diff --git a/src/apps/desktop/src/api/remote_connect_api.rs b/src/apps/desktop/src/api/remote_connect_api.rs index 5af5711792..dfaa4ef07b 100644 --- a/src/apps/desktop/src/api/remote_connect_api.rs +++ b/src/apps/desktop/src/api/remote_connect_api.rs @@ -7,6 +7,7 @@ use bitfun_core::service::remote_connect::{ }; use regex::Regex; use serde::{Deserialize, Serialize}; +use std::collections::HashMap; use std::path::PathBuf; use std::sync::{Arc, OnceLock}; use tokio::sync::RwLock; @@ -197,6 +198,7 @@ fn is_valid_mobile_web_dir(dir: &std::path::Path) -> bool { pub struct StartRemoteConnectRequest { pub method: String, pub custom_server_url: Option, + pub lan_ip: Option, } #[derive(Debug, Serialize)] @@ -228,10 +230,18 @@ pub struct DeviceInfo { pub mac_address: String, } +#[derive(Debug, Serialize)] +pub struct LanNetworkInterface { + pub interface_name: String, + pub ip: String, + pub gateway_ip: Option, +} + #[derive(Debug, Serialize)] pub struct LanNetworkInfo { pub local_ip: String, pub gateway_ip: Option, + pub available_ips: Vec, } fn detect_default_gateway_ip() -> Option { @@ -289,7 +299,100 @@ fn detect_default_gateway_ip() -> Option { None } -// ── Tauri Commands ───────────────────────────────────────────────── +/// Detect per-interface gateway IPs by parsing the system routing table. +/// +/// Returns a map keyed by interface identifier (interface name on macOS/Linux, +/// interface IP on Windows) → gateway IP. Only interfaces that have a default +/// route entry appear in the map. +fn detect_interface_gateways() -> HashMap { + let mut map = HashMap::new(); + + #[cfg(target_os = "macos")] + { + if let Ok(output) = bitfun_core::util::process_manager::create_command("netstat") + .args(["-rn", "-f", "inet"]) + .output() + { + if output.status.success() { + let stdout = String::from_utf8_lossy(&output.stdout); + // Lines look like: + // default 192.168.1.1 UGScg en0 + for line in stdout.lines() { + let parts: Vec<&str> = line.split_whitespace().collect(); + if parts.len() >= 4 && parts[0] == "default" { + let gateway = parts[1]; + let netif = parts[3]; + if is_ipv4(gateway) { + map.insert(netif.to_string(), gateway.to_string()); + } + } + } + } + } + } + + #[cfg(target_os = "linux")] + { + if let Ok(output) = bitfun_core::util::process_manager::create_command("ip") + .args(["route", "show", "default"]) + .output() + { + if output.status.success() { + let stdout = String::from_utf8_lossy(&output.stdout); + // Lines look like: + // default via 192.168.1.1 dev eth0 proto dhcp metric 100 + for line in stdout.lines() { + let parts: Vec<&str> = line.split_whitespace().collect(); + let mut via = None; + let mut dev = None; + for i in 0..parts.len() { + match parts[i] { + "via" if i + 1 < parts.len() => via = Some(parts[i + 1]), + "dev" if i + 1 < parts.len() => dev = Some(parts[i + 1]), + _ => {} + } + } + if let (Some(gw), Some(iface)) = (via, dev) { + if is_ipv4(gw) { + map.insert(iface.to_string(), gw.to_string()); + } + } + } + } + } + } + + #[cfg(target_os = "windows")] + { + if let Ok(output) = bitfun_core::util::process_manager::create_command("route") + .args(["print", "-4"]) + .output() + { + if output.status.success() { + let stdout = String::from_utf8_lossy(&output.stdout); + // Lines look like: + // 0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.2 25 + // Column 3 = gateway, column 4 = interface IP + for line in stdout.lines() { + let parts: Vec<&str> = line.split_whitespace().collect(); + if parts.len() >= 4 && parts[0] == "0.0.0.0" && parts[1] == "0.0.0.0" { + if is_ipv4(parts[2]) && is_ipv4(parts[3]) { + // Key by interface IP so it can be matched later + map.insert(parts[3].to_string(), parts[2].to_string()); + } + } + } + } + } + } + + map +} + +/// Quick check whether a string looks like an IPv4 address. +fn is_ipv4(s: &str) -> bool { + s.split('.').count() == 4 && s.split('.').all(|p| p.parse::().is_ok()) +} #[tauri::command] pub async fn remote_connect_get_device_info() -> Result { @@ -312,11 +415,33 @@ pub async fn remote_connect_get_lan_ip() -> Result { #[tauri::command] pub async fn remote_connect_get_lan_network_info() -> Result { - let local_ip = lan::get_local_ip().map_err(|e| format!("get local ip: {e}"))?; + let interfaces = lan::list_local_ips().map_err(|e| format!("list local ips: {e}"))?; + let local_ip = interfaces + .first() + .map(|e| e.ip.clone()) + .ok_or_else(|| "no local IPv4 addresses found".to_string())?; let gateway_ip = detect_default_gateway_ip(); + // Build per-interface gateway map once from the routing table. + let gateway_map = detect_interface_gateways(); + let available_ips = interfaces + .into_iter() + .map(|e| { + // Look up by interface name (macOS/Linux) or by IP (Windows). + let gw = gateway_map + .get(&e.interface_name) + .or_else(|| gateway_map.get(&e.ip)) + .cloned(); + LanNetworkInterface { + gateway_ip: gw, + interface_name: e.interface_name, + ip: e.ip, + } + }) + .collect(); Ok(LanNetworkInfo { local_ip, gateway_ip, + available_ips, }) } @@ -331,7 +456,7 @@ pub async fn remote_connect_get_methods() -> Result, S let infos = methods .into_iter() .map(|m| match m { - ConnectionMethod::Lan => ConnectionMethodInfo { + ConnectionMethod::Lan { .. } => ConnectionMethodInfo { id: "lan".into(), name: "LAN".into(), available: true, @@ -382,9 +507,12 @@ pub async fn remote_connect_get_methods() -> Result, S fn parse_connection_method( method: &str, custom_url: Option, + lan_ip: Option, ) -> Result { match method { - "lan" => Ok(ConnectionMethod::Lan), + "lan" => Ok(ConnectionMethod::Lan { + ip: lan_ip.filter(|s| !s.is_empty()), + }), "ngrok" => Ok(ConnectionMethod::Ngrok), "bitfun_server" => Ok(ConnectionMethod::BitfunServer), "custom_server" => Ok(ConnectionMethod::CustomServer { @@ -402,7 +530,8 @@ pub async fn remote_connect_start( request: StartRemoteConnectRequest, ) -> Result { ensure_service().await?; - let method = parse_connection_method(&request.method, request.custom_server_url)?; + let method = + parse_connection_method(&request.method, request.custom_server_url, request.lan_ip)?; let holder = get_service_holder(); let guard = holder.read().await; diff --git a/src/crates/assembly/core/builtin_skills/ppt-design/SKILL.md b/src/crates/assembly/core/builtin_skills/ppt-design/SKILL.md index 440c9056b0..b84787b835 100644 --- a/src/crates/assembly/core/builtin_skills/ppt-design/SKILL.md +++ b/src/crates/assembly/core/builtin_skills/ppt-design/SKILL.md @@ -163,8 +163,9 @@ DNA 与样例 → `references/design-styles.md`。 1. **假设 + 纲**:更新 `project.json` 的 `outline[]` / `slide_order`;顺带识别可能受益于图表、图示或更强视觉表达的页面,先不批量写 HTML。**若主题涉及技术方案/工程/系统/项目分析,必须在 outline 阶段就识别出哪些页是「系统组成」「处理流程」「多角色协作」「根因分析」,并标注用架构图/流程图/泳道图/因果链**(参考上方「技术方案类内容的特别触发」)。 2. **≥5 页先打样**:做 2 页视觉差异最大的 showcase,定 grammar 再批量(见 slide-decks.md)。 -3. **逐页 HTML**:封面 `slide-01`(标题/副标题/作者或日期)→ 按 outline 生成其余页;根据内容与风格自由选择图表、图示、文字、图片或混合构图,每页完整内联 CSS。写每页时一次写对,写完即止,不回头逐页复核或返工改 HTML。 -4. **改稿范围**(输入里若有 `scope`): +3. **逐页 HTML**:封面 `slide-01`(标题/副标题/作者或日期)→ 按 outline 生成其余页;根据内容与风格自由选择图表、图示、文字、图片或混合构图,每页完整内联 CSS。**写每页时一次写对**:写之前先做垂直预算心算(见「防溢出预算」),写的时候同时遵守四条 OOXML 硬约束(文字用 p/h\* 包裹、纯色无渐变、背景/边框只在 DIV、不用 background-image),写完即止。 +4. **禁止事后审计**:所有页面写完后**不得**再回头逐页 Read → Edit 返工,也不得用 Grep 批量检查约束。约束在写时遵守,不事后补救。写完最后一页后直接输出完成总结即可。 +5. **改稿范围**(输入里若有 `scope`): - `deck`:可改 outline 与任意 `slides/*.html` - `current_slide` / `slide_index`:**只改指定页**,不动其他 slide 文件 diff --git a/src/crates/assembly/core/src/agentic/tools/pipeline/state_manager.rs b/src/crates/assembly/core/src/agentic/tools/pipeline/state_manager.rs index 7fa05ab9da..1cf9c50084 100644 --- a/src/crates/assembly/core/src/agentic/tools/pipeline/state_manager.rs +++ b/src/crates/assembly/core/src/agentic/tools/pipeline/state_manager.rs @@ -161,7 +161,10 @@ impl ToolStateManager { chunks_received: *chunks_received, }, ToolExecutionState::AwaitingConfirmation { params, timeout_at } => { - let confirmation_timeout_secs = task.options.confirmation_timeout_secs.filter(|seconds| *seconds > 0); + let confirmation_timeout_secs = task + .options + .confirmation_timeout_secs + .filter(|seconds| *seconds > 0); ToolStateEventKind::AwaitingConfirmation { params: params.clone(), timeout_at: confirmation_timeout_secs.map(|_| { diff --git a/src/crates/assembly/core/src/agentic/tools/pipeline/tool_pipeline.rs b/src/crates/assembly/core/src/agentic/tools/pipeline/tool_pipeline.rs index a3baaf2449..a0efb524a6 100644 --- a/src/crates/assembly/core/src/agentic/tools/pipeline/tool_pipeline.rs +++ b/src/crates/assembly/core/src/agentic/tools/pipeline/tool_pipeline.rs @@ -28,8 +28,7 @@ use bitfun_agent_tools::{ build_user_steering_interrupted_presentation, render_tool_result_for_assistant, truncate_raw_tool_arguments_preview, truncate_tool_arguments_preview, validate_tool_execution_admission, ToolExecutionAdmissionRejection, - ToolExecutionAdmissionRequest, GET_TOOL_SPEC_TOOL_NAME, - USER_STEERING_INTERRUPTED_MESSAGE, + ToolExecutionAdmissionRequest, GET_TOOL_SPEC_TOOL_NAME, USER_STEERING_INTERRUPTED_MESSAGE, }; use bitfun_runtime_ports::RoundInjectionToolPreemption; use futures::future::join_all; diff --git a/src/crates/assembly/core/src/service/remote_connect/lan.rs b/src/crates/assembly/core/src/service/remote_connect/lan.rs index 2df68edad4..38b15f0550 100644 --- a/src/crates/assembly/core/src/service/remote_connect/lan.rs +++ b/src/crates/assembly/core/src/service/remote_connect/lan.rs @@ -3,15 +3,77 @@ //! The desktop runs a mini relay server, and the QR code points to the local IP. use anyhow::{anyhow, Result}; +use local_ip_address::list_afinet_netifas; use log::info; +use std::net::IpAddr; -/// Detect the local LAN IP address. +/// A local network interface with its IPv4 address. +#[derive(Debug, Clone)] +pub struct LocalNetworkInterface { + pub interface_name: String, + pub ip: String, +} + +/// List all local LAN IPv4 addresses, sorted by likely-usefulness. +/// +/// Private addresses (192.168.x, 10.x, 172.16-31.x) are prioritized over +/// public addresses. Loopback (127.x) and link-local (169.254.x) are excluded. +pub fn list_local_ips() -> Result> { + let interfaces = + list_afinet_netifas().map_err(|e| anyhow!("failed to list network interfaces: {e}"))?; + + let mut entries: Vec = interfaces + .into_iter() + .filter(|(_, ip)| matches!(ip, IpAddr::V4(v4) if !v4.is_loopback() && !v4.is_link_local())) + .filter_map(|(name, ip)| { + // Only keep IPv4 for LAN relay URLs. + let v4 = match ip { + IpAddr::V4(v4) => v4, + IpAddr::V6(_) => return None, + }; + // Exclude loopback (127.x) and link-local (169.254.x) as a safety net + // (is_loopback / is_link_local above already cover this, but be explicit). + if v4.is_loopback() || v4.is_link_local() { + return None; + } + Some(LocalNetworkInterface { + interface_name: name, + ip: v4.to_string(), + }) + }) + .collect(); + + // Sort: 192.168.x first, 10.x second, 172.16-31.x third, other IPv4 last. + entries.sort_by(|a, b| ip_sort_key(&a.ip).cmp(&ip_sort_key(&b.ip))); + + if entries.is_empty() { + return Err(anyhow!("no local IPv4 addresses found")); + } + Ok(entries) +} + +/// Return a sort priority for an IPv4 string. +/// Lower value = higher priority (shown first). +fn ip_sort_key(ip: &str) -> u8 { + if ip.starts_with("192.168.") { + 0 + } else if ip.starts_with("10.") { + 1 + } else if ip.starts_with("172.") { + // 172.16.0.0 – 172.31.255.255 is private; treat all 172.x as private-tier. + 2 + } else { + 3 + } +} + +/// Detect the local LAN IP address (first from the sorted list). pub fn get_local_ip() -> Result { - let ip = local_ip_address::local_ip().map_err(|e| anyhow!("failed to detect LAN IP: {e}"))?; - Ok(ip.to_string()) + let ips = list_local_ips()?; + Ok(ips[0].ip.clone()) } -/// Build the relay URL for LAN mode. +/// Build the relay URL for LAN mode, auto-detecting the local IP. pub fn build_lan_relay_url(port: u16) -> Result { let ip = get_local_ip()?; let url = format!("http://{ip}:{port}"); @@ -19,6 +81,13 @@ pub fn build_lan_relay_url(port: u16) -> Result { Ok(url) } +/// Build the relay URL for LAN mode using a user-selected IP. +pub fn build_lan_relay_url_with_ip(port: u16, ip: &str) -> Result { + let url = format!("http://{ip}:{port}"); + info!("LAN relay URL (selected): {url}"); + Ok(url) +} + #[cfg(test)] mod tests { use super::*; @@ -31,4 +100,25 @@ mod tests { assert!(!ip.is_empty()); } } + + #[test] + fn test_ip_sort_key() { + assert_eq!(ip_sort_key("192.168.1.100"), 0); + assert_eq!(ip_sort_key("10.0.0.5"), 1); + assert_eq!(ip_sort_key("172.16.0.1"), 2); + assert_eq!(ip_sort_key("8.8.8.8"), 3); + } + + #[test] + fn test_list_local_ips_sorted() { + let ips = list_local_ips(); + if let Ok(ips) = ips { + assert!(!ips.is_empty()); + // Verify sorting: first entry should have the lowest sort key. + let keys: Vec = ips.iter().map(|e| ip_sort_key(&e.ip)).collect(); + let mut sorted_keys = keys.clone(); + sorted_keys.sort(); + assert_eq!(keys, sorted_keys); + } + } } diff --git a/src/crates/assembly/core/src/service/remote_connect/mod.rs b/src/crates/assembly/core/src/service/remote_connect/mod.rs index f80a3a5c5b..2385be9576 100644 --- a/src/crates/assembly/core/src/service/remote_connect/mod.rs +++ b/src/crates/assembly/core/src/service/remote_connect/mod.rs @@ -52,7 +52,7 @@ use tokio::sync::RwLock; #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum ConnectionMethod { - Lan, + Lan { ip: Option }, Ngrok, BitfunServer, CustomServer { url: String }, @@ -259,7 +259,7 @@ impl RemoteConnectService { pub async fn available_methods(&self) -> Vec { vec![ - ConnectionMethod::Lan, + ConnectionMethod::Lan { ip: None }, ConnectionMethod::Ngrok, ConnectionMethod::BitfunServer, ConnectionMethod::CustomServer { @@ -295,11 +295,15 @@ impl RemoteConnectService { let static_dir = self.config.mobile_web_dir.as_deref(); let relay_url = match &method { - ConnectionMethod::Lan => { + ConnectionMethod::Lan { ip } => { let handle = embedded_relay::start_embedded_relay(self.config.lan_port, static_dir).await?; *self.embedded_relay.write().await = Some(handle); - match lan::build_lan_relay_url(self.config.lan_port) { + let url_result = match ip { + Some(ip) => lan::build_lan_relay_url_with_ip(self.config.lan_port, ip), + None => lan::build_lan_relay_url(self.config.lan_port), + }; + match url_result { Ok(url) => url, Err(e) => { if let Some(ref mut relay) = *self.embedded_relay.write().await { @@ -339,7 +343,7 @@ impl RemoteConnectService { let qr_payload = pairing.initiate(&relay_url).await?; let ws_url = match &method { - ConnectionMethod::Lan | ConnectionMethod::Ngrok => { + ConnectionMethod::Lan { .. } | ConnectionMethod::Ngrok => { format!("ws://127.0.0.1:{}/ws", self.config.lan_port) } _ => { @@ -363,7 +367,7 @@ impl RemoteConnectService { .await?; let web_app_url: String = match &method { - ConnectionMethod::Lan | ConnectionMethod::Ngrok => relay_url.clone(), + ConnectionMethod::Lan { .. } | ConnectionMethod::Ngrok => relay_url.clone(), ConnectionMethod::BitfunServer => { if let Some(web_dir) = static_dir { match upload_mobile_web(&relay_url, &qr_payload.room_id, web_dir).await { diff --git a/src/crates/contracts/product-domains/src/miniapp/builtin.rs b/src/crates/contracts/product-domains/src/miniapp/builtin.rs index d13f990b9d..c825a3cc53 100644 --- a/src/crates/contracts/product-domains/src/miniapp/builtin.rs +++ b/src/crates/contracts/product-domains/src/miniapp/builtin.rs @@ -161,7 +161,7 @@ pub const BUILTIN_APPS: &[BuiltinMiniAppBundle] = &[ }, BuiltinMiniAppBundle { id: "builtin-ppt-live", - version: 189, + version: 193, meta_json: include_str!("builtin/assets/ppt-live/meta.json"), html: include_str!("builtin/assets/ppt-live/index.html"), css: include_str!("builtin/assets/ppt-live/style.css"), diff --git a/src/crates/contracts/product-domains/src/miniapp/builtin/assets/ppt-live/bundle.json b/src/crates/contracts/product-domains/src/miniapp/builtin/assets/ppt-live/bundle.json index 9f67d58740..eef9a224e7 100644 --- a/src/crates/contracts/product-domains/src/miniapp/builtin/assets/ppt-live/bundle.json +++ b/src/crates/contracts/product-domains/src/miniapp/builtin/assets/ppt-live/bundle.json @@ -1,5 +1,5 @@ { "schemaVersion": 1, "id": "builtin-ppt-live", - "version": 189 + "version": 193 } diff --git a/src/crates/contracts/product-domains/src/miniapp/builtin/assets/ppt-live/dist/ui.bundle.js b/src/crates/contracts/product-domains/src/miniapp/builtin/assets/ppt-live/dist/ui.bundle.js index ecd3f4e9db..acd5b8267f 100644 --- a/src/crates/contracts/product-domains/src/miniapp/builtin/assets/ppt-live/dist/ui.bundle.js +++ b/src/crates/contracts/product-domains/src/miniapp/builtin/assets/ppt-live/dist/ui.bundle.js @@ -1,29 +1,61 @@ -var Dn=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(r,t)=>(typeof require<"u"?require:r)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Zo={"en-US":{eyebrow:"AI Deck Studio",title:"PPT Live",newDeck:"New",newTopic:"New topic",blankDeckTitle:"Untitled deck",blankDeckReady:"Blank deck ready.",clusterDraft:"Draft",clusterReview:"Review",clusterExport:"Export",generateOutline:"Outline",generateDeck:"Generate deck",preview:"Preview",exportHtml:"HTML",exportPptx:"PPTX",workflowPrompt:"Prompt",workflowGenerate:"Generate",workflowEdit:"Edit",workflowExport:"Export",slidesPanelTitle:"Slides",slidesPanelSubcopy:"Click a page to edit text directly on canvas.",agentCommandTitle:"Create or edit by prompt",agentCommandSubcopy:"Generate a deck, revise one page, edit the whole deck, insert, or delete.",briefTitle:"Brief",agentRequestTitle:"What should this deck say?",oneBoxTitle:"Describe the deck. Then keep editing by prompt.",oneBoxSubtitle:"One command box handles drafting, page edits, deck edits, insertion, and deletion.",oneBoxPlaceholder:`Generate from scratch: give the topic, audience, and rough page count, e.g. "Build a 10-page AI product strategy deck for executives". +var Dn=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(r,t)=>(typeof require<"u"?require:r)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Jo={"en-US":{eyebrow:"AI Deck Studio",title:"PPT Live",newDeck:"New",newTopic:"New topic",blankDeckTitle:"Untitled deck",blankDeckReady:"Blank deck ready.",clusterDraft:"Draft",clusterReview:"Review",clusterExport:"Export",generateOutline:"Outline",generateDeck:"Generate deck",preview:"Preview",exportHtml:"HTML",exportPptx:"PPTX",workflowPrompt:"Prompt",workflowGenerate:"Generate",workflowEdit:"Edit",workflowExport:"Export",slidesPanelTitle:"Slides",slidesPanelSubcopy:"Click a page to edit text directly on canvas.",agentCommandTitle:"Create or edit by prompt",agentCommandSubcopy:"Generate a deck, revise one page, edit the whole deck, insert, or delete.",briefTitle:"Brief",agentRequestTitle:"What should this deck say?",oneBoxTitle:"Describe the deck. Then keep editing by prompt.",oneBoxSubtitle:"One command box handles drafting, page edits, deck edits, insertion, and deletion.",oneBoxPlaceholder:`Generate from scratch: give the topic, audience, and rough page count, e.g. "Build a 10-page AI product strategy deck for executives". Edit: name the page and the change, e.g. "Turn page 3 into a data comparison page". -Incremental: add new information, e.g. "Add a competitor analysis section after page 4".`,sendPrompt:"Send",promptRequired:"Type what you want PPT Live to do.",topicLabel:"Goal",topicPlaceholder:"Describe the deck you want. Mention page count or URLs only when you need them.",audienceLabel:"Audience",audiencePlaceholder:"Executives, customers, students...",slidesLabel:"Slides",deckTypeLabel:"Deck type",deckTypeStrategy:"Strategy",deckTypeSales:"Sales pitch",deckTypeReport:"Business report",deckTypeTeaching:"Teaching",deckTypeFundraising:"Fundraising",toneLabel:"Tone",toneExecutive:"Executive",toneConcise:"Concise",tonePersuasive:"Persuasive",toneEducational:"Educational",materialLabel:"Source material",materialPlaceholder:"Paste notes, article excerpts, data points, meeting notes, or rough slide requirements.",advancedBrief:"Optional context",processTitle:"Generation process",processSubcopy:"Track the current deck build at a glance.",historyTitle:"History",historySubcopy:"Restore a deck session and continue editing.",historyEmpty:"Generated decks and edits will appear here.",historyMeta:"{{count}} slides \xB7 {{time}}",historyRestored:"Deck session restored.",stopGeneration:"Stop",generationStopped:"Generation stopped. Kept the current view.",generationTimedOut:"Generation took too long, so PPT Live stopped this run.",generationDraftReady:"Preparing the final slides\u2026",generationAgentWorking:"Building your presentation\u2026",backendGenerationFailed:"Generation did not finish. Please retry, or stop and start a new topic.",backendGenerationFailedWithReason:"Generation did not finish: {{reason}}",generationRoundBudgetFailed:"Generation ran out of steps before the deck was ready.",generationRoundBudgetHint:"Try a shorter prompt, fewer pages, or remove extra reference links, then send again.",generationRetrying:"Generation hit an error; retrying automatically ({{attempt}}/{{max}})\u2026",generationRetryAttempt:"Retry attempt {{attempt}}/{{max}}.",generationRecoveryContinuing:"{{stage}} is still in progress; continuing ({{attempt}}/{{max}})\u2026",generationRecoveryExhausted:"{{stage}} did not finish after {{retries}} attempts.",generationRecoveryFailureDetail:"Reason: {{reason}}",generationStagePlanning:"Planning",generationStageSlide:"Slide {{slide}}",generationStageAudit:"Final review",generationStageBriefs:"Slides {{start}}-{{end}}",agentOnlyRetryHint:"Check your connection and try again in a moment.",generationPlanPhase:"Planning your deck\u2026",generationPlanningSlides:"Planning slide content\u2026",generationPlanProgress:"Planned {{count}} slides so far\u2026",generationPlanReady:"{{count}} slides planned.",generationOutlineReady:"Outline ready: {{count}} slides. Writing briefs\u2026",generationBriefsBatchReady:"Briefs done for slides {{start}}-{{end}} ({{total}} total).",generationBriefsRetry:"Briefs for slides {{start}}-{{end}} issue; retrying ({{attempt}}/{{max}})\u2026",generationPlanRetry:"Planning issue; retrying ({{attempt}}/{{max}})\u2026",generationAuditRetry:"Review incomplete; retrying ({{attempt}}/{{max}})\u2026",generationSlidesPhase:"Generating {{count}} slides\u2026",generationAuditPhase:"Reviewing the full deck\u2026",generationRenderingSlide:"Generating slide {{slide}}/{{total}}\u2026",generationSlideReady:"Slide {{slide}}/{{total}} done.",generationSlideRetry:"Slide {{slide}} issue; retrying ({{attempt}}/{{max}})\u2026",generationSlideRepair:"Slide {{slide}} needs adjustment; retrying ({{attempt}}/{{max}})\u2026",generationResumeFrom:"Resuming from slide {{slide}} \u2014 finished slides are kept.",generationPartialDeck:"Slides {{missing}} did not finish. The finished slides are kept \u2014 send a follow-up prompt to fill the missing pages.",agentWorkingTitle:"Building your deck",agentWorkingKicker:"In progress",agentWorkingClaim:"Your slides will appear in the canvas when generation finishes.",agentWorkingProof:"Progress",agentWorkingDetail:"This is a live preview area while your deck is being created.",agentWorkingSourceNote:"Content is generated from your prompt.",agentWorkingMetric:"Live",agentWorkingMetricLabel:"Waiting for slides",processEventStarted:"Generation started.",processEventWaiting:"Getting ready\u2026",processEventRound:"Organizing structure and copy.",processEventTool:"Reading sources and applying design rules.",processEventText:"Drafting slide layouts.",processEventDone:"Deck received.",generationParsingDeck:"Organizing slides\u2026",processWaitingForEventsTitle:"Ready to generate",processWaitingForEvents:"Send a prompt to start. Progress will show up here.",agentStreamTitle:"Agent stream",agentStreamAssistant:"Assistant",processEventUnknown:"Update",eventTurnStarted:"Generation started",eventTurnFailed:"Generation failed",eventTurnCancelled:"Generation cancelled",eventRoundCompleted:"Step completed",eventThinkingChunk:"Thinking stream",eventTokenUsage:"Token usage updated",eventUnknownTool:"tool",eventToolDetected:"Detected tool",eventToolParams:"Reading tool input",eventToolQueued:"Queued tool",eventToolWaiting:"Waiting for tool",eventToolStarted:"Started tool",eventToolProgress:"Tool progress",eventToolStreaming:"Tool streaming",eventToolStreamChunk:"Tool output chunk",eventToolConfirmation:"Tool needs confirmation",eventToolConfirmed:"Tool confirmed",eventToolRejected:"Tool rejected",eventToolCompleted:"Completed tool",eventToolFailed:"Tool failed",eventToolCancelled:"Tool cancelled",eventToolQueuePosition:"queue",eventToolSkillName:"PPT design skill",eventToolWebSearchName:"Web search",eventToolWebFetchName:"Web page fetch",eventToolSkillReady:"Design guidelines ready",eventToolWebSearchDone:"Searched for reference material",eventToolWebFetchDone:"Read reference pages",eventToolTaskStarted:"Running a research subtask\u2026",eventToolTaskDone:"Research subtask finished",eventSubagentStarted:"Started a background research subtask",eventSubagentWorking:"Background research in progress\u2026",eventSubagentDone:"Background research finished",eventSubagentFailed:"Background research did not finish",eventSubagentWebSearchDone:"Subtask searched for reference material",eventSubagentWebFetchDone:"Subtask read reference pages",eventToolFailedUser:"A step did not finish",generationProgressPulse:"Still generating\u2026",generationPageProgress:"Generating page {{current}}",generationSlideProgress:"{{count}} slides generated",generationStepBrief:"Assumptions",generationStepBriefDetail:"Read the prompt and plan the deck.",generationStepSpine:"Outline",generationStepSpineDetail:"Create assertion-led slide titles from the request.",generationStepProof:"Slide copy",generationStepProofDetail:"Ground each page in source facts or clear assumptions.",generationStepDesign:"Visual design",generationStepDesignDetail:"Apply theme, layout, and visual hierarchy.",generationStepCompile:"Load slides",generationStepCompileDetail:"Load the generated deck into the editor.",generationReadingBrief:"Reading your prompt...",generationWritingClaims:"Building the outline...",generationChoosingProof:"Writing slide copy...",generationDesigningLayouts:"Designing slide layouts...",generationCompiled:"Your deck is ready.",generationSpineReady:"Claim spine ready.",generationLocalSpine:"Generation is unavailable. Please try again later.",generationLocalCompiler:"Generation is unavailable. Please try again later.",agentPlanning:"Planning the deck task...",agentPlanningFallback:"Planning is unavailable. Please try again.",outlineTitle:"Outline",outlineSubcopy:"Review the story spine before the deck is composed.",addOutlineItem:"Add outline item",syncOutline:"Sync slides from outline",modeEdit:"Edit",modeSort:"Sort",modePresent:"Present",inspectorTitle:"Inspector",addText:"Text",addList:"List",addShape:"Shape",addMetric:"Metric",addChart:"Chart",addMedia:"Media",addSlide:"Add slide",deleteSlide:"Delete slide",deleteElement:"Delete element",aiTitle:"AI design",aiSubcopy:"Prompt the agent to revise one page, the whole deck, or add a page.",instructionPlaceholder:"Example: make this page more visual, add a competition page, rewrite the whole deck for investors, or delete repetition.",reviseSlide:"Revise this page",reviseDeck:"Revise all",insertSlide:"Insert page",aiRewrite:"Rewrite",aiCondense:"Condense",aiProfessional:"Professional",aiMoreVisual:"More visual",aiNotes:"Speaker notes",aiRedesign:"Redesign slide",aiRestyleDeck:"Restyle deck",styleTitle:"Style",themeLabel:"Theme",themeExecutive:"Executive",themeMarket:"Market",themeMinimal:"Minimal",themeStudio:"Studio",densityLabel:"Density",densityCompact:"Compact",densityStandard:"Standard",densitySpacious:"Spacious",brandPrimaryLabel:"Primary",brandAccentLabel:"Accent",imagePolicyLabel:"Image policy",imagePolicyPlaceholders:"Editable placeholders",imagePolicyNone:"No images",ready:"Ready.",statusPillReady:"Ready",statusPillBusy:"AI",exportReady:"HTML and PPTX export ready after generation.",working:"Working with AI...",outlineReady:"Outline ready. Edit it, then generate the designed deck.",deckReady:"Designed deck generated.",aiUnavailable:"Generation is unavailable right now. Please try again later.",sourceGroundingRequired:"Source could not be verified. Generated a verification-first deck instead of inventing facts.",saved:"Saved.",slideUpdated:"Slide updated.",deckUpdated:"Deck updated.",slideInserted:"Page inserted.",deckRestyled:"Deck restyled.",cannotDelete:"Keep at least one slide.",noSelection:"Select a slide object to edit its content and layout.",elementTypeLabel:"Type",elementTextLabel:"Text",elementItemsLabel:"Items",elementDataLabel:"Chart data",geometryLabel:"Geometry",styleLabel:"Style",speakerNotesLabel:"Speaker notes",kickerLabel:"Kicker",claimLabel:"Claim",proofObjectLabel:"Proof object",supportNoteLabel:"Support note",sourceNoteLabel:"Source note",newSlideTitle:"New slide",defaultDeckTitle:"AI Product Strategy",slidesMeta:"{{count}} slides",exportHtmlDone:"HTML deck downloaded.",exportHtmlWorking:"Exporting HTML...",exportHtmlFailed:"HTML export failed:",exportSavedTo:"Exported to {{path}}",exportPptxWorking:"Rendering editable PPTX...",exportPptxDone:"Editable PPTX downloaded.",exportPptxFailed:"PPTX export failed:",exportPdfWorking:"Rendering PDF...",exportPdfDone:"PDF downloaded.",exportPdfFailed:"PDF export failed:",exportPngWorking:"Rendering PNG slides...",exportPngDone:"PNG slide archive downloaded.",exportPngFailed:"PNG export failed:",exportDeckEmpty:"Generate slides before exporting.",slidesEmptyHint:"Slides appear here after generation.",welcomeTitle:"Describe your deck to get started",welcomeSubcopy:"One prompt creates the outline, designed slides, and an editable deck you can refine page by page.",welcomeTip1:"10-page strategy deck",welcomeTip2:"Investor pitch rewrite",welcomeTip3:"Make this page more visual",deleteSlideDefaultPrompt:"Delete the current slide and keep the deck coherent.",prev:"Previous",next:"Next",assistantHello:"Describe the deck you need. I will build an outline first, then turn it into editable slides.",aiChatApplied:"I applied the instruction to the current slide.",localMetricLabel:"signal to remember",mediaPlaceholder:"Image placeholder",slidesUnit:"slides",closeConfirm:"Confirm the direction",closeOwner:"Choose the owner",closeIteration:"Start the next iteration",pointClaimPrefix:"Claim:",pointProofPrefix:"Proof object:",pointAudiencePrefix:"Audience relevance:",pointEvidenceRule:"Evidence rule: mark assumptions clearly",pointDesignRule:"Design rule: one visual plus one support rail",pointCloseRule:"Close: name the next action",claimCover:"{{topic}} needs a clear decision narrative, not another collection of slides.",claimPressure:"{{title}} is the pressure point the audience must resolve.",claimDecision:"{{title}} changes the decision because it connects evidence to action.",claimProof:"{{title}} becomes credible when the proof object carries the argument.",claimAction:"{{title}} should end with one named decision, owner, or next move.",supportWithSource:"Use the supplied source material to substantiate this claim; make the {{proof}} the dominant evidence.",supportWithAssumption:"Add one concrete example or metric so the {{proof}} can support the claim without filler.",sourceUserMaterial:"Source: user-provided material",sourceDraftAssumption:"Source: draft assumption; verify before external use",defaultSpeakerNote:'Open with the conclusion for "{{title}}", then support it with one concrete example.',proofMarketMap:"market map",proofOperatingModel:"operating model",proofRiskBridge:"risk bridge",proofDecisionTable:"decision table",proofBeforeAfter:"before/after workflow",proofValueBridge:"value bridge",proofCustomerProof:"customer proof",proofImplementationPlan:"implementation plan",proofMetricBridge:"metric bridge",proofTrendChart:"trend chart",proofSourceSummary:"source summary",proofVerificationPlan:"verification plan",proofCapabilityMatrix:"capability matrix",proofEvidenceList:"evidence list",proofVarianceTable:"variance table",proofRiskRegister:"risk register",proofConceptMap:"concept map",proofWorkedExample:"worked example",proofComparison:"comparison",proofPracticePrompt:"practice prompt",proofMarketWedge:"market wedge",proofProductDiagram:"product diagram",proofTractionChart:"traction chart",proofMilestonePlan:"milestone plan",proofVisualProof:"visual proof",sourceFetchedNote:"Sources: {{count}} fetched URL(s)",bpContextTitle:"{{topic}} must be grounded in source facts before claims are made.",bpSourceNeededTitle:"{{topic}} needs source material before factual claims can be made.",bpProblemTitle:"The current question is what the audience can safely believe.",bpSolutionTitle:"{{topic}} should be explained through capabilities, workflow, and evidence.",bpWorkflowTitle:"The workflow shows how the product creates value step by step.",bpProofTitle:"Source-backed evidence should carry the credibility of the deck.",bpVerificationTitle:"Verification gaps must be visible instead of hidden behind fake charts.",bpRiskTitle:"The main risk is overclaiming beyond the available source material.",bpDecisionTitle:"The next step is to verify the claims and choose the strongest story path.",bpSupportSource:"Built from fetched or pasted source material; verify exact wording before external use.",bpSupportMissing:"Source material is insufficient; keep this slide as a verification prompt.",bpMissingFact1:"Paste source notes, a README, metrics, or product description to ground this slide.",bpMissingFact2:"Do not use invented metrics; replace placeholders with verified evidence.",bpMissingFact3:"Use this page to decide what needs to be researched next.",qualityOutOfBounds:"An element extends outside the slide safe area.",qualityTextDense:"Visible text may be too dense for this layout.",qualityChartUngrounded:"Chart data was removed or flagged because it is not grounded in source numbers.",qualityOverlap:"Text or chart elements may overlap.",qualityMissingClaim:"This slide needs one clear claim.",qualityReportTitle:"Quality report",qualityNeedsReview:"Review required",qualityHasWarnings:"Quality warning",exportFormatUnavailable:"This export format is not available yet.",exportTitle:"Export",exportCancel:"Cancel",exportConfirm:"Export file",exportPreviewPrevAria:"Previous slide",exportPreviewNextAria:"Next slide",exportFormat:"Format",exportQuality:"Quality",exportDpi:"Image DPI",exportRange:"Slide range",exportShare:"Share",propertiesStyle:"Style",propertiesLayout:"Layout",propertiesAnimation:"Animation",propertiesThemeColor:"Theme color",propertiesFont:"Font",propertiesColorMode:"Slide colors",propertiesStylePreset:"Style preset",colorModeLight:"Light",colorModeDark:"Dark",fontSansSerif:"Sans-serif",fontSerif:"Serif",propertiesDensity:"Density",propertiesSmartAlign:"Smart align",propertiesPageTransition:"Page transition",propertiesElementAnimation:"Element animation",densityLoose:"Loose"},"zh-CN":{eyebrow:"AI \u6F14\u793A\u5DE5\u574A",title:"PPT Live",newDeck:"\u65B0\u5EFA",newTopic:"\u65B0\u4E3B\u9898",blankDeckTitle:"\u672A\u547D\u540D PPT",blankDeckReady:"\u7A7A\u767D PPT \u5DF2\u5C31\u7EEA\u3002",clusterDraft:"\u521B\u4F5C",clusterReview:"\u5BA1\u9605",clusterExport:"\u4EA4\u4ED8",generateOutline:"\u751F\u6210\u5927\u7EB2",generateDeck:"\u751F\u6210\u6574\u5957",preview:"\u6F14\u793A\u9884\u89C8",exportHtml:"\u5BFC\u51FA HTML",exportPptx:"\u5BFC\u51FA PPTX",workflowPrompt:"\u8F93\u5165",workflowGenerate:"\u751F\u6210",workflowEdit:"\u7F16\u8F91",workflowExport:"\u5BFC\u51FA",slidesPanelTitle:"\u9875\u9762",slidesPanelSubcopy:"\u70B9\u51FB\u9875\u9762\u540E\uFF0C\u53EF\u76F4\u63A5\u5728\u753B\u5E03\u4E0A\u6539\u6587\u5B57\u3002",agentCommandTitle:"\u7528 Prompt \u751F\u6210\u6216\u4FEE\u6539",agentCommandSubcopy:"\u751F\u6210\u6574\u5957 PPT\u3001\u4FEE\u6539\u5355\u9875\u3001\u5168\u5C40\u6539\u5199\u3001\u63D2\u5165\u6216\u5220\u9664\u9875\u9762\u3002",briefTitle:"\u521B\u4F5C\u7B80\u62A5",agentRequestTitle:"\u4F60\u60F3\u505A\u4E00\u4EFD\u4EC0\u4E48 PPT\uFF1F",oneBoxTitle:"\u63CF\u8FF0 PPT\uFF0C\u7136\u540E\u7EE7\u7EED\u7528 Prompt \u4FEE\u6539",oneBoxSubtitle:"\u9996\u7A3F\u3001\u6539\u5355\u9875\u3001\u6539\u6574\u5957\u3001\u63D2\u5165\u548C\u5220\u9664\uFF0C\u90FD\u7531\u8FD9\u4E00\u4E2A\u8F93\u5165\u6846\u5904\u7406\u3002",oneBoxPlaceholder:`0-1 \u751F\u6210\uFF1A\u5199\u6E05\u4E3B\u9898\u3001\u53D7\u4F17\u548C\u5927\u81F4\u9875\u6570\uFF0C\u4F8B\u5982\u201C\u4E3A\u9AD8\u7BA1\u505A\u4E00\u4EFD 10 \u9875\u7684 AI \u4EA7\u54C1\u6218\u7565 PPT\u201D\u3002 +Incremental: add new information, e.g. "Add a competitor analysis section after page 4".`,sendPrompt:"Send",promptRequired:"Type what you want PPT Live to do.",topicLabel:"Goal",topicPlaceholder:"Describe the deck you want. Mention page count or URLs only when you need them.",audienceLabel:"Audience",audiencePlaceholder:"Executives, customers, students...",slidesLabel:"Slides",deckTypeLabel:"Deck type",deckTypeStrategy:"Strategy",deckTypeSales:"Sales pitch",deckTypeReport:"Business report",deckTypeTeaching:"Teaching",deckTypeFundraising:"Fundraising",toneLabel:"Tone",toneExecutive:"Executive",toneConcise:"Concise",tonePersuasive:"Persuasive",toneEducational:"Educational",materialLabel:"Source material",materialPlaceholder:"Paste notes, article excerpts, data points, meeting notes, or rough slide requirements.",advancedBrief:"Optional context",processTitle:"Generation process",processSubcopy:"Track the current deck build at a glance.",historyTitle:"History",historySubcopy:"Restore a deck session and continue editing.",historyEmpty:"Generated decks and edits will appear here.",historyMeta:"{{count}} slides \xB7 {{time}}",historyRestored:"Deck session restored.",stopGeneration:"Stop",generationStopped:"Generation stopped. Kept the current view.",generationTimedOut:"Generation took too long, so PPT Live stopped this run.",generationDraftReady:"Preparing the final slides\u2026",generationAgentWorking:"Building your presentation\u2026",backendGenerationFailed:"Generation did not finish. Please retry, or stop and start a new topic.",backendGenerationFailedWithReason:"Generation did not finish: {{reason}}",generationRoundBudgetFailed:"Generation ran out of steps before the deck was ready.",generationRoundBudgetHint:"Try a shorter prompt, fewer pages, or remove extra reference links, then send again.",generationRetrying:"Generation hit an error; retrying automatically ({{attempt}}/{{max}})\u2026",generationRetryAttempt:"Retry attempt {{attempt}}/{{max}}.",generationRecoveryContinuing:"{{stage}} is still in progress; continuing ({{attempt}}/{{max}})\u2026",generationRecoveryExhausted:"{{stage}} did not finish after {{retries}} attempts.",generationRecoveryFailureDetail:"Reason: {{reason}}",generationStagePlanning:"Planning",generationStageSlide:"Slide {{slide}}",generationStageAudit:"Final review",generationStageBriefs:"Slides {{start}}-{{end}}",agentOnlyRetryHint:"Check your connection and try again in a moment.",generationPlanPhase:"Planning your deck\u2026",generationPlanningSlides:"Planning slide content\u2026",generationPlanProgress:"Planned {{count}} slides so far\u2026",generationPlanReady:"{{count}} slides planned.",generationOutlineReady:"Outline ready: {{count}} slides. Writing briefs\u2026",generationBriefsBatchReady:"Briefs done for slides {{start}}-{{end}} ({{total}} total).",generationBriefsRetry:"Briefs for slides {{start}}-{{end}} issue; retrying ({{attempt}}/{{max}})\u2026",generationPlanRetry:"Planning issue; retrying ({{attempt}}/{{max}})\u2026",generationAuditRetry:"Review incomplete; retrying ({{attempt}}/{{max}})\u2026",generationSlidesPhase:"Generating {{count}} slides\u2026",generationAuditPhase:"Reviewing the full deck\u2026",generationRenderingSlide:"Generating slide {{slide}}/{{total}}\u2026",generationSlideReady:"Slide {{slide}}/{{total}} done.",generationSlideRetry:"Slide {{slide}} issue; retrying ({{attempt}}/{{max}})\u2026",generationSlideRepair:"Slide {{slide}} needs adjustment; retrying ({{attempt}}/{{max}})\u2026",generationResumeFrom:"Resuming from slide {{slide}} \u2014 finished slides are kept.",generationPartialDeck:"Slides {{missing}} did not finish. The finished slides are kept \u2014 send a follow-up prompt to fill the missing pages.",agentWorkingTitle:"Building your deck",agentWorkingKicker:"In progress",agentWorkingClaim:"Your slides will appear in the canvas when generation finishes.",agentWorkingProof:"Progress",agentWorkingDetail:"This is a live preview area while your deck is being created.",agentWorkingSourceNote:"Content is generated from your prompt.",agentWorkingMetric:"Live",agentWorkingMetricLabel:"Waiting for slides",processEventStarted:"Generation started.",processEventWaiting:"Getting ready\u2026",processEventRound:"Organizing structure and copy.",processEventTool:"Reading sources and applying design rules.",processEventText:"Drafting slide layouts.",processEventDone:"Deck received.",generationParsingDeck:"Organizing slides\u2026",processWaitingForEventsTitle:"Ready to generate",processWaitingForEvents:"Send a prompt to start. Progress will show up here.",agentStreamTitle:"Agent stream",agentStreamAssistant:"Assistant",processEventUnknown:"Update",eventTurnStarted:"Generation started",eventTurnFailed:"Generation failed",eventTurnCancelled:"Generation cancelled",eventRoundCompleted:"Step completed",eventThinkingChunk:"Thinking stream",eventTokenUsage:"Token usage updated",eventUnknownTool:"tool",eventToolDetected:"Detected tool",eventToolParams:"Reading tool input",eventToolQueued:"Queued tool",eventToolWaiting:"Waiting for tool",eventToolStarted:"Started tool",eventToolProgress:"Tool progress",eventToolStreaming:"Tool streaming",eventToolStreamChunk:"Tool output chunk",eventToolConfirmation:"Tool needs confirmation",eventToolConfirmed:"Tool confirmed",eventToolRejected:"Tool rejected",eventToolCompleted:"Completed tool",eventToolFailed:"Tool failed",eventToolCancelled:"Tool cancelled",eventToolQueuePosition:"queue",eventToolSkillName:"PPT design skill",eventToolWebSearchName:"Web search",eventToolWebFetchName:"Web page fetch",eventToolReadName:"Read",eventToolWriteName:"Write",eventToolEditName:"Edit",eventToolTaskName:"Subtask",eventToolSkillReady:"Design guidelines ready",eventToolWebSearchDone:"Searched for reference material",eventToolWebFetchDone:"Read reference pages",eventToolTaskStarted:"Running a research subtask\u2026",eventToolTaskDone:"Research subtask finished",eventSubagentStarted:"Started a background research subtask",eventSubagentWorking:"Background research in progress\u2026",eventSubagentDone:"Background research finished",eventSubagentFailed:"Background research did not finish",eventSubagentWebSearchDone:"Subtask searched for reference material",eventSubagentWebFetchDone:"Subtask read reference pages",eventToolFailedUser:"A step did not finish",generationProgressPulse:"Still generating\u2026",generationPageProgress:"Generating page {{current}}",generationSlideProgress:"{{count}} slides generated",generationStepBrief:"Assumptions",generationStepBriefDetail:"Read the prompt and plan the deck.",generationStepSpine:"Outline",generationStepSpineDetail:"Create assertion-led slide titles from the request.",generationStepProof:"Slide copy",generationStepProofDetail:"Ground each page in source facts or clear assumptions.",generationStepDesign:"Visual design",generationStepDesignDetail:"Apply theme, layout, and visual hierarchy.",generationStepCompile:"Load slides",generationStepCompileDetail:"Load the generated deck into the editor.",generationReadingBrief:"Reading your prompt...",generationWritingClaims:"Building the outline...",generationChoosingProof:"Writing slide copy...",generationDesigningLayouts:"Designing slide layouts...",generationCompiled:"Your deck is ready.",generationSpineReady:"Claim spine ready.",generationLocalSpine:"Generation is unavailable. Please try again later.",generationLocalCompiler:"Generation is unavailable. Please try again later.",agentPlanning:"Planning the deck task...",agentPlanningFallback:"Planning is unavailable. Please try again.",outlineTitle:"Outline",outlineSubcopy:"Review the story spine before the deck is composed.",addOutlineItem:"Add outline item",syncOutline:"Sync slides from outline",modeEdit:"Edit",modeSort:"Sort",modePresent:"Present",inspectorTitle:"Inspector",addText:"Text",addList:"List",addShape:"Shape",addMetric:"Metric",addChart:"Chart",addMedia:"Media",addSlide:"Add slide",deleteSlide:"Delete slide",deleteElement:"Delete element",aiTitle:"AI design",aiSubcopy:"Prompt the agent to revise one page, the whole deck, or add a page.",instructionPlaceholder:"Example: make this page more visual, add a competition page, rewrite the whole deck for investors, or delete repetition.",reviseSlide:"Revise this page",reviseDeck:"Revise all",insertSlide:"Insert page",aiRewrite:"Rewrite",aiCondense:"Condense",aiProfessional:"Professional",aiMoreVisual:"More visual",aiNotes:"Speaker notes",aiRedesign:"Redesign slide",aiRestyleDeck:"Restyle deck",styleTitle:"Style",themeLabel:"Theme",themeExecutive:"Executive",themeMarket:"Market",themeMinimal:"Minimal",themeStudio:"Studio",densityLabel:"Density",densityCompact:"Compact",densityStandard:"Standard",densitySpacious:"Spacious",brandPrimaryLabel:"Primary",brandAccentLabel:"Accent",imagePolicyLabel:"Image policy",imagePolicyPlaceholders:"Editable placeholders",imagePolicyNone:"No images",ready:"Ready.",statusPillReady:"Ready",statusPillBusy:"AI",exportReady:"HTML and PPTX export ready after generation.",working:"Working with AI...",outlineReady:"Outline ready. Edit it, then generate the designed deck.",deckReady:"Designed deck generated.",aiUnavailable:"Generation is unavailable right now. Please try again later.",sourceGroundingRequired:"Source could not be verified. Generated a verification-first deck instead of inventing facts.",saved:"Saved.",slideUpdated:"Slide updated.",deckUpdated:"Deck updated.",slideInserted:"Page inserted.",deckRestyled:"Deck restyled.",cannotDelete:"Keep at least one slide.",noSelection:"Select a slide object to edit its content and layout.",elementTypeLabel:"Type",elementTextLabel:"Text",elementItemsLabel:"Items",elementDataLabel:"Chart data",geometryLabel:"Geometry",styleLabel:"Style",speakerNotesLabel:"Speaker notes",kickerLabel:"Kicker",claimLabel:"Claim",proofObjectLabel:"Proof object",supportNoteLabel:"Support note",sourceNoteLabel:"Source note",newSlideTitle:"New slide",defaultDeckTitle:"AI Product Strategy",slidesMeta:"{{count}} slides",exportHtmlDone:"HTML deck downloaded.",exportHtmlWorking:"Exporting HTML...",exportHtmlFailed:"HTML export failed:",exportSavedTo:"Exported to Downloads folder: {{path}}",exportPptxWorking:"Rendering editable PPTX...",exportPptxDone:"Editable PPTX downloaded.",exportPptxFailed:"PPTX export failed:",exportPdfWorking:"Rendering PDF...",exportPdfDone:"PDF downloaded.",exportPdfFailed:"PDF export failed:",exportPngWorking:"Rendering PNG slides...",exportPngDone:"PNG slide archive downloaded.",exportPngFailed:"PNG export failed:",exportDeckEmpty:"Generate slides before exporting.",slidesEmptyHint:"Slides appear here after generation.",welcomeTitle:"Describe your deck to get started",welcomeSubcopy:"One prompt creates the outline, designed slides, and an editable deck you can refine page by page.",welcomeTip1:"10-page strategy deck",welcomeTip2:"Investor pitch rewrite",welcomeTip3:"Make this page more visual",deleteSlideDefaultPrompt:"Delete the current slide and keep the deck coherent.",prev:"Previous",next:"Next",assistantHello:"Describe the deck you need. I will build an outline first, then turn it into editable slides.",aiChatApplied:"I applied the instruction to the current slide.",localMetricLabel:"signal to remember",mediaPlaceholder:"Image placeholder",slidesUnit:"slides",closeConfirm:"Confirm the direction",closeOwner:"Choose the owner",closeIteration:"Start the next iteration",pointClaimPrefix:"Claim:",pointProofPrefix:"Proof object:",pointAudiencePrefix:"Audience relevance:",pointEvidenceRule:"Evidence rule: mark assumptions clearly",pointDesignRule:"Design rule: one visual plus one support rail",pointCloseRule:"Close: name the next action",claimCover:"{{topic}} needs a clear decision narrative, not another collection of slides.",claimPressure:"{{title}} is the pressure point the audience must resolve.",claimDecision:"{{title}} changes the decision because it connects evidence to action.",claimProof:"{{title}} becomes credible when the proof object carries the argument.",claimAction:"{{title}} should end with one named decision, owner, or next move.",supportWithSource:"Use the supplied source material to substantiate this claim; make the {{proof}} the dominant evidence.",supportWithAssumption:"Add one concrete example or metric so the {{proof}} can support the claim without filler.",sourceUserMaterial:"Source: user-provided material",sourceDraftAssumption:"Source: draft assumption; verify before external use",defaultSpeakerNote:'Open with the conclusion for "{{title}}", then support it with one concrete example.',proofMarketMap:"market map",proofOperatingModel:"operating model",proofRiskBridge:"risk bridge",proofDecisionTable:"decision table",proofBeforeAfter:"before/after workflow",proofValueBridge:"value bridge",proofCustomerProof:"customer proof",proofImplementationPlan:"implementation plan",proofMetricBridge:"metric bridge",proofTrendChart:"trend chart",proofSourceSummary:"source summary",proofVerificationPlan:"verification plan",proofCapabilityMatrix:"capability matrix",proofEvidenceList:"evidence list",proofVarianceTable:"variance table",proofRiskRegister:"risk register",proofConceptMap:"concept map",proofWorkedExample:"worked example",proofComparison:"comparison",proofPracticePrompt:"practice prompt",proofMarketWedge:"market wedge",proofProductDiagram:"product diagram",proofTractionChart:"traction chart",proofMilestonePlan:"milestone plan",proofVisualProof:"visual proof",sourceFetchedNote:"Sources: {{count}} fetched URL(s)",bpContextTitle:"{{topic}} must be grounded in source facts before claims are made.",bpSourceNeededTitle:"{{topic}} needs source material before factual claims can be made.",bpProblemTitle:"The current question is what the audience can safely believe.",bpSolutionTitle:"{{topic}} should be explained through capabilities, workflow, and evidence.",bpWorkflowTitle:"The workflow shows how the product creates value step by step.",bpProofTitle:"Source-backed evidence should carry the credibility of the deck.",bpVerificationTitle:"Verification gaps must be visible instead of hidden behind fake charts.",bpRiskTitle:"The main risk is overclaiming beyond the available source material.",bpDecisionTitle:"The next step is to verify the claims and choose the strongest story path.",bpSupportSource:"Built from fetched or pasted source material; verify exact wording before external use.",bpSupportMissing:"Source material is insufficient; keep this slide as a verification prompt.",bpMissingFact1:"Paste source notes, a README, metrics, or product description to ground this slide.",bpMissingFact2:"Do not use invented metrics; replace placeholders with verified evidence.",bpMissingFact3:"Use this page to decide what needs to be researched next.",qualityOutOfBounds:"An element extends outside the slide safe area.",qualityTextDense:"Visible text may be too dense for this layout.",qualityChartUngrounded:"Chart data was removed or flagged because it is not grounded in source numbers.",qualityOverlap:"Text or chart elements may overlap.",qualityMissingClaim:"This slide needs one clear claim.",qualityReportTitle:"Quality report",qualityNeedsReview:"Review required",qualityHasWarnings:"Quality warning",exportFormatUnavailable:"This export format is not available yet.",exportTitle:"Export",exportCancel:"Cancel",exportConfirm:"Export file",exportPreviewPrevAria:"Previous slide",exportPreviewNextAria:"Next slide",exportFormat:"Format",exportQuality:"Quality",exportDpi:"Image DPI",exportRange:"Slide range",exportShare:"Share",propertiesStyle:"Style",propertiesLayout:"Layout",propertiesAnimation:"Animation",propertiesThemeColor:"Theme color",propertiesFont:"Font",propertiesColorMode:"Slide colors",propertiesStylePreset:"Style preset",colorModeLight:"Light",colorModeDark:"Dark",fontSansSerif:"Sans-serif",fontSerif:"Serif",propertiesDensity:"Density",propertiesSmartAlign:"Smart align",propertiesPageTransition:"Page transition",propertiesElementAnimation:"Element animation",densityLoose:"Loose"},"zh-CN":{eyebrow:"AI \u6F14\u793A\u5DE5\u574A",title:"PPT Live",newDeck:"\u65B0\u5EFA",newTopic:"\u65B0\u4E3B\u9898",blankDeckTitle:"\u672A\u547D\u540D PPT",blankDeckReady:"\u7A7A\u767D PPT \u5DF2\u5C31\u7EEA\u3002",clusterDraft:"\u521B\u4F5C",clusterReview:"\u5BA1\u9605",clusterExport:"\u4EA4\u4ED8",generateOutline:"\u751F\u6210\u5927\u7EB2",generateDeck:"\u751F\u6210\u6574\u5957",preview:"\u6F14\u793A\u9884\u89C8",exportHtml:"\u5BFC\u51FA HTML",exportPptx:"\u5BFC\u51FA PPTX",workflowPrompt:"\u8F93\u5165",workflowGenerate:"\u751F\u6210",workflowEdit:"\u7F16\u8F91",workflowExport:"\u5BFC\u51FA",slidesPanelTitle:"\u9875\u9762",slidesPanelSubcopy:"\u70B9\u51FB\u9875\u9762\u540E\uFF0C\u53EF\u76F4\u63A5\u5728\u753B\u5E03\u4E0A\u6539\u6587\u5B57\u3002",agentCommandTitle:"\u7528 Prompt \u751F\u6210\u6216\u4FEE\u6539",agentCommandSubcopy:"\u751F\u6210\u6574\u5957 PPT\u3001\u4FEE\u6539\u5355\u9875\u3001\u5168\u5C40\u6539\u5199\u3001\u63D2\u5165\u6216\u5220\u9664\u9875\u9762\u3002",briefTitle:"\u521B\u4F5C\u7B80\u62A5",agentRequestTitle:"\u4F60\u60F3\u505A\u4E00\u4EFD\u4EC0\u4E48 PPT\uFF1F",oneBoxTitle:"\u63CF\u8FF0 PPT\uFF0C\u7136\u540E\u7EE7\u7EED\u7528 Prompt \u4FEE\u6539",oneBoxSubtitle:"\u9996\u7A3F\u3001\u6539\u5355\u9875\u3001\u6539\u6574\u5957\u3001\u63D2\u5165\u548C\u5220\u9664\uFF0C\u90FD\u7531\u8FD9\u4E00\u4E2A\u8F93\u5165\u6846\u5904\u7406\u3002",oneBoxPlaceholder:`0-1 \u751F\u6210\uFF1A\u5199\u6E05\u4E3B\u9898\u3001\u53D7\u4F17\u548C\u5927\u81F4\u9875\u6570\uFF0C\u4F8B\u5982\u201C\u4E3A\u9AD8\u7BA1\u505A\u4E00\u4EFD 10 \u9875\u7684 AI \u4EA7\u54C1\u6218\u7565 PPT\u201D\u3002 \u4FEE\u6539\uFF1A\u6307\u660E\u54EA\u4E00\u9875\u4EE5\u53CA\u600E\u4E48\u6539\uFF0C\u4F8B\u5982\u201C\u628A\u7B2C 3 \u9875\u6539\u6210\u6570\u636E\u5BF9\u6BD4\u9875\u201D\u3002 -\u589E\u91CF\u751F\u6210\uFF1A\u8865\u5145\u65B0\u4FE1\u606F\uFF0C\u4F8B\u5982\u201C\u8865\u5145\u4E00\u6BB5\u7ADE\u54C1\u5206\u6790\uFF0C\u52A0\u5230\u7B2C 4 \u9875\u4E4B\u540E\u201D\u3002`,sendPrompt:"\u53D1\u9001",promptRequired:"\u8BF7\u8F93\u5165\u4F60\u5E0C\u671B PPT Live \u505A\u4EC0\u4E48\u3002",topicLabel:"\u76EE\u6807",topicPlaceholder:"\u76F4\u63A5\u63CF\u8FF0\u4F60\u60F3\u8981\u7684\u6F14\u793A\u7A3F\uFF1B\u4EC5\u5728\u9700\u8981\u65F6\u8BF4\u660E\u9875\u6570\u6216\u53C2\u8003 URL\u3002",audienceLabel:"\u53D7\u4F17",audiencePlaceholder:"\u9AD8\u7BA1\u3001\u5BA2\u6237\u3001\u5B66\u751F\u3001\u56E2\u961F\u6210\u5458...",slidesLabel:"\u9875\u6570",deckTypeLabel:"\u7C7B\u578B",deckTypeStrategy:"\u6218\u7565\u65B9\u6848",deckTypeSales:"\u9500\u552E\u63D0\u6848",deckTypeReport:"\u4E1A\u52A1\u6C47\u62A5",deckTypeTeaching:"\u6559\u5B66\u8BFE\u4EF6",deckTypeFundraising:"\u878D\u8D44\u8DEF\u6F14",toneLabel:"\u8BED\u6C14",toneExecutive:"\u9AD8\u7BA1\u98CE",toneConcise:"\u7CBE\u7B80",tonePersuasive:"\u6709\u8BF4\u670D\u529B",toneEducational:"\u6559\u5B66\u578B",materialLabel:"\u7D20\u6750",materialPlaceholder:"\u7C98\u8D34\u7B14\u8BB0\u3001\u6587\u7AE0\u7247\u6BB5\u3001\u6570\u636E\u70B9\u3001\u4F1A\u8BAE\u8BB0\u5F55\u6216\u7C97\u7565\u9875\u9762\u8981\u6C42\u3002",advancedBrief:"\u53EF\u9009\u4E0A\u4E0B\u6587",processTitle:"\u751F\u6210\u8FC7\u7A0B",processSubcopy:"\u67E5\u770B\u5F53\u524D\u6F14\u793A\u7A3F\u7684\u751F\u6210\u8FDB\u5EA6\u3002",historyTitle:"\u5386\u53F2\u8BB0\u5F55",historySubcopy:"\u6062\u590D\u4E4B\u524D\u7684 PPT \u4F1A\u8BDD\uFF0C\u5E76\u7EE7\u7EED\u4FEE\u6539\u3002",historyEmpty:"\u751F\u6210\u548C\u4FEE\u6539\u8FC7\u7684 PPT \u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002",historyMeta:"{{count}} \u9875 \xB7 {{time}}",historyRestored:"\u5DF2\u6062\u590D PPT \u4F1A\u8BDD\u3002",stopGeneration:"\u505C\u6B62",generationStopped:"\u5DF2\u505C\u6B62\u751F\u6210\uFF0C\u4FDD\u7559\u5F53\u524D\u89C6\u56FE\u3002",generationTimedOut:"\u751F\u6210\u8017\u65F6\u8FC7\u957F\uFF0C\u672C\u6B21\u8FD0\u884C\u5DF2\u505C\u6B62\u3002",generationDraftReady:"\u6B63\u5728\u6574\u7406\u6700\u7EC8\u9875\u9762\u2026",generationAgentWorking:"\u6B63\u5728\u751F\u6210\u4F60\u7684\u6F14\u793A\u7A3F\u2026",backendGenerationFailed:"\u751F\u6210\u672A\u5B8C\u6210\uFF0C\u8BF7\u91CD\u8BD5\u6216\u505C\u6B62\u540E\u91CD\u65B0\u5F00\u59CB\u3002",backendGenerationFailedWithReason:"\u751F\u6210\u672A\u5B8C\u6210\uFF1A{{reason}}",generationRoundBudgetFailed:"\u751F\u6210\u6B65\u9AA4\u8FC7\u591A\uFF0C\u6F14\u793A\u7A3F\u5C1A\u672A\u5B8C\u6210\u3002",generationRoundBudgetHint:"\u53EF\u5C1D\u8BD5\u7F29\u77ED\u63CF\u8FF0\u3001\u51CF\u5C11\u9875\u6570\u6216\u53BB\u6389\u591A\u4F59\u53C2\u8003\u94FE\u63A5\uFF0C\u7136\u540E\u91CD\u65B0\u53D1\u9001\u3002",generationRetrying:"\u751F\u6210\u51FA\u73B0\u9519\u8BEF\uFF0C\u6B63\u5728\u81EA\u52A8\u91CD\u8BD5\uFF08{{attempt}}/{{max}}\uFF09\u2026",generationRetryAttempt:"\u7B2C {{attempt}}/{{max}} \u6B21\u5C1D\u8BD5\u3002",generationRecoveryContinuing:"{{stage}}\u5C1A\u672A\u5B8C\u6210\uFF0C\u6B63\u5728\u7EE7\u7EED\uFF08{{attempt}}/{{max}}\uFF09\u2026",generationRecoveryExhausted:"{{stage}}\u5728\u91CD\u8BD5 {{retries}} \u6B21\u540E\u4ECD\u672A\u5B8C\u6210\u3002",generationRecoveryFailureDetail:"\u539F\u56E0\uFF1A{{reason}}",generationStagePlanning:"\u89C4\u5212",generationStageSlide:"\u7B2C {{slide}} \u9875",generationStageAudit:"\u6700\u7EC8\u68C0\u67E5",generationStageBriefs:"\u7B2C {{start}}-{{end}} \u9875",agentOnlyRetryHint:"\u8BF7\u68C0\u67E5\u7F51\u7EDC\u8FDE\u63A5\uFF0C\u7A0D\u540E\u518D\u8BD5\u3002",generationPlanPhase:"\u6B63\u5728\u89C4\u5212\u6F14\u793A\u5185\u5BB9\u2026",generationPlanningSlides:"\u6B63\u5728\u89C4\u5212\u5404\u9875\u5185\u5BB9\u2026",generationPlanProgress:"\u5DF2\u89C4\u5212 {{count}} \u9875\u5185\u5BB9\u2026",generationPlanReady:"\u5DF2\u89C4\u5212 {{count}} \u9875\u5185\u5BB9",generationOutlineReady:"\u5927\u7EB2\u5DF2\u5B8C\u6210\uFF1A\u5171 {{count}} \u9875\uFF0C\u6B63\u5728\u64B0\u5199\u5404\u9875\u8981\u70B9\u2026",generationBriefsBatchReady:"\u7B2C {{start}}-{{end}} \u9875\u8981\u70B9\u5DF2\u5B8C\u6210\uFF08\u7D2F\u8BA1 {{total}} \u9875\uFF09\u3002",generationBriefsRetry:"\u7B2C {{start}}-{{end}} \u9875\u8981\u70B9\u9047\u5230\u95EE\u9898\uFF0C\u6B63\u5728\u91CD\u8BD5\uFF08{{attempt}}/{{max}}\uFF09\u2026",generationPlanRetry:"\u89C4\u5212\u9047\u5230\u95EE\u9898\uFF0C\u6B63\u5728\u91CD\u8BD5\uFF08{{attempt}}/{{max}}\uFF09\u2026",generationAuditRetry:"\u68C0\u67E5\u5C1A\u672A\u5B8C\u6210\uFF0C\u6B63\u5728\u91CD\u8BD5\uFF08{{attempt}}/{{max}}\uFF09\u2026",generationSlidesPhase:"\u5F00\u59CB\u751F\u6210 {{count}} \u9875 PPT",generationAuditPhase:"\u6B63\u5728\u68C0\u67E5\u6574\u5957\u6F14\u793A\u7A3F\u2026",generationRenderingSlide:"\u6B63\u5728\u751F\u6210\u7B2C {{slide}}/{{total}} \u9875\u2026",generationSlideReady:"\u7B2C {{slide}}/{{total}} \u9875\u5DF2\u751F\u6210",generationSlideRetry:"\u7B2C {{slide}} \u9875\u751F\u6210\u9047\u5230\u95EE\u9898\uFF0C\u6B63\u5728\u91CD\u8BD5\uFF08{{attempt}}/{{max}}\uFF09\u2026",generationSlideRepair:"\u7B2C {{slide}} \u9875\u9700\u8981\u8C03\u6574\uFF0C\u6B63\u5728\u91CD\u65B0\u751F\u6210\uFF08{{attempt}}/{{max}}\uFF09\u2026",generationResumeFrom:"\u4ECE\u7B2C {{slide}} \u9875\u7EE7\u7EED\u751F\u6210\uFF0C\u5DF2\u5B8C\u6210\u7684\u9875\u9762\u4FDD\u7559\u3002",generationPartialDeck:"\u7B2C {{missing}} \u9875\u672A\u5B8C\u6210\u3002\u5DF2\u5B8C\u6210\u7684\u9875\u9762\u5DF2\u4FDD\u7559\uFF0C\u53EF\u7EE7\u7EED\u53D1\u9001\u6307\u4EE4\u8865\u5168\u7F3A\u5931\u9875\u3002",agentWorkingTitle:"\u6B63\u5728\u751F\u6210\u6F14\u793A\u7A3F",agentWorkingKicker:"\u751F\u6210\u4E2D",agentWorkingClaim:"\u5B8C\u6210\u540E\uFF0C\u6700\u7EC8\u9875\u9762\u4F1A\u51FA\u73B0\u5728\u4E2D\u95F4\u753B\u5E03\u3002",agentWorkingProof:"\u8FDB\u5EA6",agentWorkingDetail:"\u8FD9\u662F\u751F\u6210\u8FC7\u7A0B\u4E2D\u7684\u9884\u89C8\u533A\u57DF\u3002",agentWorkingSourceNote:"\u5185\u5BB9\u5C06\u6839\u636E\u4F60\u7684 Prompt \u81EA\u52A8\u751F\u6210\u3002",agentWorkingMetric:"Live",agentWorkingMetricLabel:"\u7B49\u5F85\u9875\u9762\u751F\u6210",processEventStarted:"\u5DF2\u5F00\u59CB\u751F\u6210\u3002",processEventWaiting:"\u51C6\u5907\u5F00\u59CB\u2026",processEventRound:"\u6B63\u5728\u7EC4\u7EC7\u5185\u5BB9\u4E0E\u7ED3\u6784\u3002",processEventTool:"\u6B63\u5728\u8BFB\u53D6\u7D20\u6750\u5E76\u5E94\u7528\u8BBE\u8BA1\u89C4\u5219\u3002",processEventText:"\u6B63\u5728\u64B0\u5199\u9875\u9762\u5E03\u5C40\u3002",processEventDone:"\u6F14\u793A\u7A3F\u5DF2\u751F\u6210\u3002",generationParsingDeck:"\u6B63\u5728\u6574\u7406\u9875\u9762\u2026",processWaitingForEventsTitle:"\u7B49\u5F85\u5F00\u59CB",processWaitingForEvents:"\u53D1\u9001 Prompt \u540E\uFF0C\u8FD9\u91CC\u4F1A\u663E\u793A\u751F\u6210\u8FDB\u5EA6\u3002",agentStreamTitle:"Agent \u5B9E\u65F6\u6D41",agentStreamAssistant:"\u52A9\u624B",processEventUnknown:"\u8FDB\u5EA6\u66F4\u65B0",eventTurnStarted:"\u5F00\u59CB\u751F\u6210",eventTurnFailed:"\u751F\u6210\u5931\u8D25",eventTurnCancelled:"\u751F\u6210\u5DF2\u53D6\u6D88",eventRoundCompleted:"\u672C\u9636\u6BB5\u5DF2\u5B8C\u6210",eventThinkingChunk:"\u601D\u8003\u6D41",eventTokenUsage:"Token \u7528\u91CF\u66F4\u65B0",eventUnknownTool:"\u5DE5\u5177",eventToolDetected:"\u68C0\u6D4B\u5230\u5DE5\u5177",eventToolParams:"\u6B63\u5728\u8BFB\u53D6\u5DE5\u5177\u53C2\u6570",eventToolQueued:"\u5DE5\u5177\u5DF2\u6392\u961F",eventToolWaiting:"\u7B49\u5F85\u5DE5\u5177\u6267\u884C",eventToolStarted:"\u5F00\u59CB\u8C03\u7528\u5DE5\u5177",eventToolProgress:"\u5DE5\u5177\u8FDB\u5EA6",eventToolStreaming:"\u5DE5\u5177\u6D41\u5F0F\u8F93\u51FA",eventToolStreamChunk:"\u5DE5\u5177\u8F93\u51FA\u7247\u6BB5",eventToolConfirmation:"\u5DE5\u5177\u9700\u8981\u786E\u8BA4",eventToolConfirmed:"\u5DE5\u5177\u5DF2\u786E\u8BA4",eventToolRejected:"\u5DE5\u5177\u5DF2\u62D2\u7EDD",eventToolCompleted:"\u5DE5\u5177\u6267\u884C\u5B8C\u6210",eventToolFailed:"\u5DE5\u5177\u6267\u884C\u5931\u8D25",eventToolCancelled:"\u5DE5\u5177\u5DF2\u53D6\u6D88",eventToolQueuePosition:"\u961F\u5217\u4F4D\u7F6E",eventToolSkillName:"PPT \u8BBE\u8BA1\u89C4\u8303",eventToolWebSearchName:"\u7F51\u9875\u641C\u7D22",eventToolWebFetchName:"\u7F51\u9875\u8BFB\u53D6",eventToolSkillReady:"\u8BBE\u8BA1\u89C4\u8303\u5DF2\u5C31\u7EEA",eventToolWebSearchDone:"\u5DF2\u641C\u7D22\u76F8\u5173\u8D44\u6599",eventToolWebFetchDone:"\u5DF2\u8BFB\u53D6\u53C2\u8003\u7F51\u9875",eventToolTaskStarted:"\u6B63\u5728\u6267\u884C\u8C03\u7814\u5B50\u4EFB\u52A1\u2026",eventToolTaskDone:"\u8C03\u7814\u5B50\u4EFB\u52A1\u5DF2\u5B8C\u6210",eventSubagentStarted:"\u5DF2\u542F\u52A8\u540E\u53F0\u8C03\u7814\u5B50\u4EFB\u52A1",eventSubagentWorking:"\u540E\u53F0\u8C03\u7814\u8FDB\u884C\u4E2D\u2026",eventSubagentDone:"\u540E\u53F0\u8C03\u7814\u5DF2\u5B8C\u6210",eventSubagentFailed:"\u540E\u53F0\u8C03\u7814\u672A\u5B8C\u6210",eventSubagentWebSearchDone:"\u5B50\u4EFB\u52A1\u5DF2\u641C\u7D22\u76F8\u5173\u8D44\u6599",eventSubagentWebFetchDone:"\u5B50\u4EFB\u52A1\u5DF2\u8BFB\u53D6\u53C2\u8003\u7F51\u9875",eventToolFailedUser:"\u67D0\u4E00\u6B65\u672A\u5B8C\u6210",generationProgressPulse:"\u4ECD\u5728\u751F\u6210\u4E2D\u2026",generationPageProgress:"\u6B63\u5728\u751F\u6210\u7B2C {{current}} \u9875",generationSlideProgress:"\u5DF2\u751F\u6210 {{count}} \u9875",generationStepBrief:"\u53D1\u5E03\u5047\u8BBE",generationStepBriefDetail:"\u9605\u8BFB Prompt \u5E76\u89C4\u5212\u6F14\u793A\u7A3F\u3002",generationStepSpine:"\u751F\u6210\u5927\u7EB2",generationStepSpineDetail:"\u628A\u9700\u6C42\u8F6C\u6210\u65AD\u8A00\u5F0F\u9875\u9762\u6807\u9898\u3002",generationStepProof:"\u9875\u9762\u6587\u6848",generationStepProofDetail:"\u7528\u7D20\u6750\u4E8B\u5B9E\u6216\u660E\u786E\u5047\u8BBE\u652F\u6491\u6BCF\u9875\u3002",generationStepDesign:"\u8BBE\u8BA1\u6392\u7248",generationStepDesignDetail:"\u5E94\u7528\u4E3B\u9898\u3001\u7248\u5F0F\u4E0E\u89C6\u89C9\u5C42\u6B21\u3002",generationStepCompile:"\u52A0\u8F7D\u9875\u9762",generationStepCompileDetail:"\u5C06\u751F\u6210\u7ED3\u679C\u52A0\u8F7D\u4E3A\u53EF\u7F16\u8F91\u9875\u9762\u3002",generationReadingBrief:"\u6B63\u5728\u7406\u89E3\u4F60\u7684 Prompt\u2026",generationWritingClaims:"\u6B63\u5728\u751F\u6210\u5927\u7EB2\u2026",generationChoosingProof:"\u6B63\u5728\u64B0\u5199\u9875\u9762\u6587\u6848\u2026",generationDesigningLayouts:"\u6B63\u5728\u8BBE\u8BA1\u9875\u9762\u7248\u5F0F\u2026",generationCompiled:"\u6F14\u793A\u7A3F\u5DF2\u5C31\u7EEA\u3002",generationSpineReady:"\u8BBA\u70B9\u4E3B\u7EBF\u5DF2\u751F\u6210\u3002",generationLocalSpine:"\u751F\u6210\u670D\u52A1\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",generationLocalCompiler:"\u751F\u6210\u670D\u52A1\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",agentPlanning:"\u6B63\u5728\u89C4\u5212\u6F14\u793A\u7A3F\u2026",agentPlanningFallback:"\u89C4\u5212\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",outlineTitle:"\u5927\u7EB2",outlineSubcopy:"\u5148\u786E\u8BA4\u6BCF\u4E00\u9875\u7684\u6545\u4E8B\u4E3B\u7EBF\uFF0C\u518D\u751F\u6210\u5B8C\u6574\u9875\u9762\u3002",addOutlineItem:"\u6DFB\u52A0\u5927\u7EB2\u9879",syncOutline:"\u7528\u5927\u7EB2\u540C\u6B65\u9875\u9762",modeEdit:"\u7F16\u8F91",modeSort:"\u6392\u5E8F",modePresent:"\u6F14\u793A",inspectorTitle:"\u68C0\u67E5\u5668",addText:"\u6587\u5B57",addList:"\u5217\u8868",addShape:"\u5F62\u72B6",addMetric:"\u6307\u6807",addChart:"\u56FE\u8868",addMedia:"\u5A92\u4F53",addSlide:"\u6DFB\u52A0\u9875\u9762",deleteSlide:"\u5220\u9664\u9875\u9762",deleteElement:"\u5220\u9664\u5143\u7D20",aiTitle:"AI \u8BBE\u8BA1",aiSubcopy:"\u7528 Prompt \u4FEE\u6539\u5F53\u524D\u9875\u3001\u6574\u5957 PPT\uFF0C\u6216\u63D2\u5165\u65B0\u9875\u3002",instructionPlaceholder:"\u4F8B\u5982\uFF1A\u8BA9\u672C\u9875\u66F4\u89C6\u89C9\u5316\uFF1B\u589E\u52A0\u4E00\u9875\u7ADE\u54C1\u5BF9\u6BD4\uFF1B\u6574\u5957\u6539\u6210\u878D\u8D44\u8DEF\u6F14\u98CE\u683C\uFF1B\u5220\u9664\u91CD\u590D\u5185\u5BB9\u3002",reviseSlide:"\u4FEE\u6539\u672C\u9875",reviseDeck:"\u4FEE\u6539\u6574\u5957",insertSlide:"\u63D2\u5165\u65B0\u9875",aiRewrite:"\u6539\u5199",aiCondense:"\u538B\u7F29",aiProfessional:"\u4E13\u4E1A\u5316",aiMoreVisual:"\u66F4\u89C6\u89C9\u5316",aiNotes:"\u6F14\u8BB2\u5907\u6CE8",aiRedesign:"\u91CD\u6392\u672C\u9875",aiRestyleDeck:"\u91CD\u5851\u6574\u5957\u98CE\u683C",styleTitle:"\u98CE\u683C",themeLabel:"\u4E3B\u9898",themeExecutive:"\u9AD8\u7BA1",themeMarket:"\u5E02\u573A",themeMinimal:"\u6781\u7B80",themeStudio:"\u521B\u610F",densityLabel:"\u5BC6\u5EA6",densityCompact:"\u7D27\u51D1",densityStandard:"\u6807\u51C6",densitySpacious:"\u8212\u5C55",brandPrimaryLabel:"\u4E3B\u8272",brandAccentLabel:"\u5F3A\u8C03\u8272",imagePolicyLabel:"\u56FE\u7247\u7B56\u7565",imagePolicyPlaceholders:"\u53EF\u7F16\u8F91\u5360\u4F4D",imagePolicyNone:"\u4E0D\u4F7F\u7528\u56FE\u7247",ready:"\u51C6\u5907\u5C31\u7EEA\u3002",statusPillReady:"\u5C31\u7EEA",statusPillBusy:"AI",exportReady:"\u751F\u6210\u540E\u53EF\u5BFC\u51FA HTML \u548C\u53EF\u7F16\u8F91 PPTX\u3002",working:"AI \u6B63\u5728\u5904\u7406...",outlineReady:"\u5927\u7EB2\u5DF2\u751F\u6210\u3002\u53EF\u5148\u8C03\u6574\u5927\u7EB2\uFF0C\u518D\u751F\u6210\u8BBE\u8BA1\u7A3F\u3002",deckReady:"\u8BBE\u8BA1\u7A3F\u5DF2\u751F\u6210\u3002",aiUnavailable:"\u751F\u6210\u670D\u52A1\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002",sourceGroundingRequired:"\u6765\u6E90\u65E0\u6CD5\u9A8C\u8BC1\u3002\u5DF2\u751F\u6210\u201C\u5148\u9A8C\u8BC1\u201D\u7684\u6F14\u793A\u7A3F\uFF0C\u800C\u4E0D\u662F\u7F16\u9020\u4E8B\u5B9E\u3002",saved:"\u5DF2\u4FDD\u5B58\u3002",slideUpdated:"\u9875\u9762\u5DF2\u66F4\u65B0\u3002",deckUpdated:"\u6574\u5957\u5DF2\u66F4\u65B0\u3002",slideInserted:"\u65B0\u9875\u9762\u5DF2\u63D2\u5165\u3002",deckRestyled:"\u6574\u5957\u98CE\u683C\u5DF2\u66F4\u65B0\u3002",cannotDelete:"\u81F3\u5C11\u4FDD\u7559\u4E00\u9875\u3002",noSelection:"\u9009\u62E9\u4E00\u4E2A\u9875\u9762\u5143\u7D20\u540E\u53EF\u7F16\u8F91\u5185\u5BB9\u548C\u5E03\u5C40\u3002",elementTypeLabel:"\u7C7B\u578B",elementTextLabel:"\u6587\u5B57",elementItemsLabel:"\u6761\u76EE",elementDataLabel:"\u56FE\u8868\u6570\u636E",geometryLabel:"\u4F4D\u7F6E\u5C3A\u5BF8",styleLabel:"\u6837\u5F0F",speakerNotesLabel:"\u6F14\u8BB2\u5907\u6CE8",kickerLabel:"\u7709\u6807",claimLabel:"\u8BBA\u70B9",proofObjectLabel:"\u8BC1\u636E\u5BF9\u8C61",supportNoteLabel:"\u652F\u6491\u8BF4\u660E",sourceNoteLabel:"\u6765\u6E90\u8BF4\u660E",newSlideTitle:"\u65B0\u9875\u9762",defaultDeckTitle:"AI \u4EA7\u54C1\u6218\u7565",slidesMeta:"{{count}} \u9875",exportHtmlDone:"HTML \u6F14\u793A\u7A3F\u5DF2\u4E0B\u8F7D\u3002",exportHtmlWorking:"\u6B63\u5728\u5BFC\u51FA HTML...",exportHtmlFailed:"HTML \u5BFC\u51FA\u5931\u8D25\uFF1A",exportSavedTo:"\u5DF2\u5BFC\u51FA\u5230 {{path}}",exportPptxWorking:"\u6B63\u5728\u6E32\u67D3\u53EF\u7F16\u8F91 PPTX...",exportPptxDone:"\u53EF\u7F16\u8F91 PPTX \u5DF2\u4E0B\u8F7D\u3002",exportPptxFailed:"PPTX \u5BFC\u51FA\u5931\u8D25\uFF1A",exportPdfWorking:"\u6B63\u5728\u6E32\u67D3 PDF...",exportPdfDone:"PDF \u5DF2\u4E0B\u8F7D\u3002",exportPdfFailed:"PDF \u5BFC\u51FA\u5931\u8D25\uFF1A",exportPngWorking:"\u6B63\u5728\u6E32\u67D3 PNG \u9875\u9762...",exportPngDone:"PNG \u9875\u9762\u538B\u7F29\u5305\u5DF2\u4E0B\u8F7D\u3002",exportPngFailed:"PNG \u5BFC\u51FA\u5931\u8D25\uFF1A",exportDeckEmpty:"\u8BF7\u5148\u751F\u6210\u5E7B\u706F\u7247\u540E\u518D\u5BFC\u51FA\u3002",slidesEmptyHint:"\u751F\u6210\u540E\u9875\u9762\u7F29\u7565\u56FE\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002",welcomeTitle:"\u63CF\u8FF0\u4F60\u7684 PPT\uFF0C\u4E00\u952E\u5F00\u59CB",welcomeSubcopy:"\u4E00\u6761 Prompt \u5373\u53EF\u751F\u6210\u5927\u7EB2\u3001\u8BBE\u8BA1\u9875\u9762\u548C\u53EF\u7F16\u8F91\u6F14\u793A\u7A3F\uFF0C\u4E4B\u540E\u53EF\u9010\u9875\u7EE7\u7EED\u4FEE\u6539\u3002",welcomeTip1:"10 \u9875\u6218\u7565\u65B9\u6848",welcomeTip2:"\u6539\u6210\u6295\u8D44\u4EBA\u7248\u672C",welcomeTip3:"\u672C\u9875\u66F4\u89C6\u89C9\u5316",deleteSlideDefaultPrompt:"\u5220\u9664\u5F53\u524D\u9875\u9762\uFF0C\u5E76\u4FDD\u6301\u6574\u5957 PPT \u7ED3\u6784\u8FDE\u8D2F\u3002",prev:"\u4E0A\u4E00\u9875",next:"\u4E0B\u4E00\u9875",assistantHello:"\u544A\u8BC9\u6211\u4F60\u8981\u505A\u4EC0\u4E48 PPT\u3002\u6211\u4F1A\u5148\u751F\u6210\u5927\u7EB2\uFF0C\u518D\u53D8\u6210\u53EF\u7F16\u8F91\u9875\u9762\u3002",aiChatApplied:"\u5DF2\u628A\u6307\u4EE4\u5E94\u7528\u5230\u5F53\u524D\u9875\u9762\u3002",localMetricLabel:"\u9700\u8981\u8BB0\u4F4F\u7684\u4FE1\u53F7",mediaPlaceholder:"\u56FE\u7247\u5360\u4F4D",slidesUnit:"\u9875",closeConfirm:"\u786E\u8BA4\u65B9\u5411",closeOwner:"\u660E\u786E\u8D1F\u8D23\u4EBA",closeIteration:"\u542F\u52A8\u4E0B\u4E00\u8F6E\u8FED\u4EE3",pointClaimPrefix:"\u8BBA\u70B9\uFF1A",pointProofPrefix:"\u8BC1\u636E\u5BF9\u8C61\uFF1A",pointAudiencePrefix:"\u53D7\u4F17\u5173\u8054\uFF1A",pointEvidenceRule:"\u8BC1\u636E\u89C4\u5219\uFF1A\u660E\u786E\u6807\u6CE8\u5047\u8BBE",pointDesignRule:"\u8BBE\u8BA1\u89C4\u5219\uFF1A\u4E00\u4E2A\u4E3B\u89C6\u89C9\u52A0\u4E00\u4E2A\u652F\u6491\u680F",pointCloseRule:"\u6536\u675F\uFF1A\u8BF4\u6E05\u4E0B\u4E00\u6B65\u884C\u52A8",claimCover:"{{topic}} \u9700\u8981\u4E00\u6761\u6E05\u6670\u7684\u51B3\u7B56\u4E3B\u7EBF\uFF0C\u800C\u4E0D\u662F\u4FE1\u606F\u5806\u780C\u3002",claimPressure:"{{title}} \u662F\u53D7\u4F17\u5FC5\u987B\u89E3\u51B3\u7684\u5173\u952E\u538B\u529B\u70B9\u3002",claimDecision:"{{title}} \u4E4B\u6240\u4EE5\u91CD\u8981\uFF0C\u662F\u56E0\u4E3A\u5B83\u628A\u8BC1\u636E\u8FDE\u63A5\u5230\u884C\u52A8\u3002",claimProof:"{{title}} \u5FC5\u987B\u7531\u9875\u9762\u91CC\u7684\u4E3B\u8BC1\u636E\u5BF9\u8C61\u6765\u627F\u62C5\u8BBA\u8BC1\u3002",claimAction:"{{title}} \u6700\u540E\u8981\u843D\u5230\u4E00\u4E2A\u660E\u786E\u51B3\u7B56\u3001\u8D1F\u8D23\u4EBA\u6216\u4E0B\u4E00\u6B65\u3002",supportWithSource:"\u7528\u5DF2\u63D0\u4F9B\u7D20\u6750\u652F\u6491\u8FD9\u4E2A\u8BBA\u70B9\uFF0C\u5E76\u8BA9\u201C{{proof}}\u201D\u6210\u4E3A\u4E3B\u8BC1\u636E\u3002",supportWithAssumption:"\u8865\u5145\u4E00\u4E2A\u5177\u4F53\u4F8B\u5B50\u6216\u6307\u6807\uFF0C\u8BA9\u201C{{proof}}\u201D\u652F\u6491\u8BBA\u70B9\uFF0C\u800C\u4E0D\u662F\u586B\u5145\u6587\u5B57\u3002",sourceUserMaterial:"\u6765\u6E90\uFF1A\u7528\u6237\u63D0\u4F9B\u7D20\u6750",sourceDraftAssumption:"\u6765\u6E90\uFF1A\u8349\u7A3F\u5047\u8BBE\uFF1B\u5BF9\u5916\u4F7F\u7528\u524D\u9700\u786E\u8BA4",defaultSpeakerNote:"\u5148\u8BB2\u201C{{title}}\u201D\u7684\u7ED3\u8BBA\uFF0C\u518D\u7528\u4E00\u4E2A\u5177\u4F53\u4F8B\u5B50\u6216\u6570\u636E\u652F\u6491\u3002",proofMarketMap:"\u5E02\u573A\u5730\u56FE",proofOperatingModel:"\u8FD0\u8425\u6A21\u578B",proofRiskBridge:"\u98CE\u9669\u6865",proofDecisionTable:"\u51B3\u7B56\u8868",proofBeforeAfter:"\u524D\u540E\u5BF9\u6BD4\u6D41\u7A0B",proofValueBridge:"\u4EF7\u503C\u6865",proofCustomerProof:"\u5BA2\u6237\u8BC1\u636E",proofImplementationPlan:"\u5B9E\u65BD\u8BA1\u5212",proofMetricBridge:"\u6307\u6807\u6865",proofTrendChart:"\u8D8B\u52BF\u56FE",proofSourceSummary:"\u6765\u6E90\u6458\u8981",proofVerificationPlan:"\u9A8C\u8BC1\u8BA1\u5212",proofCapabilityMatrix:"\u80FD\u529B\u77E9\u9635",proofEvidenceList:"\u8BC1\u636E\u5217\u8868",proofVarianceTable:"\u5DEE\u5F02\u8868",proofRiskRegister:"\u98CE\u9669\u6E05\u5355",proofConceptMap:"\u6982\u5FF5\u56FE",proofWorkedExample:"\u6848\u4F8B\u6F14\u7B97",proofComparison:"\u5BF9\u6BD4",proofPracticePrompt:"\u7EC3\u4E60\u63D0\u793A",proofMarketWedge:"\u5E02\u573A\u5207\u5165\u70B9",proofProductDiagram:"\u4EA7\u54C1\u56FE",proofTractionChart:"\u7275\u5F15\u529B\u56FE\u8868",proofMilestonePlan:"\u91CC\u7A0B\u7891\u8BA1\u5212",proofVisualProof:"\u89C6\u89C9\u8BC1\u636E",sourceFetchedNote:"\u6765\u6E90\uFF1A\u5DF2\u8BFB\u53D6 {{count}} \u4E2A URL",bpContextTitle:"{{topic}} \u9700\u8981\u5148\u5EFA\u7ACB\u5728\u6765\u6E90\u4E8B\u5B9E\u4E4B\u4E0A\uFF0C\u518D\u63D0\u51FA\u5224\u65AD\u3002",bpSourceNeededTitle:"{{topic}} \u9700\u8981\u8865\u5145\u6765\u6E90\u7D20\u6750\u540E\u624D\u80FD\u63D0\u51FA\u4E8B\u5B9E\u6027\u7ED3\u8BBA\u3002",bpProblemTitle:"\u5F53\u524D\u5173\u952E\u95EE\u9898\u662F\uFF1A\u53D7\u4F17\u53EF\u4EE5\u5B89\u5168\u76F8\u4FE1\u4EC0\u4E48\u3002",bpSolutionTitle:"{{topic}} \u5E94\u901A\u8FC7\u80FD\u529B\u3001\u6D41\u7A0B\u548C\u8BC1\u636E\u6765\u89E3\u91CA\u3002",bpWorkflowTitle:"\u5DE5\u4F5C\u6D41\u9700\u8981\u5C55\u793A\u4EA7\u54C1\u5982\u4F55\u4E00\u6B65\u6B65\u521B\u9020\u4EF7\u503C\u3002",bpProofTitle:"\u53EF\u4FE1\u5EA6\u5E94\u8BE5\u7531\u6765\u6E90\u8BC1\u636E\u627F\u62C5\uFF0C\u800C\u4E0D\u662F\u7531\u5047\u56FE\u8868\u627F\u62C5\u3002",bpVerificationTitle:"\u9A8C\u8BC1\u7F3A\u53E3\u5FC5\u987B\u663E\u6027\u5C55\u793A\uFF0C\u4E0D\u80FD\u85CF\u5728\u865A\u6784\u56FE\u8868\u540E\u9762\u3002",bpRiskTitle:"\u6700\u5927\u98CE\u9669\u662F\u8D85\u51FA\u5DF2\u6709\u7D20\u6750\u8FC7\u5EA6\u58F0\u79F0\u3002",bpDecisionTitle:"\u4E0B\u4E00\u6B65\u662F\u9A8C\u8BC1\u5173\u952E\u8BBA\u70B9\uFF0C\u5E76\u9009\u62E9\u6700\u5F3A\u53D9\u4E8B\u8DEF\u5F84\u3002",bpSupportSource:"\u57FA\u4E8E\u5DF2\u8BFB\u53D6\u6216\u7C98\u8D34\u7D20\u6750\u751F\u6210\uFF1B\u5BF9\u5916\u4F7F\u7528\u524D\u8BF7\u6838\u5BF9\u539F\u6587\u3002",bpSupportMissing:"\u7D20\u6750\u4E0D\u8DB3\uFF1B\u672C\u9875\u5E94\u4F5C\u4E3A\u9A8C\u8BC1\u63D0\u793A\uFF0C\u800C\u4E0D\u662F\u4E8B\u5B9E\u7ED3\u8BBA\u3002",bpMissingFact1:"\u8BF7\u7C98\u8D34\u6765\u6E90\u7B14\u8BB0\u3001README\u3001\u6307\u6807\u6216\u4EA7\u54C1\u63CF\u8FF0\u6765\u652F\u6491\u672C\u9875\u3002",bpMissingFact2:"\u4E0D\u8981\u4F7F\u7528\u865A\u6784\u6307\u6807\uFF1B\u7528\u5DF2\u9A8C\u8BC1\u8BC1\u636E\u66FF\u6362\u5360\u4F4D\u5185\u5BB9\u3002",bpMissingFact3:"\u7528\u672C\u9875\u51B3\u5B9A\u4E0B\u4E00\u6B65\u9700\u8981\u8865\u5145\u7814\u7A76\u4EC0\u4E48\u3002",qualityOutOfBounds:"\u6709\u5143\u7D20\u8D85\u51FA\u5E7B\u706F\u7247\u5B89\u5168\u533A\u57DF\u3002",qualityTextDense:"\u5F53\u524D\u7248\u5F0F\u4E2D\u7684\u53EF\u89C1\u6587\u5B57\u53EF\u80FD\u8FC7\u5BC6\u3002",qualityChartUngrounded:"\u56FE\u8868\u6570\u636E\u7F3A\u5C11\u6765\u6E90\u6570\u5B57\uFF0C\u5DF2\u79FB\u9664\u6216\u6807\u8BB0\u3002",qualityOverlap:"\u6587\u5B57\u6216\u56FE\u8868\u5143\u7D20\u53EF\u80FD\u53D1\u751F\u91CD\u53E0\u3002",qualityMissingClaim:"\u672C\u9875\u9700\u8981\u4E00\u4E2A\u6E05\u6670\u8BBA\u70B9\u3002",qualityReportTitle:"\u8D28\u91CF\u62A5\u544A",qualityNeedsReview:"\u9700\u8981\u590D\u6838",qualityHasWarnings:"\u8D28\u91CF\u63D0\u9192",exportFormatUnavailable:"\u8BE5\u5BFC\u51FA\u683C\u5F0F\u5C1A\u672A\u652F\u6301\u3002",exportTitle:"\u5BFC\u51FA",exportCancel:"\u53D6\u6D88",exportConfirm:"\u5BFC\u51FA\u6587\u4EF6",exportPreviewPrevAria:"\u4E0A\u4E00\u9875",exportPreviewNextAria:"\u4E0B\u4E00\u9875",exportFormat:"\u683C\u5F0F",exportQuality:"\u8D28\u91CF",exportDpi:"\u56FE\u7247 DPI",exportRange:"\u5E7B\u706F\u7247\u8303\u56F4",exportShare:"\u5206\u4EAB",propertiesStyle:"\u6837\u5F0F",propertiesLayout:"\u5E03\u5C40",propertiesAnimation:"\u52A8\u753B",propertiesThemeColor:"\u4E3B\u9898\u8272",propertiesFont:"\u5B57\u4F53",propertiesColorMode:"\u5E7B\u706F\u7247\u914D\u8272",propertiesStylePreset:"\u98CE\u683C\u9884\u8BBE",colorModeLight:"\u6D45\u8272",colorModeDark:"\u6DF1\u8272",fontSansSerif:"\u975E\u886C\u7EBF",fontSerif:"\u886C\u7EBF",propertiesDensity:"\u5BC6\u5EA6",propertiesSmartAlign:"\u667A\u80FD\u5BF9\u9F50",propertiesPageTransition:"\u9875\u9762\u8FC7\u6E21",propertiesElementAnimation:"\u5143\u7D20\u52A8\u753B",densityLoose:"\u5BBD\u677E"}};function Nr(){let e=window.app?.locale||document.documentElement.lang||"";return e==="zh-CN"||String(e).startsWith("zh")?"zh-CN":"en-US"}function $(e,r={}){let t=Zo[Nr()]||Zo["en-US"],n=Zo["en-US"][e]||e,i=t[e]||n;return Object.entries(r).forEach(([a,o])=>{i=i.replaceAll(`{{${a}}}`,String(o))}),i}var jf=["clean-business","insight-report"],ya={"clean-business":{styleKey:"clean-business",names:{"en-US":"Clean Business","zh-CN":"\u7B80\u6D01\u5546\u52A1"},descriptions:{"en-US":"Calm editorial product-doc: warm canvas, charcoal type, one restrained accent, typography-led","zh-CN":"\u5E73\u9759\u7F16\u8F91\u611F\u4EA7\u54C1\u6587\u6863\uFF1A\u6696\u767D\u753B\u5E03\u3001\u70AD\u9ED1\u5B57\u9636\u3001\u5355\u4E00\u514B\u5236\u5F3A\u8C03\u8272\uFF0C\u6392\u7248\u5373\u89C6\u89C9"},colorMode:"light",palette:{background:"#FAFAF7",ink:"#111111",muted:"#787774",primary:"#1E293B",accent:"#0f766e",panel:"#F3F2EF"},fontFamily:"sans",density:"spacious",keywords:/business|clean|professional|商务|简洁|专业|企业/},"insight-report":{styleKey:"insight-report",names:{"en-US":"Insight Report","zh-CN":"\u6D1E\u5BDF\u6C47\u62A5"},descriptions:{"en-US":"Analytical memo on a slide: full sentences, explicit frameworks, evidence-dense tables","zh-CN":"\u5206\u6790\u5907\u5FD8\u5F55\u4E0A\u5899\uFF1A\u5B8C\u6574\u8BBA\u8BC1\u3001\u663E\u6027\u6846\u67B6\u3001\u6EE1\u7248\u8BC1\u636E\uFF0C\u50CF\u5C3D\u8C03\u9644\u5F55\u800C\u975E bullet \u6F14\u8BB2"},colorMode:"light",palette:{background:"#ffffff",ink:"#1f2937",muted:"#64748b",primary:"#1e3a8a",accent:"#dc2626",panel:"#f1f5f9"},fontFamily:"sans",density:"compact",keywords:/insight|consult|academic|research|whitepaper|due.*diligence|洞察|咨询|学术|调研|详尽|深度分析|尽调/}},an="clean-business";function Yo(e){return e&&ya[e]?e:an}function Jo(e){return ya[Yo(e)]}var Hn={background:"#111111",ink:"#F5F5F4",muted:"#A8A29E",primary:"#93C5FD",accent:"#2DD4BF",panel:"#1C1C1C"};function tc(e,r="light"){let t=e?.palette||{};return r!=="dark"?{...t}:e?.paletteDark&&typeof e.paletteDark=="object"?{...e.paletteDark}:{background:Hn.background,ink:Hn.ink,muted:Hn.muted,primary:t.primary||Hn.primary,accent:t.accent||Hn.accent,panel:Hn.panel}}function qf(e){return e==="zh-CN"?"zh-CN":"en-US"}function rc(e){let r=qf(e);return jf.filter(t=>ya[t]).map(t=>{let n=ya[t];return{key:t,displayName:n.names[r]||n.names["en-US"],description:n.descriptions[r]||n.descriptions["en-US"],colorMode:n.colorMode}})}var Si="pptLiveStudioStateV6",rs="pptLiveDeckHistoryV1",oc=6,ns=["text","list","shape","metric","chart","media"],es={executive:{name:"Executive",background:"#fbfcff",ink:"#111827",muted:"#5b6575",primary:"#0f766e",accent:"#f97316",panel:"#ffffff"},market:{name:"Market",background:"#fffdf7",ink:"#1f2937",muted:"#6b5f50",primary:"#2563eb",accent:"#d97706",panel:"#ffffff"},minimal:{name:"Minimal",background:"#f8fafc",ink:"#0f172a",muted:"#64748b",primary:"#334155",accent:"#0f766e",panel:"#ffffff"},studio:{name:"Studio",background:"#fcfbff",ink:"#1f1630",muted:"#6c607a",primary:"#7c3aed",accent:"#db2777",panel:"#ffffff"}};function ir(e="id"){return`${e}-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function sn(e){return JSON.parse(JSON.stringify(e))}function mt(e,r,t){return Math.max(r,Math.min(t,e))}function Le(e){return String(e??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function is(){return{topic:"",slideTarget:0}}function sc(e="strategy"){let r={strategy:{profile:"strategy-leadership",thesis:"Decision-led transformation narrative",proofObjects:["market map","operating model","risk bridge","decision table"],arc:["thesis","context","friction","strategic bet","operating model","proof","risks","decision"]},sales:{profile:"gtm-growth",thesis:"Buyer pain to differentiated value narrative",proofObjects:["before/after workflow","value bridge","customer proof","implementation plan"],arc:["outcome","market shift","pain","solution","proof","commercial case","rollout","call to action"]},report:{profile:"finance-ir",thesis:"Executive performance narrative with decisions attached",proofObjects:["metric bridge","trend chart","variance table","risk register"],arc:["summary","scorecard","movement","root cause","metric proof","risk","plan","decision"]},teaching:{profile:"education",thesis:"Concept to application learning journey",proofObjects:["concept map","worked example","comparison","practice prompt"],arc:["goal","map","concept","example","mistakes","practice","summary","next step"]},fundraising:{profile:"fundraising",thesis:"Venture-scale opportunity supported by traction evidence",proofObjects:["market wedge","product diagram","traction chart","milestone plan"],arc:["thesis","problem","solution","market","product","traction","model","ask"]}};return r[e]||r.strategy}function En(e="standard"){let r=String(e||"standard");return r==="loose"?"spacious":["compact","standard","spacious"].includes(r)?r:"standard"}var ts=["spacious","standard","compact"];function xa(e="standard"){let r=En(e),t=ts.indexOf(r);return t>=0?t:1}function Sa(e=1){let r=Math.min(Math.max(Math.round(Number(e)),0),ts.length-1);return ts[r]||"standard"}function lc(e="standard"){let r=En(e),t={spacious:{bulletLimit:4,cardColumns:3,cardGap:2},standard:{bulletLimit:5,cardColumns:4,cardGap:1.8},compact:{bulletLimit:6,cardColumns:4,cardGap:1.2}};return t[r]||t.standard}function nc(e=0){let r=Number(e);return!Number.isFinite(r)||r<=0?0:mt(r,3,24)}function as(){return{theme:"executive",density:"standard",fontFamily:"sans",colorMode:"light",stylePreset:"clean-business"}}function cc(){return[$("defaultDeckTitle"),"Why now","Current friction","Strategic answer","Core workflow","Proof and impact","Rollout plan","Decision and next steps"]}function Bn(){return{schemaVersion:oc,sessionId:ir("deck"),title:$("blankDeckTitle"),brief:is(),promptDraft:"",lastSubmittedPrompt:"",agentSession:{id:"",workspaceSubdir:"",runId:"",skillKey:""},style:as(),outline:[],sources:{items:[],facts:[],warnings:[],summary:"",fetchedAt:0},slides:[],activeSlideId:"",selectedElementId:"",mode:"edit",presentIndex:0,status:"ready",generation:{active:!1,current:"idle",steps:uc().map(r=>({...r,status:"pending"})),events:[]},chatMessages:[{role:"assistant",text:$("assistantHello")}],updatedAt:Date.now()}}function ln(e){let r={...Bn(),...e||{}};r.schemaVersion=oc;let t=r.brief||{};r.brief={...is(),topic:String(t.topic||r.promptDraft||"").trim(),slideTarget:nc(t.slideTarget)},r.promptDraft=typeof r.promptDraft=="string"?r.promptDraft:"",r.lastSubmittedPrompt=typeof r.lastSubmittedPrompt=="string"?r.lastSubmittedPrompt:"",r.agentSession={id:String(r.agentSession?.id||""),workspaceSubdir:String(r.agentSession?.workspaceSubdir||""),runId:String(r.agentSession?.runId||""),skillKey:String(r.agentSession?.skillKey||"")},r.style={...as(),...r.style||{}},delete r.style.brandPrimary,delete r.style.brandAccent,Object.keys(es).includes(r.style.theme)||(r.style.theme="executive"),["compact","standard","spacious","loose"].includes(r.style.density)||(r.style.density="standard"),r.style.density=En(r.style.density),["sans","serif"].includes(r.style.fontFamily)||(r.style.fontFamily=r.style.fontFamily==="serif"?"serif":"sans"),["light","dark"].includes(r.style.colorMode)||(r.style.colorMode="light"),r.style.stylePreset=Yo(typeof r.style.stylePreset=="string"?r.style.stylePreset:""),r.generation=ki(r.generation),r.sources=Vf(r.sources),r.brief.slideTarget=nc(r.brief.slideTarget);let n=r.generation.active&&Array.isArray(r.slides)&&r.slides.length===0;r.outline=n?[]:Array.isArray(r.outline)?r.outline.map(a=>String(a||$("newSlideTitle"))):[],r.slides=n?[]:Array.isArray(r.slides)&&r.slides.length>0?r.slides.map((a,o)=>Ur(a,o,r)):r.outline.length>0?r.outline.map((a,o)=>os(a,o,r.outline.length,r)):[],r.slides.some(a=>a.id===r.activeSlideId)||(r.activeSlideId=r.slides[0]?.id||"");let i=qt(r);return i?.elements.some(a=>a.id===r.selectedElementId)||(r.selectedElementId=i?.elements[0]?.id||""),r.title=r.title||r.slides[0]?.title||$("defaultDeckTitle"),r.updatedAt=Date.now(),r}function Vf(e={}){return{items:Array.isArray(e.items)?e.items:[],facts:Array.isArray(e.facts)?e.facts:[],warnings:Array.isArray(e.warnings)?e.warnings:[],summary:typeof e.summary=="string"?e.summary:"",fetchedAt:Number(e.fetchedAt||0)}}function uc(){return[{id:"brief",label:$("generationStepBrief"),detail:$("generationStepBriefDetail")},{id:"spine",label:$("generationStepSpine"),detail:$("generationStepSpineDetail")},{id:"proof",label:$("generationStepProof"),detail:$("generationStepProofDetail")},{id:"design",label:$("generationStepDesign"),detail:$("generationStepDesignDetail")},{id:"compile",label:$("generationStepCompile"),detail:$("generationStepCompileDetail")}]}var Xf=80,Hf=200;function Kf(e={}){let r=typeof e=="string"?{title:e}:e||{},t=String(r.title||r.label||r.message||$("processEventUnknown")).trim()||$("processEventUnknown"),n=String(r.kind||"info").toLowerCase().replace(/[^a-z0-9-]/g,"")||"info",i=Number(r.timestamp||r.time||0)||Date.now();return{id:String(r.id||ir("generation-event")),seq:Number(r.seq)||0,title:t,detail:String(r.detail||r.description||"").trim(),kind:n,timestamp:i}}function ki(e={}){let r=new Map((Array.isArray(e.steps)?e.steps:[]).map(a=>[a.id,a])),t=Array.isArray(e.events)?e.events.map(Kf).slice(-Xf):[],n=t.reduce((a,o)=>Math.max(a,Number(o.seq)||0),0),i=Array.isArray(e.agentStream)?e.agentStream.slice(-Hf):[];return{active:!!e.active,current:e.current||"idle",draftedCount:Number(e.draftedCount)||0,slideTarget:Number(e.slideTarget)||0,eventSeq:Math.max(Number(e.eventSeq)||0,n),steps:uc().map(a=>({...a,status:r.get(a.id)?.status||"pending"})),events:t,agentStream:i}}function qt(e){return e.slides.find(r=>r.id===e.activeSlideId)||e.slides[0]}function Jt(e){return Math.max(0,e.slides.findIndex(r=>r.id===e.activeSlideId))}function Rn(e){return qt(e)?.elements.find(t=>t.id===e.selectedElementId)||null}function os(e,r,t,n={brief:is(),style:as(),slides:[]}){let i=dc(n,r),a={id:ir("slide"),title:e||`${$("newSlideTitle")} ${r+1}`,subtitle:"",kicker:hc(r,n),claim:ls(e,r,n),proofObject:Pa(r,n),supportNote:pc(e,r,n),sourceNote:Ac(n),notes:$("defaultSpeakerNote",{title:e}),layout:fc(r,t),theme:i,elements:[]};return a.elements=gc(a,r,t,n),Ur(a,r,n)}function Ur(e,r,t){let n=e?.title||`${$("newSlideTitle")} ${r+1}`,i={id:e?.id||ir("slide"),title:n,subtitle:e?.subtitle||"",kicker:String(e?.kicker||hc(r,t)),claim:String(e?.claim||ls(n,r,t)),proofObject:String(e?.proofObject||Pa(r,t)),supportNote:String(e?.supportNote||pc(n,r,t)),sourceNote:String(e?.sourceNote||Ac(t)),notes:e?.notes||"",layout:e?.layout||fc(r,t?.slides?.length||1),theme:{...dc(t,r),...e?.theme||e?.style||{}},html:typeof e?.html=="string"?e.html:"",quality:Qf(e?.quality),elements:[]},a=Array.isArray(e?.elements)&&e.elements.length>0?e.elements:gc(i,r,t?.slides?.length||1,t);if(i.elements=a.map(o=>ss(o)),i.html){let o=Ca(i.html);o&&(i.theme.background=o)}return i}function Qf(e={}){let r=Array.isArray(e?.issues)?e.issues:[];return{score:mt(Number(e?.score??100),0,100),issues:r.slice(0,12).map(t=>({id:String(t?.id||ir("quality")),severity:["high","medium","low"].includes(t?.severity)?t.severity:"low",type:String(t?.type||"quality"),message:String(t?.message||"")})).filter(t=>t.message)}}function ss(e={}){let r=ns.includes(e.type)?e.type:"text",t=ka(r);return{...t,...e,id:e.id||ir("el"),type:r,x:mt(Number(e.x??t.x),0,98),y:mt(Number(e.y??t.y),0,98),w:mt(Number(e.w??t.w),3,100),h:mt(Number(e.h??t.h),3,100),text:typeof e.text=="string"?e.text:t.text,label:typeof e.label=="string"?e.label:t.label,items:Array.isArray(e.items)?e.items.map(String):t.items,data:Array.isArray(e.data)?e.data.map(Zf):t.data,style:Yf({...t.style,...e.style||{}})}}function Zf(e,r){return typeof e=="number"?{label:`Q${r+1}`,value:e}:{label:String(e?.label||`Item ${r+1}`),value:Number(e?.value||0)}}function Yf(e={}){return{fontSize:mt(Number(e.fontSize||24),8,88),fontWeight:mt(Number(e.fontWeight||600),100,900),color:e.color||"ink",background:e.background||"transparent",opacity:mt(Number(e.opacity??1),0,1),borderRadius:mt(Number(e.borderRadius||0),0,99),align:e.align||"left"}}function ka(e){let r={text:{text:"Key message",label:"",items:[],data:[],x:8,y:12,w:60,h:16,style:{fontSize:38,fontWeight:780,color:"ink",background:"transparent",borderRadius:0,opacity:1,align:"left"}},list:{text:"",label:"",items:["First point","Second point","Third point"],data:[],x:9,y:36,w:48,h:40,style:{fontSize:20,fontWeight:500,color:"ink",background:"transparent",borderRadius:8,opacity:1,align:"left"}},shape:{text:"",label:"",items:[],data:[],x:66,y:14,w:24,h:62,style:{fontSize:18,fontWeight:600,color:"accent",background:"primary",borderRadius:22,opacity:.12,align:"center"}},metric:{text:"3x",label:"Faster first draft",items:[],data:[],x:63,y:42,w:26,h:26,style:{fontSize:44,fontWeight:820,color:"primary",background:"panel",borderRadius:14,opacity:1,align:"left"}},chart:{text:"Signal trend",label:"",items:[],data:[{label:"Now",value:42},{label:"Next",value:68},{label:"Target",value:86}],x:52,y:36,w:36,h:32,style:{fontSize:18,fontWeight:700,color:"ink",background:"panel",borderRadius:14,opacity:1,align:"left"}},media:{text:$("mediaPlaceholder"),label:"",items:[],data:[],x:58,y:18,w:32,h:42,style:{fontSize:16,fontWeight:650,color:"muted",background:"soft",borderRadius:16,opacity:1,align:"center"}}};return{...sn(r[e]||r.text),type:r[e]?e:"text"}}function dc(e,r=0){let t=e?.deckPalette;if(t&&typeof t=="object"){let o=t.primary||"#111111",l=t.accent||"#c84b31";return ic({name:"deck",background:t.background||"#111111",ink:t.ink||"#f8fafc",muted:t.muted||"#cbd5e1",primary:r%2?l:o,accent:r%2?o:l,panel:t.panel||"#1f2937"})}let n=es[e?.style?.theme||"executive"]||es.executive,i=n.primary,a=n.accent;return ic({...n,primary:r%2?a:i,accent:r%2?i:a})}function Ca(e){let r=String(e||""),t=[/body\s*\{[^}]*background(?:-color)?\s*:\s*([^;}\n]+)/i,/]*style="[^"]*background(?:-color)?\s*:\s*([^;"']+)/i,/html\s*\{[^}]*background(?:-color)?\s*:\s*([^;}\n]+)/i,/:root\s*\{[^}]*background(?:-color)?\s*:\s*([^;}\n]+)/i,/background(?:-color)?\s*:\s*(#[0-9a-f]{3,8}|rgb[a]?\([^)]+\)|hsl[a]?\([^)]+\)|black|white)/i];for(let n of t){let i=r.match(n);if(!i)continue;let a=Jf(i[1]);if(a)return a}return null}function Jf(e){let r=String(e||"").trim().replace(/\s+!important$/i,"");if(!r||/^transparent$/i.test(r))return null;if(/^#[0-9a-f]{3,8}$/i.test(r))return on(r,r);if(/^rgb/i.test(r)||/^hsl/i.test(r))return r;let t={black:"#000000",white:"#ffffff",transparent:null};return Object.prototype.hasOwnProperty.call(t,r.toLowerCase())?t[r.toLowerCase()]:r}function ic(e){let r=on(e.background,"#ffffff"),t=on(e.panel,"#ffffff");return{...e,background:r,panel:t,ink:ba(r,e.ink,"#111827","#f8fafc",7),muted:ba(r,e.muted,"#4b5563","#cbd5e1",4.5),primary:ba(t,e.primary,"#0f766e","#5eead4",4.5),accent:ba(t,e.accent,"#c2410c","#fdba74",4.5)}}function ba(e,r,t,n,i){let a=on(e,"#ffffff"),o=on(r,t);if($o(a,o)>=i)return o;let l=on(t,"#111827"),c=on(n,"#f8fafc");return $o(a,l)>=$o(a,c)?l:c}function $o(e,r){let t=ac(e),n=ac(r),i=Math.max(t,n),a=Math.min(t,n);return(i+.05)/(a+.05)}function ac(e){let{r,g:t,b:n}=$f(e);return[r,t,n].map(i=>{let a=i/255;return a<=.03928?a/12.92:((a+.055)/1.055)**2.4}).reduce((i,a,o)=>i+a*[.2126,.7152,.0722][o],0)}function on(e,r){let t=String(e||"").trim(),n=t.match(/^#([0-9a-f]{3})$/i);return n?`#${n[1].split("").map(i=>i+i).join("")}`.toLowerCase():/^#[0-9a-f]{6}$/i.test(t)?t.toLowerCase():r}function $f(e){let r=on(e,"#000000").slice(1),t=parseInt(r,16);return{r:t>>16&255,g:t>>8&255,b:t&255}}function fc(e,r){return e===0?"cover":e===r-1?"closing":["split","metric","process","comparison"][e%4]}function hc(e,r){let t=sc();return(t.arc[e%t.arc.length]||"proof").replace(/[-_]/g," ").toUpperCase()}function Pa(e,r){let t=sc(),n=t.proofObjects[e%t.proofObjects.length]||"visual proof";return{"market map":$("proofMarketMap"),"operating model":$("proofOperatingModel"),"risk bridge":$("proofRiskBridge"),"decision table":$("proofDecisionTable"),"before/after workflow":$("proofBeforeAfter"),"value bridge":$("proofValueBridge"),"customer proof":$("proofCustomerProof"),"implementation plan":$("proofImplementationPlan"),"metric bridge":$("proofMetricBridge"),"trend chart":$("proofTrendChart"),"variance table":$("proofVarianceTable"),"risk register":$("proofRiskRegister"),"concept map":$("proofConceptMap"),"worked example":$("proofWorkedExample"),comparison:$("proofComparison"),"practice prompt":$("proofPracticePrompt"),"market wedge":$("proofMarketWedge"),"product diagram":$("proofProductDiagram"),"traction chart":$("proofTractionChart"),"milestone plan":$("proofMilestonePlan"),"visual proof":$("proofVisualProof")}[n]||n}function ls(e,r,t){let n=t?.brief?.topic||t?.title||e;if(r===0)return $("claimCover",{topic:n});if(e&&/[.!?。!?]$/.test(e.trim()))return e;let i=[$("claimPressure",{title:e}),$("claimDecision",{title:e}),$("claimProof",{title:e}),$("claimAction",{title:e})];return i[r%i.length]}function pc(e,r,t){let n=Pa(r,t);return $("supportWithAssumption",{proof:n})}function Ac(e){return $("sourceDraftAssumption")}function gc(e,r,t,n){let i=e.title,a=lc(n?.style?.density),o=th(i,r,n).slice(0,a.bulletLimit).map(c=>String(c).slice(0,90)),l=eh(e,r,t);return l==="cover"?[Ft("shape",{x:6,y:9,w:88,h:76,style:{background:"soft",opacity:1,borderRadius:28}}),Ft("shape",{x:9,y:15,w:1.2,h:55,style:{background:"primary",opacity:1,borderRadius:99}}),Ft("text",{text:e.kicker,x:13,y:15,w:22,h:5,style:{fontSize:10,fontWeight:760,color:"primary"}}),Ft("text",{text:i,x:13,y:23,w:58,h:25,style:{fontSize:i.length>48?34:44,fontWeight:840}}),Ft("text",{text:e.claim,x:14,y:55,w:45,h:11,style:{fontSize:18,fontWeight:520,color:"muted"}}),Ft("metric",{text:String(t),label:$("slidesUnit"),x:75,y:54,w:14,h:17,style:{fontSize:34}})]:l==="closing"?[Ft("text",{text:i,x:9,y:15,w:65,h:15,style:{fontSize:i.length>48?30:38,fontWeight:820}}),Ft("text",{text:e.claim,x:10,y:33,w:46,h:9,style:{fontSize:17,fontWeight:540,color:"muted"}}),...wa([$("closeConfirm"),$("closeOwner"),$("closeIteration")],10,50,52,22,3),Ft("text",{text:o[0]||e.supportNote,x:67,y:48,w:22,h:20,style:{fontSize:18,fontWeight:720,color:"primary",background:"soft",borderRadius:20}})]:l==="process"?[Ft("text",{text:i,x:8,y:10,w:68,h:12,style:{fontSize:32,fontWeight:820}}),Ft("text",{text:e.claim,x:9,y:25,w:54,h:7,style:{fontSize:15,fontWeight:520,color:"muted"}}),Ft("shape",{x:10,y:50,w:78,h:1.2,style:{background:"primary",opacity:.25,borderRadius:99}}),...wa(o.map((c,s)=>`0${s+1} ${c}`),10,37,78,28,Math.min(a.cardColumns,Math.max(2,o.length)),a.cardGap)]:l==="comparison"?[Ft("text",{text:i,x:7,y:10,w:72,h:12,style:{fontSize:32,fontWeight:820}}),Ft("text",{text:e.claim,x:8,y:25,w:48,h:7,style:{fontSize:15,fontWeight:520,color:"muted"}}),...wa(o,8,37,82,30,2,a.cardGap)]:l==="data"?[Ft("text",{text:i,x:8,y:10,w:66,h:12,style:{fontSize:32,fontWeight:820}}),Ft("text",{text:e.claim,x:9,y:25,w:47,h:7,style:{fontSize:15,fontWeight:520,color:"muted"}}),Ft("metric",{text:String(r).padStart(2,"0"),label:e.proofObject,x:10,y:40,w:34,h:28,style:{fontSize:44}}),Ft("text",{text:o[0]||e.supportNote,x:69,y:41,w:20,h:24,style:{fontSize:17,fontWeight:700,color:"primary",background:"soft",borderRadius:18}})]:l==="cards"?[Ft("text",{text:i,x:8,y:10,w:68,h:12,style:{fontSize:32,fontWeight:820}}),Ft("text",{text:e.claim,x:9,y:25,w:51,h:8,style:{fontSize:15,fontWeight:520,color:"muted"}}),...wa(o,9,38,78,28,a.cardColumns,a.cardGap)]:[Ft("text",{text:i,x:10,y:15,w:62,h:15,style:{fontSize:i.length>48?30:38,fontWeight:820}}),Ft("text",{text:e.claim,x:11,y:34,w:42,h:10,style:{fontSize:17,fontWeight:520,color:"muted"}}),Ft("text",{text:o[0]||e.supportNote,x:58,y:38,w:28,h:24,style:{fontSize:22,fontWeight:760,color:"primary",background:"soft",borderRadius:22}}),Ft("shape",{x:10,y:72,w:18,h:.6,style:{background:"primary",opacity:1,borderRadius:99}})]}function eh(e,r,t){let n=[e.layout,e.kicker,e.proofObject,e.claim,e.title].join(" ").toLowerCase();return r===0||e.layout==="cover"?"cover":r===t-1||e.layout==="closing"?"closing":/process|workflow|timeline|roadmap|journey|steps|architecture|flow|流程|步骤|路线|架构/.test(n)?"process":/compare|comparison|versus|matrix|before|after|risk|对比|比较|矩阵|风险/.test(n)?"comparison":/data|metric|trend|scorecard|chart|number|数据|指标|趋势/.test(n)?"data":r%3===1?"cards":"spotlight"}function wa(e,r,t,n,i,a,o=2.5){let l=e.filter(Boolean),c=Math.max(1,Math.min(a||1,l.length||1)),s=Number.isFinite(o)?o:2.5,u=Math.max(1,Math.ceil((l.length||1)/c)),d=(n-s*(c-1))/c,A=(i-s*(u-1))/u;return l.map((f,p)=>Ft("text",{text:f,x:r+p%c*(d+s),y:t+Math.floor(p/c)*(A+s),w:d,h:A,style:{fontSize:17,fontWeight:p===0?760:620,color:p===0?"primary":"ink",background:p===0?"soft":"panel",borderRadius:18}}))}function Ft(e,r){let t=ka(e);return{...t,...r,style:{...t.style,...r.style||{}}}}function th(e,r,t){let n=t?.brief?.topic||e,i=Pa(r,t),a=[`${$("pointClaimPrefix")} ${ls(e,r,t)}`,`${$("pointProofPrefix")} ${i}`,`${$("pointAudiencePrefix")} ${n}`,$("pointEvidenceRule"),$("pointDesignRule"),$("pointCloseRule")],o=lc(t?.style?.density).bulletLimit,l=[];for(let c=0;c{r!==e&&Fa(r)})}function cs(e){let r=e.querySelector(".ppt-flat-select__menu"),t=e.querySelector(".ppt-flat-select__trigger");if(!r||!t)return;let n=t.getBoundingClientRect(),i=Math.min(220,r.scrollHeight||220),a=window.innerHeight-n.bottom,o=aa;r.style.left=`${Math.max(8,n.left)}px`,r.style.width=`${n.width}px`,o?(r.style.top="auto",r.style.bottom=`${window.innerHeight-n.top+4}px`):(r.style.top=`${n.bottom+4}px`,r.style.bottom="auto")}function mc(e){let r=e.querySelector(".ppt-flat-select__menu"),t=e.querySelector(".ppt-flat-select__trigger");if(!r||!t)return;Ta(null),r.hidden=!1,cs(e),t.setAttribute("aria-expanded","true"),e.classList.add("is-open"),Kn.add(e),r.querySelector(".ppt-flat-select__option.is-selected")?.scrollIntoView({block:"nearest"})}function rh(e,r){let t=e.querySelector(".ppt-flat-select__menu");if(!t||t.hidden)return;let n=[...t.querySelectorAll(".ppt-flat-select__option")];if(!n.length)return;let i=n.indexOf(document.activeElement),a=i>=0?i:n.findIndex(l=>l.classList.contains("is-selected")),o=Math.min(n.length-1,Math.max(0,(a<0?-r:a)+r));n[o]?.focus(),n[o]?.scrollIntoView({block:"nearest"})}function us(e){let r=e.closest(".ppt-flat-select");if(!r)return;let t=r.querySelector(".ppt-flat-select__label"),n=r.querySelector(".ppt-flat-select__menu"),i=e.options[e.selectedIndex];if(t&&(t.textContent=i?.textContent?.trim()||""),!n)return;let a=new Map([...n.querySelectorAll(".ppt-flat-select__option")].map(o=>[o.dataset.value,o]));[...e.options].forEach(o=>{let l=a.get(o.value);l||(l=document.createElement("button"),l.type="button",l.className="ppt-flat-select__option",l.setAttribute("role","option"),l.dataset.value=o.value,l.addEventListener("click",()=>{e.value=o.value,us(e),Fa(r),e.dispatchEvent(new Event("change",{bubbles:!0}))}),n.append(l)),l.textContent=o.textContent,o.title&&(l.title=o.title);let c=o.value===e.value;l.classList.toggle("is-selected",c),l.setAttribute("aria-selected",c?"true":"false")}),[...n.querySelectorAll(".ppt-flat-select__option")].forEach(o=>{[...e.options].some(l=>l.value===o.dataset.value)||o.remove()}),r.classList.contains("is-open")&&cs(r)}function nh(e){if(!(e instanceof Node))return!1;for(let r of Kn){let t=r.querySelector(".ppt-flat-select__menu");if(t&&(t===e||t.contains(e)))return!0}return!1}function ih(e){nh(e.target)||Ta(null)}function ah(e){let r=e.target;if(r instanceof Node){for(let t of Kn)if(t.contains(r))return}Ta(null)}function vc(e){if(!e||e.dataset.flatSelect==="true")return;e.dataset.flatSelect="true",e.classList.remove("ppt-flat-select"),e.classList.add("ppt-flat-select__native"),e.tabIndex=-1,e.setAttribute("aria-hidden","true");let r=document.createElement("div");r.className="ppt-flat-select";let t=document.createElement("button");t.type="button",t.className="ppt-flat-select__trigger",t.setAttribute("aria-haspopup","listbox"),t.setAttribute("aria-expanded","false");let n=document.createElement("span");n.className="ppt-flat-select__label",t.append(n);let i=document.createElement("div");i.className="ppt-flat-select__menu",i.hidden=!0,i.setAttribute("role","listbox"),i.addEventListener("wheel",o=>o.stopPropagation(),{passive:!0}),i.addEventListener("mousedown",o=>o.stopPropagation()),t.addEventListener("click",o=>{if(o.stopPropagation(),r.classList.contains("is-open")){Fa(r);return}mc(r)}),r.addEventListener("keydown",o=>{o.key==="ArrowDown"||o.key==="ArrowUp"?(o.preventDefault(),r.classList.contains("is-open")||mc(r),rh(r,o.key==="ArrowDown"?1:-1)):o.key==="Escape"&&r.classList.contains("is-open")&&(o.stopPropagation(),Fa(r),t.focus())}),e.parentNode.insertBefore(r,e),r.append(t,i,e),us(e)}function Ci(e){us(e)}window.__pptLiveFlatSelectBound||(window.__pptLiveFlatSelectBound=!0,document.addEventListener("click",ah),document.addEventListener("keydown",e=>{e.key==="Escape"&&Ta(null)}),window.addEventListener("resize",()=>{Kn.forEach(e=>cs(e))}),document.addEventListener("scroll",ih,!0));function Pc(){document.documentElement.lang=Nr(),document.querySelectorAll("[data-i18n]").forEach(e=>{e.textContent=$(e.dataset.i18n)}),document.querySelectorAll("[data-i18n-placeholder]").forEach(e=>{e.placeholder=$(e.dataset.i18nPlaceholder)}),document.querySelectorAll("[data-i18n-aria]").forEach(e=>{e.setAttribute("aria-label",$(e.dataset.i18nAria))})}function Fc(e,r){wh(e),mr(e),Ir(e),Sh(e,r),Nn(e,r),cn(e,r),Ma(e,r),Ln(),document.querySelectorAll(".segment").forEach(i=>{i.classList.toggle("is-active",i.dataset.mode===e.mode)});let t=Jt(e),n=Bt("slidePosition");n&&(n.textContent=`${t+1} / ${e.slides?.length||1}`)}var yc="",Pi=0,Tc=120,oh=20;function sh(e){return{x:(parseFloat(e.paddingLeft)||0)+(parseFloat(e.paddingRight)||0),y:(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}}function Dc(e,r={}){if(!e)return{width:0,height:0};let t=getComputedStyle(e),n=sh(t),i=Math.max(0,(e.clientWidth||0)-n.x),a=Math.max(0,(e.clientHeight||0)-n.y),o=e.getBoundingClientRect();o.width>0&&(i=Math.max(i,o.width-n.x)),o.height>0&&(a=Math.max(a,o.height-n.y));let l=r.minHeight??Tc,c=r.fallback;if(c&&a0&&(i=Math.max(i,s.width-n.x)),s.height>0&&(a=Math.max(a,s.height-n.y))}return{width:Math.max(0,i),height:Math.max(0,a)}}function lh(e){if(!e)return 0;let r=e.getBoundingClientRect();return Math.max(e.clientWidth||0,e.offsetWidth||0,r.width||0)}function Ln(){Pi&&cancelAnimationFrame(Pi);let e=(r=0)=>{Pi=0,Qn(),ys(),za(),Mc();let t=Bt("slideCanvas")?.closest(".canvas-area");if(!t||r>=oh)return;let{height:n}=Dc(t,{fallback:t.closest(".stage-shell")});ne(r+1)))};Pi=requestAnimationFrame(()=>e(0))}function Qn(){let e=Bt("slideCanvas"),r=e?.closest(".canvas-area"),t=e?.closest(".canvas-stage");if(!e||!r||!t)return;let{width:n,height:i}=Dc(r,{fallback:r.closest(".stage-shell")}),a=Math.max(160,n),o=Math.max(90,i),l=a,c=l*9/16;c>o&&(c=o,l=c*16/9);let s=Math.floor(l),u=Math.floor(c),d=`${a}x${o}`;if(d===yc&&t.style.width===`${s}px`&&t.style.height===`${u}px`){let p=e.querySelector(`.${Ar}`);p&&gr(p);return}yc=d,t.style.width=`${s}px`,t.style.height=`${u}px`,e.style.width="100%",e.style.height="100%";let A=Bt("presentSlide");A&&(A.style.width=`${s}px`,A.style.height=`${u}px`);let f=e.querySelector(`.${Ar}`);f&&gr(f)}function ch(e){let r=Bt("floatingToolbar"),t=Bt("slideCanvas");if(!r||!t||!e){r&&r.classList.remove("is-visible");return}let n=t.getBoundingClientRect(),i=e.x/100*n.width,a=e.y/100*n.height,o=e.w/100*n.width;r.style.left=`${n.left+i+o/2-r.offsetWidth/2}px`,r.style.top=`${n.top+a-r.offsetHeight-8}px`,r.classList.add("is-visible")}function ds(e,r){let t=String(e||"").trim(),n=parseFloat(t);return Number.isFinite(n)?t.endsWith("pt")?n*(96/72):(t.endsWith("px"),n):r}function As(e,r,t){return String(e||"").replace(/(^|[^-.\w]):root(?![\w-])/gi,`$1${r}`).replace(/(^|[^-.\w])html(?![\w-])/gi,`$1${r}`).replace(/(^|[^-.\w])body(?![\w-])/gi,`$1${t}`)}var Ar="html-slide-preview-host",Ec="html-slide-preview-scaler",gs={width:1280,height:720};function uh(e){let r=String(e||""),t=r.match(/(?:^|[{;\s])width\s*:\s*([\d.]+)\s*pt/i),n=r.match(/(?:^|[{;\s])height\s*:\s*([\d.]+)\s*pt/i);if(t?.[1]&&n?.[1])return{width:Math.round(parseFloat(t[1])*(96/72)),height:Math.round(parseFloat(n[1])*(96/72))};let i=r.match(/(?:^|[{;\s])width\s*:\s*([\d.]+)\s*px/i),a=r.match(/(?:^|[{;\s])height\s*:\s*([\d.]+)\s*px/i);return i?.[1]&&a?.[1]?{width:Math.round(parseFloat(i[1])),height:Math.round(parseFloat(a[1]))}:{...gs}}function dh(e){let r=Number(e?.dataset?.designW),t=Number(e?.dataset?.designH);return Number.isFinite(r)&&r>=320&&Number.isFinite(t)&&t>=180?{width:r,height:t}:null}function fh(e){let r=e?.body,t=e?.documentElement,n=e?.defaultView;if(!r||!t||!n)return{...gs};let i=n.getComputedStyle(r),a=ds(i.width,0),o=ds(i.height,0)||ds(i.minHeight,0);if(a>=320&&o>=180)return{width:a,height:o};let l=Math.max(r.scrollWidth||0,r.offsetWidth||0,t.clientWidth||0,1280),c=Math.max(r.scrollHeight||0,r.offsetHeight||0,t.clientHeight||0,720);return l=Math.min(Math.max(l,320),3840),c=Math.min(Math.max(c,180),3840),{width:l,height:c}}function hh(e,r){let t=dh(r);return t||(e?.body?fh(e):{...gs})}function ms(e){if(!e)return{width:0,height:0};let r=e.getBoundingClientRect();return{width:Math.max(e.clientWidth||0,e.offsetWidth||0,r.width||0),height:Math.max(e.clientHeight||0,e.offsetHeight||0,r.height||0)}}function Bc(e,r){let t=uh(r);return e.dataset.designW=String(t.width),e.dataset.designH=String(t.height),t}var bc="data-ppt-live-editing-style",Zn="data-ppt-live-editable";function ph(e,r){!e||e._pptLiveOriginalInline||!r?.documentElement||!r.body||(e._pptLiveOriginalInline={root:r.documentElement.getAttribute("style"),body:r.body.getAttribute("style")})}function Ah(e,r,t){if(!e?.documentElement||!e.body)return;let n=e.documentElement,i=e.body;n.style.margin="0",n.style.padding="0",n.style.width=`${r}px`,n.style.height=`${t}px`,n.style.overflow="hidden",i.style.margin="0",i.style.boxSizing="border-box",i.style.width=`${r}px`,i.style.height=`${t}px`,i.style.minHeight="",i.style.maxWidth="",i.style.overflow="hidden",i.style.transform="none"}function gr(e){let r=e?.classList?.contains(Ar)?e:e?.closest?.(`.${Ar}`);if(!r)return!1;let t=r.querySelector(`.${Ec}`),n=t?.querySelector("iframe, [data-slide-stage]");if(!t||!n)return!1;let{width:i,height:a}=ms(r);if(!i||!a)return!1;let o=n.tagName==="IFRAME",l=null;if(o)try{l=n.contentDocument}catch{l=null}let{width:c,height:s}=hh(l,n),u=Math.min(i/c,a/s),d=c*u,A=s*u;return l&&(ph(n,l),Ah(l,c,s)),t.style.width=`${d}px`,t.style.height=`${A}px`,t.style.overflow="hidden",t.style.position="relative",t.style.flexShrink="0",n.style.display="block",n.style.width=`${c}px`,n.style.height=`${s}px`,n.style.border="0",n.style.margin="0",n.style.padding="0",n.style.maxWidth="none",n.style.maxHeight="none",n.style.transformOrigin="top left",n.style.transform=`scale(${u})`,!0}var wc="ppt-slide-shadow-root",ps="ppt-slide-shadow-body";function gh(e){return e.querySelectorAll('script, iframe, object, embed, meta[http-equiv="refresh" i]').forEach(r=>r.remove()),e.querySelectorAll("*").forEach(r=>{for(let t of[...r.attributes]){let n=t.name.toLowerCase();(n.startsWith("on")||(n==="href"||n==="src"||n==="xlink:href")&&/^\s*javascript:/i.test(t.value))&&r.removeAttribute(t.name)}}),e}function mh(e,r){let t=document.createElement("div");t.className=r,t.dataset.slideStage="true",Bc(t,e);let n=Number(t.dataset.designW),i=Number(t.dataset.designH),a=gh(new DOMParser().parseFromString(Wr(e),"text/html")),o=t.attachShadow({mode:"open"}),l=document.createElement("div");l.className=wc,l.style.cssText=["all:initial","display:block","position:relative",`width:${n}px`,`height:${i}px`,"margin:0","padding:0","overflow:hidden",'font-family:system-ui, -apple-system, "PingFang SC", "Source Han Sans SC", sans-serif',"font-size:16px","line-height:normal","color:#000","background:#fff"].join(";"),a.querySelectorAll("style").forEach(s=>{let u=document.createElement("style");u.textContent=As(s.textContent||"",`.${wc}`,`.${ps}`),o.appendChild(u)});let c=document.createElement("div");if(c.className=ps,a.body){for(let s of a.body.attributes)s.name==="class"?c.classList.add(...s.value.split(/\s+/).filter(Boolean)):s.name==="style"?c.style.cssText+=`;${s.value}`:s.name.toLowerCase().startsWith("on")||c.setAttribute(s.name,s.value);c.innerHTML=a.body.innerHTML}return c.style.boxSizing="border-box",/\bwidth\s*:/i.test(c.style.cssText)||(c.style.width=`${n}px`),/\bheight\s*:/i.test(c.style.cssText)||(c.style.height=`${i}px`),c.style.overflow="hidden",c.style.margin="0",l.appendChild(c),o.appendChild(l),t._pptLiveSourceHtml=String(e||""),t}function vs({hostClass:e="",frameClass:r,html:t,onReady:n,interactive:i=!1}){let a=document.createElement("div");a.className=[Ar,e].filter(Boolean).join(" ");let o=document.createElement("div");if(o.className=Ec,i){let s=mh(t,r);return o.appendChild(s),a.appendChild(o),requestAnimationFrame(()=>{gr(a),n?.(s,a)}),{host:a,scaler:o,frame:s}}let l=document.createElement("iframe");l.className=r,l.setAttribute("sandbox","allow-same-origin"),l.setAttribute("loading","lazy"),Bc(l,t),l.srcdoc=Wr(t);let c=()=>{gr(a),n?.(l,a)};return l.addEventListener("load",c,{once:!0}),o.appendChild(l),a.appendChild(o),{host:a,scaler:o,frame:l}}function Rc(e){let{host:r}=vs({hostClass:"export-preview__html-stage",frameClass:"export-preview__html-frame",html:e,onReady:()=>{r.closest(".export-preview__viewport")&&gr(r)}});return r}function Lc(e){if(!e)return;let r=e.querySelector(".export-preview__viewport")||e,t=r.querySelector(".export-preview__scale");if(!t)return;let n=t.querySelector(`.${Ar}`);if(n){t.style.width="100%",t.style.height="100%",gr(n);return}let i=t.querySelector(".export-preview__element-stage");if(!i)return;let{width:a,height:o}=ms(r);if(!a||!o)return;let l=960,c=540,s=Math.min(a/l,o/c);i.style.width=`${l}px`,i.style.height=`${c}px`,i.style.transform=`scale(${s})`,i.style.transformOrigin="top left",t.style.width=`${Math.floor(l*s)}px`,t.style.height=`${Math.floor(c*s)}px`}function vh(e){if(!e||new Set(["turn","round","round-done","tokens","text","thinking"]).has(e.kind||""))return"";let t=String(e.detail||"").trim();return!t||/^[0-9a-f-]{8,}/i.test(t)?"":t}function Nc(e){if(!e)return;(typeof requestAnimationFrame=="function"?requestAnimationFrame:t=>setTimeout(t,0))(()=>{e.scrollTop=e.scrollHeight})}function mr(e){let r=Bt("generationSteps"),t=Bt("agentStreamList"),n=e.generation?.steps||[],i=Array.isArray(e.generation?.events)?e.generation.events:[],a=Array.isArray(e.generation?.agentStream)?e.generation.agentStream:[],o=!!(e.generation?.active||n.some(c=>c.status==="running")),l=n.some(c=>c.status==="error");if(document.querySelector(".ppt-live")?.classList.toggle("is-generating",o),document.querySelector(".ppt-live")?.classList.toggle("has-generation-error",l),!!r){if(r.innerHTML="",i.length)i.forEach((c,s)=>{let u=vh(c),d=document.createElement("li");d.className=`generation-event is-${c.kind||"info"}`,d.innerHTML=` - ${Number(c.seq)||s+1} - - ${Le(c.title||$("processEventUnknown"))} - ${u?`${Le(u)}`:""} - - `,r.append(d)});else{let c=document.createElement("li");c.className="generation-event is-empty",c.innerHTML=` +\u589E\u91CF\u751F\u6210\uFF1A\u8865\u5145\u65B0\u4FE1\u606F\uFF0C\u4F8B\u5982\u201C\u8865\u5145\u4E00\u6BB5\u7ADE\u54C1\u5206\u6790\uFF0C\u52A0\u5230\u7B2C 4 \u9875\u4E4B\u540E\u201D\u3002`,sendPrompt:"\u53D1\u9001",promptRequired:"\u8BF7\u8F93\u5165\u4F60\u5E0C\u671B PPT Live \u505A\u4EC0\u4E48\u3002",topicLabel:"\u76EE\u6807",topicPlaceholder:"\u76F4\u63A5\u63CF\u8FF0\u4F60\u60F3\u8981\u7684\u6F14\u793A\u7A3F\uFF1B\u4EC5\u5728\u9700\u8981\u65F6\u8BF4\u660E\u9875\u6570\u6216\u53C2\u8003 URL\u3002",audienceLabel:"\u53D7\u4F17",audiencePlaceholder:"\u9AD8\u7BA1\u3001\u5BA2\u6237\u3001\u5B66\u751F\u3001\u56E2\u961F\u6210\u5458...",slidesLabel:"\u9875\u6570",deckTypeLabel:"\u7C7B\u578B",deckTypeStrategy:"\u6218\u7565\u65B9\u6848",deckTypeSales:"\u9500\u552E\u63D0\u6848",deckTypeReport:"\u4E1A\u52A1\u6C47\u62A5",deckTypeTeaching:"\u6559\u5B66\u8BFE\u4EF6",deckTypeFundraising:"\u878D\u8D44\u8DEF\u6F14",toneLabel:"\u8BED\u6C14",toneExecutive:"\u9AD8\u7BA1\u98CE",toneConcise:"\u7CBE\u7B80",tonePersuasive:"\u6709\u8BF4\u670D\u529B",toneEducational:"\u6559\u5B66\u578B",materialLabel:"\u7D20\u6750",materialPlaceholder:"\u7C98\u8D34\u7B14\u8BB0\u3001\u6587\u7AE0\u7247\u6BB5\u3001\u6570\u636E\u70B9\u3001\u4F1A\u8BAE\u8BB0\u5F55\u6216\u7C97\u7565\u9875\u9762\u8981\u6C42\u3002",advancedBrief:"\u53EF\u9009\u4E0A\u4E0B\u6587",processTitle:"\u751F\u6210\u8FC7\u7A0B",processSubcopy:"\u67E5\u770B\u5F53\u524D\u6F14\u793A\u7A3F\u7684\u751F\u6210\u8FDB\u5EA6\u3002",historyTitle:"\u5386\u53F2\u8BB0\u5F55",historySubcopy:"\u6062\u590D\u4E4B\u524D\u7684 PPT \u4F1A\u8BDD\uFF0C\u5E76\u7EE7\u7EED\u4FEE\u6539\u3002",historyEmpty:"\u751F\u6210\u548C\u4FEE\u6539\u8FC7\u7684 PPT \u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002",historyMeta:"{{count}} \u9875 \xB7 {{time}}",historyRestored:"\u5DF2\u6062\u590D PPT \u4F1A\u8BDD\u3002",stopGeneration:"\u505C\u6B62",generationStopped:"\u5DF2\u505C\u6B62\u751F\u6210\uFF0C\u4FDD\u7559\u5F53\u524D\u89C6\u56FE\u3002",generationTimedOut:"\u751F\u6210\u8017\u65F6\u8FC7\u957F\uFF0C\u672C\u6B21\u8FD0\u884C\u5DF2\u505C\u6B62\u3002",generationDraftReady:"\u6B63\u5728\u6574\u7406\u6700\u7EC8\u9875\u9762\u2026",generationAgentWorking:"\u6B63\u5728\u751F\u6210\u4F60\u7684\u6F14\u793A\u7A3F\u2026",backendGenerationFailed:"\u751F\u6210\u672A\u5B8C\u6210\uFF0C\u8BF7\u91CD\u8BD5\u6216\u505C\u6B62\u540E\u91CD\u65B0\u5F00\u59CB\u3002",backendGenerationFailedWithReason:"\u751F\u6210\u672A\u5B8C\u6210\uFF1A{{reason}}",generationRoundBudgetFailed:"\u751F\u6210\u6B65\u9AA4\u8FC7\u591A\uFF0C\u6F14\u793A\u7A3F\u5C1A\u672A\u5B8C\u6210\u3002",generationRoundBudgetHint:"\u53EF\u5C1D\u8BD5\u7F29\u77ED\u63CF\u8FF0\u3001\u51CF\u5C11\u9875\u6570\u6216\u53BB\u6389\u591A\u4F59\u53C2\u8003\u94FE\u63A5\uFF0C\u7136\u540E\u91CD\u65B0\u53D1\u9001\u3002",generationRetrying:"\u751F\u6210\u51FA\u73B0\u9519\u8BEF\uFF0C\u6B63\u5728\u81EA\u52A8\u91CD\u8BD5\uFF08{{attempt}}/{{max}}\uFF09\u2026",generationRetryAttempt:"\u7B2C {{attempt}}/{{max}} \u6B21\u5C1D\u8BD5\u3002",generationRecoveryContinuing:"{{stage}}\u5C1A\u672A\u5B8C\u6210\uFF0C\u6B63\u5728\u7EE7\u7EED\uFF08{{attempt}}/{{max}}\uFF09\u2026",generationRecoveryExhausted:"{{stage}}\u5728\u91CD\u8BD5 {{retries}} \u6B21\u540E\u4ECD\u672A\u5B8C\u6210\u3002",generationRecoveryFailureDetail:"\u539F\u56E0\uFF1A{{reason}}",generationStagePlanning:"\u89C4\u5212",generationStageSlide:"\u7B2C {{slide}} \u9875",generationStageAudit:"\u6700\u7EC8\u68C0\u67E5",generationStageBriefs:"\u7B2C {{start}}-{{end}} \u9875",agentOnlyRetryHint:"\u8BF7\u68C0\u67E5\u7F51\u7EDC\u8FDE\u63A5\uFF0C\u7A0D\u540E\u518D\u8BD5\u3002",generationPlanPhase:"\u6B63\u5728\u89C4\u5212\u6F14\u793A\u5185\u5BB9\u2026",generationPlanningSlides:"\u6B63\u5728\u89C4\u5212\u5404\u9875\u5185\u5BB9\u2026",generationPlanProgress:"\u5DF2\u89C4\u5212 {{count}} \u9875\u5185\u5BB9\u2026",generationPlanReady:"\u5DF2\u89C4\u5212 {{count}} \u9875\u5185\u5BB9",generationOutlineReady:"\u5927\u7EB2\u5DF2\u5B8C\u6210\uFF1A\u5171 {{count}} \u9875\uFF0C\u6B63\u5728\u64B0\u5199\u5404\u9875\u8981\u70B9\u2026",generationBriefsBatchReady:"\u7B2C {{start}}-{{end}} \u9875\u8981\u70B9\u5DF2\u5B8C\u6210\uFF08\u7D2F\u8BA1 {{total}} \u9875\uFF09\u3002",generationBriefsRetry:"\u7B2C {{start}}-{{end}} \u9875\u8981\u70B9\u9047\u5230\u95EE\u9898\uFF0C\u6B63\u5728\u91CD\u8BD5\uFF08{{attempt}}/{{max}}\uFF09\u2026",generationPlanRetry:"\u89C4\u5212\u9047\u5230\u95EE\u9898\uFF0C\u6B63\u5728\u91CD\u8BD5\uFF08{{attempt}}/{{max}}\uFF09\u2026",generationAuditRetry:"\u68C0\u67E5\u5C1A\u672A\u5B8C\u6210\uFF0C\u6B63\u5728\u91CD\u8BD5\uFF08{{attempt}}/{{max}}\uFF09\u2026",generationSlidesPhase:"\u5F00\u59CB\u751F\u6210 {{count}} \u9875 PPT",generationAuditPhase:"\u6B63\u5728\u68C0\u67E5\u6574\u5957\u6F14\u793A\u7A3F\u2026",generationRenderingSlide:"\u6B63\u5728\u751F\u6210\u7B2C {{slide}}/{{total}} \u9875\u2026",generationSlideReady:"\u7B2C {{slide}}/{{total}} \u9875\u5DF2\u751F\u6210",generationSlideRetry:"\u7B2C {{slide}} \u9875\u751F\u6210\u9047\u5230\u95EE\u9898\uFF0C\u6B63\u5728\u91CD\u8BD5\uFF08{{attempt}}/{{max}}\uFF09\u2026",generationSlideRepair:"\u7B2C {{slide}} \u9875\u9700\u8981\u8C03\u6574\uFF0C\u6B63\u5728\u91CD\u65B0\u751F\u6210\uFF08{{attempt}}/{{max}}\uFF09\u2026",generationResumeFrom:"\u4ECE\u7B2C {{slide}} \u9875\u7EE7\u7EED\u751F\u6210\uFF0C\u5DF2\u5B8C\u6210\u7684\u9875\u9762\u4FDD\u7559\u3002",generationPartialDeck:"\u7B2C {{missing}} \u9875\u672A\u5B8C\u6210\u3002\u5DF2\u5B8C\u6210\u7684\u9875\u9762\u5DF2\u4FDD\u7559\uFF0C\u53EF\u7EE7\u7EED\u53D1\u9001\u6307\u4EE4\u8865\u5168\u7F3A\u5931\u9875\u3002",agentWorkingTitle:"\u6B63\u5728\u751F\u6210\u6F14\u793A\u7A3F",agentWorkingKicker:"\u751F\u6210\u4E2D",agentWorkingClaim:"\u5B8C\u6210\u540E\uFF0C\u6700\u7EC8\u9875\u9762\u4F1A\u51FA\u73B0\u5728\u4E2D\u95F4\u753B\u5E03\u3002",agentWorkingProof:"\u8FDB\u5EA6",agentWorkingDetail:"\u8FD9\u662F\u751F\u6210\u8FC7\u7A0B\u4E2D\u7684\u9884\u89C8\u533A\u57DF\u3002",agentWorkingSourceNote:"\u5185\u5BB9\u5C06\u6839\u636E\u4F60\u7684 Prompt \u81EA\u52A8\u751F\u6210\u3002",agentWorkingMetric:"Live",agentWorkingMetricLabel:"\u7B49\u5F85\u9875\u9762\u751F\u6210",processEventStarted:"\u5DF2\u5F00\u59CB\u751F\u6210\u3002",processEventWaiting:"\u51C6\u5907\u5F00\u59CB\u2026",processEventRound:"\u6B63\u5728\u7EC4\u7EC7\u5185\u5BB9\u4E0E\u7ED3\u6784\u3002",processEventTool:"\u6B63\u5728\u8BFB\u53D6\u7D20\u6750\u5E76\u5E94\u7528\u8BBE\u8BA1\u89C4\u5219\u3002",processEventText:"\u6B63\u5728\u64B0\u5199\u9875\u9762\u5E03\u5C40\u3002",processEventDone:"\u6F14\u793A\u7A3F\u5DF2\u751F\u6210\u3002",generationParsingDeck:"\u6B63\u5728\u6574\u7406\u9875\u9762\u2026",processWaitingForEventsTitle:"\u7B49\u5F85\u5F00\u59CB",processWaitingForEvents:"\u53D1\u9001 Prompt \u540E\uFF0C\u8FD9\u91CC\u4F1A\u663E\u793A\u751F\u6210\u8FDB\u5EA6\u3002",agentStreamTitle:"Agent \u5B9E\u65F6\u6D41",agentStreamAssistant:"\u52A9\u624B",processEventUnknown:"\u8FDB\u5EA6\u66F4\u65B0",eventTurnStarted:"\u5F00\u59CB\u751F\u6210",eventTurnFailed:"\u751F\u6210\u5931\u8D25",eventTurnCancelled:"\u751F\u6210\u5DF2\u53D6\u6D88",eventRoundCompleted:"\u672C\u9636\u6BB5\u5DF2\u5B8C\u6210",eventThinkingChunk:"\u601D\u8003\u6D41",eventTokenUsage:"Token \u7528\u91CF\u66F4\u65B0",eventUnknownTool:"\u5DE5\u5177",eventToolDetected:"\u68C0\u6D4B\u5230\u5DE5\u5177",eventToolParams:"\u6B63\u5728\u8BFB\u53D6\u5DE5\u5177\u53C2\u6570",eventToolQueued:"\u5DE5\u5177\u5DF2\u6392\u961F",eventToolWaiting:"\u7B49\u5F85\u5DE5\u5177\u6267\u884C",eventToolStarted:"\u5F00\u59CB\u8C03\u7528\u5DE5\u5177",eventToolProgress:"\u5DE5\u5177\u8FDB\u5EA6",eventToolStreaming:"\u5DE5\u5177\u6D41\u5F0F\u8F93\u51FA",eventToolStreamChunk:"\u5DE5\u5177\u8F93\u51FA\u7247\u6BB5",eventToolConfirmation:"\u5DE5\u5177\u9700\u8981\u786E\u8BA4",eventToolConfirmed:"\u5DE5\u5177\u5DF2\u786E\u8BA4",eventToolRejected:"\u5DE5\u5177\u5DF2\u62D2\u7EDD",eventToolCompleted:"\u5DE5\u5177\u6267\u884C\u5B8C\u6210",eventToolFailed:"\u5DE5\u5177\u6267\u884C\u5931\u8D25",eventToolCancelled:"\u5DE5\u5177\u5DF2\u53D6\u6D88",eventToolQueuePosition:"\u961F\u5217\u4F4D\u7F6E",eventToolSkillName:"PPT \u8BBE\u8BA1\u89C4\u8303",eventToolWebSearchName:"\u7F51\u9875\u641C\u7D22",eventToolWebFetchName:"\u7F51\u9875\u8BFB\u53D6",eventToolReadName:"\u8BFB\u53D6",eventToolWriteName:"\u5199\u5165",eventToolEditName:"\u7F16\u8F91",eventToolTaskName:"\u5B50\u4EFB\u52A1",eventToolSkillReady:"\u8BBE\u8BA1\u89C4\u8303\u5DF2\u5C31\u7EEA",eventToolWebSearchDone:"\u5DF2\u641C\u7D22\u76F8\u5173\u8D44\u6599",eventToolWebFetchDone:"\u5DF2\u8BFB\u53D6\u53C2\u8003\u7F51\u9875",eventToolTaskStarted:"\u6B63\u5728\u6267\u884C\u8C03\u7814\u5B50\u4EFB\u52A1\u2026",eventToolTaskDone:"\u8C03\u7814\u5B50\u4EFB\u52A1\u5DF2\u5B8C\u6210",eventSubagentStarted:"\u5DF2\u542F\u52A8\u540E\u53F0\u8C03\u7814\u5B50\u4EFB\u52A1",eventSubagentWorking:"\u540E\u53F0\u8C03\u7814\u8FDB\u884C\u4E2D\u2026",eventSubagentDone:"\u540E\u53F0\u8C03\u7814\u5DF2\u5B8C\u6210",eventSubagentFailed:"\u540E\u53F0\u8C03\u7814\u672A\u5B8C\u6210",eventSubagentWebSearchDone:"\u5B50\u4EFB\u52A1\u5DF2\u641C\u7D22\u76F8\u5173\u8D44\u6599",eventSubagentWebFetchDone:"\u5B50\u4EFB\u52A1\u5DF2\u8BFB\u53D6\u53C2\u8003\u7F51\u9875",eventToolFailedUser:"\u67D0\u4E00\u6B65\u672A\u5B8C\u6210",generationProgressPulse:"\u4ECD\u5728\u751F\u6210\u4E2D\u2026",generationPageProgress:"\u6B63\u5728\u751F\u6210\u7B2C {{current}} \u9875",generationSlideProgress:"\u5DF2\u751F\u6210 {{count}} \u9875",generationStepBrief:"\u53D1\u5E03\u5047\u8BBE",generationStepBriefDetail:"\u9605\u8BFB Prompt \u5E76\u89C4\u5212\u6F14\u793A\u7A3F\u3002",generationStepSpine:"\u751F\u6210\u5927\u7EB2",generationStepSpineDetail:"\u628A\u9700\u6C42\u8F6C\u6210\u65AD\u8A00\u5F0F\u9875\u9762\u6807\u9898\u3002",generationStepProof:"\u9875\u9762\u6587\u6848",generationStepProofDetail:"\u7528\u7D20\u6750\u4E8B\u5B9E\u6216\u660E\u786E\u5047\u8BBE\u652F\u6491\u6BCF\u9875\u3002",generationStepDesign:"\u8BBE\u8BA1\u6392\u7248",generationStepDesignDetail:"\u5E94\u7528\u4E3B\u9898\u3001\u7248\u5F0F\u4E0E\u89C6\u89C9\u5C42\u6B21\u3002",generationStepCompile:"\u52A0\u8F7D\u9875\u9762",generationStepCompileDetail:"\u5C06\u751F\u6210\u7ED3\u679C\u52A0\u8F7D\u4E3A\u53EF\u7F16\u8F91\u9875\u9762\u3002",generationReadingBrief:"\u6B63\u5728\u7406\u89E3\u4F60\u7684 Prompt\u2026",generationWritingClaims:"\u6B63\u5728\u751F\u6210\u5927\u7EB2\u2026",generationChoosingProof:"\u6B63\u5728\u64B0\u5199\u9875\u9762\u6587\u6848\u2026",generationDesigningLayouts:"\u6B63\u5728\u8BBE\u8BA1\u9875\u9762\u7248\u5F0F\u2026",generationCompiled:"\u6F14\u793A\u7A3F\u5DF2\u5C31\u7EEA\u3002",generationSpineReady:"\u8BBA\u70B9\u4E3B\u7EBF\u5DF2\u751F\u6210\u3002",generationLocalSpine:"\u751F\u6210\u670D\u52A1\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",generationLocalCompiler:"\u751F\u6210\u670D\u52A1\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",agentPlanning:"\u6B63\u5728\u89C4\u5212\u6F14\u793A\u7A3F\u2026",agentPlanningFallback:"\u89C4\u5212\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",outlineTitle:"\u5927\u7EB2",outlineSubcopy:"\u5148\u786E\u8BA4\u6BCF\u4E00\u9875\u7684\u6545\u4E8B\u4E3B\u7EBF\uFF0C\u518D\u751F\u6210\u5B8C\u6574\u9875\u9762\u3002",addOutlineItem:"\u6DFB\u52A0\u5927\u7EB2\u9879",syncOutline:"\u7528\u5927\u7EB2\u540C\u6B65\u9875\u9762",modeEdit:"\u7F16\u8F91",modeSort:"\u6392\u5E8F",modePresent:"\u6F14\u793A",inspectorTitle:"\u68C0\u67E5\u5668",addText:"\u6587\u5B57",addList:"\u5217\u8868",addShape:"\u5F62\u72B6",addMetric:"\u6307\u6807",addChart:"\u56FE\u8868",addMedia:"\u5A92\u4F53",addSlide:"\u6DFB\u52A0\u9875\u9762",deleteSlide:"\u5220\u9664\u9875\u9762",deleteElement:"\u5220\u9664\u5143\u7D20",aiTitle:"AI \u8BBE\u8BA1",aiSubcopy:"\u7528 Prompt \u4FEE\u6539\u5F53\u524D\u9875\u3001\u6574\u5957 PPT\uFF0C\u6216\u63D2\u5165\u65B0\u9875\u3002",instructionPlaceholder:"\u4F8B\u5982\uFF1A\u8BA9\u672C\u9875\u66F4\u89C6\u89C9\u5316\uFF1B\u589E\u52A0\u4E00\u9875\u7ADE\u54C1\u5BF9\u6BD4\uFF1B\u6574\u5957\u6539\u6210\u878D\u8D44\u8DEF\u6F14\u98CE\u683C\uFF1B\u5220\u9664\u91CD\u590D\u5185\u5BB9\u3002",reviseSlide:"\u4FEE\u6539\u672C\u9875",reviseDeck:"\u4FEE\u6539\u6574\u5957",insertSlide:"\u63D2\u5165\u65B0\u9875",aiRewrite:"\u6539\u5199",aiCondense:"\u538B\u7F29",aiProfessional:"\u4E13\u4E1A\u5316",aiMoreVisual:"\u66F4\u89C6\u89C9\u5316",aiNotes:"\u6F14\u8BB2\u5907\u6CE8",aiRedesign:"\u91CD\u6392\u672C\u9875",aiRestyleDeck:"\u91CD\u5851\u6574\u5957\u98CE\u683C",styleTitle:"\u98CE\u683C",themeLabel:"\u4E3B\u9898",themeExecutive:"\u9AD8\u7BA1",themeMarket:"\u5E02\u573A",themeMinimal:"\u6781\u7B80",themeStudio:"\u521B\u610F",densityLabel:"\u5BC6\u5EA6",densityCompact:"\u7D27\u51D1",densityStandard:"\u6807\u51C6",densitySpacious:"\u8212\u5C55",brandPrimaryLabel:"\u4E3B\u8272",brandAccentLabel:"\u5F3A\u8C03\u8272",imagePolicyLabel:"\u56FE\u7247\u7B56\u7565",imagePolicyPlaceholders:"\u53EF\u7F16\u8F91\u5360\u4F4D",imagePolicyNone:"\u4E0D\u4F7F\u7528\u56FE\u7247",ready:"\u51C6\u5907\u5C31\u7EEA\u3002",statusPillReady:"\u5C31\u7EEA",statusPillBusy:"AI",exportReady:"\u751F\u6210\u540E\u53EF\u5BFC\u51FA HTML \u548C\u53EF\u7F16\u8F91 PPTX\u3002",working:"AI \u6B63\u5728\u5904\u7406...",outlineReady:"\u5927\u7EB2\u5DF2\u751F\u6210\u3002\u53EF\u5148\u8C03\u6574\u5927\u7EB2\uFF0C\u518D\u751F\u6210\u8BBE\u8BA1\u7A3F\u3002",deckReady:"\u8BBE\u8BA1\u7A3F\u5DF2\u751F\u6210\u3002",aiUnavailable:"\u751F\u6210\u670D\u52A1\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002",sourceGroundingRequired:"\u6765\u6E90\u65E0\u6CD5\u9A8C\u8BC1\u3002\u5DF2\u751F\u6210\u201C\u5148\u9A8C\u8BC1\u201D\u7684\u6F14\u793A\u7A3F\uFF0C\u800C\u4E0D\u662F\u7F16\u9020\u4E8B\u5B9E\u3002",saved:"\u5DF2\u4FDD\u5B58\u3002",slideUpdated:"\u9875\u9762\u5DF2\u66F4\u65B0\u3002",deckUpdated:"\u6574\u5957\u5DF2\u66F4\u65B0\u3002",slideInserted:"\u65B0\u9875\u9762\u5DF2\u63D2\u5165\u3002",deckRestyled:"\u6574\u5957\u98CE\u683C\u5DF2\u66F4\u65B0\u3002",cannotDelete:"\u81F3\u5C11\u4FDD\u7559\u4E00\u9875\u3002",noSelection:"\u9009\u62E9\u4E00\u4E2A\u9875\u9762\u5143\u7D20\u540E\u53EF\u7F16\u8F91\u5185\u5BB9\u548C\u5E03\u5C40\u3002",elementTypeLabel:"\u7C7B\u578B",elementTextLabel:"\u6587\u5B57",elementItemsLabel:"\u6761\u76EE",elementDataLabel:"\u56FE\u8868\u6570\u636E",geometryLabel:"\u4F4D\u7F6E\u5C3A\u5BF8",styleLabel:"\u6837\u5F0F",speakerNotesLabel:"\u6F14\u8BB2\u5907\u6CE8",kickerLabel:"\u7709\u6807",claimLabel:"\u8BBA\u70B9",proofObjectLabel:"\u8BC1\u636E\u5BF9\u8C61",supportNoteLabel:"\u652F\u6491\u8BF4\u660E",sourceNoteLabel:"\u6765\u6E90\u8BF4\u660E",newSlideTitle:"\u65B0\u9875\u9762",defaultDeckTitle:"AI \u4EA7\u54C1\u6218\u7565",slidesMeta:"{{count}} \u9875",exportHtmlDone:"HTML \u6F14\u793A\u7A3F\u5DF2\u4E0B\u8F7D\u3002",exportHtmlWorking:"\u6B63\u5728\u5BFC\u51FA HTML...",exportHtmlFailed:"HTML \u5BFC\u51FA\u5931\u8D25\uFF1A",exportSavedTo:"\u5DF2\u5BFC\u51FA\u5230\u4E0B\u8F7D\u6587\u4EF6\u5939\uFF1A{{path}}",exportPptxWorking:"\u6B63\u5728\u6E32\u67D3\u53EF\u7F16\u8F91 PPTX...",exportPptxDone:"\u53EF\u7F16\u8F91 PPTX \u5DF2\u4E0B\u8F7D\u3002",exportPptxFailed:"PPTX \u5BFC\u51FA\u5931\u8D25\uFF1A",exportPdfWorking:"\u6B63\u5728\u6E32\u67D3 PDF...",exportPdfDone:"PDF \u5DF2\u4E0B\u8F7D\u3002",exportPdfFailed:"PDF \u5BFC\u51FA\u5931\u8D25\uFF1A",exportPngWorking:"\u6B63\u5728\u6E32\u67D3 PNG \u9875\u9762...",exportPngDone:"PNG \u9875\u9762\u538B\u7F29\u5305\u5DF2\u4E0B\u8F7D\u3002",exportPngFailed:"PNG \u5BFC\u51FA\u5931\u8D25\uFF1A",exportDeckEmpty:"\u8BF7\u5148\u751F\u6210\u5E7B\u706F\u7247\u540E\u518D\u5BFC\u51FA\u3002",slidesEmptyHint:"\u751F\u6210\u540E\u9875\u9762\u7F29\u7565\u56FE\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002",welcomeTitle:"\u63CF\u8FF0\u4F60\u7684 PPT\uFF0C\u4E00\u952E\u5F00\u59CB",welcomeSubcopy:"\u4E00\u6761 Prompt \u5373\u53EF\u751F\u6210\u5927\u7EB2\u3001\u8BBE\u8BA1\u9875\u9762\u548C\u53EF\u7F16\u8F91\u6F14\u793A\u7A3F\uFF0C\u4E4B\u540E\u53EF\u9010\u9875\u7EE7\u7EED\u4FEE\u6539\u3002",welcomeTip1:"10 \u9875\u6218\u7565\u65B9\u6848",welcomeTip2:"\u6539\u6210\u6295\u8D44\u4EBA\u7248\u672C",welcomeTip3:"\u672C\u9875\u66F4\u89C6\u89C9\u5316",deleteSlideDefaultPrompt:"\u5220\u9664\u5F53\u524D\u9875\u9762\uFF0C\u5E76\u4FDD\u6301\u6574\u5957 PPT \u7ED3\u6784\u8FDE\u8D2F\u3002",prev:"\u4E0A\u4E00\u9875",next:"\u4E0B\u4E00\u9875",assistantHello:"\u544A\u8BC9\u6211\u4F60\u8981\u505A\u4EC0\u4E48 PPT\u3002\u6211\u4F1A\u5148\u751F\u6210\u5927\u7EB2\uFF0C\u518D\u53D8\u6210\u53EF\u7F16\u8F91\u9875\u9762\u3002",aiChatApplied:"\u5DF2\u628A\u6307\u4EE4\u5E94\u7528\u5230\u5F53\u524D\u9875\u9762\u3002",localMetricLabel:"\u9700\u8981\u8BB0\u4F4F\u7684\u4FE1\u53F7",mediaPlaceholder:"\u56FE\u7247\u5360\u4F4D",slidesUnit:"\u9875",closeConfirm:"\u786E\u8BA4\u65B9\u5411",closeOwner:"\u660E\u786E\u8D1F\u8D23\u4EBA",closeIteration:"\u542F\u52A8\u4E0B\u4E00\u8F6E\u8FED\u4EE3",pointClaimPrefix:"\u8BBA\u70B9\uFF1A",pointProofPrefix:"\u8BC1\u636E\u5BF9\u8C61\uFF1A",pointAudiencePrefix:"\u53D7\u4F17\u5173\u8054\uFF1A",pointEvidenceRule:"\u8BC1\u636E\u89C4\u5219\uFF1A\u660E\u786E\u6807\u6CE8\u5047\u8BBE",pointDesignRule:"\u8BBE\u8BA1\u89C4\u5219\uFF1A\u4E00\u4E2A\u4E3B\u89C6\u89C9\u52A0\u4E00\u4E2A\u652F\u6491\u680F",pointCloseRule:"\u6536\u675F\uFF1A\u8BF4\u6E05\u4E0B\u4E00\u6B65\u884C\u52A8",claimCover:"{{topic}} \u9700\u8981\u4E00\u6761\u6E05\u6670\u7684\u51B3\u7B56\u4E3B\u7EBF\uFF0C\u800C\u4E0D\u662F\u4FE1\u606F\u5806\u780C\u3002",claimPressure:"{{title}} \u662F\u53D7\u4F17\u5FC5\u987B\u89E3\u51B3\u7684\u5173\u952E\u538B\u529B\u70B9\u3002",claimDecision:"{{title}} \u4E4B\u6240\u4EE5\u91CD\u8981\uFF0C\u662F\u56E0\u4E3A\u5B83\u628A\u8BC1\u636E\u8FDE\u63A5\u5230\u884C\u52A8\u3002",claimProof:"{{title}} \u5FC5\u987B\u7531\u9875\u9762\u91CC\u7684\u4E3B\u8BC1\u636E\u5BF9\u8C61\u6765\u627F\u62C5\u8BBA\u8BC1\u3002",claimAction:"{{title}} \u6700\u540E\u8981\u843D\u5230\u4E00\u4E2A\u660E\u786E\u51B3\u7B56\u3001\u8D1F\u8D23\u4EBA\u6216\u4E0B\u4E00\u6B65\u3002",supportWithSource:"\u7528\u5DF2\u63D0\u4F9B\u7D20\u6750\u652F\u6491\u8FD9\u4E2A\u8BBA\u70B9\uFF0C\u5E76\u8BA9\u201C{{proof}}\u201D\u6210\u4E3A\u4E3B\u8BC1\u636E\u3002",supportWithAssumption:"\u8865\u5145\u4E00\u4E2A\u5177\u4F53\u4F8B\u5B50\u6216\u6307\u6807\uFF0C\u8BA9\u201C{{proof}}\u201D\u652F\u6491\u8BBA\u70B9\uFF0C\u800C\u4E0D\u662F\u586B\u5145\u6587\u5B57\u3002",sourceUserMaterial:"\u6765\u6E90\uFF1A\u7528\u6237\u63D0\u4F9B\u7D20\u6750",sourceDraftAssumption:"\u6765\u6E90\uFF1A\u8349\u7A3F\u5047\u8BBE\uFF1B\u5BF9\u5916\u4F7F\u7528\u524D\u9700\u786E\u8BA4",defaultSpeakerNote:"\u5148\u8BB2\u201C{{title}}\u201D\u7684\u7ED3\u8BBA\uFF0C\u518D\u7528\u4E00\u4E2A\u5177\u4F53\u4F8B\u5B50\u6216\u6570\u636E\u652F\u6491\u3002",proofMarketMap:"\u5E02\u573A\u5730\u56FE",proofOperatingModel:"\u8FD0\u8425\u6A21\u578B",proofRiskBridge:"\u98CE\u9669\u6865",proofDecisionTable:"\u51B3\u7B56\u8868",proofBeforeAfter:"\u524D\u540E\u5BF9\u6BD4\u6D41\u7A0B",proofValueBridge:"\u4EF7\u503C\u6865",proofCustomerProof:"\u5BA2\u6237\u8BC1\u636E",proofImplementationPlan:"\u5B9E\u65BD\u8BA1\u5212",proofMetricBridge:"\u6307\u6807\u6865",proofTrendChart:"\u8D8B\u52BF\u56FE",proofSourceSummary:"\u6765\u6E90\u6458\u8981",proofVerificationPlan:"\u9A8C\u8BC1\u8BA1\u5212",proofCapabilityMatrix:"\u80FD\u529B\u77E9\u9635",proofEvidenceList:"\u8BC1\u636E\u5217\u8868",proofVarianceTable:"\u5DEE\u5F02\u8868",proofRiskRegister:"\u98CE\u9669\u6E05\u5355",proofConceptMap:"\u6982\u5FF5\u56FE",proofWorkedExample:"\u6848\u4F8B\u6F14\u7B97",proofComparison:"\u5BF9\u6BD4",proofPracticePrompt:"\u7EC3\u4E60\u63D0\u793A",proofMarketWedge:"\u5E02\u573A\u5207\u5165\u70B9",proofProductDiagram:"\u4EA7\u54C1\u56FE",proofTractionChart:"\u7275\u5F15\u529B\u56FE\u8868",proofMilestonePlan:"\u91CC\u7A0B\u7891\u8BA1\u5212",proofVisualProof:"\u89C6\u89C9\u8BC1\u636E",sourceFetchedNote:"\u6765\u6E90\uFF1A\u5DF2\u8BFB\u53D6 {{count}} \u4E2A URL",bpContextTitle:"{{topic}} \u9700\u8981\u5148\u5EFA\u7ACB\u5728\u6765\u6E90\u4E8B\u5B9E\u4E4B\u4E0A\uFF0C\u518D\u63D0\u51FA\u5224\u65AD\u3002",bpSourceNeededTitle:"{{topic}} \u9700\u8981\u8865\u5145\u6765\u6E90\u7D20\u6750\u540E\u624D\u80FD\u63D0\u51FA\u4E8B\u5B9E\u6027\u7ED3\u8BBA\u3002",bpProblemTitle:"\u5F53\u524D\u5173\u952E\u95EE\u9898\u662F\uFF1A\u53D7\u4F17\u53EF\u4EE5\u5B89\u5168\u76F8\u4FE1\u4EC0\u4E48\u3002",bpSolutionTitle:"{{topic}} \u5E94\u901A\u8FC7\u80FD\u529B\u3001\u6D41\u7A0B\u548C\u8BC1\u636E\u6765\u89E3\u91CA\u3002",bpWorkflowTitle:"\u5DE5\u4F5C\u6D41\u9700\u8981\u5C55\u793A\u4EA7\u54C1\u5982\u4F55\u4E00\u6B65\u6B65\u521B\u9020\u4EF7\u503C\u3002",bpProofTitle:"\u53EF\u4FE1\u5EA6\u5E94\u8BE5\u7531\u6765\u6E90\u8BC1\u636E\u627F\u62C5\uFF0C\u800C\u4E0D\u662F\u7531\u5047\u56FE\u8868\u627F\u62C5\u3002",bpVerificationTitle:"\u9A8C\u8BC1\u7F3A\u53E3\u5FC5\u987B\u663E\u6027\u5C55\u793A\uFF0C\u4E0D\u80FD\u85CF\u5728\u865A\u6784\u56FE\u8868\u540E\u9762\u3002",bpRiskTitle:"\u6700\u5927\u98CE\u9669\u662F\u8D85\u51FA\u5DF2\u6709\u7D20\u6750\u8FC7\u5EA6\u58F0\u79F0\u3002",bpDecisionTitle:"\u4E0B\u4E00\u6B65\u662F\u9A8C\u8BC1\u5173\u952E\u8BBA\u70B9\uFF0C\u5E76\u9009\u62E9\u6700\u5F3A\u53D9\u4E8B\u8DEF\u5F84\u3002",bpSupportSource:"\u57FA\u4E8E\u5DF2\u8BFB\u53D6\u6216\u7C98\u8D34\u7D20\u6750\u751F\u6210\uFF1B\u5BF9\u5916\u4F7F\u7528\u524D\u8BF7\u6838\u5BF9\u539F\u6587\u3002",bpSupportMissing:"\u7D20\u6750\u4E0D\u8DB3\uFF1B\u672C\u9875\u5E94\u4F5C\u4E3A\u9A8C\u8BC1\u63D0\u793A\uFF0C\u800C\u4E0D\u662F\u4E8B\u5B9E\u7ED3\u8BBA\u3002",bpMissingFact1:"\u8BF7\u7C98\u8D34\u6765\u6E90\u7B14\u8BB0\u3001README\u3001\u6307\u6807\u6216\u4EA7\u54C1\u63CF\u8FF0\u6765\u652F\u6491\u672C\u9875\u3002",bpMissingFact2:"\u4E0D\u8981\u4F7F\u7528\u865A\u6784\u6307\u6807\uFF1B\u7528\u5DF2\u9A8C\u8BC1\u8BC1\u636E\u66FF\u6362\u5360\u4F4D\u5185\u5BB9\u3002",bpMissingFact3:"\u7528\u672C\u9875\u51B3\u5B9A\u4E0B\u4E00\u6B65\u9700\u8981\u8865\u5145\u7814\u7A76\u4EC0\u4E48\u3002",qualityOutOfBounds:"\u6709\u5143\u7D20\u8D85\u51FA\u5E7B\u706F\u7247\u5B89\u5168\u533A\u57DF\u3002",qualityTextDense:"\u5F53\u524D\u7248\u5F0F\u4E2D\u7684\u53EF\u89C1\u6587\u5B57\u53EF\u80FD\u8FC7\u5BC6\u3002",qualityChartUngrounded:"\u56FE\u8868\u6570\u636E\u7F3A\u5C11\u6765\u6E90\u6570\u5B57\uFF0C\u5DF2\u79FB\u9664\u6216\u6807\u8BB0\u3002",qualityOverlap:"\u6587\u5B57\u6216\u56FE\u8868\u5143\u7D20\u53EF\u80FD\u53D1\u751F\u91CD\u53E0\u3002",qualityMissingClaim:"\u672C\u9875\u9700\u8981\u4E00\u4E2A\u6E05\u6670\u8BBA\u70B9\u3002",qualityReportTitle:"\u8D28\u91CF\u62A5\u544A",qualityNeedsReview:"\u9700\u8981\u590D\u6838",qualityHasWarnings:"\u8D28\u91CF\u63D0\u9192",exportFormatUnavailable:"\u8BE5\u5BFC\u51FA\u683C\u5F0F\u5C1A\u672A\u652F\u6301\u3002",exportTitle:"\u5BFC\u51FA",exportCancel:"\u53D6\u6D88",exportConfirm:"\u5BFC\u51FA\u6587\u4EF6",exportPreviewPrevAria:"\u4E0A\u4E00\u9875",exportPreviewNextAria:"\u4E0B\u4E00\u9875",exportFormat:"\u683C\u5F0F",exportQuality:"\u8D28\u91CF",exportDpi:"\u56FE\u7247 DPI",exportRange:"\u5E7B\u706F\u7247\u8303\u56F4",exportShare:"\u5206\u4EAB",propertiesStyle:"\u6837\u5F0F",propertiesLayout:"\u5E03\u5C40",propertiesAnimation:"\u52A8\u753B",propertiesThemeColor:"\u4E3B\u9898\u8272",propertiesFont:"\u5B57\u4F53",propertiesColorMode:"\u5E7B\u706F\u7247\u914D\u8272",propertiesStylePreset:"\u98CE\u683C\u9884\u8BBE",colorModeLight:"\u6D45\u8272",colorModeDark:"\u6DF1\u8272",fontSansSerif:"\u975E\u886C\u7EBF",fontSerif:"\u886C\u7EBF",propertiesDensity:"\u5BC6\u5EA6",propertiesSmartAlign:"\u667A\u80FD\u5BF9\u9F50",propertiesPageTransition:"\u9875\u9762\u8FC7\u6E21",propertiesElementAnimation:"\u5143\u7D20\u52A8\u753B",densityLoose:"\u5BBD\u677E"}};function Lr(){let e=window.app?.locale||document.documentElement.lang||"";return e==="zh-CN"||String(e).startsWith("zh")?"zh-CN":"en-US"}function $(e,r={}){let t=Jo[Lr()]||Jo["en-US"],n=Jo["en-US"][e]||e,i=t[e]||n;return Object.entries(r).forEach(([a,o])=>{i=i.replaceAll(`{{${a}}}`,String(o))}),i}var jf=["clean-business","insight-report"],ba={"clean-business":{styleKey:"clean-business",names:{"en-US":"Clean Business","zh-CN":"\u7B80\u6D01\u5546\u52A1"},descriptions:{"en-US":"Calm editorial product-doc: warm canvas, charcoal type, one restrained accent, typography-led","zh-CN":"\u5E73\u9759\u7F16\u8F91\u611F\u4EA7\u54C1\u6587\u6863\uFF1A\u6696\u767D\u753B\u5E03\u3001\u70AD\u9ED1\u5B57\u9636\u3001\u5355\u4E00\u514B\u5236\u5F3A\u8C03\u8272\uFF0C\u6392\u7248\u5373\u89C6\u89C9"},colorMode:"light",palette:{background:"#FAFAF7",ink:"#111111",muted:"#787774",primary:"#1E293B",accent:"#0f766e",panel:"#F3F2EF"},fontFamily:"sans",density:"spacious",keywords:/business|clean|professional|商务|简洁|专业|企业/},"insight-report":{styleKey:"insight-report",names:{"en-US":"Insight Report","zh-CN":"\u6D1E\u5BDF\u6C47\u62A5"},descriptions:{"en-US":"Analytical memo on a slide: full sentences, explicit frameworks, evidence-dense tables","zh-CN":"\u5206\u6790\u5907\u5FD8\u5F55\u4E0A\u5899\uFF1A\u5B8C\u6574\u8BBA\u8BC1\u3001\u663E\u6027\u6846\u67B6\u3001\u6EE1\u7248\u8BC1\u636E\uFF0C\u50CF\u5C3D\u8C03\u9644\u5F55\u800C\u975E bullet \u6F14\u8BB2"},colorMode:"light",palette:{background:"#ffffff",ink:"#1f2937",muted:"#64748b",primary:"#1e3a8a",accent:"#dc2626",panel:"#f1f5f9"},fontFamily:"sans",density:"compact",keywords:/insight|consult|academic|research|whitepaper|due.*diligence|洞察|咨询|学术|调研|详尽|深度分析|尽调/}},an="clean-business";function $o(e){return e&&ba[e]?e:an}function es(e){return ba[$o(e)]}var Hn={background:"#111111",ink:"#F5F5F4",muted:"#A8A29E",primary:"#93C5FD",accent:"#2DD4BF",panel:"#1C1C1C"};function rc(e,r="light"){let t=e?.palette||{};return r!=="dark"?{...t}:e?.paletteDark&&typeof e.paletteDark=="object"?{...e.paletteDark}:{background:Hn.background,ink:Hn.ink,muted:Hn.muted,primary:t.primary||Hn.primary,accent:t.accent||Hn.accent,panel:Hn.panel}}function qf(e){return e==="zh-CN"?"zh-CN":"en-US"}function nc(e){let r=qf(e);return jf.filter(t=>ba[t]).map(t=>{let n=ba[t];return{key:t,displayName:n.names[r]||n.names["en-US"],description:n.descriptions[r]||n.descriptions["en-US"],colorMode:n.colorMode}})}var Si="pptLiveStudioStateV6",is="pptLiveDeckHistoryV1",sc=6,as=["text","list","shape","metric","chart","media"],rs={executive:{name:"Executive",background:"#fbfcff",ink:"#111827",muted:"#5b6575",primary:"#0f766e",accent:"#f97316",panel:"#ffffff"},market:{name:"Market",background:"#fffdf7",ink:"#1f2937",muted:"#6b5f50",primary:"#2563eb",accent:"#d97706",panel:"#ffffff"},minimal:{name:"Minimal",background:"#f8fafc",ink:"#0f172a",muted:"#64748b",primary:"#334155",accent:"#0f766e",panel:"#ffffff"},studio:{name:"Studio",background:"#fcfbff",ink:"#1f1630",muted:"#6c607a",primary:"#7c3aed",accent:"#db2777",panel:"#ffffff"}};function ir(e="id"){return`${e}-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function sn(e){return JSON.parse(JSON.stringify(e))}function mt(e,r,t){return Math.max(r,Math.min(t,e))}function Le(e){return String(e??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function os(){return{topic:"",slideTarget:0}}function lc(e="strategy"){let r={strategy:{profile:"strategy-leadership",thesis:"Decision-led transformation narrative",proofObjects:["market map","operating model","risk bridge","decision table"],arc:["thesis","context","friction","strategic bet","operating model","proof","risks","decision"]},sales:{profile:"gtm-growth",thesis:"Buyer pain to differentiated value narrative",proofObjects:["before/after workflow","value bridge","customer proof","implementation plan"],arc:["outcome","market shift","pain","solution","proof","commercial case","rollout","call to action"]},report:{profile:"finance-ir",thesis:"Executive performance narrative with decisions attached",proofObjects:["metric bridge","trend chart","variance table","risk register"],arc:["summary","scorecard","movement","root cause","metric proof","risk","plan","decision"]},teaching:{profile:"education",thesis:"Concept to application learning journey",proofObjects:["concept map","worked example","comparison","practice prompt"],arc:["goal","map","concept","example","mistakes","practice","summary","next step"]},fundraising:{profile:"fundraising",thesis:"Venture-scale opportunity supported by traction evidence",proofObjects:["market wedge","product diagram","traction chart","milestone plan"],arc:["thesis","problem","solution","market","product","traction","model","ask"]}};return r[e]||r.strategy}function En(e="standard"){let r=String(e||"standard");return r==="loose"?"spacious":["compact","standard","spacious"].includes(r)?r:"standard"}var ns=["spacious","standard","compact"];function Sa(e="standard"){let r=En(e),t=ns.indexOf(r);return t>=0?t:1}function ka(e=1){let r=Math.min(Math.max(Math.round(Number(e)),0),ns.length-1);return ns[r]||"standard"}function cc(e="standard"){let r=En(e),t={spacious:{bulletLimit:4,cardColumns:3,cardGap:2},standard:{bulletLimit:5,cardColumns:4,cardGap:1.8},compact:{bulletLimit:6,cardColumns:4,cardGap:1.2}};return t[r]||t.standard}function ic(e=0){let r=Number(e);return!Number.isFinite(r)||r<=0?0:mt(r,3,24)}function ss(){return{theme:"executive",density:"standard",fontFamily:"sans",colorMode:"light",stylePreset:"clean-business"}}function uc(){return[$("defaultDeckTitle"),"Why now","Current friction","Strategic answer","Core workflow","Proof and impact","Rollout plan","Decision and next steps"]}function Bn(){return{schemaVersion:sc,sessionId:ir("deck"),title:$("blankDeckTitle"),brief:os(),promptDraft:"",lastSubmittedPrompt:"",agentSession:{id:"",workspaceSubdir:"",runId:"",skillKey:""},style:ss(),outline:[],sources:{items:[],facts:[],warnings:[],summary:"",fetchedAt:0},slides:[],activeSlideId:"",selectedElementId:"",mode:"edit",presentIndex:0,status:"ready",generation:{active:!1,current:"idle",steps:dc().map(r=>({...r,status:"pending"})),events:[]},chatMessages:[{role:"assistant",text:$("assistantHello")}],updatedAt:Date.now()}}function ln(e){let r={...Bn(),...e||{}};r.schemaVersion=sc;let t=r.brief||{};r.brief={...os(),topic:String(t.topic||r.promptDraft||"").trim(),slideTarget:ic(t.slideTarget)},r.promptDraft=typeof r.promptDraft=="string"?r.promptDraft:"",r.lastSubmittedPrompt=typeof r.lastSubmittedPrompt=="string"?r.lastSubmittedPrompt:"",r.agentSession={id:String(r.agentSession?.id||""),workspaceSubdir:String(r.agentSession?.workspaceSubdir||""),runId:String(r.agentSession?.runId||""),skillKey:String(r.agentSession?.skillKey||"")},r.style={...ss(),...r.style||{}},delete r.style.brandPrimary,delete r.style.brandAccent,Object.keys(rs).includes(r.style.theme)||(r.style.theme="executive"),["compact","standard","spacious","loose"].includes(r.style.density)||(r.style.density="standard"),r.style.density=En(r.style.density),["sans","serif"].includes(r.style.fontFamily)||(r.style.fontFamily=r.style.fontFamily==="serif"?"serif":"sans"),["light","dark"].includes(r.style.colorMode)||(r.style.colorMode="light"),r.style.stylePreset=$o(typeof r.style.stylePreset=="string"?r.style.stylePreset:""),r.generation=ki(r.generation),r.sources=Vf(r.sources),r.brief.slideTarget=ic(r.brief.slideTarget);let n=r.generation.active&&Array.isArray(r.slides)&&r.slides.length===0;r.outline=n?[]:Array.isArray(r.outline)?r.outline.map(a=>String(a||$("newSlideTitle"))):[],r.slides=n?[]:Array.isArray(r.slides)&&r.slides.length>0?r.slides.map((a,o)=>Ur(a,o,r)):r.outline.length>0?r.outline.map((a,o)=>ls(a,o,r.outline.length,r)):[],r.slides.some(a=>a.id===r.activeSlideId)||(r.activeSlideId=r.slides[0]?.id||"");let i=qt(r);return i?.elements.some(a=>a.id===r.selectedElementId)||(r.selectedElementId=i?.elements[0]?.id||""),r.title=r.title||r.slides[0]?.title||$("defaultDeckTitle"),r.updatedAt=Date.now(),r}function Vf(e={}){return{items:Array.isArray(e.items)?e.items:[],facts:Array.isArray(e.facts)?e.facts:[],warnings:Array.isArray(e.warnings)?e.warnings:[],summary:typeof e.summary=="string"?e.summary:"",fetchedAt:Number(e.fetchedAt||0)}}function dc(){return[{id:"brief",label:$("generationStepBrief"),detail:$("generationStepBriefDetail")},{id:"spine",label:$("generationStepSpine"),detail:$("generationStepSpineDetail")},{id:"proof",label:$("generationStepProof"),detail:$("generationStepProofDetail")},{id:"design",label:$("generationStepDesign"),detail:$("generationStepDesignDetail")},{id:"compile",label:$("generationStepCompile"),detail:$("generationStepCompileDetail")}]}var Xf=80,Hf=200;function Kf(e={}){let r=typeof e=="string"?{title:e}:e||{},t=String(r.title||r.label||r.message||$("processEventUnknown")).trim()||$("processEventUnknown"),n=String(r.kind||"info").toLowerCase().replace(/[^a-z0-9-]/g,"")||"info",i=Number(r.timestamp||r.time||0)||Date.now();return{id:String(r.id||ir("generation-event")),seq:Number(r.seq)||0,title:t,detail:String(r.detail||r.description||"").trim(),kind:n,timestamp:i}}function ki(e={}){let r=new Map((Array.isArray(e.steps)?e.steps:[]).map(a=>[a.id,a])),t=Array.isArray(e.events)?e.events.map(Kf).slice(-Xf):[],n=t.reduce((a,o)=>Math.max(a,Number(o.seq)||0),0),i=Array.isArray(e.agentStream)?e.agentStream.slice(-Hf):[];return{active:!!e.active,current:e.current||"idle",draftedCount:Number(e.draftedCount)||0,slideTarget:Number(e.slideTarget)||0,eventSeq:Math.max(Number(e.eventSeq)||0,n),steps:dc().map(a=>({...a,status:r.get(a.id)?.status||"pending"})),events:t,agentStream:i}}function qt(e){return e.slides.find(r=>r.id===e.activeSlideId)||e.slides[0]}function Jt(e){return Math.max(0,e.slides.findIndex(r=>r.id===e.activeSlideId))}function Rn(e){return qt(e)?.elements.find(t=>t.id===e.selectedElementId)||null}function ls(e,r,t,n={brief:os(),style:ss(),slides:[]}){let i=fc(n,r),a={id:ir("slide"),title:e||`${$("newSlideTitle")} ${r+1}`,subtitle:"",kicker:pc(r,n),claim:us(e,r,n),proofObject:Fa(r,n),supportNote:Ac(e,r,n),sourceNote:gc(n),notes:$("defaultSpeakerNote",{title:e}),layout:hc(r,t),theme:i,elements:[]};return a.elements=mc(a,r,t,n),Ur(a,r,n)}function Ur(e,r,t){let n=e?.title||`${$("newSlideTitle")} ${r+1}`,i={id:e?.id||ir("slide"),title:n,subtitle:e?.subtitle||"",kicker:String(e?.kicker||pc(r,t)),claim:String(e?.claim||us(n,r,t)),proofObject:String(e?.proofObject||Fa(r,t)),supportNote:String(e?.supportNote||Ac(n,r,t)),sourceNote:String(e?.sourceNote||gc(t)),notes:e?.notes||"",layout:e?.layout||hc(r,t?.slides?.length||1),theme:{...fc(t,r),...e?.theme||e?.style||{}},html:typeof e?.html=="string"?e.html:"",quality:Qf(e?.quality),elements:[]},a=Array.isArray(e?.elements)&&e.elements.length>0?e.elements:mc(i,r,t?.slides?.length||1,t);if(i.elements=a.map(o=>cs(o)),i.html){let o=Pa(i.html);o&&(i.theme.background=o)}return i}function Qf(e={}){let r=Array.isArray(e?.issues)?e.issues:[];return{score:mt(Number(e?.score??100),0,100),issues:r.slice(0,12).map(t=>({id:String(t?.id||ir("quality")),severity:["high","medium","low"].includes(t?.severity)?t.severity:"low",type:String(t?.type||"quality"),message:String(t?.message||"")})).filter(t=>t.message)}}function cs(e={}){let r=as.includes(e.type)?e.type:"text",t=Ca(r);return{...t,...e,id:e.id||ir("el"),type:r,x:mt(Number(e.x??t.x),0,98),y:mt(Number(e.y??t.y),0,98),w:mt(Number(e.w??t.w),3,100),h:mt(Number(e.h??t.h),3,100),text:typeof e.text=="string"?e.text:t.text,label:typeof e.label=="string"?e.label:t.label,items:Array.isArray(e.items)?e.items.map(String):t.items,data:Array.isArray(e.data)?e.data.map(Zf):t.data,style:Yf({...t.style,...e.style||{}})}}function Zf(e,r){return typeof e=="number"?{label:`Q${r+1}`,value:e}:{label:String(e?.label||`Item ${r+1}`),value:Number(e?.value||0)}}function Yf(e={}){return{fontSize:mt(Number(e.fontSize||24),8,88),fontWeight:mt(Number(e.fontWeight||600),100,900),color:e.color||"ink",background:e.background||"transparent",opacity:mt(Number(e.opacity??1),0,1),borderRadius:mt(Number(e.borderRadius||0),0,99),align:e.align||"left"}}function Ca(e){let r={text:{text:"Key message",label:"",items:[],data:[],x:8,y:12,w:60,h:16,style:{fontSize:38,fontWeight:780,color:"ink",background:"transparent",borderRadius:0,opacity:1,align:"left"}},list:{text:"",label:"",items:["First point","Second point","Third point"],data:[],x:9,y:36,w:48,h:40,style:{fontSize:20,fontWeight:500,color:"ink",background:"transparent",borderRadius:8,opacity:1,align:"left"}},shape:{text:"",label:"",items:[],data:[],x:66,y:14,w:24,h:62,style:{fontSize:18,fontWeight:600,color:"accent",background:"primary",borderRadius:22,opacity:.12,align:"center"}},metric:{text:"3x",label:"Faster first draft",items:[],data:[],x:63,y:42,w:26,h:26,style:{fontSize:44,fontWeight:820,color:"primary",background:"panel",borderRadius:14,opacity:1,align:"left"}},chart:{text:"Signal trend",label:"",items:[],data:[{label:"Now",value:42},{label:"Next",value:68},{label:"Target",value:86}],x:52,y:36,w:36,h:32,style:{fontSize:18,fontWeight:700,color:"ink",background:"panel",borderRadius:14,opacity:1,align:"left"}},media:{text:$("mediaPlaceholder"),label:"",items:[],data:[],x:58,y:18,w:32,h:42,style:{fontSize:16,fontWeight:650,color:"muted",background:"soft",borderRadius:16,opacity:1,align:"center"}}};return{...sn(r[e]||r.text),type:r[e]?e:"text"}}function fc(e,r=0){let t=e?.deckPalette;if(t&&typeof t=="object"){let o=t.primary||"#111111",l=t.accent||"#c84b31";return ac({name:"deck",background:t.background||"#111111",ink:t.ink||"#f8fafc",muted:t.muted||"#cbd5e1",primary:r%2?l:o,accent:r%2?o:l,panel:t.panel||"#1f2937"})}let n=rs[e?.style?.theme||"executive"]||rs.executive,i=n.primary,a=n.accent;return ac({...n,primary:r%2?a:i,accent:r%2?i:a})}function Pa(e){let r=String(e||""),t=[/body\s*\{[^}]*background(?:-color)?\s*:\s*([^;}\n]+)/i,/]*style="[^"]*background(?:-color)?\s*:\s*([^;"']+)/i,/html\s*\{[^}]*background(?:-color)?\s*:\s*([^;}\n]+)/i,/:root\s*\{[^}]*background(?:-color)?\s*:\s*([^;}\n]+)/i,/background(?:-color)?\s*:\s*(#[0-9a-f]{3,8}|rgb[a]?\([^)]+\)|hsl[a]?\([^)]+\)|black|white)/i];for(let n of t){let i=r.match(n);if(!i)continue;let a=Jf(i[1]);if(a)return a}return null}function Jf(e){let r=String(e||"").trim().replace(/\s+!important$/i,"");if(!r||/^transparent$/i.test(r))return null;if(/^#[0-9a-f]{3,8}$/i.test(r))return on(r,r);if(/^rgb/i.test(r)||/^hsl/i.test(r))return r;let t={black:"#000000",white:"#ffffff",transparent:null};return Object.prototype.hasOwnProperty.call(t,r.toLowerCase())?t[r.toLowerCase()]:r}function ac(e){let r=on(e.background,"#ffffff"),t=on(e.panel,"#ffffff");return{...e,background:r,panel:t,ink:wa(r,e.ink,"#111827","#f8fafc",7),muted:wa(r,e.muted,"#4b5563","#cbd5e1",4.5),primary:wa(t,e.primary,"#0f766e","#5eead4",4.5),accent:wa(t,e.accent,"#c2410c","#fdba74",4.5)}}function wa(e,r,t,n,i){let a=on(e,"#ffffff"),o=on(r,t);if(ts(a,o)>=i)return o;let l=on(t,"#111827"),c=on(n,"#f8fafc");return ts(a,l)>=ts(a,c)?l:c}function ts(e,r){let t=oc(e),n=oc(r),i=Math.max(t,n),a=Math.min(t,n);return(i+.05)/(a+.05)}function oc(e){let{r,g:t,b:n}=$f(e);return[r,t,n].map(i=>{let a=i/255;return a<=.03928?a/12.92:((a+.055)/1.055)**2.4}).reduce((i,a,o)=>i+a*[.2126,.7152,.0722][o],0)}function on(e,r){let t=String(e||"").trim(),n=t.match(/^#([0-9a-f]{3})$/i);return n?`#${n[1].split("").map(i=>i+i).join("")}`.toLowerCase():/^#[0-9a-f]{6}$/i.test(t)?t.toLowerCase():r}function $f(e){let r=on(e,"#000000").slice(1),t=parseInt(r,16);return{r:t>>16&255,g:t>>8&255,b:t&255}}function hc(e,r){return e===0?"cover":e===r-1?"closing":["split","metric","process","comparison"][e%4]}function pc(e,r){let t=lc();return(t.arc[e%t.arc.length]||"proof").replace(/[-_]/g," ").toUpperCase()}function Fa(e,r){let t=lc(),n=t.proofObjects[e%t.proofObjects.length]||"visual proof";return{"market map":$("proofMarketMap"),"operating model":$("proofOperatingModel"),"risk bridge":$("proofRiskBridge"),"decision table":$("proofDecisionTable"),"before/after workflow":$("proofBeforeAfter"),"value bridge":$("proofValueBridge"),"customer proof":$("proofCustomerProof"),"implementation plan":$("proofImplementationPlan"),"metric bridge":$("proofMetricBridge"),"trend chart":$("proofTrendChart"),"variance table":$("proofVarianceTable"),"risk register":$("proofRiskRegister"),"concept map":$("proofConceptMap"),"worked example":$("proofWorkedExample"),comparison:$("proofComparison"),"practice prompt":$("proofPracticePrompt"),"market wedge":$("proofMarketWedge"),"product diagram":$("proofProductDiagram"),"traction chart":$("proofTractionChart"),"milestone plan":$("proofMilestonePlan"),"visual proof":$("proofVisualProof")}[n]||n}function us(e,r,t){let n=t?.brief?.topic||t?.title||e;if(r===0)return $("claimCover",{topic:n});if(e&&/[.!?。!?]$/.test(e.trim()))return e;let i=[$("claimPressure",{title:e}),$("claimDecision",{title:e}),$("claimProof",{title:e}),$("claimAction",{title:e})];return i[r%i.length]}function Ac(e,r,t){let n=Fa(r,t);return $("supportWithAssumption",{proof:n})}function gc(e){return $("sourceDraftAssumption")}function mc(e,r,t,n){let i=e.title,a=cc(n?.style?.density),o=th(i,r,n).slice(0,a.bulletLimit).map(c=>String(c).slice(0,90)),l=eh(e,r,t);return l==="cover"?[Ft("shape",{x:6,y:9,w:88,h:76,style:{background:"soft",opacity:1,borderRadius:28}}),Ft("shape",{x:9,y:15,w:1.2,h:55,style:{background:"primary",opacity:1,borderRadius:99}}),Ft("text",{text:e.kicker,x:13,y:15,w:22,h:5,style:{fontSize:10,fontWeight:760,color:"primary"}}),Ft("text",{text:i,x:13,y:23,w:58,h:25,style:{fontSize:i.length>48?34:44,fontWeight:840}}),Ft("text",{text:e.claim,x:14,y:55,w:45,h:11,style:{fontSize:18,fontWeight:520,color:"muted"}}),Ft("metric",{text:String(t),label:$("slidesUnit"),x:75,y:54,w:14,h:17,style:{fontSize:34}})]:l==="closing"?[Ft("text",{text:i,x:9,y:15,w:65,h:15,style:{fontSize:i.length>48?30:38,fontWeight:820}}),Ft("text",{text:e.claim,x:10,y:33,w:46,h:9,style:{fontSize:17,fontWeight:540,color:"muted"}}),...xa([$("closeConfirm"),$("closeOwner"),$("closeIteration")],10,50,52,22,3),Ft("text",{text:o[0]||e.supportNote,x:67,y:48,w:22,h:20,style:{fontSize:18,fontWeight:720,color:"primary",background:"soft",borderRadius:20}})]:l==="process"?[Ft("text",{text:i,x:8,y:10,w:68,h:12,style:{fontSize:32,fontWeight:820}}),Ft("text",{text:e.claim,x:9,y:25,w:54,h:7,style:{fontSize:15,fontWeight:520,color:"muted"}}),Ft("shape",{x:10,y:50,w:78,h:1.2,style:{background:"primary",opacity:.25,borderRadius:99}}),...xa(o.map((c,s)=>`0${s+1} ${c}`),10,37,78,28,Math.min(a.cardColumns,Math.max(2,o.length)),a.cardGap)]:l==="comparison"?[Ft("text",{text:i,x:7,y:10,w:72,h:12,style:{fontSize:32,fontWeight:820}}),Ft("text",{text:e.claim,x:8,y:25,w:48,h:7,style:{fontSize:15,fontWeight:520,color:"muted"}}),...xa(o,8,37,82,30,2,a.cardGap)]:l==="data"?[Ft("text",{text:i,x:8,y:10,w:66,h:12,style:{fontSize:32,fontWeight:820}}),Ft("text",{text:e.claim,x:9,y:25,w:47,h:7,style:{fontSize:15,fontWeight:520,color:"muted"}}),Ft("metric",{text:String(r).padStart(2,"0"),label:e.proofObject,x:10,y:40,w:34,h:28,style:{fontSize:44}}),Ft("text",{text:o[0]||e.supportNote,x:69,y:41,w:20,h:24,style:{fontSize:17,fontWeight:700,color:"primary",background:"soft",borderRadius:18}})]:l==="cards"?[Ft("text",{text:i,x:8,y:10,w:68,h:12,style:{fontSize:32,fontWeight:820}}),Ft("text",{text:e.claim,x:9,y:25,w:51,h:8,style:{fontSize:15,fontWeight:520,color:"muted"}}),...xa(o,9,38,78,28,a.cardColumns,a.cardGap)]:[Ft("text",{text:i,x:10,y:15,w:62,h:15,style:{fontSize:i.length>48?30:38,fontWeight:820}}),Ft("text",{text:e.claim,x:11,y:34,w:42,h:10,style:{fontSize:17,fontWeight:520,color:"muted"}}),Ft("text",{text:o[0]||e.supportNote,x:58,y:38,w:28,h:24,style:{fontSize:22,fontWeight:760,color:"primary",background:"soft",borderRadius:22}}),Ft("shape",{x:10,y:72,w:18,h:.6,style:{background:"primary",opacity:1,borderRadius:99}})]}function eh(e,r,t){let n=[e.layout,e.kicker,e.proofObject,e.claim,e.title].join(" ").toLowerCase();return r===0||e.layout==="cover"?"cover":r===t-1||e.layout==="closing"?"closing":/process|workflow|timeline|roadmap|journey|steps|architecture|flow|流程|步骤|路线|架构/.test(n)?"process":/compare|comparison|versus|matrix|before|after|risk|对比|比较|矩阵|风险/.test(n)?"comparison":/data|metric|trend|scorecard|chart|number|数据|指标|趋势/.test(n)?"data":r%3===1?"cards":"spotlight"}function xa(e,r,t,n,i,a,o=2.5){let l=e.filter(Boolean),c=Math.max(1,Math.min(a||1,l.length||1)),s=Number.isFinite(o)?o:2.5,u=Math.max(1,Math.ceil((l.length||1)/c)),d=(n-s*(c-1))/c,A=(i-s*(u-1))/u;return l.map((f,p)=>Ft("text",{text:f,x:r+p%c*(d+s),y:t+Math.floor(p/c)*(A+s),w:d,h:A,style:{fontSize:17,fontWeight:p===0?760:620,color:p===0?"primary":"ink",background:p===0?"soft":"panel",borderRadius:18}}))}function Ft(e,r){let t=Ca(e);return{...t,...r,style:{...t.style,...r.style||{}}}}function th(e,r,t){let n=t?.brief?.topic||e,i=Fa(r,t),a=[`${$("pointClaimPrefix")} ${us(e,r,t)}`,`${$("pointProofPrefix")} ${i}`,`${$("pointAudiencePrefix")} ${n}`,$("pointEvidenceRule"),$("pointDesignRule"),$("pointCloseRule")],o=cc(t?.style?.density).bulletLimit,l=[];for(let c=0;c{r!==e&&Ta(r)})}function ds(e){let r=e.querySelector(".ppt-flat-select__menu"),t=e.querySelector(".ppt-flat-select__trigger");if(!r||!t)return;let n=t.getBoundingClientRect(),i=Math.min(220,r.scrollHeight||220),a=window.innerHeight-n.bottom,o=aa;r.style.left=`${Math.max(8,n.left)}px`,r.style.width=`${n.width}px`,o?(r.style.top="auto",r.style.bottom=`${window.innerHeight-n.top+4}px`):(r.style.top=`${n.bottom+4}px`,r.style.bottom="auto")}function vc(e){let r=e.querySelector(".ppt-flat-select__menu"),t=e.querySelector(".ppt-flat-select__trigger");if(!r||!t)return;Da(null),r.hidden=!1,ds(e),t.setAttribute("aria-expanded","true"),e.classList.add("is-open"),Kn.add(e),r.querySelector(".ppt-flat-select__option.is-selected")?.scrollIntoView({block:"nearest"})}function rh(e,r){let t=e.querySelector(".ppt-flat-select__menu");if(!t||t.hidden)return;let n=[...t.querySelectorAll(".ppt-flat-select__option")];if(!n.length)return;let i=n.indexOf(document.activeElement),a=i>=0?i:n.findIndex(l=>l.classList.contains("is-selected")),o=Math.min(n.length-1,Math.max(0,(a<0?-r:a)+r));n[o]?.focus(),n[o]?.scrollIntoView({block:"nearest"})}function fs(e){let r=e.closest(".ppt-flat-select");if(!r)return;let t=r.querySelector(".ppt-flat-select__label"),n=r.querySelector(".ppt-flat-select__menu"),i=e.options[e.selectedIndex];if(t&&(t.textContent=i?.textContent?.trim()||""),!n)return;let a=new Map([...n.querySelectorAll(".ppt-flat-select__option")].map(o=>[o.dataset.value,o]));[...e.options].forEach(o=>{let l=a.get(o.value);l||(l=document.createElement("button"),l.type="button",l.className="ppt-flat-select__option",l.setAttribute("role","option"),l.dataset.value=o.value,l.addEventListener("click",()=>{e.value=o.value,fs(e),Ta(r),e.dispatchEvent(new Event("change",{bubbles:!0}))}),n.append(l)),l.textContent=o.textContent,o.title&&(l.title=o.title);let c=o.value===e.value;l.classList.toggle("is-selected",c),l.setAttribute("aria-selected",c?"true":"false")}),[...n.querySelectorAll(".ppt-flat-select__option")].forEach(o=>{[...e.options].some(l=>l.value===o.dataset.value)||o.remove()}),r.classList.contains("is-open")&&ds(r)}function nh(e){if(!(e instanceof Node))return!1;for(let r of Kn){let t=r.querySelector(".ppt-flat-select__menu");if(t&&(t===e||t.contains(e)))return!0}return!1}function ih(e){nh(e.target)||Da(null)}function ah(e){let r=e.target;if(r instanceof Node){for(let t of Kn)if(t.contains(r))return}Da(null)}function yc(e){if(!e||e.dataset.flatSelect==="true")return;e.dataset.flatSelect="true",e.classList.remove("ppt-flat-select"),e.classList.add("ppt-flat-select__native"),e.tabIndex=-1,e.setAttribute("aria-hidden","true");let r=document.createElement("div");r.className="ppt-flat-select";let t=document.createElement("button");t.type="button",t.className="ppt-flat-select__trigger",t.setAttribute("aria-haspopup","listbox"),t.setAttribute("aria-expanded","false");let n=document.createElement("span");n.className="ppt-flat-select__label",t.append(n);let i=document.createElement("div");i.className="ppt-flat-select__menu",i.hidden=!0,i.setAttribute("role","listbox"),i.addEventListener("wheel",o=>o.stopPropagation(),{passive:!0}),i.addEventListener("mousedown",o=>o.stopPropagation()),t.addEventListener("click",o=>{if(o.stopPropagation(),r.classList.contains("is-open")){Ta(r);return}vc(r)}),r.addEventListener("keydown",o=>{o.key==="ArrowDown"||o.key==="ArrowUp"?(o.preventDefault(),r.classList.contains("is-open")||vc(r),rh(r,o.key==="ArrowDown"?1:-1)):o.key==="Escape"&&r.classList.contains("is-open")&&(o.stopPropagation(),Ta(r),t.focus())}),e.parentNode.insertBefore(r,e),r.append(t,i,e),fs(e)}function Ci(e){fs(e)}window.__pptLiveFlatSelectBound||(window.__pptLiveFlatSelectBound=!0,document.addEventListener("click",ah),document.addEventListener("keydown",e=>{e.key==="Escape"&&Da(null)}),window.addEventListener("resize",()=>{Kn.forEach(e=>ds(e))}),document.addEventListener("scroll",ih,!0));function Fc(){document.documentElement.lang=Lr(),document.querySelectorAll("[data-i18n]").forEach(e=>{e.textContent=$(e.dataset.i18n)}),document.querySelectorAll("[data-i18n-placeholder]").forEach(e=>{e.placeholder=$(e.dataset.i18nPlaceholder)}),document.querySelectorAll("[data-i18n-aria]").forEach(e=>{e.setAttribute("aria-label",$(e.dataset.i18nAria))})}function Tc(e,r){Ch(e),Fr(e),Wr(e),Fh(e,r),Nn(e,r),cn(e,r),_a(e,r),Ln(),document.querySelectorAll(".segment").forEach(i=>{i.classList.toggle("is-active",i.dataset.mode===e.mode)});let t=Jt(e),n=Bt("slidePosition");n&&(n.textContent=`${t+1} / ${e.slides?.length||1}`)}var bc="",Pi=0,Dc=120,oh=20;function sh(e){return{x:(parseFloat(e.paddingLeft)||0)+(parseFloat(e.paddingRight)||0),y:(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}}function Ec(e,r={}){if(!e)return{width:0,height:0};let t=getComputedStyle(e),n=sh(t),i=Math.max(0,(e.clientWidth||0)-n.x),a=Math.max(0,(e.clientHeight||0)-n.y),o=e.getBoundingClientRect();o.width>0&&(i=Math.max(i,o.width-n.x)),o.height>0&&(a=Math.max(a,o.height-n.y));let l=r.minHeight??Dc,c=r.fallback;if(c&&a0&&(i=Math.max(i,s.width-n.x)),s.height>0&&(a=Math.max(a,s.height-n.y))}return{width:Math.max(0,i),height:Math.max(0,a)}}function lh(e){if(!e)return 0;let r=e.getBoundingClientRect();return Math.max(e.clientWidth||0,e.offsetWidth||0,r.width||0)}function Ln(){Pi&&cancelAnimationFrame(Pi);let e=(r=0)=>{Pi=0,Qn(),bs(),Oa(),Mc();let t=Bt("slideCanvas")?.closest(".canvas-area");if(!t||r>=oh)return;let{height:n}=Ec(t,{fallback:t.closest(".stage-shell")});ne(r+1)))};Pi=requestAnimationFrame(()=>e(0))}function Qn(){let e=Bt("slideCanvas"),r=e?.closest(".canvas-area"),t=e?.closest(".canvas-stage");if(!e||!r||!t)return;let{width:n,height:i}=Ec(r,{fallback:r.closest(".stage-shell")}),a=Math.max(160,n),o=Math.max(90,i),l=a,c=l*9/16;c>o&&(c=o,l=c*16/9);let s=Math.floor(l),u=Math.floor(c),d=`${a}x${o}`;if(d===bc&&t.style.width===`${s}px`&&t.style.height===`${u}px`){let p=e.querySelector(`.${pr}`);p&&Ar(p);return}bc=d,t.style.width=`${s}px`,t.style.height=`${u}px`,e.style.width="100%",e.style.height="100%";let A=Bt("presentSlide");A&&(A.style.width=`${s}px`,A.style.height=`${u}px`);let f=e.querySelector(`.${pr}`);f&&Ar(f)}function ch(e){let r=Bt("floatingToolbar"),t=Bt("slideCanvas");if(!r||!t||!e){r&&r.classList.remove("is-visible");return}let n=t.getBoundingClientRect(),i=e.x/100*n.width,a=e.y/100*n.height,o=e.w/100*n.width;r.style.left=`${n.left+i+o/2-r.offsetWidth/2}px`,r.style.top=`${n.top+a-r.offsetHeight-8}px`,r.classList.add("is-visible")}function hs(e,r){let t=String(e||"").trim(),n=parseFloat(t);return Number.isFinite(n)?t.endsWith("pt")?n*(96/72):(t.endsWith("px"),n):r}function gs(e,r,t){return String(e||"").replace(/(^|[^-.\w]):root(?![\w-])/gi,`$1${r}`).replace(/(^|[^-.\w])html(?![\w-])/gi,`$1${r}`).replace(/(^|[^-.\w])body(?![\w-])/gi,`$1${t}`)}var pr="html-slide-preview-host",Bc="html-slide-preview-scaler",ms={width:1280,height:720};function uh(e){let r=String(e||""),t=r.match(/(?:^|[{;\s])width\s*:\s*([\d.]+)\s*pt/i),n=r.match(/(?:^|[{;\s])height\s*:\s*([\d.]+)\s*pt/i);if(t?.[1]&&n?.[1])return{width:Math.round(parseFloat(t[1])*(96/72)),height:Math.round(parseFloat(n[1])*(96/72))};let i=r.match(/(?:^|[{;\s])width\s*:\s*([\d.]+)\s*px/i),a=r.match(/(?:^|[{;\s])height\s*:\s*([\d.]+)\s*px/i);return i?.[1]&&a?.[1]?{width:Math.round(parseFloat(i[1])),height:Math.round(parseFloat(a[1]))}:{...ms}}function dh(e){let r=Number(e?.dataset?.designW),t=Number(e?.dataset?.designH);return Number.isFinite(r)&&r>=320&&Number.isFinite(t)&&t>=180?{width:r,height:t}:null}function fh(e){let r=e?.body,t=e?.documentElement,n=e?.defaultView;if(!r||!t||!n)return{...ms};let i=n.getComputedStyle(r),a=hs(i.width,0),o=hs(i.height,0)||hs(i.minHeight,0);if(a>=320&&o>=180)return{width:a,height:o};let l=Math.max(r.scrollWidth||0,r.offsetWidth||0,t.clientWidth||0,1280),c=Math.max(r.scrollHeight||0,r.offsetHeight||0,t.clientHeight||0,720);return l=Math.min(Math.max(l,320),3840),c=Math.min(Math.max(c,180),3840),{width:l,height:c}}function hh(e,r){let t=dh(r);return t||(e?.body?fh(e):{...ms})}function vs(e){if(!e)return{width:0,height:0};let r=e.getBoundingClientRect();return{width:Math.max(e.clientWidth||0,e.offsetWidth||0,r.width||0),height:Math.max(e.clientHeight||0,e.offsetHeight||0,r.height||0)}}function Rc(e,r){let t=uh(r);return e.dataset.designW=String(t.width),e.dataset.designH=String(t.height),t}var wc="data-ppt-live-editing-style",Zn="data-ppt-live-editable";function ph(e,r){!e||e._pptLiveOriginalInline||!r?.documentElement||!r.body||(e._pptLiveOriginalInline={root:r.documentElement.getAttribute("style"),body:r.body.getAttribute("style")})}function Ah(e,r,t){if(!e?.documentElement||!e.body)return;let n=e.documentElement,i=e.body;n.style.margin="0",n.style.padding="0",n.style.width=`${r}px`,n.style.height=`${t}px`,n.style.overflow="hidden",i.style.margin="0",i.style.boxSizing="border-box",i.style.width=`${r}px`,i.style.height=`${t}px`,i.style.minHeight="",i.style.maxWidth="",i.style.overflow="hidden",i.style.transform="none"}function Ar(e){let r=e?.classList?.contains(pr)?e:e?.closest?.(`.${pr}`);if(!r)return!1;let t=r.querySelector(`.${Bc}`),n=t?.querySelector("iframe, [data-slide-stage]");if(!t||!n)return!1;let{width:i,height:a}=vs(r);if(!i||!a)return!1;let o=n.tagName==="IFRAME",l=null;if(o)try{l=n.contentDocument}catch{l=null}let{width:c,height:s}=hh(l,n),u=Math.min(i/c,a/s),d=c*u,A=s*u;return l&&(ph(n,l),Ah(l,c,s)),t.style.width=`${d}px`,t.style.height=`${A}px`,t.style.overflow="hidden",t.style.position="relative",t.style.flexShrink="0",n.style.display="block",n.style.width=`${c}px`,n.style.height=`${s}px`,n.style.border="0",n.style.margin="0",n.style.padding="0",n.style.maxWidth="none",n.style.maxHeight="none",n.style.transformOrigin="top left",n.style.transform=`scale(${u})`,!0}var xc="ppt-slide-shadow-root",As="ppt-slide-shadow-body";function gh(e){return e.querySelectorAll('script, iframe, object, embed, meta[http-equiv="refresh" i]').forEach(r=>r.remove()),e.querySelectorAll("*").forEach(r=>{for(let t of[...r.attributes]){let n=t.name.toLowerCase();(n.startsWith("on")||(n==="href"||n==="src"||n==="xlink:href")&&/^\s*javascript:/i.test(t.value))&&r.removeAttribute(t.name)}}),e}function mh(e,r){let t=document.createElement("div");t.className=r,t.dataset.slideStage="true",Rc(t,e);let n=Number(t.dataset.designW),i=Number(t.dataset.designH),a=gh(new DOMParser().parseFromString(Nr(e),"text/html")),o=t.attachShadow({mode:"open"}),l=document.createElement("div");l.className=xc,l.style.cssText=["all:initial","display:block","position:relative",`width:${n}px`,`height:${i}px`,"margin:0","padding:0","overflow:hidden",'font-family:system-ui, -apple-system, "PingFang SC", "Source Han Sans SC", sans-serif',"font-size:16px","line-height:normal","color:#000","background:#fff"].join(";"),a.querySelectorAll("style").forEach(s=>{let u=document.createElement("style");u.textContent=gs(s.textContent||"",`.${xc}`,`.${As}`),o.appendChild(u)});let c=document.createElement("div");if(c.className=As,a.body){for(let s of a.body.attributes)s.name==="class"?c.classList.add(...s.value.split(/\s+/).filter(Boolean)):s.name==="style"?c.style.cssText+=`;${s.value}`:s.name.toLowerCase().startsWith("on")||c.setAttribute(s.name,s.value);c.innerHTML=a.body.innerHTML}return c.style.boxSizing="border-box",/\bwidth\s*:/i.test(c.style.cssText)||(c.style.width=`${n}px`),/\bheight\s*:/i.test(c.style.cssText)||(c.style.height=`${i}px`),c.style.overflow="hidden",c.style.margin="0",l.appendChild(c),o.appendChild(l),t._pptLiveSourceHtml=String(e||""),t}function ys({hostClass:e="",frameClass:r,html:t,onReady:n,interactive:i=!1}){let a=document.createElement("div");a.className=[pr,e].filter(Boolean).join(" ");let o=document.createElement("div");if(o.className=Bc,i){let s=mh(t,r);return o.appendChild(s),a.appendChild(o),requestAnimationFrame(()=>{Ar(a),n?.(s,a)}),{host:a,scaler:o,frame:s}}let l=document.createElement("iframe");l.className=r,l.setAttribute("sandbox","allow-same-origin"),l.setAttribute("loading","lazy"),Rc(l,t),l.srcdoc=Nr(t);let c=()=>{Ar(a),n?.(l,a)};return l.addEventListener("load",c,{once:!0}),o.appendChild(l),a.appendChild(o),{host:a,scaler:o,frame:l}}function Lc(e){let{host:r}=ys({hostClass:"export-preview__html-stage",frameClass:"export-preview__html-frame",html:e,onReady:()=>{r.closest(".export-preview__viewport")&&Ar(r)}});return r}function Nc(e){if(!e)return;let r=e.querySelector(".export-preview__viewport")||e,t=r.querySelector(".export-preview__scale");if(!t)return;let n=t.querySelector(`.${pr}`);if(n){t.style.width="100%",t.style.height="100%",Ar(n);return}let i=t.querySelector(".export-preview__element-stage");if(!i)return;let{width:a,height:o}=vs(r);if(!a||!o)return;let l=960,c=540,s=Math.min(a/l,o/c);i.style.width=`${l}px`,i.style.height=`${c}px`,i.style.transform=`scale(${s})`,i.style.transformOrigin="top left",t.style.width=`${Math.floor(l*s)}px`,t.style.height=`${Math.floor(c*s)}px`}function vh(e){if(!e||new Set(["turn","round","round-done","tokens","text","thinking"]).has(e.kind||""))return"";let t=String(e.detail||"").trim();return!t||/^[0-9a-f-]{8,}/i.test(t)?"":t}function yh(e){if(!e)return;(typeof requestAnimationFrame=="function"?requestAnimationFrame:t=>setTimeout(t,0))(()=>{e.scrollTop=e.scrollHeight})}function Fr(e){let r=Bt("generationSteps"),t=e.generation?.steps||[],n=Array.isArray(e.generation?.events)?e.generation.events:[],i=Array.isArray(e.generation?.agentStream)?e.generation.agentStream:[],a=!!(e.generation?.active||t.some(c=>c.status==="running")),o=t.some(c=>c.status==="error");if(document.querySelector(".ppt-live")?.classList.toggle("is-generating",a),document.querySelector(".ppt-live")?.classList.toggle("has-generation-error",o),!r)return;let l=bh(n,i);if(r.innerHTML="",l.length){for(let c of l){let s=c.source==="event"?wh(c):xh(c);s&&r.append(s)}if(a&&!o){let c=Sh(e,l);c&&r.append(c)}}else{let c=document.createElement("li");c.className="generation-event is-empty",c.innerHTML=` -- ${Le($("processWaitingForEventsTitle"))} ${Le($("processWaitingForEvents"))} - `,r.append(c)}Nc(r),t&&yh(t,a,o)}}function yh(e,r,t){if(e.innerHTML="",!r.length){e.classList.toggle("is-empty",!0),e.innerHTML=`
  • ${Le($("processWaitingForEvents"))}
  • `;return}e.classList.toggle("is-empty",!1);for(let n of r){let i=bh(n);i&&e.append(i)}Nc(e)}function bh(e){let r=document.createElement("li"),t=String(e.kind||"system");r.className=`agent-stream-entry is-${t}`;let n=e.isSubagent?"\u21B3 ":"";if(t==="text"){let a=String(e.text||"").trim();return a?(r.innerHTML=`${Le($("agentStreamAssistant"))}${Le(n+a)}`,r):null}if(t==="tool-start"){let a=fs(e.toolName);return r.innerHTML=`${Le(a)}${Le(n+String(e.text||""))}`,r}if(t==="tool-done"){let a=fs(e.toolName),o=String(e.text||"").trim();return r.className="agent-stream-entry is-tool-done",r.innerHTML=`${Le(a)} \u2713${o?`${Le(n+o)}`:""}`,r}if(t==="tool-error"){let a=fs(e.toolName);return r.innerHTML=`${Le(a)} \u2717${Le(n+String(e.text||""))}`,r}let i=String(e.text||"").trim();return i?(r.innerHTML=`${Le(n+i)}`,r):null}function fs(e){let r=String(e||"").trim();if(!r)return $("eventUnknownTool");let t=r.toLowerCase();return t==="websearch"?$("eventToolWebSearchName"):t==="webfetch"||t==="mcp__web_reader__webreader"?$("eventToolWebFetchName"):t==="skill"?$("eventToolSkillName"):t==="read"?"Read":t==="write"?"Write":t==="edit"?"Edit":t==="grep"?"Grep":t==="glob"?"Glob":t==="task"?"Task":t==="todowrite"||t==="todo_write"?"TodoWrite":r}function Ir(e){let r=e.generation?.steps||[],t=!!(e.generation?.active||r.some(i=>i.status==="running")),n=Bt("statusSpinner");n&&(n.hidden=!t,n.setAttribute("aria-hidden",t?"false":"true"))}function La(e="sans"){let r=e==="serif"?"serif":"sans";document.querySelectorAll("[data-font-family]").forEach(t=>{let n=t.dataset.fontFamily===r;t.classList.toggle("is-active",n),t.setAttribute("aria-pressed",n?"true":"false")})}function Na(e="light"){let r=e==="dark"?"dark":"light";document.querySelectorAll("[data-color-mode]").forEach(t=>{let n=t.dataset.colorMode===r;t.classList.toggle("is-active",n),t.setAttribute("aria-pressed",n?"true":"false")})}function Ia(e="standard"){let r=En(e),t=xa(r),n=document.getElementById("densitySlider");if(n){n.style.setProperty("--density-index",String(t)),n.dataset.index=String(t),n.setAttribute("aria-valuenow",String(t));let i=`density${r.charAt(0).toUpperCase()}${r.slice(1)}`;n.setAttribute("aria-valuetext",$(i)),n.querySelectorAll("[data-density-index]").forEach(a=>{let o=Number(a.dataset.densityIndex)===t;a.classList.toggle("is-active",o)})}document.querySelector(".ppt-live")?.setAttribute("data-density",r)}function wh(e){let r=typeof e.promptDraft=="string"?e.promptDraft:"",t=Array.isArray(e.slides)&&e.slides.length>0;Ih("topicInput",t?r:r||e.brief.topic),hs("deckTitle",e.title||$("defaultDeckTitle")),hs("deckMeta",$("slidesMeta",{count:e.slides.length})),hs("currentSlideIndex",String(Jt(e)+1))}function Ic(e){if(!e)return;let t=document.getElementById("stylePresetSelect")?.value||an,n=document.querySelector("[data-font-family].is-active"),i=document.querySelector("[data-color-mode].is-active"),a=document.getElementById("densitySlider"),o=Math.max(0,Math.min(2,Number(a?.dataset.index??1)));e.style={...e.style||{},stylePreset:t,fontFamily:n?.dataset.fontFamily==="serif"?"serif":"sans",colorMode:i?.dataset.colorMode==="dark"?"dark":"light",density:Sa(o)}}function Di(e){if(!e?.style)return;La(e.style.fontFamily),Na(e.style.colorMode),Ia(e.style.density);let r=document.getElementById("stylePresetSelect");r&&(r.value=e.style.stylePreset||an,Ci(r))}function zc(e,r={}){r.includeTopic!==!1&&(e.brief.topic=zh("topicInput"),e.promptDraft=e.brief.topic,xh(e))}function xh(e){let r=String(e.brief.topic||""),t=r.match(/(\d{1,2})\s*(?:页|页面|张|slides?|pages?)/i)||r.match(/(?:页数|slides?|pages?)\D{0,8}(\d{1,2})/i);t?e.brief.slideTarget=Math.max(3,Math.min(24,Number(t[1]))):e.brief.slideTarget=0}function Sh(e,r){let t=Bt("outlineList");t&&(t.innerHTML="",e.outline.forEach((n,i)=>{let a=document.createElement("li"),o=e.slides[i];a.className=`outline-row${o?.id===e.activeSlideId?" is-active":""}`,a.innerHTML=` + `,r.append(c)}yh(r)}function bh(e,r){let t=e.map(i=>({...i,source:"event"})),n=r.map(i=>({...i,source:"stream"}));return[...t,...n].sort((i,a)=>(i.timestamp||0)-(a.timestamp||0)).slice(-120)}function wh(e){let r=vh(e),t=document.createElement("li");return t.className=`generation-event is-${e.kind||"info"}`,t.innerHTML=` + ${Number(e.seq)||"\xB7"} + + ${Le(e.title||$("processEventUnknown"))} + ${r?`${Le(r)}`:""} + + `,t}function xh(e){let r=document.createElement("li"),t=String(e.kind||"system");r.className=`generation-event is-stream is-stream-${t}`;let n=e.isSubagent?"\u21B3 ":"";if(t==="text"){let a=Fi(String(e.text||"").trim(),120);return a?(r.innerHTML=` + ${Le($("agentStreamAssistant"))} + + ${Le(n+a)} + + `,r):null}if(t==="tool-start"){let a=Ra(e.toolName);return r.innerHTML=` + ${Le(a)} + + ${Le(n+Fi(String(e.text||""),120))} + + `,r}if(t==="tool-done"){let a=Ra(e.toolName),o=Fi(String(e.text||"").trim(),120);return r.innerHTML=` + ${Le(a)} \u2713 + + ${o?`${Le(n+o)}`:"\u2713"} + + `,r}if(t==="tool-error"){let a=Ra(e.toolName);return r.innerHTML=` + ${Le(a)} \u2717 + + ${Le(n+Fi(String(e.text||""),120))} + + `,r}let i=Fi(String(e.text||"").trim(),200);return i?(r.className="generation-event is-stream is-stream-system",r.innerHTML=` + \xB7 + + ${Le(n+i)} + + `,r):null}function Sh(e,r){let t=kh(e,r),n=document.createElement("li");return n.className="generation-event is-live",n.innerHTML=` + + + + + ${Le(t)} + + `,n}function kh(e,r){for(let n=r.length-1;n>=0;n--){let i=r[n];if(i.source==="stream"){if(i.kind==="tool-start")return`${Ra(i.toolName)}\u2026`;if(i.kind==="text")return $("processEventText")}if(i.source==="event"&&i.title)return i.title}let t=(e.generation?.steps||[]).find(n=>n.status==="running");return t?.label?`${t.label}\u2026`:$("generationProgressPulse")}function Fi(e,r=200){let t=String(e||"").replace(/\s+/g," ").trim();return t?t.length>r?`${t.slice(0,r-1)}\u2026`:t:""}function Ra(e){let r=String(e||"").trim();if(!r)return $("eventUnknownTool");let t=r.toLowerCase();return t==="websearch"?$("eventToolWebSearchName"):t==="webfetch"||t==="mcp__web_reader__webreader"?$("eventToolWebFetchName"):t==="skill"?$("eventToolSkillName"):t==="read"?$("eventToolReadName"):t==="write"?$("eventToolWriteName"):t==="edit"?$("eventToolEditName"):t==="grep"?"Grep":t==="glob"?"Glob":t==="task"?$("eventToolTaskName"):t==="todowrite"||t==="todo_write"?"TodoWrite":r}function Wr(e){let r=e.generation?.steps||[],t=!!(e.generation?.active||r.some(i=>i.status==="running")),n=Bt("statusSpinner");n&&(n.hidden=!t,n.setAttribute("aria-hidden",t?"false":"true"))}function Ia(e="sans"){let r=e==="serif"?"serif":"sans";document.querySelectorAll("[data-font-family]").forEach(t=>{let n=t.dataset.fontFamily===r;t.classList.toggle("is-active",n),t.setAttribute("aria-pressed",n?"true":"false")})}function za(e="light"){let r=e==="dark"?"dark":"light";document.querySelectorAll("[data-color-mode]").forEach(t=>{let n=t.dataset.colorMode===r;t.classList.toggle("is-active",n),t.setAttribute("aria-pressed",n?"true":"false")})}function Ma(e="standard"){let r=En(e),t=Sa(r),n=document.getElementById("densitySlider");if(n){n.style.setProperty("--density-index",String(t)),n.dataset.index=String(t),n.setAttribute("aria-valuenow",String(t));let i=`density${r.charAt(0).toUpperCase()}${r.slice(1)}`;n.setAttribute("aria-valuetext",$(i)),n.querySelectorAll("[data-density-index]").forEach(a=>{let o=Number(a.dataset.densityIndex)===t;a.classList.toggle("is-active",o)})}document.querySelector(".ppt-live")?.setAttribute("data-density",r)}function Ch(e){let r=typeof e.promptDraft=="string"?e.promptDraft:"",t=Array.isArray(e.slides)&&e.slides.length>0;_h("topicInput",t?r:r||e.brief.topic),ps("deckTitle",e.title||$("defaultDeckTitle")),ps("deckMeta",$("slidesMeta",{count:e.slides.length})),ps("currentSlideIndex",String(Jt(e)+1))}function Ic(e){if(!e)return;let t=document.getElementById("stylePresetSelect")?.value||an,n=document.querySelector("[data-font-family].is-active"),i=document.querySelector("[data-color-mode].is-active"),a=document.getElementById("densitySlider"),o=Math.max(0,Math.min(2,Number(a?.dataset.index??1)));e.style={...e.style||{},stylePreset:t,fontFamily:n?.dataset.fontFamily==="serif"?"serif":"sans",colorMode:i?.dataset.colorMode==="dark"?"dark":"light",density:ka(o)}}function Ei(e){if(!e?.style)return;Ia(e.style.fontFamily),za(e.style.colorMode),Ma(e.style.density);let r=document.getElementById("stylePresetSelect");r&&(r.value=e.style.stylePreset||an,Ci(r))}function zc(e,r={}){r.includeTopic!==!1&&(e.brief.topic=Uh("topicInput"),e.promptDraft=e.brief.topic,Ph(e))}function Ph(e){let r=String(e.brief.topic||""),t=r.match(/(\d{1,2})\s*(?:页|页面|张|slides?|pages?)/i)||r.match(/(?:页数|slides?|pages?)\D{0,8}(\d{1,2})/i);t?e.brief.slideTarget=Math.max(3,Math.min(24,Number(t[1]))):e.brief.slideTarget=0}function Fh(e,r){let t=Bt("outlineList");t&&(t.innerHTML="",e.outline.forEach((n,i)=>{let a=document.createElement("li"),o=e.slides[i];a.className=`outline-row${o?.id===e.activeSlideId?" is-active":""}`,a.innerHTML=` ${i+1} - `,a.querySelector(".outline-card").addEventListener("click",()=>{o?.id&&r.selectSlide(o.id)}),t.append(a)}))}function Nn(e,r){let t=Bt("slideThumbs");if(t){if(t.innerHTML="",!e.slides.length){let n=document.createElement("div");n.className="thumbs-empty",n.textContent=$("slidesEmptyHint"),t.append(n);return}e.slides.forEach((n,i)=>{let a=n.html?Ca(n.html):null,o=n.theme||{},l=a||o.background||"var(--studio-slide-chrome)",c=document.createElement("button");c.className=`thumb${n.id===e.activeSlideId?" is-active":""}`,c.type="button",c.style.setProperty("--thumb-bg",l),c.style.setProperty("--thumb-primary",o.primary||"var(--studio-accent)");let s=document.createElement("div");if(s.className="thumb-preview",s.style.background=l,n.html)s.appendChild(kh(n.html));else{let A=document.createElement("div");A.className="thumb-preview-slide",A.innerHTML=un(n),s.appendChild(A)}c.appendChild(s);let u=document.createElement("div");u.className="thumb-copy",u.innerHTML=` + `,a.querySelector(".outline-card").addEventListener("click",()=>{o?.id&&r.selectSlide(o.id)}),t.append(a)}))}function Nn(e,r){let t=Bt("slideThumbs");if(t){if(t.innerHTML="",!e.slides.length){let n=document.createElement("div");n.className="thumbs-empty",n.textContent=$("slidesEmptyHint"),t.append(n);return}e.slides.forEach((n,i)=>{let a=n.html?Pa(n.html):null,o=n.theme||{},l=a||o.background||"var(--studio-slide-chrome)",c=document.createElement("button");c.className=`thumb${n.id===e.activeSlideId?" is-active":""}`,c.type="button",c.style.setProperty("--thumb-bg",l),c.style.setProperty("--thumb-primary",o.primary||"var(--studio-accent)");let s=document.createElement("div");if(s.className="thumb-preview",s.style.background=l,n.html)s.appendChild(Th(n.html));else{let A=document.createElement("div");A.className="thumb-preview-slide",A.innerHTML=un(n),s.appendChild(A)}c.appendChild(s);let u=document.createElement("div");u.className="thumb-copy",u.innerHTML=` ${Le(n.kicker||"")} ${Le(n.title)} - `,c.appendChild(u);let d=document.createElement("span");d.className="thumb-number",d.textContent=String(i+1),c.appendChild(d),c.addEventListener("click",()=>r.selectSlide(n.id)),t.append(c)}),requestAnimationFrame(()=>{ys(),za()})}}var Ba=960,Ra=540;function kh(e){let{host:r}=vs({hostClass:"thumb-preview-html",frameClass:"thumb-preview-frame",html:e,onReady:()=>gr(r)});return r}function Ch(e,r){let t=e?.closest?.(`.${Ar}`)||r?.querySelector?.(`.${Ar}`);if(t){gr(t);return}if(!e||!r)return;let{width:n,height:i}=ms(r);if(!n||!i)return;let a=Math.min(n/Ba,i/Ra);e.style.width=`${Ba}px`,e.style.height=`${Ra}px`,e.style.transform=`scale(${a})`,e.style.transformOrigin="top left"}function Ph(e){let r=e.querySelector(".thumb-preview-frame");if(r){Ch(r,e);return}let t=e.querySelector(".thumb-preview-html, .thumb-preview-slide");if(!t)return;let n=lh(e);if(!n)return;let i=n/Ba,a=Ra*i;t.style.width=`${Ba}px`,t.style.height=`${Ra}px`,t.style.transform=`scale(${i})`,t.style.transformOrigin="top left",e.style.height=`${a}px`}function ys(){let e=Bt("slideThumbs");e&&(e.querySelectorAll(`.${Ar}`).forEach(r=>{gr(r)}),e.querySelectorAll(".thumb-preview").forEach(r=>{r.querySelector(`.${Ar}`)||Ph(r)}))}var Fi=null,Ti=null;function Mc(){if(typeof ResizeObserver>"u")return;Ti||(Ti=new ResizeObserver(()=>{document.querySelectorAll(`.${Ar}`).forEach(r=>{gr(r)})})),Ti.disconnect(),document.querySelectorAll(`.${Ar}`).forEach(r=>{Ti.observe(r)});let e=Bt("slideCanvas");e&&Ti.observe(e)}function za(){let e=Bt("slideThumbs");!e||typeof ResizeObserver>"u"||(Fi||(Fi=new ResizeObserver(()=>ys())),Fi.disconnect(),Fi.observe(e),e.querySelectorAll(".thumb-preview").forEach(r=>{Fi.observe(r)}),Mc())}function Fh(e){if(!String(e.brief?.topic||"").trim()){let n=String(e.title||"").trim();if(n===$("blankDeckTitle")||n===$("defaultDeckTitle")||n===$("newSlideTitle"))return!0}if(!e.slides?.length)return!0;let r=String(e.title||"").trim();return e.slides.length===1&&e.outline.length===1&&e.outline[0]===$("newSlideTitle")&&(r===$("blankDeckTitle")||r===$("newSlideTitle"))}function Da(e,r){if(!e)return;if(!r){e.style.background="";return}let t=r.theme||{},i=(r.html?Ca(r.html):null)||t.background||"";e.style.background=i||""}function cn(e,r){let t=Bt("slideCanvas");if(!t)return;let n=qt(e),i=!!(e.generation?.active||e.generation?.steps?.some(o=>o.status==="running"));if(!n){t.classList.remove("is-html-slide"),t.classList.add("is-empty"),t.innerHTML=i?`
    ${Le($("generationAgentWorking"))}

    ${Le($("agentWorkingDetail"))}

    `:`

    ${Le($("welcomeTitle"))}

    ${Le($("welcomeSubcopy"))}

    `,kc(t),Da(t,null),Qn();return}if(Fh(e)&&!n.html&&!i){t.classList.remove("is-html-slide"),t.classList.add("is-empty"),t.innerHTML=` + `,c.appendChild(u);let d=document.createElement("span");d.className="thumb-number",d.textContent=String(i+1),c.appendChild(d),c.addEventListener("click",()=>r.selectSlide(n.id)),t.append(c)}),requestAnimationFrame(()=>{bs(),Oa()})}}var La=960,Na=540;function Th(e){let{host:r}=ys({hostClass:"thumb-preview-html",frameClass:"thumb-preview-frame",html:e,onReady:()=>Ar(r)});return r}function Dh(e,r){let t=e?.closest?.(`.${pr}`)||r?.querySelector?.(`.${pr}`);if(t){Ar(t);return}if(!e||!r)return;let{width:n,height:i}=vs(r);if(!n||!i)return;let a=Math.min(n/La,i/Na);e.style.width=`${La}px`,e.style.height=`${Na}px`,e.style.transform=`scale(${a})`,e.style.transformOrigin="top left"}function Eh(e){let r=e.querySelector(".thumb-preview-frame");if(r){Dh(r,e);return}let t=e.querySelector(".thumb-preview-html, .thumb-preview-slide");if(!t)return;let n=lh(e);if(!n)return;let i=n/La,a=Na*i;t.style.width=`${La}px`,t.style.height=`${Na}px`,t.style.transform=`scale(${i})`,t.style.transformOrigin="top left",e.style.height=`${a}px`}function bs(){let e=Bt("slideThumbs");e&&(e.querySelectorAll(`.${pr}`).forEach(r=>{Ar(r)}),e.querySelectorAll(".thumb-preview").forEach(r=>{r.querySelector(`.${pr}`)||Eh(r)}))}var Ti=null,Di=null;function Mc(){if(typeof ResizeObserver>"u")return;Di||(Di=new ResizeObserver(()=>{document.querySelectorAll(`.${pr}`).forEach(r=>{Ar(r)})})),Di.disconnect(),document.querySelectorAll(`.${pr}`).forEach(r=>{Di.observe(r)});let e=Bt("slideCanvas");e&&Di.observe(e)}function Oa(){let e=Bt("slideThumbs");!e||typeof ResizeObserver>"u"||(Ti||(Ti=new ResizeObserver(()=>bs())),Ti.disconnect(),Ti.observe(e),e.querySelectorAll(".thumb-preview").forEach(r=>{Ti.observe(r)}),Mc())}function Bh(e){if(!String(e.brief?.topic||"").trim()){let n=String(e.title||"").trim();if(n===$("blankDeckTitle")||n===$("defaultDeckTitle")||n===$("newSlideTitle"))return!0}if(!e.slides?.length)return!0;let r=String(e.title||"").trim();return e.slides.length===1&&e.outline.length===1&&e.outline[0]===$("newSlideTitle")&&(r===$("blankDeckTitle")||r===$("newSlideTitle"))}function Ea(e,r){if(!e)return;if(!r){e.style.background="";return}let t=r.theme||{},i=(r.html?Pa(r.html):null)||t.background||"";e.style.background=i||""}function cn(e,r){let t=Bt("slideCanvas");if(!t)return;let n=qt(e),i=!!(e.generation?.active||e.generation?.steps?.some(o=>o.status==="running"));if(!n){t.classList.remove("is-html-slide"),t.classList.add("is-empty"),t.innerHTML=i?`
    ${Le($("generationAgentWorking"))}

    ${Le($("agentWorkingDetail"))}

    `:`

    ${Le($("welcomeTitle"))}

    ${Le($("welcomeSubcopy"))}

    `,Cc(t),Ea(t,null),Qn();return}if(Bh(e)&&!n.html&&!i){t.classList.remove("is-html-slide"),t.classList.add("is-empty"),t.innerHTML=`

    ${Le($("welcomeTitle"))}

    @@ -34,8 +66,8 @@ Incremental: add new information, e.g. "Add a competitor analysis section after
    - `,kc(t),Da(t,null),Qn();return}if(t.classList.remove("is-empty"),n?.html){t.innerHTML="",t.classList.add("is-html-slide");let{host:o,frame:l}=vs({frameClass:"html-slide-frame",html:n.html,interactive:!0,onReady:c=>{Eh(c,n.id,r),Qn(),gr(o),requestAnimationFrame(()=>gr(o))}});t.append(o),Da(t,n),t.classList.remove("is-entering"),t.offsetWidth,t.classList.add("is-entering"),Qn();return}t.classList.remove("is-html-slide"),t.innerHTML=n?un(n,{selectedElementId:e.selectedElementId,editable:!0}):"",t.querySelectorAll(".slide-element").forEach(o=>{let l=o.dataset.elementId;o.addEventListener("click",c=>{c.stopPropagation(),r.selectElement(l)}),o.addEventListener("pointerdown",c=>{c.target?.isContentEditable&&!c.target.classList.contains("resize-handle")||r.beginDrag(c,l)})}),t.querySelectorAll("[data-edit-text]").forEach(o=>{o.addEventListener("blur",()=>{r.updateElementTextDirect(o.dataset.editText,o.textContent||"")}),o.addEventListener("keydown",l=>{(l.metaKey||l.ctrlKey)&&l.key==="Enter"&&o.blur()})}),t.querySelectorAll("[data-edit-list]").forEach(o=>{o.addEventListener("blur",()=>{r.updateElementListItemDirect(o.dataset.editList,Number(o.dataset.itemIndex),o.textContent||"")}),o.addEventListener("keydown",l=>{(l.metaKey||l.ctrlKey)&&l.key==="Enter"&&o.blur()})}),t.classList.remove("is-entering"),t.offsetWidth,t.classList.add("is-entering");let a=Rn(e);if(a)ch(a);else{let o=Bt("floatingToolbar");o&&o.classList.remove("is-visible")}Da(t,n),Qn()}function Ma(e,r){let t=Bt("elementInspector"),n=Rn(e),i=qt(e);if(!(!t||!i)){if(t.hidden){t.innerHTML="";return}if(!n){t.innerHTML=`${xc(i)}

    ${$("noSelection")}

    `,Sc(t,r),t.querySelector("#slideNotesInput")?.addEventListener("input",a=>r.updateSlideNotes(a.target.value));return}t.innerHTML=` - ${xc(i)} + `,Cc(t),Ea(t,null),Qn();return}if(t.classList.remove("is-empty"),n?.html){t.innerHTML="",t.classList.add("is-html-slide");let{host:o,frame:l}=ys({frameClass:"html-slide-frame",html:n.html,interactive:!0,onReady:c=>{Nh(c,n.id,r),Qn(),Ar(o),requestAnimationFrame(()=>Ar(o))}});t.append(o),Ea(t,n),t.classList.remove("is-entering"),t.offsetWidth,t.classList.add("is-entering"),Qn();return}t.classList.remove("is-html-slide"),t.innerHTML=n?un(n,{selectedElementId:e.selectedElementId,editable:!0}):"",t.querySelectorAll(".slide-element").forEach(o=>{let l=o.dataset.elementId;o.addEventListener("click",c=>{c.stopPropagation(),r.selectElement(l)}),o.addEventListener("pointerdown",c=>{c.target?.isContentEditable&&!c.target.classList.contains("resize-handle")||r.beginDrag(c,l)})}),t.querySelectorAll("[data-edit-text]").forEach(o=>{o.addEventListener("blur",()=>{r.updateElementTextDirect(o.dataset.editText,o.textContent||"")}),o.addEventListener("keydown",l=>{(l.metaKey||l.ctrlKey)&&l.key==="Enter"&&o.blur()})}),t.querySelectorAll("[data-edit-list]").forEach(o=>{o.addEventListener("blur",()=>{r.updateElementListItemDirect(o.dataset.editList,Number(o.dataset.itemIndex),o.textContent||"")}),o.addEventListener("keydown",l=>{(l.metaKey||l.ctrlKey)&&l.key==="Enter"&&o.blur()})}),t.classList.remove("is-entering"),t.offsetWidth,t.classList.add("is-entering");let a=Rn(e);if(a)ch(a);else{let o=Bt("floatingToolbar");o&&o.classList.remove("is-visible")}Ea(t,n),Qn()}function _a(e,r){let t=Bt("elementInspector"),n=Rn(e),i=qt(e);if(!(!t||!i)){if(t.hidden){t.innerHTML="";return}if(!n){t.innerHTML=`${Sc(i)}

    ${$("noSelection")}

    `,kc(t,r),t.querySelector("#slideNotesInput")?.addEventListener("input",a=>r.updateSlideNotes(a.target.value));return}t.innerHTML=` + ${Sc(i)}
    - - - - + + + +
    @@ -55,7 +87,7 @@ Incremental: add new information, e.g. "Add a competitor analysis section after
    - `,["elementTextInput","elementItemsInput","elementDataInput","elementXInput","elementYInput","elementWInput","elementHInput","elementFontInput","elementWeightInput","elementColorInput","elementBgInput","slideNotesInput"].forEach(a=>t.querySelector(`#${a}`)?.addEventListener("input",()=>r.updateElementFromInspector())),Sc(t,r)}}function xc(e){return` + `,["elementTextInput","elementItemsInput","elementDataInput","elementXInput","elementYInput","elementWInput","elementHInput","elementFontInput","elementWeightInput","elementColorInput","elementBgInput","slideNotesInput"].forEach(a=>t.querySelector(`#${a}`)?.addEventListener("input",()=>r.updateElementFromInspector())),kc(t,r)}}function Sc(e){return`
    @@ -63,21 +95,21 @@ Incremental: add new information, e.g. "Add a competitor analysis section after
    - ${Th(e)} - `}function Th(e){let r=Array.isArray(e.quality?.issues)?e.quality.issues:[];return r.length?` + ${Rh(e)} + `}function Rh(e){let r=Array.isArray(e.quality?.issues)?e.quality.issues:[];return r.length?`
    ${Le($("qualityReportTitle"))}: ${Math.round(Number(e.quality?.score??100))}/100
      ${r.map(t=>`
    • ${Le(t.message)}
    • `).join("")}
    - `:""}function Sc(e,r){["slideKickerInput","slideClaimInput","slideProofInput","slideSupportInput","slideSourceInput"].forEach(t=>{e.querySelector(`#${t}`)?.addEventListener("input",()=>r.updateSlideMethodology())})}function un(e,r={}){if(e?.html)return``;let t=!!r.editable,n=r.selectedElementId||"",i=[`--slide-bg:${e.theme.background}`,`--slide-ink:${e.theme.ink}`,`--slide-muted:${e.theme.muted}`,`--slide-primary:${e.theme.primary}`,`--slide-accent:${e.theme.accent}`,`--slide-panel:${e.theme.panel||"#ffffff"}`].join(";");return`
    + `:""}function kc(e,r){["slideKickerInput","slideClaimInput","slideProofInput","slideSupportInput","slideSourceInput"].forEach(t=>{e.querySelector(`#${t}`)?.addEventListener("input",()=>r.updateSlideMethodology())})}function un(e,r={}){if(e?.html)return``;let t=!!r.editable,n=r.selectedElementId||"",i=[`--slide-bg:${e.theme.background}`,`--slide-ink:${e.theme.ink}`,`--slide-muted:${e.theme.muted}`,`--slide-primary:${e.theme.primary}`,`--slide-accent:${e.theme.accent}`,`--slide-panel:${e.theme.panel||"#ffffff"}`].join(";");return`
    ${e.kicker?`
    ${Le(e.kicker)}
    `:""} ${e.proofObject?`
    ${Le(e.proofObject)}
    `:""} - ${Dh(e)} - ${(e.elements||[]).map(a=>Rh(a,e.theme,t,n)).join("")} + ${Lh(e)} + ${(e.elements||[]).map(a=>zh(a,e.theme,t,n)).join("")} ${e.sourceNote?`
    ${Le(e.sourceNote)}
    `:""} -
    `}function Dh(e){let r=Array.isArray(e.quality?.issues)?e.quality.issues:[];if(!r.length)return"";let t=r.filter(i=>i.severity==="high").length,n=t?$("qualityNeedsReview"):$("qualityHasWarnings");return`
    ${Le(n)}
    `}function kc(e){e.querySelectorAll("[data-welcome-prompt]").forEach(r=>{r.addEventListener("click",()=>{let t=Bt("topicInput");t&&(t.value=r.dataset.welcomePrompt||r.textContent||"",t.focus())})})}function Eh(e,r,t){if(!t?.updateSlideHtmlDirect)return;let n=e?.shadowRoot,i=n?.querySelector(`.${ps}`);if(!n||!i)return;if(!n.querySelector(`style[${bc}]`)){let c=document.createElement("style");c.setAttribute(bc,"true"),c.textContent=[`[${Zn}] { cursor: text; -webkit-user-select: text !important; user-select: text !important; }`,`[${Zn}]:hover { outline: 1.5px dashed rgba(37, 99, 235, 0.55); outline-offset: 1px; }`,`[${Zn}]:focus { outline: 2px solid rgba(37, 99, 235, 0.85); outline-offset: 1px; }`].join(` -`),n.appendChild(c)}n.addEventListener("click",c=>{c.target?.closest?.("a[href]")&&c.preventDefault()},!0);let a=()=>{let c=Bh(e,i);c&&t.updateSlideHtmlDirect(r,c)},o=i.querySelectorAll("h1,h2,h3,h4,h5,h6,p,li,span,strong,em,b,i,u,small,code,a,label,blockquote,td,th,dt,dd,figcaption,div"),l=0;o.forEach(c=>{Array.from(c.childNodes).some(u=>u.nodeType===Node.TEXT_NODE&&String(u.textContent||"").trim())&&(l+=1,c.setAttribute("contenteditable","true"),c.setAttribute("spellcheck","false"),c.setAttribute(Zn,"true"),c.addEventListener("blur",a),c.addEventListener("keydown",u=>{((u.metaKey||u.ctrlKey)&&u.key==="Enter"||u.key==="Escape")&&(u.preventDefault(),c.blur())}))}),l||console.warn("[ppt-live] no editable nodes bound for slide",{slideId:r,candidates:o.length})}function Bh(e,r){let t=String(e?._pptLiveSourceHtml||"");if(!t)return"";let n=new DOMParser().parseFromString(Wr(t),"text/html");if(!n.body)return"";let i=r.cloneNode(!0);i.querySelectorAll(`[${Zn}]`).forEach(o=>{o.removeAttribute("contenteditable"),o.removeAttribute("spellcheck"),o.removeAttribute(Zn)}),n.body.innerHTML=i.innerHTML;let a=` -${n.documentElement.outerHTML}`;return e._pptLiveSourceHtml=a,a}function Wr(e){let r=String(e||"").trim();return r?/]/i.test(r)?r:`${r}`:''}function Rh(e,r,t,n){let i=t&&n===e.id,a=[`left:${e.x}%`,`top:${e.y}%`,`width:${e.w}%`,`height:${e.h}%`,`font-size:${Nh(e.style.fontSize)}`,`font-weight:${e.style.fontWeight}`,`color:${Cc(e.style.color,r)}`,`text-align:${e.style.align||"left"}`,`background:${Cc(e.style.background,r)}`,`opacity:${e.style.opacity}`,`border-radius:${e.style.borderRadius}px`].join(";"),o="";if(e.type==="list")o=`
      ${(e.items||[]).map((l,c)=>t?`
    • ${Le(l)}
    • `:`
    • ${Le(l)}
    • `).join("")}
    `;else if(e.type==="metric")o=`${Le(e.text)}${Le(e.label)}`;else if(e.type==="chart"){let l=Math.max(1,...(e.data||[]).map(c=>Number(c.value)||0));o=`${Le(e.text)}
    ${(e.data||[]).map(c=>`${Le(c.label)}`).join("")}
    `}else e.type==="media"?o=`${Le(e.text||$("mediaPlaceholder"))}`:o=t?`${Le(e.text||"")}`:Le(e.text||"");return`
    ${o}${i?'':""}
    `}function Cc(e,r){return!e||e==="transparent"?"transparent":e==="ink"?r.ink:e==="muted"?r.muted:e==="primary"?r.primary:e==="accent"?r.accent:e==="panel"?r.panel||"#ffffff":e==="soft"?Lh(r.primary,.1):e==="background"?r.background:e}function Lh(e,r){let t=String(e||"#0f766e").replace("#",""),n=parseInt(t.length===3?t.split("").map(l=>l+l).join(""):t,16),i=n>>16&255,a=n>>8&255,o=n&255;return`rgba(${i}, ${a}, ${o}, ${r})`}function Nh(e){let r=Math.max(8,Number(e)||24);return`clamp(8px, ${Math.round(r/10.2*1e3)/1e3}cqw, ${r}px)`}function Bt(e){return document.getElementById(e)}function Ih(e,r){let t=Bt(e);t&&document.activeElement!==t&&(t.value=r??"")}function zh(e){return Bt(e)?.value||""}function hs(e,r){let t=Bt(e);t&&(t.textContent=String(r??""))}function Ea(e){return Math.round(Number(e)*10)/10}function Oc(e=document,r=!1){let t=e,n=t.defaultView||window,i=new Set(["SCRIPT","STYLE","PRE","CODE","SVG","TEXTAREA"]),a="strong,b,em,i,u,span,a,small,mark,sub,sup,code",o="p,h1,h2,h3,h4,h5,h6,li";function l(E){let B=String(E.className||"").toLowerCase(),T=String(E.getAttribute?.("role")||"").toLowerCase();return/h1|title|headline|hero/.test(B)||T==="heading"?"h1":/h2|subtitle|subhead|section-title/.test(B)?"h2":/h3|kicker|eyebrow|label|caption/.test(B)?"h3":"p"}function c(E){return!E||E==="transparent"||E==="rgba(0, 0, 0, 0)"}function s(){let E=t.body;if(!E)return;let B=n.getComputedStyle(E),T=parseFloat(B.width),W=parseFloat(B.height);E.style.width=T>0?`${T}px`:"1280px",E.style.height=W>0?`${W}px`:"720px",E.style.margin="0",E.style.padding=B.padding||"0",E.style.overflow="hidden",E.style.position=B.position==="static"?"relative":B.position,c(B.backgroundColor)||(E.style.backgroundColor=B.backgroundColor),B.color&&(E.style.color=B.color),t.documentElement.style.margin="0",t.documentElement.style.padding="0";let H=n.getComputedStyle(t.documentElement).backgroundColor;!c(H)&&c(B.backgroundColor)&&(E.style.backgroundColor=H)}function u(E){E.querySelectorAll("div").forEach(B=>{i.has(B.tagName)||[...B.childNodes].forEach(T=>{if(T.nodeType!==Node.TEXT_NODE)return;let W=T.textContent.replace(/\s+/g," ").trim();if(!W){T.remove();return}let H=t.createElement(l(B));H.textContent=W,B.replaceChild(H,T)})})}function d(E){E.querySelectorAll("span").forEach(B=>{let T=n.getComputedStyle(B),W=T.backgroundColor&&T.backgroundColor!=="rgba(0, 0, 0, 0)",H=f(T);if(!W&&!H)return;let C=t.createElement("p");B.className&&(C.className=B.className),B.getAttribute("style")&&C.setAttribute("style",B.getAttribute("style")),C.textContent=B.textContent,B.replaceWith(C)})}function A(E){E.querySelectorAll("div").forEach(B=>{let T=[...B.children].length>0&&[...B.children].every(C=>C.tagName==="SPAN"||C.tagName==="BR"),W=B.textContent.replace(/\s+/g," ").trim();if(!T||!W||B.querySelector("ul,ol,p,h1,h2,h3,h4,h5,h6"))return;let H=W.split(/\s*[•·▪-]\s+/).map(C=>C.trim()).filter(Boolean);if(H.length>=2){let C=t.createElement("ul");H.forEach(I=>{let m=t.createElement("li");m.textContent=I,C.appendChild(m)}),B.replaceChildren(C)}})}function f(E){return["Top","Right","Bottom","Left"].some(B=>parseFloat(E[`border${B}Width`]||0)>0)}function p(E){E.querySelectorAll(o).forEach(B=>{let T=n.getComputedStyle(B),W=T.backgroundColor&&T.backgroundColor!=="rgba(0, 0, 0, 0)",H=T.backgroundImage&&T.backgroundImage!=="none",C=f(T),I=T.boxShadow&&T.boxShadow!=="none";if(!W&&!H&&!C&&!I)return;let m=t.createElement("div");(W||H)&&(m.style.background=T.background,m.style.backgroundColor=T.backgroundColor),H&&!String(T.backgroundImage||"").includes("gradient")&&(m.style.backgroundImage="none"),C&&(m.style.border=T.border),T.borderRadius&&(m.style.borderRadius=T.borderRadius),I&&(m.style.boxShadow=T.boxShadow),T.padding&&(m.style.padding=T.padding),B.style.background="transparent",B.style.backgroundColor="transparent",B.style.backgroundImage="none",B.style.border="none",B.style.boxShadow="none",B.style.padding="0",B.parentNode.insertBefore(m,B),m.appendChild(B)})}function g(E){E.querySelectorAll("*").forEach(B=>{let T=n.getComputedStyle(B),W=T.backgroundImage||"";if(!W.includes("gradient"))return;let H=W.match(/#[0-9a-f]{3,8}|rgba?\([^)]+\)/i);B.style.backgroundImage="none",H?B.style.backgroundColor=H[0]:T.backgroundColor&&T.backgroundColor!=="rgba(0, 0, 0, 0)"&&(B.style.backgroundColor=T.backgroundColor)})}function y(E){E.querySelectorAll("div").forEach(B=>{let T=n.getComputedStyle(B),W=T.backgroundImage;!W||W==="none"||(B.style.backgroundImage="none",T.backgroundColor&&T.backgroundColor!=="rgba(0, 0, 0, 0)"&&(B.style.backgroundColor=T.backgroundColor))})}function v(E){E.querySelectorAll(a).forEach(B=>{B.style.setProperty("margin","0","important"),B.style.setProperty("padding","0","important"),B.style.setProperty("border","none","important"),B.style.setProperty("box-shadow","none","important"),B.style.setProperty("background","transparent","important"),B.style.setProperty("background-color","transparent","important"),B.style.setProperty("background-image","none","important"),n.getComputedStyle(B).display==="block"&&B.style.setProperty("display","inline","important")})}function b(E){E.querySelectorAll(a).forEach(B=>{B.removeAttribute("class"),B.removeAttribute("style")})}function x(E){E.querySelectorAll('link[rel="stylesheet"], style').forEach(B=>{B.id!=="ppt-live-export-safe-styles"&&B.remove()})}function P(E){E.querySelectorAll(a).forEach(B=>{let T=n.getComputedStyle(B),W=["marginTop","marginRight","marginBottom","marginLeft"].some(q=>parseFloat(T[q])>0),H=["paddingTop","paddingRight","paddingBottom","paddingLeft"].some(q=>parseFloat(T[q])>0),C=f(T),I=T.backgroundColor&&T.backgroundColor!=="rgba(0, 0, 0, 0)",m=T.backgroundImage&&T.backgroundImage!=="none";if(!W&&!H&&!C&&!I&&!m)return;let N=B.tagName.toLowerCase(),ne=t.createElement(N);ne.textContent=B.textContent,B.replaceWith(ne)})}function F(E){let B=E.body||E.querySelector(".ppt-export-body");(B?[B,...B.querySelectorAll("*")]:[...E.querySelectorAll("body, body *")]).forEach(W=>{if(i.has(W.tagName))return;let H=n.getComputedStyle(W),C=W.style;H.position&&H.position!=="static"&&(C.position=H.position),H.display&&H.display!=="inline"&&(C.display=H.display),["left","top","right","bottom","width","height","maxWidth","maxHeight"].forEach(m=>{let N=H[m];N&&N!=="auto"&&N!=="none"&&N!=="0px"&&(C[m]=N)}),H.zIndex&&H.zIndex!=="auto"&&(C.zIndex=H.zIndex),H.color&&(C.color=H.color),H.fontSize&&(C.fontSize=H.fontSize),H.fontWeight&&(C.fontWeight=H.fontWeight),H.fontFamily&&(C.fontFamily=H.fontFamily),H.lineHeight&&H.lineHeight!=="normal"&&(C.lineHeight=H.lineHeight),H.textAlign&&(C.textAlign=H.textAlign);let I=H.backgroundColor;I&&I!=="rgba(0, 0, 0, 0)"&&(C.backgroundColor=I),H.border&&H.border!=="none"&&f(H)&&(C.border=H.border),H.borderRadius&&H.borderRadius!=="0px"&&(C.borderRadius=H.borderRadius),H.padding&&H.padding!=="0px"&&(C.padding=H.padding),H.gap&&H.gap!=="normal"&&(C.gap=H.gap),H.flexDirection&&H.flexDirection!=="row"&&(C.flexDirection=H.flexDirection),H.alignItems&&H.alignItems!=="normal"&&(C.alignItems=H.alignItems),H.justifyContent&&H.justifyContent!=="normal"&&(C.justifyContent=H.justifyContent)})}function R(E){let B="ppt-live-export-safe-styles";E.getElementById(B)?.remove();let T=t.createElement("style");T.id=B,T.textContent=` +
    `}function Lh(e){let r=Array.isArray(e.quality?.issues)?e.quality.issues:[];if(!r.length)return"";let t=r.filter(i=>i.severity==="high").length,n=t?$("qualityNeedsReview"):$("qualityHasWarnings");return`
    ${Le(n)}
    `}function Cc(e){e.querySelectorAll("[data-welcome-prompt]").forEach(r=>{r.addEventListener("click",()=>{let t=Bt("topicInput");t&&(t.value=r.dataset.welcomePrompt||r.textContent||"",t.focus())})})}function Nh(e,r,t){if(!t?.updateSlideHtmlDirect)return;let n=e?.shadowRoot,i=n?.querySelector(`.${As}`);if(!n||!i)return;if(!n.querySelector(`style[${wc}]`)){let c=document.createElement("style");c.setAttribute(wc,"true"),c.textContent=[`[${Zn}] { cursor: text; -webkit-user-select: text !important; user-select: text !important; }`,`[${Zn}]:hover { outline: 1.5px dashed rgba(37, 99, 235, 0.55); outline-offset: 1px; }`,`[${Zn}]:focus { outline: 2px solid rgba(37, 99, 235, 0.85); outline-offset: 1px; }`].join(` +`),n.appendChild(c)}n.addEventListener("click",c=>{c.target?.closest?.("a[href]")&&c.preventDefault()},!0);let a=()=>{let c=Ih(e,i);c&&t.updateSlideHtmlDirect(r,c)},o=i.querySelectorAll("h1,h2,h3,h4,h5,h6,p,li,span,strong,em,b,i,u,small,code,a,label,blockquote,td,th,dt,dd,figcaption,div"),l=0;o.forEach(c=>{Array.from(c.childNodes).some(u=>u.nodeType===Node.TEXT_NODE&&String(u.textContent||"").trim())&&(l+=1,c.setAttribute("contenteditable","true"),c.setAttribute("spellcheck","false"),c.setAttribute(Zn,"true"),c.addEventListener("blur",a),c.addEventListener("keydown",u=>{((u.metaKey||u.ctrlKey)&&u.key==="Enter"||u.key==="Escape")&&(u.preventDefault(),c.blur())}))}),l||console.warn("[ppt-live] no editable nodes bound for slide",{slideId:r,candidates:o.length})}function Ih(e,r){let t=String(e?._pptLiveSourceHtml||"");if(!t)return"";let n=new DOMParser().parseFromString(Nr(t),"text/html");if(!n.body)return"";let i=r.cloneNode(!0);i.querySelectorAll(`[${Zn}]`).forEach(o=>{o.removeAttribute("contenteditable"),o.removeAttribute("spellcheck"),o.removeAttribute(Zn)}),n.body.innerHTML=i.innerHTML;let a=` +${n.documentElement.outerHTML}`;return e._pptLiveSourceHtml=a,a}function Nr(e){let r=String(e||"").trim();return r?/]/i.test(r)?r:`${r}`:''}function zh(e,r,t,n){let i=t&&n===e.id,a=[`left:${e.x}%`,`top:${e.y}%`,`width:${e.w}%`,`height:${e.h}%`,`font-size:${Oh(e.style.fontSize)}`,`font-weight:${e.style.fontWeight}`,`color:${Pc(e.style.color,r)}`,`text-align:${e.style.align||"left"}`,`background:${Pc(e.style.background,r)}`,`opacity:${e.style.opacity}`,`border-radius:${e.style.borderRadius}px`].join(";"),o="";if(e.type==="list")o=`
      ${(e.items||[]).map((l,c)=>t?`
    • ${Le(l)}
    • `:`
    • ${Le(l)}
    • `).join("")}
    `;else if(e.type==="metric")o=`${Le(e.text)}${Le(e.label)}`;else if(e.type==="chart"){let l=Math.max(1,...(e.data||[]).map(c=>Number(c.value)||0));o=`${Le(e.text)}
    ${(e.data||[]).map(c=>`${Le(c.label)}`).join("")}
    `}else e.type==="media"?o=`${Le(e.text||$("mediaPlaceholder"))}`:o=t?`${Le(e.text||"")}`:Le(e.text||"");return`
    ${o}${i?'':""}
    `}function Pc(e,r){return!e||e==="transparent"?"transparent":e==="ink"?r.ink:e==="muted"?r.muted:e==="primary"?r.primary:e==="accent"?r.accent:e==="panel"?r.panel||"#ffffff":e==="soft"?Mh(r.primary,.1):e==="background"?r.background:e}function Mh(e,r){let t=String(e||"#0f766e").replace("#",""),n=parseInt(t.length===3?t.split("").map(l=>l+l).join(""):t,16),i=n>>16&255,a=n>>8&255,o=n&255;return`rgba(${i}, ${a}, ${o}, ${r})`}function Oh(e){let r=Math.max(8,Number(e)||24);return`clamp(8px, ${Math.round(r/10.2*1e3)/1e3}cqw, ${r}px)`}function Bt(e){return document.getElementById(e)}function _h(e,r){let t=Bt(e);t&&document.activeElement!==t&&(t.value=r??"")}function Uh(e){return Bt(e)?.value||""}function ps(e,r){let t=Bt(e);t&&(t.textContent=String(r??""))}function Ba(e){return Math.round(Number(e)*10)/10}function Oc(e=document,r=!1){let t=e,n=t.defaultView||window,i=new Set(["SCRIPT","STYLE","PRE","CODE","SVG","TEXTAREA"]),a="strong,b,em,i,u,span,a,small,mark,sub,sup,code",o="p,h1,h2,h3,h4,h5,h6,li";function l(E){let B=String(E.className||"").toLowerCase(),T=String(E.getAttribute?.("role")||"").toLowerCase();return/h1|title|headline|hero/.test(B)||T==="heading"?"h1":/h2|subtitle|subhead|section-title/.test(B)?"h2":/h3|kicker|eyebrow|label|caption/.test(B)?"h3":"p"}function c(E){return!E||E==="transparent"||E==="rgba(0, 0, 0, 0)"}function s(){let E=t.body;if(!E)return;let B=n.getComputedStyle(E),T=parseFloat(B.width),W=parseFloat(B.height);E.style.width=T>0?`${T}px`:"1280px",E.style.height=W>0?`${W}px`:"720px",E.style.margin="0",E.style.padding=B.padding||"0",E.style.overflow="hidden",E.style.position=B.position==="static"?"relative":B.position,c(B.backgroundColor)||(E.style.backgroundColor=B.backgroundColor),B.color&&(E.style.color=B.color),t.documentElement.style.margin="0",t.documentElement.style.padding="0";let H=n.getComputedStyle(t.documentElement).backgroundColor;!c(H)&&c(B.backgroundColor)&&(E.style.backgroundColor=H)}function u(E){E.querySelectorAll("div").forEach(B=>{i.has(B.tagName)||[...B.childNodes].forEach(T=>{if(T.nodeType!==Node.TEXT_NODE)return;let W=T.textContent.replace(/\s+/g," ").trim();if(!W){T.remove();return}let H=t.createElement(l(B));H.textContent=W,B.replaceChild(H,T)})})}function d(E){E.querySelectorAll("span").forEach(B=>{let T=n.getComputedStyle(B),W=T.backgroundColor&&T.backgroundColor!=="rgba(0, 0, 0, 0)",H=f(T);if(!W&&!H)return;let C=t.createElement("p");B.className&&(C.className=B.className),B.getAttribute("style")&&C.setAttribute("style",B.getAttribute("style")),C.textContent=B.textContent,B.replaceWith(C)})}function A(E){E.querySelectorAll("div").forEach(B=>{let T=[...B.children].length>0&&[...B.children].every(C=>C.tagName==="SPAN"||C.tagName==="BR"),W=B.textContent.replace(/\s+/g," ").trim();if(!T||!W||B.querySelector("ul,ol,p,h1,h2,h3,h4,h5,h6"))return;let H=W.split(/\s*[•·▪-]\s+/).map(C=>C.trim()).filter(Boolean);if(H.length>=2){let C=t.createElement("ul");H.forEach(I=>{let m=t.createElement("li");m.textContent=I,C.appendChild(m)}),B.replaceChildren(C)}})}function f(E){return["Top","Right","Bottom","Left"].some(B=>parseFloat(E[`border${B}Width`]||0)>0)}function p(E){E.querySelectorAll(o).forEach(B=>{let T=n.getComputedStyle(B),W=T.backgroundColor&&T.backgroundColor!=="rgba(0, 0, 0, 0)",H=T.backgroundImage&&T.backgroundImage!=="none",C=f(T),I=T.boxShadow&&T.boxShadow!=="none";if(!W&&!H&&!C&&!I)return;let m=t.createElement("div");(W||H)&&(m.style.background=T.background,m.style.backgroundColor=T.backgroundColor),H&&!String(T.backgroundImage||"").includes("gradient")&&(m.style.backgroundImage="none"),C&&(m.style.border=T.border),T.borderRadius&&(m.style.borderRadius=T.borderRadius),I&&(m.style.boxShadow=T.boxShadow),T.padding&&(m.style.padding=T.padding),B.style.background="transparent",B.style.backgroundColor="transparent",B.style.backgroundImage="none",B.style.border="none",B.style.boxShadow="none",B.style.padding="0",B.parentNode.insertBefore(m,B),m.appendChild(B)})}function g(E){E.querySelectorAll("*").forEach(B=>{let T=n.getComputedStyle(B),W=T.backgroundImage||"";if(!W.includes("gradient"))return;let H=W.match(/#[0-9a-f]{3,8}|rgba?\([^)]+\)/i);B.style.backgroundImage="none",H?B.style.backgroundColor=H[0]:T.backgroundColor&&T.backgroundColor!=="rgba(0, 0, 0, 0)"&&(B.style.backgroundColor=T.backgroundColor)})}function y(E){E.querySelectorAll("div").forEach(B=>{let T=n.getComputedStyle(B),W=T.backgroundImage;!W||W==="none"||(B.style.backgroundImage="none",T.backgroundColor&&T.backgroundColor!=="rgba(0, 0, 0, 0)"&&(B.style.backgroundColor=T.backgroundColor))})}function v(E){E.querySelectorAll(a).forEach(B=>{B.style.setProperty("margin","0","important"),B.style.setProperty("padding","0","important"),B.style.setProperty("border","none","important"),B.style.setProperty("box-shadow","none","important"),B.style.setProperty("background","transparent","important"),B.style.setProperty("background-color","transparent","important"),B.style.setProperty("background-image","none","important"),n.getComputedStyle(B).display==="block"&&B.style.setProperty("display","inline","important")})}function b(E){E.querySelectorAll(a).forEach(B=>{B.removeAttribute("class"),B.removeAttribute("style")})}function x(E){E.querySelectorAll('link[rel="stylesheet"], style').forEach(B=>{B.id!=="ppt-live-export-safe-styles"&&B.remove()})}function P(E){E.querySelectorAll(a).forEach(B=>{let T=n.getComputedStyle(B),W=["marginTop","marginRight","marginBottom","marginLeft"].some(q=>parseFloat(T[q])>0),H=["paddingTop","paddingRight","paddingBottom","paddingLeft"].some(q=>parseFloat(T[q])>0),C=f(T),I=T.backgroundColor&&T.backgroundColor!=="rgba(0, 0, 0, 0)",m=T.backgroundImage&&T.backgroundImage!=="none";if(!W&&!H&&!C&&!I&&!m)return;let N=B.tagName.toLowerCase(),ne=t.createElement(N);ne.textContent=B.textContent,B.replaceWith(ne)})}function F(E){let B=E.body||E.querySelector(".ppt-export-body");(B?[B,...B.querySelectorAll("*")]:[...E.querySelectorAll("body, body *")]).forEach(W=>{if(i.has(W.tagName))return;let H=n.getComputedStyle(W),C=W.style;H.position&&H.position!=="static"&&(C.position=H.position),H.display&&H.display!=="inline"&&(C.display=H.display),["left","top","right","bottom","width","height","maxWidth","maxHeight"].forEach(m=>{let N=H[m];N&&N!=="auto"&&N!=="none"&&N!=="0px"&&(C[m]=N)}),H.zIndex&&H.zIndex!=="auto"&&(C.zIndex=H.zIndex),H.color&&(C.color=H.color),H.fontSize&&(C.fontSize=H.fontSize),H.fontWeight&&(C.fontWeight=H.fontWeight),H.fontFamily&&(C.fontFamily=H.fontFamily),H.lineHeight&&H.lineHeight!=="normal"&&(C.lineHeight=H.lineHeight),H.textAlign&&(C.textAlign=H.textAlign);let I=H.backgroundColor;I&&I!=="rgba(0, 0, 0, 0)"&&(C.backgroundColor=I),H.border&&H.border!=="none"&&f(H)&&(C.border=H.border),H.borderRadius&&H.borderRadius!=="0px"&&(C.borderRadius=H.borderRadius),H.padding&&H.padding!=="0px"&&(C.padding=H.padding),H.gap&&H.gap!=="normal"&&(C.gap=H.gap),H.flexDirection&&H.flexDirection!=="row"&&(C.flexDirection=H.flexDirection),H.alignItems&&H.alignItems!=="normal"&&(C.alignItems=H.alignItems),H.justifyContent&&H.justifyContent!=="normal"&&(C.justifyContent=H.justifyContent)})}function R(E){let B="ppt-live-export-safe-styles";E.getElementById(B)?.remove();let T=t.createElement("style");T.id=B,T.textContent=` ${a}, [class] ${a.split(",").join(", [class] ")} { margin: 0 !important; padding: 0 !important; @@ -91,8 +123,16 @@ ${n.documentElement.outerHTML}`;return e._pptLiveSourceHtml=a,a}function Wr(e){l box-shadow: none !important; } `,(E.head||E.documentElement).appendChild(T)}s(),u(t),d(t),A(t),g(t),y(t),r?(p(t),v(t),P(t),R(t),P(t),F(t),t.querySelectorAll("[class]").forEach(E=>E.removeAttribute("class")),x(t),b(t),v(t),P(t),R(t)):F(t)}function _c(e=document){let r=e.defaultView||window,t=e.body,n=r.getComputedStyle(t),i={width:parseFloat(n.width),height:parseFloat(n.height),scrollWidth:t.scrollWidth,scrollHeight:t.scrollHeight},a=[],o=Math.max(0,i.scrollWidth-i.width-1),l=Math.max(0,i.scrollHeight-i.height-1),c=o*.75,s=l*.75;if(c>0||s>0){let u=[];c>0&&u.push(`${c.toFixed(1)}pt horizontally`),s>0&&u.push(`${s.toFixed(1)}pt vertically`);let d=s>0?' (Remember: leave 0.5" margin at bottom of slide)':"";a.push(`HTML content overflows body by ${u.join(" and ")}${d}`)}return{...i,errors:a}}function Uc(e=document){let r=e,t=r.defaultView||window,n=.75,i=96,a=["impact"],o=h=>{if(!h)return!1;let U=h.toLowerCase().replace(/['"]/g,"").split(",")[0].trim();return a.includes(U)},l=h=>h/i,c=h=>parseFloat(h)*n,s=h=>{if(h==="rgba(0, 0, 0, 0)"||h==="transparent")return"FFFFFF";let U=h.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);return U?U.slice(1).map(z=>parseInt(z).toString(16).padStart(2,"0")).join(""):"FFFFFF"},u=h=>{let U=h.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);if(!U||!U[4])return null;let z=parseFloat(U[4]);return Math.round((1-z)*100)},d=h=>{let U=String(h||"").match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);return U?{r:parseInt(U[1],10),g:parseInt(U[2],10),b:parseInt(U[3],10),a:U[4]!=null?parseFloat(U[4]):1}:null},A=h=>{let U=String(h||"0E0E12").replace("#","");return{r:parseInt(U.slice(0,2),16),g:parseInt(U.slice(2,4),16),b:parseInt(U.slice(4,6),16)}},f=(h,U="0E0E12")=>{let z=d(h);if(!z)return{fill:s(h),transparency:u(h)};if(z.a>=.98)return{fill:s(h),transparency:null};let k=A(U),w=Math.round(k.r*(1-z.a)+z.r*z.a),D=Math.round(k.g*(1-z.a)+z.g*z.a),K=Math.round(k.b*(1-z.a)+z.b*z.a);return{fill:[w,D,K].map(Y=>Y.toString(16).padStart(2,"0")).join("").toUpperCase(),transparency:null}},p=(h,U)=>U==="uppercase"?h.toUpperCase():U==="lowercase"?h.toLowerCase():U==="capitalize"?h.replace(/\b\w/g,z=>z.toUpperCase()):h,g=h=>h==="vertical-rl"||h==="vertical-lr"?"eaVert":null,y=h=>{let U=0;if(h&&h!=="none"){let z=h.match(/rotate\((-?\d+(?:\.\d+)?)deg\)/);if(z)U+=parseFloat(z[1]);else{let k=h.match(/matrix\(([^)]+)\)/);if(k){let w=k[1].split(",").map(parseFloat),D=Math.atan2(w[1],w[0])*(180/Math.PI);U+=Math.round(D)}}}return U=U%360,U<0&&(U+=360),U===0?null:U},v=(h,U,z)=>{if(z===null)return{x:U.left,y:U.top,w:U.width,h:U.height};if(z===90||z===270){let K=U.left+U.width/2,Y=U.top+U.height/2;return{x:K-U.height/2,y:Y-U.width/2,w:U.height,h:U.width}}let w=U.left+U.width/2,D=U.top+U.height/2;return{x:w-h.offsetWidth/2,y:D-h.offsetHeight/2,w:h.offsetWidth,h:h.offsetHeight}},b=h=>{if(!h||h==="none"||h.match(/inset/))return null;let z=h.match(/rgba?\([^)]+\)/),k=h.match(/([-\d.]+)(px|pt)/g);if(!k||k.length<2)return null;let w=parseFloat(k[0]),D=parseFloat(k[1]),K=k.length>2?parseFloat(k[2]):0,Y=0;(w!==0||D!==0)&&(Y=Math.atan2(D,w)*(180/Math.PI),Y<0&&(Y+=360));let M=Math.sqrt(w*w+D*D)*n,J=.5;if(z){let ae=z[0].match(/[\d.]+\)$/);ae&&(J=parseFloat(ae[0].replace(")","")))}return{type:"outer",angle:Math.round(Y),blur:K*.75,color:z?s(z[0]):"000000",offset:M,opacity:J}},x=(h,U={},z=[],k=w=>w)=>{let w=!1;return h.childNodes.forEach(D=>{let K=k,Y=D.nodeType===Node.TEXT_NODE||D.tagName==="BR";if(Y){let M=D.tagName==="BR"?` -`:K(D.textContent.replace(/\s+/g," ")),J=z[z.length-1];w&&J?J.text+=M:z.push({text:M,options:{...U}})}else if(D.nodeType===Node.ELEMENT_NODE&&D.textContent.trim()){let M={...U},J=t.getComputedStyle(D);if(["SPAN","B","STRONG","I","EM","U","SMALL","LABEL","A","CODE","MARK","SUB","SUP"].includes(D.tagName)){if((J.fontWeight==="bold"||parseInt(J.fontWeight)>=600)&&!o(J.fontFamily)&&(M.bold=!0),J.fontStyle==="italic"&&(M.italic=!0),J.textDecoration&&J.textDecoration.includes("underline")&&(M.underline=!0),J.color&&J.color!=="rgb(0, 0, 0)"){M.color=s(J.color);let ee=u(J.color);ee!==null&&(M.transparency=ee)}if(J.fontSize&&(M.fontSize=c(J.fontSize)),J.textTransform&&J.textTransform!=="none"){let ee=J.textTransform;K=pe=>p(pe,ee)}J.marginLeft&&parseFloat(J.marginLeft)>0&&ne.push(`Inline element <${D.tagName.toLowerCase()}> has margin-left which is not supported in PowerPoint. Remove margin from inline elements.`),J.marginRight&&parseFloat(J.marginRight)>0&&ne.push(`Inline element <${D.tagName.toLowerCase()}> has margin-right which is not supported in PowerPoint. Remove margin from inline elements.`),J.marginTop&&parseFloat(J.marginTop)>0&&ne.push(`Inline element <${D.tagName.toLowerCase()}> has margin-top which is not supported in PowerPoint. Remove margin from inline elements.`),J.marginBottom&&parseFloat(J.marginBottom)>0&&ne.push(`Inline element <${D.tagName.toLowerCase()}> has margin-bottom which is not supported in PowerPoint. Remove margin from inline elements.`),x(D,M,z,K)}}w=Y}),z.length>0&&(z[0].text=z[0].text.replace(/^\s+/,""),z[z.length-1].text=z[z.length-1].text.replace(/\s+$/,"")),z.filter(D=>D.text.length>0)},P=h=>!h||h==="transparent"||h==="rgba(0, 0, 0, 0)",F=h=>{let U=[h,r.documentElement,h?.querySelector?.(":scope > section, :scope > div, :scope > main")].filter(Boolean);for(let z of U){let k=t.getComputedStyle(z),w=k.backgroundImage||"";if(w.includes("linear-gradient")||w.includes("radial-gradient"))return{gradient:!0};if(w&&w!=="none"){let K=w.match(/url\(["']?([^"')]+)["']?\)/);if(K)return{type:"image",path:K[1]}}let D=k.backgroundColor;if(!P(D))return{type:"color",value:s(D)}}return{type:"color",value:"FFFFFF"}},R=r.body,E=R.getBoundingClientRect(),B=h=>({left:h.left-E.left,top:h.top-E.top,width:h.width,height:h.height}),T=h=>B(h.getBoundingClientRect()),W=h=>{try{let U=r.createRange();U.selectNodeContents(h);let z=B(U.getBoundingClientRect());if(U.detach?.(),z.width>0&&z.height>0)return z}catch{}return T(h)},H=(h,U)=>{let z=d(h.color);return!z||z.a>=.2||!U.textContent.trim()?s(h.color):"E8E8E8"},C=(h,U,z)=>{let{x:k,y:w,w:D,h:K}=v(h,U,z),Y=E.width,M=E.height,J=Math.max(8,Y-k-4),ae=h.scrollHeight||0,ee=/^H[1-6]$/.test(h.tagName),pe=ee?Math.min(Math.max(8,D*.05),32):Math.min(Math.max(2,D*.02),12);ee?D=Math.max(D+pe,Y*.92-k):D=Math.min(D+pe,J),D=Math.min(D,J);let Ee=Math.max(6,K*(ee?.18:.12)),ve=Math.max(8,M-w-4);return ae>K+2?K=Math.min(ae+Ee,ve):K=Math.min(K+Ee,ve),{x:k,y:w,w:D,h:K}},I=h=>{let U=t.getComputedStyle(h).zIndex;if(!U||U==="auto")return 0;let z=parseInt(U,10);return Number.isFinite(z)?z:0},m=(h,U)=>{U&&(h.zIndex=I(U)),ue.push(h)},N=(h,U,z)=>{let w=t.getComputedStyle(h).listStyleColor;if(w&&w!=="rgba(0, 0, 0, 0)"){let D=s(w);if(D&&D!==z)return D}for(let D of U)try{let K=t.getComputedStyle(D,"::marker");if(K?.color){let Y=s(K.color);if(Y&&Y!==z)return Y}}catch{}return null},ne=[],q=F(R);q.gradient&&ne.push("CSS gradients are not supported. Use Sharp to rasterize gradients as PNG images first, then reference with background-image: url('gradient.png')");let se=q.gradient?{type:"color",value:"FFFFFF"}:{type:q.type,...q.path?{path:q.path}:{value:q.value}},Z=se.value||"0E0E12",ue=[],j=[],_=["P","H1","H2","H3","H4","H5","H6","UL","OL","LI"],fe=new Set(["SPAN","SMALL","LABEL","A","CODE","BUTTON","B","STRONG","I","EM","U","MARK","SUB","SUP"]),ce=new Set(["TD","TH"]),ie=new Set(["DIV","SECTION","ARTICLE","ASIDE",...ce]),be=new Set,Re=h=>{let U=h.parentElement;for(;U&&U!==R;){if(_.includes(U.tagName)||U.dataset?.pptxMerge==="true")return!0;U=U.parentElement}return!1},ke=h=>Array.from(h.childNodes).some(U=>U.nodeType===Node.TEXT_NODE&&U.textContent.replace(/\s+/g," ").trim()),xe=h=>!h.textContent.replace(/\s+/g," ").trim()||Re(h)?!1:fe.has(h.tagName)?!0:!ie.has(h.tagName)||!ke(h)&&!ce.has(h.tagName)||h.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,li")?!1:!Array.from(h.children).some(U=>ie.has(U.tagName)),Oe=h=>{if(h.textAlign&&!["start","auto"].includes(h.textAlign))return h.textAlign==="end"?"right":h.textAlign;if(h.display.includes("flex")){if(h.justifyContent==="center")return"center";if(h.justifyContent==="flex-end"||h.justifyContent==="end")return"right"}if(h.display.includes("grid")){if((h.justifyItems||h.placeItems||"").includes("center"))return"center";if((h.justifyItems||h.placeItems||"").includes("end"))return"right"}return"left"},we=(h,U)=>{if(h.display==="table-cell"){if(h.verticalAlign==="middle")return"mid";if(h.verticalAlign==="bottom")return"bottom"}if(!h.display.includes("flex")&&!h.display.includes("grid"))return parseFloat(h.lineHeight||"0")>=U.height*.75?"mid":"top";let z=h.alignItems||h.placeItems||"";return z.includes("center")?"mid":z.includes("end")?"bottom":"top"},tt=(h,U=h.tagName.toLowerCase(),z=!1,k=null)=>{let w=k||T(h),D=h.textContent.replace(/\s+/g," ").trim();if(w.width===0||w.height===0||!D)return!1;if(U!=="text"&&h.tagName!=="LI"&&/^[•\-\*▪▸○●◆◇■□]\s/.test(D.trimStart()))return ne.push(`Text element <${h.tagName.toLowerCase()}> starts with bullet symbol "${D.substring(0,20)}...". Use
      or
        lists instead of manual bullet symbols.`),!1;let K=t.getComputedStyle(h);if(K.display==="none"||K.visibility==="hidden"||parseFloat(K.opacity||"1")<=0)return!1;let Y=y(K.transform),M=g(K.writingMode),J=z?v(h,w,Y):C(h,w,Y),ae=K.fontWeight==="bold"||parseInt(K.fontWeight,10)>=600,ee=K.lineHeight&&K.lineHeight!=="normal"?c(K.lineHeight):null,pe={fontSize:c(K.fontSize),fontFace:K.fontFamily.split(",")[0].replace(/['"]/g,"").trim(),color:H(K,h),align:Oe(K),valign:z?we(K,w):"top",lineSpacing:ee,paraSpaceBefore:c(K.marginTop),paraSpaceAfter:c(K.marginBottom),margin:[c(K.paddingLeft),c(K.paddingRight),c(K.paddingBottom),c(K.paddingTop)]},Ee=u(K.color);if(Ee!==null&&(pe.transparency=Ee),Y!==null&&(pe.rotate=Y),M!==null&&(pe.vert=M),h.querySelector("b, i, u, strong, em, span, small, label, a, code, mark, sub, sup, br")){let Ie=K.textTransform,rt={};ae&&!o(K.fontFamily)&&(rt.bold=!0);let Me=x(h,rt,[],me=>p(me,Ie));!Me.map(me=>me.text).join("").trim()&&D&&(Me=[{text:p(D,Ie),options:{...rt}}]);let oe={...pe};if(oe.lineSpacing){let me=Math.max(oe.fontSize,...Me.map(De=>De.options?.fontSize||0));me>oe.fontSize&&(oe.lineSpacing=me*(oe.lineSpacing/oe.fontSize))}m({type:U,text:Me,position:{x:l(J.x),y:l(J.y),w:l(J.w),h:l(J.h)},style:oe},h)}else m({type:U,text:p(D,K.textTransform),position:{x:l(J.x),y:l(J.y),w:l(J.w),h:l(J.h)},style:{...pe,bold:ae&&!o(K.fontFamily),italic:K.fontStyle==="italic",underline:K.textDecoration.includes("underline")}},h);return be.add(h),U==="text"&&h.querySelectorAll("span,small,label,a,code,b,strong,i,em,u,mark,sub,sup").forEach(Ie=>be.add(Ie)),!0};r.querySelectorAll("*").forEach(h=>{if(be.has(h))return;if(h.tagName==="DIV"&&h.dataset&&h.dataset.pptxMerge==="true"){let k=T(h);if(k.width===0||k.height===0){be.add(h);return}if(h.querySelector('[data-pptx-merge="true"]')){ne.push("data-pptx-merge container cannot contain another data-pptx-merge container. Nested merge is not supported."),be.add(h);return}let w=t.getComputedStyle(h);if(w.backgroundImage&&w.backgroundImage!=="none"){ne.push("Background images on data-pptx-merge container are not supported. Use solid colors or borders, or layer images via slide.addImage().");return}let D=w.backgroundColor&&w.backgroundColor!=="rgba(0, 0, 0, 0)",K=[w.borderTopWidth,w.borderRightWidth,w.borderBottomWidth,w.borderLeftWidth].map(ve=>parseFloat(ve)||0),M=K.some(ve=>ve>0)&&K.every(ve=>ve===K[0]);(D||M)&&ue.push({type:"shape",text:"",position:{x:l(k.left),y:l(k.top),w:l(k.width),h:l(k.height)},shape:{fill:D?s(w.backgroundColor):null,transparency:D?u(w.backgroundColor):null,line:M?{color:s(w.borderColor),width:c(w.borderWidth)}:null,rectRadius:(()=>{let ve=w.borderRadius,Ie=parseFloat(ve);if(Ie===0)return 0;if(ve.includes("%")){if(Ie>=50)return 1;let rt=Math.min(k.width,k.height);return Ie/100*l(rt)}return ve.includes("pt")?Ie/72:Ie/i})(),shadow:b(w.boxShadow)}});let J=Array.from(h.querySelectorAll("p, h1, h2, h3, h4, h5, h6"));if(J.length===0){ne.push("data-pptx-merge container has no

        / children to merge. Remove the data-pptx-merge attribute or add text elements."),be.add(h);return}let ae=t.getComputedStyle(J[0]),ee={fontSize:c(ae.fontSize),fontFace:ae.fontFamily.split(",")[0].replace(/['"]/g,"").trim(),color:s(ae.color),align:ae.textAlign==="start"?"left":ae.textAlign,lineSpacing:ae.lineHeight&&ae.lineHeight!=="normal"?c(ae.lineHeight):null,paraSpaceBefore:0,paraSpaceAfter:0,margin:[c(w.paddingLeft),c(w.paddingRight),c(w.paddingBottom),c(w.paddingTop)]},pe=u(ae.color);pe!==null&&(ee.transparency=pe);let Ee=[];if(J.forEach((ve,Ie)=>{let rt=Ie===J.length-1,Me=t.getComputedStyle(ve),G=Me.textTransform,oe=c(Me.fontSize),me=Me.fontFamily.split(",")[0].replace(/['"]/g,"").trim(),De=s(Me.color),te=Me.fontWeight==="bold"||parseInt(Me.fontWeight)>=600,ge=Me.fontStyle==="italic",L=Me.textDecoration.includes("underline"),ye={};oe!==ee.fontSize&&(ye.fontSize=oe),me!==ee.fontFace&&(ye.fontFace=me),De!==ee.color&&(ye.color=De),te&&!o(Me.fontFamily)&&(ye.bold=!0),ge&&(ye.italic=!0),L&&(ye.underline=!0);let Ge=ve.querySelector("b, i, u, strong, em, span, small, label, a, code, mark, sub, sup, br"),S;if(Ge)S=x(ve,ye,[],de=>p(de,G));else{let de=p(ve.textContent.trim(),G);if(!de)return;S=[{text:de,options:{...ye}}]}S.length>0&&!rt&&(S[S.length-1].options.breakLine=!0),Ee.push(...S),be.add(ve)}),Ee.length===0){be.add(h);return}ue.push({type:"merged-text",items:Ee,position:{x:l(k.left),y:l(k.top),w:l(k.width),h:l(k.height)},style:ee}),be.add(h);return}let U=xe(h)?tt(h,"text",!0,fe.has(h.tagName)?W(h):null):!1;if(_.includes(h.tagName)||fe.has(h.tagName)){let k=t.getComputedStyle(h),w=k.backgroundColor&&k.backgroundColor!=="rgba(0, 0, 0, 0)",D=k.borderWidth&&parseFloat(k.borderWidth)>0||k.borderTopWidth&&parseFloat(k.borderTopWidth)>0||k.borderRightWidth&&parseFloat(k.borderRightWidth)>0||k.borderBottomWidth&&parseFloat(k.borderBottomWidth)>0||k.borderLeftWidth&&parseFloat(k.borderLeftWidth)>0,K=k.boxShadow&&k.boxShadow!=="none";if(w||D||K){let Y=T(h);if(Y.width>0&&Y.height>0){let M=[k.borderTopWidth,k.borderRightWidth,k.borderBottomWidth,k.borderLeftWidth].map(ee=>parseFloat(ee)||0),J=M.some(ee=>ee>0)&&M.every(ee=>ee===M[0]),ae=w?f(k.backgroundColor,Z):{fill:null,transparency:null};if(ae.fill||J){let ee=k.borderRadius,pe=parseFloat(ee);m({type:"shape",text:"",position:{x:l(Y.left),y:l(Y.top),w:l(Y.width),h:l(Y.height)},shape:{fill:ae.fill,transparency:ae.transparency,line:J?{color:s(k.borderColor),width:c(k.borderWidth)}:null,rectRadius:(()=>{if(!pe)return 0;if(ee.includes("%")){if(pe>=50)return 1;let Ee=Math.min(Y.width,Y.height);return pe/100*l(Ee)}return ee.includes("pt")?pe/72:pe/i})(),shadow:b(k.boxShadow)}},h)}}}}if(h.className&&h.className.includes("placeholder")){let k=T(h);k.width===0||k.height===0?ne.push(`Placeholder "${h.id||"unnamed"}" has ${k.width===0?"width: 0":"height: 0"}. Check the layout CSS.`):j.push({id:h.id||`placeholder-${j.length}`,x:l(k.left),y:l(k.top),w:l(k.width),h:l(k.height)}),be.add(h);return}if(h.tagName==="IMG"){let k=T(h);if(k.width>0&&k.height>0){ue.push({type:"image",src:h.src,position:{x:l(k.left),y:l(k.top),w:l(k.width),h:l(k.height)}}),be.add(h);return}}if(ie.has(h.tagName)){let k=t.getComputedStyle(h),w=k.backgroundColor&&k.backgroundColor!=="rgba(0, 0, 0, 0)",D=k.backgroundImage;if(D&&D!=="none"){ne.push("Background images on DIV elements are not supported. Use solid colors or borders for shapes, or use slide.addImage() in PptxGenJS to layer images.");return}let K=k.borderTopWidth,Y=k.borderRightWidth,M=k.borderBottomWidth,J=k.borderLeftWidth,ae=[K,Y,M,J].map(ve=>parseFloat(ve)||0),ee=ae.some(ve=>ve>0),pe=ee&&ae.every(ve=>ve===ae[0]),Ee=[];if(ee&&!pe){let ve=T(h),Ie=l(ve.left),rt=l(ve.top),Me=l(ve.width),G=l(ve.height);if(parseFloat(K)>0){let oe=c(K),me=oe/72/2;Ee.push({type:"line",x1:Ie,y1:rt+me,x2:Ie+Me,y2:rt+me,width:oe,color:s(k.borderTopColor)})}if(parseFloat(Y)>0){let oe=c(Y),me=oe/72/2;Ee.push({type:"line",x1:Ie+Me-me,y1:rt,x2:Ie+Me-me,y2:rt+G,width:oe,color:s(k.borderRightColor)})}if(parseFloat(M)>0){let oe=c(M),me=oe/72/2;Ee.push({type:"line",x1:Ie,y1:rt+G-me,x2:Ie+Me,y2:rt+G-me,width:oe,color:s(k.borderBottomColor)})}if(parseFloat(J)>0){let oe=c(J),me=oe/72/2;Ee.push({type:"line",x1:Ie+me,y1:rt,x2:Ie+me,y2:rt+G,width:oe,color:s(k.borderLeftColor)})}}if(w||ee){let ve=T(h);if(ve.width>=E.width*.97&&ve.height>=E.height*.97&&w){be.add(h);return}if(ve.width>0&&ve.height>0){let rt=b(k.boxShadow);if(w||pe){let Me=w?f(k.backgroundColor,Z):{fill:null,transparency:null},G=Me.fill,oe=Me.transparency;!G&&pe&&(G=s(k.borderColor)||"2A2A30",oe=oe??88),m({type:"shape",text:"",position:{x:l(ve.left),y:l(ve.top),w:l(ve.width),h:l(ve.height)},shape:{fill:G,transparency:oe,line:pe?{color:s(k.borderColor),width:c(k.borderWidth)}:null,rectRadius:(()=>{let me=k.borderRadius,De=parseFloat(me);if(De===0)return 0;if(me.includes("%")){if(De>=50)return 1;let te=Math.min(ve.width,ve.height);return De/100*l(te)}return me.includes("pt")?De/72:De/i})(),shadow:rt}},h)}Ee.forEach(Me=>m(Me,h)),be.add(h);return}}}if(!U){if(h.tagName==="UL"||h.tagName==="OL"){let k=T(h);if(k.width===0||k.height===0)return;let w=Array.from(h.querySelectorAll("li")),D=[],K=t.getComputedStyle(h),Y=c(K.paddingLeft),M=Y*.5,J=Y*.5,ae=t.getComputedStyle(w[0]||h),ee=s(ae.color),pe=N(h,w,ee);w.forEach((ve,Ie)=>{let rt=Ie===w.length-1,Me=x(ve,{breakLine:!1});Me.length>0&&(Me[0].text=Me[0].text.replace(/^[•\-\*▪▸]\s*/,""),Me[0].options.bullet={indent:J}),Me.length>0&&pe&&pe!==ee&&Me.unshift({text:"\u200B",options:{bullet:{indent:J},color:pe,fontSize:Me[0]?.options?.fontSize||c(ae.fontSize),breakLine:!1}}),Me.length>0&&!rt&&(Me[Me.length-1].options.breakLine=!0),D.push(...Me)});let Ee=C(h,k,null);m({type:"list",items:D,position:{x:l(Ee.x),y:l(Ee.y),w:l(Ee.w),h:l(Ee.h)},style:{fontSize:c(ae.fontSize),fontFace:ae.fontFamily.split(",")[0].replace(/['"]/g,"").trim(),color:ee,bulletColor:pe,transparency:u(ae.color),align:ae.textAlign==="start"?"left":ae.textAlign,lineSpacing:ae.lineHeight&&ae.lineHeight!=="normal"?c(ae.lineHeight):null,paraSpaceBefore:0,paraSpaceAfter:c(ae.marginBottom),margin:[M,0,0,0]}},h),w.forEach(ve=>be.add(ve)),be.add(h);return}_.includes(h.tagName)&&tt(h)}});let Be=h=>h==="shape"?0:h==="line"?1:h==="image"?2:3;return ue.sort((h,U)=>{let z=(h.zIndex??0)-(U.zIndex??0);return z!==0?z:Be(h.type)-Be(U.type)}),{background:se,elements:ue,placeholders:j,errors:ne}}var ar={width:1280,height:720};function Mh(e){return(e?.elements||[]).filter(r=>Oh.has(r.type)).length}var Oh=new Set(["p","h1","h2","h3","h4","h5","h6","text","list","merged-text"]);var Gr=null;function _h(){return Gr?.isConnected||(Gr=document.createElement("div"),Gr.id="ppt-export-session-host",Gr.setAttribute("aria-hidden","true"),Gr.style.cssText=["position:fixed","left:-24000px","top:0","width:1px","height:1px","overflow:hidden","opacity:0","pointer-events:none","z-index:-1","contain:strict"].join(";"),document.body.appendChild(Gr)),Gr}function Uh(){Gr?.isConnected&&Gr.replaceChildren("")}function Wh(e){return As(e,".ppt-export-root",".ppt-export-body")}function Gh(e,r){return{body:r,documentElement:e,defaultView:window,querySelectorAll:t=>e.querySelectorAll(t),createElement:t=>document.createElement(t),getElementById:t=>e.querySelector(`#${t}`),head:e.querySelector("style")?.parentElement||e,_exportRoot:e}}function jh(){let e=document.createElement("div");e.className="ppt-export-root-host",e.setAttribute("aria-hidden","true"),e.style.cssText=[`width:${ar.width}px`,`height:${ar.height}px`,"overflow:hidden"].join(";"),_h().appendChild(e);let r=e.attachShadow({mode:"open"}),t=document.createElement("div");return t.className="ppt-export-root",t.style.cssText=[`width:${ar.width}px`,`height:${ar.height}px`,"overflow:hidden"].join(";"),r.appendChild(t),t._exportHost=e,t}function qh(e){let r=e?._exportHost||e;r?.isConnected&&r.remove()}async function Gc(){await new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(e))})}function Vh(e,r){let t=new DOMParser().parseFromString(r,"text/html");e.replaceChildren(),t.querySelectorAll("style").forEach(i=>{let a=document.createElement("style");a.textContent=Wh(i.textContent||""),e.appendChild(a)});let n=document.createElement("div");if(n.className="ppt-export-body",t.body){for(let i of t.body.attributes)i.name==="class"?n.classList.add(...i.value.split(/\s+/).filter(Boolean)):i.name==="style"?n.style.cssText+=`;${i.value}`:n.setAttribute(i.name,i.value);n.innerHTML=t.body.innerHTML}return n.style.boxSizing="border-box",/\bwidth\s*:/i.test(n.style.cssText)||(n.style.width=`${ar.width}px`),/\bheight\s*:/i.test(n.style.cssText)||(n.style.height=`${ar.height}px`),e.appendChild(n),n}async function Xh(e){let r=Wr(e),t=jh(),n=Vh(t,r);return await Gc(),Gh(t,n)}async function Wc(e,r,t={}){let n=null;try{let i=await Xh(e);n=i._exportRoot,Oc(i,r),await Gc();let a=_c(i),o=Uc(i),l=a.errors||[];l.length&&console.warn("[ppt-live-export] slide overflows canvas; exporting anyway:",l.join("; "));let c={...a,errors:[]},s=o.errors||[];return!s.length||t.allowValidationErrors?{slideData:o,bodyDimensions:c,aggressive:r,warnings:l}:{error:new Error(s.join(` -`))}}finally{n&&qh(n)}}async function Hh(e,r={}){let t=await Wc(e,!1,r);if(t?.slideData)return t;let n=await Wc(e,!0,r);if(n?.slideData)return n;throw n?.error||t?.error||new Error("PPT Live slide preparation failed")}async function jc(e,r={}){let t=[];try{for(let[n,i]of e.entries()){if(!i?.html)continue;let a=await Hh(i.html,r),o=null,c=Mh(a.slideData)===0;if(c&&typeof r.renderRaster=="function")try{typeof r.onRasterProgress=="function"&&r.onRasterProgress(n,i);let s=bs(i);o=await r.renderRaster(s,n)}catch{o=null}t.push({index:n,slideId:i.id,notes:i,...a,rasterBase64:o,rasterOnly:!!(o&&c)})}return t}finally{Uh()}}function Kh(e={}){let r=e.theme||{},t=String(e.title||"Slide").replace(/[<>&]/g,l=>({"<":"<",">":">","&":"&"})[l]||l),n=String(e.subtitle||e.claim||"").replace(/[<>&]/g,l=>({"<":"<",">":">","&":"&"})[l]||l),i=r.background||"#ffffff",a=r.ink||"#111111",o=r.muted||"#666666";return` +`:K(D.textContent.replace(/\s+/g," ")),J=z[z.length-1];w&&J?J.text+=M:z.push({text:M,options:{...U}})}else if(D.nodeType===Node.ELEMENT_NODE&&D.textContent.trim()){let M={...U},J=t.getComputedStyle(D);if(["SPAN","B","STRONG","I","EM","U","SMALL","LABEL","A","CODE","MARK","SUB","SUP"].includes(D.tagName)){if((J.fontWeight==="bold"||parseInt(J.fontWeight)>=600)&&!o(J.fontFamily)&&(M.bold=!0),J.fontStyle==="italic"&&(M.italic=!0),J.textDecoration&&J.textDecoration.includes("underline")&&(M.underline=!0),J.color&&J.color!=="rgb(0, 0, 0)"){M.color=s(J.color);let ee=u(J.color);ee!==null&&(M.transparency=ee)}if(J.fontSize&&(M.fontSize=c(J.fontSize)),J.textTransform&&J.textTransform!=="none"){let ee=J.textTransform;K=pe=>p(pe,ee)}J.marginLeft&&parseFloat(J.marginLeft)>0&&ne.push(`Inline element <${D.tagName.toLowerCase()}> has margin-left which is not supported in PowerPoint. Remove margin from inline elements.`),J.marginRight&&parseFloat(J.marginRight)>0&&ne.push(`Inline element <${D.tagName.toLowerCase()}> has margin-right which is not supported in PowerPoint. Remove margin from inline elements.`),J.marginTop&&parseFloat(J.marginTop)>0&&ne.push(`Inline element <${D.tagName.toLowerCase()}> has margin-top which is not supported in PowerPoint. Remove margin from inline elements.`),J.marginBottom&&parseFloat(J.marginBottom)>0&&ne.push(`Inline element <${D.tagName.toLowerCase()}> has margin-bottom which is not supported in PowerPoint. Remove margin from inline elements.`),x(D,M,z,K)}}w=Y}),z.length>0&&(z[0].text=z[0].text.replace(/^\s+/,""),z[z.length-1].text=z[z.length-1].text.replace(/\s+$/,"")),z.filter(D=>D.text.length>0)},P=h=>!h||h==="transparent"||h==="rgba(0, 0, 0, 0)",F=h=>{let U=[h,r.documentElement,h?.querySelector?.(":scope > section, :scope > div, :scope > main")].filter(Boolean);for(let z of U){let k=t.getComputedStyle(z),w=k.backgroundImage||"";if(w.includes("linear-gradient")||w.includes("radial-gradient"))return{gradient:!0};if(w&&w!=="none"){let K=w.match(/url\(["']?([^"')]+)["']?\)/);if(K)return{type:"image",path:K[1]}}let D=k.backgroundColor;if(!P(D))return{type:"color",value:s(D)}}return{type:"color",value:"FFFFFF"}},R=r.body,E=R.getBoundingClientRect(),B=h=>({left:h.left-E.left,top:h.top-E.top,width:h.width,height:h.height}),T=h=>B(h.getBoundingClientRect()),W=h=>{try{let U=r.createRange();U.selectNodeContents(h);let z=B(U.getBoundingClientRect());if(U.detach?.(),z.width>0&&z.height>0)return z}catch{}return T(h)},H=(h,U)=>{let z=d(h.color);return!z||z.a>=.2||!U.textContent.trim()?s(h.color):"E8E8E8"},C=(h,U,z)=>{let{x:k,y:w,w:D,h:K}=v(h,U,z),Y=E.width,M=E.height,J=Math.max(8,Y-k-4),ae=h.scrollHeight||0,ee=/^H[1-6]$/.test(h.tagName),pe=ee?Math.min(Math.max(8,D*.05),32):Math.min(Math.max(2,D*.02),12);ee?D=Math.max(D+pe,Y*.92-k):D=Math.min(D+pe,J),D=Math.min(D,J);let Ee=Math.max(6,K*(ee?.18:.12)),ve=Math.max(8,M-w-4);return ae>K+2?K=Math.min(ae+Ee,ve):K=Math.min(K+Ee,ve),{x:k,y:w,w:D,h:K}},I=h=>{let U=t.getComputedStyle(h).zIndex;if(!U||U==="auto")return 0;let z=parseInt(U,10);return Number.isFinite(z)?z:0},m=(h,U)=>{U&&(h.zIndex=I(U)),ue.push(h)},N=(h,U,z)=>{let w=t.getComputedStyle(h).listStyleColor;if(w&&w!=="rgba(0, 0, 0, 0)"){let D=s(w);if(D&&D!==z)return D}for(let D of U)try{let K=t.getComputedStyle(D,"::marker");if(K?.color){let Y=s(K.color);if(Y&&Y!==z)return Y}}catch{}return null},ne=[],q=F(R);q.gradient&&ne.push("CSS gradients are not supported. Use Sharp to rasterize gradients as PNG images first, then reference with background-image: url('gradient.png')");let se=q.gradient?{type:"color",value:"FFFFFF"}:{type:q.type,...q.path?{path:q.path}:{value:q.value}},Z=se.value||"0E0E12",ue=[],j=[],_=["P","H1","H2","H3","H4","H5","H6","UL","OL","LI"],fe=new Set(["SPAN","SMALL","LABEL","A","CODE","BUTTON","B","STRONG","I","EM","U","MARK","SUB","SUP"]),ce=new Set(["TD","TH"]),ie=new Set(["DIV","SECTION","ARTICLE","ASIDE",...ce]),be=new Set,Re=h=>{let U=h.parentElement;for(;U&&U!==R;){if(_.includes(U.tagName)||U.dataset?.pptxMerge==="true")return!0;U=U.parentElement}return!1},ke=h=>Array.from(h.childNodes).some(U=>U.nodeType===Node.TEXT_NODE&&U.textContent.replace(/\s+/g," ").trim()),xe=h=>!h.textContent.replace(/\s+/g," ").trim()||Re(h)?!1:fe.has(h.tagName)?!0:!ie.has(h.tagName)||!ke(h)&&!ce.has(h.tagName)||h.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,li")?!1:!Array.from(h.children).some(U=>ie.has(U.tagName)),Oe=h=>{if(h.textAlign&&!["start","auto"].includes(h.textAlign))return h.textAlign==="end"?"right":h.textAlign;if(h.display.includes("flex")){if(h.justifyContent==="center")return"center";if(h.justifyContent==="flex-end"||h.justifyContent==="end")return"right"}if(h.display.includes("grid")){if((h.justifyItems||h.placeItems||"").includes("center"))return"center";if((h.justifyItems||h.placeItems||"").includes("end"))return"right"}return"left"},we=(h,U)=>{if(h.display==="table-cell"){if(h.verticalAlign==="middle")return"mid";if(h.verticalAlign==="bottom")return"bottom"}if(!h.display.includes("flex")&&!h.display.includes("grid"))return parseFloat(h.lineHeight||"0")>=U.height*.75?"mid":"top";let z=h.alignItems||h.placeItems||"";return z.includes("center")?"mid":z.includes("end")?"bottom":"top"},tt=(h,U=h.tagName.toLowerCase(),z=!1,k=null)=>{let w=k||T(h),D=h.textContent.replace(/\s+/g," ").trim();if(w.width===0||w.height===0||!D)return!1;if(U!=="text"&&h.tagName!=="LI"&&/^[•\-\*▪▸○●◆◇■□]\s/.test(D.trimStart()))return ne.push(`Text element <${h.tagName.toLowerCase()}> starts with bullet symbol "${D.substring(0,20)}...". Use

          or
            lists instead of manual bullet symbols.`),!1;let K=t.getComputedStyle(h);if(K.display==="none"||K.visibility==="hidden"||parseFloat(K.opacity||"1")<=0)return!1;let Y=y(K.transform),M=g(K.writingMode),J=z?v(h,w,Y):C(h,w,Y),ae=K.fontWeight==="bold"||parseInt(K.fontWeight,10)>=600,ee=K.lineHeight&&K.lineHeight!=="normal"?c(K.lineHeight):null,pe={fontSize:c(K.fontSize),fontFace:K.fontFamily.split(",")[0].replace(/['"]/g,"").trim(),color:H(K,h),align:Oe(K),valign:z?we(K,w):"top",lineSpacing:ee,paraSpaceBefore:c(K.marginTop),paraSpaceAfter:c(K.marginBottom),margin:[c(K.paddingLeft),c(K.paddingRight),c(K.paddingBottom),c(K.paddingTop)]},Ee=u(K.color);if(Ee!==null&&(pe.transparency=Ee),Y!==null&&(pe.rotate=Y),M!==null&&(pe.vert=M),h.querySelector("b, i, u, strong, em, span, small, label, a, code, mark, sub, sup, br")){let Ie=K.textTransform,rt={};ae&&!o(K.fontFamily)&&(rt.bold=!0);let Me=x(h,rt,[],me=>p(me,Ie));!Me.map(me=>me.text).join("").trim()&&D&&(Me=[{text:p(D,Ie),options:{...rt}}]);let oe={...pe};if(oe.lineSpacing){let me=Math.max(oe.fontSize,...Me.map(De=>De.options?.fontSize||0));me>oe.fontSize&&(oe.lineSpacing=me*(oe.lineSpacing/oe.fontSize))}m({type:U,text:Me,position:{x:l(J.x),y:l(J.y),w:l(J.w),h:l(J.h)},style:oe},h)}else m({type:U,text:p(D,K.textTransform),position:{x:l(J.x),y:l(J.y),w:l(J.w),h:l(J.h)},style:{...pe,bold:ae&&!o(K.fontFamily),italic:K.fontStyle==="italic",underline:K.textDecoration.includes("underline")}},h);return be.add(h),U==="text"&&h.querySelectorAll("span,small,label,a,code,b,strong,i,em,u,mark,sub,sup").forEach(Ie=>be.add(Ie)),!0};r.querySelectorAll("*").forEach(h=>{if(be.has(h))return;if(h.tagName==="DIV"&&h.dataset&&h.dataset.pptxMerge==="true"){let k=T(h);if(k.width===0||k.height===0){be.add(h);return}if(h.querySelector('[data-pptx-merge="true"]')){ne.push("data-pptx-merge container cannot contain another data-pptx-merge container. Nested merge is not supported."),be.add(h);return}let w=t.getComputedStyle(h);if(w.backgroundImage&&w.backgroundImage!=="none"){ne.push("Background images on data-pptx-merge container are not supported. Use solid colors or borders, or layer images via slide.addImage().");return}let D=w.backgroundColor&&w.backgroundColor!=="rgba(0, 0, 0, 0)",K=[w.borderTopWidth,w.borderRightWidth,w.borderBottomWidth,w.borderLeftWidth].map(ve=>parseFloat(ve)||0),M=K.some(ve=>ve>0)&&K.every(ve=>ve===K[0]);(D||M)&&ue.push({type:"shape",text:"",position:{x:l(k.left),y:l(k.top),w:l(k.width),h:l(k.height)},shape:{fill:D?s(w.backgroundColor):null,transparency:D?u(w.backgroundColor):null,line:M?{color:s(w.borderColor),width:c(w.borderWidth)}:null,rectRadius:(()=>{let ve=w.borderRadius,Ie=parseFloat(ve);if(Ie===0)return 0;if(ve.includes("%")){if(Ie>=50)return 1;let rt=Math.min(k.width,k.height);return Ie/100*l(rt)}return ve.includes("pt")?Ie/72:Ie/i})(),shadow:b(w.boxShadow)}});let J=Array.from(h.querySelectorAll("p, h1, h2, h3, h4, h5, h6"));if(J.length===0){ne.push("data-pptx-merge container has no

            / children to merge. Remove the data-pptx-merge attribute or add text elements."),be.add(h);return}let ae=t.getComputedStyle(J[0]),ee={fontSize:c(ae.fontSize),fontFace:ae.fontFamily.split(",")[0].replace(/['"]/g,"").trim(),color:s(ae.color),align:ae.textAlign==="start"?"left":ae.textAlign,lineSpacing:ae.lineHeight&&ae.lineHeight!=="normal"?c(ae.lineHeight):null,paraSpaceBefore:0,paraSpaceAfter:0,margin:[c(w.paddingLeft),c(w.paddingRight),c(w.paddingBottom),c(w.paddingTop)]},pe=u(ae.color);pe!==null&&(ee.transparency=pe);let Ee=[];if(J.forEach((ve,Ie)=>{let rt=Ie===J.length-1,Me=t.getComputedStyle(ve),G=Me.textTransform,oe=c(Me.fontSize),me=Me.fontFamily.split(",")[0].replace(/['"]/g,"").trim(),De=s(Me.color),te=Me.fontWeight==="bold"||parseInt(Me.fontWeight)>=600,ge=Me.fontStyle==="italic",L=Me.textDecoration.includes("underline"),ye={};oe!==ee.fontSize&&(ye.fontSize=oe),me!==ee.fontFace&&(ye.fontFace=me),De!==ee.color&&(ye.color=De),te&&!o(Me.fontFamily)&&(ye.bold=!0),ge&&(ye.italic=!0),L&&(ye.underline=!0);let Ge=ve.querySelector("b, i, u, strong, em, span, small, label, a, code, mark, sub, sup, br"),S;if(Ge)S=x(ve,ye,[],de=>p(de,G));else{let de=p(ve.textContent.trim(),G);if(!de)return;S=[{text:de,options:{...ye}}]}S.length>0&&!rt&&(S[S.length-1].options.breakLine=!0),Ee.push(...S),be.add(ve)}),Ee.length===0){be.add(h);return}ue.push({type:"merged-text",items:Ee,position:{x:l(k.left),y:l(k.top),w:l(k.width),h:l(k.height)},style:ee}),be.add(h);return}let U=xe(h)?tt(h,"text",!0,fe.has(h.tagName)?W(h):null):!1;if(_.includes(h.tagName)||fe.has(h.tagName)){let k=t.getComputedStyle(h),w=k.backgroundColor&&k.backgroundColor!=="rgba(0, 0, 0, 0)",D=k.borderWidth&&parseFloat(k.borderWidth)>0||k.borderTopWidth&&parseFloat(k.borderTopWidth)>0||k.borderRightWidth&&parseFloat(k.borderRightWidth)>0||k.borderBottomWidth&&parseFloat(k.borderBottomWidth)>0||k.borderLeftWidth&&parseFloat(k.borderLeftWidth)>0,K=k.boxShadow&&k.boxShadow!=="none";if(w||D||K){let Y=T(h);if(Y.width>0&&Y.height>0){let M=[k.borderTopWidth,k.borderRightWidth,k.borderBottomWidth,k.borderLeftWidth].map(ee=>parseFloat(ee)||0),J=M.some(ee=>ee>0)&&M.every(ee=>ee===M[0]),ae=w?f(k.backgroundColor,Z):{fill:null,transparency:null};if(ae.fill||J){let ee=k.borderRadius,pe=parseFloat(ee);m({type:"shape",text:"",position:{x:l(Y.left),y:l(Y.top),w:l(Y.width),h:l(Y.height)},shape:{fill:ae.fill,transparency:ae.transparency,line:J?{color:s(k.borderColor),width:c(k.borderWidth)}:null,rectRadius:(()=>{if(!pe)return 0;if(ee.includes("%")){if(pe>=50)return 1;let Ee=Math.min(Y.width,Y.height);return pe/100*l(Ee)}return ee.includes("pt")?pe/72:pe/i})(),shadow:b(k.boxShadow)}},h)}}}}if(h.className&&h.className.includes("placeholder")){let k=T(h);k.width===0||k.height===0?ne.push(`Placeholder "${h.id||"unnamed"}" has ${k.width===0?"width: 0":"height: 0"}. Check the layout CSS.`):j.push({id:h.id||`placeholder-${j.length}`,x:l(k.left),y:l(k.top),w:l(k.width),h:l(k.height)}),be.add(h);return}if(h.tagName==="IMG"){let k=T(h);if(k.width>0&&k.height>0){ue.push({type:"image",src:h.src,position:{x:l(k.left),y:l(k.top),w:l(k.width),h:l(k.height)}}),be.add(h);return}}if(ie.has(h.tagName)){let k=t.getComputedStyle(h),w=k.backgroundColor&&k.backgroundColor!=="rgba(0, 0, 0, 0)",D=k.backgroundImage;if(D&&D!=="none"){ne.push("Background images on DIV elements are not supported. Use solid colors or borders for shapes, or use slide.addImage() in PptxGenJS to layer images.");return}let K=k.borderTopWidth,Y=k.borderRightWidth,M=k.borderBottomWidth,J=k.borderLeftWidth,ae=[K,Y,M,J].map(ve=>parseFloat(ve)||0),ee=ae.some(ve=>ve>0),pe=ee&&ae.every(ve=>ve===ae[0]),Ee=[];if(ee&&!pe){let ve=T(h),Ie=l(ve.left),rt=l(ve.top),Me=l(ve.width),G=l(ve.height);if(parseFloat(K)>0){let oe=c(K),me=oe/72/2;Ee.push({type:"line",x1:Ie,y1:rt+me,x2:Ie+Me,y2:rt+me,width:oe,color:s(k.borderTopColor)})}if(parseFloat(Y)>0){let oe=c(Y),me=oe/72/2;Ee.push({type:"line",x1:Ie+Me-me,y1:rt,x2:Ie+Me-me,y2:rt+G,width:oe,color:s(k.borderRightColor)})}if(parseFloat(M)>0){let oe=c(M),me=oe/72/2;Ee.push({type:"line",x1:Ie,y1:rt+G-me,x2:Ie+Me,y2:rt+G-me,width:oe,color:s(k.borderBottomColor)})}if(parseFloat(J)>0){let oe=c(J),me=oe/72/2;Ee.push({type:"line",x1:Ie+me,y1:rt,x2:Ie+me,y2:rt+G,width:oe,color:s(k.borderLeftColor)})}}if(w||ee){let ve=T(h);if(ve.width>=E.width*.97&&ve.height>=E.height*.97&&w){be.add(h);return}if(ve.width>0&&ve.height>0){let rt=b(k.boxShadow);if(w||pe){let Me=w?f(k.backgroundColor,Z):{fill:null,transparency:null},G=Me.fill,oe=Me.transparency;!G&&pe&&(G=s(k.borderColor)||"2A2A30",oe=oe??88),m({type:"shape",text:"",position:{x:l(ve.left),y:l(ve.top),w:l(ve.width),h:l(ve.height)},shape:{fill:G,transparency:oe,line:pe?{color:s(k.borderColor),width:c(k.borderWidth)}:null,rectRadius:(()=>{let me=k.borderRadius,De=parseFloat(me);if(De===0)return 0;if(me.includes("%")){if(De>=50)return 1;let te=Math.min(ve.width,ve.height);return De/100*l(te)}return me.includes("pt")?De/72:De/i})(),shadow:rt}},h)}Ee.forEach(Me=>m(Me,h)),be.add(h);return}}}if(!U){if(h.tagName==="UL"||h.tagName==="OL"){let k=T(h);if(k.width===0||k.height===0)return;let w=Array.from(h.querySelectorAll("li")),D=[],K=t.getComputedStyle(h),Y=c(K.paddingLeft),M=Y*.5,J=Y*.5,ae=t.getComputedStyle(w[0]||h),ee=s(ae.color),pe=N(h,w,ee);w.forEach((ve,Ie)=>{let rt=Ie===w.length-1,Me=x(ve,{breakLine:!1});Me.length>0&&(Me[0].text=Me[0].text.replace(/^[•\-\*▪▸]\s*/,""),Me[0].options.bullet={indent:J}),Me.length>0&&pe&&pe!==ee&&Me.unshift({text:"\u200B",options:{bullet:{indent:J},color:pe,fontSize:Me[0]?.options?.fontSize||c(ae.fontSize),breakLine:!1}}),Me.length>0&&!rt&&(Me[Me.length-1].options.breakLine=!0),D.push(...Me)});let Ee=C(h,k,null);m({type:"list",items:D,position:{x:l(Ee.x),y:l(Ee.y),w:l(Ee.w),h:l(Ee.h)},style:{fontSize:c(ae.fontSize),fontFace:ae.fontFamily.split(",")[0].replace(/['"]/g,"").trim(),color:ee,bulletColor:pe,transparency:u(ae.color),align:ae.textAlign==="start"?"left":ae.textAlign,lineSpacing:ae.lineHeight&&ae.lineHeight!=="normal"?c(ae.lineHeight):null,paraSpaceBefore:0,paraSpaceAfter:c(ae.marginBottom),margin:[M,0,0,0]}},h),w.forEach(ve=>be.add(ve)),be.add(h);return}_.includes(h.tagName)&&tt(h)}});let Be=h=>h==="shape"?0:h==="line"?1:h==="image"?2:3;return ue.sort((h,U)=>{let z=(h.zIndex??0)-(U.zIndex??0);return z!==0?z:Be(h.type)-Be(U.type)}),{background:se,elements:ue,placeholders:j,errors:ne}}var ar={width:1280,height:720},Wh=new Set(["p","h1","h2","h3","h4","h5","h6","text","list","merged-text"]);function Gh(e){return(e?.elements||[]).filter(r=>Wh.has(r.type)).length}function jh(e){let r=Nr(e);if(r.includes('data-pptx-raster="1"')&&r.includes("pptx-raster-hide-text"))return r;let n=``;return/<\/head>/i.test(r)?r.replace(/<\/head>/i,`${n}`).replace(/e.querySelectorAll(t),createElement:t=>document.createElement(t),getElementById:t=>e.querySelector(`#${t}`),head:e.querySelector("style")?.parentElement||e,_exportRoot:e}}function Kh(){let e=document.createElement("div");e.className="ppt-export-root-host",e.setAttribute("aria-hidden","true"),e.style.cssText=[`width:${ar.width}px`,`height:${ar.height}px`,"overflow:hidden"].join(";"),qh().appendChild(e);let r=e.attachShadow({mode:"open"}),t=document.createElement("div");return t.className="ppt-export-root",t.style.cssText=[`width:${ar.width}px`,`height:${ar.height}px`,"overflow:hidden"].join(";"),r.appendChild(t),t._exportHost=e,t}function Qh(e){let r=e?._exportHost||e;r?.isConnected&&r.remove()}async function Gc(){await new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(e))})}function Zh(e,r){let t=new DOMParser().parseFromString(r,"text/html");e.replaceChildren(),t.querySelectorAll("style").forEach(i=>{let a=document.createElement("style");a.textContent=Xh(i.textContent||""),e.appendChild(a)});let n=document.createElement("div");if(n.className="ppt-export-body",t.body){for(let i of t.body.attributes)i.name==="class"?n.classList.add(...i.value.split(/\s+/).filter(Boolean)):i.name==="style"?n.style.cssText+=`;${i.value}`:n.setAttribute(i.name,i.value);n.innerHTML=t.body.innerHTML}return n.style.boxSizing="border-box",/\bwidth\s*:/i.test(n.style.cssText)||(n.style.width=`${ar.width}px`),/\bheight\s*:/i.test(n.style.cssText)||(n.style.height=`${ar.height}px`),e.appendChild(n),n}async function Yh(e){let r=Nr(e),t=Kh(),n=Zh(t,r);return await Gc(),Hh(t,n)}async function Wc(e,r,t={}){let n=null;try{let i=await Yh(e);n=i._exportRoot,Oc(i,r),await Gc();let a=_c(i),o=Uc(i),l=a.errors||[];l.length&&console.warn("[ppt-live-export] slide overflows canvas; exporting anyway:",l.join("; "));let c={...a,errors:[]},s=o.errors||[];return!s.length||t.allowValidationErrors?{slideData:o,bodyDimensions:c,aggressive:r,warnings:l}:{error:new Error(s.join(` +`))}}finally{n&&Qh(n)}}async function Jh(e,r={}){let t=await Wc(e,!1,r);if(t?.slideData)return t;let n=await Wc(e,!0,r);if(n?.slideData)return n;throw n?.error||t?.error||new Error("PPT Live slide preparation failed")}async function jc(e,r={}){let t=[];try{for(let[n,i]of e.entries()){if(!i?.html)continue;let a=await Jh(i.html,r),o=null,c=Gh(a.slideData)===0;if(typeof r.renderRaster=="function")try{typeof r.onRasterProgress=="function"&&r.onRasterProgress(n,i);let s=c?ws(i):jh(i.html);o=await r.renderRaster(s,n)}catch{o=null}t.push({index:n,slideId:i.id,notes:i,...a,rasterBase64:o,rasterOnly:!!(o&&c)})}return t}finally{Vh()}}function $h(e={}){let r=e.theme||{},t=String(e.title||"Slide").replace(/[<>&]/g,l=>({"<":"<",">":">","&":"&"})[l]||l),n=String(e.subtitle||e.claim||"").replace(/[<>&]/g,l=>({"<":"<",">":">","&":"&"})[l]||l),i=r.background||"#ffffff",a=r.ink||"#111111",o=r.muted||"#666666";return` @@ -116,22 +156,22 @@ ${n.documentElement.outerHTML}`;return e._pptLiveSourceHtml=a,a}function Wr(e){l

            ${t}

            ${n?`

            ${n}

            `:""} -`}function bs(e){return e?.html?Wr(e.html):Kh(e)}var Qh=Object.create,Eu=Object.defineProperty,Zh=Object.getOwnPropertyDescriptor,Bu=Object.getOwnPropertyNames,Yh=Object.getPrototypeOf,Jh=Object.prototype.hasOwnProperty,An=(e=>typeof Dn<"u"?Dn:typeof Proxy<"u"?new Proxy(e,{get:(r,t)=>(typeof Dn<"u"?Dn:r)[t]}):e)(function(e){if(typeof Dn<"u")return Dn.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),Nt=(e,r)=>function(){return r||(0,e[Bu(e)[0]])((r={exports:{}}).exports,r),r.exports},$h=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Bu(r))!Jh.call(e,i)&&i!==t&&Eu(e,i,{get:()=>r[i],enumerable:!(n=Zh(r,i))||n.enumerable});return e},Qr=(e,r,t)=>(t=e!=null?Qh(Yh(e)):{},$h(r||!e||!e.__esModule?Eu(t,"default",{value:e,enumerable:!0}):t,e)),Sn=Nt({"../../../node_modules/pako/lib/utils/common.js"(e){"use strict";var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function t(a,o){return Object.prototype.hasOwnProperty.call(a,o)}e.assign=function(a){for(var o=Array.prototype.slice.call(arguments,1);o.length;){var l=o.shift();if(l){if(typeof l!="object")throw new TypeError(l+"must be non-object");for(var c in l)t(l,c)&&(a[c]=l[c])}}return a},e.shrinkBuf=function(a,o){return a.length===o?a:a.subarray?a.subarray(0,o):(a.length=o,a)};var n={arraySet:function(a,o,l,c,s){if(o.subarray&&a.subarray){a.set(o.subarray(l,l+c),s);return}for(var u=0;u=0;)G[oe]=0}var l=0,c=1,s=2,u=3,d=258,A=29,f=256,p=f+1+A,g=30,y=19,v=2*p+1,b=15,x=16,P=7,F=256,R=16,E=17,B=18,T=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],W=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],H=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],C=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],I=512,m=new Array((p+2)*2);o(m);var N=new Array(g*2);o(N);var ne=new Array(I);o(ne);var q=new Array(d-u+1);o(q);var se=new Array(A);o(se);var Z=new Array(g);o(Z);function ue(G,oe,me,De,te){this.static_tree=G,this.extra_bits=oe,this.extra_base=me,this.elems=De,this.max_length=te,this.has_stree=G&&G.length}var j,_,fe;function ce(G,oe){this.dyn_tree=G,this.max_code=0,this.stat_desc=oe}function ie(G){return G<256?ne[G]:ne[256+(G>>>7)]}function be(G,oe){G.pending_buf[G.pending++]=oe&255,G.pending_buf[G.pending++]=oe>>>8&255}function Re(G,oe,me){G.bi_valid>x-me?(G.bi_buf|=oe<>x-G.bi_valid,G.bi_valid+=me-x):(G.bi_buf|=oe<>>=1,me<<=1;while(--oe>0);return me>>>1}function Oe(G){G.bi_valid===16?(be(G,G.bi_buf),G.bi_buf=0,G.bi_valid=0):G.bi_valid>=8&&(G.pending_buf[G.pending++]=G.bi_buf&255,G.bi_buf>>=8,G.bi_valid-=8)}function we(G,oe){var me=oe.dyn_tree,De=oe.max_code,te=oe.stat_desc.static_tree,ge=oe.stat_desc.has_stree,L=oe.stat_desc.extra_bits,ye=oe.stat_desc.extra_base,Ge=oe.stat_desc.max_length,S,de,Ae,O,re,he,_e=0;for(O=0;O<=b;O++)G.bl_count[O]=0;for(me[G.heap[G.heap_max]*2+1]=0,S=G.heap_max+1;SGe&&(O=Ge,_e++),me[de*2+1]=O,!(de>De)&&(G.bl_count[O]++,re=0,de>=ye&&(re=L[de-ye]),he=me[de*2],G.opt_len+=he*(O+re),ge&&(G.static_len+=he*(te[de*2+1]+re)));if(_e!==0){do{for(O=Ge-1;G.bl_count[O]===0;)O--;G.bl_count[O]--,G.bl_count[O+1]+=2,G.bl_count[Ge]--,_e-=2}while(_e>0);for(O=Ge;O!==0;O--)for(de=G.bl_count[O];de!==0;)Ae=G.heap[--S],!(Ae>De)&&(me[Ae*2+1]!==O&&(G.opt_len+=(O-me[Ae*2+1])*me[Ae*2],me[Ae*2+1]=O),de--)}}function tt(G,oe,me){var De=new Array(b+1),te=0,ge,L;for(ge=1;ge<=b;ge++)De[ge]=te=te+me[ge-1]<<1;for(L=0;L<=oe;L++){var ye=G[L*2+1];ye!==0&&(G[L*2]=xe(De[ye]++,ye))}}function Be(){var G,oe,me,De,te,ge=new Array(b+1);for(me=0,De=0;De>=7;De8?be(G,G.bi_buf):G.bi_valid>0&&(G.pending_buf[G.pending++]=G.bi_buf),G.bi_buf=0,G.bi_valid=0}function z(G,oe,me,De){U(G),De&&(be(G,me),be(G,~me)),r.arraySet(G.pending_buf,G.window,oe,me,G.pending),G.pending+=me}function k(G,oe,me,De){var te=oe*2,ge=me*2;return G[te]>1;L>=1;L--)w(G,me,L);S=ge;do L=G.heap[1],G.heap[1]=G.heap[G.heap_len--],w(G,me,1),ye=G.heap[1],G.heap[--G.heap_max]=L,G.heap[--G.heap_max]=ye,me[S*2]=me[L*2]+me[ye*2],G.depth[S]=(G.depth[L]>=G.depth[ye]?G.depth[L]:G.depth[ye])+1,me[L*2+1]=me[ye*2+1]=S,G.heap[1]=S++,w(G,me,1);while(G.heap_len>=2);G.heap[--G.heap_max]=G.heap[1],we(G,oe),tt(me,Ge,G.bl_count)}function Y(G,oe,me){var De,te=-1,ge,L=oe[1],ye=0,Ge=7,S=4;for(L===0&&(Ge=138,S=3),oe[(me+1)*2+1]=65535,De=0;De<=me;De++)ge=L,L=oe[(De+1)*2+1],!(++ye=3&&G.bl_tree[C[oe]*2+1]===0;oe--);return G.opt_len+=3*(oe+1)+5+5+4,oe}function ae(G,oe,me,De){var te;for(Re(G,oe-257,5),Re(G,me-1,5),Re(G,De-4,4),te=0;te>>=1)if(oe&1&&G.dyn_ltree[me*2]!==0)return n;if(G.dyn_ltree[18]!==0||G.dyn_ltree[20]!==0||G.dyn_ltree[26]!==0)return i;for(me=32;me0?(G.strm.data_type===a&&(G.strm.data_type=ee(G)),K(G,G.l_desc),K(G,G.d_desc),L=J(G),te=G.opt_len+3+7>>>3,ge=G.static_len+3+7>>>3,ge<=te&&(te=ge)):te=ge=me+5,me+4<=te&&oe!==-1?ve(G,oe,me,De):G.strategy===t||ge===te?(Re(G,(c<<1)+(De?1:0),3),D(G,m,N)):(Re(G,(s<<1)+(De?1:0),3),ae(G,G.l_desc.max_code+1,G.d_desc.max_code+1,L+1),D(G,G.dyn_ltree,G.dyn_dtree)),h(G),De&&U(G)}function Me(G,oe,me){return G.pending_buf[G.d_buf+G.last_lit*2]=oe>>>8&255,G.pending_buf[G.d_buf+G.last_lit*2+1]=oe&255,G.pending_buf[G.l_buf+G.last_lit]=me&255,G.last_lit++,oe===0?G.dyn_ltree[me*2]++:(G.matches++,oe--,G.dyn_ltree[(q[me]+f+1)*2]++,G.dyn_dtree[ie(oe)*2]++),G.last_lit===G.lit_bufsize-1}e._tr_init=Ee,e._tr_stored_block=ve,e._tr_flush_block=rt,e._tr_tally=Me,e._tr_align=Ie}}),Ru=Nt({"../../../node_modules/pako/lib/zlib/adler32.js"(e,r){"use strict";function t(n,i,a,o){for(var l=n&65535|0,c=n>>>16&65535|0,s=0;a!==0;){s=a>2e3?2e3:a,a-=s;do l=l+i[o++]|0,c=c+l|0;while(--s);l%=65521,c%=65521}return l|c<<16|0}r.exports=t}}),Lu=Nt({"../../../node_modules/pako/lib/zlib/crc32.js"(e,r){"use strict";function t(){for(var a,o=[],l=0;l<256;l++){a=l;for(var c=0;c<8;c++)a=a&1?3988292384^a>>>1:a>>>1;o[l]=a}return o}var n=t();function i(a,o,l,c){var s=n,u=c+l;a^=-1;for(var d=c;d>>8^s[(a^o[d])&255];return a^-1}r.exports=i}}),tl=Nt({"../../../node_modules/pako/lib/zlib/messages.js"(e,r){"use strict";r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}}}),tp=Nt({"../../../node_modules/pako/lib/zlib/deflate.js"(e){"use strict";var r=Sn(),t=ep(),n=Ru(),i=Lu(),a=tl(),o=0,l=1,c=3,s=4,u=5,d=0,A=1,f=-2,p=-3,g=-5,y=-1,v=1,b=2,x=3,P=4,F=0,R=2,E=8,B=9,T=15,W=8,H=29,C=256,I=C+1+H,m=30,N=19,ne=2*I+1,q=15,se=3,Z=258,ue=Z+se+1,j=32,_=42,fe=69,ce=73,ie=91,be=103,Re=113,ke=666,xe=1,Oe=2,we=3,tt=4,Be=3;function h(S,de){return S.msg=a[de],de}function U(S){return(S<<1)-(S>4?9:0)}function z(S){for(var de=S.length;--de>=0;)S[de]=0}function k(S){var de=S.state,Ae=de.pending;Ae>S.avail_out&&(Ae=S.avail_out),Ae!==0&&(r.arraySet(S.output,de.pending_buf,de.pending_out,Ae,S.next_out),S.next_out+=Ae,de.pending_out+=Ae,S.total_out+=Ae,S.avail_out-=Ae,de.pending-=Ae,de.pending===0&&(de.pending_out=0))}function w(S,de){t._tr_flush_block(S,S.block_start>=0?S.block_start:-1,S.strstart-S.block_start,de),S.block_start=S.strstart,k(S.strm)}function D(S,de){S.pending_buf[S.pending++]=de}function K(S,de){S.pending_buf[S.pending++]=de>>>8&255,S.pending_buf[S.pending++]=de&255}function Y(S,de,Ae,O){var re=S.avail_in;return re>O&&(re=O),re===0?0:(S.avail_in-=re,r.arraySet(de,S.input,S.next_in,re,Ae),S.state.wrap===1?S.adler=n(S.adler,de,re,Ae):S.state.wrap===2&&(S.adler=i(S.adler,de,re,Ae)),S.next_in+=re,S.total_in+=re,re)}function M(S,de){var Ae=S.max_chain_length,O=S.strstart,re,he,_e=S.prev_length,Ne=S.nice_match,ze=S.strstart>S.w_size-ue?S.strstart-(S.w_size-ue):0,At=S.window,Or=S.w_mask,Dt=S.prev,gt=S.strstart+Z,It=At[O+_e-1],Ht=At[O+_e];S.prev_length>=S.good_match&&(Ae>>=2),Ne>S.lookahead&&(Ne=S.lookahead);do if(re=de,!(At[re+_e]!==Ht||At[re+_e-1]!==It||At[re]!==At[O]||At[++re]!==At[O+1])){O+=2,re++;do;while(At[++O]===At[++re]&&At[++O]===At[++re]&&At[++O]===At[++re]&&At[++O]===At[++re]&&At[++O]===At[++re]&&At[++O]===At[++re]&&At[++O]===At[++re]&&At[++O]===At[++re]&&O_e){if(S.match_start=de,_e=he,he>=Ne)break;It=At[O+_e-1],Ht=At[O+_e]}}while((de=Dt[de&Or])>ze&&--Ae!==0);return _e<=S.lookahead?_e:S.lookahead}function J(S){var de=S.w_size,Ae,O,re,he,_e;do{if(he=S.window_size-S.lookahead-S.strstart,S.strstart>=de+(de-ue)){r.arraySet(S.window,S.window,de,de,0),S.match_start-=de,S.strstart-=de,S.block_start-=de,O=S.hash_size,Ae=O;do re=S.head[--Ae],S.head[Ae]=re>=de?re-de:0;while(--O);O=de,Ae=O;do re=S.prev[--Ae],S.prev[Ae]=re>=de?re-de:0;while(--O);he+=de}if(S.strm.avail_in===0)break;if(O=Y(S.strm,S.window,S.strstart+S.lookahead,he),S.lookahead+=O,S.lookahead+S.insert>=se)for(_e=S.strstart-S.insert,S.ins_h=S.window[_e],S.ins_h=(S.ins_h<S.pending_buf_size-5&&(Ae=S.pending_buf_size-5);;){if(S.lookahead<=1){if(J(S),S.lookahead===0&&de===o)return xe;if(S.lookahead===0)break}S.strstart+=S.lookahead,S.lookahead=0;var O=S.block_start+Ae;if((S.strstart===0||S.strstart>=O)&&(S.lookahead=S.strstart-O,S.strstart=O,w(S,!1),S.strm.avail_out===0)||S.strstart-S.block_start>=S.w_size-ue&&(w(S,!1),S.strm.avail_out===0))return xe}return S.insert=0,de===s?(w(S,!0),S.strm.avail_out===0?we:tt):(S.strstart>S.block_start&&(w(S,!1),S.strm.avail_out===0),xe)}function ee(S,de){for(var Ae,O;;){if(S.lookahead=se&&(S.ins_h=(S.ins_h<=se)if(O=t._tr_tally(S,S.strstart-S.match_start,S.match_length-se),S.lookahead-=S.match_length,S.match_length<=S.max_lazy_match&&S.lookahead>=se){S.match_length--;do S.strstart++,S.ins_h=(S.ins_h<=se&&(S.ins_h=(S.ins_h<4096)&&(S.match_length=se-1)),S.prev_length>=se&&S.match_length<=S.prev_length){re=S.strstart+S.lookahead-se,O=t._tr_tally(S,S.strstart-1-S.prev_match,S.prev_length-se),S.lookahead-=S.prev_length-1,S.prev_length-=2;do++S.strstart<=re&&(S.ins_h=(S.ins_h<=se&&S.strstart>0&&(re=S.strstart-1,O=_e[re],O===_e[++re]&&O===_e[++re]&&O===_e[++re])){he=S.strstart+Z;do;while(O===_e[++re]&&O===_e[++re]&&O===_e[++re]&&O===_e[++re]&&O===_e[++re]&&O===_e[++re]&&O===_e[++re]&&O===_e[++re]&&reS.lookahead&&(S.match_length=S.lookahead)}if(S.match_length>=se?(Ae=t._tr_tally(S,1,S.match_length-se),S.lookahead-=S.match_length,S.strstart+=S.match_length,S.match_length=0):(Ae=t._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++),Ae&&(w(S,!1),S.strm.avail_out===0))return xe}return S.insert=0,de===s?(w(S,!0),S.strm.avail_out===0?we:tt):S.last_lit&&(w(S,!1),S.strm.avail_out===0)?xe:Oe}function ve(S,de){for(var Ae;;){if(S.lookahead===0&&(J(S),S.lookahead===0)){if(de===o)return xe;break}if(S.match_length=0,Ae=t._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++,Ae&&(w(S,!1),S.strm.avail_out===0))return xe}return S.insert=0,de===s?(w(S,!0),S.strm.avail_out===0?we:tt):S.last_lit&&(w(S,!1),S.strm.avail_out===0)?xe:Oe}function Ie(S,de,Ae,O,re){this.good_length=S,this.max_lazy=de,this.nice_length=Ae,this.max_chain=O,this.func=re}var rt;rt=[new Ie(0,0,0,0,ae),new Ie(4,4,8,4,ee),new Ie(4,5,16,8,ee),new Ie(4,6,32,32,ee),new Ie(4,4,16,16,pe),new Ie(8,16,32,32,pe),new Ie(8,16,128,128,pe),new Ie(8,32,128,256,pe),new Ie(32,128,258,1024,pe),new Ie(32,258,258,4096,pe)];function Me(S){S.window_size=2*S.w_size,z(S.head),S.max_lazy_match=rt[S.level].max_lazy,S.good_match=rt[S.level].good_length,S.nice_match=rt[S.level].nice_length,S.max_chain_length=rt[S.level].max_chain,S.strstart=0,S.block_start=0,S.lookahead=0,S.insert=0,S.match_length=S.prev_length=se-1,S.match_available=0,S.ins_h=0}function G(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=E,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(ne*2),this.dyn_dtree=new r.Buf16((2*m+1)*2),this.bl_tree=new r.Buf16((2*N+1)*2),z(this.dyn_ltree),z(this.dyn_dtree),z(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(q+1),this.heap=new r.Buf16(2*I+1),z(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(2*I+1),z(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function oe(S){var de;return!S||!S.state?h(S,f):(S.total_in=S.total_out=0,S.data_type=R,de=S.state,de.pending=0,de.pending_out=0,de.wrap<0&&(de.wrap=-de.wrap),de.status=de.wrap?_:Re,S.adler=de.wrap===2?0:1,de.last_flush=o,t._tr_init(de),d)}function me(S){var de=oe(S);return de===d&&Me(S.state),de}function De(S,de){return!S||!S.state||S.state.wrap!==2?f:(S.state.gzhead=de,d)}function te(S,de,Ae,O,re,he){if(!S)return f;var _e=1;if(de===y&&(de=6),O<0?(_e=0,O=-O):O>15&&(_e=2,O-=16),re<1||re>B||Ae!==E||O<8||O>15||de<0||de>9||he<0||he>P)return h(S,f);O===8&&(O=9);var Ne=new G;return S.state=Ne,Ne.strm=S,Ne.wrap=_e,Ne.gzhead=null,Ne.w_bits=O,Ne.w_size=1<u||de<0)return S?h(S,f):f;if(O=S.state,!S.output||!S.input&&S.avail_in!==0||O.status===ke&&de!==s)return h(S,S.avail_out===0?g:f);if(O.strm=S,Ae=O.last_flush,O.last_flush=de,O.status===_)if(O.wrap===2)S.adler=0,D(O,31),D(O,139),D(O,8),O.gzhead?(D(O,(O.gzhead.text?1:0)+(O.gzhead.hcrc?2:0)+(O.gzhead.extra?4:0)+(O.gzhead.name?8:0)+(O.gzhead.comment?16:0)),D(O,O.gzhead.time&255),D(O,O.gzhead.time>>8&255),D(O,O.gzhead.time>>16&255),D(O,O.gzhead.time>>24&255),D(O,O.level===9?2:O.strategy>=b||O.level<2?4:0),D(O,O.gzhead.os&255),O.gzhead.extra&&O.gzhead.extra.length&&(D(O,O.gzhead.extra.length&255),D(O,O.gzhead.extra.length>>8&255)),O.gzhead.hcrc&&(S.adler=i(S.adler,O.pending_buf,O.pending,0)),O.gzindex=0,O.status=fe):(D(O,0),D(O,0),D(O,0),D(O,0),D(O,0),D(O,O.level===9?2:O.strategy>=b||O.level<2?4:0),D(O,Be),O.status=Re);else{var _e=E+(O.w_bits-8<<4)<<8,Ne=-1;O.strategy>=b||O.level<2?Ne=0:O.level<6?Ne=1:O.level===6?Ne=2:Ne=3,_e|=Ne<<6,O.strstart!==0&&(_e|=j),_e+=31-_e%31,O.status=Re,K(O,_e),O.strstart!==0&&(K(O,S.adler>>>16),K(O,S.adler&65535)),S.adler=1}if(O.status===fe)if(O.gzhead.extra){for(re=O.pending;O.gzindex<(O.gzhead.extra.length&65535)&&!(O.pending===O.pending_buf_size&&(O.gzhead.hcrc&&O.pending>re&&(S.adler=i(S.adler,O.pending_buf,O.pending-re,re)),k(S),re=O.pending,O.pending===O.pending_buf_size));)D(O,O.gzhead.extra[O.gzindex]&255),O.gzindex++;O.gzhead.hcrc&&O.pending>re&&(S.adler=i(S.adler,O.pending_buf,O.pending-re,re)),O.gzindex===O.gzhead.extra.length&&(O.gzindex=0,O.status=ce)}else O.status=ce;if(O.status===ce)if(O.gzhead.name){re=O.pending;do{if(O.pending===O.pending_buf_size&&(O.gzhead.hcrc&&O.pending>re&&(S.adler=i(S.adler,O.pending_buf,O.pending-re,re)),k(S),re=O.pending,O.pending===O.pending_buf_size)){he=1;break}O.gzindexre&&(S.adler=i(S.adler,O.pending_buf,O.pending-re,re)),he===0&&(O.gzindex=0,O.status=ie)}else O.status=ie;if(O.status===ie)if(O.gzhead.comment){re=O.pending;do{if(O.pending===O.pending_buf_size&&(O.gzhead.hcrc&&O.pending>re&&(S.adler=i(S.adler,O.pending_buf,O.pending-re,re)),k(S),re=O.pending,O.pending===O.pending_buf_size)){he=1;break}O.gzindexre&&(S.adler=i(S.adler,O.pending_buf,O.pending-re,re)),he===0&&(O.status=be)}else O.status=be;if(O.status===be&&(O.gzhead.hcrc?(O.pending+2>O.pending_buf_size&&k(S),O.pending+2<=O.pending_buf_size&&(D(O,S.adler&255),D(O,S.adler>>8&255),S.adler=0,O.status=Re)):O.status=Re),O.pending!==0){if(k(S),S.avail_out===0)return O.last_flush=-1,d}else if(S.avail_in===0&&U(de)<=U(Ae)&&de!==s)return h(S,g);if(O.status===ke&&S.avail_in!==0)return h(S,g);if(S.avail_in!==0||O.lookahead!==0||de!==o&&O.status!==ke){var ze=O.strategy===b?ve(O,de):O.strategy===x?Ee(O,de):rt[O.level].func(O,de);if((ze===we||ze===tt)&&(O.status=ke),ze===xe||ze===we)return S.avail_out===0&&(O.last_flush=-1),d;if(ze===Oe&&(de===l?t._tr_align(O):de!==u&&(t._tr_stored_block(O,0,0,!1),de===c&&(z(O.head),O.lookahead===0&&(O.strstart=0,O.block_start=0,O.insert=0))),k(S),S.avail_out===0))return O.last_flush=-1,d}return de!==s?d:O.wrap<=0?A:(O.wrap===2?(D(O,S.adler&255),D(O,S.adler>>8&255),D(O,S.adler>>16&255),D(O,S.adler>>24&255),D(O,S.total_in&255),D(O,S.total_in>>8&255),D(O,S.total_in>>16&255),D(O,S.total_in>>24&255)):(K(O,S.adler>>>16),K(O,S.adler&65535)),k(S),O.wrap>0&&(O.wrap=-O.wrap),O.pending!==0?d:A)}function ye(S){var de;return!S||!S.state?f:(de=S.state.status,de!==_&&de!==fe&&de!==ce&&de!==ie&&de!==be&&de!==Re&&de!==ke?h(S,f):(S.state=null,de===Re?h(S,p):d))}function Ge(S,de){var Ae=de.length,O,re,he,_e,Ne,ze,At,Or;if(!S||!S.state||(O=S.state,_e=O.wrap,_e===2||_e===1&&O.status!==_||O.lookahead))return f;for(_e===1&&(S.adler=n(S.adler,de,Ae,0)),O.wrap=0,Ae>=O.w_size&&(_e===0&&(z(O.head),O.strstart=0,O.block_start=0,O.insert=0),Or=new r.Buf8(O.w_size),r.arraySet(Or,de,Ae-O.w_size,O.w_size,0),de=Or,Ae=O.w_size),Ne=S.avail_in,ze=S.next_in,At=S.input,S.avail_in=Ae,S.next_in=0,S.input=de,J(O);O.lookahead>=se;){re=O.strstart,he=O.lookahead-(se-1);do O.ins_h=(O.ins_h<=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;var a;i[254]=i[254]=1,e.string2buf=function(l){var c,s,u,d,A,f=l.length,p=0;for(d=0;d>>6,c[A++]=128|s&63):s<65536?(c[A++]=224|s>>>12,c[A++]=128|s>>>6&63,c[A++]=128|s&63):(c[A++]=240|s>>>18,c[A++]=128|s>>>12&63,c[A++]=128|s>>>6&63,c[A++]=128|s&63);return c};function o(l,c){if(c<65534&&(l.subarray&&n||!l.subarray&&t))return String.fromCharCode.apply(null,r.shrinkBuf(l,c));for(var s="",u=0;u4){p[u++]=65533,s+=A-1;continue}for(d&=A===2?31:A===3?15:7;A>1&&s1){p[u++]=65533;continue}d<65536?p[u++]=d:(d-=65536,p[u++]=55296|d>>10&1023,p[u++]=56320|d&1023)}return o(p,u)},e.utf8border=function(l,c){var s;for(c=c||l.length,c>l.length&&(c=l.length),s=c-1;s>=0&&(l[s]&192)===128;)s--;return s<0||s===0?c:s+i[l[s]]>c?s:c}}}),Iu=Nt({"../../../node_modules/pako/lib/zlib/zstream.js"(e,r){"use strict";function t(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}r.exports=t}}),rp=Nt({"../../../node_modules/pako/lib/deflate.js"(e){"use strict";var r=tp(),t=Sn(),n=Nu(),i=tl(),a=Iu(),o=Object.prototype.toString,l=0,c=4,s=0,u=1,d=2,A=-1,f=0,p=8;function g(x){if(!(this instanceof g))return new g(x);this.options=t.assign({level:A,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},x||{});var P=this.options;P.raw&&P.windowBits>0?P.windowBits=-P.windowBits:P.gzip&&P.windowBits>0&&P.windowBits<16&&(P.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var F=r.deflateInit2(this.strm,P.level,P.method,P.windowBits,P.memLevel,P.strategy);if(F!==s)throw new Error(i[F]);if(P.header&&r.deflateSetHeader(this.strm,P.header),P.dictionary){var R;if(typeof P.dictionary=="string"?R=n.string2buf(P.dictionary):o.call(P.dictionary)==="[object ArrayBuffer]"?R=new Uint8Array(P.dictionary):R=P.dictionary,F=r.deflateSetDictionary(this.strm,R),F!==s)throw new Error(i[F]);this._dict_set=!0}}g.prototype.push=function(x,P){var F=this.strm,R=this.options.chunkSize,E,B;if(this.ended)return!1;B=P===~~P?P:P===!0?c:l,typeof x=="string"?F.input=n.string2buf(x):o.call(x)==="[object ArrayBuffer]"?F.input=new Uint8Array(x):F.input=x,F.next_in=0,F.avail_in=F.input.length;do{if(F.avail_out===0&&(F.output=new t.Buf8(R),F.next_out=0,F.avail_out=R),E=r.deflate(F,B),E!==u&&E!==s)return this.onEnd(E),this.ended=!0,!1;(F.avail_out===0||F.avail_in===0&&(B===c||B===d))&&(this.options.to==="string"?this.onData(n.buf2binstring(t.shrinkBuf(F.output,F.next_out))):this.onData(t.shrinkBuf(F.output,F.next_out)))}while((F.avail_in>0||F.avail_out===0)&&E!==u);return B===c?(E=r.deflateEnd(this.strm),this.onEnd(E),this.ended=!0,E===s):(B===d&&(this.onEnd(s),F.avail_out=0),!0)},g.prototype.onData=function(x){this.chunks.push(x)},g.prototype.onEnd=function(x){x===s&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=t.flattenChunks(this.chunks)),this.chunks=[],this.err=x,this.msg=this.strm.msg};function y(x,P){var F=new g(P);if(F.push(x,!0),F.err)throw F.msg||i[F.err];return F.result}function v(x,P){return P=P||{},P.raw=!0,y(x,P)}function b(x,P){return P=P||{},P.gzip=!0,y(x,P)}e.Deflate=g,e.deflate=y,e.deflateRaw=v,e.gzip=b}}),np=Nt({"../../../node_modules/pako/lib/zlib/inffast.js"(e,r){"use strict";var t=30,n=12;r.exports=function(a,o){var l,c,s,u,d,A,f,p,g,y,v,b,x,P,F,R,E,B,T,W,H,C,I,m,N;l=a.state,c=a.next_in,m=a.input,s=c+(a.avail_in-5),u=a.next_out,N=a.output,d=u-(o-a.avail_out),A=u+(a.avail_out-257),f=l.dmax,p=l.wsize,g=l.whave,y=l.wnext,v=l.window,b=l.hold,x=l.bits,P=l.lencode,F=l.distcode,R=(1<>>24,b>>>=T,x-=T,T=B>>>16&255,T===0)N[u++]=B&65535;else if(T&16){W=B&65535,T&=15,T&&(x>>=T,x-=T),x<15&&(b+=m[c++]<>>24,b>>>=T,x-=T,T=B>>>16&255,T&16){if(H=B&65535,T&=15,xf){a.msg="invalid distance too far back",l.mode=t;break e}if(b>>>=T,x-=T,T=u-d,H>T){if(T=H-T,T>g&&l.sane){a.msg="invalid distance too far back",l.mode=t;break e}if(C=0,I=v,y===0){if(C+=p-T,T2;)N[u++]=I[C++],N[u++]=I[C++],N[u++]=I[C++],W-=3;W&&(N[u++]=I[C++],W>1&&(N[u++]=I[C++]))}else{C=u-H;do N[u++]=N[C++],N[u++]=N[C++],N[u++]=N[C++],W-=3;while(W>2);W&&(N[u++]=N[C++],W>1&&(N[u++]=N[C++]))}}else if((T&64)===0){B=F[(B&65535)+(b&(1<>3,c-=W,x-=W<<3,b&=(1<=1&&ie[W]===0;W--);if(H>W&&(H=W),W===0)return b[x++]=1<<24|64<<16|0,b[x++]=1<<24|64<<16|0,F.bits=1,0;for(T=1;T0&&(p===o||W!==1))return-1;for(be[1]=0,E=1;Ei||p===c&&N>a)return 1;for(;;){xe=E-I,P[B]ce?(Oe=Re[ke+P[B]],we=_[fe+P[B]]):(Oe=96,we=0),q=1<>I)+se]=xe<<24|Oe<<16|we|0;while(se!==0);for(q=1<>=1;if(q!==0?(ne&=q-1,ne+=q):ne=0,B++,--ie[E]===0){if(E===W)break;E=g[y+P[B]]}if(E>H&&(ne&ue)!==Z){for(I===0&&(I=H),j+=T,C=E-I,m=1<i||p===c&&N>a)return 1;Z=ne&ue,b[Z]=H<<24|C<<16|j-x|0}}return ne!==0&&(b[j+ne]=E-I<<24|64<<16|0),F.bits=H,0}}}),ap=Nt({"../../../node_modules/pako/lib/zlib/inflate.js"(e){"use strict";var r=Sn(),t=Ru(),n=Lu(),i=np(),a=ip(),o=0,l=1,c=2,s=4,u=5,d=6,A=0,f=1,p=2,g=-2,y=-3,v=-4,b=-5,x=8,P=1,F=2,R=3,E=4,B=5,T=6,W=7,H=8,C=9,I=10,m=11,N=12,ne=13,q=14,se=15,Z=16,ue=17,j=18,_=19,fe=20,ce=21,ie=22,be=23,Re=24,ke=25,xe=26,Oe=27,we=28,tt=29,Be=30,h=31,U=32,z=852,k=592,w=15,D=w;function K(te){return(te>>>24&255)+(te>>>8&65280)+((te&65280)<<8)+((te&255)<<24)}function Y(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function M(te){var ge;return!te||!te.state?g:(ge=te.state,te.total_in=te.total_out=ge.total=0,te.msg="",ge.wrap&&(te.adler=ge.wrap&1),ge.mode=P,ge.last=0,ge.havedict=0,ge.dmax=32768,ge.head=null,ge.hold=0,ge.bits=0,ge.lencode=ge.lendyn=new r.Buf32(z),ge.distcode=ge.distdyn=new r.Buf32(k),ge.sane=1,ge.back=-1,A)}function J(te){var ge;return!te||!te.state?g:(ge=te.state,ge.wsize=0,ge.whave=0,ge.wnext=0,M(te))}function ae(te,ge){var L,ye;return!te||!te.state||(ye=te.state,ge<0?(L=0,ge=-ge):(L=(ge>>4)+1,ge<48&&(ge&=15)),ge&&(ge<8||ge>15))?g:(ye.window!==null&&ye.wbits!==ge&&(ye.window=null),ye.wrap=L,ye.wbits=ge,J(te))}function ee(te,ge){var L,ye;return te?(ye=new Y,te.state=ye,ye.window=null,L=ae(te,ge),L!==A&&(te.state=null),L):g}function pe(te){return ee(te,D)}var Ee=!0,ve,Ie;function rt(te){if(Ee){var ge;for(ve=new r.Buf32(512),Ie=new r.Buf32(32),ge=0;ge<144;)te.lens[ge++]=8;for(;ge<256;)te.lens[ge++]=9;for(;ge<280;)te.lens[ge++]=7;for(;ge<288;)te.lens[ge++]=8;for(a(l,te.lens,0,288,ve,0,te.work,{bits:9}),ge=0;ge<32;)te.lens[ge++]=5;a(c,te.lens,0,32,Ie,0,te.work,{bits:5}),Ee=!1}te.lencode=ve,te.lenbits=9,te.distcode=Ie,te.distbits=5}function Me(te,ge,L,ye){var Ge,S=te.state;return S.window===null&&(S.wsize=1<=S.wsize?(r.arraySet(S.window,ge,L-S.wsize,S.wsize,0),S.wnext=0,S.whave=S.wsize):(Ge=S.wsize-S.wnext,Ge>ye&&(Ge=ye),r.arraySet(S.window,ge,L-ye,Ge,S.wnext),ye-=Ge,ye?(r.arraySet(S.window,ge,L-ye,ye,0),S.wnext=ye,S.whave=S.wsize):(S.wnext+=Ge,S.wnext===S.wsize&&(S.wnext=0),S.whave>>8&255,L.check=n(L.check,jt,2,0),re=0,he=0,L.mode=F;break}if(L.flags=0,L.head&&(L.head.done=!1),!(L.wrap&1)||(((re&255)<<8)+(re>>8))%31){te.msg="incorrect header check",L.mode=Be;break}if((re&15)!==x){te.msg="unknown compression method",L.mode=Be;break}if(re>>>=4,he-=4,Rt=(re&15)+8,L.wbits===0)L.wbits=Rt;else if(Rt>L.wbits){te.msg="invalid window size",L.mode=Be;break}L.dmax=1<>8&1),L.flags&512&&(jt[0]=re&255,jt[1]=re>>>8&255,L.check=n(L.check,jt,2,0)),re=0,he=0,L.mode=R;case R:for(;he<32;){if(Ae===0)break e;Ae--,re+=ye[S++]<>>8&255,jt[2]=re>>>16&255,jt[3]=re>>>24&255,L.check=n(L.check,jt,4,0)),re=0,he=0,L.mode=E;case E:for(;he<16;){if(Ae===0)break e;Ae--,re+=ye[S++]<>8),L.flags&512&&(jt[0]=re&255,jt[1]=re>>>8&255,L.check=n(L.check,jt,2,0)),re=0,he=0,L.mode=B;case B:if(L.flags&1024){for(;he<16;){if(Ae===0)break e;Ae--,re+=ye[S++]<>>8&255,L.check=n(L.check,jt,2,0)),re=0,he=0}else L.head&&(L.head.extra=null);L.mode=T;case T:if(L.flags&1024&&(ze=L.length,ze>Ae&&(ze=Ae),ze&&(L.head&&(Rt=L.head.extra_len-L.length,L.head.extra||(L.head.extra=new Array(L.head.extra_len)),r.arraySet(L.head.extra,ye,S,ze,Rt)),L.flags&512&&(L.check=n(L.check,ye,ze,S)),Ae-=ze,S+=ze,L.length-=ze),L.length))break e;L.length=0,L.mode=W;case W:if(L.flags&2048){if(Ae===0)break e;ze=0;do Rt=ye[S+ze++],L.head&&Rt&&L.length<65536&&(L.head.name+=String.fromCharCode(Rt));while(Rt&&ze>9&1,L.head.done=!0),te.adler=L.check=0,L.mode=N;break;case I:for(;he<32;){if(Ae===0)break e;Ae--,re+=ye[S++]<>>=he&7,he-=he&7,L.mode=Oe;break}for(;he<3;){if(Ae===0)break e;Ae--,re+=ye[S++]<>>=1,he-=1,re&3){case 0:L.mode=q;break;case 1:if(rt(L),L.mode=fe,ge===d){re>>>=2,he-=2;break e}break;case 2:L.mode=ue;break;case 3:te.msg="invalid block type",L.mode=Be}re>>>=2,he-=2;break;case q:for(re>>>=he&7,he-=he&7;he<32;){if(Ae===0)break e;Ae--,re+=ye[S++]<>>16^65535)){te.msg="invalid stored block lengths",L.mode=Be;break}if(L.length=re&65535,re=0,he=0,L.mode=se,ge===d)break e;case se:L.mode=Z;case Z:if(ze=L.length,ze){if(ze>Ae&&(ze=Ae),ze>O&&(ze=O),ze===0)break e;r.arraySet(Ge,ye,S,ze,de),Ae-=ze,S+=ze,O-=ze,de+=ze,L.length-=ze;break}L.mode=N;break;case ue:for(;he<14;){if(Ae===0)break e;Ae--,re+=ye[S++]<>>=5,he-=5,L.ndist=(re&31)+1,re>>>=5,he-=5,L.ncode=(re&15)+4,re>>>=4,he-=4,L.nlen>286||L.ndist>30){te.msg="too many length or distance symbols",L.mode=Be;break}L.have=0,L.mode=j;case j:for(;L.have>>=3,he-=3}for(;L.have<19;)L.lens[ec[L.have++]]=0;if(L.lencode=L.lendyn,L.lenbits=7,_r={bits:L.lenbits},pr=a(o,L.lens,0,19,L.lencode,0,L.work,_r),L.lenbits=_r.bits,pr){te.msg="invalid code lengths set",L.mode=Be;break}L.have=0,L.mode=_;case _:for(;L.have>>24,It=Dt>>>16&255,Ht=Dt&65535,!(gt<=he);){if(Ae===0)break e;Ae--,re+=ye[S++]<>>=gt,he-=gt,L.lens[L.have++]=Ht;else{if(Ht===16){for(Lr=gt+2;he>>=gt,he-=gt,L.have===0){te.msg="invalid bit length repeat",L.mode=Be;break}Rt=L.lens[L.have-1],ze=3+(re&3),re>>>=2,he-=2}else if(Ht===17){for(Lr=gt+3;he>>=gt,he-=gt,Rt=0,ze=3+(re&7),re>>>=3,he-=3}else{for(Lr=gt+7;he>>=gt,he-=gt,Rt=0,ze=11+(re&127),re>>>=7,he-=7}if(L.have+ze>L.nlen+L.ndist){te.msg="invalid bit length repeat",L.mode=Be;break}for(;ze--;)L.lens[L.have++]=Rt}}if(L.mode===Be)break;if(L.lens[256]===0){te.msg="invalid code -- missing end-of-block",L.mode=Be;break}if(L.lenbits=9,_r={bits:L.lenbits},pr=a(l,L.lens,0,L.nlen,L.lencode,0,L.work,_r),L.lenbits=_r.bits,pr){te.msg="invalid literal/lengths set",L.mode=Be;break}if(L.distbits=6,L.distcode=L.distdyn,_r={bits:L.distbits},pr=a(c,L.lens,L.nlen,L.ndist,L.distcode,0,L.work,_r),L.distbits=_r.bits,pr){te.msg="invalid distances set",L.mode=Be;break}if(L.mode=fe,ge===d)break e;case fe:L.mode=ce;case ce:if(Ae>=6&&O>=258){te.next_out=de,te.avail_out=O,te.next_in=S,te.avail_in=Ae,L.hold=re,L.bits=he,i(te,Ne),de=te.next_out,Ge=te.output,O=te.avail_out,S=te.next_in,ye=te.input,Ae=te.avail_in,re=L.hold,he=L.bits,L.mode===N&&(L.back=-1);break}for(L.back=0;Dt=L.lencode[re&(1<>>24,It=Dt>>>16&255,Ht=Dt&65535,!(gt<=he);){if(Ae===0)break e;Ae--,re+=ye[S++]<>tr)],gt=Dt>>>24,It=Dt>>>16&255,Ht=Dt&65535,!(tr+gt<=he);){if(Ae===0)break e;Ae--,re+=ye[S++]<>>=tr,he-=tr,L.back+=tr}if(re>>>=gt,he-=gt,L.back+=gt,L.length=Ht,It===0){L.mode=xe;break}if(It&32){L.back=-1,L.mode=N;break}if(It&64){te.msg="invalid literal/length code",L.mode=Be;break}L.extra=It&15,L.mode=ie;case ie:if(L.extra){for(Lr=L.extra;he>>=L.extra,he-=L.extra,L.back+=L.extra}L.was=L.length,L.mode=be;case be:for(;Dt=L.distcode[re&(1<>>24,It=Dt>>>16&255,Ht=Dt&65535,!(gt<=he);){if(Ae===0)break e;Ae--,re+=ye[S++]<>tr)],gt=Dt>>>24,It=Dt>>>16&255,Ht=Dt&65535,!(tr+gt<=he);){if(Ae===0)break e;Ae--,re+=ye[S++]<>>=tr,he-=tr,L.back+=tr}if(re>>>=gt,he-=gt,L.back+=gt,It&64){te.msg="invalid distance code",L.mode=Be;break}L.offset=Ht,L.extra=It&15,L.mode=Re;case Re:if(L.extra){for(Lr=L.extra;he>>=L.extra,he-=L.extra,L.back+=L.extra}if(L.offset>L.dmax){te.msg="invalid distance too far back",L.mode=Be;break}L.mode=ke;case ke:if(O===0)break e;if(ze=Ne-O,L.offset>ze){if(ze=L.offset-ze,ze>L.whave&&L.sane){te.msg="invalid distance too far back",L.mode=Be;break}ze>L.wnext?(ze-=L.wnext,At=L.wsize-ze):At=L.wnext-ze,ze>L.length&&(ze=L.length),Or=L.window}else Or=Ge,At=de-L.offset,ze=L.length;ze>O&&(ze=O),O-=ze,L.length-=ze;do Ge[de++]=Or[At++];while(--ze);L.length===0&&(L.mode=ce);break;case xe:if(O===0)break e;Ge[de++]=L.length,O--,L.mode=ce;break;case Oe:if(L.wrap){for(;he<32;){if(Ae===0)break e;Ae--,re|=ye[S++]<=0&&f.windowBits<16&&(f.windowBits=-f.windowBits,f.windowBits===0&&(f.windowBits=-15)),f.windowBits>=0&&f.windowBits<16&&!(A&&A.windowBits)&&(f.windowBits+=32),f.windowBits>15&&f.windowBits<48&&(f.windowBits&15)===0&&(f.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var p=r.inflateInit2(this.strm,f.windowBits);if(p!==i.Z_OK)throw new Error(a[p]);if(this.header=new l,r.inflateGetHeader(this.strm,this.header),f.dictionary&&(typeof f.dictionary=="string"?f.dictionary=n.string2buf(f.dictionary):c.call(f.dictionary)==="[object ArrayBuffer]"&&(f.dictionary=new Uint8Array(f.dictionary)),f.raw&&(p=r.inflateSetDictionary(this.strm,f.dictionary),p!==i.Z_OK)))throw new Error(a[p])}s.prototype.push=function(A,f){var p=this.strm,g=this.options.chunkSize,y=this.options.dictionary,v,b,x,P,F,R=!1;if(this.ended)return!1;b=f===~~f?f:f===!0?i.Z_FINISH:i.Z_NO_FLUSH,typeof A=="string"?p.input=n.binstring2buf(A):c.call(A)==="[object ArrayBuffer]"?p.input=new Uint8Array(A):p.input=A,p.next_in=0,p.avail_in=p.input.length;do{if(p.avail_out===0&&(p.output=new t.Buf8(g),p.next_out=0,p.avail_out=g),v=r.inflate(p,i.Z_NO_FLUSH),v===i.Z_NEED_DICT&&y&&(v=r.inflateSetDictionary(this.strm,y)),v===i.Z_BUF_ERROR&&R===!0&&(v=i.Z_OK,R=!1),v!==i.Z_STREAM_END&&v!==i.Z_OK)return this.onEnd(v),this.ended=!0,!1;p.next_out&&(p.avail_out===0||v===i.Z_STREAM_END||p.avail_in===0&&(b===i.Z_FINISH||b===i.Z_SYNC_FLUSH))&&(this.options.to==="string"?(x=n.utf8border(p.output,p.next_out),P=p.next_out-x,F=n.buf2string(p.output,x),p.next_out=P,p.avail_out=g-P,P&&t.arraySet(p.output,p.output,x,P,0),this.onData(F)):this.onData(t.shrinkBuf(p.output,p.next_out))),p.avail_in===0&&p.avail_out===0&&(R=!0)}while((p.avail_in>0||p.avail_out===0)&&v!==i.Z_STREAM_END);return v===i.Z_STREAM_END&&(b=i.Z_FINISH),b===i.Z_FINISH?(v=r.inflateEnd(this.strm),this.onEnd(v),this.ended=!0,v===i.Z_OK):(b===i.Z_SYNC_FLUSH&&(this.onEnd(i.Z_OK),p.avail_out=0),!0)},s.prototype.onData=function(A){this.chunks.push(A)},s.prototype.onEnd=function(A){A===i.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=t.flattenChunks(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};function u(A,f){var p=new s(f);if(p.push(A,!0),p.err)throw p.msg||a[p.err];return p.result}function d(A,f){return f=f||{},f.raw=!0,u(A,f)}e.Inflate=s,e.inflate=u,e.inflateRaw=d,e.ungzip=u}}),bo=Nt({"../../../node_modules/pako/index.js"(e,r){"use strict";var t=Sn().assign,n=rp(),i=sp(),a=zu(),o={};t(o,n,i,a),r.exports=o}}),lp=Nt({"node_modules/jszip/dist/jszip.min.js"(e,r){(function(t){typeof e=="object"&&typeof r<"u"?r.exports=t():typeof define=="function"&&define.amd?define([],t):(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this).JSZip=t()})(function(){return(function t(n,i,a){function o(s,u){if(!i[s]){if(!n[s]){var d=typeof An=="function"&&An;if(!u&&d)return d(s,!0);if(l)return l(s,!0);var A=new Error("Cannot find module '"+s+"'");throw A.code="MODULE_NOT_FOUND",A}var f=i[s]={exports:{}};n[s][0].call(f.exports,function(p){var g=n[s][1][p];return o(g||p)},f,f.exports,t,n,i,a)}return i[s].exports}for(var l=typeof An=="function"&&An,c=0;c>2,f=(3&s)<<4|u>>4,p=1>6:64,g=2>4,u=(15&A)<<4|(f=l.indexOf(c.charAt(g++)))>>2,d=(3&f)<<6|(p=l.indexOf(c.charAt(g++))),b[y++]=s,f!==64&&(b[y++]=u),p!==64&&(b[y++]=d);return b}},{"./support":30,"./utils":32}],2:[function(t,n,i){"use strict";var a=t("./external"),o=t("./stream/DataWorker"),l=t("./stream/Crc32Probe"),c=t("./stream/DataLengthProbe");function s(u,d,A,f,p){this.compressedSize=u,this.uncompressedSize=d,this.crc32=A,this.compression=f,this.compressedContent=p}s.prototype={getContentWorker:function(){var u=new o(a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),d=this;return u.on("end",function(){if(this.streamInfo.data_length!==d.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new o(a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(u,d,A){return u.pipe(new l).pipe(new c("uncompressedSize")).pipe(d.compressWorker(A)).pipe(new c("compressedSize")).withStreamInfo("compression",d)},n.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,n,i){"use strict";var a=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new a("STORE compression")},uncompressWorker:function(){return new a("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,n,i){"use strict";var a=t("./utils"),o=(function(){for(var l,c=[],s=0;s<256;s++){l=s;for(var u=0;u<8;u++)l=1&l?3988292384^l>>>1:l>>>1;c[s]=l}return c})();n.exports=function(l,c){return l!==void 0&&l.length?a.getTypeOf(l)!=="string"?(function(s,u,d,A){var f=o,p=A+d;s^=-1;for(var g=A;g>>8^f[255&(s^u[g])];return-1^s})(0|c,l,l.length,0):(function(s,u,d,A){var f=o,p=A+d;s^=-1;for(var g=A;g>>8^f[255&(s^u.charCodeAt(g))];return-1^s})(0|c,l,l.length,0):0}},{"./utils":32}],5:[function(t,n,i){"use strict";i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,n,i){"use strict";var a=null;a=typeof Promise<"u"?Promise:t("lie"),n.exports={Promise:a}},{lie:37}],7:[function(t,n,i){"use strict";var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=t("pako"),l=t("./utils"),c=t("./stream/GenericWorker"),s=a?"uint8array":"array";function u(d,A){c.call(this,"FlateWorker/"+d),this._pako=null,this._pakoAction=d,this._pakoOptions=A,this.meta={}}i.magic="\b\0",l.inherits(u,c),u.prototype.processChunk=function(d){this.meta=d.meta,this._pako===null&&this._createPako(),this._pako.push(l.transformTo(s,d.data),!1)},u.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var d=this;this._pako.onData=function(A){d.push({data:A,meta:d.meta})}},i.compressWorker=function(d){return new u("Deflate",d)},i.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,n,i){"use strict";function a(f,p){var g,y="";for(g=0;g>>=8;return y}function o(f,p,g,y,v,b){var x,P,F=f.file,R=f.compression,E=b!==s.utf8encode,B=l.transformTo("string",b(F.name)),T=l.transformTo("string",s.utf8encode(F.name)),W=F.comment,H=l.transformTo("string",b(W)),C=l.transformTo("string",s.utf8encode(W)),I=T.length!==F.name.length,m=C.length!==W.length,N="",ne="",q="",se=F.dir,Z=F.date,ue={crc32:0,compressedSize:0,uncompressedSize:0};p&&!g||(ue.crc32=f.crc32,ue.compressedSize=f.compressedSize,ue.uncompressedSize=f.uncompressedSize);var j=0;p&&(j|=8),E||!I&&!m||(j|=2048);var _=0,fe=0;se&&(_|=16),v==="UNIX"?(fe=798,_|=(function(ie,be){var Re=ie;return ie||(Re=be?16893:33204),(65535&Re)<<16})(F.unixPermissions,se)):(fe=20,_|=(function(ie){return 63&(ie||0)})(F.dosPermissions)),x=Z.getUTCHours(),x<<=6,x|=Z.getUTCMinutes(),x<<=5,x|=Z.getUTCSeconds()/2,P=Z.getUTCFullYear()-1980,P<<=4,P|=Z.getUTCMonth()+1,P<<=5,P|=Z.getUTCDate(),I&&(ne=a(1,1)+a(u(B),4)+T,N+="up"+a(ne.length,2)+ne),m&&(q=a(1,1)+a(u(H),4)+C,N+="uc"+a(q.length,2)+q);var ce="";return ce+=` -\0`,ce+=a(j,2),ce+=R.magic,ce+=a(x,2),ce+=a(P,2),ce+=a(ue.crc32,4),ce+=a(ue.compressedSize,4),ce+=a(ue.uncompressedSize,4),ce+=a(B.length,2),ce+=a(N.length,2),{fileRecord:d.LOCAL_FILE_HEADER+ce+B+N,dirRecord:d.CENTRAL_FILE_HEADER+a(fe,2)+ce+a(H.length,2)+"\0\0\0\0"+a(_,4)+a(y,4)+B+N+H}}var l=t("../utils"),c=t("../stream/GenericWorker"),s=t("../utf8"),u=t("../crc32"),d=t("../signature");function A(f,p,g,y){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=g,this.encodeFileName=y,this.streamFiles=f,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}l.inherits(A,c),A.prototype.push=function(f){var p=f.meta.percent||0,g=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,c.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:g?(p+100*(g-y-1))/g:100}}))},A.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var p=this.streamFiles&&!f.file.dir;if(p){var g=o(f,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},A.prototype.closedSource=function(f){this.accumulate=!1;var p=this.streamFiles&&!f.file.dir,g=o(f,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),p)this.push({data:(function(y){return d.DATA_DESCRIPTOR+a(y.crc32,4)+a(y.compressedSize,4)+a(y.uncompressedSize,4)})(f),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},A.prototype.flush=function(){for(var f=this.bytesWritten,p=0;p=this.index;c--)s=(s<<8)+this.byteAt(c);return this.index+=l,s},readString:function(l){return a.transformTo("string",this.readData(l))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var l=this.readInt(4);return new Date(Date.UTC(1980+(l>>25&127),(l>>21&15)-1,l>>16&31,l>>11&31,l>>5&63,(31&l)<<1))}},n.exports=o},{"../utils":32}],19:[function(t,n,i){"use strict";var a=t("./Uint8ArrayReader");function o(l){a.call(this,l)}t("../utils").inherits(o,a),o.prototype.readData=function(l){this.checkOffset(l);var c=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},n.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,n,i){"use strict";var a=t("./DataReader");function o(l){a.call(this,l)}t("../utils").inherits(o,a),o.prototype.byteAt=function(l){return this.data.charCodeAt(this.zero+l)},o.prototype.lastIndexOfSignature=function(l){return this.data.lastIndexOf(l)-this.zero},o.prototype.readAndCheckSignature=function(l){return l===this.readData(4)},o.prototype.readData=function(l){this.checkOffset(l);var c=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},n.exports=o},{"../utils":32,"./DataReader":18}],21:[function(t,n,i){"use strict";var a=t("./ArrayReader");function o(l){a.call(this,l)}t("../utils").inherits(o,a),o.prototype.readData=function(l){if(this.checkOffset(l),l===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},n.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(t,n,i){"use strict";var a=t("../utils"),o=t("../support"),l=t("./ArrayReader"),c=t("./StringReader"),s=t("./NodeBufferReader"),u=t("./Uint8ArrayReader");n.exports=function(d){var A=a.getTypeOf(d);return a.checkSupport(A),A!=="string"||o.uint8array?A==="nodebuffer"?new s(d):o.uint8array?new u(a.transformTo("uint8array",d)):new l(a.transformTo("array",d)):new c(d)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,n,i){"use strict";i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,n,i){"use strict";var a=t("./GenericWorker"),o=t("../utils");function l(c){a.call(this,"ConvertWorker to "+c),this.destType=c}o.inherits(l,a),l.prototype.processChunk=function(c){this.push({data:o.transformTo(this.destType,c.data),meta:c.meta})},n.exports=l},{"../utils":32,"./GenericWorker":28}],25:[function(t,n,i){"use strict";var a=t("./GenericWorker"),o=t("../crc32");function l(){a.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(l,a),l.prototype.processChunk=function(c){this.streamInfo.crc32=o(c.data,this.streamInfo.crc32||0),this.push(c)},n.exports=l},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,n,i){"use strict";var a=t("../utils"),o=t("./GenericWorker");function l(c){o.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}a.inherits(l,o),l.prototype.processChunk=function(c){if(c){var s=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=s+c.data.length}o.prototype.processChunk.call(this,c)},n.exports=l},{"../utils":32,"./GenericWorker":28}],27:[function(t,n,i){"use strict";var a=t("../utils"),o=t("./GenericWorker");function l(c){o.call(this,"DataWorker");var s=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(u){s.dataIsReady=!0,s.data=u,s.max=u&&u.length||0,s.type=a.getTypeOf(u),s.isPaused||s._tickAndRepeat()},function(u){s.error(u)})}a.inherits(l,o),l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},l.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,a.delay(this._tickAndRepeat,[],this)),!0)},l.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(a.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},l.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,s=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,s);break;case"uint8array":c=this.data.subarray(this.index,s);break;case"array":case"nodebuffer":c=this.data.slice(this.index,s)}return this.index=s,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=l},{"../utils":32,"./GenericWorker":28}],28:[function(t,n,i){"use strict";function a(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}a.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,l){return this._listeners[o].push(l),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,l){if(this._listeners[o])for(var c=0;c "+o:o}},n.exports=a},{}],29:[function(t,n,i){"use strict";var a=t("../utils"),o=t("./ConvertWorker"),l=t("./GenericWorker"),c=t("../base64"),s=t("../support"),u=t("../external"),d=null;if(s.nodestream)try{d=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function A(p,g){return new u.Promise(function(y,v){var b=[],x=p._internalType,P=p._outputType,F=p._mimeType;p.on("data",function(R,E){b.push(R),g&&g(E)}).on("error",function(R){b=[],v(R)}).on("end",function(){try{var R=(function(E,B,T){switch(E){case"blob":return a.newBlob(a.transformTo("arraybuffer",B),T);case"base64":return c.encode(B);default:return a.transformTo(E,B)}})(P,(function(E,B){var T,W=0,H=null,C=0;for(T=0;T"u")i.blob=!1;else{var a=new ArrayBuffer(0);try{i.blob=new Blob([a],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(a),i.blob=o.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!t("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(t,n,i){"use strict";for(var a=t("./utils"),o=t("./support"),l=t("./nodejsUtils"),c=t("./stream/GenericWorker"),s=new Array(256),u=0;u<256;u++)s[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;s[254]=s[254]=1;function d(){c.call(this,"utf-8 decode"),this.leftOver=null}function A(){c.call(this,"utf-8 encode")}i.utf8encode=function(f){return o.nodebuffer?l.newBufferFrom(f,"utf-8"):(function(p){var g,y,v,b,x,P=p.length,F=0;for(b=0;b>>6:(y<65536?g[x++]=224|y>>>12:(g[x++]=240|y>>>18,g[x++]=128|y>>>12&63),g[x++]=128|y>>>6&63),g[x++]=128|63&y);return g})(f)},i.utf8decode=function(f){return o.nodebuffer?a.transformTo("nodebuffer",f).toString("utf-8"):(function(p){var g,y,v,b,x=p.length,P=new Array(2*x);for(g=y=0;g>10&1023,P[y++]=56320|1023&v)}return P.length!==y&&(P.subarray?P=P.subarray(0,y):P.length=y),a.applyFromCharCode(P)})(f=a.transformTo(o.uint8array?"uint8array":"array",f))},a.inherits(d,c),d.prototype.processChunk=function(f){var p=a.transformTo(o.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var g=p;(p=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),p.set(g,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var y=(function(b,x){var P;for((x=x||b.length)>b.length&&(x=b.length),P=x-1;0<=P&&(192&b[P])==128;)P--;return P<0||P===0?x:P+s[b[P]]>x?P:x})(p),v=p;y!==p.length&&(o.uint8array?(v=p.subarray(0,y),this.leftOver=p.subarray(y,p.length)):(v=p.slice(0,y),this.leftOver=p.slice(y,p.length))),this.push({data:i.utf8decode(v),meta:f.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=d,a.inherits(A,c),A.prototype.processChunk=function(f){this.push({data:i.utf8encode(f.data),meta:f.meta})},i.Utf8EncodeWorker=A},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,n,i){"use strict";var a=t("./support"),o=t("./base64"),l=t("./nodejsUtils"),c=t("./external");function s(g){return g}function u(g,y){for(var v=0;v>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=a(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var p,g,y,v=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4>>6:(f<65536?A[y++]=224|f>>>12:(A[y++]=240|f>>>18,A[y++]=128|f>>>12&63),A[y++]=128|f>>>6&63),A[y++]=128|63&f);return A},i.buf2binstring=function(d){return u(d,d.length)},i.binstring2buf=function(d){for(var A=new a.Buf8(d.length),f=0,p=A.length;f>10&1023,b[p++]=56320|1023&g)}return u(b,p)},i.utf8border=function(d,A){var f;for((A=A||d.length)>d.length&&(A=d.length),f=A-1;0<=f&&(192&d[f])==128;)f--;return f<0||f===0?A:f+c[d[f]]>A?f:A}},{"./common":41}],43:[function(t,n,i){"use strict";n.exports=function(a,o,l,c){for(var s=65535&a|0,u=a>>>16&65535|0,d=0;l!==0;){for(l-=d=2e3>>1:o>>>1;l[c]=o}return l})();n.exports=function(o,l,c,s){var u=a,d=s+c;o^=-1;for(var A=s;A>>8^u[255&(o^l[A])];return-1^o}},{}],46:[function(t,n,i){"use strict";var a,o=t("../utils/common"),l=t("./trees"),c=t("./adler32"),s=t("./crc32"),u=t("./messages"),d=0,A=4,f=0,p=-2,g=-1,y=4,v=2,b=8,x=9,P=286,F=30,R=19,E=2*P+1,B=15,T=3,W=258,H=W+T+1,C=42,I=113,m=1,N=2,ne=3,q=4;function se(h,U){return h.msg=u[U],U}function Z(h){return(h<<1)-(4h.avail_out&&(z=h.avail_out),z!==0&&(o.arraySet(h.output,U.pending_buf,U.pending_out,z,h.next_out),h.next_out+=z,U.pending_out+=z,h.total_out+=z,h.avail_out-=z,U.pending-=z,U.pending===0&&(U.pending_out=0))}function _(h,U){l._tr_flush_block(h,0<=h.block_start?h.block_start:-1,h.strstart-h.block_start,U),h.block_start=h.strstart,j(h.strm)}function fe(h,U){h.pending_buf[h.pending++]=U}function ce(h,U){h.pending_buf[h.pending++]=U>>>8&255,h.pending_buf[h.pending++]=255&U}function ie(h,U){var z,k,w=h.max_chain_length,D=h.strstart,K=h.prev_length,Y=h.nice_match,M=h.strstart>h.w_size-H?h.strstart-(h.w_size-H):0,J=h.window,ae=h.w_mask,ee=h.prev,pe=h.strstart+W,Ee=J[D+K-1],ve=J[D+K];h.prev_length>=h.good_match&&(w>>=2),Y>h.lookahead&&(Y=h.lookahead);do if(J[(z=U)+K]===ve&&J[z+K-1]===Ee&&J[z]===J[D]&&J[++z]===J[D+1]){D+=2,z++;do;while(J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&DM&&--w!=0);return K<=h.lookahead?K:h.lookahead}function be(h){var U,z,k,w,D,K,Y,M,J,ae,ee=h.w_size;do{if(w=h.window_size-h.lookahead-h.strstart,h.strstart>=ee+(ee-H)){for(o.arraySet(h.window,h.window,ee,ee,0),h.match_start-=ee,h.strstart-=ee,h.block_start-=ee,U=z=h.hash_size;k=h.head[--U],h.head[U]=ee<=k?k-ee:0,--z;);for(U=z=ee;k=h.prev[--U],h.prev[U]=ee<=k?k-ee:0,--z;);w+=ee}if(h.strm.avail_in===0)break;if(K=h.strm,Y=h.window,M=h.strstart+h.lookahead,J=w,ae=void 0,ae=K.avail_in,J=T)for(D=h.strstart-h.insert,h.ins_h=h.window[D],h.ins_h=(h.ins_h<=T&&(h.ins_h=(h.ins_h<=T)if(k=l._tr_tally(h,h.strstart-h.match_start,h.match_length-T),h.lookahead-=h.match_length,h.match_length<=h.max_lazy_match&&h.lookahead>=T){for(h.match_length--;h.strstart++,h.ins_h=(h.ins_h<=T&&(h.ins_h=(h.ins_h<=T&&h.match_length<=h.prev_length){for(w=h.strstart+h.lookahead-T,k=l._tr_tally(h,h.strstart-1-h.prev_match,h.prev_length-T),h.lookahead-=h.prev_length-1,h.prev_length-=2;++h.strstart<=w&&(h.ins_h=(h.ins_h<h.pending_buf_size-5&&(z=h.pending_buf_size-5);;){if(h.lookahead<=1){if(be(h),h.lookahead===0&&U===d)return m;if(h.lookahead===0)break}h.strstart+=h.lookahead,h.lookahead=0;var k=h.block_start+z;if((h.strstart===0||h.strstart>=k)&&(h.lookahead=h.strstart-k,h.strstart=k,_(h,!1),h.strm.avail_out===0)||h.strstart-h.block_start>=h.w_size-H&&(_(h,!1),h.strm.avail_out===0))return m}return h.insert=0,U===A?(_(h,!0),h.strm.avail_out===0?ne:q):(h.strstart>h.block_start&&(_(h,!1),h.strm.avail_out),m)}),new xe(4,4,8,4,Re),new xe(4,5,16,8,Re),new xe(4,6,32,32,Re),new xe(4,4,16,16,ke),new xe(8,16,32,32,ke),new xe(8,16,128,128,ke),new xe(8,32,128,256,ke),new xe(32,128,258,1024,ke),new xe(32,258,258,4096,ke)],i.deflateInit=function(h,U){return Be(h,U,b,15,8,0)},i.deflateInit2=Be,i.deflateReset=tt,i.deflateResetKeep=we,i.deflateSetHeader=function(h,U){return h&&h.state?h.state.wrap!==2?p:(h.state.gzhead=U,f):p},i.deflate=function(h,U){var z,k,w,D;if(!h||!h.state||5>8&255),fe(k,k.gzhead.time>>16&255),fe(k,k.gzhead.time>>24&255),fe(k,k.level===9?2:2<=k.strategy||k.level<2?4:0),fe(k,255&k.gzhead.os),k.gzhead.extra&&k.gzhead.extra.length&&(fe(k,255&k.gzhead.extra.length),fe(k,k.gzhead.extra.length>>8&255)),k.gzhead.hcrc&&(h.adler=s(h.adler,k.pending_buf,k.pending,0)),k.gzindex=0,k.status=69):(fe(k,0),fe(k,0),fe(k,0),fe(k,0),fe(k,0),fe(k,k.level===9?2:2<=k.strategy||k.level<2?4:0),fe(k,3),k.status=I);else{var K=b+(k.w_bits-8<<4)<<8;K|=(2<=k.strategy||k.level<2?0:k.level<6?1:k.level===6?2:3)<<6,k.strstart!==0&&(K|=32),K+=31-K%31,k.status=I,ce(k,K),k.strstart!==0&&(ce(k,h.adler>>>16),ce(k,65535&h.adler)),h.adler=1}if(k.status===69)if(k.gzhead.extra){for(w=k.pending;k.gzindex<(65535&k.gzhead.extra.length)&&(k.pending!==k.pending_buf_size||(k.gzhead.hcrc&&k.pending>w&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),j(h),w=k.pending,k.pending!==k.pending_buf_size));)fe(k,255&k.gzhead.extra[k.gzindex]),k.gzindex++;k.gzhead.hcrc&&k.pending>w&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),k.gzindex===k.gzhead.extra.length&&(k.gzindex=0,k.status=73)}else k.status=73;if(k.status===73)if(k.gzhead.name){w=k.pending;do{if(k.pending===k.pending_buf_size&&(k.gzhead.hcrc&&k.pending>w&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),j(h),w=k.pending,k.pending===k.pending_buf_size)){D=1;break}D=k.gzindexw&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),D===0&&(k.gzindex=0,k.status=91)}else k.status=91;if(k.status===91)if(k.gzhead.comment){w=k.pending;do{if(k.pending===k.pending_buf_size&&(k.gzhead.hcrc&&k.pending>w&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),j(h),w=k.pending,k.pending===k.pending_buf_size)){D=1;break}D=k.gzindexw&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),D===0&&(k.status=103)}else k.status=103;if(k.status===103&&(k.gzhead.hcrc?(k.pending+2>k.pending_buf_size&&j(h),k.pending+2<=k.pending_buf_size&&(fe(k,255&h.adler),fe(k,h.adler>>8&255),h.adler=0,k.status=I)):k.status=I),k.pending!==0){if(j(h),h.avail_out===0)return k.last_flush=-1,f}else if(h.avail_in===0&&Z(U)<=Z(z)&&U!==A)return se(h,-5);if(k.status===666&&h.avail_in!==0)return se(h,-5);if(h.avail_in!==0||k.lookahead!==0||U!==d&&k.status!==666){var Y=k.strategy===2?(function(M,J){for(var ae;;){if(M.lookahead===0&&(be(M),M.lookahead===0)){if(J===d)return m;break}if(M.match_length=0,ae=l._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++,ae&&(_(M,!1),M.strm.avail_out===0))return m}return M.insert=0,J===A?(_(M,!0),M.strm.avail_out===0?ne:q):M.last_lit&&(_(M,!1),M.strm.avail_out===0)?m:N})(k,U):k.strategy===3?(function(M,J){for(var ae,ee,pe,Ee,ve=M.window;;){if(M.lookahead<=W){if(be(M),M.lookahead<=W&&J===d)return m;if(M.lookahead===0)break}if(M.match_length=0,M.lookahead>=T&&0M.lookahead&&(M.match_length=M.lookahead)}if(M.match_length>=T?(ae=l._tr_tally(M,1,M.match_length-T),M.lookahead-=M.match_length,M.strstart+=M.match_length,M.match_length=0):(ae=l._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++),ae&&(_(M,!1),M.strm.avail_out===0))return m}return M.insert=0,J===A?(_(M,!0),M.strm.avail_out===0?ne:q):M.last_lit&&(_(M,!1),M.strm.avail_out===0)?m:N})(k,U):a[k.level].func(k,U);if(Y!==ne&&Y!==q||(k.status=666),Y===m||Y===ne)return h.avail_out===0&&(k.last_flush=-1),f;if(Y===N&&(U===1?l._tr_align(k):U!==5&&(l._tr_stored_block(k,0,0,!1),U===3&&(ue(k.head),k.lookahead===0&&(k.strstart=0,k.block_start=0,k.insert=0))),j(h),h.avail_out===0))return k.last_flush=-1,f}return U!==A?f:k.wrap<=0?1:(k.wrap===2?(fe(k,255&h.adler),fe(k,h.adler>>8&255),fe(k,h.adler>>16&255),fe(k,h.adler>>24&255),fe(k,255&h.total_in),fe(k,h.total_in>>8&255),fe(k,h.total_in>>16&255),fe(k,h.total_in>>24&255)):(ce(k,h.adler>>>16),ce(k,65535&h.adler)),j(h),0=z.w_size&&(D===0&&(ue(z.head),z.strstart=0,z.block_start=0,z.insert=0),J=new o.Buf8(z.w_size),o.arraySet(J,U,ae-z.w_size,z.w_size,0),U=J,ae=z.w_size),K=h.avail_in,Y=h.next_in,M=h.input,h.avail_in=ae,h.next_in=0,h.input=U,be(z);z.lookahead>=T;){for(k=z.strstart,w=z.lookahead-(T-1);z.ins_h=(z.ins_h<>>=T=B>>>24,x-=T,(T=B>>>16&255)===0)N[u++]=65535&B;else{if(!(16&T)){if((64&T)==0){B=P[(65535&B)+(b&(1<>>=T,x-=T),x<15&&(b+=m[c++]<>>=T=B>>>24,x-=T,!(16&(T=B>>>16&255))){if((64&T)==0){B=F[(65535&B)+(b&(1<>>=T,x-=T,(T=u-d)>3,b&=(1<<(x-=W<<3))-1,a.next_in=c,a.next_out=u,a.avail_in=c>>24&255)+(C>>>8&65280)+((65280&C)<<8)+((255&C)<<24)}function b(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function x(C){var I;return C&&C.state?(I=C.state,C.total_in=C.total_out=I.total=0,C.msg="",I.wrap&&(C.adler=1&I.wrap),I.mode=p,I.last=0,I.havedict=0,I.dmax=32768,I.head=null,I.hold=0,I.bits=0,I.lencode=I.lendyn=new a.Buf32(g),I.distcode=I.distdyn=new a.Buf32(y),I.sane=1,I.back=-1,A):f}function P(C){var I;return C&&C.state?((I=C.state).wsize=0,I.whave=0,I.wnext=0,x(C)):f}function F(C,I){var m,N;return C&&C.state?(N=C.state,I<0?(m=0,I=-I):(m=1+(I>>4),I<48&&(I&=15)),I&&(I<8||15=q.wsize?(a.arraySet(q.window,I,m-q.wsize,q.wsize,0),q.wnext=0,q.whave=q.wsize):(N<(ne=q.wsize-q.wnext)&&(ne=N),a.arraySet(q.window,I,m-N,ne,q.wnext),(N-=ne)?(a.arraySet(q.window,I,m-N,N,0),q.wnext=N,q.whave=q.wsize):(q.wnext+=ne,q.wnext===q.wsize&&(q.wnext=0),q.whave>>8&255,m.check=l(m.check,D,2,0),_=j=0,m.mode=2;break}if(m.flags=0,m.head&&(m.head.done=!1),!(1&m.wrap)||(((255&j)<<8)+(j>>8))%31){C.msg="incorrect header check",m.mode=30;break}if((15&j)!=8){C.msg="unknown compression method",m.mode=30;break}if(_-=4,h=8+(15&(j>>>=4)),m.wbits===0)m.wbits=h;else if(h>m.wbits){C.msg="invalid window size",m.mode=30;break}m.dmax=1<>8&1),512&m.flags&&(D[0]=255&j,D[1]=j>>>8&255,m.check=l(m.check,D,2,0)),_=j=0,m.mode=3;case 3:for(;_<32;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}m.head&&(m.head.time=j),512&m.flags&&(D[0]=255&j,D[1]=j>>>8&255,D[2]=j>>>16&255,D[3]=j>>>24&255,m.check=l(m.check,D,4,0)),_=j=0,m.mode=4;case 4:for(;_<16;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}m.head&&(m.head.xflags=255&j,m.head.os=j>>8),512&m.flags&&(D[0]=255&j,D[1]=j>>>8&255,m.check=l(m.check,D,2,0)),_=j=0,m.mode=5;case 5:if(1024&m.flags){for(;_<16;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}m.length=j,m.head&&(m.head.extra_len=j),512&m.flags&&(D[0]=255&j,D[1]=j>>>8&255,m.check=l(m.check,D,2,0)),_=j=0}else m.head&&(m.head.extra=null);m.mode=6;case 6:if(1024&m.flags&&(Z<(ie=m.length)&&(ie=Z),ie&&(m.head&&(h=m.head.extra_len-m.length,m.head.extra||(m.head.extra=new Array(m.head.extra_len)),a.arraySet(m.head.extra,N,q,ie,h)),512&m.flags&&(m.check=l(m.check,N,ie,q)),Z-=ie,q+=ie,m.length-=ie),m.length))break e;m.length=0,m.mode=7;case 7:if(2048&m.flags){if(Z===0)break e;for(ie=0;h=N[q+ie++],m.head&&h&&m.length<65536&&(m.head.name+=String.fromCharCode(h)),h&&ie>9&1,m.head.done=!0),C.adler=m.check=0,m.mode=12;break;case 10:for(;_<32;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}C.adler=m.check=v(j),_=j=0,m.mode=11;case 11:if(m.havedict===0)return C.next_out=se,C.avail_out=ue,C.next_in=q,C.avail_in=Z,m.hold=j,m.bits=_,2;C.adler=m.check=1,m.mode=12;case 12:if(I===5||I===6)break e;case 13:if(m.last){j>>>=7&_,_-=7&_,m.mode=27;break}for(;_<3;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}switch(m.last=1&j,_-=1,3&(j>>>=1)){case 0:m.mode=14;break;case 1:if(W(m),m.mode=20,I!==6)break;j>>>=2,_-=2;break e;case 2:m.mode=17;break;case 3:C.msg="invalid block type",m.mode=30}j>>>=2,_-=2;break;case 14:for(j>>>=7&_,_-=7&_;_<32;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}if((65535&j)!=(j>>>16^65535)){C.msg="invalid stored block lengths",m.mode=30;break}if(m.length=65535&j,_=j=0,m.mode=15,I===6)break e;case 15:m.mode=16;case 16:if(ie=m.length){if(Z>>=5,_-=5,m.ndist=1+(31&j),j>>>=5,_-=5,m.ncode=4+(15&j),j>>>=4,_-=4,286>>=3,_-=3}for(;m.have<19;)m.lens[K[m.have++]]=0;if(m.lencode=m.lendyn,m.lenbits=7,z={bits:m.lenbits},U=s(0,m.lens,0,19,m.lencode,0,m.work,z),m.lenbits=z.bits,U){C.msg="invalid code lengths set",m.mode=30;break}m.have=0,m.mode=19;case 19:for(;m.have>>16&255,Oe=65535&w,!((ke=w>>>24)<=_);){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}if(Oe<16)j>>>=ke,_-=ke,m.lens[m.have++]=Oe;else{if(Oe===16){for(k=ke+2;_>>=ke,_-=ke,m.have===0){C.msg="invalid bit length repeat",m.mode=30;break}h=m.lens[m.have-1],ie=3+(3&j),j>>>=2,_-=2}else if(Oe===17){for(k=ke+3;_>>=ke)),j>>>=3,_-=3}else{for(k=ke+7;_>>=ke)),j>>>=7,_-=7}if(m.have+ie>m.nlen+m.ndist){C.msg="invalid bit length repeat",m.mode=30;break}for(;ie--;)m.lens[m.have++]=h}}if(m.mode===30)break;if(m.lens[256]===0){C.msg="invalid code -- missing end-of-block",m.mode=30;break}if(m.lenbits=9,z={bits:m.lenbits},U=s(u,m.lens,0,m.nlen,m.lencode,0,m.work,z),m.lenbits=z.bits,U){C.msg="invalid literal/lengths set",m.mode=30;break}if(m.distbits=6,m.distcode=m.distdyn,z={bits:m.distbits},U=s(d,m.lens,m.nlen,m.ndist,m.distcode,0,m.work,z),m.distbits=z.bits,U){C.msg="invalid distances set",m.mode=30;break}if(m.mode=20,I===6)break e;case 20:m.mode=21;case 21:if(6<=Z&&258<=ue){C.next_out=se,C.avail_out=ue,C.next_in=q,C.avail_in=Z,m.hold=j,m.bits=_,c(C,ce),se=C.next_out,ne=C.output,ue=C.avail_out,q=C.next_in,N=C.input,Z=C.avail_in,j=m.hold,_=m.bits,m.mode===12&&(m.back=-1);break}for(m.back=0;xe=(w=m.lencode[j&(1<>>16&255,Oe=65535&w,!((ke=w>>>24)<=_);){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}if(xe&&(240&xe)==0){for(we=ke,tt=xe,Be=Oe;xe=(w=m.lencode[Be+((j&(1<>we)])>>>16&255,Oe=65535&w,!(we+(ke=w>>>24)<=_);){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}j>>>=we,_-=we,m.back+=we}if(j>>>=ke,_-=ke,m.back+=ke,m.length=Oe,xe===0){m.mode=26;break}if(32&xe){m.back=-1,m.mode=12;break}if(64&xe){C.msg="invalid literal/length code",m.mode=30;break}m.extra=15&xe,m.mode=22;case 22:if(m.extra){for(k=m.extra;_>>=m.extra,_-=m.extra,m.back+=m.extra}m.was=m.length,m.mode=23;case 23:for(;xe=(w=m.distcode[j&(1<>>16&255,Oe=65535&w,!((ke=w>>>24)<=_);){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}if((240&xe)==0){for(we=ke,tt=xe,Be=Oe;xe=(w=m.distcode[Be+((j&(1<>we)])>>>16&255,Oe=65535&w,!(we+(ke=w>>>24)<=_);){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}j>>>=we,_-=we,m.back+=we}if(j>>>=ke,_-=ke,m.back+=ke,64&xe){C.msg="invalid distance code",m.mode=30;break}m.offset=Oe,m.extra=15&xe,m.mode=24;case 24:if(m.extra){for(k=m.extra;_>>=m.extra,_-=m.extra,m.back+=m.extra}if(m.offset>m.dmax){C.msg="invalid distance too far back",m.mode=30;break}m.mode=25;case 25:if(ue===0)break e;if(ie=ce-ue,m.offset>ie){if((ie=m.offset-ie)>m.whave&&m.sane){C.msg="invalid distance too far back",m.mode=30;break}be=ie>m.wnext?(ie-=m.wnext,m.wsize-ie):m.wnext-ie,ie>m.length&&(ie=m.length),Re=m.window}else Re=ne,be=se-m.offset,ie=m.length;for(ueE?(T=be[Re+y[I]],_[fe+y[I]]):(T=96,0),b=1<>se)+(x-=b)]=B<<24|T<<16|W|0,x!==0;);for(b=1<>=1;if(b!==0?(j&=b-1,j+=b):j=0,I++,--ce[C]==0){if(C===N)break;C=d[A+y[I]]}if(ne>>7)]}function fe(w,D){w.pending_buf[w.pending++]=255&D,w.pending_buf[w.pending++]=D>>>8&255}function ce(w,D,K){w.bi_valid>v-K?(w.bi_buf|=D<>v-w.bi_valid,w.bi_valid+=K-v):(w.bi_buf|=D<>>=1,K<<=1,0<--D;);return K>>>1}function Re(w,D,K){var Y,M,J=new Array(y+1),ae=0;for(Y=1;Y<=y;Y++)J[Y]=ae=ae+K[Y-1]<<1;for(M=0;M<=D;M++){var ee=w[2*M+1];ee!==0&&(w[2*M]=be(J[ee]++,ee))}}function ke(w){var D;for(D=0;D>1;1<=K;K--)we(w,J,K);for(M=pe;K=w.heap[1],w.heap[1]=w.heap[w.heap_len--],we(w,J,1),Y=w.heap[1],w.heap[--w.heap_max]=K,w.heap[--w.heap_max]=Y,J[2*M]=J[2*K]+J[2*Y],w.depth[M]=(w.depth[K]>=w.depth[Y]?w.depth[K]:w.depth[Y])+1,J[2*K+1]=J[2*Y+1]=M,w.heap[1]=M++,we(w,J,1),2<=w.heap_len;);w.heap[--w.heap_max]=w.heap[1],(function(ve,Ie){var rt,Me,G,oe,me,De,te=Ie.dyn_tree,ge=Ie.max_code,L=Ie.stat_desc.static_tree,ye=Ie.stat_desc.has_stree,Ge=Ie.stat_desc.extra_bits,S=Ie.stat_desc.extra_base,de=Ie.stat_desc.max_length,Ae=0;for(oe=0;oe<=y;oe++)ve.bl_count[oe]=0;for(te[2*ve.heap[ve.heap_max]+1]=0,rt=ve.heap_max+1;rt>=7;M>>=1)if(1&Ee&&ee.dyn_ltree[2*pe]!==0)return o;if(ee.dyn_ltree[18]!==0||ee.dyn_ltree[20]!==0||ee.dyn_ltree[26]!==0)return l;for(pe=32;pe>>3,(J=w.static_len+3+7>>>3)<=M&&(M=J)):M=J=K+5,K+4<=M&&D!==-1?k(w,D,K,Y):w.strategy===4||J===M?(ce(w,2+(Y?1:0),3),tt(w,H,C)):(ce(w,4+(Y?1:0),3),(function(ee,pe,Ee,ve){var Ie;for(ce(ee,pe-257,5),ce(ee,Ee-1,5),ce(ee,ve-4,4),Ie=0;Ie>>8&255,w.pending_buf[w.d_buf+2*w.last_lit+1]=255&D,w.pending_buf[w.l_buf+w.last_lit]=255&K,w.last_lit++,D===0?w.dyn_ltree[2*K]++:(w.matches++,D--,w.dyn_ltree[2*(m[K]+d+1)]++,w.dyn_dtree[2*_(D)]++),w.last_lit===w.lit_bufsize-1},i._tr_align=function(w){ce(w,2,3),ie(w,x,H),(function(D){D.bi_valid===16?(fe(D,D.bi_buf),D.bi_buf=0,D.bi_valid=0):8<=D.bi_valid&&(D.pending_buf[D.pending++]=255&D.bi_buf,D.bi_buf>>=8,D.bi_valid-=8)})(w)}},{"../utils/common":41}],53:[function(t,n,i){"use strict";n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,n,i){(function(a){(function(o,l){"use strict";if(!o.setImmediate){var c,s,u,d,A=1,f={},p=!1,g=o.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(o);y=y&&y.setTimeout?y:o,c={}.toString.call(o.process)==="[object process]"?function(P){process.nextTick(function(){b(P)})}:(function(){if(o.postMessage&&!o.importScripts){var P=!0,F=o.onmessage;return o.onmessage=function(){P=!1},o.postMessage("","*"),o.onmessage=F,P}})()?(d="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",x,!1):o.attachEvent("onmessage",x),function(P){o.postMessage(d+P,"*")}):o.MessageChannel?((u=new MessageChannel).port1.onmessage=function(P){b(P.data)},function(P){u.port2.postMessage(P)}):g&&"onreadystatechange"in g.createElement("script")?(s=g.documentElement,function(P){var F=g.createElement("script");F.onreadystatechange=function(){b(P),F.onreadystatechange=null,s.removeChild(F),F=null},s.appendChild(F)}):function(P){setTimeout(b,0,P)},y.setImmediate=function(P){typeof P!="function"&&(P=new Function(""+P));for(var F=new Array(arguments.length-1),R=0;R"u"?a===void 0?this:a:self)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})}}),cp=Nt({"node_modules/.pnpm/jszip@3.10.1/node_modules/jszip/dist/jszip.min.js"(e,r){(function(t){typeof e=="object"&&typeof r<"u"?r.exports=t():typeof define=="function"&&define.amd?define([],t):(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this).JSZip=t()})(function(){return(function t(n,i,a){function o(s,u){if(!i[s]){if(!n[s]){var d=typeof An=="function"&&An;if(!u&&d)return d(s,!0);if(l)return l(s,!0);var A=new Error("Cannot find module '"+s+"'");throw A.code="MODULE_NOT_FOUND",A}var f=i[s]={exports:{}};n[s][0].call(f.exports,function(p){var g=n[s][1][p];return o(g||p)},f,f.exports,t,n,i,a)}return i[s].exports}for(var l=typeof An=="function"&&An,c=0;c>2,f=(3&s)<<4|u>>4,p=1>6:64,g=2>4,u=(15&A)<<4|(f=l.indexOf(c.charAt(g++)))>>2,d=(3&f)<<6|(p=l.indexOf(c.charAt(g++))),b[y++]=s,f!==64&&(b[y++]=u),p!==64&&(b[y++]=d);return b}},{"./support":30,"./utils":32}],2:[function(t,n,i){"use strict";var a=t("./external"),o=t("./stream/DataWorker"),l=t("./stream/Crc32Probe"),c=t("./stream/DataLengthProbe");function s(u,d,A,f,p){this.compressedSize=u,this.uncompressedSize=d,this.crc32=A,this.compression=f,this.compressedContent=p}s.prototype={getContentWorker:function(){var u=new o(a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),d=this;return u.on("end",function(){if(this.streamInfo.data_length!==d.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new o(a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(u,d,A){return u.pipe(new l).pipe(new c("uncompressedSize")).pipe(d.compressWorker(A)).pipe(new c("compressedSize")).withStreamInfo("compression",d)},n.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,n,i){"use strict";var a=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new a("STORE compression")},uncompressWorker:function(){return new a("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,n,i){"use strict";var a=t("./utils"),o=(function(){for(var l,c=[],s=0;s<256;s++){l=s;for(var u=0;u<8;u++)l=1&l?3988292384^l>>>1:l>>>1;c[s]=l}return c})();n.exports=function(l,c){return l!==void 0&&l.length?a.getTypeOf(l)!=="string"?(function(s,u,d,A){var f=o,p=A+d;s^=-1;for(var g=A;g>>8^f[255&(s^u[g])];return-1^s})(0|c,l,l.length,0):(function(s,u,d,A){var f=o,p=A+d;s^=-1;for(var g=A;g>>8^f[255&(s^u.charCodeAt(g))];return-1^s})(0|c,l,l.length,0):0}},{"./utils":32}],5:[function(t,n,i){"use strict";i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,n,i){"use strict";var a=null;a=typeof Promise<"u"?Promise:t("lie"),n.exports={Promise:a}},{lie:37}],7:[function(t,n,i){"use strict";var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=t("pako"),l=t("./utils"),c=t("./stream/GenericWorker"),s=a?"uint8array":"array";function u(d,A){c.call(this,"FlateWorker/"+d),this._pako=null,this._pakoAction=d,this._pakoOptions=A,this.meta={}}i.magic="\b\0",l.inherits(u,c),u.prototype.processChunk=function(d){this.meta=d.meta,this._pako===null&&this._createPako(),this._pako.push(l.transformTo(s,d.data),!1)},u.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var d=this;this._pako.onData=function(A){d.push({data:A,meta:d.meta})}},i.compressWorker=function(d){return new u("Deflate",d)},i.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,n,i){"use strict";function a(f,p){var g,y="";for(g=0;g>>=8;return y}function o(f,p,g,y,v,b){var x,P,F=f.file,R=f.compression,E=b!==s.utf8encode,B=l.transformTo("string",b(F.name)),T=l.transformTo("string",s.utf8encode(F.name)),W=F.comment,H=l.transformTo("string",b(W)),C=l.transformTo("string",s.utf8encode(W)),I=T.length!==F.name.length,m=C.length!==W.length,N="",ne="",q="",se=F.dir,Z=F.date,ue={crc32:0,compressedSize:0,uncompressedSize:0};p&&!g||(ue.crc32=f.crc32,ue.compressedSize=f.compressedSize,ue.uncompressedSize=f.uncompressedSize);var j=0;p&&(j|=8),E||!I&&!m||(j|=2048);var _=0,fe=0;se&&(_|=16),v==="UNIX"?(fe=798,_|=(function(ie,be){var Re=ie;return ie||(Re=be?16893:33204),(65535&Re)<<16})(F.unixPermissions,se)):(fe=20,_|=(function(ie){return 63&(ie||0)})(F.dosPermissions)),x=Z.getUTCHours(),x<<=6,x|=Z.getUTCMinutes(),x<<=5,x|=Z.getUTCSeconds()/2,P=Z.getUTCFullYear()-1980,P<<=4,P|=Z.getUTCMonth()+1,P<<=5,P|=Z.getUTCDate(),I&&(ne=a(1,1)+a(u(B),4)+T,N+="up"+a(ne.length,2)+ne),m&&(q=a(1,1)+a(u(H),4)+C,N+="uc"+a(q.length,2)+q);var ce="";return ce+=` -\0`,ce+=a(j,2),ce+=R.magic,ce+=a(x,2),ce+=a(P,2),ce+=a(ue.crc32,4),ce+=a(ue.compressedSize,4),ce+=a(ue.uncompressedSize,4),ce+=a(B.length,2),ce+=a(N.length,2),{fileRecord:d.LOCAL_FILE_HEADER+ce+B+N,dirRecord:d.CENTRAL_FILE_HEADER+a(fe,2)+ce+a(H.length,2)+"\0\0\0\0"+a(_,4)+a(y,4)+B+N+H}}var l=t("../utils"),c=t("../stream/GenericWorker"),s=t("../utf8"),u=t("../crc32"),d=t("../signature");function A(f,p,g,y){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=g,this.encodeFileName=y,this.streamFiles=f,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}l.inherits(A,c),A.prototype.push=function(f){var p=f.meta.percent||0,g=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,c.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:g?(p+100*(g-y-1))/g:100}}))},A.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var p=this.streamFiles&&!f.file.dir;if(p){var g=o(f,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},A.prototype.closedSource=function(f){this.accumulate=!1;var p=this.streamFiles&&!f.file.dir,g=o(f,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),p)this.push({data:(function(y){return d.DATA_DESCRIPTOR+a(y.crc32,4)+a(y.compressedSize,4)+a(y.uncompressedSize,4)})(f),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},A.prototype.flush=function(){for(var f=this.bytesWritten,p=0;p=this.index;c--)s=(s<<8)+this.byteAt(c);return this.index+=l,s},readString:function(l){return a.transformTo("string",this.readData(l))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var l=this.readInt(4);return new Date(Date.UTC(1980+(l>>25&127),(l>>21&15)-1,l>>16&31,l>>11&31,l>>5&63,(31&l)<<1))}},n.exports=o},{"../utils":32}],19:[function(t,n,i){"use strict";var a=t("./Uint8ArrayReader");function o(l){a.call(this,l)}t("../utils").inherits(o,a),o.prototype.readData=function(l){this.checkOffset(l);var c=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},n.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,n,i){"use strict";var a=t("./DataReader");function o(l){a.call(this,l)}t("../utils").inherits(o,a),o.prototype.byteAt=function(l){return this.data.charCodeAt(this.zero+l)},o.prototype.lastIndexOfSignature=function(l){return this.data.lastIndexOf(l)-this.zero},o.prototype.readAndCheckSignature=function(l){return l===this.readData(4)},o.prototype.readData=function(l){this.checkOffset(l);var c=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},n.exports=o},{"../utils":32,"./DataReader":18}],21:[function(t,n,i){"use strict";var a=t("./ArrayReader");function o(l){a.call(this,l)}t("../utils").inherits(o,a),o.prototype.readData=function(l){if(this.checkOffset(l),l===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},n.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(t,n,i){"use strict";var a=t("../utils"),o=t("../support"),l=t("./ArrayReader"),c=t("./StringReader"),s=t("./NodeBufferReader"),u=t("./Uint8ArrayReader");n.exports=function(d){var A=a.getTypeOf(d);return a.checkSupport(A),A!=="string"||o.uint8array?A==="nodebuffer"?new s(d):o.uint8array?new u(a.transformTo("uint8array",d)):new l(a.transformTo("array",d)):new c(d)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,n,i){"use strict";i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,n,i){"use strict";var a=t("./GenericWorker"),o=t("../utils");function l(c){a.call(this,"ConvertWorker to "+c),this.destType=c}o.inherits(l,a),l.prototype.processChunk=function(c){this.push({data:o.transformTo(this.destType,c.data),meta:c.meta})},n.exports=l},{"../utils":32,"./GenericWorker":28}],25:[function(t,n,i){"use strict";var a=t("./GenericWorker"),o=t("../crc32");function l(){a.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(l,a),l.prototype.processChunk=function(c){this.streamInfo.crc32=o(c.data,this.streamInfo.crc32||0),this.push(c)},n.exports=l},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,n,i){"use strict";var a=t("../utils"),o=t("./GenericWorker");function l(c){o.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}a.inherits(l,o),l.prototype.processChunk=function(c){if(c){var s=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=s+c.data.length}o.prototype.processChunk.call(this,c)},n.exports=l},{"../utils":32,"./GenericWorker":28}],27:[function(t,n,i){"use strict";var a=t("../utils"),o=t("./GenericWorker");function l(c){o.call(this,"DataWorker");var s=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(u){s.dataIsReady=!0,s.data=u,s.max=u&&u.length||0,s.type=a.getTypeOf(u),s.isPaused||s._tickAndRepeat()},function(u){s.error(u)})}a.inherits(l,o),l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},l.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,a.delay(this._tickAndRepeat,[],this)),!0)},l.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(a.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},l.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,s=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,s);break;case"uint8array":c=this.data.subarray(this.index,s);break;case"array":case"nodebuffer":c=this.data.slice(this.index,s)}return this.index=s,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=l},{"../utils":32,"./GenericWorker":28}],28:[function(t,n,i){"use strict";function a(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}a.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,l){return this._listeners[o].push(l),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,l){if(this._listeners[o])for(var c=0;c "+o:o}},n.exports=a},{}],29:[function(t,n,i){"use strict";var a=t("../utils"),o=t("./ConvertWorker"),l=t("./GenericWorker"),c=t("../base64"),s=t("../support"),u=t("../external"),d=null;if(s.nodestream)try{d=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function A(p,g){return new u.Promise(function(y,v){var b=[],x=p._internalType,P=p._outputType,F=p._mimeType;p.on("data",function(R,E){b.push(R),g&&g(E)}).on("error",function(R){b=[],v(R)}).on("end",function(){try{var R=(function(E,B,T){switch(E){case"blob":return a.newBlob(a.transformTo("arraybuffer",B),T);case"base64":return c.encode(B);default:return a.transformTo(E,B)}})(P,(function(E,B){var T,W=0,H=null,C=0;for(T=0;T"u")i.blob=!1;else{var a=new ArrayBuffer(0);try{i.blob=new Blob([a],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(a),i.blob=o.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!t("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(t,n,i){"use strict";for(var a=t("./utils"),o=t("./support"),l=t("./nodejsUtils"),c=t("./stream/GenericWorker"),s=new Array(256),u=0;u<256;u++)s[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;s[254]=s[254]=1;function d(){c.call(this,"utf-8 decode"),this.leftOver=null}function A(){c.call(this,"utf-8 encode")}i.utf8encode=function(f){return o.nodebuffer?l.newBufferFrom(f,"utf-8"):(function(p){var g,y,v,b,x,P=p.length,F=0;for(b=0;b>>6:(y<65536?g[x++]=224|y>>>12:(g[x++]=240|y>>>18,g[x++]=128|y>>>12&63),g[x++]=128|y>>>6&63),g[x++]=128|63&y);return g})(f)},i.utf8decode=function(f){return o.nodebuffer?a.transformTo("nodebuffer",f).toString("utf-8"):(function(p){var g,y,v,b,x=p.length,P=new Array(2*x);for(g=y=0;g>10&1023,P[y++]=56320|1023&v)}return P.length!==y&&(P.subarray?P=P.subarray(0,y):P.length=y),a.applyFromCharCode(P)})(f=a.transformTo(o.uint8array?"uint8array":"array",f))},a.inherits(d,c),d.prototype.processChunk=function(f){var p=a.transformTo(o.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var g=p;(p=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),p.set(g,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var y=(function(b,x){var P;for((x=x||b.length)>b.length&&(x=b.length),P=x-1;0<=P&&(192&b[P])==128;)P--;return P<0||P===0?x:P+s[b[P]]>x?P:x})(p),v=p;y!==p.length&&(o.uint8array?(v=p.subarray(0,y),this.leftOver=p.subarray(y,p.length)):(v=p.slice(0,y),this.leftOver=p.slice(y,p.length))),this.push({data:i.utf8decode(v),meta:f.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=d,a.inherits(A,c),A.prototype.processChunk=function(f){this.push({data:i.utf8encode(f.data),meta:f.meta})},i.Utf8EncodeWorker=A},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,n,i){"use strict";var a=t("./support"),o=t("./base64"),l=t("./nodejsUtils"),c=t("./external");function s(g){return g}function u(g,y){for(var v=0;v>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=a(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var p,g,y,v=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4>>6:(f<65536?A[y++]=224|f>>>12:(A[y++]=240|f>>>18,A[y++]=128|f>>>12&63),A[y++]=128|f>>>6&63),A[y++]=128|63&f);return A},i.buf2binstring=function(d){return u(d,d.length)},i.binstring2buf=function(d){for(var A=new a.Buf8(d.length),f=0,p=A.length;f>10&1023,b[p++]=56320|1023&g)}return u(b,p)},i.utf8border=function(d,A){var f;for((A=A||d.length)>d.length&&(A=d.length),f=A-1;0<=f&&(192&d[f])==128;)f--;return f<0||f===0?A:f+c[d[f]]>A?f:A}},{"./common":41}],43:[function(t,n,i){"use strict";n.exports=function(a,o,l,c){for(var s=65535&a|0,u=a>>>16&65535|0,d=0;l!==0;){for(l-=d=2e3>>1:o>>>1;l[c]=o}return l})();n.exports=function(o,l,c,s){var u=a,d=s+c;o^=-1;for(var A=s;A>>8^u[255&(o^l[A])];return-1^o}},{}],46:[function(t,n,i){"use strict";var a,o=t("../utils/common"),l=t("./trees"),c=t("./adler32"),s=t("./crc32"),u=t("./messages"),d=0,A=4,f=0,p=-2,g=-1,y=4,v=2,b=8,x=9,P=286,F=30,R=19,E=2*P+1,B=15,T=3,W=258,H=W+T+1,C=42,I=113,m=1,N=2,ne=3,q=4;function se(h,U){return h.msg=u[U],U}function Z(h){return(h<<1)-(4h.avail_out&&(z=h.avail_out),z!==0&&(o.arraySet(h.output,U.pending_buf,U.pending_out,z,h.next_out),h.next_out+=z,U.pending_out+=z,h.total_out+=z,h.avail_out-=z,U.pending-=z,U.pending===0&&(U.pending_out=0))}function _(h,U){l._tr_flush_block(h,0<=h.block_start?h.block_start:-1,h.strstart-h.block_start,U),h.block_start=h.strstart,j(h.strm)}function fe(h,U){h.pending_buf[h.pending++]=U}function ce(h,U){h.pending_buf[h.pending++]=U>>>8&255,h.pending_buf[h.pending++]=255&U}function ie(h,U){var z,k,w=h.max_chain_length,D=h.strstart,K=h.prev_length,Y=h.nice_match,M=h.strstart>h.w_size-H?h.strstart-(h.w_size-H):0,J=h.window,ae=h.w_mask,ee=h.prev,pe=h.strstart+W,Ee=J[D+K-1],ve=J[D+K];h.prev_length>=h.good_match&&(w>>=2),Y>h.lookahead&&(Y=h.lookahead);do if(J[(z=U)+K]===ve&&J[z+K-1]===Ee&&J[z]===J[D]&&J[++z]===J[D+1]){D+=2,z++;do;while(J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&DM&&--w!=0);return K<=h.lookahead?K:h.lookahead}function be(h){var U,z,k,w,D,K,Y,M,J,ae,ee=h.w_size;do{if(w=h.window_size-h.lookahead-h.strstart,h.strstart>=ee+(ee-H)){for(o.arraySet(h.window,h.window,ee,ee,0),h.match_start-=ee,h.strstart-=ee,h.block_start-=ee,U=z=h.hash_size;k=h.head[--U],h.head[U]=ee<=k?k-ee:0,--z;);for(U=z=ee;k=h.prev[--U],h.prev[U]=ee<=k?k-ee:0,--z;);w+=ee}if(h.strm.avail_in===0)break;if(K=h.strm,Y=h.window,M=h.strstart+h.lookahead,J=w,ae=void 0,ae=K.avail_in,J=T)for(D=h.strstart-h.insert,h.ins_h=h.window[D],h.ins_h=(h.ins_h<=T&&(h.ins_h=(h.ins_h<=T)if(k=l._tr_tally(h,h.strstart-h.match_start,h.match_length-T),h.lookahead-=h.match_length,h.match_length<=h.max_lazy_match&&h.lookahead>=T){for(h.match_length--;h.strstart++,h.ins_h=(h.ins_h<=T&&(h.ins_h=(h.ins_h<=T&&h.match_length<=h.prev_length){for(w=h.strstart+h.lookahead-T,k=l._tr_tally(h,h.strstart-1-h.prev_match,h.prev_length-T),h.lookahead-=h.prev_length-1,h.prev_length-=2;++h.strstart<=w&&(h.ins_h=(h.ins_h<h.pending_buf_size-5&&(z=h.pending_buf_size-5);;){if(h.lookahead<=1){if(be(h),h.lookahead===0&&U===d)return m;if(h.lookahead===0)break}h.strstart+=h.lookahead,h.lookahead=0;var k=h.block_start+z;if((h.strstart===0||h.strstart>=k)&&(h.lookahead=h.strstart-k,h.strstart=k,_(h,!1),h.strm.avail_out===0)||h.strstart-h.block_start>=h.w_size-H&&(_(h,!1),h.strm.avail_out===0))return m}return h.insert=0,U===A?(_(h,!0),h.strm.avail_out===0?ne:q):(h.strstart>h.block_start&&(_(h,!1),h.strm.avail_out),m)}),new xe(4,4,8,4,Re),new xe(4,5,16,8,Re),new xe(4,6,32,32,Re),new xe(4,4,16,16,ke),new xe(8,16,32,32,ke),new xe(8,16,128,128,ke),new xe(8,32,128,256,ke),new xe(32,128,258,1024,ke),new xe(32,258,258,4096,ke)],i.deflateInit=function(h,U){return Be(h,U,b,15,8,0)},i.deflateInit2=Be,i.deflateReset=tt,i.deflateResetKeep=we,i.deflateSetHeader=function(h,U){return h&&h.state?h.state.wrap!==2?p:(h.state.gzhead=U,f):p},i.deflate=function(h,U){var z,k,w,D;if(!h||!h.state||5>8&255),fe(k,k.gzhead.time>>16&255),fe(k,k.gzhead.time>>24&255),fe(k,k.level===9?2:2<=k.strategy||k.level<2?4:0),fe(k,255&k.gzhead.os),k.gzhead.extra&&k.gzhead.extra.length&&(fe(k,255&k.gzhead.extra.length),fe(k,k.gzhead.extra.length>>8&255)),k.gzhead.hcrc&&(h.adler=s(h.adler,k.pending_buf,k.pending,0)),k.gzindex=0,k.status=69):(fe(k,0),fe(k,0),fe(k,0),fe(k,0),fe(k,0),fe(k,k.level===9?2:2<=k.strategy||k.level<2?4:0),fe(k,3),k.status=I);else{var K=b+(k.w_bits-8<<4)<<8;K|=(2<=k.strategy||k.level<2?0:k.level<6?1:k.level===6?2:3)<<6,k.strstart!==0&&(K|=32),K+=31-K%31,k.status=I,ce(k,K),k.strstart!==0&&(ce(k,h.adler>>>16),ce(k,65535&h.adler)),h.adler=1}if(k.status===69)if(k.gzhead.extra){for(w=k.pending;k.gzindex<(65535&k.gzhead.extra.length)&&(k.pending!==k.pending_buf_size||(k.gzhead.hcrc&&k.pending>w&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),j(h),w=k.pending,k.pending!==k.pending_buf_size));)fe(k,255&k.gzhead.extra[k.gzindex]),k.gzindex++;k.gzhead.hcrc&&k.pending>w&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),k.gzindex===k.gzhead.extra.length&&(k.gzindex=0,k.status=73)}else k.status=73;if(k.status===73)if(k.gzhead.name){w=k.pending;do{if(k.pending===k.pending_buf_size&&(k.gzhead.hcrc&&k.pending>w&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),j(h),w=k.pending,k.pending===k.pending_buf_size)){D=1;break}D=k.gzindexw&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),D===0&&(k.gzindex=0,k.status=91)}else k.status=91;if(k.status===91)if(k.gzhead.comment){w=k.pending;do{if(k.pending===k.pending_buf_size&&(k.gzhead.hcrc&&k.pending>w&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),j(h),w=k.pending,k.pending===k.pending_buf_size)){D=1;break}D=k.gzindexw&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),D===0&&(k.status=103)}else k.status=103;if(k.status===103&&(k.gzhead.hcrc?(k.pending+2>k.pending_buf_size&&j(h),k.pending+2<=k.pending_buf_size&&(fe(k,255&h.adler),fe(k,h.adler>>8&255),h.adler=0,k.status=I)):k.status=I),k.pending!==0){if(j(h),h.avail_out===0)return k.last_flush=-1,f}else if(h.avail_in===0&&Z(U)<=Z(z)&&U!==A)return se(h,-5);if(k.status===666&&h.avail_in!==0)return se(h,-5);if(h.avail_in!==0||k.lookahead!==0||U!==d&&k.status!==666){var Y=k.strategy===2?(function(M,J){for(var ae;;){if(M.lookahead===0&&(be(M),M.lookahead===0)){if(J===d)return m;break}if(M.match_length=0,ae=l._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++,ae&&(_(M,!1),M.strm.avail_out===0))return m}return M.insert=0,J===A?(_(M,!0),M.strm.avail_out===0?ne:q):M.last_lit&&(_(M,!1),M.strm.avail_out===0)?m:N})(k,U):k.strategy===3?(function(M,J){for(var ae,ee,pe,Ee,ve=M.window;;){if(M.lookahead<=W){if(be(M),M.lookahead<=W&&J===d)return m;if(M.lookahead===0)break}if(M.match_length=0,M.lookahead>=T&&0M.lookahead&&(M.match_length=M.lookahead)}if(M.match_length>=T?(ae=l._tr_tally(M,1,M.match_length-T),M.lookahead-=M.match_length,M.strstart+=M.match_length,M.match_length=0):(ae=l._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++),ae&&(_(M,!1),M.strm.avail_out===0))return m}return M.insert=0,J===A?(_(M,!0),M.strm.avail_out===0?ne:q):M.last_lit&&(_(M,!1),M.strm.avail_out===0)?m:N})(k,U):a[k.level].func(k,U);if(Y!==ne&&Y!==q||(k.status=666),Y===m||Y===ne)return h.avail_out===0&&(k.last_flush=-1),f;if(Y===N&&(U===1?l._tr_align(k):U!==5&&(l._tr_stored_block(k,0,0,!1),U===3&&(ue(k.head),k.lookahead===0&&(k.strstart=0,k.block_start=0,k.insert=0))),j(h),h.avail_out===0))return k.last_flush=-1,f}return U!==A?f:k.wrap<=0?1:(k.wrap===2?(fe(k,255&h.adler),fe(k,h.adler>>8&255),fe(k,h.adler>>16&255),fe(k,h.adler>>24&255),fe(k,255&h.total_in),fe(k,h.total_in>>8&255),fe(k,h.total_in>>16&255),fe(k,h.total_in>>24&255)):(ce(k,h.adler>>>16),ce(k,65535&h.adler)),j(h),0=z.w_size&&(D===0&&(ue(z.head),z.strstart=0,z.block_start=0,z.insert=0),J=new o.Buf8(z.w_size),o.arraySet(J,U,ae-z.w_size,z.w_size,0),U=J,ae=z.w_size),K=h.avail_in,Y=h.next_in,M=h.input,h.avail_in=ae,h.next_in=0,h.input=U,be(z);z.lookahead>=T;){for(k=z.strstart,w=z.lookahead-(T-1);z.ins_h=(z.ins_h<>>=T=B>>>24,x-=T,(T=B>>>16&255)===0)N[u++]=65535&B;else{if(!(16&T)){if((64&T)==0){B=P[(65535&B)+(b&(1<>>=T,x-=T),x<15&&(b+=m[c++]<>>=T=B>>>24,x-=T,!(16&(T=B>>>16&255))){if((64&T)==0){B=F[(65535&B)+(b&(1<>>=T,x-=T,(T=u-d)>3,b&=(1<<(x-=W<<3))-1,a.next_in=c,a.next_out=u,a.avail_in=c>>24&255)+(C>>>8&65280)+((65280&C)<<8)+((255&C)<<24)}function b(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function x(C){var I;return C&&C.state?(I=C.state,C.total_in=C.total_out=I.total=0,C.msg="",I.wrap&&(C.adler=1&I.wrap),I.mode=p,I.last=0,I.havedict=0,I.dmax=32768,I.head=null,I.hold=0,I.bits=0,I.lencode=I.lendyn=new a.Buf32(g),I.distcode=I.distdyn=new a.Buf32(y),I.sane=1,I.back=-1,A):f}function P(C){var I;return C&&C.state?((I=C.state).wsize=0,I.whave=0,I.wnext=0,x(C)):f}function F(C,I){var m,N;return C&&C.state?(N=C.state,I<0?(m=0,I=-I):(m=1+(I>>4),I<48&&(I&=15)),I&&(I<8||15=q.wsize?(a.arraySet(q.window,I,m-q.wsize,q.wsize,0),q.wnext=0,q.whave=q.wsize):(N<(ne=q.wsize-q.wnext)&&(ne=N),a.arraySet(q.window,I,m-N,ne,q.wnext),(N-=ne)?(a.arraySet(q.window,I,m-N,N,0),q.wnext=N,q.whave=q.wsize):(q.wnext+=ne,q.wnext===q.wsize&&(q.wnext=0),q.whave>>8&255,m.check=l(m.check,D,2,0),_=j=0,m.mode=2;break}if(m.flags=0,m.head&&(m.head.done=!1),!(1&m.wrap)||(((255&j)<<8)+(j>>8))%31){C.msg="incorrect header check",m.mode=30;break}if((15&j)!=8){C.msg="unknown compression method",m.mode=30;break}if(_-=4,h=8+(15&(j>>>=4)),m.wbits===0)m.wbits=h;else if(h>m.wbits){C.msg="invalid window size",m.mode=30;break}m.dmax=1<>8&1),512&m.flags&&(D[0]=255&j,D[1]=j>>>8&255,m.check=l(m.check,D,2,0)),_=j=0,m.mode=3;case 3:for(;_<32;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}m.head&&(m.head.time=j),512&m.flags&&(D[0]=255&j,D[1]=j>>>8&255,D[2]=j>>>16&255,D[3]=j>>>24&255,m.check=l(m.check,D,4,0)),_=j=0,m.mode=4;case 4:for(;_<16;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}m.head&&(m.head.xflags=255&j,m.head.os=j>>8),512&m.flags&&(D[0]=255&j,D[1]=j>>>8&255,m.check=l(m.check,D,2,0)),_=j=0,m.mode=5;case 5:if(1024&m.flags){for(;_<16;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}m.length=j,m.head&&(m.head.extra_len=j),512&m.flags&&(D[0]=255&j,D[1]=j>>>8&255,m.check=l(m.check,D,2,0)),_=j=0}else m.head&&(m.head.extra=null);m.mode=6;case 6:if(1024&m.flags&&(Z<(ie=m.length)&&(ie=Z),ie&&(m.head&&(h=m.head.extra_len-m.length,m.head.extra||(m.head.extra=new Array(m.head.extra_len)),a.arraySet(m.head.extra,N,q,ie,h)),512&m.flags&&(m.check=l(m.check,N,ie,q)),Z-=ie,q+=ie,m.length-=ie),m.length))break e;m.length=0,m.mode=7;case 7:if(2048&m.flags){if(Z===0)break e;for(ie=0;h=N[q+ie++],m.head&&h&&m.length<65536&&(m.head.name+=String.fromCharCode(h)),h&&ie>9&1,m.head.done=!0),C.adler=m.check=0,m.mode=12;break;case 10:for(;_<32;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}C.adler=m.check=v(j),_=j=0,m.mode=11;case 11:if(m.havedict===0)return C.next_out=se,C.avail_out=ue,C.next_in=q,C.avail_in=Z,m.hold=j,m.bits=_,2;C.adler=m.check=1,m.mode=12;case 12:if(I===5||I===6)break e;case 13:if(m.last){j>>>=7&_,_-=7&_,m.mode=27;break}for(;_<3;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}switch(m.last=1&j,_-=1,3&(j>>>=1)){case 0:m.mode=14;break;case 1:if(W(m),m.mode=20,I!==6)break;j>>>=2,_-=2;break e;case 2:m.mode=17;break;case 3:C.msg="invalid block type",m.mode=30}j>>>=2,_-=2;break;case 14:for(j>>>=7&_,_-=7&_;_<32;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}if((65535&j)!=(j>>>16^65535)){C.msg="invalid stored block lengths",m.mode=30;break}if(m.length=65535&j,_=j=0,m.mode=15,I===6)break e;case 15:m.mode=16;case 16:if(ie=m.length){if(Z>>=5,_-=5,m.ndist=1+(31&j),j>>>=5,_-=5,m.ncode=4+(15&j),j>>>=4,_-=4,286>>=3,_-=3}for(;m.have<19;)m.lens[K[m.have++]]=0;if(m.lencode=m.lendyn,m.lenbits=7,z={bits:m.lenbits},U=s(0,m.lens,0,19,m.lencode,0,m.work,z),m.lenbits=z.bits,U){C.msg="invalid code lengths set",m.mode=30;break}m.have=0,m.mode=19;case 19:for(;m.have>>16&255,Oe=65535&w,!((ke=w>>>24)<=_);){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}if(Oe<16)j>>>=ke,_-=ke,m.lens[m.have++]=Oe;else{if(Oe===16){for(k=ke+2;_>>=ke,_-=ke,m.have===0){C.msg="invalid bit length repeat",m.mode=30;break}h=m.lens[m.have-1],ie=3+(3&j),j>>>=2,_-=2}else if(Oe===17){for(k=ke+3;_>>=ke)),j>>>=3,_-=3}else{for(k=ke+7;_>>=ke)),j>>>=7,_-=7}if(m.have+ie>m.nlen+m.ndist){C.msg="invalid bit length repeat",m.mode=30;break}for(;ie--;)m.lens[m.have++]=h}}if(m.mode===30)break;if(m.lens[256]===0){C.msg="invalid code -- missing end-of-block",m.mode=30;break}if(m.lenbits=9,z={bits:m.lenbits},U=s(u,m.lens,0,m.nlen,m.lencode,0,m.work,z),m.lenbits=z.bits,U){C.msg="invalid literal/lengths set",m.mode=30;break}if(m.distbits=6,m.distcode=m.distdyn,z={bits:m.distbits},U=s(d,m.lens,m.nlen,m.ndist,m.distcode,0,m.work,z),m.distbits=z.bits,U){C.msg="invalid distances set",m.mode=30;break}if(m.mode=20,I===6)break e;case 20:m.mode=21;case 21:if(6<=Z&&258<=ue){C.next_out=se,C.avail_out=ue,C.next_in=q,C.avail_in=Z,m.hold=j,m.bits=_,c(C,ce),se=C.next_out,ne=C.output,ue=C.avail_out,q=C.next_in,N=C.input,Z=C.avail_in,j=m.hold,_=m.bits,m.mode===12&&(m.back=-1);break}for(m.back=0;xe=(w=m.lencode[j&(1<>>16&255,Oe=65535&w,!((ke=w>>>24)<=_);){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}if(xe&&(240&xe)==0){for(we=ke,tt=xe,Be=Oe;xe=(w=m.lencode[Be+((j&(1<>we)])>>>16&255,Oe=65535&w,!(we+(ke=w>>>24)<=_);){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}j>>>=we,_-=we,m.back+=we}if(j>>>=ke,_-=ke,m.back+=ke,m.length=Oe,xe===0){m.mode=26;break}if(32&xe){m.back=-1,m.mode=12;break}if(64&xe){C.msg="invalid literal/length code",m.mode=30;break}m.extra=15&xe,m.mode=22;case 22:if(m.extra){for(k=m.extra;_>>=m.extra,_-=m.extra,m.back+=m.extra}m.was=m.length,m.mode=23;case 23:for(;xe=(w=m.distcode[j&(1<>>16&255,Oe=65535&w,!((ke=w>>>24)<=_);){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}if((240&xe)==0){for(we=ke,tt=xe,Be=Oe;xe=(w=m.distcode[Be+((j&(1<>we)])>>>16&255,Oe=65535&w,!(we+(ke=w>>>24)<=_);){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}j>>>=we,_-=we,m.back+=we}if(j>>>=ke,_-=ke,m.back+=ke,64&xe){C.msg="invalid distance code",m.mode=30;break}m.offset=Oe,m.extra=15&xe,m.mode=24;case 24:if(m.extra){for(k=m.extra;_>>=m.extra,_-=m.extra,m.back+=m.extra}if(m.offset>m.dmax){C.msg="invalid distance too far back",m.mode=30;break}m.mode=25;case 25:if(ue===0)break e;if(ie=ce-ue,m.offset>ie){if((ie=m.offset-ie)>m.whave&&m.sane){C.msg="invalid distance too far back",m.mode=30;break}be=ie>m.wnext?(ie-=m.wnext,m.wsize-ie):m.wnext-ie,ie>m.length&&(ie=m.length),Re=m.window}else Re=ne,be=se-m.offset,ie=m.length;for(ueE?(T=be[Re+y[I]],_[fe+y[I]]):(T=96,0),b=1<>se)+(x-=b)]=B<<24|T<<16|W|0,x!==0;);for(b=1<>=1;if(b!==0?(j&=b-1,j+=b):j=0,I++,--ce[C]==0){if(C===N)break;C=d[A+y[I]]}if(ne>>7)]}function fe(w,D){w.pending_buf[w.pending++]=255&D,w.pending_buf[w.pending++]=D>>>8&255}function ce(w,D,K){w.bi_valid>v-K?(w.bi_buf|=D<>v-w.bi_valid,w.bi_valid+=K-v):(w.bi_buf|=D<>>=1,K<<=1,0<--D;);return K>>>1}function Re(w,D,K){var Y,M,J=new Array(y+1),ae=0;for(Y=1;Y<=y;Y++)J[Y]=ae=ae+K[Y-1]<<1;for(M=0;M<=D;M++){var ee=w[2*M+1];ee!==0&&(w[2*M]=be(J[ee]++,ee))}}function ke(w){var D;for(D=0;D>1;1<=K;K--)we(w,J,K);for(M=pe;K=w.heap[1],w.heap[1]=w.heap[w.heap_len--],we(w,J,1),Y=w.heap[1],w.heap[--w.heap_max]=K,w.heap[--w.heap_max]=Y,J[2*M]=J[2*K]+J[2*Y],w.depth[M]=(w.depth[K]>=w.depth[Y]?w.depth[K]:w.depth[Y])+1,J[2*K+1]=J[2*Y+1]=M,w.heap[1]=M++,we(w,J,1),2<=w.heap_len;);w.heap[--w.heap_max]=w.heap[1],(function(ve,Ie){var rt,Me,G,oe,me,De,te=Ie.dyn_tree,ge=Ie.max_code,L=Ie.stat_desc.static_tree,ye=Ie.stat_desc.has_stree,Ge=Ie.stat_desc.extra_bits,S=Ie.stat_desc.extra_base,de=Ie.stat_desc.max_length,Ae=0;for(oe=0;oe<=y;oe++)ve.bl_count[oe]=0;for(te[2*ve.heap[ve.heap_max]+1]=0,rt=ve.heap_max+1;rt>=7;M>>=1)if(1&Ee&&ee.dyn_ltree[2*pe]!==0)return o;if(ee.dyn_ltree[18]!==0||ee.dyn_ltree[20]!==0||ee.dyn_ltree[26]!==0)return l;for(pe=32;pe>>3,(J=w.static_len+3+7>>>3)<=M&&(M=J)):M=J=K+5,K+4<=M&&D!==-1?k(w,D,K,Y):w.strategy===4||J===M?(ce(w,2+(Y?1:0),3),tt(w,H,C)):(ce(w,4+(Y?1:0),3),(function(ee,pe,Ee,ve){var Ie;for(ce(ee,pe-257,5),ce(ee,Ee-1,5),ce(ee,ve-4,4),Ie=0;Ie>>8&255,w.pending_buf[w.d_buf+2*w.last_lit+1]=255&D,w.pending_buf[w.l_buf+w.last_lit]=255&K,w.last_lit++,D===0?w.dyn_ltree[2*K]++:(w.matches++,D--,w.dyn_ltree[2*(m[K]+d+1)]++,w.dyn_dtree[2*_(D)]++),w.last_lit===w.lit_bufsize-1},i._tr_align=function(w){ce(w,2,3),ie(w,x,H),(function(D){D.bi_valid===16?(fe(D,D.bi_buf),D.bi_buf=0,D.bi_valid=0):8<=D.bi_valid&&(D.pending_buf[D.pending++]=255&D.bi_buf,D.bi_buf>>=8,D.bi_valid-=8)})(w)}},{"../utils/common":41}],53:[function(t,n,i){"use strict";n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,n,i){(function(a){(function(o,l){"use strict";if(!o.setImmediate){var c,s,u,d,A=1,f={},p=!1,g=o.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(o);y=y&&y.setTimeout?y:o,c={}.toString.call(o.process)==="[object process]"?function(P){process.nextTick(function(){b(P)})}:(function(){if(o.postMessage&&!o.importScripts){var P=!0,F=o.onmessage;return o.onmessage=function(){P=!1},o.postMessage("","*"),o.onmessage=F,P}})()?(d="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",x,!1):o.attachEvent("onmessage",x),function(P){o.postMessage(d+P,"*")}):o.MessageChannel?((u=new MessageChannel).port1.onmessage=function(P){b(P.data)},function(P){u.port2.postMessage(P)}):g&&"onreadystatechange"in g.createElement("script")?(s=g.documentElement,function(P){var F=g.createElement("script");F.onreadystatechange=function(){b(P),F.onreadystatechange=null,s.removeChild(F),F=null},s.appendChild(F)}):function(P){setTimeout(b,0,P)},y.setImmediate=function(P){typeof P!="function"&&(P=new Function(""+P));for(var F=new Array(arguments.length-1),R=0;R"u"?a===void 0?this:a:self)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})}}),Mu=Nt({"(disabled):node:fs"(){}}),up=Nt({"(disabled):node:https"(){}}),Ls=function(e,r){return Ls=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},Ls(e,r)};function Te(e,r){Ls(e,r);function t(){this.constructor=e}e.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}var Je=function(){return Je=Object.assign||function(r){for(var t,n=1,i=arguments.length;n0&&a[a.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]>2],r+=ii[(e[n]&3)<<4|e[n+1]>>4],r+=ii[(e[n+1]&15)<<2|e[n+2]>>6],r+=ii[e[n+2]&63];return t%3===2?r=r.substring(0,r.length-1)+"=":t%3===1&&(r=r.substring(0,r.length-2)+"=="),r},qc=function(e){var r=e.length*.75,t=e.length,n,i=0,a,o,l,c;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);var s=new Uint8Array(r);for(n=0;n>4,s[i++]=(o&15)<<4|l>>2,s[i++]=(l&3)<<6|c&63;return s},hp=/^(data)?:?([\w\/\+]+)?;?(charset=[\w-]+|base64)?.*,/i,pp=function(e){var r=e.trim(),t=r.substring(0,100),n=t.match(hp);if(!n)return qc(r);var i=n[0],a=r.substring(i.length);return qc(a)},Ye=function(e){return e.charCodeAt(0)},Ap=function(e){return e.codePointAt(0)},na=function(e,r){return Br(e.toString(16),r,"0").toUpperCase()},wo=function(e){return na(e,2)},Xr=function(e){return String.fromCharCode(e)},gp=function(e){return Xr(parseInt(e,16))},Br=function(e,r,t){for(var n="",i=0,a=r-e.length;i=55296&&t<=56319&&e.length>i&&(n=e.charCodeAt(i),n>=56320&&n<=57343&&(a=2)),[e.slice(r,r+a),a]},yp=function(e){for(var r=[],t=0,n=e.length;tt&&s(),o+=A,l+=f}}return s(),c},xp=/^D:(\d\d\d\d)(\d\d)?(\d\d)?(\d\d)?(\d\d)?(\d\d)?([+\-Z])?(\d\d)?'?(\d\d)?'?$/,Gu=function(e){var r=e.match(xp);if(r){var t=r[1],n=r[2],i=n===void 0?"01":n,a=r[3],o=a===void 0?"01":a,l=r[4],c=l===void 0?"00":l,s=r[5],u=s===void 0?"00":s,d=r[6],A=d===void 0?"00":d,f=r[7],p=f===void 0?"Z":f,g=r[8],y=g===void 0?"00":g,v=r[9],b=v===void 0?"00":v,x=p==="Z"?"Z":""+p+y+":"+b,P=new Date(t+"-"+i+"-"+o+"T"+c+":"+u+":"+A+x);return P}},rl=function(e,r){for(var t,n=0,i;n=0&&e<=65535},Lp=function(e){return e>=65536&&e<=1114111},qu=function(e){return Math.floor((e-65536)/1024)+55296},Vu=function(e){return(e-65536)%1024+56320},mn;(function(e){e.BigEndian="BigEndian",e.LittleEndian="LittleEndian"})(mn||(mn={}));var Bi="\uFFFD".codePointAt(0),Xu=function(e,r){if(r===void 0&&(r=!0),e.length<=1)return String.fromCodePoint(Bi);for(var t=r?Ip(e):mn.BigEndian,n=r?2:0,i=[];e.length-n>=2;){var a=Xc(e[n++],e[n++],t);if(Np(a))if(e.length-n<2)i.push(Bi);else{var o=Xc(e[n++],e[n++],t);Vc(o)?i.push(a,o):i.push(Bi)}else Vc(a)?(n+=2,i.push(Bi)):i.push(a)}return n=55296&&e<=56319},Vc=function(e){return e>=56320&&e<=57343},Xc=function(e,r,t){if(t===mn.LittleEndian)return r<<8|e;if(t===mn.BigEndian)return e<<8|r;throw new Error("Invalid byteOrder: "+t)},Ip=function(e){return Hu(e)?mn.BigEndian:Ku(e)?mn.LittleEndian:mn.BigEndian},Hu=function(e){return e[0]===254&&e[1]===255},Ku=function(e){return e[0]===255&&e[1]===254},Qu=function(e){return Hu(e)||Ku(e)},zp=function(e){var r=String(e);if(Math.abs(e)<1){var t=parseInt(e.toString().split("e-")[1]);if(t){var n=e<0;n&&(e*=-1),e*=Math.pow(10,t-1),r="0."+new Array(t).join("0")+e.toString().substring(2),n&&(r="-"+r)}}else{var t=parseInt(e.toString().split("+")[1]);t>20&&(t-=20,e/=Math.pow(10,t),r=e.toString()+new Array(t+1).join("0"))}return r},Ka=function(e){return Math.ceil(e.toString(2).length/8)},Jn=function(e){for(var r=new Uint8Array(Ka(e)),t=1;t<=r.length;t++)r[t-1]=e>>(r.length-t)*8;return r},aa=function(e){throw new Error(e)},Mp=Qr(bo()),Hc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Mi=new Uint8Array(256);for(Rr=0;Rr>4,s[i++]=(o&15)<<4|l>>2,s[i++]=(l&3)<<6|c&63;return s},_p=function(e){for(var r="",t=0;tn)throw new Error(zt(r)+" must be at least "+t+" and at most "+n+", but was actually "+e)},Dr=function(e,r,t,n){le(e,r,["number","undefined"]),typeof e=="number"&&cr(e,r,t,n)},Ju=function(e,r,t){if(le(e,r,["number"]),e%t!==0)throw new Error(zt(r)+" must be a multiple of "+t+", but was actually "+e)},fA=function(e,r){if(!Number.isInteger(e))throw new Error(zt(r)+" must be an integer, but was actually "+e)},So=function(e,r){if(![1,0].includes(Math.sign(e)))throw new Error(zt(r)+" must be a positive number or 0, but was actually "+e)},$e=new Uint16Array(256);for(Ot=0;Ot<256;Ot++)$e[Ot]=Ot;var Ot;$e[22]=Ye("");$e[24]=Ye("\u02D8");$e[25]=Ye("\u02C7");$e[26]=Ye("\u02C6");$e[27]=Ye("\u02D9");$e[28]=Ye("\u02DD");$e[29]=Ye("\u02DB");$e[30]=Ye("\u02DA");$e[31]=Ye("\u02DC");$e[127]=Ye("\uFFFD");$e[128]=Ye("\u2022");$e[129]=Ye("\u2020");$e[130]=Ye("\u2021");$e[131]=Ye("\u2026");$e[132]=Ye("\u2014");$e[133]=Ye("\u2013");$e[134]=Ye("\u0192");$e[135]=Ye("\u2044");$e[136]=Ye("\u2039");$e[137]=Ye("\u203A");$e[138]=Ye("\u2212");$e[139]=Ye("\u2030");$e[140]=Ye("\u201E");$e[141]=Ye("\u201C");$e[142]=Ye("\u201D");$e[143]=Ye("\u2018");$e[144]=Ye("\u2019");$e[145]=Ye("\u201A");$e[146]=Ye("\u2122");$e[147]=Ye("\uFB01");$e[148]=Ye("\uFB02");$e[149]=Ye("\u0141");$e[150]=Ye("\u0152");$e[151]=Ye("\u0160");$e[152]=Ye("\u0178");$e[153]=Ye("\u017D");$e[154]=Ye("\u0131");$e[155]=Ye("\u0142");$e[156]=Ye("\u0153");$e[157]=Ye("\u0161");$e[158]=Ye("\u017E");$e[159]=Ye("\uFFFD");$e[160]=Ye("\u20AC");$e[173]=Ye("\uFFFD");var $u=function(e){for(var r=new Array(e.length),t=0,n=e.length;t=Q.ExclamationPoint&&e<=Q.Tilde&&!ol[e]},eu={},tu=new Map,OA=(function(e){Te(r,e);function r(t,n){var i=this;if(t!==eu)throw new nl("PDFName");i=e.call(this)||this;for(var a="/",o=0,l=n.length;o=Q.Zero&&s<=Q.Nine||s>=Q.a&&s<=Q.f||s>=Q.A&&s<=Q.F?(n+=c,(n.length===2||!(u>="0"&&u<="9"||u>="a"&&u<="f"||u>="A"&&u<="F"))&&(a(parseInt(n,16)),n="")):a(s):s===Q.Hash?i=!0:a(s)}return new Uint8Array(t)},r.prototype.decodeText=function(){var t=this.asBytes();return String.fromCharCode.apply(String,Array.from(t))},r.prototype.asString=function(){return this.encodedName},r.prototype.value=function(){return this.encodedName},r.prototype.clone=function(){return this},r.prototype.toString=function(){return this.encodedName},r.prototype.sizeInBytes=function(){return this.encodedName.length},r.prototype.copyBytesInto=function(t,n){return n+=Vt(this.encodedName,t,n),this.encodedName.length},r.of=function(t){var n=zA(t),i=tu.get(n);return i||(i=new r(eu,n),tu.set(n,i)),i},r.Length=r.of("Length"),r.FlateDecode=r.of("FlateDecode"),r.Resources=r.of("Resources"),r.Font=r.of("Font"),r.XObject=r.of("XObject"),r.ExtGState=r.of("ExtGState"),r.Contents=r.of("Contents"),r.Type=r.of("Type"),r.Parent=r.of("Parent"),r.MediaBox=r.of("MediaBox"),r.Page=r.of("Page"),r.Annots=r.of("Annots"),r.TrimBox=r.of("TrimBox"),r.ArtBox=r.of("ArtBox"),r.BleedBox=r.of("BleedBox"),r.CropBox=r.of("CropBox"),r.Rotate=r.of("Rotate"),r.Title=r.of("Title"),r.Author=r.of("Author"),r.Subject=r.of("Subject"),r.Creator=r.of("Creator"),r.Keywords=r.of("Keywords"),r.Producer=r.of("Producer"),r.CreationDate=r.of("CreationDate"),r.ModDate=r.of("ModDate"),r})($t),X=OA,_A=(function(e){Te(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.prototype.asNull=function(){return null},r.prototype.clone=function(){return this},r.prototype.toString=function(){return"null"},r.prototype.sizeInBytes=function(){return 4},r.prototype.copyBytesInto=function(t,n){return t[n++]=Q.n,t[n++]=Q.u,t[n++]=Q.l,t[n++]=Q.l,4},r})($t),rr=new _A,UA=(function(e){Te(r,e);function r(t,n){var i=e.call(this)||this;return i.dict=t,i.context=n,i}return r.prototype.keys=function(){return Array.from(this.dict.keys())},r.prototype.values=function(){return Array.from(this.dict.values())},r.prototype.entries=function(){return Array.from(this.dict.entries())},r.prototype.set=function(t,n){this.dict.set(t,n)},r.prototype.get=function(t,n){n===void 0&&(n=!1);var i=this.dict.get(t);if(!(i===rr&&!n))return i},r.prototype.has=function(t){var n=this.dict.get(t);return n!==void 0&&n!==rr},r.prototype.lookupMaybe=function(t){for(var n,i=[],a=1;a`}function ws(e){return e?.html?Nr(e.html):$h(e)}var ep=Object.create,Eu=Object.defineProperty,tp=Object.getOwnPropertyDescriptor,Bu=Object.getOwnPropertyNames,rp=Object.getPrototypeOf,np=Object.prototype.hasOwnProperty,An=(e=>typeof Dn<"u"?Dn:typeof Proxy<"u"?new Proxy(e,{get:(r,t)=>(typeof Dn<"u"?Dn:r)[t]}):e)(function(e){if(typeof Dn<"u")return Dn.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),Lt=(e,r)=>function(){return r||(0,e[Bu(e)[0]])((r={exports:{}}).exports,r),r.exports},ip=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Bu(r))!np.call(e,i)&&i!==t&&Eu(e,i,{get:()=>r[i],enumerable:!(n=tp(r,i))||n.enumerable});return e},Qr=(e,r,t)=>(t=e!=null?ep(rp(e)):{},ip(r||!e||!e.__esModule?Eu(t,"default",{value:e,enumerable:!0}):t,e)),Sn=Lt({"../../../node_modules/pako/lib/utils/common.js"(e){"use strict";var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function t(a,o){return Object.prototype.hasOwnProperty.call(a,o)}e.assign=function(a){for(var o=Array.prototype.slice.call(arguments,1);o.length;){var l=o.shift();if(l){if(typeof l!="object")throw new TypeError(l+"must be non-object");for(var c in l)t(l,c)&&(a[c]=l[c])}}return a},e.shrinkBuf=function(a,o){return a.length===o?a:a.subarray?a.subarray(0,o):(a.length=o,a)};var n={arraySet:function(a,o,l,c,s){if(o.subarray&&a.subarray){a.set(o.subarray(l,l+c),s);return}for(var u=0;u=0;)G[oe]=0}var l=0,c=1,s=2,u=3,d=258,A=29,f=256,p=f+1+A,g=30,y=19,v=2*p+1,b=15,x=16,P=7,F=256,R=16,E=17,B=18,T=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],W=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],H=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],C=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],I=512,m=new Array((p+2)*2);o(m);var N=new Array(g*2);o(N);var ne=new Array(I);o(ne);var q=new Array(d-u+1);o(q);var se=new Array(A);o(se);var Z=new Array(g);o(Z);function ue(G,oe,me,De,te){this.static_tree=G,this.extra_bits=oe,this.extra_base=me,this.elems=De,this.max_length=te,this.has_stree=G&&G.length}var j,_,fe;function ce(G,oe){this.dyn_tree=G,this.max_code=0,this.stat_desc=oe}function ie(G){return G<256?ne[G]:ne[256+(G>>>7)]}function be(G,oe){G.pending_buf[G.pending++]=oe&255,G.pending_buf[G.pending++]=oe>>>8&255}function Re(G,oe,me){G.bi_valid>x-me?(G.bi_buf|=oe<>x-G.bi_valid,G.bi_valid+=me-x):(G.bi_buf|=oe<>>=1,me<<=1;while(--oe>0);return me>>>1}function Oe(G){G.bi_valid===16?(be(G,G.bi_buf),G.bi_buf=0,G.bi_valid=0):G.bi_valid>=8&&(G.pending_buf[G.pending++]=G.bi_buf&255,G.bi_buf>>=8,G.bi_valid-=8)}function we(G,oe){var me=oe.dyn_tree,De=oe.max_code,te=oe.stat_desc.static_tree,ge=oe.stat_desc.has_stree,L=oe.stat_desc.extra_bits,ye=oe.stat_desc.extra_base,Ge=oe.stat_desc.max_length,S,de,Ae,O,re,he,_e=0;for(O=0;O<=b;O++)G.bl_count[O]=0;for(me[G.heap[G.heap_max]*2+1]=0,S=G.heap_max+1;SGe&&(O=Ge,_e++),me[de*2+1]=O,!(de>De)&&(G.bl_count[O]++,re=0,de>=ye&&(re=L[de-ye]),he=me[de*2],G.opt_len+=he*(O+re),ge&&(G.static_len+=he*(te[de*2+1]+re)));if(_e!==0){do{for(O=Ge-1;G.bl_count[O]===0;)O--;G.bl_count[O]--,G.bl_count[O+1]+=2,G.bl_count[Ge]--,_e-=2}while(_e>0);for(O=Ge;O!==0;O--)for(de=G.bl_count[O];de!==0;)Ae=G.heap[--S],!(Ae>De)&&(me[Ae*2+1]!==O&&(G.opt_len+=(O-me[Ae*2+1])*me[Ae*2],me[Ae*2+1]=O),de--)}}function tt(G,oe,me){var De=new Array(b+1),te=0,ge,L;for(ge=1;ge<=b;ge++)De[ge]=te=te+me[ge-1]<<1;for(L=0;L<=oe;L++){var ye=G[L*2+1];ye!==0&&(G[L*2]=xe(De[ye]++,ye))}}function Be(){var G,oe,me,De,te,ge=new Array(b+1);for(me=0,De=0;De>=7;De8?be(G,G.bi_buf):G.bi_valid>0&&(G.pending_buf[G.pending++]=G.bi_buf),G.bi_buf=0,G.bi_valid=0}function z(G,oe,me,De){U(G),De&&(be(G,me),be(G,~me)),r.arraySet(G.pending_buf,G.window,oe,me,G.pending),G.pending+=me}function k(G,oe,me,De){var te=oe*2,ge=me*2;return G[te]>1;L>=1;L--)w(G,me,L);S=ge;do L=G.heap[1],G.heap[1]=G.heap[G.heap_len--],w(G,me,1),ye=G.heap[1],G.heap[--G.heap_max]=L,G.heap[--G.heap_max]=ye,me[S*2]=me[L*2]+me[ye*2],G.depth[S]=(G.depth[L]>=G.depth[ye]?G.depth[L]:G.depth[ye])+1,me[L*2+1]=me[ye*2+1]=S,G.heap[1]=S++,w(G,me,1);while(G.heap_len>=2);G.heap[--G.heap_max]=G.heap[1],we(G,oe),tt(me,Ge,G.bl_count)}function Y(G,oe,me){var De,te=-1,ge,L=oe[1],ye=0,Ge=7,S=4;for(L===0&&(Ge=138,S=3),oe[(me+1)*2+1]=65535,De=0;De<=me;De++)ge=L,L=oe[(De+1)*2+1],!(++ye=3&&G.bl_tree[C[oe]*2+1]===0;oe--);return G.opt_len+=3*(oe+1)+5+5+4,oe}function ae(G,oe,me,De){var te;for(Re(G,oe-257,5),Re(G,me-1,5),Re(G,De-4,4),te=0;te>>=1)if(oe&1&&G.dyn_ltree[me*2]!==0)return n;if(G.dyn_ltree[18]!==0||G.dyn_ltree[20]!==0||G.dyn_ltree[26]!==0)return i;for(me=32;me0?(G.strm.data_type===a&&(G.strm.data_type=ee(G)),K(G,G.l_desc),K(G,G.d_desc),L=J(G),te=G.opt_len+3+7>>>3,ge=G.static_len+3+7>>>3,ge<=te&&(te=ge)):te=ge=me+5,me+4<=te&&oe!==-1?ve(G,oe,me,De):G.strategy===t||ge===te?(Re(G,(c<<1)+(De?1:0),3),D(G,m,N)):(Re(G,(s<<1)+(De?1:0),3),ae(G,G.l_desc.max_code+1,G.d_desc.max_code+1,L+1),D(G,G.dyn_ltree,G.dyn_dtree)),h(G),De&&U(G)}function Me(G,oe,me){return G.pending_buf[G.d_buf+G.last_lit*2]=oe>>>8&255,G.pending_buf[G.d_buf+G.last_lit*2+1]=oe&255,G.pending_buf[G.l_buf+G.last_lit]=me&255,G.last_lit++,oe===0?G.dyn_ltree[me*2]++:(G.matches++,oe--,G.dyn_ltree[(q[me]+f+1)*2]++,G.dyn_dtree[ie(oe)*2]++),G.last_lit===G.lit_bufsize-1}e._tr_init=Ee,e._tr_stored_block=ve,e._tr_flush_block=rt,e._tr_tally=Me,e._tr_align=Ie}}),Ru=Lt({"../../../node_modules/pako/lib/zlib/adler32.js"(e,r){"use strict";function t(n,i,a,o){for(var l=n&65535|0,c=n>>>16&65535|0,s=0;a!==0;){s=a>2e3?2e3:a,a-=s;do l=l+i[o++]|0,c=c+l|0;while(--s);l%=65521,c%=65521}return l|c<<16|0}r.exports=t}}),Lu=Lt({"../../../node_modules/pako/lib/zlib/crc32.js"(e,r){"use strict";function t(){for(var a,o=[],l=0;l<256;l++){a=l;for(var c=0;c<8;c++)a=a&1?3988292384^a>>>1:a>>>1;o[l]=a}return o}var n=t();function i(a,o,l,c){var s=n,u=c+l;a^=-1;for(var d=c;d>>8^s[(a^o[d])&255];return a^-1}r.exports=i}}),rl=Lt({"../../../node_modules/pako/lib/zlib/messages.js"(e,r){"use strict";r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}}}),op=Lt({"../../../node_modules/pako/lib/zlib/deflate.js"(e){"use strict";var r=Sn(),t=ap(),n=Ru(),i=Lu(),a=rl(),o=0,l=1,c=3,s=4,u=5,d=0,A=1,f=-2,p=-3,g=-5,y=-1,v=1,b=2,x=3,P=4,F=0,R=2,E=8,B=9,T=15,W=8,H=29,C=256,I=C+1+H,m=30,N=19,ne=2*I+1,q=15,se=3,Z=258,ue=Z+se+1,j=32,_=42,fe=69,ce=73,ie=91,be=103,Re=113,ke=666,xe=1,Oe=2,we=3,tt=4,Be=3;function h(S,de){return S.msg=a[de],de}function U(S){return(S<<1)-(S>4?9:0)}function z(S){for(var de=S.length;--de>=0;)S[de]=0}function k(S){var de=S.state,Ae=de.pending;Ae>S.avail_out&&(Ae=S.avail_out),Ae!==0&&(r.arraySet(S.output,de.pending_buf,de.pending_out,Ae,S.next_out),S.next_out+=Ae,de.pending_out+=Ae,S.total_out+=Ae,S.avail_out-=Ae,de.pending-=Ae,de.pending===0&&(de.pending_out=0))}function w(S,de){t._tr_flush_block(S,S.block_start>=0?S.block_start:-1,S.strstart-S.block_start,de),S.block_start=S.strstart,k(S.strm)}function D(S,de){S.pending_buf[S.pending++]=de}function K(S,de){S.pending_buf[S.pending++]=de>>>8&255,S.pending_buf[S.pending++]=de&255}function Y(S,de,Ae,O){var re=S.avail_in;return re>O&&(re=O),re===0?0:(S.avail_in-=re,r.arraySet(de,S.input,S.next_in,re,Ae),S.state.wrap===1?S.adler=n(S.adler,de,re,Ae):S.state.wrap===2&&(S.adler=i(S.adler,de,re,Ae)),S.next_in+=re,S.total_in+=re,re)}function M(S,de){var Ae=S.max_chain_length,O=S.strstart,re,he,_e=S.prev_length,Ne=S.nice_match,ze=S.strstart>S.w_size-ue?S.strstart-(S.w_size-ue):0,At=S.window,Or=S.w_mask,Dt=S.prev,gt=S.strstart+Z,Nt=At[O+_e-1],Ht=At[O+_e];S.prev_length>=S.good_match&&(Ae>>=2),Ne>S.lookahead&&(Ne=S.lookahead);do if(re=de,!(At[re+_e]!==Ht||At[re+_e-1]!==Nt||At[re]!==At[O]||At[++re]!==At[O+1])){O+=2,re++;do;while(At[++O]===At[++re]&&At[++O]===At[++re]&&At[++O]===At[++re]&&At[++O]===At[++re]&&At[++O]===At[++re]&&At[++O]===At[++re]&&At[++O]===At[++re]&&At[++O]===At[++re]&&O_e){if(S.match_start=de,_e=he,he>=Ne)break;Nt=At[O+_e-1],Ht=At[O+_e]}}while((de=Dt[de&Or])>ze&&--Ae!==0);return _e<=S.lookahead?_e:S.lookahead}function J(S){var de=S.w_size,Ae,O,re,he,_e;do{if(he=S.window_size-S.lookahead-S.strstart,S.strstart>=de+(de-ue)){r.arraySet(S.window,S.window,de,de,0),S.match_start-=de,S.strstart-=de,S.block_start-=de,O=S.hash_size,Ae=O;do re=S.head[--Ae],S.head[Ae]=re>=de?re-de:0;while(--O);O=de,Ae=O;do re=S.prev[--Ae],S.prev[Ae]=re>=de?re-de:0;while(--O);he+=de}if(S.strm.avail_in===0)break;if(O=Y(S.strm,S.window,S.strstart+S.lookahead,he),S.lookahead+=O,S.lookahead+S.insert>=se)for(_e=S.strstart-S.insert,S.ins_h=S.window[_e],S.ins_h=(S.ins_h<S.pending_buf_size-5&&(Ae=S.pending_buf_size-5);;){if(S.lookahead<=1){if(J(S),S.lookahead===0&&de===o)return xe;if(S.lookahead===0)break}S.strstart+=S.lookahead,S.lookahead=0;var O=S.block_start+Ae;if((S.strstart===0||S.strstart>=O)&&(S.lookahead=S.strstart-O,S.strstart=O,w(S,!1),S.strm.avail_out===0)||S.strstart-S.block_start>=S.w_size-ue&&(w(S,!1),S.strm.avail_out===0))return xe}return S.insert=0,de===s?(w(S,!0),S.strm.avail_out===0?we:tt):(S.strstart>S.block_start&&(w(S,!1),S.strm.avail_out===0),xe)}function ee(S,de){for(var Ae,O;;){if(S.lookahead=se&&(S.ins_h=(S.ins_h<=se)if(O=t._tr_tally(S,S.strstart-S.match_start,S.match_length-se),S.lookahead-=S.match_length,S.match_length<=S.max_lazy_match&&S.lookahead>=se){S.match_length--;do S.strstart++,S.ins_h=(S.ins_h<=se&&(S.ins_h=(S.ins_h<4096)&&(S.match_length=se-1)),S.prev_length>=se&&S.match_length<=S.prev_length){re=S.strstart+S.lookahead-se,O=t._tr_tally(S,S.strstart-1-S.prev_match,S.prev_length-se),S.lookahead-=S.prev_length-1,S.prev_length-=2;do++S.strstart<=re&&(S.ins_h=(S.ins_h<=se&&S.strstart>0&&(re=S.strstart-1,O=_e[re],O===_e[++re]&&O===_e[++re]&&O===_e[++re])){he=S.strstart+Z;do;while(O===_e[++re]&&O===_e[++re]&&O===_e[++re]&&O===_e[++re]&&O===_e[++re]&&O===_e[++re]&&O===_e[++re]&&O===_e[++re]&&reS.lookahead&&(S.match_length=S.lookahead)}if(S.match_length>=se?(Ae=t._tr_tally(S,1,S.match_length-se),S.lookahead-=S.match_length,S.strstart+=S.match_length,S.match_length=0):(Ae=t._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++),Ae&&(w(S,!1),S.strm.avail_out===0))return xe}return S.insert=0,de===s?(w(S,!0),S.strm.avail_out===0?we:tt):S.last_lit&&(w(S,!1),S.strm.avail_out===0)?xe:Oe}function ve(S,de){for(var Ae;;){if(S.lookahead===0&&(J(S),S.lookahead===0)){if(de===o)return xe;break}if(S.match_length=0,Ae=t._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++,Ae&&(w(S,!1),S.strm.avail_out===0))return xe}return S.insert=0,de===s?(w(S,!0),S.strm.avail_out===0?we:tt):S.last_lit&&(w(S,!1),S.strm.avail_out===0)?xe:Oe}function Ie(S,de,Ae,O,re){this.good_length=S,this.max_lazy=de,this.nice_length=Ae,this.max_chain=O,this.func=re}var rt;rt=[new Ie(0,0,0,0,ae),new Ie(4,4,8,4,ee),new Ie(4,5,16,8,ee),new Ie(4,6,32,32,ee),new Ie(4,4,16,16,pe),new Ie(8,16,32,32,pe),new Ie(8,16,128,128,pe),new Ie(8,32,128,256,pe),new Ie(32,128,258,1024,pe),new Ie(32,258,258,4096,pe)];function Me(S){S.window_size=2*S.w_size,z(S.head),S.max_lazy_match=rt[S.level].max_lazy,S.good_match=rt[S.level].good_length,S.nice_match=rt[S.level].nice_length,S.max_chain_length=rt[S.level].max_chain,S.strstart=0,S.block_start=0,S.lookahead=0,S.insert=0,S.match_length=S.prev_length=se-1,S.match_available=0,S.ins_h=0}function G(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=E,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(ne*2),this.dyn_dtree=new r.Buf16((2*m+1)*2),this.bl_tree=new r.Buf16((2*N+1)*2),z(this.dyn_ltree),z(this.dyn_dtree),z(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(q+1),this.heap=new r.Buf16(2*I+1),z(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(2*I+1),z(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function oe(S){var de;return!S||!S.state?h(S,f):(S.total_in=S.total_out=0,S.data_type=R,de=S.state,de.pending=0,de.pending_out=0,de.wrap<0&&(de.wrap=-de.wrap),de.status=de.wrap?_:Re,S.adler=de.wrap===2?0:1,de.last_flush=o,t._tr_init(de),d)}function me(S){var de=oe(S);return de===d&&Me(S.state),de}function De(S,de){return!S||!S.state||S.state.wrap!==2?f:(S.state.gzhead=de,d)}function te(S,de,Ae,O,re,he){if(!S)return f;var _e=1;if(de===y&&(de=6),O<0?(_e=0,O=-O):O>15&&(_e=2,O-=16),re<1||re>B||Ae!==E||O<8||O>15||de<0||de>9||he<0||he>P)return h(S,f);O===8&&(O=9);var Ne=new G;return S.state=Ne,Ne.strm=S,Ne.wrap=_e,Ne.gzhead=null,Ne.w_bits=O,Ne.w_size=1<u||de<0)return S?h(S,f):f;if(O=S.state,!S.output||!S.input&&S.avail_in!==0||O.status===ke&&de!==s)return h(S,S.avail_out===0?g:f);if(O.strm=S,Ae=O.last_flush,O.last_flush=de,O.status===_)if(O.wrap===2)S.adler=0,D(O,31),D(O,139),D(O,8),O.gzhead?(D(O,(O.gzhead.text?1:0)+(O.gzhead.hcrc?2:0)+(O.gzhead.extra?4:0)+(O.gzhead.name?8:0)+(O.gzhead.comment?16:0)),D(O,O.gzhead.time&255),D(O,O.gzhead.time>>8&255),D(O,O.gzhead.time>>16&255),D(O,O.gzhead.time>>24&255),D(O,O.level===9?2:O.strategy>=b||O.level<2?4:0),D(O,O.gzhead.os&255),O.gzhead.extra&&O.gzhead.extra.length&&(D(O,O.gzhead.extra.length&255),D(O,O.gzhead.extra.length>>8&255)),O.gzhead.hcrc&&(S.adler=i(S.adler,O.pending_buf,O.pending,0)),O.gzindex=0,O.status=fe):(D(O,0),D(O,0),D(O,0),D(O,0),D(O,0),D(O,O.level===9?2:O.strategy>=b||O.level<2?4:0),D(O,Be),O.status=Re);else{var _e=E+(O.w_bits-8<<4)<<8,Ne=-1;O.strategy>=b||O.level<2?Ne=0:O.level<6?Ne=1:O.level===6?Ne=2:Ne=3,_e|=Ne<<6,O.strstart!==0&&(_e|=j),_e+=31-_e%31,O.status=Re,K(O,_e),O.strstart!==0&&(K(O,S.adler>>>16),K(O,S.adler&65535)),S.adler=1}if(O.status===fe)if(O.gzhead.extra){for(re=O.pending;O.gzindex<(O.gzhead.extra.length&65535)&&!(O.pending===O.pending_buf_size&&(O.gzhead.hcrc&&O.pending>re&&(S.adler=i(S.adler,O.pending_buf,O.pending-re,re)),k(S),re=O.pending,O.pending===O.pending_buf_size));)D(O,O.gzhead.extra[O.gzindex]&255),O.gzindex++;O.gzhead.hcrc&&O.pending>re&&(S.adler=i(S.adler,O.pending_buf,O.pending-re,re)),O.gzindex===O.gzhead.extra.length&&(O.gzindex=0,O.status=ce)}else O.status=ce;if(O.status===ce)if(O.gzhead.name){re=O.pending;do{if(O.pending===O.pending_buf_size&&(O.gzhead.hcrc&&O.pending>re&&(S.adler=i(S.adler,O.pending_buf,O.pending-re,re)),k(S),re=O.pending,O.pending===O.pending_buf_size)){he=1;break}O.gzindexre&&(S.adler=i(S.adler,O.pending_buf,O.pending-re,re)),he===0&&(O.gzindex=0,O.status=ie)}else O.status=ie;if(O.status===ie)if(O.gzhead.comment){re=O.pending;do{if(O.pending===O.pending_buf_size&&(O.gzhead.hcrc&&O.pending>re&&(S.adler=i(S.adler,O.pending_buf,O.pending-re,re)),k(S),re=O.pending,O.pending===O.pending_buf_size)){he=1;break}O.gzindexre&&(S.adler=i(S.adler,O.pending_buf,O.pending-re,re)),he===0&&(O.status=be)}else O.status=be;if(O.status===be&&(O.gzhead.hcrc?(O.pending+2>O.pending_buf_size&&k(S),O.pending+2<=O.pending_buf_size&&(D(O,S.adler&255),D(O,S.adler>>8&255),S.adler=0,O.status=Re)):O.status=Re),O.pending!==0){if(k(S),S.avail_out===0)return O.last_flush=-1,d}else if(S.avail_in===0&&U(de)<=U(Ae)&&de!==s)return h(S,g);if(O.status===ke&&S.avail_in!==0)return h(S,g);if(S.avail_in!==0||O.lookahead!==0||de!==o&&O.status!==ke){var ze=O.strategy===b?ve(O,de):O.strategy===x?Ee(O,de):rt[O.level].func(O,de);if((ze===we||ze===tt)&&(O.status=ke),ze===xe||ze===we)return S.avail_out===0&&(O.last_flush=-1),d;if(ze===Oe&&(de===l?t._tr_align(O):de!==u&&(t._tr_stored_block(O,0,0,!1),de===c&&(z(O.head),O.lookahead===0&&(O.strstart=0,O.block_start=0,O.insert=0))),k(S),S.avail_out===0))return O.last_flush=-1,d}return de!==s?d:O.wrap<=0?A:(O.wrap===2?(D(O,S.adler&255),D(O,S.adler>>8&255),D(O,S.adler>>16&255),D(O,S.adler>>24&255),D(O,S.total_in&255),D(O,S.total_in>>8&255),D(O,S.total_in>>16&255),D(O,S.total_in>>24&255)):(K(O,S.adler>>>16),K(O,S.adler&65535)),k(S),O.wrap>0&&(O.wrap=-O.wrap),O.pending!==0?d:A)}function ye(S){var de;return!S||!S.state?f:(de=S.state.status,de!==_&&de!==fe&&de!==ce&&de!==ie&&de!==be&&de!==Re&&de!==ke?h(S,f):(S.state=null,de===Re?h(S,p):d))}function Ge(S,de){var Ae=de.length,O,re,he,_e,Ne,ze,At,Or;if(!S||!S.state||(O=S.state,_e=O.wrap,_e===2||_e===1&&O.status!==_||O.lookahead))return f;for(_e===1&&(S.adler=n(S.adler,de,Ae,0)),O.wrap=0,Ae>=O.w_size&&(_e===0&&(z(O.head),O.strstart=0,O.block_start=0,O.insert=0),Or=new r.Buf8(O.w_size),r.arraySet(Or,de,Ae-O.w_size,O.w_size,0),de=Or,Ae=O.w_size),Ne=S.avail_in,ze=S.next_in,At=S.input,S.avail_in=Ae,S.next_in=0,S.input=de,J(O);O.lookahead>=se;){re=O.strstart,he=O.lookahead-(se-1);do O.ins_h=(O.ins_h<=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;var a;i[254]=i[254]=1,e.string2buf=function(l){var c,s,u,d,A,f=l.length,p=0;for(d=0;d>>6,c[A++]=128|s&63):s<65536?(c[A++]=224|s>>>12,c[A++]=128|s>>>6&63,c[A++]=128|s&63):(c[A++]=240|s>>>18,c[A++]=128|s>>>12&63,c[A++]=128|s>>>6&63,c[A++]=128|s&63);return c};function o(l,c){if(c<65534&&(l.subarray&&n||!l.subarray&&t))return String.fromCharCode.apply(null,r.shrinkBuf(l,c));for(var s="",u=0;u4){p[u++]=65533,s+=A-1;continue}for(d&=A===2?31:A===3?15:7;A>1&&s1){p[u++]=65533;continue}d<65536?p[u++]=d:(d-=65536,p[u++]=55296|d>>10&1023,p[u++]=56320|d&1023)}return o(p,u)},e.utf8border=function(l,c){var s;for(c=c||l.length,c>l.length&&(c=l.length),s=c-1;s>=0&&(l[s]&192)===128;)s--;return s<0||s===0?c:s+i[l[s]]>c?s:c}}}),Iu=Lt({"../../../node_modules/pako/lib/zlib/zstream.js"(e,r){"use strict";function t(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}r.exports=t}}),sp=Lt({"../../../node_modules/pako/lib/deflate.js"(e){"use strict";var r=op(),t=Sn(),n=Nu(),i=rl(),a=Iu(),o=Object.prototype.toString,l=0,c=4,s=0,u=1,d=2,A=-1,f=0,p=8;function g(x){if(!(this instanceof g))return new g(x);this.options=t.assign({level:A,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},x||{});var P=this.options;P.raw&&P.windowBits>0?P.windowBits=-P.windowBits:P.gzip&&P.windowBits>0&&P.windowBits<16&&(P.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var F=r.deflateInit2(this.strm,P.level,P.method,P.windowBits,P.memLevel,P.strategy);if(F!==s)throw new Error(i[F]);if(P.header&&r.deflateSetHeader(this.strm,P.header),P.dictionary){var R;if(typeof P.dictionary=="string"?R=n.string2buf(P.dictionary):o.call(P.dictionary)==="[object ArrayBuffer]"?R=new Uint8Array(P.dictionary):R=P.dictionary,F=r.deflateSetDictionary(this.strm,R),F!==s)throw new Error(i[F]);this._dict_set=!0}}g.prototype.push=function(x,P){var F=this.strm,R=this.options.chunkSize,E,B;if(this.ended)return!1;B=P===~~P?P:P===!0?c:l,typeof x=="string"?F.input=n.string2buf(x):o.call(x)==="[object ArrayBuffer]"?F.input=new Uint8Array(x):F.input=x,F.next_in=0,F.avail_in=F.input.length;do{if(F.avail_out===0&&(F.output=new t.Buf8(R),F.next_out=0,F.avail_out=R),E=r.deflate(F,B),E!==u&&E!==s)return this.onEnd(E),this.ended=!0,!1;(F.avail_out===0||F.avail_in===0&&(B===c||B===d))&&(this.options.to==="string"?this.onData(n.buf2binstring(t.shrinkBuf(F.output,F.next_out))):this.onData(t.shrinkBuf(F.output,F.next_out)))}while((F.avail_in>0||F.avail_out===0)&&E!==u);return B===c?(E=r.deflateEnd(this.strm),this.onEnd(E),this.ended=!0,E===s):(B===d&&(this.onEnd(s),F.avail_out=0),!0)},g.prototype.onData=function(x){this.chunks.push(x)},g.prototype.onEnd=function(x){x===s&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=t.flattenChunks(this.chunks)),this.chunks=[],this.err=x,this.msg=this.strm.msg};function y(x,P){var F=new g(P);if(F.push(x,!0),F.err)throw F.msg||i[F.err];return F.result}function v(x,P){return P=P||{},P.raw=!0,y(x,P)}function b(x,P){return P=P||{},P.gzip=!0,y(x,P)}e.Deflate=g,e.deflate=y,e.deflateRaw=v,e.gzip=b}}),lp=Lt({"../../../node_modules/pako/lib/zlib/inffast.js"(e,r){"use strict";var t=30,n=12;r.exports=function(a,o){var l,c,s,u,d,A,f,p,g,y,v,b,x,P,F,R,E,B,T,W,H,C,I,m,N;l=a.state,c=a.next_in,m=a.input,s=c+(a.avail_in-5),u=a.next_out,N=a.output,d=u-(o-a.avail_out),A=u+(a.avail_out-257),f=l.dmax,p=l.wsize,g=l.whave,y=l.wnext,v=l.window,b=l.hold,x=l.bits,P=l.lencode,F=l.distcode,R=(1<>>24,b>>>=T,x-=T,T=B>>>16&255,T===0)N[u++]=B&65535;else if(T&16){W=B&65535,T&=15,T&&(x>>=T,x-=T),x<15&&(b+=m[c++]<>>24,b>>>=T,x-=T,T=B>>>16&255,T&16){if(H=B&65535,T&=15,xf){a.msg="invalid distance too far back",l.mode=t;break e}if(b>>>=T,x-=T,T=u-d,H>T){if(T=H-T,T>g&&l.sane){a.msg="invalid distance too far back",l.mode=t;break e}if(C=0,I=v,y===0){if(C+=p-T,T2;)N[u++]=I[C++],N[u++]=I[C++],N[u++]=I[C++],W-=3;W&&(N[u++]=I[C++],W>1&&(N[u++]=I[C++]))}else{C=u-H;do N[u++]=N[C++],N[u++]=N[C++],N[u++]=N[C++],W-=3;while(W>2);W&&(N[u++]=N[C++],W>1&&(N[u++]=N[C++]))}}else if((T&64)===0){B=F[(B&65535)+(b&(1<>3,c-=W,x-=W<<3,b&=(1<=1&&ie[W]===0;W--);if(H>W&&(H=W),W===0)return b[x++]=1<<24|64<<16|0,b[x++]=1<<24|64<<16|0,F.bits=1,0;for(T=1;T0&&(p===o||W!==1))return-1;for(be[1]=0,E=1;Ei||p===c&&N>a)return 1;for(;;){xe=E-I,P[B]ce?(Oe=Re[ke+P[B]],we=_[fe+P[B]]):(Oe=96,we=0),q=1<>I)+se]=xe<<24|Oe<<16|we|0;while(se!==0);for(q=1<>=1;if(q!==0?(ne&=q-1,ne+=q):ne=0,B++,--ie[E]===0){if(E===W)break;E=g[y+P[B]]}if(E>H&&(ne&ue)!==Z){for(I===0&&(I=H),j+=T,C=E-I,m=1<i||p===c&&N>a)return 1;Z=ne&ue,b[Z]=H<<24|C<<16|j-x|0}}return ne!==0&&(b[j+ne]=E-I<<24|64<<16|0),F.bits=H,0}}}),up=Lt({"../../../node_modules/pako/lib/zlib/inflate.js"(e){"use strict";var r=Sn(),t=Ru(),n=Lu(),i=lp(),a=cp(),o=0,l=1,c=2,s=4,u=5,d=6,A=0,f=1,p=2,g=-2,y=-3,v=-4,b=-5,x=8,P=1,F=2,R=3,E=4,B=5,T=6,W=7,H=8,C=9,I=10,m=11,N=12,ne=13,q=14,se=15,Z=16,ue=17,j=18,_=19,fe=20,ce=21,ie=22,be=23,Re=24,ke=25,xe=26,Oe=27,we=28,tt=29,Be=30,h=31,U=32,z=852,k=592,w=15,D=w;function K(te){return(te>>>24&255)+(te>>>8&65280)+((te&65280)<<8)+((te&255)<<24)}function Y(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function M(te){var ge;return!te||!te.state?g:(ge=te.state,te.total_in=te.total_out=ge.total=0,te.msg="",ge.wrap&&(te.adler=ge.wrap&1),ge.mode=P,ge.last=0,ge.havedict=0,ge.dmax=32768,ge.head=null,ge.hold=0,ge.bits=0,ge.lencode=ge.lendyn=new r.Buf32(z),ge.distcode=ge.distdyn=new r.Buf32(k),ge.sane=1,ge.back=-1,A)}function J(te){var ge;return!te||!te.state?g:(ge=te.state,ge.wsize=0,ge.whave=0,ge.wnext=0,M(te))}function ae(te,ge){var L,ye;return!te||!te.state||(ye=te.state,ge<0?(L=0,ge=-ge):(L=(ge>>4)+1,ge<48&&(ge&=15)),ge&&(ge<8||ge>15))?g:(ye.window!==null&&ye.wbits!==ge&&(ye.window=null),ye.wrap=L,ye.wbits=ge,J(te))}function ee(te,ge){var L,ye;return te?(ye=new Y,te.state=ye,ye.window=null,L=ae(te,ge),L!==A&&(te.state=null),L):g}function pe(te){return ee(te,D)}var Ee=!0,ve,Ie;function rt(te){if(Ee){var ge;for(ve=new r.Buf32(512),Ie=new r.Buf32(32),ge=0;ge<144;)te.lens[ge++]=8;for(;ge<256;)te.lens[ge++]=9;for(;ge<280;)te.lens[ge++]=7;for(;ge<288;)te.lens[ge++]=8;for(a(l,te.lens,0,288,ve,0,te.work,{bits:9}),ge=0;ge<32;)te.lens[ge++]=5;a(c,te.lens,0,32,Ie,0,te.work,{bits:5}),Ee=!1}te.lencode=ve,te.lenbits=9,te.distcode=Ie,te.distbits=5}function Me(te,ge,L,ye){var Ge,S=te.state;return S.window===null&&(S.wsize=1<=S.wsize?(r.arraySet(S.window,ge,L-S.wsize,S.wsize,0),S.wnext=0,S.whave=S.wsize):(Ge=S.wsize-S.wnext,Ge>ye&&(Ge=ye),r.arraySet(S.window,ge,L-ye,Ge,S.wnext),ye-=Ge,ye?(r.arraySet(S.window,ge,L-ye,ye,0),S.wnext=ye,S.whave=S.wsize):(S.wnext+=Ge,S.wnext===S.wsize&&(S.wnext=0),S.whave>>8&255,L.check=n(L.check,jt,2,0),re=0,he=0,L.mode=F;break}if(L.flags=0,L.head&&(L.head.done=!1),!(L.wrap&1)||(((re&255)<<8)+(re>>8))%31){te.msg="incorrect header check",L.mode=Be;break}if((re&15)!==x){te.msg="unknown compression method",L.mode=Be;break}if(re>>>=4,he-=4,Et=(re&15)+8,L.wbits===0)L.wbits=Et;else if(Et>L.wbits){te.msg="invalid window size",L.mode=Be;break}L.dmax=1<>8&1),L.flags&512&&(jt[0]=re&255,jt[1]=re>>>8&255,L.check=n(L.check,jt,2,0)),re=0,he=0,L.mode=R;case R:for(;he<32;){if(Ae===0)break e;Ae--,re+=ye[S++]<>>8&255,jt[2]=re>>>16&255,jt[3]=re>>>24&255,L.check=n(L.check,jt,4,0)),re=0,he=0,L.mode=E;case E:for(;he<16;){if(Ae===0)break e;Ae--,re+=ye[S++]<>8),L.flags&512&&(jt[0]=re&255,jt[1]=re>>>8&255,L.check=n(L.check,jt,2,0)),re=0,he=0,L.mode=B;case B:if(L.flags&1024){for(;he<16;){if(Ae===0)break e;Ae--,re+=ye[S++]<>>8&255,L.check=n(L.check,jt,2,0)),re=0,he=0}else L.head&&(L.head.extra=null);L.mode=T;case T:if(L.flags&1024&&(ze=L.length,ze>Ae&&(ze=Ae),ze&&(L.head&&(Et=L.head.extra_len-L.length,L.head.extra||(L.head.extra=new Array(L.head.extra_len)),r.arraySet(L.head.extra,ye,S,ze,Et)),L.flags&512&&(L.check=n(L.check,ye,ze,S)),Ae-=ze,S+=ze,L.length-=ze),L.length))break e;L.length=0,L.mode=W;case W:if(L.flags&2048){if(Ae===0)break e;ze=0;do Et=ye[S+ze++],L.head&&Et&&L.length<65536&&(L.head.name+=String.fromCharCode(Et));while(Et&&ze>9&1,L.head.done=!0),te.adler=L.check=0,L.mode=N;break;case I:for(;he<32;){if(Ae===0)break e;Ae--,re+=ye[S++]<>>=he&7,he-=he&7,L.mode=Oe;break}for(;he<3;){if(Ae===0)break e;Ae--,re+=ye[S++]<>>=1,he-=1,re&3){case 0:L.mode=q;break;case 1:if(rt(L),L.mode=fe,ge===d){re>>>=2,he-=2;break e}break;case 2:L.mode=ue;break;case 3:te.msg="invalid block type",L.mode=Be}re>>>=2,he-=2;break;case q:for(re>>>=he&7,he-=he&7;he<32;){if(Ae===0)break e;Ae--,re+=ye[S++]<>>16^65535)){te.msg="invalid stored block lengths",L.mode=Be;break}if(L.length=re&65535,re=0,he=0,L.mode=se,ge===d)break e;case se:L.mode=Z;case Z:if(ze=L.length,ze){if(ze>Ae&&(ze=Ae),ze>O&&(ze=O),ze===0)break e;r.arraySet(Ge,ye,S,ze,de),Ae-=ze,S+=ze,O-=ze,de+=ze,L.length-=ze;break}L.mode=N;break;case ue:for(;he<14;){if(Ae===0)break e;Ae--,re+=ye[S++]<>>=5,he-=5,L.ndist=(re&31)+1,re>>>=5,he-=5,L.ncode=(re&15)+4,re>>>=4,he-=4,L.nlen>286||L.ndist>30){te.msg="too many length or distance symbols",L.mode=Be;break}L.have=0,L.mode=j;case j:for(;L.have>>=3,he-=3}for(;L.have<19;)L.lens[tc[L.have++]]=0;if(L.lencode=L.lendyn,L.lenbits=7,_r={bits:L.lenbits},hr=a(o,L.lens,0,19,L.lencode,0,L.work,_r),L.lenbits=_r.bits,hr){te.msg="invalid code lengths set",L.mode=Be;break}L.have=0,L.mode=_;case _:for(;L.have>>24,Nt=Dt>>>16&255,Ht=Dt&65535,!(gt<=he);){if(Ae===0)break e;Ae--,re+=ye[S++]<>>=gt,he-=gt,L.lens[L.have++]=Ht;else{if(Ht===16){for(Rr=gt+2;he>>=gt,he-=gt,L.have===0){te.msg="invalid bit length repeat",L.mode=Be;break}Et=L.lens[L.have-1],ze=3+(re&3),re>>>=2,he-=2}else if(Ht===17){for(Rr=gt+3;he>>=gt,he-=gt,Et=0,ze=3+(re&7),re>>>=3,he-=3}else{for(Rr=gt+7;he>>=gt,he-=gt,Et=0,ze=11+(re&127),re>>>=7,he-=7}if(L.have+ze>L.nlen+L.ndist){te.msg="invalid bit length repeat",L.mode=Be;break}for(;ze--;)L.lens[L.have++]=Et}}if(L.mode===Be)break;if(L.lens[256]===0){te.msg="invalid code -- missing end-of-block",L.mode=Be;break}if(L.lenbits=9,_r={bits:L.lenbits},hr=a(l,L.lens,0,L.nlen,L.lencode,0,L.work,_r),L.lenbits=_r.bits,hr){te.msg="invalid literal/lengths set",L.mode=Be;break}if(L.distbits=6,L.distcode=L.distdyn,_r={bits:L.distbits},hr=a(c,L.lens,L.nlen,L.ndist,L.distcode,0,L.work,_r),L.distbits=_r.bits,hr){te.msg="invalid distances set",L.mode=Be;break}if(L.mode=fe,ge===d)break e;case fe:L.mode=ce;case ce:if(Ae>=6&&O>=258){te.next_out=de,te.avail_out=O,te.next_in=S,te.avail_in=Ae,L.hold=re,L.bits=he,i(te,Ne),de=te.next_out,Ge=te.output,O=te.avail_out,S=te.next_in,ye=te.input,Ae=te.avail_in,re=L.hold,he=L.bits,L.mode===N&&(L.back=-1);break}for(L.back=0;Dt=L.lencode[re&(1<>>24,Nt=Dt>>>16&255,Ht=Dt&65535,!(gt<=he);){if(Ae===0)break e;Ae--,re+=ye[S++]<>tr)],gt=Dt>>>24,Nt=Dt>>>16&255,Ht=Dt&65535,!(tr+gt<=he);){if(Ae===0)break e;Ae--,re+=ye[S++]<>>=tr,he-=tr,L.back+=tr}if(re>>>=gt,he-=gt,L.back+=gt,L.length=Ht,Nt===0){L.mode=xe;break}if(Nt&32){L.back=-1,L.mode=N;break}if(Nt&64){te.msg="invalid literal/length code",L.mode=Be;break}L.extra=Nt&15,L.mode=ie;case ie:if(L.extra){for(Rr=L.extra;he>>=L.extra,he-=L.extra,L.back+=L.extra}L.was=L.length,L.mode=be;case be:for(;Dt=L.distcode[re&(1<>>24,Nt=Dt>>>16&255,Ht=Dt&65535,!(gt<=he);){if(Ae===0)break e;Ae--,re+=ye[S++]<>tr)],gt=Dt>>>24,Nt=Dt>>>16&255,Ht=Dt&65535,!(tr+gt<=he);){if(Ae===0)break e;Ae--,re+=ye[S++]<>>=tr,he-=tr,L.back+=tr}if(re>>>=gt,he-=gt,L.back+=gt,Nt&64){te.msg="invalid distance code",L.mode=Be;break}L.offset=Ht,L.extra=Nt&15,L.mode=Re;case Re:if(L.extra){for(Rr=L.extra;he>>=L.extra,he-=L.extra,L.back+=L.extra}if(L.offset>L.dmax){te.msg="invalid distance too far back",L.mode=Be;break}L.mode=ke;case ke:if(O===0)break e;if(ze=Ne-O,L.offset>ze){if(ze=L.offset-ze,ze>L.whave&&L.sane){te.msg="invalid distance too far back",L.mode=Be;break}ze>L.wnext?(ze-=L.wnext,At=L.wsize-ze):At=L.wnext-ze,ze>L.length&&(ze=L.length),Or=L.window}else Or=Ge,At=de-L.offset,ze=L.length;ze>O&&(ze=O),O-=ze,L.length-=ze;do Ge[de++]=Or[At++];while(--ze);L.length===0&&(L.mode=ce);break;case xe:if(O===0)break e;Ge[de++]=L.length,O--,L.mode=ce;break;case Oe:if(L.wrap){for(;he<32;){if(Ae===0)break e;Ae--,re|=ye[S++]<=0&&f.windowBits<16&&(f.windowBits=-f.windowBits,f.windowBits===0&&(f.windowBits=-15)),f.windowBits>=0&&f.windowBits<16&&!(A&&A.windowBits)&&(f.windowBits+=32),f.windowBits>15&&f.windowBits<48&&(f.windowBits&15)===0&&(f.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var p=r.inflateInit2(this.strm,f.windowBits);if(p!==i.Z_OK)throw new Error(a[p]);if(this.header=new l,r.inflateGetHeader(this.strm,this.header),f.dictionary&&(typeof f.dictionary=="string"?f.dictionary=n.string2buf(f.dictionary):c.call(f.dictionary)==="[object ArrayBuffer]"&&(f.dictionary=new Uint8Array(f.dictionary)),f.raw&&(p=r.inflateSetDictionary(this.strm,f.dictionary),p!==i.Z_OK)))throw new Error(a[p])}s.prototype.push=function(A,f){var p=this.strm,g=this.options.chunkSize,y=this.options.dictionary,v,b,x,P,F,R=!1;if(this.ended)return!1;b=f===~~f?f:f===!0?i.Z_FINISH:i.Z_NO_FLUSH,typeof A=="string"?p.input=n.binstring2buf(A):c.call(A)==="[object ArrayBuffer]"?p.input=new Uint8Array(A):p.input=A,p.next_in=0,p.avail_in=p.input.length;do{if(p.avail_out===0&&(p.output=new t.Buf8(g),p.next_out=0,p.avail_out=g),v=r.inflate(p,i.Z_NO_FLUSH),v===i.Z_NEED_DICT&&y&&(v=r.inflateSetDictionary(this.strm,y)),v===i.Z_BUF_ERROR&&R===!0&&(v=i.Z_OK,R=!1),v!==i.Z_STREAM_END&&v!==i.Z_OK)return this.onEnd(v),this.ended=!0,!1;p.next_out&&(p.avail_out===0||v===i.Z_STREAM_END||p.avail_in===0&&(b===i.Z_FINISH||b===i.Z_SYNC_FLUSH))&&(this.options.to==="string"?(x=n.utf8border(p.output,p.next_out),P=p.next_out-x,F=n.buf2string(p.output,x),p.next_out=P,p.avail_out=g-P,P&&t.arraySet(p.output,p.output,x,P,0),this.onData(F)):this.onData(t.shrinkBuf(p.output,p.next_out))),p.avail_in===0&&p.avail_out===0&&(R=!0)}while((p.avail_in>0||p.avail_out===0)&&v!==i.Z_STREAM_END);return v===i.Z_STREAM_END&&(b=i.Z_FINISH),b===i.Z_FINISH?(v=r.inflateEnd(this.strm),this.onEnd(v),this.ended=!0,v===i.Z_OK):(b===i.Z_SYNC_FLUSH&&(this.onEnd(i.Z_OK),p.avail_out=0),!0)},s.prototype.onData=function(A){this.chunks.push(A)},s.prototype.onEnd=function(A){A===i.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=t.flattenChunks(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};function u(A,f){var p=new s(f);if(p.push(A,!0),p.err)throw p.msg||a[p.err];return p.result}function d(A,f){return f=f||{},f.raw=!0,u(A,f)}e.Inflate=s,e.inflate=u,e.inflateRaw=d,e.ungzip=u}}),xo=Lt({"../../../node_modules/pako/index.js"(e,r){"use strict";var t=Sn().assign,n=sp(),i=fp(),a=zu(),o={};t(o,n,i,a),r.exports=o}}),hp=Lt({"node_modules/jszip/dist/jszip.min.js"(e,r){(function(t){typeof e=="object"&&typeof r<"u"?r.exports=t():typeof define=="function"&&define.amd?define([],t):(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this).JSZip=t()})(function(){return(function t(n,i,a){function o(s,u){if(!i[s]){if(!n[s]){var d=typeof An=="function"&&An;if(!u&&d)return d(s,!0);if(l)return l(s,!0);var A=new Error("Cannot find module '"+s+"'");throw A.code="MODULE_NOT_FOUND",A}var f=i[s]={exports:{}};n[s][0].call(f.exports,function(p){var g=n[s][1][p];return o(g||p)},f,f.exports,t,n,i,a)}return i[s].exports}for(var l=typeof An=="function"&&An,c=0;c>2,f=(3&s)<<4|u>>4,p=1>6:64,g=2>4,u=(15&A)<<4|(f=l.indexOf(c.charAt(g++)))>>2,d=(3&f)<<6|(p=l.indexOf(c.charAt(g++))),b[y++]=s,f!==64&&(b[y++]=u),p!==64&&(b[y++]=d);return b}},{"./support":30,"./utils":32}],2:[function(t,n,i){"use strict";var a=t("./external"),o=t("./stream/DataWorker"),l=t("./stream/Crc32Probe"),c=t("./stream/DataLengthProbe");function s(u,d,A,f,p){this.compressedSize=u,this.uncompressedSize=d,this.crc32=A,this.compression=f,this.compressedContent=p}s.prototype={getContentWorker:function(){var u=new o(a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),d=this;return u.on("end",function(){if(this.streamInfo.data_length!==d.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new o(a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(u,d,A){return u.pipe(new l).pipe(new c("uncompressedSize")).pipe(d.compressWorker(A)).pipe(new c("compressedSize")).withStreamInfo("compression",d)},n.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,n,i){"use strict";var a=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new a("STORE compression")},uncompressWorker:function(){return new a("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,n,i){"use strict";var a=t("./utils"),o=(function(){for(var l,c=[],s=0;s<256;s++){l=s;for(var u=0;u<8;u++)l=1&l?3988292384^l>>>1:l>>>1;c[s]=l}return c})();n.exports=function(l,c){return l!==void 0&&l.length?a.getTypeOf(l)!=="string"?(function(s,u,d,A){var f=o,p=A+d;s^=-1;for(var g=A;g>>8^f[255&(s^u[g])];return-1^s})(0|c,l,l.length,0):(function(s,u,d,A){var f=o,p=A+d;s^=-1;for(var g=A;g>>8^f[255&(s^u.charCodeAt(g))];return-1^s})(0|c,l,l.length,0):0}},{"./utils":32}],5:[function(t,n,i){"use strict";i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,n,i){"use strict";var a=null;a=typeof Promise<"u"?Promise:t("lie"),n.exports={Promise:a}},{lie:37}],7:[function(t,n,i){"use strict";var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=t("pako"),l=t("./utils"),c=t("./stream/GenericWorker"),s=a?"uint8array":"array";function u(d,A){c.call(this,"FlateWorker/"+d),this._pako=null,this._pakoAction=d,this._pakoOptions=A,this.meta={}}i.magic="\b\0",l.inherits(u,c),u.prototype.processChunk=function(d){this.meta=d.meta,this._pako===null&&this._createPako(),this._pako.push(l.transformTo(s,d.data),!1)},u.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var d=this;this._pako.onData=function(A){d.push({data:A,meta:d.meta})}},i.compressWorker=function(d){return new u("Deflate",d)},i.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,n,i){"use strict";function a(f,p){var g,y="";for(g=0;g>>=8;return y}function o(f,p,g,y,v,b){var x,P,F=f.file,R=f.compression,E=b!==s.utf8encode,B=l.transformTo("string",b(F.name)),T=l.transformTo("string",s.utf8encode(F.name)),W=F.comment,H=l.transformTo("string",b(W)),C=l.transformTo("string",s.utf8encode(W)),I=T.length!==F.name.length,m=C.length!==W.length,N="",ne="",q="",se=F.dir,Z=F.date,ue={crc32:0,compressedSize:0,uncompressedSize:0};p&&!g||(ue.crc32=f.crc32,ue.compressedSize=f.compressedSize,ue.uncompressedSize=f.uncompressedSize);var j=0;p&&(j|=8),E||!I&&!m||(j|=2048);var _=0,fe=0;se&&(_|=16),v==="UNIX"?(fe=798,_|=(function(ie,be){var Re=ie;return ie||(Re=be?16893:33204),(65535&Re)<<16})(F.unixPermissions,se)):(fe=20,_|=(function(ie){return 63&(ie||0)})(F.dosPermissions)),x=Z.getUTCHours(),x<<=6,x|=Z.getUTCMinutes(),x<<=5,x|=Z.getUTCSeconds()/2,P=Z.getUTCFullYear()-1980,P<<=4,P|=Z.getUTCMonth()+1,P<<=5,P|=Z.getUTCDate(),I&&(ne=a(1,1)+a(u(B),4)+T,N+="up"+a(ne.length,2)+ne),m&&(q=a(1,1)+a(u(H),4)+C,N+="uc"+a(q.length,2)+q);var ce="";return ce+=` +\0`,ce+=a(j,2),ce+=R.magic,ce+=a(x,2),ce+=a(P,2),ce+=a(ue.crc32,4),ce+=a(ue.compressedSize,4),ce+=a(ue.uncompressedSize,4),ce+=a(B.length,2),ce+=a(N.length,2),{fileRecord:d.LOCAL_FILE_HEADER+ce+B+N,dirRecord:d.CENTRAL_FILE_HEADER+a(fe,2)+ce+a(H.length,2)+"\0\0\0\0"+a(_,4)+a(y,4)+B+N+H}}var l=t("../utils"),c=t("../stream/GenericWorker"),s=t("../utf8"),u=t("../crc32"),d=t("../signature");function A(f,p,g,y){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=g,this.encodeFileName=y,this.streamFiles=f,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}l.inherits(A,c),A.prototype.push=function(f){var p=f.meta.percent||0,g=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,c.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:g?(p+100*(g-y-1))/g:100}}))},A.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var p=this.streamFiles&&!f.file.dir;if(p){var g=o(f,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},A.prototype.closedSource=function(f){this.accumulate=!1;var p=this.streamFiles&&!f.file.dir,g=o(f,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),p)this.push({data:(function(y){return d.DATA_DESCRIPTOR+a(y.crc32,4)+a(y.compressedSize,4)+a(y.uncompressedSize,4)})(f),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},A.prototype.flush=function(){for(var f=this.bytesWritten,p=0;p=this.index;c--)s=(s<<8)+this.byteAt(c);return this.index+=l,s},readString:function(l){return a.transformTo("string",this.readData(l))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var l=this.readInt(4);return new Date(Date.UTC(1980+(l>>25&127),(l>>21&15)-1,l>>16&31,l>>11&31,l>>5&63,(31&l)<<1))}},n.exports=o},{"../utils":32}],19:[function(t,n,i){"use strict";var a=t("./Uint8ArrayReader");function o(l){a.call(this,l)}t("../utils").inherits(o,a),o.prototype.readData=function(l){this.checkOffset(l);var c=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},n.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,n,i){"use strict";var a=t("./DataReader");function o(l){a.call(this,l)}t("../utils").inherits(o,a),o.prototype.byteAt=function(l){return this.data.charCodeAt(this.zero+l)},o.prototype.lastIndexOfSignature=function(l){return this.data.lastIndexOf(l)-this.zero},o.prototype.readAndCheckSignature=function(l){return l===this.readData(4)},o.prototype.readData=function(l){this.checkOffset(l);var c=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},n.exports=o},{"../utils":32,"./DataReader":18}],21:[function(t,n,i){"use strict";var a=t("./ArrayReader");function o(l){a.call(this,l)}t("../utils").inherits(o,a),o.prototype.readData=function(l){if(this.checkOffset(l),l===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},n.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(t,n,i){"use strict";var a=t("../utils"),o=t("../support"),l=t("./ArrayReader"),c=t("./StringReader"),s=t("./NodeBufferReader"),u=t("./Uint8ArrayReader");n.exports=function(d){var A=a.getTypeOf(d);return a.checkSupport(A),A!=="string"||o.uint8array?A==="nodebuffer"?new s(d):o.uint8array?new u(a.transformTo("uint8array",d)):new l(a.transformTo("array",d)):new c(d)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,n,i){"use strict";i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,n,i){"use strict";var a=t("./GenericWorker"),o=t("../utils");function l(c){a.call(this,"ConvertWorker to "+c),this.destType=c}o.inherits(l,a),l.prototype.processChunk=function(c){this.push({data:o.transformTo(this.destType,c.data),meta:c.meta})},n.exports=l},{"../utils":32,"./GenericWorker":28}],25:[function(t,n,i){"use strict";var a=t("./GenericWorker"),o=t("../crc32");function l(){a.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(l,a),l.prototype.processChunk=function(c){this.streamInfo.crc32=o(c.data,this.streamInfo.crc32||0),this.push(c)},n.exports=l},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,n,i){"use strict";var a=t("../utils"),o=t("./GenericWorker");function l(c){o.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}a.inherits(l,o),l.prototype.processChunk=function(c){if(c){var s=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=s+c.data.length}o.prototype.processChunk.call(this,c)},n.exports=l},{"../utils":32,"./GenericWorker":28}],27:[function(t,n,i){"use strict";var a=t("../utils"),o=t("./GenericWorker");function l(c){o.call(this,"DataWorker");var s=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(u){s.dataIsReady=!0,s.data=u,s.max=u&&u.length||0,s.type=a.getTypeOf(u),s.isPaused||s._tickAndRepeat()},function(u){s.error(u)})}a.inherits(l,o),l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},l.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,a.delay(this._tickAndRepeat,[],this)),!0)},l.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(a.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},l.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,s=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,s);break;case"uint8array":c=this.data.subarray(this.index,s);break;case"array":case"nodebuffer":c=this.data.slice(this.index,s)}return this.index=s,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=l},{"../utils":32,"./GenericWorker":28}],28:[function(t,n,i){"use strict";function a(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}a.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,l){return this._listeners[o].push(l),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,l){if(this._listeners[o])for(var c=0;c "+o:o}},n.exports=a},{}],29:[function(t,n,i){"use strict";var a=t("../utils"),o=t("./ConvertWorker"),l=t("./GenericWorker"),c=t("../base64"),s=t("../support"),u=t("../external"),d=null;if(s.nodestream)try{d=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function A(p,g){return new u.Promise(function(y,v){var b=[],x=p._internalType,P=p._outputType,F=p._mimeType;p.on("data",function(R,E){b.push(R),g&&g(E)}).on("error",function(R){b=[],v(R)}).on("end",function(){try{var R=(function(E,B,T){switch(E){case"blob":return a.newBlob(a.transformTo("arraybuffer",B),T);case"base64":return c.encode(B);default:return a.transformTo(E,B)}})(P,(function(E,B){var T,W=0,H=null,C=0;for(T=0;T"u")i.blob=!1;else{var a=new ArrayBuffer(0);try{i.blob=new Blob([a],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(a),i.blob=o.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!t("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(t,n,i){"use strict";for(var a=t("./utils"),o=t("./support"),l=t("./nodejsUtils"),c=t("./stream/GenericWorker"),s=new Array(256),u=0;u<256;u++)s[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;s[254]=s[254]=1;function d(){c.call(this,"utf-8 decode"),this.leftOver=null}function A(){c.call(this,"utf-8 encode")}i.utf8encode=function(f){return o.nodebuffer?l.newBufferFrom(f,"utf-8"):(function(p){var g,y,v,b,x,P=p.length,F=0;for(b=0;b>>6:(y<65536?g[x++]=224|y>>>12:(g[x++]=240|y>>>18,g[x++]=128|y>>>12&63),g[x++]=128|y>>>6&63),g[x++]=128|63&y);return g})(f)},i.utf8decode=function(f){return o.nodebuffer?a.transformTo("nodebuffer",f).toString("utf-8"):(function(p){var g,y,v,b,x=p.length,P=new Array(2*x);for(g=y=0;g>10&1023,P[y++]=56320|1023&v)}return P.length!==y&&(P.subarray?P=P.subarray(0,y):P.length=y),a.applyFromCharCode(P)})(f=a.transformTo(o.uint8array?"uint8array":"array",f))},a.inherits(d,c),d.prototype.processChunk=function(f){var p=a.transformTo(o.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var g=p;(p=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),p.set(g,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var y=(function(b,x){var P;for((x=x||b.length)>b.length&&(x=b.length),P=x-1;0<=P&&(192&b[P])==128;)P--;return P<0||P===0?x:P+s[b[P]]>x?P:x})(p),v=p;y!==p.length&&(o.uint8array?(v=p.subarray(0,y),this.leftOver=p.subarray(y,p.length)):(v=p.slice(0,y),this.leftOver=p.slice(y,p.length))),this.push({data:i.utf8decode(v),meta:f.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=d,a.inherits(A,c),A.prototype.processChunk=function(f){this.push({data:i.utf8encode(f.data),meta:f.meta})},i.Utf8EncodeWorker=A},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,n,i){"use strict";var a=t("./support"),o=t("./base64"),l=t("./nodejsUtils"),c=t("./external");function s(g){return g}function u(g,y){for(var v=0;v>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=a(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var p,g,y,v=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4>>6:(f<65536?A[y++]=224|f>>>12:(A[y++]=240|f>>>18,A[y++]=128|f>>>12&63),A[y++]=128|f>>>6&63),A[y++]=128|63&f);return A},i.buf2binstring=function(d){return u(d,d.length)},i.binstring2buf=function(d){for(var A=new a.Buf8(d.length),f=0,p=A.length;f>10&1023,b[p++]=56320|1023&g)}return u(b,p)},i.utf8border=function(d,A){var f;for((A=A||d.length)>d.length&&(A=d.length),f=A-1;0<=f&&(192&d[f])==128;)f--;return f<0||f===0?A:f+c[d[f]]>A?f:A}},{"./common":41}],43:[function(t,n,i){"use strict";n.exports=function(a,o,l,c){for(var s=65535&a|0,u=a>>>16&65535|0,d=0;l!==0;){for(l-=d=2e3>>1:o>>>1;l[c]=o}return l})();n.exports=function(o,l,c,s){var u=a,d=s+c;o^=-1;for(var A=s;A>>8^u[255&(o^l[A])];return-1^o}},{}],46:[function(t,n,i){"use strict";var a,o=t("../utils/common"),l=t("./trees"),c=t("./adler32"),s=t("./crc32"),u=t("./messages"),d=0,A=4,f=0,p=-2,g=-1,y=4,v=2,b=8,x=9,P=286,F=30,R=19,E=2*P+1,B=15,T=3,W=258,H=W+T+1,C=42,I=113,m=1,N=2,ne=3,q=4;function se(h,U){return h.msg=u[U],U}function Z(h){return(h<<1)-(4h.avail_out&&(z=h.avail_out),z!==0&&(o.arraySet(h.output,U.pending_buf,U.pending_out,z,h.next_out),h.next_out+=z,U.pending_out+=z,h.total_out+=z,h.avail_out-=z,U.pending-=z,U.pending===0&&(U.pending_out=0))}function _(h,U){l._tr_flush_block(h,0<=h.block_start?h.block_start:-1,h.strstart-h.block_start,U),h.block_start=h.strstart,j(h.strm)}function fe(h,U){h.pending_buf[h.pending++]=U}function ce(h,U){h.pending_buf[h.pending++]=U>>>8&255,h.pending_buf[h.pending++]=255&U}function ie(h,U){var z,k,w=h.max_chain_length,D=h.strstart,K=h.prev_length,Y=h.nice_match,M=h.strstart>h.w_size-H?h.strstart-(h.w_size-H):0,J=h.window,ae=h.w_mask,ee=h.prev,pe=h.strstart+W,Ee=J[D+K-1],ve=J[D+K];h.prev_length>=h.good_match&&(w>>=2),Y>h.lookahead&&(Y=h.lookahead);do if(J[(z=U)+K]===ve&&J[z+K-1]===Ee&&J[z]===J[D]&&J[++z]===J[D+1]){D+=2,z++;do;while(J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&DM&&--w!=0);return K<=h.lookahead?K:h.lookahead}function be(h){var U,z,k,w,D,K,Y,M,J,ae,ee=h.w_size;do{if(w=h.window_size-h.lookahead-h.strstart,h.strstart>=ee+(ee-H)){for(o.arraySet(h.window,h.window,ee,ee,0),h.match_start-=ee,h.strstart-=ee,h.block_start-=ee,U=z=h.hash_size;k=h.head[--U],h.head[U]=ee<=k?k-ee:0,--z;);for(U=z=ee;k=h.prev[--U],h.prev[U]=ee<=k?k-ee:0,--z;);w+=ee}if(h.strm.avail_in===0)break;if(K=h.strm,Y=h.window,M=h.strstart+h.lookahead,J=w,ae=void 0,ae=K.avail_in,J=T)for(D=h.strstart-h.insert,h.ins_h=h.window[D],h.ins_h=(h.ins_h<=T&&(h.ins_h=(h.ins_h<=T)if(k=l._tr_tally(h,h.strstart-h.match_start,h.match_length-T),h.lookahead-=h.match_length,h.match_length<=h.max_lazy_match&&h.lookahead>=T){for(h.match_length--;h.strstart++,h.ins_h=(h.ins_h<=T&&(h.ins_h=(h.ins_h<=T&&h.match_length<=h.prev_length){for(w=h.strstart+h.lookahead-T,k=l._tr_tally(h,h.strstart-1-h.prev_match,h.prev_length-T),h.lookahead-=h.prev_length-1,h.prev_length-=2;++h.strstart<=w&&(h.ins_h=(h.ins_h<h.pending_buf_size-5&&(z=h.pending_buf_size-5);;){if(h.lookahead<=1){if(be(h),h.lookahead===0&&U===d)return m;if(h.lookahead===0)break}h.strstart+=h.lookahead,h.lookahead=0;var k=h.block_start+z;if((h.strstart===0||h.strstart>=k)&&(h.lookahead=h.strstart-k,h.strstart=k,_(h,!1),h.strm.avail_out===0)||h.strstart-h.block_start>=h.w_size-H&&(_(h,!1),h.strm.avail_out===0))return m}return h.insert=0,U===A?(_(h,!0),h.strm.avail_out===0?ne:q):(h.strstart>h.block_start&&(_(h,!1),h.strm.avail_out),m)}),new xe(4,4,8,4,Re),new xe(4,5,16,8,Re),new xe(4,6,32,32,Re),new xe(4,4,16,16,ke),new xe(8,16,32,32,ke),new xe(8,16,128,128,ke),new xe(8,32,128,256,ke),new xe(32,128,258,1024,ke),new xe(32,258,258,4096,ke)],i.deflateInit=function(h,U){return Be(h,U,b,15,8,0)},i.deflateInit2=Be,i.deflateReset=tt,i.deflateResetKeep=we,i.deflateSetHeader=function(h,U){return h&&h.state?h.state.wrap!==2?p:(h.state.gzhead=U,f):p},i.deflate=function(h,U){var z,k,w,D;if(!h||!h.state||5>8&255),fe(k,k.gzhead.time>>16&255),fe(k,k.gzhead.time>>24&255),fe(k,k.level===9?2:2<=k.strategy||k.level<2?4:0),fe(k,255&k.gzhead.os),k.gzhead.extra&&k.gzhead.extra.length&&(fe(k,255&k.gzhead.extra.length),fe(k,k.gzhead.extra.length>>8&255)),k.gzhead.hcrc&&(h.adler=s(h.adler,k.pending_buf,k.pending,0)),k.gzindex=0,k.status=69):(fe(k,0),fe(k,0),fe(k,0),fe(k,0),fe(k,0),fe(k,k.level===9?2:2<=k.strategy||k.level<2?4:0),fe(k,3),k.status=I);else{var K=b+(k.w_bits-8<<4)<<8;K|=(2<=k.strategy||k.level<2?0:k.level<6?1:k.level===6?2:3)<<6,k.strstart!==0&&(K|=32),K+=31-K%31,k.status=I,ce(k,K),k.strstart!==0&&(ce(k,h.adler>>>16),ce(k,65535&h.adler)),h.adler=1}if(k.status===69)if(k.gzhead.extra){for(w=k.pending;k.gzindex<(65535&k.gzhead.extra.length)&&(k.pending!==k.pending_buf_size||(k.gzhead.hcrc&&k.pending>w&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),j(h),w=k.pending,k.pending!==k.pending_buf_size));)fe(k,255&k.gzhead.extra[k.gzindex]),k.gzindex++;k.gzhead.hcrc&&k.pending>w&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),k.gzindex===k.gzhead.extra.length&&(k.gzindex=0,k.status=73)}else k.status=73;if(k.status===73)if(k.gzhead.name){w=k.pending;do{if(k.pending===k.pending_buf_size&&(k.gzhead.hcrc&&k.pending>w&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),j(h),w=k.pending,k.pending===k.pending_buf_size)){D=1;break}D=k.gzindexw&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),D===0&&(k.gzindex=0,k.status=91)}else k.status=91;if(k.status===91)if(k.gzhead.comment){w=k.pending;do{if(k.pending===k.pending_buf_size&&(k.gzhead.hcrc&&k.pending>w&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),j(h),w=k.pending,k.pending===k.pending_buf_size)){D=1;break}D=k.gzindexw&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),D===0&&(k.status=103)}else k.status=103;if(k.status===103&&(k.gzhead.hcrc?(k.pending+2>k.pending_buf_size&&j(h),k.pending+2<=k.pending_buf_size&&(fe(k,255&h.adler),fe(k,h.adler>>8&255),h.adler=0,k.status=I)):k.status=I),k.pending!==0){if(j(h),h.avail_out===0)return k.last_flush=-1,f}else if(h.avail_in===0&&Z(U)<=Z(z)&&U!==A)return se(h,-5);if(k.status===666&&h.avail_in!==0)return se(h,-5);if(h.avail_in!==0||k.lookahead!==0||U!==d&&k.status!==666){var Y=k.strategy===2?(function(M,J){for(var ae;;){if(M.lookahead===0&&(be(M),M.lookahead===0)){if(J===d)return m;break}if(M.match_length=0,ae=l._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++,ae&&(_(M,!1),M.strm.avail_out===0))return m}return M.insert=0,J===A?(_(M,!0),M.strm.avail_out===0?ne:q):M.last_lit&&(_(M,!1),M.strm.avail_out===0)?m:N})(k,U):k.strategy===3?(function(M,J){for(var ae,ee,pe,Ee,ve=M.window;;){if(M.lookahead<=W){if(be(M),M.lookahead<=W&&J===d)return m;if(M.lookahead===0)break}if(M.match_length=0,M.lookahead>=T&&0M.lookahead&&(M.match_length=M.lookahead)}if(M.match_length>=T?(ae=l._tr_tally(M,1,M.match_length-T),M.lookahead-=M.match_length,M.strstart+=M.match_length,M.match_length=0):(ae=l._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++),ae&&(_(M,!1),M.strm.avail_out===0))return m}return M.insert=0,J===A?(_(M,!0),M.strm.avail_out===0?ne:q):M.last_lit&&(_(M,!1),M.strm.avail_out===0)?m:N})(k,U):a[k.level].func(k,U);if(Y!==ne&&Y!==q||(k.status=666),Y===m||Y===ne)return h.avail_out===0&&(k.last_flush=-1),f;if(Y===N&&(U===1?l._tr_align(k):U!==5&&(l._tr_stored_block(k,0,0,!1),U===3&&(ue(k.head),k.lookahead===0&&(k.strstart=0,k.block_start=0,k.insert=0))),j(h),h.avail_out===0))return k.last_flush=-1,f}return U!==A?f:k.wrap<=0?1:(k.wrap===2?(fe(k,255&h.adler),fe(k,h.adler>>8&255),fe(k,h.adler>>16&255),fe(k,h.adler>>24&255),fe(k,255&h.total_in),fe(k,h.total_in>>8&255),fe(k,h.total_in>>16&255),fe(k,h.total_in>>24&255)):(ce(k,h.adler>>>16),ce(k,65535&h.adler)),j(h),0=z.w_size&&(D===0&&(ue(z.head),z.strstart=0,z.block_start=0,z.insert=0),J=new o.Buf8(z.w_size),o.arraySet(J,U,ae-z.w_size,z.w_size,0),U=J,ae=z.w_size),K=h.avail_in,Y=h.next_in,M=h.input,h.avail_in=ae,h.next_in=0,h.input=U,be(z);z.lookahead>=T;){for(k=z.strstart,w=z.lookahead-(T-1);z.ins_h=(z.ins_h<>>=T=B>>>24,x-=T,(T=B>>>16&255)===0)N[u++]=65535&B;else{if(!(16&T)){if((64&T)==0){B=P[(65535&B)+(b&(1<>>=T,x-=T),x<15&&(b+=m[c++]<>>=T=B>>>24,x-=T,!(16&(T=B>>>16&255))){if((64&T)==0){B=F[(65535&B)+(b&(1<>>=T,x-=T,(T=u-d)>3,b&=(1<<(x-=W<<3))-1,a.next_in=c,a.next_out=u,a.avail_in=c>>24&255)+(C>>>8&65280)+((65280&C)<<8)+((255&C)<<24)}function b(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function x(C){var I;return C&&C.state?(I=C.state,C.total_in=C.total_out=I.total=0,C.msg="",I.wrap&&(C.adler=1&I.wrap),I.mode=p,I.last=0,I.havedict=0,I.dmax=32768,I.head=null,I.hold=0,I.bits=0,I.lencode=I.lendyn=new a.Buf32(g),I.distcode=I.distdyn=new a.Buf32(y),I.sane=1,I.back=-1,A):f}function P(C){var I;return C&&C.state?((I=C.state).wsize=0,I.whave=0,I.wnext=0,x(C)):f}function F(C,I){var m,N;return C&&C.state?(N=C.state,I<0?(m=0,I=-I):(m=1+(I>>4),I<48&&(I&=15)),I&&(I<8||15=q.wsize?(a.arraySet(q.window,I,m-q.wsize,q.wsize,0),q.wnext=0,q.whave=q.wsize):(N<(ne=q.wsize-q.wnext)&&(ne=N),a.arraySet(q.window,I,m-N,ne,q.wnext),(N-=ne)?(a.arraySet(q.window,I,m-N,N,0),q.wnext=N,q.whave=q.wsize):(q.wnext+=ne,q.wnext===q.wsize&&(q.wnext=0),q.whave>>8&255,m.check=l(m.check,D,2,0),_=j=0,m.mode=2;break}if(m.flags=0,m.head&&(m.head.done=!1),!(1&m.wrap)||(((255&j)<<8)+(j>>8))%31){C.msg="incorrect header check",m.mode=30;break}if((15&j)!=8){C.msg="unknown compression method",m.mode=30;break}if(_-=4,h=8+(15&(j>>>=4)),m.wbits===0)m.wbits=h;else if(h>m.wbits){C.msg="invalid window size",m.mode=30;break}m.dmax=1<>8&1),512&m.flags&&(D[0]=255&j,D[1]=j>>>8&255,m.check=l(m.check,D,2,0)),_=j=0,m.mode=3;case 3:for(;_<32;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}m.head&&(m.head.time=j),512&m.flags&&(D[0]=255&j,D[1]=j>>>8&255,D[2]=j>>>16&255,D[3]=j>>>24&255,m.check=l(m.check,D,4,0)),_=j=0,m.mode=4;case 4:for(;_<16;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}m.head&&(m.head.xflags=255&j,m.head.os=j>>8),512&m.flags&&(D[0]=255&j,D[1]=j>>>8&255,m.check=l(m.check,D,2,0)),_=j=0,m.mode=5;case 5:if(1024&m.flags){for(;_<16;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}m.length=j,m.head&&(m.head.extra_len=j),512&m.flags&&(D[0]=255&j,D[1]=j>>>8&255,m.check=l(m.check,D,2,0)),_=j=0}else m.head&&(m.head.extra=null);m.mode=6;case 6:if(1024&m.flags&&(Z<(ie=m.length)&&(ie=Z),ie&&(m.head&&(h=m.head.extra_len-m.length,m.head.extra||(m.head.extra=new Array(m.head.extra_len)),a.arraySet(m.head.extra,N,q,ie,h)),512&m.flags&&(m.check=l(m.check,N,ie,q)),Z-=ie,q+=ie,m.length-=ie),m.length))break e;m.length=0,m.mode=7;case 7:if(2048&m.flags){if(Z===0)break e;for(ie=0;h=N[q+ie++],m.head&&h&&m.length<65536&&(m.head.name+=String.fromCharCode(h)),h&&ie>9&1,m.head.done=!0),C.adler=m.check=0,m.mode=12;break;case 10:for(;_<32;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}C.adler=m.check=v(j),_=j=0,m.mode=11;case 11:if(m.havedict===0)return C.next_out=se,C.avail_out=ue,C.next_in=q,C.avail_in=Z,m.hold=j,m.bits=_,2;C.adler=m.check=1,m.mode=12;case 12:if(I===5||I===6)break e;case 13:if(m.last){j>>>=7&_,_-=7&_,m.mode=27;break}for(;_<3;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}switch(m.last=1&j,_-=1,3&(j>>>=1)){case 0:m.mode=14;break;case 1:if(W(m),m.mode=20,I!==6)break;j>>>=2,_-=2;break e;case 2:m.mode=17;break;case 3:C.msg="invalid block type",m.mode=30}j>>>=2,_-=2;break;case 14:for(j>>>=7&_,_-=7&_;_<32;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}if((65535&j)!=(j>>>16^65535)){C.msg="invalid stored block lengths",m.mode=30;break}if(m.length=65535&j,_=j=0,m.mode=15,I===6)break e;case 15:m.mode=16;case 16:if(ie=m.length){if(Z>>=5,_-=5,m.ndist=1+(31&j),j>>>=5,_-=5,m.ncode=4+(15&j),j>>>=4,_-=4,286>>=3,_-=3}for(;m.have<19;)m.lens[K[m.have++]]=0;if(m.lencode=m.lendyn,m.lenbits=7,z={bits:m.lenbits},U=s(0,m.lens,0,19,m.lencode,0,m.work,z),m.lenbits=z.bits,U){C.msg="invalid code lengths set",m.mode=30;break}m.have=0,m.mode=19;case 19:for(;m.have>>16&255,Oe=65535&w,!((ke=w>>>24)<=_);){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}if(Oe<16)j>>>=ke,_-=ke,m.lens[m.have++]=Oe;else{if(Oe===16){for(k=ke+2;_>>=ke,_-=ke,m.have===0){C.msg="invalid bit length repeat",m.mode=30;break}h=m.lens[m.have-1],ie=3+(3&j),j>>>=2,_-=2}else if(Oe===17){for(k=ke+3;_>>=ke)),j>>>=3,_-=3}else{for(k=ke+7;_>>=ke)),j>>>=7,_-=7}if(m.have+ie>m.nlen+m.ndist){C.msg="invalid bit length repeat",m.mode=30;break}for(;ie--;)m.lens[m.have++]=h}}if(m.mode===30)break;if(m.lens[256]===0){C.msg="invalid code -- missing end-of-block",m.mode=30;break}if(m.lenbits=9,z={bits:m.lenbits},U=s(u,m.lens,0,m.nlen,m.lencode,0,m.work,z),m.lenbits=z.bits,U){C.msg="invalid literal/lengths set",m.mode=30;break}if(m.distbits=6,m.distcode=m.distdyn,z={bits:m.distbits},U=s(d,m.lens,m.nlen,m.ndist,m.distcode,0,m.work,z),m.distbits=z.bits,U){C.msg="invalid distances set",m.mode=30;break}if(m.mode=20,I===6)break e;case 20:m.mode=21;case 21:if(6<=Z&&258<=ue){C.next_out=se,C.avail_out=ue,C.next_in=q,C.avail_in=Z,m.hold=j,m.bits=_,c(C,ce),se=C.next_out,ne=C.output,ue=C.avail_out,q=C.next_in,N=C.input,Z=C.avail_in,j=m.hold,_=m.bits,m.mode===12&&(m.back=-1);break}for(m.back=0;xe=(w=m.lencode[j&(1<>>16&255,Oe=65535&w,!((ke=w>>>24)<=_);){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}if(xe&&(240&xe)==0){for(we=ke,tt=xe,Be=Oe;xe=(w=m.lencode[Be+((j&(1<>we)])>>>16&255,Oe=65535&w,!(we+(ke=w>>>24)<=_);){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}j>>>=we,_-=we,m.back+=we}if(j>>>=ke,_-=ke,m.back+=ke,m.length=Oe,xe===0){m.mode=26;break}if(32&xe){m.back=-1,m.mode=12;break}if(64&xe){C.msg="invalid literal/length code",m.mode=30;break}m.extra=15&xe,m.mode=22;case 22:if(m.extra){for(k=m.extra;_>>=m.extra,_-=m.extra,m.back+=m.extra}m.was=m.length,m.mode=23;case 23:for(;xe=(w=m.distcode[j&(1<>>16&255,Oe=65535&w,!((ke=w>>>24)<=_);){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}if((240&xe)==0){for(we=ke,tt=xe,Be=Oe;xe=(w=m.distcode[Be+((j&(1<>we)])>>>16&255,Oe=65535&w,!(we+(ke=w>>>24)<=_);){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}j>>>=we,_-=we,m.back+=we}if(j>>>=ke,_-=ke,m.back+=ke,64&xe){C.msg="invalid distance code",m.mode=30;break}m.offset=Oe,m.extra=15&xe,m.mode=24;case 24:if(m.extra){for(k=m.extra;_>>=m.extra,_-=m.extra,m.back+=m.extra}if(m.offset>m.dmax){C.msg="invalid distance too far back",m.mode=30;break}m.mode=25;case 25:if(ue===0)break e;if(ie=ce-ue,m.offset>ie){if((ie=m.offset-ie)>m.whave&&m.sane){C.msg="invalid distance too far back",m.mode=30;break}be=ie>m.wnext?(ie-=m.wnext,m.wsize-ie):m.wnext-ie,ie>m.length&&(ie=m.length),Re=m.window}else Re=ne,be=se-m.offset,ie=m.length;for(ueE?(T=be[Re+y[I]],_[fe+y[I]]):(T=96,0),b=1<>se)+(x-=b)]=B<<24|T<<16|W|0,x!==0;);for(b=1<>=1;if(b!==0?(j&=b-1,j+=b):j=0,I++,--ce[C]==0){if(C===N)break;C=d[A+y[I]]}if(ne>>7)]}function fe(w,D){w.pending_buf[w.pending++]=255&D,w.pending_buf[w.pending++]=D>>>8&255}function ce(w,D,K){w.bi_valid>v-K?(w.bi_buf|=D<>v-w.bi_valid,w.bi_valid+=K-v):(w.bi_buf|=D<>>=1,K<<=1,0<--D;);return K>>>1}function Re(w,D,K){var Y,M,J=new Array(y+1),ae=0;for(Y=1;Y<=y;Y++)J[Y]=ae=ae+K[Y-1]<<1;for(M=0;M<=D;M++){var ee=w[2*M+1];ee!==0&&(w[2*M]=be(J[ee]++,ee))}}function ke(w){var D;for(D=0;D>1;1<=K;K--)we(w,J,K);for(M=pe;K=w.heap[1],w.heap[1]=w.heap[w.heap_len--],we(w,J,1),Y=w.heap[1],w.heap[--w.heap_max]=K,w.heap[--w.heap_max]=Y,J[2*M]=J[2*K]+J[2*Y],w.depth[M]=(w.depth[K]>=w.depth[Y]?w.depth[K]:w.depth[Y])+1,J[2*K+1]=J[2*Y+1]=M,w.heap[1]=M++,we(w,J,1),2<=w.heap_len;);w.heap[--w.heap_max]=w.heap[1],(function(ve,Ie){var rt,Me,G,oe,me,De,te=Ie.dyn_tree,ge=Ie.max_code,L=Ie.stat_desc.static_tree,ye=Ie.stat_desc.has_stree,Ge=Ie.stat_desc.extra_bits,S=Ie.stat_desc.extra_base,de=Ie.stat_desc.max_length,Ae=0;for(oe=0;oe<=y;oe++)ve.bl_count[oe]=0;for(te[2*ve.heap[ve.heap_max]+1]=0,rt=ve.heap_max+1;rt>=7;M>>=1)if(1&Ee&&ee.dyn_ltree[2*pe]!==0)return o;if(ee.dyn_ltree[18]!==0||ee.dyn_ltree[20]!==0||ee.dyn_ltree[26]!==0)return l;for(pe=32;pe>>3,(J=w.static_len+3+7>>>3)<=M&&(M=J)):M=J=K+5,K+4<=M&&D!==-1?k(w,D,K,Y):w.strategy===4||J===M?(ce(w,2+(Y?1:0),3),tt(w,H,C)):(ce(w,4+(Y?1:0),3),(function(ee,pe,Ee,ve){var Ie;for(ce(ee,pe-257,5),ce(ee,Ee-1,5),ce(ee,ve-4,4),Ie=0;Ie>>8&255,w.pending_buf[w.d_buf+2*w.last_lit+1]=255&D,w.pending_buf[w.l_buf+w.last_lit]=255&K,w.last_lit++,D===0?w.dyn_ltree[2*K]++:(w.matches++,D--,w.dyn_ltree[2*(m[K]+d+1)]++,w.dyn_dtree[2*_(D)]++),w.last_lit===w.lit_bufsize-1},i._tr_align=function(w){ce(w,2,3),ie(w,x,H),(function(D){D.bi_valid===16?(fe(D,D.bi_buf),D.bi_buf=0,D.bi_valid=0):8<=D.bi_valid&&(D.pending_buf[D.pending++]=255&D.bi_buf,D.bi_buf>>=8,D.bi_valid-=8)})(w)}},{"../utils/common":41}],53:[function(t,n,i){"use strict";n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,n,i){(function(a){(function(o,l){"use strict";if(!o.setImmediate){var c,s,u,d,A=1,f={},p=!1,g=o.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(o);y=y&&y.setTimeout?y:o,c={}.toString.call(o.process)==="[object process]"?function(P){process.nextTick(function(){b(P)})}:(function(){if(o.postMessage&&!o.importScripts){var P=!0,F=o.onmessage;return o.onmessage=function(){P=!1},o.postMessage("","*"),o.onmessage=F,P}})()?(d="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",x,!1):o.attachEvent("onmessage",x),function(P){o.postMessage(d+P,"*")}):o.MessageChannel?((u=new MessageChannel).port1.onmessage=function(P){b(P.data)},function(P){u.port2.postMessage(P)}):g&&"onreadystatechange"in g.createElement("script")?(s=g.documentElement,function(P){var F=g.createElement("script");F.onreadystatechange=function(){b(P),F.onreadystatechange=null,s.removeChild(F),F=null},s.appendChild(F)}):function(P){setTimeout(b,0,P)},y.setImmediate=function(P){typeof P!="function"&&(P=new Function(""+P));for(var F=new Array(arguments.length-1),R=0;R"u"?a===void 0?this:a:self)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})}}),pp=Lt({"node_modules/.pnpm/jszip@3.10.1/node_modules/jszip/dist/jszip.min.js"(e,r){(function(t){typeof e=="object"&&typeof r<"u"?r.exports=t():typeof define=="function"&&define.amd?define([],t):(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this).JSZip=t()})(function(){return(function t(n,i,a){function o(s,u){if(!i[s]){if(!n[s]){var d=typeof An=="function"&&An;if(!u&&d)return d(s,!0);if(l)return l(s,!0);var A=new Error("Cannot find module '"+s+"'");throw A.code="MODULE_NOT_FOUND",A}var f=i[s]={exports:{}};n[s][0].call(f.exports,function(p){var g=n[s][1][p];return o(g||p)},f,f.exports,t,n,i,a)}return i[s].exports}for(var l=typeof An=="function"&&An,c=0;c>2,f=(3&s)<<4|u>>4,p=1>6:64,g=2>4,u=(15&A)<<4|(f=l.indexOf(c.charAt(g++)))>>2,d=(3&f)<<6|(p=l.indexOf(c.charAt(g++))),b[y++]=s,f!==64&&(b[y++]=u),p!==64&&(b[y++]=d);return b}},{"./support":30,"./utils":32}],2:[function(t,n,i){"use strict";var a=t("./external"),o=t("./stream/DataWorker"),l=t("./stream/Crc32Probe"),c=t("./stream/DataLengthProbe");function s(u,d,A,f,p){this.compressedSize=u,this.uncompressedSize=d,this.crc32=A,this.compression=f,this.compressedContent=p}s.prototype={getContentWorker:function(){var u=new o(a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),d=this;return u.on("end",function(){if(this.streamInfo.data_length!==d.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new o(a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(u,d,A){return u.pipe(new l).pipe(new c("uncompressedSize")).pipe(d.compressWorker(A)).pipe(new c("compressedSize")).withStreamInfo("compression",d)},n.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,n,i){"use strict";var a=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new a("STORE compression")},uncompressWorker:function(){return new a("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,n,i){"use strict";var a=t("./utils"),o=(function(){for(var l,c=[],s=0;s<256;s++){l=s;for(var u=0;u<8;u++)l=1&l?3988292384^l>>>1:l>>>1;c[s]=l}return c})();n.exports=function(l,c){return l!==void 0&&l.length?a.getTypeOf(l)!=="string"?(function(s,u,d,A){var f=o,p=A+d;s^=-1;for(var g=A;g>>8^f[255&(s^u[g])];return-1^s})(0|c,l,l.length,0):(function(s,u,d,A){var f=o,p=A+d;s^=-1;for(var g=A;g>>8^f[255&(s^u.charCodeAt(g))];return-1^s})(0|c,l,l.length,0):0}},{"./utils":32}],5:[function(t,n,i){"use strict";i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,n,i){"use strict";var a=null;a=typeof Promise<"u"?Promise:t("lie"),n.exports={Promise:a}},{lie:37}],7:[function(t,n,i){"use strict";var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=t("pako"),l=t("./utils"),c=t("./stream/GenericWorker"),s=a?"uint8array":"array";function u(d,A){c.call(this,"FlateWorker/"+d),this._pako=null,this._pakoAction=d,this._pakoOptions=A,this.meta={}}i.magic="\b\0",l.inherits(u,c),u.prototype.processChunk=function(d){this.meta=d.meta,this._pako===null&&this._createPako(),this._pako.push(l.transformTo(s,d.data),!1)},u.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var d=this;this._pako.onData=function(A){d.push({data:A,meta:d.meta})}},i.compressWorker=function(d){return new u("Deflate",d)},i.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,n,i){"use strict";function a(f,p){var g,y="";for(g=0;g>>=8;return y}function o(f,p,g,y,v,b){var x,P,F=f.file,R=f.compression,E=b!==s.utf8encode,B=l.transformTo("string",b(F.name)),T=l.transformTo("string",s.utf8encode(F.name)),W=F.comment,H=l.transformTo("string",b(W)),C=l.transformTo("string",s.utf8encode(W)),I=T.length!==F.name.length,m=C.length!==W.length,N="",ne="",q="",se=F.dir,Z=F.date,ue={crc32:0,compressedSize:0,uncompressedSize:0};p&&!g||(ue.crc32=f.crc32,ue.compressedSize=f.compressedSize,ue.uncompressedSize=f.uncompressedSize);var j=0;p&&(j|=8),E||!I&&!m||(j|=2048);var _=0,fe=0;se&&(_|=16),v==="UNIX"?(fe=798,_|=(function(ie,be){var Re=ie;return ie||(Re=be?16893:33204),(65535&Re)<<16})(F.unixPermissions,se)):(fe=20,_|=(function(ie){return 63&(ie||0)})(F.dosPermissions)),x=Z.getUTCHours(),x<<=6,x|=Z.getUTCMinutes(),x<<=5,x|=Z.getUTCSeconds()/2,P=Z.getUTCFullYear()-1980,P<<=4,P|=Z.getUTCMonth()+1,P<<=5,P|=Z.getUTCDate(),I&&(ne=a(1,1)+a(u(B),4)+T,N+="up"+a(ne.length,2)+ne),m&&(q=a(1,1)+a(u(H),4)+C,N+="uc"+a(q.length,2)+q);var ce="";return ce+=` +\0`,ce+=a(j,2),ce+=R.magic,ce+=a(x,2),ce+=a(P,2),ce+=a(ue.crc32,4),ce+=a(ue.compressedSize,4),ce+=a(ue.uncompressedSize,4),ce+=a(B.length,2),ce+=a(N.length,2),{fileRecord:d.LOCAL_FILE_HEADER+ce+B+N,dirRecord:d.CENTRAL_FILE_HEADER+a(fe,2)+ce+a(H.length,2)+"\0\0\0\0"+a(_,4)+a(y,4)+B+N+H}}var l=t("../utils"),c=t("../stream/GenericWorker"),s=t("../utf8"),u=t("../crc32"),d=t("../signature");function A(f,p,g,y){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=g,this.encodeFileName=y,this.streamFiles=f,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}l.inherits(A,c),A.prototype.push=function(f){var p=f.meta.percent||0,g=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,c.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:g?(p+100*(g-y-1))/g:100}}))},A.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var p=this.streamFiles&&!f.file.dir;if(p){var g=o(f,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},A.prototype.closedSource=function(f){this.accumulate=!1;var p=this.streamFiles&&!f.file.dir,g=o(f,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),p)this.push({data:(function(y){return d.DATA_DESCRIPTOR+a(y.crc32,4)+a(y.compressedSize,4)+a(y.uncompressedSize,4)})(f),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},A.prototype.flush=function(){for(var f=this.bytesWritten,p=0;p=this.index;c--)s=(s<<8)+this.byteAt(c);return this.index+=l,s},readString:function(l){return a.transformTo("string",this.readData(l))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var l=this.readInt(4);return new Date(Date.UTC(1980+(l>>25&127),(l>>21&15)-1,l>>16&31,l>>11&31,l>>5&63,(31&l)<<1))}},n.exports=o},{"../utils":32}],19:[function(t,n,i){"use strict";var a=t("./Uint8ArrayReader");function o(l){a.call(this,l)}t("../utils").inherits(o,a),o.prototype.readData=function(l){this.checkOffset(l);var c=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},n.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,n,i){"use strict";var a=t("./DataReader");function o(l){a.call(this,l)}t("../utils").inherits(o,a),o.prototype.byteAt=function(l){return this.data.charCodeAt(this.zero+l)},o.prototype.lastIndexOfSignature=function(l){return this.data.lastIndexOf(l)-this.zero},o.prototype.readAndCheckSignature=function(l){return l===this.readData(4)},o.prototype.readData=function(l){this.checkOffset(l);var c=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},n.exports=o},{"../utils":32,"./DataReader":18}],21:[function(t,n,i){"use strict";var a=t("./ArrayReader");function o(l){a.call(this,l)}t("../utils").inherits(o,a),o.prototype.readData=function(l){if(this.checkOffset(l),l===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},n.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(t,n,i){"use strict";var a=t("../utils"),o=t("../support"),l=t("./ArrayReader"),c=t("./StringReader"),s=t("./NodeBufferReader"),u=t("./Uint8ArrayReader");n.exports=function(d){var A=a.getTypeOf(d);return a.checkSupport(A),A!=="string"||o.uint8array?A==="nodebuffer"?new s(d):o.uint8array?new u(a.transformTo("uint8array",d)):new l(a.transformTo("array",d)):new c(d)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,n,i){"use strict";i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,n,i){"use strict";var a=t("./GenericWorker"),o=t("../utils");function l(c){a.call(this,"ConvertWorker to "+c),this.destType=c}o.inherits(l,a),l.prototype.processChunk=function(c){this.push({data:o.transformTo(this.destType,c.data),meta:c.meta})},n.exports=l},{"../utils":32,"./GenericWorker":28}],25:[function(t,n,i){"use strict";var a=t("./GenericWorker"),o=t("../crc32");function l(){a.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(l,a),l.prototype.processChunk=function(c){this.streamInfo.crc32=o(c.data,this.streamInfo.crc32||0),this.push(c)},n.exports=l},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,n,i){"use strict";var a=t("../utils"),o=t("./GenericWorker");function l(c){o.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}a.inherits(l,o),l.prototype.processChunk=function(c){if(c){var s=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=s+c.data.length}o.prototype.processChunk.call(this,c)},n.exports=l},{"../utils":32,"./GenericWorker":28}],27:[function(t,n,i){"use strict";var a=t("../utils"),o=t("./GenericWorker");function l(c){o.call(this,"DataWorker");var s=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(u){s.dataIsReady=!0,s.data=u,s.max=u&&u.length||0,s.type=a.getTypeOf(u),s.isPaused||s._tickAndRepeat()},function(u){s.error(u)})}a.inherits(l,o),l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},l.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,a.delay(this._tickAndRepeat,[],this)),!0)},l.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(a.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},l.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,s=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,s);break;case"uint8array":c=this.data.subarray(this.index,s);break;case"array":case"nodebuffer":c=this.data.slice(this.index,s)}return this.index=s,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=l},{"../utils":32,"./GenericWorker":28}],28:[function(t,n,i){"use strict";function a(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}a.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,l){return this._listeners[o].push(l),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,l){if(this._listeners[o])for(var c=0;c "+o:o}},n.exports=a},{}],29:[function(t,n,i){"use strict";var a=t("../utils"),o=t("./ConvertWorker"),l=t("./GenericWorker"),c=t("../base64"),s=t("../support"),u=t("../external"),d=null;if(s.nodestream)try{d=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function A(p,g){return new u.Promise(function(y,v){var b=[],x=p._internalType,P=p._outputType,F=p._mimeType;p.on("data",function(R,E){b.push(R),g&&g(E)}).on("error",function(R){b=[],v(R)}).on("end",function(){try{var R=(function(E,B,T){switch(E){case"blob":return a.newBlob(a.transformTo("arraybuffer",B),T);case"base64":return c.encode(B);default:return a.transformTo(E,B)}})(P,(function(E,B){var T,W=0,H=null,C=0;for(T=0;T"u")i.blob=!1;else{var a=new ArrayBuffer(0);try{i.blob=new Blob([a],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(a),i.blob=o.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!t("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(t,n,i){"use strict";for(var a=t("./utils"),o=t("./support"),l=t("./nodejsUtils"),c=t("./stream/GenericWorker"),s=new Array(256),u=0;u<256;u++)s[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;s[254]=s[254]=1;function d(){c.call(this,"utf-8 decode"),this.leftOver=null}function A(){c.call(this,"utf-8 encode")}i.utf8encode=function(f){return o.nodebuffer?l.newBufferFrom(f,"utf-8"):(function(p){var g,y,v,b,x,P=p.length,F=0;for(b=0;b>>6:(y<65536?g[x++]=224|y>>>12:(g[x++]=240|y>>>18,g[x++]=128|y>>>12&63),g[x++]=128|y>>>6&63),g[x++]=128|63&y);return g})(f)},i.utf8decode=function(f){return o.nodebuffer?a.transformTo("nodebuffer",f).toString("utf-8"):(function(p){var g,y,v,b,x=p.length,P=new Array(2*x);for(g=y=0;g>10&1023,P[y++]=56320|1023&v)}return P.length!==y&&(P.subarray?P=P.subarray(0,y):P.length=y),a.applyFromCharCode(P)})(f=a.transformTo(o.uint8array?"uint8array":"array",f))},a.inherits(d,c),d.prototype.processChunk=function(f){var p=a.transformTo(o.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var g=p;(p=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),p.set(g,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var y=(function(b,x){var P;for((x=x||b.length)>b.length&&(x=b.length),P=x-1;0<=P&&(192&b[P])==128;)P--;return P<0||P===0?x:P+s[b[P]]>x?P:x})(p),v=p;y!==p.length&&(o.uint8array?(v=p.subarray(0,y),this.leftOver=p.subarray(y,p.length)):(v=p.slice(0,y),this.leftOver=p.slice(y,p.length))),this.push({data:i.utf8decode(v),meta:f.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=d,a.inherits(A,c),A.prototype.processChunk=function(f){this.push({data:i.utf8encode(f.data),meta:f.meta})},i.Utf8EncodeWorker=A},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,n,i){"use strict";var a=t("./support"),o=t("./base64"),l=t("./nodejsUtils"),c=t("./external");function s(g){return g}function u(g,y){for(var v=0;v>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=a(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var p,g,y,v=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4>>6:(f<65536?A[y++]=224|f>>>12:(A[y++]=240|f>>>18,A[y++]=128|f>>>12&63),A[y++]=128|f>>>6&63),A[y++]=128|63&f);return A},i.buf2binstring=function(d){return u(d,d.length)},i.binstring2buf=function(d){for(var A=new a.Buf8(d.length),f=0,p=A.length;f>10&1023,b[p++]=56320|1023&g)}return u(b,p)},i.utf8border=function(d,A){var f;for((A=A||d.length)>d.length&&(A=d.length),f=A-1;0<=f&&(192&d[f])==128;)f--;return f<0||f===0?A:f+c[d[f]]>A?f:A}},{"./common":41}],43:[function(t,n,i){"use strict";n.exports=function(a,o,l,c){for(var s=65535&a|0,u=a>>>16&65535|0,d=0;l!==0;){for(l-=d=2e3>>1:o>>>1;l[c]=o}return l})();n.exports=function(o,l,c,s){var u=a,d=s+c;o^=-1;for(var A=s;A>>8^u[255&(o^l[A])];return-1^o}},{}],46:[function(t,n,i){"use strict";var a,o=t("../utils/common"),l=t("./trees"),c=t("./adler32"),s=t("./crc32"),u=t("./messages"),d=0,A=4,f=0,p=-2,g=-1,y=4,v=2,b=8,x=9,P=286,F=30,R=19,E=2*P+1,B=15,T=3,W=258,H=W+T+1,C=42,I=113,m=1,N=2,ne=3,q=4;function se(h,U){return h.msg=u[U],U}function Z(h){return(h<<1)-(4h.avail_out&&(z=h.avail_out),z!==0&&(o.arraySet(h.output,U.pending_buf,U.pending_out,z,h.next_out),h.next_out+=z,U.pending_out+=z,h.total_out+=z,h.avail_out-=z,U.pending-=z,U.pending===0&&(U.pending_out=0))}function _(h,U){l._tr_flush_block(h,0<=h.block_start?h.block_start:-1,h.strstart-h.block_start,U),h.block_start=h.strstart,j(h.strm)}function fe(h,U){h.pending_buf[h.pending++]=U}function ce(h,U){h.pending_buf[h.pending++]=U>>>8&255,h.pending_buf[h.pending++]=255&U}function ie(h,U){var z,k,w=h.max_chain_length,D=h.strstart,K=h.prev_length,Y=h.nice_match,M=h.strstart>h.w_size-H?h.strstart-(h.w_size-H):0,J=h.window,ae=h.w_mask,ee=h.prev,pe=h.strstart+W,Ee=J[D+K-1],ve=J[D+K];h.prev_length>=h.good_match&&(w>>=2),Y>h.lookahead&&(Y=h.lookahead);do if(J[(z=U)+K]===ve&&J[z+K-1]===Ee&&J[z]===J[D]&&J[++z]===J[D+1]){D+=2,z++;do;while(J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&J[++D]===J[++z]&&DM&&--w!=0);return K<=h.lookahead?K:h.lookahead}function be(h){var U,z,k,w,D,K,Y,M,J,ae,ee=h.w_size;do{if(w=h.window_size-h.lookahead-h.strstart,h.strstart>=ee+(ee-H)){for(o.arraySet(h.window,h.window,ee,ee,0),h.match_start-=ee,h.strstart-=ee,h.block_start-=ee,U=z=h.hash_size;k=h.head[--U],h.head[U]=ee<=k?k-ee:0,--z;);for(U=z=ee;k=h.prev[--U],h.prev[U]=ee<=k?k-ee:0,--z;);w+=ee}if(h.strm.avail_in===0)break;if(K=h.strm,Y=h.window,M=h.strstart+h.lookahead,J=w,ae=void 0,ae=K.avail_in,J=T)for(D=h.strstart-h.insert,h.ins_h=h.window[D],h.ins_h=(h.ins_h<=T&&(h.ins_h=(h.ins_h<=T)if(k=l._tr_tally(h,h.strstart-h.match_start,h.match_length-T),h.lookahead-=h.match_length,h.match_length<=h.max_lazy_match&&h.lookahead>=T){for(h.match_length--;h.strstart++,h.ins_h=(h.ins_h<=T&&(h.ins_h=(h.ins_h<=T&&h.match_length<=h.prev_length){for(w=h.strstart+h.lookahead-T,k=l._tr_tally(h,h.strstart-1-h.prev_match,h.prev_length-T),h.lookahead-=h.prev_length-1,h.prev_length-=2;++h.strstart<=w&&(h.ins_h=(h.ins_h<h.pending_buf_size-5&&(z=h.pending_buf_size-5);;){if(h.lookahead<=1){if(be(h),h.lookahead===0&&U===d)return m;if(h.lookahead===0)break}h.strstart+=h.lookahead,h.lookahead=0;var k=h.block_start+z;if((h.strstart===0||h.strstart>=k)&&(h.lookahead=h.strstart-k,h.strstart=k,_(h,!1),h.strm.avail_out===0)||h.strstart-h.block_start>=h.w_size-H&&(_(h,!1),h.strm.avail_out===0))return m}return h.insert=0,U===A?(_(h,!0),h.strm.avail_out===0?ne:q):(h.strstart>h.block_start&&(_(h,!1),h.strm.avail_out),m)}),new xe(4,4,8,4,Re),new xe(4,5,16,8,Re),new xe(4,6,32,32,Re),new xe(4,4,16,16,ke),new xe(8,16,32,32,ke),new xe(8,16,128,128,ke),new xe(8,32,128,256,ke),new xe(32,128,258,1024,ke),new xe(32,258,258,4096,ke)],i.deflateInit=function(h,U){return Be(h,U,b,15,8,0)},i.deflateInit2=Be,i.deflateReset=tt,i.deflateResetKeep=we,i.deflateSetHeader=function(h,U){return h&&h.state?h.state.wrap!==2?p:(h.state.gzhead=U,f):p},i.deflate=function(h,U){var z,k,w,D;if(!h||!h.state||5>8&255),fe(k,k.gzhead.time>>16&255),fe(k,k.gzhead.time>>24&255),fe(k,k.level===9?2:2<=k.strategy||k.level<2?4:0),fe(k,255&k.gzhead.os),k.gzhead.extra&&k.gzhead.extra.length&&(fe(k,255&k.gzhead.extra.length),fe(k,k.gzhead.extra.length>>8&255)),k.gzhead.hcrc&&(h.adler=s(h.adler,k.pending_buf,k.pending,0)),k.gzindex=0,k.status=69):(fe(k,0),fe(k,0),fe(k,0),fe(k,0),fe(k,0),fe(k,k.level===9?2:2<=k.strategy||k.level<2?4:0),fe(k,3),k.status=I);else{var K=b+(k.w_bits-8<<4)<<8;K|=(2<=k.strategy||k.level<2?0:k.level<6?1:k.level===6?2:3)<<6,k.strstart!==0&&(K|=32),K+=31-K%31,k.status=I,ce(k,K),k.strstart!==0&&(ce(k,h.adler>>>16),ce(k,65535&h.adler)),h.adler=1}if(k.status===69)if(k.gzhead.extra){for(w=k.pending;k.gzindex<(65535&k.gzhead.extra.length)&&(k.pending!==k.pending_buf_size||(k.gzhead.hcrc&&k.pending>w&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),j(h),w=k.pending,k.pending!==k.pending_buf_size));)fe(k,255&k.gzhead.extra[k.gzindex]),k.gzindex++;k.gzhead.hcrc&&k.pending>w&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),k.gzindex===k.gzhead.extra.length&&(k.gzindex=0,k.status=73)}else k.status=73;if(k.status===73)if(k.gzhead.name){w=k.pending;do{if(k.pending===k.pending_buf_size&&(k.gzhead.hcrc&&k.pending>w&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),j(h),w=k.pending,k.pending===k.pending_buf_size)){D=1;break}D=k.gzindexw&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),D===0&&(k.gzindex=0,k.status=91)}else k.status=91;if(k.status===91)if(k.gzhead.comment){w=k.pending;do{if(k.pending===k.pending_buf_size&&(k.gzhead.hcrc&&k.pending>w&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),j(h),w=k.pending,k.pending===k.pending_buf_size)){D=1;break}D=k.gzindexw&&(h.adler=s(h.adler,k.pending_buf,k.pending-w,w)),D===0&&(k.status=103)}else k.status=103;if(k.status===103&&(k.gzhead.hcrc?(k.pending+2>k.pending_buf_size&&j(h),k.pending+2<=k.pending_buf_size&&(fe(k,255&h.adler),fe(k,h.adler>>8&255),h.adler=0,k.status=I)):k.status=I),k.pending!==0){if(j(h),h.avail_out===0)return k.last_flush=-1,f}else if(h.avail_in===0&&Z(U)<=Z(z)&&U!==A)return se(h,-5);if(k.status===666&&h.avail_in!==0)return se(h,-5);if(h.avail_in!==0||k.lookahead!==0||U!==d&&k.status!==666){var Y=k.strategy===2?(function(M,J){for(var ae;;){if(M.lookahead===0&&(be(M),M.lookahead===0)){if(J===d)return m;break}if(M.match_length=0,ae=l._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++,ae&&(_(M,!1),M.strm.avail_out===0))return m}return M.insert=0,J===A?(_(M,!0),M.strm.avail_out===0?ne:q):M.last_lit&&(_(M,!1),M.strm.avail_out===0)?m:N})(k,U):k.strategy===3?(function(M,J){for(var ae,ee,pe,Ee,ve=M.window;;){if(M.lookahead<=W){if(be(M),M.lookahead<=W&&J===d)return m;if(M.lookahead===0)break}if(M.match_length=0,M.lookahead>=T&&0M.lookahead&&(M.match_length=M.lookahead)}if(M.match_length>=T?(ae=l._tr_tally(M,1,M.match_length-T),M.lookahead-=M.match_length,M.strstart+=M.match_length,M.match_length=0):(ae=l._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++),ae&&(_(M,!1),M.strm.avail_out===0))return m}return M.insert=0,J===A?(_(M,!0),M.strm.avail_out===0?ne:q):M.last_lit&&(_(M,!1),M.strm.avail_out===0)?m:N})(k,U):a[k.level].func(k,U);if(Y!==ne&&Y!==q||(k.status=666),Y===m||Y===ne)return h.avail_out===0&&(k.last_flush=-1),f;if(Y===N&&(U===1?l._tr_align(k):U!==5&&(l._tr_stored_block(k,0,0,!1),U===3&&(ue(k.head),k.lookahead===0&&(k.strstart=0,k.block_start=0,k.insert=0))),j(h),h.avail_out===0))return k.last_flush=-1,f}return U!==A?f:k.wrap<=0?1:(k.wrap===2?(fe(k,255&h.adler),fe(k,h.adler>>8&255),fe(k,h.adler>>16&255),fe(k,h.adler>>24&255),fe(k,255&h.total_in),fe(k,h.total_in>>8&255),fe(k,h.total_in>>16&255),fe(k,h.total_in>>24&255)):(ce(k,h.adler>>>16),ce(k,65535&h.adler)),j(h),0=z.w_size&&(D===0&&(ue(z.head),z.strstart=0,z.block_start=0,z.insert=0),J=new o.Buf8(z.w_size),o.arraySet(J,U,ae-z.w_size,z.w_size,0),U=J,ae=z.w_size),K=h.avail_in,Y=h.next_in,M=h.input,h.avail_in=ae,h.next_in=0,h.input=U,be(z);z.lookahead>=T;){for(k=z.strstart,w=z.lookahead-(T-1);z.ins_h=(z.ins_h<>>=T=B>>>24,x-=T,(T=B>>>16&255)===0)N[u++]=65535&B;else{if(!(16&T)){if((64&T)==0){B=P[(65535&B)+(b&(1<>>=T,x-=T),x<15&&(b+=m[c++]<>>=T=B>>>24,x-=T,!(16&(T=B>>>16&255))){if((64&T)==0){B=F[(65535&B)+(b&(1<>>=T,x-=T,(T=u-d)>3,b&=(1<<(x-=W<<3))-1,a.next_in=c,a.next_out=u,a.avail_in=c>>24&255)+(C>>>8&65280)+((65280&C)<<8)+((255&C)<<24)}function b(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function x(C){var I;return C&&C.state?(I=C.state,C.total_in=C.total_out=I.total=0,C.msg="",I.wrap&&(C.adler=1&I.wrap),I.mode=p,I.last=0,I.havedict=0,I.dmax=32768,I.head=null,I.hold=0,I.bits=0,I.lencode=I.lendyn=new a.Buf32(g),I.distcode=I.distdyn=new a.Buf32(y),I.sane=1,I.back=-1,A):f}function P(C){var I;return C&&C.state?((I=C.state).wsize=0,I.whave=0,I.wnext=0,x(C)):f}function F(C,I){var m,N;return C&&C.state?(N=C.state,I<0?(m=0,I=-I):(m=1+(I>>4),I<48&&(I&=15)),I&&(I<8||15=q.wsize?(a.arraySet(q.window,I,m-q.wsize,q.wsize,0),q.wnext=0,q.whave=q.wsize):(N<(ne=q.wsize-q.wnext)&&(ne=N),a.arraySet(q.window,I,m-N,ne,q.wnext),(N-=ne)?(a.arraySet(q.window,I,m-N,N,0),q.wnext=N,q.whave=q.wsize):(q.wnext+=ne,q.wnext===q.wsize&&(q.wnext=0),q.whave>>8&255,m.check=l(m.check,D,2,0),_=j=0,m.mode=2;break}if(m.flags=0,m.head&&(m.head.done=!1),!(1&m.wrap)||(((255&j)<<8)+(j>>8))%31){C.msg="incorrect header check",m.mode=30;break}if((15&j)!=8){C.msg="unknown compression method",m.mode=30;break}if(_-=4,h=8+(15&(j>>>=4)),m.wbits===0)m.wbits=h;else if(h>m.wbits){C.msg="invalid window size",m.mode=30;break}m.dmax=1<>8&1),512&m.flags&&(D[0]=255&j,D[1]=j>>>8&255,m.check=l(m.check,D,2,0)),_=j=0,m.mode=3;case 3:for(;_<32;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}m.head&&(m.head.time=j),512&m.flags&&(D[0]=255&j,D[1]=j>>>8&255,D[2]=j>>>16&255,D[3]=j>>>24&255,m.check=l(m.check,D,4,0)),_=j=0,m.mode=4;case 4:for(;_<16;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}m.head&&(m.head.xflags=255&j,m.head.os=j>>8),512&m.flags&&(D[0]=255&j,D[1]=j>>>8&255,m.check=l(m.check,D,2,0)),_=j=0,m.mode=5;case 5:if(1024&m.flags){for(;_<16;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}m.length=j,m.head&&(m.head.extra_len=j),512&m.flags&&(D[0]=255&j,D[1]=j>>>8&255,m.check=l(m.check,D,2,0)),_=j=0}else m.head&&(m.head.extra=null);m.mode=6;case 6:if(1024&m.flags&&(Z<(ie=m.length)&&(ie=Z),ie&&(m.head&&(h=m.head.extra_len-m.length,m.head.extra||(m.head.extra=new Array(m.head.extra_len)),a.arraySet(m.head.extra,N,q,ie,h)),512&m.flags&&(m.check=l(m.check,N,ie,q)),Z-=ie,q+=ie,m.length-=ie),m.length))break e;m.length=0,m.mode=7;case 7:if(2048&m.flags){if(Z===0)break e;for(ie=0;h=N[q+ie++],m.head&&h&&m.length<65536&&(m.head.name+=String.fromCharCode(h)),h&&ie>9&1,m.head.done=!0),C.adler=m.check=0,m.mode=12;break;case 10:for(;_<32;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}C.adler=m.check=v(j),_=j=0,m.mode=11;case 11:if(m.havedict===0)return C.next_out=se,C.avail_out=ue,C.next_in=q,C.avail_in=Z,m.hold=j,m.bits=_,2;C.adler=m.check=1,m.mode=12;case 12:if(I===5||I===6)break e;case 13:if(m.last){j>>>=7&_,_-=7&_,m.mode=27;break}for(;_<3;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}switch(m.last=1&j,_-=1,3&(j>>>=1)){case 0:m.mode=14;break;case 1:if(W(m),m.mode=20,I!==6)break;j>>>=2,_-=2;break e;case 2:m.mode=17;break;case 3:C.msg="invalid block type",m.mode=30}j>>>=2,_-=2;break;case 14:for(j>>>=7&_,_-=7&_;_<32;){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}if((65535&j)!=(j>>>16^65535)){C.msg="invalid stored block lengths",m.mode=30;break}if(m.length=65535&j,_=j=0,m.mode=15,I===6)break e;case 15:m.mode=16;case 16:if(ie=m.length){if(Z>>=5,_-=5,m.ndist=1+(31&j),j>>>=5,_-=5,m.ncode=4+(15&j),j>>>=4,_-=4,286>>=3,_-=3}for(;m.have<19;)m.lens[K[m.have++]]=0;if(m.lencode=m.lendyn,m.lenbits=7,z={bits:m.lenbits},U=s(0,m.lens,0,19,m.lencode,0,m.work,z),m.lenbits=z.bits,U){C.msg="invalid code lengths set",m.mode=30;break}m.have=0,m.mode=19;case 19:for(;m.have>>16&255,Oe=65535&w,!((ke=w>>>24)<=_);){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}if(Oe<16)j>>>=ke,_-=ke,m.lens[m.have++]=Oe;else{if(Oe===16){for(k=ke+2;_>>=ke,_-=ke,m.have===0){C.msg="invalid bit length repeat",m.mode=30;break}h=m.lens[m.have-1],ie=3+(3&j),j>>>=2,_-=2}else if(Oe===17){for(k=ke+3;_>>=ke)),j>>>=3,_-=3}else{for(k=ke+7;_>>=ke)),j>>>=7,_-=7}if(m.have+ie>m.nlen+m.ndist){C.msg="invalid bit length repeat",m.mode=30;break}for(;ie--;)m.lens[m.have++]=h}}if(m.mode===30)break;if(m.lens[256]===0){C.msg="invalid code -- missing end-of-block",m.mode=30;break}if(m.lenbits=9,z={bits:m.lenbits},U=s(u,m.lens,0,m.nlen,m.lencode,0,m.work,z),m.lenbits=z.bits,U){C.msg="invalid literal/lengths set",m.mode=30;break}if(m.distbits=6,m.distcode=m.distdyn,z={bits:m.distbits},U=s(d,m.lens,m.nlen,m.ndist,m.distcode,0,m.work,z),m.distbits=z.bits,U){C.msg="invalid distances set",m.mode=30;break}if(m.mode=20,I===6)break e;case 20:m.mode=21;case 21:if(6<=Z&&258<=ue){C.next_out=se,C.avail_out=ue,C.next_in=q,C.avail_in=Z,m.hold=j,m.bits=_,c(C,ce),se=C.next_out,ne=C.output,ue=C.avail_out,q=C.next_in,N=C.input,Z=C.avail_in,j=m.hold,_=m.bits,m.mode===12&&(m.back=-1);break}for(m.back=0;xe=(w=m.lencode[j&(1<>>16&255,Oe=65535&w,!((ke=w>>>24)<=_);){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}if(xe&&(240&xe)==0){for(we=ke,tt=xe,Be=Oe;xe=(w=m.lencode[Be+((j&(1<>we)])>>>16&255,Oe=65535&w,!(we+(ke=w>>>24)<=_);){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}j>>>=we,_-=we,m.back+=we}if(j>>>=ke,_-=ke,m.back+=ke,m.length=Oe,xe===0){m.mode=26;break}if(32&xe){m.back=-1,m.mode=12;break}if(64&xe){C.msg="invalid literal/length code",m.mode=30;break}m.extra=15&xe,m.mode=22;case 22:if(m.extra){for(k=m.extra;_>>=m.extra,_-=m.extra,m.back+=m.extra}m.was=m.length,m.mode=23;case 23:for(;xe=(w=m.distcode[j&(1<>>16&255,Oe=65535&w,!((ke=w>>>24)<=_);){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}if((240&xe)==0){for(we=ke,tt=xe,Be=Oe;xe=(w=m.distcode[Be+((j&(1<>we)])>>>16&255,Oe=65535&w,!(we+(ke=w>>>24)<=_);){if(Z===0)break e;Z--,j+=N[q++]<<_,_+=8}j>>>=we,_-=we,m.back+=we}if(j>>>=ke,_-=ke,m.back+=ke,64&xe){C.msg="invalid distance code",m.mode=30;break}m.offset=Oe,m.extra=15&xe,m.mode=24;case 24:if(m.extra){for(k=m.extra;_>>=m.extra,_-=m.extra,m.back+=m.extra}if(m.offset>m.dmax){C.msg="invalid distance too far back",m.mode=30;break}m.mode=25;case 25:if(ue===0)break e;if(ie=ce-ue,m.offset>ie){if((ie=m.offset-ie)>m.whave&&m.sane){C.msg="invalid distance too far back",m.mode=30;break}be=ie>m.wnext?(ie-=m.wnext,m.wsize-ie):m.wnext-ie,ie>m.length&&(ie=m.length),Re=m.window}else Re=ne,be=se-m.offset,ie=m.length;for(ueE?(T=be[Re+y[I]],_[fe+y[I]]):(T=96,0),b=1<>se)+(x-=b)]=B<<24|T<<16|W|0,x!==0;);for(b=1<>=1;if(b!==0?(j&=b-1,j+=b):j=0,I++,--ce[C]==0){if(C===N)break;C=d[A+y[I]]}if(ne>>7)]}function fe(w,D){w.pending_buf[w.pending++]=255&D,w.pending_buf[w.pending++]=D>>>8&255}function ce(w,D,K){w.bi_valid>v-K?(w.bi_buf|=D<>v-w.bi_valid,w.bi_valid+=K-v):(w.bi_buf|=D<>>=1,K<<=1,0<--D;);return K>>>1}function Re(w,D,K){var Y,M,J=new Array(y+1),ae=0;for(Y=1;Y<=y;Y++)J[Y]=ae=ae+K[Y-1]<<1;for(M=0;M<=D;M++){var ee=w[2*M+1];ee!==0&&(w[2*M]=be(J[ee]++,ee))}}function ke(w){var D;for(D=0;D>1;1<=K;K--)we(w,J,K);for(M=pe;K=w.heap[1],w.heap[1]=w.heap[w.heap_len--],we(w,J,1),Y=w.heap[1],w.heap[--w.heap_max]=K,w.heap[--w.heap_max]=Y,J[2*M]=J[2*K]+J[2*Y],w.depth[M]=(w.depth[K]>=w.depth[Y]?w.depth[K]:w.depth[Y])+1,J[2*K+1]=J[2*Y+1]=M,w.heap[1]=M++,we(w,J,1),2<=w.heap_len;);w.heap[--w.heap_max]=w.heap[1],(function(ve,Ie){var rt,Me,G,oe,me,De,te=Ie.dyn_tree,ge=Ie.max_code,L=Ie.stat_desc.static_tree,ye=Ie.stat_desc.has_stree,Ge=Ie.stat_desc.extra_bits,S=Ie.stat_desc.extra_base,de=Ie.stat_desc.max_length,Ae=0;for(oe=0;oe<=y;oe++)ve.bl_count[oe]=0;for(te[2*ve.heap[ve.heap_max]+1]=0,rt=ve.heap_max+1;rt>=7;M>>=1)if(1&Ee&&ee.dyn_ltree[2*pe]!==0)return o;if(ee.dyn_ltree[18]!==0||ee.dyn_ltree[20]!==0||ee.dyn_ltree[26]!==0)return l;for(pe=32;pe>>3,(J=w.static_len+3+7>>>3)<=M&&(M=J)):M=J=K+5,K+4<=M&&D!==-1?k(w,D,K,Y):w.strategy===4||J===M?(ce(w,2+(Y?1:0),3),tt(w,H,C)):(ce(w,4+(Y?1:0),3),(function(ee,pe,Ee,ve){var Ie;for(ce(ee,pe-257,5),ce(ee,Ee-1,5),ce(ee,ve-4,4),Ie=0;Ie>>8&255,w.pending_buf[w.d_buf+2*w.last_lit+1]=255&D,w.pending_buf[w.l_buf+w.last_lit]=255&K,w.last_lit++,D===0?w.dyn_ltree[2*K]++:(w.matches++,D--,w.dyn_ltree[2*(m[K]+d+1)]++,w.dyn_dtree[2*_(D)]++),w.last_lit===w.lit_bufsize-1},i._tr_align=function(w){ce(w,2,3),ie(w,x,H),(function(D){D.bi_valid===16?(fe(D,D.bi_buf),D.bi_buf=0,D.bi_valid=0):8<=D.bi_valid&&(D.pending_buf[D.pending++]=255&D.bi_buf,D.bi_buf>>=8,D.bi_valid-=8)})(w)}},{"../utils/common":41}],53:[function(t,n,i){"use strict";n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,n,i){(function(a){(function(o,l){"use strict";if(!o.setImmediate){var c,s,u,d,A=1,f={},p=!1,g=o.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(o);y=y&&y.setTimeout?y:o,c={}.toString.call(o.process)==="[object process]"?function(P){process.nextTick(function(){b(P)})}:(function(){if(o.postMessage&&!o.importScripts){var P=!0,F=o.onmessage;return o.onmessage=function(){P=!1},o.postMessage("","*"),o.onmessage=F,P}})()?(d="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",x,!1):o.attachEvent("onmessage",x),function(P){o.postMessage(d+P,"*")}):o.MessageChannel?((u=new MessageChannel).port1.onmessage=function(P){b(P.data)},function(P){u.port2.postMessage(P)}):g&&"onreadystatechange"in g.createElement("script")?(s=g.documentElement,function(P){var F=g.createElement("script");F.onreadystatechange=function(){b(P),F.onreadystatechange=null,s.removeChild(F),F=null},s.appendChild(F)}):function(P){setTimeout(b,0,P)},y.setImmediate=function(P){typeof P!="function"&&(P=new Function(""+P));for(var F=new Array(arguments.length-1),R=0;R"u"?a===void 0?this:a:self)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})}}),Mu=Lt({"(disabled):node:fs"(){}}),Ap=Lt({"(disabled):node:https"(){}}),Ns=function(e,r){return Ns=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},Ns(e,r)};function Te(e,r){Ns(e,r);function t(){this.constructor=e}e.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}var Je=function(){return Je=Object.assign||function(r){for(var t,n=1,i=arguments.length;n0&&a[a.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]>2],r+=ii[(e[n]&3)<<4|e[n+1]>>4],r+=ii[(e[n+1]&15)<<2|e[n+2]>>6],r+=ii[e[n+2]&63];return t%3===2?r=r.substring(0,r.length-1)+"=":t%3===1&&(r=r.substring(0,r.length-2)+"=="),r},qc=function(e){var r=e.length*.75,t=e.length,n,i=0,a,o,l,c;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);var s=new Uint8Array(r);for(n=0;n>4,s[i++]=(o&15)<<4|l>>2,s[i++]=(l&3)<<6|c&63;return s},vp=/^(data)?:?([\w\/\+]+)?;?(charset=[\w-]+|base64)?.*,/i,yp=function(e){var r=e.trim(),t=r.substring(0,100),n=t.match(vp);if(!n)return qc(r);var i=n[0],a=r.substring(i.length);return qc(a)},Ye=function(e){return e.charCodeAt(0)},bp=function(e){return e.codePointAt(0)},ia=function(e,r){return Er(e.toString(16),r,"0").toUpperCase()},So=function(e){return ia(e,2)},Xr=function(e){return String.fromCharCode(e)},wp=function(e){return Xr(parseInt(e,16))},Er=function(e,r,t){for(var n="",i=0,a=r-e.length;i=55296&&t<=56319&&e.length>i&&(n=e.charCodeAt(i),n>=56320&&n<=57343&&(a=2)),[e.slice(r,r+a),a]},kp=function(e){for(var r=[],t=0,n=e.length;tt&&s(),o+=A,l+=f}}return s(),c},Fp=/^D:(\d\d\d\d)(\d\d)?(\d\d)?(\d\d)?(\d\d)?(\d\d)?([+\-Z])?(\d\d)?'?(\d\d)?'?$/,Gu=function(e){var r=e.match(Fp);if(r){var t=r[1],n=r[2],i=n===void 0?"01":n,a=r[3],o=a===void 0?"01":a,l=r[4],c=l===void 0?"00":l,s=r[5],u=s===void 0?"00":s,d=r[6],A=d===void 0?"00":d,f=r[7],p=f===void 0?"Z":f,g=r[8],y=g===void 0?"00":g,v=r[9],b=v===void 0?"00":v,x=p==="Z"?"Z":""+p+y+":"+b,P=new Date(t+"-"+i+"-"+o+"T"+c+":"+u+":"+A+x);return P}},nl=function(e,r){for(var t,n=0,i;n=0&&e<=65535},Op=function(e){return e>=65536&&e<=1114111},qu=function(e){return Math.floor((e-65536)/1024)+55296},Vu=function(e){return(e-65536)%1024+56320},mn;(function(e){e.BigEndian="BigEndian",e.LittleEndian="LittleEndian"})(mn||(mn={}));var Ri="\uFFFD".codePointAt(0),Xu=function(e,r){if(r===void 0&&(r=!0),e.length<=1)return String.fromCodePoint(Ri);for(var t=r?Up(e):mn.BigEndian,n=r?2:0,i=[];e.length-n>=2;){var a=Xc(e[n++],e[n++],t);if(_p(a))if(e.length-n<2)i.push(Ri);else{var o=Xc(e[n++],e[n++],t);Vc(o)?i.push(a,o):i.push(Ri)}else Vc(a)?(n+=2,i.push(Ri)):i.push(a)}return n=55296&&e<=56319},Vc=function(e){return e>=56320&&e<=57343},Xc=function(e,r,t){if(t===mn.LittleEndian)return r<<8|e;if(t===mn.BigEndian)return e<<8|r;throw new Error("Invalid byteOrder: "+t)},Up=function(e){return Hu(e)?mn.BigEndian:Ku(e)?mn.LittleEndian:mn.BigEndian},Hu=function(e){return e[0]===254&&e[1]===255},Ku=function(e){return e[0]===255&&e[1]===254},Qu=function(e){return Hu(e)||Ku(e)},Wp=function(e){var r=String(e);if(Math.abs(e)<1){var t=parseInt(e.toString().split("e-")[1]);if(t){var n=e<0;n&&(e*=-1),e*=Math.pow(10,t-1),r="0."+new Array(t).join("0")+e.toString().substring(2),n&&(r="-"+r)}}else{var t=parseInt(e.toString().split("+")[1]);t>20&&(t-=20,e/=Math.pow(10,t),r=e.toString()+new Array(t+1).join("0"))}return r},Za=function(e){return Math.ceil(e.toString(2).length/8)},Jn=function(e){for(var r=new Uint8Array(Za(e)),t=1;t<=r.length;t++)r[t-1]=e>>(r.length-t)*8;return r},oa=function(e){throw new Error(e)},Gp=Qr(xo()),Hc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Oi=new Uint8Array(256);for(Br=0;Br>4,s[i++]=(o&15)<<4|l>>2,s[i++]=(l&3)<<6|c&63;return s},qp=function(e){for(var r="",t=0;tn)throw new Error(It(r)+" must be at least "+t+" and at most "+n+", but was actually "+e)},Tr=function(e,r,t,n){le(e,r,["number","undefined"]),typeof e=="number"&&cr(e,r,t,n)},Ju=function(e,r,t){if(le(e,r,["number"]),e%t!==0)throw new Error(It(r)+" must be a multiple of "+t+", but was actually "+e)},mA=function(e,r){if(!Number.isInteger(e))throw new Error(It(r)+" must be an integer, but was actually "+e)},Co=function(e,r){if(![1,0].includes(Math.sign(e)))throw new Error(It(r)+" must be a positive number or 0, but was actually "+e)},$e=new Uint16Array(256);for(Mt=0;Mt<256;Mt++)$e[Mt]=Mt;var Mt;$e[22]=Ye("");$e[24]=Ye("\u02D8");$e[25]=Ye("\u02C7");$e[26]=Ye("\u02C6");$e[27]=Ye("\u02D9");$e[28]=Ye("\u02DD");$e[29]=Ye("\u02DB");$e[30]=Ye("\u02DA");$e[31]=Ye("\u02DC");$e[127]=Ye("\uFFFD");$e[128]=Ye("\u2022");$e[129]=Ye("\u2020");$e[130]=Ye("\u2021");$e[131]=Ye("\u2026");$e[132]=Ye("\u2014");$e[133]=Ye("\u2013");$e[134]=Ye("\u0192");$e[135]=Ye("\u2044");$e[136]=Ye("\u2039");$e[137]=Ye("\u203A");$e[138]=Ye("\u2212");$e[139]=Ye("\u2030");$e[140]=Ye("\u201E");$e[141]=Ye("\u201C");$e[142]=Ye("\u201D");$e[143]=Ye("\u2018");$e[144]=Ye("\u2019");$e[145]=Ye("\u201A");$e[146]=Ye("\u2122");$e[147]=Ye("\uFB01");$e[148]=Ye("\uFB02");$e[149]=Ye("\u0141");$e[150]=Ye("\u0152");$e[151]=Ye("\u0160");$e[152]=Ye("\u0178");$e[153]=Ye("\u017D");$e[154]=Ye("\u0131");$e[155]=Ye("\u0142");$e[156]=Ye("\u0153");$e[157]=Ye("\u0161");$e[158]=Ye("\u017E");$e[159]=Ye("\uFFFD");$e[160]=Ye("\u20AC");$e[173]=Ye("\uFFFD");var $u=function(e){for(var r=new Array(e.length),t=0,n=e.length;t=Q.ExclamationPoint&&e<=Q.Tilde&&!sl[e]},eu={},tu=new Map,jA=(function(e){Te(r,e);function r(t,n){var i=this;if(t!==eu)throw new il("PDFName");i=e.call(this)||this;for(var a="/",o=0,l=n.length;o=Q.Zero&&s<=Q.Nine||s>=Q.a&&s<=Q.f||s>=Q.A&&s<=Q.F?(n+=c,(n.length===2||!(u>="0"&&u<="9"||u>="a"&&u<="f"||u>="A"&&u<="F"))&&(a(parseInt(n,16)),n="")):a(s):s===Q.Hash?i=!0:a(s)}return new Uint8Array(t)},r.prototype.decodeText=function(){var t=this.asBytes();return String.fromCharCode.apply(String,Array.from(t))},r.prototype.asString=function(){return this.encodedName},r.prototype.value=function(){return this.encodedName},r.prototype.clone=function(){return this},r.prototype.toString=function(){return this.encodedName},r.prototype.sizeInBytes=function(){return this.encodedName.length},r.prototype.copyBytesInto=function(t,n){return n+=Vt(this.encodedName,t,n),this.encodedName.length},r.of=function(t){var n=WA(t),i=tu.get(n);return i||(i=new r(eu,n),tu.set(n,i)),i},r.Length=r.of("Length"),r.FlateDecode=r.of("FlateDecode"),r.Resources=r.of("Resources"),r.Font=r.of("Font"),r.XObject=r.of("XObject"),r.ExtGState=r.of("ExtGState"),r.Contents=r.of("Contents"),r.Type=r.of("Type"),r.Parent=r.of("Parent"),r.MediaBox=r.of("MediaBox"),r.Page=r.of("Page"),r.Annots=r.of("Annots"),r.TrimBox=r.of("TrimBox"),r.ArtBox=r.of("ArtBox"),r.BleedBox=r.of("BleedBox"),r.CropBox=r.of("CropBox"),r.Rotate=r.of("Rotate"),r.Title=r.of("Title"),r.Author=r.of("Author"),r.Subject=r.of("Subject"),r.Creator=r.of("Creator"),r.Keywords=r.of("Keywords"),r.Producer=r.of("Producer"),r.CreationDate=r.of("CreationDate"),r.ModDate=r.of("ModDate"),r})($t),V=jA,qA=(function(e){Te(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.prototype.asNull=function(){return null},r.prototype.clone=function(){return this},r.prototype.toString=function(){return"null"},r.prototype.sizeInBytes=function(){return 4},r.prototype.copyBytesInto=function(t,n){return t[n++]=Q.n,t[n++]=Q.u,t[n++]=Q.l,t[n++]=Q.l,4},r})($t),rr=new qA,VA=(function(e){Te(r,e);function r(t,n){var i=e.call(this)||this;return i.dict=t,i.context=n,i}return r.prototype.keys=function(){return Array.from(this.dict.keys())},r.prototype.values=function(){return Array.from(this.dict.values())},r.prototype.entries=function(){return Array.from(this.dict.entries())},r.prototype.set=function(t,n){this.dict.set(t,n)},r.prototype.get=function(t,n){n===void 0&&(n=!1);var i=this.dict.get(t);if(!(i===rr&&!n))return i},r.prototype.has=function(t){var n=this.dict.get(t);return n!==void 0&&n!==rr},r.prototype.lookupMaybe=function(t){for(var n,i=[],a=1;athis.largestObjectNumber&&(this.largestObjectNumber=r.objectNumber)},e.prototype.nextRef=function(){return this.largestObjectNumber+=1,xt.of(this.largestObjectNumber)},e.prototype.register=function(r){var t=this.nextRef();return this.assign(t,r),t},e.prototype.delete=function(r){return this.indirectObjects.delete(r)},e.prototype.lookupMaybe=function(r){for(var t=[],n=1;nthis.largestObjectNumber&&(this.largestObjectNumber=r.objectNumber)},e.prototype.nextRef=function(){return this.largestObjectNumber+=1,xt.of(this.largestObjectNumber)},e.prototype.register=function(r){var t=this.nextRef();return this.assign(t,r),t},e.prototype.delete=function(r){return this.indirectObjects.delete(r)},e.prototype.lookupMaybe=function(r){for(var t=[],n=1;n1?(this.subsections.push([r]),this.chunkIdx+=1,this.chunkLength=1):(t.push(r),this.chunkLength+=1)},e.create=function(){return new e({ref:xt.of(0,65535),offset:0,deleted:!0})},e.createEmpty=function(){return new e},e})(),td=$A,eg=(function(){function e(r){this.lastXRefOffset=String(r)}return e.prototype.toString=function(){return`startxref +`;for(var a=0,o=i.length;a1?(this.subsections.push([r]),this.chunkIdx+=1,this.chunkLength=1):(t.push(r),this.chunkLength+=1)},e.create=function(){return new e({ref:xt.of(0,65535),offset:0,deleted:!0})},e.createEmpty=function(){return new e},e})(),td=ig,ag=(function(){function e(r){this.lastXRefOffset=String(r)}return e.prototype.toString=function(){return`startxref `+this.lastXRefOffset+` -%%EOF`},e.prototype.sizeInBytes=function(){return 16+this.lastXRefOffset.length},e.prototype.copyBytesInto=function(r,t){var n=t;return r[t++]=Q.s,r[t++]=Q.t,r[t++]=Q.a,r[t++]=Q.r,r[t++]=Q.t,r[t++]=Q.x,r[t++]=Q.r,r[t++]=Q.e,r[t++]=Q.f,r[t++]=Q.Newline,t+=Vt(this.lastXRefOffset,r,t),r[t++]=Q.Newline,r[t++]=Q.Percent,r[t++]=Q.Percent,r[t++]=Q.E,r[t++]=Q.O,r[t++]=Q.F,t-n},e.forLastCrossRefSectionOffset=function(r){return new e(r)},e})(),ll=eg,tg=(function(){function e(r){this.dict=r}return e.prototype.toString=function(){return`trailer -`+this.dict.toString()},e.prototype.sizeInBytes=function(){return 8+this.dict.sizeInBytes()},e.prototype.copyBytesInto=function(r,t){var n=t;return r[t++]=Q.t,r[t++]=Q.r,r[t++]=Q.a,r[t++]=Q.i,r[t++]=Q.l,r[t++]=Q.e,r[t++]=Q.r,r[t++]=Q.Newline,t+=this.dict.copyBytesInto(r,t),t-n},e.of=function(r){return new e(r)},e})(),rg=tg,ng=(function(e){Te(r,e);function r(t,n,i){i===void 0&&(i=!0);var a=e.call(this,t.obj({}),i)||this;return a.objects=n,a.offsets=a.computeObjectOffsets(),a.offsetsString=a.computeOffsetsString(),a.dict.set(X.of("Type"),X.of("ObjStm")),a.dict.set(X.of("N"),Qe.of(a.objects.length)),a.dict.set(X.of("First"),Qe.of(a.offsetsString.length)),a}return r.prototype.getObjectsCount=function(){return this.objects.length},r.prototype.clone=function(t){return r.withContextAndObjects(t||this.dict.context,this.objects.slice(),this.encode)},r.prototype.getContentsString=function(){for(var t=this.offsetsString,n=0,i=this.objects.length;n1&&(o.push(l),o.push(u.ref.objectNumber),l=0),l+=1}return o.push(l),o},a.computeEntryTuples=function(){for(var o=new Array(a.entries.length),l=0,c=a.entries.length;ll[0]&&(l[0]=p),g>l[1]&&(l[1]=g),y>l[2]&&(l[2]=y)}return l},a.entries=n||[],a.entryTuplesCache=Hr.populatedBy(a.computeEntryTuples),a.maxByteWidthsCache=Hr.populatedBy(a.computeMaxEntryByteWidths),a.indexCache=Hr.populatedBy(a.computeIndex),t.set(X.of("Type"),X.of("XRef")),a}return r.prototype.addDeletedEntry=function(t,n){var i=fn.Deleted;this.entries.push({type:i,ref:t,nextFreeObjectNumber:n}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},r.prototype.addUncompressedEntry=function(t,n){var i=fn.Uncompressed;this.entries.push({type:i,ref:t,offset:n}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},r.prototype.addCompressedEntry=function(t,n,i){var a=fn.Compressed;this.entries.push({type:a,ref:t,objectStreamRef:n,index:i}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},r.prototype.clone=function(t){var n=this,i=n.dict,a=n.entries,o=n.encode;return r.of(i.clone(t),a.slice(),o)},r.prototype.getContentsString=function(){for(var t=this.entryTuplesCache.access(),n=this.maxByteWidthsCache.access(),i="",a=0,o=t.length;a=0;p--)i+=(d[p]||0).toString(2);for(var p=n[1]-1;p>=0;p--)i+=(A[p]||0).toString(2);for(var p=n[2]-1;p>=0;p--)i+=(f[p]||0).toString(2)}return i},r.prototype.getUnencodedContents=function(){for(var t=this.entryTuplesCache.access(),n=this.maxByteWidthsCache.access(),i=new Uint8Array(this.getUnencodedContentsSize()),a=0,o=0,l=t.length;o=0;g--)i[a++]=A[g]||0;for(var g=n[1]-1;g>=0;g--)i[a++]=f[g]||0;for(var g=n[2]-1;g>=0;g--)i[a++]=p[g]||0}return i},r.prototype.getUnencodedContentsSize=function(){var t=this.maxByteWidthsCache.access(),n=Fp(t);return n*this.entries.length},r.prototype.updateDict=function(){e.prototype.updateDict.call(this);var t=this.maxByteWidthsCache.access(),n=this.indexCache.access(),i=this.dict.context;this.dict.set(X.of("W"),i.obj(t)),this.dict.set(X.of("Index"),i.obj(n))},r.create=function(t,n){n===void 0&&(n=!0);var i=new r(t,[],n);return i.addDeletedEntry(xt.of(0,65535),0),i},r.of=function(t,n,i){return i===void 0&&(i=!0),new r(t,n,i)},r})(sl),sg=og,lg=(function(e){Te(r,e);function r(t,n,i,a){var o=e.call(this,t,n)||this;return o.encodeStreams=i,o.objectsPerStream=a,o}return r.prototype.computeBufferSize=function(){return it(this,void 0,void 0,function(){var t,n,i,a,o,l,c,s,p,g,u,v,d,A,y,f,p,g,y,v,b,x,P,F;return at(this,function(R){switch(R.label){case 0:t=this.context.largestObjectNumber+1,n=ko.forVersion(1,7),i=n.sizeInBytes()+2,a=sg.create(this.createTrailerDict(),this.encodeStreams),o=[],l=[],c=[],s=this.context.enumerateIndirectObjects(),p=0,g=s.length,R.label=1;case 1:return p"},r.prototype.sizeInBytes=function(){return this.value.length+2},r.prototype.copyBytesInto=function(t,n){return t[n++]=Q.LessThan,n+=Vt(this.value,t,n),t[n++]=Q.GreaterThan,this.value.length+2},r.of=function(t){return new r(t)},r.fromText=function(t){for(var n=Bp(t),i="",a=0,o=n.length;a1&&(o.push(l),o.push(u.ref.objectNumber),l=0),l+=1}return o.push(l),o},a.computeEntryTuples=function(){for(var o=new Array(a.entries.length),l=0,c=a.entries.length;ll[0]&&(l[0]=p),g>l[1]&&(l[1]=g),y>l[2]&&(l[2]=y)}return l},a.entries=n||[],a.entryTuplesCache=Hr.populatedBy(a.computeEntryTuples),a.maxByteWidthsCache=Hr.populatedBy(a.computeMaxEntryByteWidths),a.indexCache=Hr.populatedBy(a.computeIndex),t.set(V.of("Type"),V.of("XRef")),a}return r.prototype.addDeletedEntry=function(t,n){var i=fn.Deleted;this.entries.push({type:i,ref:t,nextFreeObjectNumber:n}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},r.prototype.addUncompressedEntry=function(t,n){var i=fn.Uncompressed;this.entries.push({type:i,ref:t,offset:n}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},r.prototype.addCompressedEntry=function(t,n,i){var a=fn.Compressed;this.entries.push({type:a,ref:t,objectStreamRef:n,index:i}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},r.prototype.clone=function(t){var n=this,i=n.dict,a=n.entries,o=n.encode;return r.of(i.clone(t),a.slice(),o)},r.prototype.getContentsString=function(){for(var t=this.entryTuplesCache.access(),n=this.maxByteWidthsCache.access(),i="",a=0,o=t.length;a=0;p--)i+=(d[p]||0).toString(2);for(var p=n[1]-1;p>=0;p--)i+=(A[p]||0).toString(2);for(var p=n[2]-1;p>=0;p--)i+=(f[p]||0).toString(2)}return i},r.prototype.getUnencodedContents=function(){for(var t=this.entryTuplesCache.access(),n=this.maxByteWidthsCache.access(),i=new Uint8Array(this.getUnencodedContentsSize()),a=0,o=0,l=t.length;o=0;g--)i[a++]=A[g]||0;for(var g=n[1]-1;g>=0;g--)i[a++]=f[g]||0;for(var g=n[2]-1;g>=0;g--)i[a++]=p[g]||0}return i},r.prototype.getUnencodedContentsSize=function(){var t=this.maxByteWidthsCache.access(),n=Rp(t);return n*this.entries.length},r.prototype.updateDict=function(){e.prototype.updateDict.call(this);var t=this.maxByteWidthsCache.access(),n=this.indexCache.access(),i=this.dict.context;this.dict.set(V.of("W"),i.obj(t)),this.dict.set(V.of("Index"),i.obj(n))},r.create=function(t,n){n===void 0&&(n=!0);var i=new r(t,[],n);return i.addDeletedEntry(xt.of(0,65535),0),i},r.of=function(t,n,i){return i===void 0&&(i=!0),new r(t,n,i)},r})(ll),fg=dg,hg=(function(e){Te(r,e);function r(t,n,i,a){var o=e.call(this,t,n)||this;return o.encodeStreams=i,o.objectsPerStream=a,o}return r.prototype.computeBufferSize=function(){return it(this,void 0,void 0,function(){var t,n,i,a,o,l,c,s,p,g,u,v,d,A,y,f,p,g,y,v,b,x,P,F;return at(this,function(R){switch(R.label){case 0:t=this.context.largestObjectNumber+1,n=Po.forVersion(1,7),i=n.sizeInBytes()+2,a=fg.create(this.createTrailerDict(),this.encodeStreams),o=[],l=[],c=[],s=this.context.enumerateIndirectObjects(),p=0,g=s.length,R.label=1;case 1:return p"},r.prototype.sizeInBytes=function(){return this.value.length+2},r.prototype.copyBytesInto=function(t,n){return t[n++]=Q.LessThan,n+=Vt(this.value,t,n),t[n++]=Q.GreaterThan,this.value.length+2},r.of=function(t){return new r(t)},r.fromText=function(t){for(var n=zp(t),i="",a=0,o=n.length;a"},Qa=function(e){return na(e,4)},pg=function(e){if(Rp(e))return Qa(e);if(Lp(e)){var r=qu(e),t=Vu(e);return""+Qa(r)+Qa(t)}var n=wo(e),i="0x"+n+" is not a valid UTF-8 or UTF-16 codepoint.";throw new Error(i)},Ag=function(e){var r=0,t=function(n){r|=1<=Q.Zero&&s<=Q.Seven?(n+=c,(n.length===3||!(u>="0"&&u<="7"))&&(a(parseInt(n,8)),n="")):a(s):s===Q.BackSlash?i=!0:a(s)}return new Uint8Array(t)},r.prototype.decodeText=function(){var t=this.asBytes();return Qu(t)?Xu(t):$u(t)},r.prototype.decodeDate=function(){var t=this.decodeText(),n=Gu(t);if(!n)throw new ed(t);return n},r.prototype.asString=function(){return this.value},r.prototype.clone=function(){return r.of(this.value)},r.prototype.toString=function(){return"("+this.value+")"},r.prototype.sizeInBytes=function(){return this.value.length+2},r.prototype.copyBytesInto=function(t,n){return t[n++]=Q.LeftParen,n+=Vt(this.value,t,n),t[n++]=Q.RightParen,this.value.length+2},r.of=function(t){return new r(t)},r.fromDate=function(t){var n=Br(String(t.getUTCFullYear()),4,"0"),i=Br(String(t.getUTCMonth()+1),2,"0"),a=Br(String(t.getUTCDate()),2,"0"),o=Br(String(t.getUTCHours()),2,"0"),l=Br(String(t.getUTCMinutes()),2,"0"),c=Br(String(t.getUTCSeconds()),2,"0");return new r("D:"+n+i+a+o+l+c+"Z")},r})($t),wt=mg,vg=(function(){function e(r,t,n,i){var a=this;this.allGlyphsInFontSortedById=function(){for(var o=new Array(a.font.characterSet.length),l=0,c=o.length;l>3)]>>7-((p&7)<<0)&1,C=3*H;l[P]=F[C],l[P+1]=F[C+1],l[P+2]=F[C+2],l[P+3]=H>2)]>>6-((p&3)<<1)&3,C=3*H;l[P]=F[C],l[P+1]=F[C+1],l[P+2]=F[C+2],l[P+3]=H>1)]>>4-((p&1)<<2)&15,C=3*H;l[P]=F[C],l[P+1]=F[C+1],l[P+2]=F[C+2],l[P+3]=H>>3)]>>>7-(q&7)&1),se=m==v*255?0:255;c[ne+q]=se<<24|m<<16|m<<8|m}else if(u==2)for(var q=0;q>>2)]>>>6-((q&3)<<1)&3),se=m==v*85?0:255;c[ne+q]=se<<24|m<<16|m<<8|m}else if(u==4)for(var q=0;q>>1)]>>>4-((q&1)<<2)&15),se=m==v*17?0:255;c[ne+q]=se<<24|m<<16|m<<8|m}else if(u==8)for(var q=0;q>>2<<3));i==0;){if(i=y(r,A,1),a=y(r,A+1,2),A+=3,a==0){(A&7)!=0&&(A+=8-(A&7));var B=(A>>>3)+4,T=r[B-4]|r[B-3]<<8;E&&(t=e.H.W(t,d+T)),t.set(new n(r.buffer,r.byteOffset+B,T),d),A=B+T<<3,d+=T;continue}if(E&&(t=e.H.W(t,d+(1<<17))),a==1&&(f=R.J,p=R.h,s=511,u=31),a==2){o=v(r,A,5)+257,l=v(r,A+5,5)+1,c=v(r,A+10,4)+4,A+=14;for(var W=A,H=1,C=0;C<38;C+=2)R.Q[C]=0,R.Q[C+1]=0;for(var C=0;CH&&(H=I)}A+=3*c,x(R.Q,H),P(R.Q,H,R.u),f=R.w,p=R.d,A=b(R.u,(1<>>4;if(!(q>>>8))t[d++]=q;else{if(q==256)break;var se=d+q-254;if(q>264){var Z=R.q[q-257];se=d+(Z>>>3)+v(r,A,Z&7),A+=Z&7}var ue=p[F(r,A)&u];A+=ue&15;var j=ue>>>4,_=R.c[j],fe=(_>>>4)+y(r,A,_&15);for(A+=_&15;d>>4;if(d<=15)o[s]=d,s++;else{var A=0,f=0;d==16?(f=3+l(i,a,2),a+=2,A=o[s-1]):d==17?(f=3+l(i,a,3),a+=3):d==18&&(f=11+l(i,a,7),a+=7);for(var p=s+f;s>>1;oa&&(a=c),o++}for(;o>1,s=r[l+1],u=c<<4|s,d=t-s,A=r[l]<>>15-t;n[p]=u,A++}},e.H.l=function(r,t){for(var n=e.H.m.r,i=15-t,a=0;a>>i}},e.H.M=function(r,t,n){n=n<<(t&7);var i=t>>>3;r[i]|=n,r[i+1]|=n>>>8},e.H.I=function(r,t,n){n=n<<(t&7);var i=t>>>3;r[i]|=n,r[i+1]|=n>>>8,r[i+2]|=n>>>16},e.H.e=function(r,t,n){return(r[t>>>3]|r[(t>>>3)+1]<<8)>>>(t&7)&(1<>>3]|r[(t>>>3)+1]<<8|r[(t>>>3)+2]<<16)>>>(t&7)&(1<>>3]|r[(t>>>3)+1]<<8|r[(t>>>3)+2]<<16)>>>(t&7)},e.H.i=function(r,t){return(r[t>>>3]|r[(t>>>3)+1]<<8|r[(t>>>3)+2]<<16|r[(t>>>3)+3]<<24)>>>(t&7)},e.H.m=(function(){var r=Uint16Array,t=Uint32Array;return{K:new r(16),j:new r(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new r(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new t(32),J:new r(512),_:[],h:new r(32),$:[],w:new r(32768),C:[],v:[],d:new r(32768),D:[],u:new r(512),Q:[],r:new r(32768),s:new t(286),Y:new t(30),a:new t(19),t:new t(15e3),k:new r(65536),g:new r(32768)}})(),(function(){for(var r=e.H.m,t=32768,n=0;n>>1|(i&1431655765)<<1,i=(i&3435973836)>>>2|(i&858993459)<<2,i=(i&4042322160)>>>4|(i&252645135)<<4,i=(i&4278255360)>>>8|(i&16711935)<<8,r.r[n]=(i>>>16|i<<16)>>>17}function a(o,l,c){for(;l--!=0;)o.push(0,c)}for(var n=0;n<32;n++)r.q[n]=r.S[n]<<3|r.T[n],r.c[n]=r.p[n]<<4|r.z[n];a(r._,144,8),a(r._,112,9),a(r._,24,7),a(r._,8,8),e.H.n(r._,9),e.H.A(r._,9,r.J),e.H.l(r._,9),a(r.$,32,5),e.H.n(r.$,5),e.H.A(r.$,5,r.h),e.H.l(r.$,5),a(r.Q,19,0),a(r.C,286,0),a(r.D,30,0),a(r.v,320,0)})(),e.H.N})();Se.decode._readInterlace=function(e,r){for(var t=r.width,n=r.height,i=Se.decode._getBPP(r),a=i>>3,o=Math.ceil(t*i/8),l=new Uint8Array(n*o),c=0,s=[0,0,4,0,2,0,1],u=[0,4,0,2,0,1,0],d=[8,8,8,4,4,2,2],A=[8,8,4,4,2,2,1],f=0;f<7;){for(var p=d[f],g=A[f],y=0,v=0,b=s[f];b>3];T=T>>7-(B&7)&1,l[R*o+(E>>3)]|=T<<7-((E&7)<<0)}if(i==2){var T=e[B>>3];T=T>>6-(B&7)&3,l[R*o+(E>>2)]|=T<<6-((E&3)<<1)}if(i==4){var T=e[B>>3];T=T>>4-(B&7)&15,l[R*o+(E>>1)]|=T<<4-((E&1)<<2)}if(i>=8)for(var W=R*o+E*a,H=0;H>3)+H];B+=i,E+=g}F++,R+=p}y*v!=0&&(c+=v*(1+P)),f=f+1}return l};Se.decode._getBPP=function(e){var r=[1,null,3,1,2,null,4][e.ctype];return r*e.depth};Se.decode._filterZero=function(e,r,t,n,i){var a=Se.decode._getBPP(r),o=Math.ceil(n*a/8),l=Se.decode._paeth;a=Math.ceil(a/8);var c=0,s=1,u=e[t],d=0;if(u>1&&(e[t]=[0,0,1][u-2]),u==3)for(d=a;d>>1)&255;for(var A=0;A>>1);for(;d>>1)}else{for(;d>8&255,e[r+1]=t&255},readUint:function(e,r){return e[r]*(256*256*256)+(e[r+1]<<16|e[r+2]<<8|e[r+3])},writeUint:function(e,r,t){e[r]=t>>24&255,e[r+1]=t>>16&255,e[r+2]=t>>8&255,e[r+3]=t&255},readASCII:function(e,r,t){for(var n="",i=0;i=0&&l>=0?(d=f*r+p<<2,A=(l+f)*i+o+p<<2):(d=(-l+f)*r-o+p<<2,A=f*i+p<<2),c==0)n[A]=e[d],n[A+1]=e[d+1],n[A+2]=e[d+2],n[A+3]=e[d+3];else if(c==1){var g=e[d+3]*.00392156862745098,y=e[d]*g,v=e[d+1]*g,b=e[d+2]*g,x=n[A+3]*(1/255),P=n[A]*x,F=n[A+1]*x,R=n[A+2]*x,E=1-g,B=g+x*E,T=B==0?0:1/B;n[A+3]=255*B,n[A+0]=(y+P*E)*T,n[A+1]=(v+F*E)*T,n[A+2]=(b+R*E)*T}else if(c==2){var g=e[d+3],y=e[d],v=e[d+1],b=e[d+2],x=n[A+3],P=n[A],F=n[A+1],R=n[A+2];g==x&&y==P&&v==F&&b==R?(n[A]=0,n[A+1]=0,n[A+2]=0,n[A+3]=0):(n[A]=y,n[A+1]=v,n[A+2]=b,n[A+3]=g)}else if(c==3){var g=e[d+3],y=e[d],v=e[d+1],b=e[d+2],x=n[A+3],P=n[A],F=n[A+1],R=n[A+2];if(g==x&&y==P&&v==F&&b==R)continue;if(g<220&&x>20)return!1}return!0};Se.encode=function(e,r,t,n,i,a,o){n==null&&(n=0),o==null&&(o=!1);var l=Se.encode.compress(e,r,t,n,[!1,!1,!1,0,o]);return Se.encode.compressPNG(l,-1),Se.encode._main(l,r,t,i,a)};Se.encodeLL=function(e,r,t,n,i,a,o,l){for(var c={ctype:0+(n==1?0:2)+(i==0?0:4),depth:a,frames:[]},s=Date.now(),u=(n+i)*a,d=u*r,A=0;A1,d=!1,A=33+(u?20:0);if(i.sRGB!=null&&(A+=13),i.pHYs!=null&&(A+=21),e.ctype==3){for(var f=e.plte.length,p=0;p>>24!=255&&(d=!0);A+=8+f*3+4+(d?8+f*1+4:0)}for(var g=0;g>>8&255,E=P>>>16&255;v[s+x+0]=F,v[s+x+1]=R,v[s+x+2]=E}if(s+=f*3,o(v,s,a(v,s-f*3-4,f*3+4)),s+=4,d){o(v,s,f),s+=4,c(v,s,"tRNS"),s+=4;for(var p=0;p>>24&255;s+=f,o(v,s,a(v,s-f-4,f+4)),s+=4}}for(var B=0,g=0;g>2,C>>2));for(var f=0;fN&&q==m[y-N])ne[y]=ne[y-N];else{var se=x[q];if(se==null&&(x[q]=se=P.length,P.push(q),P.length>=300))break;ne[y]=se}}}var Z=P.length;Z<=256&&s==!1&&(Z<=2?d=1:Z<=4?d=2:Z<=16?d=4:d=8,d=Math.max(d,c));for(var f=0;f>1)]|=ke[Oe+we]<<4-(we&1)*4;else if(d==2)for(var we=0;we>2)]|=ke[Oe+we]<<6-(we&3)*2;else if(d==1)for(var we=0;we>3)]|=ke[Oe+we]<<7-(we&7)*1}fe=Re,u=3,be=1}else if(v==!1&&b.length==1){for(var Re=new Uint8Array(N*_*3),tt=N*_,y=0;yE&&(E=W),TB&&(B=T))}E==-1&&(F=R=E=B=0),i&&((F&1)==1&&F--,(R&1)==1&&R--);var C=(E-F+1)*(B-R+1);Cy&&(y=P),Fv&&(v=F))}y==-1&&(p=g=y=v=0),o&&((p&1)==1&&p--,(g&1)==1&&g--),a={x:p,y:g,width:y-p+1,height:v-g+1};var B=n[i];B.rect=a,B.blend=1,B.img=new Uint8Array(a.width*a.height*4),n[i-1].dispose==0?(Se._copyTile(s,r,t,B.img,a.width,a.height,-a.x,-a.y,0),Se.encode._prepareDiff(A,r,t,B.img,a)):Se._copyTile(A,r,t,B.img,a.width,a.height,-a.x,-a.y,0)};Se.encode._prepareDiff=function(e,r,t,n,i){Se._copyTile(e,r,t,n,i.width,i.height,-i.x,-i.y,2)};Se.encode._filterZero=function(e,r,t,n,i,a,o){var l=[],c=[0,1,2,3,4];a!=-1?c=[a]:(r*n>5e5||t==1)&&(c=[0]);var s;o&&(s={level:0});for(var u=o&&UZIP!=null?UZIP:Cg.default,d=0;d>1)+256&255;if(a==4)for(var s=i;s>1)&255;for(var s=i;s>1)&255}if(a==4){for(var s=0;s>>1:t=t>>>1;e[r]=t}return e})(),update:function(e,r,t,n){for(var i=0;i>>8;return e},crc:function(e,r,t){return Se.crc.update(4294967295,e,r,t)^4294967295}};Se.quantize=function(e,r){for(var t=new Uint8Array(e),n=t.slice(0),i=new Uint32Array(n.buffer),a=Se.quantize.getKDtree(n,r),o=a[0],l=a[1],c=Se.quantize.planeDst,s=t,u=i,d=s.length,A=new Uint8Array(t.length>>2),f=0;f>2]=b.ind,u[f>>2]=b.est.rgba}return{abuf:n.buffer,inds:A,plte:l}};Se.quantize.getKDtree=function(e,r,t){t==null&&(t=1e-4);var n=new Uint32Array(e.buffer),i={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};i.bst=Se.quantize.stats(e,i.i0,i.i1),i.est=Se.quantize.estats(i.bst);for(var a=[i];a.lengtho&&(o=a[c].est.L,l=c);if(o=u||s.i1<=u;if(d){s.est.L=0;continue}var A={i0:s.i0,i1:u,bst:null,est:null,tdst:0,left:null,right:null};A.bst=Se.quantize.stats(e,A.i0,A.i1),A.est=Se.quantize.estats(A.bst);var f={i0:u,i1:s.i1,bst:null,est:null,tdst:0,left:null,right:null};f.bst={R:[],m:[],N:s.bst.N-A.bst.N};for(var c=0;c<16;c++)f.bst.R[c]=s.bst.R[c]-A.bst.R[c];for(var c=0;c<4;c++)f.bst.m[c]=s.bst.m[c]-A.bst.m[c];f.est=Se.quantize.estats(f.bst),s.left=A,s.right=f,a[l]=A,a.push(f)}a.sort(function(p,g){return g.bst.N-p.bst.N});for(var c=0;c0&&(o=e.right,l=e.left);var c=Se.quantize.getNearest(o,r,t,n,i);if(c.tdst<=a*a)return c;var s=Se.quantize.getNearest(l,r,t,n,i);return s.tdsta;)n-=4;if(t>=n)break;var c=r[t>>2];r[t>>2]=r[n>>2],r[n>>2]=c,t+=4,n-=4}for(;o(e,t,i)>a;)t-=4;return t+4};Se.quantize.vecDot=function(e,r,t){return e[r]*t[0]+e[r+1]*t[1]+e[r+2]*t[2]+e[r+3]*t[3]};Se.quantize.stats=function(e,r,t){for(var n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0],a=t-r>>2,o=r;o>>0}};Se.M4={multVec:function(e,r){return[e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3],e[4]*r[0]+e[5]*r[1]+e[6]*r[2]+e[7]*r[3],e[8]*r[0]+e[9]*r[1]+e[10]*r[2]+e[11]*r[3],e[12]*r[0]+e[13]*r[1]+e[14]*r[2]+e[15]*r[3]]},dot:function(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3]},sml:function(e,r){return[e*r[0],e*r[1],e*r[2],e*r[3]]}};Se.encode.concatRGBA=function(e){for(var r=0,t=0;t1)throw new Error("Animated PNGs are not supported");var i=new Uint8Array(n[0]),a=Fg(i),o=a.rgbChannel,l=a.alphaChannel;this.rgbChannel=o;var c=l.some(function(s){return s<255});c&&(this.alphaChannel=l),this.type=Pg(t.ctype),this.width=t.width,this.height=t.height,this.bitsPerComponent=8}return e.load=function(r){return new e(r)},e})(),Dg=(function(){function e(r){this.image=r,this.bitsPerComponent=r.bitsPerComponent,this.width=r.width,this.height=r.height,this.colorSpace="DeviceRGB"}return e.for=function(r){return it(this,void 0,void 0,function(){var t;return at(this,function(n){return t=Tg.load(r),[2,new e(t)]})})},e.prototype.embedIntoContext=function(r,t){return it(this,void 0,void 0,function(){var n,i;return at(this,function(a){return n=this.embedAlphaChannel(r),i=r.flateStream(this.image.rgbChannel,{Type:"XObject",Subtype:"Image",BitsPerComponent:this.image.bitsPerComponent,Width:this.image.width,Height:this.image.height,ColorSpace:this.colorSpace,SMask:n}),t?(r.assign(t,i),[2,t]):[2,r.register(i)]})})},e.prototype.embedAlphaChannel=function(r){if(this.image.alphaChannel){var t=r.flateStream(this.image.alphaChannel,{Type:"XObject",Subtype:"Image",Height:this.image.height,Width:this.image.width,BitsPerComponent:this.image.bitsPerComponent,ColorSpace:"DeviceGray",Decode:[0,1]});return r.register(t)}},e})(),od=Dg,Eg=(function(){function e(r,t,n){this.bytes=r,this.start=t||0,this.pos=this.start,this.end=t&&n?t+n:this.bytes.length}return Object.defineProperty(e.prototype,"length",{get:function(){return this.end-this.start},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.length===0},enumerable:!1,configurable:!0}),e.prototype.getByte=function(){return this.pos>=this.end?-1:this.bytes[this.pos++]},e.prototype.getUint16=function(){var r=this.getByte(),t=this.getByte();return r===-1||t===-1?-1:(r<<8)+t},e.prototype.getInt32=function(){var r=this.getByte(),t=this.getByte(),n=this.getByte(),i=this.getByte();return(r<<24)+(t<<16)+(n<<8)+i},e.prototype.getBytes=function(r,t){t===void 0&&(t=!1);var n=this.bytes,i=this.pos,a=this.end;if(r){var l=i+r;l>a&&(l=a),this.pos=l;var o=n.subarray(i,l);return t?new Uint8ClampedArray(o):o}else{var o=n.subarray(i,a);return t?new Uint8ClampedArray(o):o}},e.prototype.peekByte=function(){var r=this.getByte();return this.pos--,r},e.prototype.peekBytes=function(r,t){t===void 0&&(t=!1);var n=this.getBytes(r,t);return this.pos-=n.length,n},e.prototype.skip=function(r){r||(r=1),this.pos+=r},e.prototype.reset=function(){this.pos=this.start},e.prototype.moveStart=function(){this.start=this.pos},e.prototype.makeSubStream=function(r,t){return new e(this.bytes,r,t)},e.prototype.decode=function(){return this.bytes},e})(),sd=Eg,Bg=new Uint8Array(0),Rg=(function(){function e(r){if(this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=Bg,this.minBufferLength=512,r)for(;this.minBufferLengtha&&(n=a)}else{for(;!this.eof;)this.readBlock();n=this.bufferLength}this.pos=n;var o=this.buffer.subarray(i,n);return t&&!(o instanceof Uint8ClampedArray)?new Uint8ClampedArray(o):o},e.prototype.peekByte=function(){var r=this.getByte();return this.pos--,r},e.prototype.peekBytes=function(r,t){t===void 0&&(t=!1);var n=this.getBytes(r,t);return this.pos-=n.length,n},e.prototype.skip=function(r){r||(r=1),this.pos+=r},e.prototype.reset=function(){this.pos=0},e.prototype.makeSubStream=function(r,t){for(var n=r+t;this.bufferLength<=n&&!this.eof;)this.readBlock();return new sd(this.buffer,r,t)},e.prototype.decode=function(){for(;!this.eof;)this.readBlock();return this.buffer.subarray(0,this.bufferLength)},e.prototype.readBlock=function(){throw new xr(this.constructor.name,"readBlock")},e.prototype.ensureBuffer=function(r){var t=this.buffer;if(r<=t.byteLength)return t;for(var n=this.minBufferLength;n=0;--s)c[l+s]=d&255,d>>=8}},r})(oa),Ng=Lg,Ig=(function(e){Te(r,e);function r(t,n){var i=e.call(this,n)||this;return i.stream=t,i.firstDigit=-1,n&&(n=.5*n),i}return r.prototype.readBlock=function(){var t=8e3,n=this.stream.getBytes(t);if(!n.length){this.eof=!0;return}for(var i=n.length+1>>1,a=this.ensureBuffer(this.bufferLength+i),o=this.bufferLength,l=this.firstDigit,c=0,s=n.length;c=48&&u<=57)d=u&15;else if(u>=65&&u<=70||u>=97&&u<=102)d=(u&15)+9;else if(u===62){this.eof=!0;break}else continue;l<0?l=d:(a[o++]=l<<4|d,l=-1)}l>=0&&this.eof&&(a[o++]=l<<4,l=-1),this.firstDigit=l,this.bufferLength=o},r})(oa),zg=Ig,cu=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Mg=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),Og=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),_g=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],Ug=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5],Wg=(function(e){Te(r,e);function r(t,n){var i=e.call(this,n)||this;i.stream=t;var a=t.getByte(),o=t.getByte();if(a===-1||o===-1)throw new Error("Invalid header in flate stream: "+a+", "+o);if((a&15)!==8)throw new Error("Unknown compression method in flate stream: "+a+", "+o);if(((a<<8)+o)%31!==0)throw new Error("Bad FCHECK in flate stream: "+a+", "+o);if(o&32)throw new Error("FDICT bit set in flate stream: "+a+", "+o);return i.codeSize=0,i.codeBuf=0,i}return r.prototype.readBlock=function(){var t,n,i=this.stream,a=this.getBits(3);if(a&1&&(this.eof=!0),a>>=1,a===0){var o=void 0;if((o=i.getByte())===-1)throw new Error("Bad block header in flate stream");var l=o;if((o=i.getByte())===-1)throw new Error("Bad block header in flate stream");if(l|=o<<8,(o=i.getByte())===-1)throw new Error("Bad block header in flate stream");var c=o;if((o=i.getByte())===-1)throw new Error("Bad block header in flate stream");if(c|=o<<8,c!==(~l&65535)&&(l!==0||c!==0))throw new Error("Bad uncompressed block length in flate stream");this.codeBuf=0,this.codeSize=0;var s=this.bufferLength;t=this.ensureBuffer(s+l);var u=s+l;if(this.bufferLength=u,l===0)i.peekByte()===-1&&(this.eof=!0);else for(var d=s;d0;)F[b++]=B}A=this.generateHuffmanTable(F.subarray(0,p)),f=this.generateHuffmanTable(F.subarray(p,P))}else throw new Error("Unknown block type in flate stream");t=this.buffer;for(var H=t?t.length:0,C=this.bufferLength;;){var I=this.getCode(A);if(I<256){C+1>=H&&(t=this.ensureBuffer(C+1),H=t.length),t[C++]=I;continue}if(I===256){this.bufferLength=C;return}I-=257,I=Mg[I];var m=I>>16;m>0&&(m=this.getBits(m)),n=(I&65535)+m,I=this.getCode(f),I=Og[I],m=I>>16,m>0&&(m=this.getBits(m));var N=(I&65535)+m;C+n>=H&&(t=this.ensureBuffer(C+n),H=t.length);for(var ne=0;ne>t,this.codeSize=i-=t,o},r.prototype.getCode=function(t){for(var n=this.stream,i=t[0],a=t[1],o=this.codeSize,l=this.codeBuf,c;o>16,d=s&65535;if(u<1||o>u,this.codeSize=o-u,d},r.prototype.generateHuffmanTable=function(t){var n=t.length,i=0,a;for(a=0;ai&&(i=t[a]);for(var o=1<>=1;for(a=A;a0;if(!F||F<256)y[0]=F,v=1;else if(F>=258)if(F=0;o--)y[o]=d[l],l=f[l];else y[v++]=y[0];else if(F===256){p=9,u=258,v=0;continue}else{this.eof=!0,delete this.lzwState;break}if(R&&(f[u]=g,A[u]=A[g]+1,d[u]=y[0],u++,p=u+s&u+s-1?p:Math.min(Math.log(u+s)/.6931471805599453+1,12)|0),g=F,b+=v,n>>n&(1<0){var o=this.stream.getBytes(a);n.set(o,i),i+=a}}else{a=257-a;var l=t[1];n=this.ensureBuffer(i+a+1);for(var c=0;cn.size())throw new ao(t,0,n.size());n.remove(t)}else{if(t!==0)throw new ao(t,0,0);this.setKids([])}},r.prototype.normalizedEntries=function(){var t=this.Kids();return t||(t=this.dict.context.obj([this.ref]),this.dict.set(X.of("Kids"),t)),{Kids:t}},r.fromDict=function(t,n){return new r(t,n)},r})(ud),pi=im,am=(function(e){Te(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.prototype.Opt=function(){return this.dict.lookupMaybe(X.of("Opt"),wt,qe,vt)},r.prototype.setOpt=function(t){this.dict.set(X.of("Opt"),this.dict.context.obj(t))},r.prototype.getExportValues=function(){var t=this.Opt();if(t){if(t instanceof wt||t instanceof qe)return[t];for(var n=[],i=0,a=t.size();in.size())throw new ao(t,0,n.size());n.remove(t)}},r.prototype.normalizeExportValues=function(){for(var t,n,i,a,o=(t=this.getExportValues())!==null&&t!==void 0?t:[],l=[],c=this.getWidgets(),s=0,u=c.length;s1){if(!this.hasFlag(bt.MultiSelect))throw new yA;this.dict.set(X.of("V"),this.dict.context.obj(t))}this.updateSelectedIndices(t)},r.prototype.valuesAreValid=function(t){for(var n=this.getOptions(),i=function(c,s){var u=t[c].decodeText();if(!n.find(function(d){return u===(d.display||d.value).decodeText()}))return{value:!1}},a=0,o=t.length;a1){for(var n=new Array(t.length),i=this.getOptions(),a=function(c,s){var u=t[c].decodeText();n[c]=i.findIndex(function(d){return u===(d.display||d.value).decodeText()})},o=0,l=t.length;o0){var l=o.lookup(0,wt,qe),c=o.lookupMaybe(1,wt,qe);n.push({value:l,display:c||l})}}return n}return[]},r})(pi),dd=sm,lm=(function(e){Te(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.fromDict=function(t,n){return new r(t,n)},r.create=function(t){var n=t.obj({FT:"Ch",Ff:bt.Combo,Kids:[]}),i=t.register(n);return new r(n,i)},r})(dd),Po=lm,cm=(function(e){Te(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.prototype.addField=function(t){var n=this.normalizedEntries().Kids;n?.push(t)},r.prototype.normalizedEntries=function(){var t=this.Kids();return t||(t=this.dict.context.obj([]),this.dict.set(X.of("Kids"),t)),{Kids:t}},r.fromDict=function(t,n){return new r(t,n)},r.create=function(t){var n=t.obj({}),i=t.register(n);return new r(n,i)},r})(ud),lo=cm,um=(function(e){Te(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.fromDict=function(t,n){return new r(t,n)},r})(pi),dl=um,dm=(function(e){Te(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.prototype.MaxLen=function(){var t=this.dict.lookup(X.of("MaxLen"));if(t instanceof Qe)return t},r.prototype.Q=function(){var t=this.dict.lookup(X.of("Q"));if(t instanceof Qe)return t},r.prototype.setMaxLength=function(t){this.dict.set(X.of("MaxLen"),Qe.of(t))},r.prototype.removeMaxLength=function(){this.dict.delete(X.of("MaxLen"))},r.prototype.getMaxLength=function(){var t;return(t=this.MaxLen())===null||t===void 0?void 0:t.asNumber()},r.prototype.setQuadding=function(t){this.dict.set(X.of("Q"),Qe.of(t))},r.prototype.getQuadding=function(){var t;return(t=this.Q())===null||t===void 0?void 0:t.asNumber()},r.prototype.setValue=function(t){this.dict.set(X.of("V"),t)},r.prototype.removeValue=function(){this.dict.delete(X.of("V"))},r.prototype.getValue=function(){var t=this.V();if(t instanceof wt||t instanceof qe)return t},r.fromDict=function(t,n){return new r(t,n)},r.create=function(t){var n=t.obj({FT:"Tx",Kids:[]}),i=t.register(n);return new r(n,i)},r})(pi),Fo=dm,fm=(function(e){Te(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.fromDict=function(t,n){return new r(t,n)},r.create=function(t){var n=t.obj({FT:"Btn",Ff:yr.PushButton,Kids:[]}),i=t.register(n);return new r(n,i)},r})(ul),To=fm,hm=(function(e){Te(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.prototype.setValue=function(t){var n=this.getOnValues();if(!n.includes(t)&&t!==X.of("Off"))throw new al;this.dict.set(X.of("V"),t);for(var i=this.getWidgets(),a=0,o=i.length;aa)throw new Yc(n,a);for(var o=n,l=0,c=i.size();lo)return u.insertLeafNode(t,o)||s;o-=u.Count().asNumber()}u instanceof Kr&&(o-=1)}if(o===0){this.insertLeafKid(i.size(),t);return}throw new Jc(n,"insertLeafNode")},r.prototype.removeLeafNode=function(t,n){n===void 0&&(n=!0);var i=this.Kids(),a=this.Count().asNumber();if(t>=a)throw new Yc(t,a);for(var o=t,l=0,c=i.size();lo){u.removeLeafNode(o,n),n&&u.Kids().size()===0&&i.remove(l);return}else o-=u.Count().asNumber();if(u instanceof Kr)if(o===0){this.removeKid(l);return}else o-=1}throw new Jc(t,"removeLeafNode")},r.prototype.ascend=function(t){t(this);var n=this.Parent();n&&n.ascend(t)},r.prototype.traverse=function(t){for(var n=this.Kids(),i=0,a=n.size();iNumber.MAX_SAFE_INTEGER)if(this.capNumbers){var i="Parsed number that is too large for some PDF readers: "+r+", using Number.MAX_SAFE_INTEGER instead.";return console.warn(i),Number.MAX_SAFE_INTEGER}else{var i="Parsed number that is too large for some PDF readers: "+r+", not capping.";console.warn(i)}return n},e.prototype.skipWhitespace=function(){for(;!this.bytes.done()&&Yr[this.bytes.peek()];)this.bytes.next()},e.prototype.skipLine=function(){for(;!this.bytes.done();){var r=this.bytes.peek();if(r===fu||r===hu)return;this.bytes.next()}},e.prototype.skipComment=function(){if(this.bytes.peek()!==Q.Percent)return!1;for(;!this.bytes.done();){var r=this.bytes.peek();if(r===fu||r===hu)return!0;this.bytes.next()}return!0},e.prototype.skipWhitespaceAndComments=function(){for(this.skipWhitespace();this.skipComment();)this.skipWhitespace()},e.prototype.matchKeyword=function(r){for(var t=this.bytes.offset(),n=0,i=r.length;n=this.length},e.prototype.offset=function(){return this.idx},e.prototype.slice=function(r,t){return this.bytes.slice(r,t)},e.prototype.position=function(){return{line:this.line,column:this.column,offset:this.idx}},e.of=function(r){return new e(r)},e.fromPDFRawStream=function(r){return e.of(ld(r).decode())},e})(),Ro=km,Cm=Q.Space,Ri=Q.CarriageReturn,Li=Q.Newline,Ni=[Q.s,Q.t,Q.r,Q.e,Q.a,Q.m],Wa=[Q.e,Q.n,Q.d,Q.s,Q.t,Q.r,Q.e,Q.a,Q.m],Ct={header:[Q.Percent,Q.P,Q.D,Q.F,Q.Dash],eof:[Q.Percent,Q.Percent,Q.E,Q.O,Q.F],obj:[Q.o,Q.b,Q.j],endobj:[Q.e,Q.n,Q.d,Q.o,Q.b,Q.j],xref:[Q.x,Q.r,Q.e,Q.f],trailer:[Q.t,Q.r,Q.a,Q.i,Q.l,Q.e,Q.r],startxref:[Q.s,Q.t,Q.a,Q.r,Q.t,Q.x,Q.r,Q.e,Q.f],true:[Q.t,Q.r,Q.u,Q.e],false:[Q.f,Q.a,Q.l,Q.s,Q.e],null:[Q.n,Q.u,Q.l,Q.l],stream:Ni,streamEOF1:ht(Ni,[Cm,Ri,Li]),streamEOF2:ht(Ni,[Ri,Li]),streamEOF3:ht(Ni,[Ri]),streamEOF4:ht(Ni,[Li]),endstream:Wa,EOF1endstream:ht([Ri,Li],Wa),EOF2endstream:ht([Ri],Wa),EOF3endstream:ht([Li],Wa)},Pm=(function(e){Te(r,e);function r(t,n,i){i===void 0&&(i=!1);var a=e.call(this,t,i)||this;return a.context=n,a}return r.prototype.parseObject=function(){if(this.skipWhitespaceAndComments(),this.matchKeyword(Ct.true))return Yi.True;if(this.matchKeyword(Ct.false))return Yi.False;if(this.matchKeyword(Ct.null))return rr;var t=this.bytes.peek();if(t===Q.LessThan&&this.bytes.peekAhead(1)===Q.LessThan)return this.parseDictOrStream();if(t===Q.LessThan)return this.parseHexString();if(t===Q.LeftParen)return this.parseString();if(t===Q.ForwardSlash)return this.parseName();if(t===Q.LeftSquareBracket)return this.parseArray();if(pl[t])return this.parseNumberOrRef();throw new SA(this.bytes.position(),t)},r.prototype.parseNumberOrRef=function(){var t=this.parseRawNumber();this.skipWhitespaceAndComments();var n=this.bytes.offset();if(Kt[this.bytes.peek()]){var i=this.parseRawNumber();if(this.skipWhitespaceAndComments(),this.bytes.peek()===Q.R)return this.bytes.assertNext(Q.R),xt.of(t,i)}return this.bytes.moveTo(n),Qe.of(t)},r.prototype.parseHexString=function(){var t="";for(this.bytes.assertNext(Q.LessThan);!this.bytes.done()&&this.bytes.peek()!==Q.GreaterThan;)t+=Xr(this.bytes.next());return this.bytes.assertNext(Q.GreaterThan),qe.of(t)},r.prototype.parseString=function(){for(var t=0,n=!1,i="";!this.bytes.done();){var a=this.bytes.next();if(i+=Xr(a),n||(a===Q.LeftParen&&(t+=1),a===Q.RightParen&&(t-=1)),a===Q.BackSlash?n=!n:n&&(n=!1),t===0)return wt.of(i.substring(1,i.length-1))}throw new PA(this.bytes.position())},r.prototype.parseName=function(){this.bytes.assertNext(Q.ForwardSlash);for(var t="";!this.bytes.done();){var n=this.bytes.peek();if(Yr[n]||Pr[n])break;t+=Xr(n),this.bytes.next()}return X.of(t)},r.prototype.parseArray=function(){this.bytes.assertNext(Q.LeftSquareBracket),this.skipWhitespaceAndComments();for(var t=vt.withContext(this.context);this.bytes.peek()!==Q.RightSquareBracket;){var n=this.parseObject();t.push(n),this.skipWhitespaceAndComments()}return this.bytes.assertNext(Q.RightSquareBracket),t},r.prototype.parseDict=function(){this.bytes.assertNext(Q.LessThan),this.bytes.assertNext(Q.LessThan),this.skipWhitespaceAndComments();for(var t=new Map;!this.bytes.done()&&this.bytes.peek()!==Q.GreaterThan&&this.bytes.peekAhead(1)!==Q.GreaterThan;){var n=this.parseName(),i=this.parseObject();t.set(n,i),this.skipWhitespaceAndComments()}this.skipWhitespaceAndComments(),this.bytes.assertNext(Q.GreaterThan),this.bytes.assertNext(Q.GreaterThan);var a=t.get(X.of("Type"));return a===X.of("Catalog")?pd.fromMapWithContext(t,this.context):a===X.of("Pages")?Ad.fromMapWithContext(t,this.context):a===X.of("Page")?Kr.fromMapWithContext(t,this.context):et.fromMapWithContext(t,this.context)},r.prototype.parseDictOrStream=function(){var t=this.bytes.position(),n=this.parseDict();if(this.skipWhitespaceAndComments(),!this.matchKeyword(Ct.streamEOF1)&&!this.matchKeyword(Ct.streamEOF2)&&!this.matchKeyword(Ct.streamEOF3)&&!this.matchKeyword(Ct.streamEOF4)&&!this.matchKeyword(Ct.stream))return n;var i=this.bytes.offset(),a,o=n.get(X.of("Length"));o instanceof Qe?(a=i+o.asNumber(),this.bytes.moveTo(a),this.skipWhitespaceAndComments(),this.matchKeyword(Ct.endstream)||(this.bytes.moveTo(i),a=this.findEndOfStreamFallback(t))):a=this.findEndOfStreamFallback(t);var l=this.bytes.slice(i,a);return Ji.of(n,l)},r.prototype.findEndOfStreamFallback=function(t){for(var n=1,i=this.bytes.offset();!this.bytes.done()&&(i=this.bytes.offset(),this.matchKeyword(Ct.stream)?n+=1:this.matchKeyword(Ct.EOF1endstream)||this.matchKeyword(Ct.EOF2endstream)||this.matchKeyword(Ct.EOF3endstream)||this.matchKeyword(Ct.endstream)?n-=1:this.bytes.next(),n!==0););if(n!==0)throw new CA(t);return i},r.forBytes=function(t,n,i){return new r(Ro.of(t),n,i)},r.forByteStream=function(t,n,i){return i===void 0&&(i=!1),new r(t,n,i)},r})(Sm),gd=Pm,Fm=(function(e){Te(r,e);function r(t,n){var i=e.call(this,Ro.fromPDFRawStream(t),t.dict.context)||this,a=t.dict;return i.alreadyParsed=!1,i.shouldWaitForTick=n||(function(){return!1}),i.firstOffset=a.lookup(X.of("First"),Qe).asNumber(),i.objectCount=a.lookup(X.of("N"),Qe).asNumber(),i}return r.prototype.parseIntoContext=function(){return it(this,void 0,void 0,function(){var t,n,i,a,o,l,c,s;return at(this,function(u){switch(u.label){case 0:if(this.alreadyParsed)throw new il("PDFObjectStreamParser","parseIntoContext");this.alreadyParsed=!0,t=this.parseOffsetsAndObjectNumbers(),n=0,i=t.length,u.label=1;case 1:return n=Q.Space&&n<=Q.Tilde;if(i&&(this.matchKeyword(Ct.xref)||this.matchKeyword(Ct.trailer)||this.matchKeyword(Ct.startxref)||this.matchIndirectObjectHeader())){this.bytes.moveTo(t);break}this.bytes.next()}},r.prototype.skipBinaryHeaderComment=function(){this.skipWhitespaceAndComments();try{var t=this.bytes.offset();this.parseIndirectObjectHeader(),this.bytes.moveTo(t)}catch{this.bytes.next(),this.skipWhitespaceAndComments()}},r.forBytesWithOptions=function(t,n,i,a){return new r(t,n,i,a)},r})(gd),Rm=Bm,zr=function(e){return 1<0&&(n[n.length]=+i),t[t.length]={cmd:r,args:n},n=[],i="",a=!1),r=s;else if([" ",","].includes(s)||s==="-"&&i.length>0&&i[i.length-1]!=="e"||s==="."&&a){if(i.length===0)continue;n.length===o?(t[t.length]={cmd:r,args:n},n=[+i],r==="M"&&(r="L"),r==="m"&&(r="l")):n[n.length]=+i,a=s===".",i=["-","."].includes(s)?s:""}else i+=s,s==="."&&(a=!0)}return i.length>0&&(n.length===o?(t[t.length]={cmd:r,args:n},n=[+i],r==="M"&&(r="L"),r==="m"&&(r="l")):n[n.length]=+i),t[t.length]={cmd:r,args:n},t},Vm=function(e){Ue=We=ct=ut=Oi=_i=0;for(var r=[],t=0;t1&&(A=Math.sqrt(A),t*=A,n*=A);var f=d/t,p=u/t,g=-u/n,y=d/n,v=f*l+p*c,b=g*l+y*c,x=f*e+p*r,P=g*e+y*r,F=(x-v)*(x-v)+(P-b)*(P-b),R=1/F-.25;R<0&&(R=0);var E=Math.sqrt(R);a===i&&(E=-E);var B=.5*(v+x)-E*(P-b),T=.5*(b+P)+E*(x-v),W=Math.atan2(b-T,v-B),H=Math.atan2(P-T,x-B),C=H-W;C<0&&a===1?C+=2*Math.PI:C>0&&a===0&&(C-=2*Math.PI);for(var I=Math.ceil(Math.abs(C/(Math.PI*.5+.001))),m=[],N=0;Ne.length)return i-1;var y=r.heightAtSize(i),v=y+y*.2,b=v*a;if(b>Math.abs(t.height))return i-1;i+=1}return i},hv=function(e,r,t,n){for(var i=t.width/n,a=t.height,o=Nd,l=yp(e);oi*.75;if(d)return o-1}var A=r.heightAtSize(o,{descender:!1});if(A>a)return o-1;o+=1}return o},pv=function(e){for(var r=e.length;r>0;r--)if(/\s/.test(e[r]))return r},Av=function(e,r,t,n){for(var i,a=e.length;a>0;){var o=e.substring(0,a),l=t.encodeText(o),c=t.widthOfTextAtSize(o,n);if(cA&&(A=E+F),p+l>f&&(f=p+l),s.push({text:x,encoded:P,width:F,height:l,x:E,y:p}),v=R?.trim()}return{fontSize:n,lineHeight:c,lines:s,bounds:{x:u,y:d,width:A-u,height:f-d}}},gv=function(e,r){var t=r.fontSize,n=r.font,i=r.bounds,a=r.cellCount,o=Uu(ia(e));if(o.length>a)throw new uv(o.length,a);(t===void 0||t===0)&&(t=hv(o,n,i,a));for(var l=i.width/a,c=n.heightAtSize(t,{descender:!1}),s=i.y+(i.height/2-c/2),u=[],d=i.x,A=i.y,f=i.x+i.width,p=i.y+i.height,g=0,y=0;gf&&(f=E+F),s+c>p&&(p=s+c),u.push({text:o,encoded:P,width:F,height:c,x:E,y:s}),g+=1,y+=x}return{fontSize:t,cells:u,bounds:{x:d,y:A,width:f-d,height:p-A}}},Ao=function(e,r){var t=r.alignment,n=r.fontSize,i=r.font,a=r.bounds,o=Uu(ia(e));(n===void 0||n===0)&&(n=zd([o],i,a));var l=i.encodeText(o),c=i.widthOfTextAtSize(o,n),s=i.heightAtSize(n,{descender:!1}),u=t===Mt.Left?a.x:t===Mt.Center?a.x+a.width/2-c/2:t===Mt.Right?a.x+a.width-c:a.x,d=a.y+(a.height/2-s/2);return{fontSize:n,line:{text:o,encoded:l,width:c,height:s,x:u,y:d},bounds:{x:u,y:d,width:c,height:s}}},gi=function(e){return"normal"in e?e:{normal:e}},mv=/\/([^\0\t\n\f\r\ ]+)[\0\t\n\f\r\ ]+(\d*\.\d+|\d+)[\0\t\n\f\r\ ]+Tf/,wn=function(e){var r,t,n=(r=e.getDefaultAppearance())!==null&&r!==void 0?r:"",i=(t=rl(n,mv).match)!==null&&t!==void 0?t:[],a=Number(i[2]);return isFinite(a)?a:void 0},vv=/(\d*\.\d+|\d+)[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]+(g|rg|k)/,kr=function(e){var r,t=(r=e.getDefaultAppearance())!==null&&r!==void 0?r:"",n=rl(t,vv).match,i=n??[],a=i[1],o=i[2],l=i[3],c=i[4],s=i[5];if(s==="g"&&a)return Dd(Number(a));if(s==="rg"&&a&&o&&l)return St(Number(a),Number(o),Number(l));if(s==="k"&&a&&o&&l&&c)return Ed(Number(a),Number(o),Number(l),Number(c))},Cr=function(e,r,t,n){var i;n===void 0&&(n=0);var a=[jn(r).toString(),vl((i=t?.name)!==null&&i!==void 0?i:"dummy__noop",n).toString()].join(` -`);e.setDefaultAppearance(a)},yv=function(e,r){var t,n,i,a=kr(r),o=kr(e.acroField),l=r.getRectangle(),c=r.getAppearanceCharacteristics(),s=r.getBorderStyle(),u=(t=s?.getWidth())!==null&&t!==void 0?t:0,d=Jr(c?.getRotation()),A=Wn(l,d),f=A.width,p=A.height,g=Cn(Je(Je({},l),{rotation:d})),y=St(0,0,0),v=(n=er(c?.getBorderColor()))!==null&&n!==void 0?n:y,b=er(c?.getBackgroundColor()),x=er(c?.getBackgroundColor(),.8),P=(i=a??o)!==null&&i!==void 0?i:y;Cr(a?r:e.acroField,P);var F={x:0+u/2,y:0+u/2,width:f-u,height:p-u,thickness:1.5,borderWidth:u,borderColor:v,markColor:P};return{normal:{on:ht(g,qa(Je(Je({},F),{color:b,filled:!0}))),off:ht(g,qa(Je(Je({},F),{color:b,filled:!1})))},down:{on:ht(g,qa(Je(Je({},F),{color:x,filled:!0}))),off:ht(g,qa(Je(Je({},F),{color:x,filled:!1})))}}},bv=function(e,r){var t,n,i,a=kr(r),o=kr(e.acroField),l=r.getRectangle(),c=r.getAppearanceCharacteristics(),s=r.getBorderStyle(),u=(t=s?.getWidth())!==null&&t!==void 0?t:0,d=Jr(c?.getRotation()),A=Wn(l,d),f=A.width,p=A.height,g=Cn(Je(Je({},l),{rotation:d})),y=St(0,0,0),v=(n=er(c?.getBorderColor()))!==null&&n!==void 0?n:y,b=er(c?.getBackgroundColor()),x=er(c?.getBackgroundColor(),.8),P=(i=a??o)!==null&&i!==void 0?i:y;Cr(a?r:e.acroField,P);var F={x:f/2,y:p/2,width:f-u,height:p-u,borderWidth:u,borderColor:v,dotColor:P};return{normal:{on:ht(g,Va(Je(Je({},F),{color:b,filled:!0}))),off:ht(g,Va(Je(Je({},F),{color:b,filled:!1})))},down:{on:ht(g,Va(Je(Je({},F),{color:x,filled:!0}))),off:ht(g,Va(Je(Je({},F),{color:x,filled:!1})))}}},wv=function(e,r,t){var n,i,a,o,l,c=kr(r),s=kr(e.acroField),u=wn(r),d=wn(e.acroField),A=r.getRectangle(),f=r.getAppearanceCharacteristics(),p=r.getBorderStyle(),g=f?.getCaptions(),y=(n=g?.normal)!==null&&n!==void 0?n:"",v=(a=(i=g?.down)!==null&&i!==void 0?i:y)!==null&&a!==void 0?a:"",b=(o=p?.getWidth())!==null&&o!==void 0?o:0,x=Jr(f?.getRotation()),P=Wn(A,x),F=P.width,R=P.height,E=Cn(Je(Je({},A),{rotation:x})),B=St(0,0,0),T=er(f?.getBorderColor()),W=er(f?.getBackgroundColor()),H=er(f?.getBackgroundColor(),.8),C={x:b,y:b,width:F-b*2,height:R-b*2},I=Ao(y,{alignment:Mt.Center,fontSize:u??d,font:t,bounds:C}),m=Ao(v,{alignment:Mt.Center,fontSize:u??d,font:t,bounds:C}),N=Math.min(I.fontSize,m.fontSize),ne=(l=c??s)!==null&&l!==void 0?l:B;Cr(c||u!==void 0?r:e.acroField,ne,t,N);var q={x:0+b/2,y:0+b/2,width:F-b,height:R-b,borderWidth:b,borderColor:T,textColor:ne,font:t.name,fontSize:N};return{normal:ht(E,bu(Je(Je({},q),{color:W,textLines:[I.line]}))),down:ht(E,bu(Je(Je({},q),{color:H,textLines:[m.line]})))}},xv=function(e,r,t){var n,i,a,o,l=kr(r),c=kr(e.acroField),s=wn(r),u=wn(e.acroField),d=r.getRectangle(),A=r.getAppearanceCharacteristics(),f=r.getBorderStyle(),p=(n=e.getText())!==null&&n!==void 0?n:"",g=(i=f?.getWidth())!==null&&i!==void 0?i:0,y=Jr(A?.getRotation()),v=Wn(d,y),b=v.width,x=v.height,P=Cn(Je(Je({},d),{rotation:y})),F=St(0,0,0),R=er(A?.getBorderColor()),E=er(A?.getBackgroundColor()),B,T,W=e.isCombed()?0:1,H={x:g+W,y:g+W,width:b-(g+W)*2,height:x-(g+W)*2};if(e.isMultiline()){var C=Md(p,{alignment:e.getAlignment(),fontSize:s??u,font:t,bounds:H});B=C.lines,T=C.fontSize}else if(e.isCombed()){var C=gv(p,{fontSize:s??u,font:t,bounds:H,cellCount:(a=e.getMaxLength())!==null&&a!==void 0?a:0});B=C.cells,T=C.fontSize}else{var C=Ao(p,{alignment:e.getAlignment(),fontSize:s??u,font:t,bounds:H});B=[C.line],T=C.fontSize}var I=(o=l??c)!==null&&o!==void 0?o:F;Cr(l||s!==void 0?r:e.acroField,I,t,T);var m={x:0+g/2,y:0+g/2,width:b-g,height:x-g,borderWidth:g??0,borderColor:R,textColor:I,font:t.name,fontSize:T,color:E,textLines:B,padding:W};return ht(P,Rd(m))},Sv=function(e,r,t){var n,i,a,o=kr(r),l=kr(e.acroField),c=wn(r),s=wn(e.acroField),u=r.getRectangle(),d=r.getAppearanceCharacteristics(),A=r.getBorderStyle(),f=(n=e.getSelected()[0])!==null&&n!==void 0?n:"",p=(i=A?.getWidth())!==null&&i!==void 0?i:0,g=Jr(d?.getRotation()),y=Wn(u,g),v=y.width,b=y.height,x=Cn(Je(Je({},u),{rotation:g})),P=St(0,0,0),F=er(d?.getBorderColor()),R=er(d?.getBackgroundColor()),E=1,B={x:p+E,y:p+E,width:v-(p+E)*2,height:b-(p+E)*2},T=Ao(f,{alignment:Mt.Left,fontSize:c??s,font:t,bounds:B}),W=T.line,H=T.fontSize,C=(a=o??l)!==null&&a!==void 0?a:P;Cr(o||c!==void 0?r:e.acroField,C,t,H);var I={x:0+p/2,y:0+p/2,width:v-p,height:b-p,borderWidth:p??0,borderColor:F,textColor:C,font:t.name,fontSize:H,color:R,textLines:[W],padding:E};return ht(x,Rd(I))},kv=function(e,r,t){var n,i,a=kr(r),o=kr(e.acroField),l=wn(r),c=wn(e.acroField),s=r.getRectangle(),u=r.getAppearanceCharacteristics(),d=r.getBorderStyle(),A=(n=d?.getWidth())!==null&&n!==void 0?n:0,f=Jr(u?.getRotation()),p=Wn(s,f),g=p.width,y=p.height,v=Cn(Je(Je({},s),{rotation:f})),b=St(0,0,0),x=er(u?.getBorderColor()),P=er(u?.getBackgroundColor()),F=e.getOptions(),R=e.getSelected();e.isSorted()&&F.sort();for(var E="",B=0,T=F.length;B1||i.length===1&&n)&&this.enableMultiselect();for(var l=new Array(i.length),c=0,s=i.length;c1||i.length===1&&n)&&this.enableMultiselect();for(var o=new Array(i.length),l=0,c=i.length;ln)throw new dv(t.length,n,this.getName());this.markAsDirty(),this.disableRichFormatting(),t?this.acroField.setValue(qe.fromText(t)):this.acroField.removeValue()},r.prototype.getAlignment=function(){var t=this.acroField.getQuadding();return t===0?Mt.Left:t===1?Mt.Center:t===2?Mt.Right:Mt.Left},r.prototype.setAlignment=function(t){gn(t,"alignment",Mt),this.markAsDirty(),this.acroField.setQuadding(t)},r.prototype.getMaxLength=function(){return this.acroField.getMaxLength()},r.prototype.setMaxLength=function(t){if(Dr(t,"maxLength",0,Number.MAX_SAFE_INTEGER),this.markAsDirty(),t===void 0)this.acroField.removeMaxLength();else{var n=this.getText();if(n&&n.length>t)throw new fv(n.length,t,this.getName());this.acroField.setMaxLength(t)}},r.prototype.removeMaxLength=function(){this.markAsDirty(),this.acroField.removeMaxLength()},r.prototype.setImage=function(t){for(var n=this.getAlignment(),i=n===Mt.Center?vn.Center:n===Mt.Right?vn.Right:vn.Left,a=this.acroField.getWidgets(),o=0,l=a.length;o=100?e:typeof e=="string"&&e.includes("%")?Math.round(r&&r==="X"?parseFloat(e)/100*t.width:r&&r==="Y"?parseFloat(e)/100*t.height:parseFloat(e)/100*t.width):0}function to(e){return e.replace(/[xy]/g,function(r){let t=Math.random()*16|0;return(r==="x"?t:t&3|8).toString(16)})}function Ve(e){return typeof e>"u"||e==null?"":e.toString().replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function lt(e){return typeof e=="number"&&e>100?e:(typeof e=="string"&&(e=Number(e.replace(/in*/gi,""))),Math.round(Ke*e))}function je(e){let r=Number(e)||0;return isNaN(r)?0:Math.round(r*ua)}function Un(e){return e=e||0,Math.round((e>360?e-360:e)*6e4)}function Fs(e){let r=e.toString(16);return r.length===1?"0"+r:r}function Ts(e,r,t){return(Fs(e)+Fs(r)+Fs(t)).toUpperCase()}function ft(e,r){let t=(e||"").replace("#","");!Ps.test(t)&&t!==or.background1&&t!==or.background2&&t!==or.text1&&t!==or.text2&&t!==or.accent1&&t!==or.accent2&&t!==or.accent3&&t!==or.accent4&&t!==or.accent5&&t!==or.accent6&&(console.warn(`"${t}" is not a valid scheme color or hex RGB! "${nr}" used instead. Only provide 6-digit RGB or 'pptx.SchemeColor' values!`),t=nr);let n=Ps.test(t)?"srgbClr":"schemeClr",i='val="'+(Ps.test(t)?t.toUpperCase():t)+'"';return r?`${r}`:``}function r0(e,r){let t="",n=Object.assign(Object.assign({},r),e),i=Math.round(n.size*ua),a=n.color,o=Math.round(n.opacity*1e5);return t+=``,t+=ft(a,``),t+="",t}function lr(e){let r="solid",t="",n="",i="";return e&&(typeof e=="string"?t=e:(e.type&&(r=e.type),e.color&&(t=e.color),e.alpha&&(n+=``),e.transparency&&(n+=``)),r==="solid"?i+=`${ft(t,n)}`:i+=""),i}function Vr(e){return e._rels.length+e._relsChart.length+e._relsMedia.length+1}function kl(e){if(!(!e||typeof e!="object"))return e.type!=="outer"&&e.type!=="inner"&&e.type!=="none"&&(console.warn("Warning: shadow.type options are `outer`, `inner` or `none`."),e.type="outer"),e.angle&&((isNaN(Number(e.angle))||e.angle<0||e.angle>359)&&(console.warn("Warning: shadow.angle can only be 0-359"),e.angle=270),e.angle=Math.round(Number(e.angle))),e.opacity&&((isNaN(Number(e.opacity))||e.opacity<0||e.opacity>1)&&(console.warn("Warning: shadow.opacity can only be 0-1"),e.opacity=.75),e.opacity=Number(e.opacity)),e.color&&e.color.startsWith("#")&&(console.warn('Warning: shadow.color should not include hash (#) character, , e.g. "FF0000"'),e.color=e.color.replace("#","")),e}function n0(e,r,t){var n,i;let a=2.3+(!((n=e.options)===null||n===void 0)&&n.autoPageCharWeight?e.options.autoPageCharWeight:0),o=Math.floor(r/ua*Ke)/((!((i=e.options)===null||i===void 0)&&i.fontSize?e.options.fontSize:wr)/a),l=[],c=[],s=[],u=[];e.text&&e.text.toString().trim().length===0?c.push({_type:He.tablecell,text:" "}):typeof e.text=="number"||typeof e.text=="string"?c.push({_type:He.tablecell,text:(e.text||"").toString().trim()}):Array.isArray(e.text)&&(c=e.text);let d=[];return c.forEach(A=>{var f;typeof A.text=="string"&&(A.text.split(` +end`},au=function(){for(var e=[],r=0;r"},Ya=function(e){return ia(e,4)},yg=function(e){if(Mp(e))return Ya(e);if(Op(e)){var r=qu(e),t=Vu(e);return""+Ya(r)+Ya(t)}var n=So(e),i="0x"+n+" is not a valid UTF-8 or UTF-16 codepoint.";throw new Error(i)},bg=function(e){var r=0,t=function(n){r|=1<=Q.Zero&&s<=Q.Seven?(n+=c,(n.length===3||!(u>="0"&&u<="7"))&&(a(parseInt(n,8)),n="")):a(s):s===Q.BackSlash?i=!0:a(s)}return new Uint8Array(t)},r.prototype.decodeText=function(){var t=this.asBytes();return Qu(t)?Xu(t):$u(t)},r.prototype.decodeDate=function(){var t=this.decodeText(),n=Gu(t);if(!n)throw new ed(t);return n},r.prototype.asString=function(){return this.value},r.prototype.clone=function(){return r.of(this.value)},r.prototype.toString=function(){return"("+this.value+")"},r.prototype.sizeInBytes=function(){return this.value.length+2},r.prototype.copyBytesInto=function(t,n){return t[n++]=Q.LeftParen,n+=Vt(this.value,t,n),t[n++]=Q.RightParen,this.value.length+2},r.of=function(t){return new r(t)},r.fromDate=function(t){var n=Er(String(t.getUTCFullYear()),4,"0"),i=Er(String(t.getUTCMonth()+1),2,"0"),a=Er(String(t.getUTCDate()),2,"0"),o=Er(String(t.getUTCHours()),2,"0"),l=Er(String(t.getUTCMinutes()),2,"0"),c=Er(String(t.getUTCSeconds()),2,"0");return new r("D:"+n+i+a+o+l+c+"Z")},r})($t),wt=xg,Sg=(function(){function e(r,t,n,i){var a=this;this.allGlyphsInFontSortedById=function(){for(var o=new Array(a.font.characterSet.length),l=0,c=o.length;l>3)]>>7-((p&7)<<0)&1,C=3*H;l[P]=F[C],l[P+1]=F[C+1],l[P+2]=F[C+2],l[P+3]=H>2)]>>6-((p&3)<<1)&3,C=3*H;l[P]=F[C],l[P+1]=F[C+1],l[P+2]=F[C+2],l[P+3]=H>1)]>>4-((p&1)<<2)&15,C=3*H;l[P]=F[C],l[P+1]=F[C+1],l[P+2]=F[C+2],l[P+3]=H>>3)]>>>7-(q&7)&1),se=m==v*255?0:255;c[ne+q]=se<<24|m<<16|m<<8|m}else if(u==2)for(var q=0;q>>2)]>>>6-((q&3)<<1)&3),se=m==v*85?0:255;c[ne+q]=se<<24|m<<16|m<<8|m}else if(u==4)for(var q=0;q>>1)]>>>4-((q&1)<<2)&15),se=m==v*17?0:255;c[ne+q]=se<<24|m<<16|m<<8|m}else if(u==8)for(var q=0;q>>2<<3));i==0;){if(i=y(r,A,1),a=y(r,A+1,2),A+=3,a==0){(A&7)!=0&&(A+=8-(A&7));var B=(A>>>3)+4,T=r[B-4]|r[B-3]<<8;E&&(t=e.H.W(t,d+T)),t.set(new n(r.buffer,r.byteOffset+B,T),d),A=B+T<<3,d+=T;continue}if(E&&(t=e.H.W(t,d+(1<<17))),a==1&&(f=R.J,p=R.h,s=511,u=31),a==2){o=v(r,A,5)+257,l=v(r,A+5,5)+1,c=v(r,A+10,4)+4,A+=14;for(var W=A,H=1,C=0;C<38;C+=2)R.Q[C]=0,R.Q[C+1]=0;for(var C=0;CH&&(H=I)}A+=3*c,x(R.Q,H),P(R.Q,H,R.u),f=R.w,p=R.d,A=b(R.u,(1<>>4;if(!(q>>>8))t[d++]=q;else{if(q==256)break;var se=d+q-254;if(q>264){var Z=R.q[q-257];se=d+(Z>>>3)+v(r,A,Z&7),A+=Z&7}var ue=p[F(r,A)&u];A+=ue&15;var j=ue>>>4,_=R.c[j],fe=(_>>>4)+y(r,A,_&15);for(A+=_&15;d>>4;if(d<=15)o[s]=d,s++;else{var A=0,f=0;d==16?(f=3+l(i,a,2),a+=2,A=o[s-1]):d==17?(f=3+l(i,a,3),a+=3):d==18&&(f=11+l(i,a,7),a+=7);for(var p=s+f;s>>1;oa&&(a=c),o++}for(;o>1,s=r[l+1],u=c<<4|s,d=t-s,A=r[l]<>>15-t;n[p]=u,A++}},e.H.l=function(r,t){for(var n=e.H.m.r,i=15-t,a=0;a>>i}},e.H.M=function(r,t,n){n=n<<(t&7);var i=t>>>3;r[i]|=n,r[i+1]|=n>>>8},e.H.I=function(r,t,n){n=n<<(t&7);var i=t>>>3;r[i]|=n,r[i+1]|=n>>>8,r[i+2]|=n>>>16},e.H.e=function(r,t,n){return(r[t>>>3]|r[(t>>>3)+1]<<8)>>>(t&7)&(1<>>3]|r[(t>>>3)+1]<<8|r[(t>>>3)+2]<<16)>>>(t&7)&(1<>>3]|r[(t>>>3)+1]<<8|r[(t>>>3)+2]<<16)>>>(t&7)},e.H.i=function(r,t){return(r[t>>>3]|r[(t>>>3)+1]<<8|r[(t>>>3)+2]<<16|r[(t>>>3)+3]<<24)>>>(t&7)},e.H.m=(function(){var r=Uint16Array,t=Uint32Array;return{K:new r(16),j:new r(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new r(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new t(32),J:new r(512),_:[],h:new r(32),$:[],w:new r(32768),C:[],v:[],d:new r(32768),D:[],u:new r(512),Q:[],r:new r(32768),s:new t(286),Y:new t(30),a:new t(19),t:new t(15e3),k:new r(65536),g:new r(32768)}})(),(function(){for(var r=e.H.m,t=32768,n=0;n>>1|(i&1431655765)<<1,i=(i&3435973836)>>>2|(i&858993459)<<2,i=(i&4042322160)>>>4|(i&252645135)<<4,i=(i&4278255360)>>>8|(i&16711935)<<8,r.r[n]=(i>>>16|i<<16)>>>17}function a(o,l,c){for(;l--!=0;)o.push(0,c)}for(var n=0;n<32;n++)r.q[n]=r.S[n]<<3|r.T[n],r.c[n]=r.p[n]<<4|r.z[n];a(r._,144,8),a(r._,112,9),a(r._,24,7),a(r._,8,8),e.H.n(r._,9),e.H.A(r._,9,r.J),e.H.l(r._,9),a(r.$,32,5),e.H.n(r.$,5),e.H.A(r.$,5,r.h),e.H.l(r.$,5),a(r.Q,19,0),a(r.C,286,0),a(r.D,30,0),a(r.v,320,0)})(),e.H.N})();Se.decode._readInterlace=function(e,r){for(var t=r.width,n=r.height,i=Se.decode._getBPP(r),a=i>>3,o=Math.ceil(t*i/8),l=new Uint8Array(n*o),c=0,s=[0,0,4,0,2,0,1],u=[0,4,0,2,0,1,0],d=[8,8,8,4,4,2,2],A=[8,8,4,4,2,2,1],f=0;f<7;){for(var p=d[f],g=A[f],y=0,v=0,b=s[f];b>3];T=T>>7-(B&7)&1,l[R*o+(E>>3)]|=T<<7-((E&7)<<0)}if(i==2){var T=e[B>>3];T=T>>6-(B&7)&3,l[R*o+(E>>2)]|=T<<6-((E&3)<<1)}if(i==4){var T=e[B>>3];T=T>>4-(B&7)&15,l[R*o+(E>>1)]|=T<<4-((E&1)<<2)}if(i>=8)for(var W=R*o+E*a,H=0;H>3)+H];B+=i,E+=g}F++,R+=p}y*v!=0&&(c+=v*(1+P)),f=f+1}return l};Se.decode._getBPP=function(e){var r=[1,null,3,1,2,null,4][e.ctype];return r*e.depth};Se.decode._filterZero=function(e,r,t,n,i){var a=Se.decode._getBPP(r),o=Math.ceil(n*a/8),l=Se.decode._paeth;a=Math.ceil(a/8);var c=0,s=1,u=e[t],d=0;if(u>1&&(e[t]=[0,0,1][u-2]),u==3)for(d=a;d>>1)&255;for(var A=0;A>>1);for(;d>>1)}else{for(;d>8&255,e[r+1]=t&255},readUint:function(e,r){return e[r]*(256*256*256)+(e[r+1]<<16|e[r+2]<<8|e[r+3])},writeUint:function(e,r,t){e[r]=t>>24&255,e[r+1]=t>>16&255,e[r+2]=t>>8&255,e[r+3]=t&255},readASCII:function(e,r,t){for(var n="",i=0;i=0&&l>=0?(d=f*r+p<<2,A=(l+f)*i+o+p<<2):(d=(-l+f)*r-o+p<<2,A=f*i+p<<2),c==0)n[A]=e[d],n[A+1]=e[d+1],n[A+2]=e[d+2],n[A+3]=e[d+3];else if(c==1){var g=e[d+3]*.00392156862745098,y=e[d]*g,v=e[d+1]*g,b=e[d+2]*g,x=n[A+3]*(1/255),P=n[A]*x,F=n[A+1]*x,R=n[A+2]*x,E=1-g,B=g+x*E,T=B==0?0:1/B;n[A+3]=255*B,n[A+0]=(y+P*E)*T,n[A+1]=(v+F*E)*T,n[A+2]=(b+R*E)*T}else if(c==2){var g=e[d+3],y=e[d],v=e[d+1],b=e[d+2],x=n[A+3],P=n[A],F=n[A+1],R=n[A+2];g==x&&y==P&&v==F&&b==R?(n[A]=0,n[A+1]=0,n[A+2]=0,n[A+3]=0):(n[A]=y,n[A+1]=v,n[A+2]=b,n[A+3]=g)}else if(c==3){var g=e[d+3],y=e[d],v=e[d+1],b=e[d+2],x=n[A+3],P=n[A],F=n[A+1],R=n[A+2];if(g==x&&y==P&&v==F&&b==R)continue;if(g<220&&x>20)return!1}return!0};Se.encode=function(e,r,t,n,i,a,o){n==null&&(n=0),o==null&&(o=!1);var l=Se.encode.compress(e,r,t,n,[!1,!1,!1,0,o]);return Se.encode.compressPNG(l,-1),Se.encode._main(l,r,t,i,a)};Se.encodeLL=function(e,r,t,n,i,a,o,l){for(var c={ctype:0+(n==1?0:2)+(i==0?0:4),depth:a,frames:[]},s=Date.now(),u=(n+i)*a,d=u*r,A=0;A1,d=!1,A=33+(u?20:0);if(i.sRGB!=null&&(A+=13),i.pHYs!=null&&(A+=21),e.ctype==3){for(var f=e.plte.length,p=0;p>>24!=255&&(d=!0);A+=8+f*3+4+(d?8+f*1+4:0)}for(var g=0;g>>8&255,E=P>>>16&255;v[s+x+0]=F,v[s+x+1]=R,v[s+x+2]=E}if(s+=f*3,o(v,s,a(v,s-f*3-4,f*3+4)),s+=4,d){o(v,s,f),s+=4,c(v,s,"tRNS"),s+=4;for(var p=0;p>>24&255;s+=f,o(v,s,a(v,s-f-4,f+4)),s+=4}}for(var B=0,g=0;g>2,C>>2));for(var f=0;fN&&q==m[y-N])ne[y]=ne[y-N];else{var se=x[q];if(se==null&&(x[q]=se=P.length,P.push(q),P.length>=300))break;ne[y]=se}}}var Z=P.length;Z<=256&&s==!1&&(Z<=2?d=1:Z<=4?d=2:Z<=16?d=4:d=8,d=Math.max(d,c));for(var f=0;f>1)]|=ke[Oe+we]<<4-(we&1)*4;else if(d==2)for(var we=0;we>2)]|=ke[Oe+we]<<6-(we&3)*2;else if(d==1)for(var we=0;we>3)]|=ke[Oe+we]<<7-(we&7)*1}fe=Re,u=3,be=1}else if(v==!1&&b.length==1){for(var Re=new Uint8Array(N*_*3),tt=N*_,y=0;yE&&(E=W),TB&&(B=T))}E==-1&&(F=R=E=B=0),i&&((F&1)==1&&F--,(R&1)==1&&R--);var C=(E-F+1)*(B-R+1);Cy&&(y=P),Fv&&(v=F))}y==-1&&(p=g=y=v=0),o&&((p&1)==1&&p--,(g&1)==1&&g--),a={x:p,y:g,width:y-p+1,height:v-g+1};var B=n[i];B.rect=a,B.blend=1,B.img=new Uint8Array(a.width*a.height*4),n[i-1].dispose==0?(Se._copyTile(s,r,t,B.img,a.width,a.height,-a.x,-a.y,0),Se.encode._prepareDiff(A,r,t,B.img,a)):Se._copyTile(A,r,t,B.img,a.width,a.height,-a.x,-a.y,0)};Se.encode._prepareDiff=function(e,r,t,n,i){Se._copyTile(e,r,t,n,i.width,i.height,-i.x,-i.y,2)};Se.encode._filterZero=function(e,r,t,n,i,a,o){var l=[],c=[0,1,2,3,4];a!=-1?c=[a]:(r*n>5e5||t==1)&&(c=[0]);var s;o&&(s={level:0});for(var u=o&&UZIP!=null?UZIP:Eg.default,d=0;d>1)+256&255;if(a==4)for(var s=i;s>1)&255;for(var s=i;s>1)&255}if(a==4){for(var s=0;s>>1:t=t>>>1;e[r]=t}return e})(),update:function(e,r,t,n){for(var i=0;i>>8;return e},crc:function(e,r,t){return Se.crc.update(4294967295,e,r,t)^4294967295}};Se.quantize=function(e,r){for(var t=new Uint8Array(e),n=t.slice(0),i=new Uint32Array(n.buffer),a=Se.quantize.getKDtree(n,r),o=a[0],l=a[1],c=Se.quantize.planeDst,s=t,u=i,d=s.length,A=new Uint8Array(t.length>>2),f=0;f>2]=b.ind,u[f>>2]=b.est.rgba}return{abuf:n.buffer,inds:A,plte:l}};Se.quantize.getKDtree=function(e,r,t){t==null&&(t=1e-4);var n=new Uint32Array(e.buffer),i={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};i.bst=Se.quantize.stats(e,i.i0,i.i1),i.est=Se.quantize.estats(i.bst);for(var a=[i];a.lengtho&&(o=a[c].est.L,l=c);if(o=u||s.i1<=u;if(d){s.est.L=0;continue}var A={i0:s.i0,i1:u,bst:null,est:null,tdst:0,left:null,right:null};A.bst=Se.quantize.stats(e,A.i0,A.i1),A.est=Se.quantize.estats(A.bst);var f={i0:u,i1:s.i1,bst:null,est:null,tdst:0,left:null,right:null};f.bst={R:[],m:[],N:s.bst.N-A.bst.N};for(var c=0;c<16;c++)f.bst.R[c]=s.bst.R[c]-A.bst.R[c];for(var c=0;c<4;c++)f.bst.m[c]=s.bst.m[c]-A.bst.m[c];f.est=Se.quantize.estats(f.bst),s.left=A,s.right=f,a[l]=A,a.push(f)}a.sort(function(p,g){return g.bst.N-p.bst.N});for(var c=0;c0&&(o=e.right,l=e.left);var c=Se.quantize.getNearest(o,r,t,n,i);if(c.tdst<=a*a)return c;var s=Se.quantize.getNearest(l,r,t,n,i);return s.tdsta;)n-=4;if(t>=n)break;var c=r[t>>2];r[t>>2]=r[n>>2],r[n>>2]=c,t+=4,n-=4}for(;o(e,t,i)>a;)t-=4;return t+4};Se.quantize.vecDot=function(e,r,t){return e[r]*t[0]+e[r+1]*t[1]+e[r+2]*t[2]+e[r+3]*t[3]};Se.quantize.stats=function(e,r,t){for(var n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0],a=t-r>>2,o=r;o>>0}};Se.M4={multVec:function(e,r){return[e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3],e[4]*r[0]+e[5]*r[1]+e[6]*r[2]+e[7]*r[3],e[8]*r[0]+e[9]*r[1]+e[10]*r[2]+e[11]*r[3],e[12]*r[0]+e[13]*r[1]+e[14]*r[2]+e[15]*r[3]]},dot:function(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3]},sml:function(e,r){return[e*r[0],e*r[1],e*r[2],e*r[3]]}};Se.encode.concatRGBA=function(e){for(var r=0,t=0;t1)throw new Error("Animated PNGs are not supported");var i=new Uint8Array(n[0]),a=Rg(i),o=a.rgbChannel,l=a.alphaChannel;this.rgbChannel=o;var c=l.some(function(s){return s<255});c&&(this.alphaChannel=l),this.type=Bg(t.ctype),this.width=t.width,this.height=t.height,this.bitsPerComponent=8}return e.load=function(r){return new e(r)},e})(),Ng=(function(){function e(r){this.image=r,this.bitsPerComponent=r.bitsPerComponent,this.width=r.width,this.height=r.height,this.colorSpace="DeviceRGB"}return e.for=function(r){return it(this,void 0,void 0,function(){var t;return at(this,function(n){return t=Lg.load(r),[2,new e(t)]})})},e.prototype.embedIntoContext=function(r,t){return it(this,void 0,void 0,function(){var n,i;return at(this,function(a){return n=this.embedAlphaChannel(r),i=r.flateStream(this.image.rgbChannel,{Type:"XObject",Subtype:"Image",BitsPerComponent:this.image.bitsPerComponent,Width:this.image.width,Height:this.image.height,ColorSpace:this.colorSpace,SMask:n}),t?(r.assign(t,i),[2,t]):[2,r.register(i)]})})},e.prototype.embedAlphaChannel=function(r){if(this.image.alphaChannel){var t=r.flateStream(this.image.alphaChannel,{Type:"XObject",Subtype:"Image",Height:this.image.height,Width:this.image.width,BitsPerComponent:this.image.bitsPerComponent,ColorSpace:"DeviceGray",Decode:[0,1]});return r.register(t)}},e})(),od=Ng,Ig=(function(){function e(r,t,n){this.bytes=r,this.start=t||0,this.pos=this.start,this.end=t&&n?t+n:this.bytes.length}return Object.defineProperty(e.prototype,"length",{get:function(){return this.end-this.start},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.length===0},enumerable:!1,configurable:!0}),e.prototype.getByte=function(){return this.pos>=this.end?-1:this.bytes[this.pos++]},e.prototype.getUint16=function(){var r=this.getByte(),t=this.getByte();return r===-1||t===-1?-1:(r<<8)+t},e.prototype.getInt32=function(){var r=this.getByte(),t=this.getByte(),n=this.getByte(),i=this.getByte();return(r<<24)+(t<<16)+(n<<8)+i},e.prototype.getBytes=function(r,t){t===void 0&&(t=!1);var n=this.bytes,i=this.pos,a=this.end;if(r){var l=i+r;l>a&&(l=a),this.pos=l;var o=n.subarray(i,l);return t?new Uint8ClampedArray(o):o}else{var o=n.subarray(i,a);return t?new Uint8ClampedArray(o):o}},e.prototype.peekByte=function(){var r=this.getByte();return this.pos--,r},e.prototype.peekBytes=function(r,t){t===void 0&&(t=!1);var n=this.getBytes(r,t);return this.pos-=n.length,n},e.prototype.skip=function(r){r||(r=1),this.pos+=r},e.prototype.reset=function(){this.pos=this.start},e.prototype.moveStart=function(){this.start=this.pos},e.prototype.makeSubStream=function(r,t){return new e(this.bytes,r,t)},e.prototype.decode=function(){return this.bytes},e})(),sd=Ig,zg=new Uint8Array(0),Mg=(function(){function e(r){if(this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=zg,this.minBufferLength=512,r)for(;this.minBufferLengtha&&(n=a)}else{for(;!this.eof;)this.readBlock();n=this.bufferLength}this.pos=n;var o=this.buffer.subarray(i,n);return t&&!(o instanceof Uint8ClampedArray)?new Uint8ClampedArray(o):o},e.prototype.peekByte=function(){var r=this.getByte();return this.pos--,r},e.prototype.peekBytes=function(r,t){t===void 0&&(t=!1);var n=this.getBytes(r,t);return this.pos-=n.length,n},e.prototype.skip=function(r){r||(r=1),this.pos+=r},e.prototype.reset=function(){this.pos=0},e.prototype.makeSubStream=function(r,t){for(var n=r+t;this.bufferLength<=n&&!this.eof;)this.readBlock();return new sd(this.buffer,r,t)},e.prototype.decode=function(){for(;!this.eof;)this.readBlock();return this.buffer.subarray(0,this.bufferLength)},e.prototype.readBlock=function(){throw new br(this.constructor.name,"readBlock")},e.prototype.ensureBuffer=function(r){var t=this.buffer;if(r<=t.byteLength)return t;for(var n=this.minBufferLength;n=0;--s)c[l+s]=d&255,d>>=8}},r})(sa),_g=Og,Ug=(function(e){Te(r,e);function r(t,n){var i=e.call(this,n)||this;return i.stream=t,i.firstDigit=-1,n&&(n=.5*n),i}return r.prototype.readBlock=function(){var t=8e3,n=this.stream.getBytes(t);if(!n.length){this.eof=!0;return}for(var i=n.length+1>>1,a=this.ensureBuffer(this.bufferLength+i),o=this.bufferLength,l=this.firstDigit,c=0,s=n.length;c=48&&u<=57)d=u&15;else if(u>=65&&u<=70||u>=97&&u<=102)d=(u&15)+9;else if(u===62){this.eof=!0;break}else continue;l<0?l=d:(a[o++]=l<<4|d,l=-1)}l>=0&&this.eof&&(a[o++]=l<<4,l=-1),this.firstDigit=l,this.bufferLength=o},r})(sa),Wg=Ug,cu=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Gg=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),jg=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),qg=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],Vg=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5],Xg=(function(e){Te(r,e);function r(t,n){var i=e.call(this,n)||this;i.stream=t;var a=t.getByte(),o=t.getByte();if(a===-1||o===-1)throw new Error("Invalid header in flate stream: "+a+", "+o);if((a&15)!==8)throw new Error("Unknown compression method in flate stream: "+a+", "+o);if(((a<<8)+o)%31!==0)throw new Error("Bad FCHECK in flate stream: "+a+", "+o);if(o&32)throw new Error("FDICT bit set in flate stream: "+a+", "+o);return i.codeSize=0,i.codeBuf=0,i}return r.prototype.readBlock=function(){var t,n,i=this.stream,a=this.getBits(3);if(a&1&&(this.eof=!0),a>>=1,a===0){var o=void 0;if((o=i.getByte())===-1)throw new Error("Bad block header in flate stream");var l=o;if((o=i.getByte())===-1)throw new Error("Bad block header in flate stream");if(l|=o<<8,(o=i.getByte())===-1)throw new Error("Bad block header in flate stream");var c=o;if((o=i.getByte())===-1)throw new Error("Bad block header in flate stream");if(c|=o<<8,c!==(~l&65535)&&(l!==0||c!==0))throw new Error("Bad uncompressed block length in flate stream");this.codeBuf=0,this.codeSize=0;var s=this.bufferLength;t=this.ensureBuffer(s+l);var u=s+l;if(this.bufferLength=u,l===0)i.peekByte()===-1&&(this.eof=!0);else for(var d=s;d0;)F[b++]=B}A=this.generateHuffmanTable(F.subarray(0,p)),f=this.generateHuffmanTable(F.subarray(p,P))}else throw new Error("Unknown block type in flate stream");t=this.buffer;for(var H=t?t.length:0,C=this.bufferLength;;){var I=this.getCode(A);if(I<256){C+1>=H&&(t=this.ensureBuffer(C+1),H=t.length),t[C++]=I;continue}if(I===256){this.bufferLength=C;return}I-=257,I=Gg[I];var m=I>>16;m>0&&(m=this.getBits(m)),n=(I&65535)+m,I=this.getCode(f),I=jg[I],m=I>>16,m>0&&(m=this.getBits(m));var N=(I&65535)+m;C+n>=H&&(t=this.ensureBuffer(C+n),H=t.length);for(var ne=0;ne>t,this.codeSize=i-=t,o},r.prototype.getCode=function(t){for(var n=this.stream,i=t[0],a=t[1],o=this.codeSize,l=this.codeBuf,c;o>16,d=s&65535;if(u<1||o>u,this.codeSize=o-u,d},r.prototype.generateHuffmanTable=function(t){var n=t.length,i=0,a;for(a=0;ai&&(i=t[a]);for(var o=1<>=1;for(a=A;a0;if(!F||F<256)y[0]=F,v=1;else if(F>=258)if(F=0;o--)y[o]=d[l],l=f[l];else y[v++]=y[0];else if(F===256){p=9,u=258,v=0;continue}else{this.eof=!0,delete this.lzwState;break}if(R&&(f[u]=g,A[u]=A[g]+1,d[u]=y[0],u++,p=u+s&u+s-1?p:Math.min(Math.log(u+s)/.6931471805599453+1,12)|0),g=F,b+=v,n>>n&(1<0){var o=this.stream.getBytes(a);n.set(o,i),i+=a}}else{a=257-a;var l=t[1];n=this.ensureBuffer(i+a+1);for(var c=0;cn.size())throw new so(t,0,n.size());n.remove(t)}else{if(t!==0)throw new so(t,0,0);this.setKids([])}},r.prototype.normalizedEntries=function(){var t=this.Kids();return t||(t=this.dict.context.obj([this.ref]),this.dict.set(V.of("Kids"),t)),{Kids:t}},r.fromDict=function(t,n){return new r(t,n)},r})(ud),pi=cm,um=(function(e){Te(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.prototype.Opt=function(){return this.dict.lookupMaybe(V.of("Opt"),wt,qe,vt)},r.prototype.setOpt=function(t){this.dict.set(V.of("Opt"),this.dict.context.obj(t))},r.prototype.getExportValues=function(){var t=this.Opt();if(t){if(t instanceof wt||t instanceof qe)return[t];for(var n=[],i=0,a=t.size();in.size())throw new so(t,0,n.size());n.remove(t)}},r.prototype.normalizeExportValues=function(){for(var t,n,i,a,o=(t=this.getExportValues())!==null&&t!==void 0?t:[],l=[],c=this.getWidgets(),s=0,u=c.length;s1){if(!this.hasFlag(bt.MultiSelect))throw new kA;this.dict.set(V.of("V"),this.dict.context.obj(t))}this.updateSelectedIndices(t)},r.prototype.valuesAreValid=function(t){for(var n=this.getOptions(),i=function(c,s){var u=t[c].decodeText();if(!n.find(function(d){return u===(d.display||d.value).decodeText()}))return{value:!1}},a=0,o=t.length;a1){for(var n=new Array(t.length),i=this.getOptions(),a=function(c,s){var u=t[c].decodeText();n[c]=i.findIndex(function(d){return u===(d.display||d.value).decodeText()})},o=0,l=t.length;o0){var l=o.lookup(0,wt,qe),c=o.lookupMaybe(1,wt,qe);n.push({value:l,display:c||l})}}return n}return[]},r})(pi),dd=fm,hm=(function(e){Te(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.fromDict=function(t,n){return new r(t,n)},r.create=function(t){var n=t.obj({FT:"Ch",Ff:bt.Combo,Kids:[]}),i=t.register(n);return new r(n,i)},r})(dd),To=hm,pm=(function(e){Te(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.prototype.addField=function(t){var n=this.normalizedEntries().Kids;n?.push(t)},r.prototype.normalizedEntries=function(){var t=this.Kids();return t||(t=this.dict.context.obj([]),this.dict.set(V.of("Kids"),t)),{Kids:t}},r.fromDict=function(t,n){return new r(t,n)},r.create=function(t){var n=t.obj({}),i=t.register(n);return new r(n,i)},r})(ud),uo=pm,Am=(function(e){Te(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.fromDict=function(t,n){return new r(t,n)},r})(pi),fl=Am,gm=(function(e){Te(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.prototype.MaxLen=function(){var t=this.dict.lookup(V.of("MaxLen"));if(t instanceof Qe)return t},r.prototype.Q=function(){var t=this.dict.lookup(V.of("Q"));if(t instanceof Qe)return t},r.prototype.setMaxLength=function(t){this.dict.set(V.of("MaxLen"),Qe.of(t))},r.prototype.removeMaxLength=function(){this.dict.delete(V.of("MaxLen"))},r.prototype.getMaxLength=function(){var t;return(t=this.MaxLen())===null||t===void 0?void 0:t.asNumber()},r.prototype.setQuadding=function(t){this.dict.set(V.of("Q"),Qe.of(t))},r.prototype.getQuadding=function(){var t;return(t=this.Q())===null||t===void 0?void 0:t.asNumber()},r.prototype.setValue=function(t){this.dict.set(V.of("V"),t)},r.prototype.removeValue=function(){this.dict.delete(V.of("V"))},r.prototype.getValue=function(){var t=this.V();if(t instanceof wt||t instanceof qe)return t},r.fromDict=function(t,n){return new r(t,n)},r.create=function(t){var n=t.obj({FT:"Tx",Kids:[]}),i=t.register(n);return new r(n,i)},r})(pi),Do=gm,mm=(function(e){Te(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.fromDict=function(t,n){return new r(t,n)},r.create=function(t){var n=t.obj({FT:"Btn",Ff:mr.PushButton,Kids:[]}),i=t.register(n);return new r(n,i)},r})(dl),Eo=mm,vm=(function(e){Te(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.prototype.setValue=function(t){var n=this.getOnValues();if(!n.includes(t)&&t!==V.of("Off"))throw new ol;this.dict.set(V.of("V"),t);for(var i=this.getWidgets(),a=0,o=i.length;aa)throw new Yc(n,a);for(var o=n,l=0,c=i.size();lo)return u.insertLeafNode(t,o)||s;o-=u.Count().asNumber()}u instanceof Kr&&(o-=1)}if(o===0){this.insertLeafKid(i.size(),t);return}throw new Jc(n,"insertLeafNode")},r.prototype.removeLeafNode=function(t,n){n===void 0&&(n=!0);var i=this.Kids(),a=this.Count().asNumber();if(t>=a)throw new Yc(t,a);for(var o=t,l=0,c=i.size();lo){u.removeLeafNode(o,n),n&&u.Kids().size()===0&&i.remove(l);return}else o-=u.Count().asNumber();if(u instanceof Kr)if(o===0){this.removeKid(l);return}else o-=1}throw new Jc(t,"removeLeafNode")},r.prototype.ascend=function(t){t(this);var n=this.Parent();n&&n.ascend(t)},r.prototype.traverse=function(t){for(var n=this.Kids(),i=0,a=n.size();iNumber.MAX_SAFE_INTEGER)if(this.capNumbers){var i="Parsed number that is too large for some PDF readers: "+r+", using Number.MAX_SAFE_INTEGER instead.";return console.warn(i),Number.MAX_SAFE_INTEGER}else{var i="Parsed number that is too large for some PDF readers: "+r+", not capping.";console.warn(i)}return n},e.prototype.skipWhitespace=function(){for(;!this.bytes.done()&&Yr[this.bytes.peek()];)this.bytes.next()},e.prototype.skipLine=function(){for(;!this.bytes.done();){var r=this.bytes.peek();if(r===fu||r===hu)return;this.bytes.next()}},e.prototype.skipComment=function(){if(this.bytes.peek()!==Q.Percent)return!1;for(;!this.bytes.done();){var r=this.bytes.peek();if(r===fu||r===hu)return!0;this.bytes.next()}return!0},e.prototype.skipWhitespaceAndComments=function(){for(this.skipWhitespace();this.skipComment();)this.skipWhitespace()},e.prototype.matchKeyword=function(r){for(var t=this.bytes.offset(),n=0,i=r.length;n=this.length},e.prototype.offset=function(){return this.idx},e.prototype.slice=function(r,t){return this.bytes.slice(r,t)},e.prototype.position=function(){return{line:this.line,column:this.column,offset:this.idx}},e.of=function(r){return new e(r)},e.fromPDFRawStream=function(r){return e.of(ld(r).decode())},e})(),No=Dm,Em=Q.Space,Li=Q.CarriageReturn,Ni=Q.Newline,Ii=[Q.s,Q.t,Q.r,Q.e,Q.a,Q.m],ja=[Q.e,Q.n,Q.d,Q.s,Q.t,Q.r,Q.e,Q.a,Q.m],Ct={header:[Q.Percent,Q.P,Q.D,Q.F,Q.Dash],eof:[Q.Percent,Q.Percent,Q.E,Q.O,Q.F],obj:[Q.o,Q.b,Q.j],endobj:[Q.e,Q.n,Q.d,Q.o,Q.b,Q.j],xref:[Q.x,Q.r,Q.e,Q.f],trailer:[Q.t,Q.r,Q.a,Q.i,Q.l,Q.e,Q.r],startxref:[Q.s,Q.t,Q.a,Q.r,Q.t,Q.x,Q.r,Q.e,Q.f],true:[Q.t,Q.r,Q.u,Q.e],false:[Q.f,Q.a,Q.l,Q.s,Q.e],null:[Q.n,Q.u,Q.l,Q.l],stream:Ii,streamEOF1:ht(Ii,[Em,Li,Ni]),streamEOF2:ht(Ii,[Li,Ni]),streamEOF3:ht(Ii,[Li]),streamEOF4:ht(Ii,[Ni]),endstream:ja,EOF1endstream:ht([Li,Ni],ja),EOF2endstream:ht([Li],ja),EOF3endstream:ht([Ni],ja)},Bm=(function(e){Te(r,e);function r(t,n,i){i===void 0&&(i=!1);var a=e.call(this,t,i)||this;return a.context=n,a}return r.prototype.parseObject=function(){if(this.skipWhitespaceAndComments(),this.matchKeyword(Ct.true))return Ji.True;if(this.matchKeyword(Ct.false))return Ji.False;if(this.matchKeyword(Ct.null))return rr;var t=this.bytes.peek();if(t===Q.LessThan&&this.bytes.peekAhead(1)===Q.LessThan)return this.parseDictOrStream();if(t===Q.LessThan)return this.parseHexString();if(t===Q.LeftParen)return this.parseString();if(t===Q.ForwardSlash)return this.parseName();if(t===Q.LeftSquareBracket)return this.parseArray();if(Al[t])return this.parseNumberOrRef();throw new TA(this.bytes.position(),t)},r.prototype.parseNumberOrRef=function(){var t=this.parseRawNumber();this.skipWhitespaceAndComments();var n=this.bytes.offset();if(Kt[this.bytes.peek()]){var i=this.parseRawNumber();if(this.skipWhitespaceAndComments(),this.bytes.peek()===Q.R)return this.bytes.assertNext(Q.R),xt.of(t,i)}return this.bytes.moveTo(n),Qe.of(t)},r.prototype.parseHexString=function(){var t="";for(this.bytes.assertNext(Q.LessThan);!this.bytes.done()&&this.bytes.peek()!==Q.GreaterThan;)t+=Xr(this.bytes.next());return this.bytes.assertNext(Q.GreaterThan),qe.of(t)},r.prototype.parseString=function(){for(var t=0,n=!1,i="";!this.bytes.done();){var a=this.bytes.next();if(i+=Xr(a),n||(a===Q.LeftParen&&(t+=1),a===Q.RightParen&&(t-=1)),a===Q.BackSlash?n=!n:n&&(n=!1),t===0)return wt.of(i.substring(1,i.length-1))}throw new BA(this.bytes.position())},r.prototype.parseName=function(){this.bytes.assertNext(Q.ForwardSlash);for(var t="";!this.bytes.done();){var n=this.bytes.peek();if(Yr[n]||kr[n])break;t+=Xr(n),this.bytes.next()}return V.of(t)},r.prototype.parseArray=function(){this.bytes.assertNext(Q.LeftSquareBracket),this.skipWhitespaceAndComments();for(var t=vt.withContext(this.context);this.bytes.peek()!==Q.RightSquareBracket;){var n=this.parseObject();t.push(n),this.skipWhitespaceAndComments()}return this.bytes.assertNext(Q.RightSquareBracket),t},r.prototype.parseDict=function(){this.bytes.assertNext(Q.LessThan),this.bytes.assertNext(Q.LessThan),this.skipWhitespaceAndComments();for(var t=new Map;!this.bytes.done()&&this.bytes.peek()!==Q.GreaterThan&&this.bytes.peekAhead(1)!==Q.GreaterThan;){var n=this.parseName(),i=this.parseObject();t.set(n,i),this.skipWhitespaceAndComments()}this.skipWhitespaceAndComments(),this.bytes.assertNext(Q.GreaterThan),this.bytes.assertNext(Q.GreaterThan);var a=t.get(V.of("Type"));return a===V.of("Catalog")?pd.fromMapWithContext(t,this.context):a===V.of("Pages")?Ad.fromMapWithContext(t,this.context):a===V.of("Page")?Kr.fromMapWithContext(t,this.context):et.fromMapWithContext(t,this.context)},r.prototype.parseDictOrStream=function(){var t=this.bytes.position(),n=this.parseDict();if(this.skipWhitespaceAndComments(),!this.matchKeyword(Ct.streamEOF1)&&!this.matchKeyword(Ct.streamEOF2)&&!this.matchKeyword(Ct.streamEOF3)&&!this.matchKeyword(Ct.streamEOF4)&&!this.matchKeyword(Ct.stream))return n;var i=this.bytes.offset(),a,o=n.get(V.of("Length"));o instanceof Qe?(a=i+o.asNumber(),this.bytes.moveTo(a),this.skipWhitespaceAndComments(),this.matchKeyword(Ct.endstream)||(this.bytes.moveTo(i),a=this.findEndOfStreamFallback(t))):a=this.findEndOfStreamFallback(t);var l=this.bytes.slice(i,a);return $i.of(n,l)},r.prototype.findEndOfStreamFallback=function(t){for(var n=1,i=this.bytes.offset();!this.bytes.done()&&(i=this.bytes.offset(),this.matchKeyword(Ct.stream)?n+=1:this.matchKeyword(Ct.EOF1endstream)||this.matchKeyword(Ct.EOF2endstream)||this.matchKeyword(Ct.EOF3endstream)||this.matchKeyword(Ct.endstream)?n-=1:this.bytes.next(),n!==0););if(n!==0)throw new EA(t);return i},r.forBytes=function(t,n,i){return new r(No.of(t),n,i)},r.forByteStream=function(t,n,i){return i===void 0&&(i=!1),new r(t,n,i)},r})(Tm),gd=Bm,Rm=(function(e){Te(r,e);function r(t,n){var i=e.call(this,No.fromPDFRawStream(t),t.dict.context)||this,a=t.dict;return i.alreadyParsed=!1,i.shouldWaitForTick=n||(function(){return!1}),i.firstOffset=a.lookup(V.of("First"),Qe).asNumber(),i.objectCount=a.lookup(V.of("N"),Qe).asNumber(),i}return r.prototype.parseIntoContext=function(){return it(this,void 0,void 0,function(){var t,n,i,a,o,l,c,s;return at(this,function(u){switch(u.label){case 0:if(this.alreadyParsed)throw new al("PDFObjectStreamParser","parseIntoContext");this.alreadyParsed=!0,t=this.parseOffsetsAndObjectNumbers(),n=0,i=t.length,u.label=1;case 1:return n=Q.Space&&n<=Q.Tilde;if(i&&(this.matchKeyword(Ct.xref)||this.matchKeyword(Ct.trailer)||this.matchKeyword(Ct.startxref)||this.matchIndirectObjectHeader())){this.bytes.moveTo(t);break}this.bytes.next()}},r.prototype.skipBinaryHeaderComment=function(){this.skipWhitespaceAndComments();try{var t=this.bytes.offset();this.parseIndirectObjectHeader(),this.bytes.moveTo(t)}catch{this.bytes.next(),this.skipWhitespaceAndComments()}},r.forBytesWithOptions=function(t,n,i,a){return new r(t,n,i,a)},r})(gd),Mm=zm,Ir=function(e){return 1<0&&(n[n.length]=+i),t[t.length]={cmd:r,args:n},n=[],i="",a=!1),r=s;else if([" ",","].includes(s)||s==="-"&&i.length>0&&i[i.length-1]!=="e"||s==="."&&a){if(i.length===0)continue;n.length===o?(t[t.length]={cmd:r,args:n},n=[+i],r==="M"&&(r="L"),r==="m"&&(r="l")):n[n.length]=+i,a=s===".",i=["-","."].includes(s)?s:""}else i+=s,s==="."&&(a=!0)}return i.length>0&&(n.length===o?(t[t.length]={cmd:r,args:n},n=[+i],r==="M"&&(r="L"),r==="m"&&(r="l")):n[n.length]=+i),t[t.length]={cmd:r,args:n},t},Zm=function(e){Ue=We=ct=ut=_i=Ui=0;for(var r=[],t=0;t1&&(A=Math.sqrt(A),t*=A,n*=A);var f=d/t,p=u/t,g=-u/n,y=d/n,v=f*l+p*c,b=g*l+y*c,x=f*e+p*r,P=g*e+y*r,F=(x-v)*(x-v)+(P-b)*(P-b),R=1/F-.25;R<0&&(R=0);var E=Math.sqrt(R);a===i&&(E=-E);var B=.5*(v+x)-E*(P-b),T=.5*(b+P)+E*(x-v),W=Math.atan2(b-T,v-B),H=Math.atan2(P-T,x-B),C=H-W;C<0&&a===1?C+=2*Math.PI:C>0&&a===0&&(C-=2*Math.PI);for(var I=Math.ceil(Math.abs(C/(Math.PI*.5+.001))),m=[],N=0;Ne.length)return i-1;var y=r.heightAtSize(i),v=y+y*.2,b=v*a;if(b>Math.abs(t.height))return i-1;i+=1}return i},vv=function(e,r,t,n){for(var i=t.width/n,a=t.height,o=Nd,l=kp(e);oi*.75;if(d)return o-1}var A=r.heightAtSize(o,{descender:!1});if(A>a)return o-1;o+=1}return o},yv=function(e){for(var r=e.length;r>0;r--)if(/\s/.test(e[r]))return r},bv=function(e,r,t,n){for(var i,a=e.length;a>0;){var o=e.substring(0,a),l=t.encodeText(o),c=t.widthOfTextAtSize(o,n);if(cA&&(A=E+F),p+l>f&&(f=p+l),s.push({text:x,encoded:P,width:F,height:l,x:E,y:p}),v=R?.trim()}return{fontSize:n,lineHeight:c,lines:s,bounds:{x:u,y:d,width:A-u,height:f-d}}},wv=function(e,r){var t=r.fontSize,n=r.font,i=r.bounds,a=r.cellCount,o=Uu(aa(e));if(o.length>a)throw new Av(o.length,a);(t===void 0||t===0)&&(t=vv(o,n,i,a));for(var l=i.width/a,c=n.heightAtSize(t,{descender:!1}),s=i.y+(i.height/2-c/2),u=[],d=i.x,A=i.y,f=i.x+i.width,p=i.y+i.height,g=0,y=0;gf&&(f=E+F),s+c>p&&(p=s+c),u.push({text:o,encoded:P,width:F,height:c,x:E,y:s}),g+=1,y+=x}return{fontSize:t,cells:u,bounds:{x:d,y:A,width:f-d,height:p-A}}},mo=function(e,r){var t=r.alignment,n=r.fontSize,i=r.font,a=r.bounds,o=Uu(aa(e));(n===void 0||n===0)&&(n=zd([o],i,a));var l=i.encodeText(o),c=i.widthOfTextAtSize(o,n),s=i.heightAtSize(n,{descender:!1}),u=t===zt.Left?a.x:t===zt.Center?a.x+a.width/2-c/2:t===zt.Right?a.x+a.width-c:a.x,d=a.y+(a.height/2-s/2);return{fontSize:n,line:{text:o,encoded:l,width:c,height:s,x:u,y:d},bounds:{x:u,y:d,width:c,height:s}}},gi=function(e){return"normal"in e?e:{normal:e}},xv=/\/([^\0\t\n\f\r\ ]+)[\0\t\n\f\r\ ]+(\d*\.\d+|\d+)[\0\t\n\f\r\ ]+Tf/,wn=function(e){var r,t,n=(r=e.getDefaultAppearance())!==null&&r!==void 0?r:"",i=(t=nl(n,xv).match)!==null&&t!==void 0?t:[],a=Number(i[2]);return isFinite(a)?a:void 0},Sv=/(\d*\.\d+|\d+)[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]+(g|rg|k)/,xr=function(e){var r,t=(r=e.getDefaultAppearance())!==null&&r!==void 0?r:"",n=nl(t,Sv).match,i=n??[],a=i[1],o=i[2],l=i[3],c=i[4],s=i[5];if(s==="g"&&a)return Dd(Number(a));if(s==="rg"&&a&&o&&l)return St(Number(a),Number(o),Number(l));if(s==="k"&&a&&o&&l&&c)return Ed(Number(a),Number(o),Number(l),Number(c))},Sr=function(e,r,t,n){var i;n===void 0&&(n=0);var a=[jn(r).toString(),yl((i=t?.name)!==null&&i!==void 0?i:"dummy__noop",n).toString()].join(` +`);e.setDefaultAppearance(a)},kv=function(e,r){var t,n,i,a=xr(r),o=xr(e.acroField),l=r.getRectangle(),c=r.getAppearanceCharacteristics(),s=r.getBorderStyle(),u=(t=s?.getWidth())!==null&&t!==void 0?t:0,d=Jr(c?.getRotation()),A=Wn(l,d),f=A.width,p=A.height,g=Cn(Je(Je({},l),{rotation:d})),y=St(0,0,0),v=(n=er(c?.getBorderColor()))!==null&&n!==void 0?n:y,b=er(c?.getBackgroundColor()),x=er(c?.getBackgroundColor(),.8),P=(i=a??o)!==null&&i!==void 0?i:y;Sr(a?r:e.acroField,P);var F={x:0+u/2,y:0+u/2,width:f-u,height:p-u,thickness:1.5,borderWidth:u,borderColor:v,markColor:P};return{normal:{on:ht(g,Xa(Je(Je({},F),{color:b,filled:!0}))),off:ht(g,Xa(Je(Je({},F),{color:b,filled:!1})))},down:{on:ht(g,Xa(Je(Je({},F),{color:x,filled:!0}))),off:ht(g,Xa(Je(Je({},F),{color:x,filled:!1})))}}},Cv=function(e,r){var t,n,i,a=xr(r),o=xr(e.acroField),l=r.getRectangle(),c=r.getAppearanceCharacteristics(),s=r.getBorderStyle(),u=(t=s?.getWidth())!==null&&t!==void 0?t:0,d=Jr(c?.getRotation()),A=Wn(l,d),f=A.width,p=A.height,g=Cn(Je(Je({},l),{rotation:d})),y=St(0,0,0),v=(n=er(c?.getBorderColor()))!==null&&n!==void 0?n:y,b=er(c?.getBackgroundColor()),x=er(c?.getBackgroundColor(),.8),P=(i=a??o)!==null&&i!==void 0?i:y;Sr(a?r:e.acroField,P);var F={x:f/2,y:p/2,width:f-u,height:p-u,borderWidth:u,borderColor:v,dotColor:P};return{normal:{on:ht(g,Ha(Je(Je({},F),{color:b,filled:!0}))),off:ht(g,Ha(Je(Je({},F),{color:b,filled:!1})))},down:{on:ht(g,Ha(Je(Je({},F),{color:x,filled:!0}))),off:ht(g,Ha(Je(Je({},F),{color:x,filled:!1})))}}},Pv=function(e,r,t){var n,i,a,o,l,c=xr(r),s=xr(e.acroField),u=wn(r),d=wn(e.acroField),A=r.getRectangle(),f=r.getAppearanceCharacteristics(),p=r.getBorderStyle(),g=f?.getCaptions(),y=(n=g?.normal)!==null&&n!==void 0?n:"",v=(a=(i=g?.down)!==null&&i!==void 0?i:y)!==null&&a!==void 0?a:"",b=(o=p?.getWidth())!==null&&o!==void 0?o:0,x=Jr(f?.getRotation()),P=Wn(A,x),F=P.width,R=P.height,E=Cn(Je(Je({},A),{rotation:x})),B=St(0,0,0),T=er(f?.getBorderColor()),W=er(f?.getBackgroundColor()),H=er(f?.getBackgroundColor(),.8),C={x:b,y:b,width:F-b*2,height:R-b*2},I=mo(y,{alignment:zt.Center,fontSize:u??d,font:t,bounds:C}),m=mo(v,{alignment:zt.Center,fontSize:u??d,font:t,bounds:C}),N=Math.min(I.fontSize,m.fontSize),ne=(l=c??s)!==null&&l!==void 0?l:B;Sr(c||u!==void 0?r:e.acroField,ne,t,N);var q={x:0+b/2,y:0+b/2,width:F-b,height:R-b,borderWidth:b,borderColor:T,textColor:ne,font:t.name,fontSize:N};return{normal:ht(E,bu(Je(Je({},q),{color:W,textLines:[I.line]}))),down:ht(E,bu(Je(Je({},q),{color:H,textLines:[m.line]})))}},Fv=function(e,r,t){var n,i,a,o,l=xr(r),c=xr(e.acroField),s=wn(r),u=wn(e.acroField),d=r.getRectangle(),A=r.getAppearanceCharacteristics(),f=r.getBorderStyle(),p=(n=e.getText())!==null&&n!==void 0?n:"",g=(i=f?.getWidth())!==null&&i!==void 0?i:0,y=Jr(A?.getRotation()),v=Wn(d,y),b=v.width,x=v.height,P=Cn(Je(Je({},d),{rotation:y})),F=St(0,0,0),R=er(A?.getBorderColor()),E=er(A?.getBackgroundColor()),B,T,W=e.isCombed()?0:1,H={x:g+W,y:g+W,width:b-(g+W)*2,height:x-(g+W)*2};if(e.isMultiline()){var C=Md(p,{alignment:e.getAlignment(),fontSize:s??u,font:t,bounds:H});B=C.lines,T=C.fontSize}else if(e.isCombed()){var C=wv(p,{fontSize:s??u,font:t,bounds:H,cellCount:(a=e.getMaxLength())!==null&&a!==void 0?a:0});B=C.cells,T=C.fontSize}else{var C=mo(p,{alignment:e.getAlignment(),fontSize:s??u,font:t,bounds:H});B=[C.line],T=C.fontSize}var I=(o=l??c)!==null&&o!==void 0?o:F;Sr(l||s!==void 0?r:e.acroField,I,t,T);var m={x:0+g/2,y:0+g/2,width:b-g,height:x-g,borderWidth:g??0,borderColor:R,textColor:I,font:t.name,fontSize:T,color:E,textLines:B,padding:W};return ht(P,Rd(m))},Tv=function(e,r,t){var n,i,a,o=xr(r),l=xr(e.acroField),c=wn(r),s=wn(e.acroField),u=r.getRectangle(),d=r.getAppearanceCharacteristics(),A=r.getBorderStyle(),f=(n=e.getSelected()[0])!==null&&n!==void 0?n:"",p=(i=A?.getWidth())!==null&&i!==void 0?i:0,g=Jr(d?.getRotation()),y=Wn(u,g),v=y.width,b=y.height,x=Cn(Je(Je({},u),{rotation:g})),P=St(0,0,0),F=er(d?.getBorderColor()),R=er(d?.getBackgroundColor()),E=1,B={x:p+E,y:p+E,width:v-(p+E)*2,height:b-(p+E)*2},T=mo(f,{alignment:zt.Left,fontSize:c??s,font:t,bounds:B}),W=T.line,H=T.fontSize,C=(a=o??l)!==null&&a!==void 0?a:P;Sr(o||c!==void 0?r:e.acroField,C,t,H);var I={x:0+p/2,y:0+p/2,width:v-p,height:b-p,borderWidth:p??0,borderColor:F,textColor:C,font:t.name,fontSize:H,color:R,textLines:[W],padding:E};return ht(x,Rd(I))},Dv=function(e,r,t){var n,i,a=xr(r),o=xr(e.acroField),l=wn(r),c=wn(e.acroField),s=r.getRectangle(),u=r.getAppearanceCharacteristics(),d=r.getBorderStyle(),A=(n=d?.getWidth())!==null&&n!==void 0?n:0,f=Jr(u?.getRotation()),p=Wn(s,f),g=p.width,y=p.height,v=Cn(Je(Je({},s),{rotation:f})),b=St(0,0,0),x=er(u?.getBorderColor()),P=er(u?.getBackgroundColor()),F=e.getOptions(),R=e.getSelected();e.isSorted()&&F.sort();for(var E="",B=0,T=F.length;B1||i.length===1&&n)&&this.enableMultiselect();for(var l=new Array(i.length),c=0,s=i.length;c1||i.length===1&&n)&&this.enableMultiselect();for(var o=new Array(i.length),l=0,c=i.length;ln)throw new gv(t.length,n,this.getName());this.markAsDirty(),this.disableRichFormatting(),t?this.acroField.setValue(qe.fromText(t)):this.acroField.removeValue()},r.prototype.getAlignment=function(){var t=this.acroField.getQuadding();return t===0?zt.Left:t===1?zt.Center:t===2?zt.Right:zt.Left},r.prototype.setAlignment=function(t){gn(t,"alignment",zt),this.markAsDirty(),this.acroField.setQuadding(t)},r.prototype.getMaxLength=function(){return this.acroField.getMaxLength()},r.prototype.setMaxLength=function(t){if(Tr(t,"maxLength",0,Number.MAX_SAFE_INTEGER),this.markAsDirty(),t===void 0)this.acroField.removeMaxLength();else{var n=this.getText();if(n&&n.length>t)throw new mv(n.length,t,this.getName());this.acroField.setMaxLength(t)}},r.prototype.removeMaxLength=function(){this.markAsDirty(),this.acroField.removeMaxLength()},r.prototype.setImage=function(t){for(var n=this.getAlignment(),i=n===zt.Center?vn.Center:n===zt.Right?vn.Right:vn.Left,a=this.acroField.getWidgets(),o=0,l=a.length;o=100?e:typeof e=="string"&&e.includes("%")?Math.round(r&&r==="X"?parseFloat(e)/100*t.width:r&&r==="Y"?parseFloat(e)/100*t.height:parseFloat(e)/100*t.width):0}function no(e){return e.replace(/[xy]/g,function(r){let t=Math.random()*16|0;return(r==="x"?t:t&3|8).toString(16)})}function Ve(e){return typeof e>"u"||e==null?"":e.toString().replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function lt(e){return typeof e=="number"&&e>100?e:(typeof e=="string"&&(e=Number(e.replace(/in*/gi,""))),Math.round(Ke*e))}function je(e){let r=Number(e)||0;return isNaN(r)?0:Math.round(r*da)}function Un(e){return e=e||0,Math.round((e>360?e-360:e)*6e4)}function Ts(e){let r=e.toString(16);return r.length===1?"0"+r:r}function Ds(e,r,t){return(Ts(e)+Ts(r)+Ts(t)).toUpperCase()}function ft(e,r){let t=(e||"").replace("#","");!Fs.test(t)&&t!==or.background1&&t!==or.background2&&t!==or.text1&&t!==or.text2&&t!==or.accent1&&t!==or.accent2&&t!==or.accent3&&t!==or.accent4&&t!==or.accent5&&t!==or.accent6&&(console.warn(`"${t}" is not a valid scheme color or hex RGB! "${nr}" used instead. Only provide 6-digit RGB or 'pptx.SchemeColor' values!`),t=nr);let n=Fs.test(t)?"srgbClr":"schemeClr",i='val="'+(Fs.test(t)?t.toUpperCase():t)+'"';return r?`${r}`:``}function s0(e,r){let t="",n=Object.assign(Object.assign({},r),e),i=Math.round(n.size*da),a=n.color,o=Math.round(n.opacity*1e5);return t+=``,t+=ft(a,``),t+="",t}function lr(e){let r="solid",t="",n="",i="";return e&&(typeof e=="string"?t=e:(e.type&&(r=e.type),e.color&&(t=e.color),e.alpha&&(n+=``),e.transparency&&(n+=``)),r==="solid"?i+=`${ft(t,n)}`:i+=""),i}function Vr(e){return e._rels.length+e._relsChart.length+e._relsMedia.length+1}function Cl(e){if(!(!e||typeof e!="object"))return e.type!=="outer"&&e.type!=="inner"&&e.type!=="none"&&(console.warn("Warning: shadow.type options are `outer`, `inner` or `none`."),e.type="outer"),e.angle&&((isNaN(Number(e.angle))||e.angle<0||e.angle>359)&&(console.warn("Warning: shadow.angle can only be 0-359"),e.angle=270),e.angle=Math.round(Number(e.angle))),e.opacity&&((isNaN(Number(e.opacity))||e.opacity<0||e.opacity>1)&&(console.warn("Warning: shadow.opacity can only be 0-1"),e.opacity=.75),e.opacity=Number(e.opacity)),e.color&&e.color.startsWith("#")&&(console.warn('Warning: shadow.color should not include hash (#) character, , e.g. "FF0000"'),e.color=e.color.replace("#","")),e}function l0(e,r,t){var n,i;let a=2.3+(!((n=e.options)===null||n===void 0)&&n.autoPageCharWeight?e.options.autoPageCharWeight:0),o=Math.floor(r/da*Ke)/((!((i=e.options)===null||i===void 0)&&i.fontSize?e.options.fontSize:yr)/a),l=[],c=[],s=[],u=[];e.text&&e.text.toString().trim().length===0?c.push({_type:He.tablecell,text:" "}):typeof e.text=="number"||typeof e.text=="string"?c.push({_type:He.tablecell,text:(e.text||"").toString().trim()}):Array.isArray(e.text)&&(c=e.text);let d=[];return c.forEach(A=>{var f;typeof A.text=="string"&&(A.text.split(` `).length>1?A.text.split(` -`).forEach(p=>{d.push({_type:He.tablecell,text:p,options:Object.assign(Object.assign({},A.options),{breakLine:!0})})}):d.push({_type:He.tablecell,text:A.text.trim(),options:A.options}),!((f=A.options)===null||f===void 0)&&f.breakLine&&(s.push(d),d=[])),d.length>0&&(s.push(d),d=[])}),s.forEach(A=>{A.forEach(f=>{let p=[],y=String(f.text).split(" ");y.forEach((v,b)=>{let x=Object.assign({},f.options);x?.breakLine&&(x.breakLine=b+1===y.length),p.push({_type:He.tablecell,text:v+(b+1{let f=[],p="";A.forEach(g=>{p.length+g.text.length>o&&(l.push(f),f=[],p=""),f.push(g),p+=g.text.toString()}),f.length>0&&l.push(f)}),l}function qd(e=[],r={},t,n){let i=ra,a=Ke*1,o=Ke*1,l=0,c=0,s=[],u=nt(r.x,"X",t),d=nt(r.y,"Y",t),A=nt(r.w,"X",t),f=nt(r.h,"Y",t),p=A;function g(){let v=0;s.length===0&&(v=d||lt(i[0])),s.length>0&&(v=lt(r.autoPageSlideStartY||r.newSlideStartY||i[0])),o=(f||t.height)-v-lt(i[2]),s.length>1&&(typeof r.autoPageSlideStartY=="number"?o=(f||t.height)-lt(r.autoPageSlideStartY+i[2]):typeof r.newSlideStartY=="number"?o=(f||t.height)-lt(r.newSlideStartY+i[2]):d&&(o=(f||t.height)-lt((d/Ke{b||(b={_type:He.tablecell});let x=b.options||null;c+=Number(x?.colspan?x.colspan:1)}),r.verbose&&console.log(`| numCols ......................................... = ${c}`),!A&&r.colW&&(p=Array.isArray(r.colW)?r.colW.reduce((v,b)=>v+b)*Ke:r.colW*c||0,r.verbose&&console.log(`| tableCalcW ...................................... = ${p/Ke}`)),a=p||lt((u?u/Ke:i[1])+i[3]),r.verbose&&console.log(`| emuSlideTabW .................................... = ${(a/Ke).toFixed(1)}`),!r.colW||!Array.isArray(r.colW))if(r.colW&&!isNaN(Number(r.colW))){let v=[];(e[0]||[]).forEach(()=>v.push(r.colW)),r.colW=[],v.forEach(x=>{Array.isArray(r.colW)&&r.colW.push(x)})}else{r.colW=[];for(let v=0;v{let x=[],P=0,F=0,R=[];v.forEach(W=>{var H,C,I,m;R.push({_type:He.tablecell,text:[],options:W.options}),W.options.margin&&W.options.margin[0]>=1?(!((H=W.options)===null||H===void 0)&&H.margin&&W.options.margin[0]&&je(W.options.margin[0])>P?P=je(W.options.margin[0]):r?.margin&&r.margin[0]&&je(r.margin[0])>P&&(P=je(r.margin[0])),!((C=W.options)===null||C===void 0)&&C.margin&&W.options.margin[2]&&je(W.options.margin[2])>F?F=je(W.options.margin[2]):r?.margin&&r.margin[2]&&je(r.margin[2])>F&&(F=je(r.margin[2]))):(!((I=W.options)===null||I===void 0)&&I.margin&&W.options.margin[0]&<(W.options.margin[0])>P?P=lt(W.options.margin[0]):r?.margin&&r.margin[0]&<(r.margin[0])>P&&(P=lt(r.margin[0])),!((m=W.options)===null||m===void 0)&&m.margin&&W.options.margin[2]&<(W.options.margin[2])>F?F=lt(W.options.margin[2]):r?.margin&&r.margin[2]&<(r.margin[2])>F&&(F=lt(r.margin[2])))}),g(),l+=P+F,r.verbose&&b===0&&console.log(`| SLIDE [${s.length}]: emuSlideTabH ...... = ${(o/Ke).toFixed(1)} `),v.forEach((W,H)=>{var C;let I={_type:He.tablecell,_lines:null,_lineHeight:lt((!((C=W.options)===null||C===void 0)&&C.fontSize?W.options.fontSize:r.fontSize?r.fontSize:wr)*(Zv+(r.autoPageLineWeight?r.autoPageLineWeight:0))/100),text:[],options:W.options};I.options.rowspan&&(I._lineHeight=0),I.options.autoPageCharWeight=r.autoPageCharWeight?r.autoPageCharWeight:null;let m=r.colW[H];W.options.colspan&&Array.isArray(r.colW)&&(m=r.colW.filter((N,ne)=>ne>=H&&neN+ne)),I._lines=n0(W,m),x.push(I)}),r.verbose&&console.log(` +`).forEach(p=>{d.push({_type:He.tablecell,text:p,options:Object.assign(Object.assign({},A.options),{breakLine:!0})})}):d.push({_type:He.tablecell,text:A.text.trim(),options:A.options}),!((f=A.options)===null||f===void 0)&&f.breakLine&&(s.push(d),d=[])),d.length>0&&(s.push(d),d=[])}),s.forEach(A=>{A.forEach(f=>{let p=[],y=String(f.text).split(" ");y.forEach((v,b)=>{let x=Object.assign({},f.options);x?.breakLine&&(x.breakLine=b+1===y.length),p.push({_type:He.tablecell,text:v+(b+1{let f=[],p="";A.forEach(g=>{p.length+g.text.length>o&&(l.push(f),f=[],p=""),f.push(g),p+=g.text.toString()}),f.length>0&&l.push(f)}),l}function qd(e=[],r={},t,n){let i=na,a=Ke*1,o=Ke*1,l=0,c=0,s=[],u=nt(r.x,"X",t),d=nt(r.y,"Y",t),A=nt(r.w,"X",t),f=nt(r.h,"Y",t),p=A;function g(){let v=0;s.length===0&&(v=d||lt(i[0])),s.length>0&&(v=lt(r.autoPageSlideStartY||r.newSlideStartY||i[0])),o=(f||t.height)-v-lt(i[2]),s.length>1&&(typeof r.autoPageSlideStartY=="number"?o=(f||t.height)-lt(r.autoPageSlideStartY+i[2]):typeof r.newSlideStartY=="number"?o=(f||t.height)-lt(r.newSlideStartY+i[2]):d&&(o=(f||t.height)-lt((d/Ke{b||(b={_type:He.tablecell});let x=b.options||null;c+=Number(x?.colspan?x.colspan:1)}),r.verbose&&console.log(`| numCols ......................................... = ${c}`),!A&&r.colW&&(p=Array.isArray(r.colW)?r.colW.reduce((v,b)=>v+b)*Ke:r.colW*c||0,r.verbose&&console.log(`| tableCalcW ...................................... = ${p/Ke}`)),a=p||lt((u?u/Ke:i[1])+i[3]),r.verbose&&console.log(`| emuSlideTabW .................................... = ${(a/Ke).toFixed(1)}`),!r.colW||!Array.isArray(r.colW))if(r.colW&&!isNaN(Number(r.colW))){let v=[];(e[0]||[]).forEach(()=>v.push(r.colW)),r.colW=[],v.forEach(x=>{Array.isArray(r.colW)&&r.colW.push(x)})}else{r.colW=[];for(let v=0;v{let x=[],P=0,F=0,R=[];v.forEach(W=>{var H,C,I,m;R.push({_type:He.tablecell,text:[],options:W.options}),W.options.margin&&W.options.margin[0]>=1?(!((H=W.options)===null||H===void 0)&&H.margin&&W.options.margin[0]&&je(W.options.margin[0])>P?P=je(W.options.margin[0]):r?.margin&&r.margin[0]&&je(r.margin[0])>P&&(P=je(r.margin[0])),!((C=W.options)===null||C===void 0)&&C.margin&&W.options.margin[2]&&je(W.options.margin[2])>F?F=je(W.options.margin[2]):r?.margin&&r.margin[2]&&je(r.margin[2])>F&&(F=je(r.margin[2]))):(!((I=W.options)===null||I===void 0)&&I.margin&&W.options.margin[0]&<(W.options.margin[0])>P?P=lt(W.options.margin[0]):r?.margin&&r.margin[0]&<(r.margin[0])>P&&(P=lt(r.margin[0])),!((m=W.options)===null||m===void 0)&&m.margin&&W.options.margin[2]&<(W.options.margin[2])>F?F=lt(W.options.margin[2]):r?.margin&&r.margin[2]&<(r.margin[2])>F&&(F=lt(r.margin[2])))}),g(),l+=P+F,r.verbose&&b===0&&console.log(`| SLIDE [${s.length}]: emuSlideTabH ...... = ${(o/Ke).toFixed(1)} `),v.forEach((W,H)=>{var C;let I={_type:He.tablecell,_lines:null,_lineHeight:lt((!((C=W.options)===null||C===void 0)&&C.fontSize?W.options.fontSize:r.fontSize?r.fontSize:yr)*(t0+(r.autoPageLineWeight?r.autoPageLineWeight:0))/100),text:[],options:W.options};I.options.rowspan&&(I._lineHeight=0),I.options.autoPageCharWeight=r.autoPageCharWeight?r.autoPageCharWeight:null;let m=r.colW[H];W.options.colspan&&Array.isArray(r.colW)&&(m=r.colW.filter((N,ne)=>ne>=H&&neN+ne)),I._lines=l0(W,m),x.push(I)}),r.verbose&&console.log(` | SLIDE [${s.length}]: ROW [${b}]: START...`);let E=0,B=0,T=!1;for(;!T;){let W=x[E],H=R[E];x.forEach(m=>{m._lineHeight>=B&&(B=m._lineHeight)}),l+B>o&&(r.verbose&&(console.log(` |-----------------------------------------------------------------------|`),console.log(`|-- NEW SLIDE CREATED (currTabH+currLineH > maxH) => ${(l/Ke).toFixed(2)} + ${(W._lineHeight/Ke).toFixed(2)} > ${o/Ke}`),console.log(`|-----------------------------------------------------------------------| `)),R.length>0&&R.map(N=>N.text.length).reduce((N,ne)=>N+ne)>0&&y.rows.push(R),s.push(y),y={rows:[]},R=[],v.forEach(N=>R.push({_type:He.tablecell,text:[],options:N.options})),g(),l+=P+F,r.verbose&&console.log(`| SLIDE [${s.length}]: emuSlideTabH ...... = ${(o/Ke).toFixed(1)} `),l=0,(r.addHeaderToEach||r.autoPageRepeatHeader)&&r._arrObjTabHeadRows&&r._arrObjTabHeadRows.forEach(N=>{let ne=[],q=0;N.forEach(se=>{ne.push(se),se._lineHeight>q&&(q=se._lineHeight)}),y.rows.push(ne),l+=q}),H=R[E]);let C=W._lines.shift();Array.isArray(H.text)&&(C?H.text=H.text.concat(C):H.text.length===0&&(H.text=H.text.concat({_type:He.tablecell,text:""}))),E===x.length-1&&(l+=B),E=Em._lines.length).reduce((m,N)=>m+N)===0&&(T=!0)}R.length>0&&y.rows.push(R),r.verbose&&console.log(`- SLIDE [${s.length}]: ROW [${b}]: ...COMPLETE ...... emuTabCurrH = ${(l/Ke).toFixed(2)} ( emuSlideTabH = ${(o/Ke).toFixed(2)} )`)}),s.push(y),r.verbose&&(console.log(` |================================================|`),console.log(`| FINAL: tableRowSlides.length = ${s.length}`),s.forEach(v=>console.log(v)),console.log(`|================================================| -`)),s}function i0(e,r,t={},n){let i=t||{};i.slideMargin=i.slideMargin||i.slideMargin===0?i.slideMargin:.5;let a=i.w||e.presLayout.width,o=[],l=[],c=[],s=[],u=[],d=[.5,.5,.5,.5],A=0;if(!document.getElementById(r))throw new Error('tableToSlides: Table ID "'+r+'" does not exist!');n?._margin?(Array.isArray(n._margin)?d=n._margin:isNaN(n._margin)||(d=[n._margin,n._margin,n._margin,n._margin]),i.slideMargin=d):i?.slideMargin&&(Array.isArray(i.slideMargin)?d=i.slideMargin:isNaN(i.slideMargin)||(d=[i.slideMargin,i.slideMargin,i.slideMargin,i.slideMargin])),a=(i.w?lt(i.w):e.presLayout.width)-lt(d[1]+d[3]),i.verbose&&(console.log("[[VERBOSE MODE]]"),console.log("|-- `tableToSlides` ----------------------------------------------------|"),console.log(`| tableProps.h .................................... = ${i.h}`),console.log(`| tableProps.w .................................... = ${i.w}`),console.log(`| pptx.presLayout.width ........................... = ${(e.presLayout.width/Ke).toFixed(1)}`),console.log(`| pptx.presLayout.height .......................... = ${(e.presLayout.height/Ke).toFixed(1)}`),console.log(`| emuSlideTabW .................................... = ${(a/Ke).toFixed(1)}`));let f=document.querySelectorAll(`#${r} tr:first-child th`);f.length===0&&(f=document.querySelectorAll(`#${r} tr:first-child td`)),f.forEach(g=>{let y=g;if(y.getAttribute("colspan"))for(let v=0;v{A+=g}),u.forEach((g,y)=>{let v=Number((Number(a)*(g/A*100)/100/Ke).toFixed(2)),b=0,x=document.querySelector(`#${r} thead tr:first-child th:nth-child(${y+1})`);x&&(b=Number(x.getAttribute("data-pptx-min-width")));let P=document.querySelector(`#${r} thead tr:first-child th:nth-child(${y+1})`);P&&(b=Number(P.getAttribute("data-pptx-width"))),s.push(b>v?b:v)}),i.verbose&&console.log(`| arrColW ......................................... = [${s.join(", ")}]`),["thead","tbody","tfoot"].forEach(g=>{document.querySelectorAll(`#${r} ${g} tr`).forEach(y=>{let v=y,b=[];switch(Array.from(v.cells).forEach(x=>{let P=window.getComputedStyle(x).getPropertyValue("color").replace(/\s+/gi,"").replace("rgba(","").replace("rgb(","").replace(")","").split(","),F=window.getComputedStyle(x).getPropertyValue("background-color").replace(/\s+/gi,"").replace("rgba(","").replace("rgb(","").replace(")","").split(",");(window.getComputedStyle(x).getPropertyValue("background-color")==="rgba(0, 0, 0, 0)"||window.getComputedStyle(x).getPropertyValue("transparent"))&&(F=["255","255","255"]);let R={align:null,bold:window.getComputedStyle(x).getPropertyValue("font-weight")==="bold"||Number(window.getComputedStyle(x).getPropertyValue("font-weight"))>=500,border:null,color:Ts(Number(P[0]),Number(P[1]),Number(P[2])),fill:{color:Ts(Number(F[0]),Number(F[1]),Number(F[2]))},fontFace:(window.getComputedStyle(x).getPropertyValue("font-family")||"").split(",")[0].replace(/"/g,"").replace("inherit","").replace("initial","")||null,fontSize:Number(window.getComputedStyle(x).getPropertyValue("font-size").replace(/[a-z]/gi,"")),margin:null,colspan:Number(x.getAttribute("colspan"))||null,rowspan:Number(x.getAttribute("rowspan"))||null,valign:null};if(["left","center","right","start","end"].includes(window.getComputedStyle(x).getPropertyValue("text-align"))){let E=window.getComputedStyle(x).getPropertyValue("text-align").replace("start","left").replace("end","right");R.align=E==="center"?"center":E==="left"?"left":E==="right"?"right":null}if(["top","middle","bottom"].includes(window.getComputedStyle(x).getPropertyValue("vertical-align"))){let E=window.getComputedStyle(x).getPropertyValue("vertical-align");R.valign=E==="top"?"top":E==="middle"?"middle":E==="bottom"?"bottom":null}window.getComputedStyle(x).getPropertyValue("padding-left")&&(R.margin=[0,0,0,0],["padding-top","padding-right","padding-bottom","padding-left"].forEach((B,T)=>{R.margin[T]=Math.round(Number(window.getComputedStyle(x).getPropertyValue(B).replace(/\D/gi,"")))})),(window.getComputedStyle(x).getPropertyValue("border-top-width")||window.getComputedStyle(x).getPropertyValue("border-right-width")||window.getComputedStyle(x).getPropertyValue("border-bottom-width")||window.getComputedStyle(x).getPropertyValue("border-left-width"))&&(R.border=[null,null,null,null],["top","right","bottom","left"].forEach((B,T)=>{let W=Math.round(Number(window.getComputedStyle(x).getPropertyValue("border-"+B+"-width").replace("px",""))),H=[];H=window.getComputedStyle(x).getPropertyValue("border-"+B+"-color").replace(/\s+/gi,"").replace("rgba(","").replace("rgb(","").replace(")","").split(",");let C=Ts(Number(H[0]),Number(H[1]),Number(H[2]));R.border[T]={pt:W,color:C}})),b.push({_type:He.tablecell,text:x.innerText,options:R})}),g){case"thead":o.push(b);break;case"tbody":l.push(b);break;case"tfoot":c.push(b);break;default:console.log(`table parsing: unexpected table part: ${g}`);break}})}),i._arrObjTabHeadRows=o||null,i.colW=s,qd([...o,...l,...c],i,e.presLayout,n).forEach((g,y)=>{let v=e.addSlide({masterName:i.masterSlideName||null});y===0&&(i.y=i.y||d[0]),y>0&&(i.y=i.autoPageSlideStartY||i.newSlideStartY||d[0]),i.verbose&&console.log(`| opts.autoPageSlideStartY: ${i.autoPageSlideStartY} / arrInchMargins[0]: ${d[0]} => opts.y = ${i.y}`),v.addTable(g.rows,{x:i.x||d[3],y:i.y,w:Number(a)/Ke,colW:s,autoPage:!1}),i.addImage&&(i.addImage.options=i.addImage.options||{},!i.addImage.image||!i.addImage.image.path&&!i.addImage.image.data?console.warn("Warning: tableToSlides.addImage requires either `path` or `data`"):v.addImage({path:i.addImage.image.path,data:i.addImage.image.data,x:i.addImage.options.x,y:i.addImage.options.y,w:i.addImage.options.w,h:i.addImage.options.h})),i.addShape&&v.addShape(i.addShape.shapeName,i.addShape.options||{}),i.addTable&&v.addTable(i.addTable.rows,i.addTable.options||{}),i.addText&&v.addText(i.addText.text,i.addText.options||{})})}var a0=0;function o0(e,r){e.bkgd&&(r.bkgd=e.bkgd),e.objects&&Array.isArray(e.objects)&&e.objects.length>0&&e.objects.forEach((t,n)=>{let i=Object.keys(t)[0],a=r;hn[i]&&i==="chart"?Vd(a,t[i].type,t[i].data,t[i].opts):hn[i]&&i==="image"?Xd(a,t[i]):hn[i]&&i==="line"?Js(a,xn.LINE,t[i]):hn[i]&&i==="rect"?Js(a,xn.RECTANGLE,t[i]):hn[i]&&i==="text"?vo(a,[{text:t[i].text}],t[i].options,!1):hn[i]&&i==="placeholder"&&(t[i].options.placeholder=t[i].options.name,delete t[i].options.name,t[i].options._placeholderType=t[i].options.type,delete t[i].options.type,t[i].options._placeholderIdx=100+n,vo(a,[{text:t[i].text}],t[i].options,!0))}),e.slideNumber&&typeof e.slideNumber=="object"&&(r._slideNumberProps=e.slideNumber)}function Vd(e,r,t,n){var i;function a(d){!d||d.style==="none"||(d.size!==void 0&&(isNaN(Number(d.size))||d.size<=0)&&(console.warn("Warning: chart.gridLine.size must be greater than 0."),delete d.size),d.style&&!["solid","dash","dot"].includes(d.style)&&(console.warn("Warning: chart.gridLine.style options: `solid`, `dash`, `dot`."),delete d.style),d.cap&&!["flat","square","round"].includes(d.cap)&&(console.warn("Warning: chart.gridLine.cap options: `flat`, `square`, `round`."),delete d.cap))}let o=++a0,l={_type:null,text:null,options:null,chartRid:null},c=null,s=[];Array.isArray(r)?(r.forEach(d=>{s=s.concat(d.data)}),c=t||n):(s=t,c=n),s.forEach((d,A)=>{d._dataIndex=A,d.labels!==void 0&&!Array.isArray(d.labels[0])&&(d.labels=[d.labels])});let u=c&&typeof c=="object"?c:{};if(u._type=r,u.x=typeof u.x<"u"&&u.x!=null&&!isNaN(Number(u.x))?u.x:1,u.y=typeof u.y<"u"&&u.y!=null&&!isNaN(Number(u.y))?u.y:1,u.w=u.w||"50%",u.h=u.h||"50%",u.objectName=u.objectName?Ve(u.objectName):`Chart ${e._slideObjects.filter(d=>d._type===He.chart).length}`,["bar","col"].includes(u.barDir||"")||(u.barDir="col"),u._type===Ce.AREA&&(["stacked","standard","percentStacked"].includes(u.barGrouping||"")||(u.barGrouping="standard")),u._type===Ce.BAR&&(["clustered","stacked","percentStacked"].includes(u.barGrouping||"")||(u.barGrouping="clustered")),u._type===Ce.BAR3D&&(["clustered","stacked","standard","percentStacked"].includes(u.barGrouping||"")||(u.barGrouping="standard")),!((i=u.barGrouping)===null||i===void 0)&&i.includes("tacked")&&(u.barGapWidthPct||(u.barGapWidthPct=50)),u.dataLabelPosition&&((u._type===Ce.AREA||u._type===Ce.BAR3D||u._type===Ce.DOUGHNUT||u._type===Ce.RADAR)&&delete u.dataLabelPosition,u._type===Ce.PIE&&(["bestFit","ctr","inEnd","outEnd"].includes(u.dataLabelPosition)||delete u.dataLabelPosition),(u._type===Ce.BUBBLE||u._type===Ce.BUBBLE3D||u._type===Ce.LINE||u._type===Ce.SCATTER)&&(["b","ctr","l","r","t"].includes(u.dataLabelPosition)||delete u.dataLabelPosition),u._type===Ce.BAR&&(["stacked","percentStacked"].includes(u.barGrouping||"")||["ctr","inBase","inEnd"].includes(u.dataLabelPosition)||delete u.dataLabelPosition,["clustered"].includes(u.barGrouping||"")||["ctr","inBase","inEnd","outEnd"].includes(u.dataLabelPosition)||delete u.dataLabelPosition)),u.dataLabelBkgrdColors=u.dataLabelBkgrdColors||!u.dataLabelBkgrdColors?u.dataLabelBkgrdColors:!1,["b","l","r","t","tr"].includes(u.legendPos||"")||(u.legendPos="r"),["cone","coneToMax","box","cylinder","pyramid","pyramidToMax"].includes(u.bar3DShape||"")||(u.bar3DShape="box"),["circle","dash","diamond","dot","none","square","triangle"].includes(u.lineDataSymbol||"")||(u.lineDataSymbol="circle"),["gap","span"].includes(u.displayBlanksAs||"")||(u.displayBlanksAs="span"),["standard","marker","filled"].includes(u.radarStyle||"")||(u.radarStyle="standard"),u.lineDataSymbolSize=u.lineDataSymbolSize&&!isNaN(u.lineDataSymbolSize)?u.lineDataSymbolSize:6,u.lineDataSymbolLineSize=u.lineDataSymbolLineSize&&!isNaN(u.lineDataSymbolLineSize)?je(u.lineDataSymbolLineSize):je(.75),u.layout&&["x","y","w","h"].forEach(d=>{let A=u.layout[d];(isNaN(Number(A))||A<0||A>1)&&(console.warn("Warning: chart.layout."+d+" can only be 0-1"),delete u.layout[d])}),u.catGridLine=u.catGridLine||(u._type===Ce.SCATTER?{color:"D9D9D9",size:1}:{style:"none"}),u.valGridLine=u.valGridLine||(u._type===Ce.SCATTER?{color:"D9D9D9",size:1}:{}),u.serGridLine=u.serGridLine||(u._type===Ce.SCATTER?{color:"D9D9D9",size:1}:{style:"none"}),a(u.catGridLine),a(u.valGridLine),a(u.serGridLine),kl(u.shadow),u.showDataTable=u.showDataTable||!u.showDataTable?u.showDataTable:!1,u.showDataTableHorzBorder=u.showDataTableHorzBorder||!u.showDataTableHorzBorder?u.showDataTableHorzBorder:!0,u.showDataTableVertBorder=u.showDataTableVertBorder||!u.showDataTableVertBorder?u.showDataTableVertBorder:!0,u.showDataTableOutline=u.showDataTableOutline||!u.showDataTableOutline?u.showDataTableOutline:!0,u.showDataTableKeys=u.showDataTableKeys||!u.showDataTableKeys?u.showDataTableKeys:!0,u.showLabel=u.showLabel||!u.showLabel?u.showLabel:!1,u.showLegend=u.showLegend||!u.showLegend?u.showLegend:!1,u.showPercent=u.showPercent||!u.showPercent?u.showPercent:!0,u.showTitle=u.showTitle||!u.showTitle?u.showTitle:!1,u.showValue=u.showValue||!u.showValue?u.showValue:!1,u.showLeaderLines=u.showLeaderLines||!u.showLeaderLines?u.showLeaderLines:!1,u.catAxisLineShow=typeof u.catAxisLineShow<"u"?u.catAxisLineShow:!0,u.valAxisLineShow=typeof u.valAxisLineShow<"u"?u.valAxisLineShow:!0,u.serAxisLineShow=typeof u.serAxisLineShow<"u"?u.serAxisLineShow:!0,u.v3DRotX=!isNaN(u.v3DRotX)&&u.v3DRotX>=-90&&u.v3DRotX<=90?u.v3DRotX:30,u.v3DRotY=!isNaN(u.v3DRotY)&&u.v3DRotY>=0&&u.v3DRotY<=360?u.v3DRotY:30,u.v3DRAngAx=u.v3DRAngAx||!u.v3DRAngAx?u.v3DRAngAx:!0,u.v3DPerspective=!isNaN(u.v3DPerspective)&&u.v3DPerspective>=0&&u.v3DPerspective<=240?u.v3DPerspective:30,u.barGapWidthPct=!isNaN(u.barGapWidthPct)&&u.barGapWidthPct>=0&&u.barGapWidthPct<=1e3?u.barGapWidthPct:150,u.barGapDepthPct=!isNaN(u.barGapDepthPct)&&u.barGapDepthPct>=0&&u.barGapDepthPct<=1e3?u.barGapDepthPct:150,u.chartColors=Array.isArray(u.chartColors)?u.chartColors:u._type===Ce.PIE||u._type===Ce.DOUGHNUT?e0:ji,u.chartColorsOpacity=u.chartColorsOpacity&&!isNaN(u.chartColorsOpacity)?u.chartColorsOpacity:null,u.border=u.border&&typeof u.border=="object"?u.border:null,u.border&&(!u.border.pt||isNaN(u.border.pt))&&(u.border.pt=ri.pt),u.border&&(!u.border.color||typeof u.border.color!="string")&&(u.border.color=ri.color),u.plotArea=u.plotArea||{},u.plotArea.border=u.plotArea.border&&typeof u.plotArea.border=="object"?u.plotArea.border:null,u.plotArea.border&&(!u.plotArea.border.pt||isNaN(u.plotArea.border.pt))&&(u.plotArea.border.pt=ri.pt),u.plotArea.border&&(!u.plotArea.border.color||typeof u.plotArea.border.color!="string")&&(u.plotArea.border.color=ri.color),u.border&&(u.plotArea.border=u.border),u.plotArea.fill=u.plotArea.fill||{color:null,transparency:null},u.fill&&(u.plotArea.fill.color=u.fill),u.chartArea=u.chartArea||{},u.chartArea.border=u.chartArea.border&&typeof u.chartArea.border=="object"?u.chartArea.border:null,u.chartArea.border&&(u.chartArea.border={color:u.chartArea.border.color||ri.color,pt:u.chartArea.border.pt||ri.pt}),u.chartArea.roundedCorners=typeof u.chartArea.roundedCorners=="boolean"?u.chartArea.roundedCorners:!0,u.dataBorder=u.dataBorder&&typeof u.dataBorder=="object"?u.dataBorder:null,u.dataBorder&&(!u.dataBorder.pt||isNaN(u.dataBorder.pt))&&(u.dataBorder.pt=.75),u.dataBorder&&u.dataBorder.color){let d=typeof u.dataBorder.color=="string"&&u.dataBorder.color.length===6&&/^[0-9A-Fa-f]{6}$/.test(u.dataBorder.color),A=Object.values(mo).includes(u.dataBorder.color);!d&&!A&&(u.dataBorder.color="F9F9F9")}return!u.dataLabelFormatCode&&u._type===Ce.SCATTER&&(u.dataLabelFormatCode="General"),!u.dataLabelFormatCode&&(u._type===Ce.PIE||u._type===Ce.DOUGHNUT)&&(u.dataLabelFormatCode=u.showPercent?"0%":"General"),u.dataLabelFormatCode=u.dataLabelFormatCode&&typeof u.dataLabelFormatCode=="string"?u.dataLabelFormatCode:"#,##0",!u.dataLabelFormatScatter&&u._type===Ce.SCATTER&&(u.dataLabelFormatScatter="custom"),u.lineSize=typeof u.lineSize=="number"?u.lineSize:2,u.valAxisMajorUnit=typeof u.valAxisMajorUnit=="number"?u.valAxisMajorUnit:null,u._type===Ce.AREA||u._type===Ce.BAR||u._type===Ce.BAR3D||u._type===Ce.LINE?u.catAxisMultiLevelLabels=!!u.catAxisMultiLevelLabels:delete u.catAxisMultiLevelLabels,l._type="chart",l.options=u,l.chartRid=Vr(e),e._relsChart.push({rId:Vr(e),data:s,opts:u,type:u._type,globalId:o,fileName:`chart${o}.xml`,Target:`/ppt/charts/chart${o}.xml`}),e._slideObjects.push(l),l}function Xd(e,r){let t={_type:null,text:null,options:null,image:null,imageRid:null,hyperlink:null},n=r.x||0,i=r.y||0,a=r.w||0,o=r.h||0,l=r.sizing||null,c=r.hyperlink||"",s=r.data||"",u=r.path||"",d=Vr(e),A=r.objectName?Ve(r.objectName):`Image ${e._slideObjects.filter(p=>p._type===He.image).length}`;if(!u&&!s)return console.error("ERROR: addImage() requires either 'data' or 'path' parameter!"),null;if(u&&typeof u!="string")return console.error(`ERROR: addImage() 'path' should be a string, ex: {path:'/img/sample.png'} - you sent ${String(u)}`),null;if(s&&typeof s!="string")return console.error(`ERROR: addImage() 'data' should be a string, ex: {data:'image/png;base64,NMP[...]'} - you sent ${String(s)}`),null;if(s&&typeof s=="string"&&!s.toLowerCase().includes("base64,"))return console.error("ERROR: Image `data` value lacks a base64 header! Ex: 'image/png;base64,NMP[...]')"),null;let f=(u.substring(u.lastIndexOf("/")+1).split("?")[0].split(".").pop().split("#")[0]||"png").toLowerCase();if(s&&/image\/(\w+);/.exec(s)&&/image\/(\w+);/.exec(s).length>0?f=/image\/(\w+);/.exec(s)[1]:s?.toLowerCase().includes("image/svg+xml")&&(f="svg"),t._type=He.image,t.image=u||"preencoded.png",t.options={x:n||0,y:i||0,w:a||1,h:o||1,altText:r.altText||"",rounding:typeof r.rounding=="boolean"?r.rounding:!1,sizing:l,placeholder:r.placeholder,rotate:r.rotate||0,flipV:r.flipV||!1,flipH:r.flipH||!1,transparency:r.transparency||0,objectName:A,shadow:kl(r.shadow)},f==="svg")e._relsMedia.push({path:u||s+"png",type:"image/png",extn:"png",data:s||"",rId:d,Target:`../media/image-${e._slideNum}-${e._relsMedia.length+1}.png`,isSvgPng:!0,svgSize:{w:nt(t.options.w,"X",e._presLayout),h:nt(t.options.h,"Y",e._presLayout)}}),t.imageRid=d,e._relsMedia.push({path:u||s,type:"image/svg+xml",extn:f,data:s||"",rId:d+1,Target:`../media/image-${e._slideNum}-${e._relsMedia.length+1}.${f}`}),t.imageRid=d+1;else{let p=e._relsMedia.filter(g=>g.path&&g.path===u&&g.type==="image/"+f&&!g.isDuplicate)[0];e._relsMedia.push({path:u||"preencoded."+f,type:"image/"+f,extn:f,data:s||"",rId:d,isDuplicate:!!p?.Target,Target:p?.Target?p.Target:`../media/image-${e._slideNum}-${e._relsMedia.length+1}.${f}`}),t.imageRid=d}if(typeof c=="object"){if(!c.url&&!c.slide)throw new Error("ERROR: `hyperlink` option requires either: `url` or `slide`");d++,e._rels.push({type:He.hyperlink,data:c.slide?"slide":"dummy",rId:d,Target:c.url||c.slide.toString()}),c._rId=d,t.hyperlink=c}e._slideObjects.push(t)}function s0(e,r){let t=r.x||0,n=r.y||0,i=r.w||2,a=r.h||2,o=r.data||"",l=r.link||"",c=r.path||"",s=r.type||"audio",u="",d=r.cover||t0,A=r.objectName?Ve(r.objectName):`Media ${e._slideObjects.filter(p=>p._type===He.media).length}`,f={_type:He.media};if(!c&&!o&&s!=="online")throw new Error("addMedia() error: either `data` or `path` are required!");if(o&&!o.toLowerCase().includes("base64,"))throw new Error("addMedia() error: `data` value lacks a base64 header! Ex: 'video/mpeg;base64,NMP[...]')");if(!d.toLowerCase().includes("base64,"))throw new Error("addMedia() error: `cover` value lacks a base64 header! Ex: 'data:image/png;base64,iV[...]')");if(s==="online"&&!l)throw new Error("addMedia() error: online videos require `link` value");if(u=r.extn||(o?o.split(";")[0].split("/")[1]:c.split(".").pop())||"mp3",f.mtype=s,f.media=c||"preencoded.mov",f.options={},f.options.x=t,f.options.y=n,f.options.w=i,f.options.h=a,f.options.objectName=A,s==="online"){let p=Vr(e);e._relsMedia.push({path:c||"preencoded"+u,data:"dummy",type:"online",extn:u,rId:p,Target:l}),f.mediaRid=p,e._relsMedia.push({path:"preencoded.png",data:d,type:"image/png",extn:"png",rId:Vr(e),Target:`../media/image-${e._slideNum}-${e._relsMedia.length+1}.png`})}else{let p=e._relsMedia.filter(y=>y.path&&y.path===c&&y.type===s+"/"+u&&!y.isDuplicate)[0],g=Vr(e);e._relsMedia.push({path:c||"preencoded"+u,type:s+"/"+u,extn:u,data:o||"",rId:g,isDuplicate:!!p?.Target,Target:p?.Target?p.Target:`../media/media-${e._slideNum}-${e._relsMedia.length+1}.${u}`}),f.mediaRid=g,e._relsMedia.push({path:c||"preencoded"+u,type:s+"/"+u,extn:u,data:o||"",rId:Vr(e),isDuplicate:!!p?.Target,Target:p?.Target?p.Target:`../media/media-${e._slideNum}-${e._relsMedia.length+0}.${u}`}),e._relsMedia.push({path:"preencoded.png",type:"image/png",extn:"png",data:d,rId:Vr(e),Target:`../media/image-${e._slideNum}-${e._relsMedia.length+1}.png`})}e._slideObjects.push(f)}function l0(e,r){e._slideObjects.push({_type:He.notes,text:[{text:r}]})}function Js(e,r,t){let n=typeof t=="object"?t:{};n.line=n.line||{type:"none"};let i={_type:He.text,shape:r||xn.RECTANGLE,options:n,text:null};if(!r)throw new Error("Missing/Invalid shape parameter! Example: `addShape(pptxgen.shapes.LINE, {x:1, y:1, w:1, h:1});`");let a={type:n.line.type||"solid",color:n.line.color||Wd,transparency:n.line.transparency||0,width:n.line.width||1,dashType:n.line.dashType||"solid",beginArrowType:n.line.beginArrowType||null,endArrowType:n.line.endArrowType||null};if(typeof n.line=="object"&&n.line.type!=="none"&&(n.line=a),n.x=n.x||(n.x===0?0:1),n.y=n.y||(n.y===0?0:1),n.w=n.w||(n.w===0?0:1),n.h=n.h||(n.h===0?0:1),n.objectName=n.objectName?Ve(n.objectName):`Shape ${e._slideObjects.filter(o=>o._type===He.text).length}`,typeof n.line=="string"){let o=a;o.color=String(n.line),n.line=o}typeof n.lineSize=="number"&&(n.line.width=n.lineSize),typeof n.lineDash=="string"&&(n.line.dashType=n.lineDash),typeof n.lineHead=="string"&&(n.line.beginArrowType=n.lineHead),typeof n.lineTail=="string"&&(n.line.endArrowType=n.lineTail),hi(e,i),e._slideObjects.push(i)}function c0(e,r,t,n,i,a,o){let l=[e],c=t&&typeof t=="object"?t:{};c.objectName=c.objectName?Ve(c.objectName):`Table ${e._slideObjects.filter(A=>A._type===He.table).length}`;{if(r===null||r.length===0||!Array.isArray(r))throw new Error("addTable: Array expected! EX: 'slide.addTable( [rows], {options} );' (https://gitbrent.github.io/PptxGenJS/docs/api-tables.html)");if(!r[0]||!Array.isArray(r[0]))throw new Error("addTable: 'rows' should be an array of cells! EX: 'slide.addTable( [ ['A'], ['B'], {text:'C',options:{align:'center'}} ] );' (https://gitbrent.github.io/PptxGenJS/docs/api-tables.html)")}let s=[];r.forEach(A=>{let f=[];Array.isArray(A)?A.forEach(p=>{let g={_type:He.tablecell,text:"",options:typeof p=="object"&&p.options?p.options:{}};typeof p=="string"||typeof p=="number"?g.text=p.toString():p.text&&(typeof p.text=="string"||typeof p.text=="number"?g.text=p.text.toString():p.text&&(g.text=p.text),p.options&&typeof p.options=="object"&&(g.options=p.options)),g.options.border=g.options.border||c.border||[{type:"none"},{type:"none"},{type:"none"},{type:"none"}];let y=g.options.border;!Array.isArray(y)&&typeof y=="object"&&(g.options.border=[y,y,y,y]),g.options.border[0]||(g.options.border[0]={type:"none"}),g.options.border[1]||(g.options.border[1]={type:"none"}),g.options.border[2]||(g.options.border[2]={type:"none"}),g.options.border[3]||(g.options.border[3]={type:"none"}),[0,1,2,3].forEach(b=>{g.options.border[b]={type:g.options.border[b].type||ti.type,color:g.options.border[b].color||ti.color,pt:typeof g.options.border[b].pt=="number"?g.options.border[b].pt:ti.pt}}),f.push(g)}):(console.log("addTable: tableRows has a bad row. A row should be an array of cells. You provided:"),console.log(A)),s.push(f)}),c.x=nt(c.x||(c.x===0?0:Ke/2),"X",i),c.y=nt(c.y||(c.y===0?0:Ke/2),"Y",i),c.h&&(c.h=nt(c.h,"Y",i)),c.fontSize=c.fontSize||wr,c.margin=c.margin===0||c.margin?c.margin:Ud,typeof c.margin=="number"&&(c.margin=[Number(c.margin),Number(c.margin),Number(c.margin),Number(c.margin)]),JSON.stringify({arrRows:s}).indexOf("hyperlink")===-1&&(c.color||(c.color=c.color||nr)),typeof c.border=="string"?(console.warn("addTable `border` option must be an object. Ex: `{border: {type:'none'}}`"),c.border=null):Array.isArray(c.border)&&[0,1,2,3].forEach(A=>{c.border[A]=c.border[A]?{type:c.border[A].type||ti.type,color:c.border[A].color||ti.color,pt:c.border[A].pt||ti.pt}:{type:"none"}}),c.autoPage=typeof c.autoPage=="boolean"?c.autoPage:!1,c.autoPageRepeatHeader=typeof c.autoPageRepeatHeader=="boolean"?c.autoPageRepeatHeader:!1,c.autoPageHeaderRows=typeof c.autoPageHeaderRows<"u"&&!isNaN(Number(c.autoPageHeaderRows))?Number(c.autoPageHeaderRows):1,c.autoPageLineWeight=typeof c.autoPageLineWeight<"u"&&!isNaN(Number(c.autoPageLineWeight))?Number(c.autoPageLineWeight):0,c.autoPageLineWeight&&(c.autoPageLineWeight>1?c.autoPageLineWeight=1:c.autoPageLineWeight<-1&&(c.autoPageLineWeight=-1));let u=ra;if(n&&typeof n._margin<"u"&&(Array.isArray(n._margin)?u=n._margin:isNaN(Number(n._margin))||(u=[Number(n._margin),Number(n._margin),Number(n._margin),Number(n._margin)])),c.colW){let A=s[0].reduce((f,p)=>{var g;return!((g=p?.options)===null||g===void 0)&&g.colspan&&typeof p.options.colspan=="number"?f+=p.options.colspan:f+=1,f},0);typeof c.colW=="string"||typeof c.colW=="number"||c.colW&&Array.isArray(c.colW)&&c.colW.length===1&&A>1?(c.w=Math.floor(Number(c.colW)*A),c.colW=null):c.colW&&Array.isArray(c.colW)&&c.colW.length!==A&&(console.warn("addTable: mismatch: (colW.length != data.length) Therefore, defaulting to evenly distributed col widths."),c.colW=null)}else c.w?c.w=nt(c.w,"X",i):c.w=Math.floor(i._sizeW/Ke-u[1]-u[3]);c.x&&c.x<20&&(c.x=lt(c.x)),c.y&&c.y<20&&(c.y=lt(c.y)),c.w&&typeof c.w=="number"&&c.w<20&&(c.w=lt(c.w)),c.h&&typeof c.h=="number"&&c.h<20&&(c.h=lt(c.h)),s.forEach(A=>{A.forEach((f,p)=>{typeof f=="number"||typeof f=="string"?A[p]={_type:He.tablecell,text:String(A[p]),options:c}:typeof f=="object"&&(typeof f.text=="number"?A[p].text=A[p].text.toString():(typeof f.text>"u"||f.text===null)&&(A[p].text=""),A[p].options=f.options||{},A[p]._type=He.tablecell)})});let d=[];return c&&!c.autoPage?(hi(e,s),e._slideObjects.push({_type:He.table,arrTabRows:s,options:Object.assign({},c)})):(c.autoPageRepeatHeader&&(c._arrObjTabHeadRows=s.filter((A,f)=>f{o(e._slideNum+f)||l.push(a({masterName:n?._name||null})),f>0&&(c.y=lt(c.autoPageSlideStartY||c.newSlideStartY||u[0]));{let p=o(e._slideNum+f);c.autoPage=!1,hi(p,A.rows),p.addTable(A.rows,Object.assign({},c)),f>0&&d.push(p)}})),d}function vo(e,r,t,n){let i={_type:n?He.placeholder:He.text,shape:t?.shape||xn.RECTANGLE,text:!r||r.length===0?[{text:"",options:null}]:r,options:t||{}};function a(o){{if(o.placeholder||(o.color=o.color||i.options.color||e.color||nr),(o.placeholder||n)&&(o.bullet=o.bullet||!1),o.placeholder&&e._slideLayout&&e._slideLayout._slideObjects){let l=e._slideLayout._slideObjects.filter(c=>c._type==="placeholder"&&c.options&&c.options.placeholder&&c.options.placeholder===o.placeholder)[0];l?.options&&(o=Object.assign(Object.assign({},o),l.options))}if(o.objectName=o.objectName?Ve(o.objectName):`Text ${e._slideObjects.filter(l=>l._type===He.text).length}`,o.shape===xn.LINE){let l={type:o.line.type||"solid",color:o.line.color||Wd,transparency:o.line.transparency||0,width:o.line.width||1,dashType:o.line.dashType||"solid",beginArrowType:o.line.beginArrowType||null,endArrowType:o.line.endArrowType||null};if(typeof o.line=="object"&&(o.line=l),typeof o.line=="string"){let c=l;typeof o.line=="string"&&(c.color=o.line),o.line=c}typeof o.lineSize=="number"&&(o.line.width=o.lineSize),typeof o.lineDash=="string"&&(o.line.dashType=o.lineDash),typeof o.lineHead=="string"&&(o.line.beginArrowType=o.lineHead),typeof o.lineTail=="string"&&(o.line.endArrowType=o.lineTail)}o.line=o.line||{},o.lineSpacing=o.lineSpacing&&!isNaN(o.lineSpacing)?o.lineSpacing:null,o.lineSpacingMultiple=o.lineSpacingMultiple&&!isNaN(o.lineSpacingMultiple)?o.lineSpacingMultiple:null,o._bodyProp=o._bodyProp||{},o._bodyProp.autoFit=o.autoFit||!1,o._bodyProp.anchor=o.placeholder?null:si.ctr,o._bodyProp.vert=o.vert||null,o._bodyProp.wrap=typeof o.wrap=="boolean"?o.wrap:!0,(o.inset&&!isNaN(Number(o.inset))||o.inset===0)&&(o._bodyProp.lIns=lt(o.inset),o._bodyProp.rIns=lt(o.inset),o._bodyProp.tIns=lt(o.inset),o._bodyProp.bIns=lt(o.inset)),typeof o.underline=="boolean"&&o.underline===!0&&(o.underline={style:"sng"})}return(o.align||"").toLowerCase().indexOf("c")===0?o._bodyProp.align=oi.center:(o.align||"").toLowerCase().indexOf("l")===0?o._bodyProp.align=oi.left:(o.align||"").toLowerCase().indexOf("r")===0?o._bodyProp.align=oi.right:(o.align||"").toLowerCase().indexOf("j")===0&&(o._bodyProp.align=oi.justify),(o.valign||"").toLowerCase().indexOf("b")===0?o._bodyProp.anchor=si.b:(o.valign||"").toLowerCase().indexOf("m")===0?o._bodyProp.anchor=si.ctr:(o.valign||"").toLowerCase().indexOf("t")===0&&(o._bodyProp.anchor=si.t),kl(o.shadow),o}i.options=a(i.options),i.text.forEach(o=>o.options=a(o.options||{})),hi(e,i.text||""),e._slideObjects.push(i)}function u0(e){(e._slideLayout._slideObjects||[]).forEach(r=>{r._type===He.placeholder&&e._slideObjects.filter(t=>t.options&&t.options.placeholder===r.options.placeholder).length===0&&vo(e,[{text:""}],r.options,!1)})}function Hd(e,r){var t;if(r.bkgd&&(r.background||(r.background={}),typeof r.bkgd=="string"?r.background.color=r.bkgd:(r.bkgd.data&&(r.background.data=r.bkgd.data),r.bkgd.path&&(r.background.path=r.bkgd.path),r.bkgd.src&&(r.background.path=r.bkgd.src))),!((t=r.background)===null||t===void 0)&&t.fill&&(r.background.color=r.background.fill),e&&(e.path||e.data)){e.path=e.path||"preencoded.png";let n=(e.path.split(".").pop()||"png").split("?")[0];n==="jpg"&&(n="jpeg"),r._relsMedia=r._relsMedia||[];let i=r._relsMedia.length+1;r._relsMedia.push({path:e.path,type:He.image,extn:n,data:e.data||null,rId:i,Target:`../media/${(r._name||"").replace(/\s+/gi,"-")}-image-${r._relsMedia.length+1}.${n}`}),r._bkgdImgRid=i}}function hi(e,r,t){let n=[];typeof r=="string"||typeof r=="number"||(Array.isArray(r)?n=r:typeof r=="object"&&(n=[r]),n.forEach((i,a)=>{if(t&&t[a]&&t[a].hyperlink&&(i.options=Object.assign(Object.assign({},i.options),t[a])),Array.isArray(i)){let o=[];i.forEach(l=>{l.options&&!l.text.options&&o.push(l.options)}),hi(e,i,o)}else if(Array.isArray(i.text))hi(e,i.text,t&&t[a]?[t[a]]:void 0);else if(i&&typeof i=="object"&&i.options&&i.options.hyperlink&&!i.options.hyperlink._rId)if(typeof i.options.hyperlink!="object")console.log("ERROR: text `hyperlink` option should be an object. Ex: `hyperlink: {url:'https://github.com'}` ");else if(!i.options.hyperlink.url&&!i.options.hyperlink.slide)console.log("ERROR: 'hyperlink requires either: `url` or `slide`'");else{let o=Vr(e);e._rels.push({type:He.hyperlink,data:i.options.hyperlink.slide?"slide":"dummy",rId:o,Target:Ve(i.options.hyperlink.url)||i.options.hyperlink.slide.toString()}),i.options.hyperlink._rId=o}else i&&typeof i=="object"&&i.options&&i.options.hyperlink&&i.options.hyperlink._rId&&e._rels.filter(o=>o.rId===i.options.hyperlink._rId).length===0&&e._rels.push({type:He.hyperlink,data:i.options.hyperlink.slide?"slide":"dummy",rId:i.options.hyperlink._rId,Target:Ve(i.options.hyperlink.url)||i.options.hyperlink.slide.toString()})}))}var d0=class{constructor(e){var r;this.addSlide=e.addSlide,this.getSlide=e.getSlide,this._name=`Slide ${e.slideNumber}`,this._presLayout=e.presLayout,this._rId=e.slideRId,this._rels=[],this._relsChart=[],this._relsMedia=[],this._setSlideNum=e.setSlideNum,this._slideId=e.slideId,this._slideLayout=e.slideLayout||null,this._slideNum=e.slideNumber,this._slideObjects=[],this._slideNumberProps=!((r=this._slideLayout)===null||r===void 0)&&r._slideNumberProps?this._slideLayout._slideNumberProps:null}set bkgd(e){this._bkgd=e,(!this._background||!this._background.color)&&(this._background||(this._background={}),typeof e=="string"&&(this._background.color=e))}get bkgd(){return this._bkgd}set background(e){this._background=e,e&&Hd(e,this)}get background(){return this._background}set color(e){this._color=e}get color(){return this._color}set hidden(e){this._hidden=e}get hidden(){return this._hidden}set slideNumber(e){this._slideNumberProps=e,this._setSlideNum(e)}get slideNumber(){return this._slideNumberProps}get newAutoPagedSlides(){return this._newAutoPagedSlides}addChart(e,r,t){let n=t||{};return n._type=e,Vd(this,e,r,t),this}addImage(e){return Xd(this,e),this}addMedia(e){return s0(this,e),this}addNotes(e){return l0(this,e),this}addShape(e,r){return Js(this,e,r),this}addTable(e,r){return this._newAutoPagedSlides=c0(this,e,r,this._slideLayout,this._presLayout,this.addSlide,this.getSlide),this}addText(e,r){return vo(this,typeof e=="string"||typeof e=="number"?[{text:e,options:r}]:e,r,!1),this}};function f0(e,r){return sr(this,void 0,void 0,function*(){let t=e.data;return yield new Promise((n,i)=>{var a,o;let l=new _d.default,c=(t.length-1)*2+1,s=((o=(a=t[0])===null||a===void 0?void 0:a.labels)===null||o===void 0?void 0:o.length)>1;l.folder("_rels"),l.folder("docProps"),l.folder("xl/_rels"),l.folder("xl/tables"),l.folder("xl/theme"),l.folder("xl/worksheets"),l.folder("xl/worksheets/_rels"),l.file("[Content_Types].xml",` +`)),s}function c0(e,r,t={},n){let i=t||{};i.slideMargin=i.slideMargin||i.slideMargin===0?i.slideMargin:.5;let a=i.w||e.presLayout.width,o=[],l=[],c=[],s=[],u=[],d=[.5,.5,.5,.5],A=0;if(!document.getElementById(r))throw new Error('tableToSlides: Table ID "'+r+'" does not exist!');n?._margin?(Array.isArray(n._margin)?d=n._margin:isNaN(n._margin)||(d=[n._margin,n._margin,n._margin,n._margin]),i.slideMargin=d):i?.slideMargin&&(Array.isArray(i.slideMargin)?d=i.slideMargin:isNaN(i.slideMargin)||(d=[i.slideMargin,i.slideMargin,i.slideMargin,i.slideMargin])),a=(i.w?lt(i.w):e.presLayout.width)-lt(d[1]+d[3]),i.verbose&&(console.log("[[VERBOSE MODE]]"),console.log("|-- `tableToSlides` ----------------------------------------------------|"),console.log(`| tableProps.h .................................... = ${i.h}`),console.log(`| tableProps.w .................................... = ${i.w}`),console.log(`| pptx.presLayout.width ........................... = ${(e.presLayout.width/Ke).toFixed(1)}`),console.log(`| pptx.presLayout.height .......................... = ${(e.presLayout.height/Ke).toFixed(1)}`),console.log(`| emuSlideTabW .................................... = ${(a/Ke).toFixed(1)}`));let f=document.querySelectorAll(`#${r} tr:first-child th`);f.length===0&&(f=document.querySelectorAll(`#${r} tr:first-child td`)),f.forEach(g=>{let y=g;if(y.getAttribute("colspan"))for(let v=0;v{A+=g}),u.forEach((g,y)=>{let v=Number((Number(a)*(g/A*100)/100/Ke).toFixed(2)),b=0,x=document.querySelector(`#${r} thead tr:first-child th:nth-child(${y+1})`);x&&(b=Number(x.getAttribute("data-pptx-min-width")));let P=document.querySelector(`#${r} thead tr:first-child th:nth-child(${y+1})`);P&&(b=Number(P.getAttribute("data-pptx-width"))),s.push(b>v?b:v)}),i.verbose&&console.log(`| arrColW ......................................... = [${s.join(", ")}]`),["thead","tbody","tfoot"].forEach(g=>{document.querySelectorAll(`#${r} ${g} tr`).forEach(y=>{let v=y,b=[];switch(Array.from(v.cells).forEach(x=>{let P=window.getComputedStyle(x).getPropertyValue("color").replace(/\s+/gi,"").replace("rgba(","").replace("rgb(","").replace(")","").split(","),F=window.getComputedStyle(x).getPropertyValue("background-color").replace(/\s+/gi,"").replace("rgba(","").replace("rgb(","").replace(")","").split(",");(window.getComputedStyle(x).getPropertyValue("background-color")==="rgba(0, 0, 0, 0)"||window.getComputedStyle(x).getPropertyValue("transparent"))&&(F=["255","255","255"]);let R={align:null,bold:window.getComputedStyle(x).getPropertyValue("font-weight")==="bold"||Number(window.getComputedStyle(x).getPropertyValue("font-weight"))>=500,border:null,color:Ds(Number(P[0]),Number(P[1]),Number(P[2])),fill:{color:Ds(Number(F[0]),Number(F[1]),Number(F[2]))},fontFace:(window.getComputedStyle(x).getPropertyValue("font-family")||"").split(",")[0].replace(/"/g,"").replace("inherit","").replace("initial","")||null,fontSize:Number(window.getComputedStyle(x).getPropertyValue("font-size").replace(/[a-z]/gi,"")),margin:null,colspan:Number(x.getAttribute("colspan"))||null,rowspan:Number(x.getAttribute("rowspan"))||null,valign:null};if(["left","center","right","start","end"].includes(window.getComputedStyle(x).getPropertyValue("text-align"))){let E=window.getComputedStyle(x).getPropertyValue("text-align").replace("start","left").replace("end","right");R.align=E==="center"?"center":E==="left"?"left":E==="right"?"right":null}if(["top","middle","bottom"].includes(window.getComputedStyle(x).getPropertyValue("vertical-align"))){let E=window.getComputedStyle(x).getPropertyValue("vertical-align");R.valign=E==="top"?"top":E==="middle"?"middle":E==="bottom"?"bottom":null}window.getComputedStyle(x).getPropertyValue("padding-left")&&(R.margin=[0,0,0,0],["padding-top","padding-right","padding-bottom","padding-left"].forEach((B,T)=>{R.margin[T]=Math.round(Number(window.getComputedStyle(x).getPropertyValue(B).replace(/\D/gi,"")))})),(window.getComputedStyle(x).getPropertyValue("border-top-width")||window.getComputedStyle(x).getPropertyValue("border-right-width")||window.getComputedStyle(x).getPropertyValue("border-bottom-width")||window.getComputedStyle(x).getPropertyValue("border-left-width"))&&(R.border=[null,null,null,null],["top","right","bottom","left"].forEach((B,T)=>{let W=Math.round(Number(window.getComputedStyle(x).getPropertyValue("border-"+B+"-width").replace("px",""))),H=[];H=window.getComputedStyle(x).getPropertyValue("border-"+B+"-color").replace(/\s+/gi,"").replace("rgba(","").replace("rgb(","").replace(")","").split(",");let C=Ds(Number(H[0]),Number(H[1]),Number(H[2]));R.border[T]={pt:W,color:C}})),b.push({_type:He.tablecell,text:x.innerText,options:R})}),g){case"thead":o.push(b);break;case"tbody":l.push(b);break;case"tfoot":c.push(b);break;default:console.log(`table parsing: unexpected table part: ${g}`);break}})}),i._arrObjTabHeadRows=o||null,i.colW=s,qd([...o,...l,...c],i,e.presLayout,n).forEach((g,y)=>{let v=e.addSlide({masterName:i.masterSlideName||null});y===0&&(i.y=i.y||d[0]),y>0&&(i.y=i.autoPageSlideStartY||i.newSlideStartY||d[0]),i.verbose&&console.log(`| opts.autoPageSlideStartY: ${i.autoPageSlideStartY} / arrInchMargins[0]: ${d[0]} => opts.y = ${i.y}`),v.addTable(g.rows,{x:i.x||d[3],y:i.y,w:Number(a)/Ke,colW:s,autoPage:!1}),i.addImage&&(i.addImage.options=i.addImage.options||{},!i.addImage.image||!i.addImage.image.path&&!i.addImage.image.data?console.warn("Warning: tableToSlides.addImage requires either `path` or `data`"):v.addImage({path:i.addImage.image.path,data:i.addImage.image.data,x:i.addImage.options.x,y:i.addImage.options.y,w:i.addImage.options.w,h:i.addImage.options.h})),i.addShape&&v.addShape(i.addShape.shapeName,i.addShape.options||{}),i.addTable&&v.addTable(i.addTable.rows,i.addTable.options||{}),i.addText&&v.addText(i.addText.text,i.addText.options||{})})}var u0=0;function d0(e,r){e.bkgd&&(r.bkgd=e.bkgd),e.objects&&Array.isArray(e.objects)&&e.objects.length>0&&e.objects.forEach((t,n)=>{let i=Object.keys(t)[0],a=r;hn[i]&&i==="chart"?Vd(a,t[i].type,t[i].data,t[i].opts):hn[i]&&i==="image"?Xd(a,t[i]):hn[i]&&i==="line"?$s(a,xn.LINE,t[i]):hn[i]&&i==="rect"?$s(a,xn.RECTANGLE,t[i]):hn[i]&&i==="text"?bo(a,[{text:t[i].text}],t[i].options,!1):hn[i]&&i==="placeholder"&&(t[i].options.placeholder=t[i].options.name,delete t[i].options.name,t[i].options._placeholderType=t[i].options.type,delete t[i].options.type,t[i].options._placeholderIdx=100+n,bo(a,[{text:t[i].text}],t[i].options,!0))}),e.slideNumber&&typeof e.slideNumber=="object"&&(r._slideNumberProps=e.slideNumber)}function Vd(e,r,t,n){var i;function a(d){!d||d.style==="none"||(d.size!==void 0&&(isNaN(Number(d.size))||d.size<=0)&&(console.warn("Warning: chart.gridLine.size must be greater than 0."),delete d.size),d.style&&!["solid","dash","dot"].includes(d.style)&&(console.warn("Warning: chart.gridLine.style options: `solid`, `dash`, `dot`."),delete d.style),d.cap&&!["flat","square","round"].includes(d.cap)&&(console.warn("Warning: chart.gridLine.cap options: `flat`, `square`, `round`."),delete d.cap))}let o=++u0,l={_type:null,text:null,options:null,chartRid:null},c=null,s=[];Array.isArray(r)?(r.forEach(d=>{s=s.concat(d.data)}),c=t||n):(s=t,c=n),s.forEach((d,A)=>{d._dataIndex=A,d.labels!==void 0&&!Array.isArray(d.labels[0])&&(d.labels=[d.labels])});let u=c&&typeof c=="object"?c:{};if(u._type=r,u.x=typeof u.x<"u"&&u.x!=null&&!isNaN(Number(u.x))?u.x:1,u.y=typeof u.y<"u"&&u.y!=null&&!isNaN(Number(u.y))?u.y:1,u.w=u.w||"50%",u.h=u.h||"50%",u.objectName=u.objectName?Ve(u.objectName):`Chart ${e._slideObjects.filter(d=>d._type===He.chart).length}`,["bar","col"].includes(u.barDir||"")||(u.barDir="col"),u._type===Ce.AREA&&(["stacked","standard","percentStacked"].includes(u.barGrouping||"")||(u.barGrouping="standard")),u._type===Ce.BAR&&(["clustered","stacked","percentStacked"].includes(u.barGrouping||"")||(u.barGrouping="clustered")),u._type===Ce.BAR3D&&(["clustered","stacked","standard","percentStacked"].includes(u.barGrouping||"")||(u.barGrouping="standard")),!((i=u.barGrouping)===null||i===void 0)&&i.includes("tacked")&&(u.barGapWidthPct||(u.barGapWidthPct=50)),u.dataLabelPosition&&((u._type===Ce.AREA||u._type===Ce.BAR3D||u._type===Ce.DOUGHNUT||u._type===Ce.RADAR)&&delete u.dataLabelPosition,u._type===Ce.PIE&&(["bestFit","ctr","inEnd","outEnd"].includes(u.dataLabelPosition)||delete u.dataLabelPosition),(u._type===Ce.BUBBLE||u._type===Ce.BUBBLE3D||u._type===Ce.LINE||u._type===Ce.SCATTER)&&(["b","ctr","l","r","t"].includes(u.dataLabelPosition)||delete u.dataLabelPosition),u._type===Ce.BAR&&(["stacked","percentStacked"].includes(u.barGrouping||"")||["ctr","inBase","inEnd"].includes(u.dataLabelPosition)||delete u.dataLabelPosition,["clustered"].includes(u.barGrouping||"")||["ctr","inBase","inEnd","outEnd"].includes(u.dataLabelPosition)||delete u.dataLabelPosition)),u.dataLabelBkgrdColors=u.dataLabelBkgrdColors||!u.dataLabelBkgrdColors?u.dataLabelBkgrdColors:!1,["b","l","r","t","tr"].includes(u.legendPos||"")||(u.legendPos="r"),["cone","coneToMax","box","cylinder","pyramid","pyramidToMax"].includes(u.bar3DShape||"")||(u.bar3DShape="box"),["circle","dash","diamond","dot","none","square","triangle"].includes(u.lineDataSymbol||"")||(u.lineDataSymbol="circle"),["gap","span"].includes(u.displayBlanksAs||"")||(u.displayBlanksAs="span"),["standard","marker","filled"].includes(u.radarStyle||"")||(u.radarStyle="standard"),u.lineDataSymbolSize=u.lineDataSymbolSize&&!isNaN(u.lineDataSymbolSize)?u.lineDataSymbolSize:6,u.lineDataSymbolLineSize=u.lineDataSymbolLineSize&&!isNaN(u.lineDataSymbolLineSize)?je(u.lineDataSymbolLineSize):je(.75),u.layout&&["x","y","w","h"].forEach(d=>{let A=u.layout[d];(isNaN(Number(A))||A<0||A>1)&&(console.warn("Warning: chart.layout."+d+" can only be 0-1"),delete u.layout[d])}),u.catGridLine=u.catGridLine||(u._type===Ce.SCATTER?{color:"D9D9D9",size:1}:{style:"none"}),u.valGridLine=u.valGridLine||(u._type===Ce.SCATTER?{color:"D9D9D9",size:1}:{}),u.serGridLine=u.serGridLine||(u._type===Ce.SCATTER?{color:"D9D9D9",size:1}:{style:"none"}),a(u.catGridLine),a(u.valGridLine),a(u.serGridLine),Cl(u.shadow),u.showDataTable=u.showDataTable||!u.showDataTable?u.showDataTable:!1,u.showDataTableHorzBorder=u.showDataTableHorzBorder||!u.showDataTableHorzBorder?u.showDataTableHorzBorder:!0,u.showDataTableVertBorder=u.showDataTableVertBorder||!u.showDataTableVertBorder?u.showDataTableVertBorder:!0,u.showDataTableOutline=u.showDataTableOutline||!u.showDataTableOutline?u.showDataTableOutline:!0,u.showDataTableKeys=u.showDataTableKeys||!u.showDataTableKeys?u.showDataTableKeys:!0,u.showLabel=u.showLabel||!u.showLabel?u.showLabel:!1,u.showLegend=u.showLegend||!u.showLegend?u.showLegend:!1,u.showPercent=u.showPercent||!u.showPercent?u.showPercent:!0,u.showTitle=u.showTitle||!u.showTitle?u.showTitle:!1,u.showValue=u.showValue||!u.showValue?u.showValue:!1,u.showLeaderLines=u.showLeaderLines||!u.showLeaderLines?u.showLeaderLines:!1,u.catAxisLineShow=typeof u.catAxisLineShow<"u"?u.catAxisLineShow:!0,u.valAxisLineShow=typeof u.valAxisLineShow<"u"?u.valAxisLineShow:!0,u.serAxisLineShow=typeof u.serAxisLineShow<"u"?u.serAxisLineShow:!0,u.v3DRotX=!isNaN(u.v3DRotX)&&u.v3DRotX>=-90&&u.v3DRotX<=90?u.v3DRotX:30,u.v3DRotY=!isNaN(u.v3DRotY)&&u.v3DRotY>=0&&u.v3DRotY<=360?u.v3DRotY:30,u.v3DRAngAx=u.v3DRAngAx||!u.v3DRAngAx?u.v3DRAngAx:!0,u.v3DPerspective=!isNaN(u.v3DPerspective)&&u.v3DPerspective>=0&&u.v3DPerspective<=240?u.v3DPerspective:30,u.barGapWidthPct=!isNaN(u.barGapWidthPct)&&u.barGapWidthPct>=0&&u.barGapWidthPct<=1e3?u.barGapWidthPct:150,u.barGapDepthPct=!isNaN(u.barGapDepthPct)&&u.barGapDepthPct>=0&&u.barGapDepthPct<=1e3?u.barGapDepthPct:150,u.chartColors=Array.isArray(u.chartColors)?u.chartColors:u._type===Ce.PIE||u._type===Ce.DOUGHNUT?a0:qi,u.chartColorsOpacity=u.chartColorsOpacity&&!isNaN(u.chartColorsOpacity)?u.chartColorsOpacity:null,u.border=u.border&&typeof u.border=="object"?u.border:null,u.border&&(!u.border.pt||isNaN(u.border.pt))&&(u.border.pt=ri.pt),u.border&&(!u.border.color||typeof u.border.color!="string")&&(u.border.color=ri.color),u.plotArea=u.plotArea||{},u.plotArea.border=u.plotArea.border&&typeof u.plotArea.border=="object"?u.plotArea.border:null,u.plotArea.border&&(!u.plotArea.border.pt||isNaN(u.plotArea.border.pt))&&(u.plotArea.border.pt=ri.pt),u.plotArea.border&&(!u.plotArea.border.color||typeof u.plotArea.border.color!="string")&&(u.plotArea.border.color=ri.color),u.border&&(u.plotArea.border=u.border),u.plotArea.fill=u.plotArea.fill||{color:null,transparency:null},u.fill&&(u.plotArea.fill.color=u.fill),u.chartArea=u.chartArea||{},u.chartArea.border=u.chartArea.border&&typeof u.chartArea.border=="object"?u.chartArea.border:null,u.chartArea.border&&(u.chartArea.border={color:u.chartArea.border.color||ri.color,pt:u.chartArea.border.pt||ri.pt}),u.chartArea.roundedCorners=typeof u.chartArea.roundedCorners=="boolean"?u.chartArea.roundedCorners:!0,u.dataBorder=u.dataBorder&&typeof u.dataBorder=="object"?u.dataBorder:null,u.dataBorder&&(!u.dataBorder.pt||isNaN(u.dataBorder.pt))&&(u.dataBorder.pt=.75),u.dataBorder&&u.dataBorder.color){let d=typeof u.dataBorder.color=="string"&&u.dataBorder.color.length===6&&/^[0-9A-Fa-f]{6}$/.test(u.dataBorder.color),A=Object.values(yo).includes(u.dataBorder.color);!d&&!A&&(u.dataBorder.color="F9F9F9")}return!u.dataLabelFormatCode&&u._type===Ce.SCATTER&&(u.dataLabelFormatCode="General"),!u.dataLabelFormatCode&&(u._type===Ce.PIE||u._type===Ce.DOUGHNUT)&&(u.dataLabelFormatCode=u.showPercent?"0%":"General"),u.dataLabelFormatCode=u.dataLabelFormatCode&&typeof u.dataLabelFormatCode=="string"?u.dataLabelFormatCode:"#,##0",!u.dataLabelFormatScatter&&u._type===Ce.SCATTER&&(u.dataLabelFormatScatter="custom"),u.lineSize=typeof u.lineSize=="number"?u.lineSize:2,u.valAxisMajorUnit=typeof u.valAxisMajorUnit=="number"?u.valAxisMajorUnit:null,u._type===Ce.AREA||u._type===Ce.BAR||u._type===Ce.BAR3D||u._type===Ce.LINE?u.catAxisMultiLevelLabels=!!u.catAxisMultiLevelLabels:delete u.catAxisMultiLevelLabels,l._type="chart",l.options=u,l.chartRid=Vr(e),e._relsChart.push({rId:Vr(e),data:s,opts:u,type:u._type,globalId:o,fileName:`chart${o}.xml`,Target:`/ppt/charts/chart${o}.xml`}),e._slideObjects.push(l),l}function Xd(e,r){let t={_type:null,text:null,options:null,image:null,imageRid:null,hyperlink:null},n=r.x||0,i=r.y||0,a=r.w||0,o=r.h||0,l=r.sizing||null,c=r.hyperlink||"",s=r.data||"",u=r.path||"",d=Vr(e),A=r.objectName?Ve(r.objectName):`Image ${e._slideObjects.filter(p=>p._type===He.image).length}`;if(!u&&!s)return console.error("ERROR: addImage() requires either 'data' or 'path' parameter!"),null;if(u&&typeof u!="string")return console.error(`ERROR: addImage() 'path' should be a string, ex: {path:'/img/sample.png'} - you sent ${String(u)}`),null;if(s&&typeof s!="string")return console.error(`ERROR: addImage() 'data' should be a string, ex: {data:'image/png;base64,NMP[...]'} - you sent ${String(s)}`),null;if(s&&typeof s=="string"&&!s.toLowerCase().includes("base64,"))return console.error("ERROR: Image `data` value lacks a base64 header! Ex: 'image/png;base64,NMP[...]')"),null;let f=(u.substring(u.lastIndexOf("/")+1).split("?")[0].split(".").pop().split("#")[0]||"png").toLowerCase();if(s&&/image\/(\w+);/.exec(s)&&/image\/(\w+);/.exec(s).length>0?f=/image\/(\w+);/.exec(s)[1]:s?.toLowerCase().includes("image/svg+xml")&&(f="svg"),t._type=He.image,t.image=u||"preencoded.png",t.options={x:n||0,y:i||0,w:a||1,h:o||1,altText:r.altText||"",rounding:typeof r.rounding=="boolean"?r.rounding:!1,sizing:l,placeholder:r.placeholder,rotate:r.rotate||0,flipV:r.flipV||!1,flipH:r.flipH||!1,transparency:r.transparency||0,objectName:A,shadow:Cl(r.shadow)},f==="svg")e._relsMedia.push({path:u||s+"png",type:"image/png",extn:"png",data:s||"",rId:d,Target:`../media/image-${e._slideNum}-${e._relsMedia.length+1}.png`,isSvgPng:!0,svgSize:{w:nt(t.options.w,"X",e._presLayout),h:nt(t.options.h,"Y",e._presLayout)}}),t.imageRid=d,e._relsMedia.push({path:u||s,type:"image/svg+xml",extn:f,data:s||"",rId:d+1,Target:`../media/image-${e._slideNum}-${e._relsMedia.length+1}.${f}`}),t.imageRid=d+1;else{let p=e._relsMedia.filter(g=>g.path&&g.path===u&&g.type==="image/"+f&&!g.isDuplicate)[0];e._relsMedia.push({path:u||"preencoded."+f,type:"image/"+f,extn:f,data:s||"",rId:d,isDuplicate:!!p?.Target,Target:p?.Target?p.Target:`../media/image-${e._slideNum}-${e._relsMedia.length+1}.${f}`}),t.imageRid=d}if(typeof c=="object"){if(!c.url&&!c.slide)throw new Error("ERROR: `hyperlink` option requires either: `url` or `slide`");d++,e._rels.push({type:He.hyperlink,data:c.slide?"slide":"dummy",rId:d,Target:c.url||c.slide.toString()}),c._rId=d,t.hyperlink=c}e._slideObjects.push(t)}function f0(e,r){let t=r.x||0,n=r.y||0,i=r.w||2,a=r.h||2,o=r.data||"",l=r.link||"",c=r.path||"",s=r.type||"audio",u="",d=r.cover||o0,A=r.objectName?Ve(r.objectName):`Media ${e._slideObjects.filter(p=>p._type===He.media).length}`,f={_type:He.media};if(!c&&!o&&s!=="online")throw new Error("addMedia() error: either `data` or `path` are required!");if(o&&!o.toLowerCase().includes("base64,"))throw new Error("addMedia() error: `data` value lacks a base64 header! Ex: 'video/mpeg;base64,NMP[...]')");if(!d.toLowerCase().includes("base64,"))throw new Error("addMedia() error: `cover` value lacks a base64 header! Ex: 'data:image/png;base64,iV[...]')");if(s==="online"&&!l)throw new Error("addMedia() error: online videos require `link` value");if(u=r.extn||(o?o.split(";")[0].split("/")[1]:c.split(".").pop())||"mp3",f.mtype=s,f.media=c||"preencoded.mov",f.options={},f.options.x=t,f.options.y=n,f.options.w=i,f.options.h=a,f.options.objectName=A,s==="online"){let p=Vr(e);e._relsMedia.push({path:c||"preencoded"+u,data:"dummy",type:"online",extn:u,rId:p,Target:l}),f.mediaRid=p,e._relsMedia.push({path:"preencoded.png",data:d,type:"image/png",extn:"png",rId:Vr(e),Target:`../media/image-${e._slideNum}-${e._relsMedia.length+1}.png`})}else{let p=e._relsMedia.filter(y=>y.path&&y.path===c&&y.type===s+"/"+u&&!y.isDuplicate)[0],g=Vr(e);e._relsMedia.push({path:c||"preencoded"+u,type:s+"/"+u,extn:u,data:o||"",rId:g,isDuplicate:!!p?.Target,Target:p?.Target?p.Target:`../media/media-${e._slideNum}-${e._relsMedia.length+1}.${u}`}),f.mediaRid=g,e._relsMedia.push({path:c||"preencoded"+u,type:s+"/"+u,extn:u,data:o||"",rId:Vr(e),isDuplicate:!!p?.Target,Target:p?.Target?p.Target:`../media/media-${e._slideNum}-${e._relsMedia.length+0}.${u}`}),e._relsMedia.push({path:"preencoded.png",type:"image/png",extn:"png",data:d,rId:Vr(e),Target:`../media/image-${e._slideNum}-${e._relsMedia.length+1}.png`})}e._slideObjects.push(f)}function h0(e,r){e._slideObjects.push({_type:He.notes,text:[{text:r}]})}function $s(e,r,t){let n=typeof t=="object"?t:{};n.line=n.line||{type:"none"};let i={_type:He.text,shape:r||xn.RECTANGLE,options:n,text:null};if(!r)throw new Error("Missing/Invalid shape parameter! Example: `addShape(pptxgen.shapes.LINE, {x:1, y:1, w:1, h:1});`");let a={type:n.line.type||"solid",color:n.line.color||Wd,transparency:n.line.transparency||0,width:n.line.width||1,dashType:n.line.dashType||"solid",beginArrowType:n.line.beginArrowType||null,endArrowType:n.line.endArrowType||null};if(typeof n.line=="object"&&n.line.type!=="none"&&(n.line=a),n.x=n.x||(n.x===0?0:1),n.y=n.y||(n.y===0?0:1),n.w=n.w||(n.w===0?0:1),n.h=n.h||(n.h===0?0:1),n.objectName=n.objectName?Ve(n.objectName):`Shape ${e._slideObjects.filter(o=>o._type===He.text).length}`,typeof n.line=="string"){let o=a;o.color=String(n.line),n.line=o}typeof n.lineSize=="number"&&(n.line.width=n.lineSize),typeof n.lineDash=="string"&&(n.line.dashType=n.lineDash),typeof n.lineHead=="string"&&(n.line.beginArrowType=n.lineHead),typeof n.lineTail=="string"&&(n.line.endArrowType=n.lineTail),hi(e,i),e._slideObjects.push(i)}function p0(e,r,t,n,i,a,o){let l=[e],c=t&&typeof t=="object"?t:{};c.objectName=c.objectName?Ve(c.objectName):`Table ${e._slideObjects.filter(A=>A._type===He.table).length}`;{if(r===null||r.length===0||!Array.isArray(r))throw new Error("addTable: Array expected! EX: 'slide.addTable( [rows], {options} );' (https://gitbrent.github.io/PptxGenJS/docs/api-tables.html)");if(!r[0]||!Array.isArray(r[0]))throw new Error("addTable: 'rows' should be an array of cells! EX: 'slide.addTable( [ ['A'], ['B'], {text:'C',options:{align:'center'}} ] );' (https://gitbrent.github.io/PptxGenJS/docs/api-tables.html)")}let s=[];r.forEach(A=>{let f=[];Array.isArray(A)?A.forEach(p=>{let g={_type:He.tablecell,text:"",options:typeof p=="object"&&p.options?p.options:{}};typeof p=="string"||typeof p=="number"?g.text=p.toString():p.text&&(typeof p.text=="string"||typeof p.text=="number"?g.text=p.text.toString():p.text&&(g.text=p.text),p.options&&typeof p.options=="object"&&(g.options=p.options)),g.options.border=g.options.border||c.border||[{type:"none"},{type:"none"},{type:"none"},{type:"none"}];let y=g.options.border;!Array.isArray(y)&&typeof y=="object"&&(g.options.border=[y,y,y,y]),g.options.border[0]||(g.options.border[0]={type:"none"}),g.options.border[1]||(g.options.border[1]={type:"none"}),g.options.border[2]||(g.options.border[2]={type:"none"}),g.options.border[3]||(g.options.border[3]={type:"none"}),[0,1,2,3].forEach(b=>{g.options.border[b]={type:g.options.border[b].type||ti.type,color:g.options.border[b].color||ti.color,pt:typeof g.options.border[b].pt=="number"?g.options.border[b].pt:ti.pt}}),f.push(g)}):(console.log("addTable: tableRows has a bad row. A row should be an array of cells. You provided:"),console.log(A)),s.push(f)}),c.x=nt(c.x||(c.x===0?0:Ke/2),"X",i),c.y=nt(c.y||(c.y===0?0:Ke/2),"Y",i),c.h&&(c.h=nt(c.h,"Y",i)),c.fontSize=c.fontSize||yr,c.margin=c.margin===0||c.margin?c.margin:Ud,typeof c.margin=="number"&&(c.margin=[Number(c.margin),Number(c.margin),Number(c.margin),Number(c.margin)]),JSON.stringify({arrRows:s}).indexOf("hyperlink")===-1&&(c.color||(c.color=c.color||nr)),typeof c.border=="string"?(console.warn("addTable `border` option must be an object. Ex: `{border: {type:'none'}}`"),c.border=null):Array.isArray(c.border)&&[0,1,2,3].forEach(A=>{c.border[A]=c.border[A]?{type:c.border[A].type||ti.type,color:c.border[A].color||ti.color,pt:c.border[A].pt||ti.pt}:{type:"none"}}),c.autoPage=typeof c.autoPage=="boolean"?c.autoPage:!1,c.autoPageRepeatHeader=typeof c.autoPageRepeatHeader=="boolean"?c.autoPageRepeatHeader:!1,c.autoPageHeaderRows=typeof c.autoPageHeaderRows<"u"&&!isNaN(Number(c.autoPageHeaderRows))?Number(c.autoPageHeaderRows):1,c.autoPageLineWeight=typeof c.autoPageLineWeight<"u"&&!isNaN(Number(c.autoPageLineWeight))?Number(c.autoPageLineWeight):0,c.autoPageLineWeight&&(c.autoPageLineWeight>1?c.autoPageLineWeight=1:c.autoPageLineWeight<-1&&(c.autoPageLineWeight=-1));let u=na;if(n&&typeof n._margin<"u"&&(Array.isArray(n._margin)?u=n._margin:isNaN(Number(n._margin))||(u=[Number(n._margin),Number(n._margin),Number(n._margin),Number(n._margin)])),c.colW){let A=s[0].reduce((f,p)=>{var g;return!((g=p?.options)===null||g===void 0)&&g.colspan&&typeof p.options.colspan=="number"?f+=p.options.colspan:f+=1,f},0);typeof c.colW=="string"||typeof c.colW=="number"||c.colW&&Array.isArray(c.colW)&&c.colW.length===1&&A>1?(c.w=Math.floor(Number(c.colW)*A),c.colW=null):c.colW&&Array.isArray(c.colW)&&c.colW.length!==A&&(console.warn("addTable: mismatch: (colW.length != data.length) Therefore, defaulting to evenly distributed col widths."),c.colW=null)}else c.w?c.w=nt(c.w,"X",i):c.w=Math.floor(i._sizeW/Ke-u[1]-u[3]);c.x&&c.x<20&&(c.x=lt(c.x)),c.y&&c.y<20&&(c.y=lt(c.y)),c.w&&typeof c.w=="number"&&c.w<20&&(c.w=lt(c.w)),c.h&&typeof c.h=="number"&&c.h<20&&(c.h=lt(c.h)),s.forEach(A=>{A.forEach((f,p)=>{typeof f=="number"||typeof f=="string"?A[p]={_type:He.tablecell,text:String(A[p]),options:c}:typeof f=="object"&&(typeof f.text=="number"?A[p].text=A[p].text.toString():(typeof f.text>"u"||f.text===null)&&(A[p].text=""),A[p].options=f.options||{},A[p]._type=He.tablecell)})});let d=[];return c&&!c.autoPage?(hi(e,s),e._slideObjects.push({_type:He.table,arrTabRows:s,options:Object.assign({},c)})):(c.autoPageRepeatHeader&&(c._arrObjTabHeadRows=s.filter((A,f)=>f{o(e._slideNum+f)||l.push(a({masterName:n?._name||null})),f>0&&(c.y=lt(c.autoPageSlideStartY||c.newSlideStartY||u[0]));{let p=o(e._slideNum+f);c.autoPage=!1,hi(p,A.rows),p.addTable(A.rows,Object.assign({},c)),f>0&&d.push(p)}})),d}function bo(e,r,t,n){let i={_type:n?He.placeholder:He.text,shape:t?.shape||xn.RECTANGLE,text:!r||r.length===0?[{text:"",options:null}]:r,options:t||{}};function a(o){{if(o.placeholder||(o.color=o.color||i.options.color||e.color||nr),(o.placeholder||n)&&(o.bullet=o.bullet||!1),o.placeholder&&e._slideLayout&&e._slideLayout._slideObjects){let l=e._slideLayout._slideObjects.filter(c=>c._type==="placeholder"&&c.options&&c.options.placeholder&&c.options.placeholder===o.placeholder)[0];l?.options&&(o=Object.assign(Object.assign({},o),l.options))}if(o.objectName=o.objectName?Ve(o.objectName):`Text ${e._slideObjects.filter(l=>l._type===He.text).length}`,o.shape===xn.LINE){let l={type:o.line.type||"solid",color:o.line.color||Wd,transparency:o.line.transparency||0,width:o.line.width||1,dashType:o.line.dashType||"solid",beginArrowType:o.line.beginArrowType||null,endArrowType:o.line.endArrowType||null};if(typeof o.line=="object"&&(o.line=l),typeof o.line=="string"){let c=l;typeof o.line=="string"&&(c.color=o.line),o.line=c}typeof o.lineSize=="number"&&(o.line.width=o.lineSize),typeof o.lineDash=="string"&&(o.line.dashType=o.lineDash),typeof o.lineHead=="string"&&(o.line.beginArrowType=o.lineHead),typeof o.lineTail=="string"&&(o.line.endArrowType=o.lineTail)}o.line=o.line||{},o.lineSpacing=o.lineSpacing&&!isNaN(o.lineSpacing)?o.lineSpacing:null,o.lineSpacingMultiple=o.lineSpacingMultiple&&!isNaN(o.lineSpacingMultiple)?o.lineSpacingMultiple:null,o._bodyProp=o._bodyProp||{},o._bodyProp.autoFit=o.autoFit||!1,o._bodyProp.anchor=o.placeholder?null:si.ctr,o._bodyProp.vert=o.vert||null,o._bodyProp.wrap=typeof o.wrap=="boolean"?o.wrap:!0,(o.inset&&!isNaN(Number(o.inset))||o.inset===0)&&(o._bodyProp.lIns=lt(o.inset),o._bodyProp.rIns=lt(o.inset),o._bodyProp.tIns=lt(o.inset),o._bodyProp.bIns=lt(o.inset)),typeof o.underline=="boolean"&&o.underline===!0&&(o.underline={style:"sng"})}return(o.align||"").toLowerCase().indexOf("c")===0?o._bodyProp.align=oi.center:(o.align||"").toLowerCase().indexOf("l")===0?o._bodyProp.align=oi.left:(o.align||"").toLowerCase().indexOf("r")===0?o._bodyProp.align=oi.right:(o.align||"").toLowerCase().indexOf("j")===0&&(o._bodyProp.align=oi.justify),(o.valign||"").toLowerCase().indexOf("b")===0?o._bodyProp.anchor=si.b:(o.valign||"").toLowerCase().indexOf("m")===0?o._bodyProp.anchor=si.ctr:(o.valign||"").toLowerCase().indexOf("t")===0&&(o._bodyProp.anchor=si.t),Cl(o.shadow),o}i.options=a(i.options),i.text.forEach(o=>o.options=a(o.options||{})),hi(e,i.text||""),e._slideObjects.push(i)}function A0(e){(e._slideLayout._slideObjects||[]).forEach(r=>{r._type===He.placeholder&&e._slideObjects.filter(t=>t.options&&t.options.placeholder===r.options.placeholder).length===0&&bo(e,[{text:""}],r.options,!1)})}function Hd(e,r){var t;if(r.bkgd&&(r.background||(r.background={}),typeof r.bkgd=="string"?r.background.color=r.bkgd:(r.bkgd.data&&(r.background.data=r.bkgd.data),r.bkgd.path&&(r.background.path=r.bkgd.path),r.bkgd.src&&(r.background.path=r.bkgd.src))),!((t=r.background)===null||t===void 0)&&t.fill&&(r.background.color=r.background.fill),e&&(e.path||e.data)){e.path=e.path||"preencoded.png";let n=(e.path.split(".").pop()||"png").split("?")[0];n==="jpg"&&(n="jpeg"),r._relsMedia=r._relsMedia||[];let i=r._relsMedia.length+1;r._relsMedia.push({path:e.path,type:He.image,extn:n,data:e.data||null,rId:i,Target:`../media/${(r._name||"").replace(/\s+/gi,"-")}-image-${r._relsMedia.length+1}.${n}`}),r._bkgdImgRid=i}}function hi(e,r,t){let n=[];typeof r=="string"||typeof r=="number"||(Array.isArray(r)?n=r:typeof r=="object"&&(n=[r]),n.forEach((i,a)=>{if(t&&t[a]&&t[a].hyperlink&&(i.options=Object.assign(Object.assign({},i.options),t[a])),Array.isArray(i)){let o=[];i.forEach(l=>{l.options&&!l.text.options&&o.push(l.options)}),hi(e,i,o)}else if(Array.isArray(i.text))hi(e,i.text,t&&t[a]?[t[a]]:void 0);else if(i&&typeof i=="object"&&i.options&&i.options.hyperlink&&!i.options.hyperlink._rId)if(typeof i.options.hyperlink!="object")console.log("ERROR: text `hyperlink` option should be an object. Ex: `hyperlink: {url:'https://github.com'}` ");else if(!i.options.hyperlink.url&&!i.options.hyperlink.slide)console.log("ERROR: 'hyperlink requires either: `url` or `slide`'");else{let o=Vr(e);e._rels.push({type:He.hyperlink,data:i.options.hyperlink.slide?"slide":"dummy",rId:o,Target:Ve(i.options.hyperlink.url)||i.options.hyperlink.slide.toString()}),i.options.hyperlink._rId=o}else i&&typeof i=="object"&&i.options&&i.options.hyperlink&&i.options.hyperlink._rId&&e._rels.filter(o=>o.rId===i.options.hyperlink._rId).length===0&&e._rels.push({type:He.hyperlink,data:i.options.hyperlink.slide?"slide":"dummy",rId:i.options.hyperlink._rId,Target:Ve(i.options.hyperlink.url)||i.options.hyperlink.slide.toString()})}))}var g0=class{constructor(e){var r;this.addSlide=e.addSlide,this.getSlide=e.getSlide,this._name=`Slide ${e.slideNumber}`,this._presLayout=e.presLayout,this._rId=e.slideRId,this._rels=[],this._relsChart=[],this._relsMedia=[],this._setSlideNum=e.setSlideNum,this._slideId=e.slideId,this._slideLayout=e.slideLayout||null,this._slideNum=e.slideNumber,this._slideObjects=[],this._slideNumberProps=!((r=this._slideLayout)===null||r===void 0)&&r._slideNumberProps?this._slideLayout._slideNumberProps:null}set bkgd(e){this._bkgd=e,(!this._background||!this._background.color)&&(this._background||(this._background={}),typeof e=="string"&&(this._background.color=e))}get bkgd(){return this._bkgd}set background(e){this._background=e,e&&Hd(e,this)}get background(){return this._background}set color(e){this._color=e}get color(){return this._color}set hidden(e){this._hidden=e}get hidden(){return this._hidden}set slideNumber(e){this._slideNumberProps=e,this._setSlideNum(e)}get slideNumber(){return this._slideNumberProps}get newAutoPagedSlides(){return this._newAutoPagedSlides}addChart(e,r,t){let n=t||{};return n._type=e,Vd(this,e,r,t),this}addImage(e){return Xd(this,e),this}addMedia(e){return f0(this,e),this}addNotes(e){return h0(this,e),this}addShape(e,r){return $s(this,e,r),this}addTable(e,r){return this._newAutoPagedSlides=p0(this,e,r,this._slideLayout,this._presLayout,this.addSlide,this.getSlide),this}addText(e,r){return bo(this,typeof e=="string"||typeof e=="number"?[{text:e,options:r}]:e,r,!1),this}};function m0(e,r){return sr(this,void 0,void 0,function*(){let t=e.data;return yield new Promise((n,i)=>{var a,o;let l=new _d.default,c=(t.length-1)*2+1,s=((o=(a=t[0])===null||a===void 0?void 0:a.labels)===null||o===void 0?void 0:o.length)>1;l.folder("_rels"),l.folder("docProps"),l.folder("xl/_rels"),l.folder("xl/tables"),l.folder("xl/theme"),l.folder("xl/worksheets"),l.folder("xl/worksheets/_rels"),l.file("[Content_Types].xml",` `),l.file("_rels/.rels",` `),l.file("docProps/app.xml",`Microsoft Macintosh Excel0falseWorksheets1Sheet1falsefalsefalse16.0300 `),l.file("docProps/core.xml",'PptxGenJSPptxGenJS'+new Date().toISOString()+''+new Date().toISOString()+""),l.file("xl/_rels/workbook.xml.rels",''),l.file("xl/styles.xml",` @@ -172,7 +212,7 @@ end`},au=function(){for(var e=[],r=0;r `);{let u='';if(e.opts._type===Ce.BUBBLE||e.opts._type===Ce.BUBBLE3D)u+=``;else if(e.opts._type===Ce.SCATTER)u+=``;else if(s){let d=t.length;t[0].labels.forEach(A=>d+=A.filter(f=>f&&f!=="").length),u+=``,u+=""}else{let d=t.length+t[0].labels.length*t[0].labels[0].length+t[0].labels.length,A=t.length+t[0].labels.length*t[0].labels[0].length+1;u+=``,u+=''}e.opts._type===Ce.BUBBLE||e.opts._type===Ce.BUBBLE3D?t.forEach((d,A)=>{A===0?u+="X-Axis":(u+=`${Ve(d.name||`Y-Axis${A}`)}`,u+=`${Ve(`Size${A}`)}`)}):t.forEach(d=>{u+=`${Ve((d.name||" ").replace("X-Axis","X-Values"))}`}),e.opts._type!==Ce.BUBBLE&&e.opts._type!==Ce.BUBBLE3D&&e.opts._type!==Ce.SCATTER&&t[0].labels.slice().reverse().forEach(d=>{d.filter(A=>A&&A!=="").forEach(A=>{u+=`${Ve(A)}`})}),u+=` `,l.file("xl/sharedStrings.xml",u)}{let u='';if(e.opts._type===Ce.BUBBLE||e.opts._type===Ce.BUBBLE3D){u+=``,u+=``;let d=1;t.forEach((A,f)=>{f===0?u+=``:(u+=``,d++,u+=``)})}else e.opts._type===Ce.SCATTER?(u+=`
            `,u+=``,t.forEach((d,A)=>{u+=``})):(u+=`
            `,u+=``,t[0].labels.forEach((d,A)=>{u+=``}),t.forEach((d,A)=>{u+=``}));u+="",u+='',u+="
            ",l.file("xl/tables/table1.xml",u)}{let u='';if(u+='',e.opts._type===Ce.BUBBLE||e.opts._type===Ce.BUBBLE3D?u+=``:e.opts._type===Ce.SCATTER?u+=``:u+=``,u+='',u+='',e.opts._type===Ce.BUBBLE||e.opts._type===Ce.BUBBLE3D){u+="",u+=``,u+='0';for(let d=1;d${d}`;u+="",t[0].values.forEach((d,A)=>{u+=``,u+=`${d}`;let f=2;for(let p=1;p${t[p].values[A]||""}`,f++,u+=`${t[p].sizes[A]||""}`,f++;u+=""})}else if(e.opts._type===Ce.SCATTER){u+="",u+=``;for(let d=0;d${d}`;u+="",t[0].values.forEach((d,A)=>{u+=``,u+=`${d}`;for(let f=1;f${t[f].values[A]||t[f].values[A]===0?t[f].values[A]:""}`;u+=""})}else if(u+="",s){u+=``;for(let p=0;p0`;for(let p=t[0].labels.length-1;p${p}`;u+="";let d=t.length,A=t[0].labels[0].length,f=t[0].labels.length;for(let p=0;p`;let g=d,y=t[0].labels.slice().reverse();y.forEach((v,b)=>{if(v[p]){let P=b===0?1:y[b-1].filter(F=>F&&F!=="").length;g+=P,u+=`${g}`}});for(let v=0;v${t[v].values[p]||0}`;u+=""}}else{u+=``,t[0].labels.forEach((d,A)=>{u+=`0`});for(let d=0;d${d+1}`;u+="",t[0].labels[0].forEach((d,A)=>{u+=``;for(let f=t[0].labels.length-1;f>=0;f--)u+=``,u+=`${t.length+A+1}`,u+="";for(let f=0;f${t[f].values[A]||""}`;u+=""})}u+="",u+='',u+=` -`,l.file("xl/worksheets/sheet1.xml",u)}l.generateAsync({type:"base64"}).then(u=>{r.file(`ppt/embeddings/Microsoft_Excel_Worksheet${e.globalId}.xlsx`,u,{base64:!0}),r.file("ppt/charts/_rels/"+e.fileName+".rels",``),r.file(`ppt/charts/${e.fileName}`,h0(e)),n("")}).catch(u=>{i(u)})})})}function h0(e){var r,t,n,i;let a='',o=!1;if(a+='',a+='',a+=``,a+="",e.opts.showTitle?(a+=Mo({title:e.opts.title||"Chart Title",color:e.opts.titleColor,fontFace:e.opts.titleFontFace,fontSize:e.opts.titleFontSize||Jv,titleAlign:e.opts.titleAlign,titleBold:e.opts.titleBold,titlePos:e.opts.titlePos,titleRotate:e.opts.titleRotate},e.opts.x,e.opts.y),a+=''):a+='',e.opts._type===Ce.BAR3D&&(a+=``),a+="",e.opts.layout?(a+="",a+=" ",a+=' ',a+=' ',a+=' ',a+=' ',a+=' ',a+=' ',a+=' ',a+=" ",a+=""):a+="",Array.isArray(e.opts._type)?e.opts._type.forEach(l=>{let c=Object.assign(Object.assign({},e.opts),l.options),s=c.secondaryValAxis?eo:qr,u=c.secondaryCatAxis?Xs:Gi;o=o||c.secondaryValAxis,a+=xu(l.type,l.data,c,s,u)}):a+=xu(e.opts._type,e.data,e.opts,qr,Gi),e.opts._type!==Ce.PIE&&e.opts._type!==Ce.DOUGHNUT){if(e.opts.valAxes&&e.opts.valAxes.length>1&&!o)throw new Error("Secondary axis must be used by one of the multiple charts");if(e.opts.catAxes){if(!e.opts.valAxes||e.opts.valAxes.length!==e.opts.catAxes.length)throw new Error("There must be the same number of value and category axes.");a+=Ds(Object.assign(Object.assign({},e.opts),e.opts.catAxes[0]),Gi,qr)}else a+=Ds(e.opts,Gi,qr);e.opts.valAxes?(a+=Es(Object.assign(Object.assign({},e.opts),e.opts.valAxes[0]),qr),e.opts.valAxes[1]&&(a+=Es(Object.assign(Object.assign({},e.opts),e.opts.valAxes[1]),eo))):(a+=Es(e.opts,qr),e.opts._type===Ce.BAR3D&&(a+=p0(e.opts,Gd,qr))),!((r=e.opts)===null||r===void 0)&&r.catAxes&&(!((t=e.opts)===null||t===void 0)&&t.catAxes[1])&&(a+=Ds(Object.assign(Object.assign({},e.opts),e.opts.catAxes[1]),Xs,eo))}return e.opts.showDataTable&&(a+="",a+=` `,a+=` `,a+=` `,a+=` `,a+=" ",a+=" ",a+=' ',a+=" ",a+=" ",a+=" ",a+=' ',a+=" ",a+=" ",a+=' ',a+=` `,a+=' ',a+=' ',a+=' ',a+=' ',a+=" ",a+=" ",a+=' ',a+=" ",a+=" ",a+=""),a+=" ",a+=!((n=e.opts.plotArea.fill)===null||n===void 0)&&n.color?lr(e.opts.plotArea.fill):"",a+=e.opts.plotArea.border?`${lr(e.opts.plotArea.border.color)}`:"",a+=" ",a+=" ",a+="",e.opts.showLegend&&(a+="",a+='',a+='',(e.opts.legendFontFace||e.opts.legendFontSize||e.opts.legendColor)&&(a+="",a+=" ",a+=" ",a+=" ",a+=" ",a+=e.opts.legendFontSize?``:"",e.opts.legendColor&&(a+=lr(e.opts.legendColor)),e.opts.legendFontFace&&(a+=''),e.opts.legendFontFace&&(a+=''),a+=" ",a+=" ",a+=' ',a+=" ",a+=""),a+=""),a+=' ',a+=' ',e.opts._type===Ce.SCATTER&&(a+=''),a+="",a+="",a+=!((i=e.opts.chartArea.fill)===null||i===void 0)&&i.color?lr(e.opts.chartArea.fill):"",a+=e.opts.chartArea.border?`${lr(e.opts.chartArea.border.color)}`:"",a+=" ",a+="",a+='',a+="",a}function xu(e,r,t,n,i,a){let o=-1,l=1,c=null,s="";switch(e){case Ce.AREA:case Ce.BAR:case Ce.BAR3D:case Ce.LINE:case Ce.RADAR:s+=``,e===Ce.AREA&&t.barGrouping==="stacked"&&(s+=''),(e===Ce.BAR||e===Ce.BAR3D)&&(s+='',s+=''),e===Ce.RADAR&&(s+=''),s+='',r.forEach(u=>{var d;o++,s+="",s+=` `,s+=" ",s+=" ",s+=" Sheet1!$"+yt(u._dataIndex+u.labels.length+1)+"$1",s+=' '+Ve(u.name)+"",s+=" ",s+=" ";let A=t.chartColors?t.chartColors[o%t.chartColors.length]:null;s+=" ",A==="transparent"?s+="":t.chartColorsOpacity?s+=""+ft(A,``)+"":s+=""+ft(A)+"",e===Ce.LINE||e===Ce.RADAR?t.lineSize===0?s+="":(s+=`${ft(A)}`,s+=''):t.dataBorder&&(s+=`${ft(t.dataBorder.color)}`),s+=Mn(t.shadow,zn),s+=" ",s+=' ',e!==Ce.RADAR&&(s+="",s+=``,t.dataLabelBkgrdColors&&(s+=`${ft(A)}`),s+="",s+=``,s+=`${ft(t.dataLabelColor||nr)}`,s+=``,s+="",t.dataLabelPosition&&(s+=``),s+='',s+=``,s+=``,s+=``,s+=""),(e===Ce.LINE||e===Ce.RADAR)&&(s+="",s+=' ',t.lineDataSymbolSize&&(s+=``),s+=" ",s+=` ${ft(t.chartColors[u._dataIndex+1>t.chartColors.length?Math.floor(Math.random()*t.chartColors.length):u._dataIndex])}`,s+=` ${ft(t.lineDataSymbolLineColor||A)}`,s+=" ",s+=" ",s+=""),(e===Ce.BAR||e===Ce.BAR3D)&&r.length===1&&(t.chartColors&&t.chartColors!==ji&&t.chartColors.length>1||!((d=t.invertedColors)===null||d===void 0)&&d.length)&&u.values.forEach((f,p)=>{let g=f<0?t.invertedColors||t.chartColors||ji:t.chartColors||[];s+=" ",s+=` `,s+=' ',s+=' ',s+=" ",t.lineSize===0?s+="":e===Ce.BAR?(s+="",s+=' ',s+=""):(s+="",s+=" ",s+=' ',s+=" ",s+=""),s+=Mn(t.shadow,zn),s+=" ",s+=" "}),s+="",t.catLabelFormatCode?(s+=" ",s+=` Sheet1!$A$2:$A$${u.labels[0].length+1}`,s+=" ",s+=" "+(t.catLabelFormatCode||"General")+"",s+=` `,u.labels[0].forEach((f,p)=>s+=`${Ve(f)}`),s+=" ",s+=" "):(s+=" ",s+=` Sheet1!$A$2:$${yt(u.labels.length)}$${u.labels[0].length+1}`,s+=" ",s+=` `,u.labels.forEach(f=>{s+="",f.forEach((p,g)=>s+=`${Ve(p)}`),s+=""}),s+=" ",s+=" "),s+="",s+="",s+=" ",s+=`Sheet1!$${yt(u._dataIndex+u.labels.length+1)}$2:$${yt(u._dataIndex+u.labels.length+1)}$${u.labels[0].length+1}`,s+=" ",s+=" "+(t.valLabelFormatCode||t.dataTableFormatCode||"General")+"",s+=` `,u.values.forEach((f,p)=>s+=`${f||f===0?f:""}`),s+=" ",s+=" ",s+="",e===Ce.LINE&&(s+=''),s+=""}),s+=" ",s+=` `,s+=" ",s+=" ",s+=" ",s+=" ",s+=` `,s+=" "+ft(t.dataLabelColor||nr)+"",s+=' ',s+=" ",s+=" ",s+=" ",t.dataLabelPosition&&(s+=' '),s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=` `,s+=" ",e===Ce.BAR?(s+=` `,s+=` `):e===Ce.BAR3D?(s+=` `,s+=` `,s+=' '):e===Ce.LINE&&(s+=' '),s+=``,s+=``;break;case Ce.SCATTER:s+="",s+='',s+='',o=-1,r.filter((u,d)=>d>0).forEach((u,d)=>{o++,s+="",s+=` `,s+=` `,s+=" ",s+=" ",s+=` Sheet1!$${yt(d+2)}$1`,s+=' '+Ve(u.name)+"",s+=" ",s+=" ",s+=" ";{let A=t.chartColors[o%t.chartColors.length];A==="transparent"?s+="":t.chartColorsOpacity?s+=""+ft(A,'')+"":s+=""+ft(A)+"",t.lineSize===0?s+="":(s+=`${ft(A)}`,s+=``),s+=Mn(t.shadow,zn)}if(s+=" ",s+="",s+=' ',t.lineDataSymbolSize&&(s+=``),s+="",s+=`${ft(t.chartColors[d+1>t.chartColors.length?Math.floor(Math.random()*t.chartColors.length):d])}`,s+=`${ft(t.lineDataSymbolLineColor||t.chartColors[o%t.chartColors.length])}`,s+="",s+="",s+="",t.showLabel){let A=to("-xxxx-xxxx-xxxx-xxxxxxxxxxxx");u.labels[0]&&(t.dataLabelFormatScatter==="custom"||t.dataLabelFormatScatter==="customXY")&&(s+="",u.labels[0].forEach((f,p)=>{(t.dataLabelFormatScatter==="custom"||t.dataLabelFormatScatter==="customXY")&&(s+=" ",s+=` `,s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=' ',s+=" "+Ve(f)+"",s+=" ",t.dataLabelFormatScatter==="customXY"&&!/^ *$/.test(f)&&(s+=" ",s+=' ',s+=" (",s+=" ",s+=' ',s+=' ',s+=" ",s+=" ",s+=" ",s+=" ["+Ve(u.name)+"",s+=" ",s+=" ",s+=' ',s+=" , ",s+=" ",s+=' ',s+=' ',s+=" ",s+=" ",s+=" ",s+=" ["+Ve(u.name)+"]",s+=" ",s+=" ",s+=' ',s+=" )",s+=" ",s+=' '),s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",t.dataLabelPosition&&(s+=' '),s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=" ",s+=' ',s+=' ',s+=` `,s+=" ",s+=" ",s+="")}),s+=""),t.dataLabelFormatScatter==="XY"&&(s+="",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=' ',s+=" ",s+=" ",t.dataLabelPosition&&(s+=' '),s+=' ',s+=` `,s+=` `,s+=` `,s+=' ',s+=' ',s+=" ",s+=' ',s+=' ',s+=" ",s+=" ",s+="")}r.length===1&&t.chartColors!==ji&&u.values.forEach((A,f)=>{let p=A<0?t.invertedColors||t.chartColors||ji:t.chartColors||[];s+=" ",s+=` `,s+=' ',s+=' ',s+=" ",t.lineSize===0?s+="":(s+="",s+=' ',s+=""),s+=Mn(t.shadow,zn),s+=" ",s+=" "}),s+="",s+=" ",s+=` Sheet1!$A$2:$A$${r[0].values.length+1}`,s+=" ",s+=" General",s+=` `,r[0].values.forEach((A,f)=>{s+=`${A||A===0?A:""}`}),s+=" ",s+=" ",s+="",s+="",s+=" ",s+=` Sheet1!$${yt(d+2)}$2:$${yt(d+2)}$${r[0].values.length+1}`,s+=" ",s+=" General",s+=` `,r[0].values.forEach((A,f)=>{s+=`${u.values[f]||u.values[f]===0?u.values[f]:""}`}),s+=" ",s+=" ",s+="",s+='',s+=""}),s+=" ",s+=` `,s+=" ",s+=" ",s+=" ",s+=" ",s+=` `,s+=" "+ft(t.dataLabelColor||nr)+"",s+=' ',s+=" ",s+=" ",s+=" ",t.dataLabelPosition&&(s+=' '),s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=" ",s+=``,s+="";break;case Ce.BUBBLE:case Ce.BUBBLE3D:s+="",s+='',o=-1,r.filter((u,d)=>d>0).forEach((u,d)=>{o++,s+="",s+=` `,s+=` `,s+=" ",s+=" ",s+=" Sheet1!$"+yt(l+1)+"$1",s+=' '+Ve(u.name)+"",s+=" ",s+=" ";{s+="";let A=t.chartColors[o%t.chartColors.length];A==="transparent"?s+="":t.chartColorsOpacity?s+=`${ft(A,'')}`:s+=""+ft(A)+"",t.lineSize===0?s+="":t.dataBorder?s+=`${ft(t.dataBorder.color)}`:(s+=`${ft(A)}`,s+=``),s+=Mn(t.shadow,zn),s+=""}s+="",s+=" ",s+=` Sheet1!$A$2:$A$${r[0].values.length+1}`,s+=" ",s+=" General",s+=` `,r[0].values.forEach((A,f)=>{s+=`${A||A===0?A:""}`}),s+=" ",s+=" ",s+="",s+="",s+=" ",s+=`Sheet1!$${yt(l+1)}$2:$${yt(l+1)}$${r[0].values.length+1}`,l++,s+=" ",s+=" General",s+=` `,r[0].values.forEach((A,f)=>{s+=`${u.values[f]||u.values[f]===0?u.values[f]:""}`}),s+=" ",s+=" ",s+="",s+=" ",s+=" ",s+=`Sheet1!$${yt(l+1)}$2:$${yt(l+1)}$${u.sizes.length+1}`,l++,s+=" ",s+=" General",s+=` `,u.sizes.forEach((A,f)=>{s+=`${A||""}`}),s+=" ",s+=" ",s+=" ",s+=' ',s+=""}),s+="",s+=``,s+="",s+=``,s+=`${ft(t.dataLabelColor||nr)}`,s+=``,s+="",t.dataLabelPosition&&(s+=``),s+='',s+=``,s+=``,s+="",s+=' ',s+=' ',s+=" ",s+="",s+="",s+=``,s+="";break;case Ce.DOUGHNUT:case Ce.PIE:c=r[0],s+="",s+=' ',s+="",s+=' ',s+=' ',s+=" ",s+=" ",s+=" Sheet1!$B$1",s+=" ",s+=' ',s+=' '+Ve(c.name)+"",s+=" ",s+=" ",s+=" ",s+=" ",s+=' ',s+=' ',t.dataNoEffects?s+="":s+=Mn(t.shadow,zn),s+=" ",c.labels[0].forEach((u,d)=>{s+="",s+=` `,s+=' ',s+=" ",s+=`${ft(t.chartColors[d+1>t.chartColors.length?Math.floor(Math.random()*t.chartColors.length):d])}`,t.dataBorder&&(s+=`${ft(t.dataBorder.color)}`),s+=Mn(t.shadow,zn),s+=" ",s+=""}),s+="",c.labels[0].forEach((u,d)=>{s+="",s+=` `,s+=` `,s+=" ",s+=" ",s+=" ",s+=` `,s+=" "+ft(t.dataLabelColor||nr)+"",s+=` `,s+=" ",s+=" ",s+=" ",e===Ce.PIE&&t.dataLabelPosition&&(s+=``),s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=" "}),s+=` `,s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=` `,s+=' ',s+=" ",s+=" ",s+=" ",s+=" ",s+=e===Ce.PIE?'':"",s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=` `,s+="",s+="",s+=" ",s+=` Sheet1!$A$2:$A$${c.labels[0].length+1}`,s+=" ",s+=` `,c.labels[0].forEach((u,d)=>{s+=`${Ve(u)}`}),s+=" ",s+=" ",s+="",s+=" ",s+=" ",s+=` Sheet1!$B$2:$B$${c.labels[0].length+1}`,s+=" ",s+=` `,c.values.forEach((u,d)=>{s+=`${u||u===0?u:""}`}),s+=" ",s+=" ",s+=" ",s+=" ",s+=` `,e===Ce.DOUGHNUT&&(s+=``),s+="";break;default:s+="";break}return s}function Ds(e,r,t){let n="";return e._type===Ce.SCATTER||e._type===Ce.BUBBLE||e._type===Ce.BUBBLE3D?n+="":n+="",n+=' ',n+=" ",n+='',(e.catAxisMaxVal||e.catAxisMaxVal===0)&&(n+=``),(e.catAxisMinVal||e.catAxisMinVal===0)&&(n+=``),n+="",n+=' ',n+=' ',n+=e.catGridLine.style!=="none"?Cl(e.catGridLine):"",e.showCatAxisTitle&&(n+=Mo({color:e.catAxisTitleColor,fontFace:e.catAxisTitleFontFace,fontSize:e.catAxisTitleFontSize,titleRotate:e.catAxisTitleRotate,title:e.catAxisTitle||"Axis Title"})),e._type===Ce.SCATTER||e._type===Ce.BUBBLE||e._type===Ce.BUBBLE3D?n+=' ':n+=' ',e._type===Ce.SCATTER?(n+=' ',n+=' ',n+=' '):(n+=' ',n+=' ',n+=' '),n+=" ",n+=` `,n+=e.catAxisLineShow?""+ft(e.catAxisLineColor||_n.color)+"":"",n+=' ',n+=" ",n+=" ",n+=" ",n+=" ",e.catAxisLabelRotate?n+=``:n+="",n+=" ",n+=" ",n+=" ",n+=` `,n+=" "+ft(e.catAxisLabelColor||nr)+"",n+=' ',n+=" ",n+=" ",n+=' ',n+=" ",n+=" ",n+=' ',n+=` `,n+=' ',n+=' ',n+=` `,e.catAxisLabelFrequency&&(n+=' '),(e.catLabelFormatCode||e._type===Ce.SCATTER||e._type===Ce.BUBBLE||e._type===Ce.BUBBLE3D)&&(e.catLabelFormatCode&&(["catAxisBaseTimeUnit","catAxisMajorTimeUnit","catAxisMinorTimeUnit"].forEach(i=>{e[i]&&(typeof e[i]!="string"||!["days","months","years"].includes(e[i].toLowerCase()))&&(console.warn(`"${i}" must be one of: 'days','months','years' !`),e[i]=null)}),e.catAxisBaseTimeUnit&&(n+=''),e.catAxisMajorTimeUnit&&(n+=''),e.catAxisMinorTimeUnit&&(n+='')),e.catAxisMajorUnit&&(n+=``),e.catAxisMinorUnit&&(n+=``)),e._type===Ce.SCATTER||e._type===Ce.BUBBLE||e._type===Ce.BUBBLE3D?n+="":n+="",n}function Es(e,r){let t=r===qr?e.barDir==="col"?"l":"b":e.barDir!=="col"?"r":"t";r===eo&&(t="r");let n=r===qr?Gi:Xs,i="";return i+="",i+=' ',i+=" ",e.valAxisLogScaleBase&&(i+=``),i+='',(e.valAxisMaxVal||e.valAxisMaxVal===0)&&(i+=``),(e.valAxisMinVal||e.valAxisMinVal===0)&&(i+=``),i+=" ",i+=` `,i+=' ',e.valGridLine.style!=="none"&&(i+=Cl(e.valGridLine)),e.showValAxisTitle&&(i+=Mo({color:e.valAxisTitleColor,fontFace:e.valAxisTitleFontFace,fontSize:e.valAxisTitleFontSize,titleRotate:e.valAxisTitleRotate,title:e.valAxisTitle||"Axis Title"})),i+=``,e._type===Ce.SCATTER?(i+=' ',i+=' ',i+=' '):(i+=' ',i+=' ',i+=' '),i+=" ",i+=` `,i+=e.valAxisLineShow?""+ft(e.valAxisLineColor||_n.color)+"":"",i+=' ',i+=" ",i+=" ",i+=" ",i+=" ",i+=` `,i+=" ",i+=" ",i+=" ",i+=` `,i+=" "+ft(e.valAxisLabelColor||nr)+"",i+=' ',i+=" ",i+=" ",i+=' ',i+=" ",i+=" ",i+=' ',typeof e.catAxisCrossesAt=="number"?i+=` `:typeof e.catAxisCrossesAt=="string"?i+=' ':i+=' ',i+=' ',e.valAxisMajorUnit&&(i+=` `),e.valAxisDisplayUnit&&(i+=`${e.valAxisDisplayUnitLabel?"":""}`),i+="",i}function p0(e,r,t){let n="";return n+="",n+=' ',n+=' ',n+=' ',n+=' ',n+=e.serGridLine.style!=="none"?Cl(e.serGridLine):"",e.showSerAxisTitle&&(n+=Mo({color:e.serAxisTitleColor,fontFace:e.serAxisTitleFontFace,fontSize:e.serAxisTitleFontSize,titleRotate:e.serAxisTitleRotate,title:e.serAxisTitle||"Axis Title"})),n+=` `,n+=' ',n+=' ',n+=` `,n+=" ",n+=' ',n+=e.serAxisLineShow?`${ft(e.serAxisLineColor||_n.color)}`:"",n+=' ',n+=" ",n+=" ",n+=" ",n+=" ",n+=" ",n+=" ",n+=" ",n+=" ",n+=` `,n+=` ${ft(e.serAxisLabelColor||nr)}`,n+=` `,n+=" ",n+=" ",n+=' ',n+=" ",n+=" ",n+=' ',n+=' ',e.serAxisLabelFrequency&&(n+=' '),e.serLabelFormatCode&&(["serAxisBaseTimeUnit","serAxisMajorTimeUnit","serAxisMinorTimeUnit"].forEach(i=>{e[i]&&(typeof e[i]!="string"||!["days","months","years"].includes(i.toLowerCase()))&&(console.warn(`"${i}" must be one of: 'days','months','years' !`),e[i]=null)}),e.serAxisBaseTimeUnit&&(n+=` `),e.serAxisMajorTimeUnit&&(n+=` `),e.serAxisMinorTimeUnit&&(n+=` `),e.serAxisMajorUnit&&(n+=` `),e.serAxisMinorUnit&&(n+=` `)),n+="",n}function Mo(e,r,t){let n=e.titleAlign==="left"||e.titleAlign==="right"?``:"",i=e.titleRotate?``:"",a=e.fontSize?`sz="${Math.round(e.fontSize*100)}"`:"",o=e.titleBold?1:0,l="";if(e.titlePos&&typeof e.titlePos.x=="number"&&typeof e.titlePos.y=="number"){let c=e.titlePos.x+r,s=e.titlePos.y+t,u=c===0?0:c*(c/5)/10;u>=1&&(u=u/10),u>=.1&&(u=u/10);let d=s===0?0:s*(s/5)/10;d>=1&&(d=d/10),d>=.1&&(d=d/10),l=``}return` +`,l.file("xl/worksheets/sheet1.xml",u)}l.generateAsync({type:"base64"}).then(u=>{r.file(`ppt/embeddings/Microsoft_Excel_Worksheet${e.globalId}.xlsx`,u,{base64:!0}),r.file("ppt/charts/_rels/"+e.fileName+".rels",``),r.file(`ppt/charts/${e.fileName}`,v0(e)),n("")}).catch(u=>{i(u)})})})}function v0(e){var r,t,n,i;let a='',o=!1;if(a+='',a+='',a+=``,a+="",e.opts.showTitle?(a+=_o({title:e.opts.title||"Chart Title",color:e.opts.titleColor,fontFace:e.opts.titleFontFace,fontSize:e.opts.titleFontSize||n0,titleAlign:e.opts.titleAlign,titleBold:e.opts.titleBold,titlePos:e.opts.titlePos,titleRotate:e.opts.titleRotate},e.opts.x,e.opts.y),a+=''):a+='',e.opts._type===Ce.BAR3D&&(a+=``),a+="",e.opts.layout?(a+="",a+=" ",a+=' ',a+=' ',a+=' ',a+=' ',a+=' ',a+=' ',a+=' ',a+=" ",a+=""):a+="",Array.isArray(e.opts._type)?e.opts._type.forEach(l=>{let c=Object.assign(Object.assign({},e.opts),l.options),s=c.secondaryValAxis?ro:qr,u=c.secondaryCatAxis?Hs:ji;o=o||c.secondaryValAxis,a+=xu(l.type,l.data,c,s,u)}):a+=xu(e.opts._type,e.data,e.opts,qr,ji),e.opts._type!==Ce.PIE&&e.opts._type!==Ce.DOUGHNUT){if(e.opts.valAxes&&e.opts.valAxes.length>1&&!o)throw new Error("Secondary axis must be used by one of the multiple charts");if(e.opts.catAxes){if(!e.opts.valAxes||e.opts.valAxes.length!==e.opts.catAxes.length)throw new Error("There must be the same number of value and category axes.");a+=Es(Object.assign(Object.assign({},e.opts),e.opts.catAxes[0]),ji,qr)}else a+=Es(e.opts,ji,qr);e.opts.valAxes?(a+=Bs(Object.assign(Object.assign({},e.opts),e.opts.valAxes[0]),qr),e.opts.valAxes[1]&&(a+=Bs(Object.assign(Object.assign({},e.opts),e.opts.valAxes[1]),ro))):(a+=Bs(e.opts,qr),e.opts._type===Ce.BAR3D&&(a+=y0(e.opts,Gd,qr))),!((r=e.opts)===null||r===void 0)&&r.catAxes&&(!((t=e.opts)===null||t===void 0)&&t.catAxes[1])&&(a+=Es(Object.assign(Object.assign({},e.opts),e.opts.catAxes[1]),Hs,ro))}return e.opts.showDataTable&&(a+="",a+=` `,a+=` `,a+=` `,a+=` `,a+=" ",a+=" ",a+=' ',a+=" ",a+=" ",a+=" ",a+=' ',a+=" ",a+=" ",a+=' ',a+=` `,a+=' ',a+=' ',a+=' ',a+=' ',a+=" ",a+=" ",a+=' ',a+=" ",a+=" ",a+=""),a+=" ",a+=!((n=e.opts.plotArea.fill)===null||n===void 0)&&n.color?lr(e.opts.plotArea.fill):"",a+=e.opts.plotArea.border?`${lr(e.opts.plotArea.border.color)}`:"",a+=" ",a+=" ",a+="",e.opts.showLegend&&(a+="",a+='',a+='',(e.opts.legendFontFace||e.opts.legendFontSize||e.opts.legendColor)&&(a+="",a+=" ",a+=" ",a+=" ",a+=" ",a+=e.opts.legendFontSize?``:"",e.opts.legendColor&&(a+=lr(e.opts.legendColor)),e.opts.legendFontFace&&(a+=''),e.opts.legendFontFace&&(a+=''),a+=" ",a+=" ",a+=' ',a+=" ",a+=""),a+=""),a+=' ',a+=' ',e.opts._type===Ce.SCATTER&&(a+=''),a+="",a+="",a+=!((i=e.opts.chartArea.fill)===null||i===void 0)&&i.color?lr(e.opts.chartArea.fill):"",a+=e.opts.chartArea.border?`${lr(e.opts.chartArea.border.color)}`:"",a+=" ",a+="",a+='',a+="",a}function xu(e,r,t,n,i,a){let o=-1,l=1,c=null,s="";switch(e){case Ce.AREA:case Ce.BAR:case Ce.BAR3D:case Ce.LINE:case Ce.RADAR:s+=``,e===Ce.AREA&&t.barGrouping==="stacked"&&(s+=''),(e===Ce.BAR||e===Ce.BAR3D)&&(s+='',s+=''),e===Ce.RADAR&&(s+=''),s+='',r.forEach(u=>{var d;o++,s+="",s+=` `,s+=" ",s+=" ",s+=" Sheet1!$"+yt(u._dataIndex+u.labels.length+1)+"$1",s+=' '+Ve(u.name)+"",s+=" ",s+=" ";let A=t.chartColors?t.chartColors[o%t.chartColors.length]:null;s+=" ",A==="transparent"?s+="":t.chartColorsOpacity?s+=""+ft(A,``)+"":s+=""+ft(A)+"",e===Ce.LINE||e===Ce.RADAR?t.lineSize===0?s+="":(s+=`${ft(A)}`,s+=''):t.dataBorder&&(s+=`${ft(t.dataBorder.color)}`),s+=Mn(t.shadow,zn),s+=" ",s+=' ',e!==Ce.RADAR&&(s+="",s+=``,t.dataLabelBkgrdColors&&(s+=`${ft(A)}`),s+="",s+=``,s+=`${ft(t.dataLabelColor||nr)}`,s+=``,s+="",t.dataLabelPosition&&(s+=``),s+='',s+=``,s+=``,s+=``,s+=""),(e===Ce.LINE||e===Ce.RADAR)&&(s+="",s+=' ',t.lineDataSymbolSize&&(s+=``),s+=" ",s+=` ${ft(t.chartColors[u._dataIndex+1>t.chartColors.length?Math.floor(Math.random()*t.chartColors.length):u._dataIndex])}`,s+=` ${ft(t.lineDataSymbolLineColor||A)}`,s+=" ",s+=" ",s+=""),(e===Ce.BAR||e===Ce.BAR3D)&&r.length===1&&(t.chartColors&&t.chartColors!==qi&&t.chartColors.length>1||!((d=t.invertedColors)===null||d===void 0)&&d.length)&&u.values.forEach((f,p)=>{let g=f<0?t.invertedColors||t.chartColors||qi:t.chartColors||[];s+=" ",s+=` `,s+=' ',s+=' ',s+=" ",t.lineSize===0?s+="":e===Ce.BAR?(s+="",s+=' ',s+=""):(s+="",s+=" ",s+=' ',s+=" ",s+=""),s+=Mn(t.shadow,zn),s+=" ",s+=" "}),s+="",t.catLabelFormatCode?(s+=" ",s+=` Sheet1!$A$2:$A$${u.labels[0].length+1}`,s+=" ",s+=" "+(t.catLabelFormatCode||"General")+"",s+=` `,u.labels[0].forEach((f,p)=>s+=`${Ve(f)}`),s+=" ",s+=" "):(s+=" ",s+=` Sheet1!$A$2:$${yt(u.labels.length)}$${u.labels[0].length+1}`,s+=" ",s+=` `,u.labels.forEach(f=>{s+="",f.forEach((p,g)=>s+=`${Ve(p)}`),s+=""}),s+=" ",s+=" "),s+="",s+="",s+=" ",s+=`Sheet1!$${yt(u._dataIndex+u.labels.length+1)}$2:$${yt(u._dataIndex+u.labels.length+1)}$${u.labels[0].length+1}`,s+=" ",s+=" "+(t.valLabelFormatCode||t.dataTableFormatCode||"General")+"",s+=` `,u.values.forEach((f,p)=>s+=`${f||f===0?f:""}`),s+=" ",s+=" ",s+="",e===Ce.LINE&&(s+=''),s+=""}),s+=" ",s+=` `,s+=" ",s+=" ",s+=" ",s+=" ",s+=` `,s+=" "+ft(t.dataLabelColor||nr)+"",s+=' ',s+=" ",s+=" ",s+=" ",t.dataLabelPosition&&(s+=' '),s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=` `,s+=" ",e===Ce.BAR?(s+=` `,s+=` `):e===Ce.BAR3D?(s+=` `,s+=` `,s+=' '):e===Ce.LINE&&(s+=' '),s+=``,s+=``;break;case Ce.SCATTER:s+="",s+='',s+='',o=-1,r.filter((u,d)=>d>0).forEach((u,d)=>{o++,s+="",s+=` `,s+=` `,s+=" ",s+=" ",s+=` Sheet1!$${yt(d+2)}$1`,s+=' '+Ve(u.name)+"",s+=" ",s+=" ",s+=" ";{let A=t.chartColors[o%t.chartColors.length];A==="transparent"?s+="":t.chartColorsOpacity?s+=""+ft(A,'')+"":s+=""+ft(A)+"",t.lineSize===0?s+="":(s+=`${ft(A)}`,s+=``),s+=Mn(t.shadow,zn)}if(s+=" ",s+="",s+=' ',t.lineDataSymbolSize&&(s+=``),s+="",s+=`${ft(t.chartColors[d+1>t.chartColors.length?Math.floor(Math.random()*t.chartColors.length):d])}`,s+=`${ft(t.lineDataSymbolLineColor||t.chartColors[o%t.chartColors.length])}`,s+="",s+="",s+="",t.showLabel){let A=no("-xxxx-xxxx-xxxx-xxxxxxxxxxxx");u.labels[0]&&(t.dataLabelFormatScatter==="custom"||t.dataLabelFormatScatter==="customXY")&&(s+="",u.labels[0].forEach((f,p)=>{(t.dataLabelFormatScatter==="custom"||t.dataLabelFormatScatter==="customXY")&&(s+=" ",s+=` `,s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=' ',s+=" "+Ve(f)+"",s+=" ",t.dataLabelFormatScatter==="customXY"&&!/^ *$/.test(f)&&(s+=" ",s+=' ',s+=" (",s+=" ",s+=' ',s+=' ',s+=" ",s+=" ",s+=" ",s+=" ["+Ve(u.name)+"",s+=" ",s+=" ",s+=' ',s+=" , ",s+=" ",s+=' ',s+=' ',s+=" ",s+=" ",s+=" ",s+=" ["+Ve(u.name)+"]",s+=" ",s+=" ",s+=' ',s+=" )",s+=" ",s+=' '),s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",t.dataLabelPosition&&(s+=' '),s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=" ",s+=' ',s+=' ',s+=` `,s+=" ",s+=" ",s+="")}),s+=""),t.dataLabelFormatScatter==="XY"&&(s+="",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=' ',s+=" ",s+=" ",t.dataLabelPosition&&(s+=' '),s+=' ',s+=` `,s+=` `,s+=` `,s+=' ',s+=' ',s+=" ",s+=' ',s+=' ',s+=" ",s+=" ",s+="")}r.length===1&&t.chartColors!==qi&&u.values.forEach((A,f)=>{let p=A<0?t.invertedColors||t.chartColors||qi:t.chartColors||[];s+=" ",s+=` `,s+=' ',s+=' ',s+=" ",t.lineSize===0?s+="":(s+="",s+=' ',s+=""),s+=Mn(t.shadow,zn),s+=" ",s+=" "}),s+="",s+=" ",s+=` Sheet1!$A$2:$A$${r[0].values.length+1}`,s+=" ",s+=" General",s+=` `,r[0].values.forEach((A,f)=>{s+=`${A||A===0?A:""}`}),s+=" ",s+=" ",s+="",s+="",s+=" ",s+=` Sheet1!$${yt(d+2)}$2:$${yt(d+2)}$${r[0].values.length+1}`,s+=" ",s+=" General",s+=` `,r[0].values.forEach((A,f)=>{s+=`${u.values[f]||u.values[f]===0?u.values[f]:""}`}),s+=" ",s+=" ",s+="",s+='',s+=""}),s+=" ",s+=` `,s+=" ",s+=" ",s+=" ",s+=" ",s+=` `,s+=" "+ft(t.dataLabelColor||nr)+"",s+=' ',s+=" ",s+=" ",s+=" ",t.dataLabelPosition&&(s+=' '),s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=" ",s+=``,s+="";break;case Ce.BUBBLE:case Ce.BUBBLE3D:s+="",s+='',o=-1,r.filter((u,d)=>d>0).forEach((u,d)=>{o++,s+="",s+=` `,s+=` `,s+=" ",s+=" ",s+=" Sheet1!$"+yt(l+1)+"$1",s+=' '+Ve(u.name)+"",s+=" ",s+=" ";{s+="";let A=t.chartColors[o%t.chartColors.length];A==="transparent"?s+="":t.chartColorsOpacity?s+=`${ft(A,'')}`:s+=""+ft(A)+"",t.lineSize===0?s+="":t.dataBorder?s+=`${ft(t.dataBorder.color)}`:(s+=`${ft(A)}`,s+=``),s+=Mn(t.shadow,zn),s+=""}s+="",s+=" ",s+=` Sheet1!$A$2:$A$${r[0].values.length+1}`,s+=" ",s+=" General",s+=` `,r[0].values.forEach((A,f)=>{s+=`${A||A===0?A:""}`}),s+=" ",s+=" ",s+="",s+="",s+=" ",s+=`Sheet1!$${yt(l+1)}$2:$${yt(l+1)}$${r[0].values.length+1}`,l++,s+=" ",s+=" General",s+=` `,r[0].values.forEach((A,f)=>{s+=`${u.values[f]||u.values[f]===0?u.values[f]:""}`}),s+=" ",s+=" ",s+="",s+=" ",s+=" ",s+=`Sheet1!$${yt(l+1)}$2:$${yt(l+1)}$${u.sizes.length+1}`,l++,s+=" ",s+=" General",s+=` `,u.sizes.forEach((A,f)=>{s+=`${A||""}`}),s+=" ",s+=" ",s+=" ",s+=' ',s+=""}),s+="",s+=``,s+="",s+=``,s+=`${ft(t.dataLabelColor||nr)}`,s+=``,s+="",t.dataLabelPosition&&(s+=``),s+='',s+=``,s+=``,s+="",s+=' ',s+=' ',s+=" ",s+="",s+="",s+=``,s+="";break;case Ce.DOUGHNUT:case Ce.PIE:c=r[0],s+="",s+=' ',s+="",s+=' ',s+=' ',s+=" ",s+=" ",s+=" Sheet1!$B$1",s+=" ",s+=' ',s+=' '+Ve(c.name)+"",s+=" ",s+=" ",s+=" ",s+=" ",s+=' ',s+=' ',t.dataNoEffects?s+="":s+=Mn(t.shadow,zn),s+=" ",c.labels[0].forEach((u,d)=>{s+="",s+=` `,s+=' ',s+=" ",s+=`${ft(t.chartColors[d+1>t.chartColors.length?Math.floor(Math.random()*t.chartColors.length):d])}`,t.dataBorder&&(s+=`${ft(t.dataBorder.color)}`),s+=Mn(t.shadow,zn),s+=" ",s+=""}),s+="",c.labels[0].forEach((u,d)=>{s+="",s+=` `,s+=` `,s+=" ",s+=" ",s+=" ",s+=` `,s+=" "+ft(t.dataLabelColor||nr)+"",s+=` `,s+=" ",s+=" ",s+=" ",e===Ce.PIE&&t.dataLabelPosition&&(s+=``),s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=" "}),s+=` `,s+=" ",s+=" ",s+=" ",s+=" ",s+=" ",s+=` `,s+=' ',s+=" ",s+=" ",s+=" ",s+=" ",s+=e===Ce.PIE?'':"",s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=` `,s+="",s+="",s+=" ",s+=` Sheet1!$A$2:$A$${c.labels[0].length+1}`,s+=" ",s+=` `,c.labels[0].forEach((u,d)=>{s+=`${Ve(u)}`}),s+=" ",s+=" ",s+="",s+=" ",s+=" ",s+=` Sheet1!$B$2:$B$${c.labels[0].length+1}`,s+=" ",s+=` `,c.values.forEach((u,d)=>{s+=`${u||u===0?u:""}`}),s+=" ",s+=" ",s+=" ",s+=" ",s+=` `,e===Ce.DOUGHNUT&&(s+=``),s+="";break;default:s+="";break}return s}function Es(e,r,t){let n="";return e._type===Ce.SCATTER||e._type===Ce.BUBBLE||e._type===Ce.BUBBLE3D?n+="":n+="",n+=' ',n+=" ",n+='',(e.catAxisMaxVal||e.catAxisMaxVal===0)&&(n+=``),(e.catAxisMinVal||e.catAxisMinVal===0)&&(n+=``),n+="",n+=' ',n+=' ',n+=e.catGridLine.style!=="none"?Pl(e.catGridLine):"",e.showCatAxisTitle&&(n+=_o({color:e.catAxisTitleColor,fontFace:e.catAxisTitleFontFace,fontSize:e.catAxisTitleFontSize,titleRotate:e.catAxisTitleRotate,title:e.catAxisTitle||"Axis Title"})),e._type===Ce.SCATTER||e._type===Ce.BUBBLE||e._type===Ce.BUBBLE3D?n+=' ':n+=' ',e._type===Ce.SCATTER?(n+=' ',n+=' ',n+=' '):(n+=' ',n+=' ',n+=' '),n+=" ",n+=` `,n+=e.catAxisLineShow?""+ft(e.catAxisLineColor||_n.color)+"":"",n+=' ',n+=" ",n+=" ",n+=" ",n+=" ",e.catAxisLabelRotate?n+=``:n+="",n+=" ",n+=" ",n+=" ",n+=` `,n+=" "+ft(e.catAxisLabelColor||nr)+"",n+=' ',n+=" ",n+=" ",n+=' ',n+=" ",n+=" ",n+=' ',n+=` `,n+=' ',n+=' ',n+=` `,e.catAxisLabelFrequency&&(n+=' '),(e.catLabelFormatCode||e._type===Ce.SCATTER||e._type===Ce.BUBBLE||e._type===Ce.BUBBLE3D)&&(e.catLabelFormatCode&&(["catAxisBaseTimeUnit","catAxisMajorTimeUnit","catAxisMinorTimeUnit"].forEach(i=>{e[i]&&(typeof e[i]!="string"||!["days","months","years"].includes(e[i].toLowerCase()))&&(console.warn(`"${i}" must be one of: 'days','months','years' !`),e[i]=null)}),e.catAxisBaseTimeUnit&&(n+=''),e.catAxisMajorTimeUnit&&(n+=''),e.catAxisMinorTimeUnit&&(n+='')),e.catAxisMajorUnit&&(n+=``),e.catAxisMinorUnit&&(n+=``)),e._type===Ce.SCATTER||e._type===Ce.BUBBLE||e._type===Ce.BUBBLE3D?n+="":n+="",n}function Bs(e,r){let t=r===qr?e.barDir==="col"?"l":"b":e.barDir!=="col"?"r":"t";r===ro&&(t="r");let n=r===qr?ji:Hs,i="";return i+="",i+=' ',i+=" ",e.valAxisLogScaleBase&&(i+=``),i+='',(e.valAxisMaxVal||e.valAxisMaxVal===0)&&(i+=``),(e.valAxisMinVal||e.valAxisMinVal===0)&&(i+=``),i+=" ",i+=` `,i+=' ',e.valGridLine.style!=="none"&&(i+=Pl(e.valGridLine)),e.showValAxisTitle&&(i+=_o({color:e.valAxisTitleColor,fontFace:e.valAxisTitleFontFace,fontSize:e.valAxisTitleFontSize,titleRotate:e.valAxisTitleRotate,title:e.valAxisTitle||"Axis Title"})),i+=``,e._type===Ce.SCATTER?(i+=' ',i+=' ',i+=' '):(i+=' ',i+=' ',i+=' '),i+=" ",i+=` `,i+=e.valAxisLineShow?""+ft(e.valAxisLineColor||_n.color)+"":"",i+=' ',i+=" ",i+=" ",i+=" ",i+=" ",i+=` `,i+=" ",i+=" ",i+=" ",i+=` `,i+=" "+ft(e.valAxisLabelColor||nr)+"",i+=' ',i+=" ",i+=" ",i+=' ',i+=" ",i+=" ",i+=' ',typeof e.catAxisCrossesAt=="number"?i+=` `:typeof e.catAxisCrossesAt=="string"?i+=' ':i+=' ',i+=' ',e.valAxisMajorUnit&&(i+=` `),e.valAxisDisplayUnit&&(i+=`${e.valAxisDisplayUnitLabel?"":""}`),i+="",i}function y0(e,r,t){let n="";return n+="",n+=' ',n+=' ',n+=' ',n+=' ',n+=e.serGridLine.style!=="none"?Pl(e.serGridLine):"",e.showSerAxisTitle&&(n+=_o({color:e.serAxisTitleColor,fontFace:e.serAxisTitleFontFace,fontSize:e.serAxisTitleFontSize,titleRotate:e.serAxisTitleRotate,title:e.serAxisTitle||"Axis Title"})),n+=` `,n+=' ',n+=' ',n+=` `,n+=" ",n+=' ',n+=e.serAxisLineShow?`${ft(e.serAxisLineColor||_n.color)}`:"",n+=' ',n+=" ",n+=" ",n+=" ",n+=" ",n+=" ",n+=" ",n+=" ",n+=" ",n+=` `,n+=` ${ft(e.serAxisLabelColor||nr)}`,n+=` `,n+=" ",n+=" ",n+=' ',n+=" ",n+=" ",n+=' ',n+=' ',e.serAxisLabelFrequency&&(n+=' '),e.serLabelFormatCode&&(["serAxisBaseTimeUnit","serAxisMajorTimeUnit","serAxisMinorTimeUnit"].forEach(i=>{e[i]&&(typeof e[i]!="string"||!["days","months","years"].includes(i.toLowerCase()))&&(console.warn(`"${i}" must be one of: 'days','months','years' !`),e[i]=null)}),e.serAxisBaseTimeUnit&&(n+=` `),e.serAxisMajorTimeUnit&&(n+=` `),e.serAxisMinorTimeUnit&&(n+=` `),e.serAxisMajorUnit&&(n+=` `),e.serAxisMinorUnit&&(n+=` `)),n+="",n}function _o(e,r,t){let n=e.titleAlign==="left"||e.titleAlign==="right"?``:"",i=e.titleRotate?``:"",a=e.fontSize?`sz="${Math.round(e.fontSize*100)}"`:"",o=e.titleBold?1:0,l="";if(e.titlePos&&typeof e.titlePos.x=="number"&&typeof e.titlePos.y=="number"){let c=e.titlePos.x+r,s=e.titlePos.y+t,u=c===0?0:c*(c/5)/10;u>=1&&(u=u/10),u>=.1&&(u=u/10);let d=s===0?0:s*(s/5)/10;d>=1&&(d=d/10),d>=.1&&(d=d/10),l=``}return` ${i} @@ -196,23 +236,23 @@ end`},au=function(){for(var e=[],r=0;r ${l} - `}function yt(e){let r="",t=e-1;return t<=25?r=Ii[t]:r=`${Ii[Math.floor(t/Ii.length-1)]}${Ii[t%Ii.length]}`,r}function Mn(e,r){if(e){if(typeof e!="object")return console.warn("`shadow` options must be an object. Ex: `{shadow: {type:'none'}}`"),""}else return"";let t="",n=Object.assign(Object.assign({},r),e),i=n.type||"outer",a=je(n.blur),o=je(n.offset),l=Math.round(n.angle*6e4),c=n.color,s=Math.round(n.opacity*1e5),u=n.rotateWithShape?1:0;return t+=``,t+=``,t+=``,t+=``,t+="",t}function Cl(e){let r="";return r+=" ",r+=` `,r+=' ',r+=' ',r+=" ",r+=" ",r+="",r}function ro(e){if(!e||e==="flat")return"flat";if(e==="square")return"sq";if(e==="round")return"rnd";{let r=e;throw new Error(`Invalid chart line cap: ${r}`)}}function Bs(e){var r,t;let n=typeof process<"u"&&!!(!((r=process.versions)===null||r===void 0)&&r.node)&&((t=process.release)===null||t===void 0?void 0:t.name)==="node",i,a,o=n?()=>sr(this,void 0,void 0,function*(){({default:i}=yield Promise.resolve().then(()=>Qr(Mu()))),{default:a}=yield Promise.resolve().then(()=>Qr(up()))}):()=>sr(this,void 0,void 0,function*(){});n&&o();let l=[],c=e._relsMedia.filter(u=>u.type!=="online"&&!u.data&&(!u.path||u.path&&!u.path.includes("preencoded"))),s=[];return c.forEach(u=>{s.includes(u.path)?u.isDuplicate=!0:(u.isDuplicate=!1,s.push(u.path))}),c.filter(u=>!u.isDuplicate).forEach(u=>{l.push(sr(this,void 0,void 0,function*(){if(a||(yield o()),n&&i&&u.path.indexOf("http")!==0)try{let d=i.readFileSync(u.path);return u.data=Buffer.from(d).toString("base64"),c.filter(A=>A.isDuplicate&&A.path===u.path).forEach(A=>A.data=u.data),"done"}catch(d){throw u.data=ci,c.filter(A=>A.isDuplicate&&A.path===u.path).forEach(A=>A.data=u.data),new Error(`ERROR: Unable to read media: "${u.path}" -${String(d)}`)}return n&&a&&u.path.startsWith("http")?yield new Promise((d,A)=>{a.get(u.path,f=>{let p="";f.setEncoding("binary"),f.on("data",g=>p+=g),f.on("end",()=>{u.data=Buffer.from(p,"binary").toString("base64"),c.filter(g=>g.isDuplicate&&g.path===u.path).forEach(g=>g.data=u.data),d("done")}),f.on("error",()=>{u.data=ci,c.filter(g=>g.isDuplicate&&g.path===u.path).forEach(g=>g.data=u.data),A(new Error(`ERROR! Unable to load image (https.get): ${u.path}`))})})}):yield new Promise((d,A)=>{let f=new XMLHttpRequest;f.onload=()=>{let p=new FileReader;p.onloadend=()=>{u.data=p.result,c.filter(g=>g.isDuplicate&&g.path===u.path).forEach(g=>g.data=u.data),u.isSvgPng?Su(u).then(()=>d("done")).catch(A):d("done")},p.readAsDataURL(f.response)},f.onerror=()=>{u.data=ci,c.filter(p=>p.isDuplicate&&p.path===u.path).forEach(p=>p.data=u.data),A(new Error(`ERROR! Unable to load image (xhr.onerror): ${u.path}`))},f.open("GET",u.path),f.responseType="blob",f.send()})}))}),e._relsMedia.filter(u=>u.isSvgPng&&u.data).forEach(u=>{sr(this,void 0,void 0,function*(){n&&!i&&(yield o()),n&&i?(u.data=ci,l.push(Promise.resolve("done"))):l.push(Su(u))})}),l}function Su(e){return sr(this,void 0,void 0,function*(){return yield new Promise((r,t)=>{let n=new Image;n.onload=()=>{n.width+n.height===0&&n.onerror("h/w=0");let i=document.createElement("CANVAS"),a=i.getContext("2d");i.width=n.width,i.height=n.height,a.drawImage(n,0,0);try{e.data=i.toDataURL(e.type),r("done")}catch(o){n.onerror(o.toString())}i=null},n.onerror=()=>{e.data=ci,t(new Error(`ERROR! Unable to load image (image.onerror): ${e.path}`))},n.src=typeof e.data=="string"?e.data:ci})})}var A0={cover:function(e,r){let t=e.h/e.w,i=r.h/r.w>t,a=i?r.h/t:r.w,o=i?r.h:r.w*t,l=Math.round(1e5*.5*(1-r.w/a)),c=Math.round(1e5*.5*(1-r.h/o));return``},contain:function(e,r){let t=e.h/e.w,i=r.h/r.w>t,a=i?r.w:r.h/t,o=i?r.w*t:r.h,l=Math.round(1e5*.5*(1-r.w/a)),c=Math.round(1e5*.5*(1-r.h/o));return``},crop:function(e,r){let t=r.x,n=e.w-(r.x+r.w),i=r.y,a=e.h-(r.y+r.h),o=Math.round(1e5*(t/e.w)),l=Math.round(1e5*(n/e.w)),c=Math.round(1e5*(i/e.h)),s=Math.round(1e5*(a/e.h));return``}};function Pl(e){var r;let t=e._name?'':"",n=1;return e._bkgdImgRid?t+=``:!((r=e.background)===null||r===void 0)&&r.color?t+=`${lr(e.background)}`:!e.bkgd&&e._name&&e._name===Vs&&(t+=''),t+="",t+='',t+='',t+='',e._slideObjects.forEach((i,a)=>{var o,l,c,s,u,d,A,f;let p=0,g=0,y=nt("75%","X",e._presLayout),v=0,b,x="",P=null,F=null,R=0,E=0,B=null,T=null,W=(o=i.options)===null||o===void 0?void 0:o.sizing,H=(l=i.options)===null||l===void 0?void 0:l.rounding;e._slideLayout!==void 0&&e._slideLayout._slideObjects!==void 0&&i.options&&i.options.placeholder&&(b=e._slideLayout._slideObjects.filter(m=>m.options.placeholder===i.options.placeholder)[0]),i.options=i.options||{},typeof i.options.x<"u"&&(p=nt(i.options.x,"X",e._presLayout)),typeof i.options.y<"u"&&(g=nt(i.options.y,"Y",e._presLayout)),typeof i.options.w<"u"&&(y=nt(i.options.w,"X",e._presLayout)),typeof i.options.h<"u"&&(v=nt(i.options.h,"Y",e._presLayout));let C=y,I=v;switch(b&&((b.options.x||b.options.x===0)&&(p=nt(b.options.x,"X",e._presLayout)),(b.options.y||b.options.y===0)&&(g=nt(b.options.y,"Y",e._presLayout)),(b.options.w||b.options.w===0)&&(y=nt(b.options.w,"X",e._presLayout)),(b.options.h||b.options.h===0)&&(v=nt(b.options.h,"Y",e._presLayout))),i.options.flipH&&(x+=' flipH="1"'),i.options.flipV&&(x+=' flipV="1"'),i.options.rotate&&(x+=` rot="${Un(i.options.rotate)}"`),i._type){case He.table:if(P=i.arrTabRows,F=i.options,R=0,E=0,P[0].forEach(m=>{B=m.options||null,R+=B?.colspan?Number(B.colspan):1}),T=``,T+=' ',T+=``,T+='',Array.isArray(F.colW)){T+="";for(let m=0;m`}T+=""}else{E=F.colW?F.colW:Ke,i.options.w&&!F.colW&&(E=Math.round((typeof i.options.w=="number"?i.options.w:1)/R)),T+="";for(let m=0;m`;T+=""}P.forEach(m=>{var N,ne;for(let q=0;q1){let j=new Array(Z-1).fill(void 0).map(()=>({_type:He.tablecell,options:{rowspan:ue},_hmerge:!0}));m.splice(q+1,0,...j),q+=Z}else q+=1}}),P.forEach((m,N)=>{let ne=P[N+1];ne&&m.forEach((q,se)=>{var Z,ue;let j=q._rowContinue||((Z=q.options)===null||Z===void 0?void 0:Z.rowspan),_=(ue=q.options)===null||ue===void 0?void 0:ue.colspan,fe=q._hmerge;if(j&&j>1){let ce={_type:He.tablecell,options:{colspan:_},_rowContinue:j-1,_vmerge:!0,_hmerge:fe};ne.splice(se,0,ce)}})}),P.forEach((m,N)=>{let ne=0;Array.isArray(F.rowH)&&F.rowH[N]?ne=lt(Number(F.rowH[N])):F.rowH&&!isNaN(Number(F.rowH))?ne=lt(Number(F.rowH)):(i.options.cy||i.options.h)&&(ne=Math.round((i.options.h?lt(i.options.h):typeof i.options.cy=="number"?i.options.cy:1)/P.length)),T+=``,m.forEach(q=>{var se,Z,ue,j,_;let fe=q,ce={rowSpan:((se=fe.options)===null||se===void 0?void 0:se.rowspan)>1?fe.options.rowspan:void 0,gridSpan:((Z=fe.options)===null||Z===void 0?void 0:Z.colspan)>1?fe.options.colspan:void 0,vMerge:fe._vmerge?1:void 0,hMerge:fe._hmerge?1:void 0},ie=Object.keys(ce).map(Be=>[Be,ce[Be]]).filter(([,Be])=>!!Be).map(([Be,h])=>`${String(Be)}="${String(h)}"`).join(" ");if(ie&&(ie=" "+ie),fe._hmerge||fe._vmerge){T+=``;return}let be=fe.options||{};fe.options=be,["align","bold","border","color","fill","fontFace","fontSize","margin","textDirection","underline","valign"].forEach(Be=>{F[Be]&&!be[Be]&&be[Be]!==0&&(be[Be]=F[Be])});let Re=be.valign?` anchor="${be.valign.replace(/^c$/i,"ctr").replace(/^m$/i,"ctr").replace("center","ctr").replace("middle","ctr").replace("top","t").replace("btm","b").replace("bottom","b")}"`:"",ke=be.textDirection&&be.textDirection!=="horz"?` vert="${be.textDirection}"`:"",xe=!((j=(ue=fe._optImp)===null||ue===void 0?void 0:ue.fill)===null||j===void 0)&&j.color?fe._optImp.fill.color:!((_=fe._optImp)===null||_===void 0)&&_.fill&&typeof fe._optImp.fill=="string"?fe._optImp.fill:"";xe=xe||be.fill?be.fill:"";let Oe=xe?lr(xe):"",we=be.margin===0||be.margin?be.margin:Ud;!Array.isArray(we)&&typeof we=="number"&&(we=[we,we,we,we]);let tt="";we[0]>=1?tt=` marL="${je(we[3])}" marR="${je(we[1])}" marT="${je(we[0])}" marB="${je(we[2])}"`:tt=` marL="${lt(we[3])}" marR="${lt(we[1])}" marT="${lt(we[0])}" marB="${lt(we[2])}"`,T+=`${Cu(fe)}`,be.border&&Array.isArray(be.border)&&[{idx:3,name:"lnL"},{idx:1,name:"lnR"},{idx:0,name:"lnT"},{idx:2,name:"lnB"}].forEach(Be=>{be.border[Be.idx].type!=="none"?(T+=``,T+=`${ft(be.border[Be.idx].color)}`,T+=``,T+=``):T+=``}),T+=Oe,T+=" ",T+=" "}),T+=""}),T+=" ",T+=" ",T+=" ",T+="",t+=T,n++;break;case He.text:case He.placeholder:if(!i.options.line&&v===0&&(v=Ke*.3),i.options._bodyProp||(i.options._bodyProp={}),i.options.margin&&Array.isArray(i.options.margin)?(i.options._bodyProp.lIns=je(i.options.margin[0]||0),i.options._bodyProp.rIns=je(i.options.margin[1]||0),i.options._bodyProp.bIns=je(i.options.margin[2]||0),i.options._bodyProp.tIns=je(i.options.margin[3]||0)):typeof i.options.margin=="number"&&(i.options._bodyProp.lIns=je(i.options.margin),i.options._bodyProp.rIns=je(i.options.margin),i.options._bodyProp.bIns=je(i.options.margin),i.options._bodyProp.tIns=je(i.options.margin)),t+="",t+=``,!((c=i.options.hyperlink)===null||c===void 0)&&c.url&&(t+=``),!((s=i.options.hyperlink)===null||s===void 0)&&s.slide&&(t+=``),t+="",t+="':"/>"),t+=`${i._type==="placeholder"?Xa(i):Xa(b)}`,t+="",t+=``,t+=``,t+=``,i.shape==="custGeom")t+="",t+="",t+="",t+="",t+="",t+="",t+='',t+="",t+=``,(d=i.options.points)===null||d===void 0||d.forEach((m,N)=>{if("curve"in m)switch(m.curve.type){case"arc":t+=``;break;case"cubic":t+=` + `}function yt(e){let r="",t=e-1;return t<=25?r=zi[t]:r=`${zi[Math.floor(t/zi.length-1)]}${zi[t%zi.length]}`,r}function Mn(e,r){if(e){if(typeof e!="object")return console.warn("`shadow` options must be an object. Ex: `{shadow: {type:'none'}}`"),""}else return"";let t="",n=Object.assign(Object.assign({},r),e),i=n.type||"outer",a=je(n.blur),o=je(n.offset),l=Math.round(n.angle*6e4),c=n.color,s=Math.round(n.opacity*1e5),u=n.rotateWithShape?1:0;return t+=``,t+=``,t+=``,t+=``,t+="",t}function Pl(e){let r="";return r+=" ",r+=` `,r+=' ',r+=' ',r+=" ",r+=" ",r+="",r}function io(e){if(!e||e==="flat")return"flat";if(e==="square")return"sq";if(e==="round")return"rnd";{let r=e;throw new Error(`Invalid chart line cap: ${r}`)}}function Rs(e){var r,t;let n=typeof process<"u"&&!!(!((r=process.versions)===null||r===void 0)&&r.node)&&((t=process.release)===null||t===void 0?void 0:t.name)==="node",i,a,o=n?()=>sr(this,void 0,void 0,function*(){({default:i}=yield Promise.resolve().then(()=>Qr(Mu()))),{default:a}=yield Promise.resolve().then(()=>Qr(Ap()))}):()=>sr(this,void 0,void 0,function*(){});n&&o();let l=[],c=e._relsMedia.filter(u=>u.type!=="online"&&!u.data&&(!u.path||u.path&&!u.path.includes("preencoded"))),s=[];return c.forEach(u=>{s.includes(u.path)?u.isDuplicate=!0:(u.isDuplicate=!1,s.push(u.path))}),c.filter(u=>!u.isDuplicate).forEach(u=>{l.push(sr(this,void 0,void 0,function*(){if(a||(yield o()),n&&i&&u.path.indexOf("http")!==0)try{let d=i.readFileSync(u.path);return u.data=Buffer.from(d).toString("base64"),c.filter(A=>A.isDuplicate&&A.path===u.path).forEach(A=>A.data=u.data),"done"}catch(d){throw u.data=ci,c.filter(A=>A.isDuplicate&&A.path===u.path).forEach(A=>A.data=u.data),new Error(`ERROR: Unable to read media: "${u.path}" +${String(d)}`)}return n&&a&&u.path.startsWith("http")?yield new Promise((d,A)=>{a.get(u.path,f=>{let p="";f.setEncoding("binary"),f.on("data",g=>p+=g),f.on("end",()=>{u.data=Buffer.from(p,"binary").toString("base64"),c.filter(g=>g.isDuplicate&&g.path===u.path).forEach(g=>g.data=u.data),d("done")}),f.on("error",()=>{u.data=ci,c.filter(g=>g.isDuplicate&&g.path===u.path).forEach(g=>g.data=u.data),A(new Error(`ERROR! Unable to load image (https.get): ${u.path}`))})})}):yield new Promise((d,A)=>{let f=new XMLHttpRequest;f.onload=()=>{let p=new FileReader;p.onloadend=()=>{u.data=p.result,c.filter(g=>g.isDuplicate&&g.path===u.path).forEach(g=>g.data=u.data),u.isSvgPng?Su(u).then(()=>d("done")).catch(A):d("done")},p.readAsDataURL(f.response)},f.onerror=()=>{u.data=ci,c.filter(p=>p.isDuplicate&&p.path===u.path).forEach(p=>p.data=u.data),A(new Error(`ERROR! Unable to load image (xhr.onerror): ${u.path}`))},f.open("GET",u.path),f.responseType="blob",f.send()})}))}),e._relsMedia.filter(u=>u.isSvgPng&&u.data).forEach(u=>{sr(this,void 0,void 0,function*(){n&&!i&&(yield o()),n&&i?(u.data=ci,l.push(Promise.resolve("done"))):l.push(Su(u))})}),l}function Su(e){return sr(this,void 0,void 0,function*(){return yield new Promise((r,t)=>{let n=new Image;n.onload=()=>{n.width+n.height===0&&n.onerror("h/w=0");let i=document.createElement("CANVAS"),a=i.getContext("2d");i.width=n.width,i.height=n.height,a.drawImage(n,0,0);try{e.data=i.toDataURL(e.type),r("done")}catch(o){n.onerror(o.toString())}i=null},n.onerror=()=>{e.data=ci,t(new Error(`ERROR! Unable to load image (image.onerror): ${e.path}`))},n.src=typeof e.data=="string"?e.data:ci})})}var b0={cover:function(e,r){let t=e.h/e.w,i=r.h/r.w>t,a=i?r.h/t:r.w,o=i?r.h:r.w*t,l=Math.round(1e5*.5*(1-r.w/a)),c=Math.round(1e5*.5*(1-r.h/o));return``},contain:function(e,r){let t=e.h/e.w,i=r.h/r.w>t,a=i?r.w:r.h/t,o=i?r.w*t:r.h,l=Math.round(1e5*.5*(1-r.w/a)),c=Math.round(1e5*.5*(1-r.h/o));return``},crop:function(e,r){let t=r.x,n=e.w-(r.x+r.w),i=r.y,a=e.h-(r.y+r.h),o=Math.round(1e5*(t/e.w)),l=Math.round(1e5*(n/e.w)),c=Math.round(1e5*(i/e.h)),s=Math.round(1e5*(a/e.h));return``}};function Fl(e){var r;let t=e._name?'':"",n=1;return e._bkgdImgRid?t+=``:!((r=e.background)===null||r===void 0)&&r.color?t+=`${lr(e.background)}`:!e.bkgd&&e._name&&e._name===Xs&&(t+=''),t+="",t+='',t+='',t+='',e._slideObjects.forEach((i,a)=>{var o,l,c,s,u,d,A,f;let p=0,g=0,y=nt("75%","X",e._presLayout),v=0,b,x="",P=null,F=null,R=0,E=0,B=null,T=null,W=(o=i.options)===null||o===void 0?void 0:o.sizing,H=(l=i.options)===null||l===void 0?void 0:l.rounding;e._slideLayout!==void 0&&e._slideLayout._slideObjects!==void 0&&i.options&&i.options.placeholder&&(b=e._slideLayout._slideObjects.filter(m=>m.options.placeholder===i.options.placeholder)[0]),i.options=i.options||{},typeof i.options.x<"u"&&(p=nt(i.options.x,"X",e._presLayout)),typeof i.options.y<"u"&&(g=nt(i.options.y,"Y",e._presLayout)),typeof i.options.w<"u"&&(y=nt(i.options.w,"X",e._presLayout)),typeof i.options.h<"u"&&(v=nt(i.options.h,"Y",e._presLayout));let C=y,I=v;switch(b&&((b.options.x||b.options.x===0)&&(p=nt(b.options.x,"X",e._presLayout)),(b.options.y||b.options.y===0)&&(g=nt(b.options.y,"Y",e._presLayout)),(b.options.w||b.options.w===0)&&(y=nt(b.options.w,"X",e._presLayout)),(b.options.h||b.options.h===0)&&(v=nt(b.options.h,"Y",e._presLayout))),i.options.flipH&&(x+=' flipH="1"'),i.options.flipV&&(x+=' flipV="1"'),i.options.rotate&&(x+=` rot="${Un(i.options.rotate)}"`),i._type){case He.table:if(P=i.arrTabRows,F=i.options,R=0,E=0,P[0].forEach(m=>{B=m.options||null,R+=B?.colspan?Number(B.colspan):1}),T=``,T+=' ',T+=``,T+='',Array.isArray(F.colW)){T+="";for(let m=0;m`}T+=""}else{E=F.colW?F.colW:Ke,i.options.w&&!F.colW&&(E=Math.round((typeof i.options.w=="number"?i.options.w:1)/R)),T+="";for(let m=0;m`;T+=""}P.forEach(m=>{var N,ne;for(let q=0;q1){let j=new Array(Z-1).fill(void 0).map(()=>({_type:He.tablecell,options:{rowspan:ue},_hmerge:!0}));m.splice(q+1,0,...j),q+=Z}else q+=1}}),P.forEach((m,N)=>{let ne=P[N+1];ne&&m.forEach((q,se)=>{var Z,ue;let j=q._rowContinue||((Z=q.options)===null||Z===void 0?void 0:Z.rowspan),_=(ue=q.options)===null||ue===void 0?void 0:ue.colspan,fe=q._hmerge;if(j&&j>1){let ce={_type:He.tablecell,options:{colspan:_},_rowContinue:j-1,_vmerge:!0,_hmerge:fe};ne.splice(se,0,ce)}})}),P.forEach((m,N)=>{let ne=0;Array.isArray(F.rowH)&&F.rowH[N]?ne=lt(Number(F.rowH[N])):F.rowH&&!isNaN(Number(F.rowH))?ne=lt(Number(F.rowH)):(i.options.cy||i.options.h)&&(ne=Math.round((i.options.h?lt(i.options.h):typeof i.options.cy=="number"?i.options.cy:1)/P.length)),T+=``,m.forEach(q=>{var se,Z,ue,j,_;let fe=q,ce={rowSpan:((se=fe.options)===null||se===void 0?void 0:se.rowspan)>1?fe.options.rowspan:void 0,gridSpan:((Z=fe.options)===null||Z===void 0?void 0:Z.colspan)>1?fe.options.colspan:void 0,vMerge:fe._vmerge?1:void 0,hMerge:fe._hmerge?1:void 0},ie=Object.keys(ce).map(Be=>[Be,ce[Be]]).filter(([,Be])=>!!Be).map(([Be,h])=>`${String(Be)}="${String(h)}"`).join(" ");if(ie&&(ie=" "+ie),fe._hmerge||fe._vmerge){T+=``;return}let be=fe.options||{};fe.options=be,["align","bold","border","color","fill","fontFace","fontSize","margin","textDirection","underline","valign"].forEach(Be=>{F[Be]&&!be[Be]&&be[Be]!==0&&(be[Be]=F[Be])});let Re=be.valign?` anchor="${be.valign.replace(/^c$/i,"ctr").replace(/^m$/i,"ctr").replace("center","ctr").replace("middle","ctr").replace("top","t").replace("btm","b").replace("bottom","b")}"`:"",ke=be.textDirection&&be.textDirection!=="horz"?` vert="${be.textDirection}"`:"",xe=!((j=(ue=fe._optImp)===null||ue===void 0?void 0:ue.fill)===null||j===void 0)&&j.color?fe._optImp.fill.color:!((_=fe._optImp)===null||_===void 0)&&_.fill&&typeof fe._optImp.fill=="string"?fe._optImp.fill:"";xe=xe||be.fill?be.fill:"";let Oe=xe?lr(xe):"",we=be.margin===0||be.margin?be.margin:Ud;!Array.isArray(we)&&typeof we=="number"&&(we=[we,we,we,we]);let tt="";we[0]>=1?tt=` marL="${je(we[3])}" marR="${je(we[1])}" marT="${je(we[0])}" marB="${je(we[2])}"`:tt=` marL="${lt(we[3])}" marR="${lt(we[1])}" marT="${lt(we[0])}" marB="${lt(we[2])}"`,T+=`${Cu(fe)}`,be.border&&Array.isArray(be.border)&&[{idx:3,name:"lnL"},{idx:1,name:"lnR"},{idx:0,name:"lnT"},{idx:2,name:"lnB"}].forEach(Be=>{be.border[Be.idx].type!=="none"?(T+=``,T+=`${ft(be.border[Be.idx].color)}`,T+=``,T+=``):T+=``}),T+=Oe,T+=" ",T+=" "}),T+=""}),T+=" ",T+=" ",T+=" ",T+="",t+=T,n++;break;case He.text:case He.placeholder:if(!i.options.line&&v===0&&(v=Ke*.3),i.options._bodyProp||(i.options._bodyProp={}),i.options.margin&&Array.isArray(i.options.margin)?(i.options._bodyProp.lIns=je(i.options.margin[0]||0),i.options._bodyProp.rIns=je(i.options.margin[1]||0),i.options._bodyProp.bIns=je(i.options.margin[2]||0),i.options._bodyProp.tIns=je(i.options.margin[3]||0)):typeof i.options.margin=="number"&&(i.options._bodyProp.lIns=je(i.options.margin),i.options._bodyProp.rIns=je(i.options.margin),i.options._bodyProp.bIns=je(i.options.margin),i.options._bodyProp.tIns=je(i.options.margin)),t+="",t+=``,!((c=i.options.hyperlink)===null||c===void 0)&&c.url&&(t+=``),!((s=i.options.hyperlink)===null||s===void 0)&&s.slide&&(t+=``),t+="",t+="':"/>"),t+=`${i._type==="placeholder"?Ka(i):Ka(b)}`,t+="",t+=``,t+=``,t+=``,i.shape==="custGeom")t+="",t+="",t+="",t+="",t+="",t+="",t+='',t+="",t+=``,(d=i.options.points)===null||d===void 0||d.forEach((m,N)=>{if("curve"in m)switch(m.curve.type){case"arc":t+=``;break;case"cubic":t+=` `;break;case"quadratic":t+=` - `;break}else"close"in m?t+="":m.moveTo||N===0?t+=``:t+=``}),t+="",t+="",t+="";else{if(t+='',i.options.rectRadius)t+=``;else if(i.options.angleRange){for(let m=0;m<2;m++){let N=i.options.angleRange[m];t+=``}i.options.arcThicknessRatio&&(t+=``)}t+=""}t+=i.options.fill?lr(i.options.fill):"",i.options.line&&(t+=i.options.line.width?``:"",i.options.line.color&&(t+=lr(i.options.line)),i.options.line.dashType&&(t+=``),i.options.line.beginArrowType&&(t+=``),i.options.line.endArrowType&&(t+=``),t+=""),i.options.shadow&&i.options.shadow.type!=="none"&&(i.options.shadow.type=i.options.shadow.type||"outer",i.options.shadow.blur=je(i.options.shadow.blur||8),i.options.shadow.offset=je(i.options.shadow.offset||4),i.options.shadow.angle=Math.round((i.options.shadow.angle||270)*6e4),i.options.shadow.opacity=Math.round((i.options.shadow.opacity||.75)*1e5),i.options.shadow.color=i.options.shadow.color||wu.color,t+="",t+=` `,t+=` `,t+=` `,t+=" ",t+=""),t+="",t+=Cu(i),t+="";break;case He.image:if(t+="",t+=" ",t+=``,!((A=i.hyperlink)===null||A===void 0)&&A.url&&(t+=``),!((f=i.hyperlink)===null||f===void 0)&&f.slide&&(t+=``),t+=" ",t+=' ',t+=" "+Xa(b)+"",t+=" ",t+="",(e._relsMedia||[]).filter(m=>m.rId===i.imageRid)[0]&&(e._relsMedia||[]).filter(m=>m.rId===i.imageRid)[0].extn==="svg"?(t+=``,t+=i.options.transparency?` `:"",t+=" ",t+=' ',t+=` `,t+=" ",t+=" ",t+=""):(t+=``,t+=i.options.transparency?``:"",t+=""),W?.type){let m=W.w?nt(W.w,"X",e._presLayout):y,N=W.h?nt(W.h,"Y",e._presLayout):v,ne=nt(W.x||0,"X",e._presLayout),q=nt(W.y||0,"Y",e._presLayout);t+=A0[W.type]({w:C,h:I},{w:m,h:N,x:ne,y:q}),C=m,I=N}else t+=" ";t+="",t+="",t+=" ",t+=` `,t+=` `,t+=" ",t+=` `,i.options.shadow&&i.options.shadow.type!=="none"&&(i.options.shadow.type=i.options.shadow.type||"outer",i.options.shadow.blur=je(i.options.shadow.blur||8),i.options.shadow.offset=je(i.options.shadow.offset||4),i.options.shadow.angle=Math.round((i.options.shadow.angle||270)*6e4),i.options.shadow.opacity=Math.round((i.options.shadow.opacity||.75)*1e5),i.options.shadow.color=i.options.shadow.color||wu.color,t+="",t+=``,t+=``,t+=``,t+=``,t+=""),t+="",t+="";break;case He.media:i.mtype==="online"?(t+="",t+=" ",t+=``,t+=" ",t+=" ",t+=` `,t+=" ",t+=" ",t+=` `,t+=" ",t+=` `,t+=' ',t+=" ",t+=""):(t+="",t+=" ",t+=``,t+=' ',t+=" ",t+=` `,t+=" ",t+=' ',t+=` `,t+=" ",t+=" ",t+=" ",t+=" ",t+=` `,t+=" ",t+=` `,t+=' ',t+=" ",t+="");break;case He.chart:t+="",t+=" ",t+=` `,t+=" ",t+=` ${Xa(b)}`,t+=" ",t+=` `,t+=' ',t+=' ',t+=` `,t+=" ",t+=" ",t+="";break;default:t+="";break}}),e._slideNumberProps&&(e._slideNumberProps.align||(e._slideNumberProps.align="left"),t+="",t+=" ",t+=' ',t+=' ',t+=" ",t+=" ",t+=` `,t+="",t+="`,e._slideNumberProps.color&&(t+=lr(e._slideNumberProps.color)),e._slideNumberProps.fontFace&&(t+=``),t+=""),t+="",t+="",e._slideNumberProps.align.startsWith("l")?t+='':e._slideNumberProps.align.startsWith("c")?t+='':e._slideNumberProps.align.startsWith("r")?t+='':t+='',t+=``,t+=`${e._slideNum}`,t+=""),t+="",t+="",t}function Fl(e,r){let t=0,n=''+Gt+'';return e._rels.forEach(i=>{t=Math.max(t,i.rId),i.type.toLowerCase().includes("hyperlink")?i.data==="slide"?n+=``:n+=``:i.type.toLowerCase().includes("notesSlide")&&(n+=``)}),(e._relsChart||[]).forEach(i=>{t=Math.max(t,i.rId),n+=``}),(e._relsMedia||[]).forEach(i=>{let a=i.rId.toString();t=Math.max(t,i.rId),i.type.toLowerCase().includes("image")?n+='':i.type.toLowerCase().includes("audio")?n.includes(' Target="'+i.Target+'"')?n+='':n+='':i.type.toLowerCase().includes("video")?n.includes(' Target="'+i.Target+'"')?n+='':n+='':i.type.toLowerCase().includes("online")&&(n.includes(' Target="'+i.Target+'"')?n+='':n+='')}),r.forEach((i,a)=>{n+=``}),n+="",n}function ku(e,r){var t,n;let i="",a="",o="",l="",c=r?"a:lvl1pPr":"a:pPr",s=je(Yv),u=`<${c}${e.options.rtlMode?' rtl="1" ':""}`;{if(e.options.align)switch(e.options.align){case"left":u+=' algn="l"';break;case"right":u+=' algn="r"';break;case"center":u+=' algn="ctr"';break;case"justify":u+=' algn="just"';break;default:u+="";break}if(e.options.lineSpacing?a=``:e.options.lineSpacingMultiple&&(a=``),e.options.indentLevel&&!isNaN(Number(e.options.indentLevel))&&e.options.indentLevel>0&&(u+=` lvl="${e.options.indentLevel}"`),e.options.paraSpaceBefore&&!isNaN(Number(e.options.paraSpaceBefore))&&e.options.paraSpaceBefore>0&&(o+=``),e.options.paraSpaceAfter&&!isNaN(Number(e.options.paraSpaceAfter))&&e.options.paraSpaceAfter>0&&(o+=``),typeof e.options.bullet=="object")if(!((n=(t=e?.options)===null||t===void 0?void 0:t.bullet)===null||n===void 0)&&n.indent&&(s=je(e.options.bullet.indent)),e.options.bullet.type)e.options.bullet.type.toString().toLowerCase()==="number"&&(u+=` marL="${e.options.indentLevel&&e.options.indentLevel>0?s+s*e.options.indentLevel:s}" indent="-${s}"`,i=``);else if(e.options.bullet.characterCode){let d=`&#x${e.options.bullet.characterCode};`;/^[0-9A-Fa-f]{4}$/.test(e.options.bullet.characterCode)||(console.warn("Warning: `bullet.characterCode should be a 4-digit unicode charatcer (ex: 22AB)`!"),d=li.DEFAULT),u+=` marL="${e.options.indentLevel&&e.options.indentLevel>0?s+s*e.options.indentLevel:s}" indent="-${s}"`,i=''}else if(e.options.bullet.code){let d=`&#x${e.options.bullet.code};`;/^[0-9A-Fa-f]{4}$/.test(e.options.bullet.code)||(console.warn("Warning: `bullet.code should be a 4-digit hex code (ex: 22AB)`!"),d=li.DEFAULT),u+=` marL="${e.options.indentLevel&&e.options.indentLevel>0?s+s*e.options.indentLevel:s}" indent="-${s}"`,i=''}else u+=` marL="${e.options.indentLevel&&e.options.indentLevel>0?s+s*e.options.indentLevel:s}" indent="-${s}"`,i=``;else e.options.bullet?(u+=` marL="${e.options.indentLevel&&e.options.indentLevel>0?s+s*e.options.indentLevel:s}" indent="-${s}"`,i=``):e.options.bullet||(u+=' indent="0" marL="0"',i="");e.options.tabStops&&Array.isArray(e.options.tabStops)&&(l=`${e.options.tabStops.map(A=>``).join("")}`),u+=">"+a+o+i+l,r&&(u+=Kd(e.options,!0)),u+=""}return u}function Kd(e,r){var t;let n="",i=r?"a:defRPr":"a:rPr";if(n+="<"+i+' lang="'+(e.lang?e.lang:"en-US")+'"'+(e.lang?' altLang="en-US"':""),n+=e.fontSize?` sz="${Math.round(e.fontSize*100)}"`:"",n+=e?.bold?` b="${e.bold?"1":"0"}"`:"",n+=e?.italic?` i="${e.italic?"1":"0"}"`:"",n+=e?.strike?` strike="${typeof e.strike=="string"?e.strike:"sngStrike"}"`:"",typeof e.underline=="object"&&(!((t=e.underline)===null||t===void 0)&&t.style)?n+=` u="${e.underline.style}"`:typeof e.underline=="string"?n+=` u="${String(e.underline)}"`:e.hyperlink&&(n+=' u="sng"'),e.baseline?n+=` baseline="${Math.round(e.baseline*50)}"`:e.subscript?n+=' baseline="-40000"':e.superscript&&(n+=' baseline="30000"'),n+=e.charSpacing?` spc="${Math.round(e.charSpacing*100)}" kern="0"`:"",n+=' dirty="0">',(e.color||e.fontFace||e.outline||typeof e.underline=="object"&&e.underline.color)&&(e.outline&&typeof e.outline=="object"&&(n+=`${lr(e.outline.color||"FFFFFF")}`),e.color&&(n+=lr({color:e.color,transparency:e.transparency})),e.highlight&&(n+=`${ft(e.highlight)}`),typeof e.underline=="object"&&e.underline.color&&(n+=`${lr(e.underline.color)}`),e.glow&&(n+=`${r0(e.glow,$v)}`),e.fontFace&&(n+=``)),e.hyperlink){if(typeof e.hyperlink!="object")throw new Error("ERROR: text `hyperlink` option should be an object. Ex: `hyperlink:{url:'https://github.com'}` ");if(!e.hyperlink.url&&!e.hyperlink.slide)throw new Error("ERROR: 'hyperlink requires either `url` or `slide`'");e.hyperlink.url?n+=`":"/>"}`:e.hyperlink.slide&&(n+=`":"/>"}`),e.color&&(n+=" ",n+=' ',n+=' ',n+=" ",n+=" ",n+="")}return n+=``,n}function g0(e){return e.text?`${Kd(e.options,!1)}${Ve(e.text)}`:""}function m0(e){let r="":e.options.fit==="resize"&&(r+="")),e.options.shrinkText&&(r+=""),r+=e.options._bodyProp.autoFit?"":"",r+=""):(r+=' wrap="square" rtlCol="0">',r+=""),e._type===He.tablecell?"":r}function Cu(e){let r=e.options||{},t=[],n=[];if(r&&e._type!==He.tablecell&&(typeof e.text>"u"||e.text===null))return"";let i=e._type===He.tablecell?"":"";i+=m0(e),r.h===0&&r.line&&r.align?i+='':e._type==="placeholder"?i+=`${ku(e,!0)}`:i+="",typeof e.text=="string"||typeof e.text=="number"?t.push({text:e.text.toString(),options:r||{}}):e.text&&!Array.isArray(e.text)&&typeof e.text=="object"&&Object.keys(e.text).includes("text")?t.push({text:e.text||"",options:e.options||{}}):Array.isArray(e.text)&&(t=e.text.map(l=>({text:l.text,options:l.options}))),t.forEach((l,c)=>{l.text||(l.text=""),l.options=l.options||r||{},c===0&&l.options&&!l.options.bullet&&r.bullet&&(l.options.bullet=r.bullet),(typeof l.text=="string"||typeof l.text=="number")&&(l.text=l.text.toString().replace(/\r*\n/g,Gt)),l.text.includes(Gt)&&l.text.match(/\n$/g)===null?l.text.split(Gt).forEach(s=>{l.options.breakLine=!0,n.push({text:s,options:l.options})}):n.push(l)});let a=[],o=[];return n.forEach((l,c)=>{o.length>0&&(l.options.align||r.align)?l.options.align!==n[c-1].options.align&&(a.push(o),o=[]):o.length>0&&l.options.bullet&&o.length>0&&(a.push(o),o=[],l.options.breakLine=!1),o.push(l),o.length>0&&l.options.breakLine&&c+1{var c;let s=!1;i+="";let u=`{d.options._lineIdx=A,A>0&&d.options.softBreakBefore&&(i+=""),d.options.align=d.options.align||r.align,d.options.lineSpacing=d.options.lineSpacing||r.lineSpacing,d.options.lineSpacingMultiple=d.options.lineSpacingMultiple||r.lineSpacingMultiple,d.options.indentLevel=d.options.indentLevel||r.indentLevel,d.options.paraSpaceBefore=d.options.paraSpaceBefore||r.paraSpaceBefore,d.options.paraSpaceAfter=d.options.paraSpaceAfter||r.paraSpaceAfter,u=ku(d,!1),i+=u.replace("",""),Object.entries(r).filter(([f])=>!(d.options.hyperlink&&f==="color")).forEach(([f,p])=>{f!=="bullet"&&!d.options[f]&&(d.options[f]=p)}),i+=g0(d),(!d.text&&r.fontSize||d.options.fontSize)&&(s=!0,r.fontSize=r.fontSize||d.options.fontSize)}),e._type===He.tablecell&&(r.fontSize||r.fontFace)?r.fontFace?(i+=`',i+=``,i+=``,i+=``,i+=""):i+=`':s?i+=`':i+=``,i+=""}),i.indexOf("")===-1&&(i+=""),i+=e._type===He.tablecell?"":"",i}function Xa(e){var r,t;if(!e)return"";let n=!((r=e.options)===null||r===void 0)&&r._placeholderIdx?e.options._placeholderIdx:"",i=!((t=e.options)===null||t===void 0)&&t._placeholderType?e.options._placeholderType:"",a=i&&Qi[i]?Qi[i].toString():"";return``;break}else"close"in m?t+="":m.moveTo||N===0?t+=``:t+=``}),t+="",t+="",t+="";else{if(t+='',i.options.rectRadius)t+=``;else if(i.options.angleRange){for(let m=0;m<2;m++){let N=i.options.angleRange[m];t+=``}i.options.arcThicknessRatio&&(t+=``)}t+=""}t+=i.options.fill?lr(i.options.fill):"",i.options.line&&(t+=i.options.line.width?``:"",i.options.line.color&&(t+=lr(i.options.line)),i.options.line.dashType&&(t+=``),i.options.line.beginArrowType&&(t+=``),i.options.line.endArrowType&&(t+=``),t+=""),i.options.shadow&&i.options.shadow.type!=="none"&&(i.options.shadow.type=i.options.shadow.type||"outer",i.options.shadow.blur=je(i.options.shadow.blur||8),i.options.shadow.offset=je(i.options.shadow.offset||4),i.options.shadow.angle=Math.round((i.options.shadow.angle||270)*6e4),i.options.shadow.opacity=Math.round((i.options.shadow.opacity||.75)*1e5),i.options.shadow.color=i.options.shadow.color||wu.color,t+="",t+=` `,t+=` `,t+=` `,t+=" ",t+=""),t+="",t+=Cu(i),t+="";break;case He.image:if(t+="",t+=" ",t+=``,!((A=i.hyperlink)===null||A===void 0)&&A.url&&(t+=``),!((f=i.hyperlink)===null||f===void 0)&&f.slide&&(t+=``),t+=" ",t+=' ',t+=" "+Ka(b)+"",t+=" ",t+="",(e._relsMedia||[]).filter(m=>m.rId===i.imageRid)[0]&&(e._relsMedia||[]).filter(m=>m.rId===i.imageRid)[0].extn==="svg"?(t+=``,t+=i.options.transparency?` `:"",t+=" ",t+=' ',t+=` `,t+=" ",t+=" ",t+=""):(t+=``,t+=i.options.transparency?``:"",t+=""),W?.type){let m=W.w?nt(W.w,"X",e._presLayout):y,N=W.h?nt(W.h,"Y",e._presLayout):v,ne=nt(W.x||0,"X",e._presLayout),q=nt(W.y||0,"Y",e._presLayout);t+=b0[W.type]({w:C,h:I},{w:m,h:N,x:ne,y:q}),C=m,I=N}else t+=" ";t+="",t+="",t+=" ",t+=` `,t+=` `,t+=" ",t+=` `,i.options.shadow&&i.options.shadow.type!=="none"&&(i.options.shadow.type=i.options.shadow.type||"outer",i.options.shadow.blur=je(i.options.shadow.blur||8),i.options.shadow.offset=je(i.options.shadow.offset||4),i.options.shadow.angle=Math.round((i.options.shadow.angle||270)*6e4),i.options.shadow.opacity=Math.round((i.options.shadow.opacity||.75)*1e5),i.options.shadow.color=i.options.shadow.color||wu.color,t+="",t+=``,t+=``,t+=``,t+=``,t+=""),t+="",t+="";break;case He.media:i.mtype==="online"?(t+="",t+=" ",t+=``,t+=" ",t+=" ",t+=` `,t+=" ",t+=" ",t+=` `,t+=" ",t+=` `,t+=' ',t+=" ",t+=""):(t+="",t+=" ",t+=``,t+=' ',t+=" ",t+=` `,t+=" ",t+=' ',t+=` `,t+=" ",t+=" ",t+=" ",t+=" ",t+=` `,t+=" ",t+=` `,t+=' ',t+=" ",t+="");break;case He.chart:t+="",t+=" ",t+=` `,t+=" ",t+=` ${Ka(b)}`,t+=" ",t+=` `,t+=' ',t+=' ',t+=` `,t+=" ",t+=" ",t+="";break;default:t+="";break}}),e._slideNumberProps&&(e._slideNumberProps.align||(e._slideNumberProps.align="left"),t+="",t+=" ",t+=' ',t+=' ',t+=" ",t+=" ",t+=` `,t+="",t+="`,e._slideNumberProps.color&&(t+=lr(e._slideNumberProps.color)),e._slideNumberProps.fontFace&&(t+=``),t+=""),t+="",t+="",e._slideNumberProps.align.startsWith("l")?t+='':e._slideNumberProps.align.startsWith("c")?t+='':e._slideNumberProps.align.startsWith("r")?t+='':t+='',t+=``,t+=`${e._slideNum}`,t+=""),t+="",t+="",t}function Tl(e,r){let t=0,n=''+Wt+'';return e._rels.forEach(i=>{t=Math.max(t,i.rId),i.type.toLowerCase().includes("hyperlink")?i.data==="slide"?n+=``:n+=``:i.type.toLowerCase().includes("notesSlide")&&(n+=``)}),(e._relsChart||[]).forEach(i=>{t=Math.max(t,i.rId),n+=``}),(e._relsMedia||[]).forEach(i=>{let a=i.rId.toString();t=Math.max(t,i.rId),i.type.toLowerCase().includes("image")?n+='':i.type.toLowerCase().includes("audio")?n.includes(' Target="'+i.Target+'"')?n+='':n+='':i.type.toLowerCase().includes("video")?n.includes(' Target="'+i.Target+'"')?n+='':n+='':i.type.toLowerCase().includes("online")&&(n.includes(' Target="'+i.Target+'"')?n+='':n+='')}),r.forEach((i,a)=>{n+=``}),n+="",n}function ku(e,r){var t,n;let i="",a="",o="",l="",c=r?"a:lvl1pPr":"a:pPr",s=je(r0),u=`<${c}${e.options.rtlMode?' rtl="1" ':""}`;{if(e.options.align)switch(e.options.align){case"left":u+=' algn="l"';break;case"right":u+=' algn="r"';break;case"center":u+=' algn="ctr"';break;case"justify":u+=' algn="just"';break;default:u+="";break}if(e.options.lineSpacing?a=``:e.options.lineSpacingMultiple&&(a=``),e.options.indentLevel&&!isNaN(Number(e.options.indentLevel))&&e.options.indentLevel>0&&(u+=` lvl="${e.options.indentLevel}"`),e.options.paraSpaceBefore&&!isNaN(Number(e.options.paraSpaceBefore))&&e.options.paraSpaceBefore>0&&(o+=``),e.options.paraSpaceAfter&&!isNaN(Number(e.options.paraSpaceAfter))&&e.options.paraSpaceAfter>0&&(o+=``),typeof e.options.bullet=="object")if(!((n=(t=e?.options)===null||t===void 0?void 0:t.bullet)===null||n===void 0)&&n.indent&&(s=je(e.options.bullet.indent)),e.options.bullet.type)e.options.bullet.type.toString().toLowerCase()==="number"&&(u+=` marL="${e.options.indentLevel&&e.options.indentLevel>0?s+s*e.options.indentLevel:s}" indent="-${s}"`,i=``);else if(e.options.bullet.characterCode){let d=`&#x${e.options.bullet.characterCode};`;/^[0-9A-Fa-f]{4}$/.test(e.options.bullet.characterCode)||(console.warn("Warning: `bullet.characterCode should be a 4-digit unicode charatcer (ex: 22AB)`!"),d=li.DEFAULT),u+=` marL="${e.options.indentLevel&&e.options.indentLevel>0?s+s*e.options.indentLevel:s}" indent="-${s}"`,i=''}else if(e.options.bullet.code){let d=`&#x${e.options.bullet.code};`;/^[0-9A-Fa-f]{4}$/.test(e.options.bullet.code)||(console.warn("Warning: `bullet.code should be a 4-digit hex code (ex: 22AB)`!"),d=li.DEFAULT),u+=` marL="${e.options.indentLevel&&e.options.indentLevel>0?s+s*e.options.indentLevel:s}" indent="-${s}"`,i=''}else u+=` marL="${e.options.indentLevel&&e.options.indentLevel>0?s+s*e.options.indentLevel:s}" indent="-${s}"`,i=``;else e.options.bullet?(u+=` marL="${e.options.indentLevel&&e.options.indentLevel>0?s+s*e.options.indentLevel:s}" indent="-${s}"`,i=``):e.options.bullet||(u+=' indent="0" marL="0"',i="");e.options.tabStops&&Array.isArray(e.options.tabStops)&&(l=`${e.options.tabStops.map(A=>``).join("")}`),u+=">"+a+o+i+l,r&&(u+=Kd(e.options,!0)),u+=""}return u}function Kd(e,r){var t;let n="",i=r?"a:defRPr":"a:rPr";if(n+="<"+i+' lang="'+(e.lang?e.lang:"en-US")+'"'+(e.lang?' altLang="en-US"':""),n+=e.fontSize?` sz="${Math.round(e.fontSize*100)}"`:"",n+=e?.bold?` b="${e.bold?"1":"0"}"`:"",n+=e?.italic?` i="${e.italic?"1":"0"}"`:"",n+=e?.strike?` strike="${typeof e.strike=="string"?e.strike:"sngStrike"}"`:"",typeof e.underline=="object"&&(!((t=e.underline)===null||t===void 0)&&t.style)?n+=` u="${e.underline.style}"`:typeof e.underline=="string"?n+=` u="${String(e.underline)}"`:e.hyperlink&&(n+=' u="sng"'),e.baseline?n+=` baseline="${Math.round(e.baseline*50)}"`:e.subscript?n+=' baseline="-40000"':e.superscript&&(n+=' baseline="30000"'),n+=e.charSpacing?` spc="${Math.round(e.charSpacing*100)}" kern="0"`:"",n+=' dirty="0">',(e.color||e.fontFace||e.outline||typeof e.underline=="object"&&e.underline.color)&&(e.outline&&typeof e.outline=="object"&&(n+=`${lr(e.outline.color||"FFFFFF")}`),e.color&&(n+=lr({color:e.color,transparency:e.transparency})),e.highlight&&(n+=`${ft(e.highlight)}`),typeof e.underline=="object"&&e.underline.color&&(n+=`${lr(e.underline.color)}`),e.glow&&(n+=`${s0(e.glow,i0)}`),e.fontFace&&(n+=``)),e.hyperlink){if(typeof e.hyperlink!="object")throw new Error("ERROR: text `hyperlink` option should be an object. Ex: `hyperlink:{url:'https://github.com'}` ");if(!e.hyperlink.url&&!e.hyperlink.slide)throw new Error("ERROR: 'hyperlink requires either `url` or `slide`'");e.hyperlink.url?n+=`":"/>"}`:e.hyperlink.slide&&(n+=`":"/>"}`),e.color&&(n+=" ",n+=' ',n+=' ',n+=" ",n+=" ",n+="")}return n+=``,n}function w0(e){return e.text?`${Kd(e.options,!1)}${Ve(e.text)}`:""}function x0(e){let r="":e.options.fit==="resize"&&(r+="")),e.options.shrinkText&&(r+=""),r+=e.options._bodyProp.autoFit?"":"",r+=""):(r+=' wrap="square" rtlCol="0">',r+=""),e._type===He.tablecell?"":r}function Cu(e){let r=e.options||{},t=[],n=[];if(r&&e._type!==He.tablecell&&(typeof e.text>"u"||e.text===null))return"";let i=e._type===He.tablecell?"":"";i+=x0(e),r.h===0&&r.line&&r.align?i+='':e._type==="placeholder"?i+=`${ku(e,!0)}`:i+="",typeof e.text=="string"||typeof e.text=="number"?t.push({text:e.text.toString(),options:r||{}}):e.text&&!Array.isArray(e.text)&&typeof e.text=="object"&&Object.keys(e.text).includes("text")?t.push({text:e.text||"",options:e.options||{}}):Array.isArray(e.text)&&(t=e.text.map(l=>({text:l.text,options:l.options}))),t.forEach((l,c)=>{l.text||(l.text=""),l.options=l.options||r||{},c===0&&l.options&&!l.options.bullet&&r.bullet&&(l.options.bullet=r.bullet),(typeof l.text=="string"||typeof l.text=="number")&&(l.text=l.text.toString().replace(/\r*\n/g,Wt)),l.text.includes(Wt)&&l.text.match(/\n$/g)===null?l.text.split(Wt).forEach(s=>{l.options.breakLine=!0,n.push({text:s,options:l.options})}):n.push(l)});let a=[],o=[];return n.forEach((l,c)=>{o.length>0&&(l.options.align||r.align)?l.options.align!==n[c-1].options.align&&(a.push(o),o=[]):o.length>0&&l.options.bullet&&o.length>0&&(a.push(o),o=[],l.options.breakLine=!1),o.push(l),o.length>0&&l.options.breakLine&&c+1{var c;let s=!1;i+="";let u=`{d.options._lineIdx=A,A>0&&d.options.softBreakBefore&&(i+=""),d.options.align=d.options.align||r.align,d.options.lineSpacing=d.options.lineSpacing||r.lineSpacing,d.options.lineSpacingMultiple=d.options.lineSpacingMultiple||r.lineSpacingMultiple,d.options.indentLevel=d.options.indentLevel||r.indentLevel,d.options.paraSpaceBefore=d.options.paraSpaceBefore||r.paraSpaceBefore,d.options.paraSpaceAfter=d.options.paraSpaceAfter||r.paraSpaceAfter,u=ku(d,!1),i+=u.replace("",""),Object.entries(r).filter(([f])=>!(d.options.hyperlink&&f==="color")).forEach(([f,p])=>{f!=="bullet"&&!d.options[f]&&(d.options[f]=p)}),i+=w0(d),(!d.text&&r.fontSize||d.options.fontSize)&&(s=!0,r.fontSize=r.fontSize||d.options.fontSize)}),e._type===He.tablecell&&(r.fontSize||r.fontFace)?r.fontFace?(i+=`',i+=``,i+=``,i+=``,i+=""):i+=`':s?i+=`':i+=``,i+=""}),i.indexOf("")===-1&&(i+=""),i+=e._type===He.tablecell?"":"",i}function Ka(e){var r,t;if(!e)return"";let n=!((r=e.options)===null||r===void 0)&&r._placeholderIdx?e.options._placeholderIdx:"",i=!((t=e.options)===null||t===void 0)&&t._placeholderType?e.options._placeholderType:"",a=i&&Zi[i]?Zi[i].toString():"";return`0?' hasCustomPrompt="1"':""} - />`}function v0(e,r,t){let n=''+Gt;return n+='',n+='',n+='',n+='',n+='',n+='',n+='',n+='',n+='',n+='',e.forEach(i=>{(i._relsMedia||[]).forEach(a=>{a.type!=="image"&&a.type!=="online"&&a.type!=="chart"&&a.extn!=="m4v"&&!n.includes(a.type)&&(n+='')})}),n+='',n+='',n+='',n+='',e.forEach((i,a)=>{n+=``,n+=``,i._relsChart.forEach(o=>{n+=``})}),n+='',n+='',n+='',n+='',r.forEach((i,a)=>{n+=``,(i._relsChart||[]).forEach(o=>{n+=' '})}),e.forEach((i,a)=>{n+=``}),t._relsChart.forEach(i=>{n+=' '}),t._relsMedia.forEach(i=>{i.type!=="image"&&i.type!=="online"&&i.type!=="chart"&&i.extn!=="m4v"&&!n.includes(i.type)&&(n+=' ')}),n+=' ',n+=' ',n+="",n}function y0(){return`${Gt} + />`}function S0(e,r,t){let n=''+Wt;return n+='',n+='',n+='',n+='',n+='',n+='',n+='',n+='',n+='',n+='',e.forEach(i=>{(i._relsMedia||[]).forEach(a=>{a.type!=="image"&&a.type!=="online"&&a.type!=="chart"&&a.extn!=="m4v"&&!n.includes(a.type)&&(n+='')})}),n+='',n+='',n+='',n+='',e.forEach((i,a)=>{n+=``,n+=``,i._relsChart.forEach(o=>{n+=``})}),n+='',n+='',n+='',n+='',r.forEach((i,a)=>{n+=``,(i._relsChart||[]).forEach(o=>{n+=' '})}),e.forEach((i,a)=>{n+=``}),t._relsChart.forEach(i=>{n+=' '}),t._relsMedia.forEach(i=>{i.type!=="image"&&i.type!=="online"&&i.type!=="chart"&&i.extn!=="m4v"&&!n.includes(i.type)&&(n+=' ')}),n+=' ',n+=' ',n+="",n}function k0(){return`${Wt} - `}function b0(e,r){return`${Gt} + `}function C0(e,r){return`${Wt} 0 0 Microsoft Office PowerPoint @@ -246,7 +286,7 @@ ${String(d)}`)}return n&&a&&u.path.startsWith("http")?yield new Promise((d,A)=>{ false false 16.0000 - `}function w0(e,r,t,n){return` + `}function P0(e,r,t,n){return` ${Ve(e)} ${Ve(r)} @@ -255,36 +295,36 @@ ${String(d)}`)}return n&&a&&u.path.startsWith("http")?yield new Promise((d,A)=>{ ${n} ${new Date().toISOString().replace(/\.\d\d\dZ/,"Z")} ${new Date().toISOString().replace(/\.\d\d\dZ/,"Z")} - `}function x0(e){let r=1,t=''+Gt;t+='',t+='';for(let n=1;n<=e.length;n++)t+=``;return r++,t+=``,t}function S0(e){return`${Gt}${Pl(e)}`}function k0(e){let r="";return e._slideObjects.forEach(t=>{t._type===He.notes&&(r+=t?.text&&t.text[0]?t.text[0].text:"")}),r.replace(/\r*\n/g,Gt)}function C0(){return`${Gt}7/23/19Click to edit Master text stylesSecond levelThird levelFourth levelFifth level\u2039#\u203A`}function P0(e){return`${Gt}${Ve(k0(e))}${e._slideNum}`}function F0(e){return` + `}function F0(e){let r=1,t=''+Wt;t+='',t+='';for(let n=1;n<=e.length;n++)t+=``;return r++,t+=``,t}function T0(e){return`${Wt}${Fl(e)}`}function D0(e){let r="";return e._slideObjects.forEach(t=>{t._type===He.notes&&(r+=t?.text&&t.text[0]?t.text[0].text:"")}),r.replace(/\r*\n/g,Wt)}function E0(){return`${Wt}7/23/19Click to edit Master text stylesSecond levelThird levelFourth levelFifth level\u2039#\u203A`}function B0(e){return`${Wt}${Ve(D0(e))}${e._slideNum}`}function R0(e){return` - ${Pl(e)} - `}function T0(e,r){let t=r.map((i,a)=>``),n=''+Gt;return n+='',n+=Pl(e),n+='',n+=""+t.join("")+"",n+='',n+=' ',n+="",n}function D0(e,r){return Fl(r[e-1],[{target:"../slideMasters/slideMaster1.xml",type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster"}])}function E0(e,r,t){return Fl(e[t-1],[{target:`../slideLayouts/slideLayout${N0(e,r,t)}.xml`,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"},{target:`../notesSlides/notesSlide${t}.xml`,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide"}])}function B0(e){return` + ${Fl(e)} + `}function L0(e,r){let t=r.map((i,a)=>``),n=''+Wt;return n+='',n+=Fl(e),n+='',n+=""+t.join("")+"",n+='',n+=' ',n+="",n}function N0(e,r){return Tl(r[e-1],[{target:"../slideMasters/slideMaster1.xml",type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster"}])}function I0(e,r,t){return Tl(e[t-1],[{target:`../slideLayouts/slideLayout${_0(e,r,t)}.xml`,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"},{target:`../notesSlides/notesSlide${t}.xml`,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide"}])}function z0(e){return` - `}function R0(e,r){let t=r.map((n,i)=>({target:`../slideLayouts/slideLayout${i+1}.xml`,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"}));return t.push({target:"../theme/theme1.xml",type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"}),Fl(e,t)}function L0(){return`${Gt} + `}function M0(e,r){let t=r.map((n,i)=>({target:`../slideLayouts/slideLayout${i+1}.xml`,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"}));return t.push({target:"../theme/theme1.xml",type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"}),Tl(e,t)}function O0(){return`${Wt} - `}function N0(e,r,t){for(let n=0;n`:'',o=!((n=e.theme)===null||n===void 0)&&n.bodyFontFace?``:'';return`${a}${o}`}function z0(e){let r=`${Gt}`;r+='',r+="",e.slides.forEach(t=>r+=``),r+="",r+=``,r+=``,r+=``,r+="";for(let t=1;t<10;t++)r+=``;return r+="",e.sections&&e.sections.length>0&&(r+='',r+='',e.sections.forEach(t=>{r+=``,t._slides.forEach(n=>r+=``),r+=""}),r+="",r+='',r+=""),r+="",r}function M0(){return`${Gt}`}function O0(){return`${Gt}`}function _0(){return`${Gt}`}var U0="4.0.1",W0=class{set layout(e){let r=this.LAYOUTS[e];if(r)this._layout=e,this._presLayout=r;else throw new Error("UNKNOWN-LAYOUT")}get layout(){return this._layout}get version(){return this._version}set author(e){this._author=e}get author(){return this._author}set company(e){this._company=e}get company(){return this._company}set revision(e){this._revision=e}get revision(){return this._revision}set subject(e){this._subject=e}get subject(){return this._subject}set theme(e){this._theme=e}get theme(){return this._theme}set title(e){this._title=e}get title(){return this._title}set rtlMode(e){this._rtlMode=e}get rtlMode(){return this._rtlMode}get masterSlide(){return this._masterSlide}get slides(){return this._slides}get sections(){return this._sections}get slideLayouts(){return this._slideLayouts}get AlignH(){return this._alignH}get AlignV(){return this._alignV}get ChartType(){return this._chartType}get OutputType(){return this._outputType}get presLayout(){return this._presLayout}get SchemeColor(){return this._schemeColor}get ShapeType(){return this._shapeType}get charts(){return this._charts}get colors(){return this._colors}get shapes(){return this._shapes}constructor(){this._version=U0,this._alignH=Zs,this._alignV=Ys,this._chartType=Ks,this._outputType=Hs,this._schemeColor=or,this._shapeType=Qs,this._charts=Ce,this._colors=mo,this._shapes=xn,this.addNewSlide=i=>{let a=this.sections.length>0&&this.sections[this.sections.length-1]._slides.filter(o=>o._slideNum===this.slides[this.slides.length-1]._slideNum).length>0;return i.sectionTitle=a?this.sections[this.sections.length-1].title:null,this.addSlide(i)},this.getSlide=i=>this.slides.filter(a=>a._slideNum===i)[0],this.setSlideNumber=i=>{this.masterSlide._slideNumberProps=i,this.slideLayouts.filter(a=>a._name===Vs)[0]._slideNumberProps=i},this.createChartMediaRels=(i,a,o)=>{i._relsChart.forEach(l=>o.push(f0(l,a))),i._relsMedia.forEach(l=>{if(l.type!=="online"&&l.type!=="hyperlink"){let c=l.data&&typeof l.data=="string"?l.data:"";!c.includes(",")&&!c.includes(";")?c="image/png;base64,"+c:c.includes(",")?c.includes(";")||(c="image/png;"+c):c="image/png;base64,"+c,a.file(l.Target.replace("..","ppt"),c.split(",").pop(),{base64:!0})}})},this.writeFileToBrowser=(i,a)=>sr(this,void 0,void 0,function*(){let o=document.createElement("a");if(o.setAttribute("style","display:none;"),o.dataset.interception="off",document.body.appendChild(o),window.URL.createObjectURL){let l=window.URL.createObjectURL(new Blob([a],{type:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}));return o.href=l,o.download=i,o.click(),setTimeout(()=>{window.URL.revokeObjectURL(l),document.body.removeChild(o)},100),yield Promise.resolve(i)}}),this.exportPresentation=i=>sr(this,void 0,void 0,function*(){let a=[],o=[],l=new _d.default;return this.slides.forEach(c=>{o=o.concat(Bs(c))}),this.slideLayouts.forEach(c=>{o=o.concat(Bs(c))}),o=o.concat(Bs(this.masterSlide)),yield Promise.all(o).then(()=>sr(this,void 0,void 0,function*(){return this.slides.forEach(c=>{c._slideLayout&&u0(c)}),l.folder("_rels"),l.folder("docProps"),l.folder("ppt").folder("_rels"),l.folder("ppt/charts").folder("_rels"),l.folder("ppt/embeddings"),l.folder("ppt/media"),l.folder("ppt/slideLayouts").folder("_rels"),l.folder("ppt/slideMasters").folder("_rels"),l.folder("ppt/slides").folder("_rels"),l.folder("ppt/theme"),l.folder("ppt/notesMasters").folder("_rels"),l.folder("ppt/notesSlides").folder("_rels"),l.file("[Content_Types].xml",v0(this.slides,this.slideLayouts,this.masterSlide)),l.file("_rels/.rels",y0()),l.file("docProps/app.xml",b0(this.slides,this.company)),l.file("docProps/core.xml",w0(this.title,this.subject,this.author,this.revision)),l.file("ppt/_rels/presentation.xml.rels",x0(this.slides)),l.file("ppt/theme/theme1.xml",I0(this)),l.file("ppt/presentation.xml",z0(this)),l.file("ppt/presProps.xml",M0()),l.file("ppt/tableStyles.xml",O0()),l.file("ppt/viewProps.xml",_0()),this.slideLayouts.forEach((c,s)=>{l.file(`ppt/slideLayouts/slideLayout${s+1}.xml`,F0(c)),l.file(`ppt/slideLayouts/_rels/slideLayout${s+1}.xml.rels`,D0(s+1,this.slideLayouts))}),this.slides.forEach((c,s)=>{l.file(`ppt/slides/slide${s+1}.xml`,S0(c)),l.file(`ppt/slides/_rels/slide${s+1}.xml.rels`,E0(this.slides,this.slideLayouts,s+1)),l.file(`ppt/notesSlides/notesSlide${s+1}.xml`,P0(c)),l.file(`ppt/notesSlides/_rels/notesSlide${s+1}.xml.rels`,B0(s+1))}),l.file("ppt/slideMasters/slideMaster1.xml",T0(this.masterSlide,this.slideLayouts)),l.file("ppt/slideMasters/_rels/slideMaster1.xml.rels",R0(this.masterSlide,this.slideLayouts)),l.file("ppt/notesMasters/notesMaster1.xml",C0()),l.file("ppt/notesMasters/_rels/notesMaster1.xml.rels",L0()),this.slideLayouts.forEach(c=>{this.createChartMediaRels(c,l,a)}),this.slides.forEach(c=>{this.createChartMediaRels(c,l,a)}),this.createChartMediaRels(this.masterSlide,l,a),yield Promise.all(a).then(()=>sr(this,void 0,void 0,function*(){return i.outputType==="STREAM"?yield l.generateAsync({type:"nodebuffer",compression:i.compression?"DEFLATE":"STORE"}):i.outputType?yield l.generateAsync({type:i.outputType}):yield l.generateAsync({type:"blob",compression:i.compression?"DEFLATE":"STORE"})}))}))});let e={name:"screen4x3",width:9144e3,height:6858e3},r={name:"screen16x9",width:9144e3,height:5143500},t={name:"screen16x10",width:9144e3,height:5715e3},n={name:"custom",width:12192e3,height:6858e3};this.LAYOUTS={LAYOUT_4x3:e,LAYOUT_16x9:r,LAYOUT_16x10:t,LAYOUT_WIDE:n},this._author="PptxGenJS",this._company="PptxGenJS",this._revision="1",this._subject="PptxGenJS Presentation",this._title="PptxGenJS Presentation",this._presLayout={name:this.LAYOUTS[ni].name,_sizeW:this.LAYOUTS[ni].width,_sizeH:this.LAYOUTS[ni].height,width:this.LAYOUTS[ni].width,height:this.LAYOUTS[ni].height},this._rtlMode=!1,this._slideLayouts=[{_margin:ra,_name:Vs,_presLayout:this._presLayout,_rels:[],_relsChart:[],_relsMedia:[],_slide:null,_slideNum:1e3,_slideNumberProps:null,_slideObjects:[]}],this._slides=[],this._sections=[],this._masterSlide={addChart:null,addImage:null,addMedia:null,addNotes:null,addShape:null,addTable:null,addText:null,_name:null,_presLayout:this._presLayout,_rId:null,_rels:[],_relsChart:[],_relsMedia:[],_slideId:null,_slideLayout:null,_slideNum:null,_slideNumberProps:null,_slideObjects:[]}}stream(e){return sr(this,void 0,void 0,function*(){return yield this.exportPresentation({compression:e?.compression,outputType:"STREAM"})})}write(e){return sr(this,void 0,void 0,function*(){let r=typeof e=="object"&&e?.outputType?e.outputType:e||null,t=typeof e=="object"&&e?.compression?e.compression:!1;return yield this.exportPresentation({compression:t,outputType:r})})}writeFile(e){return sr(this,void 0,void 0,function*(){var r,t;let n=typeof process<"u"&&!!(!((r=process.versions)===null||r===void 0)&&r.node)&&((t=process.release)===null||t===void 0?void 0:t.name)==="node";typeof e=="string"&&(console.warn("[WARNING] writeFile(string) is deprecated - pass { fileName } instead."),e={fileName:e});let{fileName:i="Presentation.pptx",compression:a=!1}=e,o=i.toLowerCase().endsWith(".pptx")?i:`${i}.pptx`,l=n?"nodebuffer":null,c=yield this.exportPresentation({compression:a,outputType:l});if(n){let{promises:s}=yield Promise.resolve().then(()=>Qr(Mu())),{writeFile:u}=s;return yield u(o,c),o}return yield this.writeFileToBrowser(o,c),o})}addSection(e){e?e.title||console.warn("addSection requires a title"):console.warn("addSection requires an argument");let r={_type:"user",_slides:[],title:e.title};e.order?this.sections.splice(e.order,0,r):this._sections.push(r)}addSlide(e){let r=typeof e=="string"?e:e?.masterName?e.masterName:"",t={_name:this.LAYOUTS[ni].name,_presLayout:this.presLayout,_rels:[],_relsChart:[],_relsMedia:[],_slideNum:this.slides.length+1};if(r){let i=this.slideLayouts.filter(a=>a._name===r)[0];i&&(t=i)}let n=new d0({addSlide:this.addNewSlide,getSlide:this.getSlide,presLayout:this.presLayout,setSlideNum:this.setSlideNumber,slideId:this.slides.length+256,slideRId:this.slides.length+2,slideNumber:this.slides.length+1,slideLayout:t});if(this._slides.push(n),e?.sectionTitle){let i=this.sections.filter(a=>a.title===e.sectionTitle)[0];i?i._slides.push(n):console.warn(`addSlide: unable to find section with title: "${e.sectionTitle}"`)}else if(this.sections&&this.sections.length>0&&!e?.sectionTitle){let i=this._sections[this.sections.length-1];i._type==="default"?i._slides.push(n):this._sections.push({title:`Default-${this.sections.filter(a=>a._type==="default").length+1}`,_type:"default",_slides:[n]})}return n}defineLayout(e){e?e.name?e.width?e.height?typeof e.height!="number"?console.warn("defineLayout `height` should be a number (inches)"):typeof e.width!="number"&&console.warn("defineLayout `width` should be a number (inches)"):console.warn("defineLayout requires `height`"):console.warn("defineLayout requires `width`"):console.warn("defineLayout requires `name`"):console.warn("defineLayout requires `{name, width, height}`"),this.LAYOUTS[e.name]={name:e.name,_sizeW:Math.round(Number(e.width)*Ke),_sizeH:Math.round(Number(e.height)*Ke),width:Math.round(Number(e.width)*Ke),height:Math.round(Number(e.height)*Ke)}}defineSlideMaster(e){let r=JSON.parse(JSON.stringify(e));if(!r.title)throw new Error("defineSlideMaster() object argument requires a `title` value. (https://gitbrent.github.io/PptxGenJS/docs/masters.html)");let t={_margin:r.margin||ra,_name:r.title,_presLayout:this.presLayout,_rels:[],_relsChart:[],_relsMedia:[],_slide:null,_slideNum:1e3+this.slideLayouts.length+1,_slideNumberProps:r.slideNumber||null,_slideObjects:[],background:r.background||null,bkgd:r.bkgd||null};o0(r,t),this.slideLayouts.push(t),(r.background||r.bkgd)&&Hd(r.background,t),t._slideNumberProps&&!this.masterSlide._slideNumberProps&&(this.masterSlide._slideNumberProps=t._slideNumberProps)}tableToSlides(e,r={}){i0(this,e,r,r?.masterSlideName?this.slideLayouts.filter(t=>t._name===r.masterSlideName)[0]:null)}},$s=96,Pu=914400,G0=13.333,Fu=7.5;function Rs(e,r){return Math.min(r,Math.max(.15,G0-e-.04))}function Qd(e){let r=String(e||"").trim();return r?r.startsWith("data:")?{data:r}:r.startsWith("file://")?{path:r.replace("file://","")}:{path:r}:null}function j0(e,r){let t=[],n=e.width/$s,i=e.height/$s;if(r.presLayout){let a=r.presLayout.width/Pu,o=r.presLayout.height/Pu;(Math.abs(a-n)>.1||Math.abs(o-i)>.1)&&t.push(`HTML dimensions (${n.toFixed(1)}" \xD7 ${i.toFixed(1)}") don't match presentation layout (${a.toFixed(1)}" \xD7 ${o.toFixed(1)}")`)}return t}function q0(e,r){let t=[],n=r.height/$s,i=.5;for(let a of e.elements){if(!["p","h1","h2","h3","h4","h5","h6","text","list","merged-text"].includes(a.type))continue;let o=a.style?.fontSize||0,l=a.position.y+a.position.h,c=n-l,s=typeof a.text=="string"?a.text:Array.isArray(a.text)?a.text.find(d=>d.text)?.text||"":Array.isArray(a.items)&&a.items.find(d=>d.text)?.text||"";if(!(/^\d{1,2}\s*\/\s*\d{1,2}$/.test(s.trim())||/^(Arknights|数据来源|source:)/i.test(s.trim())||o<=11)&&o>12&&c50?"...":""}`;t.push(`Text box "${d}" ends too close to bottom edge (${c.toFixed(2)}" from bottom, minimum ${i}" required)`)}}return t}async function V0(e,r){if(e.background?.type==="image"&&e.background.path){let t=Qd(e.background.path);t&&(r.background=t)}else e.background?.type==="color"&&e.background.value&&(r.background={color:e.background.value})}function X0(e,r,t){for(let n of e.elements)if(n.type==="image"){let i=Qd(n.src);if(!i)continue;r.addImage({...i,x:n.position.x,y:n.position.y,w:n.position.w,h:n.position.h})}else if(n.type==="line")r.addShape(t.ShapeType.line,{x:n.x1,y:n.y1,w:n.x2-n.x1,h:n.y2-n.y1,line:{color:n.color,width:n.width}});else if(n.type==="shape"){let i={x:n.position.x,y:n.position.y,w:n.position.w,h:n.position.h,shape:n.shape.rectRadius>0?t.ShapeType.roundRect:t.ShapeType.rect};n.shape.fill&&(i.fill={color:n.shape.fill},n.shape.transparency!=null&&(i.fill.transparency=n.shape.transparency)),n.shape.line&&(i.line=n.shape.line),n.shape.rectRadius>0&&(i.rectRadius=n.shape.rectRadius),n.shape.shadow&&(i.shadow=n.shape.shadow),r.addText(n.text||"",i)}else if(n.type==="list"||n.type==="merged-text"){let i={x:n.position.x,y:n.position.y,w:Rs(n.position.x,n.position.w+n.position.w*.04),h:Math.min(n.position.h,Math.max(.15,Fu-n.position.y-.04)),fontSize:n.style.fontSize,fontFace:n.style.fontFace,color:n.style.color,align:n.style.align,valign:"top",lineSpacing:n.style.lineSpacing,paraSpaceBefore:n.style.paraSpaceBefore,paraSpaceAfter:n.style.paraSpaceAfter,margin:n.style.margin,inset:0,shrinkText:!1,autoFit:!1};n.style.transparency!=null&&(i.transparency=n.style.transparency),r.addText(n.items||n.text,i)}else{let i=n.style.lineSpacing||n.style.fontSize*1.2,a=n.position.h<=i*1.5,o=n.style.vert&&n.style.vert!=="horz",l=o?0:n.position.w*(a?.02:.06),c=n.position.x,s=Rs(n.position.x,n.position.w+l),u=n.style.align;!o&&u==="center"?c=n.position.x-(s-n.position.w)/2:!o&&u==="right"&&(c=n.position.x-(s-n.position.w)),c=Math.max(0,c),s=Rs(c,s);let d={x:c,y:n.position.y,w:s,h:Math.min(n.position.h,Math.max(.15,Fu-n.position.y-.04)),fontSize:n.style.fontSize,fontFace:n.style.fontFace,color:n.style.color,bold:n.style.bold,italic:n.style.italic,underline:n.style.underline,valign:o?"mid":n.style.valign||"top",lineSpacing:n.style.lineSpacing,paraSpaceBefore:n.style.paraSpaceBefore,paraSpaceAfter:n.style.paraSpaceAfter,inset:0,shrinkText:!1,autoFit:!1};n.style.align&&(d.align=n.style.align),n.style.margin&&(d.margin=n.style.margin),n.style.rotate!==void 0&&(d.rotate=n.style.rotate),n.style.vert&&(d.vert=n.style.vert),n.style.transparency!=null&&n.style.transparency!==void 0&&(d.transparency=n.style.transparency),r.addText(n.text,d)}}async function H0(e,r,t,n={}){let i=[];r?.errors?.length&&i.push(...r.errors),i.push(...j0(r,t)),i.push(...q0(e,r)),e?.errors?.length&&i.push(...e.errors),i.length&&console.warn("[ppt-live-export] slide validation warnings (export continues):",i.join("; "));let a=n.slide||t.addSlide();return await V0(e,a),X0(e,a,t),{slide:a,placeholders:e.placeholders||[]}}function Zd(e={}){let r=new W0;return r.layout="LAYOUT_WIDE",r.author="PPT Live",r.subject=e.brief?.topic||e.title||"PPT Live deck",r.title=e.title||"PPT Live",r.company="BitFun",r.lang="zh-CN",r.theme={headFontFace:"PingFang SC",bodyFontFace:"PingFang SC",lang:"zh-CN"},r}function Yd(e={}){return[e.notes,e.claim?`Claim: ${e.claim}`:"",e.proofObject?`Proof object: ${e.proofObject}`:"",e.supportNote?`Support note: ${e.supportNote}`:"",e.sourceNote?`Source note: ${e.sourceNote}`:""].filter(Boolean).join(` + `}function _0(e,r,t){for(let n=0;n`:'',o=!((n=e.theme)===null||n===void 0)&&n.bodyFontFace?``:'';return`${a}${o}`}function W0(e){let r=`${Wt}`;r+='',r+="",e.slides.forEach(t=>r+=``),r+="",r+=``,r+=``,r+=``,r+="";for(let t=1;t<10;t++)r+=``;return r+="",e.sections&&e.sections.length>0&&(r+='',r+='',e.sections.forEach(t=>{r+=``,t._slides.forEach(n=>r+=``),r+=""}),r+="",r+='',r+=""),r+="",r}function G0(){return`${Wt}`}function j0(){return`${Wt}`}function q0(){return`${Wt}`}var V0="4.0.1",X0=class{set layout(e){let r=this.LAYOUTS[e];if(r)this._layout=e,this._presLayout=r;else throw new Error("UNKNOWN-LAYOUT")}get layout(){return this._layout}get version(){return this._version}set author(e){this._author=e}get author(){return this._author}set company(e){this._company=e}get company(){return this._company}set revision(e){this._revision=e}get revision(){return this._revision}set subject(e){this._subject=e}get subject(){return this._subject}set theme(e){this._theme=e}get theme(){return this._theme}set title(e){this._title=e}get title(){return this._title}set rtlMode(e){this._rtlMode=e}get rtlMode(){return this._rtlMode}get masterSlide(){return this._masterSlide}get slides(){return this._slides}get sections(){return this._sections}get slideLayouts(){return this._slideLayouts}get AlignH(){return this._alignH}get AlignV(){return this._alignV}get ChartType(){return this._chartType}get OutputType(){return this._outputType}get presLayout(){return this._presLayout}get SchemeColor(){return this._schemeColor}get ShapeType(){return this._shapeType}get charts(){return this._charts}get colors(){return this._colors}get shapes(){return this._shapes}constructor(){this._version=V0,this._alignH=Ys,this._alignV=Js,this._chartType=Qs,this._outputType=Ks,this._schemeColor=or,this._shapeType=Zs,this._charts=Ce,this._colors=yo,this._shapes=xn,this.addNewSlide=i=>{let a=this.sections.length>0&&this.sections[this.sections.length-1]._slides.filter(o=>o._slideNum===this.slides[this.slides.length-1]._slideNum).length>0;return i.sectionTitle=a?this.sections[this.sections.length-1].title:null,this.addSlide(i)},this.getSlide=i=>this.slides.filter(a=>a._slideNum===i)[0],this.setSlideNumber=i=>{this.masterSlide._slideNumberProps=i,this.slideLayouts.filter(a=>a._name===Xs)[0]._slideNumberProps=i},this.createChartMediaRels=(i,a,o)=>{i._relsChart.forEach(l=>o.push(m0(l,a))),i._relsMedia.forEach(l=>{if(l.type!=="online"&&l.type!=="hyperlink"){let c=l.data&&typeof l.data=="string"?l.data:"";!c.includes(",")&&!c.includes(";")?c="image/png;base64,"+c:c.includes(",")?c.includes(";")||(c="image/png;"+c):c="image/png;base64,"+c,a.file(l.Target.replace("..","ppt"),c.split(",").pop(),{base64:!0})}})},this.writeFileToBrowser=(i,a)=>sr(this,void 0,void 0,function*(){let o=document.createElement("a");if(o.setAttribute("style","display:none;"),o.dataset.interception="off",document.body.appendChild(o),window.URL.createObjectURL){let l=window.URL.createObjectURL(new Blob([a],{type:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}));return o.href=l,o.download=i,o.click(),setTimeout(()=>{window.URL.revokeObjectURL(l),document.body.removeChild(o)},100),yield Promise.resolve(i)}}),this.exportPresentation=i=>sr(this,void 0,void 0,function*(){let a=[],o=[],l=new _d.default;return this.slides.forEach(c=>{o=o.concat(Rs(c))}),this.slideLayouts.forEach(c=>{o=o.concat(Rs(c))}),o=o.concat(Rs(this.masterSlide)),yield Promise.all(o).then(()=>sr(this,void 0,void 0,function*(){return this.slides.forEach(c=>{c._slideLayout&&A0(c)}),l.folder("_rels"),l.folder("docProps"),l.folder("ppt").folder("_rels"),l.folder("ppt/charts").folder("_rels"),l.folder("ppt/embeddings"),l.folder("ppt/media"),l.folder("ppt/slideLayouts").folder("_rels"),l.folder("ppt/slideMasters").folder("_rels"),l.folder("ppt/slides").folder("_rels"),l.folder("ppt/theme"),l.folder("ppt/notesMasters").folder("_rels"),l.folder("ppt/notesSlides").folder("_rels"),l.file("[Content_Types].xml",S0(this.slides,this.slideLayouts,this.masterSlide)),l.file("_rels/.rels",k0()),l.file("docProps/app.xml",C0(this.slides,this.company)),l.file("docProps/core.xml",P0(this.title,this.subject,this.author,this.revision)),l.file("ppt/_rels/presentation.xml.rels",F0(this.slides)),l.file("ppt/theme/theme1.xml",U0(this)),l.file("ppt/presentation.xml",W0(this)),l.file("ppt/presProps.xml",G0()),l.file("ppt/tableStyles.xml",j0()),l.file("ppt/viewProps.xml",q0()),this.slideLayouts.forEach((c,s)=>{l.file(`ppt/slideLayouts/slideLayout${s+1}.xml`,R0(c)),l.file(`ppt/slideLayouts/_rels/slideLayout${s+1}.xml.rels`,N0(s+1,this.slideLayouts))}),this.slides.forEach((c,s)=>{l.file(`ppt/slides/slide${s+1}.xml`,T0(c)),l.file(`ppt/slides/_rels/slide${s+1}.xml.rels`,I0(this.slides,this.slideLayouts,s+1)),l.file(`ppt/notesSlides/notesSlide${s+1}.xml`,B0(c)),l.file(`ppt/notesSlides/_rels/notesSlide${s+1}.xml.rels`,z0(s+1))}),l.file("ppt/slideMasters/slideMaster1.xml",L0(this.masterSlide,this.slideLayouts)),l.file("ppt/slideMasters/_rels/slideMaster1.xml.rels",M0(this.masterSlide,this.slideLayouts)),l.file("ppt/notesMasters/notesMaster1.xml",E0()),l.file("ppt/notesMasters/_rels/notesMaster1.xml.rels",O0()),this.slideLayouts.forEach(c=>{this.createChartMediaRels(c,l,a)}),this.slides.forEach(c=>{this.createChartMediaRels(c,l,a)}),this.createChartMediaRels(this.masterSlide,l,a),yield Promise.all(a).then(()=>sr(this,void 0,void 0,function*(){return i.outputType==="STREAM"?yield l.generateAsync({type:"nodebuffer",compression:i.compression?"DEFLATE":"STORE"}):i.outputType?yield l.generateAsync({type:i.outputType}):yield l.generateAsync({type:"blob",compression:i.compression?"DEFLATE":"STORE"})}))}))});let e={name:"screen4x3",width:9144e3,height:6858e3},r={name:"screen16x9",width:9144e3,height:5143500},t={name:"screen16x10",width:9144e3,height:5715e3},n={name:"custom",width:12192e3,height:6858e3};this.LAYOUTS={LAYOUT_4x3:e,LAYOUT_16x9:r,LAYOUT_16x10:t,LAYOUT_WIDE:n},this._author="PptxGenJS",this._company="PptxGenJS",this._revision="1",this._subject="PptxGenJS Presentation",this._title="PptxGenJS Presentation",this._presLayout={name:this.LAYOUTS[ni].name,_sizeW:this.LAYOUTS[ni].width,_sizeH:this.LAYOUTS[ni].height,width:this.LAYOUTS[ni].width,height:this.LAYOUTS[ni].height},this._rtlMode=!1,this._slideLayouts=[{_margin:na,_name:Xs,_presLayout:this._presLayout,_rels:[],_relsChart:[],_relsMedia:[],_slide:null,_slideNum:1e3,_slideNumberProps:null,_slideObjects:[]}],this._slides=[],this._sections=[],this._masterSlide={addChart:null,addImage:null,addMedia:null,addNotes:null,addShape:null,addTable:null,addText:null,_name:null,_presLayout:this._presLayout,_rId:null,_rels:[],_relsChart:[],_relsMedia:[],_slideId:null,_slideLayout:null,_slideNum:null,_slideNumberProps:null,_slideObjects:[]}}stream(e){return sr(this,void 0,void 0,function*(){return yield this.exportPresentation({compression:e?.compression,outputType:"STREAM"})})}write(e){return sr(this,void 0,void 0,function*(){let r=typeof e=="object"&&e?.outputType?e.outputType:e||null,t=typeof e=="object"&&e?.compression?e.compression:!1;return yield this.exportPresentation({compression:t,outputType:r})})}writeFile(e){return sr(this,void 0,void 0,function*(){var r,t;let n=typeof process<"u"&&!!(!((r=process.versions)===null||r===void 0)&&r.node)&&((t=process.release)===null||t===void 0?void 0:t.name)==="node";typeof e=="string"&&(console.warn("[WARNING] writeFile(string) is deprecated - pass { fileName } instead."),e={fileName:e});let{fileName:i="Presentation.pptx",compression:a=!1}=e,o=i.toLowerCase().endsWith(".pptx")?i:`${i}.pptx`,l=n?"nodebuffer":null,c=yield this.exportPresentation({compression:a,outputType:l});if(n){let{promises:s}=yield Promise.resolve().then(()=>Qr(Mu())),{writeFile:u}=s;return yield u(o,c),o}return yield this.writeFileToBrowser(o,c),o})}addSection(e){e?e.title||console.warn("addSection requires a title"):console.warn("addSection requires an argument");let r={_type:"user",_slides:[],title:e.title};e.order?this.sections.splice(e.order,0,r):this._sections.push(r)}addSlide(e){let r=typeof e=="string"?e:e?.masterName?e.masterName:"",t={_name:this.LAYOUTS[ni].name,_presLayout:this.presLayout,_rels:[],_relsChart:[],_relsMedia:[],_slideNum:this.slides.length+1};if(r){let i=this.slideLayouts.filter(a=>a._name===r)[0];i&&(t=i)}let n=new g0({addSlide:this.addNewSlide,getSlide:this.getSlide,presLayout:this.presLayout,setSlideNum:this.setSlideNumber,slideId:this.slides.length+256,slideRId:this.slides.length+2,slideNumber:this.slides.length+1,slideLayout:t});if(this._slides.push(n),e?.sectionTitle){let i=this.sections.filter(a=>a.title===e.sectionTitle)[0];i?i._slides.push(n):console.warn(`addSlide: unable to find section with title: "${e.sectionTitle}"`)}else if(this.sections&&this.sections.length>0&&!e?.sectionTitle){let i=this._sections[this.sections.length-1];i._type==="default"?i._slides.push(n):this._sections.push({title:`Default-${this.sections.filter(a=>a._type==="default").length+1}`,_type:"default",_slides:[n]})}return n}defineLayout(e){e?e.name?e.width?e.height?typeof e.height!="number"?console.warn("defineLayout `height` should be a number (inches)"):typeof e.width!="number"&&console.warn("defineLayout `width` should be a number (inches)"):console.warn("defineLayout requires `height`"):console.warn("defineLayout requires `width`"):console.warn("defineLayout requires `name`"):console.warn("defineLayout requires `{name, width, height}`"),this.LAYOUTS[e.name]={name:e.name,_sizeW:Math.round(Number(e.width)*Ke),_sizeH:Math.round(Number(e.height)*Ke),width:Math.round(Number(e.width)*Ke),height:Math.round(Number(e.height)*Ke)}}defineSlideMaster(e){let r=JSON.parse(JSON.stringify(e));if(!r.title)throw new Error("defineSlideMaster() object argument requires a `title` value. (https://gitbrent.github.io/PptxGenJS/docs/masters.html)");let t={_margin:r.margin||na,_name:r.title,_presLayout:this.presLayout,_rels:[],_relsChart:[],_relsMedia:[],_slide:null,_slideNum:1e3+this.slideLayouts.length+1,_slideNumberProps:r.slideNumber||null,_slideObjects:[],background:r.background||null,bkgd:r.bkgd||null};d0(r,t),this.slideLayouts.push(t),(r.background||r.bkgd)&&Hd(r.background,t),t._slideNumberProps&&!this.masterSlide._slideNumberProps&&(this.masterSlide._slideNumberProps=t._slideNumberProps)}tableToSlides(e,r={}){c0(this,e,r,r?.masterSlideName?this.slideLayouts.filter(t=>t._name===r.masterSlideName)[0]:null)}},el=96,Pu=914400,H0=13.333,Fu=7.5;function Ls(e,r){return Math.min(r,Math.max(.15,H0-e-.04))}function Qd(e){let r=String(e||"").trim();return r?r.startsWith("data:")?{data:r}:r.startsWith("file://")?{path:r.replace("file://","")}:{path:r}:null}function K0(e,r){let t=[],n=e.width/el,i=e.height/el;if(r.presLayout){let a=r.presLayout.width/Pu,o=r.presLayout.height/Pu;(Math.abs(a-n)>.1||Math.abs(o-i)>.1)&&t.push(`HTML dimensions (${n.toFixed(1)}" \xD7 ${i.toFixed(1)}") don't match presentation layout (${a.toFixed(1)}" \xD7 ${o.toFixed(1)}")`)}return t}function Q0(e,r){let t=[],n=r.height/el,i=.5;for(let a of e.elements){if(!["p","h1","h2","h3","h4","h5","h6","text","list","merged-text"].includes(a.type))continue;let o=a.style?.fontSize||0,l=a.position.y+a.position.h,c=n-l,s=typeof a.text=="string"?a.text:Array.isArray(a.text)?a.text.find(d=>d.text)?.text||"":Array.isArray(a.items)&&a.items.find(d=>d.text)?.text||"";if(!(/^\d{1,2}\s*\/\s*\d{1,2}$/.test(s.trim())||/^(Arknights|数据来源|source:)/i.test(s.trim())||o<=11)&&o>12&&c50?"...":""}`;t.push(`Text box "${d}" ends too close to bottom edge (${c.toFixed(2)}" from bottom, minimum ${i}" required)`)}}return t}async function Z0(e,r){if(e.background?.type==="image"&&e.background.path){let t=Qd(e.background.path);t&&(r.background=t)}else e.background?.type==="color"&&e.background.value&&(r.background={color:e.background.value})}function Y0(e,r,t){for(let n of e.elements)if(n.type==="image"){let i=Qd(n.src);if(!i)continue;r.addImage({...i,x:n.position.x,y:n.position.y,w:n.position.w,h:n.position.h})}else if(n.type==="line")r.addShape(t.ShapeType.line,{x:n.x1,y:n.y1,w:n.x2-n.x1,h:n.y2-n.y1,line:{color:n.color,width:n.width}});else if(n.type==="shape"){let i={x:n.position.x,y:n.position.y,w:n.position.w,h:n.position.h,shape:n.shape.rectRadius>0?t.ShapeType.roundRect:t.ShapeType.rect};n.shape.fill&&(i.fill={color:n.shape.fill},n.shape.transparency!=null&&(i.fill.transparency=n.shape.transparency)),n.shape.line&&(i.line=n.shape.line),n.shape.rectRadius>0&&(i.rectRadius=n.shape.rectRadius),n.shape.shadow&&(i.shadow=n.shape.shadow),r.addText(n.text||"",i)}else if(n.type==="list"||n.type==="merged-text"){let i={x:n.position.x,y:n.position.y,w:Ls(n.position.x,n.position.w+n.position.w*.04),h:Math.min(n.position.h,Math.max(.15,Fu-n.position.y-.04)),fontSize:n.style.fontSize,fontFace:n.style.fontFace,color:n.style.color,align:n.style.align,valign:"top",lineSpacing:n.style.lineSpacing,paraSpaceBefore:n.style.paraSpaceBefore,paraSpaceAfter:n.style.paraSpaceAfter,margin:n.style.margin,inset:0,shrinkText:!1,autoFit:!1};n.style.transparency!=null&&(i.transparency=n.style.transparency),r.addText(n.items||n.text,i)}else{let i=n.style.lineSpacing||n.style.fontSize*1.2,a=n.position.h<=i*1.5,o=n.style.vert&&n.style.vert!=="horz",l=o?0:n.position.w*(a?.02:.06),c=n.position.x,s=Ls(n.position.x,n.position.w+l),u=n.style.align;!o&&u==="center"?c=n.position.x-(s-n.position.w)/2:!o&&u==="right"&&(c=n.position.x-(s-n.position.w)),c=Math.max(0,c),s=Ls(c,s);let d={x:c,y:n.position.y,w:s,h:Math.min(n.position.h,Math.max(.15,Fu-n.position.y-.04)),fontSize:n.style.fontSize,fontFace:n.style.fontFace,color:n.style.color,bold:n.style.bold,italic:n.style.italic,underline:n.style.underline,valign:o?"mid":n.style.valign||"top",lineSpacing:n.style.lineSpacing,paraSpaceBefore:n.style.paraSpaceBefore,paraSpaceAfter:n.style.paraSpaceAfter,inset:0,shrinkText:!1,autoFit:!1};n.style.align&&(d.align=n.style.align),n.style.margin&&(d.margin=n.style.margin),n.style.rotate!==void 0&&(d.rotate=n.style.rotate),n.style.vert&&(d.vert=n.style.vert),n.style.transparency!=null&&n.style.transparency!==void 0&&(d.transparency=n.style.transparency),r.addText(n.text,d)}}async function J0(e,r,t,n={}){let i=[];r?.errors?.length&&i.push(...r.errors),i.push(...K0(r,t)),i.push(...Q0(e,r)),e?.errors?.length&&i.push(...e.errors),i.length&&console.warn("[ppt-live-export] slide validation warnings (export continues):",i.join("; "));let a=n.slide||t.addSlide();return await Z0(e,a),Y0(e,a,t),{slide:a,placeholders:e.placeholders||[]}}function Zd(e={}){let r=new X0;return r.layout="LAYOUT_WIDE",r.author="PPT Live",r.subject=e.brief?.topic||e.title||"PPT Live deck",r.title=e.title||"PPT Live",r.company="BitFun",r.lang="zh-CN",r.theme={headFontFace:"PingFang SC",bodyFontFace:"PingFang SC",lang:"zh-CN"},r}function Yd(e={}){return[e.notes,e.claim?`Claim: ${e.claim}`:"",e.proofObject?`Proof object: ${e.proofObject}`:"",e.supportNote?`Support note: ${e.supportNote}`:"",e.sourceNote?`Source note: ${e.sourceNote}`:""].filter(Boolean).join(` -`)}var el=13.333,yo=7.5;function K0(e,r,t,n){r.addShape(e.ShapeType.rect,{x:0,y:0,w:el,h:yo,fill:{color:kt(t.background)},line:{color:kt(t.background),transparency:100}}),r.addShape(e.ShapeType.ellipse,{x:10.3,y:-.45,w:3.8,h:3.8,fill:{color:kt(n%2?t.accent:t.primary),transparency:84},line:{color:kt(t.background),transparency:100}}),r.addShape(e.ShapeType.rect,{x:0,y:0,w:.12,h:yo,fill:{color:kt(t.primary),transparency:0},line:{color:kt(t.primary),transparency:100}})}function Q0(e,r,t,n){t.kicker&&(r.addShape(e.ShapeType.roundRect,{x:.96,y:.48,w:.22,h:.07,fill:{color:kt(n.primary)},line:{color:kt(n.primary),transparency:100}}),r.addText(String(t.kicker).toUpperCase(),{x:1.24,y:.36,w:2.4,h:.28,margin:0,fontFace:"Aptos",fontSize:7,bold:!0,color:kt(n.primary),fit:"shrink"})),t.proofObject&&r.addText(String(t.proofObject),{x:9.26,y:.34,w:2.95,h:.32,margin:.04,fontFace:"Aptos",fontSize:7,bold:!0,color:kt(n.muted),align:"right",fit:"shrink",fill:{color:kt(n.panel),transparency:8},line:{color:kt(n.primary),transparency:78}}),t.sourceNote&&r.addText(String(t.sourceNote),{x:.96,y:7.05,w:10.7,h:.2,margin:0,fontFace:"Aptos",fontSize:6,color:kt(n.muted),fit:"shrink"})}function Z0(e,r,t,n){let i=ey(t),a=t.style||{},o={x:i.x,y:i.y,w:i.w,h:i.h,margin:.08,fit:"shrink",color:kt(pn(a.color,n)),fontFace:"Aptos",fontSize:Du(a.fontSize||22),bold:Number(a.fontWeight||500)>=700,align:a.align||"left",valign:"mid",breakLine:!1};if(t.type==="shape"){r.addShape(e.ShapeType.roundRect,{...i,rectRadius:.08,fill:{color:kt(pn(a.background,n)),transparency:Tl(a.opacity)},line:{color:kt(pn(a.background,n)),transparency:100}}),t.text&&r.addText(t.text,o);return}if(t.type==="list"){let l=(t.items||[]).map(c=>({text:c,options:{bullet:{type:"bullet"},breakLine:!0}}));r.addText(l.length?l:[{text:""}],{...o,valign:"top",paraSpaceAfterPt:6,fit:"shrink"});return}if(t.type==="metric"){Tu(e,r,i,a,n),r.addText(String(t.text||""),{...o,y:i.y+.08,h:i.h*.48,color:kt(pn(a.color||"primary",n)),fontSize:Du(a.fontSize||42),bold:!0}),r.addText(String(t.label||""),{...o,y:i.y+i.h*.56,h:i.h*.34,color:kt(n.muted),fontSize:10,bold:!1,valign:"top"});return}if(t.type==="chart"){Tu(e,r,i,a,n),r.addText(String(t.text||""),{...o,y:i.y+.1,h:.32,fontSize:11,bold:!0}),J0(e,r,t,i,n);return}if(t.type==="media"){r.addShape(e.ShapeType.roundRect,{...i,fill:{color:kt(pn(a.background||"soft",n)),transparency:10},line:{color:kt(n.primary),transparency:55,dash:"dash"}}),r.addText(String(t.text||"Image placeholder"),{...o,align:"center",color:kt(n.muted),fontSize:12});return}Y0(e,r,i,a,n),r.addText(String(t.text||""),o)}function Tu(e,r,t,n,i){r.addShape(e.ShapeType.roundRect,{...t,fill:{color:kt(pn(n.background||"panel",i)),transparency:Tl(n.opacity)},line:{color:kt(i.primary),transparency:82},shadow:{type:"outer",color:"111827",opacity:.12,blur:1,angle:45,distance:1}})}function Y0(e,r,t,n,i){let a=n.background||"transparent";a!=="transparent"&&r.addShape(e.ShapeType.roundRect,{...t,fill:{color:kt(pn(a,i)),transparency:Tl(n.opacity)},line:{color:kt(pn(a,i)),transparency:100}})}function J0(e,r,t,n,i){let a=Array.isArray(t.data)&&t.data.length?t.data:[{label:"A",value:40},{label:"B",value:70}],o=Math.max(1,...a.map(f=>Number(f.value)||0)),l=.1,c=n.x+.18,s=n.y+.68,u=n.w-.36,d=n.h-.95,A=Math.max(.08,(u-l*(a.length-1))/a.length);a.forEach((f,p)=>{let g=Number(f.value)||0,y=Math.max(.15,g/o*d),v=c+p*(A+l),b=s+d-y;r.addShape(e.ShapeType.rect,{x:v,y:b,w:A,h:y,fill:{color:kt(p%2?i.accent:i.primary)},line:{color:kt(p%2?i.accent:i.primary),transparency:100}}),r.addText(String(f.label||""),{x:v-.03,y:s+d+.04,w:A+.06,h:.2,fontSize:7,color:kt(i.muted),align:"center",margin:0,fit:"shrink"})})}function $0(e={}){return{background:e.background||"#fbfcff",ink:e.ink||"#111827",muted:e.muted||"#5b6575",primary:e.primary||"#0f766e",accent:e.accent||"#f97316",panel:e.panel||"#ffffff"}}function ey(e){return{x:Ha(e.x)*el,y:Ha(e.y)*yo,w:Ha(e.w)*el,h:Ha(e.h)*yo}}function Ha(e){return Math.max(0,Math.min(100,Number(e)||0))/100}function Du(e){return Math.max(6,Math.min(66,Math.round((Number(e)||22)*.58)))}function pn(e,r){return!e||e==="transparent"?r.background:e==="ink"?r.ink:e==="muted"?r.muted:e==="primary"?r.primary:e==="accent"?r.accent:e==="panel"?r.panel:e==="soft"?r.primary:e==="background"?r.background:e}function kt(e){let r=String(e||"#111827").trim();return/^#[0-9a-f]{6}$/i.test(r)?r.slice(1).toUpperCase():/^[0-9a-f]{6}$/i.test(r)?r.toUpperCase():/^#[0-9a-f]{3}$/i.test(r)?r.slice(1).split("").map(t=>t+t).join("").toUpperCase():"111827"}function Tl(e){return Math.round((1-Math.max(0,Math.min(1,Number(e??1))))*100)}async function ty(e){let r=Array.isArray(e.slides)&&e.slides.length>0?e.slides:[],t=Zd(e);return r.forEach((n,i)=>{let a=t.addSlide(),o=$0(n.theme);a.background={color:kt(o.background)},K0(t,a,o,i),Q0(t,a,n,o),(n.elements||[]).forEach(c=>Z0(t,a,c,o));let l=Yd(n);l&&typeof a.addNotes=="function"&&a.addNotes(l)}),t}var ry="application/vnd.openxmlformats-officedocument.presentationml.presentation",Jd=new Set(["p","h1","h2","h3","h4","h5","h6","text","list","merged-text"]);function ny(e){return{...e,elements:(e.elements||[]).filter(r=>Jd.has(r.type))}}function iy(e){let t="";for(let n=0;n|]+/g,"-").slice(0,96)}async function $d(e,r){let t=await e.write({outputType:"base64"});return{filename:`${Dl(r.title||"ppt-live")}.pptx`,mimeType:ry,base64:String(t||"").replace(/^data:.*;base64,/,"")}}async function El(e){if((Array.isArray(e?.slides)?e.slides:[]).some(n=>n?.html))throw new Error("HTML slides must use the WebView prepare export path.");let t=await ty(e);return $d(t,e)}async function Bl(e,r){let t=Array.isArray(r)?r:[];if(!t.length)throw new Error("No prepared slides to export");let n=Zd(e),i=Array.isArray(e?.slides)?e.slides:[];for(let a of t){let o=i[a.index]||a.notes||{},l=a.slideData;if(a.rasterBase64){let u=String(a.rasterBase64).replace(/^data:.*;base64,/,"");a.rasterOnly?l={...l,elements:(l.elements||[]).filter(d=>!Jd.has(d.type)),background:{type:"image",path:`data:image/png;base64,${u}`}}:(l=ny(l),l={...l,background:{type:"image",path:`data:image/png;base64,${u}`}})}let c=await H0(l,a.bodyDimensions,n),s=Yd(o);s&&c?.slide&&typeof c.slide.addNotes=="function"&&c.slide.addNotes(s)}return $d(n,e)}async function Rl(e,r){let t=Array.isArray(r)?r:[];if(!t.length)throw new Error("No rendered PDF pages to export");let n=await Zr.create();for(let a of t){let o=String(a||"").replace(/^data:.*;base64,/,""),l=Uint8Array.from(atob(o),u=>u.charCodeAt(0)),c=await Zr.load(l);(await n.copyPages(c,c.getPageIndices())).forEach(u=>n.addPage(u))}let i=await n.save();return{filename:`${Dl(e?.title||"ppt-live")}.pdf`,mimeType:"application/pdf",base64:iy(i)}}async function Ll(e,r){let t=Array.isArray(r)?r:[];if(!t.length)throw new Error("No rendered PNG pages to export");let n=new Kv.default;t.forEach((a,o)=>{let l=typeof a=="string"?a:String(a?.base64||"").replace(/^data:.*;base64,/,""),c=(a?.index??o)+1;n.file(`slide-${String(c).padStart(2,"0")}.png`,l,{base64:!0})});let i=await n.generateAsync({type:"base64",compression:"DEFLATE"});return{filename:`${Dl(e?.title||"ppt-live")}-slides.zip`,mimeType:"application/zip",base64:String(i||"").replace(/^data:.*;base64,/,"")}}function ay(e){if((e.slides||[]).some(t=>t.html))return oy(e);let r=e.slides.map(t=>`
            ${un(t)}
            `).join(` +`)}var tl=13.333,wo=7.5;function $0(e,r,t,n){r.addShape(e.ShapeType.rect,{x:0,y:0,w:tl,h:wo,fill:{color:kt(t.background)},line:{color:kt(t.background),transparency:100}}),r.addShape(e.ShapeType.ellipse,{x:10.3,y:-.45,w:3.8,h:3.8,fill:{color:kt(n%2?t.accent:t.primary),transparency:84},line:{color:kt(t.background),transparency:100}}),r.addShape(e.ShapeType.rect,{x:0,y:0,w:.12,h:wo,fill:{color:kt(t.primary),transparency:0},line:{color:kt(t.primary),transparency:100}})}function ey(e,r,t,n){t.kicker&&(r.addShape(e.ShapeType.roundRect,{x:.96,y:.48,w:.22,h:.07,fill:{color:kt(n.primary)},line:{color:kt(n.primary),transparency:100}}),r.addText(String(t.kicker).toUpperCase(),{x:1.24,y:.36,w:2.4,h:.28,margin:0,fontFace:"Aptos",fontSize:7,bold:!0,color:kt(n.primary),fit:"shrink"})),t.proofObject&&r.addText(String(t.proofObject),{x:9.26,y:.34,w:2.95,h:.32,margin:.04,fontFace:"Aptos",fontSize:7,bold:!0,color:kt(n.muted),align:"right",fit:"shrink",fill:{color:kt(n.panel),transparency:8},line:{color:kt(n.primary),transparency:78}}),t.sourceNote&&r.addText(String(t.sourceNote),{x:.96,y:7.05,w:10.7,h:.2,margin:0,fontFace:"Aptos",fontSize:6,color:kt(n.muted),fit:"shrink"})}function ty(e,r,t,n){let i=ay(t),a=t.style||{},o={x:i.x,y:i.y,w:i.w,h:i.h,margin:.08,fit:"shrink",color:kt(pn(a.color,n)),fontFace:"Aptos",fontSize:Du(a.fontSize||22),bold:Number(a.fontWeight||500)>=700,align:a.align||"left",valign:"mid",breakLine:!1};if(t.type==="shape"){r.addShape(e.ShapeType.roundRect,{...i,rectRadius:.08,fill:{color:kt(pn(a.background,n)),transparency:Dl(a.opacity)},line:{color:kt(pn(a.background,n)),transparency:100}}),t.text&&r.addText(t.text,o);return}if(t.type==="list"){let l=(t.items||[]).map(c=>({text:c,options:{bullet:{type:"bullet"},breakLine:!0}}));r.addText(l.length?l:[{text:""}],{...o,valign:"top",paraSpaceAfterPt:6,fit:"shrink"});return}if(t.type==="metric"){Tu(e,r,i,a,n),r.addText(String(t.text||""),{...o,y:i.y+.08,h:i.h*.48,color:kt(pn(a.color||"primary",n)),fontSize:Du(a.fontSize||42),bold:!0}),r.addText(String(t.label||""),{...o,y:i.y+i.h*.56,h:i.h*.34,color:kt(n.muted),fontSize:10,bold:!1,valign:"top"});return}if(t.type==="chart"){Tu(e,r,i,a,n),r.addText(String(t.text||""),{...o,y:i.y+.1,h:.32,fontSize:11,bold:!0}),ny(e,r,t,i,n);return}if(t.type==="media"){r.addShape(e.ShapeType.roundRect,{...i,fill:{color:kt(pn(a.background||"soft",n)),transparency:10},line:{color:kt(n.primary),transparency:55,dash:"dash"}}),r.addText(String(t.text||"Image placeholder"),{...o,align:"center",color:kt(n.muted),fontSize:12});return}ry(e,r,i,a,n),r.addText(String(t.text||""),o)}function Tu(e,r,t,n,i){r.addShape(e.ShapeType.roundRect,{...t,fill:{color:kt(pn(n.background||"panel",i)),transparency:Dl(n.opacity)},line:{color:kt(i.primary),transparency:82},shadow:{type:"outer",color:"111827",opacity:.12,blur:1,angle:45,distance:1}})}function ry(e,r,t,n,i){let a=n.background||"transparent";a!=="transparent"&&r.addShape(e.ShapeType.roundRect,{...t,fill:{color:kt(pn(a,i)),transparency:Dl(n.opacity)},line:{color:kt(pn(a,i)),transparency:100}})}function ny(e,r,t,n,i){let a=Array.isArray(t.data)&&t.data.length?t.data:[{label:"A",value:40},{label:"B",value:70}],o=Math.max(1,...a.map(f=>Number(f.value)||0)),l=.1,c=n.x+.18,s=n.y+.68,u=n.w-.36,d=n.h-.95,A=Math.max(.08,(u-l*(a.length-1))/a.length);a.forEach((f,p)=>{let g=Number(f.value)||0,y=Math.max(.15,g/o*d),v=c+p*(A+l),b=s+d-y;r.addShape(e.ShapeType.rect,{x:v,y:b,w:A,h:y,fill:{color:kt(p%2?i.accent:i.primary)},line:{color:kt(p%2?i.accent:i.primary),transparency:100}}),r.addText(String(f.label||""),{x:v-.03,y:s+d+.04,w:A+.06,h:.2,fontSize:7,color:kt(i.muted),align:"center",margin:0,fit:"shrink"})})}function iy(e={}){return{background:e.background||"#fbfcff",ink:e.ink||"#111827",muted:e.muted||"#5b6575",primary:e.primary||"#0f766e",accent:e.accent||"#f97316",panel:e.panel||"#ffffff"}}function ay(e){return{x:Qa(e.x)*tl,y:Qa(e.y)*wo,w:Qa(e.w)*tl,h:Qa(e.h)*wo}}function Qa(e){return Math.max(0,Math.min(100,Number(e)||0))/100}function Du(e){return Math.max(6,Math.min(66,Math.round((Number(e)||22)*.58)))}function pn(e,r){return!e||e==="transparent"?r.background:e==="ink"?r.ink:e==="muted"?r.muted:e==="primary"?r.primary:e==="accent"?r.accent:e==="panel"?r.panel:e==="soft"?r.primary:e==="background"?r.background:e}function kt(e){let r=String(e||"#111827").trim();return/^#[0-9a-f]{6}$/i.test(r)?r.slice(1).toUpperCase():/^[0-9a-f]{6}$/i.test(r)?r.toUpperCase():/^#[0-9a-f]{3}$/i.test(r)?r.slice(1).split("").map(t=>t+t).join("").toUpperCase():"111827"}function Dl(e){return Math.round((1-Math.max(0,Math.min(1,Number(e??1))))*100)}async function oy(e){let r=Array.isArray(e.slides)&&e.slides.length>0?e.slides:[],t=Zd(e);return r.forEach((n,i)=>{let a=t.addSlide(),o=iy(n.theme);a.background={color:kt(o.background)},$0(t,a,o,i),ey(t,a,n,o),(n.elements||[]).forEach(c=>ty(t,a,c,o));let l=Yd(n);l&&typeof a.addNotes=="function"&&a.addNotes(l)}),t}var sy="application/vnd.openxmlformats-officedocument.presentationml.presentation",Jd=new Set(["p","h1","h2","h3","h4","h5","h6","text","list","merged-text"]);function ly(e){return{...e,elements:(e.elements||[]).filter(r=>Jd.has(r.type))}}function cy(e){let t="";for(let n=0;n|]+/g,"-").slice(0,96)}async function $d(e,r){let t=await e.write({outputType:"base64"});return{filename:`${El(r.title||"ppt-live")}.pptx`,mimeType:sy,base64:String(t||"").replace(/^data:.*;base64,/,"")}}async function Bl(e){if((Array.isArray(e?.slides)?e.slides:[]).some(n=>n?.html))throw new Error("HTML slides must use the WebView prepare export path.");let t=await oy(e);return $d(t,e)}async function Rl(e,r){let t=Array.isArray(r)?r:[];if(!t.length)throw new Error("No prepared slides to export");let n=Zd(e),i=Array.isArray(e?.slides)?e.slides:[];for(let a of t){let o=i[a.index]||a.notes||{},l=a.slideData;if(a.rasterBase64){let u=String(a.rasterBase64).replace(/^data:.*;base64,/,"");a.rasterOnly?l={...l,elements:(l.elements||[]).filter(d=>!Jd.has(d.type)),background:{type:"image",path:`data:image/png;base64,${u}`}}:(l=ly(l),l={...l,background:{type:"image",path:`data:image/png;base64,${u}`}})}let c=await J0(l,a.bodyDimensions,n),s=Yd(o);s&&c?.slide&&typeof c.slide.addNotes=="function"&&c.slide.addNotes(s)}return $d(n,e)}async function Ll(e,r){let t=Array.isArray(r)?r:[];if(!t.length)throw new Error("No rendered PDF pages to export");let n=await Zr.create();for(let a of t){let o=String(a||"").replace(/^data:.*;base64,/,""),l=Uint8Array.from(atob(o),u=>u.charCodeAt(0)),c=await Zr.load(l);(await n.copyPages(c,c.getPageIndices())).forEach(u=>n.addPage(u))}let i=await n.save();return{filename:`${El(e?.title||"ppt-live")}.pdf`,mimeType:"application/pdf",base64:cy(i)}}async function Nl(e,r){let t=Array.isArray(r)?r:[];if(!t.length)throw new Error("No rendered PNG pages to export");let n=new $v.default;t.forEach((a,o)=>{let l=typeof a=="string"?a:String(a?.base64||"").replace(/^data:.*;base64,/,""),c=(a?.index??o)+1;n.file(`slide-${String(c).padStart(2,"0")}.png`,l,{base64:!0})});let i=await n.generateAsync({type:"base64",compression:"DEFLATE"});return{filename:`${El(e?.title||"ppt-live")}-slides.zip`,mimeType:"application/zip",base64:String(i||"").replace(/^data:.*;base64,/,"")}}function uy(e){if((e.slides||[]).some(t=>t.html))return dy(e);let r=e.slides.map(t=>`
            ${un(t)}
            `).join(` `);return` - + ${Le(e.title||"PPT Live")}
            ${r}
            -`}function oy(e){let r=(e.slides||[]).map((t,n)=>`
            - +`}function dy(e){let r=(e.slides||[]).map((t,n)=>`
            +
            `).join(` `);return` - + @@ -300,7 +340,7 @@ html,body{margin:0;background:#111;color:#fff;font-family:system-ui,-apple-syste
            ${r}
            -`}function Nl(e){let r=new Blob([ay(e)],{type:"text/html;charset=utf-8"}),t=URL.createObjectURL(r),n=document.createElement("a"),i=`${Il(e.title||"ppt-live")}.html`;return n.href=t,n.download=i,document.body.append(n),n.click(),n.remove(),URL.revokeObjectURL(t),i}function ef(e,r,t){let n=atob(e),i=new Uint8Array(n.length);for(let c=0;c|]+/g,"-").slice(0,96)}function sy(){return` +`}function Il(e){let r=new Blob([uy(e)],{type:"text/html;charset=utf-8"}),t=URL.createObjectURL(r),n=document.createElement("a"),i=`${zl(e.title||"ppt-live")}.html`;return n.href=t,n.download=i,document.body.append(n),n.click(),n.remove(),URL.revokeObjectURL(t),i}function ef(e,r,t){let n=atob(e),i=new Uint8Array(n.length);for(let c=0;c|]+/g,"-").slice(0,96)}function fy(){return` body{margin:0;background:#111827;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif} .deck{display:grid;gap:24px;padding:24px}.deck-slide{display:grid;place-items:center;min-height:100vh} .slide{position:relative;width:min(100%,1280px);aspect-ratio:16/9;color:var(--slide-ink);background:var(--slide-bg);overflow:hidden;box-shadow:0 24px 70px rgba(0,0,0,.34)} @@ -311,7 +351,7 @@ body{margin:0;background:#111827;font-family:-apple-system,BlinkMacSystemFont,"S .element-metric strong{font-size:inherit;line-height:.95}.element-metric span{color:var(--slide-muted);font-size:14px;line-height:1.25} .element-media{display:grid;place-items:center;border:1px dashed color-mix(in srgb,var(--slide-primary) 40%,transparent)} .element-chart{display:flex;flex-direction:column;gap:10px}.element-chart b{font-size:16px}.chart-bars{display:flex;align-items:end;gap:8px;flex:1;min-height:0}.chart-bars span{display:flex;flex:1;height:100%;align-items:end;gap:4px;flex-direction:column}.chart-bars i{display:block;width:100%;border-radius:5px 5px 0 0;background:var(--slide-primary)}.chart-bars em{font-size:10px;color:var(--slide-muted);font-style:normal} -`}var Oo='xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" aria-hidden="true" focusable="false"',tf={pptx:``,pdf:`PDF`,html:``,png:``};function rf(e){return tf[e]||tf.html}function nf(e){return{pptx:"#d44726",pdf:"#e01e3c",html:"#0d9488",png:"#2563eb"}[e]||"#475569"}var zl=new Set,af="user::bitfun-system::ppt-design";function ly(e){zl.forEach(r=>{try{r(e)}catch{}})}function cy(e){try{return JSON.stringify(e??{},null,2)}catch{return"{}"}}function uy(e){return Array.isArray(e?.currentDeck?.slides)&&e.currentDeck.slides.length>0}function dy(e={}){let r=[],t=e.fontFamily;t==="serif"?r.push("\u886C\u7EBF\u5B57\u4F53"):t==="sans"&&r.push("\u975E\u886C\u7EBF\u5B57\u4F53");let n=e.density==="loose"?"spacious":e.density;return n==="compact"?r.push("\u7D27\u51D1\u4FE1\u606F\u5BC6\u5EA6"):n==="spacious"&&r.push("\u5BBD\u677E\u7559\u767D"),(e.colorMode||e.theme)==="dark"&&r.push("\u6DF1\u8272\u4E3B\u9898"),e.stylePreset&&r.push(`\u98CE\u683C\u9884\u8BBE: ${e.stylePreset}`),r.length?r.join("\u3001"):""}function fy(e){let r=uy(e),t=dy(e?.style),n=e?.instruction||e?.userInput||"",i=r?`\u4F7F\u7528 PPT-Design skill \u7F16\u8F91\u73B0\u6709 PPT\u3002\u7F16\u8F91\u6307\u4EE4\uFF1A${n||"\uFF08\u89C1 currentDeck \u4E0A\u4E0B\u6587\uFF09"}\u3002`:`\u4F7F\u7528 PPT-Design skill \u751F\u6210 PPT\u3002\u7528\u6237\u9700\u6C42\uFF1A${n||"\uFF08\u89C1 input JSON\uFF09"}\u3002`;return t&&(i+=` +`}var Uo='xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" aria-hidden="true" focusable="false"',tf={pptx:``,pdf:`PDF`,html:``,png:``};function rf(e){return tf[e]||tf.html}function nf(e){return{pptx:"#d44726",pdf:"#e01e3c",html:"#0d9488",png:"#2563eb"}[e]||"#475569"}var Ml=new Set,af="user::bitfun-system::ppt-design";function hy(e){Ml.forEach(r=>{try{r(e)}catch{}})}function py(e){try{return JSON.stringify(e??{},null,2)}catch{return"{}"}}function Ay(e){return Array.isArray(e?.currentDeck?.slides)&&e.currentDeck.slides.length>0}function gy(e={}){let r=[],t=e.fontFamily;t==="serif"?r.push("\u886C\u7EBF\u5B57\u4F53"):t==="sans"&&r.push("\u975E\u886C\u7EBF\u5B57\u4F53");let n=e.density==="loose"?"spacious":e.density;return n==="compact"?r.push("\u7D27\u51D1\u4FE1\u606F\u5BC6\u5EA6"):n==="spacious"&&r.push("\u5BBD\u677E\u7559\u767D"),(e.colorMode||e.theme)==="dark"&&r.push("\u6DF1\u8272\u4E3B\u9898"),e.stylePreset&&r.push(`\u98CE\u683C\u9884\u8BBE: ${e.stylePreset}`),r.length?r.join("\u3001"):""}function my(e){let r=Ay(e),t=gy(e?.style),n=e?.instruction||e?.userInput||"",i=r?`\u4F7F\u7528 PPT-Design skill \u7F16\u8F91\u73B0\u6709 PPT\u3002\u7F16\u8F91\u6307\u4EE4\uFF1A${n||"\uFF08\u89C1 currentDeck \u4E0A\u4E0B\u6587\uFF09"}\u3002`:`\u4F7F\u7528 PPT-Design skill \u751F\u6210 PPT\u3002\u7528\u6237\u9700\u6C42\uFF1A${n||"\uFF08\u89C1 input JSON\uFF09"}\u3002`;return t&&(i+=` \u6837\u5F0F\u504F\u597D\uFF1A${t}\u3002`),i+=` ## \u7EA6\u675F @@ -319,24 +359,25 @@ body{margin:0;background:#111827;font-family:-apple-system,BlinkMacSystemFont,"S - \u7528\u6237\u53EA\u80FD\u770B\u5230 PPT Live UI\uFF0C\u65E0\u6CD5\u56DE\u7B54\u63D0\u95EE\u3002\u5982\u6709\u6B67\u4E49\u81EA\u884C\u5224\u65AD\u6700\u4F18\u65B9\u6848\u5E76\u8BB0\u5F55\u5047\u8BBE\u3002 - \u4E0D\u8981\u8C03\u7528 AskUserQuestion\u3001ControlHub\u3001GenerativeUI\u3001ComputerUse \u7B49\u4EA4\u4E92\u5DE5\u5177\u3002 - \u7814\u7A76\u7528 WebSearch / WebFetch \u5373\u53EF\u3002 +- **\u4E00\u6B21\u5199\u5BF9\uFF0C\u7981\u6B62\u4E8B\u540E\u5BA1\u8BA1**\uFF1A\u6BCF\u9875 HTML \u5728\u5199\u5165\u65F6\u5C31\u8981\u6EE1\u8DB3\u6240\u6709\u7EA6\u675F\uFF08\u753B\u5E03\u5C3A\u5BF8\u3001\u56DB\u6761 OOXML \u786C\u7EA6\u675F\u3001\u9632\u6EA2\u51FA\u9884\u7B97\uFF09\u3002\u6240\u6709\u9875\u9762\u5199\u5B8C\u540E\u4E0D\u5F97\u518D\u9010\u9875 Read\u2192Edit \u8FD4\u5DE5\u6216 Grep \u6279\u91CF\u68C0\u67E5\u3002\u5199\u5B8C\u5373\u7ED3\u675F\u3002 `,r&&(i+="\n## \u7F16\u8F91\u4E0A\u4E0B\u6587\n\n- `currentDeck` \u5DF2\u63D0\u4F9B\u3002\u5C06\u7528\u6237\u6307\u4EE4\u89C6\u4E3A\u5BF9\u73B0\u6709 deck \u7684\u589E\u91CF\u7F16\u8F91\uFF0C\u9664\u975E\u6307\u4EE4\u660E\u786E\u8981\u6C42\u5168\u65B0\u751F\u6210\u3002\n- `currentDeck.slides[].slideNumber` \u662F\u4ECE 1 \u5F00\u59CB\u7684\u9875\u7801\uFF0C\u4E0E\u7528\u6237\u53E3\u8BED\u4E00\u81F4\u3002\n- \u7F16\u8F91\u65F6\u53EA\u91CD\u5199\u53D8\u66F4\u7684 `slides/slide-NN.html` \u6587\u4EF6\uFF0C\u4E0D\u52A8\u5176\u4ED6\u9875\u3002\n"),i+=` Input JSON: \`\`\`json -${cy(e)} +${py(e)} \`\``,e?.continueAfterInterruption&&(i=`\u4E0A\u4E00\u6B21\u751F\u6210\u88AB\u4E2D\u65AD\u4E86\u3002\u8BF7\u7EE7\u7EED\u5B8C\u6210\u4EFB\u52A1\uFF1A\u68C0\u67E5 project.json \u548C\u5DF2\u5199\u7684 slides/ \u6587\u4EF6\uFF0C\u53EA\u8865\u5199\u8FD8\u6CA1\u5B8C\u6210\u7684\u9875\u9762\uFF0C\u4E0D\u8981\u91CD\u5199\u5DF2\u6709\u7684\u9875\u9762\u3002 -${i}`),i}function hy(e){let r=!1,t=()=>{r||(r=!0,e.agent.onEvent(n=>{!n||typeof n!="object"||ly(n)}))};e.backend={protocol:"files",async call(n,i,a={}){if(n!=="ppt.generate")throw new Error(`Unsupported PPT Live action: ${n}`);t();let o=fy(i),l=await e.agent.run(o,{runId:a.idempotencyKey,sessionName:"PPT Live",sessionId:a.sessionId,appDataWorkspace:a.appDataWorkspace});if(!l?.sessionId||!l?.turnId)throw new Error("PPT Live agent backend did not return sessionId/turnId");return{sessionId:l.sessionId,turnId:l.turnId,actionRunId:l.actionRunId||l.turnId}},onEvent(n){zl.add(n)},offEvent(n){zl.delete(n)},async cancel(n,i){await e.agent.cancel(n,i)},async turnText(n,i){return{text:(await e.agent.turnText(n,i))?.text||""}},async cancelStaleRuns(){await e.agent.cancelStaleRuns()}}}function of(e=window.app){!e||e.backend?.call||e.agent?.run&&hy(e)}var V=Bn(),Fn=!1,Fr=null,Tn=[],Xn=0,Uo=!1,pa=!1,Vn=[],Ml=0,Pe=e=>document.getElementById(e),st=()=>window.app||{};of(st());var bf=2500,Vo=new Map;function Ol(e){try{return localStorage.getItem(e)}catch{return Vo.has(e)?Vo.get(e):null}}function _l(e,r){try{localStorage.setItem(e,r)}catch{Vo.set(e,r)}}var Aa={get:async e=>JSON.parse(Ol(e)||"null"),set:async(e,r)=>_l(e,JSON.stringify(r))};function wf(){let e=st();return e.storage?e.storage:Aa}async function xf(e){let r=wf();if(r===Aa||!st().storage)return r.get(e);try{return await Promise.race([r.get(e),new Promise((t,n)=>setTimeout(()=>n(new Error("storage-timeout")),bf))])}catch(t){return st().log?.warn?.("Host storage read timed out, using local fallback",{key:e,error:String(t)}),Aa.get(e)}}async function Ho(e,r){let t=wf();if(t===Aa||!st().storage){await t.set(e,r);return}try{await Promise.race([t.set(e,r),new Promise((n,i)=>setTimeout(()=>i(new Error("storage-timeout")),bf))])}catch(n){st().log?.warn?.("Host storage write timed out, using local fallback",{key:e,error:String(n)}),await Aa.set(e,r)}}async function py(){try{Vn=await Ay();let e=await xf(Si);if(e){V=ln(e),ql(V)&&(V=Bn(),await Ho(Si,{...V,updatedAt:Date.now()}));return}V=Bn(),await Pt(!0)}catch(e){st().log?.warn?.("Failed to load PPT Live state",{error:String(e)}),V=Bn()}}async function Pt(e=!1){V=ln(V),await Ho(Si,{...V,updatedAt:Date.now()}),await jl(e?"autosave":"manual"),e||Zt($("saved"))}async function Ay(){try{let e=await xf(rs);return Array.isArray(e)?e.map(Sf).filter(Boolean).slice(0,40):[]}catch(e){return st().log?.warn?.("Failed to load PPT Live history",{error:String(e)}),[]}}async function jl(e="autosave"){if(!V?.slides?.length||ql(V))return;let r=Date.now();if(e==="autosave"&&Ml&&r-Ml<15e3)return;Ml=r;let t=Sf({id:V.sessionId||ir("deck"),title:V.title||$("blankDeckTitle"),updatedAt:r,slideCount:V.slides.length,reason:e,prompt:V.promptDraft||V.brief?.topic||"",state:sn({...V,generation:{...V.generation,active:!1}})});t&&(Vn=[t,...Vn.filter(n=>n.id!==t.id)].slice(0,40),await Ho(rs,Vn),kf())}function ql(e){let r=Array.isArray(e?.slides)?e.slides:[];return r.length===1&&!r[0]?.html&&String(r[0]?.id||"").startsWith("agent-working-slide")&&String(e?.title||"")===$("agentWorkingTitle")&&!e?.generation?.active}function Sf(e){return!e?.id||!e?.state?null:{id:String(e.id),title:String(e.title||e.state?.title||$("blankDeckTitle")),updatedAt:Number(e.updatedAt||Date.now()),slideCount:Number(e.slideCount||e.state?.slides?.length||0),reason:String(e.reason||"autosave"),prompt:String(e.prompt||e.state?.brief?.topic||""),state:e.state}}function kf(){let e=Pe("historyList");if(e){if(e.innerHTML="",!Vn.length){let r=document.createElement("div");r.className="history-empty",r.textContent=$("historyEmpty"),e.append(r);return}Vn.slice(0,12).forEach(r=>{let t=document.createElement("button");t.type="button",t.className=`history-card${r.id===V.sessionId?" is-active":""}`,t.innerHTML=` +${i}`),i}function vy(e){let r=!1,t=()=>{r||(r=!0,e.agent.onEvent(n=>{!n||typeof n!="object"||hy(n)}))};e.backend={protocol:"files",async call(n,i,a={}){if(n!=="ppt.generate")throw new Error(`Unsupported PPT Live action: ${n}`);t();let o=my(i),l=await e.agent.run(o,{runId:a.idempotencyKey,sessionName:"PPT Live",sessionId:a.sessionId,appDataWorkspace:a.appDataWorkspace});if(!l?.sessionId||!l?.turnId)throw new Error("PPT Live agent backend did not return sessionId/turnId");return{sessionId:l.sessionId,turnId:l.turnId,actionRunId:l.actionRunId||l.turnId}},onEvent(n){Ml.add(n)},offEvent(n){Ml.delete(n)},async cancel(n,i){await e.agent.cancel(n,i)},async turnText(n,i){return{text:(await e.agent.turnText(n,i))?.text||""}},async cancelStaleRuns(){await e.agent.cancelStaleRuns()}}}function of(e=window.app){!e||e.backend?.call||e.agent?.run&&vy(e)}var X=Bn(),Fn=!1,Cr=null,Tn=[],Xn=0,Go=!1,Aa=!1,Vn=[],Ol=0,Pe=e=>document.getElementById(e),st=()=>window.app||{};of(st());var bf=2500,Ho=new Map;function _l(e){try{return localStorage.getItem(e)}catch{return Ho.has(e)?Ho.get(e):null}}function Ul(e,r){try{localStorage.setItem(e,r)}catch{Ho.set(e,r)}}var ga={get:async e=>JSON.parse(_l(e)||"null"),set:async(e,r)=>Ul(e,JSON.stringify(r))};function wf(){let e=st();return e.storage?e.storage:ga}async function xf(e){let r=wf();if(r===ga||!st().storage)return r.get(e);try{return await Promise.race([r.get(e),new Promise((t,n)=>setTimeout(()=>n(new Error("storage-timeout")),bf))])}catch(t){return st().log?.warn?.("Host storage read timed out, using local fallback",{key:e,error:String(t)}),ga.get(e)}}async function Qo(e,r){let t=wf();if(t===ga||!st().storage){await t.set(e,r);return}try{await Promise.race([t.set(e,r),new Promise((n,i)=>setTimeout(()=>i(new Error("storage-timeout")),bf))])}catch(n){st().log?.warn?.("Host storage write timed out, using local fallback",{key:e,error:String(n)}),await ga.set(e,r)}}async function yy(){try{Vn=await by();let e=await xf(Si);if(e){X=ln(e),Vl(X)&&(X=Bn(),await Qo(Si,{...X,updatedAt:Date.now()}));return}X=Bn(),await Pt(!0)}catch(e){st().log?.warn?.("Failed to load PPT Live state",{error:String(e)}),X=Bn()}}async function Pt(e=!1){X=ln(X),await Qo(Si,{...X,updatedAt:Date.now()}),await ql(e?"autosave":"manual"),e||Zt($("saved"))}async function by(){try{let e=await xf(is);return Array.isArray(e)?e.map(Sf).filter(Boolean).slice(0,40):[]}catch(e){return st().log?.warn?.("Failed to load PPT Live history",{error:String(e)}),[]}}async function ql(e="autosave"){if(!X?.slides?.length||Vl(X))return;let r=Date.now();if(e==="autosave"&&Ol&&r-Ol<15e3)return;Ol=r;let t=Sf({id:X.sessionId||ir("deck"),title:X.title||$("blankDeckTitle"),updatedAt:r,slideCount:X.slides.length,reason:e,prompt:X.promptDraft||X.brief?.topic||"",state:sn({...X,generation:{...X.generation,active:!1}})});t&&(Vn=[t,...Vn.filter(n=>n.id!==t.id)].slice(0,40),await Qo(is,Vn),kf())}function Vl(e){let r=Array.isArray(e?.slides)?e.slides:[];return r.length===1&&!r[0]?.html&&String(r[0]?.id||"").startsWith("agent-working-slide")&&String(e?.title||"")===$("agentWorkingTitle")&&!e?.generation?.active}function Sf(e){return!e?.id||!e?.state?null:{id:String(e.id),title:String(e.title||e.state?.title||$("blankDeckTitle")),updatedAt:Number(e.updatedAt||Date.now()),slideCount:Number(e.slideCount||e.state?.slides?.length||0),reason:String(e.reason||"autosave"),prompt:String(e.prompt||e.state?.brief?.topic||""),state:e.state}}function kf(){let e=Pe("historyList");if(e){if(e.innerHTML="",!Vn.length){let r=document.createElement("div");r.className="history-empty",r.textContent=$("historyEmpty"),e.append(r);return}Vn.slice(0,12).forEach(r=>{let t=document.createElement("button");t.type="button",t.className=`history-card${r.id===X.sessionId?" is-active":""}`,t.innerHTML=` ${sf(r.title)} - ${$("historyMeta",{count:r.slideCount,time:my(r.updatedAt)})} + ${$("historyMeta",{count:r.slideCount,time:xy(r.updatedAt)})} ${r.prompt?`${sf(r.prompt)}`:""} - `,t.addEventListener("click",()=>{gy(r.id)}),e.append(t)})}}async function gy(e){let r=Vn.find(t=>t.id===e);r&&(Xn+=1,await $l(),V=ln(sn(r.state)),V.generation.active=!1,Ko(),Yt(),Di(V),Zt($("historyRestored")),await Ho(Si,{...V,updatedAt:Date.now()}))}function my(e){let r=new Date(e);if(Number.isNaN(r.getTime()))return"";let t=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0"),i=String(r.getHours()).padStart(2,"0"),a=String(r.getMinutes()).padStart(2,"0");return`${t}/${n} ${i}:${a}`}function sf(e){return String(e??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Zt(e){let r=Pe("statusLine");r&&(r.textContent=e)}function yi(e){let r=Pe("exportStatus");r&&(r.textContent=e)}function wi(e,r){Fn=e,document.querySelector(".ppt-live")?.classList.toggle("is-busy",Fn),document.querySelectorAll("button, input, select, textarea").forEach(n=>{if(!["closePreview","prevPresent","nextPresent"].includes(n.id)){if(n.id==="cancelGeneration"){n.disabled=!Fn,n.hidden=!Fn;return}n.id!=="newDeck"&&(n.disabled=Fn)}});let t=Pe("aiStatusPill");t&&(t.textContent=Fn?$("statusPillBusy"):$("statusPillReady"),t.classList.toggle("is-busy",Fn)),r&&Zt(r)}function hr(e,r,t){V.generation.current=e,V.generation.steps=V.generation.steps.map(n=>({...n,status:n.id===e?r:n.status})),V.generation.active=r==="running"||V.generation.steps.some(n=>n.status==="running"),mr(V),Ir(V),t&&Zt(t)}function Ko(){V.generation.active=!1,V.generation.current="idle",V.generation.draftedCount=0,V.generation.slideTarget=0,V.generation.eventSeq=0,V.generation.steps=V.generation.steps.map(e=>({...e,status:"pending"})),V.generation.events=[],V.generation.agentStream=[],mr(V),Ir(V)}function Tr(e,r="",t="info"){V.generation=ki(V.generation||{});let n=typeof e=="string"?{title:e,detail:r,kind:t}:{...e||{}},i=Et(n.title||n.label||n.message||$("processEventUnknown"),160),a=Et(n.detail??r??"",260),o=String(n.kind||t||"info").toLowerCase().replace(/[^a-z0-9-]/g,"")||"info";if(!i&&!a)return;let l=Array.isArray(V.generation.events)?V.generation.events:[],c=l[l.length-1];if(c&&c.title===i&&c.detail===a&&c.kind===o)c.timestamp=Date.now(),V.generation.events=l;else{let s=l.reduce((d,A)=>Math.max(d,Number(A.seq)||0),0),u=Math.max(Number(V.generation.eventSeq)||0,s)+1;V.generation.eventSeq=u,V.generation.events=[...l,{id:ir("generation-event"),seq:u,title:i||$("processEventUnknown"),detail:a,kind:o,timestamp:Date.now()}].slice(-80)}mr(V),Ir(V)}function $r(e){V.generation=ki(V.generation||{});let r=Array.isArray(V.generation.agentStream)?V.generation.agentStream:[];if(e.kind==="text"){let t=r[r.length-1];if(t&&t.kind==="text"){t.text=String(t.text||"")+String(e.text||""),t.timestamp=Date.now(),V.generation.agentStream=r,mr(V);return}}r.push({id:ir("agent-stream"),timestamp:Date.now(),...e}),V.generation.agentStream=r,mr(V)}function Yt(){V=ln(V),Fc(V,Qt),kf()}function rn(e={}){zc(V,e),V=ln(V)}function Cf(){return Pe("topicInput")?.value.trim()||""}function Pf(){let e=cc().join(` -`);return!V.outline.length||V.outline.join(` -`)===e||V.title===$("defaultDeckTitle")||Vl()}function Vl(){let e=String(V.title||"").trim();return V.slides.length===1&&V.outline.length===1&&V.outline[0]===$("newSlideTitle")&&(e===$("blankDeckTitle")||e===$("newSlideTitle"))}function nn(){return Array.isArray(V.slides)&&V.slides.length>0&&!Pf()&&!Vl()&&!ql(V)}async function vy(){await Xl()}async function yy(){await Xl()}async function Xl(){if(Uo||pa)return;let e=Cf();if(!e){Zt($("promptRequired"));return}Uo=!0;let r=nn();V.promptDraft=e,V.lastSubmittedPrompt=e,rn({includeTopic:!r}),r||(V.brief.topic=e);try{await Yl("auto",e,{includeTopic:!r,persistBeforeRun:!0});return}catch(t){if(Qo(t))return;st().log?.warn?.("PPT Live backend generation failed",{error:String(t)}),Hl(t),Yt(),await Pt(!0)}finally{Uo=!1}}function Ff(e=$("deckReady")){V.generation.active=!1,V.generation.draftedCount=V.slides.length,V.generation.slideTarget=0,V.generation.steps=(V.generation.steps||[]).map(r=>({...r,status:r.status==="error"?"error":"done"})),Zt(e),mr(V),Ir(V)}function by(e=$("backendGenerationFailed"),r=""){V.generation.active=!1,V.generation.steps=(V.generation.steps||[]).map(t=>({...t,status:t.status==="done"?"done":"error"})),Zt(e),Tr({title:e,detail:r||$("agentOnlyRetryHint"),kind:"error"}),wi(!1),mr(V),Ir(V)}function wy(e,r=5){let t=[],n=new Set,i=e;for(let a=0;i&&a({kind:n.kind,title:n.title,url:n.url,text:String(n.text||"").slice(0,6e3)}))}:null);let t=Number(V.brief?.slideTarget)||0;return t>0&&(r.slideTarget=t),r}function Kl({includePreset:e=!0}={}){let r=Jo(V.style?.stylePreset),t=V.style?.colorMode==="dark"?"dark":"light",n={fontFamily:V.style?.fontFamily==="serif"?"serif":"sans",density:En(V.style?.density),colorMode:t,theme:t,palette:tc(r,t)};return e&&(n.stylePreset=V.style?.stylePreset||an),n}function Sy(e){let r=String(e||"").trim();if(!r)return"";try{let t=new DOMParser().parseFromString(r,"text/html");return t.querySelectorAll("style,script,svg").forEach(n=>n.remove()),Et(t.body?.textContent||t.documentElement?.textContent||"",1800)}catch{return Et(r.replace(/<[^>]+>/g," "),1800)}}function ky(e){let r=new Set,t=String(e||""),n=Jt(V);return/(当前|本页|这一页|此页|current\s+(slide|page)|this\s+(slide|page))/i.test(t)&&r.add(n),[/第\s*(\d{1,2})\s*(页|頁|张|張)/gi,/\b(?:slide|page)\s*(\d{1,2})\b/gi,/\b(\d{1,2})\s*(?:slide|slides|page|pages)\b/gi].forEach(a=>{let o=a.exec(t);for(;o;){let l=Number(o[1])-1;l>=0&&la-o)}function Cy(e){let r=ky(e),t=Jt(V),n=new Set(r.length?r:[t]);return{title:V.title,outline:sn(V.outline||[]),slideCount:V.slides.length,activeSlideIndex:t,activeSlideId:V.slides[t]?.id||"",targetHints:r.map(i=>({slideIndex:i,slideNumber:i+1,slideId:V.slides[i]?.id||"",title:V.slides[i]?.title||""})),slides:V.slides.map((i,a)=>{let o=i.html?Sy(i.html):Et((i.elements||[]).flatMap(c=>[c.text,c.label,...Array.isArray(c.items)?c.items:[]]).filter(Boolean).join(` -`),1800),l={slideIndex:a,slideNumber:a+1,id:i.id,title:i.title,kicker:i.kicker,claim:i.claim,proofObject:i.proofObject,supportNote:i.supportNote,sourceNote:i.sourceNote,notes:i.notes,layout:i.layout,visibleText:o,hasHtml:!!i.html};return n.has(a)&&i.html&&(l.html=String(i.html).slice(0,12e3)),l})}}function lf(e,r){let t=r.getBoundingClientRect(),n=mt((e-t.left)/t.width,0,1);return Math.round(n*2)}function Pn(e){Ia(Sa(mt(Math.round(Number(e)),0,2)))}function Py(){Ic(V),V=ln(V)}var da=2,Fy=750;function Ty(e){let r=String(e?.message||e||"");return!(Qo(e)||/Generation stopped/i.test(r)||/backend is unavailable|did not return sessionId/i.test(r)||/permission|workspacePath is required|unsupported PPT Live action/i.test(r))}function Dy(e,r){let t=String(e?.message||e||"");return/rate limit|network|timed? out|connection|temporar|overload|service unavailable|502|503|504/i.test(t)?Math.min(15e3,1e3*2**Math.min(Math.max(0,r-1),4)):Fy}function Ey(e){return/Unknown MiniApp agent session|session workspace does not match/i.test(String(e?.message||e||""))}function By(){let e=st();return e.backend?.protocol==="files"&&!!e.appDataDir&&!!e.fs?.readFile}function Ry(){let e=`deck-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return{runId:e,workspaceSubdir:`decks/${e}`,dir:`${st().appDataDir}/decks/${e}`}}function Ly(){let e=String(V.agentSession?.workspaceSubdir||"");return!e||!st().appDataDir?null:{runId:String(V.agentSession?.runId||e.split("/").pop()||""),workspaceSubdir:e,dir:`${st().appDataDir}/${e}`}}function Df(e){return`slides/slide-${String(e).padStart(2,"0")}.html`}function Ql(e){return typeof e=="string"?e:String(e?.title||"")}function Ef(e){return Array.isArray(e?.outline)?e.outline.map(Ql).filter(Boolean):[]}function Bf(e){let r=String(e||"").trim();return r?[$("agentWorkingTitle"),$("generationAgentWorking"),$("blankDeckTitle"),$("defaultDeckTitle"),$("newSlideTitle")].includes(r):!0}function ga({plan:e=null,payload:r=null,state:t=null,instruction:n="",slides:i=[]}={}){let a=Array.isArray(e?.outline)?e.outline:Array.isArray(r?.outline)?r.outline:[],o=a.length?Ql(a[0]):"",l=Array.isArray(i)&&i.length?String(i[0]?.title||"").trim():"",c=[r?.deckPatch?.title,r?.patch?.title,r?.title,e?.title,o,t?.brief?.topic,n,t?.promptDraft,l];for(let s of c){let u=String(s||"").trim();if(u&&!Bf(u))return u}return $("blankDeckTitle")}async function Rf(e,r){let t=st().fs;if(!t?.readFile)throw new Error("PPT Live fs API is unavailable");return await t.readFile(`${e.dir}/${r}`)}async function Ny(e,r){try{let t=String(await Rf(e,r)||"");return t.trim()?xi(t):null}catch{return null}}async function Zl(e){return await Ny(e,"project.json")}async function Lf(e,r){try{let t=String(await Rf(e,Df(r))||"").trim();return!t||!/<\/html>\s*$/i.test(t)?null:t}catch{return null}}async function Iy(e,r,t=6,n=120){for(let i=1;i<=t;i+=1){let a=await Lf(e,r);if(a)return a;isetTimeout(o,n))}return null}async function zy(e){let r=await Zl(e);if(!r)throw new Error("PPT Live agent finished without a valid project.json");let t=Array.isArray(r.slide_order)&&r.slide_order.length?r.slide_order:Array.isArray(r.outline)?r.outline.map((i,a)=>`slide-${String(a+1).padStart(2,"0")}`):[],n=[];for(let i=0;i({id:`slide-${String(o+1).padStart(2,"0")}`,title:String(a.title||""),bullets:[],slide_id:`slide-${String(o+1).padStart(2,"0")}`})),i={title:V.title||"",language:Nr(),outline:n,slide_order:n.map(a=>a.slide_id),style:Kl()};await r.writeFile(`${e.dir}/project.json`,`${JSON.stringify(i,null,2)} -`);for(let a=0;atypeof a=="string"?a:a?.name).filter(a=>typeof a=="string"&&a.startsWith("deck-")&&a!==e);for(let a of i)await r.rm(`${t}/${a}`,{recursive:!0})}catch{}}async function Yl(e,r,t={}){if(!st().backend?.call)throw new Error("PPT Live backend is unavailable");if(!pa){pa=!0;try{rn({includeTopic:t.includeTopic!==!1}),Py(),t.persistBeforeRun&&await Pt(!0),await Wy(e,r)}finally{pa=!1}}}async function _y(e,r={},t={}){let n=st(),i=Xn,a=null,o=null,l="",c="",s=!1,u=0,d=null,A=[],f=new Set,p=[],g=new Set,y=Xy(),v={lastEventAt:Date.now()};try{let b=await n.backend.call("ppt.generate",e,{entityId:"deck",idempotencyKey:`ppt-live-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,sessionId:t.sessionId||void 0,appDataWorkspace:t.appDataWorkspace||void 0});if(a=b?.sessionId||null,o=b?.turnId||b?.actionRunId||null,!a||!o)throw new Error("PPT Live backend did not return sessionId/turnId");if(nb(a,o),ha(i))throw new Error("Generation stopped");let x=new Promise((W,H)=>{let C=m=>{let N=m.sessionId,ne=N===a,q=String(m.sourceEvent||"");if(q.endsWith("subagent-session-linked")){m.parentSessionId===a&&N&&(g.add(N),Tr({title:$("eventSubagentStarted"),detail:"",kind:"tool"}),$r({kind:"system",text:`[subagent started] ${String(m.subagentName||m.sessionName||N).slice(0,120)}`}));return}let se=g.has(N);if(!(!ne&&!se)&&!(ne&&m.turnId&&m.turnId!==o)){if(v.lastEventAt=Date.now(),!ne&&N&&g.add(N),q.endsWith("dialog-turn-started"))y.note($("eventTurnStarted"),"","turn");else if(q.endsWith("model-round-started"))ne?r.onToolPhase?.("round"):y.note($("eventSubagentWorking"),"","pulse",8e3),y.touch();else if(q.endsWith("model-round-completed"))y.touch();else if(q.endsWith("tool-event")){let Z=Jl(m.toolEvent||{}),ue=Z.event_type||Z.eventType||"",j=String(Z.tool_name||Z.toolName||"").trim().toLowerCase();if(ne&&(ue==="Started"?p.push({eventType:ue,toolId:Z.tool_id||Z.toolId||"",toolName:Z.tool_name||Z.toolName||"",params:Z.params||{}}):ue==="Completed"?p.push({eventType:ue,toolId:Z.tool_id||Z.toolId||"",toolName:Z.tool_name||Z.toolName||"",result:Z.result||{}}):(ue==="Failed"||ue==="Cancelled")&&p.push({eventType:ue,toolId:Z.tool_id||Z.toolId||"",toolName:Z.tool_name||Z.toolName||"",error:Z.error||Z.message||ue})),ue==="Started"&&j==="task"&&(y.note($("eventToolTaskStarted"),"","tool"),y.touch()),ue==="Started"&&j){let _=Z.params||Z.result||{},fe=Hy(j,_);$r({kind:"tool-start",toolName:j,isSubagent:!ne,text:fe})}else if(ue==="Completed"&&j){let _=Ky(j,Z.result||{});_&&$r({kind:"tool-done",toolName:j,isSubagent:!ne,text:_})}else(ue==="Failed"||ue==="Cancelled")&&$r({kind:"tool-error",toolName:j,isSubagent:!ne,text:Et(String(Z.error||Z.message||ue),200)});if(Vy(Z,f,{isSubagent:!ne})){let _=rb(m,{isSubagent:!ne});_&&Tr(_),y.touch()}if(ne&&(ue==="EarlyDetected"||ue==="Started"))r.onToolPhase?.("detected");else if(ne&&ue==="Completed"){let _=j;if(r.onToolPhase?.("completed"),_==="skill"?y.note($("eventToolSkillReady"),"","phase"):(_==="websearch"||_==="webfetch")&&r.onToolPhase?.("research"),(_==="write"||_==="edit")&&typeof r.onSlideFileWritten=="function"){let ce=If(Z,p).match(/slides\/slide-(\d{2})\.html/i);if(ce){let ie=parseInt(ce[1],10);Number.isFinite(ie)&&ie>0&&Promise.resolve(r.onSlideFileWritten(ie)).catch(()=>{})}}}}else if(q.endsWith("text-chunk")){let Z=String(m.text||"");if(m.contentType==="thinking")c+=Z;else{l+=Z,y.touch(),$r({kind:"text",text:Z});let j=Date.now();j-u>=500&&(u=j,r.onTextProgress?.(l))}}else if(!q.endsWith("token-usage-updated")){if(q.endsWith("dialog-turn-completed")){if(!ne){y.note($("eventSubagentDone"),"","tool"),$r({kind:"system",isSubagent:!0,text:"[subagent done]"});return}$r({kind:"system",text:"[turn completed]"}),s=!0,d={success:m.success,finishReason:m.finishReason||m.finish_reason||"",partialRecoveryReason:m.partialRecoveryReason||m.partial_recovery_reason||""},W({answer:l,thinking:c})}else if(q.endsWith("dialog-turn-failed")||q.endsWith("dialog-turn-cancelled")){if(!ne){y.note($("eventSubagentFailed"),"","error"),$r({kind:"system",isSubagent:!0,text:"[subagent failed]"});return}s=!0,l&&r.onTextProgress?.(l);let Z=Et(m.error||m.message||"");$r({kind:"system",text:q.endsWith("dialog-turn-cancelled")?"[turn cancelled]":"[turn failed]"}),Tr({title:q.endsWith("dialog-turn-cancelled")?$("eventTurnCancelled"):$("eventTurnFailed"),detail:Z,kind:"error"}),H(new Error(Z||q))}}}};n.backend.onEvent(C),A.push(()=>n.backend.offEvent?.(C));let I=setInterval(()=>{if(s||Date.now()-y.lastProgressLogAt<12e3)return;let N=(V.generation?.steps||[]).find(ne=>ne.status==="running");y.note(N?.label?`${N.label}\u2026`:$("generationProgressPulse"),N?.detail||"","pulse",0)},12e3);A.push(()=>clearInterval(I))}),P=t.resultKind!=="text",F=await db(x,a,o,v,{expectJson:P}),R=typeof F=="string"?F:F?.answer||"",E=typeof F=="string"?"":F?.thinking||"";if(ha(i))throw new Error("Generation stopped");if(!P)return{payload:null,text:R,sessionId:a,toolTrace:p,completion:d};let B=await fb(a,o,R,E);if(ha(i))throw new Error("Generation stopped");let T=xi(B);if(ha(i))throw new Error("Generation stopped");return{payload:T,sessionId:a,toolTrace:p,completion:d}}catch(b){if(b&&typeof b=="object"&&a&&(b.pptLiveSessionId=a,b.pptLiveToolTrace=p),!s&&a&&o&&n.backend?.cancel)try{await n.backend.cancel(a,o)}catch(x){st().log?.warn?.("PPT Live backend cancel after failure failed",{sessionId:a,turnId:o,error:String(x)})}throw b}finally{A.forEach(b=>b()),a&&o&&ib(a,o)}}function Uy(e,r){return{operation:e,instruction:r,locale:Nr(),brief:xy(),style:Kl()}}async function Wy(e,r){let t=Xn;wi(!0,$("working")),Ko(),hr("brief","running",$("generationReadingBrief")),Tr({title:$("processEventStarted"),detail:$("processEventWaiting"),kind:"start"}),Gy(e,r);let n=!1,i=By()?Ly()||Ry():null;i&&!V.agentSession?.workspaceSubdir&&(await Oy(i.runId),await My(i));let a={id:V.agentSession?.id||null,project:i},o={value:""},l={touch:()=>{},note:()=>{},lastProgressLogAt:0},c=new Map,s=null;try{let u=null;for(let d=1;d<=da;d+=1)try{d>1&&(Tr({title:$("generationRetryAttempt",{attempt:d,max:da}),detail:Tf(u),kind:"start"}),Zt($("generationRetrying",{attempt:d,max:da})),await new Promise(y=>setTimeout(y,Dy(u,d))));let A={...Uy(e,r),...a?.id?{continueAfterInterruption:!0}:{}};nn()&&(A.currentSlideIndex=Jt(V),A.currentDeck=Cy(r));let{sessionId:p}=await _y(A,{onToolPhase:y=>{y==="detected"?hr("brief","running",$("generationReadingBrief")):y==="completed"?(hr("brief","done"),hr("spine","running",$("generationWritingClaims"))):y==="research"?hr("proof","running",$("generationChoosingProof")):y==="round"&&hr("spine","running",$("generationWritingClaims"))},onTextProgress:y=>tb(y,l,o),onSlideFileWritten:i?async y=>{let v=await Iy(i,y);if(!v)return;c.set(y,v);let b=Array.isArray(s?.outline)?s.outline.length:0;if(!s||y>b){let R=await Zl(i);if(R){s=R;let E=ga({plan:R,state:V,instruction:r});Bf(E)||(V.title=E)}}let x=s||{},P=[...c.entries()].sort((R,E)=>R[0]-E[0]).map(([R,E])=>({id:`ppt-live-slide-${R}`,slideNumber:R,title:typeof x?.outline?.[R-1]=="string"?x.outline[R-1]:x?.outline?.[R-1]?.title||`${$("newSlideTitle")} ${R}`,html:E})),F=ga({plan:x,state:V,instruction:r,slides:P});hr("design","running",$("generationSlideReady",{slide:y,total:P.length})),Zt($("generationRenderingSlide",{slide:y,total:x?.outline?.length||P.length})),Tr({title:$("generationSlideReady",{slide:y,total:x?.outline?.length||P.length}),detail:"",kind:"slide"}),uf({title:F,language:x?.language||"",outline:Ef(x||{}),researchReport:x?.researchReport||null,design:x?.design||{},slides:P},{instruction:r}),V.activeSlideId=`ppt-live-slide-${y}`,V.selectedElementId="",Yt()}:void 0},{sessionId:a?.id||void 0,appDataWorkspace:a?.project?.workspaceSubdir,resultKind:i?"text":void 0});a.id=p||a.id,V.agentSession={id:a.id||"",workspaceSubdir:a?.project?.workspaceSubdir||"",runId:a?.project?.runId||"",skillKey:af},Tr({title:$("generationParsingDeck"),detail:"",kind:"parsing"}),Zt($("generationParsingDeck")),hr("design","running",$("generationDesigningLayouts"));let g=i?await zy(i):null;if(!g)throw new Error("PPT Live agent did not produce a readable deck");uf(g,{instruction:r}),await jl(`agent:${e}`),Tr({title:$("processEventDone"),detail:"",kind:"done"}),hr("spine","done"),hr("proof","done"),hr("design","done"),hr("compile","done",$("generationCompiled")),Ff($("deckReady")),n=!0,Yt(),await Pt(!0);break}catch(A){if(u=A,Ey(A)?a.id=null:A?.pptLiveSessionId&&(a.id=A.pptLiveSessionId),!Ty(A)||d>=da)throw A;st().log?.warn?.("PPT Live cowork generation attempt failed, retrying",{attempt:d,maxAttempts:da,continueInSession:!!a.id,error:String(A)})}}finally{!ha(t)&&(V.generation.active&&!n&&(V.generation.active=!1),wi(!1)),mr(V),Ir(V)}}function Gy(e,r){Zt($("generationAgentWorking")),Tr({title:$("generationAgentWorking"),detail:Et(r||""),kind:"start"}),e==="auto"&&(Pf()||Vl())&&(V.title=$("agentWorkingTitle")),Yt()}var jy=new Set(["ParamsPartial","Queued","Waiting","Progress","Streaming","StreamChunk","Confirmed","Rejected","EarlyDetected","Started"]),qy=new Set(["read","write","grep","glob","list","todowrite","todo_write","skill","bash","shell","edit","delete","apply_patch","strreplace","search_replace"]);function Nf(e,r={}){let t=String(e||"").trim().toLowerCase();return!t||qy.has(t)?"":t==="websearch"?r.isSubagent?$("eventSubagentWebSearchDone"):$("eventToolWebSearchDone"):t==="webfetch"?r.isSubagent?$("eventSubagentWebFetchDone"):$("eventToolWebFetchDone"):t==="task"?$("eventToolTaskDone"):""}function Vy(e,r,t={}){let n=Jl(e),i=n.event_type||n.eventType||"";if(jy.has(i))return!1;let a=String(n.tool_name||n.toolName||"tool").toLowerCase();if(i==="Completed"&&!Nf(a,t))return!1;let o=If(n)||String(n.params&&typeof n.params=="object"&&n.params.command||"").trim(),l=o?`${a}:${o}:${i}`:`${a}:${i}`;return r.has(l)?!1:(r.add(l),i==="Completed"||i==="Failed"||i==="Cancelled"||i==="ConfirmationNeeded")}function Xy(){let e=0,r="";return{get lastProgressLogAt(){return e},touch(){e=Date.now()},note(t,n="",i="phase",a=0){let o=Date.now(),l=t===r;return a>0&&l&&o-eo?.content||"").filter(Boolean).join(" | "),200)}if(t==="execcommand"||t==="bash"||t==="shell")return Et(String(n.cmd||n.command||""),160);let i=Object.values(n).find(a=>typeof a=="string"&&a.trim());return Et(String(i||""),160)}function Ky(e,r={}){let t=String(e||"").toLowerCase(),n=r&&typeof r=="object"?r:{};if(t==="websearch"){let i=Array.isArray(n.results)?n.results:[];return i.length?`${i.length} results`:""}if(t==="webfetch"||t==="mcp__web_reader__webreader"){let i=String(n.content||n.text||n.markdown||"").length;return i?`${i} chars`:""}if(t==="read"){let i=Number(n.lineCount||(Array.isArray(n.lines)?n.lines.length:0));return i?`${i} lines`:""}if(t==="write"||t==="edit")return Et(String(n.message||"written"),80);if(t==="grep"||t==="glob"){let i=Array.isArray(n.matches)?n.matches.length:Array.isArray(n.files)?n.files.length:0;return i?`${i} matches`:"no matches"}return t==="skill"?Et(String(n.skill_key||n.message||"loaded"),80):t==="task"?Et(String(n.result||n.message||""),160):""}function Qy(e){let r=String(e||"");return/"html"\s*:/.test(r)?"design":/"slides"\s*:/.test(r)?"proof":(/"outline"\s*:/.test(r),"spine")}function Zy(e){switch(e){case"proof":return $("generationChoosingProof");case"design":return $("generationDesigningLayouts");default:return $("generationWritingClaims")}}function cf(e,r){let n=new RegExp(`"${r}"\\s*:\\s*\\[`).exec(String(e||""));return n?String(e).slice(n.index+n[0].length):""}function Yy(e){let r=0,t=0,n=!1,i=!1;for(let a=0;a0&&(V.generation.draftedCount=t),mr(V),Ir(V)}function tb(e,r,t){let n=Qy(e),i=Zy(n);hr(n,"running",i),eb(e,n),r.touch()}function rb(e,r={}){let t=Jl(e.toolEvent||{}),n=t.event_type||t.eventType||"ToolEvent",i=String(t.tool_name||t.toolName||"").trim();if(n==="Completed"){let a=Nf(i,r);return a?{title:a,detail:"",kind:"tool"}:null}return n==="Failed"||n==="Cancelled"?{title:$("eventToolFailedUser"),detail:"",kind:"error"}:n==="ConfirmationNeeded"?{title:$("processEventWaiting"),detail:"",kind:"tool"}:null}function If(e,r=[]){let t=e?.params&&typeof e.params=="object"?e.params:{},n=String(t.file_path||t.path||"").trim();if(n)return n;let i=e?.result&&typeof e.result=="object"?e.result:{},a=String(i.file_path||i.path||"").trim();if(a)return a;let o=String(e?.tool_id||e?.toolId||"").trim();if(!o)return"";let l=[...r].reverse().find(s=>s.eventType==="Started"&&String(s.toolId||s.tool_id||"")===o),c=l?.params&&typeof l.params=="object"?l.params:{};return String(c.file_path||c.path||"").trim()}function Jl(e){if(e.event_type||e.eventType||e.tool_name||e.toolName)return e;let t=["EarlyDetected","ParamsPartial","Queued","Waiting","Started","Progress","Streaming","StreamChunk","ConfirmationNeeded","Confirmed","Rejected","Completed","Failed","Cancelled"].find(i=>e&&Object.prototype.hasOwnProperty.call(e,i));return t?{...e[t]||{},event_type:t}:e||{}}function Et(e,r=180){let t=String(e||"").replace(/\s+/g," ").trim();return t?t.length>r?`${t.slice(0,r-1)}...`:t:""}function nb(e,r){if(!e||!r)return;Tn.some(n=>n.sessionId===e&&n.turnId===r)||Tn.push({sessionId:e,turnId:r})}function ib(e,r){Tn=Tn.filter(t=>!(t.sessionId===e&&t.turnId===r))}function ha(e){return e!==Xn}async function $l(){let e=[...Tn];Tn=[],!(!e.length||!st().backend?.cancel)&&await Promise.all(e.map(async r=>{try{await st().backend.cancel(r.sessionId,r.turnId)}catch(t){st().log?.warn?.("PPT Live backend cancel failed",{sessionId:r.sessionId,turnId:r.turnId,error:String(t)})}}))}async function ab(e=!1,r={}){let t=Tn.length>0;Xn+=1,await $l(),V.generation.active=!1,V.generation.steps=V.generation.steps.map(n=>n.status==="running"?{...n,status:"error"}:n),!r.silent&&t&&(Zt(e?$("generationTimedOut"):$("generationStopped")),Tr(e?$("generationTimedOut"):$("generationStopped"))),wi(!1),mr(V),Ir(V),r.silent||await Pt(!0)}async function ob(e=!1){await ab(e)}function uf(e,r={}){if(cb(e,r)){e.researchReport&&df(e.researchReport),e.design?.palette&&typeof e.design.palette=="object"&&(V.deckPalette=e.design.palette);return}let t=ga({payload:e,state:V,instruction:r.instruction||"",slides:e?.slides||[]}),n=ub(e);if(n.length)V.title=t,V.slides=n.map((i,a)=>Ur(i,a,{...V,slides:n})),V.outline=V.slides.map(i=>i.title),V.activeSlideId=V.slides[0]?.id||"",V.selectedElementId="";else{if(!Array.isArray(e?.slides)||e.slides.length===0)throw new Error("PPT Live deck payload has no slides");V.title=t,V.slides=e.slides.map((i,a)=>Ur({...i,html:i.html||i.sourceHtml||i.slideHtml||""},a,{...V,slides:e.slides})),V.outline=V.slides.map(i=>i.title),V.activeSlideId=V.slides[0]?.id||"",V.selectedElementId=V.slides[0]?.elements[0]?.id||""}Array.isArray(e.outline)&&e.outline.length&&(V.outline=e.outline.map(Ql).filter(Boolean)),e.researchReport&&df(e.researchReport),e.design?.palette&&typeof e.design.palette=="object"&&(V.deckPalette=e.design.palette)}function df(e){V.sources={...V.sources,facts:e.verifiedFacts||V.sources?.facts||[],warnings:e.warnings||V.sources?.warnings||[],summary:e.summary||V.sources?.summary||"",fetchedAt:Date.now()}}function sb(e){return Array.isArray(e?.deckPatch?.changes)?e.deckPatch.changes:Array.isArray(e?.patch?.changes)?e.patch.changes:Array.isArray(e?.changes)?e.changes:Array.isArray(e?.patches)?e.patches:[]}function ff(e,r,t=0){let n=String(e?.slideId||e?.id||e?.targetSlideId||e?.targetId||"").trim();if(n){let o=r.findIndex(l=>l.id===n);if(o>=0)return o}let i=Number(e?.slideNumber??e?.pageNumber);if(Number.isFinite(i)&&i>0)return mt(Math.round(i)-1,0,Math.max(0,r.length-1));let a=Number(e?.slideIndex??e?.index??e?.targetSlideIndex);return Number.isFinite(a)?a>=r.length&&a-1>=0&&a-1a.id===t);if(i>=0)return i+1}let n=String(e?.beforeSlideId||"").trim();if(n){let i=r.findIndex(a=>a.id===n);if(i>=0)return i}return e?.afterSlideNumber?mt(Number(e.afterSlideNumber),0,r.length):e?.beforeSlideNumber?mt(Number(e.beforeSlideNumber)-1,0,r.length):e?.slideNumber?mt(Number(e.slideNumber)-1,0,r.length):e?.slideIndex!==void 0?mt(Number(e.slideIndex),0,r.length):Math.min(r.length,Jt(V)+1)}function hf(e,r,t,n){let i=e?.slide||e?.replacement||e?.newSlide||e?.payload||e;if(!i||typeof i!="object")return null;let a={...r||{},...i,id:i.id||i.slideId||r?.id||ir("html-slide"),html:i.html||i.sourceHtml||i.slideHtml||r?.html||""};return Ur(a,t,{...V,slides:n})}function cb(e,r={}){let t=sb(e);if(!t.length)return!1;let n=sn(V.slides||[]),i=[],a=0;if(t.forEach(l=>{let c=String(l?.op||l?.operation||l?.type||"replace_slide").toLowerCase();if(c==="delete_slide"||c==="delete"||c==="remove_slide"||c==="remove"){if(!n.length)return;let A=ff(l,n,Jt(V)),[f]=n.splice(A,1);f?.id&&i.push(f.id),a+=1;return}if(c==="insert_slide"||c==="insert"||c==="add_slide"||c==="add"){let A=lb(l,n),f=hf(l,null,A,n);if(!f)return;n.splice(A,0,f),i.push(f.id),a+=1;return}let s=ff(l,n,Jt(V)),u=n[s],d=hf(l,u,s,n);d&&(n[s]=d,i.push(d.id),a+=1)}),!a)throw new Error("PPT Live deck patch had no applicable changes");V.title=ga({payload:e,state:V,instruction:r.instruction||"",slides:n}),V.slides=n.map((l,c)=>Ur(l,c,{...V,slides:n})),V.outline=Array.isArray(e.outline)&&e.outline.length?e.outline.map(String):V.slides.map(l=>l.title);let o=i.find(l=>V.slides.some(c=>c.id===l));return V.activeSlideId=o||V.slides[Math.min(Jt(V),V.slides.length-1)]?.id||V.slides[0]?.id||"",V.selectedElementId=qt(V)?.elements?.[0]?.id||"",!0}function ub(e){let r=[];return Array.isArray(e?.htmlSlides)&&r.push(...e.htmlSlides),Array.isArray(e?.slides)&&r.push(...e.slides.filter(t=>t?.html||t?.sourceHtml||t?.slideHtml)),r.map((t,n)=>{let i=String(t?.html||t?.sourceHtml||t?.slideHtml||"").trim();return i?{id:t.id||t.slideId||ir("html-slide"),title:String(t.title||t.label||`${$("newSlideTitle")} ${n+1}`),subtitle:String(t.subtitle||""),kicker:String(t.kicker||""),claim:String(t.claim||t.title||""),proofObject:String(t.proofObject||""),supportNote:String(t.supportNote||""),sourceNote:String(t.sourceNote||""),notes:String(t.notes||""),layout:"html",theme:t.theme||{},html:i,elements:[]}:null}).filter(Boolean)}function pf(...e){for(let r of e){let t=String(r||"").trim();if(t)try{return xi(t),t}catch{}}return String(e.find(r=>String(r||"").trim())||"").trim()}async function db(e,r,t,n=null,i={}){let a=st(),o=i.expectJson!==!1;if(!r||!t||!a.backend?.turnText)return e;let l=!1,c=Promise.resolve(e).finally(()=>{l=!0}),s=new Promise((u,d)=>{let A=Date.now(),f=300*1e3,p=10*1e3,g=3600*1e3,y=()=>Number(n?.lastEventAt||A);(async()=>{for(;!l&&Date.now()-Af)break;if(bsetTimeout(x,Math.min(1e3,p-b)));continue}try{let x=await a.backend.turnText(r,t),P=String(x?.text||"").trim();if(P){if(!o){u({answer:P,thinking:""});return}try{xi(P),u({answer:P,thinking:""});return}catch{}}}catch{}await new Promise(x=>setTimeout(x,2e3))}l||d(new Error("PPT Live backend did not publish a final deck JSON"))})()});return Promise.race([c,s])}async function fb(e,r,t,n=""){let i=Date.now(),a=25e3,o=String(t||"").trim(),l=String(n||"").trim(),s=pf(o,l,`${o} -${l}`.trim());if(s)try{return xi(s),s}catch{}let u=st();if(!e||!r||!u.backend?.turnText){if(!s)throw new Error("PPT Live backend produced no text");return s}let d=0;for(;Date.now()-i{setTimeout(()=>g(new Error("turnText timeout")),4e3)})]),f=String(A?.text||"").trim();if(s=pf(f,s,l,o),s)return xi(s),s}catch{}await new Promise(A=>setTimeout(A,500))}if(!s)throw new Error("PPT Live backend produced no text");return s}function xi(e){let r=String(e||"").trim();if(!r)throw new Error("PPT Live backend produced no text");try{return JSON.parse(r)}catch{let t=r.match(/```(?:json)?\s*([\s\S]*?)```/i);if(t)return JSON.parse(t[1]);let n=r.indexOf("{"),i=r.lastIndexOf("}");if(n>=0&&i>n)return JSON.parse(r.slice(n,i+1));throw new Error("PPT Live backend returned invalid JSON")}}function hb(e){let r=String(e?.message||e||"");return/ppt_live:\/\/round-budget-exhausted|exhausted its \d+-round tool budget|tool budget before producing deck JSON/i.test(r)}function pb(e){return String(e||"").includes("timed out")}function Qo(e){let r=String(e||"");return r.includes("dialog-turn-cancelled")||r.includes("Generation stopped")}async function Ab(e,r={}){let t=nn();r.readBrief!==!1&&rn({includeTopic:!t});let n=[e,Cf()].filter(Boolean).join(": ");if(!n){Zt($("promptRequired"));return}try{await Yl("revise_slide",n,{includeTopic:!t})}catch(i){if(Qo(i))return;st().log?.warn?.("PPT Live backend slide revision failed",{action:e,error:String(i)}),Hl(i),await Pt(!0)}}async function gb(){if(rn({includeTopic:!nn()}),(V.slides||[]).some(e=>String(e?.html||"").trim())){let e=`Restyle the existing deck without changing its facts or narrative. Apply these exact settings to every slide HTML: ${JSON.stringify(Kl())}. Preserve each page's informationIntent and visualStrategy while making the deck visually coherent.`;try{await Yl("revise_deck",e,{includeTopic:!1});return}catch(r){if(Qo(r))return;st().log?.warn?.("PPT Live Agent restyle failed",{error:String(r)}),Hl(r),await Pt(!0);return}}V.slides=V.slides.map((e,r)=>Ur({...e,theme:void 0},r,V)),Zt($("deckRestyled")),Yt(),await Pt(!0)}function Ul(){rn({includeTopic:!nn()});let e=new Map(V.slides.map(r=>[r.title,r]));V.slides=V.outline.map((r,t)=>{let n=e.get(r);return n?Ur(n,t,V):os(r,t,V.outline.length,V)}),V.activeSlideId=V.slides[0]?.id||"",V.selectedElementId=V.slides[0]?.elements[0]?.id||"",Yt(),Pt(!0)}async function mb(){Xn+=1,await jl("before-new"),await $l(),V.generation.active=!1,wi(!1),V=vb(),Ko(),Yt(),Di(V),Zt($("blankDeckReady")),await Pt(!0)}function vb(){return ln(Bn())}function yb(e){if(!ns.includes(e))return;let r=qt(V);if(!r)return;let t=ss({...ka(e),x:10+r.elements.length%5*4,y:14+r.elements.length%5*4});r.elements.push(t),V.selectedElementId=t.id,Yt(),Pt(!0)}function bb(){let e=qt(V);!e||!V.selectedElementId||(e.elements=e.elements.filter(r=>r.id!==V.selectedElementId),V.selectedElementId=e.elements[0]?.id||"",Yt(),Pt(!0))}function Af(e){let r=e.elements.find(t=>t.type==="text"&&t.text);r&&(e.title=r.text.slice(0,90),V.outline[Jt(V)]=e.title,Jt(V)===0&&(V.title=e.title))}function gf(){V.presentIndex=Jt(V),zf(),Pe("previewDialog")?.showModal()}function zf(){let e=V.slides[V.presentIndex]||V.slides[0];Pe("presentSlide")&&(Pe("presentSlide").innerHTML=e?un(e):""),Pe("presentCounter")&&(Pe("presentCounter").textContent=`${Math.max(1,V.presentIndex+1)} / ${Math.max(1,V.slides.length)}`),Ln()}function _o(e){V.presentIndex=mt(V.presentIndex+e,0,V.slides.length-1),zf()}function wb(){if(!(V.slides||[]).length)return yi($("exportDeckEmpty")),null;rn({includeTopic:!nn()});let e=Nl(V);return yi($("exportSavedTo",{path:e})),e}function xb(){return rn({includeTopic:!nn()}),(V.slides||[]).length?!0:(yi($("exportDeckEmpty")),!1)}function Mf(e){return{html:{working:$("exportHtmlWorking"),done:$("exportHtmlDone"),failed:$("exportHtmlFailed")},pptx:{working:$("exportPptxWorking"),done:$("exportPptxDone"),failed:$("exportPptxFailed")},pdf:{working:$("exportPdfWorking"),done:$("exportPdfDone"),failed:$("exportPdfFailed")},png:{working:$("exportPngWorking"),done:$("exportPngDone"),failed:$("exportPngFailed")}}[e]||null}function Wl(e,r,t){let n=Mf(t==="pptx"?"pptx":t);if(!n||r<=0)return;let i=Math.min(r,Math.max(1,e+1));Go("loading",`${n.working} (${i}/${r})`)}async function mf(e,r){let t=st();if(!t?.deck?.renderPage)throw new Error("Host WebView export is unavailable in this runtime.");let n=[],i=e.length;for(let[a,o]of e.entries()){Wl(a,i,r);let l=await t.deck.renderPage({html:bs(o),format:r,width:ar.width,height:ar.height});if(!l)throw new Error(`Host WebView returned empty ${r} for slide ${a+1}`);n.push({index:a,base64:String(l).replace(/^data:.*;base64,/,"")})}return n}async function Sb(e){if(e==="html"){rn({includeTopic:!nn()});let o=Nl(V);if(!o)throw new Error($("exportDeckEmpty"));return{filename:o}}let r=V.slides||[];if(!r.length)throw new Error($("exportDeckEmpty"));let t,n=sn(V);if(e==="pptx")if(r.some(o=>o?.html)){let o=st(),l=typeof o?.deck?.renderPage=="function"?async(s,u)=>{Wl(u,r.length,"pptx");let d=await o.deck.renderPage({html:s,format:"png",width:ar.width,height:ar.height});return String(d||"").replace(/^data:.*;base64,/,"")}:null,c=await jc(r,{renderRaster:l,onRasterProgress:s=>Wl(s,r.length,"pptx")});t=await Bl(n,c)}else t=await El(n);else if(e==="pdf"){let o=await mf(r,"pdf");t=await Rl(n,o.map(l=>l.base64))}else if(e==="png"){let o=await mf(r,"png");t=await Ll(n,o)}else throw new Error($("exportFormatUnavailable"));let i=typeof t?.base64=="string"?t.base64.replace(/^data:.*;base64,/,""):"";if(!i)throw new Error(`export${e} returned no data`);let a=t.filename||`${Il(V.title||"ppt-live")}`;return ef(i,a,t.mimeType||"application/octet-stream"),{filename:a}}var Wo=!1,Qt={updateOutline(e,r){V.outline[e]=r,V.slides[e]&&(V.slides[e].title=r),Yt(),Pt(!0)},moveOutline(e,r){let t=e+r;t<0||t>=V.outline.length||([V.outline[e],V.outline[t]]=[V.outline[t],V.outline[e]],Ul())},removeOutline(e){V.outline.length<=1||(V.outline.splice(e,1),Ul())},selectSlide(e){V.activeSlideId=e,V.selectedElementId=qt(V)?.elements[0]?.id||"",Yt(),Pt(!0)},selectElement(e){V.selectedElementId=e,cn(V,Qt),Ma(V,Qt),Pt(!0)},updateElementTextDirect(e,r){let t=qt(V),n=t?.elements.find(i=>i.id===e);n&&(n.text=String(r||"").trim(),Af(t),Nn(V,Qt),renderOutline(V,Qt),Pt(!1))},updateElementListItemDirect(e,r,t){let i=qt(V)?.elements.find(a=>a.id===e);!i||!Array.isArray(i.items)||(i.items[r]=String(t||"").trim(),i.items=i.items.filter(Boolean),cn(V,Qt),Nn(V,Qt),Pt(!1))},updateSlideHtmlDirect(e,r){let t=V.slides.find(i=>i.id===e);if(!t)return;let n=String(r||"");t.html!==n&&(t.html=n,Nn(V,Qt),Pt(!1))},updateSlideNotes(e){let r=qt(V);r&&(r.notes=e),Pt(!0)},updateSlideMethodology(){let e=qt(V);e&&(e.kicker=Pe("slideKickerInput")?.value||e.kicker,e.claim=Pe("slideClaimInput")?.value||e.claim,e.proofObject=Pe("slideProofInput")?.value||e.proofObject,e.supportNote=Pe("slideSupportInput")?.value||e.supportNote,e.sourceNote=Pe("slideSourceInput")?.value||e.sourceNote,cn(V,Qt),Nn(V,Qt),Pt(!0))},updateElementFromInspector(){let e=qt(V),r=Rn(V);!e||!r||(r.text=Pe("elementTextInput")?.value||"",r.items=(Pe("elementItemsInput")?.value||"").split(` -`).map(t=>t.trim()).filter(Boolean),r.data=Cb(Pe("elementDataInput")?.value||""),r.x=mt(Number(Pe("elementXInput")?.value??r.x),0,100),r.y=mt(Number(Pe("elementYInput")?.value??r.y),0,100),r.w=mt(Number(Pe("elementWInput")?.value??r.w),3,100),r.h=mt(Number(Pe("elementHInput")?.value??r.h),3,100),r.style.fontSize=mt(Number(Pe("elementFontInput")?.value??r.style.fontSize),8,88),r.style.fontWeight=mt(Number(Pe("elementWeightInput")?.value??r.style.fontWeight),100,900),r.style.color=Pe("elementColorInput")?.value||r.style.color,r.style.background=Pe("elementBgInput")?.value||r.style.background,Qt.updateSlideMethodology(),e.notes=Pe("slideNotesInput")?.value||e.notes,Af(e),cn(V,Qt),Pt(!0))},beginDrag(e,r){if(e.button!==0)return;let n=qt(V)?.elements.find(a=>a.id===r);if(!n)return;V.selectedElementId=n.id;let i=Pe("slideCanvas").getBoundingClientRect();Fr={resizing:e.target.classList.contains("resize-handle"),startX:e.clientX,startY:e.clientY,rect:i,start:{x:n.x,y:n.y,w:n.w,h:n.h}},e.currentTarget.setPointerCapture?.(e.pointerId),window.addEventListener("pointermove",Of),window.addEventListener("pointerup",kb,{once:!0})}};function Of(e){if(!Fr)return;let r=Rn(V);if(!r)return;let t=(e.clientX-Fr.startX)/Fr.rect.width*100,n=(e.clientY-Fr.startY)/Fr.rect.height*100;Fr.resizing?(r.w=mt(Fr.start.w+t,3,100-r.x),r.h=mt(Fr.start.h+n,3,100-r.y)):(r.x=mt(Fr.start.x+t,0,100-r.w),r.y=mt(Fr.start.y+n,0,100-r.h)),cn(V,Qt),Ma(V,Qt)}function kb(){Fr=null,window.removeEventListener("pointermove",Of),Pt(!0)}function Cb(e){return e.split(` -`).map((r,t)=>{let[n,i]=r.split(":");return{label:(n||`Item ${t+1}`).trim(),value:Number(i||0)}}).filter(r=>r.label)}function Pb(){let e=document.querySelector(".studio-shell");if(!e)return;let r=document.documentElement,t=Number(Ol("pptLiveFilmstripWidth")||0),n=Number(Ol("pptLiveAgentWidth")||0);t>=128&&t<=360&&r.style.setProperty("--filmstrip-width",`${t}px`),n>=240&&n<=460&&r.style.setProperty("--agent-width",`${n}px`);let i=(a,o)=>{let l=e.getBoundingClientRect(),c=128,s=Math.min(360,l.width*.34),u=240,d=Math.min(460,l.width*.42),A=360,f=g=>{if(a==="filmstrip"){let y=Math.max(c,Math.min(s,g.clientX-l.left));if(l.width-y-parseFloat(getComputedStyle(r).getPropertyValue("--agent-width"))-12{e.classList.remove("is-resizing"),document.querySelectorAll(".panel-resizer.is-dragging").forEach(g=>g.classList.remove("is-dragging")),window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",p),_l("pptLiveFilmstripWidth",String(parseFloat(getComputedStyle(r).getPropertyValue("--filmstrip-width"))||"")),_l("pptLiveAgentWidth",String(parseFloat(getComputedStyle(r).getPropertyValue("--agent-width"))||"")),Ln()};e.classList.add("is-resizing"),window.addEventListener("pointermove",f),window.addEventListener("pointerup",p,{once:!0}),window.addEventListener("pointercancel",p,{once:!0}),f({clientX:o})};Pe("filmstripResizer")?.addEventListener("pointerdown",a=>{a.button===0&&(a.preventDefault(),a.currentTarget.classList.add("is-dragging"),i("filmstrip",a.clientX))}),Pe("agentResizer")?.addEventListener("pointerdown",a=>{a.button===0&&(a.preventDefault(),a.currentTarget.classList.add("is-dragging"),i("agent",a.clientX))})}function Fb(){let e=null,r=()=>{e&&clearTimeout(e),e=setTimeout(()=>{Ln()},60)};window.addEventListener("resize",r),Pe("toggleHistory")?.addEventListener("click",()=>{let t=Pe("historyDrawer");t&&(t.hidden=!t.hidden)}),Pe("closeHistory")?.addEventListener("click",()=>{let t=Pe("historyDrawer");t&&(t.hidden=!0)}),document.querySelectorAll("[data-sidebar-tab]").forEach(t=>{t.addEventListener("click",()=>{let n=t.dataset.sidebarTab;document.querySelectorAll("[data-sidebar-tab]").forEach(i=>{i.classList.toggle("is-active",i.dataset.sidebarTab===n)}),document.querySelectorAll("[data-sidebar-panel]").forEach(i=>{i.classList.toggle("is-active",i.dataset.sidebarPanel===n)})})}),Pe("topicInput")?.addEventListener("input",()=>{if(nn()){V.promptDraft=Pe("topicInput")?.value||"",Pt(!0);return}rn({includeTopic:!0}),Pt(!0)}),Pe("newDeck")?.addEventListener("click",()=>{mb()}),Pe("cancelGeneration")?.addEventListener("click",()=>{ob(!1)}),Pe("sendPrompt")?.addEventListener("click",()=>{Xl()}),Pe("generateOutline")?.addEventListener("click",()=>{vy()}),Pe("generateDeck")?.addEventListener("click",()=>{yy()}),Pe("addOutlineItem")?.addEventListener("click",()=>{V.outline.push($("newSlideTitle")),Yt(),Pt(!0)}),Pe("syncSlidesFromOutline")?.addEventListener("click",Ul),Pe("deleteElement")?.addEventListener("click",bb),Pe("previewDeck")?.addEventListener("click",gf),Pe("closePreview")?.addEventListener("click",()=>Pe("previewDialog")?.close()),Pe("prevPresent")?.addEventListener("click",()=>_o(-1)),Pe("nextPresent")?.addEventListener("click",()=>_o(1)),Pe("exportHtml")?.addEventListener("click",wb),Pe("restyleDeck")?.addEventListener("click",gb),document.querySelectorAll("[data-add-element]").forEach(t=>{t.addEventListener("click",()=>yb(t.dataset.addElement))}),document.querySelectorAll(".ai-action").forEach(t=>{t.addEventListener("click",()=>{Ab(t.dataset.action)})}),document.querySelectorAll(".segment").forEach(t=>{t.addEventListener("click",()=>{V.mode=t.dataset.mode,V.mode==="present"&&gf(),Yt(),Pt(!0)})}),document.addEventListener("keydown",t=>{Pe("previewDialog")?.open&&((t.key==="ArrowRight"||t.key==="PageDown")&&_o(1),(t.key==="ArrowLeft"||t.key==="PageUp")&&_o(-1),t.key==="Escape"&&Pe("previewDialog")?.close())});try{Pb()}catch(t){st().log?.warn?.("Failed to bind PPT Live panel resizers",{error:String(t)})}if(typeof ResizeObserver<"u"){let t=[document.querySelector(".ppt-live"),document.querySelector(".studio-shell"),document.querySelector(".stage-shell"),document.querySelector(".canvas-area")].filter(Boolean),n=new ResizeObserver(r);t.forEach(i=>n.observe(i))}Eb(),Bb(),Rb(),Mb(),_b()}var en=1,vi=.25,Tb=.25,Db=2;function fa(e){en=mt(e,Tb,Db);let r=document.querySelector(".canvas-stage");r&&(r.style.transform=en===1?"":`scale(${en})`);let t=Pe("zoomValue"),n=Pe("statusZoomValue"),i=Math.round(en*100)+"%";t&&(t.textContent=i),n&&(n.textContent=i)}function Eb(){Pe("zoomIn")?.addEventListener("click",()=>fa(en+vi)),Pe("zoomOut")?.addEventListener("click",()=>fa(en-vi)),Pe("statusZoomIn")?.addEventListener("click",()=>fa(en+vi)),Pe("statusZoomOut")?.addEventListener("click",()=>fa(en-vi)),document.querySelector(".canvas-area")?.addEventListener("wheel",e=>{if(e.ctrlKey||e.metaKey){e.preventDefault();let r=e.deltaY>0?-vi:vi;fa(en+r)}},{passive:!1})}function Bb(){Pe("floatingToolbar")&&document.querySelectorAll(".floating-toolbar-btn").forEach(r=>{r.addEventListener("click",()=>{let t=r.dataset.tool;if(!t)return;let n=qt(V),i=Rn(V);if(!(!n||!i)){switch(t){case"bold":i.fontWeight=i.fontWeight==="700"?"400":"700";break;case"italic":i.fontStyle=i.fontStyle==="italic"?"normal":"italic";break;case"underline":i.textDecoration=i.textDecoration==="underline"?"none":"underline";break;case"align-left":i.align="left";break;case"align-center":i.align="center";break;case"align-right":i.align="right";break;case"duplicate":n.elements.push({...sn(i),id:ir("el"),x:i.x+5,y:i.y+5});break;case"delete":n.elements=n.elements.filter(a=>a.id!==i.id),V.selectedElementId=null;break}cn(V,Qt),Nn(V,Qt),Pt(!0)}})})}function Rb(){document.querySelectorAll(".property-section__header").forEach(n=>{let i=n.closest(".property-section");if(!i)return;let a=()=>{i.classList.toggle("is-collapsed");let o=!i.classList.contains("is-collapsed");n.setAttribute("aria-expanded",String(o))};n.addEventListener("click",a),n.addEventListener("keydown",o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),a())})});let e=Pe("densitySlider"),r=e?.querySelector(".density-slider__track");e&&r&&(r.addEventListener("pointerdown",n=>{n.preventDefault(),Pn(lf(n.clientX,r)),r.setPointerCapture(n.pointerId)}),r.addEventListener("pointermove",n=>{r.hasPointerCapture(n.pointerId)&&Pn(lf(n.clientX,r))}),r.addEventListener("pointerup",n=>{r.hasPointerCapture(n.pointerId)&&r.releasePointerCapture(n.pointerId)}),r.addEventListener("pointercancel",n=>{r.hasPointerCapture(n.pointerId)&&(r.releasePointerCapture(n.pointerId),Ia(V.style?.density))}),e.querySelectorAll("[data-density-index]").forEach(n=>{n.addEventListener("click",i=>{i.stopPropagation(),Pn(n.dataset.densityIndex)})}),e.addEventListener("keydown",n=>{let i=Pe("densitySlider"),a=Number(i?.dataset.index??1);n.key==="ArrowLeft"||n.key==="ArrowDown"?(n.preventDefault(),Pn(a-1)):n.key==="ArrowRight"||n.key==="ArrowUp"?(n.preventDefault(),Pn(a+1)):n.key==="Home"?(n.preventDefault(),Pn(0)):n.key==="End"&&(n.preventDefault(),Pn(2))})),document.querySelectorAll("[data-font-family]").forEach(n=>{n.addEventListener("click",()=>{La(n.dataset.fontFamily==="serif"?"serif":"sans")})}),document.querySelectorAll("[data-color-mode]").forEach(n=>{n.addEventListener("click",()=>{Na(n.dataset.colorMode==="dark"?"dark":"light")})});let t=Pe("stylePresetSelect");t&&(Gf(),vc(t),Di(V),t.addEventListener("change",()=>{let n=t.value;if(!n)return;let i=Jo(n);i&&(Na(i.colorMode||"light"),La(i.fontFamily||"sans"),Pn(xa(i.density||"standard"))),Ci(t)}))}var tn=0;function _f(){return Pe("formatGrid")?.querySelector(".format-card.is-selected")?.dataset.format||"pptx"}function Lb(){let e=Pe("exportOverlay");e&&(Uf(),tn=Math.max(0,Jt(V)),e.classList.add("is-visible"),e.setAttribute("aria-hidden","false"),Nb(),Xo(),requestAnimationFrame(()=>bi()))}function bi(){Lc(Pe("exportPreviewFrame"))}function Uf(){let e=Pe("exportModalFeedback"),r=Pe("exportModalFeedbackText"),t=Pe("exportModalSpinner");Pe("exportOverlay")?.classList.remove("is-exporting"),e&&(e.hidden=!0,e.classList.remove("is-success","is-error")),r&&(r.textContent=""),t&&(t.hidden=!1),Gl(!1)}function Gl(e){["exportCancel","exportConfirm","closeExport"].forEach(r=>{let t=Pe(r);t&&(t.disabled=e)}),Pe("formatGrid")?.querySelectorAll(".format-card").forEach(r=>{r.tabIndex=e?-1:0,r.style.pointerEvents=e?"none":""}),["exportPreviewPrev","exportPreviewNext"].forEach(r=>{let t=Pe(r);t&&(t.disabled=e)})}function Go(e,r){let t=Pe("exportModalFeedback"),n=Pe("exportModalFeedbackText"),i=Pe("exportModalSpinner");!t||!n||(t.hidden=!1,t.classList.toggle("is-success",e==="success"),t.classList.toggle("is-error",e==="error"),i&&(i.hidden=e!=="loading"),n.textContent=r)}function jo(){let e=Pe("exportOverlay");e&&(e.classList.remove("is-visible"),e.setAttribute("aria-hidden","true"),Uf())}function Nb(){let e=Pe("formatGrid");if(!e)return;let r=[{id:"pptx",name:"PPTX",desc:"Editable PowerPoint"},{id:"pdf",name:"PDF",desc:"Universal format"},{id:"html",name:"HTML",desc:"Interactive web deck"},{id:"png",name:"PNG",desc:"Image sequence"}];e.innerHTML=r.map((t,n)=>` + `,t.addEventListener("click",()=>{wy(r.id)}),e.append(t)})}}async function wy(e){let r=Vn.find(t=>t.id===e);r&&(Xn+=1,await ec(),X=ln(sn(r.state)),X.generation.active=!1,Zo(),Yt(),Ei(X),Zt($("historyRestored")),await Qo(Si,{...X,updatedAt:Date.now()}))}function xy(e){let r=new Date(e);if(Number.isNaN(r.getTime()))return"";let t=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0"),i=String(r.getHours()).padStart(2,"0"),a=String(r.getMinutes()).padStart(2,"0");return`${t}/${n} ${i}:${a}`}function sf(e){return String(e??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Zt(e){let r=Pe("statusLine");r&&(r.textContent=e)}function yi(e){let r=Pe("exportStatus");r&&(r.textContent=e)}function wi(e,r){Fn=e,document.querySelector(".ppt-live")?.classList.toggle("is-busy",Fn),document.querySelectorAll("button, input, select, textarea").forEach(n=>{if(!["closePreview","prevPresent","nextPresent"].includes(n.id)){if(n.id==="cancelGeneration"){n.disabled=!Fn,n.hidden=!Fn;return}n.id!=="newDeck"&&(n.disabled=Fn)}});let t=Pe("aiStatusPill");t&&(t.textContent=Fn?$("statusPillBusy"):$("statusPillReady"),t.classList.toggle("is-busy",Fn)),r&&Zt(r)}function Mr(e,r,t){X.generation.current=e,X.generation.steps=X.generation.steps.map(n=>({...n,status:n.id===e?r:n.status})),X.generation.active=r==="running"||X.generation.steps.some(n=>n.status==="running"),Fr(X),Wr(X),t&&Zt(t)}function Zo(){X.generation.active=!1,X.generation.current="idle",X.generation.draftedCount=0,X.generation.slideTarget=0,X.generation.eventSeq=0,X.generation.steps=X.generation.steps.map(e=>({...e,status:"pending"})),X.generation.events=[],X.generation.agentStream=[],Fr(X),Wr(X)}function Pr(e,r="",t="info"){X.generation=ki(X.generation||{});let n=typeof e=="string"?{title:e,detail:r,kind:t}:{...e||{}},i=Gt(n.title||n.label||n.message||$("processEventUnknown"),160),a=Gt(n.detail??r??"",260),o=String(n.kind||t||"info").toLowerCase().replace(/[^a-z0-9-]/g,"")||"info";if(!i&&!a)return;let l=Array.isArray(X.generation.events)?X.generation.events:[],c=l[l.length-1];if(c&&c.title===i&&c.detail===a&&c.kind===o)c.timestamp=Date.now(),X.generation.events=l;else{let s=l.reduce((d,A)=>Math.max(d,Number(A.seq)||0),0),u=Math.max(Number(X.generation.eventSeq)||0,s)+1;X.generation.eventSeq=u,X.generation.events=[...l,{id:ir("generation-event"),seq:u,title:i||$("processEventUnknown"),detail:a,kind:o,timestamp:Date.now()}].slice(-80)}Fr(X),Wr(X)}function $r(e){let r=String(e.toolName||"").toLowerCase();if(r&&Zy.has(r)||e.kind==="system")return;X.generation=ki(X.generation||{});let t=Array.isArray(X.generation.agentStream)?X.generation.agentStream:[];if(e.kind==="text"){let n=t[t.length-1];if(n&&n.kind==="text"){n.text=String(n.text||"")+String(e.text||""),n.timestamp=Date.now(),X.generation.agentStream=t,Fr(X);return}}t.push({id:ir("agent-stream"),timestamp:Date.now(),...e}),X.generation.agentStream=t,Fr(X)}function Yt(){X=ln(X),Tc(X,Qt),kf()}function rn(e={}){zc(X,e),X=ln(X)}function Cf(){return Pe("topicInput")?.value.trim()||""}function Pf(){let e=uc().join(` +`);return!X.outline.length||X.outline.join(` +`)===e||X.title===$("defaultDeckTitle")||Xl()}function Xl(){let e=String(X.title||"").trim();return X.slides.length===1&&X.outline.length===1&&X.outline[0]===$("newSlideTitle")&&(e===$("blankDeckTitle")||e===$("newSlideTitle"))}function nn(){return Array.isArray(X.slides)&&X.slides.length>0&&!Pf()&&!Xl()&&!Vl(X)}async function Sy(){await Hl()}async function ky(){await Hl()}async function Hl(){if(Go||Aa)return;let e=Cf();if(!e){Zt($("promptRequired"));return}Go=!0;let r=nn();X.promptDraft=e,X.lastSubmittedPrompt=e,rn({includeTopic:!r}),r||(X.brief.topic=e);try{await Jl("auto",e,{includeTopic:!r,persistBeforeRun:!0});return}catch(t){if(Yo(t))return;st().log?.warn?.("PPT Live backend generation failed",{error:String(t)}),Kl(t),Yt(),await Pt(!0)}finally{Go=!1}}function Ff(e=$("deckReady")){X.generation.active=!1,X.generation.draftedCount=X.slides.length,X.generation.slideTarget=0,X.generation.steps=(X.generation.steps||[]).map(r=>({...r,status:r.status==="error"?"error":"done"})),Zt(e),Fr(X),Wr(X)}function Cy(e=$("backendGenerationFailed"),r=""){X.generation.active=!1,X.generation.steps=(X.generation.steps||[]).map(t=>({...t,status:t.status==="done"?"done":"error"})),Zt(e),Pr({title:e,detail:r||$("agentOnlyRetryHint"),kind:"error"}),wi(!1),Fr(X),Wr(X)}function Py(e,r=5){let t=[],n=new Set,i=e;for(let a=0;i&&a({kind:n.kind,title:n.title,url:n.url,text:String(n.text||"").slice(0,6e3)}))}:null);let t=Number(X.brief?.slideTarget)||0;return t>0&&(r.slideTarget=t),r}function Ql({includePreset:e=!0}={}){let r=es(X.style?.stylePreset),t=X.style?.colorMode==="dark"?"dark":"light",n={fontFamily:X.style?.fontFamily==="serif"?"serif":"sans",density:En(X.style?.density),colorMode:t,theme:t,palette:rc(r,t)};return e&&(n.stylePreset=X.style?.stylePreset||an),n}function Ty(e){let r=String(e||"").trim();if(!r)return"";try{let t=new DOMParser().parseFromString(r,"text/html");return t.querySelectorAll("style,script,svg").forEach(n=>n.remove()),Gt(t.body?.textContent||t.documentElement?.textContent||"",1800)}catch{return Gt(r.replace(/<[^>]+>/g," "),1800)}}function Dy(e){let r=new Set,t=String(e||""),n=Jt(X);return/(当前|本页|这一页|此页|current\s+(slide|page)|this\s+(slide|page))/i.test(t)&&r.add(n),[/第\s*(\d{1,2})\s*(页|頁|张|張)/gi,/\b(?:slide|page)\s*(\d{1,2})\b/gi,/\b(\d{1,2})\s*(?:slide|slides|page|pages)\b/gi].forEach(a=>{let o=a.exec(t);for(;o;){let l=Number(o[1])-1;l>=0&&la-o)}function Ey(e){let r=Dy(e),t=Jt(X),n=new Set(r.length?r:[t]);return{title:X.title,outline:sn(X.outline||[]),slideCount:X.slides.length,activeSlideIndex:t,activeSlideId:X.slides[t]?.id||"",targetHints:r.map(i=>({slideIndex:i,slideNumber:i+1,slideId:X.slides[i]?.id||"",title:X.slides[i]?.title||""})),slides:X.slides.map((i,a)=>{let o=i.html?Ty(i.html):Gt((i.elements||[]).flatMap(c=>[c.text,c.label,...Array.isArray(c.items)?c.items:[]]).filter(Boolean).join(` +`),1800),l={slideIndex:a,slideNumber:a+1,id:i.id,title:i.title,kicker:i.kicker,claim:i.claim,proofObject:i.proofObject,supportNote:i.supportNote,sourceNote:i.sourceNote,notes:i.notes,layout:i.layout,visibleText:o,hasHtml:!!i.html};return n.has(a)&&i.html&&(l.html=String(i.html).slice(0,12e3)),l})}}function lf(e,r){let t=r.getBoundingClientRect(),n=mt((e-t.left)/t.width,0,1);return Math.round(n*2)}function Pn(e){Ma(ka(mt(Math.round(Number(e)),0,2)))}function By(){Ic(X),X=ln(X)}var fa=2,Ry=750;function Ly(e){let r=String(e?.message||e||"");return!(Yo(e)||/Generation stopped/i.test(r)||/backend is unavailable|did not return sessionId/i.test(r)||/permission|workspacePath is required|unsupported PPT Live action/i.test(r))}function Ny(e,r){let t=String(e?.message||e||"");return/rate limit|network|timed? out|connection|temporar|overload|service unavailable|502|503|504/i.test(t)?Math.min(15e3,1e3*2**Math.min(Math.max(0,r-1),4)):Ry}function Iy(e){return/Unknown MiniApp agent session|session workspace does not match/i.test(String(e?.message||e||""))}function zy(){let e=st();return e.backend?.protocol==="files"&&!!e.appDataDir&&!!e.fs?.readFile}function My(){let e=`deck-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return{runId:e,workspaceSubdir:`decks/${e}`,dir:`${st().appDataDir}/decks/${e}`}}function Oy(){let e=String(X.agentSession?.workspaceSubdir||"");return!e||!st().appDataDir?null:{runId:String(X.agentSession?.runId||e.split("/").pop()||""),workspaceSubdir:e,dir:`${st().appDataDir}/${e}`}}function Df(e){return`slides/slide-${String(e).padStart(2,"0")}.html`}function Zl(e){return typeof e=="string"?e:String(e?.title||"")}function Ef(e){return Array.isArray(e?.outline)?e.outline.map(Zl).filter(Boolean):[]}function Bf(e){let r=String(e||"").trim();return r?[$("agentWorkingTitle"),$("generationAgentWorking"),$("blankDeckTitle"),$("defaultDeckTitle"),$("newSlideTitle")].includes(r):!0}function ma({plan:e=null,payload:r=null,state:t=null,instruction:n="",slides:i=[]}={}){let a=Array.isArray(e?.outline)?e.outline:Array.isArray(r?.outline)?r.outline:[],o=a.length?Zl(a[0]):"",l=Array.isArray(i)&&i.length?String(i[0]?.title||"").trim():"",c=[r?.deckPatch?.title,r?.patch?.title,r?.title,e?.title,o,t?.brief?.topic,n,t?.promptDraft,l];for(let s of c){let u=String(s||"").trim();if(u&&!Bf(u))return u}return $("blankDeckTitle")}async function Rf(e,r){let t=st().fs;if(!t?.readFile)throw new Error("PPT Live fs API is unavailable");return await t.readFile(`${e.dir}/${r}`)}async function _y(e,r){try{let t=String(await Rf(e,r)||"");return t.trim()?xi(t):null}catch{return null}}async function Yl(e){return await _y(e,"project.json")}async function Lf(e,r){try{let t=String(await Rf(e,Df(r))||"").trim();return!t||!/<\/html>\s*$/i.test(t)?null:t}catch{return null}}async function Uy(e,r,t=6,n=120){for(let i=1;i<=t;i+=1){let a=await Lf(e,r);if(a)return a;isetTimeout(o,n))}return null}async function Wy(e){let r=await Yl(e);if(!r)throw new Error("PPT Live agent finished without a valid project.json");let t=Array.isArray(r.slide_order)&&r.slide_order.length?r.slide_order:Array.isArray(r.outline)?r.outline.map((i,a)=>`slide-${String(a+1).padStart(2,"0")}`):[],n=[];for(let i=0;i({id:`slide-${String(o+1).padStart(2,"0")}`,title:String(a.title||""),bullets:[],slide_id:`slide-${String(o+1).padStart(2,"0")}`})),i={title:X.title||"",language:Lr(),outline:n,slide_order:n.map(a=>a.slide_id),style:Ql()};await r.writeFile(`${e.dir}/project.json`,`${JSON.stringify(i,null,2)} +`);for(let a=0;atypeof a=="string"?a:a?.name).filter(a=>typeof a=="string"&&a.startsWith("deck-")&&a!==e);for(let a of i)await r.rm(`${t}/${a}`,{recursive:!0})}catch{}}async function Jl(e,r,t={}){if(!st().backend?.call)throw new Error("PPT Live backend is unavailable");if(!Aa){Aa=!0;try{rn({includeTopic:t.includeTopic!==!1}),By(),t.persistBeforeRun&&await Pt(!0),await Xy(e,r)}finally{Aa=!1}}}async function qy(e,r={},t={}){let n=st(),i=Xn,a=null,o=null,l="",c="",s=!1,u=0,d=null,A=[],f=new Set,p=[],g=new Set,y=Jy(),v={lastEventAt:Date.now()};try{let b=await n.backend.call("ppt.generate",e,{entityId:"deck",idempotencyKey:`ppt-live-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,sessionId:t.sessionId||void 0,appDataWorkspace:t.appDataWorkspace||void 0});if(a=b?.sessionId||null,o=b?.turnId||b?.actionRunId||null,!a||!o)throw new Error("PPT Live backend did not return sessionId/turnId");if(nb(a,o),pa(i))throw new Error("Generation stopped");let x=new Promise((W,H)=>{let C=m=>{let N=m.sessionId,ne=N===a,q=String(m.sourceEvent||"");if(q.endsWith("subagent-session-linked")){m.parentSessionId===a&&N&&(g.add(N),Pr({title:$("eventSubagentStarted"),detail:"",kind:"tool"}),$r({kind:"system",text:`[subagent started] ${String(m.subagentName||m.sessionName||N).slice(0,120)}`}));return}let se=g.has(N);if(!(!ne&&!se)&&!(ne&&m.turnId&&m.turnId!==o)){if(v.lastEventAt=Date.now(),!ne&&N&&g.add(N),q.endsWith("dialog-turn-started"))y.note($("eventTurnStarted"),"","turn");else if(q.endsWith("model-round-started"))ne?r.onToolPhase?.("round"):y.note($("eventSubagentWorking"),"","pulse",8e3),y.touch();else if(q.endsWith("model-round-completed"))y.touch();else if(q.endsWith("tool-event")){let Z=$l(m.toolEvent||{}),ue=Z.event_type||Z.eventType||"",j=String(Z.tool_name||Z.toolName||"").trim().toLowerCase();if(ne&&(ue==="Started"?p.push({eventType:ue,toolId:Z.tool_id||Z.toolId||"",toolName:Z.tool_name||Z.toolName||"",params:Z.params||{}}):ue==="Completed"?p.push({eventType:ue,toolId:Z.tool_id||Z.toolId||"",toolName:Z.tool_name||Z.toolName||"",result:Z.result||{}}):(ue==="Failed"||ue==="Cancelled")&&p.push({eventType:ue,toolId:Z.tool_id||Z.toolId||"",toolName:Z.tool_name||Z.toolName||"",error:Z.error||Z.message||ue})),ue==="Started"&&j==="task"&&(y.note($("eventToolTaskStarted"),"","tool"),y.touch()),ue==="Started"&&j){let _=Z.params||Z.result||{},fe=$y(j,_);$r({kind:"tool-start",toolName:j,isSubagent:!ne,text:fe})}else if(ue==="Completed"&&j){let _=eb(j,Z.result||{});_&&$r({kind:"tool-done",toolName:j,isSubagent:!ne,text:_})}else(ue==="Failed"||ue==="Cancelled")&&$r({kind:"tool-error",toolName:j,isSubagent:!ne,text:Gt(String(Z.error||Z.message||ue),200)});if(Yy(Z,f,{isSubagent:!ne})){let _=rb(m,{isSubagent:!ne});_&&Pr(_),y.touch()}if(ne&&(ue==="EarlyDetected"||ue==="Started"))r.onToolPhase?.("detected");else if(ne&&ue==="Completed"){let _=j;if(r.onToolPhase?.("completed"),_==="skill"?y.note($("eventToolSkillReady"),"","phase"):(_==="websearch"||_==="webfetch")&&r.onToolPhase?.("research"),(_==="write"||_==="edit")&&typeof r.onSlideFileWritten=="function"){let ce=If(Z,p).match(/slides\/slide-(\d{2})\.html/i);if(ce){let ie=parseInt(ce[1],10);Number.isFinite(ie)&&ie>0&&Promise.resolve(r.onSlideFileWritten(ie)).catch(()=>{})}}}}else if(q.endsWith("text-chunk")){let Z=String(m.text||"");if(m.contentType==="thinking")c+=Z;else{l+=Z,y.touch(),$r({kind:"text",text:Z});let j=Date.now();j-u>=500&&(u=j,r.onTextProgress?.(l))}}else if(!q.endsWith("token-usage-updated")){if(q.endsWith("dialog-turn-completed")){if(!ne){y.note($("eventSubagentDone"),"","tool"),$r({kind:"system",isSubagent:!0,text:"[subagent done]"});return}$r({kind:"system",text:"[turn completed]"}),s=!0,d={success:m.success,finishReason:m.finishReason||m.finish_reason||"",partialRecoveryReason:m.partialRecoveryReason||m.partial_recovery_reason||""},W({answer:l,thinking:c})}else if(q.endsWith("dialog-turn-failed")||q.endsWith("dialog-turn-cancelled")){if(!ne){y.note($("eventSubagentFailed"),"","error"),$r({kind:"system",isSubagent:!0,text:"[subagent failed]"});return}s=!0,l&&r.onTextProgress?.(l);let Z=Gt(m.error||m.message||"");$r({kind:"system",text:q.endsWith("dialog-turn-cancelled")?"[turn cancelled]":"[turn failed]"}),Pr({title:q.endsWith("dialog-turn-cancelled")?$("eventTurnCancelled"):$("eventTurnFailed"),detail:Z,kind:"error"}),H(new Error(Z||q))}}}};n.backend.onEvent(C),A.push(()=>n.backend.offEvent?.(C));let I=setInterval(()=>{if(s||Date.now()-y.lastProgressLogAt<12e3)return;let N=(X.generation?.steps||[]).find(ne=>ne.status==="running");y.note(N?.label?`${N.label}\u2026`:$("generationProgressPulse"),N?.detail||"","pulse",0)},12e3);A.push(()=>clearInterval(I))}),P=t.resultKind!=="text",F=await db(x,a,o,v,{expectJson:P}),R=typeof F=="string"?F:F?.answer||"",E=typeof F=="string"?"":F?.thinking||"";if(pa(i))throw new Error("Generation stopped");if(!P)return{payload:null,text:R,sessionId:a,toolTrace:p,completion:d};let B=await fb(a,o,R,E);if(pa(i))throw new Error("Generation stopped");let T=xi(B);if(pa(i))throw new Error("Generation stopped");return{payload:T,sessionId:a,toolTrace:p,completion:d}}catch(b){if(b&&typeof b=="object"&&a&&(b.pptLiveSessionId=a,b.pptLiveToolTrace=p),!s&&a&&o&&n.backend?.cancel)try{await n.backend.cancel(a,o)}catch(x){st().log?.warn?.("PPT Live backend cancel after failure failed",{sessionId:a,turnId:o,error:String(x)})}throw b}finally{A.forEach(b=>b()),a&&o&&ib(a,o)}}function Vy(e,r){return{operation:e,instruction:r,locale:Lr(),brief:Fy(),style:Ql()}}async function Xy(e,r){let t=Xn;wi(!0,$("working")),Zo(),Mr("brief","running",$("generationReadingBrief")),Pr({title:$("processEventStarted"),detail:$("processEventWaiting"),kind:"start"}),Hy(e,r);let n=!1,i=zy()?Oy()||My():null;i&&!X.agentSession?.workspaceSubdir&&(await jy(i.runId),await Gy(i));let a={id:X.agentSession?.id||null,project:i},o={value:""},l={touch:()=>{},note:()=>{},lastProgressLogAt:0},c=new Map,s=null;try{let u=null;for(let d=1;d<=fa;d+=1)try{d>1&&(Pr({title:$("generationRetryAttempt",{attempt:d,max:fa}),detail:Tf(u),kind:"start"}),Zt($("generationRetrying",{attempt:d,max:fa})),await new Promise(y=>setTimeout(y,Ny(u,d))));let A={...Vy(e,r),...a?.id?{continueAfterInterruption:!0}:{}};nn()&&(A.currentSlideIndex=Jt(X),A.currentDeck=Ey(r));let{sessionId:p}=await qy(A,{onToolPhase:y=>{y==="detected"?Mr("brief","running",$("generationReadingBrief")):y==="completed"?Mr("brief","done"):y==="research"&&Mr("proof","running",$("generationChoosingProof"))},onTextProgress:y=>tb(y,l,o),onSlideFileWritten:i?async y=>{let v=await Uy(i,y);if(!v)return;c.set(y,v);let b=Array.isArray(s?.outline)?s.outline.length:0;if(!s||y>b){let R=await Yl(i);if(R){s=R;let E=ma({plan:R,state:X,instruction:r});Bf(E)||(X.title=E)}}let x=s||{},P=[...c.entries()].sort((R,E)=>R[0]-E[0]).map(([R,E])=>({id:`ppt-live-slide-${R}`,slideNumber:R,title:typeof x?.outline?.[R-1]=="string"?x.outline[R-1]:x?.outline?.[R-1]?.title||`${$("newSlideTitle")} ${R}`,html:E})),F=ma({plan:x,state:X,instruction:r,slides:P});Mr("design","running",$("generationSlideReady",{slide:y,total:P.length})),Zt($("generationRenderingSlide",{slide:y,total:x?.outline?.length||P.length})),Pr({title:$("generationSlideReady",{slide:y,total:x?.outline?.length||P.length}),detail:"",kind:"slide"}),uf({title:F,language:x?.language||"",outline:Ef(x||{}),researchReport:x?.researchReport||null,design:x?.design||{},slides:P},{instruction:r}),X.activeSlideId=`ppt-live-slide-${y}`,X.selectedElementId="",Yt()}:void 0},{sessionId:a?.id||void 0,appDataWorkspace:a?.project?.workspaceSubdir,resultKind:i?"text":void 0});a.id=p||a.id,X.agentSession={id:a.id||"",workspaceSubdir:a?.project?.workspaceSubdir||"",runId:a?.project?.runId||"",skillKey:af},Pr({title:$("generationParsingDeck"),detail:"",kind:"parsing"}),Zt($("generationParsingDeck")),Mr("design","running",$("generationDesigningLayouts"));let g=i?await Wy(i):null;if(!g)throw new Error("PPT Live agent did not produce a readable deck");uf(g,{instruction:r}),await ql(`agent:${e}`),Pr({title:$("processEventDone"),detail:"",kind:"done"}),Mr("spine","done"),Mr("proof","done"),Mr("design","done"),Mr("compile","done",$("generationCompiled")),Ff($("deckReady")),n=!0,Yt(),await Pt(!0);break}catch(A){if(u=A,Iy(A)?a.id=null:A?.pptLiveSessionId&&(a.id=A.pptLiveSessionId),!Ly(A)||d>=fa)throw A;st().log?.warn?.("PPT Live cowork generation attempt failed, retrying",{attempt:d,maxAttempts:fa,continueInSession:!!a.id,error:String(A)})}}finally{!pa(t)&&(X.generation.active&&!n&&(X.generation.active=!1),wi(!1)),Fr(X),Wr(X)}}function Hy(e,r){Zt($("generationAgentWorking")),Pr({title:$("generationAgentWorking"),detail:Gt(r||""),kind:"start"}),e==="auto"&&(Pf()||Xl())&&(X.title=$("agentWorkingTitle")),Yt()}var Ky=new Set(["ParamsPartial","Queued","Waiting","Progress","Streaming","StreamChunk","Confirmed","Rejected","EarlyDetected","Started"]),Qy=new Set(["read","write","grep","glob","list","todowrite","todo_write","skill","bash","shell","edit","delete","apply_patch","strreplace","search_replace"]),Zy=new Set(["todowrite","todo_write","grep","glob","ls","list","execcommand","bash","shell"]);function cf(e){if(!e)return"";let r=String(e).replace(/\\/g,"/").split("/").filter(Boolean);return r.length<=2?r.join("/"):r.slice(-2).join("/")}function Nf(e,r={}){let t=String(e||"").trim().toLowerCase();return!t||Qy.has(t)?"":t==="websearch"?r.isSubagent?$("eventSubagentWebSearchDone"):$("eventToolWebSearchDone"):t==="webfetch"?r.isSubagent?$("eventSubagentWebFetchDone"):$("eventToolWebFetchDone"):t==="task"?$("eventToolTaskDone"):""}function Yy(e,r,t={}){let n=$l(e),i=n.event_type||n.eventType||"";if(Ky.has(i))return!1;let a=String(n.tool_name||n.toolName||"tool").toLowerCase();if(i==="Completed"&&!Nf(a,t))return!1;let o=If(n)||String(n.params&&typeof n.params=="object"&&n.params.command||"").trim(),l=o?`${a}:${o}:${i}`:`${a}:${i}`;return r.has(l)?!1:(r.add(l),i==="Completed"||i==="Failed"||i==="Cancelled"||i==="ConfirmationNeeded")}function Jy(){let e=0,r="";return{get lastProgressLogAt(){return e},touch(){e=Date.now()},note(t,n="",i="phase",a=0){let o=Date.now(),l=t===r;return a>0&&l&&o-eo?.content||"").filter(Boolean).join(" | "),200)}if(t==="execcommand"||t==="bash"||t==="shell")return Gt(String(n.cmd||n.command||""),160);let i=Object.values(n).find(a=>typeof a=="string"&&a.trim());return Gt(String(i||""),160)}function eb(e,r={}){let t=String(e||"").toLowerCase(),n=r&&typeof r=="object"?r:{};if(t==="websearch"){let i=Array.isArray(n.results)?n.results:[];return i.length?`${i.length} \u6761\u7ED3\u679C`:""}if(t==="webfetch"||t==="mcp__web_reader__webreader"){let i=String(n.content||n.text||n.markdown||"").length;return i?`${i>1e3?Math.round(i/1e3)+"k":i} \u5B57\u7B26`:""}if(t==="read"){let i=Number(n.lineCount||(Array.isArray(n.lines)?n.lines.length:0));return i?`${i} \u884C`:""}return t==="write"||t==="edit"||t==="grep"||t==="glob"||t==="skill"?"":t==="task"?Gt(String(n.result||n.message||""),160):""}function tb(e,r,t){r.touch()}function rb(e,r={}){let t=$l(e.toolEvent||{}),n=t.event_type||t.eventType||"ToolEvent",i=String(t.tool_name||t.toolName||"").trim();if(n==="Completed"){let a=Nf(i,r);return a?{title:a,detail:"",kind:"tool"}:null}return n==="Failed"||n==="Cancelled"?{title:$("eventToolFailedUser"),detail:"",kind:"error"}:n==="ConfirmationNeeded"?{title:$("processEventWaiting"),detail:"",kind:"tool"}:null}function If(e,r=[]){let t=e?.params&&typeof e.params=="object"?e.params:{},n=String(t.file_path||t.path||"").trim();if(n)return n;let i=e?.result&&typeof e.result=="object"?e.result:{},a=String(i.file_path||i.path||"").trim();if(a)return a;let o=String(e?.tool_id||e?.toolId||"").trim();if(!o)return"";let l=[...r].reverse().find(s=>s.eventType==="Started"&&String(s.toolId||s.tool_id||"")===o),c=l?.params&&typeof l.params=="object"?l.params:{};return String(c.file_path||c.path||"").trim()}function $l(e){if(e.event_type||e.eventType||e.tool_name||e.toolName)return e;let t=["EarlyDetected","ParamsPartial","Queued","Waiting","Started","Progress","Streaming","StreamChunk","ConfirmationNeeded","Confirmed","Rejected","Completed","Failed","Cancelled"].find(i=>e&&Object.prototype.hasOwnProperty.call(e,i));return t?{...e[t]||{},event_type:t}:e||{}}function Gt(e,r=180){let t=String(e||"").replace(/\s+/g," ").trim();return t?t.length>r?`${t.slice(0,r-1)}...`:t:""}function nb(e,r){if(!e||!r)return;Tn.some(n=>n.sessionId===e&&n.turnId===r)||Tn.push({sessionId:e,turnId:r})}function ib(e,r){Tn=Tn.filter(t=>!(t.sessionId===e&&t.turnId===r))}function pa(e){return e!==Xn}async function ec(){let e=[...Tn];Tn=[],!(!e.length||!st().backend?.cancel)&&await Promise.all(e.map(async r=>{try{await st().backend.cancel(r.sessionId,r.turnId)}catch(t){st().log?.warn?.("PPT Live backend cancel failed",{sessionId:r.sessionId,turnId:r.turnId,error:String(t)})}}))}async function ab(e=!1,r={}){let t=Tn.length>0;Xn+=1,await ec(),X.generation.active=!1,X.generation.steps=X.generation.steps.map(n=>n.status==="running"?{...n,status:"error"}:n),!r.silent&&t&&(Zt(e?$("generationTimedOut"):$("generationStopped")),Pr(e?$("generationTimedOut"):$("generationStopped"))),wi(!1),Fr(X),Wr(X),r.silent||await Pt(!0)}async function ob(e=!1){await ab(e)}function uf(e,r={}){if(cb(e,r)){e.researchReport&&df(e.researchReport),e.design?.palette&&typeof e.design.palette=="object"&&(X.deckPalette=e.design.palette);return}let t=ma({payload:e,state:X,instruction:r.instruction||"",slides:e?.slides||[]}),n=ub(e);if(n.length)X.title=t,X.slides=n.map((i,a)=>Ur(i,a,{...X,slides:n})),X.outline=X.slides.map(i=>i.title),X.activeSlideId=X.slides[0]?.id||"",X.selectedElementId="";else{if(!Array.isArray(e?.slides)||e.slides.length===0)throw new Error("PPT Live deck payload has no slides");X.title=t,X.slides=e.slides.map((i,a)=>Ur({...i,html:i.html||i.sourceHtml||i.slideHtml||""},a,{...X,slides:e.slides})),X.outline=X.slides.map(i=>i.title),X.activeSlideId=X.slides[0]?.id||"",X.selectedElementId=X.slides[0]?.elements[0]?.id||""}Array.isArray(e.outline)&&e.outline.length&&(X.outline=e.outline.map(Zl).filter(Boolean)),e.researchReport&&df(e.researchReport),e.design?.palette&&typeof e.design.palette=="object"&&(X.deckPalette=e.design.palette)}function df(e){X.sources={...X.sources,facts:e.verifiedFacts||X.sources?.facts||[],warnings:e.warnings||X.sources?.warnings||[],summary:e.summary||X.sources?.summary||"",fetchedAt:Date.now()}}function sb(e){return Array.isArray(e?.deckPatch?.changes)?e.deckPatch.changes:Array.isArray(e?.patch?.changes)?e.patch.changes:Array.isArray(e?.changes)?e.changes:Array.isArray(e?.patches)?e.patches:[]}function ff(e,r,t=0){let n=String(e?.slideId||e?.id||e?.targetSlideId||e?.targetId||"").trim();if(n){let o=r.findIndex(l=>l.id===n);if(o>=0)return o}let i=Number(e?.slideNumber??e?.pageNumber);if(Number.isFinite(i)&&i>0)return mt(Math.round(i)-1,0,Math.max(0,r.length-1));let a=Number(e?.slideIndex??e?.index??e?.targetSlideIndex);return Number.isFinite(a)?a>=r.length&&a-1>=0&&a-1a.id===t);if(i>=0)return i+1}let n=String(e?.beforeSlideId||"").trim();if(n){let i=r.findIndex(a=>a.id===n);if(i>=0)return i}return e?.afterSlideNumber?mt(Number(e.afterSlideNumber),0,r.length):e?.beforeSlideNumber?mt(Number(e.beforeSlideNumber)-1,0,r.length):e?.slideNumber?mt(Number(e.slideNumber)-1,0,r.length):e?.slideIndex!==void 0?mt(Number(e.slideIndex),0,r.length):Math.min(r.length,Jt(X)+1)}function hf(e,r,t,n){let i=e?.slide||e?.replacement||e?.newSlide||e?.payload||e;if(!i||typeof i!="object")return null;let a={...r||{},...i,id:i.id||i.slideId||r?.id||ir("html-slide"),html:i.html||i.sourceHtml||i.slideHtml||r?.html||""};return Ur(a,t,{...X,slides:n})}function cb(e,r={}){let t=sb(e);if(!t.length)return!1;let n=sn(X.slides||[]),i=[],a=0;if(t.forEach(l=>{let c=String(l?.op||l?.operation||l?.type||"replace_slide").toLowerCase();if(c==="delete_slide"||c==="delete"||c==="remove_slide"||c==="remove"){if(!n.length)return;let A=ff(l,n,Jt(X)),[f]=n.splice(A,1);f?.id&&i.push(f.id),a+=1;return}if(c==="insert_slide"||c==="insert"||c==="add_slide"||c==="add"){let A=lb(l,n),f=hf(l,null,A,n);if(!f)return;n.splice(A,0,f),i.push(f.id),a+=1;return}let s=ff(l,n,Jt(X)),u=n[s],d=hf(l,u,s,n);d&&(n[s]=d,i.push(d.id),a+=1)}),!a)throw new Error("PPT Live deck patch had no applicable changes");X.title=ma({payload:e,state:X,instruction:r.instruction||"",slides:n}),X.slides=n.map((l,c)=>Ur(l,c,{...X,slides:n})),X.outline=Array.isArray(e.outline)&&e.outline.length?e.outline.map(String):X.slides.map(l=>l.title);let o=i.find(l=>X.slides.some(c=>c.id===l));return X.activeSlideId=o||X.slides[Math.min(Jt(X),X.slides.length-1)]?.id||X.slides[0]?.id||"",X.selectedElementId=qt(X)?.elements?.[0]?.id||"",!0}function ub(e){let r=[];return Array.isArray(e?.htmlSlides)&&r.push(...e.htmlSlides),Array.isArray(e?.slides)&&r.push(...e.slides.filter(t=>t?.html||t?.sourceHtml||t?.slideHtml)),r.map((t,n)=>{let i=String(t?.html||t?.sourceHtml||t?.slideHtml||"").trim();return i?{id:t.id||t.slideId||ir("html-slide"),title:String(t.title||t.label||`${$("newSlideTitle")} ${n+1}`),subtitle:String(t.subtitle||""),kicker:String(t.kicker||""),claim:String(t.claim||t.title||""),proofObject:String(t.proofObject||""),supportNote:String(t.supportNote||""),sourceNote:String(t.sourceNote||""),notes:String(t.notes||""),layout:"html",theme:t.theme||{},html:i,elements:[]}:null}).filter(Boolean)}function pf(...e){for(let r of e){let t=String(r||"").trim();if(t)try{return xi(t),t}catch{}}return String(e.find(r=>String(r||"").trim())||"").trim()}async function db(e,r,t,n=null,i={}){let a=st(),o=i.expectJson!==!1;if(!r||!t||!a.backend?.turnText)return e;let l=!1,c=Promise.resolve(e).finally(()=>{l=!0}),s=new Promise((u,d)=>{let A=Date.now(),f=300*1e3,p=10*1e3,g=3600*1e3,y=()=>Number(n?.lastEventAt||A);(async()=>{for(;!l&&Date.now()-Af)break;if(bsetTimeout(x,Math.min(1e3,p-b)));continue}try{let x=await a.backend.turnText(r,t),P=String(x?.text||"").trim();if(P){if(!o){u({answer:P,thinking:""});return}try{xi(P),u({answer:P,thinking:""});return}catch{}}}catch{}await new Promise(x=>setTimeout(x,2e3))}l||d(new Error("PPT Live backend did not publish a final deck JSON"))})()});return Promise.race([c,s])}async function fb(e,r,t,n=""){let i=Date.now(),a=25e3,o=String(t||"").trim(),l=String(n||"").trim(),s=pf(o,l,`${o} +${l}`.trim());if(s)try{return xi(s),s}catch{}let u=st();if(!e||!r||!u.backend?.turnText){if(!s)throw new Error("PPT Live backend produced no text");return s}let d=0;for(;Date.now()-i{setTimeout(()=>g(new Error("turnText timeout")),4e3)})]),f=String(A?.text||"").trim();if(s=pf(f,s,l,o),s)return xi(s),s}catch{}await new Promise(A=>setTimeout(A,500))}if(!s)throw new Error("PPT Live backend produced no text");return s}function xi(e){let r=String(e||"").trim();if(!r)throw new Error("PPT Live backend produced no text");try{return JSON.parse(r)}catch{let t=r.match(/```(?:json)?\s*([\s\S]*?)```/i);if(t)return JSON.parse(t[1]);let n=r.indexOf("{"),i=r.lastIndexOf("}");if(n>=0&&i>n)return JSON.parse(r.slice(n,i+1));throw new Error("PPT Live backend returned invalid JSON")}}function hb(e){let r=String(e?.message||e||"");return/ppt_live:\/\/round-budget-exhausted|exhausted its \d+-round tool budget|tool budget before producing deck JSON/i.test(r)}function pb(e){return String(e||"").includes("timed out")}function Yo(e){let r=String(e||"");return r.includes("dialog-turn-cancelled")||r.includes("Generation stopped")}async function Ab(e,r={}){let t=nn();r.readBrief!==!1&&rn({includeTopic:!t});let n=[e,Cf()].filter(Boolean).join(": ");if(!n){Zt($("promptRequired"));return}try{await Jl("revise_slide",n,{includeTopic:!t})}catch(i){if(Yo(i))return;st().log?.warn?.("PPT Live backend slide revision failed",{action:e,error:String(i)}),Kl(i),await Pt(!0)}}async function gb(){if(rn({includeTopic:!nn()}),(X.slides||[]).some(e=>String(e?.html||"").trim())){let e=`Restyle the existing deck without changing its facts or narrative. Apply these exact settings to every slide HTML: ${JSON.stringify(Ql())}. Preserve each page's informationIntent and visualStrategy while making the deck visually coherent.`;try{await Jl("revise_deck",e,{includeTopic:!1});return}catch(r){if(Yo(r))return;st().log?.warn?.("PPT Live Agent restyle failed",{error:String(r)}),Kl(r),await Pt(!0);return}}X.slides=X.slides.map((e,r)=>Ur({...e,theme:void 0},r,X)),Zt($("deckRestyled")),Yt(),await Pt(!0)}function Wl(){rn({includeTopic:!nn()});let e=new Map(X.slides.map(r=>[r.title,r]));X.slides=X.outline.map((r,t)=>{let n=e.get(r);return n?Ur(n,t,X):ls(r,t,X.outline.length,X)}),X.activeSlideId=X.slides[0]?.id||"",X.selectedElementId=X.slides[0]?.elements[0]?.id||"",Yt(),Pt(!0)}async function mb(){Xn+=1,await ql("before-new"),await ec(),X.generation.active=!1,wi(!1),X=vb(),Zo(),Yt(),Ei(X),Zt($("blankDeckReady")),await Pt(!0)}function vb(){return ln(Bn())}function yb(e){if(!as.includes(e))return;let r=qt(X);if(!r)return;let t=cs({...Ca(e),x:10+r.elements.length%5*4,y:14+r.elements.length%5*4});r.elements.push(t),X.selectedElementId=t.id,Yt(),Pt(!0)}function bb(){let e=qt(X);!e||!X.selectedElementId||(e.elements=e.elements.filter(r=>r.id!==X.selectedElementId),X.selectedElementId=e.elements[0]?.id||"",Yt(),Pt(!0))}function Af(e){let r=e.elements.find(t=>t.type==="text"&&t.text);r&&(e.title=r.text.slice(0,90),X.outline[Jt(X)]=e.title,Jt(X)===0&&(X.title=e.title))}function gf(){X.presentIndex=Jt(X),zf(),Pe("previewDialog")?.showModal()}function zf(){let e=X.slides[X.presentIndex]||X.slides[0];Pe("presentSlide")&&(Pe("presentSlide").innerHTML=e?un(e):""),Pe("presentCounter")&&(Pe("presentCounter").textContent=`${Math.max(1,X.presentIndex+1)} / ${Math.max(1,X.slides.length)}`),Ln()}function Wo(e){X.presentIndex=mt(X.presentIndex+e,0,X.slides.length-1),zf()}function wb(){if(!(X.slides||[]).length)return yi($("exportDeckEmpty")),null;rn({includeTopic:!nn()});let e=Il(X);return yi($("exportSavedTo",{path:e})),e}function xb(){return rn({includeTopic:!nn()}),(X.slides||[]).length?!0:(yi($("exportDeckEmpty")),!1)}function Mf(e){return{html:{working:$("exportHtmlWorking"),done:$("exportHtmlDone"),failed:$("exportHtmlFailed")},pptx:{working:$("exportPptxWorking"),done:$("exportPptxDone"),failed:$("exportPptxFailed")},pdf:{working:$("exportPdfWorking"),done:$("exportPdfDone"),failed:$("exportPdfFailed")},png:{working:$("exportPngWorking"),done:$("exportPngDone"),failed:$("exportPngFailed")}}[e]||null}function Gl(e,r,t){let n=Mf(t==="pptx"?"pptx":t);if(!n||r<=0)return;let i=Math.min(r,Math.max(1,e+1));qo("loading",`${n.working} (${i}/${r})`)}async function mf(e,r){let t=st();if(!t?.deck?.renderPage)throw new Error("Host WebView export is unavailable in this runtime.");let n=[],i=e.length;for(let[a,o]of e.entries()){Gl(a,i,r);let l=await t.deck.renderPage({html:ws(o),format:r,width:ar.width,height:ar.height});if(!l)throw new Error(`Host WebView returned empty ${r} for slide ${a+1}`);n.push({index:a,base64:String(l).replace(/^data:.*;base64,/,"")})}return n}async function Sb(e){if(e==="html"){rn({includeTopic:!nn()});let o=Il(X);if(!o)throw new Error($("exportDeckEmpty"));return{filename:o}}let r=X.slides||[];if(!r.length)throw new Error($("exportDeckEmpty"));let t,n=sn(X);if(e==="pptx")if(r.some(o=>o?.html)){let o=st(),l=typeof o?.deck?.renderPage=="function"?async(s,u)=>{Gl(u,r.length,"pptx");let d=await o.deck.renderPage({html:s,format:"png",width:ar.width,height:ar.height});return String(d||"").replace(/^data:.*;base64,/,"")}:null,c=await jc(r,{renderRaster:l,onRasterProgress:s=>Gl(s,r.length,"pptx")});t=await Rl(n,c)}else t=await Bl(n);else if(e==="pdf"){let o=await mf(r,"pdf");t=await Ll(n,o.map(l=>l.base64))}else if(e==="png"){let o=await mf(r,"png");t=await Nl(n,o)}else throw new Error($("exportFormatUnavailable"));let i=typeof t?.base64=="string"?t.base64.replace(/^data:.*;base64,/,""):"";if(!i)throw new Error(`export${e} returned no data`);let a=t.filename||`${zl(X.title||"ppt-live")}`;return ef(i,a,t.mimeType||"application/octet-stream"),{filename:a}}var jo=!1,Qt={updateOutline(e,r){X.outline[e]=r,X.slides[e]&&(X.slides[e].title=r),Yt(),Pt(!0)},moveOutline(e,r){let t=e+r;t<0||t>=X.outline.length||([X.outline[e],X.outline[t]]=[X.outline[t],X.outline[e]],Wl())},removeOutline(e){X.outline.length<=1||(X.outline.splice(e,1),Wl())},selectSlide(e){X.activeSlideId=e,X.selectedElementId=qt(X)?.elements[0]?.id||"",Yt(),Pt(!0)},selectElement(e){X.selectedElementId=e,cn(X,Qt),_a(X,Qt),Pt(!0)},updateElementTextDirect(e,r){let t=qt(X),n=t?.elements.find(i=>i.id===e);n&&(n.text=String(r||"").trim(),Af(t),Nn(X,Qt),renderOutline(X,Qt),Pt(!1))},updateElementListItemDirect(e,r,t){let i=qt(X)?.elements.find(a=>a.id===e);!i||!Array.isArray(i.items)||(i.items[r]=String(t||"").trim(),i.items=i.items.filter(Boolean),cn(X,Qt),Nn(X,Qt),Pt(!1))},updateSlideHtmlDirect(e,r){let t=X.slides.find(i=>i.id===e);if(!t)return;let n=String(r||"");t.html!==n&&(t.html=n,Nn(X,Qt),Pt(!1))},updateSlideNotes(e){let r=qt(X);r&&(r.notes=e),Pt(!0)},updateSlideMethodology(){let e=qt(X);e&&(e.kicker=Pe("slideKickerInput")?.value||e.kicker,e.claim=Pe("slideClaimInput")?.value||e.claim,e.proofObject=Pe("slideProofInput")?.value||e.proofObject,e.supportNote=Pe("slideSupportInput")?.value||e.supportNote,e.sourceNote=Pe("slideSourceInput")?.value||e.sourceNote,cn(X,Qt),Nn(X,Qt),Pt(!0))},updateElementFromInspector(){let e=qt(X),r=Rn(X);!e||!r||(r.text=Pe("elementTextInput")?.value||"",r.items=(Pe("elementItemsInput")?.value||"").split(` +`).map(t=>t.trim()).filter(Boolean),r.data=Cb(Pe("elementDataInput")?.value||""),r.x=mt(Number(Pe("elementXInput")?.value??r.x),0,100),r.y=mt(Number(Pe("elementYInput")?.value??r.y),0,100),r.w=mt(Number(Pe("elementWInput")?.value??r.w),3,100),r.h=mt(Number(Pe("elementHInput")?.value??r.h),3,100),r.style.fontSize=mt(Number(Pe("elementFontInput")?.value??r.style.fontSize),8,88),r.style.fontWeight=mt(Number(Pe("elementWeightInput")?.value??r.style.fontWeight),100,900),r.style.color=Pe("elementColorInput")?.value||r.style.color,r.style.background=Pe("elementBgInput")?.value||r.style.background,Qt.updateSlideMethodology(),e.notes=Pe("slideNotesInput")?.value||e.notes,Af(e),cn(X,Qt),Pt(!0))},beginDrag(e,r){if(e.button!==0)return;let n=qt(X)?.elements.find(a=>a.id===r);if(!n)return;X.selectedElementId=n.id;let i=Pe("slideCanvas").getBoundingClientRect();Cr={resizing:e.target.classList.contains("resize-handle"),startX:e.clientX,startY:e.clientY,rect:i,start:{x:n.x,y:n.y,w:n.w,h:n.h}},e.currentTarget.setPointerCapture?.(e.pointerId),window.addEventListener("pointermove",Of),window.addEventListener("pointerup",kb,{once:!0})}};function Of(e){if(!Cr)return;let r=Rn(X);if(!r)return;let t=(e.clientX-Cr.startX)/Cr.rect.width*100,n=(e.clientY-Cr.startY)/Cr.rect.height*100;Cr.resizing?(r.w=mt(Cr.start.w+t,3,100-r.x),r.h=mt(Cr.start.h+n,3,100-r.y)):(r.x=mt(Cr.start.x+t,0,100-r.w),r.y=mt(Cr.start.y+n,0,100-r.h)),cn(X,Qt),_a(X,Qt)}function kb(){Cr=null,window.removeEventListener("pointermove",Of),Pt(!0)}function Cb(e){return e.split(` +`).map((r,t)=>{let[n,i]=r.split(":");return{label:(n||`Item ${t+1}`).trim(),value:Number(i||0)}}).filter(r=>r.label)}function Pb(){let e=document.querySelector(".studio-shell");if(!e)return;let r=document.documentElement,t=Number(_l("pptLiveFilmstripWidth")||0),n=Number(_l("pptLiveAgentWidth")||0);t>=128&&t<=360&&r.style.setProperty("--filmstrip-width",`${t}px`),n>=240&&n<=460&&r.style.setProperty("--agent-width",`${n}px`);let i=(a,o)=>{let l=e.getBoundingClientRect(),c=128,s=Math.min(360,l.width*.34),u=240,d=Math.min(460,l.width*.42),A=360,f=g=>{if(a==="filmstrip"){let y=Math.max(c,Math.min(s,g.clientX-l.left));if(l.width-y-parseFloat(getComputedStyle(r).getPropertyValue("--agent-width"))-12{e.classList.remove("is-resizing"),document.querySelectorAll(".panel-resizer.is-dragging").forEach(g=>g.classList.remove("is-dragging")),window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",p),Ul("pptLiveFilmstripWidth",String(parseFloat(getComputedStyle(r).getPropertyValue("--filmstrip-width"))||"")),Ul("pptLiveAgentWidth",String(parseFloat(getComputedStyle(r).getPropertyValue("--agent-width"))||"")),Ln()};e.classList.add("is-resizing"),window.addEventListener("pointermove",f),window.addEventListener("pointerup",p,{once:!0}),window.addEventListener("pointercancel",p,{once:!0}),f({clientX:o})};Pe("filmstripResizer")?.addEventListener("pointerdown",a=>{a.button===0&&(a.preventDefault(),a.currentTarget.classList.add("is-dragging"),i("filmstrip",a.clientX))}),Pe("agentResizer")?.addEventListener("pointerdown",a=>{a.button===0&&(a.preventDefault(),a.currentTarget.classList.add("is-dragging"),i("agent",a.clientX))})}function Fb(){let e=null,r=()=>{e&&clearTimeout(e),e=setTimeout(()=>{Ln()},60)};window.addEventListener("resize",r),Pe("toggleHistory")?.addEventListener("click",()=>{let t=Pe("historyDrawer");t&&(t.hidden=!t.hidden)}),Pe("closeHistory")?.addEventListener("click",()=>{let t=Pe("historyDrawer");t&&(t.hidden=!0)}),document.querySelectorAll("[data-sidebar-tab]").forEach(t=>{t.addEventListener("click",()=>{let n=t.dataset.sidebarTab;document.querySelectorAll("[data-sidebar-tab]").forEach(i=>{i.classList.toggle("is-active",i.dataset.sidebarTab===n)}),document.querySelectorAll("[data-sidebar-panel]").forEach(i=>{i.classList.toggle("is-active",i.dataset.sidebarPanel===n)})})}),Pe("topicInput")?.addEventListener("input",()=>{if(nn()){X.promptDraft=Pe("topicInput")?.value||"",Pt(!0);return}rn({includeTopic:!0}),Pt(!0)}),Pe("newDeck")?.addEventListener("click",()=>{mb()}),Pe("cancelGeneration")?.addEventListener("click",()=>{ob(!1)}),Pe("sendPrompt")?.addEventListener("click",()=>{Hl()}),Pe("generateOutline")?.addEventListener("click",()=>{Sy()}),Pe("generateDeck")?.addEventListener("click",()=>{ky()}),Pe("addOutlineItem")?.addEventListener("click",()=>{X.outline.push($("newSlideTitle")),Yt(),Pt(!0)}),Pe("syncSlidesFromOutline")?.addEventListener("click",Wl),Pe("deleteElement")?.addEventListener("click",bb),Pe("previewDeck")?.addEventListener("click",gf),Pe("closePreview")?.addEventListener("click",()=>Pe("previewDialog")?.close()),Pe("prevPresent")?.addEventListener("click",()=>Wo(-1)),Pe("nextPresent")?.addEventListener("click",()=>Wo(1)),Pe("exportHtml")?.addEventListener("click",wb),Pe("restyleDeck")?.addEventListener("click",gb),document.querySelectorAll("[data-add-element]").forEach(t=>{t.addEventListener("click",()=>yb(t.dataset.addElement))}),document.querySelectorAll(".ai-action").forEach(t=>{t.addEventListener("click",()=>{Ab(t.dataset.action)})}),document.querySelectorAll(".segment").forEach(t=>{t.addEventListener("click",()=>{X.mode=t.dataset.mode,X.mode==="present"&&gf(),Yt(),Pt(!0)})}),document.addEventListener("keydown",t=>{Pe("previewDialog")?.open&&((t.key==="ArrowRight"||t.key==="PageDown")&&Wo(1),(t.key==="ArrowLeft"||t.key==="PageUp")&&Wo(-1),t.key==="Escape"&&Pe("previewDialog")?.close())});try{Pb()}catch(t){st().log?.warn?.("Failed to bind PPT Live panel resizers",{error:String(t)})}if(typeof ResizeObserver<"u"){let t=[document.querySelector(".ppt-live"),document.querySelector(".studio-shell"),document.querySelector(".stage-shell"),document.querySelector(".canvas-area")].filter(Boolean),n=new ResizeObserver(r);t.forEach(i=>n.observe(i))}Eb(),Bb(),Rb(),Mb(),_b()}var en=1,vi=.25,Tb=.25,Db=2;function ha(e){en=mt(e,Tb,Db);let r=document.querySelector(".canvas-stage");r&&(r.style.transform=en===1?"":`scale(${en})`);let t=Pe("zoomValue"),n=Pe("statusZoomValue"),i=Math.round(en*100)+"%";t&&(t.textContent=i),n&&(n.textContent=i)}function Eb(){Pe("zoomIn")?.addEventListener("click",()=>ha(en+vi)),Pe("zoomOut")?.addEventListener("click",()=>ha(en-vi)),Pe("statusZoomIn")?.addEventListener("click",()=>ha(en+vi)),Pe("statusZoomOut")?.addEventListener("click",()=>ha(en-vi)),document.querySelector(".canvas-area")?.addEventListener("wheel",e=>{if(e.ctrlKey||e.metaKey){e.preventDefault();let r=e.deltaY>0?-vi:vi;ha(en+r)}},{passive:!1})}function Bb(){Pe("floatingToolbar")&&document.querySelectorAll(".floating-toolbar-btn").forEach(r=>{r.addEventListener("click",()=>{let t=r.dataset.tool;if(!t)return;let n=qt(X),i=Rn(X);if(!(!n||!i)){switch(t){case"bold":i.fontWeight=i.fontWeight==="700"?"400":"700";break;case"italic":i.fontStyle=i.fontStyle==="italic"?"normal":"italic";break;case"underline":i.textDecoration=i.textDecoration==="underline"?"none":"underline";break;case"align-left":i.align="left";break;case"align-center":i.align="center";break;case"align-right":i.align="right";break;case"duplicate":n.elements.push({...sn(i),id:ir("el"),x:i.x+5,y:i.y+5});break;case"delete":n.elements=n.elements.filter(a=>a.id!==i.id),X.selectedElementId=null;break}cn(X,Qt),Nn(X,Qt),Pt(!0)}})})}function Rb(){document.querySelectorAll(".property-section__header").forEach(n=>{let i=n.closest(".property-section");if(!i)return;let a=()=>{i.classList.toggle("is-collapsed");let o=!i.classList.contains("is-collapsed");n.setAttribute("aria-expanded",String(o))};n.addEventListener("click",a),n.addEventListener("keydown",o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),a())})});let e=Pe("densitySlider"),r=e?.querySelector(".density-slider__track");e&&r&&(r.addEventListener("pointerdown",n=>{n.preventDefault(),Pn(lf(n.clientX,r)),r.setPointerCapture(n.pointerId)}),r.addEventListener("pointermove",n=>{r.hasPointerCapture(n.pointerId)&&Pn(lf(n.clientX,r))}),r.addEventListener("pointerup",n=>{r.hasPointerCapture(n.pointerId)&&r.releasePointerCapture(n.pointerId)}),r.addEventListener("pointercancel",n=>{r.hasPointerCapture(n.pointerId)&&(r.releasePointerCapture(n.pointerId),Ma(X.style?.density))}),e.querySelectorAll("[data-density-index]").forEach(n=>{n.addEventListener("click",i=>{i.stopPropagation(),Pn(n.dataset.densityIndex)})}),e.addEventListener("keydown",n=>{let i=Pe("densitySlider"),a=Number(i?.dataset.index??1);n.key==="ArrowLeft"||n.key==="ArrowDown"?(n.preventDefault(),Pn(a-1)):n.key==="ArrowRight"||n.key==="ArrowUp"?(n.preventDefault(),Pn(a+1)):n.key==="Home"?(n.preventDefault(),Pn(0)):n.key==="End"&&(n.preventDefault(),Pn(2))})),document.querySelectorAll("[data-font-family]").forEach(n=>{n.addEventListener("click",()=>{Ia(n.dataset.fontFamily==="serif"?"serif":"sans")})}),document.querySelectorAll("[data-color-mode]").forEach(n=>{n.addEventListener("click",()=>{za(n.dataset.colorMode==="dark"?"dark":"light")})});let t=Pe("stylePresetSelect");t&&(Gf(),yc(t),Ei(X),t.addEventListener("change",()=>{let n=t.value;if(!n)return;let i=es(n);i&&(za(i.colorMode||"light"),Ia(i.fontFamily||"sans"),Pn(Sa(i.density||"standard"))),Ci(t)}))}var tn=0;function _f(){return Pe("formatGrid")?.querySelector(".format-card.is-selected")?.dataset.format||"pptx"}function Lb(){let e=Pe("exportOverlay");e&&(Uf(),tn=Math.max(0,Jt(X)),e.classList.add("is-visible"),e.setAttribute("aria-hidden","false"),Nb(),Ko(),requestAnimationFrame(()=>bi()))}function bi(){Nc(Pe("exportPreviewFrame"))}function Uf(){let e=Pe("exportModalFeedback"),r=Pe("exportModalFeedbackText"),t=Pe("exportModalSpinner");Pe("exportOverlay")?.classList.remove("is-exporting"),e&&(e.hidden=!0,e.classList.remove("is-success","is-error")),r&&(r.textContent=""),t&&(t.hidden=!1),jl(!1)}function jl(e){["exportCancel","exportConfirm","closeExport"].forEach(r=>{let t=Pe(r);t&&(t.disabled=e)}),Pe("formatGrid")?.querySelectorAll(".format-card").forEach(r=>{r.tabIndex=e?-1:0,r.style.pointerEvents=e?"none":""}),["exportPreviewPrev","exportPreviewNext"].forEach(r=>{let t=Pe(r);t&&(t.disabled=e)})}function qo(e,r){let t=Pe("exportModalFeedback"),n=Pe("exportModalFeedbackText"),i=Pe("exportModalSpinner");!t||!n||(t.hidden=!1,t.classList.toggle("is-success",e==="success"),t.classList.toggle("is-error",e==="error"),i&&(i.hidden=e!=="loading"),n.textContent=r)}function Vo(){let e=Pe("exportOverlay");e&&(e.classList.remove("is-visible"),e.setAttribute("aria-hidden","true"),Uf())}function Nb(){let e=Pe("formatGrid");if(!e)return;let r=[{id:"pptx",name:"PPTX",desc:"Editable PowerPoint"},{id:"pdf",name:"PDF",desc:"Universal format"},{id:"html",name:"HTML",desc:"Interactive web deck"},{id:"png",name:"PNG",desc:"Image sequence"}];e.innerHTML=r.map((t,n)=>`
            @@ -344,4 +385,4 @@ ${l}`.trim());if(s)try{return xi(s),s}catch{}let u=st();if(!e||!r||!u.backend?.t ${t.name} ${t.desc}
            - `).join(""),e.querySelectorAll(".format-card").forEach(t=>{let n=()=>{e.querySelectorAll(".format-card").forEach(i=>i.classList.remove("is-selected")),t.classList.add("is-selected"),Xo()};t.addEventListener("click",n),t.addEventListener("keydown",i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),n())})})}function Ib(e,r){if(!e||!r)return;e.innerHTML="";let t=document.createElement("div");t.className="export-preview__viewport";let n=document.createElement("div");if(n.className="export-preview__scale",r.html)n.appendChild(Rc(r.html));else{let i=document.createElement("div");i.className="export-preview__element-stage",i.innerHTML=un(r),n.append(i)}t.append(n),e.append(t),requestAnimationFrame(()=>{bi(),requestAnimationFrame(()=>bi())})}function Xo(){let e=Pe("exportPreviewInfo"),r=Pe("exportPreviewCounter"),t=Pe("exportPreviewFrame"),n=V.slides||[],i=_f().toUpperCase(),a=Math.max(1,n.length);if(tn=mt(tn,0,Math.max(0,n.length-1)),e&&(e.textContent=`${i} \xB7 ${n.length} slides`),r&&(r.textContent=`${tn+1} / ${a}`),!t)return;let o=n[tn];if(!o){t.innerHTML=`
            ${Le($("slidesEmptyHint"))}
            `;return}Ib(t,o)}async function zb(){if(Wo||!xb())return;let e=_f(),r=Mf(e);if(!r){yi($("exportFormatUnavailable"));return}Wo=!0,Pe("exportOverlay")?.classList.add("is-exporting"),Gl(!0),Go("loading",r.working);let t=Pe("exportPreviewFrame"),n=t?.innerHTML||"";try{let{filename:i}=await Sb(e),a=$("exportSavedTo",{path:i});Pe("exportOverlay")?.classList.remove("is-exporting"),Go("success",a),yi(a),await new Promise(o=>setTimeout(o,1600)),jo()}catch(i){let a=i instanceof Error?i.message:String(i);st().log?.error?.(`PPT Live ${e} export failed`,{error:a}),Pe("exportOverlay")?.classList.remove("is-exporting"),Go("error",`${r.failed} ${a}`),yi(`${r.failed} ${a}`)}finally{t&&n&&(t.innerHTML=n),Gl(!1),Wo=!1}}function Mb(){if(Pe("exportPptx")?.addEventListener("click",()=>Lb()),Pe("closeExport")?.addEventListener("click",jo),Pe("exportCancel")?.addEventListener("click",jo),Pe("exportConfirm")?.addEventListener("click",()=>{zb()}),Pe("exportOverlay")?.addEventListener("click",e=>{e.target===Pe("exportOverlay")&&!Wo&&jo()}),Pe("exportPreviewPrev")?.addEventListener("click",()=>{tn=Math.max(0,tn-1),Xo(),requestAnimationFrame(()=>bi())}),Pe("exportPreviewNext")?.addEventListener("click",()=>{let e=(V.slides||[]).length-1;tn=Math.min(e,tn+1),Xo(),requestAnimationFrame(()=>bi())}),typeof ResizeObserver<"u"){let e=Pe("exportPreviewFrame");e&&new ResizeObserver(()=>{Pe("exportOverlay")?.classList.contains("is-visible")&&bi()}).observe(e)}}var vf="pptLiveTheme";function Wf(e){return e==="dark"||e==="light"?e:window.matchMedia?.("(prefers-color-scheme: dark)")?.matches?"dark":"light"}function Ob(){let e=document.documentElement.getAttribute("data-theme-type")||document.documentElement.getAttribute("data-theme");if(e==="dark"||e==="light")return e;let r=st().theme;return r==="dark"||r==="light"?r:Wf()}function yf(e){let r=Wf(e),t=document.documentElement;t.setAttribute("data-theme",r),t.setAttribute("data-theme-type",r),t.style.colorScheme=r,Ln(),Yt()}function _b(){try{localStorage.removeItem(vf)}catch{Vo.delete(vf)}yf(Ob()),st().onThemeChange?.(e=>{let r=e?.type==="dark"?"dark":"light";yf(r)})}async function Ub(){Xn+=1,Tn=[],pa=!1,Uo=!1,(V.generation?.active||V.generation?.steps?.some(r=>r.status==="running"))&&(Ff($("generationStopped")),Ko()),wi(!1);let e=st();e.backend?.cancelStaleRuns&&e.backend.cancelStaleRuns().catch(r=>{st().log?.warn?.("Failed to cancel stale PPT Live backend runs",{error:String(r)})})}function Gf(){let e=Pe("stylePresetSelect");if(!e)return;let r=e.value||V.style?.stylePreset||an;e.textContent="",rc(Nr()).forEach(({key:t,displayName:n,description:i})=>{let a=document.createElement("option");a.value=t,a.textContent=n,i&&(a.title=i),e.append(a)}),e.value=r,e.selectedIndex<0&&(e.value=an),Ci(e)}function qo(){V.generation=ki(V.generation),Pc(),Gf();let e=Pe("aiStatusPill");e&&(e.textContent=Fn?$("statusPillBusy"):$("statusPillReady")),Yt()}async function Wb(){qo();try{await py(),await Ub(),qo(),Di(V),await Pt(!0)}catch(e){st().log?.error?.("PPT Live init failed",{error:String(e)}),Zt($("ready")),qo()}finally{Ln()}}Fb();za();st().onLocaleChange?.(()=>qo());Wb(); + `).join(""),e.querySelectorAll(".format-card").forEach(t=>{let n=()=>{e.querySelectorAll(".format-card").forEach(i=>i.classList.remove("is-selected")),t.classList.add("is-selected"),Ko()};t.addEventListener("click",n),t.addEventListener("keydown",i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),n())})})}function Ib(e,r){if(!e||!r)return;e.innerHTML="";let t=document.createElement("div");t.className="export-preview__viewport";let n=document.createElement("div");if(n.className="export-preview__scale",r.html)n.appendChild(Lc(r.html));else{let i=document.createElement("div");i.className="export-preview__element-stage",i.innerHTML=un(r),n.append(i)}t.append(n),e.append(t),requestAnimationFrame(()=>{bi(),requestAnimationFrame(()=>bi())})}function Ko(){let e=Pe("exportPreviewInfo"),r=Pe("exportPreviewCounter"),t=Pe("exportPreviewFrame"),n=X.slides||[],i=_f().toUpperCase(),a=Math.max(1,n.length);if(tn=mt(tn,0,Math.max(0,n.length-1)),e&&(e.textContent=`${i} \xB7 ${n.length} slides`),r&&(r.textContent=`${tn+1} / ${a}`),!t)return;let o=n[tn];if(!o){t.innerHTML=`
            ${Le($("slidesEmptyHint"))}
            `;return}Ib(t,o)}async function zb(){if(jo||!xb())return;let e=_f(),r=Mf(e);if(!r){yi($("exportFormatUnavailable"));return}jo=!0,Pe("exportOverlay")?.classList.add("is-exporting"),jl(!0),qo("loading",r.working);let t=Pe("exportPreviewFrame"),n=t?.innerHTML||"";try{let{filename:i}=await Sb(e),a=$("exportSavedTo",{path:i});Pe("exportOverlay")?.classList.remove("is-exporting"),qo("success",a),yi(a),await new Promise(o=>setTimeout(o,1600)),Vo()}catch(i){let a=i instanceof Error?i.message:String(i);st().log?.error?.(`PPT Live ${e} export failed`,{error:a}),Pe("exportOverlay")?.classList.remove("is-exporting"),qo("error",`${r.failed} ${a}`),yi(`${r.failed} ${a}`)}finally{t&&n&&(t.innerHTML=n),jl(!1),jo=!1}}function Mb(){if(Pe("exportPptx")?.addEventListener("click",()=>Lb()),Pe("closeExport")?.addEventListener("click",Vo),Pe("exportCancel")?.addEventListener("click",Vo),Pe("exportConfirm")?.addEventListener("click",()=>{zb()}),Pe("exportOverlay")?.addEventListener("click",e=>{e.target===Pe("exportOverlay")&&!jo&&Vo()}),Pe("exportPreviewPrev")?.addEventListener("click",()=>{tn=Math.max(0,tn-1),Ko(),requestAnimationFrame(()=>bi())}),Pe("exportPreviewNext")?.addEventListener("click",()=>{let e=(X.slides||[]).length-1;tn=Math.min(e,tn+1),Ko(),requestAnimationFrame(()=>bi())}),typeof ResizeObserver<"u"){let e=Pe("exportPreviewFrame");e&&new ResizeObserver(()=>{Pe("exportOverlay")?.classList.contains("is-visible")&&bi()}).observe(e)}}var vf="pptLiveTheme";function Wf(e){return e==="dark"||e==="light"?e:window.matchMedia?.("(prefers-color-scheme: dark)")?.matches?"dark":"light"}function Ob(){let e=document.documentElement.getAttribute("data-theme-type")||document.documentElement.getAttribute("data-theme");if(e==="dark"||e==="light")return e;let r=st().theme;return r==="dark"||r==="light"?r:Wf()}function yf(e){let r=Wf(e),t=document.documentElement;t.setAttribute("data-theme",r),t.setAttribute("data-theme-type",r),t.style.colorScheme=r,Ln(),Yt()}function _b(){try{localStorage.removeItem(vf)}catch{Ho.delete(vf)}yf(Ob()),st().onThemeChange?.(e=>{let r=e?.type==="dark"?"dark":"light";yf(r)})}async function Ub(){Xn+=1,Tn=[],Aa=!1,Go=!1,(X.generation?.active||X.generation?.steps?.some(r=>r.status==="running"))&&(Ff($("generationStopped")),Zo()),wi(!1);let e=st();e.backend?.cancelStaleRuns&&e.backend.cancelStaleRuns().catch(r=>{st().log?.warn?.("Failed to cancel stale PPT Live backend runs",{error:String(r)})})}function Gf(){let e=Pe("stylePresetSelect");if(!e)return;let r=e.value||X.style?.stylePreset||an;e.textContent="",nc(Lr()).forEach(({key:t,displayName:n,description:i})=>{let a=document.createElement("option");a.value=t,a.textContent=n,i&&(a.title=i),e.append(a)}),e.value=r,e.selectedIndex<0&&(e.value=an),Ci(e)}function Xo(){X.generation=ki(X.generation),Fc(),Gf();let e=Pe("aiStatusPill");e&&(e.textContent=Fn?$("statusPillBusy"):$("statusPillReady")),Yt()}async function Wb(){Xo();try{await yy(),await Ub(),Xo(),Ei(X),await Pt(!0)}catch(e){st().log?.error?.("PPT Live init failed",{error:String(e)}),Zt($("ready")),Xo()}finally{Ln()}}Fb();Oa();st().onLocaleChange?.(()=>Xo());Wb(); diff --git a/src/crates/contracts/product-domains/src/miniapp/builtin/assets/ppt-live/index.html b/src/crates/contracts/product-domains/src/miniapp/builtin/assets/ppt-live/index.html index b44f4cd2ec..54c109f42a 100644 --- a/src/crates/contracts/product-domains/src/miniapp/builtin/assets/ppt-live/index.html +++ b/src/crates/contracts/product-domains/src/miniapp/builtin/assets/ppt-live/index.html @@ -165,8 +165,6 @@

            Create or edit by prompt