const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.es-BJLvFYMV.js","assets/index-XAQEFxR0.js","assets/index-Bcd83L-V.css","assets/asyncToGenerator-B8GBtsZp.js","assets/slicedToArray-CIunP2G7.js"])))=>i.map(i=>d[i]);
var sd=Object.defineProperty;var ad=(e,t,r)=>t in e?sd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Lt=(e,t,r)=>ad(e,typeof t!="symbol"?t+"":t,r);import{c as $a,r as it,j as o,S as Pi,T as cl,R as od,C as vu,_ as Co,y as jt,g as ld,p as vn,u as ul,A as rn,e as yu,L as rc,o as cd}from"./index-XAQEFxR0.js";import{S as wu}from"./search-BAkj-wLk.js";import{C as ud}from"./circle-alert-BtS5bUWs.js";import{a as hd,H as dd,C as fd}from"./hash-BTvn9URF.js";import{C as pd}from"./chevron-down-Aw6gVMVv.js";import{S as Nu}from"./server-BpOvYAHH.js";import{C as Ga}from"./clock-wl9u5f-e.js";import{E as _u}from"./eye-DfpkT4YW.js";import{G as Ba}from"./globe-ggO-5B8t.js";import{A as hl}from"./activity-DJNZk-yp.js";import{M as gd}from"./mail-C4YbZpAk.js";import{U as Xo,T as nc}from"./user-CG273jvt.js";import{A as ju}from"./arrow-right-BBWeihko.js";import{C as md}from"./calendar-BvkO_kGD.js";import{F as li}from"./file-text-YXpqYYkL.js";import{L as xd}from"./lock-riYib5_N.js";import{g as bd,B as vd,S as yd,a as Au,T as wd,_ as Ft,d as ic,P as sc,L as Nd,C as ac}from"./slicedToArray-CIunP2G7.js";import{N as _d,S as jd}from"./skull-CbMwERHs.js";import{E as Ad}from"./external-link-Cdm4wqGT.js";import{T as Su}from"./terminal-quH4CBjU.js";import{S as Sd}from"./SEO-BWgzAOui.js";import{I as Ld}from"./InvestigationWizard-BQFDug9o.js";import{X as dl}from"./x-BjlbuifP.js";import{T as Fa}from"./target-DtlTPIrP.js";import{C as Lu}from"./circle-check-big-CKA5EG0X.js";import{D as ku}from"./download-B5hOBf36.js";import{m as kd}from"./proxy-C_GZZbVv.js";import{T as Cd}from"./trophy-Cnk5jCR7.js";import{A as Pd}from"./award-C8G88Zaq.js";import{H as Id}from"./house-CTmgKYg8.js";import{C as Fd}from"./crown-BMB7bvmv.js";import{M as Ed}from"./index-CAq7-Zc8.js";import{B as Od}from"./book-open-YNf-MZ7G.js";import{C as Td}from"./crosshair-B6tIAVGJ.js";import"./ThreatHuntingDashboard-DtDniBrw.js";import"./loader-circle-Dgmm4WPV.js";import"./database-DSq8s2r7.js";import"./chevron-right-3LV85XzN.js";import"./chevron-left-AiuWqI8X.js";import"./send-gqAzuMSb.js";/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Md=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],is=$a("code",Md);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Rd=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Dd=$a("map-pin",Rd);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bd=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],qd=$a("paperclip",Bd);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ud=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],zd=$a("table",Ud),Hd=({data:e,alert:t})=>{var c,d,g;const[r,n]=it.useState(null),[s,a]=it.useState(!1);let h=null;try{t!=null&&t.raw_log&&(h=typeof t.raw_log=="string"?JSON.parse(t.raw_log):t.raw_log,typeof h=="string"&&(h=JSON.parse(h)))}catch(m){console.error("Raw log parse error",m)}return o.jsxs("div",{className:"bg-[#0b0c0e] h-full flex flex-col font-mono text-sm text-gray-300 relative overflow-hidden",children:[o.jsxs("div",{className:"p-4 border-b border-gray-800 bg-[#0e0f11]",children:[o.jsxs("div",{className:"flex justify-between items-center mb-4",children:[o.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[o.jsx("span",{className:"text-blue-500",children:"InfoSecLabs"})," SIEM"]}),o.jsx("button",{onClick:()=>a(!s),className:`text-xs px-3 py-1.5 rounded border transition-all flex items-center gap-2 ${s?"bg-green-500/20 text-green-400 border-green-500/50 hover:bg-green-500/30":"bg-blue-900/20 text-blue-400 border-blue-500/30 hover:bg-blue-900/40"}`,children:s?o.jsxs(o.Fragment,{children:[o.jsx(zd,{className:"w-3 h-3"}),"Table View"]}):o.jsxs(o.Fragment,{children:[o.jsx(is,{className:"w-3 h-3"}),"Log Analysis Mode"]})})]}),o.jsxs("div",{className:"relative group",children:[o.jsx("div",{className:"absolute inset-y-0 left-3 flex items-center pointer-events-none",children:o.jsx(wu,{className:"w-4 h-4 text-gray-500 group-focus-within:text-blue-400 transition-colors"})}),o.jsx("input",{readOnly:!0,type:"text",value:((c=e==null?void 0:e.evidence)==null?void 0:c.query)||"index=*",className:"w-full bg-black/50 border border-gray-700 text-green-400 pl-10 pr-4 py-2.5 rounded-lg focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500/50 transition-all font-mono text-sm shadow-inner"}),o.jsx("div",{className:"absolute inset-y-0 right-3 flex items-center",children:o.jsx("span",{className:"text-[10px] text-gray-600 border border-gray-800 px-1.5 rounded",children:"LAST 24H"})})]})]}),o.jsx("div",{className:"flex-1 overflow-auto p-4 custom-scrollbar",children:s?o.jsxs("div",{className:"border border-green-500/30 rounded-lg overflow-hidden bg-[#050507]",children:[o.jsxs("div",{className:"bg-green-500/10 border-b border-green-500/30 p-3 flex justify-between items-center",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(is,{className:"w-4 h-4 text-green-400"}),o.jsx("span",{className:"text-xs font-bold text-green-400 uppercase tracking-wider",children:"Raw Log Data"})]}),o.jsx("span",{className:"text-[10px] text-green-500/60",children:"JSON Format"})]}),o.jsx("div",{className:"p-4 max-h-[500px] overflow-auto custom-scrollbar",children:h?o.jsx("pre",{className:"text-green-400 font-mono text-xs leading-relaxed whitespace-pre-wrap select-text",children:JSON.stringify(h,null,2)}):o.jsxs("div",{className:"text-center text-gray-500 py-8",children:[o.jsx(ud,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),o.jsx("p",{children:"No raw log data available for this alert."})]})})]}):o.jsxs("div",{className:"border border-gray-800 rounded-lg overflow-hidden bg-[#050507]",children:[o.jsxs("div",{className:"grid grid-cols-12 bg-[#1a1b1e] border-b border-gray-800 p-2 text-[10px] text-gray-500 font-bold uppercase tracking-wider",children:[o.jsx("div",{className:"col-span-2",children:"Time"}),o.jsx("div",{className:"col-span-2",children:"Source"}),o.jsx("div",{className:"col-span-1",children:"Event"}),o.jsx("div",{className:"col-span-7",children:"Message"})]}),(()=>{var w,S;let m=((w=e==null?void 0:e.evidence)==null?void 0:w.events)||[];try{if(t!=null&&t.raw_log){let p=typeof t.raw_log=="string"?JSON.parse(t.raw_log):t.raw_log;if(typeof p=="string")try{p=JSON.parse(p)}catch{}Array.isArray(p)?m=p:p.events&&Array.isArray(p.events)?m=p.events:Object.keys(p).length>0&&!((S=e==null?void 0:e.evidence)!=null&&S.events)&&(m=[p])}}catch(p){console.error("SIEM Parse Error",p)}return m.length===0?o.jsx("div",{className:"p-8 text-center text-gray-500 italic",children:"No logs found matching criteria."}):m.map((p,O)=>{var N,T;return o.jsxs("div",{onClick:()=>n(r===O?null:O),className:"grid grid-cols-12 p-3 text-xs border-b border-gray-800/50 hover:bg-white/5 transition-colors group cursor-pointer items-start relative",children:[o.jsx("div",{className:"col-span-2 text-gray-500 font-mono",children:((T=(N=p.timestamp)==null?void 0:N.split("T")[1])==null?void 0:T.split(".")[0])||p.time||"--:--"}),o.jsx("div",{className:"col-span-2 text-blue-400 truncate pr-2",title:p.source,children:p.source||p.src_ip||p.device||"Unknown"}),o.jsx("div",{className:"col-span-1",children:o.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-bold ${p.event_code==="4625"||p.event_code==="403"||String(p.event_code).includes("Rule")?"bg-red-900/30 text-red-400 border border-red-900/50":"bg-gray-800 text-gray-400"}`,children:p.event_code||p.id||"INFO"})}),o.jsx("div",{className:"col-span-6 text-gray-400 group-hover:text-gray-200 transition-colors break-words",children:p.message||"No description available"}),o.jsx("div",{className:"col-span-1 flex justify-end",children:r===O?o.jsx(hd,{className:"w-4 h-4 text-gray-500"}):o.jsx(pd,{className:"w-4 h-4 text-gray-500 opacity-0 group-hover:opacity-100 transition-opacity"})}),r===O&&o.jsxs("div",{className:"col-span-12 mt-3 bg-black/50 p-3 rounded border border-gray-700 animation-expand-vertical",children:[o.jsx("div",{className:"text-[10px] text-gray-500 font-bold mb-1 uppercase tracking-wider",children:"Raw Event Data"}),o.jsx("pre",{className:"text-green-400 font-mono text-[10px] whitespace-pre-wrap leading-relaxed select-text",children:p.raw||JSON.stringify(p,null,2)})]})]},O)})})()]})}),o.jsxs("div",{className:"bg-[#0a0b0d] border-t border-gray-800 p-2 flex justify-between items-center text-[10px] text-gray-600",children:[o.jsxs("div",{className:"flex gap-4",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(Nu,{className:"w-3 h-3"})," US-EAST-1"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(Ga,{className:"w-3 h-3"})," REALTIME"]})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[s&&o.jsxs("span",{className:"text-green-400 flex items-center gap-1",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400 animate-pulse"}),"RAW MODE"]}),o.jsxs("span",{children:[((g=(d=e==null?void 0:e.evidence)==null?void 0:d.events)==null?void 0:g.length)||0," EVENTS FOUND"]})]})]})]})},Wd=({data:e,alert:t})=>{const[r,n]=it.useState(!1);let s=Array.isArray(e)?e[0]:e;try{let w=t==null?void 0:t.raw_log;if(w){let S=typeof w=="string"?JSON.parse(w):w;if(typeof S=="string")try{S=JSON.parse(S)}catch{}S&&(S.process_tree||S.processes?s={tool:s.tool,...S}:s=S)}}catch(w){console.error("EDR Parse Error",w)}const a=w=>s==null?void 0:s[w],h=s.process_tree||s.processes||a("process_tree")||a("processes")||[],c=s.hostname||s.host||a("hostname")||"UNKNOWN",d=s.os||s.os_version||s.platform||a("os")||"Windows 10 Enterprise",g=h&&h.length>0,m=r||!g;return o.jsxs("div",{className:"bg-[#111827] p-6 rounded-lg border border-indigo-900/50 h-full text-gray-300",children:[o.jsxs("div",{className:"flex justify-between items-center mb-6",children:[o.jsxs("div",{children:[o.jsxs("h2",{className:"text-xl font-bold text-indigo-400 flex items-center gap-2",children:[o.jsx("span",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse"}),"InfoSecLabs EDR"]}),o.jsx("div",{className:"text-xs text-indigo-300/50 mt-1",children:"Endpoint Detection & Response"})]}),o.jsx("button",{className:"bg-red-500/10 hover:bg-red-500/20 text-red-400 border border-red-500/50 px-3 py-1.5 rounded text-xs font-bold transition-all",children:"ISOLATE HOST"})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-6",children:[o.jsxs("div",{className:"bg-gray-900/50 p-3 rounded border border-gray-800",children:[o.jsx("div",{className:"text-[10px] uppercase text-gray-500 font-bold",children:"Hostname"}),o.jsx("div",{className:"text-white font-mono",children:c})]}),o.jsxs("div",{className:"bg-gray-900/50 p-3 rounded border border-gray-800",children:[o.jsx("div",{className:"text-[10px] uppercase text-gray-500 font-bold",children:"OS Version"}),o.jsx("div",{className:"text-white font-mono",children:d})]})]}),o.jsxs("div",{className:"flex-1 bg-black/40 rounded-lg border border-gray-800 p-4 font-mono text-xs overflow-auto relative",children:[o.jsxs("div",{className:"flex justify-between items-center mb-4",children:[o.jsx("div",{className:"text-indigo-400 font-bold uppercase tracking-wider",children:m?"Alert Telemetry (JSON)":"Process Tree Execution"}),g&&o.jsx("button",{onClick:()=>n(!r),className:`text-[10px] font-bold px-2 py-1 rounded border transition-colors ${r?"bg-indigo-500/20 text-indigo-300 border-indigo-500/30":"bg-gray-800 text-gray-400 border-gray-700 hover:text-indigo-300"}`,children:r?"VIEW VISUALIZATION":"VIEW SOURCE DATA"})]}),m?o.jsx("div",{className:"h-full overflow-auto custom-scrollbar",children:o.jsx("pre",{className:"text-green-400/80 whitespace-pre-wrap font-mono text-[10px] leading-relaxed",children:JSON.stringify(s,null,2)})}):o.jsx("div",{className:"pl-2 pt-2",children:o.jsx($d,{data:h})})]})]})},Vd=e=>{if(!e)return[];const t={},r=[];return e.forEach(n=>{t[n.id]={...n,_children:[]}}),e.forEach(n=>{n.children&&n.children.length>0&&n.children.forEach(s=>{t[s]&&(t[n.id]._children.push(t[s]),t[s]._isChild=!0)})}),Object.values(t).forEach(n=>{n._isChild||r.push(n)}),r},Cu=({node:e,isLast:t})=>o.jsxs("div",{className:"relative",children:[o.jsxs("div",{className:`p-2 rounded border mb-3 w-full max-w-xl transition-colors relative z-10 ${e.highlight?"bg-red-900/20 border-red-500/50 text-red-300 shadow-[0_0_10px_rgba(220,38,38,0.1)]":"bg-[#1a1b1e] border-gray-700 text-gray-300 hover:border-gray-600"}`,children:[o.jsxs("div",{className:"flex justify-between items-start",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-6 h-6 bg-gray-800 rounded flex items-center justify-center border border-gray-700",children:o.jsx("span",{className:"text-[10px] font-bold text-gray-500",children:"EXE"})}),o.jsxs("div",{children:[o.jsxs("div",{className:"font-bold flex items-center gap-2",children:[e.name,e.highlight&&o.jsx("span",{className:"text-[9px] bg-red-500 text-white px-1 rounded font-bold uppercase",children:"Malicious"})]}),o.jsxs("div",{className:"text-[9px] opacity-50 font-mono",children:["PID: ",e.pid," | User: ",e.user||"SYSTEM"]})]})]}),e.integrity&&o.jsx("div",{className:`text-[9px] px-1.5 py-0.5 rounded border ${e.integrity==="High"||e.integrity==="System"?"bg-red-900/40 text-red-400 border-red-500/30":"bg-gray-800 text-gray-500 border-gray-700"}`,children:e.integrity})]}),o.jsx("div",{className:"mt-2 pt-2 border-t border-gray-700/50",children:o.jsx("div",{className:"text-[10px] text-gray-400 font-mono break-all pl-1 border-l-2 border-gray-700",children:e.cmd})})]}),e._children&&e._children.length>0&&o.jsxs("div",{className:"pl-8 relative",children:[o.jsx("div",{className:"absolute left-3.5 top-[-12px] bottom-4 w-px bg-gray-700"}),e._children.map((r,n)=>o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:"absolute left-[-18px] top-6 w-[18px] h-px bg-gray-700"}),o.jsx(Cu,{node:r,isLast:n===e._children.length-1})]},r.id))]})]}),$d=({data:e})=>{const t=Vd(e);return o.jsx("div",{className:"pb-4",children:t.map(r=>o.jsx(Cu,{node:r},r.id))})},Gd=({data:e,alert:t})=>{var H;const[r,n]=it.useState(!1),[s,a]=it.useState("");let h={};try{if(typeof(t==null?void 0:t.raw_log)=="string"){if(h=JSON.parse(t.raw_log),typeof h=="string")try{h=JSON.parse(h)}catch{}}else h=(t==null?void 0:t.raw_log)||{}}catch(Q){console.error("Failed to parse raw_log for Firewall",Q),h={}}const c=h.src_ip||h.source_ip||h.src||h.source||"192.168.1.100",d=h.dst_ip||h.destination_ip||h.dest_ip||h.dst||h.destination||"10.0.0.5",g=h.protocol||h.proto||"TCP",m=Q=>{const he=String(Q).toUpperCase();return he.includes("RDP")?"3389":he.includes("SSH")?"22":he.includes("HTTPS")?"443":he.includes("HTTP")?"80":he.includes("DNS")?"53":he.includes("FTP")?"21":he.includes("SMB")?"445":he.includes("SMTP")?"25":he.includes("TELNET")?"23":"443"},w=h.dst_port||h.destination_port||h.port||h.dest_port||m(g),S=h.action||"ALLOW",p=h.timestamp||new Date().toISOString(),O=((H=e==null?void 0:e.evidence)==null?void 0:H.packets)||[],N={time:p,src:c,dst:d,port:w,proto:g,action:S,alert:!0},T=O.filter(Q=>!Q.alert),K=[N,...T].slice(0,10).filter(Q=>Q.src.includes(s)||Q.dst.includes(s)||String(Q.port).includes(s)),X=Q=>{if(!Q)return"--:--:--";if(Q.length>10||Q.includes("T"))try{return new Date(Q).toLocaleTimeString()}catch{return Q}return Q};return o.jsxs("div",{className:"bg-[#0e0f11] rounded-2xl border border-gray-800 shadow-xl overflow-hidden flex flex-col h-full w-full",children:[o.jsxs("div",{className:"bg-gray-900/50 border-b border-gray-800 p-4 flex justify-between items-center backdrop-blur-sm",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-2 bg-orange-500/10 rounded-lg border border-orange-500/20",children:o.jsx(Pi,{className:"w-5 h-5 text-orange-400"})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-gray-100 font-semibold tracking-wide",children:"INFOSECLABS FIREWALL"}),o.jsx("div",{className:"flex items-center gap-2 text-xs",children:o.jsxs("span",{className:"flex items-center gap-1.5 text-green-400",children:[o.jsxs("span",{className:"relative flex h-2 w-2",children:[o.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"}),o.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-green-500"})]}),"TRAFFIC MONITOR ACTIVE"]})})]})]}),o.jsxs("div",{className:"flex items-center gap-2 bg-black/40 p-1 rounded-lg border border-gray-800",children:[o.jsxs("button",{onClick:()=>n(!1),className:`px-3 py-1.5 rounded-md text-xs font-medium transition-all flex items-center gap-2 ${r?"text-gray-400 hover:text-gray-200 hover:bg-gray-800":"bg-orange-600 text-white shadow-lg shadow-orange-900/20"}`,children:[o.jsx(_u,{className:"w-3.5 h-3.5"}),"VISUALIZER"]}),o.jsxs("button",{onClick:()=>n(!0),className:`px-3 py-1.5 rounded-md text-xs font-medium transition-all flex items-center gap-2 ${r?"bg-purple-600 text-white shadow-lg shadow-purple-900/20":"text-gray-400 hover:text-gray-200 hover:bg-gray-800"}`,children:[o.jsx(is,{className:"w-3.5 h-3.5"}),"SOURCE DATA"]})]})]}),o.jsx("div",{className:"flex-1 overflow-hidden relative",children:r?o.jsx("div",{className:"h-full p-6 overflow-hidden flex flex-col",children:o.jsxs("div",{className:"flex-1 bg-black rounded-xl border border-gray-800 p-4 font-mono text-xs text-green-400 overflow-auto shadow-inner",children:[o.jsxs("div",{className:"flex justify-between items-center border-b border-gray-800 pb-2 mb-4",children:[o.jsx("span",{className:"text-gray-500 uppercase tracking-wider",children:"RAW LOG TELEMETRY"}),o.jsx("span",{className:"text-gray-600",children:"JSON-FORMATTED EVENT LOG"})]}),o.jsx("pre",{className:"whitespace-pre-wrap",children:JSON.stringify(h,null,2)})]})}):o.jsxs("div",{className:"h-full flex flex-col p-6 gap-6 overflow-y-auto",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"bg-gray-800/30 p-4 rounded-xl border border-gray-700/50 backdrop-blur-sm",children:[o.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[o.jsx("div",{className:"p-1.5 bg-blue-500/10 rounded-md",children:o.jsx(Nu,{className:"w-4 h-4 text-blue-400"})}),o.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Source"})]}),o.jsx("div",{className:"text-xl font-mono text-gray-100",children:c})]}),o.jsxs("div",{className:"bg-gray-800/30 p-4 rounded-xl border border-gray-700/50 backdrop-blur-sm",children:[o.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[o.jsx("div",{className:"p-1.5 bg-purple-500/10 rounded-md",children:o.jsx(Ba,{className:"w-4 h-4 text-purple-400"})}),o.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Destination"})]}),o.jsx("div",{className:"text-xl font-mono text-gray-100",children:d})]}),o.jsxs("div",{className:"bg-gray-800/30 p-4 rounded-xl border border-gray-700/50 backdrop-blur-sm",children:[o.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[o.jsx("div",{className:`p-1.5 rounded-md ${S==="BLOCK"?"bg-red-500/10":"bg-green-500/10"}`,children:o.jsx(hl,{className:`w-4 h-4 ${S==="BLOCK"?"text-red-400":"text-green-400"}`})}),o.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Action"})]}),o.jsx("div",{className:`text-xl font-mono font-bold ${S==="BLOCK"?"text-red-400":"text-green-400"}`,children:S}),o.jsxs("div",{className:"text-xs text-gray-500 mt-1 font-mono",children:[g," : ",w]})]})]}),o.jsxs("div",{className:"flex items-center gap-2 bg-gray-900/50 p-2 rounded-lg border border-gray-800",children:[o.jsx(wu,{className:"w-4 h-4 text-gray-500 ml-2"}),o.jsx("input",{type:"text",placeholder:"Filter traffic logs...",className:"bg-transparent border-none focus:ring-0 text-sm text-gray-300 w-full placeholder-gray-600",value:s,onChange:Q=>a(Q.target.value)})]}),o.jsx("div",{className:"flex-1 bg-gray-900/30 rounded-xl border border-gray-800 overflow-hidden flex flex-col",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-left border-collapse",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-gray-800 bg-gray-900/50 text-xs text-gray-400 uppercase tracking-wider",children:[o.jsx("th",{className:"p-4 font-medium",children:"Timestamp"}),o.jsx("th",{className:"p-4 font-medium",children:"Source"}),o.jsx("th",{className:"p-4 font-medium",children:"Destination"}),o.jsx("th",{className:"p-4 font-medium",children:"Proto"}),o.jsx("th",{className:"p-4 font-medium",children:"Action"})]})}),o.jsx("tbody",{className:"text-sm font-mono",children:K.map((Q,he)=>o.jsxs("tr",{className:`border-b border-gray-800/50 hover:bg-gray-800/30 transition-colors ${Q.alert?"bg-red-500/5":""}`,children:[o.jsx("td",{className:"p-4 text-gray-400",children:X(Q.time)}),o.jsx("td",{className:"p-4 text-gray-300",children:Q.src}),o.jsxs("td",{className:"p-4 text-gray-300 flex items-center gap-2",children:[Q.dst,Q.alert&&o.jsx(cl,{className:"w-3 h-3 text-red-500"})]}),o.jsxs("td",{className:"p-4 text-gray-400",children:[Q.proto,"/",Q.port]}),o.jsx("td",{className:"p-4",children:o.jsx("span",{className:`px-2 py-1 rounded text-[10px] font-bold border ${Q.action==="BLOCK"?"bg-red-500/10 text-red-400 border-red-500/20":"bg-green-500/10 text-green-400 border-green-500/20"}`,children:Q.action})})]},he))})]})})})]})}),o.jsxs("div",{className:"bg-gray-900/80 border-t border-gray-800 p-3 text-xs text-gray-500 flex justify-between items-center",children:[o.jsx("span",{children:"NetGuard FW-X1 v4.2.1"}),o.jsxs("span",{children:["ID: ",t.id," • ",new Date().toISOString()]})]})]})},Jd=({data:e,alert:t})=>{var S,p,O,N,T,L,K,X,H,Q,he,pe,C;const[r,n]=it.useState(!1);let s={};try{if(typeof(t==null?void 0:t.raw_log)=="string"){if(s=JSON.parse(t.raw_log),typeof s=="string")try{s=JSON.parse(s)}catch{}}else s=(t==null?void 0:t.raw_log)||{}}catch(R){console.error("Failed to parse raw_log",R),s={}}const a=s.from||s.sender||s.email_sender||s.src_email||((p=(S=e==null?void 0:e.evidence)==null?void 0:S.headers)==null?void 0:p.from)||"unknown@sender.com",h=s.to||s.recipient||s.email_recipient||s.dest_email||s.target||(s.username?`${s.username}@company.com`:null)||((N=(O=e==null?void 0:e.evidence)==null?void 0:O.headers)==null?void 0:N.to)||"employee@company.com",c=s.subject||s.email_subject||((L=(T=e==null?void 0:e.evidence)==null?void 0:T.headers)==null?void 0:L.subject)||"Suspicious Activity Detected",d=s.timestamp||s.date||s.time||((X=(K=e==null?void 0:e.evidence)==null?void 0:K.headers)==null?void 0:X.date)||new Date().toISOString(),g={from:a,to:h,subject:c,date:d};let m=[],w=s.filename||s.file_name||s.attachment_name;return!w&&s.attachment&&(typeof s.attachment=="object"&&s.attachment!==null?(w=s.attachment.name||s.attachment.filename||JSON.stringify(s.attachment),s.attachment.hash||s.attachment.sha256||s.attachment.md5):w=s.attachment),w?m=[{name:typeof w=="object"?JSON.stringify(w):w,size:s.file_size||s.size||"Unknown",type:s.file_type||s.type||"application/octet-stream",verdict:s.verdict||s.threat_level||"Malicious"}]:m=((H=e==null?void 0:e.evidence)==null?void 0:H.attachments)||[],o.jsxs("div",{className:"bg-[#0e0f11] rounded-2xl border border-gray-800 shadow-xl overflow-hidden flex flex-col h-full w-full",children:[o.jsxs("div",{className:"bg-[#131416] border-b border-gray-800 p-4 flex justify-between items-center shrink-0",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-10 h-10 bg-purple-900/20 rounded-xl flex items-center justify-center border border-purple-500/20 shadow-[0_0_15px_rgba(168,85,247,0.1)]",children:o.jsx(gd,{className:"w-5 h-5 text-purple-400"})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-sm font-bold text-white uppercase tracking-wider",children:"SecureMail Guard"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse"}),o.jsx("div",{className:"text-[10px] text-gray-500 font-mono",children:"GATEWAY ACTIVE"})]})]})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"flex bg-black/40 rounded-lg p-1 border border-gray-800",children:[o.jsxs("button",{onClick:()=>n(!1),className:`px-3 py-1.5 rounded-md text-[10px] font-bold uppercase tracking-wider transition-all flex items-center gap-2 ${r?"text-gray-500 hover:text-gray-300":"bg-purple-600 text-white shadow-lg shadow-purple-900/20"}`,children:[o.jsx(_u,{className:"w-3 h-3"}),"Visualizer"]}),o.jsxs("button",{onClick:()=>n(!0),className:`px-3 py-1.5 rounded-md text-[10px] font-bold uppercase tracking-wider transition-all flex items-center gap-2 ${r?"bg-purple-600 text-white shadow-lg shadow-purple-900/20":"text-gray-500 hover:text-gray-300"}`,children:[o.jsx(is,{className:"w-3 h-3"}),"Source Data"]})]}),o.jsxs("div",{className:`px-3 py-1.5 rounded-lg border text-[10px] font-bold uppercase tracking-wider flex items-center gap-2 ${(((Q=e==null?void 0:e.evidence)==null?void 0:Q.security_check)||"").includes("FAIL")||((he=e==null?void 0:e.evidence)==null?void 0:he.verdict)==="Malicious"?"bg-red-500/10 text-red-400 border-red-500/20":"bg-green-500/10 text-green-400 border-green-500/20"}`,children:[o.jsx(Pi,{className:"w-3 h-3"}),((pe=e==null?void 0:e.evidence)==null?void 0:pe.security_check)||"SCAN COMPLETE"]})]})]}),o.jsx("div",{className:"flex-1 overflow-hidden relative",children:r?o.jsx("div",{className:"absolute inset-0 overflow-auto custom-scrollbar p-0",children:o.jsxs("div",{className:"min-h-full bg-[#0a0a0c] p-6",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsx("h3",{className:"text-xs font-bold text-gray-500 uppercase tracking-widest",children:"Raw Log Telemetry"}),o.jsx("div",{className:"text-[10px] font-mono text-gray-600",children:"JSON-FORMATTED EVENT LOG"})]}),t.raw_log?o.jsx("pre",{className:"font-mono text-xs text-green-400/90 whitespace-pre-wrap leading-relaxed bg-black/40 p-6 rounded-xl border border-gray-800/50 shadow-inner",children:typeof t.raw_log=="string"?t.raw_log:JSON.stringify(t.raw_log,null,2)}):o.jsxs("div",{className:"text-center py-20",children:[o.jsx(cl,{className:"w-12 h-12 text-yellow-500/20 mx-auto mb-4"}),o.jsx("p",{className:"text-gray-500 font-mono text-xs",children:"No raw log data available for this alert."}),o.jsx("p",{className:"text-gray-600 text-[10px] mt-2",children:"Displaying simulation data structure instead:"}),o.jsx("pre",{className:"mt-6 text-left font-mono text-xs text-gray-500 whitespace-pre-wrap bg-black/40 p-4 rounded-xl border border-gray-800/50 max-w-2xl mx-auto",children:JSON.stringify(e,null,2)})]})]})}):o.jsxs("div",{className:"absolute inset-0 overflow-y-auto custom-scrollbar p-6 space-y-6 bg-[#0c0d0f]",children:[o.jsx("div",{className:"bg-[#131416] rounded-xl border border-gray-800 overflow-hidden",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-px bg-gray-800/50",children:[o.jsxs("div",{className:"bg-[#131416] p-4 flex flex-col gap-1",children:[o.jsxs("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-wider flex items-center gap-1.5",children:[o.jsx(Xo,{className:"w-3 h-3"})," From"]}),o.jsx("div",{className:"font-mono text-sm text-white break-all",children:g.from})]}),o.jsxs("div",{className:"bg-[#131416] p-4 flex flex-col gap-1",children:[o.jsxs("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-wider flex items-center gap-1.5",children:[o.jsx(ju,{className:"w-3 h-3"})," To"]}),o.jsx("div",{className:"font-mono text-sm text-gray-300 break-all",children:g.to})]}),o.jsxs("div",{className:"bg-[#131416] p-4 flex flex-col gap-1",children:[o.jsxs("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-wider flex items-center gap-1.5",children:[o.jsx(md,{className:"w-3 h-3"})," Timestamp"]}),o.jsx("div",{className:"font-mono text-sm text-gray-300",children:g.date})]}),o.jsxs("div",{className:"bg-[#131416] p-4 flex flex-col gap-1",children:[o.jsxs("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-wider flex items-center gap-1.5",children:[o.jsx(li,{className:"w-3 h-3"})," Subject"]}),o.jsx("div",{className:"font-bold text-sm text-white",children:g.subject})]})]})}),m.length>0&&o.jsxs("div",{children:[o.jsxs("h3",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-wider mb-3 flex items-center gap-2",children:[o.jsx(qd,{className:"w-3.5 h-3.5"})," Attachments (",m.length,")"]}),o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:m.map((R,ne)=>o.jsxs("div",{className:`group relative bg-[#131416] p-3 rounded-xl border transition-all hover:-translate-y-0.5 ${R.verdict==="Malicious"?"border-red-500/30 hover:border-red-500/50 hover:shadow-[0_5px_15px_rgba(239,68,68,0.1)]":"border-gray-800 hover:border-gray-700"}`,children:[o.jsxs("div",{className:"flex items-start justify-between mb-2",children:[o.jsx("div",{className:"p-2 bg-black/40 rounded-lg border border-gray-800",children:o.jsx(li,{className:"w-5 h-5 text-gray-400"})}),R.verdict==="Malicious"&&o.jsx("span",{className:"px-1.5 py-0.5 rounded bg-red-500/10 text-red-400 border border-red-500/20 text-[9px] font-black uppercase tracking-wider",children:"Malware"})]}),o.jsx("div",{className:"font-mono text-xs text-white font-bold truncate mb-1",title:R.name,children:R.name}),o.jsxs("div",{className:"flex justify-between items-center text-[10px] text-gray-500",children:[o.jsx("span",{children:R.size}),o.jsx("span",{className:"font-mono opacity-50",children:R.type})]})]},ne))})]}),o.jsxs("div",{className:"flex-1",children:[o.jsxs("h3",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-wider mb-3 flex items-center gap-2",children:[o.jsx(li,{className:"w-3.5 h-3.5"})," Message Body"]}),o.jsxs("div",{className:"bg-white text-gray-900 rounded-xl p-8 min-h-[300px] shadow-sm font-serif leading-relaxed relative",children:[o.jsxs("div",{className:"border-b pb-4 mb-4 border-gray-200",children:[o.jsx("div",{className:"text-xl font-bold mb-2 text-gray-800",children:g.subject}),o.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[o.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center text-blue-600 font-bold text-xs",children:g.from.charAt(0).toUpperCase()}),o.jsx("div",{children:o.jsx("span",{className:"font-bold text-gray-900",children:g.from})})]})]}),o.jsx("div",{className:"prose prose-sm max-w-none text-gray-800",children:(C=e==null?void 0:e.evidence)!=null&&C.body_preview?e.evidence.body_preview.split(`
`).map((R,ne)=>o.jsx("p",{className:"mb-2",children:R},ne)):o.jsx("p",{className:"italic text-gray-400",children:"No body content captured."})}),o.jsxs("div",{className:"mt-8 pt-8 border-t border-gray-100 text-xs text-gray-400 text-center",children:["Scanned by SecureMail Gateway • ID: ",t.id," • ",g.date]})]})]})]})})]})},Yd=({data:e,alert:t})=>{var d,g,m,w,S,p;const[r,n]=it.useState(!1);let s={};try{s=typeof(t==null?void 0:t.raw_log)=="string"?JSON.parse(t.raw_log):(t==null?void 0:t.raw_log)||{}}catch(O){console.error("Failed to parse raw_log for Identity",O)}const a={name:s.user||s.display_name||s.name||((d=e==null?void 0:e.user)==null?void 0:d.display_name)||"Unknown User",username:s.username||s.user_id||((g=e==null?void 0:e.user)==null?void 0:g.username)||"unknown.user",department:s.department||s.dept||((m=e==null?void 0:e.user)==null?void 0:m.department)||"Operations",manager:s.manager||s.reports_to||((w=e==null?void 0:e.user)==null?void 0:w.manager)||"N/A",role:s.role||s.job_title||((S=e==null?void 0:e.user)==null?void 0:S.role)||"Standard User",riskScore:s.risk_score||s.score||((p=e==null?void 0:e.user)==null?void 0:p.risk_score)||85},h=s.recent_activity||s.activities||s.events||[],c=h.length>0?h:(e==null?void 0:e.recent_activity)||[{action:"Login Success",location:"New York, USA",ip:"192.168.1.10",time:"10 min ago",flag:!1},{action:"Password Change",location:"New York, USA",ip:"192.168.1.10",time:"1 hour ago",flag:!1}];return o.jsxs("div",{className:"bg-[#0e0f11] rounded-2xl border border-gray-800 shadow-xl overflow-hidden flex flex-col h-full w-full font-sans",children:[o.jsxs("div",{className:"bg-gray-900/50 border-b border-gray-800 p-4 flex justify-between items-center backdrop-blur-sm",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-2 bg-blue-500/10 rounded-lg border border-blue-500/20",children:o.jsx(xd,{className:"w-5 h-5 text-blue-400"})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-gray-100 font-semibold tracking-wide",children:"INFOSECLABS IDENTITY"}),o.jsx("div",{className:"flex items-center gap-2 text-xs",children:o.jsxs("span",{className:"flex items-center gap-1.5 text-blue-400",children:[o.jsxs("span",{className:"relative flex h-2 w-2",children:[o.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75"}),o.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-blue-500"})]}),"DIRECTORY SYNC ACTIVE"]})})]})]}),o.jsxs("div",{className:"flex items-center gap-2 bg-black/40 p-1 rounded-lg border border-gray-800",children:[o.jsxs("button",{onClick:()=>n(!1),className:`px-3 py-1.5 rounded-md text-xs font-medium transition-all flex items-center gap-2 ${r?"text-gray-400 hover:text-gray-200 hover:bg-gray-800":"bg-blue-600 text-white shadow-lg shadow-blue-900/20"}`,children:[o.jsx(Xo,{className:"w-3.5 h-3.5"}),"PROFILE"]}),o.jsxs("button",{onClick:()=>n(!0),className:`px-3 py-1.5 rounded-md text-xs font-medium transition-all flex items-center gap-2 ${r?"bg-purple-600 text-white shadow-lg shadow-purple-900/20":"text-gray-400 hover:text-gray-200 hover:bg-gray-800"}`,children:[o.jsx(is,{className:"w-3.5 h-3.5"}),"SOURCE DATA"]})]})]}),o.jsx("div",{className:"flex-1 overflow-hidden relative",children:r?o.jsx("div",{className:"h-full p-6 overflow-hidden flex flex-col",children:o.jsxs("div",{className:"flex-1 bg-black rounded-xl border border-gray-800 p-4 font-mono text-xs text-green-400 overflow-auto shadow-inner",children:[o.jsxs("div",{className:"flex justify-between items-center border-b border-gray-800 pb-2 mb-4",children:[o.jsx("span",{className:"text-gray-500 uppercase tracking-wider",children:"RAW LOG TELEMETRY"}),o.jsx("span",{className:"text-gray-600",children:"JSON-FORMATTED EVENT LOG"})]}),o.jsx("pre",{className:"whitespace-pre-wrap",children:JSON.stringify(s,null,2)}),o.jsxs("pre",{className:"whitespace-pre-wrap mt-4 text-gray-500",children:["// Simulation Metadata",JSON.stringify(e,null,2)]})]})}):o.jsxs("div",{className:"h-full flex flex-col md:flex-row divide-y md:divide-y-0 md:divide-x divide-gray-800",children:[o.jsxs("div",{className:"w-full md:w-1/3 bg-gray-900/20 p-6 flex flex-col gap-6 overflow-y-auto",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"w-24 h-24 bg-gradient-to-br from-blue-500 to-indigo-600 rounded-full mx-auto mb-4 flex items-center justify-center text-4xl shadow-lg ring-4 ring-gray-900 border border-gray-700",children:o.jsx("span",{className:"text-white drop-shadow-md",children:a.name.charAt(0)})}),o.jsx("h3",{className:"text-xl font-bold text-gray-100",children:a.name}),o.jsxs("div",{className:"text-sm text-gray-400 font-mono",children:["@",a.username]}),o.jsxs("div",{className:"mt-4 inline-flex items-center gap-2 px-3 py-1 rounded-full bg-red-500/10 border border-red-500/20 text-red-400 text-xs font-bold uppercase tracking-wide",children:[o.jsx(Pi,{className:"w-3 h-3"})," Risk Score: ",a.riskScore,"/100"]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"bg-gray-800/40 p-4 rounded-xl border border-gray-700/50",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(bd,{className:"w-4 h-4 text-gray-400 mt-1"}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-gray-500 uppercase tracking-wider mb-0.5",children:"Role"}),o.jsx("div",{className:"text-sm text-gray-200",children:a.role})]})]})}),o.jsx("div",{className:"bg-gray-800/40 p-4 rounded-xl border border-gray-700/50",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(vd,{className:"w-4 h-4 text-gray-400 mt-1"}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-gray-500 uppercase tracking-wider mb-0.5",children:"Department"}),o.jsx("div",{className:"text-sm text-gray-200",children:a.department})]})]})}),o.jsx("div",{className:"bg-gray-800/40 p-4 rounded-xl border border-gray-700/50",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(Xo,{className:"w-4 h-4 text-gray-400 mt-1"}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-gray-500 uppercase tracking-wider mb-0.5",children:"Manager"}),o.jsx("div",{className:"text-sm text-gray-200",children:a.manager})]})]})})]})]}),o.jsxs("div",{className:"flex-1 bg-gray-900/10 p-6 overflow-y-auto",children:[o.jsxs("h3",{className:"text-sm font-bold text-gray-400 uppercase tracking-wider mb-6 flex items-center gap-2",children:[o.jsx(hl,{className:"w-4 h-4 text-blue-400"})," Recent User Activity"]}),o.jsx("div",{className:"relative pl-4 space-y-8 before:absolute before:left-[19px] before:top-2 before:bottom-2 before:w-[2px] before:bg-gray-800",children:c.map((O,N)=>o.jsxs("div",{className:"relative flex gap-4 group",children:[o.jsx("div",{className:`absolute -left-[5px] mt-1.5 w-3 h-3 rounded-full border-2 border-[#0e0f11] shadow-sm z-10 transition-transform group-hover:scale-125 ${O.flag?"bg-red-500 ring-4 ring-red-500/10":"bg-green-500"}`}),o.jsxs("div",{className:`flex-1 p-4 rounded-xl border transition-all ${O.flag?"bg-red-500/5 border-red-500/20 shadow-lg shadow-red-900/5":"bg-gray-800/30 border-gray-700/30 hover:bg-gray-800/50 hover:border-gray-600"}`,children:[o.jsxs("div",{className:"flex justify-between items-start mb-2",children:[o.jsxs("div",{className:"font-semibold text-gray-200 flex items-center gap-2",children:[O.action,O.flag&&o.jsx("span",{className:"px-1.5 py-0.5 rounded bg-red-500 text-white text-[10px] uppercase font-bold",children:"Risk"})]}),o.jsxs("div",{className:"text-xs text-gray-500 font-mono flex items-center gap-1",children:[o.jsx(Ga,{className:"w-3 h-3"})," ",O.time]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[o.jsxs("div",{className:"flex items-center gap-2 text-gray-400",children:[o.jsx(Dd,{className:"w-3.5 h-3.5 text-gray-500"}),O.location]}),o.jsxs("div",{className:"flex items-center gap-2 text-gray-400",children:[o.jsx(Ba,{className:"w-3.5 h-3.5 text-gray-500"}),O.ip]})]})]})]},N))})]})]})}),o.jsxs("div",{className:"bg-gray-900/80 border-t border-gray-800 p-3 text-xs text-gray-500 flex justify-between items-center",children:[o.jsx("span",{children:"IdentityGuard v2.4 (LDAP Connected)"}),o.jsxs("span",{children:["ID: ",t.id," • ",new Date().toISOString()]})]})]})},Kd=({data:e,alert:t})=>{const[r,n]=it.useState(!1);let s={};try{s=typeof(t==null?void 0:t.raw_log)=="string"?JSON.parse(t.raw_log):(t==null?void 0:t.raw_log)||{}}catch(w){console.error("Failed to parse raw_log for Intel",w)}const a=s.risk_score||s.score||s.threat_score||(e==null?void 0:e.risk_score)||0,h={riskScore:a,verdict:a>70?"MALICIOUS":a>40?"SUSPICIOUS":"BENIGN",confidence:s.confidence||(e==null?void 0:e.confidence)||"High",iocType:s.ioc_type||s.type||s.indicator_type||(e==null?void 0:e.ioc_type)||"Unknown",iocValue:s.indicator||s.ioc||s.value||s.ioc_value||(e==null?void 0:e.value)||"N/A",threatActors:s.threat_actors||s.related_threats||(e==null?void 0:e.related_threats)||[],context:s.context||s.description||s.intel_context||(e==null?void 0:e.context)||"No intelligence context available for this artifact."},d=(w=>w>=90?"text-red-500 bg-red-500":w>=70?"text-orange-500 bg-orange-500":w>=40?"text-yellow-500 bg-yellow-500":"text-green-500 bg-green-500")(h.riskScore),g=d.split(" ")[0],m=d.split(" ")[1];return o.jsxs("div",{className:"bg-[#0e0f11] rounded-2xl border border-gray-800 shadow-xl overflow-hidden flex flex-col h-full w-full font-sans",children:[o.jsxs("div",{className:"bg-gray-900/50 border-b border-gray-800 p-4 flex justify-between items-center backdrop-blur-sm",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-2 bg-emerald-500/10 rounded-lg border border-emerald-500/20",children:o.jsx(Ba,{className:"w-5 h-5 text-emerald-400"})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-gray-100 font-semibold tracking-wide",children:"INFOSECLABS INTEL"}),o.jsx("div",{className:"flex items-center gap-2 text-xs",children:o.jsxs("span",{className:"flex items-center gap-1.5 text-emerald-400",children:[o.jsxs("span",{className:"relative flex h-2 w-2",children:[o.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),o.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-emerald-500"})]}),"LIVE FEED CONNECTED"]})})]})]}),o.jsxs("div",{className:"flex items-center gap-2 bg-black/40 p-1 rounded-lg border border-gray-800",children:[o.jsxs("button",{onClick:()=>n(!1),className:`px-3 py-1.5 rounded-md text-xs font-medium transition-all flex items-center gap-2 ${r?"text-gray-400 hover:text-gray-200 hover:bg-gray-800":"bg-emerald-600 text-white shadow-lg shadow-emerald-900/20"}`,children:[o.jsx(_d,{className:"w-3.5 h-3.5"}),"ANALYSIS"]}),o.jsxs("button",{onClick:()=>n(!0),className:`px-3 py-1.5 rounded-md text-xs font-medium transition-all flex items-center gap-2 ${r?"bg-purple-600 text-white shadow-lg shadow-purple-900/20":"text-gray-400 hover:text-gray-200 hover:bg-gray-800"}`,children:[o.jsx(is,{className:"w-3.5 h-3.5"}),"SOURCE DATA"]})]})]}),o.jsx("div",{className:"flex-1 overflow-hidden relative",children:r?o.jsx("div",{className:"h-full p-6 overflow-hidden flex flex-col",children:o.jsxs("div",{className:"flex-1 bg-black rounded-xl border border-gray-800 p-4 font-mono text-xs text-green-400 overflow-auto shadow-inner",children:[o.jsxs("div",{className:"flex justify-between items-center border-b border-gray-800 pb-2 mb-4",children:[o.jsx("span",{className:"text-gray-500 uppercase tracking-wider",children:"RAW LOG TELEMETRY"}),o.jsx("span",{className:"text-gray-600",children:"JSON-FORMATTED EVENT LOG"})]}),o.jsx("pre",{className:"whitespace-pre-wrap",children:JSON.stringify(s,null,2)}),o.jsxs("pre",{className:"whitespace-pre-wrap mt-4 text-gray-500",children:["// Simulation Metadata",JSON.stringify(e,null,2)]})]})}):o.jsxs("div",{className:"h-full flex flex-col p-6 gap-6 overflow-y-auto",children:[o.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[o.jsxs("div",{className:"w-full md:w-1/3 bg-gray-900/30 rounded-xl border border-gray-800 p-6 flex flex-col items-center justify-center relative overflow-hidden",children:[o.jsx("div",{className:`absolute top-0 left-0 w-full h-1 ${m} opacity-50`}),o.jsxs("div",{className:"relative w-32 h-32 flex items-center justify-center mb-4",children:[o.jsxs("svg",{className:"w-full h-full transform -rotate-90",children:[o.jsx("circle",{cx:"64",cy:"64",r:"56",stroke:"currentColor",strokeWidth:"8",fill:"transparent",className:"text-gray-800"}),o.jsx("circle",{cx:"64",cy:"64",r:"56",stroke:"currentColor",strokeWidth:"8",fill:"transparent",className:`${g} drop-shadow-[0_0_10px_rgba(239,68,68,0.5)]`,strokeDasharray:351,strokeDashoffset:351-351*h.riskScore/100,strokeLinecap:"round"})]}),o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[o.jsx("span",{className:`text-4xl font-bold ${g}`,children:h.riskScore}),o.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-widest font-semibold",children:"RISK"})]})]}),o.jsx("div",{className:`px-4 py-1 rounded-full text-xs font-bold uppercase tracking-wider ${m.replace("bg-","bg-opacity-10 ")} ${g} border border-current`,children:h.verdict})]}),o.jsxs("div",{className:"flex-1 bg-gray-900/30 rounded-xl border border-gray-800 p-6 flex flex-col justify-between",children:[o.jsxs("div",{children:[o.jsxs("h3",{className:"text-gray-400 text-xs font-bold uppercase tracking-wider mb-4 flex items-center gap-2",children:[o.jsx(yd,{className:"w-4 h-4 text-emerald-400"})," Indicator Analysis"]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[o.jsxs("div",{className:"bg-black/40 p-3 rounded-lg border border-gray-800",children:[o.jsx("div",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"Indicator Type"}),o.jsxs("div",{className:"text-gray-200 font-mono text-sm flex items-center gap-2",children:[h.iocType==="Hash"?o.jsx(dd,{className:"w-3.5 h-3.5 text-blue-400"}):o.jsx(Ba,{className:"w-3.5 h-3.5 text-blue-400"}),h.iocType]})]}),o.jsxs("div",{className:"bg-black/40 p-3 rounded-lg border border-gray-800",children:[o.jsx("div",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"Observation Confidence"}),o.jsxs("div",{className:"text-gray-200 font-mono text-sm flex items-center gap-2",children:[o.jsx(hl,{className:"w-3.5 h-3.5 text-orange-400"}),h.confidence]})]}),o.jsxs("div",{className:"bg-black/40 p-3 rounded-lg border border-gray-800 col-span-1 md:col-span-2",children:[o.jsx("div",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"IOC Value"}),o.jsxs("div",{className:"text-gray-200 font-mono text-sm truncate select-all cursor-text flex items-center gap-2",children:[o.jsx(li,{className:"w-3.5 h-3.5 text-gray-500"}),h.iocValue]})]})]})]}),o.jsxs("div",{className:"text-sm text-gray-400 italic border-l-2 border-emerald-500/30 pl-4 py-1",children:['"',h.context,'"']})]})]}),o.jsxs("div",{className:"flex-1 bg-gray-900/30 rounded-xl border border-gray-800 p-6",children:[o.jsxs("h3",{className:"text-gray-400 text-xs font-bold uppercase tracking-wider mb-4 flex items-center gap-2",children:[o.jsx(jd,{className:"w-4 h-4 text-red-500"})," Threat Attribution"]}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:h.threatActors.length>0?h.threatActors.map((w,S)=>o.jsxs("div",{className:"group cursor-pointer bg-gradient-to-br from-red-900/10 to-transparent p-4 rounded-xl border border-red-900/20 hover:border-red-500/50 transition-all",children:[o.jsxs("div",{className:"flex justify-between items-start mb-2",children:[o.jsx("h4",{className:"text-red-400 font-bold group-hover:text-red-300 transition-colors",children:w}),o.jsx(Ad,{className:"w-3 h-3 text-red-500/50"})]}),o.jsx("div",{className:"text-xs text-gray-500 mb-3",children:"Advanced Persistent Threat"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] bg-red-500/10 text-red-400 border border-red-500/20",children:"Espionage"}),o.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] bg-red-500/10 text-red-400 border border-red-500/20",children:"State-Sponsored"})]})]},S)):o.jsx("div",{className:"col-span-3 text-center py-8 text-gray-500 italic",children:"No specific threat actor attribution links found."})})]})]})}),o.jsxs("div",{className:"bg-gray-900/80 border-t border-gray-800 p-3 text-xs text-gray-500 flex justify-between items-center",children:[o.jsx("span",{children:"ThreatFocus CTI v9.0.2"}),o.jsxs("span",{children:["ID: ",t.id," • ",new Date().toISOString()]})]})]})},oc=({data:e,alert:t})=>{const r=(e==null?void 0:e.raw)||(t==null?void 0:t.raw_log)||(t==null?void 0:t.details)||"No evidence data available.",n=typeof r=="object"?JSON.stringify(r,null,2):String(r),[s,a]=od.useState(!1),h=()=>{navigator.clipboard.writeText(n),a(!0),setTimeout(()=>a(!1),2e3)},c=n.split(`
`).length;return o.jsxs("div",{className:"bg-[#1e1e1e] h-full flex flex-col font-mono text-sm relative overflow-hidden",children:[o.jsxs("div",{className:"bg-[#252526] p-2 flex justify-between items-center border-b border-[#000] shadow-sm select-none",children:[o.jsxs("div",{className:"flex items-center gap-2 px-2 text-gray-400",children:[o.jsx(li,{className:"w-4 h-4 text-blue-400"}),o.jsx("span",{className:"text-xs font-medium italic",children:"evidence_dump.txt"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("div",{className:"text-[10px] text-gray-500 mr-2",children:[c," lines"]}),o.jsx("button",{onClick:h,className:"p-1.5 hover:bg-[#3e3e42] rounded text-gray-400 transition-colors",title:"Copy to clipboard",children:s?o.jsx(vu,{className:"w-3.5 h-3.5 text-green-400"}):o.jsx(Au,{className:"w-3.5 h-3.5"})})]})]}),o.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[o.jsxs("div",{className:"bg-[#1e1e1e] text-[#858585] text-right pr-3 pl-2 py-4 select-none border-r border-[#3e3e42]/50 text-xs leading-6 min-w-[3rem]",children:[Array.from({length:Math.min(c,100)}).map((d,g)=>o.jsx("div",{children:g+1},g)),c>100&&o.jsx("div",{children:"..."})]}),o.jsx("div",{className:"flex-1 overflow-auto custom-scrollbar bg-[#1e1e1e]",children:o.jsx("pre",{className:"text-[#d4d4d4] text-xs leading-6 p-4 font-mono whitespace-pre-wrap outline-none selection:bg-[#264f78]",children:n})})]}),o.jsxs("div",{className:"bg-[#007acc] text-white px-3 py-0.5 text-[10px] flex justify-between items-center select-none",children:[o.jsxs("div",{className:"flex gap-4",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(wd,{className:"w-3 h-3"})," Plain Text"]}),o.jsx("span",{children:"UTF-8"})]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Su,{className:"w-3 h-3"}),"Log Viewer"]})]})]})},Xd=({alert:e})=>{const[t,r]=it.useState(null),[n,s]=it.useState(!0);if(it.useEffect(()=>{if(e!=null&&e.simulation_data){const a=typeof e.simulation_data=="string"?JSON.parse(e.simulation_data):e.simulation_data;r(a)}else r(Zd(e));s(!1)},[e]),n)return o.jsx("div",{className:"p-10 text-center text-gray-500 animate-pulse",children:"Booting Security Interface..."});if(!t)return o.jsx("div",{className:"p-4 bg-red-900/20 border border-red-500/50 rounded text-red-400",children:"Error loading simulation environment."});switch(t.tool){case"SIEM":return o.jsx(Hd,{data:t,alert:e});case"EDR":return o.jsx(Wd,{data:t,alert:e});case"Firewall":return o.jsx(Gd,{data:t,alert:e});case"Mail":return o.jsx(Jd,{data:t,alert:e});case"Identity":return o.jsx(Yd,{data:t,alert:e});case"Intel":return o.jsx(Kd,{data:t,alert:e});case"Generic":return o.jsx(oc,{data:t,alert:e});default:return o.jsx(oc,{data:t,alert:e})}},Zd=e=>({tool:"Generic",raw:e.raw_log||e.details||"No raw executable evidence found."});var nn=Uint8Array,Mr=Uint16Array,fl=Int32Array,pl=new nn([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]),gl=new nn([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]),lc=new nn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Pu=function(e,t){for(var r=new Mr(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var s=new fl(r[30]),n=1;n<30;++n)for(var a=r[n];a<r[n+1];++a)s[a]=a-r[n]<<5|n;return{b:r,r:s}},Iu=Pu(pl,2),Qd=Iu.b,Zo=Iu.r;Qd[28]=258,Zo[258]=28;var ef=Pu(gl,0),cc=ef.r,Qo=new Mr(32768);for(var Rt=0;Rt<32768;++Rt){var si=(Rt&43690)>>1|(Rt&21845)<<1;si=(si&52428)>>2|(si&13107)<<2,si=(si&61680)>>4|(si&3855)<<4,Qo[Rt]=((si&65280)>>8|(si&255)<<8)>>1}var Ms=function(e,t,r){for(var n=e.length,s=0,a=new Mr(t);s<n;++s)e[s]&&++a[e[s]-1];var h=new Mr(t);for(s=1;s<t;++s)h[s]=h[s-1]+a[s-1]<<1;var c;if(r){c=new Mr(1<<t);var d=15-t;for(s=0;s<n;++s)if(e[s])for(var g=s<<4|e[s],m=t-e[s],w=h[e[s]-1]++<<m,S=w|(1<<m)-1;w<=S;++w)c[Qo[w]>>d]=g}else for(c=new Mr(n),s=0;s<n;++s)e[s]&&(c[s]=Qo[h[e[s]-1]++]>>15-e[s]);return c},Ii=new nn(288);for(var Rt=0;Rt<144;++Rt)Ii[Rt]=8;for(var Rt=144;Rt<256;++Rt)Ii[Rt]=9;for(var Rt=256;Rt<280;++Rt)Ii[Rt]=7;for(var Rt=280;Rt<288;++Rt)Ii[Rt]=8;var qa=new nn(32);for(var Rt=0;Rt<32;++Rt)qa[Rt]=5;var tf=Ms(Ii,9,0),rf=Ms(qa,5,0),Fu=function(e){return(e+7)/8|0},nf=function(e,t,r){return(r==null||r>e.length)&&(r=e.length),new nn(e.subarray(t,r))},qn=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},Os=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},Po=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var s=r.length,a=r.slice();if(!s)return{t:Ou,l:0};if(s==1){var h=new nn(r[0].s+1);return h[r[0].s]=1,{t:h,l:1}}r.sort(function(Q,he){return Q.f-he.f}),r.push({s:-1,f:25001});var c=r[0],d=r[1],g=0,m=1,w=2;for(r[0]={s:-1,f:c.f+d.f,l:c,r:d};m!=s-1;)c=r[r[g].f<r[w].f?g++:w++],d=r[g!=m&&r[g].f<r[w].f?g++:w++],r[m++]={s:-1,f:c.f+d.f,l:c,r:d};for(var S=a[0].s,n=1;n<s;++n)a[n].s>S&&(S=a[n].s);var p=new Mr(S+1),O=el(r[m-1],p,0);if(O>t){var n=0,N=0,T=O-t,L=1<<T;for(a.sort(function(he,pe){return p[pe.s]-p[he.s]||he.f-pe.f});n<s;++n){var K=a[n].s;if(p[K]>t)N+=L-(1<<O-p[K]),p[K]=t;else break}for(N>>=T;N>0;){var X=a[n].s;p[X]<t?N-=1<<t-p[X]++-1:++n}for(;n>=0&&N;--n){var H=a[n].s;p[H]==t&&(--p[H],++N)}O=t}return{t:new nn(p),l:O}},el=function(e,t,r){return e.s==-1?Math.max(el(e.l,t,r+1),el(e.r,t,r+1)):t[e.s]=r},uc=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Mr(++t),n=0,s=e[0],a=1,h=function(d){r[n++]=d},c=1;c<=t;++c)if(e[c]==s&&c!=t)++a;else{if(!s&&a>2){for(;a>138;a-=138)h(32754);a>2&&(h(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(h(s),--a;a>6;a-=6)h(8304);a>2&&(h(a-3<<5|8208),a=0)}for(;a--;)h(s);a=1,s=e[c]}return{c:r.subarray(0,n),n:t}},Ts=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},Eu=function(e,t,r){var n=r.length,s=Fu(t+2);e[s]=n&255,e[s+1]=n>>8,e[s+2]=e[s]^255,e[s+3]=e[s+1]^255;for(var a=0;a<n;++a)e[s+a+4]=r[a];return(s+4+n)*8},hc=function(e,t,r,n,s,a,h,c,d,g,m){qn(t,m++,r),++s[256];for(var w=Po(s,15),S=w.t,p=w.l,O=Po(a,15),N=O.t,T=O.l,L=uc(S),K=L.c,X=L.n,H=uc(N),Q=H.c,he=H.n,pe=new Mr(19),C=0;C<K.length;++C)++pe[K[C]&31];for(var C=0;C<Q.length;++C)++pe[Q[C]&31];for(var R=Po(pe,7),ne=R.t,j=R.l,P=19;P>4&&!ne[lc[P-1]];--P);var G=g+5<<3,$=Ts(s,Ii)+Ts(a,qa)+h,ue=Ts(s,S)+Ts(a,N)+h+14+3*P+Ts(pe,ne)+2*pe[16]+3*pe[17]+7*pe[18];if(d>=0&&G<=$&&G<=ue)return Eu(t,m,e.subarray(d,d+g));var fe,me,se,ge;if(qn(t,m,1+(ue<$)),m+=2,ue<$){fe=Ms(S,p,0),me=S,se=Ms(N,T,0),ge=N;var W=Ms(ne,j,0);qn(t,m,X-257),qn(t,m+5,he-1),qn(t,m+10,P-4),m+=14;for(var C=0;C<P;++C)qn(t,m+3*C,ne[lc[C]]);m+=3*P;for(var M=[K,Q],b=0;b<2;++b)for(var I=M[b],C=0;C<I.length;++C){var D=I[C]&31;qn(t,m,W[D]),m+=ne[D],D>15&&(qn(t,m,I[C]>>5&127),m+=I[C]>>12)}}else fe=tf,me=Ii,se=rf,ge=qa;for(var C=0;C<c;++C){var z=n[C];if(z>255){var D=z>>18&31;Os(t,m,fe[D+257]),m+=me[D+257],D>7&&(qn(t,m,z>>23&31),m+=pl[D]);var V=z&31;Os(t,m,se[V]),m+=ge[V],V>3&&(Os(t,m,z>>5&8191),m+=gl[V])}else Os(t,m,fe[z]),m+=me[z]}return Os(t,m,fe[256]),m+me[256]},sf=new fl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ou=new nn(0),af=function(e,t,r,n,s,a){var h=a.z||e.length,c=new nn(n+h+5*(1+Math.ceil(h/7e3))+s),d=c.subarray(n,c.length-s),g=a.l,m=(a.r||0)&7;if(t){m&&(d[0]=a.r>>3);for(var w=sf[t-1],S=w>>13,p=w&8191,O=(1<<r)-1,N=a.p||new Mr(32768),T=a.h||new Mr(O+1),L=Math.ceil(r/3),K=2*L,X=function(ke){return(e[ke]^e[ke+1]<<L^e[ke+2]<<K)&O},H=new fl(25e3),Q=new Mr(288),he=new Mr(32),pe=0,C=0,R=a.i||0,ne=0,j=a.w||0,P=0;R+2<h;++R){var G=X(R),$=R&32767,ue=T[G];if(N[$]=ue,T[G]=$,j<=R){var fe=h-R;if((pe>7e3||ne>24576)&&(fe>423||!g)){m=hc(e,d,0,H,Q,he,C,ne,P,R-P,m),ne=pe=C=0,P=R;for(var me=0;me<286;++me)Q[me]=0;for(var me=0;me<30;++me)he[me]=0}var se=2,ge=0,W=p,M=$-ue&32767;if(fe>2&&G==X(R-M))for(var b=Math.min(S,fe)-1,I=Math.min(32767,R),D=Math.min(258,fe);M<=I&&--W&&$!=ue;){if(e[R+se]==e[R+se-M]){for(var z=0;z<D&&e[R+z]==e[R+z-M];++z);if(z>se){if(se=z,ge=M,z>b)break;for(var V=Math.min(M,z-2),Y=0,me=0;me<V;++me){var re=R-M+me&32767,oe=N[re],de=re-oe&32767;de>Y&&(Y=de,ue=re)}}}$=ue,ue=N[$],M+=$-ue&32767}if(ge){H[ne++]=268435456|Zo[se]<<18|cc[ge];var ye=Zo[se]&31,je=cc[ge]&31;C+=pl[ye]+gl[je],++Q[257+ye],++he[je],j=R+se,++pe}else H[ne++]=e[R],++Q[e[R]]}}for(R=Math.max(R,j);R<h;++R)H[ne++]=e[R],++Q[e[R]];m=hc(e,d,g,H,Q,he,C,ne,P,R-P,m),g||(a.r=m&7|d[m/8|0]<<3,m-=7,a.h=T,a.p=N,a.i=R,a.w=j)}else{for(var R=a.w||0;R<h+g;R+=65535){var Ce=R+65535;Ce>=h&&(d[m/8|0]=g,Ce=h),m=Eu(d,m+1,e.subarray(R,Ce))}a.i=h}return nf(c,0,n+Fu(m)+s)},Tu=function(){var e=1,t=0;return{p:function(r){for(var n=e,s=t,a=r.length|0,h=0;h!=a;){for(var c=Math.min(h+2655,a);h<c;++h)s+=n+=r[h];n=(n&65535)+15*(n>>16),s=(s&65535)+15*(s>>16)}e=n,t=s},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},of=function(e,t,r,n,s){if(!s&&(s={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),h=new nn(a.length+e.length);h.set(a),h.set(e,a.length),e=h,s.w=a.length}return af(e,t.level==null?6:t.level,t.mem==null?s.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,s)},Mu=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},lf=function(e,t){var r=t.level,n=r==0?0:r<6?1:r==9?3:2;if(e[0]=120,e[1]=n<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var s=Tu();s.p(t.dictionary),Mu(e,2,s.d())}};function tl(e,t){t||(t={});var r=Tu();r.p(e);var n=of(e,t,t.dictionary?6:2,4);return lf(n,t),Mu(n,n.length-4,r.d()),n}var cf=typeof TextDecoder<"u"&&new TextDecoder,uf=0;try{cf.decode(Ou,{stream:!0}),uf=1}catch{}function dc(e,t="utf8"){return new TextDecoder(t).decode(e)}const hf=new TextEncoder;function df(e){return hf.encode(e)}const ff=1024*8,pf=(()=>{const e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),Io={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class ml{constructor(t=ff,r={}){Lt(this,"buffer");Lt(this,"byteLength");Lt(this,"byteOffset");Lt(this,"length");Lt(this,"offset");Lt(this,"lastWrittenByte");Lt(this,"littleEndian");Lt(this,"_data");Lt(this,"_mark");Lt(this,"_marks");let n=!1;typeof t=="number"?t=new ArrayBuffer(t):(n=!0,this.lastWrittenByte=t.byteLength);const s=r.offset?r.offset>>>0:0,a=t.byteLength-s;let h=s;(ArrayBuffer.isView(t)||t instanceof ml)&&(t.byteLength!==t.buffer.byteLength&&(h=t.byteOffset+s),t=t.buffer),n?this.lastWrittenByte=a:this.lastWrittenByte=0,this.buffer=t,this.length=a,this.byteLength=a,this.byteOffset=h,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,h,a),this._mark=0,this._marks=[]}available(t=1){return this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t=1){return this.offset+=t,this}back(t=1){return this.offset-=t,this}seek(t){return this.offset=t,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const t=this._marks.pop();if(t===void 0)throw new Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t=1){if(!this.available(t)){const n=(this.offset+t)*2,s=new Uint8Array(n);s.set(new Uint8Array(this.buffer)),this.buffer=s.buffer,this.length=n,this.byteLength=n,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(t=1){return this.readArray(t,"uint8")}readArray(t,r){const n=Io[r].BYTES_PER_ELEMENT*t,s=this.byteOffset+this.offset,a=this.buffer.slice(s,s+n);if(this.littleEndian===pf&&r!=="uint8"&&r!=="int8"){const c=new Uint8Array(this.buffer.slice(s,s+n));c.reverse();const d=new Io[r](c.buffer);return this.offset+=n,d.reverse(),d}const h=new Io[r](a);return this.offset+=n,h}readInt16(){const t=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}readUint16(){const t=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,t}readInt32(){const t=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}readUint32(){const t=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat32(){const t=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat64(){const t=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}readBigInt64(){const t=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,t}readBigUint64(){const t=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,t}readChar(){return String.fromCharCode(this.readInt8())}readChars(t=1){let r="";for(let n=0;n<t;n++)r+=this.readChar();return r}readUtf8(t=1){return dc(this.readBytes(t))}decodeText(t=1,r="utf8"){return dc(this.readBytes(t),r)}writeBoolean(t){return this.writeUint8(t?255:0),this}writeInt8(t){return this.ensureAvailable(1),this._data.setInt8(this.offset++,t),this._updateLastWrittenByte(),this}writeUint8(t){return this.ensureAvailable(1),this._data.setUint8(this.offset++,t),this._updateLastWrittenByte(),this}writeByte(t){return this.writeUint8(t)}writeBytes(t){this.ensureAvailable(t.length);for(let r=0;r<t.length;r++)this._data.setUint8(this.offset++,t[r]);return this._updateLastWrittenByte(),this}writeInt16(t){return this.ensureAvailable(2),this._data.setInt16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(t){return this.ensureAvailable(2),this._data.setUint16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(t){return this.ensureAvailable(4),this._data.setInt32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(t){return this.ensureAvailable(4),this._data.setUint32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(t){return this.ensureAvailable(4),this._data.setFloat32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(t){return this.ensureAvailable(8),this._data.setFloat64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(t){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(t){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(t){return this.writeUint8(t.charCodeAt(0))}writeChars(t){for(let r=0;r<t.length;r++)this.writeUint8(t.charCodeAt(r));return this}writeUtf8(t){return this.writeBytes(df(t))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function ss(e){let t=e.length;for(;--t>=0;)e[t]=0}const gf=3,mf=258,Ru=29,xf=256,bf=xf+1+Ru,Du=30,vf=512,yf=new Array((bf+2)*2);ss(yf);const wf=new Array(Du*2);ss(wf);const Nf=new Array(vf);ss(Nf);const _f=new Array(mf-gf+1);ss(_f);const jf=new Array(Ru);ss(jf);const Af=new Array(Du);ss(Af);const Sf=(e,t,r,n)=>{let s=e&65535|0,a=e>>>16&65535|0,h=0;for(;r!==0;){h=r>2e3?2e3:r,r-=h;do s=s+t[n++]|0,a=a+s|0;while(--h);s%=65521,a%=65521}return s|a<<16|0};var rl=Sf;const Lf=()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t},kf=new Uint32Array(Lf()),Cf=(e,t,r,n)=>{const s=kf,a=n+r;e^=-1;for(let h=n;h<a;h++)e=e>>>8^s[(e^t[h])&255];return e^-1};var mn=Cf,nl={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"},Bu={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const Pf=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var If=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(const n in r)Pf(r,n)&&(e[n]=r[n])}}return e},Ff=e=>{let t=0;for(let n=0,s=e.length;n<s;n++)t+=e[n].length;const r=new Uint8Array(t);for(let n=0,s=0,a=e.length;n<a;n++){let h=e[n];r.set(h,s),s+=h.length}return r},qu={assign:If,flattenChunks:Ff};let Uu=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Uu=!1}const Ds=new Uint8Array(256);for(let e=0;e<256;e++)Ds[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Ds[254]=Ds[254]=1;var Ef=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,r,n,s,a,h=e.length,c=0;for(s=0;s<h;s++)r=e.charCodeAt(s),(r&64512)===55296&&s+1<h&&(n=e.charCodeAt(s+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),s++)),c+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(c),a=0,s=0;a<c;s++)r=e.charCodeAt(s),(r&64512)===55296&&s+1<h&&(n=e.charCodeAt(s+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),s++)),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|r&63):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|r&63):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|r&63);return t};const Of=(e,t)=>{if(t<65534&&e.subarray&&Uu)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r};var Tf=(e,t)=>{const r=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let n,s;const a=new Array(r*2);for(s=0,n=0;n<r;){let h=e[n++];if(h<128){a[s++]=h;continue}let c=Ds[h];if(c>4){a[s++]=65533,n+=c-1;continue}for(h&=c===2?31:c===3?15:7;c>1&&n<r;)h=h<<6|e[n++]&63,c--;if(c>1){a[s++]=65533;continue}h<65536?a[s++]=h:(h-=65536,a[s++]=55296|h>>10&1023,a[s++]=56320|h&1023)}return Of(a,s)},Mf=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let r=t-1;for(;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+Ds[e[r]]>t?r:t},il={string2buf:Ef,buf2string:Tf,utf8border:Mf};function Rf(){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}var Df=Rf;const _a=16209,Bf=16191;var qf=function(t,r){let n,s,a,h,c,d,g,m,w,S,p,O,N,T,L,K,X,H,Q,he,pe,C,R,ne;const j=t.state;n=t.next_in,R=t.input,s=n+(t.avail_in-5),a=t.next_out,ne=t.output,h=a-(r-t.avail_out),c=a+(t.avail_out-257),d=j.dmax,g=j.wsize,m=j.whave,w=j.wnext,S=j.window,p=j.hold,O=j.bits,N=j.lencode,T=j.distcode,L=(1<<j.lenbits)-1,K=(1<<j.distbits)-1;e:do{O<15&&(p+=R[n++]<<O,O+=8,p+=R[n++]<<O,O+=8),X=N[p&L];t:for(;;){if(H=X>>>24,p>>>=H,O-=H,H=X>>>16&255,H===0)ne[a++]=X&65535;else if(H&16){Q=X&65535,H&=15,H&&(O<H&&(p+=R[n++]<<O,O+=8),Q+=p&(1<<H)-1,p>>>=H,O-=H),O<15&&(p+=R[n++]<<O,O+=8,p+=R[n++]<<O,O+=8),X=T[p&K];r:for(;;){if(H=X>>>24,p>>>=H,O-=H,H=X>>>16&255,H&16){if(he=X&65535,H&=15,O<H&&(p+=R[n++]<<O,O+=8,O<H&&(p+=R[n++]<<O,O+=8)),he+=p&(1<<H)-1,he>d){t.msg="invalid distance too far back",j.mode=_a;break e}if(p>>>=H,O-=H,H=a-h,he>H){if(H=he-H,H>m&&j.sane){t.msg="invalid distance too far back",j.mode=_a;break e}if(pe=0,C=S,w===0){if(pe+=g-H,H<Q){Q-=H;do ne[a++]=S[pe++];while(--H);pe=a-he,C=ne}}else if(w<H){if(pe+=g+w-H,H-=w,H<Q){Q-=H;do ne[a++]=S[pe++];while(--H);if(pe=0,w<Q){H=w,Q-=H;do ne[a++]=S[pe++];while(--H);pe=a-he,C=ne}}}else if(pe+=w-H,H<Q){Q-=H;do ne[a++]=S[pe++];while(--H);pe=a-he,C=ne}for(;Q>2;)ne[a++]=C[pe++],ne[a++]=C[pe++],ne[a++]=C[pe++],Q-=3;Q&&(ne[a++]=C[pe++],Q>1&&(ne[a++]=C[pe++]))}else{pe=a-he;do ne[a++]=ne[pe++],ne[a++]=ne[pe++],ne[a++]=ne[pe++],Q-=3;while(Q>2);Q&&(ne[a++]=ne[pe++],Q>1&&(ne[a++]=ne[pe++]))}}else if(H&64){t.msg="invalid distance code",j.mode=_a;break e}else{X=T[(X&65535)+(p&(1<<H)-1)];continue r}break}}else if(H&64)if(H&32){j.mode=Bf;break e}else{t.msg="invalid literal/length code",j.mode=_a;break e}else{X=N[(X&65535)+(p&(1<<H)-1)];continue t}break}}while(n<s&&a<c);Q=O>>3,n-=Q,O-=Q<<3,p&=(1<<O)-1,t.next_in=n,t.next_out=a,t.avail_in=n<s?5+(s-n):5-(n-s),t.avail_out=a<c?257+(c-a):257-(a-c),j.hold=p,j.bits=O};const Ji=15,fc=852,pc=592,gc=0,Fo=1,mc=2,Uf=new Uint16Array([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,0,0]),zf=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Hf=new Uint16Array([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,0,0]),Wf=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Vf=(e,t,r,n,s,a,h,c)=>{const d=c.bits;let g=0,m=0,w=0,S=0,p=0,O=0,N=0,T=0,L=0,K=0,X,H,Q,he,pe,C=null,R;const ne=new Uint16Array(Ji+1),j=new Uint16Array(Ji+1);let P=null,G,$,ue;for(g=0;g<=Ji;g++)ne[g]=0;for(m=0;m<n;m++)ne[t[r+m]]++;for(p=d,S=Ji;S>=1&&ne[S]===0;S--);if(p>S&&(p=S),S===0)return s[a++]=1<<24|64<<16|0,s[a++]=1<<24|64<<16|0,c.bits=1,0;for(w=1;w<S&&ne[w]===0;w++);for(p<w&&(p=w),T=1,g=1;g<=Ji;g++)if(T<<=1,T-=ne[g],T<0)return-1;if(T>0&&(e===gc||S!==1))return-1;for(j[1]=0,g=1;g<Ji;g++)j[g+1]=j[g]+ne[g];for(m=0;m<n;m++)t[r+m]!==0&&(h[j[t[r+m]]++]=m);if(e===gc?(C=P=h,R=20):e===Fo?(C=Uf,P=zf,R=257):(C=Hf,P=Wf,R=0),K=0,m=0,g=w,pe=a,O=p,N=0,Q=-1,L=1<<p,he=L-1,e===Fo&&L>fc||e===mc&&L>pc)return 1;for(;;){G=g-N,h[m]+1<R?($=0,ue=h[m]):h[m]>=R?($=P[h[m]-R],ue=C[h[m]-R]):($=96,ue=0),X=1<<g-N,H=1<<O,w=H;do H-=X,s[pe+(K>>N)+H]=G<<24|$<<16|ue|0;while(H!==0);for(X=1<<g-1;K&X;)X>>=1;if(X!==0?(K&=X-1,K+=X):K=0,m++,--ne[g]===0){if(g===S)break;g=t[r+h[m]]}if(g>p&&(K&he)!==Q){for(N===0&&(N=p),pe+=w,O=g-N,T=1<<O;O+N<S&&(T-=ne[O+N],!(T<=0));)O++,T<<=1;if(L+=1<<O,e===Fo&&L>fc||e===mc&&L>pc)return 1;Q=K&he,s[Q]=p<<24|O<<16|pe-a|0}}return K!==0&&(s[pe+K]=g-N<<24|64<<16|0),c.bits=p,0};var Rs=Vf;const $f=0,zu=1,Hu=2,{Z_FINISH:xc,Z_BLOCK:Gf,Z_TREES:ja,Z_OK:Fi,Z_STREAM_END:Jf,Z_NEED_DICT:Yf,Z_STREAM_ERROR:$r,Z_DATA_ERROR:Wu,Z_MEM_ERROR:Vu,Z_BUF_ERROR:Kf,Z_DEFLATED:bc}=Bu,Ja=16180,vc=16181,yc=16182,wc=16183,Nc=16184,_c=16185,jc=16186,Ac=16187,Sc=16188,Lc=16189,Ua=16190,Un=16191,Eo=16192,kc=16193,Oo=16194,Cc=16195,Pc=16196,Ic=16197,Fc=16198,Aa=16199,Sa=16200,Ec=16201,Oc=16202,Tc=16203,Mc=16204,Rc=16205,To=16206,Dc=16207,Bc=16208,Dt=16209,$u=16210,Gu=16211,Xf=852,Zf=592,Qf=15,e0=Qf,qc=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function t0(){this.strm=null,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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Ei=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<Ja||t.mode>Gu?1:0},Ju=e=>{if(Ei(e))return $r;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Ja,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(Xf),t.distcode=t.distdyn=new Int32Array(Zf),t.sane=1,t.back=-1,Fi},Yu=e=>{if(Ei(e))return $r;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Ju(e)},Ku=(e,t)=>{let r;if(Ei(e))return $r;const n=e.state;return t<0?(r=0,t=-t):(r=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?$r:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Yu(e))},Xu=(e,t)=>{if(!e)return $r;const r=new t0;e.state=r,r.strm=e,r.window=null,r.mode=Ja;const n=Ku(e,t);return n!==Fi&&(e.state=null),n},r0=e=>Xu(e,e0);let Uc=!0,Mo,Ro;const n0=e=>{if(Uc){Mo=new Int32Array(512),Ro=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Rs(zu,e.lens,0,288,Mo,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Rs(Hu,e.lens,0,32,Ro,0,e.work,{bits:5}),Uc=!1}e.lencode=Mo,e.lenbits=9,e.distcode=Ro,e.distbits=5},Zu=(e,t,r,n)=>{let s;const a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(t.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(s=a.wsize-a.wnext,s>n&&(s=n),a.window.set(t.subarray(r-n,r-n+s),a.wnext),n-=s,n?(a.window.set(t.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=s,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=s))),0},i0=(e,t)=>{let r,n,s,a,h,c,d,g,m,w,S,p,O,N,T=0,L,K,X,H,Q,he,pe,C;const R=new Uint8Array(4);let ne,j;const P=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ei(e)||!e.output||!e.input&&e.avail_in!==0)return $r;r=e.state,r.mode===Un&&(r.mode=Eo),h=e.next_out,s=e.output,d=e.avail_out,a=e.next_in,n=e.input,c=e.avail_in,g=r.hold,m=r.bits,w=c,S=d,C=Fi;e:for(;;)switch(r.mode){case Ja:if(r.wrap===0){r.mode=Eo;break}for(;m<16;){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}if(r.wrap&2&&g===35615){r.wbits===0&&(r.wbits=15),r.check=0,R[0]=g&255,R[1]=g>>>8&255,r.check=mn(r.check,R,2,0),g=0,m=0,r.mode=vc;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((g&255)<<8)+(g>>8))%31){e.msg="incorrect header check",r.mode=Dt;break}if((g&15)!==bc){e.msg="unknown compression method",r.mode=Dt;break}if(g>>>=4,m-=4,pe=(g&15)+8,r.wbits===0&&(r.wbits=pe),pe>15||pe>r.wbits){e.msg="invalid window size",r.mode=Dt;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=g&512?Lc:Un,g=0,m=0;break;case vc:for(;m<16;){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}if(r.flags=g,(r.flags&255)!==bc){e.msg="unknown compression method",r.mode=Dt;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=Dt;break}r.head&&(r.head.text=g>>8&1),r.flags&512&&r.wrap&4&&(R[0]=g&255,R[1]=g>>>8&255,r.check=mn(r.check,R,2,0)),g=0,m=0,r.mode=yc;case yc:for(;m<32;){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}r.head&&(r.head.time=g),r.flags&512&&r.wrap&4&&(R[0]=g&255,R[1]=g>>>8&255,R[2]=g>>>16&255,R[3]=g>>>24&255,r.check=mn(r.check,R,4,0)),g=0,m=0,r.mode=wc;case wc:for(;m<16;){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}r.head&&(r.head.xflags=g&255,r.head.os=g>>8),r.flags&512&&r.wrap&4&&(R[0]=g&255,R[1]=g>>>8&255,r.check=mn(r.check,R,2,0)),g=0,m=0,r.mode=Nc;case Nc:if(r.flags&1024){for(;m<16;){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}r.length=g,r.head&&(r.head.extra_len=g),r.flags&512&&r.wrap&4&&(R[0]=g&255,R[1]=g>>>8&255,r.check=mn(r.check,R,2,0)),g=0,m=0}else r.head&&(r.head.extra=null);r.mode=_c;case _c:if(r.flags&1024&&(p=r.length,p>c&&(p=c),p&&(r.head&&(pe=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+p),pe)),r.flags&512&&r.wrap&4&&(r.check=mn(r.check,n,p,a)),c-=p,a+=p,r.length-=p),r.length))break e;r.length=0,r.mode=jc;case jc:if(r.flags&2048){if(c===0)break e;p=0;do pe=n[a+p++],r.head&&pe&&r.length<65536&&(r.head.name+=String.fromCharCode(pe));while(pe&&p<c);if(r.flags&512&&r.wrap&4&&(r.check=mn(r.check,n,p,a)),c-=p,a+=p,pe)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Ac;case Ac:if(r.flags&4096){if(c===0)break e;p=0;do pe=n[a+p++],r.head&&pe&&r.length<65536&&(r.head.comment+=String.fromCharCode(pe));while(pe&&p<c);if(r.flags&512&&r.wrap&4&&(r.check=mn(r.check,n,p,a)),c-=p,a+=p,pe)break e}else r.head&&(r.head.comment=null);r.mode=Sc;case Sc:if(r.flags&512){for(;m<16;){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}if(r.wrap&4&&g!==(r.check&65535)){e.msg="header crc mismatch",r.mode=Dt;break}g=0,m=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Un;break;case Lc:for(;m<32;){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}e.adler=r.check=qc(g),g=0,m=0,r.mode=Ua;case Ua:if(r.havedict===0)return e.next_out=h,e.avail_out=d,e.next_in=a,e.avail_in=c,r.hold=g,r.bits=m,Yf;e.adler=r.check=1,r.mode=Un;case Un:if(t===Gf||t===ja)break e;case Eo:if(r.last){g>>>=m&7,m-=m&7,r.mode=To;break}for(;m<3;){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}switch(r.last=g&1,g>>>=1,m-=1,g&3){case 0:r.mode=kc;break;case 1:if(n0(r),r.mode=Aa,t===ja){g>>>=2,m-=2;break e}break;case 2:r.mode=Pc;break;case 3:e.msg="invalid block type",r.mode=Dt}g>>>=2,m-=2;break;case kc:for(g>>>=m&7,m-=m&7;m<32;){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}if((g&65535)!==(g>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Dt;break}if(r.length=g&65535,g=0,m=0,r.mode=Oo,t===ja)break e;case Oo:r.mode=Cc;case Cc:if(p=r.length,p){if(p>c&&(p=c),p>d&&(p=d),p===0)break e;s.set(n.subarray(a,a+p),h),c-=p,a+=p,d-=p,h+=p,r.length-=p;break}r.mode=Un;break;case Pc:for(;m<14;){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}if(r.nlen=(g&31)+257,g>>>=5,m-=5,r.ndist=(g&31)+1,g>>>=5,m-=5,r.ncode=(g&15)+4,g>>>=4,m-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Dt;break}r.have=0,r.mode=Ic;case Ic:for(;r.have<r.ncode;){for(;m<3;){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}r.lens[P[r.have++]]=g&7,g>>>=3,m-=3}for(;r.have<19;)r.lens[P[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,ne={bits:r.lenbits},C=Rs($f,r.lens,0,19,r.lencode,0,r.work,ne),r.lenbits=ne.bits,C){e.msg="invalid code lengths set",r.mode=Dt;break}r.have=0,r.mode=Fc;case Fc:for(;r.have<r.nlen+r.ndist;){for(;T=r.lencode[g&(1<<r.lenbits)-1],L=T>>>24,K=T>>>16&255,X=T&65535,!(L<=m);){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}if(X<16)g>>>=L,m-=L,r.lens[r.have++]=X;else{if(X===16){for(j=L+2;m<j;){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}if(g>>>=L,m-=L,r.have===0){e.msg="invalid bit length repeat",r.mode=Dt;break}pe=r.lens[r.have-1],p=3+(g&3),g>>>=2,m-=2}else if(X===17){for(j=L+3;m<j;){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}g>>>=L,m-=L,pe=0,p=3+(g&7),g>>>=3,m-=3}else{for(j=L+7;m<j;){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}g>>>=L,m-=L,pe=0,p=11+(g&127),g>>>=7,m-=7}if(r.have+p>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Dt;break}for(;p--;)r.lens[r.have++]=pe}}if(r.mode===Dt)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=Dt;break}if(r.lenbits=9,ne={bits:r.lenbits},C=Rs(zu,r.lens,0,r.nlen,r.lencode,0,r.work,ne),r.lenbits=ne.bits,C){e.msg="invalid literal/lengths set",r.mode=Dt;break}if(r.distbits=6,r.distcode=r.distdyn,ne={bits:r.distbits},C=Rs(Hu,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,ne),r.distbits=ne.bits,C){e.msg="invalid distances set",r.mode=Dt;break}if(r.mode=Aa,t===ja)break e;case Aa:r.mode=Sa;case Sa:if(c>=6&&d>=258){e.next_out=h,e.avail_out=d,e.next_in=a,e.avail_in=c,r.hold=g,r.bits=m,qf(e,S),h=e.next_out,s=e.output,d=e.avail_out,a=e.next_in,n=e.input,c=e.avail_in,g=r.hold,m=r.bits,r.mode===Un&&(r.back=-1);break}for(r.back=0;T=r.lencode[g&(1<<r.lenbits)-1],L=T>>>24,K=T>>>16&255,X=T&65535,!(L<=m);){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}if(K&&!(K&240)){for(H=L,Q=K,he=X;T=r.lencode[he+((g&(1<<H+Q)-1)>>H)],L=T>>>24,K=T>>>16&255,X=T&65535,!(H+L<=m);){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}g>>>=H,m-=H,r.back+=H}if(g>>>=L,m-=L,r.back+=L,r.length=X,K===0){r.mode=Rc;break}if(K&32){r.back=-1,r.mode=Un;break}if(K&64){e.msg="invalid literal/length code",r.mode=Dt;break}r.extra=K&15,r.mode=Ec;case Ec:if(r.extra){for(j=r.extra;m<j;){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}r.length+=g&(1<<r.extra)-1,g>>>=r.extra,m-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Oc;case Oc:for(;T=r.distcode[g&(1<<r.distbits)-1],L=T>>>24,K=T>>>16&255,X=T&65535,!(L<=m);){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}if(!(K&240)){for(H=L,Q=K,he=X;T=r.distcode[he+((g&(1<<H+Q)-1)>>H)],L=T>>>24,K=T>>>16&255,X=T&65535,!(H+L<=m);){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}g>>>=H,m-=H,r.back+=H}if(g>>>=L,m-=L,r.back+=L,K&64){e.msg="invalid distance code",r.mode=Dt;break}r.offset=X,r.extra=K&15,r.mode=Tc;case Tc:if(r.extra){for(j=r.extra;m<j;){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}r.offset+=g&(1<<r.extra)-1,g>>>=r.extra,m-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Dt;break}r.mode=Mc;case Mc:if(d===0)break e;if(p=S-d,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Dt;break}p>r.wnext?(p-=r.wnext,O=r.wsize-p):O=r.wnext-p,p>r.length&&(p=r.length),N=r.window}else N=s,O=h-r.offset,p=r.length;p>d&&(p=d),d-=p,r.length-=p;do s[h++]=N[O++];while(--p);r.length===0&&(r.mode=Sa);break;case Rc:if(d===0)break e;s[h++]=r.length,d--,r.mode=Sa;break;case To:if(r.wrap){for(;m<32;){if(c===0)break e;c--,g|=n[a++]<<m,m+=8}if(S-=d,e.total_out+=S,r.total+=S,r.wrap&4&&S&&(e.adler=r.check=r.flags?mn(r.check,s,S,h-S):rl(r.check,s,S,h-S)),S=d,r.wrap&4&&(r.flags?g:qc(g))!==r.check){e.msg="incorrect data check",r.mode=Dt;break}g=0,m=0}r.mode=Dc;case Dc:if(r.wrap&&r.flags){for(;m<32;){if(c===0)break e;c--,g+=n[a++]<<m,m+=8}if(r.wrap&4&&g!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=Dt;break}g=0,m=0}r.mode=Bc;case Bc:C=Jf;break e;case Dt:C=Wu;break e;case $u:return Vu;case Gu:default:return $r}return e.next_out=h,e.avail_out=d,e.next_in=a,e.avail_in=c,r.hold=g,r.bits=m,(r.wsize||S!==e.avail_out&&r.mode<Dt&&(r.mode<To||t!==xc))&&Zu(e,e.output,e.next_out,S-e.avail_out),w-=e.avail_in,S-=e.avail_out,e.total_in+=w,e.total_out+=S,r.total+=S,r.wrap&4&&S&&(e.adler=r.check=r.flags?mn(r.check,s,S,e.next_out-S):rl(r.check,s,S,e.next_out-S)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Un?128:0)+(r.mode===Aa||r.mode===Oo?256:0),(w===0&&S===0||t===xc)&&C===Fi&&(C=Kf),C},s0=e=>{if(Ei(e))return $r;let t=e.state;return t.window&&(t.window=null),e.state=null,Fi},a0=(e,t)=>{if(Ei(e))return $r;const r=e.state;return r.wrap&2?(r.head=t,t.done=!1,Fi):$r},o0=(e,t)=>{const r=t.length;let n,s,a;return Ei(e)||(n=e.state,n.wrap!==0&&n.mode!==Ua)?$r:n.mode===Ua&&(s=1,s=rl(s,t,r,0),s!==n.check)?Wu:(a=Zu(e,t,r,r),a?(n.mode=$u,Vu):(n.havedict=1,Fi))};var l0=Yu,c0=Ku,u0=Ju,h0=r0,d0=Xu,f0=i0,p0=s0,g0=a0,m0=o0,x0="pako inflate (from Nodeca project)",zn={inflateReset:l0,inflateReset2:c0,inflateResetKeep:u0,inflateInit:h0,inflateInit2:d0,inflate:f0,inflateEnd:p0,inflateGetHeader:g0,inflateSetDictionary:m0,inflateInfo:x0};function b0(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var v0=b0;const Qu=Object.prototype.toString,{Z_NO_FLUSH:y0,Z_FINISH:w0,Z_OK:Bs,Z_STREAM_END:Do,Z_NEED_DICT:Bo,Z_STREAM_ERROR:N0,Z_DATA_ERROR:zc,Z_MEM_ERROR:_0}=Bu;function qs(e){this.options=qu.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Df,this.strm.avail_out=0;let r=zn.inflateInit2(this.strm,t.windowBits);if(r!==Bs)throw new Error(nl[r]);if(this.header=new v0,zn.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=il.string2buf(t.dictionary):Qu.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=zn.inflateSetDictionary(this.strm,t.dictionary),r!==Bs)))throw new Error(nl[r])}qs.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,s=this.options.dictionary;let a,h,c;if(this.ended)return!1;for(t===~~t?h=t:h=t===!0?w0:y0,Qu.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),a=zn.inflate(r,h),a===Bo&&s&&(a=zn.inflateSetDictionary(r,s),a===Bs?a=zn.inflate(r,h):a===zc&&(a=Bo));r.avail_in>0&&a===Do&&r.state.wrap>0&&e[r.next_in]!==0;)zn.inflateReset(r),a=zn.inflate(r,h);switch(a){case N0:case zc:case Bo:case _0:return this.onEnd(a),this.ended=!0,!1}if(c=r.avail_out,r.next_out&&(r.avail_out===0||a===Do))if(this.options.to==="string"){let d=il.utf8border(r.output,r.next_out),g=r.next_out-d,m=il.buf2string(r.output,d);r.next_out=g,r.avail_out=n-g,g&&r.output.set(r.output.subarray(d,d+g),0),this.onData(m)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(a===Bs&&c===0)){if(a===Do)return a=zn.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};qs.prototype.onData=function(e){this.chunks.push(e)};qs.prototype.onEnd=function(e){e===Bs&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=qu.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function j0(e,t){const r=new qs(t);if(r.push(e),r.err)throw r.msg||nl[r.err];return r.result}var A0=qs,S0=j0,L0={Inflate:A0,inflate:S0};const{Inflate:k0,inflate:C0}=L0;var Hc=k0,P0=C0;const eh=[];for(let e=0;e<256;e++){let t=e;for(let r=0;r<8;r++)t&1?t=3988292384^t>>>1:t=t>>>1;eh[e]=t}const Wc=4294967295;function I0(e,t,r){let n=e;for(let s=0;s<r;s++)n=eh[(n^t[s])&255]^n>>>8;return n}function F0(e,t){return(I0(Wc,e,t)^Wc)>>>0}function Vc(e,t,r){const n=e.readUint32(),s=F0(new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),t);if(s!==n)throw new Error(`CRC mismatch for chunk ${r}. Expected ${n}, found ${s}`)}function th(e,t,r){for(let n=0;n<r;n++)t[n]=e[n]}function rh(e,t,r,n){let s=0;for(;s<n;s++)t[s]=e[s];for(;s<r;s++)t[s]=e[s]+t[s-n]&255}function nh(e,t,r,n){let s=0;if(r.length===0)for(;s<n;s++)t[s]=e[s];else for(;s<n;s++)t[s]=e[s]+r[s]&255}function ih(e,t,r,n,s){let a=0;if(r.length===0){for(;a<s;a++)t[a]=e[a];for(;a<n;a++)t[a]=e[a]+(t[a-s]>>1)&255}else{for(;a<s;a++)t[a]=e[a]+(r[a]>>1)&255;for(;a<n;a++)t[a]=e[a]+(t[a-s]+r[a]>>1)&255}}function sh(e,t,r,n,s){let a=0;if(r.length===0){for(;a<s;a++)t[a]=e[a];for(;a<n;a++)t[a]=e[a]+t[a-s]&255}else{for(;a<s;a++)t[a]=e[a]+r[a]&255;for(;a<n;a++)t[a]=e[a]+E0(t[a-s],r[a],r[a-s])&255}}function E0(e,t,r){const n=e+t-r,s=Math.abs(n-e),a=Math.abs(n-t),h=Math.abs(n-r);return s<=a&&s<=h?e:a<=h?t:r}function O0(e,t,r,n,s,a){switch(e){case 0:th(t,r,s);break;case 1:rh(t,r,s,a);break;case 2:nh(t,r,n,s);break;case 3:ih(t,r,n,s,a);break;case 4:sh(t,r,n,s,a);break;default:throw new Error(`Unsupported filter: ${e}`)}}const T0=new Uint16Array([255]),M0=new Uint8Array(T0.buffer),R0=M0[0]===255;function D0(e){const{data:t,width:r,height:n,channels:s,depth:a}=e,h=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],c=Math.ceil(a/8)*s,d=new Uint8Array(n*r*c);let g=0;for(let m=0;m<7;m++){const w=h[m],S=Math.ceil((r-w.x)/w.xStep),p=Math.ceil((n-w.y)/w.yStep);if(S<=0||p<=0)continue;const O=S*c,N=new Uint8Array(O);for(let T=0;T<p;T++){const L=t[g++],K=t.subarray(g,g+O);g+=O;const X=new Uint8Array(O);O0(L,K,X,N,O,c),N.set(X);for(let H=0;H<S;H++){const Q=w.x+H*w.xStep,he=w.y+T*w.yStep;if(!(Q>=r||he>=n))for(let pe=0;pe<c;pe++)d[(he*r+Q)*c+pe]=X[H*c+pe]}}}if(a===16){const m=new Uint16Array(d.buffer);if(R0)for(let w=0;w<m.length;w++)m[w]=B0(m[w]);return m}else return d}function B0(e){return(e&255)<<8|e>>8&255}const q0=new Uint16Array([255]),U0=new Uint8Array(q0.buffer),z0=U0[0]===255,H0=new Uint8Array(0);function $c(e){const{data:t,width:r,height:n,channels:s,depth:a}=e,h=Math.ceil(a/8)*s,c=Math.ceil(a/8*s*r),d=new Uint8Array(n*c);let g=H0,m=0,w,S;for(let p=0;p<n;p++){switch(w=t.subarray(m+1,m+1+c),S=d.subarray(p*c,(p+1)*c),t[m]){case 0:th(w,S,c);break;case 1:rh(w,S,c,h);break;case 2:nh(w,S,g,c);break;case 3:ih(w,S,g,c,h);break;case 4:sh(w,S,g,c,h);break;default:throw new Error(`Unsupported filter: ${t[m]}`)}g=S,m+=c+1}if(a===16){const p=new Uint16Array(d.buffer);if(z0)for(let O=0;O<p.length;O++)p[O]=W0(p[O]);return p}else return d}function W0(e){return(e&255)<<8|e>>8&255}const Ea=Uint8Array.of(137,80,78,71,13,10,26,10);function Gc(e){if(!V0(e.readBytes(Ea.length)))throw new Error("wrong PNG signature")}function V0(e){if(e.length<Ea.length)return!1;for(let t=0;t<Ea.length;t++)if(e[t]!==Ea[t])return!1;return!0}const $0="tEXt",G0=0,ah=new TextDecoder("latin1");function J0(e){if(K0(e),e.length===0||e.length>79)throw new Error("keyword length must be between 1 and 79")}const Y0=/^[\u0000-\u00FF]*$/;function K0(e){if(!Y0.test(e))throw new Error("invalid latin1 text")}function X0(e,t,r){const n=oh(t);e[n]=Z0(t,r-n.length-1)}function oh(e){for(e.mark();e.readByte()!==G0;);const t=e.offset;e.reset();const r=ah.decode(e.readBytes(t-e.offset-1));return e.skip(1),J0(r),r}function Z0(e,t){return ah.decode(e.readBytes(t))}const Tr={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},qo={UNKNOWN:-1,DEFLATE:0},Jc={UNKNOWN:-1,ADAPTIVE:0},Uo={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},La={NONE:0,BACKGROUND:1,PREVIOUS:2},zo={SOURCE:0,OVER:1};class Q0 extends ml{constructor(r,n={}){super(r);Lt(this,"_checkCrc");Lt(this,"_inflator");Lt(this,"_png");Lt(this,"_apng");Lt(this,"_end");Lt(this,"_hasPalette");Lt(this,"_palette");Lt(this,"_hasTransparency");Lt(this,"_transparency");Lt(this,"_compressionMethod");Lt(this,"_filterMethod");Lt(this,"_interlaceMethod");Lt(this,"_colorType");Lt(this,"_isAnimated");Lt(this,"_numberOfFrames");Lt(this,"_numberOfPlays");Lt(this,"_frames");Lt(this,"_writingDataChunks");const{checkCrc:s=!1}=n;this._checkCrc=s,this._inflator=new Hc,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=qo.UNKNOWN,this._filterMethod=Jc.UNKNOWN,this._interlaceMethod=Uo.UNKNOWN,this._colorType=Tr.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(Gc(this);!this._end;){const r=this.readUint32(),n=this.readChars(4);this.decodeChunk(r,n)}return this.decodeImage(),this._png}decodeApng(){for(Gc(this);!this._end;){const r=this.readUint32(),n=this.readChars(4);this.decodeApngChunk(r,n)}return this.decodeApngImage(),this._apng}decodeChunk(r,n){const s=this.offset;switch(n){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(r);break;case"IDAT":this.decodeIDAT(r);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(r);break;case"iCCP":this.decodeiCCP(r);break;case $0:X0(this._png.text,this,r);break;case"pHYs":this.decodepHYs();break;default:this.skip(r);break}if(this.offset-s!==r)throw new Error(`Length mismatch while decoding chunk ${n}`);this._checkCrc?Vc(this,r+4,n):this.skip(4)}decodeApngChunk(r,n){const s=this.offset;switch(n!=="fdAT"&&n!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),n){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(r);break;default:this.decodeChunk(r,n),this.offset=s+r;break}if(this.offset-s!==r)throw new Error(`Length mismatch while decoding chunk ${n}`);this._checkCrc?Vc(this,r+4,n):this.skip(4)}decodeIHDR(){const r=this._png;r.width=this.readUint32(),r.height=this.readUint32(),r.depth=e1(this.readUint8());const n=this.readUint8();this._colorType=n;let s;switch(n){case Tr.GREYSCALE:s=1;break;case Tr.TRUECOLOUR:s=3;break;case Tr.INDEXED_COLOUR:s=1;break;case Tr.GREYSCALE_ALPHA:s=2;break;case Tr.TRUECOLOUR_ALPHA:s=4;break;case Tr.UNKNOWN:default:throw new Error(`Unknown color type: ${n}`)}if(this._png.channels=s,this._compressionMethod=this.readUint8(),this._compressionMethod!==qo.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const r={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(r)}decodePLTE(r){if(r%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${r}`);const n=r/3;this._hasPalette=!0;const s=[];this._palette=s;for(let a=0;a<n;a++)s.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(r){this._writingDataChunks=!0;const n=r,s=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,s,n)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(r)}decodeFDAT(r){this._writingDataChunks=!0;let n=r,s=this.offset+this.byteOffset;if(s+=4,n-=4,this._inflator.push(new Uint8Array(this.buffer,s,n)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(r)}decodetRNS(r){switch(this._colorType){case Tr.GREYSCALE:case Tr.TRUECOLOUR:{if(r%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${r}`);if(r/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${r/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(r/2);for(let n=0;n<r/2;n++)this._transparency[n]=this.readUint16();break}case Tr.INDEXED_COLOUR:{if(r>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${r} vs ${this._palette.length})`);let n=0;for(;n<r;n++){const s=this.readByte();this._palette[n].push(s)}for(;n<this._palette.length;n++)this._palette[n].push(255);break}case Tr.UNKNOWN:case Tr.GREYSCALE_ALPHA:case Tr.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(r){const n=oh(this),s=this.readUint8();if(s!==qo.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${s}`);const a=this.readBytes(r-n.length-2);this._png.iccEmbeddedProfile={name:n,profile:P0(a)}}decodepHYs(){const r=this.readUint32(),n=this.readUint32(),s=this.readByte();this._png.resolution={x:r,y:n,unit:s}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let r=0;r<this._numberOfFrames;r++){const n={sequenceNumber:this._frames[r].sequenceNumber,delayNumber:this._frames[r].delayNumber,delayDenominator:this._frames[r].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},s=this._frames.at(r);if(s){if(s.data=$c({data:s.data,width:s.width,height:s.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),r===0||s.xOffset===0&&s.yOffset===0&&s.width===this._png.width&&s.height===this._png.height)n.data=s.data;else{const a=this._apng.frames.at(r-1);this.disposeFrame(s,a,n),this.addFrameDataToCanvas(n,s)}this._apng.frames.push(n)}}return this._apng}disposeFrame(r,n,s){switch(r.disposeOp){case La.NONE:break;case La.BACKGROUND:for(let a=0;a<this._png.height;a++)for(let h=0;h<this._png.width;h++){const c=(a*r.width+h)*this._png.channels;for(let d=0;d<this._png.channels;d++)s.data[c+d]=0}break;case La.PREVIOUS:s.data.set(n.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(r,n){const s=1<<this._png.depth,a=(h,c)=>{const d=((h+n.yOffset)*this._png.width+n.xOffset+c)*this._png.channels,g=(h*n.width+c)*this._png.channels;return{index:d,frameIndex:g}};switch(n.blendOp){case zo.SOURCE:for(let h=0;h<n.height;h++)for(let c=0;c<n.width;c++){const{index:d,frameIndex:g}=a(h,c);for(let m=0;m<this._png.channels;m++)r.data[d+m]=n.data[g+m]}break;case zo.OVER:for(let h=0;h<n.height;h++)for(let c=0;c<n.width;c++){const{index:d,frameIndex:g}=a(h,c);for(let m=0;m<this._png.channels;m++){const w=n.data[g+this._png.channels-1]/s,S=m%(this._png.channels-1)===0?1:n.data[g+m],p=Math.floor(w*S+(1-w)*r.data[d+m]);r.data[d+m]+=p}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){var n;if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const r=this._isAnimated?((n=this._frames)==null?void 0:n.at(0)).data:this._inflator.result;if(this._filterMethod!==Jc.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===Uo.NO_INTERLACE)this._png.data=$c({data:r,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===Uo.ADAM7)this._png.data=D0({data:r,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const r=this._inflator.result,n=this._frames.at(-1);n?n.data=r:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:La.NONE,blendOp:zo.SOURCE,data:r}),this._inflator=new Hc,this._writingDataChunks=!1}}function e1(e){if(e!==1&&e!==2&&e!==4&&e!==8&&e!==16)throw new Error(`invalid bit depth: ${e}`);return e}var Yc;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.METRE=1]="METRE"})(Yc||(Yc={}));function t1(e,t){return new Q0(e,t).decode()}var st=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function Ho(){st.console&&typeof st.console.log=="function"&&st.console.log.apply(st.console,arguments)}var It={log:Ho,warn:function(e){st.console&&(typeof st.console.warn=="function"?st.console.warn.apply(st.console,arguments):Ho.call(null,arguments))},error:function(e){st.console&&(typeof st.console.error=="function"?st.console.error.apply(st.console,arguments):Ho(e))}};function Wo(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){Li(n.response,t,r)},n.onerror=function(){It.error("could not download file")},n.send()}function Kc(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function ka(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var Li=st.saveAs||((typeof window>"u"?"undefined":Ft(window))!=="object"||window!==st?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(e,t,r){var n=st.URL||st.webkitURL,s=document.createElement("a");t=t||e.name||"download",s.download=t,s.rel="noopener",typeof e=="string"?(s.href=e,s.origin!==location.origin?Kc(s.href)?Wo(e,t,r):ka(s,s.target="_blank"):ka(s)):(s.href=n.createObjectURL(e),setTimeout(function(){n.revokeObjectURL(s.href)},4e4),setTimeout(function(){ka(s)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,r){if(t=t||e.name||"download",typeof e=="string")if(Kc(e))Wo(e,t,r);else{var n=document.createElement("a");n.href=e,n.target="_blank",setTimeout(function(){ka(n)})}else navigator.msSaveOrOpenBlob(function(s,a){return a===void 0?a={autoBom:!1}:Ft(a)!=="object"&&(It.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(s.type)?new Blob(["\uFEFF",s],{type:s.type}):s}(e,r),t)}:function(e,t,r,n){if((n=n||open("","_blank"))&&(n.document.title=n.document.body.innerText="downloading..."),typeof e=="string")return Wo(e,t,r);var s=e.type==="application/octet-stream",a=/constructor/i.test(st.HTMLElement)||st.safari,h=/CriOS\/[\d]+/.test(navigator.userAgent);if((h||s&&a)&&(typeof FileReader>"u"?"undefined":Ft(FileReader))==="object"){var c=new FileReader;c.onloadend=function(){var m=c.result;m=h?m:m.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=m:location=m,n=null},c.readAsDataURL(e)}else{var d=st.URL||st.webkitURL,g=d.createObjectURL(e);n?n.location=g:location.href=g,n=null,setTimeout(function(){d.revokeObjectURL(g)},4e4)}});/**
 * A class to parse color values
 * @author Stoyan Stefanov <sstoo@gmail.com>
 * {@link   http://www.phpied.com/rgb-color-parser-in-javascript/}
 * @license Use it if you like it
 */function lh(e){var t;e=e||"",this.ok=!1,e.charAt(0)=="#"&&(e=e.substr(1,6)),e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[e=(e=e.replace(/ /g,"")).toLowerCase()]||e;for(var r=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(c){return[parseInt(c[1]),parseInt(c[2]),parseInt(c[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(c){return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(c){return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)]}}],n=0;n<r.length;n++){var s=r[n].re,a=r[n].process,h=s.exec(e);h&&(t=a(h),this.r=t[0],this.g=t[1],this.b=t[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var c=this.r.toString(16),d=this.g.toString(16),g=this.b.toString(16);return c.length==1&&(c="0"+c),d.length==1&&(d="0"+d),g.length==1&&(g="0"+g),"#"+c+d+g}}var Oa=st.atob.bind(st),Xc=st.btoa.bind(st);/**
 * @license
 * Joseph Myers does not specify a particular license for his work.
 *
 * Author: Joseph Myers
 * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
 *
 * Modified by: Owen Leong
 */function Vo(e,t){var r=e[0],n=e[1],s=e[2],a=e[3];r=mr(r,n,s,a,t[0],7,-680876936),a=mr(a,r,n,s,t[1],12,-389564586),s=mr(s,a,r,n,t[2],17,606105819),n=mr(n,s,a,r,t[3],22,-1044525330),r=mr(r,n,s,a,t[4],7,-176418897),a=mr(a,r,n,s,t[5],12,1200080426),s=mr(s,a,r,n,t[6],17,-1473231341),n=mr(n,s,a,r,t[7],22,-45705983),r=mr(r,n,s,a,t[8],7,1770035416),a=mr(a,r,n,s,t[9],12,-1958414417),s=mr(s,a,r,n,t[10],17,-42063),n=mr(n,s,a,r,t[11],22,-1990404162),r=mr(r,n,s,a,t[12],7,1804603682),a=mr(a,r,n,s,t[13],12,-40341101),s=mr(s,a,r,n,t[14],17,-1502002290),r=xr(r,n=mr(n,s,a,r,t[15],22,1236535329),s,a,t[1],5,-165796510),a=xr(a,r,n,s,t[6],9,-1069501632),s=xr(s,a,r,n,t[11],14,643717713),n=xr(n,s,a,r,t[0],20,-373897302),r=xr(r,n,s,a,t[5],5,-701558691),a=xr(a,r,n,s,t[10],9,38016083),s=xr(s,a,r,n,t[15],14,-660478335),n=xr(n,s,a,r,t[4],20,-405537848),r=xr(r,n,s,a,t[9],5,568446438),a=xr(a,r,n,s,t[14],9,-1019803690),s=xr(s,a,r,n,t[3],14,-187363961),n=xr(n,s,a,r,t[8],20,1163531501),r=xr(r,n,s,a,t[13],5,-1444681467),a=xr(a,r,n,s,t[2],9,-51403784),s=xr(s,a,r,n,t[7],14,1735328473),r=br(r,n=xr(n,s,a,r,t[12],20,-1926607734),s,a,t[5],4,-378558),a=br(a,r,n,s,t[8],11,-2022574463),s=br(s,a,r,n,t[11],16,1839030562),n=br(n,s,a,r,t[14],23,-35309556),r=br(r,n,s,a,t[1],4,-1530992060),a=br(a,r,n,s,t[4],11,1272893353),s=br(s,a,r,n,t[7],16,-155497632),n=br(n,s,a,r,t[10],23,-1094730640),r=br(r,n,s,a,t[13],4,681279174),a=br(a,r,n,s,t[0],11,-358537222),s=br(s,a,r,n,t[3],16,-722521979),n=br(n,s,a,r,t[6],23,76029189),r=br(r,n,s,a,t[9],4,-640364487),a=br(a,r,n,s,t[12],11,-421815835),s=br(s,a,r,n,t[15],16,530742520),r=vr(r,n=br(n,s,a,r,t[2],23,-995338651),s,a,t[0],6,-198630844),a=vr(a,r,n,s,t[7],10,1126891415),s=vr(s,a,r,n,t[14],15,-1416354905),n=vr(n,s,a,r,t[5],21,-57434055),r=vr(r,n,s,a,t[12],6,1700485571),a=vr(a,r,n,s,t[3],10,-1894986606),s=vr(s,a,r,n,t[10],15,-1051523),n=vr(n,s,a,r,t[1],21,-2054922799),r=vr(r,n,s,a,t[8],6,1873313359),a=vr(a,r,n,s,t[15],10,-30611744),s=vr(s,a,r,n,t[6],15,-1560198380),n=vr(n,s,a,r,t[13],21,1309151649),r=vr(r,n,s,a,t[4],6,-145523070),a=vr(a,r,n,s,t[11],10,-1120210379),s=vr(s,a,r,n,t[2],15,718787259),n=vr(n,s,a,r,t[9],21,-343485551),e[0]=oi(r,e[0]),e[1]=oi(n,e[1]),e[2]=oi(s,e[2]),e[3]=oi(a,e[3])}function Ya(e,t,r,n,s,a){return t=oi(oi(t,e),oi(n,a)),oi(t<<s|t>>>32-s,r)}function mr(e,t,r,n,s,a,h){return Ya(t&r|~t&n,e,t,s,a,h)}function xr(e,t,r,n,s,a,h){return Ya(t&n|r&~n,e,t,s,a,h)}function br(e,t,r,n,s,a,h){return Ya(t^r^n,e,t,s,a,h)}function vr(e,t,r,n,s,a,h){return Ya(r^(t|~n),e,t,s,a,h)}function ch(e){var t,r=e.length,n=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)Vo(n,r1(e.substring(t-64,t)));e=e.substring(t-64);var s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<e.length;t++)s[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(s[t>>2]|=128<<(t%4<<3),t>55)for(Vo(n,s),t=0;t<16;t++)s[t]=0;return s[14]=8*r,Vo(n,s),n}function r1(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}var Zc="0123456789abcdef".split("");function n1(e){for(var t="",r=0;r<4;r++)t+=Zc[e>>8*r+4&15]+Zc[e>>8*r&15];return t}function i1(e){return String.fromCharCode(255&e,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function sl(e){return ch(e).map(i1).join("")}var s1=function(e){for(var t=0;t<e.length;t++)e[t]=n1(e[t]);return e.join("")}(ch("hello"))!="5d41402abc4b2a76b9719d911017c592";function oi(e,t){if(s1){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}return e+t&4294967295}/**
 * @license
 * FPDF is released under a permissive license: there is no usage restriction.
 * You may embed it freely in your application (commercial or not), with or
 * without modifications.
 *
 * Reference: http://www.fpdf.org/en/script/script37.php
 */function al(e,t){var r,n,s,a;if(e!==r){for(var h=(s=e,a=1+(256/e.length|0),new Array(a+1).join(s)),c=[],d=0;d<256;d++)c[d]=d;var g=0;for(d=0;d<256;d++){var m=c[d];g=(g+m+h.charCodeAt(d))%256,c[d]=c[g],c[g]=m}r=e,n=c}else c=n;var w=t.length,S=0,p=0,O="";for(d=0;d<w;d++)p=(p+(m=c[S=(S+1)%256]))%256,c[S]=c[p],c[p]=m,h=c[(c[S]+c[p])%256],O+=String.fromCharCode(t.charCodeAt(d)^h);return O}/**
 * @license
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 * Author: Owen Leong (@owenl131)
 * Date: 15 Oct 2020
 * References:
 * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
 * https://github.com/foliojs/pdfkit/blob/master/lib/security.js
 * http://www.fpdf.org/en/script/script37.php
 */var Qc={print:4,modify:8,copy:16,"annot-forms":32};function Xi(e,t,r,n){this.v=1,this.r=2;var s=192;e.forEach(function(c){if(Qc.perm!==void 0)throw new Error("Invalid permission: "+c);s+=Qc[c]}),this.padding="(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";var a=(t+this.padding).substr(0,32),h=(r+this.padding).substr(0,32);this.O=this.processOwnerPassword(a,h),this.P=-(1+(255^s)),this.encryptionKey=sl(a+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(n)).substr(0,5),this.U=al(this.encryptionKey,this.padding)}function Zi(e){if(/[^\u0000-\u00ff]/.test(e))throw new Error("Invalid PDF Name Object: "+e+", Only accept ASCII characters.");for(var t="",r=e.length,n=0;n<r;n++){var s=e.charCodeAt(n);t+=s<33||s===35||s===37||s===40||s===41||s===47||s===60||s===62||s===91||s===93||s===123||s===125||s>126?"#"+("0"+s.toString(16)).slice(-2):e[n]}return t}function eu(e){if(Ft(e)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var t={};this.subscribe=function(r,n,s){if(s=s||!1,typeof r!="string"||typeof n!="function"||typeof s!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");t.hasOwnProperty(r)||(t[r]={});var a=Math.random().toString(35);return t[r][a]=[n,!!s],a},this.unsubscribe=function(r){for(var n in t)if(t[n][r])return delete t[n][r],Object.keys(t[n]).length===0&&delete t[n],!0;return!1},this.publish=function(r){if(t.hasOwnProperty(r)){var n=Array.prototype.slice.call(arguments,1),s=[];for(var a in t[r]){var h=t[r][a];try{h[0].apply(e,n)}catch(c){st.console&&It.error("jsPDF PubSub Error",c.message,c)}h[1]&&s.push(a)}s.length&&s.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function za(e){if(!(this instanceof za))return new za(e);var t="opacity,stroke-opacity".split(",");for(var r in e)e.hasOwnProperty(r)&&t.indexOf(r)>=0&&(this[r]=e[r]);this.id="",this.objectNumber=-1}function uh(e,t){this.gState=e,this.matrix=t,this.id="",this.objectNumber=-1}function ki(e,t,r,n,s){if(!(this instanceof ki))return new ki(e,t,r,n,s);this.type=e==="axial"?2:3,this.coords=t,this.colors=r,uh.call(this,n,s)}function Qi(e,t,r,n,s){if(!(this instanceof Qi))return new Qi(e,t,r,n,s);this.boundingBox=e,this.xStep=t,this.yStep=r,this.stream="",this.cloneIndex=0,uh.call(this,n,s)}function Ke(e){var t,r=typeof arguments[0]=="string"?arguments[0]:"p",n=arguments[1],s=arguments[2],a=arguments[3],h=[],c=1,d=16,g="S",m=null;Ft(e=e||{})==="object"&&(r=e.orientation,n=e.unit||n,s=e.format||s,a=e.compress||e.compressPdf||a,(m=e.encryption||null)!==null&&(m.userPassword=m.userPassword||"",m.ownerPassword=m.ownerPassword||"",m.userPermissions=m.userPermissions||[]),c=typeof e.userUnit=="number"?Math.abs(e.userUnit):1,e.precision!==void 0&&(t=e.precision),e.floatPrecision!==void 0&&(d=e.floatPrecision),g=e.defaultPathOperation||"S"),h=e.filters||(a===!0?["FlateEncode"]:h),n=n||"mm",r=(""+(r||"P")).toLowerCase();var w=e.putOnlyUsedFonts||!1,S={},p={internal:{},__private__:{}};p.__private__.PubSub=eu;var O="1.3",N=p.__private__.getPdfVersion=function(){return O};p.__private__.setPdfVersion=function(u){O=u};var T={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};p.__private__.getPageFormats=function(){return T};var L=p.__private__.getPageFormat=function(u){return T[u]};s=s||"a4";var K="compat",X="advanced",H=K;function Q(){this.saveGraphicsState(),E(new tt(nt,0,0,-nt,0,xi()*nt).toString()+" cm"),this.setFontSize(this.getFontSize()/nt),g="n",H=X}function he(){this.restoreGraphicsState(),g="S",H=K}var pe=p.__private__.combineFontStyleAndFontWeight=function(u,v){if(u=="bold"&&v=="normal"||u=="bold"&&v==400||u=="normal"&&v=="italic"||u=="bold"&&v=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return v&&(u=v==400||v==="normal"?u==="italic"?"italic":"normal":v!=700&&v!=="bold"||u!=="normal"?(v==700?"bold":v)+""+u:"bold"),u};p.advancedAPI=function(u){var v=H===K;return v&&Q.call(this),typeof u!="function"||(u(this),v&&he.call(this)),this},p.compatAPI=function(u){var v=H===X;return v&&he.call(this),typeof u!="function"||(u(this),v&&Q.call(this)),this},p.isAdvancedAPI=function(){return H===X};var C,R=function(u){if(H!==X)throw new Error(u+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},ne=p.roundToPrecision=p.__private__.roundToPrecision=function(u,v){var U=t||v;if(isNaN(u)||isNaN(U))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return u.toFixed(U).replace(/0+$/,"")};C=p.hpf=p.__private__.hpf=typeof d=="number"?function(u){if(isNaN(u))throw new Error("Invalid argument passed to jsPDF.hpf");return ne(u,d)}:d==="smart"?function(u){if(isNaN(u))throw new Error("Invalid argument passed to jsPDF.hpf");return ne(u,u>-1&&u<1?16:5)}:function(u){if(isNaN(u))throw new Error("Invalid argument passed to jsPDF.hpf");return ne(u,16)};var j=p.f2=p.__private__.f2=function(u){if(isNaN(u))throw new Error("Invalid argument passed to jsPDF.f2");return ne(u,2)},P=p.__private__.f3=function(u){if(isNaN(u))throw new Error("Invalid argument passed to jsPDF.f3");return ne(u,3)},G=p.scale=p.__private__.scale=function(u){if(isNaN(u))throw new Error("Invalid argument passed to jsPDF.scale");return H===K?u*nt:H===X?u:void 0},$=function(u){return G(function(v){return H===K?xi()-v:H===X?v:void 0}(u))};p.__private__.setPrecision=p.setPrecision=function(u){typeof parseInt(u,10)=="number"&&(t=parseInt(u,10))};var ue,fe="00000000000000000000000000000000",me=p.__private__.getFileId=function(){return fe},se=p.__private__.setFileId=function(u){return fe=u!==void 0&&/^[a-fA-F0-9]{32}$/.test(u)?u.toUpperCase():fe.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),m!==null&&(er=new Xi(m.userPermissions,m.userPassword,m.ownerPassword,fe)),fe};p.setFileId=function(u){return se(u),this},p.getFileId=function(){return me()};var ge=p.__private__.convertDateToPDFDate=function(u){var v=u.getTimezoneOffset(),U=v<0?"+":"-",J=Math.floor(Math.abs(v/60)),te=Math.abs(v%60),ve=[U,D(J),"'",D(te),"'"].join("");return["D:",u.getFullYear(),D(u.getMonth()+1),D(u.getDate()),D(u.getHours()),D(u.getMinutes()),D(u.getSeconds()),ve].join("")},W=p.__private__.convertPDFDateToDate=function(u){var v=parseInt(u.substr(2,4),10),U=parseInt(u.substr(6,2),10)-1,J=parseInt(u.substr(8,2),10),te=parseInt(u.substr(10,2),10),ve=parseInt(u.substr(12,2),10),Ae=parseInt(u.substr(14,2),10);return new Date(v,U,J,te,ve,Ae,0)},M=p.__private__.setCreationDate=function(u){var v;if(u===void 0&&(u=new Date),u instanceof Date)v=ge(u);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(u))throw new Error("Invalid argument passed to jsPDF.setCreationDate");v=u}return ue=v},b=p.__private__.getCreationDate=function(u){var v=ue;return u==="jsDate"&&(v=W(ue)),v};p.setCreationDate=function(u){return M(u),this},p.getCreationDate=function(u){return b(u)};var I,D=p.__private__.padd2=function(u){return("0"+parseInt(u)).slice(-2)},z=p.__private__.padd2Hex=function(u){return("00"+(u=u.toString())).substr(u.length)},V=0,Y=[],re=[],oe=0,de=[],ye=[],je=!1,Ce=re;p.__private__.setCustomOutputDestination=function(u){je=!0,Ce=u};var ke=function(u){je||(Ce=u)};p.__private__.resetCustomOutputDestination=function(){je=!1,Ce=re};var E=p.__private__.out=function(u){return u=u.toString(),oe+=u.length+1,Ce.push(u),Ce},Ie=p.__private__.write=function(u){return E(arguments.length===1?u.toString():Array.prototype.join.call(arguments," "))},Qe=p.__private__.getArrayBuffer=function(u){for(var v=u.length,U=new ArrayBuffer(v),J=new Uint8Array(U);v--;)J[v]=u.charCodeAt(v);return U},Re=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];p.__private__.getStandardFonts=function(){return Re};var Ne=e.fontSize||16;p.__private__.setFontSize=p.setFontSize=function(u){return Ne=H===X?u/nt:u,this};var De,Te=p.__private__.getFontSize=p.getFontSize=function(){return H===K?Ne:Ne*nt},qe=e.R2L||!1;p.__private__.setR2L=p.setR2L=function(u){return qe=u,this},p.__private__.getR2L=p.getR2L=function(){return qe};var Je,Ee=p.__private__.setZoomMode=function(u){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(u))De=u;else if(isNaN(u)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(u)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+u+'" is not recognized.');De=u}else De=parseInt(u,10)};p.__private__.getZoomMode=function(){return De};var ut,rt=p.__private__.setPageMode=function(u){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(u)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+u+'" is not recognized.');Je=u};p.__private__.getPageMode=function(){return Je};var xt=p.__private__.setLayoutMode=function(u){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(u)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+u+'" is not recognized.');ut=u};p.__private__.getLayoutMode=function(){return ut},p.__private__.setDisplayMode=p.setDisplayMode=function(u,v,U){return Ee(u),xt(v),rt(U),this};var mt={title:"",subject:"",author:"",keywords:"",creator:""};p.__private__.getDocumentProperty=function(u){if(Object.keys(mt).indexOf(u)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return mt[u]},p.__private__.getDocumentProperties=function(){return mt},p.__private__.setDocumentProperties=p.setProperties=p.setDocumentProperties=function(u){for(var v in mt)mt.hasOwnProperty(v)&&u[v]&&(mt[v]=u[v]);return this},p.__private__.setDocumentProperty=function(u,v){if(Object.keys(mt).indexOf(u)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return mt[u]=v};var ze,nt,He,Et,bt,ht={},dt={},kt=[],Ze={},ae={},_e={},Fe={},Pe=null,Be=0,Me=[],et=new eu(p),wn=e.hotfixes||[],pr={},Nn={},on=[],tt=function u(v,U,J,te,ve,Ae){if(!(this instanceof u))return new u(v,U,J,te,ve,Ae);isNaN(v)&&(v=1),isNaN(U)&&(U=0),isNaN(J)&&(J=0),isNaN(te)&&(te=1),isNaN(ve)&&(ve=0),isNaN(Ae)&&(Ae=0),this._matrix=[v,U,J,te,ve,Ae]};Object.defineProperty(tt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(u){this._matrix[0]=u}}),Object.defineProperty(tt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(u){this._matrix[1]=u}}),Object.defineProperty(tt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(u){this._matrix[2]=u}}),Object.defineProperty(tt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(u){this._matrix[3]=u}}),Object.defineProperty(tt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(u){this._matrix[4]=u}}),Object.defineProperty(tt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(u){this._matrix[5]=u}}),Object.defineProperty(tt.prototype,"a",{get:function(){return this._matrix[0]},set:function(u){this._matrix[0]=u}}),Object.defineProperty(tt.prototype,"b",{get:function(){return this._matrix[1]},set:function(u){this._matrix[1]=u}}),Object.defineProperty(tt.prototype,"c",{get:function(){return this._matrix[2]},set:function(u){this._matrix[2]=u}}),Object.defineProperty(tt.prototype,"d",{get:function(){return this._matrix[3]},set:function(u){this._matrix[3]=u}}),Object.defineProperty(tt.prototype,"e",{get:function(){return this._matrix[4]},set:function(u){this._matrix[4]=u}}),Object.defineProperty(tt.prototype,"f",{get:function(){return this._matrix[5]},set:function(u){this._matrix[5]=u}}),Object.defineProperty(tt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(tt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(tt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(tt.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),tt.prototype.join=function(u){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(C).join(u)},tt.prototype.multiply=function(u){var v=u.sx*this.sx+u.shy*this.shx,U=u.sx*this.shy+u.shy*this.sy,J=u.shx*this.sx+u.sy*this.shx,te=u.shx*this.shy+u.sy*this.sy,ve=u.tx*this.sx+u.ty*this.shx+this.tx,Ae=u.tx*this.shy+u.ty*this.sy+this.ty;return new tt(v,U,J,te,ve,Ae)},tt.prototype.decompose=function(){var u=this.sx,v=this.shy,U=this.shx,J=this.sy,te=this.tx,ve=this.ty,Ae=Math.sqrt(u*u+v*v),Ve=(u/=Ae)*U+(v/=Ae)*J;U-=u*Ve,J-=v*Ve;var Ye=Math.sqrt(U*U+J*J);return Ve/=Ye,u*(J/=Ye)<v*(U/=Ye)&&(u=-u,v=-v,Ve=-Ve,Ae=-Ae),{scale:new tt(Ae,0,0,Ye,0,0),translate:new tt(1,0,0,1,te,ve),rotate:new tt(u,v,-v,u,0,0),skew:new tt(1,0,Ve,1,0,0)}},tt.prototype.toString=function(u){return this.join(" ")},tt.prototype.inversed=function(){var u=this.sx,v=this.shy,U=this.shx,J=this.sy,te=this.tx,ve=this.ty,Ae=1/(u*J-v*U),Ve=J*Ae,Ye=-v*Ae,at=-U*Ae,ft=u*Ae;return new tt(Ve,Ye,at,ft,-Ve*te-at*ve,-Ye*te-ft*ve)},tt.prototype.applyToPoint=function(u){var v=u.x*this.sx+u.y*this.shx+this.tx,U=u.x*this.shy+u.y*this.sy+this.ty;return new Cn(v,U)},tt.prototype.applyToRectangle=function(u){var v=this.applyToPoint(u),U=this.applyToPoint(new Cn(u.x+u.w,u.y+u.h));return new ps(v.x,v.y,U.x-v.x,U.y-v.y)},tt.prototype.clone=function(){var u=this.sx,v=this.shy,U=this.shx,J=this.sy,te=this.tx,ve=this.ty;return new tt(u,v,U,J,te,ve)},p.Matrix=tt;var _n=p.matrixMult=function(u,v){return v.multiply(u)},jn=new tt(1,0,0,1,0,0);p.unitMatrix=p.identityMatrix=jn;var Rr=function(u,v){if(!ae[u]){var U=(v instanceof ki?"Sh":"P")+(Object.keys(Ze).length+1).toString(10);v.id=U,ae[u]=U,Ze[U]=v,et.publish("addPattern",v)}};p.ShadingPattern=ki,p.TilingPattern=Qi,p.addShadingPattern=function(u,v){return R("addShadingPattern()"),Rr(u,v),this},p.beginTilingPattern=function(u){R("beginTilingPattern()"),gs(u.boundingBox[0],u.boundingBox[1],u.boundingBox[2]-u.boundingBox[0],u.boundingBox[3]-u.boundingBox[1],u.matrix)},p.endTilingPattern=function(u,v){R("endTilingPattern()"),v.stream=ye[I].join(`
`),Rr(u,v),et.publish("endTilingPattern",v),on.pop().restore()};var Dr,qt=p.__private__.newObject=function(){var u=ar();return lr(u,!0),u},ar=p.__private__.newObjectDeferred=function(){return V++,Y[V]=function(){return oe},V},lr=function(u,v){return v=typeof v=="boolean"&&v,Y[u]=oe,v&&E(u+" 0 obj"),u},ui=p.__private__.newAdditionalObject=function(){var u={objId:ar(),content:""};return de.push(u),u},Hn=ar(),Gr=ar(),ln=p.__private__.decodeColorString=function(u){var v=u.split(" ");if(v.length!==2||v[1]!=="g"&&v[1]!=="G")v.length!==5||v[4]!=="k"&&v[4]!=="K"||(v=[(1-v[0])*(1-v[3]),(1-v[1])*(1-v[3]),(1-v[2])*(1-v[3]),"r"]);else{var U=parseFloat(v[0]);v=[U,U,U,"r"]}for(var J="#",te=0;te<3;te++)J+=("0"+Math.floor(255*parseFloat(v[te])).toString(16)).slice(-2);return J},Jr=p.__private__.encodeColorString=function(u){var v;typeof u=="string"&&(u={ch1:u});var U=u.ch1,J=u.ch2,te=u.ch3,ve=u.ch4,Ae=u.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof U=="string"&&U.charAt(0)!=="#"){var Ve=new lh(U);if(Ve.ok)U=Ve.toHex();else if(!/^\d*\.?\d*$/.test(U))throw new Error('Invalid color "'+U+'" passed to jsPDF.encodeColorString.')}if(typeof U=="string"&&/^#[0-9A-Fa-f]{3}$/.test(U)&&(U="#"+U[1]+U[1]+U[2]+U[2]+U[3]+U[3]),typeof U=="string"&&/^#[0-9A-Fa-f]{6}$/.test(U)){var Ye=parseInt(U.substr(1),16);U=Ye>>16&255,J=Ye>>8&255,te=255&Ye}if(J===void 0||ve===void 0&&U===J&&J===te)v=typeof U=="string"?U+" "+Ae[0]:u.precision===2?j(U/255)+" "+Ae[0]:P(U/255)+" "+Ae[0];else if(ve===void 0||Ft(ve)==="object"){if(ve&&!isNaN(ve.a)&&ve.a===0)return["1.","1.","1.",Ae[1]].join(" ");v=typeof U=="string"?[U,J,te,Ae[1]].join(" "):u.precision===2?[j(U/255),j(J/255),j(te/255),Ae[1]].join(" "):[P(U/255),P(J/255),P(te/255),Ae[1]].join(" ")}else v=typeof U=="string"?[U,J,te,ve,Ae[2]].join(" "):u.precision===2?[j(U),j(J),j(te),j(ve),Ae[2]].join(" "):[P(U),P(J),P(te),P(ve),Ae[2]].join(" ");return v},Yr=p.__private__.getFilters=function(){return h},Br=p.__private__.putStream=function(u){var v=(u=u||{}).data||"",U=u.filters||Yr(),J=u.alreadyAppliedFilters||[],te=u.addLength1||!1,ve=v.length,Ae=u.objectId,Ve=function(tr){return tr};if(m!==null&&Ae===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");m!==null&&(Ve=er.encryptor(Ae,0));var Ye={};U===!0&&(U=["FlateEncode"]);var at=u.additionalKeyValues||[],ft=(Ye=Ke.API.processDataByFilters!==void 0?Ke.API.processDataByFilters(v,U):{data:v,reverseChain:[]}).reverseChain+(Array.isArray(J)?J.join(" "):J.toString());if(Ye.data.length!==0&&(at.push({key:"Length",value:Ye.data.length}),te===!0&&at.push({key:"Length1",value:ve})),ft.length!=0)if(ft.split("/").length-1==1)at.push({key:"Filter",value:ft});else{at.push({key:"Filter",value:"["+ft+"]"});for(var wt=0;wt<at.length;wt+=1)if(at[wt].key==="DecodeParms"){for(var Bt=[],Zt=0;Zt<Ye.reverseChain.split("/").length-1;Zt+=1)Bt.push("null");Bt.push(at[wt].value),at[wt].value="["+Bt.join(" ")+"]"}}E("<<");for(var Ot=0;Ot<at.length;Ot++)E("/"+at[Ot].key+" "+at[Ot].value);E(">>"),Ye.data.length!==0&&(E("stream"),E(Ve(Ye.data)),E("endstream"))},hi=p.__private__.putPage=function(u){var v=u.number,U=u.data,J=u.objId,te=u.contentsObjId;lr(J,!0),E("<</Type /Page"),E("/Parent "+u.rootDictionaryObjId+" 0 R"),E("/Resources "+u.resourceDictionaryObjId+" 0 R"),E("/MediaBox ["+parseFloat(C(u.mediaBox.bottomLeftX))+" "+parseFloat(C(u.mediaBox.bottomLeftY))+" "+C(u.mediaBox.topRightX)+" "+C(u.mediaBox.topRightY)+"]"),u.cropBox!==null&&E("/CropBox ["+C(u.cropBox.bottomLeftX)+" "+C(u.cropBox.bottomLeftY)+" "+C(u.cropBox.topRightX)+" "+C(u.cropBox.topRightY)+"]"),u.bleedBox!==null&&E("/BleedBox ["+C(u.bleedBox.bottomLeftX)+" "+C(u.bleedBox.bottomLeftY)+" "+C(u.bleedBox.topRightX)+" "+C(u.bleedBox.topRightY)+"]"),u.trimBox!==null&&E("/TrimBox ["+C(u.trimBox.bottomLeftX)+" "+C(u.trimBox.bottomLeftY)+" "+C(u.trimBox.topRightX)+" "+C(u.trimBox.topRightY)+"]"),u.artBox!==null&&E("/ArtBox ["+C(u.artBox.bottomLeftX)+" "+C(u.artBox.bottomLeftY)+" "+C(u.artBox.topRightX)+" "+C(u.artBox.topRightY)+"]"),typeof u.userUnit=="number"&&u.userUnit!==1&&E("/UserUnit "+u.userUnit),et.publish("putPage",{objId:J,pageContext:Me[v],pageNumber:v,page:U}),E("/Contents "+te+" 0 R"),E(">>"),E("endobj");var ve=U.join(`
`);return H===X&&(ve+=`
Q`),lr(te,!0),Br({data:ve,filters:Yr(),objectId:te}),E("endobj"),J},cn=p.__private__.putPages=function(){var u,v,U=[];for(u=1;u<=Be;u++)Me[u].objId=ar(),Me[u].contentsObjId=ar();for(u=1;u<=Be;u++)U.push(hi({number:u,data:ye[u],objId:Me[u].objId,contentsObjId:Me[u].contentsObjId,mediaBox:Me[u].mediaBox,cropBox:Me[u].cropBox,bleedBox:Me[u].bleedBox,trimBox:Me[u].trimBox,artBox:Me[u].artBox,userUnit:Me[u].userUnit,rootDictionaryObjId:Hn,resourceDictionaryObjId:Gr}));lr(Hn,!0),E("<</Type /Pages");var J="/Kids [";for(v=0;v<Be;v++)J+=U[v]+" 0 R ";E(J+"]"),E("/Count "+Be),E(">>"),E("endobj"),et.publish("postPutPages")},di=function(u){et.publish("putFont",{font:u,out:E,newObject:qt,putStream:Br}),u.isAlreadyPutted!==!0&&(u.objectNumber=qt(),E("<<"),E("/Type /Font"),E("/BaseFont /"+Zi(u.postScriptName)),E("/Subtype /Type1"),typeof u.encoding=="string"&&E("/Encoding /"+u.encoding),E("/FirstChar 32"),E("/LastChar 255"),E(">>"),E("endobj"))},Ti=function(u){u.objectNumber=qt();var v=[];v.push({key:"Type",value:"/XObject"}),v.push({key:"Subtype",value:"/Form"}),v.push({key:"BBox",value:"["+[C(u.x),C(u.y),C(u.x+u.width),C(u.y+u.height)].join(" ")+"]"}),v.push({key:"Matrix",value:"["+u.matrix.toString()+"]"});var U=u.pages[1].join(`
`);Br({data:U,additionalKeyValues:v,objectId:u.objectNumber}),E("endobj")},Mi=function(u,v){v||(v=21);var U=qt(),J=function(Ae,Ve){var Ye,at=[],ft=1/(Ve-1);for(Ye=0;Ye<1;Ye+=ft)at.push(Ye);if(at.push(1),Ae[0].offset!=0){var wt={offset:0,color:Ae[0].color};Ae.unshift(wt)}if(Ae[Ae.length-1].offset!=1){var Bt={offset:1,color:Ae[Ae.length-1].color};Ae.push(Bt)}for(var Zt="",Ot=0,tr=0;tr<at.length;tr++){for(Ye=at[tr];Ye>Ae[Ot+1].offset;)Ot++;var Qt=Ae[Ot].offset,cr=(Ye-Qt)/(Ae[Ot+1].offset-Qt),Fn=Ae[Ot].color,Xr=Ae[Ot+1].color;Zt+=z(Math.round((1-cr)*Fn[0]+cr*Xr[0]).toString(16))+z(Math.round((1-cr)*Fn[1]+cr*Xr[1]).toString(16))+z(Math.round((1-cr)*Fn[2]+cr*Xr[2]).toString(16))}return Zt.trim()}(u.colors,v),te=[];te.push({key:"FunctionType",value:"0"}),te.push({key:"Domain",value:"[0.0 1.0]"}),te.push({key:"Size",value:"["+v+"]"}),te.push({key:"BitsPerSample",value:"8"}),te.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),te.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Br({data:J,additionalKeyValues:te,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:U}),E("endobj"),u.objectNumber=qt(),E("<< /ShadingType "+u.type),E("/ColorSpace /DeviceRGB");var ve="/Coords ["+C(parseFloat(u.coords[0]))+" "+C(parseFloat(u.coords[1]))+" ";u.type===2?ve+=C(parseFloat(u.coords[2]))+" "+C(parseFloat(u.coords[3])):ve+=C(parseFloat(u.coords[2]))+" "+C(parseFloat(u.coords[3]))+" "+C(parseFloat(u.coords[4]))+" "+C(parseFloat(u.coords[5])),E(ve+="]"),u.matrix&&E("/Matrix ["+u.matrix.toString()+"]"),E("/Function "+U+" 0 R"),E("/Extend [true true]"),E(">>"),E("endobj")},Ri=function(u,v){var U=ar(),J=qt();v.push({resourcesOid:U,objectOid:J}),u.objectNumber=J;var te=[];te.push({key:"Type",value:"/Pattern"}),te.push({key:"PatternType",value:"1"}),te.push({key:"PaintType",value:"1"}),te.push({key:"TilingType",value:"1"}),te.push({key:"BBox",value:"["+u.boundingBox.map(C).join(" ")+"]"}),te.push({key:"XStep",value:C(u.xStep)}),te.push({key:"YStep",value:C(u.yStep)}),te.push({key:"Resources",value:U+" 0 R"}),u.matrix&&te.push({key:"Matrix",value:"["+u.matrix.toString()+"]"}),Br({data:u.stream,additionalKeyValues:te,objectId:u.objectNumber}),E("endobj")},Ka=function(u){for(var v in u.objectNumber=qt(),E("<<"),u)switch(v){case"opacity":E("/ca "+j(u[v]));break;case"stroke-opacity":E("/CA "+j(u[v]))}E(">>"),E("endobj")},as=function(u){lr(u.resourcesOid,!0),E("<<"),E("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var v in E("/Font <<"),ht)ht.hasOwnProperty(v)&&(w===!1||w===!0&&S.hasOwnProperty(v))&&E("/"+v+" "+ht[v].objectNumber+" 0 R");E(">>")}(),function(){if(Object.keys(Ze).length>0){for(var v in E("/Shading <<"),Ze)Ze.hasOwnProperty(v)&&Ze[v]instanceof ki&&Ze[v].objectNumber>=0&&E("/"+v+" "+Ze[v].objectNumber+" 0 R");et.publish("putShadingPatternDict"),E(">>")}}(),function(v){if(Object.keys(Ze).length>0){for(var U in E("/Pattern <<"),Ze)Ze.hasOwnProperty(U)&&Ze[U]instanceof p.TilingPattern&&Ze[U].objectNumber>=0&&Ze[U].objectNumber<v&&E("/"+U+" "+Ze[U].objectNumber+" 0 R");et.publish("putTilingPatternDict"),E(">>")}}(u.objectOid),function(){if(Object.keys(_e).length>0){var v;for(v in E("/ExtGState <<"),_e)_e.hasOwnProperty(v)&&_e[v].objectNumber>=0&&E("/"+v+" "+_e[v].objectNumber+" 0 R");et.publish("putGStateDict"),E(">>")}}(),function(){for(var v in E("/XObject <<"),pr)pr.hasOwnProperty(v)&&pr[v].objectNumber>=0&&E("/"+v+" "+pr[v].objectNumber+" 0 R");et.publish("putXobjectDict"),E(">>")}(),E(">>"),E("endobj")},Us=function(u){dt[u.fontName]=dt[u.fontName]||{},dt[u.fontName][u.fontStyle]=u.id},zs=function(u,v,U,J,te){var ve={id:"F"+(Object.keys(ht).length+1).toString(10),postScriptName:u,fontName:v,fontStyle:U,encoding:J,isStandardFont:te||!1,metadata:{}};return et.publish("addFont",{font:ve,instance:this}),ht[ve.id]=ve,Us(ve),ve.id},qr=p.__private__.pdfEscape=p.pdfEscape=function(u,v){return function(U,J){var te,ve,Ae,Ve,Ye,at,ft,wt,Bt;if(Ae=(J=J||{}).sourceEncoding||"Unicode",Ye=J.outputEncoding,(J.autoencode||Ye)&&ht[ze].metadata&&ht[ze].metadata[Ae]&&ht[ze].metadata[Ae].encoding&&(Ve=ht[ze].metadata[Ae].encoding,!Ye&&ht[ze].encoding&&(Ye=ht[ze].encoding),!Ye&&Ve.codePages&&(Ye=Ve.codePages[0]),typeof Ye=="string"&&(Ye=Ve[Ye]),Ye)){for(ft=!1,at=[],te=0,ve=U.length;te<ve;te++)(wt=Ye[U.charCodeAt(te)])?at.push(String.fromCharCode(wt)):at.push(U[te]),at[te].charCodeAt(0)>>8&&(ft=!0);U=at.join("")}for(te=U.length;ft===void 0&&te!==0;)U.charCodeAt(te-1)>>8&&(ft=!0),te--;if(!ft)return U;for(at=J.noBOM?[]:[254,255],te=0,ve=U.length;te<ve;te++){if((Bt=(wt=U.charCodeAt(te))>>8)>>8)throw new Error("Character at position "+te+" of string '"+U+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");at.push(Bt),at.push(wt-(Bt<<8))}return String.fromCharCode.apply(void 0,at)}(u,v).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},os=p.__private__.beginPage=function(u){ye[++Be]=[],Me[Be]={objId:0,contentsObjId:0,userUnit:Number(c),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(u[0]),topRightY:Number(u[1])}},Ws(Be),ke(ye[I])},Hs=function(u,v){var U,J,te;switch(r=v||r,typeof u=="string"&&(U=L(u.toLowerCase()),Array.isArray(U)&&(J=U[0],te=U[1])),Array.isArray(u)&&(J=u[0]*nt,te=u[1]*nt),isNaN(J)&&(J=s[0],te=s[1]),(J>14400||te>14400)&&(It.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),J=Math.min(14400,J),te=Math.min(14400,te)),s=[J,te],r.substr(0,1)){case"l":te>J&&(s=[te,J]);break;case"p":J>te&&(s=[te,J])}os(s),ot(us),E(Ui),ds!==0&&E(ds+" J"),fs!==0&&E(fs+" j"),et.publish("addPage",{pageNumber:Be})},ls=function(u){u>0&&u<=Be&&(ye.splice(u,1),Me.splice(u,1),Be--,I>Be&&(I=Be),this.setPage(I))},Ws=function(u){u>0&&u<=Be&&(I=u)},Vs=p.__private__.getNumberOfPages=p.getNumberOfPages=function(){return ye.length-1},$s=function(u,v,U){var J,te=void 0;return U=U||{},u=u!==void 0?u:ht[ze].fontName,v=v!==void 0?v:ht[ze].fontStyle,J=u.toLowerCase(),dt[J]!==void 0&&dt[J][v]!==void 0?te=dt[J][v]:dt[u]!==void 0&&dt[u][v]!==void 0?te=dt[u][v]:U.disableWarning===!1&&It.warn("Unable to look up font label for font '"+u+"', '"+v+"'. Refer to getFontList() for available fonts."),te||U.noFallback||(te=dt.times[v])==null&&(te=dt.times.normal),te},un=p.__private__.putInfo=function(){var u=qt(),v=function(J){return J};for(var U in m!==null&&(v=er.encryptor(u,0)),E("<<"),E("/Producer ("+qr(v("jsPDF "+Ke.version))+")"),mt)mt.hasOwnProperty(U)&&mt[U]&&E("/"+U.substr(0,1).toUpperCase()+U.substr(1)+" ("+qr(v(mt[U]))+")");E("/CreationDate ("+qr(v(ue))+")"),E(">>"),E("endobj")},Di=p.__private__.putCatalog=function(u){var v=(u=u||{}).rootDictionaryObjId||Hn;switch(qt(),E("<<"),E("/Type /Catalog"),E("/Pages "+v+" 0 R"),De||(De="fullwidth"),De){case"fullwidth":E("/OpenAction [3 0 R /FitH null]");break;case"fullheight":E("/OpenAction [3 0 R /FitV null]");break;case"fullpage":E("/OpenAction [3 0 R /Fit]");break;case"original":E("/OpenAction [3 0 R /XYZ null null 1]");break;default:var U=""+De;U.substr(U.length-1)==="%"&&(De=parseInt(De)/100),typeof De=="number"&&E("/OpenAction [3 0 R /XYZ null null "+j(De)+"]")}switch(ut||(ut="continuous"),ut){case"continuous":E("/PageLayout /OneColumn");break;case"single":E("/PageLayout /SinglePage");break;case"two":case"twoleft":E("/PageLayout /TwoColumnLeft");break;case"tworight":E("/PageLayout /TwoColumnRight")}Je&&E("/PageMode /"+Je),et.publish("putCatalog"),E(">>"),E("endobj")},Xa=p.__private__.putTrailer=function(){E("trailer"),E("<<"),E("/Size "+(V+1)),E("/Root "+V+" 0 R"),E("/Info "+(V-1)+" 0 R"),m!==null&&E("/Encrypt "+er.oid+" 0 R"),E("/ID [ <"+fe+"> <"+fe+"> ]"),E(">>")},Xt=p.__private__.putHeader=function(){E("%PDF-"+O),E("%ºß¬à")},Gs=p.__private__.putXRef=function(){var u="0000000000";E("xref"),E("0 "+(V+1)),E("0000000000 65535 f ");for(var v=1;v<=V;v++)typeof Y[v]=="function"?E((u+Y[v]()).slice(-10)+" 00000 n "):Y[v]!==void 0?E((u+Y[v]).slice(-10)+" 00000 n "):E("0000000000 00000 n ")},hn=p.__private__.buildDocument=function(){var u;V=0,oe=0,re=[],Y=[],de=[],Hn=ar(),Gr=ar(),ke(re),et.publish("buildDocument"),Xt(),cn(),function(){et.publish("putAdditionalObjects");for(var U=0;U<de.length;U++){var J=de[U];lr(J.objId,!0),E(J.content),E("endobj")}et.publish("postPutAdditionalObjects")}(),u=[],function(){for(var U in ht)ht.hasOwnProperty(U)&&(w===!1||w===!0&&S.hasOwnProperty(U))&&di(ht[U])}(),function(){var U;for(U in _e)_e.hasOwnProperty(U)&&Ka(_e[U])}(),function(){for(var U in pr)pr.hasOwnProperty(U)&&Ti(pr[U])}(),function(U){var J;for(J in Ze)Ze.hasOwnProperty(J)&&(Ze[J]instanceof ki?Mi(Ze[J]):Ze[J]instanceof Qi&&Ri(Ze[J],U))}(u),et.publish("putResources"),u.forEach(as),as({resourcesOid:Gr,objectOid:Number.MAX_SAFE_INTEGER}),et.publish("postPutResources"),m!==null&&(er.oid=qt(),E("<<"),E("/Filter /Standard"),E("/V "+er.v),E("/R "+er.r),E("/U <"+er.toHexString(er.U)+">"),E("/O <"+er.toHexString(er.O)+">"),E("/P "+er.P),E(">>"),E("endobj")),un(),Di();var v=oe;return Gs(),Xa(),E("startxref"),E(""+v),E("%%EOF"),ke(ye[I]),re.join(`
`)},Bi=p.__private__.getBlob=function(u){return new Blob([Qe(u)],{type:"application/pdf"})},Js=p.output=p.__private__.output=(Dr=function(u,v){switch(typeof(v=v||{})=="string"?v={filename:v}:v.filename=v.filename||"generated.pdf",u){case void 0:return hn();case"save":p.save(v.filename);break;case"arraybuffer":return Qe(hn());case"blob":return Bi(hn());case"bloburi":case"bloburl":if(st.URL!==void 0&&typeof st.URL.createObjectURL=="function")return st.URL&&st.URL.createObjectURL(Bi(hn()))||void 0;It.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var U="",J=hn();try{U=Xc(J)}catch{U=Xc(unescape(encodeURIComponent(J)))}return"data:application/pdf;filename="+v.filename+";base64,"+U;case"pdfobjectnewwindow":if(Object.prototype.toString.call(st)==="[object Window]"){var te="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",ve=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';v.pdfObjectUrl&&(te=v.pdfObjectUrl,ve="");var Ae='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><script src="'+te+'"'+ve+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(v)+");<\/script></body></html>",Ve=st.open();return Ve!==null&&Ve.document.write(Ae),Ve}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(st)==="[object Window]"){var Ye='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><iframe id="pdfViewer" src="'+(v.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+v.filename+'" width="500px" height="400px" /></body></html>',at=st.open();if(at!==null){at.document.write(Ye);var ft=this;at.document.documentElement.querySelector("#pdfViewer").onload=function(){at.document.title=v.filename,at.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(ft.output("bloburl"))}}return at}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(st)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var wt='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><iframe src="'+this.output("datauristring",v)+'"></iframe></body></html>',Bt=st.open();if(Bt!==null&&(Bt.document.write(wt),Bt.document.title=v.filename),Bt||typeof safari>"u")return Bt;break;case"datauri":case"dataurl":return st.document.location.href=this.output("datauristring",v);default:return null}},Dr.foo=function(){try{return Dr.apply(this,arguments)}catch(U){var u=U.stack||"";~u.indexOf(" at ")&&(u=u.split(" at ")[1]);var v="Error in function "+u.split(`
`)[0].split("<")[0]+": "+U.message;if(!st.console)throw new Error(v);st.console.error(v,U),st.alert&&alert(v)}},Dr.foo.bar=Dr,Dr.foo),Ur=function(u){return Array.isArray(wn)===!0&&wn.indexOf(u)>-1};switch(n){case"pt":nt=1;break;case"mm":nt=72/25.4;break;case"cm":nt=72/2.54;break;case"in":nt=72;break;case"px":nt=Ur("px_scaling")==1?.75:96/72;break;case"pc":case"em":nt=12;break;case"ex":nt=6;break;default:if(typeof n!="number")throw new Error("Invalid unit: "+n);nt=n}var er=null;M(),se();var An=p.__private__.getPageInfo=p.getPageInfo=function(u){if(isNaN(u)||u%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Me[u].objId,pageNumber:u,pageContext:Me[u]}},Ys=p.__private__.getPageInfoByObjId=function(u){if(isNaN(u)||u%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var v in Me)if(Me[v].objId===u)break;return An(v)},Za=p.__private__.getCurrentPageInfo=p.getCurrentPageInfo=function(){return{objId:Me[I].objId,pageNumber:I,pageContext:Me[I]}};p.addPage=function(){return Hs.apply(this,arguments),this},p.setPage=function(){return Ws.apply(this,arguments),ke.call(this,ye[I]),this},p.insertPage=function(u){return this.addPage(),this.movePage(I,u),this},p.movePage=function(u,v){var U,J;if(u>v){U=ye[u],J=Me[u];for(var te=u;te>v;te--)ye[te]=ye[te-1],Me[te]=Me[te-1];ye[v]=U,Me[v]=J,this.setPage(v)}else if(u<v){U=ye[u],J=Me[u];for(var ve=u;ve<v;ve++)ye[ve]=ye[ve+1],Me[ve]=Me[ve+1];ye[v]=U,Me[v]=J,this.setPage(v)}return this},p.deletePage=function(){return ls.apply(this,arguments),this},p.__private__.text=p.text=function(u,v,U,J,te){var ve,Ae,Ve,Ye,at,ft,wt,Bt,Zt,Ot=(J=J||{}).scope||this;if(typeof u=="number"&&typeof v=="number"&&(typeof U=="string"||Array.isArray(U))){var tr=U;U=v,v=u,u=tr}if(arguments[3]instanceof tt==0?(Ve=arguments[4],Ye=arguments[5],Ft(wt=arguments[3])==="object"&&wt!==null||(typeof Ve=="string"&&(Ye=Ve,Ve=null),typeof wt=="string"&&(Ye=wt,wt=null),typeof wt=="number"&&(Ve=wt,wt=null),J={flags:wt,angle:Ve,align:Ye})):(R("The transform parameter of text() with a Matrix value"),Zt=te),isNaN(v)||isNaN(U)||u==null)throw new Error("Invalid arguments passed to jsPDF.text");if(u.length===0)return Ot;var Qt,cr="",Fn=typeof J.lineHeightFactor=="number"?J.lineHeightFactor:pi,Xr=Ot.internal.scaleFactor;function En(_t){return _t=_t.split("	").join(Array(J.TabLen||9).join(" ")),qr(_t,wt)}function xs(_t){for(var Ct,Vt=_t.concat(),rr=[],Mn=Vt.length;Mn--;)typeof(Ct=Vt.shift())=="string"?rr.push(Ct):Array.isArray(_t)&&(Ct.length===1||Ct[1]===void 0&&Ct[2]===void 0)?rr.push(Ct[0]):rr.push([Ct[0],Ct[1],Ct[2]]);return rr}function Hi(_t,Ct){var Vt;if(typeof _t=="string")Vt=Ct(_t)[0];else if(Array.isArray(_t)){for(var rr,Mn,Ls=_t.concat(),$i=[],aa=Ls.length;aa--;)typeof(rr=Ls.shift())=="string"?$i.push(Ct(rr)[0]):Array.isArray(rr)&&typeof rr[0]=="string"&&(Mn=Ct(rr[0],rr[1],rr[2]),$i.push([Mn[0],Mn[1],Mn[2]]));Vt=$i}return Vt}var Wn=!1,bi=!0;if(typeof u=="string")Wn=!0;else if(Array.isArray(u)){var vi=u.concat();Ae=[];for(var Vn,ur=vi.length;ur--;)(typeof(Vn=vi.shift())!="string"||Array.isArray(Vn)&&typeof Vn[0]!="string")&&(bi=!1);Wn=bi}if(Wn===!1)throw new Error('Type of text must be string or Array. "'+u+'" is not recognized.');typeof u=="string"&&(u=u.match(/[\r?\n]/)?u.split(/\r\n|\r|\n/g):[u]);var yi=Ne/Ot.internal.scaleFactor,wi=yi*(Fn-1);switch(J.baseline){case"bottom":U-=wi;break;case"top":U+=yi-wi;break;case"hanging":U+=yi-2*wi;break;case"middle":U+=yi/2-wi}if((ft=J.maxWidth||0)>0&&(typeof u=="string"?u=Ot.splitTextToSize(u,ft):Object.prototype.toString.call(u)==="[object Array]"&&(u=u.reduce(function(_t,Ct){return _t.concat(Ot.splitTextToSize(Ct,ft))},[]))),ve={text:u,x:v,y:U,options:J,mutex:{pdfEscape:qr,activeFontKey:ze,fonts:ht,activeFontSize:Ne}},et.publish("preProcessText",ve),u=ve.text,Ve=(J=ve.options).angle,Zt instanceof tt==0&&Ve&&typeof Ve=="number"){Ve*=Math.PI/180,J.rotationDirection===0&&(Ve=-Ve),H===X&&(Ve=-Ve);var bs=Math.cos(Ve),vs=Math.sin(Ve);Zt=new tt(bs,vs,-vs,bs,0,0)}else Ve&&Ve instanceof tt&&(Zt=Ve);H!==X||Zt||(Zt=jn),(at=J.charSpace||kn)!==void 0&&(cr+=C(G(at))+` Tc
`,this.setCharSpace(this.getCharSpace()||0)),(Bt=J.horizontalScale)!==void 0&&(cr+=C(100*Bt)+` Tz
`),J.lang;var yr=-1,On=J.renderingMode!==void 0?J.renderingMode:J.stroke,Wi=Ot.internal.getCurrentPageInfo().pageContext;switch(On){case 0:case!1:case"fill":yr=0;break;case 1:case!0:case"stroke":yr=1;break;case 2:case"fillThenStroke":yr=2;break;case 3:case"invisible":yr=3;break;case 4:case"fillAndAddForClipping":yr=4;break;case 5:case"strokeAndAddPathForClipping":yr=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":yr=6;break;case 7:case"addToPathForClipping":yr=7}var ia=Wi.usedRenderingMode!==void 0?Wi.usedRenderingMode:-1;yr!==-1?cr+=yr+` Tr
`:ia!==-1&&(cr+=`0 Tr
`),yr!==-1&&(Wi.usedRenderingMode=yr),Ye=J.align||"left";var zr,Ni=Ne*Fn,ys=Ot.internal.pageSize.getWidth(),ws=ht[ze];at=J.charSpace||kn,ft=J.maxWidth||0,wt=Object.assign({autoencode:!0,noBOM:!0},J.flags);var $n=[],_i=function(_t){return Ot.getStringUnitWidth(_t,{font:ws,charSpace:at,fontSize:Ne,doKerning:!1})*Ne/Xr};if(Object.prototype.toString.call(u)==="[object Array]"){var Lr;Ae=xs(u),Ye!=="left"&&(zr=Ae.map(_i));var kr,Gn=0;if(Ye==="right"){v-=zr[0],u=[],ur=Ae.length;for(var Tn=0;Tn<ur;Tn++)Tn===0?(kr=Sn(v),Lr=Ln(U)):(kr=G(Gn-zr[Tn]),Lr=-Ni),u.push([Ae[Tn],kr,Lr]),Gn=zr[Tn]}else if(Ye==="center"){v-=zr[0]/2,u=[],ur=Ae.length;for(var Jn=0;Jn<ur;Jn++)Jn===0?(kr=Sn(v),Lr=Ln(U)):(kr=G((Gn-zr[Jn])/2),Lr=-Ni),u.push([Ae[Jn],kr,Lr]),Gn=zr[Jn]}else if(Ye==="left"){u=[],ur=Ae.length;for(var Ns=0;Ns<ur;Ns++)u.push(Ae[Ns])}else if(Ye==="justify"&&ws.encoding==="Identity-H"){u=[],ur=Ae.length,ft=ft!==0?ft:ys;for(var Vi=0,Wt=0;Wt<ur;Wt++)if(Lr=Wt===0?Ln(U):-Ni,kr=Wt===0?Sn(v):Vi,Wt<ur-1){var sa=G((ft-zr[Wt])/(Ae[Wt].split(" ").length-1)),fn=Ae[Wt].split(" ");u.push([fn[0]+" ",kr,Lr]),Vi=0;for(var pn=1;pn<fn.length;pn++){var _s=(_i(fn[pn-1]+" "+fn[pn])-_i(fn[pn]))*Xr+sa;pn==fn.length-1?u.push([fn[pn],_s,0]):u.push([fn[pn]+" ",_s,0]),Vi-=_s}}else u.push([Ae[Wt],kr,Lr]);u.push(["",Vi,0])}else{if(Ye!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(u=[],ur=Ae.length,ft=ft!==0?ft:ys,Wt=0;Wt<ur;Wt++){Lr=Wt===0?Ln(U):-Ni,kr=Wt===0?Sn(v):0;var js=Ae[Wt].split(" ").length-1,As=js>0?(ft-zr[Wt])/js:0;Wt<ur-1?$n.push(C(G(As))):$n.push(0),u.push([Ae[Wt],kr,Lr])}}}(typeof J.R2L=="boolean"?J.R2L:qe)===!0&&(u=Hi(u,function(_t,Ct,Vt){return[_t.split("").reverse().join(""),Ct,Vt]})),ve={text:u,x:v,y:U,options:J,mutex:{pdfEscape:qr,activeFontKey:ze,fonts:ht,activeFontSize:Ne}},et.publish("postProcessText",ve),u=ve.text,Qt=ve.mutex.isHex||!1;var Ss=ht[ze].encoding;Ss!=="WinAnsiEncoding"&&Ss!=="StandardEncoding"||(u=Hi(u,function(_t,Ct,Vt){return[En(_t),Ct,Vt]})),Ae=xs(u),u=[];for(var Yn,Kn,Xn,ji=Array.isArray(Ae[0])?1:0,Zn="",Ai=function(_t,Ct,Vt){var rr="";return Vt instanceof tt?(Vt=typeof J.angle=="number"?_n(Vt,new tt(1,0,0,1,_t,Ct)):_n(new tt(1,0,0,1,_t,Ct),Vt),H===X&&(Vt=_n(new tt(1,0,0,-1,0,0),Vt)),rr=Vt.join(" ")+` Tm
`):rr=C(_t)+" "+C(Ct)+` Td
`,rr},Hr=0;Hr<Ae.length;Hr++){switch(Zn="",ji){case 1:Xn=(Qt?"<":"(")+Ae[Hr][0]+(Qt?">":")"),Yn=parseFloat(Ae[Hr][1]),Kn=parseFloat(Ae[Hr][2]);break;case 0:Xn=(Qt?"<":"(")+Ae[Hr]+(Qt?">":")"),Yn=Sn(v),Kn=Ln(U)}$n!==void 0&&$n[Hr]!==void 0&&(Zn=$n[Hr]+` Tw
`),Hr===0?u.push(Zn+Ai(Yn,Kn,Zt)+Xn):ji===0?u.push(Zn+Xn):ji===1&&u.push(Zn+Ai(Yn,Kn,Zt)+Xn)}u=ji===0?u.join(` Tj
T* `):u.join(` Tj
`),u+=` Tj
`;var gn=`BT
/`;return gn+=ze+" "+Ne+` Tf
`,gn+=C(Ne*Fn)+` TL
`,gn+=gi+`
`,gn+=cr,gn+=u,E(gn+="ET"),S[ze]=!0,Ot};var Qa=p.__private__.clip=p.clip=function(u){return E(u==="evenodd"?"W*":"W"),this};p.clipEvenOdd=function(){return Qa("evenodd")},p.__private__.discardPath=p.discardPath=function(){return E("n"),this};var dn=p.__private__.isValidStyle=function(u){var v=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(u)!==-1&&(v=!0),v};p.__private__.setDefaultPathOperation=p.setDefaultPathOperation=function(u){return dn(u)&&(g=u),this};var Ks=p.__private__.getStyle=p.getStyle=function(u){var v=g;switch(u){case"D":case"S":v="S";break;case"F":v="f";break;case"FD":case"DF":v="B";break;case"f":case"f*":case"B":case"B*":v=u}return v},Xs=p.close=function(){return E("h"),this};p.stroke=function(){return E("S"),this},p.fill=function(u){return qi("f",u),this},p.fillEvenOdd=function(u){return qi("f*",u),this},p.fillStroke=function(u){return qi("B",u),this},p.fillStrokeEvenOdd=function(u){return qi("B*",u),this};var qi=function(u,v){Ft(v)==="object"?to(v,u):E(u)},fi=function(u){u===null||H===X&&u===void 0||(u=Ks(u),E(u))};function eo(u,v,U,J,te){var ve=new Qi(v||this.boundingBox,U||this.xStep,J||this.yStep,this.gState,te||this.matrix);ve.stream=this.stream;var Ae=u+"$$"+this.cloneIndex+++"$$";return Rr(Ae,ve),ve}var to=function(u,v){var U=ae[u.key],J=Ze[U];if(J instanceof ki)E("q"),E(ro(v)),J.gState&&p.setGState(J.gState),E(u.matrix.toString()+" cm"),E("/"+U+" sh"),E("Q");else if(J instanceof Qi){var te=new tt(1,0,0,-1,0,xi());u.matrix&&(te=te.multiply(u.matrix||jn),U=eo.call(J,u.key,u.boundingBox,u.xStep,u.yStep,te).id),E("q"),E("/Pattern cs"),E("/"+U+" scn"),J.gState&&p.setGState(J.gState),E(v),E("Q")}},ro=function(u){switch(u){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},cs=p.moveTo=function(u,v){return E(C(G(u))+" "+C($(v))+" m"),this},Zs=p.lineTo=function(u,v){return E(C(G(u))+" "+C($(v))+" l"),this},Kr=p.curveTo=function(u,v,U,J,te,ve){return E([C(G(u)),C($(v)),C(G(U)),C($(J)),C(G(te)),C($(ve)),"c"].join(" ")),this};p.__private__.line=p.line=function(u,v,U,J,te){if(isNaN(u)||isNaN(v)||isNaN(U)||isNaN(J)||!dn(te))throw new Error("Invalid arguments passed to jsPDF.line");return H===K?this.lines([[U-u,J-v]],u,v,[1,1],te||"S"):this.lines([[U-u,J-v]],u,v,[1,1]).stroke()},p.__private__.lines=p.lines=function(u,v,U,J,te,ve){var Ae,Ve,Ye,at,ft,wt,Bt,Zt,Ot,tr,Qt,cr;if(typeof u=="number"&&(cr=U,U=v,v=u,u=cr),J=J||[1,1],ve=ve||!1,isNaN(v)||isNaN(U)||!Array.isArray(u)||!Array.isArray(J)||!dn(te)||typeof ve!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(cs(v,U),Ae=J[0],Ve=J[1],at=u.length,tr=v,Qt=U,Ye=0;Ye<at;Ye++)(ft=u[Ye]).length===2?(tr=ft[0]*Ae+tr,Qt=ft[1]*Ve+Qt,Zs(tr,Qt)):(wt=ft[0]*Ae+tr,Bt=ft[1]*Ve+Qt,Zt=ft[2]*Ae+tr,Ot=ft[3]*Ve+Qt,tr=ft[4]*Ae+tr,Qt=ft[5]*Ve+Qt,Kr(wt,Bt,Zt,Ot,tr,Qt));return ve&&Xs(),fi(te),this},p.path=function(u){for(var v=0;v<u.length;v++){var U=u[v],J=U.c;switch(U.op){case"m":cs(J[0],J[1]);break;case"l":Zs(J[0],J[1]);break;case"c":Kr.apply(this,J);break;case"h":Xs()}}return this},p.__private__.rect=p.rect=function(u,v,U,J,te){if(isNaN(u)||isNaN(v)||isNaN(U)||isNaN(J)||!dn(te))throw new Error("Invalid arguments passed to jsPDF.rect");return H===K&&(J=-J),E([C(G(u)),C($(v)),C(G(U)),C(G(J)),"re"].join(" ")),fi(te),this},p.__private__.triangle=p.triangle=function(u,v,U,J,te,ve,Ae){if(isNaN(u)||isNaN(v)||isNaN(U)||isNaN(J)||isNaN(te)||isNaN(ve)||!dn(Ae))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[U-u,J-v],[te-U,ve-J],[u-te,v-ve]],u,v,[1,1],Ae,!0),this},p.__private__.roundedRect=p.roundedRect=function(u,v,U,J,te,ve,Ae){if(isNaN(u)||isNaN(v)||isNaN(U)||isNaN(J)||isNaN(te)||isNaN(ve)||!dn(Ae))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var Ve=4/3*(Math.SQRT2-1);return te=Math.min(te,.5*U),ve=Math.min(ve,.5*J),this.lines([[U-2*te,0],[te*Ve,0,te,ve-ve*Ve,te,ve],[0,J-2*ve],[0,ve*Ve,-te*Ve,ve,-te,ve],[2*te-U,0],[-te*Ve,0,-te,-ve*Ve,-te,-ve],[0,2*ve-J],[0,-ve*Ve,te*Ve,-ve,te,-ve]],u+te,v,[1,1],Ae,!0),this},p.__private__.ellipse=p.ellipse=function(u,v,U,J,te){if(isNaN(u)||isNaN(v)||isNaN(U)||isNaN(J)||!dn(te))throw new Error("Invalid arguments passed to jsPDF.ellipse");var ve=4/3*(Math.SQRT2-1)*U,Ae=4/3*(Math.SQRT2-1)*J;return cs(u+U,v),Kr(u+U,v-Ae,u+ve,v-J,u,v-J),Kr(u-ve,v-J,u-U,v-Ae,u-U,v),Kr(u-U,v+Ae,u-ve,v+J,u,v+J),Kr(u+ve,v+J,u+U,v+Ae,u+U,v),fi(te),this},p.__private__.circle=p.circle=function(u,v,U,J){if(isNaN(u)||isNaN(v)||isNaN(U)||!dn(J))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(u,v,U,U,J)},p.setFont=function(u,v,U){return U&&(v=pe(v,U)),ze=$s(u,v,{disableWarning:!1}),this};var no=p.__private__.getFont=p.getFont=function(){return ht[$s.apply(p,arguments)]};p.__private__.getFontList=p.getFontList=function(){var u,v,U={};for(u in dt)if(dt.hasOwnProperty(u))for(v in U[u]=[],dt[u])dt[u].hasOwnProperty(v)&&U[u].push(v);return U},p.addFont=function(u,v,U,J,te){var ve=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&ve.indexOf(arguments[3])!==-1?te=arguments[3]:arguments[3]&&ve.indexOf(arguments[3])==-1&&(U=pe(U,J)),zs.call(this,u,v,U,te=te||"Identity-H")};var pi,us=e.lineWidth||.200025,io=p.__private__.getLineWidth=p.getLineWidth=function(){return us},ot=p.__private__.setLineWidth=p.setLineWidth=function(u){return us=u,E(C(G(u))+" w"),this};p.__private__.setLineDash=Ke.API.setLineDash=Ke.API.setLineDashPattern=function(u,v){if(u=u||[],v=v||0,isNaN(v)||!Array.isArray(u))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return u=u.map(function(U){return C(G(U))}).join(" "),v=C(G(v)),E("["+u+"] "+v+" d"),this};var so=p.__private__.getLineHeight=p.getLineHeight=function(){return Ne*pi};p.__private__.getLineHeight=p.getLineHeight=function(){return Ne*pi};var ao=p.__private__.setLineHeightFactor=p.setLineHeightFactor=function(u){return typeof(u=u||1.15)=="number"&&(pi=u),this},oo=p.__private__.getLineHeightFactor=p.getLineHeightFactor=function(){return pi};ao(e.lineHeight);var Sn=p.__private__.getHorizontalCoordinate=function(u){return G(u)},Ln=p.__private__.getVerticalCoordinate=function(u){return H===X?u:Me[I].mediaBox.topRightY-Me[I].mediaBox.bottomLeftY-G(u)},lo=p.__private__.getHorizontalCoordinateString=p.getHorizontalCoordinateString=function(u){return C(Sn(u))},co=p.__private__.getVerticalCoordinateString=p.getVerticalCoordinateString=function(u){return C(Ln(u))},Ui=e.strokeColor||"0 G";p.__private__.getStrokeColor=p.getDrawColor=function(){return ln(Ui)},p.__private__.setStrokeColor=p.setDrawColor=function(u,v,U,J){return Ui=Jr({ch1:u,ch2:v,ch3:U,ch4:J,pdfColorType:"draw",precision:2}),E(Ui),this};var hs=e.fillColor||"0 g";p.__private__.getFillColor=p.getFillColor=function(){return ln(hs)},p.__private__.setFillColor=p.setFillColor=function(u,v,U,J){return hs=Jr({ch1:u,ch2:v,ch3:U,ch4:J,pdfColorType:"fill",precision:2}),E(hs),this};var gi=e.textColor||"0 g",uo=p.__private__.getTextColor=p.getTextColor=function(){return ln(gi)};p.__private__.setTextColor=p.setTextColor=function(u,v,U,J){return gi=Jr({ch1:u,ch2:v,ch3:U,ch4:J,pdfColorType:"text",precision:3}),this};var kn=e.charSpace,ho=p.__private__.getCharSpace=p.getCharSpace=function(){return parseFloat(kn||0)};p.__private__.setCharSpace=p.setCharSpace=function(u){if(isNaN(u))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return kn=u,this};var ds=0;p.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},p.__private__.setLineCap=p.setLineCap=function(u){var v=p.CapJoinStyles[u];if(v===void 0)throw new Error("Line cap style of '"+u+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return ds=v,E(v+" J"),this};var fs=0;p.__private__.setLineJoin=p.setLineJoin=function(u){var v=p.CapJoinStyles[u];if(v===void 0)throw new Error("Line join style of '"+u+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return fs=v,E(v+" j"),this},p.__private__.setLineMiterLimit=p.__private__.setMiterLimit=p.setLineMiterLimit=p.setMiterLimit=function(u){if(u=u||0,isNaN(u))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return E(C(G(u))+" M"),this},p.GState=za,p.setGState=function(u){(u=typeof u=="string"?_e[Fe[u]]:Qs(null,u)).equals(Pe)||(E("/"+u.id+" gs"),Pe=u)};var Qs=function(u,v){if(!u||!Fe[u]){var U=!1;for(var J in _e)if(_e.hasOwnProperty(J)&&_e[J].equals(v)){U=!0;break}if(U)v=_e[J];else{var te="GS"+(Object.keys(_e).length+1).toString(10);_e[te]=v,v.id=te}return u&&(Fe[u]=v.id),et.publish("addGState",v),v}};p.addGState=function(u,v){return Qs(u,v),this},p.saveGraphicsState=function(){return E("q"),kt.push({key:ze,size:Ne,color:gi}),this},p.restoreGraphicsState=function(){E("Q");var u=kt.pop();return ze=u.key,Ne=u.size,gi=u.color,Pe=null,this},p.setCurrentTransformationMatrix=function(u){return E(u.toString()+" cm"),this},p.comment=function(u){return E("#"+u),this};var Cn=function(u,v){var U=u||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return U},set:function(ve){isNaN(ve)||(U=parseFloat(ve))}});var J=v||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return J},set:function(ve){isNaN(ve)||(J=parseFloat(ve))}});var te="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return te},set:function(ve){te=ve.toString()}}),this},ps=function(u,v,U,J){Cn.call(this,u,v),this.type="rect";var te=U||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return te},set:function(Ae){isNaN(Ae)||(te=parseFloat(Ae))}});var ve=J||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return ve},set:function(Ae){isNaN(Ae)||(ve=parseFloat(Ae))}}),this},zi=function(){this.page=Be,this.currentPage=I,this.pages=ye.slice(0),this.pagesContext=Me.slice(0),this.x=He,this.y=Et,this.matrix=bt,this.width=ms(I),this.height=ta(I),this.outputDestination=Ce,this.id="",this.objectNumber=-1};zi.prototype.restore=function(){Be=this.page,I=this.currentPage,Me=this.pagesContext,ye=this.pages,He=this.x,Et=this.y,bt=this.matrix,ea(I,this.width),Pn(I,this.height),Ce=this.outputDestination};var gs=function(u,v,U,J,te){on.push(new zi),Be=I=0,ye=[],He=u,Et=v,bt=te,os([U,J])};for(var mi in p.beginFormObject=function(u,v,U,J,te){return gs(u,v,U,J,te),this},p.endFormObject=function(u){return function(v){if(Nn[v])on.pop().restore();else{var U=new zi,J="Xo"+(Object.keys(pr).length+1).toString(10);U.id=J,Nn[v]=J,pr[J]=U,et.publish("addFormObject",U),on.pop().restore()}}(u),this},p.doFormObject=function(u,v){var U=pr[Nn[u]];return E("q"),E(v.toString()+" cm"),E("/"+U.id+" Do"),E("Q"),this},p.getFormObject=function(u){var v=pr[Nn[u]];return{x:v.x,y:v.y,width:v.width,height:v.height,matrix:v.matrix}},p.save=function(u,v){return u=u||"generated.pdf",(v=v||{}).returnPromise=v.returnPromise||!1,v.returnPromise===!1?(Li(Bi(hn()),u),typeof Li.unload=="function"&&st.setTimeout&&setTimeout(Li.unload,911),this):new Promise(function(U,J){try{var te=Li(Bi(hn()),u);typeof Li.unload=="function"&&st.setTimeout&&setTimeout(Li.unload,911),U(te)}catch(ve){J(ve.message)}})},Ke.API)Ke.API.hasOwnProperty(mi)&&(mi==="events"&&Ke.API.events.length?function(u,v){var U,J,te;for(te=v.length-1;te!==-1;te--)U=v[te][0],J=v[te][1],u.subscribe.apply(u,[U].concat(typeof J=="function"?[J]:J))}(et,Ke.API.events):p[mi]=Ke.API[mi]);function ms(u){return Me[u].mediaBox.topRightX-Me[u].mediaBox.bottomLeftX}function ea(u,v){Me[u].mediaBox.topRightX=v+Me[u].mediaBox.bottomLeftX}function ta(u){return Me[u].mediaBox.topRightY-Me[u].mediaBox.bottomLeftY}function Pn(u,v){Me[u].mediaBox.topRightY=v+Me[u].mediaBox.bottomLeftY}var In=p.getPageWidth=function(u){return ms(u=u||I)/nt},ra=p.setPageWidth=function(u,v){ea(u,v*nt)},xi=p.getPageHeight=function(u){return ta(u=u||I)/nt},na=p.setPageHeight=function(u,v){Pn(u,v*nt)};return p.internal={pdfEscape:qr,getStyle:Ks,getFont:no,getFontSize:Te,getCharSpace:ho,getTextColor:uo,getLineHeight:so,getLineHeightFactor:oo,getLineWidth:io,write:Ie,getHorizontalCoordinate:Sn,getVerticalCoordinate:Ln,getCoordinateString:lo,getVerticalCoordinateString:co,collections:{},newObject:qt,newAdditionalObject:ui,newObjectDeferred:ar,newObjectDeferredBegin:lr,getFilters:Yr,putStream:Br,events:et,scaleFactor:nt,pageSize:{getWidth:function(){return In(I)},setWidth:function(u){ra(I,u)},getHeight:function(){return xi(I)},setHeight:function(u){na(I,u)}},encryptionOptions:m,encryption:er,getEncryptor:function(u){return m!==null?er.encryptor(u,0):function(v){return v}},output:Js,getNumberOfPages:Vs,get pages(){return ye},out:E,f2:j,f3:P,getPageInfo:An,getPageInfoByObjId:Ys,getCurrentPageInfo:Za,getPDFVersion:N,Point:Cn,Rectangle:ps,Matrix:tt,hasHotfix:Ur},Object.defineProperty(p.internal.pageSize,"width",{get:function(){return In(I)},set:function(u){ra(I,u)},enumerable:!0,configurable:!0}),Object.defineProperty(p.internal.pageSize,"height",{get:function(){return xi(I)},set:function(u){na(I,u)},enumerable:!0,configurable:!0}),(function(u){for(var v=0,U=Re.length;v<U;v++){var J=zs.call(this,u[v][0],u[v][1],u[v][2],Re[v][3],!0);w===!1&&(S[J]=!0);var te=u[v][0].split("-");Us({id:J,fontName:te[0],fontStyle:te[1]||""})}et.publish("addFonts",{fonts:ht,dictionary:dt})}).call(p,Re),ze="F1",Hs(s,r),et.publish("initialized"),p}Xi.prototype.lsbFirstWord=function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)},Xi.prototype.toHexString=function(e){return e.split("").map(function(t){return("0"+(255&t.charCodeAt(0)).toString(16)).slice(-2)}).join("")},Xi.prototype.hexToBytes=function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(String.fromCharCode(parseInt(e.substr(r,2),16)));return t.join("")},Xi.prototype.processOwnerPassword=function(e,t){return al(sl(t).substr(0,5),e)},Xi.prototype.encryptor=function(e,t){var r=sl(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&t,t>>8&255)).substr(0,10);return function(n){return al(r,n)}},za.prototype.equals=function(e){var t,r="id,objectNumber,equals";if(!e||Ft(e)!==Ft(this))return!1;var n=0;for(t in this)if(!(r.indexOf(t)>=0)){if(this.hasOwnProperty(t)&&!e.hasOwnProperty(t)||this[t]!==e[t])return!1;n++}for(t in e)e.hasOwnProperty(t)&&r.indexOf(t)<0&&n--;return n===0},Ke.API={events:[]},Ke.version="4.1.0";var Ht=Ke.API,xl=1,Oi=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Yi=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Ha=function(e){return e.toString().replace(/#/g,"#23").replace(/[\s\n\r()<>[\]{}\/%]/g,function(t){var r=t.charCodeAt(0).toString(16).toUpperCase();return"#"+(r.length===1?"0"+r:r)})},lt=function(e){return e.toFixed(2)},ai=function(e){return e.toFixed(5)};Ht.__acroform__={};var Sr=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e},tu=function(e){return e*xl},xn=function(e){var t=new dh,r=We.internal.getHeight(e)||0,n=We.internal.getWidth(e)||0;return t.BBox=[0,0,Number(lt(n)),Number(lt(r))],t},a1=Ht.__acroform__.setBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return e|1<<t},o1=Ht.__acroform__.clearBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return e&~(1<<t)},l1=Ht.__acroform__.getBit=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return e&1<<t?1:0},Jt=Ht.__acroform__.getBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return l1(e,t-1)},Yt=Ht.__acroform__.setBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return a1(e,t-1)},Kt=Ht.__acroform__.clearBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return o1(e,t-1)},c1=Ht.__acroform__.calculateCoordinates=function(e,t){var r=t.internal.getHorizontalCoordinate,n=t.internal.getVerticalCoordinate,s=e[0],a=e[1],h=e[2],c=e[3],d={};return d.lowerLeft_X=r(s)||0,d.lowerLeft_Y=n(a+c)||0,d.upperRight_X=r(s+h)||0,d.upperRight_Y=n(a)||0,[Number(lt(d.lowerLeft_X)),Number(lt(d.lowerLeft_Y)),Number(lt(d.upperRight_X)),Number(lt(d.upperRight_Y))]},u1=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var t=[],r=e._V||e.DV,n=ol(e,r),s=e.scope.internal.getFont(e.fontName,e.fontStyle).id;t.push("/Tx BMC"),t.push("q"),t.push("BT"),t.push(e.scope.__private__.encodeColorString(e.color)),t.push("/"+s+" "+lt(n.fontSize)+" Tf"),t.push("1 0 0 1 0 0 Tm"),t.push(n.text),t.push("ET"),t.push("Q"),t.push("EMC");var a=xn(e);return a.scope=e.scope,a.stream=t.join(`
`),a}},ol=function(e,t){var r=e.fontSize===0?e.maxFontSize:e.fontSize,n={text:"",fontSize:""},s=(t=(t=t.substr(0,1)=="("?t.substr(1):t).substr(t.length-1)==")"?t.substr(0,t.length-1):t).split(" ");s=e.multiline?s.map(function(j){return j.split(`
`)}):s.map(function(j){return[j]});var a=r,h=We.internal.getHeight(e)||0;h=h<0?-h:h;var c=We.internal.getWidth(e)||0;c=c<0?-c:c;var d=function(j,P,G){if(j+1<s.length){var $=P+" "+s[j+1][0];return Ca($,e,G).width<=c-4}return!1};a++;e:for(;a>0;){t="",a--;var g,m,w=Ca("3",e,a).height,S=e.multiline?h-a:(h-w)/2,p=S+=2,O=0,N=0,T=0;if(a<=0){t=`(...) Tj
`,t+="% Width of Text: "+Ca(t,e,a=12).width+", FieldWidth:"+c+`
`;break}for(var L="",K=0,X=0;X<s.length;X++)if(s.hasOwnProperty(X)){var H=!1;if(s[X].length!==1&&T!==s[X].length-1){if((w+2)*(K+2)+2>h)continue e;L+=s[X][T],H=!0,N=X,X--}else{L=(L+=s[X][T]+" ").substr(L.length-1)==" "?L.substr(0,L.length-1):L;var Q=parseInt(X),he=d(Q,L,a),pe=X>=s.length-1;if(he&&!pe){L+=" ",T=0;continue}if(he||pe){if(pe)N=Q;else if(e.multiline&&(w+2)*(K+2)+2>h)continue e}else{if(!e.multiline||(w+2)*(K+2)+2>h)continue e;N=Q}}for(var C="",R=O;R<=N;R++){var ne=s[R];if(e.multiline){if(R===N){C+=ne[T]+" ",T=(T+1)%ne.length;continue}if(R===O){C+=ne[ne.length-1]+" ";continue}}C+=ne[0]+" "}switch(C=C.substr(C.length-1)==" "?C.substr(0,C.length-1):C,m=Ca(C,e,a).width,e.textAlign){case"right":g=c-m-2;break;case"center":g=(c-m)/2;break;default:g=2}t+=lt(g)+" "+lt(p)+` Td
`,t+="("+Oi(C)+`) Tj
`,t+=-lt(g)+` 0 Td
`,p=-(a+2),m=0,O=H?N:N+1,K++,L=""}break}return n.text=t,n.fontSize=a,n},Ca=function(e,t,r){var n=t.scope.internal.getFont(t.fontName,t.fontStyle),s=t.scope.getStringUnitWidth(e,{font:n,fontSize:parseFloat(r),charSpace:0})*parseFloat(r);return{height:t.scope.getStringUnitWidth("3",{font:n,fontSize:parseFloat(r),charSpace:0})*parseFloat(r)*1.5,width:s}},h1={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},d1=function(e,t){var r={type:"reference",object:e};t.internal.getPageInfo(e.page).pageContext.annotations.find(function(n){return n.type===r.type&&n.object===r.object})===void 0&&t.internal.getPageInfo(e.page).pageContext.annotations.push(r)},f1=function(e,t){if(t.scope=e,e.internal!==void 0&&(e.internal.acroformPlugin===void 0||e.internal.acroformPlugin.isInitialized===!1)){if(sn.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(h1)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");xl=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new fh,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe("postPutResources",function(){(function(r){r.internal.events.unsubscribe(r.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete r.internal.acroformPlugin.acroFormDictionaryRoot._eventID,r.internal.acroformPlugin.printedOut=!0})(e)}),e.internal.events.subscribe("buildDocument",function(){(function(r){r.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var n=r.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var s in n)if(n.hasOwnProperty(s)){var a=n[s];a.objId=void 0,a.hasAnnotation&&d1(a,r)}})(e)}),e.internal.events.subscribe("putCatalog",function(){(function(r){if(r.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");r.internal.write("/AcroForm "+r.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(e)}),e.internal.events.subscribe("postPutPages",function(r){(function(n,s){var a=!n;for(var h in n||(s.internal.newObjectDeferredBegin(s.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),s.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),n=n||s.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(n.hasOwnProperty(h)){var c=n[h],d=[],g=c.Rect;if(c.Rect&&(c.Rect=c1(c.Rect,s)),s.internal.newObjectDeferredBegin(c.objId,!0),c.DA=We.createDefaultAppearanceStream(c),Ft(c)==="object"&&typeof c.getKeyValueListForStream=="function"&&(d=c.getKeyValueListForStream()),c.Rect=g,c.hasAppearanceStream&&!c.appearanceStreamContent){var m=u1(c);d.push({key:"AP",value:"<</N "+m+">>"}),s.internal.acroformPlugin.xForms.push(m)}if(c.appearanceStreamContent){var w="";for(var S in c.appearanceStreamContent)if(c.appearanceStreamContent.hasOwnProperty(S)){var p=c.appearanceStreamContent[S];if(w+="/"+S+" ",w+="<<",Object.keys(p).length>=1||Array.isArray(p)){for(var h in p)if(p.hasOwnProperty(h)){var O=p[h];typeof O=="function"&&(O=O.call(s,c)),w+="/"+h+" "+O+" ",s.internal.acroformPlugin.xForms.indexOf(O)>=0||s.internal.acroformPlugin.xForms.push(O)}}else typeof(O=p)=="function"&&(O=O.call(s,c)),w+="/"+h+" "+O,s.internal.acroformPlugin.xForms.indexOf(O)>=0||s.internal.acroformPlugin.xForms.push(O);w+=">>"}d.push({key:"AP",value:`<<
`+w+">>"})}s.internal.putStream({additionalKeyValues:d,objectId:c.objId}),s.internal.out("endobj")}a&&function(N,T){for(var L in N)if(N.hasOwnProperty(L)){var K=L,X=N[L];T.internal.newObjectDeferredBegin(X.objId,!0),Ft(X)==="object"&&typeof X.putStream=="function"&&X.putStream(),delete N[K]}}(s.internal.acroformPlugin.xForms,s)})(r,e)}),e.internal.acroformPlugin.isInitialized=!0}},hh=Ht.__acroform__.arrayToPdfArray=function(e,t,r){var n=function(h){return h};if(Array.isArray(e)){for(var s="[",a=0;a<e.length;a++)switch(a!==0&&(s+=" "),Ft(e[a])){case"boolean":case"number":case"object":s+=e[a].toString();break;case"string":e[a].substr(0,1)==="/"?s+="/"+Ha(e[a].substr(1)):(t!==void 0&&r&&(n=r.internal.getEncryptor(t)),s+="("+Oi(n(e[a].toString()))+")")}return s+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},$o=function(e,t,r){var n=function(s){return s};return t!==void 0&&r&&(n=r.internal.getEncryptor(t)),(e=e||"").toString(),"("+Oi(n(e))+")"},bn=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(e){this._objId=e}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};bn.prototype.toString=function(){return this.objId+" 0 R"},bn.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out("endobj")},bn.prototype.getKeyValueListForStream=function(){var e=[],t=Object.getOwnPropertyNames(this).filter(function(a){return a!="content"&&a!="appearanceStreamContent"&&a!="scope"&&a!="objId"&&a.substring(0,1)!="_"});for(var r in t)if(Object.getOwnPropertyDescriptor(this,t[r]).configurable===!1){var n=t[r],s=this[n];s&&(Array.isArray(s)?e.push({key:n,value:hh(s,this.objId,this.scope)}):s instanceof bn?(s.scope=this.scope,e.push({key:n,value:s.objId+" 0 R"})):typeof s!="function"&&e.push({key:n,value:s}))}return e};var dh=function(){bn.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var e,t=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return t},set:function(r){t=r}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(r){e=r.trim()},get:function(){return e||null}})};Sr(dh,bn);var fh=function(){bn.call(this);var e,t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return t.length>0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var r=function(n){return n};return this.scope&&(r=this.scope.internal.getEncryptor(this.objId)),"("+Oi(r(e))+")"}},set:function(r){e=r}})};Sr(fh,bn);var sn=function e(){bn.call(this);var t=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(L){if(isNaN(L))throw new Error('Invalid value "'+L+'" for attribute F supplied.');t=L}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!Jt(t,3)},set:function(L){L?this.F=Yt(t,3):this.F=Kt(t,3)}});var r=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return r},set:function(L){if(isNaN(L))throw new Error('Invalid value "'+L+'" for attribute Ff supplied.');r=L}});var n=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(n.length!==0)return n},set:function(L){n=L!==void 0?L:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[0])?0:n[0]},set:function(L){n[0]=L}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[1])?0:n[1]},set:function(L){n[1]=L}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[2])?0:n[2]},set:function(L){n[2]=L}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[3])?0:n[3]},set:function(L){n[3]=L}});var s="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return s},set:function(L){switch(L){case"/Btn":case"/Tx":case"/Ch":case"/Sig":s=L;break;default:throw new Error('Invalid value "'+L+'" for attribute FT supplied.')}}});var a=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!a||a.length<1){if(this instanceof Wa)return;a="FieldObject"+e.FieldNum++}var L=function(K){return K};return this.scope&&(L=this.scope.internal.getEncryptor(this.objId)),"("+Oi(L(a))+")"},set:function(L){a=L.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return a},set:function(L){a=L}});var h="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return h},set:function(L){h=L}});var c="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return c},set:function(L){c=L}});var d=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return d},set:function(L){d=L}});var g=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return g===void 0?50/xl:g},set:function(L){g=L}});var m="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return m},set:function(L){m=L}});var w="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!w||this instanceof Wa||this instanceof Ci))return $o(w,this.objId,this.scope)},set:function(L){L=L.toString(),w=L}});var S=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(S)return this instanceof or==0?$o(S,this.objId,this.scope):S},set:function(L){L=L.toString(),S=this instanceof or==0?L.substr(0,1)==="("?Yi(L.substr(1,L.length-2)):Yi(L):L}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof or==1?Yi(S.substr(1,S.length-1)):S},set:function(L){L=L.toString(),S=this instanceof or==1?"/"+Ha(L):L}});var p=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(p)return p},set:function(L){this.V=L}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(p)return this instanceof or==0?$o(p,this.objId,this.scope):p},set:function(L){L=L.toString(),p=this instanceof or==0?L.substr(0,1)==="("?Yi(L.substr(1,L.length-2)):Yi(L):L}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof or==1?Yi(p.substr(1,p.length-1)):p},set:function(L){L=L.toString(),p=this instanceof or==1?"/"+Ha(L):L}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var O,N=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return N},set:function(L){L=!!L,N=L}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(O)return O},set:function(L){O=L}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!Jt(this.Ff,1)},set:function(L){L?this.Ff=Yt(this.Ff,1):this.Ff=Kt(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!Jt(this.Ff,2)},set:function(L){L?this.Ff=Yt(this.Ff,2):this.Ff=Kt(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!Jt(this.Ff,3)},set:function(L){L?this.Ff=Yt(this.Ff,3):this.Ff=Kt(this.Ff,3)}});var T=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(T!==null)return T},set:function(L){if([0,1,2].indexOf(L)===-1)throw new Error('Invalid value "'+L+'" for attribute Q supplied.');T=L}}),Object.defineProperty(this,"textAlign",{get:function(){var L;switch(T){case 0:default:L="left";break;case 1:L="center";break;case 2:L="right"}return L},configurable:!0,enumerable:!0,set:function(L){switch(L){case"right":case 2:T=2;break;case"center":case 1:T=1;break;default:T=0}}})};Sr(sn,bn);var es=function(){sn.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var e=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return e},set:function(r){e=r}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(r){e=r}});var t=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return hh(t,this.objId,this.scope)},set:function(r){var n,s;s=[],typeof(n=r)=="string"&&(s=function(a,h,c){c||(c=1);for(var d,g=[];d=h.exec(a);)g.push(d[c]);return g}(n,/\((.*?)\)/g)),t=s}}),this.getOptions=function(){return t},this.setOptions=function(r){t=r,this.sort&&t.sort()},this.addOption=function(r){r=(r=r||"").toString(),t.push(r),this.sort&&t.sort()},this.removeOption=function(r,n){for(n=n||!1,r=(r=r||"").toString();t.indexOf(r)!==-1&&(t.splice(t.indexOf(r),1),n!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!Jt(this.Ff,18)},set:function(r){r?this.Ff=Yt(this.Ff,18):this.Ff=Kt(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!Jt(this.Ff,19)},set:function(r){this.combo===!0&&(r?this.Ff=Yt(this.Ff,19):this.Ff=Kt(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!Jt(this.Ff,20)},set:function(r){r?(this.Ff=Yt(this.Ff,20),t.sort()):this.Ff=Kt(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!Jt(this.Ff,22)},set:function(r){r?this.Ff=Yt(this.Ff,22):this.Ff=Kt(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Jt(this.Ff,23)},set:function(r){r?this.Ff=Yt(this.Ff,23):this.Ff=Kt(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!Jt(this.Ff,27)},set:function(r){r?this.Ff=Yt(this.Ff,27):this.Ff=Kt(this.Ff,27)}}),this.hasAppearanceStream=!1};Sr(es,sn);var ts=function(){es.call(this),this.fontName="helvetica",this.combo=!1};Sr(ts,es);var rs=function(){ts.call(this),this.combo=!0};Sr(rs,ts);var Ta=function(){rs.call(this),this.edit=!0};Sr(Ta,rs);var or=function(){sn.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!Jt(this.Ff,15)},set:function(r){r?this.Ff=Yt(this.Ff,15):this.Ff=Kt(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!Jt(this.Ff,16)},set:function(r){r?this.Ff=Yt(this.Ff,16):this.Ff=Kt(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!Jt(this.Ff,17)},set:function(r){r?this.Ff=Yt(this.Ff,17):this.Ff=Kt(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!Jt(this.Ff,26)},set:function(r){r?this.Ff=Yt(this.Ff,26):this.Ff=Kt(this.Ff,26)}});var e,t={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var r=function(a){return a};if(this.scope&&(r=this.scope.internal.getEncryptor(this.objId)),Object.keys(t).length!==0){var n,s=[];for(n in s.push("<<"),t)s.push("/"+n+" ("+Oi(r(t[n]))+")");return s.push(">>"),s.join(`
`)}},set:function(r){Ft(r)==="object"&&(t=r)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return t.CA||""},set:function(r){typeof r=="string"&&(t.CA=r)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(r){e=r}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(r){e="/"+Ha(r)}})};Sr(or,sn);var Ma=function(){or.call(this),this.pushButton=!0};Sr(Ma,or);var ns=function(){or.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t!==void 0?t:[]}})};Sr(ns,or);var Wa=function(){var e,t;sn.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(s){e=s}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(s){t=s}});var r,n={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var s=function(c){return c};this.scope&&(s=this.scope.internal.getEncryptor(this.objId));var a,h=[];for(a in h.push("<<"),n)h.push("/"+a+" ("+Oi(s(n[a]))+")");return h.push(">>"),h.join(`
`)},set:function(s){Ft(s)==="object"&&(n=s)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(s){typeof s=="string"&&(n.CA=s)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return r},set:function(s){r=s}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return r.substr(1,r.length-1)},set:function(s){r="/"+s}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=We.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Sr(Wa,sn),ns.prototype.setAppearance=function(e){if(!("createAppearanceStream"in e)||!("getCA"in e))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var t in this.Kids)if(this.Kids.hasOwnProperty(t)){var r=this.Kids[t];r.appearanceStreamContent=e.createAppearanceStream(r.optionName),r.caption=e.getCA()}},ns.prototype.createOption=function(e){var t=new Wa;return t.Parent=this,t.optionName=e,this.Kids.push(t),p1.call(this.scope,t),t};var Ra=function(){or.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=We.CheckBox.createAppearanceStream()};Sr(Ra,or);var Ci=function(){sn.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!Jt(this.Ff,13)},set:function(t){t?this.Ff=Yt(this.Ff,13):this.Ff=Kt(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!Jt(this.Ff,21)},set:function(t){t?this.Ff=Yt(this.Ff,21):this.Ff=Kt(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Jt(this.Ff,23)},set:function(t){t?this.Ff=Yt(this.Ff,23):this.Ff=Kt(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!Jt(this.Ff,24)},set:function(t){t?this.Ff=Yt(this.Ff,24):this.Ff=Kt(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!Jt(this.Ff,25)},set:function(t){t?this.Ff=Yt(this.Ff,25):this.Ff=Kt(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!Jt(this.Ff,26)},set:function(t){t?this.Ff=Yt(this.Ff,26):this.Ff=Kt(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};Sr(Ci,sn);var Da=function(){Ci.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!Jt(this.Ff,14)},set:function(e){e?this.Ff=Yt(this.Ff,14):this.Ff=Kt(this.Ff,14)}}),this.password=!0};Sr(Da,Ci);var We={CheckBox:{createAppearanceStream:function(){return{N:{On:We.CheckBox.YesNormal},D:{On:We.CheckBox.YesPushDown,Off:We.CheckBox.OffPushDown}}},YesPushDown:function(e){var t=xn(e);t.scope=e.scope;var r=[],n=e.scope.internal.getFont(e.fontName,e.fontStyle).id,s=e.scope.__private__.encodeColorString(e.color),a=ol(e,e.caption);return r.push("0.749023 g"),r.push("0 0 "+lt(We.internal.getWidth(e))+" "+lt(We.internal.getHeight(e))+" re"),r.push("f"),r.push("BMC"),r.push("q"),r.push("0 0 1 rg"),r.push("/"+n+" "+lt(a.fontSize)+" Tf "+s),r.push("BT"),r.push(a.text),r.push("ET"),r.push("Q"),r.push("EMC"),t.stream=r.join(`
`),t},YesNormal:function(e){var t=xn(e);t.scope=e.scope;var r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color),s=[],a=We.internal.getHeight(e),h=We.internal.getWidth(e),c=ol(e,e.caption);return s.push("1 g"),s.push("0 0 "+lt(h)+" "+lt(a)+" re"),s.push("f"),s.push("q"),s.push("0 0 1 rg"),s.push("0 0 "+lt(h-1)+" "+lt(a-1)+" re"),s.push("W"),s.push("n"),s.push("0 g"),s.push("BT"),s.push("/"+r+" "+lt(c.fontSize)+" Tf "+n),s.push(c.text),s.push("ET"),s.push("Q"),t.stream=s.join(`
`),t},OffPushDown:function(e){var t=xn(e);t.scope=e.scope;var r=[];return r.push("0.749023 g"),r.push("0 0 "+lt(We.internal.getWidth(e))+" "+lt(We.internal.getHeight(e))+" re"),r.push("f"),t.stream=r.join(`
`),t}},RadioButton:{Circle:{createAppearanceStream:function(e){var t={D:{Off:We.RadioButton.Circle.OffPushDown},N:{}};return t.N[e]=We.RadioButton.Circle.YesNormal,t.D[e]=We.RadioButton.Circle.YesPushDown,t},getCA:function(){return"l"},YesNormal:function(e){var t=xn(e);t.scope=e.scope;var r=[],n=We.internal.getWidth(e)<=We.internal.getHeight(e)?We.internal.getWidth(e)/4:We.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var s=We.internal.Bezier_C,a=Number((n*s).toFixed(5));return r.push("q"),r.push("1 0 0 1 "+ai(We.internal.getWidth(e)/2)+" "+ai(We.internal.getHeight(e)/2)+" cm"),r.push(n+" 0 m"),r.push(n+" "+a+" "+a+" "+n+" 0 "+n+" c"),r.push("-"+a+" "+n+" -"+n+" "+a+" -"+n+" 0 c"),r.push("-"+n+" -"+a+" -"+a+" -"+n+" 0 -"+n+" c"),r.push(a+" -"+n+" "+n+" -"+a+" "+n+" 0 c"),r.push("f"),r.push("Q"),t.stream=r.join(`
`),t},YesPushDown:function(e){var t=xn(e);t.scope=e.scope;var r=[],n=We.internal.getWidth(e)<=We.internal.getHeight(e)?We.internal.getWidth(e)/4:We.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var s=Number((2*n).toFixed(5)),a=Number((s*We.internal.Bezier_C).toFixed(5)),h=Number((n*We.internal.Bezier_C).toFixed(5));return r.push("0.749023 g"),r.push("q"),r.push("1 0 0 1 "+ai(We.internal.getWidth(e)/2)+" "+ai(We.internal.getHeight(e)/2)+" cm"),r.push(s+" 0 m"),r.push(s+" "+a+" "+a+" "+s+" 0 "+s+" c"),r.push("-"+a+" "+s+" -"+s+" "+a+" -"+s+" 0 c"),r.push("-"+s+" -"+a+" -"+a+" -"+s+" 0 -"+s+" c"),r.push(a+" -"+s+" "+s+" -"+a+" "+s+" 0 c"),r.push("f"),r.push("Q"),r.push("0 g"),r.push("q"),r.push("1 0 0 1 "+ai(We.internal.getWidth(e)/2)+" "+ai(We.internal.getHeight(e)/2)+" cm"),r.push(n+" 0 m"),r.push(n+" "+h+" "+h+" "+n+" 0 "+n+" c"),r.push("-"+h+" "+n+" -"+n+" "+h+" -"+n+" 0 c"),r.push("-"+n+" -"+h+" -"+h+" -"+n+" 0 -"+n+" c"),r.push(h+" -"+n+" "+n+" -"+h+" "+n+" 0 c"),r.push("f"),r.push("Q"),t.stream=r.join(`
`),t},OffPushDown:function(e){var t=xn(e);t.scope=e.scope;var r=[],n=We.internal.getWidth(e)<=We.internal.getHeight(e)?We.internal.getWidth(e)/4:We.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var s=Number((2*n).toFixed(5)),a=Number((s*We.internal.Bezier_C).toFixed(5));return r.push("0.749023 g"),r.push("q"),r.push("1 0 0 1 "+ai(We.internal.getWidth(e)/2)+" "+ai(We.internal.getHeight(e)/2)+" cm"),r.push(s+" 0 m"),r.push(s+" "+a+" "+a+" "+s+" 0 "+s+" c"),r.push("-"+a+" "+s+" -"+s+" "+a+" -"+s+" 0 c"),r.push("-"+s+" -"+a+" -"+a+" -"+s+" 0 -"+s+" c"),r.push(a+" -"+s+" "+s+" -"+a+" "+s+" 0 c"),r.push("f"),r.push("Q"),t.stream=r.join(`
`),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:We.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=We.RadioButton.Cross.YesNormal,t.D[e]=We.RadioButton.Cross.YesPushDown,t},getCA:function(){return"8"},YesNormal:function(e){var t=xn(e);t.scope=e.scope;var r=[],n=We.internal.calculateCross(e);return r.push("q"),r.push("1 1 "+lt(We.internal.getWidth(e)-2)+" "+lt(We.internal.getHeight(e)-2)+" re"),r.push("W"),r.push("n"),r.push(lt(n.x1.x)+" "+lt(n.x1.y)+" m"),r.push(lt(n.x2.x)+" "+lt(n.x2.y)+" l"),r.push(lt(n.x4.x)+" "+lt(n.x4.y)+" m"),r.push(lt(n.x3.x)+" "+lt(n.x3.y)+" l"),r.push("s"),r.push("Q"),t.stream=r.join(`
`),t},YesPushDown:function(e){var t=xn(e);t.scope=e.scope;var r=We.internal.calculateCross(e),n=[];return n.push("0.749023 g"),n.push("0 0 "+lt(We.internal.getWidth(e))+" "+lt(We.internal.getHeight(e))+" re"),n.push("f"),n.push("q"),n.push("1 1 "+lt(We.internal.getWidth(e)-2)+" "+lt(We.internal.getHeight(e)-2)+" re"),n.push("W"),n.push("n"),n.push(lt(r.x1.x)+" "+lt(r.x1.y)+" m"),n.push(lt(r.x2.x)+" "+lt(r.x2.y)+" l"),n.push(lt(r.x4.x)+" "+lt(r.x4.y)+" m"),n.push(lt(r.x3.x)+" "+lt(r.x3.y)+" l"),n.push("s"),n.push("Q"),t.stream=n.join(`
`),t},OffPushDown:function(e){var t=xn(e);t.scope=e.scope;var r=[];return r.push("0.749023 g"),r.push("0 0 "+lt(We.internal.getWidth(e))+" "+lt(We.internal.getHeight(e))+" re"),r.push("f"),t.stream=r.join(`
`),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color);return"/"+t+" "+e.fontSize+" Tf "+r}};We.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=We.internal.getWidth(e),r=We.internal.getHeight(e),n=Math.min(t,r);return{x1:{x:(t-n)/2,y:(r-n)/2+n},x2:{x:(t-n)/2+n,y:(r-n)/2},x3:{x:(t-n)/2,y:(r-n)/2},x4:{x:(t-n)/2+n,y:(r-n)/2+n}}}},We.internal.getWidth=function(e){var t=0;return Ft(e)==="object"&&(t=tu(e.Rect[2])),t},We.internal.getHeight=function(e){var t=0;return Ft(e)==="object"&&(t=tu(e.Rect[3])),t};var p1=Ht.addField=function(e){if(f1(this,e),!(e instanceof sn))throw new Error("Invalid argument passed to jsPDF.addField.");var t;return(t=e).scope.internal.acroformPlugin.printedOut&&(t.scope.internal.acroformPlugin.printedOut=!1,t.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};Ht.AcroFormChoiceField=es,Ht.AcroFormListBox=ts,Ht.AcroFormComboBox=rs,Ht.AcroFormEditBox=Ta,Ht.AcroFormButton=or,Ht.AcroFormPushButton=Ma,Ht.AcroFormRadioButton=ns,Ht.AcroFormCheckBox=Ra,Ht.AcroFormTextField=Ci,Ht.AcroFormPasswordField=Da,Ht.AcroFormAppearance=We,Ht.AcroForm={ChoiceField:es,ListBox:ts,ComboBox:rs,EditBox:Ta,Button:or,PushButton:Ma,RadioButton:ns,CheckBox:Ra,TextField:Ci,PasswordField:Da,Appearance:We},Ke.AcroForm={ChoiceField:es,ListBox:ts,ComboBox:rs,EditBox:Ta,Button:or,PushButton:Ma,RadioButton:ns,CheckBox:Ra,TextField:Ci,PasswordField:Da,Appearance:We};Ke.AcroForm;function ph(e){return e.reduce(function(t,r,n){return t[r]=n,t},{})}(function(e){var t="addImage_";e.__addimage__={};var r="UNKNOWN",n={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},s=e.__addimage__.getImageFileTypeByImageData=function(j,P){var G,$,ue,fe,me,se=r;if((P=P||r)==="RGBA"||j.data!==void 0&&j.data instanceof Uint8ClampedArray&&"height"in j&&"width"in j)return"RGBA";if(he(j))for(me in n)for(ue=n[me],G=0;G<ue.length;G+=1){for(fe=!0,$=0;$<ue[G].length;$+=1)if(ue[G][$]!==void 0&&ue[G][$]!==j[$]){fe=!1;break}if(fe===!0){se=me;break}}else for(me in n)for(ue=n[me],G=0;G<ue.length;G+=1){for(fe=!0,$=0;$<ue[G].length;$+=1)if(ue[G][$]!==void 0&&ue[G][$]!==j.charCodeAt($)){fe=!1;break}if(fe===!0){se=me;break}}return se===r&&P!==r&&(se=P),se},a=function j(P){for(var G=this.internal.write,$=this.internal.putStream,ue=(0,this.internal.getFilters)();ue.indexOf("FlateEncode")!==-1;)ue.splice(ue.indexOf("FlateEncode"),1);P.objectId=this.internal.newObject();var fe=[];if(fe.push({key:"Type",value:"/XObject"}),fe.push({key:"Subtype",value:"/Image"}),fe.push({key:"Width",value:P.width}),fe.push({key:"Height",value:P.height}),P.colorSpace===L.INDEXED?fe.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(P.palette.length/3-1)+" "+("sMask"in P&&P.sMask!==void 0?P.objectId+2:P.objectId+1)+" 0 R]"}):(fe.push({key:"ColorSpace",value:"/"+P.colorSpace}),P.colorSpace===L.DEVICE_CMYK&&fe.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),fe.push({key:"BitsPerComponent",value:P.bitsPerComponent}),"decodeParameters"in P&&P.decodeParameters!==void 0&&fe.push({key:"DecodeParms",value:"<<"+P.decodeParameters+">>"}),"transparency"in P&&Array.isArray(P.transparency)&&P.transparency.length>0){for(var me="",se=0,ge=P.transparency.length;se<ge;se++)me+=P.transparency[se]+" "+P.transparency[se]+" ";fe.push({key:"Mask",value:"["+me+"]"})}P.sMask!==void 0&&fe.push({key:"SMask",value:P.objectId+1+" 0 R"});var W=P.filter!==void 0?["/"+P.filter]:void 0;if($({data:P.data,additionalKeyValues:fe,alreadyAppliedFilters:W,objectId:P.objectId}),G("endobj"),"sMask"in P&&P.sMask!==void 0){var M,b=(M=P.sMaskBitsPerComponent)!==null&&M!==void 0?M:P.bitsPerComponent,I={width:P.width,height:P.height,colorSpace:"DeviceGray",bitsPerComponent:b,data:P.sMask};"filter"in P&&(I.decodeParameters="/Predictor ".concat(P.predictor," /Colors 1 /BitsPerComponent ").concat(b," /Columns ").concat(P.width),I.filter=P.filter),j.call(this,I)}if(P.colorSpace===L.INDEXED){var D=this.internal.newObject();$({data:C(new Uint8Array(P.palette)),objectId:D}),G("endobj")}},h=function(){var j=this.internal.collections[t+"images"];for(var P in j)a.call(this,j[P])},c=function(){var j,P=this.internal.collections[t+"images"],G=this.internal.write;for(var $ in P)G("/I"+(j=P[$]).index,j.objectId,"0","R")},d=function(){this.internal.collections[t+"images"]||(this.internal.collections[t+"images"]={},this.internal.events.subscribe("putResources",h),this.internal.events.subscribe("putXobjectDict",c))},g=function(){var j=this.internal.collections[t+"images"];return d.call(this),j},m=function(){return Object.keys(this.internal.collections[t+"images"]).length},w=function(j){return typeof e["process"+j.toUpperCase()]=="function"},S=function(j){return Ft(j)==="object"&&j.nodeType===1},p=function(j,P){if(j.nodeName==="IMG"&&j.hasAttribute("src")){var G=""+j.getAttribute("src");if(G.indexOf("data:image/")===0)return Oa(unescape(G).split("base64,").pop());var $=e.loadFile(G,!0);if($!==void 0)return $}if(j.nodeName==="CANVAS"){if(j.width===0||j.height===0)throw new Error("Given canvas must have data. Canvas width: "+j.width+", height: "+j.height);var ue;switch(P){case"PNG":ue="image/png";break;case"WEBP":ue="image/webp";break;default:ue="image/jpeg"}return Oa(j.toDataURL(ue,1).split("base64,").pop())}},O=function(j){var P=this.internal.collections[t+"images"];if(P){for(var G in P)if(j===P[G].alias)return P[G]}},N=function(j,P,G){return j||P||(j=-96,P=-96),j<0&&(j=-1*G.width*72/j/this.internal.scaleFactor),P<0&&(P=-1*G.height*72/P/this.internal.scaleFactor),j===0&&(j=P*G.width/G.height),P===0&&(P=j*G.height/G.width),[j,P]},T=function(j,P,G,$,ue,fe){var me=N.call(this,G,$,ue),se=this.internal.getCoordinateString,ge=this.internal.getVerticalCoordinateString,W=g.call(this);if(G=me[0],$=me[1],W[ue.index]=ue,fe){fe*=Math.PI/180;var M=Math.cos(fe),b=Math.sin(fe),I=function(z){return z.toFixed(4)},D=[I(M),I(b),I(-1*b),I(M),0,0,"cm"]}this.internal.write("q"),fe?(this.internal.write([1,"0","0",1,se(j),ge(P+$),"cm"].join(" ")),this.internal.write(D.join(" ")),this.internal.write([se(G),"0","0",se($),"0","0","cm"].join(" "))):this.internal.write([se(G),"0","0",se($),se(j),ge(P+$),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+ue.index+" Do"),this.internal.write("Q")},L=e.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};e.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var K=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},X=e.__addimage__.sHashCode=function(j){var P,G,$=0;if(typeof j=="string")for(G=j.length,P=0;P<G;P++)$=($<<5)-$+j.charCodeAt(P),$|=0;else if(he(j))for(G=j.byteLength/2,P=0;P<G;P++)$=($<<5)-$+j[P],$|=0;return $},H=e.__addimage__.validateStringAsBase64=function(j){(j=j||"").toString().trim();var P=!0;return j.length===0&&(P=!1),j.length%4!=0&&(P=!1),/^[A-Za-z0-9+/]+$/.test(j.substr(0,j.length-2))===!1&&(P=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(j.substr(-2))===!1&&(P=!1),P},Q=e.__addimage__.extractImageFromDataUrl=function(j){if(j==null||!(j=j.trim()).startsWith("data:"))return null;var P=j.indexOf(",");return P<0?null:j.substring(0,P).trim().endsWith("base64")?j.substring(P+1):null};e.__addimage__.isArrayBuffer=function(j){return j instanceof ArrayBuffer};var he=e.__addimage__.isArrayBufferView=function(j){return j instanceof Int8Array||j instanceof Uint8Array||j instanceof Uint8ClampedArray||j instanceof Int16Array||j instanceof Uint16Array||j instanceof Int32Array||j instanceof Uint32Array||j instanceof Float32Array||j instanceof Float64Array},pe=e.__addimage__.binaryStringToUint8Array=function(j){for(var P=j.length,G=new Uint8Array(P),$=0;$<P;$++)G[$]=j.charCodeAt($);return G},C=e.__addimage__.arrayBufferToBinaryString=function(j){for(var P="",G=he(j)?j:new Uint8Array(j),$=0;$<G.length;$+=8192)P+=String.fromCharCode.apply(null,G.subarray($,$+8192));return P};e.addImage=function(){var j,P,G,$,ue,fe,me,se,ge;if(typeof arguments[1]=="number"?(P=r,G=arguments[1],$=arguments[2],ue=arguments[3],fe=arguments[4],me=arguments[5],se=arguments[6],ge=arguments[7]):(P=arguments[1],G=arguments[2],$=arguments[3],ue=arguments[4],fe=arguments[5],me=arguments[6],se=arguments[7],ge=arguments[8]),Ft(j=arguments[0])==="object"&&!S(j)&&"imageData"in j){var W=j;j=W.imageData,P=W.format||P||r,G=W.x||G||0,$=W.y||$||0,ue=W.w||W.width||ue,fe=W.h||W.height||fe,me=W.alias||me,se=W.compression||se,ge=W.rotation||W.angle||ge}var M=this.internal.getFilters();if(se===void 0&&M.indexOf("FlateEncode")!==-1&&(se="SLOW"),isNaN(G)||isNaN($))throw new Error("Invalid coordinates passed to jsPDF.addImage");d.call(this);var b=R.call(this,j,P,me,se);return T.call(this,G,$,ue,fe,b,ge),this};var R=function(j,P,G,$){var ue,fe,me;if(typeof j=="string"&&s(j)===r){j=unescape(j);var se=ne(j,!1);(se!==""||(se=e.loadFile(j,!0))!==void 0)&&(j=se)}if(S(j)&&(j=p(j,P)),P=s(j,P),!w(P))throw new Error("addImage does not support files of type '"+P+"', please ensure that a plugin for '"+P+"' support is added.");if(((me=G)==null||me.length===0)&&(G=function(ge){return typeof ge=="string"||he(ge)?X(ge):he(ge.data)?X(ge.data):null}(j)),(ue=O.call(this,G))||(j instanceof Uint8Array||P==="RGBA"||(fe=j,j=pe(j)),ue=this["process"+P.toUpperCase()](j,m.call(this),G,function(ge){return ge&&typeof ge=="string"&&(ge=ge.toUpperCase()),ge in e.image_compression?ge:K.NONE}($),fe)),!ue)throw new Error("An unknown error occurred whilst processing the image.");return ue},ne=e.__addimage__.convertBase64ToBinaryString=function(j,P){P=typeof P!="boolean"||P;var G,$="";if(typeof j=="string"){var ue;G=(ue=Q(j))!==null&&ue!==void 0?ue:j;try{$=Oa(G)}catch(fe){if(P)throw H(G)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+fe.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return $};e.getImageProperties=function(j){var P,G,$="";if(S(j)&&(j=p(j)),typeof j=="string"&&s(j)===r&&(($=ne(j,!1))===""&&($=e.loadFile(j)||""),j=$),G=s(j),!w(G))throw new Error("addImage does not support files of type '"+G+"', please ensure that a plugin for '"+G+"' support is added.");if(j instanceof Uint8Array||(j=pe(j)),!(P=this["process"+G.toUpperCase()](j)))throw new Error("An unknown error occurred whilst processing the image");return P.fileType=G,P}})(Ke.API),function(e){var t=function(r){if(r!==void 0&&r!="")return!0};Ke.API.events.push(["addPage",function(r){this.internal.getPageInfo(r.pageNumber).pageContext.annotations=[]}]),e.events.push(["putPage",function(r){for(var n,s,a,h=this.internal.getCoordinateString,c=this.internal.getVerticalCoordinateString,d=this.internal.getPageInfoByObjId(r.objId),g=r.pageContext.annotations,m=!1,w=0;w<g.length&&!m;w++)switch((n=g[w]).type){case"link":(t(n.options.url)||t(n.options.pageNumber))&&(m=!0);break;case"reference":case"text":case"freetext":m=!0}if(m!=0){this.internal.write("/Annots [");for(var S=0;S<g.length;S++){n=g[S];var p=this.internal.pdfEscape,O=this.internal.getEncryptor(r.objId);switch(n.type){case"reference":this.internal.write(" "+n.object.objId+" 0 R ");break;case"text":var N=this.internal.newAdditionalObject(),T=this.internal.newAdditionalObject(),L=this.internal.getEncryptor(N.objId),K=n.title||"Note";a="<</Type /Annot /Subtype /Text "+(s="/Rect ["+h(n.bounds.x)+" "+c(n.bounds.y+n.bounds.h)+" "+h(n.bounds.x+n.bounds.w)+" "+c(n.bounds.y)+"] ")+"/Contents ("+p(L(n.contents))+")",a+=" /Popup "+T.objId+" 0 R",a+=" /P "+d.objId+" 0 R",a+=" /T ("+p(L(K))+") >>",N.content=a;var X=N.objId+" 0 R";a="<</Type /Annot /Subtype /Popup "+(s="/Rect ["+h(n.bounds.x+30)+" "+c(n.bounds.y+n.bounds.h)+" "+h(n.bounds.x+n.bounds.w+30)+" "+c(n.bounds.y)+"] ")+" /Parent "+X,n.open&&(a+=" /Open true"),a+=" >>",T.content=a,this.internal.write(N.objId,"0 R",T.objId,"0 R");break;case"freetext":s="/Rect ["+h(n.bounds.x)+" "+c(n.bounds.y)+" "+h(n.bounds.x+n.bounds.w)+" "+c(n.bounds.y+n.bounds.h)+"] ";var H=n.color||"#000000";a="<</Type /Annot /Subtype /FreeText "+s+"/Contents ("+p(O(n.contents))+")",a+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+H+")",a+=" /Border [0 0 0]",a+=" >>",this.internal.write(a);break;case"link":if(n.options.name){var Q=this.annotations._nameMap[n.options.name];n.options.pageNumber=Q.page,n.options.top=Q.y}else n.options.top||(n.options.top=0);if(s="/Rect ["+n.finalBounds.x+" "+n.finalBounds.y+" "+n.finalBounds.w+" "+n.finalBounds.h+"] ",a="",n.options.url)a="<</Type /Annot /Subtype /Link "+s+"/Border [0 0 0] /A <</S /URI /URI ("+p(O(n.options.url))+") >>";else if(n.options.pageNumber)switch(a="<</Type /Annot /Subtype /Link "+s+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(n.options.pageNumber).objId+" 0 R",n.options.magFactor=n.options.magFactor||"XYZ",n.options.magFactor){case"Fit":a+=" /Fit]";break;case"FitH":a+=" /FitH "+n.options.top+"]";break;case"FitV":n.options.left=n.options.left||0,a+=" /FitV "+n.options.left+"]";break;default:var he=c(n.options.top);n.options.left=n.options.left||0,n.options.zoom===void 0&&(n.options.zoom=0),a+=" /XYZ "+n.options.left+" "+he+" "+n.options.zoom+"]"}a!=""&&(a+=" >>",this.internal.write(a))}}this.internal.write("]")}}]),e.createAnnotation=function(r){var n=this.internal.getCurrentPageInfo();switch(r.type){case"link":this.link(r.bounds.x,r.bounds.y,r.bounds.w,r.bounds.h,r);break;case"text":case"freetext":n.pageContext.annotations.push(r)}},e.link=function(r,n,s,a,h){var c=this.internal.getCurrentPageInfo(),d=this.internal.getCoordinateString,g=this.internal.getVerticalCoordinateString;c.pageContext.annotations.push({finalBounds:{x:d(r),y:g(n),w:d(r+s),h:g(n+a)},options:h,type:"link"})},e.textWithLink=function(r,n,s,a){var h,c,d=this.getTextWidth(r),g=this.internal.getLineHeight()/this.internal.scaleFactor;if(a.maxWidth!==void 0){c=a.maxWidth;var m=this.splitTextToSize(r,c).length;h=Math.ceil(g*m)}else c=d,h=g;return this.text(r,n,s,a),s+=.2*g,a.align==="center"&&(n-=d/2),a.align==="right"&&(n-=d),this.link(n,s-g,c,h,a),d},e.getTextWidth=function(r){var n=this.internal.getFontSize();return this.getStringUnitWidth(r)*n/this.internal.scaleFactor}}(Ke.API),function(e){var t={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},r={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},n={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},s=[1570,1571,1573,1575];e.__arabicParser__={};var a=e.__arabicParser__.isInArabicSubstitutionA=function(N){return t[N.charCodeAt(0)]!==void 0},h=e.__arabicParser__.isArabicLetter=function(N){return typeof N=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(N)},c=e.__arabicParser__.isArabicEndLetter=function(N){return h(N)&&a(N)&&t[N.charCodeAt(0)].length<=2},d=e.__arabicParser__.isArabicAlfLetter=function(N){return h(N)&&s.indexOf(N.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(N){return h(N)&&a(N)&&t[N.charCodeAt(0)].length>=1};var g=e.__arabicParser__.arabicLetterHasFinalForm=function(N){return h(N)&&a(N)&&t[N.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(N){return h(N)&&a(N)&&t[N.charCodeAt(0)].length>=3};var m=e.__arabicParser__.arabicLetterHasMedialForm=function(N){return h(N)&&a(N)&&t[N.charCodeAt(0)].length==4},w=e.__arabicParser__.resolveLigatures=function(N){var T=0,L=r,K="",X=0;for(T=0;T<N.length;T+=1)L[N.charCodeAt(T)]!==void 0?(X++,typeof(L=L[N.charCodeAt(T)])=="number"&&(K+=String.fromCharCode(L),L=r,X=0),T===N.length-1&&(L=r,K+=N.charAt(T-(X-1)),T-=X-1,X=0)):(L=r,K+=N.charAt(T-X),T-=X,X=0);return K};e.__arabicParser__.isArabicDiacritic=function(N){return N!==void 0&&n[N.charCodeAt(0)]!==void 0};var S=e.__arabicParser__.getCorrectForm=function(N,T,L){return h(N)?a(N)===!1?-1:!g(N)||!h(T)&&!h(L)||!h(L)&&c(T)||c(N)&&!h(T)||c(N)&&d(T)||c(N)&&c(T)?0:m(N)&&h(T)&&!c(T)&&h(L)&&g(L)?3:c(N)||!h(L)?1:2:-1},p=function(N){var T=0,L=0,K=0,X="",H="",Q="",he=(N=N||"").split("\\s+"),pe=[];for(T=0;T<he.length;T+=1){for(pe.push(""),L=0;L<he[T].length;L+=1)X=he[T][L],H=he[T][L-1],Q=he[T][L+1],h(X)?(K=S(X,H,Q),pe[T]+=K!==-1?String.fromCharCode(t[X.charCodeAt(0)][K]):X):pe[T]+=X;pe[T]=w(pe[T])}return pe.join(" ")},O=e.__arabicParser__.processArabic=e.processArabic=function(){var N,T=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,L=[];if(Array.isArray(T)){var K=0;for(L=[],K=0;K<T.length;K+=1)Array.isArray(T[K])?L.push([p(T[K][0]),T[K][1],T[K][2]]):L.push([p(T[K])]);N=L}else N=p(T);return typeof arguments[0]=="string"?N:(arguments[0].text=N,arguments[0])};e.events.push(["preProcessText",O])}(Ke.API),Ke.API.autoPrint=function(e){var t;return(e=e||{}).variant=e.variant||"non-conform",e.variant==="javascript"?this.addJS("print({});"):(this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+t+" 0 R")})),this},function(e){var t=function(){var r=void 0;Object.defineProperty(this,"pdf",{get:function(){return r},set:function(c){r=c}});var n=150;Object.defineProperty(this,"width",{get:function(){return n},set:function(c){n=isNaN(c)||Number.isInteger(c)===!1||c<0?150:c,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=n+1)}});var s=300;Object.defineProperty(this,"height",{get:function(){return s},set:function(c){s=isNaN(c)||Number.isInteger(c)===!1||c<0?300:c,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=s+1)}});var a=[];Object.defineProperty(this,"childNodes",{get:function(){return a},set:function(c){a=c}});var h={};Object.defineProperty(this,"style",{get:function(){return h},set:function(c){h=c}}),Object.defineProperty(this,"parentNode",{})};t.prototype.getContext=function(r,n){var s;if((r=r||"2d")!=="2d")return null;for(s in n)this.pdf.context2d.hasOwnProperty(s)&&(this.pdf.context2d[s]=n[s]);return this.pdf.context2d._canvas=this,this.pdf.context2d},t.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new t,this.canvas.pdf=this}])}(Ke.API),function(e){var t={left:0,top:0,bottom:0,right:0},r=!1,n=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},t),this.internal.__cell__.margins.width=this.getPageWidth(),s.call(this))},s=function(){this.internal.__cell__.lastCell=new a,this.internal.__cell__.pages=1},a=function(){var d=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return d},set:function(N){d=N}});var g=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return g},set:function(N){g=N}});var m=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return m},set:function(N){m=N}});var w=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return w},set:function(N){w=N}});var S=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return S},set:function(N){S=N}});var p=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return p},set:function(N){p=N}});var O=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return O},set:function(N){O=N}}),this};a.prototype.clone=function(){return new a(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},a.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},e.setHeaderFunction=function(d){return n.call(this),this.internal.__cell__.headerFunction=typeof d=="function"?d:void 0,this},e.getTextDimensions=function(d,g){n.call(this);var m=(g=g||{}).fontSize||this.getFontSize(),w=g.font||this.getFont(),S=g.scaleFactor||this.internal.scaleFactor,p=0,O=0,N=0,T=this;if(!Array.isArray(d)&&typeof d!="string"){if(typeof d!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");d=String(d)}var L=g.maxWidth;L>0?typeof d=="string"?d=this.splitTextToSize(d,L):Object.prototype.toString.call(d)==="[object Array]"&&(d=d.reduce(function(X,H){return X.concat(T.splitTextToSize(H,L))},[])):d=Array.isArray(d)?d:[d];for(var K=0;K<d.length;K++)p<(N=this.getStringUnitWidth(d[K],{font:w})*m)&&(p=N);return p!==0&&(O=d.length),{w:p/=S,h:Math.max((O*m*this.getLineHeightFactor()-m*(this.getLineHeightFactor()-1))/S,0)}},e.cellAddPage=function(){n.call(this),this.addPage();var d=this.internal.__cell__.margins||t;return this.internal.__cell__.lastCell=new a(d.left,d.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var h=e.cell=function(){var d;d=arguments[0]instanceof a?arguments[0]:new a(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]),n.call(this);var g=this.internal.__cell__.lastCell,m=this.internal.__cell__.padding,w=this.internal.__cell__.margins||t,S=this.internal.__cell__.tableHeaderRow,p=this.internal.__cell__.printHeaders;return g.lineNumber!==void 0&&(g.lineNumber===d.lineNumber?(d.x=(g.x||0)+(g.width||0),d.y=g.y||0):g.y+g.height+d.height+w.bottom>this.getPageHeight()?(this.cellAddPage(),d.y=w.top,p&&S&&(this.printHeaderRow(d.lineNumber,!0),d.y+=S[0].height)):d.y=g.y+g.height||d.y),d.text[0]!==void 0&&(this.rect(d.x,d.y,d.width,d.height,r===!0?"FD":void 0),d.align==="right"?this.text(d.text,d.x+d.width-m,d.y+m,{align:"right",baseline:"top"}):d.align==="center"?this.text(d.text,d.x+d.width/2,d.y+m,{align:"center",baseline:"top",maxWidth:d.width-m-m}):this.text(d.text,d.x+m,d.y+m,{align:"left",baseline:"top",maxWidth:d.width-m-m})),this.internal.__cell__.lastCell=d,this};e.table=function(d,g,m,w,S){if(n.call(this),!m)throw new Error("No data for PDF table.");var p,O,N,T,L=[],K=[],X=[],H={},Q={},he=[],pe=[],C=(S=S||{}).autoSize||!1,R=S.printHeaders!==!1,ne=S.css&&S.css["font-size"]!==void 0?16*S.css["font-size"]:S.fontSize||12,j=S.margins||Object.assign({width:this.getPageWidth()},t),P=typeof S.padding=="number"?S.padding:3,G=S.headerBackgroundColor||"#c8c8c8",$=S.headerTextColor||"#000";if(s.call(this),this.internal.__cell__.printHeaders=R,this.internal.__cell__.margins=j,this.internal.__cell__.table_font_size=ne,this.internal.__cell__.padding=P,this.internal.__cell__.headerBackgroundColor=G,this.internal.__cell__.headerTextColor=$,this.setFontSize(ne),w==null)K=L=Object.keys(m[0]),X=L.map(function(){return"left"});else if(Array.isArray(w)&&Ft(w[0])==="object")for(L=w.map(function(W){return W.name}),K=w.map(function(W){return W.prompt||W.name||""}),X=w.map(function(W){return W.align||"left"}),p=0;p<w.length;p+=1)Q[w[p].name]=.7499990551181103*w[p].width;else Array.isArray(w)&&typeof w[0]=="string"&&(K=L=w,X=L.map(function(){return"left"}));if(C||Array.isArray(w)&&typeof w[0]=="string")for(p=0;p<L.length;p+=1){for(H[T=L[p]]=m.map(function(W){return W[T]}),this.setFont(void 0,"bold"),he.push(this.getTextDimensions(K[p],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),O=H[T],this.setFont(void 0,"normal"),N=0;N<O.length;N+=1)he.push(this.getTextDimensions(O[N],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);Q[T]=Math.max.apply(null,he)+P+P,he=[]}if(R){var ue={};for(p=0;p<L.length;p+=1)ue[L[p]]={},ue[L[p]].text=K[p],ue[L[p]].align=X[p];var fe=c.call(this,ue,Q);pe=L.map(function(W){return new a(d,g,Q[W],fe,ue[W].text,void 0,ue[W].align)}),this.setTableHeaderRow(pe),this.printHeaderRow(1,!1)}var me=w.reduce(function(W,M){return W[M.name]=M.align,W},{});for(p=0;p<m.length;p+=1){"rowStart"in S&&S.rowStart instanceof Function&&S.rowStart({row:p,data:m[p]},this);var se=c.call(this,m[p],Q);for(N=0;N<L.length;N+=1){var ge=m[p][L[N]];"cellStart"in S&&S.cellStart instanceof Function&&S.cellStart({row:p,col:N,data:ge},this),h.call(this,new a(d,g,Q[L[N]],se,ge,p+2,me[L[N]]))}}return this.internal.__cell__.table_x=d,this.internal.__cell__.table_y=g,this};var c=function(d,g){var m=this.internal.__cell__.padding,w=this.internal.__cell__.table_font_size,S=this.internal.scaleFactor;return Object.keys(d).map(function(p){var O=d[p];return this.splitTextToSize(O.hasOwnProperty("text")?O.text:O,g[p]-m-m)},this).map(function(p){return this.getLineHeightFactor()*p.length*w/S+m+m},this).reduce(function(p,O){return Math.max(p,O)},0)};e.setTableHeaderRow=function(d){n.call(this),this.internal.__cell__.tableHeaderRow=d},e.printHeaderRow=function(d,g){if(n.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var m;if(r=!0,typeof this.internal.__cell__.headerFunction=="function"){var w=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new a(w[0],w[1],w[2],w[3],void 0,-1)}this.setFont(void 0,"bold");for(var S=[],p=0;p<this.internal.__cell__.tableHeaderRow.length;p+=1){m=this.internal.__cell__.tableHeaderRow[p].clone(),g&&(m.y=this.internal.__cell__.margins.top||0,S.push(m)),m.lineNumber=d;var O=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),h.call(this,m),this.setTextColor(O)}S.length>0&&this.setTableHeaderRow(S),this.setFont(void 0,"normal"),r=!1}}(Ke.API);var gh={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},mh=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],ll=ph(mh),xh=[100,200,300,400,500,600,700,800,900],g1=ph(xh);function Go(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),r=function(a){return gh[a=a||"normal"]?a:"normal"}(e.style),n=function(a){return a?typeof a=="number"?a>=100&&a<=900&&a%100==0?a:400:/^\d00$/.test(a)?parseInt(a):a==="bold"?700:400:400}(e.weight),s=function(a){return typeof ll[a=a||"normal"]=="number"?a:"normal"}(e.stretch);return{family:t,style:r,weight:n,stretch:s,src:e.src||[],ref:e.ref||{name:t,style:[s,r,n].join(" ")}}}function ru(e,t,r,n){var s;for(s=r;s>=0&&s<t.length;s+=n)if(e[t[s]])return e[t[s]];for(s=r;s>=0&&s<t.length;s-=n)if(e[t[s]])return e[t[s]]}var m1={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},nu={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function iu(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function su(e){return e.trimLeft()}function x1(e,t){for(var r=0;r<e.length;){if(e.charAt(r)===t)return[e.substring(0,r),e.substring(r+1)];r+=1}return null}function b1(e){var t=e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return t===null?null:[t[0],e.substring(t[0].length)]}var Ki,Pa,au,ou,lu,Jo=["times"];function cu(e,t,r,n,s){var a=4,h=hu;switch(s){case Ke.API.image_compression.FAST:a=1,h=uu;break;case Ke.API.image_compression.MEDIUM:a=6,h=du;break;case Ke.API.image_compression.SLOW:a=9,h=fu}e=function(d,g,m,w){for(var S,p=d.length/g,O=new Uint8Array(d.length+p),N=[v1,uu,hu,du,fu],T=0;T<p;T+=1){var L=T*g,K=d.subarray(L,L+g);if(w)O.set(w(K,m,S),L+T);else{for(var X=N.length,H=[],Q=0;Q<X;Q+=1)H[Q]=N[Q](K,m,S);var he=w1(H.concat());O.set(H[he],L+T)}S=K}return O}(e,t,Math.ceil(r*n/8),h);var c=tl(e,{level:a});return Ke.API.__addimage__.arrayBufferToBinaryString(c)}function v1(e){var t=Array.apply([],e);return t.unshift(0),t}function uu(e,t){var r=e.length,n=[];n[0]=1;for(var s=0;s<r;s+=1){var a=e[s-t]||0;n[s+1]=e[s]-a+256&255}return n}function hu(e,t,r){var n=e.length,s=[];s[0]=2;for(var a=0;a<n;a+=1){var h=r&&r[a]||0;s[a+1]=e[a]-h+256&255}return s}function du(e,t,r){var n=e.length,s=[];s[0]=3;for(var a=0;a<n;a+=1){var h=e[a-t]||0,c=r&&r[a]||0;s[a+1]=e[a]+256-(h+c>>>1)&255}return s}function fu(e,t,r){var n=e.length,s=[];s[0]=4;for(var a=0;a<n;a+=1){var h=y1(e[a-t]||0,r&&r[a]||0,r&&r[a-t]||0);s[a+1]=e[a]-h+256&255}return s}function y1(e,t,r){if(e===t&&t===r)return e;var n=Math.abs(t-r),s=Math.abs(e-r),a=Math.abs(e+t-r-r);return n<=s&&n<=a?e:s<=a?t:r}function w1(e){var t=e.map(function(r){return r.reduce(function(n,s){return n+Math.abs(s)},0)});return t.indexOf(Math.min.apply(null,t))}function Yo(e,t,r){var n=t*r,s=Math.floor(n/8),a=16-(n-8*s+r),h=(1<<r)-1;return bh(e,s)>>a&h}function pu(e,t,r,n){var s=r*n,a=Math.floor(s/8),h=16-(s-8*a+n),c=(1<<n)-1,d=(t&c)<<h;(function(g,m,w){if(m+1<g.byteLength)g.setUint16(m,w,!1);else{var S=w>>8&255;g.setUint8(m,S)}})(e,a,bh(e,a)&~(c<<h)&65535|d)}function bh(e,t){return t+1<e.byteLength?e.getUint16(t,!1):e.getUint8(t)<<8}function N1(e){var t=0;if(e[t++]!==71||e[t++]!==73||e[t++]!==70||e[t++]!==56||(e[t++]+1&253)!=56||e[t++]!==97)throw new Error("Invalid GIF 87a/89a header.");var r=e[t++]|e[t++]<<8,n=e[t++]|e[t++]<<8,s=e[t++],a=s>>7,h=1<<1+(7&s);e[t++],e[t++];var c=null,d=null;a&&(c=t,d=h,t+=3*h);var g=!0,m=[],w=0,S=null,p=0,O=null;for(this.width=r,this.height=n;g&&t<e.length;)switch(e[t++]){case 33:switch(e[t++]){case 255:if(e[t]!==11||e[t+1]==78&&e[t+2]==69&&e[t+3]==84&&e[t+4]==83&&e[t+5]==67&&e[t+6]==65&&e[t+7]==80&&e[t+8]==69&&e[t+9]==50&&e[t+10]==46&&e[t+11]==48&&e[t+12]==3&&e[t+13]==1&&e[t+16]==0)t+=14,O=e[t++]|e[t++]<<8,t++;else for(t+=12;;){if(!((j=e[t++])>=0))throw Error("Invalid block size");if(j===0)break;t+=j}break;case 249:if(e[t++]!==4||e[t+4]!==0)throw new Error("Invalid graphics extension block.");var N=e[t++];w=e[t++]|e[t++]<<8,S=e[t++],1&N||(S=null),p=N>>2&7,t++;break;case 254:for(;;){if(!((j=e[t++])>=0))throw Error("Invalid block size");if(j===0)break;t+=j}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var T=e[t++]|e[t++]<<8,L=e[t++]|e[t++]<<8,K=e[t++]|e[t++]<<8,X=e[t++]|e[t++]<<8,H=e[t++],Q=H>>6&1,he=1<<1+(7&H),pe=c,C=d,R=!1;H>>7&&(R=!0,pe=t,C=he,t+=3*he);var ne=t;for(t++;;){var j;if(!((j=e[t++])>=0))throw Error("Invalid block size");if(j===0)break;t+=j}m.push({x:T,y:L,width:K,height:X,has_local_palette:R,palette_offset:pe,palette_size:C,data_offset:ne,data_length:t-ne,transparent_index:S,interlaced:!!Q,delay:w,disposal:p});break;case 59:g=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return m.length},this.loopCount=function(){return O},this.frameInfo=function(P){if(P<0||P>=m.length)throw new Error("Frame index out of range.");return m[P]},this.decodeAndBlitFrameBGRA=function(P,G){var $=this.frameInfo(P),ue=$.width*$.height,fe=new Uint8Array(ue);gu(e,$.data_offset,fe,ue);var me=$.palette_offset,se=$.transparent_index;se===null&&(se=256);var ge=$.width,W=r-ge,M=ge,b=4*($.y*r+$.x),I=4*(($.y+$.height)*r+$.x),D=b,z=4*W;$.interlaced===!0&&(z+=4*r*7);for(var V=8,Y=0,re=fe.length;Y<re;++Y){var oe=fe[Y];if(M===0&&(M=ge,(D+=z)>=I&&(z=4*W+4*r*(V-1),D=b+(ge+W)*(V<<1),V>>=1)),oe===se)D+=4;else{var de=e[me+3*oe],ye=e[me+3*oe+1],je=e[me+3*oe+2];G[D++]=je,G[D++]=ye,G[D++]=de,G[D++]=255}--M}},this.decodeAndBlitFrameRGBA=function(P,G){var $=this.frameInfo(P),ue=$.width*$.height,fe=new Uint8Array(ue);gu(e,$.data_offset,fe,ue);var me=$.palette_offset,se=$.transparent_index;se===null&&(se=256);var ge=$.width,W=r-ge,M=ge,b=4*($.y*r+$.x),I=4*(($.y+$.height)*r+$.x),D=b,z=4*W;$.interlaced===!0&&(z+=4*r*7);for(var V=8,Y=0,re=fe.length;Y<re;++Y){var oe=fe[Y];if(M===0&&(M=ge,(D+=z)>=I&&(z=4*W+4*r*(V-1),D=b+(ge+W)*(V<<1),V>>=1)),oe===se)D+=4;else{var de=e[me+3*oe],ye=e[me+3*oe+1],je=e[me+3*oe+2];G[D++]=de,G[D++]=ye,G[D++]=je,G[D++]=255}--M}}}function gu(e,t,r,n){for(var s=e[t++],a=1<<s,h=a+1,c=h+1,d=s+1,g=(1<<d)-1,m=0,w=0,S=0,p=e[t++],O=new Int32Array(4096),N=null;;){for(;m<16&&p!==0;)w|=e[t++]<<m,m+=8,p===1?p=e[t++]:--p;if(m<d)break;var T=w&g;if(w>>=d,m-=d,T!==a){if(T===h)break;for(var L=T<c?T:N,K=0,X=L;X>a;)X=O[X]>>8,++K;var H=X;if(S+K+(L!==T?1:0)>n)return void It.log("Warning, gif stream longer than expected.");r[S++]=H;var Q=S+=K;for(L!==T&&(r[S++]=H),X=L;K--;)X=O[X],r[--Q]=255&X,X>>=8;N!==null&&c<4096&&(O[c++]=N<<8|H,c>=g+1&&d<12&&(++d,g=g<<1|1)),N=T}else c=h+1,g=(1<<(d=s+1))-1,N=null}return S!==n&&It.log("Warning, gif stream shorter than expected."),r}/**
 * @license
  Copyright (c) 2008, Adobe Systems Incorporated
  All rights reserved.

  Redistribution and use in source and binary forms, with or without 
  modification, are permitted provided that the following conditions are
  met:

  * Redistributions of source code must retain the above copyright notice, 
    this list of conditions and the following disclaimer.
  
  * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the 
    documentation and/or other materials provided with the distribution.
  
  * Neither the name of Adobe Systems Incorporated nor the names of its 
    contributors may be used to endorse or promote products derived from 
    this software without specific prior written permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/function Ko(e){var t,r,n,s,a,h=Math.floor,c=new Array(64),d=new Array(64),g=new Array(64),m=new Array(64),w=new Array(65535),S=new Array(65535),p=new Array(64),O=new Array(64),N=[],T=0,L=7,K=new Array(64),X=new Array(64),H=new Array(64),Q=new Array(256),he=new Array(2048),pe=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],C=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],R=[0,1,2,3,4,5,6,7,8,9,10,11],ne=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],j=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],P=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],G=[0,1,2,3,4,5,6,7,8,9,10,11],$=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],ue=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function fe(b,I){for(var D=0,z=0,V=new Array,Y=1;Y<=16;Y++){for(var re=1;re<=b[Y];re++)V[I[z]]=[],V[I[z]][0]=D,V[I[z]][1]=Y,z++,D++;D*=2}return V}function me(b){for(var I=b[0],D=b[1]-1;D>=0;)I&1<<D&&(T|=1<<L),D--,--L<0&&(T==255?(se(255),se(0)):se(T),L=7,T=0)}function se(b){N.push(b)}function ge(b){se(b>>8&255),se(255&b)}function W(b,I,D,z,V){for(var Y,re=V[0],oe=V[240],de=function(Ne,De){var Te,qe,Je,Ee,ut,rt,xt,mt,ze,nt,He=0;for(ze=0;ze<8;++ze){Te=Ne[He],qe=Ne[He+1],Je=Ne[He+2],Ee=Ne[He+3],ut=Ne[He+4],rt=Ne[He+5],xt=Ne[He+6];var Et=Te+(mt=Ne[He+7]),bt=Te-mt,ht=qe+xt,dt=qe-xt,kt=Je+rt,Ze=Je-rt,ae=Ee+ut,_e=Ee-ut,Fe=Et+ae,Pe=Et-ae,Be=ht+kt,Me=ht-kt;Ne[He]=Fe+Be,Ne[He+4]=Fe-Be;var et=.707106781*(Me+Pe);Ne[He+2]=Pe+et,Ne[He+6]=Pe-et;var wn=.382683433*((Fe=_e+Ze)-(Me=dt+bt)),pr=.5411961*Fe+wn,Nn=1.306562965*Me+wn,on=.707106781*(Be=Ze+dt),tt=bt+on,_n=bt-on;Ne[He+5]=_n+pr,Ne[He+3]=_n-pr,Ne[He+1]=tt+Nn,Ne[He+7]=tt-Nn,He+=8}for(He=0,ze=0;ze<8;++ze){Te=Ne[He],qe=Ne[He+8],Je=Ne[He+16],Ee=Ne[He+24],ut=Ne[He+32],rt=Ne[He+40],xt=Ne[He+48];var jn=Te+(mt=Ne[He+56]),Rr=Te-mt,Dr=qe+xt,qt=qe-xt,ar=Je+rt,lr=Je-rt,ui=Ee+ut,Hn=Ee-ut,Gr=jn+ui,ln=jn-ui,Jr=Dr+ar,Yr=Dr-ar;Ne[He]=Gr+Jr,Ne[He+32]=Gr-Jr;var Br=.707106781*(Yr+ln);Ne[He+16]=ln+Br,Ne[He+48]=ln-Br;var hi=.382683433*((Gr=Hn+lr)-(Yr=qt+Rr)),cn=.5411961*Gr+hi,di=1.306562965*Yr+hi,Ti=.707106781*(Jr=lr+qt),Mi=Rr+Ti,Ri=Rr-Ti;Ne[He+40]=Ri+cn,Ne[He+24]=Ri-cn,Ne[He+8]=Mi+di,Ne[He+56]=Mi-di,He++}for(ze=0;ze<64;++ze)nt=Ne[ze]*De[ze],p[ze]=nt>0?nt+.5|0:nt-.5|0;return p}(b,I),ye=0;ye<64;++ye)O[pe[ye]]=de[ye];var je=O[0]-D;D=O[0],je==0?me(z[0]):(me(z[S[Y=32767+je]]),me(w[Y]));for(var Ce=63;Ce>0&&O[Ce]==0;)Ce--;if(Ce==0)return me(re),D;for(var ke,E=1;E<=Ce;){for(var Ie=E;O[E]==0&&E<=Ce;)++E;var Qe=E-Ie;if(Qe>=16){ke=Qe>>4;for(var Re=1;Re<=ke;++Re)me(oe);Qe&=15}Y=32767+O[E],me(V[(Qe<<4)+S[Y]]),me(w[Y]),E++}return Ce!=63&&me(re),D}function M(b){b=Math.min(Math.max(b,1),100),a!=b&&(function(I){for(var D=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],z=0;z<64;z++){var V=h((D[z]*I+50)/100);V=Math.min(Math.max(V,1),255),c[pe[z]]=V}for(var Y=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],re=0;re<64;re++){var oe=h((Y[re]*I+50)/100);oe=Math.min(Math.max(oe,1),255),d[pe[re]]=oe}for(var de=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],ye=0,je=0;je<8;je++)for(var Ce=0;Ce<8;Ce++)g[ye]=1/(c[pe[ye]]*de[je]*de[Ce]*8),m[ye]=1/(d[pe[ye]]*de[je]*de[Ce]*8),ye++}(b<50?Math.floor(5e3/b):Math.floor(200-2*b)),a=b)}this.encode=function(b,I){I&&M(I),N=new Array,T=0,L=7,ge(65496),ge(65504),ge(16),se(74),se(70),se(73),se(70),se(0),se(1),se(1),se(0),ge(1),ge(1),se(0),se(0),function(){ge(65499),ge(132),se(0);for(var qe=0;qe<64;qe++)se(c[qe]);se(1);for(var Je=0;Je<64;Je++)se(d[Je])}(),function(qe,Je){ge(65472),ge(17),se(8),ge(Je),ge(qe),se(3),se(1),se(17),se(0),se(2),se(17),se(1),se(3),se(17),se(1)}(b.width,b.height),function(){ge(65476),ge(418),se(0);for(var qe=0;qe<16;qe++)se(C[qe+1]);for(var Je=0;Je<=11;Je++)se(R[Je]);se(16);for(var Ee=0;Ee<16;Ee++)se(ne[Ee+1]);for(var ut=0;ut<=161;ut++)se(j[ut]);se(1);for(var rt=0;rt<16;rt++)se(P[rt+1]);for(var xt=0;xt<=11;xt++)se(G[xt]);se(17);for(var mt=0;mt<16;mt++)se($[mt+1]);for(var ze=0;ze<=161;ze++)se(ue[ze])}(),ge(65498),ge(12),se(3),se(1),se(0),se(2),se(17),se(3),se(17),se(0),se(63),se(0);var D=0,z=0,V=0;T=0,L=7,this.encode.displayName="_encode_";for(var Y,re,oe,de,ye,je,Ce,ke,E,Ie=b.data,Qe=b.width,Re=b.height,Ne=4*Qe,De=0;De<Re;){for(Y=0;Y<Ne;){for(ye=Ne*De+Y,Ce=-1,ke=0,E=0;E<64;E++)je=ye+(ke=E>>3)*Ne+(Ce=4*(7&E)),De+ke>=Re&&(je-=Ne*(De+1+ke-Re)),Y+Ce>=Ne&&(je-=Y+Ce-Ne+4),re=Ie[je++],oe=Ie[je++],de=Ie[je++],K[E]=(he[re]+he[oe+256|0]+he[de+512|0]>>16)-128,X[E]=(he[re+768|0]+he[oe+1024|0]+he[de+1280|0]>>16)-128,H[E]=(he[re+1280|0]+he[oe+1536|0]+he[de+1792|0]>>16)-128;D=W(K,g,D,t,n),z=W(X,m,z,r,s),V=W(H,m,V,r,s),Y+=32}De+=8}if(L>=0){var Te=[];Te[1]=L+1,Te[0]=(1<<L+1)-1,me(Te)}return ge(65497),new Uint8Array(N)},e=e||50,function(){for(var b=String.fromCharCode,I=0;I<256;I++)Q[I]=b(I)}(),t=fe(C,R),r=fe(P,G),n=fe(ne,j),s=fe($,ue),function(){for(var b=1,I=2,D=1;D<=15;D++){for(var z=b;z<I;z++)S[32767+z]=D,w[32767+z]=[],w[32767+z][1]=D,w[32767+z][0]=z;for(var V=-(I-1);V<=-b;V++)S[32767+V]=D,w[32767+V]=[],w[32767+V][1]=D,w[32767+V][0]=I-1+V;b<<=1,I<<=1}}(),function(){for(var b=0;b<256;b++)he[b]=19595*b,he[b+256|0]=38470*b,he[b+512|0]=7471*b+32768,he[b+768|0]=-11059*b,he[b+1024|0]=-21709*b,he[b+1280|0]=32768*b+8421375,he[b+1536|0]=-27439*b,he[b+1792|0]=-5329*b}(),M(e)}/**
 * @license
 * Copyright (c) 2017 Aras Abbasi
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */function tn(e,t){if(this.pos=0,this.buffer=e,this.datav=new DataView(e.buffer),this.is_with_alpha=!!t,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function mu(e){function t(R){if(!R)throw Error("assert :P")}function r(R,ne,j){for(var P=0;4>P;P++)if(R[ne+P]!=j.charCodeAt(P))return!0;return!1}function n(R,ne,j,P,G){for(var $=0;$<G;$++)R[ne+$]=j[P+$]}function s(R,ne,j,P){for(var G=0;G<P;G++)R[ne+G]=j}function a(R){return new Int32Array(R)}function h(R,ne){for(var j=[],P=0;P<R;P++)j.push(new ne);return j}function c(R,ne){var j=[];return function P(G,$,ue){for(var fe=ue[$],me=0;me<fe&&(G.push(ue.length>$+1?[]:new ne),!(ue.length<$+1));me++)P(G[me],$+1,ue)}(j,0,R),j}var d=function(){var R=this;function ne(i,l){for(var f=1<<l-1>>>0;i&f;)f>>>=1;return f?(i&f-1)+f:i}function j(i,l,f,x,y){t(!(x%f));do i[l+(x-=f)]=y;while(0<x)}function P(i,l,f,x,y){if(t(2328>=y),512>=y)var _=a(512);else if((_=a(y))==null)return 0;return function(A,k,F,B,Z,ce){var q,ee,ie=k,xe=1<<F,le=a(16),be=a(16);for(t(Z!=0),t(B!=null),t(A!=null),t(0<F),ee=0;ee<Z;++ee){if(15<B[ee])return 0;++le[B[ee]]}if(le[0]==Z)return 0;for(be[1]=0,q=1;15>q;++q){if(le[q]>1<<q)return 0;be[q+1]=be[q]+le[q]}for(ee=0;ee<Z;++ee)q=B[ee],0<B[ee]&&(ce[be[q]++]=ee);if(be[15]==1)return(B=new G).g=0,B.value=ce[0],j(A,ie,1,xe,B),xe;var we,Le=-1,Se=xe-1,Xe=0,Ue=1,pt=1,$e=1<<F;for(ee=0,q=1,Z=2;q<=F;++q,Z<<=1){if(Ue+=pt<<=1,0>(pt-=le[q]))return 0;for(;0<le[q];--le[q])(B=new G).g=q,B.value=ce[ee++],j(A,ie+Xe,Z,$e,B),Xe=ne(Xe,q)}for(q=F+1,Z=2;15>=q;++q,Z<<=1){if(Ue+=pt<<=1,0>(pt-=le[q]))return 0;for(;0<le[q];--le[q]){if(B=new G,(Xe&Se)!=Le){for(ie+=$e,we=1<<(Le=q)-F;15>Le&&!(0>=(we-=le[Le]));)++Le,we<<=1;xe+=$e=1<<(we=Le-F),A[k+(Le=Xe&Se)].g=we+F,A[k+Le].value=ie-k-Le}B.g=q-F,B.value=ce[ee++],j(A,ie+(Xe>>F),Z,$e,B),Xe=ne(Xe,q)}}return Ue!=2*be[15]-1?0:xe}(i,l,f,x,y,_)}function G(){this.value=this.g=0}function $(){this.value=this.g=0}function ue(){this.G=h(5,G),this.H=a(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=h(_i,$)}function fe(i,l,f,x){t(i!=null),t(l!=null),t(2147483648>x),i.Ca=254,i.I=0,i.b=-8,i.Ka=0,i.oa=l,i.pa=f,i.Jd=l,i.Yc=f+x,i.Zc=4<=x?f+x-4+1:f,re(i)}function me(i,l){for(var f=0;0<l--;)f|=de(i,128)<<l;return f}function se(i,l){var f=me(i,l);return oe(i)?-f:f}function ge(i,l,f,x){var y,_=0;for(t(i!=null),t(l!=null),t(4294967288>x),i.Sb=x,i.Ra=0,i.u=0,i.h=0,4<x&&(x=4),y=0;y<x;++y)_+=l[f+y]<<8*y;i.Ra=_,i.bb=x,i.oa=l,i.pa=f}function W(i){for(;8<=i.u&&i.bb<i.Sb;)i.Ra>>>=8,i.Ra+=i.oa[i.pa+i.bb]<<Gn-8>>>0,++i.bb,i.u-=8;z(i)&&(i.h=1,i.u=0)}function M(i,l){if(t(0<=l),!i.h&&l<=kr){var f=D(i)&Lr[l];return i.u+=l,W(i),f}return i.h=1,i.u=0}function b(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function I(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function D(i){return i.Ra>>>(i.u&Gn-1)>>>0}function z(i){return t(i.bb<=i.Sb),i.h||i.bb==i.Sb&&i.u>Gn}function V(i,l){i.u=l,i.h=z(i)}function Y(i){i.u>=Tn&&(t(i.u>=Tn),W(i))}function re(i){t(i!=null&&i.oa!=null),i.pa<i.Zc?(i.I=(i.oa[i.pa++]|i.I<<8)>>>0,i.b+=8):(t(i!=null&&i.oa!=null),i.pa<i.Yc?(i.b+=8,i.I=i.oa[i.pa++]|i.I<<8):i.Ka?i.b=0:(i.I<<=8,i.b+=8,i.Ka=1))}function oe(i){return me(i,1)}function de(i,l){var f=i.Ca;0>i.b&&re(i);var x=i.b,y=f*l>>>8,_=(i.I>>>x>y)+0;for(_?(f-=y,i.I-=y+1<<x>>>0):f=y+1,x=f,y=0;256<=x;)y+=8,x>>=8;return x=7^y+Jn[x],i.b-=x,i.Ca=(f<<x)-1,_}function ye(i,l,f){i[l+0]=f>>24&255,i[l+1]=f>>16&255,i[l+2]=f>>8&255,i[l+3]=255&f}function je(i,l){return i[l+0]|i[l+1]<<8}function Ce(i,l){return je(i,l)|i[l+2]<<16}function ke(i,l){return je(i,l)|je(i,l+2)<<16}function E(i,l){var f=1<<l;return t(i!=null),t(0<l),i.X=a(f),i.X==null?0:(i.Mb=32-l,i.Xa=l,1)}function Ie(i,l){t(i!=null),t(l!=null),t(i.Xa==l.Xa),n(l.X,0,i.X,0,1<<l.Xa)}function Qe(){this.X=[],this.Xa=this.Mb=0}function Re(i,l,f,x){t(f!=null),t(x!=null);var y=f[0],_=x[0];return y==0&&(y=(i*_+l/2)/l),_==0&&(_=(l*y+i/2)/i),0>=y||0>=_?0:(f[0]=y,x[0]=_,1)}function Ne(i,l){return i+(1<<l)-1>>>l}function De(i,l){return((4278255360&i)+(4278255360&l)>>>0&4278255360)+((16711935&i)+(16711935&l)>>>0&16711935)>>>0}function Te(i,l){R[l]=function(f,x,y,_,A,k,F){var B;for(B=0;B<A;++B){var Z=R[i](k[F+B-1],y,_+B);k[F+B]=De(f[x+B],Z)}}}function qe(){this.ud=this.hd=this.jd=0}function Je(i,l){return((4278124286&(i^l))>>>1)+(i&l)>>>0}function Ee(i){return 0<=i&&256>i?i:0>i?0:255<i?255:void 0}function ut(i,l){return Ee(i+(i-l+.5>>1))}function rt(i,l,f){return Math.abs(l-f)-Math.abs(i-f)}function xt(i,l,f,x,y,_,A){for(x=_[A-1],f=0;f<y;++f)_[A+f]=x=De(i[l+f],x)}function mt(i,l,f,x,y){var _;for(_=0;_<f;++_){var A=i[l+_],k=A>>8&255,F=16711935&(F=(F=16711935&A)+((k<<16)+k));x[y+_]=(4278255360&A)+F>>>0}}function ze(i,l){l.jd=255&i,l.hd=i>>8&255,l.ud=i>>16&255}function nt(i,l,f,x,y,_){var A;for(A=0;A<x;++A){var k=l[f+A],F=k>>>8,B=k,Z=255&(Z=(Z=k>>>16)+((i.jd<<24>>24)*(F<<24>>24)>>>5));B=255&(B=(B+=(i.hd<<24>>24)*(F<<24>>24)>>>5)+((i.ud<<24>>24)*(Z<<24>>24)>>>5)),y[_+A]=(4278255360&k)+(Z<<16)+B}}function He(i,l,f,x,y){R[l]=function(_,A,k,F,B,Z,ce,q,ee){for(F=ce;F<q;++F)for(ce=0;ce<ee;++ce)B[Z++]=y(k[x(_[A++])])},R[i]=function(_,A,k,F,B,Z,ce){var q=8>>_.b,ee=_.Ea,ie=_.K[0],xe=_.w;if(8>q)for(_=(1<<_.b)-1,xe=(1<<q)-1;A<k;++A){var le,be=0;for(le=0;le<ee;++le)le&_||(be=x(F[B++])),Z[ce++]=y(ie[be&xe]),be>>=q}else R["VP8LMapColor"+f](F,B,ie,xe,Z,ce,A,k,ee)}}function Et(i,l,f,x,y){for(f=l+f;l<f;){var _=i[l++];x[y++]=_>>16&255,x[y++]=_>>8&255,x[y++]=255&_}}function bt(i,l,f,x,y){for(f=l+f;l<f;){var _=i[l++];x[y++]=_>>16&255,x[y++]=_>>8&255,x[y++]=255&_,x[y++]=_>>24&255}}function ht(i,l,f,x,y){for(f=l+f;l<f;){var _=(A=i[l++])>>16&240|A>>12&15,A=240&A|A>>28&15;x[y++]=_,x[y++]=A}}function dt(i,l,f,x,y){for(f=l+f;l<f;){var _=(A=i[l++])>>16&248|A>>13&7,A=A>>5&224|A>>3&31;x[y++]=_,x[y++]=A}}function kt(i,l,f,x,y){for(f=l+f;l<f;){var _=i[l++];x[y++]=255&_,x[y++]=_>>8&255,x[y++]=_>>16&255}}function Ze(i,l,f,x,y,_){if(_==0)for(f=l+f;l<f;)ye(x,((_=i[l++])[0]>>24|_[1]>>8&65280|_[2]<<8&16711680|_[3]<<24)>>>0),y+=32;else n(x,y,i,l,f)}function ae(i,l){R[l][0]=R[i+"0"],R[l][1]=R[i+"1"],R[l][2]=R[i+"2"],R[l][3]=R[i+"3"],R[l][4]=R[i+"4"],R[l][5]=R[i+"5"],R[l][6]=R[i+"6"],R[l][7]=R[i+"7"],R[l][8]=R[i+"8"],R[l][9]=R[i+"9"],R[l][10]=R[i+"10"],R[l][11]=R[i+"11"],R[l][12]=R[i+"12"],R[l][13]=R[i+"13"],R[l][14]=R[i+"0"],R[l][15]=R[i+"0"]}function _e(i){return i==go||i==mo||i==da||i==xo}function Fe(){this.eb=[],this.size=this.A=this.fb=0}function Pe(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function Be(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Fe,this.f.kb=new Pe,this.sd=null}function Me(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function et(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function wn(i){return alert("todo:WebPSamplerProcessPlane"),i.T}function pr(i,l){var f=i.T,x=l.ba.f.RGBA,y=x.eb,_=x.fb+i.ka*x.A,A=Vr[l.ba.S],k=i.y,F=i.O,B=i.f,Z=i.N,ce=i.ea,q=i.W,ee=l.cc,ie=l.dc,xe=l.Mc,le=l.Nc,be=i.ka,we=i.ka+i.T,Le=i.U,Se=Le+1>>1;for(be==0?A(k,F,null,null,B,Z,ce,q,B,Z,ce,q,y,_,null,null,Le):(A(l.ec,l.fc,k,F,ee,ie,xe,le,B,Z,ce,q,y,_-x.A,y,_,Le),++f);be+2<we;be+=2)ee=B,ie=Z,xe=ce,le=q,Z+=i.Rc,q+=i.Rc,_+=2*x.A,A(k,(F+=2*i.fa)-i.fa,k,F,ee,ie,xe,le,B,Z,ce,q,y,_-x.A,y,_,Le);return F+=i.fa,i.j+we<i.o?(n(l.ec,l.fc,k,F,Le),n(l.cc,l.dc,B,Z,Se),n(l.Mc,l.Nc,ce,q,Se),f--):1&we||A(k,F,null,null,B,Z,ce,q,B,Z,ce,q,y,_+x.A,null,null,Le),f}function Nn(i,l,f){var x=i.F,y=[i.J];if(x!=null){var _=i.U,A=l.ba.S,k=A==ha||A==da;l=l.ba.f.RGBA;var F=[0],B=i.ka;F[0]=i.T,i.Kb&&(B==0?--F[0]:(--B,y[0]-=i.width),i.j+i.ka+i.T==i.o&&(F[0]=i.o-i.j-B));var Z=l.eb;B=l.fb+B*l.A,i=Sl(x,y[0],i.width,_,F,Z,B+(k?0:3),l.A),t(f==F),i&&_e(A)&&ks(Z,B,k,_,F,l.A)}return 0}function on(i){var l=i.ma,f=l.ba.S,x=11>f,y=f==ca||f==ua||f==ha||f==po||f==12||_e(f);if(l.memory=null,l.Ib=null,l.Jb=null,l.Nd=null,!ys(l.Oa,i,y?11:12))return 0;if(y&&_e(f)&&xs(),i.da)alert("todo:use_scaling");else{if(x){if(l.Ib=wn,i.Kb){if(f=i.U+1>>1,l.memory=a(i.U+2*f),l.memory==null)return 0;l.ec=l.memory,l.fc=0,l.cc=l.ec,l.dc=l.fc+i.U,l.Mc=l.cc,l.Nc=l.dc+f,l.Ib=pr,xs()}}else alert("todo:EmitYUV");y&&(l.Jb=Nn,x&&Xr())}if(x&&!zl){for(i=0;256>i;++i)qh[i]=89858*(i-128)+pa>>fa,Hh[i]=-22014*(i-128)+pa,zh[i]=-45773*(i-128),Uh[i]=113618*(i-128)+pa>>fa;for(i=Ps;i<yo;++i)l=76283*(i-16)+pa>>fa,Wh[i-Ps]=un(l,255),Vh[i-Ps]=un(l+8>>4,15);zl=1}return 1}function tt(i){var l=i.ma,f=i.U,x=i.T;return t(!(1&i.ka)),0>=f||0>=x?0:(f=l.Ib(i,l),l.Jb!=null&&l.Jb(i,l,f),l.Dc+=f,1)}function _n(i){i.ma.memory=null}function jn(i,l,f,x){return M(i,8)!=47?0:(l[0]=M(i,14)+1,f[0]=M(i,14)+1,x[0]=M(i,1),M(i,3)!=0?0:!i.h)}function Rr(i,l){if(4>i)return i+1;var f=i-2>>1;return(2+(1&i)<<f)+M(l,f)+1}function Dr(i,l){return 120<l?l-120:1<=(f=((f=Sh[l-1])>>4)*i+(8-(15&f)))?f:1;var f}function qt(i,l,f){var x=D(f),y=i[l+=255&x].g-8;return 0<y&&(V(f,f.u+8),x=D(f),l+=i[l].value,l+=x&(1<<y)-1),V(f,f.u+i[l].g),i[l].value}function ar(i,l,f){return f.g+=i.g,f.value+=i.value<<l>>>0,t(8>=f.g),i.g}function lr(i,l,f){var x=i.xc;return t((l=x==0?0:i.vc[i.md*(f>>x)+(l>>x)])<i.Wb),i.Ya[l]}function ui(i,l,f,x){var y=i.ab,_=i.c*l,A=i.C;l=A+l;var k=f,F=x;for(x=i.Ta,f=i.Ua;0<y--;){var B=i.gc[y],Z=A,ce=l,q=k,ee=F,ie=(F=x,k=f,B.Ea);switch(t(Z<ce),t(ce<=B.nc),B.hc){case 2:Wt(q,ee,(ce-Z)*ie,F,k);break;case 0:var xe=Z,le=ce,be=F,we=k,Le=($e=B).Ea;xe==0&&(Ns(q,ee,null,null,1,be,we),xt(q,ee+1,0,0,Le-1,be,we+1),ee+=Le,we+=Le,++xe);for(var Se=1<<$e.b,Xe=Se-1,Ue=Ne(Le,$e.b),pt=$e.K,$e=$e.w+(xe>>$e.b)*Ue;xe<le;){var vt=pt,nr=$e,gt=1;for(Vi(q,ee,be,we-Le,1,be,we);gt<Le;){var Ge=(gt&~Xe)+Se;Ge>Le&&(Ge=Le),(0,js[vt[nr++]>>8&15])(q,ee+ +gt,be,we+gt-Le,Ge-gt,be,we+gt),gt=Ge}ee+=Le,we+=Le,++xe&Xe||($e+=Ue)}ce!=B.nc&&n(F,k-ie,F,k+(ce-Z-1)*ie,ie);break;case 1:for(ie=q,le=ee,Le=(q=B.Ea)-(we=q&~(be=(ee=1<<B.b)-1)),xe=Ne(q,B.b),Se=B.K,B=B.w+(Z>>B.b)*xe;Z<ce;){for(Xe=Se,Ue=B,pt=new qe,$e=le+we,vt=le+q;le<$e;)ze(Xe[Ue++],pt),As(pt,ie,le,ee,F,k),le+=ee,k+=ee;le<vt&&(ze(Xe[Ue++],pt),As(pt,ie,le,Le,F,k),le+=Le,k+=Le),++Z&be||(B+=xe)}break;case 3:if(q==F&&ee==k&&0<B.b){for(le=F,q=ie=k+(ce-Z)*ie-(we=(ce-Z)*Ne(B.Ea,B.b)),ee=F,be=k,xe=[],we=(Le=we)-1;0<=we;--we)xe[we]=ee[be+we];for(we=Le-1;0<=we;--we)le[q+we]=xe[we];sa(B,Z,ce,F,ie,F,k)}else sa(B,Z,ce,q,ee,F,k)}k=x,F=f}F!=f&&n(x,f,k,F,_)}function Hn(i,l){var f=i.V,x=i.Ba+i.c*i.C,y=l-i.C;if(t(l<=i.l.o),t(16>=y),0<y){var _=i.l,A=i.Ta,k=i.Ua,F=_.width;if(ui(i,y,f,x),y=k=[k],t((f=i.C)<(x=l)),t(_.v<_.va),x>_.o&&(x=_.o),f<_.j){var B=_.j-f;f=_.j,y[0]+=B*F}if(f>=x?f=0:(y[0]+=4*_.v,_.ka=f-_.j,_.U=_.va-_.v,_.T=x-f,f=1),f){if(k=k[0],11>(f=i.ca).S){var Z=f.f.RGBA,ce=(x=f.S,y=_.U,_=_.T,B=Z.eb,Z.A),q=_;for(Z=Z.fb+i.Ma*Z.A;0<q--;){var ee=A,ie=k,xe=y,le=B,be=Z;switch(x){case la:Ss(ee,ie,xe,le,be);break;case ca:Yn(ee,ie,xe,le,be);break;case go:Yn(ee,ie,xe,le,be),ks(le,be,0,xe,1,0);break;case El:ji(ee,ie,xe,le,be);break;case ua:Ze(ee,ie,xe,le,be,1);break;case mo:Ze(ee,ie,xe,le,be,1),ks(le,be,0,xe,1,0);break;case ha:Ze(ee,ie,xe,le,be,0);break;case da:Ze(ee,ie,xe,le,be,0),ks(le,be,1,xe,1,0);break;case po:Kn(ee,ie,xe,le,be);break;case xo:Kn(ee,ie,xe,le,be),Al(le,be,xe,1,0);break;case Ol:Xn(ee,ie,xe,le,be);break;default:t(0)}k+=F,Z+=ce}i.Ma+=_}else alert("todo:EmitRescaledRowsYUVA");t(i.Ma<=f.height)}}i.C=l,t(i.C<=i.i)}function Gr(i){var l;if(0<i.ua)return 0;for(l=0;l<i.Wb;++l){var f=i.Ya[l].G,x=i.Ya[l].H;if(0<f[1][x[1]+0].g||0<f[2][x[2]+0].g||0<f[3][x[3]+0].g)return 0}return 1}function ln(i,l,f,x,y,_){if(i.Z!=0){var A=i.qd,k=i.rd;for(t(ei[i.Z]!=null);l<f;++l)ei[i.Z](A,k,x,y,x,y,_),A=x,k=y,y+=_;i.qd=A,i.rd=k}}function Jr(i,l){var f=i.l.ma,x=f.Z==0||f.Z==1?i.l.j:i.C;if(x=i.C<x?x:i.C,t(l<=i.l.o),l>x){var y=i.l.width,_=f.ca,A=f.tb+y*x,k=i.V,F=i.Ba+i.c*x,B=i.gc;t(i.ab==1),t(B[0].hc==3),pn(B[0],x,l,k,F,_,A),ln(f,x,l,_,A,y)}i.C=i.Ma=l}function Yr(i,l,f,x,y,_,A){var k=i.$/x,F=i.$%x,B=i.m,Z=i.s,ce=f+i.$,q=ce;y=f+x*y;var ee=f+x*_,ie=280+Z.ua,xe=i.Pb?k:16777216,le=0<Z.ua?Z.Wa:null,be=Z.wc,we=ce<ee?lr(Z,F,k):null;t(i.C<_),t(ee<=y);var Le=!1;e:for(;;){for(;Le||ce<ee;){var Se=0;if(k>=xe){var Xe=ce-f;t((xe=i).Pb),xe.wd=xe.m,xe.xd=Xe,0<xe.s.ua&&Ie(xe.s.Wa,xe.s.vb),xe=k+kh}if(F&be||(we=lr(Z,F,k)),t(we!=null),we.Qb&&(l[ce]=we.qb,Le=!0),!Le)if(Y(B),we.jc){Se=B,Xe=l;var Ue=ce,pt=we.pd[D(Se)&_i-1];t(we.jc),256>pt.g?(V(Se,Se.u+pt.g),Xe[Ue]=pt.value,Se=0):(V(Se,Se.u+pt.g-256),t(256<=pt.value),Se=pt.value),Se==0&&(Le=!0)}else Se=qt(we.G[0],we.H[0],B);if(B.h)break;if(Le||256>Se){if(!Le)if(we.nd)l[ce]=(we.qb|Se<<8)>>>0;else{if(Y(B),Le=qt(we.G[1],we.H[1],B),Y(B),Xe=qt(we.G[2],we.H[2],B),Ue=qt(we.G[3],we.H[3],B),B.h)break;l[ce]=(Ue<<24|Le<<16|Se<<8|Xe)>>>0}if(Le=!1,++ce,++F>=x&&(F=0,++k,A!=null&&k<=_&&!(k%16)&&A(i,k),le!=null))for(;q<ce;)Se=l[q++],le.X[(506832829*Se&4294967295)>>>le.Mb]=Se}else if(280>Se){if(Se=Rr(Se-256,B),Xe=qt(we.G[4],we.H[4],B),Y(B),Xe=Dr(x,Xe=Rr(Xe,B)),B.h)break;if(ce-f<Xe||y-ce<Se)break e;for(Ue=0;Ue<Se;++Ue)l[ce+Ue]=l[ce+Ue-Xe];for(ce+=Se,F+=Se;F>=x;)F-=x,++k,A!=null&&k<=_&&!(k%16)&&A(i,k);if(t(ce<=y),F&be&&(we=lr(Z,F,k)),le!=null)for(;q<ce;)Se=l[q++],le.X[(506832829*Se&4294967295)>>>le.Mb]=Se}else{if(!(Se<ie))break e;for(Le=Se-280,t(le!=null);q<ce;)Se=l[q++],le.X[(506832829*Se&4294967295)>>>le.Mb]=Se;Se=ce,t(!(Le>>>(Xe=le).Xa)),l[Se]=Xe.X[Le],Le=!0}Le||t(B.h==z(B))}if(i.Pb&&B.h&&ce<y)t(i.m.h),i.a=5,i.m=i.wd,i.$=i.xd,0<i.s.ua&&Ie(i.s.vb,i.s.Wa);else{if(B.h)break e;A!=null&&A(i,k>_?_:k),i.a=0,i.$=ce-f}return 1}return i.a=3,0}function Br(i){t(i!=null),i.vc=null,i.yc=null,i.Ya=null;var l=i.Wa;l!=null&&(l.X=null),i.vb=null,t(i!=null)}function hi(){var i=new at;return i==null?null:(i.a=0,i.xb=Rl,ae("Predictor","VP8LPredictors"),ae("Predictor","VP8LPredictors_C"),ae("PredictorAdd","VP8LPredictorsAdd"),ae("PredictorAdd","VP8LPredictorsAdd_C"),Wt=mt,As=nt,Ss=Et,Yn=bt,Kn=ht,Xn=dt,ji=kt,R.VP8LMapColor32b=fn,R.VP8LMapColor8b=_s,i)}function cn(i,l,f,x,y){var _=1,A=[i],k=[l],F=x.m,B=x.s,Z=null,ce=0;e:for(;;){if(f)for(;_&&M(F,1);){var q=A,ee=k,ie=x,xe=1,le=ie.m,be=ie.gc[ie.ab],we=M(le,2);if(ie.Oc&1<<we)_=0;else{switch(ie.Oc|=1<<we,be.hc=we,be.Ea=q[0],be.nc=ee[0],be.K=[null],++ie.ab,t(4>=ie.ab),we){case 0:case 1:be.b=M(le,3)+2,xe=cn(Ne(be.Ea,be.b),Ne(be.nc,be.b),0,ie,be.K),be.K=be.K[0];break;case 3:var Le,Se=M(le,8)+1,Xe=16<Se?0:4<Se?1:2<Se?2:3;if(q[0]=Ne(be.Ea,Xe),be.b=Xe,Le=xe=cn(Se,1,0,ie,be.K)){var Ue,pt=Se,$e=be,vt=1<<(8>>$e.b),nr=a(vt);if(nr==null)Le=0;else{var gt=$e.K[0],Ge=$e.w;for(nr[0]=$e.K[0][0],Ue=1;Ue<1*pt;++Ue)nr[Ue]=De(gt[Ge+Ue],nr[Ue-1]);for(;Ue<4*vt;++Ue)nr[Ue]=0;$e.K[0]=null,$e.K[0]=nr,Le=1}}xe=Le;break;case 2:break;default:t(0)}_=xe}}if(A=A[0],k=k[0],_&&M(F,1)&&!(_=1<=(ce=M(F,4))&&11>=ce)){x.a=3;break e}var Oe;if(Oe=_)t:{var $t,ct,yt,Mt=x,hr=A,wr=k,Ut=ce,gr=f,Nr=Mt.m,ir=Mt.s,Nt=[null],At=1,zt=0,St=Lh[Ut];r:for(;;){if(gr&&M(Nr,1)){var dr=M(Nr,3)+2,Qr=Ne(hr,dr),Gt=Ne(wr,dr),jr=Qr*Gt;if(!cn(Qr,Gt,0,Mt,Nt))break r;for(Nt=Nt[0],ir.xc=dr,$t=0;$t<jr;++$t){var Pt=Nt[$t]>>8&65535;Nt[$t]=Pt,Pt>=At&&(At=Pt+1)}}if(Nr.h)break r;for(ct=0;5>ct;++ct){var sr=Tl[ct];!ct&&0<Ut&&(sr+=1<<Ut),zt<sr&&(zt=sr)}var Pr=h(At*St,G),_r=At,Ir=h(_r,ue);if(Ir==null)var Fr=null;else t(65536>=_r),Fr=Ir;var Ar=a(zt);if(Fr==null||Ar==null||Pr==null){Mt.a=1;break r}var Er=Pr;for($t=yt=0;$t<At;++$t){var Tt=Fr[$t],Or=Tt.G,en=Tt.H,Si=0,Dn=1,fr=0;for(ct=0;5>ct;++ct){sr=Tl[ct],Or[ct]=Er,en[ct]=yt,!ct&&0<Ut&&(sr+=1<<Ut);i:{var ma,wo=sr,xa=Mt,Is=Ar,Jh=Er,Yh=yt,No=0,ti=xa.m,Kh=M(ti,1);if(s(Is,0,0,wo),Kh){var Xh=M(ti,1)+1,Zh=M(ti,1),Vl=M(ti,Zh==0?1:8);Is[Vl]=1,Xh==2&&(Is[Vl=M(ti,8)]=1);var ba=1}else{var $l=a(19),Gl=M(ti,4)+4;if(19<Gl){xa.a=3;var va=0;break i}for(ma=0;ma<Gl;++ma)$l[Ah[ma]]=M(ti,3);var _o=void 0,Fs=void 0,Jl=xa,Qh=$l,ya=wo,Yl=Is,jo=0,ri=Jl.m,Kl=8,Xl=h(128,G);n:for(;P(Xl,0,7,Qh,19);){if(M(ri,1)){var ed=2+2*M(ri,3);if((_o=2+M(ri,ed))>ya)break n}else _o=ya;for(Fs=0;Fs<ya&&_o--;){Y(ri);var Zl=Xl[0+(127&D(ri))];V(ri,ri.u+Zl.g);var Gi=Zl.value;if(16>Gi)Yl[Fs++]=Gi,Gi!=0&&(Kl=Gi);else{var td=Gi==16,Ql=Gi-16,rd=_h[Ql],ec=M(ri,Nh[Ql])+rd;if(Fs+ec>ya)break n;for(var nd=td?Kl:0;0<ec--;)Yl[Fs++]=nd}}jo=1;break n}jo||(Jl.a=3),ba=jo}(ba=ba&&!ti.h)&&(No=P(Jh,Yh,8,Is,wo)),ba&&No!=0?va=No:(xa.a=3,va=0)}if(va==0)break r;if(Dn&&jh[ct]==1&&(Dn=Er[yt].g==0),Si+=Er[yt].g,yt+=va,3>=ct){var Es,Ao=Ar[0];for(Es=1;Es<sr;++Es)Ar[Es]>Ao&&(Ao=Ar[Es]);fr+=Ao}}if(Tt.nd=Dn,Tt.Qb=0,Dn&&(Tt.qb=(Or[3][en[3]+0].value<<24|Or[1][en[1]+0].value<<16|Or[2][en[2]+0].value)>>>0,Si==0&&256>Or[0][en[0]+0].value&&(Tt.Qb=1,Tt.qb+=Or[0][en[0]+0].value<<8)),Tt.jc=!Tt.Qb&&6>fr,Tt.jc){var wa,Bn=Tt;for(wa=0;wa<_i;++wa){var ni=wa,ii=Bn.pd[ni],Na=Bn.G[0][Bn.H[0]+ni];256<=Na.value?(ii.g=Na.g+256,ii.value=Na.value):(ii.g=0,ii.value=0,ni>>=ar(Na,8,ii),ni>>=ar(Bn.G[1][Bn.H[1]+ni],16,ii),ni>>=ar(Bn.G[2][Bn.H[2]+ni],0,ii),ar(Bn.G[3][Bn.H[3]+ni],24,ii))}}}ir.vc=Nt,ir.Wb=At,ir.Ya=Fr,ir.yc=Pr,Oe=1;break t}Oe=0}if(!(_=Oe)){x.a=3;break e}if(0<ce){if(B.ua=1<<ce,!E(B.Wa,ce)){x.a=1,_=0;break e}}else B.ua=0;var So=x,tc=A,id=k,Lo=So.s,ko=Lo.xc;if(So.c=tc,So.i=id,Lo.md=Ne(tc,ko),Lo.wc=ko==0?-1:(1<<ko)-1,f){x.xb=Th;break e}if((Z=a(A*k))==null){x.a=1,_=0;break e}_=(_=Yr(x,Z,0,A,k,k,null))&&!F.h;break e}return _?(y!=null?y[0]=Z:(t(Z==null),t(f)),x.$=0,f||Br(B)):Br(B),_}function di(i,l){var f=i.c*i.i,x=f+l+16*l;return t(i.c<=l),i.V=a(x),i.V==null?(i.Ta=null,i.Ua=0,i.a=1,0):(i.Ta=i.V,i.Ua=i.Ba+f+l,1)}function Ti(i,l){var f=i.C,x=l-f,y=i.V,_=i.Ba+i.c*f;for(t(l<=i.l.o);0<x;){var A=16<x?16:x,k=i.l.ma,F=i.l.width,B=F*A,Z=k.ca,ce=k.tb+F*f,q=i.Ta,ee=i.Ua;ui(i,A,y,_),Ll(q,ee,Z,ce,B),ln(k,f,f+A,Z,ce,F),x-=A,y+=A*i.c,f+=A}t(f==l),i.C=i.Ma=l}function Mi(){this.ub=this.yd=this.td=this.Rb=0}function Ri(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Ka(){this.Fb=this.Bb=this.Cb=0,this.Zb=a(4),this.Lb=a(4)}function as(){this.Yb=function(){var i=[];return function l(f,x,y){for(var _=y[x],A=0;A<_&&(f.push(y.length>x+1?[]:0),!(y.length<x+1));A++)l(f[A],x+1,y)}(i,0,[3,11]),i}()}function Us(){this.jb=a(3),this.Wc=c([4,8],as),this.Xc=c([4,17],as)}function zs(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new a(4),this.od=new a(4)}function qr(){this.ld=this.La=this.dd=this.tc=0}function os(){this.Na=this.la=0}function Hs(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function ls(){this.ad=a(384),this.Za=0,this.Ob=a(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function Ws(){this.uc=this.M=this.Nb=0,this.wa=Array(new qr),this.Y=0,this.ya=Array(new ls),this.aa=0,this.l=new Di}function Vs(){this.y=a(16),this.f=a(8),this.ea=a(8)}function $s(){this.cb=this.a=0,this.sc="",this.m=new b,this.Od=new Mi,this.Kc=new Ri,this.ed=new zs,this.Qa=new Ka,this.Ic=this.$c=this.Aa=0,this.D=new Ws,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=h(8,b),this.ia=0,this.pb=h(4,Hs),this.Pa=new Us,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new Vs),this.Hd=0,this.rb=Array(new os),this.sb=0,this.wa=Array(new qr),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new ls),this.L=this.aa=0,this.gd=c([4,2],qr),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function un(i,l){return 0>i?0:i>l?l:i}function Di(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function Xa(){var i=new $s;return i!=null&&(i.a=0,i.sc="OK",i.cb=0,i.Xb=0,Cs||(Cs=Bi)),i}function Xt(i,l,f){return i.a==0&&(i.a=l,i.sc=f,i.cb=0),0}function Gs(i,l,f){return 3<=f&&i[l+0]==157&&i[l+1]==1&&i[l+2]==42}function hn(i,l){if(i==null)return 0;if(i.a=0,i.sc="OK",l==null)return Xt(i,2,"null VP8Io passed to VP8GetHeaders()");var f=l.data,x=l.w,y=l.ha;if(4>y)return Xt(i,7,"Truncated header.");var _=f[x+0]|f[x+1]<<8|f[x+2]<<16,A=i.Od;if(A.Rb=!(1&_),A.td=_>>1&7,A.yd=_>>4&1,A.ub=_>>5,3<A.td)return Xt(i,3,"Incorrect keyframe parameters.");if(!A.yd)return Xt(i,4,"Frame not displayable.");x+=3,y-=3;var k=i.Kc;if(A.Rb){if(7>y)return Xt(i,7,"cannot parse picture header");if(!Gs(f,x,y))return Xt(i,3,"Bad code word");k.c=16383&(f[x+4]<<8|f[x+3]),k.Td=f[x+4]>>6,k.i=16383&(f[x+6]<<8|f[x+5]),k.Ud=f[x+6]>>6,x+=7,y-=7,i.za=k.c+15>>4,i.Ub=k.i+15>>4,l.width=k.c,l.height=k.i,l.Da=0,l.j=0,l.v=0,l.va=l.width,l.o=l.height,l.da=0,l.ib=l.width,l.hb=l.height,l.U=l.width,l.T=l.height,s((_=i.Pa).jb,0,255,_.jb.length),t((_=i.Qa)!=null),_.Cb=0,_.Bb=0,_.Fb=1,s(_.Zb,0,0,_.Zb.length),s(_.Lb,0,0,_.Lb)}if(A.ub>y)return Xt(i,7,"bad partition length");fe(_=i.m,f,x,A.ub),x+=A.ub,y-=A.ub,A.Rb&&(k.Ld=oe(_),k.Kd=oe(_)),k=i.Qa;var F,B=i.Pa;if(t(_!=null),t(k!=null),k.Cb=oe(_),k.Cb){if(k.Bb=oe(_),oe(_)){for(k.Fb=oe(_),F=0;4>F;++F)k.Zb[F]=oe(_)?se(_,7):0;for(F=0;4>F;++F)k.Lb[F]=oe(_)?se(_,6):0}if(k.Bb)for(F=0;3>F;++F)B.jb[F]=oe(_)?me(_,8):255}else k.Bb=0;if(_.Ka)return Xt(i,3,"cannot parse segment header");if((k=i.ed).zd=oe(_),k.Tb=me(_,6),k.wb=me(_,3),k.Pc=oe(_),k.Pc&&oe(_)){for(B=0;4>B;++B)oe(_)&&(k.vd[B]=se(_,6));for(B=0;4>B;++B)oe(_)&&(k.od[B]=se(_,6))}if(i.L=k.Tb==0?0:k.zd?1:2,_.Ka)return Xt(i,3,"cannot parse filter header");var Z=y;if(y=F=x,x=F+Z,k=Z,i.Xb=(1<<me(i.m,2))-1,Z<3*(B=i.Xb))f=7;else{for(F+=3*B,k-=3*B,Z=0;Z<B;++Z){var ce=f[y+0]|f[y+1]<<8|f[y+2]<<16;ce>k&&(ce=k),fe(i.Jc[+Z],f,F,ce),F+=ce,k-=ce,y+=3}fe(i.Jc[+B],f,F,k),f=F<x?0:5}if(f!=0)return Xt(i,f,"cannot parse partitions");for(f=me(F=i.m,7),y=oe(F)?se(F,4):0,x=oe(F)?se(F,4):0,k=oe(F)?se(F,4):0,B=oe(F)?se(F,4):0,F=oe(F)?se(F,4):0,Z=i.Qa,ce=0;4>ce;++ce){if(Z.Cb){var q=Z.Zb[ce];Z.Fb||(q+=f)}else{if(0<ce){i.pb[ce]=i.pb[0];continue}q=f}var ee=i.pb[ce];ee.Sc[0]=bo[un(q+y,127)],ee.Sc[1]=vo[un(q+0,127)],ee.Eb[0]=2*bo[un(q+x,127)],ee.Eb[1]=101581*vo[un(q+k,127)]>>16,8>ee.Eb[1]&&(ee.Eb[1]=8),ee.Qc[0]=bo[un(q+B,117)],ee.Qc[1]=vo[un(q+F,127)],ee.lc=q+F}if(!A.Rb)return Xt(i,4,"Not a key frame.");for(oe(_),A=i.Pa,f=0;4>f;++f){for(y=0;8>y;++y)for(x=0;3>x;++x)for(k=0;11>k;++k)B=de(_,Eh[f][y][x][k])?me(_,8):Ih[f][y][x][k],A.Wc[f][y].Yb[x][k]=B;for(y=0;17>y;++y)A.Xc[f][y]=A.Wc[f][Oh[y]]}return i.kc=oe(_),i.kc&&(i.Bd=me(_,8)),i.cb=1}function Bi(i,l,f,x,y,_,A){var k=l[y].Yb[f];for(f=0;16>y;++y){if(!de(i,k[f+0]))return y;for(;!de(i,k[f+1]);)if(k=l[++y].Yb[0],f=0,y==16)return 16;var F=l[y+1].Yb;if(de(i,k[f+2])){var B=i,Z=0;if(de(B,(q=k)[(ce=f)+3]))if(de(B,q[ce+6])){for(k=0,ce=2*(Z=de(B,q[ce+8]))+(q=de(B,q[ce+9+Z])),Z=0,q=Ch[ce];q[k];++k)Z+=Z+de(B,q[k]);Z+=3+(8<<ce)}else de(B,q[ce+7])?(Z=7+2*de(B,165),Z+=de(B,145)):Z=5+de(B,159);else Z=de(B,q[ce+4])?3+de(B,q[ce+5]):2;k=F[2]}else Z=1,k=F[1];F=A+Ph[y],0>(B=i).b&&re(B);var ce,q=B.b,ee=(ce=B.Ca>>1)-(B.I>>q)>>31;--B.b,B.Ca+=ee,B.Ca|=1,B.I-=(ce+1&ee)<<q,_[F]=((Z^ee)-ee)*x[(0<y)+0]}return 16}function Js(i){var l=i.rb[i.sb-1];l.la=0,l.Na=0,s(i.zc,0,0,i.zc.length),i.ja=0}function Ur(i,l,f,x,y){y=i[l+f+32*x]+(y>>3),i[l+f+32*x]=-256&y?0>y?0:255:y}function er(i,l,f,x,y,_){Ur(i,l,0,f,x+y),Ur(i,l,1,f,x+_),Ur(i,l,2,f,x-_),Ur(i,l,3,f,x-y)}function An(i){return(20091*i>>16)+i}function Ys(i,l,f,x){var y,_=0,A=a(16);for(y=0;4>y;++y){var k=i[l+0]+i[l+8],F=i[l+0]-i[l+8],B=(35468*i[l+4]>>16)-An(i[l+12]),Z=An(i[l+4])+(35468*i[l+12]>>16);A[_+0]=k+Z,A[_+1]=F+B,A[_+2]=F-B,A[_+3]=k-Z,_+=4,l++}for(y=_=0;4>y;++y)k=(i=A[_+0]+4)+A[_+8],F=i-A[_+8],B=(35468*A[_+4]>>16)-An(A[_+12]),Ur(f,x,0,0,k+(Z=An(A[_+4])+(35468*A[_+12]>>16))),Ur(f,x,1,0,F+B),Ur(f,x,2,0,F-B),Ur(f,x,3,0,k-Z),_++,x+=32}function Za(i,l,f,x){var y=i[l+0]+4,_=35468*i[l+4]>>16,A=An(i[l+4]),k=35468*i[l+1]>>16;er(f,x,0,y+A,i=An(i[l+1]),k),er(f,x,1,y+_,i,k),er(f,x,2,y-_,i,k),er(f,x,3,y-A,i,k)}function Qa(i,l,f,x,y){Ys(i,l,f,x),y&&Ys(i,l+16,f,x+4)}function dn(i,l,f,x){Ai(i,l+0,f,x,1),Ai(i,l+32,f,x+128,1)}function Ks(i,l,f,x){var y;for(i=i[l+0]+4,y=0;4>y;++y)for(l=0;4>l;++l)Ur(f,x,l,y,i)}function Xs(i,l,f,x){i[l+0]&&_t(i,l+0,f,x),i[l+16]&&_t(i,l+16,f,x+4),i[l+32]&&_t(i,l+32,f,x+128),i[l+48]&&_t(i,l+48,f,x+128+4)}function qi(i,l,f,x){var y,_=a(16);for(y=0;4>y;++y){var A=i[l+0+y]+i[l+12+y],k=i[l+4+y]+i[l+8+y],F=i[l+4+y]-i[l+8+y],B=i[l+0+y]-i[l+12+y];_[0+y]=A+k,_[8+y]=A-k,_[4+y]=B+F,_[12+y]=B-F}for(y=0;4>y;++y)A=(i=_[0+4*y]+3)+_[3+4*y],k=_[1+4*y]+_[2+4*y],F=_[1+4*y]-_[2+4*y],B=i-_[3+4*y],f[x+0]=A+k>>3,f[x+16]=B+F>>3,f[x+32]=A-k>>3,f[x+48]=B-F>>3,x+=64}function fi(i,l,f){var x,y=l-32,_=Cr,A=255-i[y-1];for(x=0;x<f;++x){var k,F=_,B=A+i[l-1];for(k=0;k<f;++k)i[l+k]=F[B+i[y+k]];l+=32}}function eo(i,l){fi(i,l,4)}function to(i,l){fi(i,l,8)}function ro(i,l){fi(i,l,16)}function cs(i,l){var f;for(f=0;16>f;++f)n(i,l+32*f,i,l-32,16)}function Zs(i,l){var f;for(f=16;0<f;--f)s(i,l,i[l-1],16),l+=32}function Kr(i,l,f){var x;for(x=0;16>x;++x)s(l,f+32*x,i,16)}function no(i,l){var f,x=16;for(f=0;16>f;++f)x+=i[l-1+32*f]+i[l+f-32];Kr(x>>5,i,l)}function pi(i,l){var f,x=8;for(f=0;16>f;++f)x+=i[l-1+32*f];Kr(x>>4,i,l)}function us(i,l){var f,x=8;for(f=0;16>f;++f)x+=i[l+f-32];Kr(x>>4,i,l)}function io(i,l){Kr(128,i,l)}function ot(i,l,f){return i+2*l+f+2>>2}function so(i,l){var f,x=l-32;for(x=new Uint8Array([ot(i[x-1],i[x+0],i[x+1]),ot(i[x+0],i[x+1],i[x+2]),ot(i[x+1],i[x+2],i[x+3]),ot(i[x+2],i[x+3],i[x+4])]),f=0;4>f;++f)n(i,l+32*f,x,0,x.length)}function ao(i,l){var f=i[l-1],x=i[l-1+32],y=i[l-1+64],_=i[l-1+96];ye(i,l+0,16843009*ot(i[l-1-32],f,x)),ye(i,l+32,16843009*ot(f,x,y)),ye(i,l+64,16843009*ot(x,y,_)),ye(i,l+96,16843009*ot(y,_,_))}function oo(i,l){var f,x=4;for(f=0;4>f;++f)x+=i[l+f-32]+i[l-1+32*f];for(x>>=3,f=0;4>f;++f)s(i,l+32*f,x,4)}function Sn(i,l){var f=i[l-1+0],x=i[l-1+32],y=i[l-1+64],_=i[l-1-32],A=i[l+0-32],k=i[l+1-32],F=i[l+2-32],B=i[l+3-32];i[l+0+96]=ot(x,y,i[l-1+96]),i[l+1+96]=i[l+0+64]=ot(f,x,y),i[l+2+96]=i[l+1+64]=i[l+0+32]=ot(_,f,x),i[l+3+96]=i[l+2+64]=i[l+1+32]=i[l+0+0]=ot(A,_,f),i[l+3+64]=i[l+2+32]=i[l+1+0]=ot(k,A,_),i[l+3+32]=i[l+2+0]=ot(F,k,A),i[l+3+0]=ot(B,F,k)}function Ln(i,l){var f=i[l+1-32],x=i[l+2-32],y=i[l+3-32],_=i[l+4-32],A=i[l+5-32],k=i[l+6-32],F=i[l+7-32];i[l+0+0]=ot(i[l+0-32],f,x),i[l+1+0]=i[l+0+32]=ot(f,x,y),i[l+2+0]=i[l+1+32]=i[l+0+64]=ot(x,y,_),i[l+3+0]=i[l+2+32]=i[l+1+64]=i[l+0+96]=ot(y,_,A),i[l+3+32]=i[l+2+64]=i[l+1+96]=ot(_,A,k),i[l+3+64]=i[l+2+96]=ot(A,k,F),i[l+3+96]=ot(k,F,F)}function lo(i,l){var f=i[l-1+0],x=i[l-1+32],y=i[l-1+64],_=i[l-1-32],A=i[l+0-32],k=i[l+1-32],F=i[l+2-32],B=i[l+3-32];i[l+0+0]=i[l+1+64]=_+A+1>>1,i[l+1+0]=i[l+2+64]=A+k+1>>1,i[l+2+0]=i[l+3+64]=k+F+1>>1,i[l+3+0]=F+B+1>>1,i[l+0+96]=ot(y,x,f),i[l+0+64]=ot(x,f,_),i[l+0+32]=i[l+1+96]=ot(f,_,A),i[l+1+32]=i[l+2+96]=ot(_,A,k),i[l+2+32]=i[l+3+96]=ot(A,k,F),i[l+3+32]=ot(k,F,B)}function co(i,l){var f=i[l+0-32],x=i[l+1-32],y=i[l+2-32],_=i[l+3-32],A=i[l+4-32],k=i[l+5-32],F=i[l+6-32],B=i[l+7-32];i[l+0+0]=f+x+1>>1,i[l+1+0]=i[l+0+64]=x+y+1>>1,i[l+2+0]=i[l+1+64]=y+_+1>>1,i[l+3+0]=i[l+2+64]=_+A+1>>1,i[l+0+32]=ot(f,x,y),i[l+1+32]=i[l+0+96]=ot(x,y,_),i[l+2+32]=i[l+1+96]=ot(y,_,A),i[l+3+32]=i[l+2+96]=ot(_,A,k),i[l+3+64]=ot(A,k,F),i[l+3+96]=ot(k,F,B)}function Ui(i,l){var f=i[l-1+0],x=i[l-1+32],y=i[l-1+64],_=i[l-1+96];i[l+0+0]=f+x+1>>1,i[l+2+0]=i[l+0+32]=x+y+1>>1,i[l+2+32]=i[l+0+64]=y+_+1>>1,i[l+1+0]=ot(f,x,y),i[l+3+0]=i[l+1+32]=ot(x,y,_),i[l+3+32]=i[l+1+64]=ot(y,_,_),i[l+3+64]=i[l+2+64]=i[l+0+96]=i[l+1+96]=i[l+2+96]=i[l+3+96]=_}function hs(i,l){var f=i[l-1+0],x=i[l-1+32],y=i[l-1+64],_=i[l-1+96],A=i[l-1-32],k=i[l+0-32],F=i[l+1-32],B=i[l+2-32];i[l+0+0]=i[l+2+32]=f+A+1>>1,i[l+0+32]=i[l+2+64]=x+f+1>>1,i[l+0+64]=i[l+2+96]=y+x+1>>1,i[l+0+96]=_+y+1>>1,i[l+3+0]=ot(k,F,B),i[l+2+0]=ot(A,k,F),i[l+1+0]=i[l+3+32]=ot(f,A,k),i[l+1+32]=i[l+3+64]=ot(x,f,A),i[l+1+64]=i[l+3+96]=ot(y,x,f),i[l+1+96]=ot(_,y,x)}function gi(i,l){var f;for(f=0;8>f;++f)n(i,l+32*f,i,l-32,8)}function uo(i,l){var f;for(f=0;8>f;++f)s(i,l,i[l-1],8),l+=32}function kn(i,l,f){var x;for(x=0;8>x;++x)s(l,f+32*x,i,8)}function ho(i,l){var f,x=8;for(f=0;8>f;++f)x+=i[l+f-32]+i[l-1+32*f];kn(x>>4,i,l)}function ds(i,l){var f,x=4;for(f=0;8>f;++f)x+=i[l+f-32];kn(x>>3,i,l)}function fs(i,l){var f,x=4;for(f=0;8>f;++f)x+=i[l-1+32*f];kn(x>>3,i,l)}function Qs(i,l){kn(128,i,l)}function Cn(i,l,f){var x=i[l-f],y=i[l+0],_=3*(y-x)+fo[1020+i[l-2*f]-i[l+f]],A=oa[112+(_+4>>3)];i[l-f]=Cr[255+x+oa[112+(_+3>>3)]],i[l+0]=Cr[255+y-A]}function ps(i,l,f,x){var y=i[l+0],_=i[l+f];return Wr[255+i[l-2*f]-i[l-f]]>x||Wr[255+_-y]>x}function zi(i,l,f,x){return 4*Wr[255+i[l-f]-i[l+0]]+Wr[255+i[l-2*f]-i[l+f]]<=x}function gs(i,l,f,x,y){var _=i[l-3*f],A=i[l-2*f],k=i[l-f],F=i[l+0],B=i[l+f],Z=i[l+2*f],ce=i[l+3*f];return 4*Wr[255+k-F]+Wr[255+A-B]>x?0:Wr[255+i[l-4*f]-_]<=y&&Wr[255+_-A]<=y&&Wr[255+A-k]<=y&&Wr[255+ce-Z]<=y&&Wr[255+Z-B]<=y&&Wr[255+B-F]<=y}function mi(i,l,f,x){var y=2*x+1;for(x=0;16>x;++x)zi(i,l+x,f,y)&&Cn(i,l+x,f)}function ms(i,l,f,x){var y=2*x+1;for(x=0;16>x;++x)zi(i,l+x*f,1,y)&&Cn(i,l+x*f,1)}function ea(i,l,f,x){var y;for(y=3;0<y;--y)mi(i,l+=4*f,f,x)}function ta(i,l,f,x){var y;for(y=3;0<y;--y)ms(i,l+=4,f,x)}function Pn(i,l,f,x,y,_,A,k){for(_=2*_+1;0<y--;){if(gs(i,l,f,_,A))if(ps(i,l,f,k))Cn(i,l,f);else{var F=i,B=l,Z=f,ce=F[B-2*Z],q=F[B-Z],ee=F[B+0],ie=F[B+Z],xe=F[B+2*Z],le=27*(we=fo[1020+3*(ee-q)+fo[1020+ce-ie]])+63>>7,be=18*we+63>>7,we=9*we+63>>7;F[B-3*Z]=Cr[255+F[B-3*Z]+we],F[B-2*Z]=Cr[255+ce+be],F[B-Z]=Cr[255+q+le],F[B+0]=Cr[255+ee-le],F[B+Z]=Cr[255+ie-be],F[B+2*Z]=Cr[255+xe-we]}l+=x}}function In(i,l,f,x,y,_,A,k){for(_=2*_+1;0<y--;){if(gs(i,l,f,_,A))if(ps(i,l,f,k))Cn(i,l,f);else{var F=i,B=l,Z=f,ce=F[B-Z],q=F[B+0],ee=F[B+Z],ie=oa[112+(4+(xe=3*(q-ce))>>3)],xe=oa[112+(xe+3>>3)],le=ie+1>>1;F[B-2*Z]=Cr[255+F[B-2*Z]+le],F[B-Z]=Cr[255+ce+xe],F[B+0]=Cr[255+q-ie],F[B+Z]=Cr[255+ee-le]}l+=x}}function ra(i,l,f,x,y,_){Pn(i,l,f,1,16,x,y,_)}function xi(i,l,f,x,y,_){Pn(i,l,1,f,16,x,y,_)}function na(i,l,f,x,y,_){var A;for(A=3;0<A;--A)In(i,l+=4*f,f,1,16,x,y,_)}function u(i,l,f,x,y,_){var A;for(A=3;0<A;--A)In(i,l+=4,1,f,16,x,y,_)}function v(i,l,f,x,y,_,A,k){Pn(i,l,y,1,8,_,A,k),Pn(f,x,y,1,8,_,A,k)}function U(i,l,f,x,y,_,A,k){Pn(i,l,1,y,8,_,A,k),Pn(f,x,1,y,8,_,A,k)}function J(i,l,f,x,y,_,A,k){In(i,l+4*y,y,1,8,_,A,k),In(f,x+4*y,y,1,8,_,A,k)}function te(i,l,f,x,y,_,A,k){In(i,l+4,1,y,8,_,A,k),In(f,x+4,1,y,8,_,A,k)}function ve(){this.ba=new Be,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new et,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function Ae(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function Ve(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Ye(){this.ua=0,this.Wa=new Qe,this.vb=new Qe,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new ue,this.yc=new G}function at(){this.xb=this.a=0,this.l=new Di,this.ca=new Be,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new I,this.Pb=0,this.wd=new I,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Ye,this.ab=0,this.gc=h(4,Ve),this.Oc=0}function ft(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Di,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function wt(i,l,f,x,y,_,A){for(i=i==null?0:i[l+0],l=0;l<A;++l)y[_+l]=i+f[x+l]&255,i=y[_+l]}function Bt(i,l,f,x,y,_,A){var k;if(i==null)wt(null,null,f,x,y,_,A);else for(k=0;k<A;++k)y[_+k]=i[l+k]+f[x+k]&255}function Zt(i,l,f,x,y,_,A){if(i==null)wt(null,null,f,x,y,_,A);else{var k,F=i[l+0],B=F,Z=F;for(k=0;k<A;++k)B=Z+(F=i[l+k])-B,Z=f[x+k]+(-256&B?0>B?0:255:B)&255,B=F,y[_+k]=Z}}function Ot(i,l,f,x){var y=l.width,_=l.o;if(t(i!=null&&l!=null),0>f||0>=x||f+x>_)return null;if(!i.Cc){if(i.ga==null){var A;if(i.ga=new ft,(A=i.ga==null)||(A=l.width*l.o,t(i.Gb.length==0),i.Gb=a(A),i.Uc=0,i.Gb==null?A=0:(i.mb=i.Gb,i.nb=i.Uc,i.rc=null,A=1),A=!A),!A){A=i.ga;var k=i.Fa,F=i.P,B=i.qc,Z=i.mb,ce=i.nb,q=F+1,ee=B-1,ie=A.l;if(t(k!=null&&Z!=null&&l!=null),ei[0]=null,ei[1]=wt,ei[2]=Bt,ei[3]=Zt,A.ca=Z,A.tb=ce,A.c=l.width,A.i=l.height,t(0<A.c&&0<A.i),1>=B)l=0;else if(A.$a=3&k[F+0],A.Z=k[F+0]>>2&3,A.Lc=k[F+0]>>4&3,F=k[F+0]>>6&3,0>A.$a||1<A.$a||4<=A.Z||1<A.Lc||F)l=0;else if(ie.put=tt,ie.ac=on,ie.bc=_n,ie.ma=A,ie.width=l.width,ie.height=l.height,ie.Da=l.Da,ie.v=l.v,ie.va=l.va,ie.j=l.j,ie.o=l.o,A.$a)e:{t(A.$a==1),l=hi();t:for(;;){if(l==null){l=0;break e}if(t(A!=null),A.mc=l,l.c=A.c,l.i=A.i,l.l=A.l,l.l.ma=A,l.l.width=A.c,l.l.height=A.i,l.a=0,ge(l.m,k,q,ee),!cn(A.c,A.i,1,l,null)||(l.ab==1&&l.gc[0].hc==3&&Gr(l.s)?(A.ic=1,k=l.c*l.i,l.Ta=null,l.Ua=0,l.V=a(k),l.Ba=0,l.V==null?(l.a=1,l=0):l=1):(A.ic=0,l=di(l,A.c)),!l))break t;l=1;break e}A.mc=null,l=0}else l=ee>=A.c*A.i;A=!l}if(A)return null;i.ga.Lc!=1?i.Ga=0:x=_-f}t(i.ga!=null),t(f+x<=_);e:{if(l=(k=i.ga).c,_=k.l.o,k.$a==0){if(q=i.rc,ee=i.Vc,ie=i.Fa,F=i.P+1+f*l,B=i.mb,Z=i.nb+f*l,t(F<=i.P+i.qc),k.Z!=0)for(t(ei[k.Z]!=null),A=0;A<x;++A)ei[k.Z](q,ee,ie,F,B,Z,l),q=B,ee=Z,Z+=l,F+=l;else for(A=0;A<x;++A)n(B,Z,ie,F,l),q=B,ee=Z,Z+=l,F+=l;i.rc=q,i.Vc=ee}else{if(t(k.mc!=null),l=f+x,t((A=k.mc)!=null),t(l<=A.i),A.C>=l)l=1;else if(k.ic||Xr(),k.ic){k=A.V,q=A.Ba,ee=A.c;var xe=A.i,le=(ie=1,F=A.$/ee,B=A.$%ee,Z=A.m,ce=A.s,A.$),be=ee*xe,we=ee*l,Le=ce.wc,Se=le<we?lr(ce,B,F):null;t(le<=be),t(l<=xe),t(Gr(ce));t:for(;;){for(;!Z.h&&le<we;){if(B&Le||(Se=lr(ce,B,F)),t(Se!=null),Y(Z),256>(xe=qt(Se.G[0],Se.H[0],Z)))k[q+le]=xe,++le,++B>=ee&&(B=0,++F<=l&&!(F%16)&&Jr(A,F));else{if(!(280>xe)){ie=0;break t}xe=Rr(xe-256,Z);var Xe,Ue=qt(Se.G[4],Se.H[4],Z);if(Y(Z),!(le>=(Ue=Dr(ee,Ue=Rr(Ue,Z)))&&be-le>=xe)){ie=0;break t}for(Xe=0;Xe<xe;++Xe)k[q+le+Xe]=k[q+le+Xe-Ue];for(le+=xe,B+=xe;B>=ee;)B-=ee,++F<=l&&!(F%16)&&Jr(A,F);le<we&&B&Le&&(Se=lr(ce,B,F))}t(Z.h==z(Z))}Jr(A,F>l?l:F);break t}!ie||Z.h&&le<be?(ie=0,A.a=Z.h?5:3):A.$=le,l=ie}else l=Yr(A,A.V,A.Ba,A.c,A.i,l,Ti);if(!l){x=0;break e}}f+x>=_&&(i.Cc=1),x=1}if(!x)return null;if(i.Cc&&((x=i.ga)!=null&&(x.mc=null),i.ga=null,0<i.Ga))return alert("todo:WebPDequantizeLevels"),null}return i.nb+f*y}function tr(i,l,f,x,y,_){for(;0<y--;){var A,k=i,F=l+(f?1:0),B=i,Z=l+(f?0:3);for(A=0;A<x;++A){var ce=B[Z+4*A];ce!=255&&(ce*=32897,k[F+4*A+0]=k[F+4*A+0]*ce>>23,k[F+4*A+1]=k[F+4*A+1]*ce>>23,k[F+4*A+2]=k[F+4*A+2]*ce>>23)}l+=_}}function Qt(i,l,f,x,y){for(;0<x--;){var _;for(_=0;_<f;++_){var A=i[l+2*_+0],k=15&(B=i[l+2*_+1]),F=4369*k,B=(240&B|B>>4)*F>>16;i[l+2*_+0]=(240&A|A>>4)*F>>16&240|(15&A|A<<4)*F>>16>>4&15,i[l+2*_+1]=240&B|k}l+=y}}function cr(i,l,f,x,y,_,A,k){var F,B,Z=255;for(B=0;B<y;++B){for(F=0;F<x;++F){var ce=i[l+F];_[A+4*F]=ce,Z&=ce}l+=f,A+=k}return Z!=255}function Fn(i,l,f,x,y){var _;for(_=0;_<y;++_)f[x+_]=i[l+_]>>8}function Xr(){ks=tr,Al=Qt,Sl=cr,Ll=Fn}function En(i,l,f){R[i]=function(x,y,_,A,k,F,B,Z,ce,q,ee,ie,xe,le,be,we,Le){var Se,Xe=Le-1>>1,Ue=k[F+0]|B[Z+0]<<16,pt=ce[q+0]|ee[ie+0]<<16;t(x!=null);var $e=3*Ue+pt+131074>>2;for(l(x[y+0],255&$e,$e>>16,xe,le),_!=null&&($e=3*pt+Ue+131074>>2,l(_[A+0],255&$e,$e>>16,be,we)),Se=1;Se<=Xe;++Se){var vt=k[F+Se]|B[Z+Se]<<16,nr=ce[q+Se]|ee[ie+Se]<<16,gt=Ue+vt+pt+nr+524296,Ge=gt+2*(vt+pt)>>3;$e=Ge+Ue>>1,Ue=(gt=gt+2*(Ue+nr)>>3)+vt>>1,l(x[y+2*Se-1],255&$e,$e>>16,xe,le+(2*Se-1)*f),l(x[y+2*Se-0],255&Ue,Ue>>16,xe,le+(2*Se-0)*f),_!=null&&($e=gt+pt>>1,Ue=Ge+nr>>1,l(_[A+2*Se-1],255&$e,$e>>16,be,we+(2*Se-1)*f),l(_[A+2*Se+0],255&Ue,Ue>>16,be,we+(2*Se+0)*f)),Ue=vt,pt=nr}1&Le||($e=3*Ue+pt+131074>>2,l(x[y+Le-1],255&$e,$e>>16,xe,le+(Le-1)*f),_!=null&&($e=3*pt+Ue+131074>>2,l(_[A+Le-1],255&$e,$e>>16,be,we+(Le-1)*f)))}}function xs(){Vr[la]=Mh,Vr[ca]=Dl,Vr[El]=Rh,Vr[ua]=Bl,Vr[ha]=ql,Vr[po]=Ul,Vr[Ol]=Dh,Vr[go]=Dl,Vr[mo]=Bl,Vr[da]=ql,Vr[xo]=Ul}function Hi(i){return i&-16384?0>i?0:255:i>>Bh}function Wn(i,l){return Hi((19077*i>>8)+(26149*l>>8)-14234)}function bi(i,l,f){return Hi((19077*i>>8)-(6419*l>>8)-(13320*f>>8)+8708)}function vi(i,l){return Hi((19077*i>>8)+(33050*l>>8)-17685)}function Vn(i,l,f,x,y){x[y+0]=Wn(i,f),x[y+1]=bi(i,l,f),x[y+2]=vi(i,l)}function ur(i,l,f,x,y){x[y+0]=vi(i,l),x[y+1]=bi(i,l,f),x[y+2]=Wn(i,f)}function yi(i,l,f,x,y){var _=bi(i,l,f);l=_<<3&224|vi(i,l)>>3,x[y+0]=248&Wn(i,f)|_>>5,x[y+1]=l}function wi(i,l,f,x,y){var _=240&vi(i,l)|15;x[y+0]=240&Wn(i,f)|bi(i,l,f)>>4,x[y+1]=_}function bs(i,l,f,x,y){x[y+0]=255,Vn(i,l,f,x,y+1)}function vs(i,l,f,x,y){ur(i,l,f,x,y),x[y+3]=255}function yr(i,l,f,x,y){Vn(i,l,f,x,y),x[y+3]=255}function On(i,l,f){R[i]=function(x,y,_,A,k,F,B,Z,ce){for(var q=Z+(-2&ce)*f;Z!=q;)l(x[y+0],_[A+0],k[F+0],B,Z),l(x[y+1],_[A+0],k[F+0],B,Z+f),y+=2,++A,++F,Z+=2*f;1&ce&&l(x[y+0],_[A+0],k[F+0],B,Z)}}function Wi(i,l,f){return f==0?i==0?l==0?6:5:l==0?4:0:f}function ia(i,l,f,x,y){switch(i>>>30){case 3:Ai(l,f,x,y,0);break;case 2:Hr(l,f,x,y);break;case 1:_t(l,f,x,y)}}function zr(i,l){var f,x,y=l.M,_=l.Nb,A=i.oc,k=i.pc+40,F=i.oc,B=i.pc+584,Z=i.oc,ce=i.pc+600;for(f=0;16>f;++f)A[k+32*f-1]=129;for(f=0;8>f;++f)F[B+32*f-1]=129,Z[ce+32*f-1]=129;for(0<y?A[k-1-32]=F[B-1-32]=Z[ce-1-32]=129:(s(A,k-32-1,127,21),s(F,B-32-1,127,9),s(Z,ce-32-1,127,9)),x=0;x<i.za;++x){var q=l.ya[l.aa+x];if(0<x){for(f=-1;16>f;++f)n(A,k+32*f-4,A,k+32*f+12,4);for(f=-1;8>f;++f)n(F,B+32*f-4,F,B+32*f+4,4),n(Z,ce+32*f-4,Z,ce+32*f+4,4)}var ee=i.Gd,ie=i.Hd+x,xe=q.ad,le=q.Hc;if(0<y&&(n(A,k-32,ee[ie].y,0,16),n(F,B-32,ee[ie].f,0,8),n(Z,ce-32,ee[ie].ea,0,8)),q.Za){var be=A,we=k-32+16;for(0<y&&(x>=i.za-1?s(be,we,ee[ie].y[15],4):n(be,we,ee[ie+1].y,0,4)),f=0;4>f;f++)be[we+128+f]=be[we+256+f]=be[we+384+f]=be[we+0+f];for(f=0;16>f;++f,le<<=2)be=A,we=k+Hl[f],Zr[q.Ob[f]](be,we),ia(le,xe,16*+f,be,we)}else if(be=Wi(x,y,q.Ob[0]),Qn[be](A,k),le!=0)for(f=0;16>f;++f,le<<=2)ia(le,xe,16*+f,A,k+Hl[f]);for(f=q.Gc,be=Wi(x,y,q.Dd),Rn[be](F,B),Rn[be](Z,ce),le=xe,be=F,we=B,255&(q=0|f)&&(170&q?gn(le,256,be,we):Ct(le,256,be,we)),q=Z,le=ce,255&(f>>=8)&&(170&f?gn(xe,320,q,le):Ct(xe,320,q,le)),y<i.Ub-1&&(n(ee[ie].y,0,A,k+480,16),n(ee[ie].f,0,F,B+224,8),n(ee[ie].ea,0,Z,ce+224,8)),f=8*_*i.B,ee=i.sa,ie=i.ta+16*x+16*_*i.R,xe=i.qa,q=i.ra+8*x+f,le=i.Ha,be=i.Ia+8*x+f,f=0;16>f;++f)n(ee,ie+f*i.R,A,k+32*f,16);for(f=0;8>f;++f)n(xe,q+f*i.B,F,B+32*f,8),n(le,be+f*i.B,Z,ce+32*f,8)}}function Ni(i,l,f,x,y,_,A,k,F){var B=[0],Z=[0],ce=0,q=F!=null?F.kd:0,ee=F??new Ae;if(i==null||12>f)return 7;ee.data=i,ee.w=l,ee.ha=f,l=[l],f=[f],ee.gb=[ee.gb];e:{var ie=l,xe=f,le=ee.gb;if(t(i!=null),t(xe!=null),t(le!=null),le[0]=0,12<=xe[0]&&!r(i,ie[0],"RIFF")){if(r(i,ie[0]+8,"WEBP")){le=3;break e}var be=ke(i,ie[0]+4);if(12>be||4294967286<be){le=3;break e}if(q&&be>xe[0]-8){le=7;break e}le[0]=be,ie[0]+=12,xe[0]-=12}le=0}if(le!=0)return le;for(be=0<ee.gb[0],f=f[0];;){e:{var we=i;xe=l,le=f;var Le=B,Se=Z,Xe=ie=[0];if(($e=ce=[ce])[0]=0,8>le[0])le=7;else{if(!r(we,xe[0],"VP8X")){if(ke(we,xe[0]+4)!=10){le=3;break e}if(18>le[0]){le=7;break e}var Ue=ke(we,xe[0]+8),pt=1+Ce(we,xe[0]+12);if(2147483648<=pt*(we=1+Ce(we,xe[0]+15))){le=3;break e}Xe!=null&&(Xe[0]=Ue),Le!=null&&(Le[0]=pt),Se!=null&&(Se[0]=we),xe[0]+=18,le[0]-=18,$e[0]=1}le=0}}if(ce=ce[0],ie=ie[0],le!=0)return le;if(xe=!!(2&ie),!be&&ce)return 3;if(_!=null&&(_[0]=!!(16&ie)),A!=null&&(A[0]=xe),k!=null&&(k[0]=0),A=B[0],ie=Z[0],ce&&xe&&F==null){le=0;break}if(4>f){le=7;break}if(be&&ce||!be&&!ce&&!r(i,l[0],"ALPH")){f=[f],ee.na=[ee.na],ee.P=[ee.P],ee.Sa=[ee.Sa];e:{Ue=i,le=l,be=f;var $e=ee.gb;Le=ee.na,Se=ee.P,Xe=ee.Sa,pt=22,t(Ue!=null),t(be!=null),we=le[0];var vt=be[0];for(t(Le!=null),t(Xe!=null),Le[0]=null,Se[0]=null,Xe[0]=0;;){if(le[0]=we,be[0]=vt,8>vt){le=7;break e}var nr=ke(Ue,we+4);if(4294967286<nr){le=3;break e}var gt=8+nr+1&-2;if(pt+=gt,0<$e&&pt>$e){le=3;break e}if(!r(Ue,we,"VP8 ")||!r(Ue,we,"VP8L")){le=0;break e}if(vt[0]<gt){le=7;break e}r(Ue,we,"ALPH")||(Le[0]=Ue,Se[0]=we+8,Xe[0]=nr),we+=gt,vt-=gt}}if(f=f[0],ee.na=ee.na[0],ee.P=ee.P[0],ee.Sa=ee.Sa[0],le!=0)break}f=[f],ee.Ja=[ee.Ja],ee.xa=[ee.xa];e:if($e=i,le=l,be=f,Le=ee.gb[0],Se=ee.Ja,Xe=ee.xa,Ue=le[0],we=!r($e,Ue,"VP8 "),pt=!r($e,Ue,"VP8L"),t($e!=null),t(be!=null),t(Se!=null),t(Xe!=null),8>be[0])le=7;else{if(we||pt){if($e=ke($e,Ue+4),12<=Le&&$e>Le-12){le=3;break e}if(q&&$e>be[0]-8){le=7;break e}Se[0]=$e,le[0]+=8,be[0]-=8,Xe[0]=pt}else Xe[0]=5<=be[0]&&$e[Ue+0]==47&&!($e[Ue+4]>>5),Se[0]=be[0];le=0}if(f=f[0],ee.Ja=ee.Ja[0],ee.xa=ee.xa[0],l=l[0],le!=0)break;if(4294967286<ee.Ja)return 3;if(k==null||xe||(k[0]=ee.xa?2:1),A=[A],ie=[ie],ee.xa){if(5>f){le=7;break}k=A,q=ie,xe=_,i==null||5>f?i=0:5<=f&&i[l+0]==47&&!(i[l+4]>>5)?(be=[0],$e=[0],Le=[0],ge(Se=new I,i,l,f),jn(Se,be,$e,Le)?(k!=null&&(k[0]=be[0]),q!=null&&(q[0]=$e[0]),xe!=null&&(xe[0]=Le[0]),i=1):i=0):i=0}else{if(10>f){le=7;break}k=ie,i==null||10>f||!Gs(i,l+3,f-3)?i=0:(q=i[l+0]|i[l+1]<<8|i[l+2]<<16,xe=16383&(i[l+7]<<8|i[l+6]),i=16383&(i[l+9]<<8|i[l+8]),1&q||3<(q>>1&7)||!(q>>4&1)||q>>5>=ee.Ja||!xe||!i?i=0:(A&&(A[0]=xe),k&&(k[0]=i),i=1))}if(!i||(A=A[0],ie=ie[0],ce&&(B[0]!=A||Z[0]!=ie)))return 3;F!=null&&(F[0]=ee,F.offset=l-F.w,t(4294967286>l-F.w),t(F.offset==F.ha-f));break}return le==0||le==7&&ce&&F==null?(_!=null&&(_[0]|=ee.na!=null&&0<ee.na.length),x!=null&&(x[0]=A),y!=null&&(y[0]=ie),0):le}function ys(i,l,f){var x=l.width,y=l.height,_=0,A=0,k=x,F=y;if(l.Da=i!=null&&0<i.Da,l.Da&&(k=i.cd,F=i.bd,_=i.v,A=i.j,11>f||(_&=-2,A&=-2),0>_||0>A||0>=k||0>=F||_+k>x||A+F>y))return 0;if(l.v=_,l.j=A,l.va=_+k,l.o=A+F,l.U=k,l.T=F,l.da=i!=null&&0<i.da,l.da){if(!Re(k,F,f=[i.ib],_=[i.hb]))return 0;l.ib=f[0],l.hb=_[0]}return l.ob=i!=null&&i.ob,l.Kb=i==null||!i.Sd,l.da&&(l.ob=l.ib<3*x/4&&l.hb<3*y/4,l.Kb=0),1}function ws(i){if(i==null)return 2;if(11>i.S){var l=i.f.RGBA;l.fb+=(i.height-1)*l.A,l.A=-l.A}else l=i.f.kb,i=i.height,l.O+=(i-1)*l.fa,l.fa=-l.fa,l.N+=(i-1>>1)*l.Ab,l.Ab=-l.Ab,l.W+=(i-1>>1)*l.Db,l.Db=-l.Db,l.F!=null&&(l.J+=(i-1)*l.lb,l.lb=-l.lb);return 0}function $n(i,l,f,x){if(x==null||0>=i||0>=l)return 2;if(f!=null){if(f.Da){var y=f.cd,_=f.bd,A=-2&f.v,k=-2&f.j;if(0>A||0>k||0>=y||0>=_||A+y>i||k+_>l)return 2;i=y,l=_}if(f.da){if(!Re(i,l,y=[f.ib],_=[f.hb]))return 2;i=y[0],l=_[0]}}x.width=i,x.height=l;e:{var F=x.width,B=x.height;if(i=x.S,0>=F||0>=B||!(i>=la&&13>i))i=2;else{if(0>=x.Rd&&x.sd==null){A=_=y=l=0;var Z=(k=F*Wl[i])*B;if(11>i||(_=(B+1)/2*(l=(F+1)/2),i==12&&(A=(y=F)*B)),(B=a(Z+2*_+A))==null){i=1;break e}x.sd=B,11>i?((F=x.f.RGBA).eb=B,F.fb=0,F.A=k,F.size=Z):((F=x.f.kb).y=B,F.O=0,F.fa=k,F.Fd=Z,F.f=B,F.N=0+Z,F.Ab=l,F.Cd=_,F.ea=B,F.W=0+Z+_,F.Db=l,F.Ed=_,i==12&&(F.F=B,F.J=0+Z+2*_),F.Tc=A,F.lb=y)}if(l=1,y=x.S,_=x.width,A=x.height,y>=la&&13>y)if(11>y)i=x.f.RGBA,l&=(k=Math.abs(i.A))*(A-1)+_<=i.size,l&=k>=_*Wl[y],l&=i.eb!=null;else{i=x.f.kb,k=(_+1)/2,Z=(A+1)/2,F=Math.abs(i.fa),B=Math.abs(i.Ab);var ce=Math.abs(i.Db),q=Math.abs(i.lb),ee=q*(A-1)+_;l&=F*(A-1)+_<=i.Fd,l&=B*(Z-1)+k<=i.Cd,l=(l&=ce*(Z-1)+k<=i.Ed)&F>=_&B>=k&ce>=k,l&=i.y!=null,l&=i.f!=null,l&=i.ea!=null,y==12&&(l&=q>=_,l&=ee<=i.Tc,l&=i.F!=null)}else l=0;i=l?0:2}}return i!=0||f!=null&&f.fd&&(i=ws(x)),i}var _i=64,Lr=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],kr=24,Gn=32,Tn=8,Jn=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];Te("Predictor0","PredictorAdd0"),R.Predictor0=function(){return 4278190080},R.Predictor1=function(i){return i},R.Predictor2=function(i,l,f){return l[f+0]},R.Predictor3=function(i,l,f){return l[f+1]},R.Predictor4=function(i,l,f){return l[f-1]},R.Predictor5=function(i,l,f){return Je(Je(i,l[f+1]),l[f+0])},R.Predictor6=function(i,l,f){return Je(i,l[f-1])},R.Predictor7=function(i,l,f){return Je(i,l[f+0])},R.Predictor8=function(i,l,f){return Je(l[f-1],l[f+0])},R.Predictor9=function(i,l,f){return Je(l[f+0],l[f+1])},R.Predictor10=function(i,l,f){return Je(Je(i,l[f-1]),Je(l[f+0],l[f+1]))},R.Predictor11=function(i,l,f){var x=l[f+0];return 0>=rt(x>>24&255,i>>24&255,(l=l[f-1])>>24&255)+rt(x>>16&255,i>>16&255,l>>16&255)+rt(x>>8&255,i>>8&255,l>>8&255)+rt(255&x,255&i,255&l)?x:i},R.Predictor12=function(i,l,f){var x=l[f+0];return(Ee((i>>24&255)+(x>>24&255)-((l=l[f-1])>>24&255))<<24|Ee((i>>16&255)+(x>>16&255)-(l>>16&255))<<16|Ee((i>>8&255)+(x>>8&255)-(l>>8&255))<<8|Ee((255&i)+(255&x)-(255&l)))>>>0},R.Predictor13=function(i,l,f){var x=l[f-1];return(ut((i=Je(i,l[f+0]))>>24&255,x>>24&255)<<24|ut(i>>16&255,x>>16&255)<<16|ut(i>>8&255,x>>8&255)<<8|ut(255&i,255&x))>>>0};var Ns=R.PredictorAdd0;R.PredictorAdd1=xt,Te("Predictor2","PredictorAdd2"),Te("Predictor3","PredictorAdd3"),Te("Predictor4","PredictorAdd4"),Te("Predictor5","PredictorAdd5"),Te("Predictor6","PredictorAdd6"),Te("Predictor7","PredictorAdd7"),Te("Predictor8","PredictorAdd8"),Te("Predictor9","PredictorAdd9"),Te("Predictor10","PredictorAdd10"),Te("Predictor11","PredictorAdd11"),Te("Predictor12","PredictorAdd12"),Te("Predictor13","PredictorAdd13");var Vi=R.PredictorAdd2;He("ColorIndexInverseTransform","MapARGB","32b",function(i){return i>>8&255},function(i){return i}),He("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(i){return i},function(i){return i>>8&255});var Wt,sa=R.ColorIndexInverseTransform,fn=R.MapARGB,pn=R.VP8LColorIndexInverseTransformAlpha,_s=R.MapAlpha,js=R.VP8LPredictorsAdd=[];js.length=16,(R.VP8LPredictors=[]).length=16,(R.VP8LPredictorsAdd_C=[]).length=16,(R.VP8LPredictors_C=[]).length=16;var As,Ss,Yn,Kn,Xn,ji,Zn,Ai,Hr,gn,_t,Ct,Vt,rr,Mn,Ls,$i,aa,vl,yl,wl,Nl,_l,jl,ks,Al,Sl,Ll,kl=a(511),Cl=a(2041),Pl=a(225),Il=a(767),Fl=0,fo=Cl,oa=Pl,Cr=Il,Wr=kl,la=0,ca=1,El=2,ua=3,ha=4,po=5,Ol=6,go=7,mo=8,da=9,xo=10,Nh=[2,3,7],_h=[3,3,11],Tl=[280,256,256,256,40],jh=[0,1,1,1,0],Ah=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Sh=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Lh=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],kh=8,bo=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],vo=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],Cs=null,Ch=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],Ph=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],Ml=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],Ih=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],Fh=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],Eh=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],Oh=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Qn=[],Zr=[],Rn=[],Th=1,Rl=2,ei=[],Vr=[];En("UpsampleRgbLinePair",Vn,3),En("UpsampleBgrLinePair",ur,3),En("UpsampleRgbaLinePair",yr,4),En("UpsampleBgraLinePair",vs,4),En("UpsampleArgbLinePair",bs,4),En("UpsampleRgba4444LinePair",wi,2),En("UpsampleRgb565LinePair",yi,2);var Mh=R.UpsampleRgbLinePair,Rh=R.UpsampleBgrLinePair,Dl=R.UpsampleRgbaLinePair,Bl=R.UpsampleBgraLinePair,ql=R.UpsampleArgbLinePair,Ul=R.UpsampleRgba4444LinePair,Dh=R.UpsampleRgb565LinePair,fa=16,pa=1<<fa-1,Ps=-227,yo=482,Bh=6,zl=0,qh=a(256),Uh=a(256),zh=a(256),Hh=a(256),Wh=a(yo-Ps),Vh=a(yo-Ps);On("YuvToRgbRow",Vn,3),On("YuvToBgrRow",ur,3),On("YuvToRgbaRow",yr,4),On("YuvToBgraRow",vs,4),On("YuvToArgbRow",bs,4),On("YuvToRgba4444Row",wi,2),On("YuvToRgb565Row",yi,2);var Hl=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],ga=[0,2,8],$h=[8,7,6,4,4,2,2,2,1,1,1,1],Gh=1;this.WebPDecodeRGBA=function(i,l,f,x,y){var _=ca,A=new ve,k=new Be;A.ba=k,k.S=_,k.width=[k.width],k.height=[k.height];var F=k.width,B=k.height,Z=new Me;if(Z==null||i==null)var ce=2;else t(Z!=null),ce=Ni(i,l,f,Z.width,Z.height,Z.Pd,Z.Qd,Z.format,null);if(ce!=0?F=0:(F!=null&&(F[0]=Z.width[0]),B!=null&&(B[0]=Z.height[0]),F=1),F){k.width=k.width[0],k.height=k.height[0],x!=null&&(x[0]=k.width),y!=null&&(y[0]=k.height);e:{if(x=new Di,(y=new Ae).data=i,y.w=l,y.ha=f,y.kd=1,l=[0],t(y!=null),((i=Ni(y.data,y.w,y.ha,null,null,null,l,null,y))==0||i==7)&&l[0]&&(i=4),(l=i)==0){if(t(A!=null),x.data=y.data,x.w=y.w+y.offset,x.ha=y.ha-y.offset,x.put=tt,x.ac=on,x.bc=_n,x.ma=A,y.xa){if((i=hi())==null){A=1;break e}if(function(q,ee){var ie=[0],xe=[0],le=[0];t:for(;;){if(q==null)return 0;if(ee==null)return q.a=2,0;if(q.l=ee,q.a=0,ge(q.m,ee.data,ee.w,ee.ha),!jn(q.m,ie,xe,le)){q.a=3;break t}if(q.xb=Rl,ee.width=ie[0],ee.height=xe[0],!cn(ie[0],xe[0],1,q,null))break t;return 1}return t(q.a!=0),0}(i,x)){if(x=(l=$n(x.width,x.height,A.Oa,A.ba))==0){t:{x=i;r:for(;;){if(x==null){x=0;break t}if(t(x.s.yc!=null),t(x.s.Ya!=null),t(0<x.s.Wb),t((f=x.l)!=null),t((y=f.ma)!=null),x.xb!=0){if(x.ca=y.ba,x.tb=y.tb,t(x.ca!=null),!ys(y.Oa,f,ua)){x.a=2;break r}if(!di(x,f.width)||f.da)break r;if((f.da||_e(x.ca.S))&&Xr(),11>x.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),x.ca.f.kb.F!=null&&Xr()),x.Pb&&0<x.s.ua&&x.s.vb.X==null&&!E(x.s.vb,x.s.Wa.Xa)){x.a=1;break r}x.xb=0}if(!Yr(x,x.V,x.Ba,x.c,x.i,f.o,Hn))break r;y.Dc=x.Ma,x=1;break t}t(x.a!=0),x=0}x=!x}x&&(l=i.a)}else l=i.a}else{if((i=new Xa)==null){A=1;break e}if(i.Fa=y.na,i.P=y.P,i.qc=y.Sa,hn(i,x)){if((l=$n(x.width,x.height,A.Oa,A.ba))==0){if(i.Aa=0,f=A.Oa,t((y=i)!=null),f!=null){if(0<(F=0>(F=f.Md)?0:100<F?255:255*F/100)){for(B=Z=0;4>B;++B)12>(ce=y.pb[B]).lc&&(ce.ia=F*$h[0>ce.lc?0:ce.lc]>>3),Z|=ce.ia;Z&&(alert("todo:VP8InitRandom"),y.ia=1)}y.Ga=f.Id,100<y.Ga?y.Ga=100:0>y.Ga&&(y.Ga=0)}(function(q,ee){if(q==null)return 0;if(ee==null)return Xt(q,2,"NULL VP8Io parameter in VP8Decode().");if(!q.cb&&!hn(q,ee))return 0;if(t(q.cb),ee.ac==null||ee.ac(ee)){ee.ob&&(q.L=0);var ie=ga[q.L];if(q.L==2?(q.yb=0,q.zb=0):(q.yb=ee.v-ie>>4,q.zb=ee.j-ie>>4,0>q.yb&&(q.yb=0),0>q.zb&&(q.zb=0)),q.Va=ee.o+15+ie>>4,q.Hb=ee.va+15+ie>>4,q.Hb>q.za&&(q.Hb=q.za),q.Va>q.Ub&&(q.Va=q.Ub),0<q.L){var xe=q.ed;for(ie=0;4>ie;++ie){var le;if(q.Qa.Cb){var be=q.Qa.Lb[ie];q.Qa.Fb||(be+=xe.Tb)}else be=xe.Tb;for(le=0;1>=le;++le){var we=q.gd[ie][le],Le=be;if(xe.Pc&&(Le+=xe.vd[0],le&&(Le+=xe.od[0])),0<(Le=0>Le?0:63<Le?63:Le)){var Se=Le;0<xe.wb&&(Se=4<xe.wb?Se>>2:Se>>1)>9-xe.wb&&(Se=9-xe.wb),1>Se&&(Se=1),we.dd=Se,we.tc=2*Le+Se,we.ld=40<=Le?2:15<=Le?1:0}else we.tc=0;we.La=le}}}ie=0}else Xt(q,6,"Frame setup failed"),ie=q.a;if(ie=ie==0){if(ie){q.$c=0,0<q.Aa||(q.Ic=Gh);t:{ie=q.Ic,xe=4*(Se=q.za);var Xe=32*Se,Ue=Se+1,pt=0<q.L?Se*(0<q.Aa?2:1):0,$e=(q.Aa==2?2:1)*Se;if((we=xe+832+(le=3*(16*ie+ga[q.L])/2*Xe)+(be=q.Fa!=null&&0<q.Fa.length?q.Kc.c*q.Kc.i:0))!=we)ie=0;else{if(we>q.Vb){if(q.Vb=0,q.Ec=a(we),q.Fc=0,q.Ec==null){ie=Xt(q,1,"no memory during frame initialization.");break t}q.Vb=we}we=q.Ec,Le=q.Fc,q.Ac=we,q.Bc=Le,Le+=xe,q.Gd=h(Xe,Vs),q.Hd=0,q.rb=h(Ue+1,os),q.sb=1,q.wa=pt?h(pt,qr):null,q.Y=0,q.D.Nb=0,q.D.wa=q.wa,q.D.Y=q.Y,0<q.Aa&&(q.D.Y+=Se),t(!0),q.oc=we,q.pc=Le,Le+=832,q.ya=h($e,ls),q.aa=0,q.D.ya=q.ya,q.D.aa=q.aa,q.Aa==2&&(q.D.aa+=Se),q.R=16*Se,q.B=8*Se,Se=(Xe=ga[q.L])*q.R,Xe=Xe/2*q.B,q.sa=we,q.ta=Le+Se,q.qa=q.sa,q.ra=q.ta+16*ie*q.R+Xe,q.Ha=q.qa,q.Ia=q.ra+8*ie*q.B+Xe,q.$c=0,Le+=le,q.mb=be?we:null,q.nb=be?Le:null,t(Le+be<=q.Fc+q.Vb),Js(q),s(q.Ac,q.Bc,0,xe),ie=1}}if(ie){if(ee.ka=0,ee.y=q.sa,ee.O=q.ta,ee.f=q.qa,ee.N=q.ra,ee.ea=q.Ha,ee.Vd=q.Ia,ee.fa=q.R,ee.Rc=q.B,ee.F=null,ee.J=0,!Fl){for(ie=-255;255>=ie;++ie)kl[255+ie]=0>ie?-ie:ie;for(ie=-1020;1020>=ie;++ie)Cl[1020+ie]=-128>ie?-128:127<ie?127:ie;for(ie=-112;112>=ie;++ie)Pl[112+ie]=-16>ie?-16:15<ie?15:ie;for(ie=-255;510>=ie;++ie)Il[255+ie]=0>ie?0:255<ie?255:ie;Fl=1}Zn=qi,Ai=Qa,gn=dn,_t=Ks,Ct=Xs,Hr=Za,Vt=ra,rr=xi,Mn=v,Ls=U,$i=na,aa=u,vl=J,yl=te,wl=mi,Nl=ms,_l=ea,jl=ta,Zr[0]=oo,Zr[1]=eo,Zr[2]=so,Zr[3]=ao,Zr[4]=Sn,Zr[5]=lo,Zr[6]=Ln,Zr[7]=co,Zr[8]=hs,Zr[9]=Ui,Qn[0]=no,Qn[1]=ro,Qn[2]=cs,Qn[3]=Zs,Qn[4]=pi,Qn[5]=us,Qn[6]=io,Rn[0]=ho,Rn[1]=to,Rn[2]=gi,Rn[3]=uo,Rn[4]=fs,Rn[5]=ds,Rn[6]=Qs,ie=1}else ie=0}ie&&(ie=function(vt,nr){for(vt.M=0;vt.M<vt.Va;++vt.M){var gt,Ge=vt.Jc[vt.M&vt.Xb],Oe=vt.m,$t=vt;for(gt=0;gt<$t.za;++gt){var ct=Oe,yt=$t,Mt=yt.Ac,hr=yt.Bc+4*gt,wr=yt.zc,Ut=yt.ya[yt.aa+gt];if(yt.Qa.Bb?Ut.$b=de(ct,yt.Pa.jb[0])?2+de(ct,yt.Pa.jb[2]):de(ct,yt.Pa.jb[1]):Ut.$b=0,yt.kc&&(Ut.Ad=de(ct,yt.Bd)),Ut.Za=!de(ct,145)+0,Ut.Za){var gr=Ut.Ob,Nr=0;for(yt=0;4>yt;++yt){var ir,Nt=wr[0+yt];for(ir=0;4>ir;++ir){Nt=Fh[Mt[hr+ir]][Nt];for(var At=Ml[de(ct,Nt[0])];0<At;)At=Ml[2*At+de(ct,Nt[At])];Nt=-At,Mt[hr+ir]=Nt}n(gr,Nr,Mt,hr,4),Nr+=4,wr[0+yt]=Nt}}else Nt=de(ct,156)?de(ct,128)?1:3:de(ct,163)?2:0,Ut.Ob[0]=Nt,s(Mt,hr,Nt,4),s(wr,0,Nt,4);Ut.Dd=de(ct,142)?de(ct,114)?de(ct,183)?1:3:2:0}if($t.m.Ka)return Xt(vt,7,"Premature end-of-partition0 encountered.");for(;vt.ja<vt.za;++vt.ja){if($t=Ge,ct=(Oe=vt).rb[Oe.sb-1],Mt=Oe.rb[Oe.sb+Oe.ja],gt=Oe.ya[Oe.aa+Oe.ja],hr=Oe.kc?gt.Ad:0)ct.la=Mt.la=0,gt.Za||(ct.Na=Mt.Na=0),gt.Hc=0,gt.Gc=0,gt.ia=0;else{var zt,St;if(ct=Mt,Mt=$t,hr=Oe.Pa.Xc,wr=Oe.ya[Oe.aa+Oe.ja],Ut=Oe.pb[wr.$b],yt=wr.ad,gr=0,Nr=Oe.rb[Oe.sb-1],Nt=ir=0,s(yt,gr,0,384),wr.Za)var dr=0,Qr=hr[3];else{At=a(16);var Gt=ct.Na+Nr.Na;if(Gt=Cs(Mt,hr[1],Gt,Ut.Eb,0,At,0),ct.Na=Nr.Na=(0<Gt)+0,1<Gt)Zn(At,0,yt,gr);else{var jr=At[0]+3>>3;for(At=0;256>At;At+=16)yt[gr+At]=jr}dr=1,Qr=hr[0]}var Pt=15&ct.la,sr=15&Nr.la;for(At=0;4>At;++At){var Pr=1&sr;for(jr=St=0;4>jr;++jr)Pt=Pt>>1|(Pr=(Gt=Cs(Mt,Qr,Gt=Pr+(1&Pt),Ut.Sc,dr,yt,gr))>dr)<<7,St=St<<2|(3<Gt?3:1<Gt?2:yt[gr+0]!=0),gr+=16;Pt>>=4,sr=sr>>1|Pr<<7,ir=(ir<<8|St)>>>0}for(Qr=Pt,dr=sr>>4,zt=0;4>zt;zt+=2){for(St=0,Pt=ct.la>>4+zt,sr=Nr.la>>4+zt,At=0;2>At;++At){for(Pr=1&sr,jr=0;2>jr;++jr)Gt=Pr+(1&Pt),Pt=Pt>>1|(Pr=0<(Gt=Cs(Mt,hr[2],Gt,Ut.Qc,0,yt,gr)))<<3,St=St<<2|(3<Gt?3:1<Gt?2:yt[gr+0]!=0),gr+=16;Pt>>=2,sr=sr>>1|Pr<<5}Nt|=St<<4*zt,Qr|=Pt<<4<<zt,dr|=(240&sr)<<zt}ct.la=Qr,Nr.la=dr,wr.Hc=ir,wr.Gc=Nt,wr.ia=43690&Nt?0:Ut.ia,hr=!(ir|Nt)}if(0<Oe.L&&(Oe.wa[Oe.Y+Oe.ja]=Oe.gd[gt.$b][gt.Za],Oe.wa[Oe.Y+Oe.ja].La|=!hr),$t.Ka)return Xt(vt,7,"Premature end-of-file encountered.")}if(Js(vt),Oe=nr,$t=1,gt=(Ge=vt).D,ct=0<Ge.L&&Ge.M>=Ge.zb&&Ge.M<=Ge.Va,Ge.Aa==0)t:{if(gt.M=Ge.M,gt.uc=ct,zr(Ge,gt),$t=1,gt=(St=Ge.D).Nb,ct=(Nt=ga[Ge.L])*Ge.R,Mt=Nt/2*Ge.B,At=16*gt*Ge.R,jr=8*gt*Ge.B,hr=Ge.sa,wr=Ge.ta-ct+At,Ut=Ge.qa,yt=Ge.ra-Mt+jr,gr=Ge.Ha,Nr=Ge.Ia-Mt+jr,sr=(Pt=St.M)==0,ir=Pt>=Ge.Va-1,Ge.Aa==2&&zr(Ge,St),St.uc)for(Pr=(Gt=Ge).D.M,t(Gt.D.uc),St=Gt.yb;St<Gt.Hb;++St){dr=St,Qr=Pr;var _r=(Ir=(fr=Gt).D).Nb;zt=fr.R;var Ir=Ir.wa[Ir.Y+dr],Fr=fr.sa,Ar=fr.ta+16*_r*zt+16*dr,Er=Ir.dd,Tt=Ir.tc;if(Tt!=0)if(t(3<=Tt),fr.L==1)0<dr&&Nl(Fr,Ar,zt,Tt+4),Ir.La&&jl(Fr,Ar,zt,Tt),0<Qr&&wl(Fr,Ar,zt,Tt+4),Ir.La&&_l(Fr,Ar,zt,Tt);else{var Or=fr.B,en=fr.qa,Si=fr.ra+8*_r*Or+8*dr,Dn=fr.Ha,fr=fr.Ia+8*_r*Or+8*dr;_r=Ir.ld,0<dr&&(rr(Fr,Ar,zt,Tt+4,Er,_r),Ls(en,Si,Dn,fr,Or,Tt+4,Er,_r)),Ir.La&&(aa(Fr,Ar,zt,Tt,Er,_r),yl(en,Si,Dn,fr,Or,Tt,Er,_r)),0<Qr&&(Vt(Fr,Ar,zt,Tt+4,Er,_r),Mn(en,Si,Dn,fr,Or,Tt+4,Er,_r)),Ir.La&&($i(Fr,Ar,zt,Tt,Er,_r),vl(en,Si,Dn,fr,Or,Tt,Er,_r))}}if(Ge.ia&&alert("todo:DitherRow"),Oe.put!=null){if(St=16*Pt,Pt=16*(Pt+1),sr?(Oe.y=Ge.sa,Oe.O=Ge.ta+At,Oe.f=Ge.qa,Oe.N=Ge.ra+jr,Oe.ea=Ge.Ha,Oe.W=Ge.Ia+jr):(St-=Nt,Oe.y=hr,Oe.O=wr,Oe.f=Ut,Oe.N=yt,Oe.ea=gr,Oe.W=Nr),ir||(Pt-=Nt),Pt>Oe.o&&(Pt=Oe.o),Oe.F=null,Oe.J=null,Ge.Fa!=null&&0<Ge.Fa.length&&St<Pt&&(Oe.J=Ot(Ge,Oe,St,Pt-St),Oe.F=Ge.mb,Oe.F==null&&Oe.F.length==0)){$t=Xt(Ge,3,"Could not decode alpha data.");break t}St<Oe.j&&(Nt=Oe.j-St,St=Oe.j,t(!(1&Nt)),Oe.O+=Ge.R*Nt,Oe.N+=Ge.B*(Nt>>1),Oe.W+=Ge.B*(Nt>>1),Oe.F!=null&&(Oe.J+=Oe.width*Nt)),St<Pt&&(Oe.O+=Oe.v,Oe.N+=Oe.v>>1,Oe.W+=Oe.v>>1,Oe.F!=null&&(Oe.J+=Oe.v),Oe.ka=St-Oe.j,Oe.U=Oe.va-Oe.v,Oe.T=Pt-St,$t=Oe.put(Oe))}gt+1!=Ge.Ic||ir||(n(Ge.sa,Ge.ta-ct,hr,wr+16*Ge.R,ct),n(Ge.qa,Ge.ra-Mt,Ut,yt+8*Ge.B,Mt),n(Ge.Ha,Ge.Ia-Mt,gr,Nr+8*Ge.B,Mt))}if(!$t)return Xt(vt,6,"Output aborted.")}return 1}(q,ee)),ee.bc!=null&&ee.bc(ee),ie&=1}return ie?(q.cb=0,ie):0})(i,x)||(l=i.a)}}else l=i.a}l==0&&A.Oa!=null&&A.Oa.fd&&(l=ws(A.ba))}A=l}_=A!=0?null:11>_?k.f.RGBA.eb:k.f.kb.y}else _=null;return _};var Wl=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function g(R,ne){for(var j="",P=0;P<4;P++)j+=String.fromCharCode(R[ne++]);return j}function m(R,ne){return R[ne+0]|R[ne+1]<<8}function w(R,ne){return(R[ne+0]|R[ne+1]<<8|R[ne+2]<<16)>>>0}function S(R,ne){return(R[ne+0]|R[ne+1]<<8|R[ne+2]<<16|R[ne+3]<<24)>>>0}new d;var p=[0],O=[0],N=[],T=new d,L=e,K=function(R,ne){var j={},P=0,G=!1,$=0,ue=0;if(j.frames=[],!function(b,I){for(var D=0;D<4;D++)if(b[I+D]!="RIFF".charCodeAt(D))return!0;return!1}(R,ne)){for(S(R,ne+=4),ne+=8;ne<R.length;){var fe=g(R,ne),me=S(R,ne+=4);ne+=4;var se=me+(1&me);switch(fe){case"VP8 ":case"VP8L":j.frames[P]===void 0&&(j.frames[P]={}),(M=j.frames[P]).src_off=G?ue:ne-8,M.src_size=$+me+8,P++,G&&(G=!1,$=0,ue=0);break;case"VP8X":(M=j.header={}).feature_flags=R[ne];var ge=ne+4;M.canvas_width=1+w(R,ge),ge+=3,M.canvas_height=1+w(R,ge),ge+=3;break;case"ALPH":G=!0,$=se+8,ue=ne-8;break;case"ANIM":(M=j.header).bgcolor=S(R,ne),ge=ne+4,M.loop_count=m(R,ge),ge+=2;break;case"ANMF":var W,M;(M=j.frames[P]={}).offset_x=2*w(R,ne),ne+=3,M.offset_y=2*w(R,ne),ne+=3,M.width=1+w(R,ne),ne+=3,M.height=1+w(R,ne),ne+=3,M.duration=w(R,ne),ne+=3,W=R[ne++],M.dispose=1&W,M.blend=W>>1&1}fe!="ANMF"&&(ne+=se)}return j}}(L,0);K.response=L,K.rgbaoutput=!0,K.dataurl=!1;var X=K.header?K.header:null,H=K.frames?K.frames:null;if(X){X.loop_counter=X.loop_count,p=[X.canvas_height],O=[X.canvas_width];for(var Q=0;Q<H.length&&H[Q].blend!=0;Q++);}var he=H[0],pe=T.WebPDecodeRGBA(L,he.src_off,he.src_size,O,p);he.rgba=pe,he.imgwidth=O[0],he.imgheight=p[0];for(var C=0;C<O[0]*p[0]*4;C++)N[C]=pe[C];return this.width=O,this.height=p,this.data=N,this}/** ====================================================================
 * @license
 * jsPDF XMP metadata plugin
 * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 * ====================================================================
 */function _1(){var e,t=this.internal.__metadata__.metadata,r=unescape(encodeURIComponent(t));e=this.internal.__metadata__.rawXml?r:'<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceUri+'"><jspdf:metadata>'+r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")+"</jspdf:metadata></rdf:Description></rdf:RDF></x:xmpmeta>",this.internal.__metadata__.metadataObjectNumber=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+e.length+" >>"),this.internal.write("stream"),this.internal.write(e),this.internal.write("endstream"),this.internal.write("endobj")}function j1(){this.internal.__metadata__.metadataObjectNumber&&this.internal.write("/Metadata "+this.internal.__metadata__.metadataObjectNumber+" 0 R")}(function(e){var t,r,n,s,a,h,c,d,g,m=function(b){return b=b||{},this.isStrokeTransparent=b.isStrokeTransparent||!1,this.strokeOpacity=b.strokeOpacity||1,this.strokeStyle=b.strokeStyle||"#000000",this.fillStyle=b.fillStyle||"#000000",this.isFillTransparent=b.isFillTransparent||!1,this.fillOpacity=b.fillOpacity||1,this.font=b.font||"10px sans-serif",this.textBaseline=b.textBaseline||"alphabetic",this.textAlign=b.textAlign||"left",this.lineWidth=b.lineWidth||1,this.lineJoin=b.lineJoin||"miter",this.lineCap=b.lineCap||"butt",this.path=b.path||[],this.transform=b.transform!==void 0?b.transform.clone():new d,this.globalCompositeOperation=b.globalCompositeOperation||"normal",this.globalAlpha=b.globalAlpha||1,this.clip_path=b.clip_path||[],this.currentPoint=b.currentPoint||new h,this.miterLimit=b.miterLimit||10,this.lastPoint=b.lastPoint||new h,this.lineDashOffset=b.lineDashOffset||0,this.lineDash=b.lineDash||[],this.margin=b.margin||[0,0,0,0],this.prevPageLastElemOffset=b.prevPageLastElemOffset||0,this.ignoreClearRect=typeof b.ignoreClearRect!="boolean"||b.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new w(this),t=this.internal.f2,r=this.internal.getCoordinateString,n=this.internal.getVerticalCoordinateString,s=this.internal.getHorizontalCoordinate,a=this.internal.getVerticalCoordinate,h=this.internal.Point,c=this.internal.Rectangle,d=this.internal.Matrix,g=new m}]);var w=function(b){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var I=b;Object.defineProperty(this,"pdf",{get:function(){return I}});var D=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return D},set:function(E){D=!!E}});var z=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return z},set:function(E){z=!!E}});var V=0;Object.defineProperty(this,"posX",{get:function(){return V},set:function(E){isNaN(E)||(V=E)}});var Y=0;Object.defineProperty(this,"posY",{get:function(){return Y},set:function(E){isNaN(E)||(Y=E)}}),Object.defineProperty(this,"margin",{get:function(){return g.margin},set:function(E){var Ie;typeof E=="number"?Ie=[E,E,E,E]:((Ie=new Array(4))[0]=E[0],Ie[1]=E.length>=2?E[1]:Ie[0],Ie[2]=E.length>=3?E[2]:Ie[0],Ie[3]=E.length>=4?E[3]:Ie[1]),g.margin=Ie}});var re=!1;Object.defineProperty(this,"autoPaging",{get:function(){return re},set:function(E){re=E}});var oe=0;Object.defineProperty(this,"lastBreak",{get:function(){return oe},set:function(E){oe=E}});var de=[];Object.defineProperty(this,"pageBreaks",{get:function(){return de},set:function(E){de=E}}),Object.defineProperty(this,"ctx",{get:function(){return g},set:function(E){E instanceof m&&(g=E)}}),Object.defineProperty(this,"path",{get:function(){return g.path},set:function(E){g.path=E}});var ye=[];Object.defineProperty(this,"ctxStack",{get:function(){return ye},set:function(E){ye=E}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(E){var Ie;Ie=S(E),this.ctx.fillStyle=Ie.style,this.ctx.isFillTransparent=Ie.a===0,this.ctx.fillOpacity=Ie.a,this.pdf.setFillColor(Ie.r,Ie.g,Ie.b,{a:Ie.a}),this.pdf.setTextColor(Ie.r,Ie.g,Ie.b,{a:Ie.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(E){var Ie=S(E);this.ctx.strokeStyle=Ie.style,this.ctx.isStrokeTransparent=Ie.a===0,this.ctx.strokeOpacity=Ie.a,Ie.a===0?this.pdf.setDrawColor(255,255,255):(Ie.a,this.pdf.setDrawColor(Ie.r,Ie.g,Ie.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(E){["butt","round","square"].indexOf(E)!==-1&&(this.ctx.lineCap=E,this.pdf.setLineCap(E))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(E){isNaN(E)||(this.ctx.lineWidth=E,this.pdf.setLineWidth(E))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(E){["bevel","round","miter"].indexOf(E)!==-1&&(this.ctx.lineJoin=E,this.pdf.setLineJoin(E))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(E){isNaN(E)||(this.ctx.miterLimit=E,this.pdf.setMiterLimit(E))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(E){this.ctx.textBaseline=E}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(E){["right","end","center","left","start"].indexOf(E)!==-1&&(this.ctx.textAlign=E)}});var je=null,Ce=null,ke=null;Object.defineProperty(this,"fontFaces",{get:function(){return ke},set:function(E){je=null,Ce=null,ke=E}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(E){var Ie;if(this.ctx.font=E,(Ie=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(E))!==null){var Qe=Ie[1];Ie[2];var Re=Ie[3],Ne=Ie[4];Ie[5];var De=Ie[6],Te=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Ne)[2];Ne=Math.floor(Te==="px"?parseFloat(Ne)*this.pdf.internal.scaleFactor:Te==="em"?parseFloat(Ne)*this.pdf.getFontSize():parseFloat(Ne)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Ne);var qe=function(He){var Et,bt,ht=[],dt=He.trim();if(dt==="")return Jo;if(dt in nu)return[nu[dt]];for(;dt!=="";){switch(bt=null,Et=(dt=su(dt)).charAt(0)){case'"':case"'":bt=x1(dt.substring(1),Et);break;default:bt=b1(dt)}if(bt===null||(ht.push(bt[0]),(dt=su(bt[1]))!==""&&dt.charAt(0)!==","))return Jo;dt=dt.replace(/^,/,"")}return ht}(De);if(this.fontFaces){var Je=function(He,Et){var bt=He.getFontList(),ht=JSON.stringify(bt);if(je===null||Ce!==ht){var dt=function(kt){var Ze=[];return Object.keys(kt).forEach(function(ae){kt[ae].forEach(function(_e){var Fe=null;switch(_e){case"bold":Fe={family:ae,weight:"bold"};break;case"italic":Fe={family:ae,style:"italic"};break;case"bolditalic":Fe={family:ae,weight:"bold",style:"italic"};break;case"":case"normal":Fe={family:ae}}Fe!==null&&(Fe.ref={name:ae,style:_e},Ze.push(Fe))})}),Ze}(bt);je=function(kt){for(var Ze={},ae=0;ae<kt.length;++ae){var _e=Go(kt[ae]),Fe=_e.family,Pe=_e.stretch,Be=_e.style,Me=_e.weight;Ze[Fe]=Ze[Fe]||{},Ze[Fe][Pe]=Ze[Fe][Pe]||{},Ze[Fe][Pe][Be]=Ze[Fe][Pe][Be]||{},Ze[Fe][Pe][Be][Me]=_e}return Ze}(dt.concat(Et)),Ce=ht}return je}(this.pdf,this.fontFaces),Ee=qe.map(function(He){return{family:He,stretch:"normal",weight:Re,style:Qe}}),ut=function(He,Et,bt){for(var ht=(bt=bt||{}).defaultFontFamily||"times",dt=Object.assign({},m1,bt.genericFontFamilies||{}),kt=null,Ze=null,ae=0;ae<Et.length;++ae)if(dt[(kt=Go(Et[ae])).family]&&(kt.family=dt[kt.family]),He.hasOwnProperty(kt.family)){Ze=He[kt.family];break}if(!(Ze=Ze||He[ht]))throw new Error("Could not find a font-family for the rule '"+iu(kt)+"' and default family '"+ht+"'.");if(Ze=function(_e,Fe){if(Fe[_e])return Fe[_e];var Pe=ll[_e],Be=Pe<=ll.normal?-1:1,Me=ru(Fe,mh,Pe,Be);if(!Me)throw new Error("Could not find a matching font-stretch value for "+_e);return Me}(kt.stretch,Ze),Ze=function(_e,Fe){if(Fe[_e])return Fe[_e];for(var Pe=gh[_e],Be=0;Be<Pe.length;++Be)if(Fe[Pe[Be]])return Fe[Pe[Be]];throw new Error("Could not find a matching font-style for "+_e)}(kt.style,Ze),!(Ze=function(_e,Fe){if(Fe[_e])return Fe[_e];if(_e===400&&Fe[500])return Fe[500];if(_e===500&&Fe[400])return Fe[400];var Pe=g1[_e],Be=ru(Fe,xh,Pe,_e<400?-1:1);if(!Be)throw new Error("Could not find a matching font-weight for value "+_e);return Be}(kt.weight,Ze)))throw new Error("Failed to resolve a font for the rule '"+iu(kt)+"'.");return Ze}(Je,Ee);this.pdf.setFont(ut.ref.name,ut.ref.style)}else{var rt="";(Re==="bold"||parseInt(Re,10)>=700||Qe==="bold")&&(rt="bold"),Qe==="italic"&&(rt+="italic"),rt.length===0&&(rt="normal");for(var xt="",mt={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},ze=0;ze<qe.length;ze++){if(this.pdf.internal.getFont(qe[ze],rt,{noFallback:!0,disableWarning:!0})!==void 0){xt=qe[ze];break}if(rt==="bolditalic"&&this.pdf.internal.getFont(qe[ze],"bold",{noFallback:!0,disableWarning:!0})!==void 0)xt=qe[ze],rt="bold";else if(this.pdf.internal.getFont(qe[ze],"normal",{noFallback:!0,disableWarning:!0})!==void 0){xt=qe[ze],rt="normal";break}}if(xt===""){for(var nt=0;nt<qe.length;nt++)if(mt[qe[nt]]){xt=mt[qe[nt]];break}}xt=xt===""?"Times":xt,this.pdf.setFont(xt,rt)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(E){this.ctx.globalCompositeOperation=E}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(E){this.ctx.globalAlpha=E}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(E){this.ctx.lineDashOffset=E,M.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(E){this.ctx.lineDash=E,M.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(E){this.ctx.ignoreClearRect=!!E}})};w.prototype.setLineDash=function(b){this.lineDash=b},w.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},w.prototype.fill=function(){H.call(this,"fill",!1)},w.prototype.stroke=function(){H.call(this,"stroke",!1)},w.prototype.beginPath=function(){this.path=[{type:"begin"}]},w.prototype.moveTo=function(b,I){if(isNaN(b)||isNaN(I))throw It.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var D=this.ctx.transform.applyToPoint(new h(b,I));this.path.push({type:"mt",x:D.x,y:D.y}),this.ctx.lastPoint=new h(b,I)},w.prototype.closePath=function(){var b=new h(0,0),I=0;for(I=this.path.length-1;I!==-1;I--)if(this.path[I].type==="begin"&&Ft(this.path[I+1])==="object"&&typeof this.path[I+1].x=="number"){b=new h(this.path[I+1].x,this.path[I+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new h(b.x,b.y)},w.prototype.lineTo=function(b,I){if(isNaN(b)||isNaN(I))throw It.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var D=this.ctx.transform.applyToPoint(new h(b,I));this.path.push({type:"lt",x:D.x,y:D.y}),this.ctx.lastPoint=new h(D.x,D.y)},w.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),H.call(this,null,!0)},w.prototype.quadraticCurveTo=function(b,I,D,z){if(isNaN(D)||isNaN(z)||isNaN(b)||isNaN(I))throw It.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var V=this.ctx.transform.applyToPoint(new h(D,z)),Y=this.ctx.transform.applyToPoint(new h(b,I));this.path.push({type:"qct",x1:Y.x,y1:Y.y,x:V.x,y:V.y}),this.ctx.lastPoint=new h(V.x,V.y)},w.prototype.bezierCurveTo=function(b,I,D,z,V,Y){if(isNaN(V)||isNaN(Y)||isNaN(b)||isNaN(I)||isNaN(D)||isNaN(z))throw It.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var re=this.ctx.transform.applyToPoint(new h(V,Y)),oe=this.ctx.transform.applyToPoint(new h(b,I)),de=this.ctx.transform.applyToPoint(new h(D,z));this.path.push({type:"bct",x1:oe.x,y1:oe.y,x2:de.x,y2:de.y,x:re.x,y:re.y}),this.ctx.lastPoint=new h(re.x,re.y)},w.prototype.arc=function(b,I,D,z,V,Y){if(isNaN(b)||isNaN(I)||isNaN(D)||isNaN(z)||isNaN(V))throw It.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(Y=!!Y,!this.ctx.transform.isIdentity){var re=this.ctx.transform.applyToPoint(new h(b,I));b=re.x,I=re.y;var oe=this.ctx.transform.applyToPoint(new h(0,D)),de=this.ctx.transform.applyToPoint(new h(0,0));D=Math.sqrt(Math.pow(oe.x-de.x,2)+Math.pow(oe.y-de.y,2))}Math.abs(V-z)>=2*Math.PI&&(z=0,V=2*Math.PI),this.path.push({type:"arc",x:b,y:I,radius:D,startAngle:z,endAngle:V,counterclockwise:Y})},w.prototype.arcTo=function(b,I,D,z,V){throw new Error("arcTo not implemented.")},w.prototype.rect=function(b,I,D,z){if(isNaN(b)||isNaN(I)||isNaN(D)||isNaN(z))throw It.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(b,I),this.lineTo(b+D,I),this.lineTo(b+D,I+z),this.lineTo(b,I+z),this.lineTo(b,I),this.lineTo(b+D,I),this.lineTo(b,I)},w.prototype.fillRect=function(b,I,D,z){if(isNaN(b)||isNaN(I)||isNaN(D)||isNaN(z))throw It.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!p.call(this)){var V={};this.lineCap!=="butt"&&(V.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(V.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(b,I,D,z),this.fill(),V.hasOwnProperty("lineCap")&&(this.lineCap=V.lineCap),V.hasOwnProperty("lineJoin")&&(this.lineJoin=V.lineJoin)}},w.prototype.strokeRect=function(b,I,D,z){if(isNaN(b)||isNaN(I)||isNaN(D)||isNaN(z))throw It.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");O.call(this)||(this.beginPath(),this.rect(b,I,D,z),this.stroke())},w.prototype.clearRect=function(b,I,D,z){if(isNaN(b)||isNaN(I)||isNaN(D)||isNaN(z))throw It.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(b,I,D,z))},w.prototype.save=function(b){b=typeof b!="boolean"||b;for(var I=this.pdf.internal.getCurrentPageInfo().pageNumber,D=0;D<this.pdf.internal.getNumberOfPages();D++)this.pdf.setPage(D+1),this.pdf.internal.out("q");if(this.pdf.setPage(I),b){this.ctx.fontSize=this.pdf.internal.getFontSize();var z=new m(this.ctx);this.ctxStack.push(this.ctx),this.ctx=z}},w.prototype.restore=function(b){b=typeof b!="boolean"||b;for(var I=this.pdf.internal.getCurrentPageInfo().pageNumber,D=0;D<this.pdf.internal.getNumberOfPages();D++)this.pdf.setPage(D+1),this.pdf.internal.out("Q");this.pdf.setPage(I),b&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},w.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var S=function(b){var I,D,z,V;if(b.isCanvasGradient===!0&&(b=b.getColor()),!b)return{r:0,g:0,b:0,a:0,style:b};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(b))I=0,D=0,z=0,V=0;else{var Y=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(b);if(Y!==null)I=parseInt(Y[1]),D=parseInt(Y[2]),z=parseInt(Y[3]),V=1;else if((Y=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(b))!==null)I=parseInt(Y[1]),D=parseInt(Y[2]),z=parseInt(Y[3]),V=parseFloat(Y[4]);else{if(V=1,typeof b=="string"&&b.charAt(0)!=="#"){var re=new lh(b);b=re.ok?re.toHex():"#000000"}b.length===4?(I=b.substring(1,2),I+=I,D=b.substring(2,3),D+=D,z=b.substring(3,4),z+=z):(I=b.substring(1,3),D=b.substring(3,5),z=b.substring(5,7)),I=parseInt(I,16),D=parseInt(D,16),z=parseInt(z,16)}}return{r:I,g:D,b:z,a:V,style:b}},p=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},O=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};w.prototype.fillText=function(b,I,D,z){if(isNaN(I)||isNaN(D)||typeof b!="string")throw It.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(z=isNaN(z)?void 0:z,!p.call(this)){var V=se(this.ctx.transform.rotation),Y=this.ctx.transform.scaleX;P.call(this,{text:b,x:I,y:D,scale:Y,angle:V,align:this.textAlign,maxWidth:z})}},w.prototype.strokeText=function(b,I,D,z){if(isNaN(I)||isNaN(D)||typeof b!="string")throw It.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!O.call(this)){z=isNaN(z)?void 0:z;var V=se(this.ctx.transform.rotation),Y=this.ctx.transform.scaleX;P.call(this,{text:b,x:I,y:D,scale:Y,renderingMode:"stroke",angle:V,align:this.textAlign,maxWidth:z})}},w.prototype.measureText=function(b){if(typeof b!="string")throw It.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var I=this.pdf,D=this.pdf.internal.scaleFactor,z=I.internal.getFontSize(),V=I.getStringUnitWidth(b)*z/I.internal.scaleFactor;return new function(Y){var re=(Y=Y||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return re}}),this}({width:V*=Math.round(96*D/72*1e4)/1e4})},w.prototype.scale=function(b,I){if(isNaN(b)||isNaN(I))throw It.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var D=new d(b,0,0,I,0,0);this.ctx.transform=this.ctx.transform.multiply(D)},w.prototype.rotate=function(b){if(isNaN(b))throw It.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var I=new d(Math.cos(b),Math.sin(b),-Math.sin(b),Math.cos(b),0,0);this.ctx.transform=this.ctx.transform.multiply(I)},w.prototype.translate=function(b,I){if(isNaN(b)||isNaN(I))throw It.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var D=new d(1,0,0,1,b,I);this.ctx.transform=this.ctx.transform.multiply(D)},w.prototype.transform=function(b,I,D,z,V,Y){if(isNaN(b)||isNaN(I)||isNaN(D)||isNaN(z)||isNaN(V)||isNaN(Y))throw It.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var re=new d(b,I,D,z,V,Y);this.ctx.transform=this.ctx.transform.multiply(re)},w.prototype.setTransform=function(b,I,D,z,V,Y){b=isNaN(b)?1:b,I=isNaN(I)?0:I,D=isNaN(D)?0:D,z=isNaN(z)?1:z,V=isNaN(V)?0:V,Y=isNaN(Y)?0:Y,this.ctx.transform=new d(b,I,D,z,V,Y)};var N=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};w.prototype.drawImage=function(b,I,D,z,V,Y,re,oe,de){var ye=this.pdf.getImageProperties(b),je=1,Ce=1,ke=1,E=1;z!==void 0&&oe!==void 0&&(ke=oe/z,E=de/V,je=ye.width/z*oe/z,Ce=ye.height/V*de/V),Y===void 0&&(Y=I,re=D,I=0,D=0),z!==void 0&&oe===void 0&&(oe=z,de=V),z===void 0&&oe===void 0&&(oe=ye.width,de=ye.height);var Ie=this.ctx.transform.decompose(),Qe=se(Ie.rotate.shx),Re=new d,Ne=(Re=(Re=(Re=Re.multiply(Ie.translate)).multiply(Ie.skew)).multiply(Ie.scale)).applyToRectangle(new c(Y-I*ke,re-D*E,z*je,V*Ce));if(this.autoPaging){for(var De,Te=T.call(this,Ne),qe=[],Je=0;Je<Te.length;Je+=1)qe.indexOf(Te[Je])===-1&&qe.push(Te[Je]);X(qe);for(var Ee=qe[0],ut=qe[qe.length-1],rt=Ee;rt<ut+1;rt++){this.pdf.setPage(rt);var xt=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],mt=rt===1?this.posY+this.margin[0]:this.margin[0],ze=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],nt=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],He=rt===1?0:ze+(rt-2)*nt;if(this.ctx.clip_path.length!==0){var Et=this.path;De=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=K(De,this.posX+this.margin[3],-He+mt+this.ctx.prevPageLastElemOffset),Q.call(this,"fill",!0),this.path=Et}var bt=JSON.parse(JSON.stringify(Ne));bt=K([bt],this.posX+this.margin[3],-He+mt+this.ctx.prevPageLastElemOffset)[0];var ht=(rt>Ee||rt<ut)&&N.call(this);ht&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],xt,nt,null).clip().discardPath()),this.pdf.addImage(b,"JPEG",bt.x,bt.y,bt.w,bt.h,null,null,Qe),ht&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(b,"JPEG",Ne.x,Ne.y,Ne.w,Ne.h,null,null,Qe)};var T=function(b,I,D){var z=[];I=I||this.pdf.internal.pageSize.width,D=D||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var V=this.posY+this.ctx.prevPageLastElemOffset;switch(b.type){default:case"mt":case"lt":z.push(Math.floor((b.y+V)/D)+1);break;case"arc":z.push(Math.floor((b.y+V-b.radius)/D)+1),z.push(Math.floor((b.y+V+b.radius)/D)+1);break;case"qct":var Y=ge(this.ctx.lastPoint.x,this.ctx.lastPoint.y,b.x1,b.y1,b.x,b.y);z.push(Math.floor((Y.y+V)/D)+1),z.push(Math.floor((Y.y+Y.h+V)/D)+1);break;case"bct":var re=W(this.ctx.lastPoint.x,this.ctx.lastPoint.y,b.x1,b.y1,b.x2,b.y2,b.x,b.y);z.push(Math.floor((re.y+V)/D)+1),z.push(Math.floor((re.y+re.h+V)/D)+1);break;case"rect":z.push(Math.floor((b.y+V)/D)+1),z.push(Math.floor((b.y+b.h+V)/D)+1)}for(var oe=0;oe<z.length;oe+=1)for(;this.pdf.internal.getNumberOfPages()<z[oe];)L.call(this);return z},L=function(){var b=this.fillStyle,I=this.strokeStyle,D=this.font,z=this.lineCap,V=this.lineWidth,Y=this.lineJoin;this.pdf.addPage(),this.fillStyle=b,this.strokeStyle=I,this.font=D,this.lineCap=z,this.lineWidth=V,this.lineJoin=Y},K=function(b,I,D){for(var z=0;z<b.length;z++)switch(b[z].type){case"bct":b[z].x2+=I,b[z].y2+=D;case"qct":b[z].x1+=I,b[z].y1+=D;default:b[z].x+=I,b[z].y+=D}return b},X=function(b){return b.sort(function(I,D){return I-D})},H=function(b,I){var D=this.fillStyle,z=this.strokeStyle,V=this.lineCap,Y=this.lineWidth,re=Math.abs(Y*this.ctx.transform.scaleX),oe=this.lineJoin;if(this.autoPaging){for(var de,ye,je=JSON.parse(JSON.stringify(this.path)),Ce=JSON.parse(JSON.stringify(this.path)),ke=[],E=0;E<Ce.length;E++)if(Ce[E].x!==void 0)for(var Ie=T.call(this,Ce[E]),Qe=0;Qe<Ie.length;Qe+=1)ke.indexOf(Ie[Qe])===-1&&ke.push(Ie[Qe]);for(var Re=0;Re<ke.length;Re++)for(;this.pdf.internal.getNumberOfPages()<ke[Re];)L.call(this);X(ke);for(var Ne=ke[0],De=ke[ke.length-1],Te=Ne;Te<De+1;Te++){this.pdf.setPage(Te),this.fillStyle=D,this.strokeStyle=z,this.lineCap=V,this.lineWidth=re,this.lineJoin=oe;var qe=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Je=Te===1?this.posY+this.margin[0]:this.margin[0],Ee=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],ut=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],rt=Te===1?0:Ee+(Te-2)*ut;if(this.ctx.clip_path.length!==0){var xt=this.path;de=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=K(de,this.posX+this.margin[3],-rt+Je+this.ctx.prevPageLastElemOffset),Q.call(this,b,!0),this.path=xt}if(ye=JSON.parse(JSON.stringify(je)),this.path=K(ye,this.posX+this.margin[3],-rt+Je+this.ctx.prevPageLastElemOffset),I===!1||Te===0){var mt=(Te>Ne||Te<De)&&N.call(this);mt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],qe,ut,null).clip().discardPath()),Q.call(this,b,I),mt&&this.pdf.restoreGraphicsState()}this.lineWidth=Y}this.path=je}else this.lineWidth=re,Q.call(this,b,I),this.lineWidth=Y},Q=function(b,I){if((b!=="stroke"||I||!O.call(this))&&(b==="stroke"||I||!p.call(this))){for(var D,z,V=[],Y=this.path,re=0;re<Y.length;re++){var oe=Y[re];switch(oe.type){case"begin":V.push({begin:!0});break;case"close":V.push({close:!0});break;case"mt":V.push({start:oe,deltas:[],abs:[]});break;case"lt":var de=V.length;if(Y[re-1]&&!isNaN(Y[re-1].x)&&(D=[oe.x-Y[re-1].x,oe.y-Y[re-1].y],de>0)){for(;de>=0;de--)if(V[de-1].close!==!0&&V[de-1].begin!==!0){V[de-1].deltas.push(D),V[de-1].abs.push(oe);break}}break;case"bct":D=[oe.x1-Y[re-1].x,oe.y1-Y[re-1].y,oe.x2-Y[re-1].x,oe.y2-Y[re-1].y,oe.x-Y[re-1].x,oe.y-Y[re-1].y],V[V.length-1].deltas.push(D);break;case"qct":var ye=Y[re-1].x+2/3*(oe.x1-Y[re-1].x),je=Y[re-1].y+2/3*(oe.y1-Y[re-1].y),Ce=oe.x+2/3*(oe.x1-oe.x),ke=oe.y+2/3*(oe.y1-oe.y),E=oe.x,Ie=oe.y;D=[ye-Y[re-1].x,je-Y[re-1].y,Ce-Y[re-1].x,ke-Y[re-1].y,E-Y[re-1].x,Ie-Y[re-1].y],V[V.length-1].deltas.push(D);break;case"arc":V.push({deltas:[],abs:[],arc:!0}),Array.isArray(V[V.length-1].abs)&&V[V.length-1].abs.push(oe)}}z=I?null:b==="stroke"?"stroke":"fill";for(var Qe=!1,Re=0;Re<V.length;Re++)if(V[Re].arc)for(var Ne=V[Re].abs,De=0;De<Ne.length;De++){var Te=Ne[De];Te.type==="arc"?C.call(this,Te.x,Te.y,Te.radius,Te.startAngle,Te.endAngle,Te.counterclockwise,void 0,I,!Qe):G.call(this,Te.x,Te.y),Qe=!0}else if(V[Re].close===!0)this.pdf.internal.out("h"),Qe=!1;else if(V[Re].begin!==!0){var qe=V[Re].start.x,Je=V[Re].start.y;$.call(this,V[Re].deltas,qe,Je),Qe=!0}z&&R.call(this,z),I&&ne.call(this)}},he=function(b){var I=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,D=I*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return b-D;case"top":return b+I-D;case"hanging":return b+I-2*D;case"middle":return b+I/2-D;default:return b}},pe=function(b){return b+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};w.prototype.createLinearGradient=function(){var b=function(){};return b.colorStops=[],b.addColorStop=function(I,D){this.colorStops.push([I,D])},b.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},b.isCanvasGradient=!0,b},w.prototype.createPattern=function(){return this.createLinearGradient()},w.prototype.createRadialGradient=function(){return this.createLinearGradient()};var C=function(b,I,D,z,V,Y,re,oe,de){for(var ye=fe.call(this,D,z,V,Y),je=0;je<ye.length;je++){var Ce=ye[je];je===0&&(de?j.call(this,Ce.x1+b,Ce.y1+I):G.call(this,Ce.x1+b,Ce.y1+I)),ue.call(this,b,I,Ce.x2,Ce.y2,Ce.x3,Ce.y3,Ce.x4,Ce.y4)}oe?ne.call(this):R.call(this,re)},R=function(b){switch(b){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},ne=function(){this.pdf.clip(),this.pdf.discardPath()},j=function(b,I){this.pdf.internal.out(r(b)+" "+n(I)+" m")},P=function(b){var I;switch(b.align){case"right":case"end":I="right";break;case"center":I="center";break;default:I="left"}var D,z,V,Y=this.pdf.getTextDimensions(b.text),re=he.call(this,b.y),oe=pe.call(this,re)-Y.h,de=this.ctx.transform.applyToPoint(new h(b.x,re));if(this.autoPaging){var ye=this.ctx.transform.decompose(),je=new d;je=(je=(je=je.multiply(ye.translate)).multiply(ye.skew)).multiply(ye.scale);for(var Ce=this.ctx.transform.applyToRectangle(new c(b.x,re,Y.w,Y.h)),ke=je.applyToRectangle(new c(b.x,oe,Y.w,Y.h)),E=T.call(this,ke),Ie=[],Qe=0;Qe<E.length;Qe+=1)Ie.indexOf(E[Qe])===-1&&Ie.push(E[Qe]);X(Ie);for(var Re=Ie[0],Ne=Ie[Ie.length-1],De=Re;De<Ne+1;De++){this.pdf.setPage(De);var Te=De===1?this.posY+this.margin[0]:this.margin[0],qe=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Je=this.pdf.internal.pageSize.height-this.margin[2],Ee=Je-this.margin[0],ut=this.pdf.internal.pageSize.width-this.margin[1],rt=ut-this.margin[3],xt=De===1?0:qe+(De-2)*Ee;if(this.ctx.clip_path.length!==0){var mt=this.path;D=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=K(D,this.posX+this.margin[3],-1*xt+Te),Q.call(this,"fill",!0),this.path=mt}var ze=K([JSON.parse(JSON.stringify(ke))],this.posX+this.margin[3],-xt+Te+this.ctx.prevPageLastElemOffset)[0];b.scale>=.01&&(z=this.pdf.internal.getFontSize(),this.pdf.setFontSize(z*b.scale),V=this.lineWidth,this.lineWidth=V*b.scale);var nt=this.autoPaging!=="text";if(nt||ze.y+ze.h<=Je){if(nt||ze.y>=Te&&ze.x<=ut){var He=nt?b.text:this.pdf.splitTextToSize(b.text,b.maxWidth||ut-ze.x)[0],Et=K([JSON.parse(JSON.stringify(Ce))],this.posX+this.margin[3],-xt+Te+this.ctx.prevPageLastElemOffset)[0],bt=nt&&(De>Re||De<Ne)&&N.call(this);bt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],rt,Ee,null).clip().discardPath()),this.pdf.text(He,Et.x,Et.y,{angle:b.angle,align:I,renderingMode:b.renderingMode}),bt&&this.pdf.restoreGraphicsState()}}else ze.y<Je&&(this.ctx.prevPageLastElemOffset+=Je-ze.y);b.scale>=.01&&(this.pdf.setFontSize(z),this.lineWidth=V)}}else b.scale>=.01&&(z=this.pdf.internal.getFontSize(),this.pdf.setFontSize(z*b.scale),V=this.lineWidth,this.lineWidth=V*b.scale),this.pdf.text(b.text,de.x+this.posX,de.y+this.posY,{angle:b.angle,align:I,renderingMode:b.renderingMode,maxWidth:b.maxWidth}),b.scale>=.01&&(this.pdf.setFontSize(z),this.lineWidth=V)},G=function(b,I,D,z){D=D||0,z=z||0,this.pdf.internal.out(r(b+D)+" "+n(I+z)+" l")},$=function(b,I,D){return this.pdf.lines(b,I,D,null,null)},ue=function(b,I,D,z,V,Y,re,oe){this.pdf.internal.out([t(s(D+b)),t(a(z+I)),t(s(V+b)),t(a(Y+I)),t(s(re+b)),t(a(oe+I)),"c"].join(" "))},fe=function(b,I,D,z){for(var V=2*Math.PI,Y=Math.PI/2;I>D;)I-=V;var re=Math.abs(D-I);re<V&&z&&(re=V-re);for(var oe=[],de=z?-1:1,ye=I;re>1e-5;){var je=ye+de*Math.min(re,Y);oe.push(me.call(this,b,ye,je)),re-=Math.abs(je-ye),ye=je}return oe},me=function(b,I,D){var z=(D-I)/2,V=b*Math.cos(z),Y=b*Math.sin(z),re=V,oe=-Y,de=re*re+oe*oe,ye=de+re*V+oe*Y,je=4/3*(Math.sqrt(2*de*ye)-ye)/(re*Y-oe*V),Ce=re-je*oe,ke=oe+je*re,E=Ce,Ie=-ke,Qe=z+I,Re=Math.cos(Qe),Ne=Math.sin(Qe);return{x1:b*Math.cos(I),y1:b*Math.sin(I),x2:Ce*Re-ke*Ne,y2:Ce*Ne+ke*Re,x3:E*Re-Ie*Ne,y3:E*Ne+Ie*Re,x4:b*Math.cos(D),y4:b*Math.sin(D)}},se=function(b){return 180*b/Math.PI},ge=function(b,I,D,z,V,Y){var re=b+.5*(D-b),oe=I+.5*(z-I),de=V+.5*(D-V),ye=Y+.5*(z-Y),je=Math.min(b,V,re,de),Ce=Math.max(b,V,re,de),ke=Math.min(I,Y,oe,ye),E=Math.max(I,Y,oe,ye);return new c(je,ke,Ce-je,E-ke)},W=function(b,I,D,z,V,Y,re,oe){var de,ye,je,Ce,ke,E,Ie,Qe,Re,Ne,De,Te,qe,Je,Ee=D-b,ut=z-I,rt=V-D,xt=Y-z,mt=re-V,ze=oe-Y;for(ye=0;ye<41;ye++)Re=(Ie=(je=b+(de=ye/40)*Ee)+de*((ke=D+de*rt)-je))+de*(ke+de*(V+de*mt-ke)-Ie),Ne=(Qe=(Ce=I+de*ut)+de*((E=z+de*xt)-Ce))+de*(E+de*(Y+de*ze-E)-Qe),ye==0?(De=Re,Te=Ne,qe=Re,Je=Ne):(De=Math.min(De,Re),Te=Math.min(Te,Ne),qe=Math.max(qe,Re),Je=Math.max(Je,Ne));return new c(Math.round(De),Math.round(Te),Math.round(qe-De),Math.round(Je-Te))},M=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var b,I,D=(b=this.ctx.lineDash,I=this.ctx.lineDashOffset,JSON.stringify({lineDash:b,lineDashOffset:I}));this.prevLineDash!==D&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=D)}}})(Ke.API),function(e){var t=function(h){var c,d,g,m,w,S,p,O,N,T;for(d=[],g=0,m=(h+=c="\0\0\0\0".slice(h.length%4||4)).length;m>g;g+=4)(w=(h.charCodeAt(g)<<24)+(h.charCodeAt(g+1)<<16)+(h.charCodeAt(g+2)<<8)+h.charCodeAt(g+3))!==0?(S=(w=((w=((w=((w=(w-(T=w%85))/85)-(N=w%85))/85)-(O=w%85))/85)-(p=w%85))/85)%85,d.push(S+33,p+33,O+33,N+33,T+33)):d.push(122);return function(L,K){for(var X=K;X>0;X--)L.pop()}(d,c.length),String.fromCharCode.apply(String,d)+"~>"},r=function(h){var c,d,g,m,w,S=String,p="length",O=255,N="charCodeAt",T="slice",L="replace";for(h[T](-2),h=h[T](0,-2)[L](/\s/g,"")[L]("z","!!!!!"),g=[],m=0,w=(h+=c="uuuuu"[T](h[p]%5||5))[p];w>m;m+=5)d=52200625*(h[N](m)-33)+614125*(h[N](m+1)-33)+7225*(h[N](m+2)-33)+85*(h[N](m+3)-33)+(h[N](m+4)-33),g.push(O&d>>24,O&d>>16,O&d>>8,O&d);return function(K,X){for(var H=X;H>0;H--)K.pop()}(g,c[p]),S.fromCharCode.apply(S,g)},n=function(h){return h.split("").map(function(c){return("0"+c.charCodeAt().toString(16)).slice(-2)}).join("")+">"},s=function(h){var c=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((h=h.replace(/\s/g,"")).indexOf(">")!==-1&&(h=h.substr(0,h.indexOf(">"))),h.length%2&&(h+="0"),c.test(h)===!1)return"";for(var d="",g=0;g<h.length;g+=2)d+=String.fromCharCode("0x"+(h[g]+h[g+1]));return d},a=function(h){for(var c=new Uint8Array(h.length),d=h.length;d--;)c[d]=h.charCodeAt(d);return(c=tl(c)).reduce(function(g,m){return g+String.fromCharCode(m)},"")};e.processDataByFilters=function(h,c){var d=0,g=h||"",m=[];for(typeof(c=c||[])=="string"&&(c=[c]),d=0;d<c.length;d+=1)switch(c[d]){case"ASCII85Decode":case"/ASCII85Decode":g=r(g),m.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":g=t(g),m.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":g=s(g),m.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":g=n(g),m.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":g=a(g),m.push("/FlateDecode");break;default:throw new Error('The filter: "'+c[d]+'" is not implemented')}return{data:g,reverseChain:m.reverse().join(" ")}}}(Ke.API),function(e){e.loadFile=function(t,r,n){return function(s,a,h){a=a!==!1,h=typeof h=="function"?h:function(){};var c=void 0;try{c=function(d,g,m){var w=new XMLHttpRequest,S=0,p=function(O){var N=O.length,T=[],L=String.fromCharCode;for(S=0;S<N;S+=1)T.push(L(255&O.charCodeAt(S)));return T.join("")};if(w.open("GET",d,!g),w.overrideMimeType("text/plain; charset=x-user-defined"),g===!1&&(w.onload=function(){w.status===200?m(p(this.responseText)):m(void 0)}),w.send(null),g&&w.status===200)return p(w.responseText)}(s,a,h)}catch{}return c}(t,r,n)},e.allowFsRead=void 0,e.loadImageFile=e.loadFile}(Ke.API),function(e){function t(){return(st.html2canvas?Promise.resolve(st.html2canvas):Co(()=>import("./html2canvas.esm-CBrSDip1.js"),[])).catch(function(c){return Promise.reject(new Error("Could not load html2canvas: "+c))}).then(function(c){return c.default?c.default:c})}function r(){return(st.DOMPurify?Promise.resolve(st.DOMPurify):Co(()=>import("./purify.es-B9ZVCkUG.js"),[])).catch(function(c){return Promise.reject(new Error("Could not load dompurify: "+c))}).then(function(c){return c.default?c.default:c})}var n=function(c){var d=Ft(c);return d==="undefined"?"undefined":d==="string"||c instanceof String?"string":d==="number"||c instanceof Number?"number":d==="function"||c instanceof Function?"function":c&&c.constructor===Array?"array":c&&c.nodeType===1?"element":d==="object"?"object":"unknown"},s=function(c,d){var g=document.createElement(c);for(var m in d.className&&(g.className=d.className),d.innerHTML&&d.dompurify&&(g.innerHTML=d.dompurify.sanitize(d.innerHTML)),d.style)g.style[m]=d.style[m];return g},a=function c(d,g){for(var m=d.nodeType===3?document.createTextNode(d.nodeValue):d.cloneNode(!1),w=d.firstChild;w;w=w.nextSibling)g!==!0&&w.nodeType===1&&w.nodeName==="SCRIPT"||m.appendChild(c(w,g));return d.nodeType===1&&(d.nodeName==="CANVAS"?(m.width=d.width,m.height=d.height,m.getContext("2d").drawImage(d,0,0)):d.nodeName!=="TEXTAREA"&&d.nodeName!=="SELECT"||(m.value=d.value),m.addEventListener("load",function(){m.scrollTop=d.scrollTop,m.scrollLeft=d.scrollLeft},!0)),m},h=function c(d){var g=Object.assign(c.convert(Promise.resolve()),JSON.parse(JSON.stringify(c.template))),m=c.convert(Promise.resolve(),g);return(m=m.setProgress(1,c,1,[c])).set(d)};(h.prototype=Object.create(Promise.prototype)).constructor=h,h.convert=function(c,d){return c.__proto__=d||h.prototype,c},h.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},h.prototype.from=function(c,d){return this.then(function(){switch(d=d||function(g){switch(n(g)){case"string":return"string";case"element":return g.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(c),d){case"string":return this.then(r).then(function(g){return this.set({src:s("div",{innerHTML:c,dompurify:g})})});case"element":return this.set({src:c});case"canvas":return this.set({canvas:c});case"img":return this.set({img:c});default:return this.error("Unknown source type.")}})},h.prototype.to=function(c){switch(c){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},h.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var c={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},d=a(this.prop.src,this.opt.html2canvas.javascriptEnabled);d.tagName==="BODY"&&(c.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=s("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=s("div",{className:"html2pdf__container",style:c}),this.prop.container.appendChild(d),this.prop.container.firstChild.appendChild(s("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},h.prototype.toCanvas=function(){var c=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(c).then(t).then(function(d){var g=Object.assign({},this.opt.html2canvas);return delete g.onrendered,d(this.prop.container,g)}).then(function(d){(this.opt.html2canvas.onrendered||function(){})(d),this.prop.canvas=d,document.body.removeChild(this.prop.overlay)})},h.prototype.toContext2d=function(){var c=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(c).then(t).then(function(d){var g=this.opt.jsPDF,m=this.opt.fontFaces,w=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,S=Object.assign({async:!0,allowTaint:!0,scale:w,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete S.onrendered,g.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,g.context2d.posX=this.opt.x,g.context2d.posY=this.opt.y,g.context2d.margin=this.opt.margin,g.context2d.fontFaces=m,m)for(var p=0;p<m.length;++p){var O=m[p],N=O.src.find(function(T){return T.format==="truetype"});N&&g.addFont(N.url,O.ref.name,O.ref.style)}return S.windowHeight=S.windowHeight||0,S.windowHeight=S.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):S.windowHeight,g.context2d.save(!0),d(this.prop.container,S)}).then(function(d){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(d),this.prop.canvas=d,document.body.removeChild(this.prop.overlay)})},h.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var c=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=c})},h.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},h.prototype.output=function(c,d,g){return(g=g||"pdf").toLowerCase()==="img"||g.toLowerCase()==="image"?this.outputImg(c,d):this.outputPdf(c,d)},h.prototype.outputPdf=function(c,d){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(c,d)})},h.prototype.outputImg=function(c){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(c){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+c+'" is not supported.'}})},h.prototype.save=function(c){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(c?{filename:c}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},h.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},h.prototype.set=function(c){if(n(c)!=="object")return this;var d=Object.keys(c||{}).map(function(g){if(g in h.template.prop)return function(){this.prop[g]=c[g]};switch(g){case"margin":return this.setMargin.bind(this,c.margin);case"jsPDF":return function(){return this.opt.jsPDF=c.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,c.pageSize);default:return function(){this.opt[g]=c[g]}}},this);return this.then(function(){return this.thenList(d)})},h.prototype.get=function(c,d){return this.then(function(){var g=c in h.template.prop?this.prop[c]:this.opt[c];return d?d(g):g})},h.prototype.setMargin=function(c){return this.then(function(){switch(n(c)){case"number":c=[c,c,c,c];case"array":if(c.length===2&&(c=[c[0],c[1],c[0],c[1]]),c.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=c}).then(this.setPageSize)},h.prototype.setPageSize=function(c){function d(g,m){return Math.floor(g*m/72*96)}return this.then(function(){(c=c||Ke.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(c.inner={width:c.width-this.opt.margin[1]-this.opt.margin[3],height:c.height-this.opt.margin[0]-this.opt.margin[2]},c.inner.px={width:d(c.inner.width,c.k),height:d(c.inner.height,c.k)},c.inner.ratio=c.inner.height/c.inner.width),this.prop.pageSize=c})},h.prototype.setProgress=function(c,d,g,m){return c!=null&&(this.progress.val=c),d!=null&&(this.progress.state=d),g!=null&&(this.progress.n=g),m!=null&&(this.progress.stack=m),this.progress.ratio=this.progress.val/this.progress.state,this},h.prototype.updateProgress=function(c,d,g,m){return this.setProgress(c?this.progress.val+c:null,d||null,g?this.progress.n+g:null,m?this.progress.stack.concat(m):null)},h.prototype.then=function(c,d){var g=this;return this.thenCore(c,d,function(m,w){return g.updateProgress(null,null,1,[m]),Promise.prototype.then.call(this,function(S){return g.updateProgress(null,m),S}).then(m,w).then(function(S){return g.updateProgress(1),S})})},h.prototype.thenCore=function(c,d,g){g=g||Promise.prototype.then;var m=this;c&&(c=c.bind(m)),d&&(d=d.bind(m));var w=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?m:h.convert(Object.assign({},m),Promise.prototype),S=g.call(w,c,d);return h.convert(S,m.__proto__)},h.prototype.thenExternal=function(c,d){return Promise.prototype.then.call(this,c,d)},h.prototype.thenList=function(c){var d=this;return c.forEach(function(g){d=d.thenCore(g)}),d},h.prototype.catch=function(c){c&&(c=c.bind(this));var d=Promise.prototype.catch.call(this,c);return h.convert(d,this)},h.prototype.catchExternal=function(c){return Promise.prototype.catch.call(this,c)},h.prototype.error=function(c){return this.then(function(){throw new Error(c)})},h.prototype.using=h.prototype.set,h.prototype.saveAs=h.prototype.save,h.prototype.export=h.prototype.output,h.prototype.run=h.prototype.then,Ke.getPageSize=function(c,d,g){if(Ft(c)==="object"){var m=c;c=m.orientation,d=m.unit||d,g=m.format||g}d=d||"mm",g=g||"a4",c=(""+(c||"P")).toLowerCase();var w,S=(""+g).toLowerCase(),p={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(d){case"pt":w=1;break;case"mm":w=72/25.4;break;case"cm":w=72/2.54;break;case"in":w=72;break;case"px":w=.75;break;case"pc":case"em":w=12;break;case"ex":w=6;break;default:throw"Invalid unit: "+d}var O,N=0,T=0;if(p.hasOwnProperty(S))N=p[S][1]/w,T=p[S][0]/w;else try{N=g[1],T=g[0]}catch{throw new Error("Invalid format: "+g)}if(c==="p"||c==="portrait")c="p",T>N&&(O=T,T=N,N=O);else{if(c!=="l"&&c!=="landscape")throw"Invalid orientation: "+c;c="l",N>T&&(O=T,T=N,N=O)}return{width:T,height:N,unit:d,k:w,orientation:c}},e.html=function(c,d){(d=d||{}).callback=d.callback||function(){},d.html2canvas=d.html2canvas||{},d.html2canvas.canvas=d.html2canvas.canvas||this.canvas,d.jsPDF=d.jsPDF||this,d.fontFaces=d.fontFaces?d.fontFaces.map(Go):null;var g=new h(d);return d.worker?g:g.from(c).doCallback()}}(Ke.API),Ke.API.addJS=function(e){var t,r,n=e;return this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(t+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),r=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+n+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){t!==void 0&&r!==void 0&&this.internal.out("/Names <</JavaScript "+t+" 0 R>>")}),this},function(e){var t;e.events.push(["postPutResources",function(){var r=this,n=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var s=r.outline.render().split(/\r\n/),a=0;a<s.length;a++){var h=s[a],c=n.exec(h);if(c!=null){var d=c[1];r.internal.newObjectDeferredBegin(d,!1)}r.internal.write(h)}if(this.outline.createNamedDestinations){var g=this.internal.pages.length,m=[];for(a=0;a<g;a++){var w=r.internal.newObject();m.push(w);var S=r.internal.getPageInfo(a+1);r.internal.write("<< /D["+S.objId+" 0 R /XYZ null null null]>> endobj")}var p=r.internal.newObject();for(r.internal.write("<< /Names [ "),a=0;a<m.length;a++)r.internal.write("(page_"+(a+1)+")"+m[a]+" 0 R");r.internal.write(" ] >>","endobj"),t=r.internal.newObject(),r.internal.write("<< /Dests "+p+" 0 R"),r.internal.write(">>","endobj")}}]),e.events.push(["putCatalog",function(){var r=this;r.outline.root.children.length>0&&(r.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&r.internal.write("/Names "+t+" 0 R"))}]),e.events.push(["initialized",function(){var r=this;r.outline={createNamedDestinations:!1,root:{children:[]}},r.outline.add=function(n,s,a){var h={title:s,options:a,children:[]};return n==null&&(n=this.root),n.children.push(h),h},r.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=r,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},r.outline.genIds_r=function(n){n.id=r.internal.newObjectDeferred();for(var s=0;s<n.children.length;s++)this.genIds_r(n.children[s])},r.outline.renderRoot=function(n){this.objStart(n),this.line("/Type /Outlines"),n.children.length>0&&(this.line("/First "+this.makeRef(n.children[0])),this.line("/Last "+this.makeRef(n.children[n.children.length-1]))),this.line("/Count "+this.count_r({count:0},n)),this.objEnd()},r.outline.renderItems=function(n){for(var s=this.ctx.pdf.internal.getVerticalCoordinateString,a=0;a<n.children.length;a++){var h=n.children[a];this.objStart(h),this.line("/Title "+this.makeString(h.title)),this.line("/Parent "+this.makeRef(n)),a>0&&this.line("/Prev "+this.makeRef(n.children[a-1])),a<n.children.length-1&&this.line("/Next "+this.makeRef(n.children[a+1])),h.children.length>0&&(this.line("/First "+this.makeRef(h.children[0])),this.line("/Last "+this.makeRef(h.children[h.children.length-1])));var c=this.count=this.count_r({count:0},h);if(c>0&&this.line("/Count "+c),h.options&&h.options.pageNumber){var d=r.internal.getPageInfo(h.options.pageNumber);this.line("/Dest ["+d.objId+" 0 R /XYZ 0 "+s(0)+" 0]")}this.objEnd()}for(var g=0;g<n.children.length;g++)this.renderItems(n.children[g])},r.outline.line=function(n){this.ctx.val+=n+`\r
`},r.outline.makeRef=function(n){return n.id+" 0 R"},r.outline.makeString=function(n){return"("+r.internal.pdfEscape(n)+")"},r.outline.objStart=function(n){this.ctx.val+=`\r
`+n.id+` 0 obj\r
<<\r
`},r.outline.objEnd=function(){this.ctx.val+=`>> \r
endobj\r
`},r.outline.count_r=function(n,s){for(var a=0;a<s.children.length;a++)n.count++,this.count_r(n,s.children[a]);return n.count}}])}(Ke.API),function(e){var t=[192,193,194,195,196,197,198,199];e.processJPEG=function(r,n,s,a,h,c){var d,g=this.decode.DCT_DECODE,m=null;if(typeof r=="string"||this.__addimage__.isArrayBuffer(r)||this.__addimage__.isArrayBufferView(r)){switch(r=h||r,r=this.__addimage__.isArrayBuffer(r)?new Uint8Array(r):r,d=function(w){for(var S,p=256*w.charCodeAt(4)+w.charCodeAt(5),O=w.length,N={width:0,height:0,numcomponents:1},T=4;T<O;T+=2){if(T+=p,t.indexOf(w.charCodeAt(T+1))!==-1){S=256*w.charCodeAt(T+5)+w.charCodeAt(T+6),N={width:256*w.charCodeAt(T+7)+w.charCodeAt(T+8),height:S,numcomponents:w.charCodeAt(T+9)};break}p=256*w.charCodeAt(T+2)+w.charCodeAt(T+3)}return N}(r=this.__addimage__.isArrayBufferView(r)?this.__addimage__.arrayBufferToBinaryString(r):r),d.numcomponents){case 1:c=this.color_spaces.DEVICE_GRAY;break;case 4:c=this.color_spaces.DEVICE_CMYK;break;case 3:c=this.color_spaces.DEVICE_RGB}m={data:r,width:d.width,height:d.height,colorSpace:c,bitsPerComponent:8,filter:g,index:n,alias:s}}return m}}(Ke.API),Ke.API.processPNG=function(e,t,r,n){if(this.__addimage__.isArrayBuffer(e)&&(e=new Uint8Array(e)),this.__addimage__.isArrayBufferView(e)){var s,a=t1(e,{checkCrc:!0}),h=a.width,c=a.height,d=a.channels,g=a.palette,m=a.depth;s=g&&d===1?function(C){for(var R=C.width,ne=C.height,j=C.data,P=C.palette,G=C.depth,$=!1,ue=[],fe=[],me=void 0,se=!1,ge=0,W=0;W<P.length;W++){var M=ic(P[W],4),b=M[0],I=M[1],D=M[2],z=M[3];ue.push(b,I,D),z!=null&&(z===0?(ge++,fe.length<1&&fe.push(W)):z<255&&(se=!0))}if(se||ge>1){$=!0,fe=void 0;var V=R*ne;me=new Uint8Array(V);for(var Y=new DataView(j.buffer),re=0;re<V;re++){var oe=Yo(Y,re,G),de=ic(P[oe],4)[3];me[re]=de}}else ge===0&&(fe=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:$?8:void 0,colorBytes:j,alphaBytes:me,needSMask:$,palette:ue,mask:fe}}(a):d===2||d===4?function(C){for(var R=C.data,ne=C.width,j=C.height,P=C.channels,G=C.depth,$=P===2?"DeviceGray":"DeviceRGB",ue=P-1,fe=ne*j,me=ue,se=fe*me,ge=1*fe,W=Math.ceil(se*G/8),M=Math.ceil(ge*G/8),b=new Uint8Array(W),I=new Uint8Array(M),D=new DataView(R.buffer),z=new DataView(b.buffer),V=new DataView(I.buffer),Y=!1,re=0;re<fe;re++){for(var oe=re*P,de=0;de<me;de++)pu(z,Yo(D,oe+de,G),re*me+de,G);var ye=Yo(D,oe+me,G);ye<(1<<G)-1&&(Y=!0),pu(V,ye,1*re,G)}return{colorSpace:$,colorsPerPixel:ue,sMaskBitsPerComponent:Y?G:void 0,colorBytes:b,alphaBytes:I,needSMask:Y}}(a):function(C){var R=C.data,ne=C.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:ne,colorsPerPixel:ne==="DeviceGray"?1:3,colorBytes:R instanceof Uint16Array?function(j){for(var P=j.length,G=new Uint8Array(2*P),$=new DataView(G.buffer,G.byteOffset,G.byteLength),ue=0;ue<P;ue++)$.setUint16(2*ue,j[ue],!1);return G}(R):R,needSMask:!1}}(a);var w,S,p,O=s,N=O.colorSpace,T=O.colorsPerPixel,L=O.sMaskBitsPerComponent,K=O.colorBytes,X=O.alphaBytes,H=O.needSMask,Q=O.palette,he=O.mask,pe=null;return n!==Ke.API.image_compression.NONE&&typeof tl=="function"?(pe=function(C){var R;switch(C){case Ke.API.image_compression.FAST:R=11;break;case Ke.API.image_compression.MEDIUM:R=13;break;case Ke.API.image_compression.SLOW:R=14;break;default:R=12}return R}(n),w=this.decode.FLATE_DECODE,S="/Predictor ".concat(pe," /Colors ").concat(T," /BitsPerComponent ").concat(m," /Columns ").concat(h),e=cu(K,Math.ceil(h*T*m/8),T,m,n),H&&(p=cu(X,Math.ceil(h*L/8),1,L,n))):(w=void 0,S=void 0,e=K,H&&(p=X)),(this.__addimage__.isArrayBuffer(e)||this.__addimage__.isArrayBufferView(e))&&(e=this.__addimage__.arrayBufferToBinaryString(e)),(p&&this.__addimage__.isArrayBuffer(p)||this.__addimage__.isArrayBufferView(p))&&(p=this.__addimage__.arrayBufferToBinaryString(p)),{alias:r,data:e,index:t,filter:w,decodeParameters:S,transparency:he,palette:Q,sMask:p,predictor:pe,width:h,height:c,bitsPerComponent:m,sMaskBitsPerComponent:L,colorSpace:N}}},function(e){e.processGIF89A=function(t,r,n,s){var a=new N1(t),h=a.width,c=a.height,d=[];a.decodeAndBlitFrameRGBA(0,d);var g={data:d,width:h,height:c},m=new Ko(100).encode(g,100);return e.processJPEG.call(this,m,r,n,s)},e.processGIF87A=e.processGIF89A}(Ke.API),tn.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var e=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(e);for(var t=0;t<e;t++){var r=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0);this.palette[t]={red:s,green:n,blue:r,quad:a}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},tn.prototype.parseBGR=function(){this.pos=this.offset;var e="bit"+this.bitPP,t=this.width*this.height*4;if(t>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");this.data=new Uint8Array(t);try{this[e]()}catch(r){It.log("bit decode error:"+r)}},tn.prototype.bit1=function(){var e,t=Math.ceil(this.width/8),r=t%4;for(e=this.height-1;e>=0;e--){for(var n=this.bottom_up?e:this.height-1-e,s=0;s<t;s++)for(var a=this.datav.getUint8(this.pos++,!0),h=n*this.width*4+8*s*4,c=0;c<8&&8*s+c<this.width;c++){var d=this.palette[a>>7-c&1];this.data[h+4*c]=d.blue,this.data[h+4*c+1]=d.green,this.data[h+4*c+2]=d.red,this.data[h+4*c+3]=255}r!==0&&(this.pos+=4-r)}},tn.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,s=0;s<e;s++){var a=this.datav.getUint8(this.pos++,!0),h=n*this.width*4+2*s*4,c=a>>4,d=15&a,g=this.palette[c];if(this.data[h]=g.blue,this.data[h+1]=g.green,this.data[h+2]=g.red,this.data[h+3]=255,2*s+1>=this.width)break;g=this.palette[d],this.data[h+4]=g.blue,this.data[h+4+1]=g.green,this.data[h+4+2]=g.red,this.data[h+4+3]=255}t!==0&&(this.pos+=4-t)}},tn.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;t>=0;t--){for(var r=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var s=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+4*n;if(s<this.palette.length){var h=this.palette[s];this.data[a]=h.red,this.data[a+1]=h.green,this.data[a+2]=h.blue,this.data[a+3]=255}else this.data[a]=255,this.data[a+1]=255,this.data[a+2]=255,this.data[a+3]=255}e!==0&&(this.pos+=4-e)}},tn.prototype.bit15=function(){for(var e=this.width%3,t=parseInt("11111",2),r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,s=0;s<this.width;s++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var h=(a&t)/t*255|0,c=(a>>5&t)/t*255|0,d=(a>>10&t)/t*255|0,g=a>>15?255:0,m=n*this.width*4+4*s;this.data[m]=d,this.data[m+1]=c,this.data[m+2]=h,this.data[m+3]=g}this.pos+=e}},tn.prototype.bit16=function(){for(var e=this.width%3,t=parseInt("11111",2),r=parseInt("111111",2),n=this.height-1;n>=0;n--){for(var s=this.bottom_up?n:this.height-1-n,a=0;a<this.width;a++){var h=this.datav.getUint16(this.pos,!0);this.pos+=2;var c=(h&t)/t*255|0,d=(h>>5&r)/r*255|0,g=(h>>11)/t*255|0,m=s*this.width*4+4*a;this.data[m]=g,this.data[m+1]=d,this.data[m+2]=c,this.data[m+3]=255}this.pos+=e}},tn.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var n=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),h=t*this.width*4+4*r;this.data[h]=a,this.data[h+1]=s,this.data[h+2]=n,this.data[h+3]=255}this.pos+=this.width%4}},tn.prototype.bit32=function(){for(var e=this.height-1;e>=0;e--)for(var t=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var n=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),h=this.datav.getUint8(this.pos++,!0),c=t*this.width*4+4*r;this.data[c]=a,this.data[c+1]=s,this.data[c+2]=n,this.data[c+3]=h}},tn.prototype.getData=function(){return this.data},function(e){e.processBMP=function(t,r,n,s){var a=new tn(t,!1),h=a.width,c=a.height,d={data:a.getData(),width:h,height:c},g=new Ko(100).encode(d,100);return e.processJPEG.call(this,g,r,n,s)}}(Ke.API),mu.prototype.getData=function(){return this.data},function(e){e.processWEBP=function(t,r,n,s){var a=new mu(t),h=a.width,c=a.height,d={data:a.getData(),width:h,height:c},g=new Ko(100).encode(d,100);return e.processJPEG.call(this,g,r,n,s)}}(Ke.API),Ke.API.processRGBA=function(e,t,r){for(var n=e.data,s=n.length,a=new Uint8Array(s/4*3),h=new Uint8Array(s/4),c=0,d=0,g=0;g<s;g+=4){var m=n[g],w=n[g+1],S=n[g+2],p=n[g+3];a[c++]=m,a[c++]=w,a[c++]=S,h[d++]=p}var O=this.__addimage__.arrayBufferToBinaryString(a);return{alpha:this.__addimage__.arrayBufferToBinaryString(h),data:O,index:t,alias:r,colorSpace:"DeviceRGB",bitsPerComponent:8,width:e.width,height:e.height}},Ke.API.setLanguage=function(e){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[e]!==void 0&&(this.internal.languageSettings.languageCode=e,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},Ki=Ke.API,Pa=Ki.getCharWidthsArray=function(e,t){var r,n,s=(t=t||{}).font||this.internal.getFont(),a=t.fontSize||this.internal.getFontSize(),h=t.charSpace||this.internal.getCharSpace(),c=t.widths?t.widths:s.metadata.Unicode.widths,d=c.fof?c.fof:1,g=t.kerning?t.kerning:s.metadata.Unicode.kerning,m=g.fof?g.fof:1,w=t.doKerning!==!1,S=0,p=e.length,O=0,N=c[0]||d,T=[];for(r=0;r<p;r++)n=e.charCodeAt(r),typeof s.metadata.widthOfString=="function"?T.push((s.metadata.widthOfGlyph(s.metadata.characterToGlyph(n))+h*(1e3/a)||0)/1e3):(S=w&&Ft(g[n])==="object"&&!isNaN(parseInt(g[n][O],10))?g[n][O]/m:0,T.push((c[n]||N)/d+S)),O=n;return T},au=Ki.getStringUnitWidth=function(e,t){var r=(t=t||{}).fontSize||this.internal.getFontSize(),n=t.font||this.internal.getFont(),s=t.charSpace||this.internal.getCharSpace();return Ki.processArabic&&(e=Ki.processArabic(e)),typeof n.metadata.widthOfString=="function"?n.metadata.widthOfString(e,r,s)/r:Pa.apply(this,arguments).reduce(function(a,h){return a+h},0)},ou=function(e,t,r,n){for(var s=[],a=0,h=e.length,c=0;a!==h&&c+t[a]<r;)c+=t[a],a++;s.push(e.slice(0,a));var d=a;for(c=0;a!==h;)c+t[a]>n&&(s.push(e.slice(d,a)),c=0,d=a),c+=t[a],a++;return d!==a&&s.push(e.slice(d,a)),s},lu=function(e,t,r){r||(r={});var n,s,a,h,c,d,g,m=[],w=[m],S=r.textIndent||0,p=0,O=0,N=e.split(" "),T=Pa.apply(this,[" ",r])[0];if(d=r.lineIndent===-1?N[0].length+2:r.lineIndent||0){var L=Array(d).join(" "),K=[];N.map(function(H){(H=H.split(/\s*\n/)).length>1?K=K.concat(H.map(function(Q,he){return(he&&Q.length?`
`:"")+Q})):K.push(H[0])}),N=K,d=au.apply(this,[L,r])}for(a=0,h=N.length;a<h;a++){var X=0;if(n=N[a],d&&n[0]==`
`&&(n=n.substr(1),X=1),S+p+(O=(s=Pa.apply(this,[n,r])).reduce(function(H,Q){return H+Q},0))>t||X){if(O>t){for(c=ou.apply(this,[n,s,t-(S+p),t]),m.push(c.shift()),m=[c.pop()];c.length;)w.push([c.shift()]);O=s.slice(n.length-(m[0]?m[0].length:0)).reduce(function(H,Q){return H+Q},0)}else m=[n];w.push(m),S=O+d,p=T}else m.push(n),S+=p+O,p=T}return g=d?function(H,Q){return(Q?L:"")+H.join(" ")}:function(H){return H.join(" ")},w.map(g)},Ki.splitTextToSize=function(e,t,r){var n,s=(r=r||{}).fontSize||this.internal.getFontSize(),a=(function(m){if(m.widths&&m.kerning)return{widths:m.widths,kerning:m.kerning};var w=this.internal.getFont(m.fontName,m.fontStyle),S="Unicode";return w.metadata[S]?{widths:w.metadata[S].widths||{0:1},kerning:w.metadata[S].kerning||{}}:{font:w.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,r);n=Array.isArray(e)?e:String(e).split(/\r?\n/);var h=1*this.internal.scaleFactor*t/s;a.textIndent=r.textIndent?1*r.textIndent*this.internal.scaleFactor/s:0,a.lineIndent=r.lineIndent;var c,d,g=[];for(c=0,d=n.length;c<d;c++)g=g.concat(lu.apply(this,[n[c],h,a]));return g},function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="0123456789abcdef",r="klmnopqrstuvwxyz",n={},s={},a=0;a<16;a++)n[r[a]]=t[a],s[t[a]]=r[a];var h=function(S){return"0x"+parseInt(S,10).toString(16)},c=e.__fontmetrics__.compress=function(S){var p,O,N,T,L=["{"];for(var K in S){if(p=S[K],isNaN(parseInt(K,10))?O="'"+K+"'":(K=parseInt(K,10),O=(O=h(K).slice(2)).slice(0,-1)+s[O.slice(-1)]),typeof p=="number")p<0?(N=h(p).slice(3),T="-"):(N=h(p).slice(2),T=""),N=T+N.slice(0,-1)+s[N.slice(-1)];else{if(Ft(p)!=="object")throw new Error("Don't know what to do with value type "+Ft(p)+".");N=c(p)}L.push(O+N)}return L.push("}"),L.join("")},d=e.__fontmetrics__.uncompress=function(S){if(typeof S!="string")throw new Error("Invalid argument passed to uncompress.");for(var p,O,N,T,L={},K=1,X=L,H=[],Q="",he="",pe=S.length-1,C=1;C<pe;C+=1)(T=S[C])=="'"?p?(N=p.join(""),p=void 0):p=[]:p?p.push(T):T=="{"?(H.push([X,N]),X={},N=void 0):T=="}"?((O=H.pop())[0][O[1]]=X,N=void 0,X=O[0]):T=="-"?K=-1:N===void 0?n.hasOwnProperty(T)?(Q+=n[T],N=parseInt(Q,16)*K,K=1,Q=""):Q+=T:n.hasOwnProperty(T)?(he+=n[T],X[N]=parseInt(he,16)*K,K=1,N=void 0,he=""):he+=T;return L},g={codePages:["WinAnsiEncoding"],WinAnsiEncoding:d("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},m={Unicode:{Courier:g,"Courier-Bold":g,"Courier-BoldOblique":g,"Courier-Oblique":g,Helvetica:g,"Helvetica-Bold":g,"Helvetica-BoldOblique":g,"Helvetica-Oblique":g,"Times-Roman":g,"Times-Bold":g,"Times-BoldItalic":g,"Times-Italic":g}},w={Unicode:{"Courier-Oblique":d("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":d("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":d("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:d("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":d("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":d("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:d("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:d("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":d("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:d("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":d("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":d("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":d("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":d("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};e.events.push(["addFont",function(S){var p=S.font,O=w.Unicode[p.postScriptName];O&&(p.metadata.Unicode={},p.metadata.Unicode.widths=O.widths,p.metadata.Unicode.kerning=O.kerning);var N=m.Unicode[p.postScriptName];N&&(p.metadata.Unicode.encoding=N,p.encoding=N.codePages[0])}])}(Ke.API),function(e){var t=function(r){for(var n=r.length,s=new Uint8Array(n),a=0;a<n;a++)s[a]=r.charCodeAt(a);return s};e.API.events.push(["addFont",function(r){var n=void 0,s=r.font,a=r.instance;if(!s.isStandardFont){if(a===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+s.postScriptName+"').");if(typeof(n=a.existsFileInVFS(s.postScriptName)===!1?a.loadFile(s.postScriptName):a.getFileFromVFS(s.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+s.postScriptName+"').");(function(h,c){c=/^\x00\x01\x00\x00/.test(c)?t(c):t(Oa(c)),h.metadata=e.API.TTFFont.open(c),h.metadata.Unicode=h.metadata.Unicode||{encoding:{},kerning:{},widths:[]},h.metadata.glyIdsUsed=[0]})(s,n)}}])}(Ke),Ke.API.addSvgAsImage=function(e,t,r,n,s,a,h,c){if(isNaN(t)||isNaN(r))throw It.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(n)||isNaN(s))throw It.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var d=document.createElement("canvas");d.width=n,d.height=s;var g=d.getContext("2d");g.fillStyle="#fff",g.fillRect(0,0,d.width,d.height);var m={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},w=this;return(st.canvg?Promise.resolve(st.canvg):Co(()=>import("./index.es-BJLvFYMV.js"),__vite__mapDeps([0,1,2,3,4]))).catch(function(S){return Promise.reject(new Error("Could not load canvg: "+S))}).then(function(S){return S.default?S.default:S}).then(function(S){return S.fromString(g,e,m)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(S){return S.render(m)}).then(function(){w.addImage(d.toDataURL("image/jpeg",1),t,r,n,s,h,c)})},Ke.API.putTotalPages=function(e){var t,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),r=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var s=0;s<this.internal.pages[n].length;s++)this.internal.pages[n][s]=this.internal.pages[n][s].replace(t,r);return this},Ke.API.viewerPreferences=function(e,t){var r;e=e||{},t=t||!1;var n,s,a,h={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},c=Object.keys(h),d=[],g=0,m=0,w=0;function S(O,N){var T,L=!1;for(T=0;T<O.length;T+=1)O[T]===N&&(L=!0);return L}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(h)),this.internal.viewerpreferences.isSubscribed=!1),r=this.internal.viewerpreferences.configuration,e==="reset"||t===!0){var p=c.length;for(w=0;w<p;w+=1)r[c[w]].value=r[c[w]].defaultValue,r[c[w]].explicitSet=!1}if(Ft(e)==="object"){for(s in e)if(a=e[s],S(c,s)&&a!==void 0){if(r[s].type==="boolean"&&typeof a=="boolean")r[s].value=a;else if(r[s].type==="name"&&S(r[s].valueSet,a))r[s].value=a;else if(r[s].type==="integer"&&Number.isInteger(a))r[s].value=a;else if(r[s].type==="array"){for(g=0;g<a.length;g+=1)if(n=!0,a[g].length===1&&typeof a[g][0]=="number")d.push(String(a[g]-1));else if(a[g].length>1){for(m=0;m<a[g].length;m+=1)typeof a[g][m]!="number"&&(n=!1);n===!0&&d.push([a[g][0]-1,a[g][1]-1].join(" "))}r[s].value="["+d.join(" ")+"]"}else r[s].value=r[s].defaultValue;r[s].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var O,N=[];for(O in r)r[O].explicitSet===!0&&(r[O].type==="name"?N.push("/"+O+" /"+r[O].value):N.push("/"+O+" "+r[O].value));N.length!==0&&this.internal.write(`/ViewerPreferences
<<
`+N.join(`
`)+`
>>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=r,this},Ke.API.addMetadata=function(e,t){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:e,namespaceUri:t??"http://jspdf.default.namespaceuri/",rawXml:typeof t=="boolean"&&t},this.internal.events.subscribe("putCatalog",j1),this.internal.events.subscribe("postPutResources",_1)),this},function(e){var t=e.API,r=t.pdfEscape16=function(a,h){for(var c,d=h.metadata.Unicode.widths,g=["","0","00","000","0000"],m=[""],w=0,S=a.length;w<S;++w){if(c=h.metadata.characterToGlyph(a.charCodeAt(w)),h.metadata.glyIdsUsed.push(c),h.metadata.toUnicode[c]=a.charCodeAt(w),d.indexOf(c)==-1&&(d.push(c),d.push([parseInt(h.metadata.widthOfGlyph(c),10)])),c=="0")return m.join("");c=c.toString(16),m.push(g[4-c.length],c)}return m.join("")},n=function(a){var h,c,d,g,m,w,S;for(m=`/CIDInit /ProcSet findresource begin
12 dict begin
begincmap
/CIDSystemInfo <<
  /Registry (Adobe)
  /Ordering (UCS)
  /Supplement 0
>> def
/CMapName /Adobe-Identity-UCS def
/CMapType 2 def
1 begincodespacerange
<0000><ffff>
endcodespacerange`,d=[],w=0,S=(c=Object.keys(a).sort(function(p,O){return p-O})).length;w<S;w++)h=c[w],d.length>=100&&(m+=`
`+d.length+` beginbfchar
`+d.join(`
`)+`
endbfchar`,d=[]),a[h]!==void 0&&a[h]!==null&&typeof a[h].toString=="function"&&(g=("0000"+a[h].toString(16)).slice(-4),h=("0000"+(+h).toString(16)).slice(-4),d.push("<"+h+"><"+g+">"));return d.length&&(m+=`
`+d.length+` beginbfchar
`+d.join(`
`)+`
endbfchar
`),m+`endcmap
CMapName currentdict /CMap defineresource pop
end
end`};t.events.push(["putFont",function(a){(function(h){var c=h.font,d=h.out,g=h.newObject,m=h.putStream;if(c.metadata instanceof e.API.TTFFont&&c.encoding==="Identity-H"){for(var w=c.metadata.Unicode.widths,S=c.metadata.subset.encode(c.metadata.glyIdsUsed,1),p="",O=0;O<S.length;O++)p+=String.fromCharCode(S[O]);var N=g();m({data:p,addLength1:!0,objectId:N}),d("endobj");var T=g();m({data:n(c.metadata.toUnicode),addLength1:!0,objectId:T}),d("endobj");var L=g();d("<<"),d("/Type /FontDescriptor"),d("/FontName /"+Zi(c.fontName)),d("/FontFile2 "+N+" 0 R"),d("/FontBBox "+e.API.PDFObject.convert(c.metadata.bbox)),d("/Flags "+c.metadata.flags),d("/StemV "+c.metadata.stemV),d("/ItalicAngle "+c.metadata.italicAngle),d("/Ascent "+c.metadata.ascender),d("/Descent "+c.metadata.decender),d("/CapHeight "+c.metadata.capHeight),d(">>"),d("endobj");var K=g();d("<<"),d("/Type /Font"),d("/BaseFont /"+Zi(c.fontName)),d("/FontDescriptor "+L+" 0 R"),d("/W "+e.API.PDFObject.convert(w)),d("/CIDToGIDMap /Identity"),d("/DW 1000"),d("/Subtype /CIDFontType2"),d("/CIDSystemInfo"),d("<<"),d("/Supplement 0"),d("/Registry (Adobe)"),d("/Ordering ("+c.encoding+")"),d(">>"),d(">>"),d("endobj"),c.objectNumber=g(),d("<<"),d("/Type /Font"),d("/Subtype /Type0"),d("/ToUnicode "+T+" 0 R"),d("/BaseFont /"+Zi(c.fontName)),d("/Encoding /"+c.encoding),d("/DescendantFonts ["+K+" 0 R]"),d(">>"),d("endobj"),c.isAlreadyPutted=!0}})(a)}]),t.events.push(["putFont",function(a){(function(h){var c=h.font,d=h.out,g=h.newObject,m=h.putStream;if(c.metadata instanceof e.API.TTFFont&&c.encoding==="WinAnsiEncoding"){for(var w=c.metadata.rawData,S="",p=0;p<w.length;p++)S+=String.fromCharCode(w[p]);var O=g();m({data:S,addLength1:!0,objectId:O}),d("endobj");var N=g();m({data:n(c.metadata.toUnicode),addLength1:!0,objectId:N}),d("endobj");var T=g();d("<<"),d("/Descent "+c.metadata.decender),d("/CapHeight "+c.metadata.capHeight),d("/StemV "+c.metadata.stemV),d("/Type /FontDescriptor"),d("/FontFile2 "+O+" 0 R"),d("/Flags 96"),d("/FontBBox "+e.API.PDFObject.convert(c.metadata.bbox)),d("/FontName /"+Zi(c.fontName)),d("/ItalicAngle "+c.metadata.italicAngle),d("/Ascent "+c.metadata.ascender),d(">>"),d("endobj"),c.objectNumber=g();for(var L=0;L<c.metadata.hmtx.widths.length;L++)c.metadata.hmtx.widths[L]=parseInt(c.metadata.hmtx.widths[L]*(1e3/c.metadata.head.unitsPerEm));d("<</Subtype/TrueType/Type/Font/ToUnicode "+N+" 0 R/BaseFont/"+Zi(c.fontName)+"/FontDescriptor "+T+" 0 R/Encoding/"+c.encoding+" /FirstChar 29 /LastChar 255 /Widths "+e.API.PDFObject.convert(c.metadata.hmtx.widths)+">>"),d("endobj"),c.isAlreadyPutted=!0}})(a)}]);var s=function(a){var h,c=a.text||"",d=a.x,g=a.y,m=a.options||{},w=a.mutex||{},S=w.pdfEscape,p=w.activeFontKey,O=w.fonts,N=p,T="",L=0,K="",X=O[N].encoding;if(O[N].encoding!=="Identity-H")return{text:c,x:d,y:g,options:m,mutex:w};for(K=c,N=p,Array.isArray(c)&&(K=c[0]),L=0;L<K.length;L+=1)O[N].metadata.hasOwnProperty("cmap")&&(h=O[N].metadata.cmap.unicode.codeMap[K[L].charCodeAt(0)]),h||K[L].charCodeAt(0)<256&&O[N].metadata.hasOwnProperty("Unicode")?T+=K[L]:T+="";var H="";return parseInt(N.slice(1))<14||X==="WinAnsiEncoding"?H=S(T,N).split("").map(function(Q){return Q.charCodeAt(0).toString(16)}).join(""):X==="Identity-H"&&(H=r(T,O[N])),w.isHex=!0,{text:H,x:d,y:g,options:m,mutex:w}};t.events.push(["postProcessText",function(a){var h=a.text||"",c=[],d={text:h,x:a.x,y:a.y,options:a.options,mutex:a.mutex};if(Array.isArray(h)){var g=0;for(g=0;g<h.length;g+=1)Array.isArray(h[g])&&h[g].length===3?c.push([s(Object.assign({},d,{text:h[g][0]})).text,h[g][1],h[g][2]]):c.push(s(Object.assign({},d,{text:h[g]})).text);a.text=c}else a.text=s(Object.assign({},d,{text:h})).text}])}(Ke),function(e){var t=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};e.existsFileInVFS=function(r){return t.call(this),this.internal.vFS[r]!==void 0},e.addFileToVFS=function(r,n){return t.call(this),this.internal.vFS[r]=n,this},e.getFileFromVFS=function(r){return t.call(this),this.internal.vFS[r]!==void 0?this.internal.vFS[r]:null}}(Ke.API),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(n){var s,a,h,c,d,g,m,w=t,S=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],p=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],O={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},N={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},T=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],L=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),K=!1,X=0;this.__bidiEngine__={};var H=function(j){var P=j.charCodeAt(),G=P>>8,$=N[G];return $!==void 0?w[256*$+(255&P)]:G===252||G===253?"AL":L.test(G)?"L":G===8?"R":"N"},Q=function(j){for(var P,G=0;G<j.length;G++){if((P=H(j.charAt(G)))==="L")return!1;if(P==="R")return!0}return!1},he=function(j,P,G,$){var ue,fe,me,se,ge=P[$];switch(ge){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":K=!1;break;case"N":case"AN":break;case"EN":K&&(ge="AN");break;case"AL":K=!0,ge="R";break;case"WS":case"BN":ge="N";break;case"CS":$<1||$+1>=P.length||(ue=G[$-1])!=="EN"&&ue!=="AN"||(fe=P[$+1])!=="EN"&&fe!=="AN"?ge="N":K&&(fe="AN"),ge=fe===ue?fe:"N";break;case"ES":ge=(ue=$>0?G[$-1]:"B")==="EN"&&$+1<P.length&&P[$+1]==="EN"?"EN":"N";break;case"ET":if($>0&&G[$-1]==="EN"){ge="EN";break}if(K){ge="N";break}for(me=$+1,se=P.length;me<se&&P[me]==="ET";)me++;ge=me<se&&P[me]==="EN"?"EN":"N";break;case"NSM":if(h&&!c){for(se=P.length,me=$+1;me<se&&P[me]==="NSM";)me++;if(me<se){var W=j[$],M=W>=1425&&W<=2303||W===64286;if(ue=P[me],M&&(ue==="R"||ue==="AL")){ge="R";break}}}ge=$<1||(ue=P[$-1])==="B"?"N":G[$-1];break;case"B":K=!1,s=!0,ge=X;break;case"S":a=!0,ge="N"}return ge},pe=function(j,P,G){var $=j.split("");return G&&C($,G,{hiLevel:X}),$.reverse(),P&&P.reverse(),$.join("")},C=function(j,P,G){var $,ue,fe,me,se,ge=-1,W=j.length,M=0,b=[],I=X?p:S,D=[];for(K=!1,s=!1,a=!1,ue=0;ue<W;ue++)D[ue]=H(j[ue]);for(fe=0;fe<W;fe++){if(se=M,b[fe]=he(j,D,b,fe),$=240&(M=I[se][O[b[fe]]]),M&=15,P[fe]=me=I[M][5],$>0)if($===16){for(ue=ge;ue<fe;ue++)P[ue]=1;ge=-1}else ge=-1;if(I[M][6])ge===-1&&(ge=fe);else if(ge>-1){for(ue=ge;ue<fe;ue++)P[ue]=me;ge=-1}D[fe]==="B"&&(P[fe]=0),G.hiLevel|=me}a&&function(z,V,Y){for(var re=0;re<Y;re++)if(z[re]==="S"){V[re]=X;for(var oe=re-1;oe>=0&&z[oe]==="WS";oe--)V[oe]=X}}(D,P,W)},R=function(j,P,G,$,ue){if(!(ue.hiLevel<j)){if(j===1&&X===1&&!s)return P.reverse(),void(G&&G.reverse());for(var fe,me,se,ge,W=P.length,M=0;M<W;){if($[M]>=j){for(se=M+1;se<W&&$[se]>=j;)se++;for(ge=M,me=se-1;ge<me;ge++,me--)fe=P[ge],P[ge]=P[me],P[me]=fe,G&&(fe=G[ge],G[ge]=G[me],G[me]=fe);M=se}M++}}},ne=function(j,P,G){var $=j.split(""),ue={hiLevel:X};return G||(G=[]),C($,G,ue),function(fe,me,se){if(se.hiLevel!==0&&m)for(var ge,W=0;W<fe.length;W++)me[W]===1&&(ge=T.indexOf(fe[W]))>=0&&(fe[W]=T[ge+1])}($,G,ue),R(2,$,P,G,ue),R(1,$,P,G,ue),$.join("")};return this.__bidiEngine__.doBidiReorder=function(j,P,G){if(function(ue,fe){if(fe)for(var me=0;me<ue.length;me++)fe[me]=me;c===void 0&&(c=Q(ue)),g===void 0&&(g=Q(ue))}(j,P),h||!d||g)if(h&&d&&c^g)X=c?1:0,j=pe(j,P,G);else if(!h&&d&&g)X=c?1:0,j=ne(j,P,G),j=pe(j,P);else if(!h||c||d||g){if(h&&!d&&c^g)j=pe(j,P),c?(X=0,j=ne(j,P,G)):(X=1,j=ne(j,P,G),j=pe(j,P));else if(h&&c&&!d&&g)X=1,j=ne(j,P,G),j=pe(j,P);else if(!h&&!d&&c^g){var $=m;c?(X=1,j=ne(j,P,G),X=0,m=!1,j=ne(j,P,G),m=$):(X=0,j=ne(j,P,G),j=pe(j,P),X=1,m=!1,j=ne(j,P,G),m=$,j=pe(j,P))}}else X=0,j=ne(j,P,G);else X=c?1:0,j=ne(j,P,G);return j},this.__bidiEngine__.setOptions=function(j){j&&(h=j.isInputVisual,d=j.isOutputVisual,c=j.isInputRtl,g=j.isOutputRtl,m=j.isSymmetricSwapping)},this.__bidiEngine__.setOptions(n),this.__bidiEngine__};var t=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],r=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push(["postProcessText",function(n){var s=n.text;n.x,n.y;var a=n.options||{};n.mutex,a.lang;var h=[];if(a.isInputVisual=typeof a.isInputVisual!="boolean"||a.isInputVisual,r.setOptions(a),Object.prototype.toString.call(s)==="[object Array]"){var c=0;for(h=[],c=0;c<s.length;c+=1)Object.prototype.toString.call(s[c])==="[object Array]"?h.push([r.doBidiReorder(s[c][0]),s[c][1],s[c][2]]):h.push([r.doBidiReorder(s[c])]);n.text=h}else n.text=r.doBidiReorder(s);r.setOptions({isInputVisual:!0})}])}(Ke),Ke.API.TTFFont=function(){function e(t){var r;if(this.rawData=t,r=this.contents=new ci(t),this.contents.pos=4,r.readString(4)==="ttcf")throw new Error("TTCF not supported.");r.pos=0,this.parse(),this.subset=new B1(this),this.registerTTF()}return e.open=function(t){return new e(t)},e.prototype.parse=function(){return this.directory=new A1(this.contents),this.head=new L1(this),this.name=new F1(this),this.cmap=new vh(this),this.toUnicode={},this.hhea=new k1(this),this.maxp=new E1(this),this.hmtx=new O1(this),this.post=new P1(this),this.os2=new C1(this),this.loca=new D1(this),this.glyf=new T1(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},e.prototype.registerTTF=function(){var t,r,n,s,a;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var h,c,d,g;for(g=[],h=0,c=(d=this.bbox).length;h<c;h++)t=d[h],g.push(Math.round(t*this.scaleFactor));return g}).call(this),this.stemV=0,this.post.exists?(n=255&(s=this.post.italic_angle),32768&(r=s>>16)&&(r=-(1+(65535^r))),this.italicAngle=+(r+"."+n)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(a=this.familyClass)===1||a===2||a===3||a===4||a===5||a===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},e.prototype.characterToGlyph=function(t){var r;return((r=this.cmap.unicode)!=null?r.codeMap[t]:void 0)||0},e.prototype.widthOfGlyph=function(t){var r;return r=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*r},e.prototype.widthOfString=function(t,r,n){var s,a,h,c;for(h=0,a=0,c=(t=""+t).length;0<=c?a<c:a>c;a=0<=c?++a:--a)s=t.charCodeAt(a),h+=this.widthOfGlyph(this.characterToGlyph(s))+n*(1e3/r)||0;return h*(r/1e3)},e.prototype.lineHeight=function(t,r){var n;return r==null&&(r=!1),n=r?this.lineGap:0,(this.ascender+n-this.decender)/1e3*t},e}();var an,ci=function(){function e(t){this.data=t??[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(t){return this.data[this.pos++]=t},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(t){return this.writeByte(t>>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt32=function(){var t;return(t=this.readUInt32())>=2147483648?t-4294967296:t},e.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt16=function(){var t;return(t=this.readUInt16())>=32768?t-65536:t},e.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},e.prototype.readString=function(t){var r,n;for(n=[],r=0;0<=t?r<t:r>t;r=0<=t?++r:--r)n[r]=String.fromCharCode(this.readByte());return n.join("")},e.prototype.writeString=function(t){var r,n,s;for(s=[],r=0,n=t.length;0<=n?r<n:r>n;r=0<=n?++r:--r)s.push(this.writeByte(t.charCodeAt(r)));return s},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(t){return this.writeInt16(t)},e.prototype.readLongLong=function(){var t,r,n,s,a,h,c,d;return t=this.readByte(),r=this.readByte(),n=this.readByte(),s=this.readByte(),a=this.readByte(),h=this.readByte(),c=this.readByte(),d=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^r)+1099511627776*(255^n)+4294967296*(255^s)+16777216*(255^a)+65536*(255^h)+256*(255^c)+(255^d)+1):72057594037927940*t+281474976710656*r+1099511627776*n+4294967296*s+16777216*a+65536*h+256*c+d},e.prototype.writeLongLong=function(t){var r,n;return r=Math.floor(t/4294967296),n=4294967295&t,this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(t){return this.writeInt32(t)},e.prototype.read=function(t){var r,n;for(r=[],n=0;0<=t?n<t:n>t;n=0<=t?++n:--n)r.push(this.readByte());return r},e.prototype.write=function(t){var r,n,s,a;for(a=[],n=0,s=t.length;n<s;n++)r=t[n],a.push(this.writeByte(r));return a},e}(),A1=function(){var e;function t(r){var n,s,a;for(this.scalarType=r.readInt(),this.tableCount=r.readShort(),this.searchRange=r.readShort(),this.entrySelector=r.readShort(),this.rangeShift=r.readShort(),this.tables={},s=0,a=this.tableCount;0<=a?s<a:s>a;s=0<=a?++s:--s)n={tag:r.readString(4),checksum:r.readInt(),offset:r.readInt(),length:r.readInt()},this.tables[n.tag]=n}return t.prototype.encode=function(r){var n,s,a,h,c,d,g,m,w,S,p,O,N;for(N in p=Object.keys(r).length,d=Math.log(2),w=16*Math.floor(Math.log(p)/d),h=Math.floor(w/d),m=16*p-w,(s=new ci).writeInt(this.scalarType),s.writeShort(p),s.writeShort(w),s.writeShort(h),s.writeShort(m),a=16*p,g=s.pos+a,c=null,O=[],r)for(S=r[N],s.writeString(N),s.writeInt(e(S)),s.writeInt(g),s.writeInt(S.length),O=O.concat(S),N==="head"&&(c=g),g+=S.length;g%4;)O.push(0),g++;return s.write(O),n=2981146554-e(s.data),s.pos=c+8,s.writeUInt32(n),s.data},e=function(r){var n,s,a,h;for(r=yh.call(r);r.length%4;)r.push(0);for(a=new ci(r),s=0,n=0,h=r.length;n<h;n=n+=4)s+=a.readUInt32();return 4294967295&s},t}(),S1={}.hasOwnProperty,yn=function(e,t){for(var r in t)S1.call(t,r)&&(e[r]=t[r]);function n(){this.constructor=e}return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e};an=function(){function e(t){var r;this.file=t,r=this.file.directory.tables[this.tag],this.exists=!!r,r&&(this.offset=r.offset,this.length=r.length,this.parse(this.file.contents))}return e.prototype.parse=function(){},e.prototype.encode=function(){},e.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},e}();var L1=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return yn(e,an),e.prototype.tag="head",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.revision=t.readInt(),this.checkSumAdjustment=t.readInt(),this.magicNumber=t.readInt(),this.flags=t.readShort(),this.unitsPerEm=t.readShort(),this.created=t.readLongLong(),this.modified=t.readLongLong(),this.xMin=t.readShort(),this.yMin=t.readShort(),this.xMax=t.readShort(),this.yMax=t.readShort(),this.macStyle=t.readShort(),this.lowestRecPPEM=t.readShort(),this.fontDirectionHint=t.readShort(),this.indexToLocFormat=t.readShort(),this.glyphDataFormat=t.readShort()},e.prototype.encode=function(t){var r;return(r=new ci).writeInt(this.version),r.writeInt(this.revision),r.writeInt(this.checkSumAdjustment),r.writeInt(this.magicNumber),r.writeShort(this.flags),r.writeShort(this.unitsPerEm),r.writeLongLong(this.created),r.writeLongLong(this.modified),r.writeShort(this.xMin),r.writeShort(this.yMin),r.writeShort(this.xMax),r.writeShort(this.yMax),r.writeShort(this.macStyle),r.writeShort(this.lowestRecPPEM),r.writeShort(this.fontDirectionHint),r.writeShort(t),r.writeShort(this.glyphDataFormat),r.data},e}(),xu=function(){function e(t,r){var n,s,a,h,c,d,g,m,w,S,p,O,N,T,L,K,X;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=r+t.readInt(),w=t.pos,t.pos=this.offset,this.format=t.readUInt16(),this.length=t.readUInt16(),this.language=t.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(d=0;d<256;++d)this.codeMap[d]=t.readByte();break;case 4:for(p=t.readUInt16(),S=p/2,t.pos+=6,a=function(){var H,Q;for(Q=[],d=H=0;0<=S?H<S:H>S;d=0<=S?++H:--H)Q.push(t.readUInt16());return Q}(),t.pos+=2,N=function(){var H,Q;for(Q=[],d=H=0;0<=S?H<S:H>S;d=0<=S?++H:--H)Q.push(t.readUInt16());return Q}(),g=function(){var H,Q;for(Q=[],d=H=0;0<=S?H<S:H>S;d=0<=S?++H:--H)Q.push(t.readUInt16());return Q}(),m=function(){var H,Q;for(Q=[],d=H=0;0<=S?H<S:H>S;d=0<=S?++H:--H)Q.push(t.readUInt16());return Q}(),s=(this.length-t.pos+this.offset)/2,c=function(){var H,Q;for(Q=[],d=H=0;0<=s?H<s:H>s;d=0<=s?++H:--H)Q.push(t.readUInt16());return Q}(),d=L=0,X=a.length;L<X;d=++L)for(T=a[d],n=K=O=N[d];O<=T?K<=T:K>=T;n=O<=T?++K:--K)m[d]===0?h=n+g[d]:(h=c[m[d]/2+(n-O)-(S-d)]||0)!==0&&(h+=g[d]),this.codeMap[n]=65535&h}t.pos=w}return e.encode=function(t,r){var n,s,a,h,c,d,g,m,w,S,p,O,N,T,L,K,X,H,Q,he,pe,C,R,ne,j,P,G,$,ue,fe,me,se,ge,W,M,b,I,D,z,V,Y,re,oe,de,ye,je;switch($=new ci,h=Object.keys(t).sort(function(Ce,ke){return Ce-ke}),r){case"macroman":for(N=0,T=function(){var Ce=[];for(O=0;O<256;++O)Ce.push(0);return Ce}(),K={0:0},a={},ue=0,ge=h.length;ue<ge;ue++)K[oe=t[s=h[ue]]]==null&&(K[oe]=++N),a[s]={old:t[s],new:K[t[s]]},T[s]=K[t[s]];return $.writeUInt16(1),$.writeUInt16(0),$.writeUInt32(12),$.writeUInt16(0),$.writeUInt16(262),$.writeUInt16(0),$.write(T),{charMap:a,subtable:$.data,maxGlyphID:N+1};case"unicode":for(P=[],w=[],X=0,K={},n={},L=g=null,fe=0,W=h.length;fe<W;fe++)K[Q=t[s=h[fe]]]==null&&(K[Q]=++X),n[s]={old:Q,new:K[Q]},c=K[Q]-s,L!=null&&c===g||(L&&w.push(L),P.push(s),g=c),L=s;for(L&&w.push(L),w.push(65535),P.push(65535),ne=2*(R=P.length),C=2*Math.pow(Math.log(R)/Math.LN2,2),S=Math.log(C/2)/Math.LN2,pe=2*R-C,d=[],he=[],p=[],O=me=0,M=P.length;me<M;O=++me){if(j=P[O],m=w[O],j===65535){d.push(0),he.push(0);break}if(j-(G=n[j].new)>=32768)for(d.push(0),he.push(2*(p.length+R-O)),s=se=j;j<=m?se<=m:se>=m;s=j<=m?++se:--se)p.push(n[s].new);else d.push(G-j),he.push(0)}for($.writeUInt16(3),$.writeUInt16(1),$.writeUInt32(12),$.writeUInt16(4),$.writeUInt16(16+8*R+2*p.length),$.writeUInt16(0),$.writeUInt16(ne),$.writeUInt16(C),$.writeUInt16(S),$.writeUInt16(pe),Y=0,b=w.length;Y<b;Y++)s=w[Y],$.writeUInt16(s);for($.writeUInt16(0),re=0,I=P.length;re<I;re++)s=P[re],$.writeUInt16(s);for(de=0,D=d.length;de<D;de++)c=d[de],$.writeUInt16(c);for(ye=0,z=he.length;ye<z;ye++)H=he[ye],$.writeUInt16(H);for(je=0,V=p.length;je<V;je++)N=p[je],$.writeUInt16(N);return{charMap:n,subtable:$.data,maxGlyphID:X+1}}},e}(),vh=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return yn(e,an),e.prototype.tag="cmap",e.prototype.parse=function(t){var r,n,s;for(t.pos=this.offset,this.version=t.readUInt16(),s=t.readUInt16(),this.tables=[],this.unicode=null,n=0;0<=s?n<s:n>s;n=0<=s?++n:--n)r=new xu(t,this.offset),this.tables.push(r),r.isUnicode&&this.unicode==null&&(this.unicode=r);return!0},e.encode=function(t,r){var n,s;return r==null&&(r="macroman"),n=xu.encode(t,r),(s=new ci).writeUInt16(0),s.writeUInt16(1),n.table=s.data.concat(n.subtable),n},e}(),k1=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return yn(e,an),e.prototype.tag="hhea",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.ascender=t.readShort(),this.decender=t.readShort(),this.lineGap=t.readShort(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort(),this.minRightSideBearing=t.readShort(),this.xMaxExtent=t.readShort(),this.caretSlopeRise=t.readShort(),this.caretSlopeRun=t.readShort(),this.caretOffset=t.readShort(),t.pos+=8,this.metricDataFormat=t.readShort(),this.numberOfMetrics=t.readUInt16()},e}(),C1=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return yn(e,an),e.prototype.tag="OS/2",e.prototype.parse=function(t){if(t.pos=this.offset,this.version=t.readUInt16(),this.averageCharWidth=t.readShort(),this.weightClass=t.readUInt16(),this.widthClass=t.readUInt16(),this.type=t.readShort(),this.ySubscriptXSize=t.readShort(),this.ySubscriptYSize=t.readShort(),this.ySubscriptXOffset=t.readShort(),this.ySubscriptYOffset=t.readShort(),this.ySuperscriptXSize=t.readShort(),this.ySuperscriptYSize=t.readShort(),this.ySuperscriptXOffset=t.readShort(),this.ySuperscriptYOffset=t.readShort(),this.yStrikeoutSize=t.readShort(),this.yStrikeoutPosition=t.readShort(),this.familyClass=t.readShort(),this.panose=function(){var r,n;for(n=[],r=0;r<10;++r)n.push(t.readByte());return n}(),this.charRange=function(){var r,n;for(n=[],r=0;r<4;++r)n.push(t.readInt());return n}(),this.vendorID=t.readString(4),this.selection=t.readShort(),this.firstCharIndex=t.readShort(),this.lastCharIndex=t.readShort(),this.version>0&&(this.ascent=t.readShort(),this.descent=t.readShort(),this.lineGap=t.readShort(),this.winAscent=t.readShort(),this.winDescent=t.readShort(),this.codePageRange=function(){var r,n;for(n=[],r=0;r<2;r=++r)n.push(t.readInt());return n}(),this.version>1))return this.xHeight=t.readShort(),this.capHeight=t.readShort(),this.defaultChar=t.readShort(),this.breakChar=t.readShort(),this.maxContext=t.readShort()},e}(),P1=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return yn(e,an),e.prototype.tag="post",e.prototype.parse=function(t){var r,n,s;switch(t.pos=this.offset,this.format=t.readInt(),this.italicAngle=t.readInt(),this.underlinePosition=t.readShort(),this.underlineThickness=t.readShort(),this.isFixedPitch=t.readInt(),this.minMemType42=t.readInt(),this.maxMemType42=t.readInt(),this.minMemType1=t.readInt(),this.maxMemType1=t.readInt(),this.format){case 65536:case 196608:break;case 131072:var a;for(n=t.readUInt16(),this.glyphNameIndex=[],a=0;0<=n?a<n:a>n;a=0<=n?++a:--a)this.glyphNameIndex.push(t.readUInt16());for(this.names=[],s=[];t.pos<this.offset+this.length;)r=t.readByte(),s.push(this.names.push(t.readString(r)));return s;case 151552:return n=t.readUInt16(),this.offsets=t.read(n);case 262144:return this.map=(function(){var h,c,d;for(d=[],a=h=0,c=this.file.maxp.numGlyphs;0<=c?h<c:h>c;a=0<=c?++h:--h)d.push(t.readUInt32());return d}).call(this)}},e}(),I1=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},F1=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return yn(e,an),e.prototype.tag="name",e.prototype.parse=function(t){var r,n,s,a,h,c,d,g,m,w,S;for(t.pos=this.offset,t.readShort(),r=t.readShort(),c=t.readShort(),n=[],a=0;0<=r?a<r:a>r;a=0<=r?++a:--a)n.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+c+t.readShort()});for(d={},a=m=0,w=n.length;m<w;a=++m)s=n[a],t.pos=s.offset,g=t.readString(s.length),h=new I1(g,s),d[S=s.nameID]==null&&(d[S]=[]),d[s.nameID].push(h);this.strings=d,this.copyright=d[0],this.fontFamily=d[1],this.fontSubfamily=d[2],this.uniqueSubfamily=d[3],this.fontName=d[4],this.version=d[5];try{this.postscriptName=d[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=d[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=d[7],this.manufacturer=d[8],this.designer=d[9],this.description=d[10],this.vendorUrl=d[11],this.designerUrl=d[12],this.license=d[13],this.licenseUrl=d[14],this.preferredFamily=d[15],this.preferredSubfamily=d[17],this.compatibleFull=d[18],this.sampleText=d[19]},e}(),E1=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return yn(e,an),e.prototype.tag="maxp",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.numGlyphs=t.readUInt16(),this.maxPoints=t.readUInt16(),this.maxContours=t.readUInt16(),this.maxCompositePoints=t.readUInt16(),this.maxComponentContours=t.readUInt16(),this.maxZones=t.readUInt16(),this.maxTwilightPoints=t.readUInt16(),this.maxStorage=t.readUInt16(),this.maxFunctionDefs=t.readUInt16(),this.maxInstructionDefs=t.readUInt16(),this.maxStackElements=t.readUInt16(),this.maxSizeOfInstructions=t.readUInt16(),this.maxComponentElements=t.readUInt16(),this.maxComponentDepth=t.readUInt16()},e}(),O1=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return yn(e,an),e.prototype.tag="hmtx",e.prototype.parse=function(t){var r,n,s,a,h,c,d;for(t.pos=this.offset,this.metrics=[],r=0,c=this.file.hhea.numberOfMetrics;0<=c?r<c:r>c;r=0<=c?++r:--r)this.metrics.push({advance:t.readUInt16(),lsb:t.readInt16()});for(s=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var g,m;for(m=[],r=g=0;0<=s?g<s:g>s;r=0<=s?++g:--g)m.push(t.readInt16());return m}(),this.widths=(function(){var g,m,w,S;for(S=[],g=0,m=(w=this.metrics).length;g<m;g++)a=w[g],S.push(a.advance);return S}).call(this),n=this.widths[this.widths.length-1],d=[],r=h=0;0<=s?h<s:h>s;r=0<=s?++h:--h)d.push(this.widths.push(n));return d},e.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}},e}(),yh=[].slice,T1=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return yn(e,an),e.prototype.tag="glyf",e.prototype.parse=function(){return this.cache={}},e.prototype.glyphFor=function(t){var r,n,s,a,h,c,d,g,m,w;return t in this.cache?this.cache[t]:(a=this.file.loca,r=this.file.contents,n=a.indexOf(t),(s=a.lengthOf(t))===0?this.cache[t]=null:(r.pos=this.offset+n,h=(c=new ci(r.read(s))).readShort(),g=c.readShort(),w=c.readShort(),d=c.readShort(),m=c.readShort(),this.cache[t]=h===-1?new R1(c,g,w,d,m):new M1(c,h,g,w,d,m),this.cache[t]))},e.prototype.encode=function(t,r,n){var s,a,h,c,d;for(h=[],a=[],c=0,d=r.length;c<d;c++)s=t[r[c]],a.push(h.length),s&&(h=h.concat(s.encode(n)));return a.push(h.length),{table:h,offsets:a}},e}(),M1=function(){function e(t,r,n,s,a,h){this.raw=t,this.numberOfContours=r,this.xMin=n,this.yMin=s,this.xMax=a,this.yMax=h,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e}(),R1=function(){function e(t,r,n,s,a){var h,c;for(this.raw=t,this.xMin=r,this.yMin=n,this.xMax=s,this.yMax=a,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],h=this.raw;c=h.readShort(),this.glyphOffsets.push(h.pos),this.glyphIDs.push(h.readUInt16()),32&c;)h.pos+=1&c?4:2,128&c?h.pos+=8:64&c?h.pos+=4:8&c&&(h.pos+=2)}return e.prototype.encode=function(){var t,r,n;for(r=new ci(yh.call(this.raw.data)),t=0,n=this.glyphIDs.length;t<n;++t)r.pos=this.glyphOffsets[t];return r.data},e}(),D1=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return yn(e,an),e.prototype.tag="loca",e.prototype.parse=function(t){var r,n;return t.pos=this.offset,r=this.file.head.indexToLocFormat,this.offsets=r===0?(function(){var s,a;for(a=[],n=0,s=this.length;n<s;n+=2)a.push(2*t.readUInt16());return a}).call(this):(function(){var s,a;for(a=[],n=0,s=this.length;n<s;n+=4)a.push(t.readUInt32());return a}).call(this)},e.prototype.indexOf=function(t){return this.offsets[t]},e.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]},e.prototype.encode=function(t,r){for(var n=new Uint32Array(this.offsets.length),s=0,a=0,h=0;h<n.length;++h)if(n[h]=s,a<r.length&&r[a]==h){++a,n[h]=s;var c=this.offsets[h],d=this.offsets[h+1]-c;d>0&&(s+=d)}for(var g=new Array(4*n.length),m=0;m<n.length;++m)g[4*m+3]=255&n[m],g[4*m+2]=(65280&n[m])>>8,g[4*m+1]=(16711680&n[m])>>16,g[4*m]=(4278190080&n[m])>>24;return g},e}(),B1=function(){function e(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var t,r,n,s,a;for(r in s=this.font.cmap.tables[0].codeMap,t={},a=this.subset)n=a[r],t[r]=s[n];return t},e.prototype.glyphsFor=function(t){var r,n,s,a,h,c,d;for(s={},h=0,c=t.length;h<c;h++)s[a=t[h]]=this.font.glyf.glyphFor(a);for(a in r=[],s)(n=s[a])!=null&&n.compound&&r.push.apply(r,n.glyphIDs);if(r.length>0)for(a in d=this.glyphsFor(r))n=d[a],s[a]=n;return s},e.prototype.encode=function(t,r){var n,s,a,h,c,d,g,m,w,S,p,O,N,T,L;for(s in n=vh.encode(this.generateCmap(),"unicode"),h=this.glyphsFor(t),p={0:0},L=n.charMap)p[(d=L[s]).old]=d.new;for(O in S=n.maxGlyphID,h)O in p||(p[O]=S++);return m=function(K){var X,H;for(X in H={},K)H[K[X]]=X;return H}(p),w=Object.keys(m).sort(function(K,X){return K-X}),N=function(){var K,X,H;for(H=[],K=0,X=w.length;K<X;K++)c=w[K],H.push(m[c]);return H}(),a=this.font.glyf.encode(h,N,p),g=this.font.loca.encode(a.offsets,N),T={cmap:this.font.cmap.raw(),glyf:a.table,loca:g,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(r)},this.font.os2.exists&&(T["OS/2"]=this.font.os2.raw()),this.font.directory.encode(T)},e}();Ke.API.PDFObject=function(){var e;function t(){}return e=function(r,n){return(Array(n+1).join("0")+r).slice(-n)},t.convert=function(r){var n,s,a,h;if(Array.isArray(r))return"["+function(){var c,d,g;for(g=[],c=0,d=r.length;c<d;c++)n=r[c],g.push(t.convert(n));return g}().join(" ")+"]";if(typeof r=="string")return"/"+r;if(r!=null&&r.isString)return"("+r+")";if(r instanceof Date)return"(D:"+e(r.getUTCFullYear(),4)+e(r.getUTCMonth(),2)+e(r.getUTCDate(),2)+e(r.getUTCHours(),2)+e(r.getUTCMinutes(),2)+e(r.getUTCSeconds(),2)+"Z)";if({}.toString.call(r)==="[object Object]"){for(s in a=["<<"],r)h=r[s],a.push("/"+s+" "+t.convert(h));return a.push(">>"),a.join(`
`)}return""+r},t}();const q1=({alert:e,investigation:t,artifacts:r=[],verdict:n,conclusion:s,grade:a,isOpen:h,onClose:c})=>{var K,X,H,Q,he,pe;const[d,g]=it.useState(!1),[m,w]=it.useState(!1);if(!h)return null;const S=C=>new Date(C).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",timeZoneName:"short"}),p=C=>({critical:"CRITICAL",high:"HIGH",medium:"MEDIUM",low:"LOW"})[C==null?void 0:C.toLowerCase()]||C,O=C=>({true_positive:"True Positive - Confirmed Threat",false_positive:"False Positive - Benign Activity",suspicious:"Suspicious - Requires Further Analysis",inconclusive:"Inconclusive - Insufficient Data"})[C]||(C==null?void 0:C.replace("_"," "))||"Unknown",N=C=>({critical:[239,68,68],high:[249,115,22],medium:[234,179,8],low:[34,197,94]})[C==null?void 0:C.toLowerCase()]||[156,163,175],T=async()=>{w(!0);try{const C=new Ke("p","mm","a4"),R=C.internal.pageSize.getWidth(),ne=C.internal.pageSize.getHeight(),j=20;let P=j;const G=[139,92,246],$=[17,18,20],ue=[255,255,255],fe=[156,163,175],me=N(e==null?void 0:e.severity);C.setFillColor(...$),C.rect(0,0,R,50,"F"),C.setFillColor(...G),C.rect(0,50,R,2,"F"),C.setFont("helvetica","bold"),C.setFontSize(24),C.setTextColor(...ue),C.text("InfoSecLabs",j,25),C.setFont("helvetica","normal"),C.setFontSize(10),C.setTextColor(...fe),C.text("Security Operations Center",j,32),C.setFont("helvetica","bold"),C.setFontSize(14),C.setTextColor(...G),C.text("INVESTIGATION REPORT",R-j,25,{align:"right"}),C.setFont("helvetica","normal"),C.setFontSize(10),C.setTextColor(...fe),C.text(`Alert #${(e==null?void 0:e.id)||"N/A"}`,R-j,32,{align:"right"}),C.setFontSize(9),C.text(S(new Date),R-j,40,{align:"right"}),P=65,C.setFillColor(30,32,36),C.roundedRect(j,P,R-2*j,45,3,3,"F"),C.setFillColor(...me),C.roundedRect(j+5,P+5,50,8,2,2,"F"),C.setFont("helvetica","bold"),C.setFontSize(8),C.setTextColor(0,0,0),C.text(p(e==null?void 0:e.severity),j+30,P+10.5,{align:"center"}),C.setFont("helvetica","bold"),C.setFontSize(16),C.setTextColor(...ue),C.text((e==null?void 0:e.title)||"Untitled Alert",j+60,P+12),C.setFont("helvetica","normal"),C.setFontSize(9),C.setTextColor(...fe);const se=P+25;C.text(`Source: ${(e==null?void 0:e.source)||"N/A"}`,j+5,se),C.text(`Created: ${S(e==null?void 0:e.created_at)}`,j+70,se),C.text(`MITRE: ${(e==null?void 0:e.mitre_technique)||"N/A"}`,j+5,se+10),P+=55;const ge=(R-2*j-10)/2;C.setFillColor(30,32,36),C.roundedRect(j,P,ge,35,3,3,"F"),C.setFont("helvetica","bold"),C.setFontSize(8),C.setTextColor(...fe),C.text("FINAL VERDICT",j+5,P+10);const W=n==="true_positive"?[239,68,68]:n==="false_positive"?[34,197,94]:[234,179,8];C.setFont("helvetica","bold"),C.setFontSize(12),C.setTextColor(...W),C.text(O(n),j+5,P+22),C.setFillColor(30,32,36),C.roundedRect(j+ge+10,P,ge,35,3,3,"F"),C.setFont("helvetica","bold"),C.setFontSize(8),C.setTextColor(...fe),C.text("INVESTIGATION SCORE",j+ge+15,P+10);const M=a>=80?[34,197,94]:a>=60?[234,179,8]:[239,68,68];if(C.setFont("helvetica","bold"),C.setFontSize(28),C.setTextColor(...M),C.text(`${a??"..."}/100`,j+ge+15,P+28),P+=45,C.setFont("helvetica","bold"),C.setFontSize(12),C.setTextColor(...G),C.text("EVIDENCE COLLECTED",j,P),P+=8,r&&r.length>0?(C.setFillColor(40,42,48),C.rect(j,P,R-2*j,8,"F"),C.setFont("helvetica","bold"),C.setFontSize(8),C.setTextColor(...fe),C.text("TYPE",j+5,P+5.5),C.text("VALUE",j+40,P+5.5),C.text("STATUS",R-j-25,P+5.5),P+=8,r.forEach((b,I)=>{var V;const D=I%2===0?[30,32,36]:[25,27,31];C.setFillColor(...D),C.rect(j,P,R-2*j,8,"F"),C.setFont("helvetica","normal"),C.setFontSize(8),C.setTextColor(59,130,246),C.text(b.type||"Unknown",j+5,P+5.5),C.setTextColor(...ue);const z=((V=b.value)==null?void 0:V.substring(0,50))||"N/A";C.text(z,j+40,P+5.5),C.setTextColor(34,197,94),C.text(b.score||"Confirmed",R-j-25,P+5.5),P+=8})):(C.setFont("helvetica","italic"),C.setFontSize(10),C.setTextColor(...fe),C.text("No artifacts documented.",j,P+5),P+=12),P+=10,s){C.setFont("helvetica","bold"),C.setFontSize(12),C.setTextColor(...G),C.text("AI ANALYSIS FEEDBACK",j,P),P+=8,C.setFillColor(30,32,36);const b=Math.min(50,Math.ceil(s.length/80)*6+10);C.roundedRect(j,P,R-2*j,b,3,3,"F"),C.setFont("helvetica","normal"),C.setFontSize(9),C.setTextColor(...ue);const I=C.splitTextToSize(s,R-2*j-10);C.text(I.slice(0,6),j+5,P+8),P+=b+10}C.setFillColor(...$),C.rect(0,ne-20,R,20,"F"),C.setFont("helvetica","normal"),C.setFontSize(8),C.setTextColor(...fe),C.text("Generated by InfoSecLabs SOC Platform",j,ne-10),C.text(`Report ID: INV-${e==null?void 0:e.id}-${Date.now().toString(36).toUpperCase()}`,R-j,ne-10,{align:"right"}),C.setFont("helvetica","bold"),C.setFontSize(6),C.setTextColor(100,100,100),C.text("CONFIDENTIAL - FOR AUTHORIZED PERSONNEL ONLY",R/2,ne-5,{align:"center"}),C.save(`InfoSecLabs_Investigation_Report_${e==null?void 0:e.id}_${new Date().toISOString().split("T")[0]}.pdf`),jt.success("PDF Report downloaded!")}catch(C){console.error("PDF generation error:",C),jt.error("Failed to generate PDF")}finally{w(!1)}},L=async()=>{const C=[`# Investigation Report - Alert #${e==null?void 0:e.id}`,"",`## ${e==null?void 0:e.title}`,`- **Severity:** ${p(e==null?void 0:e.severity)}`,`- **Source:** ${(e==null?void 0:e.source)||"N/A"}`,`- **Verdict:** ${O(n)}`,`- **Score:** ${a}/100`,"","## Evidence",r.length>0?r.map(R=>`- ${R.type}: ${R.value}`).join(`
`):"_No artifacts_","","## AI Feedback",s||"_No feedback_","","---",`_Generated by InfoSecLabs on ${S(new Date)}_`].join(`
`);try{await navigator.clipboard.writeText(C),g(!0),jt.success("Report copied to clipboard!"),setTimeout(()=>g(!1),2e3)}catch{jt.error("Failed to copy report")}};return o.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[o.jsx("div",{className:"absolute inset-0 bg-black/80 backdrop-blur-sm animate-in fade-in",onClick:c}),o.jsxs("div",{className:"relative w-full max-w-3xl max-h-[85vh] bg-[#0e0f11] rounded-2xl border border-gray-800 overflow-hidden shadow-2xl animate-in zoom-in-95 flex flex-col",children:[o.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-800 bg-[#131416]",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-2 bg-blue-500/10 border border-blue-500/20 rounded-lg",children:o.jsx(li,{className:"w-5 h-5 text-blue-400"})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-white font-bold",children:"Investigation Report"}),o.jsxs("span",{className:"text-xs text-gray-500",children:["Alert #",e==null?void 0:e.id]})]})]}),o.jsx("button",{onClick:c,className:"p-2 text-gray-400 hover:text-white hover:bg-white/5 rounded-lg transition-colors",children:o.jsx(dl,{className:"w-5 h-5"})})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[o.jsx("div",{className:"bg-[#1a1b1e] rounded-xl border border-gray-800 p-4",children:o.jsxs("div",{className:"flex items-start gap-4",children:[o.jsx("div",{className:`p-3 rounded-lg border ${((K=e==null?void 0:e.severity)==null?void 0:K.toLowerCase())==="critical"?"bg-red-500/10 border-red-500/20":((X=e==null?void 0:e.severity)==null?void 0:X.toLowerCase())==="high"?"bg-orange-500/10 border-orange-500/20":((H=e==null?void 0:e.severity)==null?void 0:H.toLowerCase())==="medium"?"bg-yellow-500/10 border-yellow-500/20":"bg-blue-500/10 border-blue-500/20"}`,children:o.jsx(Pi,{className:`w-6 h-6 ${((Q=e==null?void 0:e.severity)==null?void 0:Q.toLowerCase())==="critical"?"text-red-400":((he=e==null?void 0:e.severity)==null?void 0:he.toLowerCase())==="high"?"text-orange-400":((pe=e==null?void 0:e.severity)==null?void 0:pe.toLowerCase())==="medium"?"text-yellow-400":"text-blue-400"}`})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h3",{className:"text-white font-bold text-lg",children:e==null?void 0:e.title}),o.jsxs("div",{className:"flex flex-wrap items-center gap-3 mt-2 text-xs text-gray-400",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(cl,{className:"w-3 h-3"}),e==null?void 0:e.severity]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(Fa,{className:"w-3 h-3"}),e==null?void 0:e.source]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(Ga,{className:"w-3 h-3"}),S(e==null?void 0:e.created_at)]})]})]}),a!==null&&o.jsxs("div",{className:"text-right",children:[o.jsx("span",{className:`text-2xl font-black ${a>=80?"text-green-400":a>=60?"text-yellow-400":"text-red-400"}`,children:a}),o.jsx("span",{className:"text-xs text-gray-500 block",children:"/100"})]})]})}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"bg-[#1a1b1e] rounded-xl border border-gray-800 p-4",children:[o.jsx("h4",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:"Verdict"}),o.jsx("p",{className:"text-white font-medium",children:O(n)})]}),o.jsxs("div",{className:"bg-[#1a1b1e] rounded-xl border border-gray-800 p-4",children:[o.jsx("h4",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:"Artifacts Found"}),o.jsxs("p",{className:"text-white font-medium",children:[(r==null?void 0:r.length)||0," indicators"]})]})]}),s&&o.jsxs("div",{className:"bg-[#1a1b1e] rounded-xl border border-gray-800 p-4",children:[o.jsx("h4",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:"AI Feedback"}),o.jsx("p",{className:"text-gray-300 text-sm leading-relaxed",children:s})]}),r&&r.length>0&&o.jsxs("div",{className:"bg-[#1a1b1e] rounded-xl border border-gray-800 overflow-hidden",children:[o.jsx("div",{className:"px-4 py-3 border-b border-gray-800",children:o.jsx("h4",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider",children:"Evidence"})}),o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{className:"bg-[#131416]",children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left px-4 py-2 text-gray-400 font-medium",children:"Type"}),o.jsx("th",{className:"text-left px-4 py-2 text-gray-400 font-medium",children:"Value"}),o.jsx("th",{className:"text-left px-4 py-2 text-gray-400 font-medium",children:"Status"})]})}),o.jsx("tbody",{children:r.map((C,R)=>o.jsxs("tr",{className:"border-t border-gray-800/50",children:[o.jsx("td",{className:"px-4 py-2 text-purple-400 font-mono",children:C.type}),o.jsx("td",{className:"px-4 py-2 text-white font-mono",children:C.value}),o.jsx("td",{className:"px-4 py-2 text-green-400",children:C.score||"Confirmed"})]},R))})]})})]})]}),o.jsxs("div",{className:"flex items-center justify-end gap-3 px-6 py-4 border-t border-gray-800 bg-[#131416]",children:[o.jsxs("button",{onClick:L,className:"flex items-center gap-2 px-4 py-2 bg-gray-800 hover:bg-gray-700 text-white rounded-lg font-medium text-sm transition-colors",children:[d?o.jsx(Lu,{className:"w-4 h-4 text-green-400"}):o.jsx(Au,{className:"w-4 h-4"}),d?"Copied!":"Copy Markdown"]}),o.jsxs("button",{onClick:T,disabled:m,className:"flex items-center gap-2 px-4 py-2 bg-blue-600 hover:bg-blue-500 text-white rounded-lg font-bold text-sm transition-colors shadow-lg shadow-blue-600/20 disabled:opacity-50",children:[o.jsx(ku,{className:"w-4 h-4"}),m?"Generating...":"Download PDF"]})]})]})]})};var wh={},bl={};(function e(t,r,n,s){var a=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),h=typeof Path2D=="function"&&typeof DOMMatrix=="function",c=function(){if(!t.OffscreenCanvas)return!1;try{var W=new OffscreenCanvas(1,1),M=W.getContext("2d");M.fillRect(0,0,1,1);var b=W.transferToImageBitmap();M.createPattern(b,"no-repeat")}catch{return!1}return!0}();function d(){}function g(W){var M=r.exports.Promise,b=M!==void 0?M:t.Promise;return typeof b=="function"?new b(W):(W(d,d),null)}var m=function(W,M){return{transform:function(b){if(W)return b;if(M.has(b))return M.get(b);var I=new OffscreenCanvas(b.width,b.height),D=I.getContext("2d");return D.drawImage(b,0,0),M.set(b,I),I},clear:function(){M.clear()}}}(c,new Map),w=function(){var W=Math.floor(16.666666666666668),M,b,I={},D=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(M=function(z){var V=Math.random();return I[V]=requestAnimationFrame(function Y(re){D===re||D+W-1<re?(D=re,delete I[V],z()):I[V]=requestAnimationFrame(Y)}),V},b=function(z){I[z]&&cancelAnimationFrame(I[z])}):(M=function(z){return setTimeout(z,W)},b=function(z){return clearTimeout(z)}),{frame:M,cancel:b}}(),S=function(){var W,M,b={};function I(D){function z(V,Y){D.postMessage({options:V||{},callback:Y})}D.init=function(Y){var re=Y.transferControlToOffscreen();D.postMessage({canvas:re},[re])},D.fire=function(Y,re,oe){if(M)return z(Y,null),M;var de=Math.random().toString(36).slice(2);return M=g(function(ye){function je(Ce){Ce.data.callback===de&&(delete b[de],D.removeEventListener("message",je),M=null,m.clear(),oe(),ye())}D.addEventListener("message",je),z(Y,de),b[de]=je.bind(null,{data:{callback:de}})}),M},D.reset=function(){D.postMessage({reset:!0});for(var Y in b)b[Y](),delete b[Y]}}return function(){if(W)return W;if(!n&&a){var D=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {","  if (msg.data.options) {","    CONFETTI(msg.data.options).then(function () {","      if (msg.data.callback) {","        postMessage({ callback: msg.data.callback });","      }","    });","  } else if (msg.data.reset) {","    CONFETTI && CONFETTI.reset();","  } else if (msg.data.resize) {","    SIZE.width = msg.data.resize.width;","    SIZE.height = msg.data.resize.height;","  } else if (msg.data.canvas) {","    SIZE.width = msg.data.canvas.width;","    SIZE.height = msg.data.canvas.height;","    CONFETTI = module.exports.create(msg.data.canvas);","  }","}"].join(`
`);try{W=new Worker(URL.createObjectURL(new Blob([D])))}catch(z){return typeof console<"u"&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",z),null}I(W)}return W}}(),p={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function O(W,M){return M?M(W):W}function N(W){return W!=null}function T(W,M,b){return O(W&&N(W[M])?W[M]:p[M],b)}function L(W){return W<0?0:Math.floor(W)}function K(W,M){return Math.floor(Math.random()*(M-W))+W}function X(W){return parseInt(W,16)}function H(W){return W.map(Q)}function Q(W){var M=String(W).replace(/[^0-9a-f]/gi,"");return M.length<6&&(M=M[0]+M[0]+M[1]+M[1]+M[2]+M[2]),{r:X(M.substring(0,2)),g:X(M.substring(2,4)),b:X(M.substring(4,6))}}function he(W){var M=T(W,"origin",Object);return M.x=T(M,"x",Number),M.y=T(M,"y",Number),M}function pe(W){W.width=document.documentElement.clientWidth,W.height=document.documentElement.clientHeight}function C(W){var M=W.getBoundingClientRect();W.width=M.width,W.height=M.height}function R(W){var M=document.createElement("canvas");return M.style.position="fixed",M.style.top="0px",M.style.left="0px",M.style.pointerEvents="none",M.style.zIndex=W,M}function ne(W,M,b,I,D,z,V,Y,re){W.save(),W.translate(M,b),W.rotate(z),W.scale(I,D),W.arc(0,0,1,V,Y,re),W.restore()}function j(W){var M=W.angle*(Math.PI/180),b=W.spread*(Math.PI/180);return{x:W.x,y:W.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:W.startVelocity*.5+Math.random()*W.startVelocity,angle2D:-M+(.5*b-Math.random()*b),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:W.color,shape:W.shape,tick:0,totalTicks:W.ticks,decay:W.decay,drift:W.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:W.gravity*3,ovalScalar:.6,scalar:W.scalar,flat:W.flat}}function P(W,M){M.x+=Math.cos(M.angle2D)*M.velocity+M.drift,M.y+=Math.sin(M.angle2D)*M.velocity+M.gravity,M.velocity*=M.decay,M.flat?(M.wobble=0,M.wobbleX=M.x+10*M.scalar,M.wobbleY=M.y+10*M.scalar,M.tiltSin=0,M.tiltCos=0,M.random=1):(M.wobble+=M.wobbleSpeed,M.wobbleX=M.x+10*M.scalar*Math.cos(M.wobble),M.wobbleY=M.y+10*M.scalar*Math.sin(M.wobble),M.tiltAngle+=.1,M.tiltSin=Math.sin(M.tiltAngle),M.tiltCos=Math.cos(M.tiltAngle),M.random=Math.random()+2);var b=M.tick++/M.totalTicks,I=M.x+M.random*M.tiltCos,D=M.y+M.random*M.tiltSin,z=M.wobbleX+M.random*M.tiltCos,V=M.wobbleY+M.random*M.tiltSin;if(W.fillStyle="rgba("+M.color.r+", "+M.color.g+", "+M.color.b+", "+(1-b)+")",W.beginPath(),h&&M.shape.type==="path"&&typeof M.shape.path=="string"&&Array.isArray(M.shape.matrix))W.fill(me(M.shape.path,M.shape.matrix,M.x,M.y,Math.abs(z-I)*.1,Math.abs(V-D)*.1,Math.PI/10*M.wobble));else if(M.shape.type==="bitmap"){var Y=Math.PI/10*M.wobble,re=Math.abs(z-I)*.1,oe=Math.abs(V-D)*.1,de=M.shape.bitmap.width*M.scalar,ye=M.shape.bitmap.height*M.scalar,je=new DOMMatrix([Math.cos(Y)*re,Math.sin(Y)*re,-Math.sin(Y)*oe,Math.cos(Y)*oe,M.x,M.y]);je.multiplySelf(new DOMMatrix(M.shape.matrix));var Ce=W.createPattern(m.transform(M.shape.bitmap),"no-repeat");Ce.setTransform(je),W.globalAlpha=1-b,W.fillStyle=Ce,W.fillRect(M.x-de/2,M.y-ye/2,de,ye),W.globalAlpha=1}else if(M.shape==="circle")W.ellipse?W.ellipse(M.x,M.y,Math.abs(z-I)*M.ovalScalar,Math.abs(V-D)*M.ovalScalar,Math.PI/10*M.wobble,0,2*Math.PI):ne(W,M.x,M.y,Math.abs(z-I)*M.ovalScalar,Math.abs(V-D)*M.ovalScalar,Math.PI/10*M.wobble,0,2*Math.PI);else if(M.shape==="star")for(var ke=Math.PI/2*3,E=4*M.scalar,Ie=8*M.scalar,Qe=M.x,Re=M.y,Ne=5,De=Math.PI/Ne;Ne--;)Qe=M.x+Math.cos(ke)*Ie,Re=M.y+Math.sin(ke)*Ie,W.lineTo(Qe,Re),ke+=De,Qe=M.x+Math.cos(ke)*E,Re=M.y+Math.sin(ke)*E,W.lineTo(Qe,Re),ke+=De;else W.moveTo(Math.floor(M.x),Math.floor(M.y)),W.lineTo(Math.floor(M.wobbleX),Math.floor(D)),W.lineTo(Math.floor(z),Math.floor(V)),W.lineTo(Math.floor(I),Math.floor(M.wobbleY));return W.closePath(),W.fill(),M.tick<M.totalTicks}function G(W,M,b,I,D){var z=M.slice(),V=W.getContext("2d"),Y,re,oe=g(function(de){function ye(){Y=re=null,V.clearRect(0,0,I.width,I.height),m.clear(),D(),de()}function je(){n&&!(I.width===s.width&&I.height===s.height)&&(I.width=W.width=s.width,I.height=W.height=s.height),!I.width&&!I.height&&(b(W),I.width=W.width,I.height=W.height),V.clearRect(0,0,I.width,I.height),z=z.filter(function(Ce){return P(V,Ce)}),z.length?Y=w.frame(je):ye()}Y=w.frame(je),re=ye});return{addFettis:function(de){return z=z.concat(de),oe},canvas:W,promise:oe,reset:function(){Y&&w.cancel(Y),re&&re()}}}function $(W,M){var b=!W,I=!!T(M||{},"resize"),D=!1,z=T(M,"disableForReducedMotion",Boolean),V=a&&!!T(M||{},"useWorker"),Y=V?S():null,re=b?pe:C,oe=W&&Y?!!W.__confetti_initialized:!1,de=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,ye;function je(ke,E,Ie){for(var Qe=T(ke,"particleCount",L),Re=T(ke,"angle",Number),Ne=T(ke,"spread",Number),De=T(ke,"startVelocity",Number),Te=T(ke,"decay",Number),qe=T(ke,"gravity",Number),Je=T(ke,"drift",Number),Ee=T(ke,"colors",H),ut=T(ke,"ticks",Number),rt=T(ke,"shapes"),xt=T(ke,"scalar"),mt=!!T(ke,"flat"),ze=he(ke),nt=Qe,He=[],Et=W.width*ze.x,bt=W.height*ze.y;nt--;)He.push(j({x:Et,y:bt,angle:Re,spread:Ne,startVelocity:De,color:Ee[nt%Ee.length],shape:rt[K(0,rt.length)],ticks:ut,decay:Te,gravity:qe,drift:Je,scalar:xt,flat:mt}));return ye?ye.addFettis(He):(ye=G(W,He,re,E,Ie),ye.promise)}function Ce(ke){var E=z||T(ke,"disableForReducedMotion",Boolean),Ie=T(ke,"zIndex",Number);if(E&&de)return g(function(De){De()});b&&ye?W=ye.canvas:b&&!W&&(W=R(Ie),document.body.appendChild(W)),I&&!oe&&re(W);var Qe={width:W.width,height:W.height};Y&&!oe&&Y.init(W),oe=!0,Y&&(W.__confetti_initialized=!0);function Re(){if(Y){var De={getBoundingClientRect:function(){if(!b)return W.getBoundingClientRect()}};re(De),Y.postMessage({resize:{width:De.width,height:De.height}});return}Qe.width=Qe.height=null}function Ne(){ye=null,I&&(D=!1,t.removeEventListener("resize",Re)),b&&W&&(document.body.contains(W)&&document.body.removeChild(W),W=null,oe=!1)}return I&&!D&&(D=!0,t.addEventListener("resize",Re,!1)),Y?Y.fire(ke,Qe,Ne):je(ke,Qe,Ne)}return Ce.reset=function(){Y&&Y.reset(),ye&&ye.reset()},Ce}var ue;function fe(){return ue||(ue=$(null,{useWorker:!0,resize:!0})),ue}function me(W,M,b,I,D,z,V){var Y=new Path2D(W),re=new Path2D;re.addPath(Y,new DOMMatrix(M));var oe=new Path2D;return oe.addPath(re,new DOMMatrix([Math.cos(V)*D,Math.sin(V)*D,-Math.sin(V)*z,Math.cos(V)*z,b,I])),oe}function se(W){if(!h)throw new Error("path confetti are not supported in this browser");var M,b;typeof W=="string"?M=W:(M=W.path,b=W.matrix);var I=new Path2D(M),D=document.createElement("canvas"),z=D.getContext("2d");if(!b){for(var V=1e3,Y=V,re=V,oe=0,de=0,ye,je,Ce=0;Ce<V;Ce+=2)for(var ke=0;ke<V;ke+=2)z.isPointInPath(I,Ce,ke,"nonzero")&&(Y=Math.min(Y,Ce),re=Math.min(re,ke),oe=Math.max(oe,Ce),de=Math.max(de,ke));ye=oe-Y,je=de-re;var E=10,Ie=Math.min(E/ye,E/je);b=[Ie,0,0,Ie,-Math.round(ye/2+Y)*Ie,-Math.round(je/2+re)*Ie]}return{type:"path",path:M,matrix:b}}function ge(W){var M,b=1,I="#000000",D='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof W=="string"?M=W:(M=W.text,b="scalar"in W?W.scalar:b,D="fontFamily"in W?W.fontFamily:D,I="color"in W?W.color:I);var z=10*b,V=""+z+"px "+D,Y=new OffscreenCanvas(z,z),re=Y.getContext("2d");re.font=V;var oe=re.measureText(M),de=Math.ceil(oe.actualBoundingBoxRight+oe.actualBoundingBoxLeft),ye=Math.ceil(oe.actualBoundingBoxAscent+oe.actualBoundingBoxDescent),je=2,Ce=oe.actualBoundingBoxLeft+je,ke=oe.actualBoundingBoxAscent+je;de+=je+je,ye+=je+je,Y=new OffscreenCanvas(de,ye),re=Y.getContext("2d"),re.font=V,re.fillStyle=I,re.fillText(M,Ce,ke);var E=1/b;return{type:"bitmap",bitmap:Y.transferToImageBitmap(),matrix:[E,0,0,E,-de*E/2,-ye*E/2]}}r.exports=function(){return fe().apply(this,arguments)},r.exports.reset=function(){fe().reset()},r.exports.create=$,r.exports.shapeFromPath=se,r.exports.shapeFromText=ge})(function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}(),bl,!1);const U1=bl.exports;var z1=bl.exports.create;const H1=Object.freeze(Object.defineProperty({__proto__:null,create:z1,default:U1},Symbol.toStringTag,{value:"Module"})),W1=ld(H1);var Va=vn&&vn.__assign||function(){return Va=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Va.apply(this,arguments)},V1=vn&&vn.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),$1=vn&&vn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),G1=vn&&vn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&V1(t,e,r);return $1(t,e),t},J1=vn&&vn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wh,"__esModule",{value:!0});var Ia=G1(it),Y1=J1(W1),K1={resize:!0,useWorker:!1},X1={position:"fixed",pointerEvents:"none",width:"100%",height:"100%",top:0,left:0};function Z1(e,t){return!e&&!t?X1:e}function Q1(e){var t=e.style,r=e.className,n=e.width,s=e.height,a=e.globalOptions,h=e.onInit,c=(0,Ia.useRef)(null),d=(0,Ia.useRef)(null);return(0,Ia.useEffect)(function(){if(c.current)return d.current=Y1.default.create(c.current,Va(Va({},K1),a)),h==null||h({confetti:d.current}),function(){var g;(g=d.current)===null||g===void 0||g.reset()}},[]),Ia.default.createElement("canvas",{ref:c,style:Z1(t,r),className:r,width:n,height:s})}var e2=wh.default=Q1;const t2={position:"fixed",pointerEvents:"none",width:"100%",height:"100%",top:0,left:0,zIndex:100},r2=({isOpen:e,onClose:t,operationId:r})=>{const[n,s]=it.useState(null),[a,h]=it.useState(!0),[c,d]=it.useState(!1),g=ul();it.useEffect(()=>{e&&r&&m()},[e,r]);const m=async()=>{try{h(!0);const N=localStorage.getItem("token"),T=await fetch(`/api/operations/${r}/completion-report`,{headers:{Authorization:`Bearer ${N}`}});if(!T.ok)throw new Error("Failed to fetch report");const L=await T.json();s(L),L.summary.passed&&setTimeout(()=>d(!0),500)}catch(N){console.error("Error fetching completion report:",N),jt.error("Failed to load completion report")}finally{h(!1)}},w=N=>N?new Date(N).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):"N/A",S=N=>N>=90?"#10b981":N>=70?"#f59e0b":N>=60?"#f97316":"#ef4444",p=()=>{if(!n)return;const N=new Ke("p","mm","a4"),T=N.internal.pageSize.getWidth();let L=20;N.setFillColor(139,92,246),N.rect(0,0,T,40,"F"),N.setTextColor(255,255,255),N.setFontSize(22),N.setFont("helvetica","bold"),N.text("OPERATION COMPLETE",T/2,18,{align:"center"}),N.setFontSize(14),N.setFont("helvetica","normal"),N.text(n.operation.title.toUpperCase(),T/2,28,{align:"center"}),N.setFontSize(10),N.text(`Target: ${n.operation.apt_group||"Unknown Threat Actor"}`,T/2,36,{align:"center"}),L=50,N.setTextColor(0,0,0),N.setFillColor(245,245,245),N.roundedRect(15,L,T-30,30,3,3,"F"),N.setFontSize(11),N.setFont("helvetica","bold"),N.text("MISSION SUMMARY",20,L+8),N.setFont("helvetica","normal"),N.setFontSize(9);const K=n.operation.story_intro||n.operation.description||"Mission completed successfully.",X=N.splitTextToSize(K,T-40);N.text(X.slice(0,3),20,L+16),L+=40,N.setFillColor(n.summary.passed?16:239,n.summary.passed?185:68,n.summary.passed?129:68),N.roundedRect(15,L,T-30,25,3,3,"F"),N.setTextColor(255,255,255),N.setFontSize(16),N.setFont("helvetica","bold"),N.text(`OVERALL SCORE: ${n.summary.average_score}/100`,T/2,L+12,{align:"center"}),N.setFontSize(11),N.text(n.summary.passed?"✓ MISSION SUCCESS":"✗ NEEDS IMPROVEMENT",T/2,L+20,{align:"center"}),L+=35,N.setTextColor(0,0,0),N.setFontSize(12),N.setFont("helvetica","bold"),N.text("MISSION BREAKDOWN",15,L),L+=8,N.setFillColor(30,30,40),N.rect(15,L,T-30,8,"F"),N.setTextColor(255,255,255),N.setFontSize(9),N.text("#",20,L+5.5),N.text("MISSION",30,L+5.5),N.text("TYPE",110,L+5.5),N.text("GRADE",145,L+5.5),N.text("STATUS",170,L+5.5),L+=8,N.setTextColor(0,0,0),n.missions.forEach((Q,he)=>{L>260&&(N.addPage(),L=20);const pe=he%2===0?[250,250,250]:[255,255,255];N.setFillColor(...pe),N.rect(15,L,T-30,10,"F"),N.setFontSize(9),N.text(`${Q.sequence}`,20,L+6.5);const C=Q.title.length>35?Q.title.substring(0,35)+"...":Q.title;N.text(C,30,L+6.5),N.text(Q.type||"N/A",110,L+6.5);const R=S(Q.grade);N.setTextColor(R),N.setFont("helvetica","bold"),N.text(Q.grade!==null?`${Q.grade}%`:"-",145,L+6.5),N.setTextColor(Q.grade>=60?16:239,Q.grade>=60?185:68,Q.grade>=60?129:68),N.text(Q.grade>=60?"PASS":Q.grade!==null?"FAIL":"-",170,L+6.5),N.setTextColor(0,0,0),N.setFont("helvetica","normal"),L+=10}),L+=10,N.setFontSize(9),N.setTextColor(100,100,100),N.text(`Completed: ${w(n.progress.completed_at)}`,15,L),N.text(`Difficulty: ${n.operation.difficulty_level||"Standard"}`,15,L+5),N.setFontSize(8),N.setTextColor(150,150,150),N.text("Generated by InfoSecLabs Platform",T/2,285,{align:"center"}),N.text("CONFIDENTIAL - For Training Purposes Only",T/2,290,{align:"center"});const H=`Operation_${n.operation.title.replace(/[^a-z0-9]/gi,"_")}_Report.pdf`;N.save(H),jt.success("Report downloaded!")},O=()=>{t(),g("/dashboard")};return e?o.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm",children:[c&&o.jsx("div",{style:t2,children:o.jsx(e2,{fire:c,particleCount:150,spread:80,origin:{y:.6},onDecay:()=>d(!1)})}),o.jsxs(kd.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},transition:{type:"spring",damping:25,stiffness:300},className:"relative w-full max-w-2xl max-h-[90vh] overflow-y-auto bg-gradient-to-br from-gray-900 via-gray-800 to-gray-900 rounded-2xl border border-purple-500/30 shadow-2xl",children:[o.jsx("button",{onClick:t,className:"absolute top-4 right-4 p-2 rounded-full bg-white/10 hover:bg-white/20 transition-colors z-10",children:o.jsx(dl,{size:20,className:"text-white"})}),a?o.jsx("div",{className:"flex items-center justify-center h-96",children:o.jsx("div",{className:"animate-spin rounded-full h-16 w-16 border-4 border-purple-500 border-t-transparent"})}):n?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-r from-purple-600 via-purple-500 to-pink-500 p-8 text-center",children:[o.jsx("div",{className:"absolute inset-0 overflow-hidden",children:[...Array(20)].map((N,T)=>o.jsx("div",{className:"absolute w-2 h-2 rounded-full animate-pulse",style:{backgroundColor:["#ffd700","#ff6b6b","#48dbfb","#1dd1a1","#ff9ff3"][T%5],left:`${Math.random()*100}%`,top:`${Math.random()*100}%`,animationDelay:`${Math.random()*2}s`}},T))}),o.jsxs("div",{className:"relative z-10",children:[o.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 mb-4 rounded-full bg-white/20 backdrop-blur",children:n.summary.passed?o.jsx(Cd,{size:40,className:"text-yellow-300"}):o.jsx(Pi,{size:40,className:"text-white"})}),o.jsx("h1",{className:"text-3xl font-bold text-white mb-2",children:n.summary.passed?"🎉 OPERATION COMPLETE!":"📋 MISSION REPORT"}),o.jsx("h2",{className:"text-xl text-white/90 font-medium",children:n.operation.title}),o.jsxs("p",{className:"text-white/70 mt-1",children:["Target: ",n.operation.apt_group||"Unknown Threat Actor"]})]})]}),o.jsxs("div",{className:"p-6 space-y-6",children:[n.operation.story_intro&&o.jsxs("div",{className:"bg-gray-800/50 rounded-xl p-4 border border-gray-700",children:[o.jsxs("h3",{className:"text-sm font-semibold text-purple-400 uppercase tracking-wider mb-2 flex items-center gap-2",children:[o.jsx(Pd,{size:16}),"Mission Debrief"]}),o.jsx("p",{className:"text-gray-300 text-sm leading-relaxed",children:n.operation.story_intro})]}),o.jsxs("div",{className:`rounded-xl p-6 text-center ${n.summary.passed?"bg-gradient-to-r from-green-500/20 to-emerald-500/20 border border-green-500/30":"bg-gradient-to-r from-orange-500/20 to-red-500/20 border border-orange-500/30"}`,children:[o.jsxs("div",{className:"text-5xl font-bold mb-2",style:{color:S(n.summary.average_score)},children:[n.summary.average_score,o.jsx("span",{className:"text-2xl text-gray-400",children:"/100"})]}),o.jsx("div",{className:`text-lg font-medium ${n.summary.passed?"text-green-400":"text-orange-400"}`,children:n.summary.passed?"✓ MISSION SUCCESS":"⚠ NEEDS IMPROVEMENT"}),o.jsxs("p",{className:"text-gray-400 text-sm mt-1",children:[n.summary.completed_missions," of ",n.summary.total_missions," missions completed"]})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-sm font-semibold text-gray-400 uppercase tracking-wider mb-3",children:"Mission Breakdown"}),o.jsx("div",{className:"bg-gray-800/30 rounded-xl overflow-hidden border border-gray-700",children:o.jsxs("table",{className:"w-full",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"bg-gray-900/50 text-xs text-gray-400 uppercase",children:[o.jsx("th",{className:"px-4 py-3 text-left",children:"#"}),o.jsx("th",{className:"px-4 py-3 text-left",children:"Mission"}),o.jsx("th",{className:"px-4 py-3 text-center",children:"Grade"}),o.jsx("th",{className:"px-4 py-3 text-center",children:"Status"})]})}),o.jsx("tbody",{children:n.missions.map((N,T)=>o.jsxs("tr",{className:`border-t border-gray-700/50 ${T%2===0?"bg-gray-800/20":""}`,children:[o.jsx("td",{className:"px-4 py-3 text-gray-400 font-mono",children:N.sequence}),o.jsxs("td",{className:"px-4 py-3",children:[o.jsx("div",{className:"text-white font-medium text-sm",children:N.title}),o.jsx("div",{className:"text-gray-500 text-xs",children:N.type||"Alert"})]}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx("span",{className:"font-bold text-lg",style:{color:S(N.grade)},children:N.grade!==null?`${N.grade}%`:"-"})}),o.jsx("td",{className:"px-4 py-3 text-center",children:N.grade>=60?o.jsxs("span",{className:"inline-flex items-center gap-1 text-green-400",children:[o.jsx(Lu,{size:16})," Pass"]}):N.grade!==null?o.jsxs("span",{className:"inline-flex items-center gap-1 text-red-400",children:[o.jsx(fd,{size:16})," Fail"]}):o.jsx("span",{className:"text-gray-500",children:"-"})})]},N.alert_id))})]})})]}),o.jsxs("div",{className:"flex justify-between text-sm text-gray-400 border-t border-gray-700 pt-4",children:[o.jsxs("span",{children:["Completed: ",w(n.progress.completed_at)]}),o.jsxs("span",{children:["Difficulty: ",n.operation.difficulty_level||"Standard"]})]}),o.jsxs("div",{className:"flex gap-4 pt-2",children:[o.jsxs("button",{onClick:p,className:"flex-1 flex items-center justify-center gap-2 px-6 py-3 bg-purple-600 hover:bg-purple-500 text-white font-medium rounded-xl transition-colors",children:[o.jsx(ku,{size:18}),"Download PDF Report"]}),o.jsxs("button",{onClick:O,className:"flex-1 flex items-center justify-center gap-2 px-6 py-3 bg-gray-700 hover:bg-gray-600 text-white font-medium rounded-xl transition-colors",children:[o.jsx(Id,{size:18}),"Back to Dashboard"]})]})]})]}):o.jsx("div",{className:"flex items-center justify-center h-96 text-gray-400",children:"Failed to load report data"})]})]}):null},bu=()=>({"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")}`}),n2={generateScenario:async e=>{try{const t=await fetch(`${rn}/api/ai/generate`,{method:"POST",headers:bu(),body:JSON.stringify(e)});if(!t.ok){const r=await t.json();throw new Error(r.message||"Failed to generate scenario")}return await t.json()}catch(t){throw console.error("Error generating AI scenario:",t),t}},askTutor:async(e,t,r,n,s=[])=>{try{const a=await fetch(`${rn}/api/ai/tutor`,{method:"POST",headers:bu(),body:JSON.stringify({question:e,alert:t,artifacts:r,verdict:n,history:s})});if(!a.ok){if(a.status===429)throw new Error("You are sending messages too fast. Please slow down.");const h=await a.json();throw new Error(h.message||"AI Tutor request failed")}return await a.json()}catch(a){throw console.error("Error asking AI Tutor:",a),a}}},i2=e=>{if(!e||!e.playbook_solution)return 1;try{let t=e.playbook_solution;for(let n=0;n<3&&typeof t=="string";n++)try{t=JSON.parse(t)}catch{break}const r=t&&t.playbook_version?parseInt(t.playbook_version):1;return r===1&&(console.log(`[AlertDetails] Alert #${e.id} detected as V1 Playbook. Solution Type: ${typeof e.playbook_solution}`),typeof t=="object"&&console.log("[AlertDetails] Playbook keys:",Object.keys(t))),r}catch(t){return console.error("[AlertDetails] Version detection error:",t),1}},s2=({alert:e,onBack:t,onAssign:r,userId:n,onUpdate:s})=>{var He,Et,bt,ht,dt,kt,Ze;const{user:a}=yu(),h=ul(),[c,d]=it.useState(""),[g,m]=it.useState(""),[w,S]=it.useState(!1),[p,O]=it.useState(!1),[N,T]=it.useState(""),[L,K]=it.useState(!1);if(!e)return null;const X=ae=>!ae||typeof ae!="string"?[]:ae.split(`
`).filter(_e=>_e.trim()).map((_e,Fe)=>{const Pe=_e.match(/^\[(.*?)\] \[(.*?)\] (.*?): (.*)$/);return Pe?{id:Fe,timestamp:Pe[1],role:Pe[2],author:Pe[3],content:Pe[4]}:{id:Fe,content:_e,role:"UNKNOWN"}});e.notes&&X(e.notes);const[H,Q]=it.useState(!1),[he,pe]=it.useState(null),[C,R]=it.useState(!1),[ne,j]=it.useState(!1),[P,G]=it.useState(!1),[$,ue]=it.useState(null),[fe,me]=it.useState(!1),[se,ge]=it.useState(!1),[W,M]=it.useState([]),[b,I]=it.useState(""),[D,z]=it.useState(!1),V=async ae=>{if(ae&&ae.preventDefault(),!b.trim())return;const _e={role:"user",content:b},Fe=[...W,_e];M(Fe),I(""),z(!0);try{const Pe=await n2.askTutor(_e.content,e,Re,je,Fe);M(Be=>[...Be,{role:"assistant",content:Pe.answer}])}catch(Pe){console.error(Pe),jt.error(Pe.message||"Handler is unreachable."),M(Be=>[...Be,{role:"assistant",content:"⚠️ Connection lost. I couldn't process that request."}])}finally{z(!1)}};it.useEffect(()=>{e&&pe({title:e.title,severity:e.severity,source:e.source,details:e.details,status:e.status})},[e]);const Y=async()=>{if(window.confirm("Are you sure you want to delete this alert? This cannot be undone."))try{const ae=localStorage.getItem("token");(await fetch(`${rn}/api/alerts/${e.id}`,{method:"DELETE",headers:{Authorization:`Bearer ${ae}`}})).ok&&(jt.success("Alert deleted successfully"),t())}catch(ae){console.error("Error deleting alert:",ae),jt.error("Failed to delete alert")}},re=async()=>{try{const ae=localStorage.getItem("token"),_e=await fetch(`${rn}/api/alerts/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${ae}`},body:JSON.stringify(he)});if(_e.ok){const Fe=await _e.json();s(Fe),Q(!1),jt.success("Alert updated successfully")}}catch(ae){console.error("Error updating alert:",ae),jt.error("Failed to update alert")}},oe=()=>{R(!0)},de=async()=>{try{const ae=localStorage.getItem("token"),_e=await fetch(`${rn}/api/alerts/${e.id}/unassign`,{method:"POST",headers:{Authorization:`Bearer ${ae}`}});if(_e.ok)jt.success("Alert unassigned successfully"),s({...e,assigned_to:null,status:"New"}),R(!1);else{const Fe=await _e.json();jt.error(Fe.message||"Failed to unassign"),R(!1)}}catch(ae){console.error("Error unassigning:",ae),jt.error("Error unassigning alert"),R(!1)}},ye=async()=>{try{const ae=localStorage.getItem("token"),_e=await fetch(`${rn}/api/alerts/${e.id}/reset-mine`,{method:"POST",headers:{Authorization:`Bearer ${ae}`}});if(_e.ok)jt.success("Investigation reset!"),s({...e,status:"Investigating",grade:null}),j(!1),window.location.reload();else{const Fe=await _e.json();jt.error(Fe.message||"Failed to reset.")}}catch(ae){console.error(ae),jt.error("Error resetting.")}},[je,Ce]=it.useState(""),[ke,E]=it.useState(""),[Ie,Qe]=it.useState(""),[Re,Ne]=it.useState([{type:"IP",value:"",link:"",score:""}]),[De,Te]=it.useState(1),[qe,Je]=it.useState({}),[Ee,ut]=it.useState(null),rt=(ae,_e,Fe)=>{const Pe=[...Re];Pe[ae][_e]=Fe,Ne(Pe)},xt=async()=>{if(!N.trim())return jt.error("Please provide a reason.");S(!0);try{const ae=localStorage.getItem("token");(await fetch(`${rn}/api/alerts/investigation/${e.investigation_id}/report`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${ae}`},body:JSON.stringify({reason:N})})).ok?(jt.success("Report submitted successfully."),O(!1),s({...e,is_reported:1,report_reason:N})):jt.error("Failed to submit report.")}catch(ae){console.error("Report error:",ae),jt.error("Error submitting report.")}finally{S(!1)}},mt=()=>{Ne([...Re,{type:"IP",value:"",link:"",score:""}])},ze=ae=>{const _e=[...Re];_e.splice(ae,1),Ne(_e)},nt=async()=>{if(!je||!ke||!Ie){jt.error("Please complete all fields (Verdict, Report, Conclusion).");return}S(!0);try{const ae=localStorage.getItem("token"),_e={verdict:je,executive_summary:{report:ke,conclusion:Ie},artifacts:Re.filter(Pe=>Pe.value),analysis_answers:qe},Fe=await fetch(`${rn}/api/alerts/${e.id}/complete`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${ae}`},body:JSON.stringify(_e)});if(Fe.ok){const Pe=await Fe.json();s(Pe),jt.success("Executive Summary Submitted"),h("/dashboard")}else{const Pe=await Fe.json();jt.error(Pe.message||"Failed to submit summary")}}catch(ae){console.error("Error submitting summary:",ae),jt.error("Failed to submit summary")}finally{S(!1)}};return o.jsxs("div",{className:"w-full mx-auto pb-12",children:[o.jsx(Sd,{title:`${e.title} - Investigation`,description:`Investigate security alert: ${e.title}. Severity: ${e.severity}. ${e.details?e.details.substring(0,100):""}...`}),o.jsx("div",{className:"sticky top-0 z-40 bg-[#0e0f11]/95 backdrop-blur-xl border-b border-gray-800/50 mb-6",children:o.jsx("div",{className:"max-w-[1800px] mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"flex items-center justify-between h-16",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(rc,{to:"/",className:"flex items-center gap-2 group",children:o.jsx("img",{src:"/logo.png",alt:"InfoSecLabs",className:"h-12 w-auto opacity-80 group-hover:opacity-100 transition-opacity"})}),o.jsx("div",{className:"h-6 w-px bg-gray-700/50 hidden sm:block"}),o.jsxs("button",{onClick:t,className:"hidden sm:flex items-center gap-2 text-gray-400 hover:text-white text-lg font-medium transition-colors px-3 py-1.5 rounded-lg hover:bg-white/5",children:[o.jsx("span",{children:"←"})," Dashboard"]})]}),o.jsx("div",{className:"flex-1 max-w-xl mx-4 hidden md:block",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:`px-2 py-0.5 text-xs uppercase tracking-widest font-black rounded border ${((He=e.severity)==null?void 0:He.toLowerCase())==="critical"?"bg-red-500/10 text-red-500 border-red-500/20":((Et=e.severity)==null?void 0:Et.toLowerCase())==="high"?"bg-orange-500/10 text-orange-500 border-orange-500/20":((bt=e.severity)==null?void 0:bt.toLowerCase())==="medium"?"bg-yellow-500/10 text-yellow-500 border-yellow-500/20":"bg-blue-500/10 text-blue-500 border-blue-500/20"}`,children:e.severity}),o.jsx("h1",{className:"text-white font-bold text-lg truncate",children:e.title}),o.jsxs("span",{className:"text-gray-500 text-sm font-mono",children:["#",e.id]})]})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("button",{onClick:t,className:"sm:hidden flex items-center gap-1 text-gray-400 hover:text-white text-sm font-medium transition-colors px-3 py-1.5 rounded-lg hover:bg-white/5",children:[o.jsx("span",{children:"←"})," Back"]}),((a==null?void 0:a.role)==="admin"||(a==null?void 0:a.role)==="alert-admin")&&o.jsx("div",{className:"flex gap-2",children:H?o.jsxs(o.Fragment,{children:[o.jsx("button",{onClick:re,className:"px-3 py-1.5 bg-green-500 hover:bg-green-600 text-white rounded-lg font-bold text-xs transition",children:"Save"}),o.jsx("button",{onClick:()=>Q(!1),className:"px-3 py-1.5 bg-gray-600 hover:bg-gray-500 text-white rounded-lg font-bold text-xs transition",children:"Cancel"})]}):o.jsxs(o.Fragment,{children:[o.jsx("button",{onClick:()=>Q(!0),className:"p-2 bg-gray-800 hover:bg-gray-700 text-gray-400 hover:text-white rounded-lg transition",title:"Edit Alert",children:o.jsx(sc,{className:"w-4 h-4"})}),o.jsx("button",{onClick:Y,className:"p-2 bg-gray-800 hover:bg-red-900/50 text-gray-400 hover:text-red-400 rounded-lg transition",title:"Delete Alert",children:o.jsx(nc,{className:"w-4 h-4"})})]})}),o.jsx(rc,{to:"/dashboard?view=profile",className:"w-8 h-8 rounded-full bg-gradient-to-br from-purple-500 to-blue-500 flex items-center justify-center text-white font-bold text-xs border border-white/10",children:((ht=a==null?void 0:a.username)==null?void 0:ht.charAt(0).toUpperCase())||"U"})]})]})})}),o.jsxs("div",{className:"px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"bg-[#1a1b1e] rounded-2xl border border-gray-800 overflow-hidden mb-8",children:[e.is_operation_alert&&o.jsxs("div",{className:"bg-purple-900/30 border-b border-purple-500/20 px-8 py-4 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-10 h-10 bg-purple-500/10 rounded-xl flex items-center justify-center border border-purple-500/20 shadow-[0_0_15px_rgba(168,85,247,0.15)]",children:o.jsx(Pi,{className:"w-6 h-6 text-purple-400"})}),o.jsxs("div",{children:[o.jsx("div",{className:"text-[10px] font-bold text-purple-400 uppercase tracking-widest mb-0.5",children:e.operation_title||"Classified Operation"}),o.jsxs("div",{className:"text-sm font-medium text-gray-400",children:["Mission Progress: ",o.jsxs("span",{className:"text-white",children:[e.operation_sequence," of ",e.operation_total_alerts," Alerts"]})]})]})]}),o.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[o.jsxs("div",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest",children:["Operation Status: ",e.operation_sequence===e.operation_total_alerts?"Final Stage":"Active"]}),o.jsx("div",{className:"w-32 h-1.5 bg-gray-800 rounded-full overflow-hidden border border-gray-700/50",children:o.jsx("div",{className:"h-full bg-gradient-to-r from-purple-500 to-fuchsia-500 shadow-[0_0_10px_rgba(168,85,247,0.4)]",style:{width:`${e.operation_sequence/e.operation_total_alerts*100}%`}})})]})]}),o.jsxs("div",{className:"relative bg-[#0e0f11] border-b border-gray-800 overflow-hidden group",children:[o.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-blue-900/10 via-transparent to-transparent z-0"}),o.jsxs("div",{className:"p-8 relative z-10 flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[o.jsxs("div",{className:"flex-1 w-full",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-3",children:[H?o.jsxs("select",{value:he.severity,onChange:ae=>pe({...he,severity:ae.target.value}),className:"px-2 py-1 bg-[#0e0f11] border border-gray-700 rounded text-xs text-white uppercase font-bold",children:[o.jsx("option",{value:"Low",children:"Low"}),o.jsx("option",{value:"Medium",children:"Medium"}),o.jsx("option",{value:"High",children:"High"}),o.jsx("option",{value:"Critical",children:"Critical"})]}):o.jsxs("span",{className:`px-3 py-1 inline-flex text-[10px] uppercase tracking-widest font-black rounded-md border shadow-lg ${((dt=e.severity)==null?void 0:dt.toLowerCase())==="critical"?"bg-red-500/10 text-red-500 border-red-500/20 shadow-red-500/10":((kt=e.severity)==null?void 0:kt.toLowerCase())==="high"?"bg-orange-500/10 text-orange-500 border-orange-500/20 shadow-orange-500/10":"bg-blue-500/10 text-blue-500 border-blue-500/20 shadow-blue-500/10"}`,children:[e.severity," Priority"]}),o.jsxs("span",{className:"flex items-center gap-1.5 text-gray-500 text-xs font-mono font-medium border-l border-gray-800 pl-3",children:[o.jsx(Ga,{className:"w-3.5 h-3.5"}),new Date(e.created_at).toLocaleString()]}),e.grade!==null&&o.jsxs("span",{className:"px-3 py-1 inline-flex text-[10px] uppercase tracking-widest font-black rounded-md border bg-purple-500/10 text-purple-400 border-purple-500/20 shadow-lg shadow-purple-500/10",children:[o.jsx(Fd,{className:"w-3 h-3 mr-1"}),"Grade: ",e.grade,"/100"]})]}),H?o.jsx("input",{type:"text",value:he.title,onChange:ae=>pe({...he,title:ae.target.value}),className:"w-full bg-black/30 border-b border-gray-700 rounded-lg p-2 text-3xl font-black text-white italic tracking-wide focus:outline-none focus:border-blue-500"}):o.jsx("h1",{className:"text-3xl md:text-4xl font-black text-white italic tracking-wider drop-shadow-xl",children:e.title})]}),o.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[!e.assigned_to&&o.jsxs("button",{onClick:()=>r(e.id),className:"px-8 py-3 bg-blue-600 hover:bg-blue-500 text-white font-bold rounded-xl transition-all shadow-[0_0_20px_rgba(37,99,235,0.3)] hover:shadow-[0_0_30px_rgba(37,99,235,0.5)] transform hover:-translate-y-1 flex items-center gap-2",children:[o.jsx(Pi,{className:"w-4 h-4"}),"INITIALIZE OPS"]}),e.assigned_to===n&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("div",{className:"px-4 py-2 bg-green-500/10 border border-green-500/20 rounded-xl flex items-center gap-2 shadow-[0_0_15px_rgba(34,197,94,0.1)]",children:[o.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),o.jsx("span",{className:"text-green-500 text-xs font-bold uppercase tracking-wider",children:"Assigned to You"})]}),o.jsx("button",{onClick:oe,className:"p-2.5 bg-gray-800/50 hover:bg-red-500/20 text-gray-400 hover:text-red-400 border border-gray-700 hover:border-red-500/30 rounded-xl transition-all",title:"Abort Mission / Unassign",children:o.jsx(Nd,{className:"w-4 h-4"})})]}),e.assigned_to&&e.assigned_to!==n&&o.jsx("span",{className:"px-4 py-2 bg-gray-800 text-gray-500 rounded-xl text-xs font-bold uppercase tracking-wider border border-gray-700",children:"Operator Assigned"}),((a==null?void 0:a.role)==="admin"||(a==null?void 0:a.role)==="alert-admin")&&o.jsx("div",{className:"border-l border-gray-700 pl-3 ml-2 flex gap-2",children:H?o.jsxs(o.Fragment,{children:[o.jsx("button",{onClick:re,className:"p-2 bg-green-600 hover:bg-green-500 text-white rounded-lg",children:o.jsx(vu,{className:"w-4 h-4"})}),o.jsx("button",{onClick:()=>Q(!1),className:"p-2 bg-gray-700 hover:bg-gray-600 text-white rounded-lg",children:o.jsx(dl,{className:"w-4 h-4"})})]}):o.jsxs(o.Fragment,{children:[o.jsx("button",{onClick:()=>Q(!0),className:"p-2 bg-gray-800 hover:bg-gray-700 text-gray-400 hover:text-white rounded-lg border border-gray-700 transition",children:o.jsx(sc,{className:"w-4 h-4"})}),o.jsx("button",{onClick:Y,className:"p-2 bg-gray-800 hover:bg-red-900/50 text-gray-400 hover:text-red-400 rounded-lg border border-gray-700 transition",children:o.jsx(nc,{className:"w-4 h-4"})})]})})]})]})]})]}),o.jsxs("div",{className:"fixed bottom-6 right-6 z-50 flex flex-col items-end pointer-events-none",children:[se&&o.jsxs("div",{className:"bg-[#0e0f11]/95 backdrop-blur-xl border border-fuchsia-500/30 rounded-2xl shadow-[0_0_50px_rgba(192,38,211,0.25)] w-80 md:w-96 mb-6 pointer-events-auto flex flex-col overflow-hidden animate-fade-in-up md:mr-10 transition-all duration-300 transform origin-bottom-right theme-glass",children:[o.jsxs("div",{className:"bg-gradient-to-r from-fuchsia-950/80 via-purple-900/40 to-fuchsia-950/80 p-4 border-b border-fuchsia-500/20 flex justify-between items-center relative overflow-hidden group",children:[o.jsx("div",{className:"absolute top-0 left-0 w-full h-[1px] bg-gradient-to-r from-transparent via-fuchsia-400 to-transparent animate-scan-slow opacity-70"}),o.jsxs("div",{className:"flex items-center gap-3 relative z-10",children:[o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:"w-11 h-11 rounded-full p-[2px] bg-gradient-to-tr from-fuchsia-500 via-white/50 to-blue-500 shadow-lg shadow-fuchsia-500/20",children:o.jsx("img",{src:"/handler-avatar.png?v=2",alt:"Senior Analyst",className:"w-full h-full rounded-full object-cover border-2 border-[#131416] bg-gray-800",onError:ae=>{ae.target.onerror=null,ae.target.src="https://ui-avatars.com/api/?name=Senior+Analyst&background=C026D3&color=fff"}})}),o.jsx("div",{className:"absolute 0 bottom-0 right-0 w-3.5 h-3.5 bg-green-500 rounded-full border-2 border-[#131416] shadow-[0_0_8px_rgba(34,197,94,0.6)] animate-pulse"})]}),o.jsxs("div",{className:"flex flex-col justify-center",children:[o.jsxs("h4",{className:"font-bold text-white text-sm flex items-center gap-2 tracking-wide font-sans",children:["SENIOR ANALYST",o.jsx("span",{className:"px-1.5 py-0.5 rounded text-[9px] font-bold bg-green-500/10 text-green-400 border border-green-500/20 uppercase tracking-widest shadow-[0_0_10px_rgba(34,197,94,0.1)]",children:"Online"})]}),o.jsx("p",{className:"text-[10px] text-fuchsia-200/60 font-mono tracking-wider uppercase mt-0.5",children:"Secure Link • Encrypted v2"})]})]}),o.jsx("button",{onClick:()=>ge(!1),className:"text-gray-400 hover:text-white transition-all p-2 hover:bg-white/10 rounded-full active:scale-90",children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),o.jsxs("div",{className:"h-80 overflow-y-auto p-4 space-y-5 bg-[#0a0a0c]/60 scrollbar-thin scrollbar-thumb-fuchsia-900/50 scrollbar-track-transparent",children:[W.length===0&&o.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center px-6 animate-fade-in",children:[o.jsx("div",{className:"w-20 h-20 rounded-full bg-gradient-to-tr from-fuchsia-500/10 to-purple-500/10 flex items-center justify-center mb-4 border border-fuchsia-500/20 shadow-[0_0_30px_rgba(192,38,211,0.1)]",children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8 text-fuchsia-500/50",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})})}),o.jsx("h5",{className:"text-gray-200 font-medium text-sm mb-1",children:"Awaiting SitRep"}),o.jsx("p",{className:"text-gray-500 text-xs leading-relaxed max-w-[200px]",children:"I've analyzed the telemetry. What particular artifact requires clarification?"})]}),W.map((ae,_e)=>o.jsxs("div",{className:`flex ${ae.role==="user"?"justify-end":"justify-start"} animate-fade-in group`,children:[ae.role!=="user"&&o.jsx("div",{className:"w-8 h-8 rounded-full overflow-hidden mr-3 mt-1 flex-shrink-0 border border-fuchsia-500/20 shadow-sm",children:o.jsx("img",{src:"/handler-avatar.png?v=2",className:"w-full h-full object-cover"})}),o.jsx("div",{className:`max-w-[85%] rounded-2xl px-4 py-3 text-xs leading-relaxed shadow-md backdrop-blur-sm ${ae.role==="user"?"bg-gradient-to-br from-fuchsia-600/30 to-purple-700/30 text-fuchsia-50 rounded-tr-sm border border-fuchsia-500/20 shadow-[0_4px_15px_rgba(192,38,211,0.05)]":"bg-[#151619] text-gray-300 rounded-tl-sm border border-gray-800 shadow-[0_4px_15px_rgba(0,0,0,0.2)]"}`,children:o.jsx(Ed,{components:{code:({node:Fe,inline:Pe,className:Be,children:Me,...et})=>o.jsx("code",{className:`${Pe?"bg-black/40 px-1 py-0.5 rounded text-fuchsia-300 font-mono text-[10px]":"block bg-black/60 p-3 rounded-lg border border-gray-800 my-2 overflow-x-auto text-[10px] text-gray-300"}`,...et,children:Me})},children:(ae.role==="user",ae.content)})})]},_e)),D&&o.jsxs("div",{className:"flex justify-start animate-pulse",children:[o.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-800/50 mr-3 mt-1 border border-white/5"}),o.jsxs("div",{className:"bg-[#151619] text-fuchsia-400 rounded-2xl rounded-tl-sm px-4 py-3 text-xs border border-gray-800 flex items-center gap-1.5",children:[o.jsx("span",{className:"w-1.5 h-1.5 bg-fuchsia-500 rounded-full animate-bounce"}),o.jsx("span",{className:"w-1.5 h-1.5 bg-fuchsia-500 rounded-full animate-bounce [animation-delay:0.2s]"}),o.jsx("span",{className:"w-1.5 h-1.5 bg-fuchsia-500 rounded-full animate-bounce [animation-delay:0.4s]"}),o.jsx("span",{className:"ml-2 text-[10px] text-gray-500 font-mono uppercase tracking-widest",children:"Typing"})]})]}),o.jsx("div",{ref:ae=>ae==null?void 0:ae.scrollIntoView({behavior:"smooth"})})]}),o.jsxs("form",{onSubmit:V,className:"p-4 bg-[#131416] border-t border-white/5 flex gap-3 relative z-10",children:[o.jsx("input",{type:"text",value:b,onChange:ae=>I(ae.target.value),placeholder:"Transmit request...",className:"flex-1 bg-[#0a0a0c] border border-gray-800 rounded-xl px-4 py-3 text-xs text-white focus:outline-none focus:border-fuchsia-500/50 focus:bg-[#1a1b1e] transition-all placeholder:text-gray-600 shadow-inner"}),o.jsx("button",{type:"submit",disabled:D||!b.trim(),className:"bg-gradient-to-br from-fuchsia-600 to-purple-700 hover:from-fuchsia-500 hover:to-purple-600 text-white rounded-xl px-3.5 transition-all disabled:opacity-50 disabled:cursor-not-allowed shadow-[0_0_15px_rgba(192,38,211,0.2)] hover:shadow-[0_0_20px_rgba(192,38,211,0.4)] active:scale-95 flex items-center justify-center border border-white/10",children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 transform rotate-90",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})})})]})]}),o.jsxs("div",{className:"relative group pointer-events-auto",children:[!se&&o.jsx("div",{className:"absolute right-full mr-4 top-1/2 -translate-y-1/2 whitespace-nowrap hidden group-hover:flex items-center gap-2 animate-fade-in-right",children:o.jsx("div",{className:"bg-white/10 backdrop-blur-md text-white/90 text-[11px] font-medium px-3 py-1.5 rounded-lg border border-white/10 shadow-lg",children:"Senior Analyst is Online"})}),!se&&o.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-fuchsia-500/30 animate-ping-slow opacity-75"}),o.jsx("button",{onClick:()=>ge(!se),className:`relative flex items-center justify-center transition-all duration-300 hover:scale-105 active:scale-95 shadow-[0_0_30px_rgba(192,38,211,0.3)] ${se?"w-12 h-12 rounded-full bg-gray-800 border border-gray-600 text-gray-400 hover:text-white":"h-14 px-5 rounded-full bg-gradient-to-r from-fuchsia-600 to-purple-700 border border-white/20"}`,children:se?o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}):o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 overflow-hidden shadow-inner relative bg-black",children:o.jsx("img",{src:"/handler-avatar.png?v=2",alt:"AI",className:"w-full h-full object-cover"})}),o.jsxs("div",{className:"flex flex-col items-start",children:[o.jsx("span",{className:"text-xs font-bold text-white tracking-wide",children:"ASK ANALYST"}),o.jsxs("span",{className:"text-[9px] text-fuchsia-200 font-mono flex items-center gap-1",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400 animate-pulse"}),"ONLINE"]})]})]})})]})]}),o.jsxs("div",{className:"p-6 md:p-8 bg-[#1a1b1e] rounded-2xl border border-gray-800 mb-8 shadow-2xl relative overflow-hidden",children:[o.jsx("div",{className:"absolute top-0 right-0 w-[800px] h-[800px] bg-blue-600/10 rounded-full blur-[120px] pointer-events-none mix-blend-screen"}),o.jsx("div",{className:"absolute bottom-0 left-0 w-[800px] h-[800px] bg-purple-600/10 rounded-full blur-[120px] pointer-events-none mix-blend-screen"}),o.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-12 gap-8 relative z-10",children:[o.jsx("div",{className:"xl:col-span-8 xl:order-1 order-2 flex flex-col gap-6",children:o.jsxs("div",{className:"bg-[#0e0f11] border border-gray-800 rounded-3xl overflow-hidden shadow-2xl flex flex-col h-full",children:[o.jsxs("div",{className:"px-6 py-4 border-b border-gray-800 bg-[#131416] flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Su,{className:"w-5 h-5 text-blue-500"}),o.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Security Environment"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("div",{className:"flex gap-1.5 mr-4",children:[o.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500/50"}),o.jsx("div",{className:"w-2 h-2 rounded-full bg-yellow-500/50"}),o.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500/50"})]}),o.jsx("span",{className:"px-2 py-0.5 rounded bg-blue-500/10 text-blue-400 text-[10px] font-mono border border-blue-500/20",children:"LIVE CONNECTION"})]})]}),o.jsxs("div",{className:"flex-1 relative group bg-black/50",children:[o.jsx("div",{className:"absolute inset-0 bg-blue-500/5 opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-0"}),o.jsx("div",{className:"relative z-10 h-[80vh] min-h-[700px]",children:o.jsx(Xd,{alert:e})})]})]})}),o.jsxs("div",{className:"xl:col-span-4 xl:order-2 order-1 space-y-6 h-full sticky top-6",children:[o.jsxs("div",{className:"bg-[#0e0f11] border border-gray-800 rounded-3xl overflow-hidden shadow-xl flex-1",children:[o.jsxs("div",{className:"px-6 py-4 border-b border-gray-800 bg-[#131416] flex items-center gap-3",children:[o.jsx(Od,{className:"w-5 h-5 text-indigo-500"}),o.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Mission Brief"})]}),o.jsx("div",{className:"p-6",children:o.jsx("div",{className:"font-mono text-xs text-gray-400 whitespace-pre-wrap leading-relaxed max-h-[400px] overflow-y-auto custom-scrollbar p-3 bg-[#1a1b1e] rounded-xl border border-gray-800/50",children:H?o.jsx("textarea",{className:"w-full bg-transparent p-0 border-none font-mono text-gray-300 h-32 focus:outline-none resize-none focus:ring-0",value:he.details,onChange:ae=>pe({...he,details:ae.target.value})}):typeof e.details=="object"?JSON.stringify(e.details,null,2):e.details||"No additional intelligence available."})})]}),o.jsxs("div",{className:"bg-[#0e0f11] border border-gray-800 rounded-3xl overflow-hidden shadow-xl",children:[o.jsxs("div",{className:"px-6 py-4 border-b border-gray-800 bg-[#131416] flex items-center gap-3",children:[o.jsx(Fa,{className:"w-5 h-5 text-purple-500"}),o.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Alert Profile"})]}),o.jsxs("div",{className:"p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsxs("label",{className:"block text-[10px] font-bold text-gray-500 mb-2 uppercase tracking-wider flex items-center gap-2",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-500"})," Source System"]}),H?o.jsx("input",{className:"w-full bg-transparent border-b border-gray-700 text-white font-mono text-sm py-1",value:he.source,onChange:ae=>pe({...he,source:ae.target.value})}):o.jsxs("div",{className:"bg-[#1a1b1e] p-3 rounded-xl border border-gray-800 flex items-center gap-3 group hover:border-blue-500/50 transition-colors",children:[o.jsx("div",{className:"w-8 h-8 rounded-lg bg-blue-500/10 flex items-center justify-center border border-blue-500/20",children:o.jsx(Fa,{className:"w-4 h-4 text-blue-400"})}),o.jsx("span",{className:"text-white font-mono text-sm font-bold",children:typeof e.source=="object"?JSON.stringify(e.source):e.source})]})]}),o.jsxs("div",{children:[o.jsxs("label",{className:"block text-[10px] font-bold text-gray-500 mb-2 uppercase tracking-wider flex items-center gap-2",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-purple-500"})," Investigation Status"]}),H?o.jsxs("select",{className:"w-full bg-transparent border-b border-gray-700 text-white text-sm py-1",value:he.status,onChange:ae=>pe({...he,status:ae.target.value}),children:[o.jsx("option",{value:"New",children:"New"}),o.jsx("option",{value:"Investigating",children:"Investigating"}),o.jsx("option",{value:"Closed",children:"Closed"})]}):o.jsxs("div",{className:"bg-[#1a1b1e] p-3 rounded-xl border border-gray-800 flex items-center gap-3",children:[o.jsx("span",{className:`w-2 h-2 rounded-full ${e.status==="New"||((Ze=e.status)==null?void 0:Ze.toLowerCase())==="pending"?"bg-blue-500 shadow-[0_0_10px_rgba(59,130,246,0.5)]":e.status==="Investigating"?"bg-yellow-500 animate-pulse shadow-[0_0_10px_rgba(234,179,8,0.5)]":"bg-green-500 shadow-[0_0_10px_rgba(34,197,94,0.5)]"}`}),o.jsx("span",{className:"text-white text-sm font-medium capitalize",children:e.status})]})]}),o.jsx("div",{className:"pt-4 border-t border-gray-800/50",children:o.jsxs("div",{className:"flex justify-between items-center text-xs",children:[o.jsx("span",{className:"text-gray-500 uppercase tracking-widest font-bold",children:"Alert ID"}),o.jsxs("span",{className:"font-mono text-gray-300 bg-gray-800/50 px-2 py-1 rounded",children:["#",e.id]})]})})]})]}),e.mitre_technique&&o.jsxs("div",{className:"bg-[#0e0f11] border border-gray-800 rounded-3xl overflow-hidden shadow-xl",children:[o.jsxs("div",{className:"px-6 py-4 border-b border-gray-800 bg-[#131416] flex items-center gap-3",children:[o.jsx(Td,{className:"w-5 h-5 text-red-500"}),o.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"MITRE Intel"})]}),o.jsx("div",{className:"p-6",children:o.jsxs("div",{className:"bg-red-900/10 p-4 rounded-xl border border-red-900/20 flex items-start gap-4 hover:bg-red-900/20 transition-colors",children:[o.jsx("div",{className:"bg-red-500/10 p-2 rounded-lg shrink-0",children:o.jsx(Fa,{className:"w-5 h-5 text-red-500"})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("div",{className:"text-white font-mono text-sm font-bold mb-1",children:e.mitre_technique}),o.jsxs("a",{href:`https://attack.mitre.org/techniques/${e.mitre_technique.split(" ")[0]}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[10px] text-red-400 hover:text-red-300 transition-colors uppercase tracking-wider font-bold",children:["TTP Reference ",o.jsx(ju,{className:"w-3 h-3"})]})]})]})})]})]})]})]}),["closed"].includes((e.status||"").toLowerCase())&&e.grade!==null&&e.grade<60&&e.assigned_to==n&&o.jsxs("div",{className:"bg-red-900/10 border border-red-500/20 rounded-2xl p-8 text-center mb-8",children:[o.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:"Investigation Failed"}),o.jsxs("p",{className:"text-gray-400 mb-6",children:["Your investigation grade (",e.grade,"%) was below the passing threshold (60%). You can try again to improve your score."]}),o.jsx("button",{onClick:()=>j(!0),className:"px-6 py-3 bg-red-600 hover:bg-red-500 text-white font-bold rounded-lg shadow-lg shadow-red-600/20 transition-all hover:scale-105",children:"🔄 Try Again"})]}),!["closed","graded","submitted"].includes((e.status||"").toLowerCase())&&String(e.assigned_to)===String(n)&&o.jsx(o.Fragment,{children:i2(e)===2?o.jsx("div",{className:"max-w-7xl mx-auto",children:o.jsx(Ld,{alert:e,isSubmitting:w,onSubmit:async ae=>{S(!0);try{const _e=localStorage.getItem("token"),Fe=await fetch(`${rn}/api/alerts/${e.id}/complete-v2`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${_e}`},body:JSON.stringify(ae)});if(Fe.ok){const Pe=await Fe.json();s(Pe),ut(Pe),Pe.isOperationComplete&&Pe.operationId&&(ue(Pe.operationId),G(!0))}else{const Pe=await Fe.json();jt.error(Pe.message||"Failed to submit investigation")}}catch(_e){console.error("Error submitting v2 investigation:",_e),jt.error("Failed to submit investigation")}finally{S(!1)}}})}):o.jsxs("div",{className:"max-w-7xl mx-auto bg-[#1a1b1e] rounded-2xl border border-gray-800 overflow-hidden mb-8 p-8",children:[o.jsx("div",{className:"flex items-center gap-2 mb-4",children:o.jsx("span",{className:"px-2 py-1 bg-gray-700 text-gray-400 text-xs font-medium rounded",children:"Classic Mode"})}),o.jsxs("div",{className:"flex justify-between items-center mb-8 relative",children:[o.jsx("div",{className:"absolute top-1/2 left-0 w-full h-1 bg-gray-800 -z-0 rounded-full"}),o.jsx("div",{className:"absolute top-1/2 left-0 h-1 bg-fuchsia-600 -z-0 rounded-full transition-all duration-300",style:{width:`${(De-1)/3*100}%`}}),[1,2,3,4].map(ae=>o.jsxs("div",{className:"flex flex-col items-center relative z-10 bg-[#1a1b1e] px-4",children:[o.jsx("div",{className:`w-10 h-10 rounded-full flex items-center justify-center font-bold text-sm mb-2 transition-colors border-2 ${De>=ae?"bg-fuchsia-600 border-fuchsia-600 text-white shadow-lg shadow-fuchsia-600/30":"bg-[#1a1b1e] border-gray-700 text-gray-500"}`,children:De>ae?"✓":ae}),o.jsx("span",{className:`text-xs font-bold uppercase tracking-wider ${De>=ae?"text-white":"text-gray-600"}`,children:ae===1?"Investigate":ae===2?"Verdict":ae===3?"Report":"Conclusion"})]},ae))]}),De===1&&o.jsxs("div",{className:"animate-fade-in",children:[o.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:"Step 1: Investigation & Artifacts"}),o.jsx("p",{className:"text-gray-400 text-sm mb-4",children:"Identify and list any suspicious IPs, domains, hashes, or URLs found during your triage."}),o.jsxs("div",{className:"bg-blue-900/10 border border-blue-500/20 rounded-lg p-4 mb-6",children:[o.jsxs("h4",{className:"text-blue-400 font-bold text-sm mb-2 flex items-center gap-2",children:[o.jsx("span",{children:"💡"})," Pro Tip: Finding Artifacts"]}),o.jsxs("ul",{className:"text-gray-400 text-xs space-y-1 list-disc list-inside",children:[o.jsxs("li",{children:["Check the ",o.jsx("strong",{children:"Raw Log"})," above for IP addresses, URLs, and domains"]}),o.jsx("li",{children:"Look for file hashes (MD5, SHA1, SHA256) in malware alerts"}),o.jsx("li",{children:"Note any suspicious usernames or email addresses"})]})]}),o.jsxs("div",{className:"mb-6",children:[o.jsxs("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-3 flex items-center gap-2",children:[o.jsx("span",{children:"🔍"})," Identified Artifacts"]}),o.jsxs("div",{className:"space-y-2",children:[Re.map((ae,_e)=>o.jsxs("div",{className:"flex gap-2 p-3 bg-[#0e0f11] rounded-lg border border-gray-800 hover:border-gray-700 transition group",children:[o.jsxs("select",{value:ae.type,onChange:Fe=>rt(_e,"type",Fe.target.value),className:"bg-gray-900 border border-gray-700 rounded px-3 py-2 text-infosec-accent font-bold text-sm min-w-[130px] focus:outline-none focus:border-infosec-accent cursor-pointer",children:[o.jsx("option",{value:"IP",children:"🌐 IP Address"}),o.jsx("option",{value:"Domain",children:"🔗 Domain"}),o.jsx("option",{value:"Hash",children:"🔐 File Hash"}),o.jsx("option",{value:"URL",children:"🌍 URL"}),o.jsx("option",{value:"Email",children:"📧 Email"}),o.jsx("option",{value:"Process",children:"⚙️ Process"}),o.jsx("option",{value:"File",children:"📁 File Path"}),o.jsx("option",{value:"Username",children:"👤 Username"}),o.jsx("option",{value:"Command",children:"💻 Command"}),o.jsx("option",{value:"Port",children:"🔌 Port"}),o.jsx("option",{value:"CVE",children:"🛡️ CVE ID"}),o.jsx("option",{value:"Registry",children:"📋 Registry"})]}),o.jsx("input",{type:"text",placeholder:"Enter the artifact value...",value:ae.value,onChange:Fe=>rt(_e,"value",Fe.target.value),className:"bg-gray-900 border border-gray-700 rounded px-4 py-2 text-white text-sm flex-1 focus:outline-none focus:border-infosec-accent font-mono placeholder:text-gray-600"}),o.jsx("button",{onClick:()=>ze(_e),className:"text-gray-600 hover:text-red-500 hover:bg-red-500/10 px-3 rounded transition",title:"Remove Artifact",children:"✕"})]},_e)),o.jsxs("button",{onClick:mt,className:"w-full py-3 border-2 border-dashed border-gray-700 rounded-lg text-gray-400 hover:text-infosec-accent hover:border-infosec-accent/50 hover:bg-infosec-accent/5 transition text-sm font-bold flex items-center justify-center gap-2",children:[o.jsx("span",{className:"text-lg",children:"+"})," Add Another Artifact"]})]})]}),o.jsxs("div",{className:"mb-8 border-t border-gray-800 pt-6",children:[o.jsxs("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-3 flex items-center gap-2",children:[o.jsx("span",{children:"⚠️"})," Attack Category"]}),o.jsx("p",{className:"text-gray-500 text-xs mb-3",children:"What type of attack or threat does this alert represent?"}),o.jsxs("select",{value:qe.attack_category||"",onChange:ae=>Je({...qe,attack_category:ae.target.value}),className:"w-full bg-[#0e0f11] border border-gray-700 rounded-lg p-4 text-white focus:outline-none focus:border-infosec-accent text-sm cursor-pointer",children:[o.jsx("option",{value:"",children:"-- Select Attack Category --"}),o.jsx("option",{value:"Malware",children:"🦠 Malware / Ransomware"}),o.jsx("option",{value:"Phishing",children:"🎣 Phishing / Social Engineering"}),o.jsx("option",{value:"Brute Force",children:"🔓 Brute Force / Password Attack"}),o.jsx("option",{value:"Web Attack",children:"🌐 Web Attack (SQLi/XSS/RCE)"}),o.jsx("option",{value:"Network Intrusion",children:"🔌 Network Intrusion / Lateral Movement"}),o.jsx("option",{value:"Suspicious Login",children:"🚪 Suspicious Login / Account Compromise"}),o.jsx("option",{value:"Data Exfiltration",children:"📤 Data Exfiltration / Leakage"}),o.jsx("option",{value:"Insider Threat",children:"👥 Insider Threat"}),o.jsx("option",{value:"Cryptomining",children:"⛏️ Cryptomining / Resource Abuse"}),o.jsx("option",{value:"DNS Tunneling",children:"🔀 DNS Tunneling / C2 Communication"}),o.jsx("option",{value:"Reconnaissance",children:"🔎 Reconnaissance / Scanning"}),o.jsx("option",{value:"Other",children:"❓ Other / Unknown"})]})]}),o.jsx("div",{className:"flex justify-end",children:o.jsxs("button",{onClick:()=>Te(2),disabled:Re.filter(ae=>ae.value).length===0,className:"px-8 py-3 bg-fuchsia-600 hover:bg-fuchsia-700 disabled:bg-gray-700 disabled:cursor-not-allowed text-white font-bold rounded-lg shadow-lg shadow-fuchsia-600/20 disabled:shadow-none transition flex items-center gap-2",children:["Next Step ",o.jsx("span",{className:"text-lg",children:"→"})]})})]}),De===2&&o.jsxs("div",{className:"animate-fade-in",children:[o.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:"Step 2: Verdict & Actions"}),o.jsx("p",{className:"text-gray-400 text-sm mb-6",children:"Determine the nature of this alert and select appropriate remediation actions."}),o.jsxs("div",{className:"mb-8",children:[o.jsx("label",{className:"block text-xs font-bold text-gray-400 uppercase mb-3 tracking-wider",children:"1. Recommended Actions"}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:["Isolate Host","Block IP / Domain","Block Hash","Reset Credentials","Close Alert (False Positive)"].map(ae=>{const _e=(Array.isArray(qe.action_taken)?qe.action_taken:[]).includes(ae);return o.jsxs("div",{onClick:()=>{const Fe=Array.isArray(qe.action_taken)?qe.action_taken:[],Pe=Fe.includes(ae)?Fe.filter(Be=>Be!==ae):[...Fe,ae];Je({...qe,action_taken:Pe})},className:`flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-all duration-200 ${_e?"bg-fuchsia-900/20 border-fuchsia-500/50 text-white shadow-sm shadow-fuchsia-500/10":"bg-[#0e0f11] border-gray-700 text-gray-400 hover:border-gray-500 hover:text-gray-200"}`,children:[o.jsx("div",{className:`w-5 h-5 rounded flex items-center justify-center border transition-colors ${_e?"bg-fuchsia-600 border-fuchsia-600":"border-gray-600 bg-gray-800"}`,children:_e&&o.jsx("span",{className:"text-white text-xs font-bold",children:"✓"})}),o.jsx("span",{className:"text-sm font-medium",children:ae})]},ae)})})]}),o.jsxs("div",{className:"mb-8",children:[o.jsx("label",{className:"block text-xs font-bold text-gray-400 uppercase mb-3 tracking-wider",children:"2. Verdict"}),o.jsx("div",{className:"grid grid-cols-3 gap-4",children:["True Positive","False Positive","Benign"].map(ae=>o.jsxs("div",{onClick:()=>Ce(ae),className:`cursor-pointer p-4 rounded-xl border-2 transition-all duration-200 text-center ${je===ae?"border-infosec-accent bg-infosec-accent/10 shadow-lg shadow-infosec-accent/10 transform scale-105":"border-gray-800 bg-[#0e0f11] hover:border-gray-600"}`,children:[o.jsx("div",{className:`text-2xl mb-2 ${ae==="True Positive"?"text-red-500":ae==="False Positive"?"text-orange-500":"text-green-500"}`,children:ae==="True Positive"?"🚨":ae==="False Positive"?"⚠️":"✅"}),o.jsx("div",{className:`font-bold text-sm ${je===ae?"text-white":"text-gray-500"}`,children:ae})]},ae))})]}),o.jsxs("div",{className:"flex justify-between items-center border-t border-gray-800 pt-6",children:[o.jsx("button",{onClick:()=>Te(1),className:"px-6 py-3 bg-gray-700 hover:bg-gray-600 text-white font-bold rounded-lg transition",children:"Back"}),o.jsxs("button",{onClick:()=>{if(!je){e("Please select a Verdict before proceeding.");return}Te(3)},className:`px-8 py-3 font-bold rounded-lg shadow-lg transition flex items-center gap-2 ${je?"bg-fuchsia-600 hover:bg-fuchsia-700 text-white shadow-fuchsia-600/20":"bg-gray-800 text-gray-500 cursor-not-allowed"}`,children:["Next: Report ",o.jsx("span",{className:"text-lg",children:"→"})]})]})]}),De===3&&o.jsxs("div",{className:"animate-fade-in",children:[o.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:"Step 3: Executive Report"}),o.jsx("p",{className:"text-gray-400 text-sm mb-6",children:"Review the auto-generated summary of your findings."}),o.jsxs("div",{className:"mb-8",children:[o.jsxs("div",{className:"flex justify-between items-center mb-2",children:[o.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider",children:"Investigation Findings"}),o.jsxs("button",{onClick:()=>{const ae=Re.filter(Pe=>Pe.value).map(Pe=>`- ${Pe.type}: ${Pe.value}`).join(`
`),_e=Array.isArray(qe.action_taken)&&qe.action_taken.length>0?qe.action_taken.join(", "):qe.action_taken||"None",Fe=`## Executive Report
**Date:** ${new Date().toLocaleDateString()}
**Verdict:** ${je||"Pending Analysis"}

### Incident Overview
Alert triggered by suspicious activity classified as **${qe.attack_category||"Unknown"}**.

### Key Findings & Artifacts
${ae||"- No artifacts recorded."}

### Incident Response
Actions taken to mitigate the threat:
${_e||"- No specific actions recorded."}`;E(Fe)},className:"text-xs font-bold text-infosec-accent bg-infosec-accent/10 border border-infosec-accent/20 px-3 py-1.5 rounded-full hover:bg-infosec-accent/20 hover:border-infosec-accent/40 transition-all flex items-center gap-2",children:[o.jsx("span",{children:"✨"})," Generate Report Draft"]})]}),o.jsx("textarea",{value:ke,onChange:ae=>E(ae.target.value),placeholder:"Click 'Generate Report Draft' or start typing...",className:"w-full bg-[#0e0f11] border border-gray-700 rounded-lg p-4 text-white h-64 focus:outline-none focus:border-infosec-accent font-mono text-sm leading-relaxed"})]}),o.jsxs("div",{className:"flex justify-between items-center border-t border-gray-800 pt-6",children:[o.jsx("button",{onClick:()=>Te(2),className:"px-6 py-3 bg-gray-700 hover:bg-gray-600 text-white font-bold rounded-lg transition",children:"Back"}),o.jsxs("button",{onClick:()=>Te(4),className:"px-8 py-3 bg-fuchsia-600 hover:bg-fuchsia-700 text-white font-bold rounded-lg shadow-lg shadow-fuchsia-600/20 transition transform hover:scale-105",children:["Next: Conclusion ",o.jsx("span",{className:"text-lg",children:"→"})]})]})]}),De===4&&o.jsxs("div",{className:"animate-fade-in",children:[o.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:"Step 4: Conclusion"}),o.jsx("p",{className:"text-gray-400 text-sm mb-6",children:"Provide your final professional conclusion based on the findings."}),o.jsxs("div",{className:"bg-blue-900/10 border border-blue-500/20 rounded-lg p-4 mb-6",children:[o.jsxs("h4",{className:"text-blue-400 font-bold text-sm mb-2 flex items-center gap-2",children:[o.jsx("span",{children:"ℹ️"})," Guide: Writing a Strong Conclusion"]}),o.jsxs("ul",{className:"text-gray-400 text-xs space-y-1 list-disc list-inside",children:[o.jsxs("li",{children:["State clearly: ",o.jsx("strong",{children:'"This alert is a [Verdict] because..."'})]}),o.jsxs("li",{children:["Mention impact: ",o.jsx("strong",{children:'"The malicious file was/was not executed."'})]}),o.jsxs("li",{children:["Confirm containment: ",o.jsx("strong",{children:'"Host isolated and hash blocked to prevent spread."'})]})]})]}),o.jsxs("div",{className:"bg-gray-800/30 border border-gray-700/50 rounded-lg p-4 mb-6",children:[o.jsxs("div",{className:"flex items-center justify-between mb-3",children:[o.jsxs("h4",{className:"text-gray-400 font-bold text-xs uppercase tracking-wider flex items-center gap-2",children:[o.jsx("span",{children:"📝"})," Sample Conclusion"]}),o.jsx("button",{onClick:()=>Qe(`This alert is classified as a ${je||"[Verdict]"} based on the following findings:

1. The identified artifacts (${Re.map(ae=>ae.value).filter(ae=>ae).join(", ")||"[artifacts]"}) were analyzed and determined to be ${je==="True Positive"?"malicious":je==="False Positive"?"benign/legitimate":"inconclusive"}.

2. Impact Assessment: ${je==="True Positive"?"The threat was confirmed. Immediate containment measures were taken to prevent lateral movement.":"No malicious activity was confirmed. This appears to be legitimate activity."}

3. Recommended Actions: ${je==="True Positive"?"Continue monitoring the affected systems, review access logs, and consider password resets for affected accounts.":"No further action required. Alert can be safely closed."}`),className:"text-xs bg-infosec-accent/20 text-infosec-accent hover:bg-infosec-accent hover:text-white px-3 py-1 rounded transition font-medium",children:"Use Template"})]}),o.jsx("p",{className:"text-gray-500 text-xs font-mono leading-relaxed",children:'"This alert is classified as a [True Positive/False Positive] based on the following findings: The identified artifacts were analyzed and determined to be malicious/benign. Impact assessment shows [impact details]. Recommended actions: [containment steps taken or recommended]."'})]}),o.jsxs("div",{className:"mb-8",children:[o.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:"Final Conclusion"}),o.jsx("textarea",{value:Ie,onChange:ae=>Qe(ae.target.value),placeholder:"Write your final conclusion here...",className:"w-full bg-[#0e0f11] border border-gray-700 rounded-lg p-4 text-white h-48 focus:outline-none focus:border-infosec-accent font-mono text-sm leading-relaxed"})]}),o.jsxs("div",{className:"flex justify-between items-center border-t border-gray-800 pt-6",children:[o.jsx("button",{onClick:()=>Te(3),className:"px-6 py-3 bg-gray-700 hover:bg-gray-600 text-white font-bold rounded-lg transition",children:"Back"}),o.jsx("button",{onClick:nt,disabled:w||!Ie||!ke,className:"px-8 py-3 bg-green-600 hover:bg-green-700 text-white font-bold rounded-lg shadow-lg shadow-green-600/20 transition transform hover:scale-105 disabled:opacity-50 disabled:transform-none disabled:shadow-none flex items-center gap-2",children:w?"Submitting...":"✅ Final Submit"})]})]})]})}),["submitted","graded","closed"].includes((e.investigation_status||e.status||"").toLowerCase())&&o.jsxs("div",{className:"bg-[#1a1b1e] rounded-2xl border border-gray-800 mb-8 p-8 animate-fade-in shadow-xl",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8",children:[(()=>{var Be;let ae=e.verdict;if(!ae)try{const Me=typeof e.executive_summary=="string"?JSON.parse(e.executive_summary):e.executive_summary;ae=(Me==null?void 0:Me.verdict)||((Be=Me==null?void 0:Me.summary)==null?void 0:Be.verdict)||null}catch{ae=null}const _e=Me=>Me?Me.split("_").map(et=>et.charAt(0).toUpperCase()+et.slice(1).toLowerCase()).join(" "):"N/A",Pe=(Me=>{const et=(Me||"").toLowerCase();return et==="true_positive"||et==="true positive"?"red":et==="false_positive"||et==="false positive"?"orange":"green"})(ae);return o.jsxs("div",{className:`p-6 rounded-xl border flex items-center justify-between transition-colors ${Pe==="red"?"bg-red-500/5 border-red-500/20":Pe==="orange"?"bg-orange-500/5 border-orange-500/20":"bg-green-500/5 border-green-500/20"}`,children:[o.jsxs("div",{children:[o.jsx("span",{className:"block text-xs font-bold uppercase tracking-wider text-gray-400 mb-1",children:"Final Verdict"}),o.jsx("span",{className:`text-2xl font-bold ${Pe==="red"?"text-red-500":Pe==="orange"?"text-orange-500":"text-green-500"}`,children:_e(ae)})]}),o.jsx("div",{className:"text-4xl filter drop-shadow-md",children:Pe==="red"?"🚨":Pe==="orange"?"⚠️":"✅"})]})})(),o.jsxs("div",{className:"p-6 rounded-xl border border-gray-800/50 bg-[#0e0f11] flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("span",{className:"block text-xs font-bold uppercase tracking-wider text-gray-400 mb-1",children:"Investigation Score"}),o.jsx("span",{className:`text-3xl font-bold font-mono ${e.grade?e.grade>=70?"text-white":"text-gray-300":"text-gray-600"}`,children:e.grade!==null?e.grade:"..."})]}),o.jsx("div",{className:"text-3xl",children:e.grade!==null?e.grade>=90?"🏆":e.grade>=70?"⭐":"📝":"⏳"})]})]}),o.jsxs("div",{className:"mb-8",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("h3",{className:"text-lg font-bold text-white flex items-center gap-2",children:[o.jsx("span",{className:"w-1 h-6 bg-infosec-accent rounded-full"}),"Investigation Report"]}),o.jsxs("button",{onClick:()=>K(!0),className:"flex items-center gap-2 px-4 py-2 bg-blue-600 hover:bg-blue-500 text-white rounded-lg font-bold text-sm transition-colors shadow-lg shadow-blue-600/20",children:[o.jsx(li,{className:"w-4 h-4"}),"Download Report"]})]}),o.jsx("div",{className:"bg-[#0e0f11] p-8 rounded-xl border border-gray-800/80 shadow-inner",children:(()=>{var ae,_e,Fe;try{const Pe=typeof e.executive_summary=="string"?JSON.parse(e.executive_summary):e.executive_summary;if(Pe)return o.jsxs("div",{className:"space-y-4 text-sm",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"text-gray-500 font-bold uppercase text-xs w-24",children:"Verdict:"}),o.jsx("span",{className:"text-white font-medium",children:((ae=Pe.verdict)==null?void 0:ae.replace("_"," ").toUpperCase())||"N/A"})]}),((_e=Pe.checkedArtifacts)==null?void 0:_e.length)>0&&o.jsxs("div",{children:[o.jsxs("span",{className:"text-gray-500 font-bold uppercase text-xs block mb-2",children:["Artifacts Analyzed (",Pe.checkedArtifacts.length,"):"]}),o.jsx("div",{className:"flex flex-wrap gap-2",children:Pe.checkedArtifacts.map((Be,Me)=>{const wn=typeof Be=="object"&&Be!==null?Be.value?`[${Be.type||"?"}] ${Be.value}`:Be.name:Be;return o.jsx("span",{className:"px-2 py-1 bg-blue-500/10 border border-blue-500/20 rounded text-blue-400 text-xs font-mono",children:wn},Me)})})]}),((Fe=Pe.selectedActions)==null?void 0:Fe.length)>0&&o.jsxs("div",{children:[o.jsxs("span",{className:"text-gray-500 font-bold uppercase text-xs block mb-2",children:["Response Actions (",Pe.selectedActions.length,"):"]}),o.jsx("div",{className:"flex flex-wrap gap-2",children:Pe.selectedActions.map((Be,Me)=>o.jsx("span",{className:"px-2 py-1 bg-purple-500/10 border border-purple-500/20 rounded text-purple-400 text-xs font-medium uppercase",children:typeof Be=="object"?(Be==null?void 0:Be.name)||JSON.stringify(Be):String(Be).replace("_"," ")},Me))})]}),Pe.submitted_at&&o.jsxs("div",{className:"flex items-center gap-3 pt-2 border-t border-gray-800",children:[o.jsx("span",{className:"text-gray-500 font-bold uppercase text-xs w-24",children:"Submitted:"}),o.jsx("span",{className:"text-gray-400 text-xs",children:new Date(Pe.submitted_at).toLocaleString()})]})]})}catch(Pe){console.error("[AlertDetails] Error parsing executive_summary:",Pe)}return o.jsx("div",{className:"text-gray-500 italic",children:"No investigation data available."})})()})]}),(()=>{try{const ae=typeof e.executive_summary=="string"?JSON.parse(e.executive_summary):e.executive_summary;if(ae!=null&&ae.analysis_answers)return o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-8",children:[o.jsxs("div",{className:"p-4 rounded-lg bg-[#0e0f11] border border-gray-800/80",children:[o.jsx("span",{className:"block text-xs text-gray-500 uppercase font-bold mb-1 tracking-wider",children:"Identified Attack Category"}),o.jsx("span",{className:"text-white font-medium text-lg",children:ae.analysis_answers.attack_category||"N/A"})]}),o.jsxs("div",{className:"p-4 rounded-lg bg-[#0e0f11] border border-gray-800/80",children:[o.jsx("span",{className:"block text-xs text-gray-500 uppercase font-bold mb-1 tracking-wider",children:"Actions Taken"}),o.jsx("span",{className:"text-white font-medium",children:Array.isArray(ae.analysis_answers.action_taken)?ae.analysis_answers.action_taken.join(", "):ae.analysis_answers.action_taken||"N/A"})]})]})}catch{return null}})(),e.feedback&&o.jsxs("div",{className:"mt-8 pt-8 border-t border-gray-800",children:[o.jsx("h4",{className:"flex items-center gap-2 text-purple-400 font-bold mb-4 text-lg",children:"🤖 AI Feedback"}),o.jsx("div",{className:"bg-purple-900/10 border border-purple-500/20 p-6 rounded-xl text-gray-300 text-sm leading-relaxed whitespace-pre-wrap",children:typeof e.feedback=="object"?JSON.stringify(e.feedback,null,2):e.feedback})]}),(()=>{const ae=new Date(e.updated_at||e.closed_at||e.created_at),_e=new Date-ae<24*60*60*1e3;return e.is_reported?o.jsx("div",{className:"mt-6 flex justify-end",children:o.jsx("div",{className:"text-yellow-500 text-sm flex items-center gap-2 border border-yellow-500/30 bg-yellow-500/5 px-4 py-2 rounded-lg",children:"🚩 Report Received - Pending Review"})}):_e?o.jsx("div",{className:"mt-6 flex justify-end",children:o.jsx("button",{onClick:()=>O(!0),className:"text-gray-400 hover:text-white text-sm flex items-center gap-2 transition-colors border border-gray-700 hover:border-gray-500 px-4 py-2 rounded-lg",children:"🚩 Report Issue / Appeal Grade"})}):null})()]}),p&&o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm",children:o.jsxs("div",{className:"bg-[#1a1b1e] rounded-xl border border-gray-700 p-6 w-full max-w-md shadow-2xl animate-fade-in-up",children:[o.jsx("h3",{className:"text-xl font-bold text-white mb-4",children:"Report Investigation Issue"}),o.jsx("p",{className:"text-gray-400 text-sm mb-4",children:"Please explain why you are reporting this investigation or appealing the grade. An admin will review it."}),o.jsx("textarea",{className:"w-full bg-[#0e0f11] text-gray-200 border border-gray-700 rounded-lg p-3 text-sm focus:border-infosec-accent focus:ring-1 focus:ring-infosec-accent mb-4",rows:4,placeholder:"Enter your reason here...",value:N,onChange:ae=>T(ae.target.value)}),o.jsxs("div",{className:"flex justify-end gap-3",children:[o.jsx("button",{onClick:()=>O(!1),className:"px-4 py-2 rounded-lg text-gray-400 hover:text-white hover:bg-gray-800",children:"Cancel"}),o.jsx("button",{onClick:xt,disabled:w||!N.trim(),className:"px-4 py-2 rounded-lg bg-red-600 hover:bg-red-700 text-white font-bold disabled:opacity-50",children:w?"Submitting...":"Submit Report"})]})]})}),o.jsx(ac,{isOpen:C,onClose:()=>R(!1),onConfirm:de,title:"Unassign Alert?",message:"Are you sure you want to unassign this alert? It will be removed from your active investigations.",confirmText:"Unassign",isDanger:!0}),o.jsx(ac,{isOpen:ne,onClose:()=>j(!1),onConfirm:ye,title:"Retry Investigation?",message:"Are you sure you want to start over? All your previous answers/progress for this alert will be reset.",confirmText:"Rewrite & Retry",isDanger:!0}),Ee&&o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm animate-fade-in",children:o.jsxs("div",{className:"bg-[#1a1b1e] border border-gray-700 rounded-2xl w-full max-w-lg p-0 relative overflow-hidden text-center shadow-2xl transform transition-all scale-100 max-h-[90vh] overflow-y-auto flex flex-col",children:[o.jsx("div",{className:`absolute top-0 left-0 w-full h-2 bg-gradient-to-r ${Ee.grade>=60?"from-green-500 to-emerald-400":"from-red-500 to-orange-500"}`}),o.jsxs("div",{className:"p-8 pb-4",children:[o.jsx("div",{className:`w-20 h-20 rounded-full flex items-center justify-center mx-auto mb-4 border shadow-[0_0_30px_rgba(34,197,94,0.2)] ${Ee.grade>=60?"bg-green-500/10 border-green-500/20 shadow-green-500/20":"bg-red-500/10 border-red-500/20 shadow-red-500/20"}`,children:o.jsx("span",{className:"text-4xl",children:Ee.grade>=60?"🏆":"💀"})}),o.jsx("h2",{className:"text-2xl font-bold text-white mb-1",children:Ee.grade>=60?"Excellent Work!":"Mission Failed"}),o.jsx("p",{className:"text-gray-400 text-sm mb-4",children:Ee.grade>=60?"You successfully neutralized the threat.":"Your analysis was incorrect."}),o.jsxs("div",{className:"bg-[#0e0f11] rounded-xl p-4 border border-gray-800 inline-block min-w-[150px]",children:[o.jsx("div",{className:"text-xs text-gray-500 uppercase tracking-wider font-bold mb-1",children:"Final Grade"}),o.jsxs("div",{className:`text-5xl font-mono font-bold text-transparent bg-clip-text bg-gradient-to-r ${Ee.grade>=60?"from-green-400 to-emerald-500":"from-red-400 to-orange-500"}`,children:[Ee.grade,"%"]})]})]}),o.jsxs("div",{className:"px-8 pb-4 overflow-y-auto flex-1 text-left space-y-3",children:[Ee.grading_breakdown&&Ee.grading_breakdown.sections?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:`p-4 rounded-xl border ${Ee.grading_breakdown.sections.verdict.status==="pass"?"bg-green-500/5 border-green-500/20":"bg-red-500/5 border-red-500/20"}`,children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("h3",{className:`font-bold text-sm flex items-center gap-2 ${Ee.grading_breakdown.sections.verdict.status==="pass"?"text-green-400":"text-red-400"}`,children:Ee.grading_breakdown.sections.verdict.status==="pass"?"✅ Correct Verdict":"❌ Incorrect Verdict"}),o.jsxs("span",{className:"text-xs font-mono text-gray-500",children:["+",Ee.grading_breakdown.sections.verdict.score,"/40"]})]}),Ee.grading_breakdown.sections.verdict.feedback&&o.jsx("p",{className:"text-xs text-gray-400",children:Ee.grading_breakdown.sections.verdict.feedback})]}),o.jsxs("div",{className:`p-4 rounded-xl border ${Ee.grading_breakdown.sections.artifacts.status==="pass"?"bg-blue-500/5 border-blue-500/20":"bg-orange-500/5 border-orange-500/20"}`,children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsxs("h3",{className:"font-bold text-sm text-gray-200 flex items-center gap-2",children:[o.jsx("span",{children:"🔍"})," Critical Artifacts"]}),o.jsxs("span",{className:"text-xs font-mono text-gray-500",children:["+",Ee.grading_breakdown.sections.artifacts.score,"/30"]})]}),Ee.grading_breakdown.sections.artifacts.missed_items&&Ee.grading_breakdown.sections.artifacts.missed_items.length>0?o.jsxs("div",{className:"mt-2 text-xs",children:[o.jsx("span",{className:"text-red-400 font-bold block mb-1",children:"Missed Items:"}),o.jsx("ul",{className:"list-disc list-inside space-y-1 text-gray-400",children:Ee.grading_breakdown.sections.artifacts.missed_items.map((ae,_e)=>o.jsx("li",{children:ae},_e))})]}):o.jsx("div",{className:"flex items-center gap-2 text-xs text-green-400",children:o.jsx("span",{children:"✓ All critical artifacts identified"})})]}),o.jsxs("div",{className:`p-4 rounded-xl border ${Ee.grading_breakdown.sections.actions.status==="pass"?"bg-purple-500/5 border-purple-500/20":"bg-yellow-500/5 border-yellow-500/20"}`,children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsxs("h3",{className:"font-bold text-sm text-gray-200 flex items-center gap-2",children:[o.jsx("span",{children:"🛡️"})," Response Actions"]}),o.jsxs("span",{className:"text-xs font-mono text-gray-500",children:["+",Ee.grading_breakdown.sections.actions.score,"/30"]})]}),Ee.grading_breakdown.sections.actions.missed_items&&Ee.grading_breakdown.sections.actions.missed_items.length>0?o.jsxs("div",{className:"mt-2 text-xs",children:[o.jsx("span",{className:"text-red-400 font-bold block mb-1",children:"Missed Actions:"}),o.jsx("ul",{className:"list-disc list-inside space-y-1 text-gray-400",children:Ee.grading_breakdown.sections.actions.missed_items.map((ae,_e)=>o.jsx("li",{children:ae},_e))})]}):o.jsx("div",{className:"flex items-center gap-2 text-xs text-green-400",children:o.jsx("span",{children:"✓ Correct response actions taken"})})]})]}):null,Ee.feedback&&o.jsxs("div",{className:`border rounded-xl p-4 text-left ${Ee.grade>=60?"bg-green-500/5 border-green-500/20":"bg-red-500/5 border-red-500/30"}`,children:[o.jsx("h4",{className:`font-bold text-sm mb-2 flex items-center gap-2 ${Ee.grade>=60?"text-green-400":"text-red-400"}`,children:"🤖 Playbook Evaluation Feedback"}),o.jsx("p",{className:"text-gray-300 text-sm leading-relaxed whitespace-pre-wrap font-medium",children:Ee.feedback})]})]}),o.jsxs("div",{className:"p-8 pt-4 space-y-3 bg-[#1a1b1e]",children:[Ee.next_alert_id?o.jsx("button",{onClick:()=>{const ae=Ee.next_alert_id;ut(null),window.location.href=`/alerts/${ae}`},className:"w-full py-3 bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 text-white font-bold rounded-xl transition-all shadow-lg shadow-blue-600/20 hover:shadow-blue-600/40 transform hover:-translate-y-1",children:"🚀 Start Next Mission"}):null,o.jsxs("div",{className:"flex gap-3",children:[Ee.grade<60&&o.jsx("button",{onClick:()=>{ut(null),j(!0)},className:"flex-1 py-3 bg-red-600 hover:bg-red-500 text-white font-bold rounded-xl transition shadow-lg shadow-red-600/20 hover:shadow-red-600/40",children:"🔄 Retry"}),o.jsx("button",{onClick:()=>t?t():h("/dashboard"),className:`flex-1 py-3 ${Ee.grade>=60&&!Ee.next_alert_id?"bg-gradient-to-r from-green-600 to-emerald-600 hover:from-green-500 hover:to-emerald-500 text-white":"bg-gray-800 hover:bg-gray-700 text-gray-300"} font-bold rounded-xl transition-all shadow-lg transform hover:-translate-y-1`,children:Ee.next_alert_id?"Dashboard":Ee.grade>=60?"Continue":"Abort"})]}),Ee.grade>=60&&o.jsxs("button",{onClick:()=>K(!0),className:"w-full mt-3 py-2 bg-blue-600/20 hover:bg-blue-600/30 border border-blue-500/30 text-blue-400 font-bold rounded-xl transition-colors flex items-center justify-center gap-2",children:[o.jsx(li,{className:"w-4 h-4"}),"Generate Investigation Report"]})]})]})}),o.jsx(q1,{isOpen:L,onClose:()=>K(!1),alert:e,verdict:(()=>{var ae,_e,Fe;if(((Fe=(_e=(ae=Ee==null?void 0:Ee.grading_breakdown)==null?void 0:ae.sections)==null?void 0:_e.verdict)==null?void 0:Fe.status)==="pass")try{const Pe=typeof e.playbook_solution=="string"?JSON.parse(e.playbook_solution):e.playbook_solution;return(Pe==null?void 0:Pe.expected_verdict)||"true_positive"}catch{return"true_positive"}try{const Pe=typeof e.executive_summary=="string"?JSON.parse(e.executive_summary):e.executive_summary;return(Pe==null?void 0:Pe.verdict)||"unknown"}catch{return"unknown"}})(),conclusion:(Ee==null?void 0:Ee.feedback)||e.feedback||"",artifacts:(()=>{var ae,_e,Fe,Pe;if((Pe=(Fe=(_e=(ae=Ee==null?void 0:Ee.grading_breakdown)==null?void 0:ae.sections)==null?void 0:_e.artifacts)==null?void 0:Fe.caught_items)!=null&&Pe.length)return Ee.grading_breakdown.sections.artifacts.caught_items.map(Be=>{const[Me,et]=Be.split(": ");return{type:Me,value:et,score:"Confirmed"}});try{const Be=typeof e.executive_summary=="string"?JSON.parse(e.executive_summary):e.executive_summary;return((Be==null?void 0:Be.checkedArtifacts)||[]).map(et=>et.startsWith("ip-")?{type:"IP",value:et.slice(3),score:"Confirmed"}:et.startsWith("hash-")?{type:"Hash",value:et.slice(5),score:"Confirmed"}:et.startsWith("domain-")?{type:"Domain",value:et.slice(7),score:"Confirmed"}:et.startsWith("email-")?{type:"Email",value:et.slice(6),score:"Confirmed"}:{type:"Artifact",value:et,score:"Confirmed"})}catch{return[]}})(),grade:(Ee==null?void 0:Ee.grade)??e.grade})]})," ",o.jsx(r2,{isOpen:P,onClose:()=>G(!1),operationId:$})]})},G2=()=>{const{id:e}=cd(),t=ul(),{user:r}=yu(),[n,s]=it.useState(null),[a,h]=it.useState(!0),[c,d]=it.useState(null),g=async()=>{try{const S=localStorage.getItem("token"),p=await fetch(`${rn}/api/alerts/${e}`,{headers:{Authorization:`Bearer ${S}`}});if(!p.ok)throw new Error("Alert not found");const O=await p.json();s(O)}catch(S){d(S.message)}finally{h(!1)}};it.useEffect(()=>{e&&g()},[e]);const m=async S=>{try{const p=localStorage.getItem("token"),O=await fetch(`${rn}/api/alerts/${S}/assign`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${p}`},body:JSON.stringify({userId:r.id})}),N=await O.json();O.ok?(jt.success("Alert assigned successfully"),g()):jt.error(N.message||"Failed to assign alert")}catch(p){console.error("Error assigning alert:",p),jt.error("Error connecting to server")}},w=S=>{s(S)};return a?o.jsx("div",{className:"text-white p-8 text-center",children:"Loading..."}):c?o.jsxs("div",{className:"text-red-500 p-8 text-center",children:["Error: ",c]}):o.jsx("div",{className:"w-full h-full",children:o.jsx(s2,{alert:n,onBack:()=>{const S=new URLSearchParams(window.location.search),p=S.get("return_to"),O=S.get("mission_id");t(p==="mission"&&O?`/dashboard?view=mission&id=${O}`:p==="operations"?"/dashboard?view=operations":"/dashboard")},onAssign:m,userId:r==null?void 0:r.id,onUpdate:w})})};export{G2 as default};
