zcode-app-cli 3.16.2-38 → 3.16.3-40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/LICENSES/README.md +1 -1
  2. package/README.md +19 -4
  3. package/bin/zcode.js +47 -16
  4. package/docs/CONFIGURATION.md +2 -1
  5. package/docs/CONFIGURATION.zh-CN.md +2 -1
  6. package/docs/THIRD_PARTY_CONTENT.md +2 -2
  7. package/package.json +2 -2
  8. package/vendor/cli-config.cjs +21 -0
  9. package/vendor/extraction.json +9 -4
  10. package/vendor/node_modules/@zcode/tui/dist/index.js +79 -22
  11. package/vendor/packages/documents-plugin/.zcode-plugin/plugin.json +3 -2
  12. package/vendor/packages/documents-plugin/dist/server.mjs +201 -152
  13. package/vendor/packages/documents-plugin/dist/ui/bundle-0.txt +1 -1
  14. package/vendor/packages/documents-plugin/dist/ui/panel.html +1 -1
  15. package/vendor/packages/documents-plugin/package.json +1 -1
  16. package/vendor/packages/node-repl-host/dist/mcp/server.js +1 -1
  17. package/vendor/packages/pdf-plugin/.zcode-plugin/plugin.json +3 -2
  18. package/vendor/packages/pdf-plugin/dist/server.mjs +201 -152
  19. package/vendor/packages/pdf-plugin/dist/ui/bundle-0.txt +1 -1
  20. package/vendor/packages/pdf-plugin/dist/ui/panel.html +1 -1
  21. package/vendor/packages/pdf-plugin/package.json +1 -1
  22. package/vendor/packages/presentations-plugin/.zcode-plugin/plugin.json +3 -2
  23. package/vendor/packages/presentations-plugin/dist/server.mjs +201 -152
  24. package/vendor/packages/presentations-plugin/dist/ui/bundle-0.txt +1 -1
  25. package/vendor/packages/presentations-plugin/dist/ui/panel.html +1 -1
  26. package/vendor/packages/presentations-plugin/package.json +1 -1
  27. package/vendor/packages/spreadsheets-plugin/.zcode-plugin/plugin.json +3 -2
  28. package/vendor/packages/spreadsheets-plugin/dist/server.mjs +201 -152
  29. package/vendor/packages/spreadsheets-plugin/dist/ui/bundle-0.txt +1 -1
  30. package/vendor/packages/spreadsheets-plugin/dist/ui/panel.html +1 -1
  31. package/vendor/packages/spreadsheets-plugin/package.json +1 -1
  32. package/vendor/zcode.cjs +1033 -1031
  33. package/zcode-runtime.lock.json +3 -3
@@ -113,7 +113,7 @@ Boolean requesting whether a visible border and background is provided by the ho
113
113
  - omitted: host decides border`)}),cge=Q.object({method:Q.literal("ui/request-display-mode"),params:Q.object({mode:Xh.describe("The display mode being requested.")})}),Hae=Q.object({mode:Xh.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),Vae=Q.union([Q.literal("model"),Q.literal("app")]).describe("Tool visibility scope - who can access the tool."),uge=Q.object({resourceUri:Q.string().optional(),visibility:Q.array(Vae).optional().describe(`Who can access this tool. Default: ["model", "app"]
114
114
  - "model": Tool visible to and callable by the agent
115
115
  - "app": Tool callable by the app from this server only`),csp:Q.never().optional(),permissions:Q.never().optional()}),dge=Q.object({mimeTypes:Q.array(Q.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),pge=Q.object({method:Q.literal("ui/download-file"),params:Q.object({contents:Q.array(Q.union([g8,y8])).describe("Resource contents to download \u2014 embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),fge=Q.object({method:Q.literal("ui/message"),params:Q.object({role:Q.literal("user").describe('Message role, currently only "user" is supported.'),content:Q.array(os).describe("Message content blocks (text, image, etc.).")})}),mge=Q.object({method:Q.literal("ui/notifications/sandbox-resource-ready"),params:Q.object({html:Q.string().describe("HTML content to load into the inner iframe."),sandbox:Q.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:GT.optional().describe("CSP configuration from resource metadata."),permissions:ZT.optional().describe("Sandbox permissions from resource metadata.")})}),qae=Q.object({method:Q.literal("ui/notifications/tool-result"),params:g7.describe("Standard MCP tool execution result.")}),wW=Q.object({toolInfo:Q.object({id:Q4.optional().describe("JSON-RPC id of the tools/call request."),tool:h7.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:$ae.optional().describe("Current color theme preference."),styles:Dae.optional().describe("Style configuration for theming the app."),displayMode:Xh.optional().describe("How the UI is currently displayed."),availableDisplayModes:Q.array(Xh).optional().describe("Display modes the host supports."),containerDimensions:Q.union([Q.object({height:Q.number().describe("Fixed container height in pixels.")}),Q.object({maxHeight:Q.union([Q.number(),Q.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(Q.union([Q.object({width:Q.number().describe("Fixed container width in pixels.")}),Q.object({maxWidth:Q.union([Q.number(),Q.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
116
- container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:Q.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:Q.string().optional().describe("User's timezone in IANA format."),userAgent:Q.string().optional().describe("Host application identifier."),platform:Q.union([Q.literal("web"),Q.literal("desktop"),Q.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:Q.object({touch:Q.boolean().optional().describe("Whether the device supports touch input."),hover:Q.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:Q.object({top:Q.number().describe("Top safe area inset in pixels."),right:Q.number().describe("Right safe area inset in pixels."),bottom:Q.number().describe("Bottom safe area inset in pixels."),left:Q.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),Wae=Q.object({method:Q.literal("ui/notifications/host-context-changed"),params:wW.describe("Partial context update containing only changed fields.")}),hge=Q.object({method:Q.literal("ui/update-model-context"),params:Q.object({content:Q.array(os).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:Q.record(Q.string(),Q.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),gge=Q.object({method:Q.literal("ui/initialize"),params:Q.object({appInfo:ns.describe("App identification (name and version)."),appCapabilities:Fae.describe("Features and capabilities this app provides."),protocolVersion:Q.string().describe("Protocol version this app supports.")})}),Gae=Q.object({protocolVersion:Q.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:ns.describe("Host application identification and version."),hostCapabilities:Uae.describe("Features and capabilities provided by the host."),hostContext:wW.describe("Rich context about the host environment.")}).passthrough(),Zae={target:"draft-2020-12"};async function SW(e,t){let n=e["~standard"];if(n.jsonSchema)return n.jsonSchema[t](Zae);throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function xW(e,t,n=""){let o=await e["~standard"].validate(t);if(o.issues){let r=o.issues.map(i=>{let a=i.path?.map(s=>typeof s=="object"?s.key:s).join(".");return a?`${a}: ${i.message}`:i.message}).join("; ");throw Error(n+r)}return o.value}function _W(e,t=document.documentElement){for(let[n,o]of Object.entries(e))o!==void 0&&t.style.setProperty(n,o)}function Xae(e,t){let n={...e,...t};return t.experimental!==void 0&&(n.experimental={...e.experimental,...t.experimental}),t.tools!==void 0&&(n.tools={...e.tools,...t.tools}),n}var rw=class e extends VT{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new qT;_methods=new WT;setRequestHandler=(...t)=>{let[n,...o]=vW("request",t)??t;this._methods.claim(n,"setRequestHandler"),super.setRequestHandler.call(this,n,...o)};setNotificationHandler=(...t)=>{let[n,...o]=vW("notification",t)??t;this._methods.claim(n,"setNotificationHandler"),super.setNotificationHandler.call(this,n,...o)};removeRequestHandler=t=>{this._methods.release(t),super.removeRequestHandler(t)};removeNotificationHandler=t=>{this._methods.release(t),super.removeNotificationHandler(t)};replaceRequestHandler=(t,...n)=>{this._methods.replace(t),super.setRequestHandler.call(this,t,...n)};_assertInitialized(t){if(this._initializedSent)return;let n=`[ext-apps] App.${t}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(n);console.warn(`${n}. This will throw in a future release.`)}eventSchemas={toolinput:Iae,toolinputpartial:Nae,toolresult:qae,toolcancelled:Oae,hostcontextchanged:Wae};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(t,n){n&&this._assertHandlerTiming(t),this._ensureEventSlot(t),this._events.setHandler(t,n)}addEventListener(t,n){this._assertHandlerTiming(t),this._ensureEventSlot(t),this._events.addEventListener(t,n)}removeEventListener(t,n){this._events.removeEventListener(t,n)}_ensureEventSlot(t){if(this._registeredEvents.has(t))return;let n=this.eventSchemas[t];if(!n)throw Error(`Unknown event: ${String(t)}`);this.setNotificationHandler(n.shape.method.value,{params:n.shape.params},o=>{let r=o;t==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...r}),this._events.dispatch(t,r)}),this._registeredEvents.add(t)}getEventHandler(t){return this._events.getHandler(t)}warnIfRequestHandlerReplaced(t,n,o){n&&o&&console.warn(`[MCP Apps] ${t} handler replaced. Previous handler will no longer be called.`)}constructor(t,n={},o={autoResize:!0}){super(o),this._appInfo=t,this._appCapabilities=n,this.options=o,this._methods.replace("notifications/cancelled"),this._methods.replace("notifications/progress"),!o.allowUnsafeEval&&Q.config({jitless:!0}),this.replaceRequestHandler("ping",r=>(console.log("Received ping:",r.params),{})),this.setEventHandler("hostcontextchanged",void 0)}buildContext(t){return t}registerAppCapabilities(t){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._appCapabilities=Xae(this._appCapabilities,t)}registerTool(t,n,o){if(this._registeredTools[t])throw Error(`Tool ${t} is already registered`);let r=this,i=()=>{r._initializedSent&&r._appCapabilities.tools?.listChanged&&r.sendToolListChanged()},a=n.inputSchema!==void 0,s={title:n.title,description:n.description,inputSchema:n.inputSchema,outputSchema:n.outputSchema,annotations:n.annotations,_meta:n._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(l){Object.assign(this,l),i()},remove(){r._registeredTools[t]===s&&(delete r._registeredTools[t],i())},handler:async(l,c)=>{if(!s.enabled)throw Error(`Tool ${t} is disabled`);let u;if(a){let d=s.inputSchema,p=d?await xW(d,l??{},`Invalid input for tool ${t}: `):l??{};u=await o(p,c)}else u=await o(c);return s.outputSchema&&!u.isError&&(u.structuredContent=await xW(s.outputSchema,u.structuredContent,`Invalid output for tool ${t}: `)),u}};return this._registeredTools[t]=s,!this._appCapabilities.tools&&!this.transport&&this.registerAppCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),s}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(t,n)=>{let o=this._registeredTools[t.name];if(!o)throw Error(`Tool ${t.name} not found`);return o.handler(t.arguments,n)},this.onlisttools=async(t,n)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([o,r])=>r.enabled).map(async([o,r])=>{let i={name:o,title:r.title,description:r.description,inputSchema:r.inputSchema?await SW(r.inputSchema,"input"):{type:"object",properties:{}}};return r.outputSchema&&(i.outputSchema=await SW(r.outputSchema,"output")),r.annotations&&(i.annotations=r.annotations),r._meta&&(i._meta=r._meta),i}))}))}async sendToolListChanged(t={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:t})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(t){this.setEventHandler("toolinput",t)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(t){this.setEventHandler("toolinputpartial",t)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(t){this.setEventHandler("toolresult",t)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(t){this.setEventHandler("toolcancelled",t)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(t){this.setEventHandler("hostcontextchanged",t)}_onteardown;get onteardown(){return this._onteardown}set onteardown(t){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,t),this._onteardown=t,this.replaceRequestHandler("ui/resource-teardown",{params:Bae.shape.params,result:jae},(n,o)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(n,o)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(t){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,t),this._oncalltool=t,this.replaceRequestHandler("tools/call",(n,o)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(n.params,o)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(t){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,t),this._onlisttools=t,this.replaceRequestHandler("tools/list",(n,o)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(n.params,o)})}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${t})`);break}}assertRequestHandlerCapability(t){switch(t){case"tools/call":case"tools/list":if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${t})`);return;default:return}}assertNotificationCapability(t){}async callServerTool(t,n){if(this._assertInitialized("callServerTool"),typeof t=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${t}"). Did you mean: callServerTool({ name: "${t}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:t},{onprogress:()=>{},resetTimeoutOnProgress:!0,...n})}async readServerResource(t,n){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:t},n)}async listServerResources(t,n){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:t},n)}async createSamplingMessage(t,n){return this._assertInitialized("createSamplingMessage"),await this.request({method:"sampling/createMessage",params:t},n)}sendMessage(t,n){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:t},Aae,n)}sendLog(t){return this.notification({method:"notifications/message",params:t})}updateModelContext(t,n){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:t},m7,n)}openLink(t,n){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:t},Eae,n)}sendOpenLink=this.openLink;downloadFile(t,n){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:t},Tae,n)}requestTeardown(t={}){return this.notification({method:"ui/notifications/request-teardown",params:t})}requestDisplayMode(t,n){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:t},Hae,n)}sendSizeChanged(t){return this.notification({method:"ui/notifications/size-changed",params:t})}setupSizeChangedNotifications(){let t=!1,n=0,o=0,r=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1;let a=document.documentElement,s=a.style.height;a.style.height="max-content";let l=Math.ceil(a.getBoundingClientRect().height);a.style.height=s;let c=Math.ceil(window.innerWidth);(c!==n||l!==o)&&(n=c,o=l,this.sendSizeChanged({width:c,height:l}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(t=new Zh(window.parent,window.parent),n){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1;try{await super.connect(t);let o=await this.request({method:"ui/initialize",params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:kae}},Gae,n);if(o===void 0)throw Error(`Server sent invalid initialize result: ${o}`);this._hostCapabilities=o.hostCapabilities,this._hostInfo=o.hostInfo,this._hostContext=o.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(o){throw this.close(),o}}};var or={name:"spreadsheets",version:"0.2.0",title:{en:"Spreadsheets","zh-CN":"\u7535\u5B50\u8868\u683C"},kinds:["xlsx"]};var PW=or.version,CW=or.name,Pge=or.name,Cge=`ui://${or.name}/panel.html`,XT=`ui://${or.name}/assets/`,kW=`ui://${or.name}/file/`;var e5=or.kinds,Kh=100*1024*1024,kge=512*1024*1024,YT=4*1024*1024,Rge=24*1024,Yh=class extends Error{constructor(n,o){super(o);this.code=n;this.name="OfficeError"}};function Jh(e){let t=e.toLowerCase().match(/\.([a-z]+)$/)?.[1];return e5.includes(t??"")?t:null}var Yae={en:{sep:", ",and:" and ",or:" or "},"zh-CN":{sep:"\u3001",and:"\u548C",or:"\u6216"}};function p4(e,t="en",n="and"){let o=Yae[t];if(e.length<2)return e.join("");let r=e[e.length-1],i=t==="zh-CN"&&/^[\x20-\x7e]/.test(r)?` ${o[n]} `:o[n];return`${e.slice(0,-1).join(o.sep)}${i}${r}`}function _8(e="en",t="and"){return p4(e5.map(n=>`.${n}`),e,t)}var as=(e,t)=>new Yh("invalid_anchor",`Cannot read location "${e}". ${t}`),ss={docx:"Use p:N, p:N-M, t:N or t:N/rRcC.",pptx:"Use slide:N, slide:N-M or slide:N/shape:ID.",pdf:"Use page:N or page:N-M.",xlsx:"Use Sheet, Sheet!A1 or Sheet!A1:C9 (quote names with spaces: 'My sheet'!A1)."};function KT(e,t,n){if(!t)throw as(e,ss[n]);let o=Number(t[1]),r=t[2]===void 0?o:Number(t[2]);if(!(o>=1)||!(r>=o)||r>1e6)throw as(e,ss[n]);return{from:o,to:r}}function Kae(e){let t="";for(let n=e;n>0;n=Math.floor((n-1)/26))t=String.fromCharCode(65+(n-1)%26)+t;return t}function JT(e){let t=/^\$?([A-Za-z]{1,3})\$?(\d{1,7})$/.exec(e);if(!t)return null;let n=0;for(let r of t[1].toUpperCase())n=n*26+(r.charCodeAt(0)-64);let o=Number(t[2]);return o<1||o>1048576||n>16384?null:{row:o,col:n}}var ow=e=>`${Kae(e.col)}${e.row}`;function Jae(e){return/^[A-Za-z_À-￿][\w.À-￿]*$/.test(e)&&!JT(e)?e:`'${e.replace(/'/g,"''")}'`}function Qae(e){let t,n;if(e.startsWith("'")){let s=1;for(t="";s<e.length;s++)if(e[s]==="'")if(e[s+1]==="'")t+="'",s++;else break;else t+=e[s];if(s>=e.length||(n=e.slice(s+1),n&&!n.startsWith("!")))throw as(e,ss.xlsx);n=n.slice(1)}else{let s=e.lastIndexOf("!");t=s<0?e:e.slice(0,s),n=s<0?"":e.slice(s+1)}if(!t||t.length>64)throw as(e,ss.xlsx);if(!n)return{kind:"xlsx",sheet:t};let[o,r=o]=n.split(":"),i=JT(o),a=JT(r);if(!i||!a)throw as(e,ss.xlsx);return{kind:"xlsx",sheet:t,range:{start:{row:Math.min(i.row,a.row),col:Math.min(i.col,a.col)},end:{row:Math.max(i.row,a.row),col:Math.max(i.col,a.col)}}}}function QT(e,t){let n=t.trim();if(!n||n.length>300)throw as(t,ss[e]);switch(e){case"docx":{let o=/^t:(\d+)(?:\/r(\d+)c(\d+))?$/i.exec(n);if(o){let r=Number(o[1]);if(r<1)throw as(n,ss.docx);if(o[2]===void 0)return{kind:e,type:"table",table:r};let i={row:Number(o[2]),col:Number(o[3])};if(i.row<1||i.col<1)throw as(n,ss.docx);return{kind:e,type:"table",table:r,cell:i}}return{kind:e,type:"paragraph",...KT(n,/^p:(\d+)(?:-(?:p:)?(\d+))?$/i.exec(n),e)}}case"pptx":{let o=/^slide:(\d+)\/shape:([\w-]{1,32})$/i.exec(n);if(o){let r=Number(o[1]);if(r<1)throw as(n,ss.pptx);return{kind:e,from:r,to:r,shape:o[2]}}return{kind:e,...KT(n,/^slide:(\d+)(?:-(?:slide:)?(\d+))?$/i.exec(n),e)}}case"pdf":return{kind:e,...KT(n,/^page:(\d+)(?:-(?:page:)?(\d+))?$/i.exec(n),e)};case"xlsx":return Qae(n)}}function Ru(e){let t=(n,o,r)=>o===r?`${n}:${o}`:`${n}:${o}-${r}`;switch(e.kind){case"docx":return e.type==="paragraph"?t("p",e.from,e.to):e.cell?`t:${e.table}/r${e.cell.row}c${e.cell.col}`:`t:${e.table}`;case"pptx":return e.shape?`slide:${e.from}/shape:${e.shape}`:t("slide",e.from,e.to);case"pdf":return t("page",e.from,e.to);case"xlsx":{let n=Jae(e.sheet);if(!e.range)return n;let{start:o,end:r}=e.range,i=ow(o),a=ow(r);return i===a?`${n}!${i}`:`${n}!${i}:${a}`}}}function RW(e){let t=/^(.*?\.(?:docx|xlsx|pptx|pdf))(?:#(.*))?$/i.exec(e.trim());if(!t)throw new Yh("invalid_anchor",`"${e}" is not a document anchor. Use <path>.docx|.xlsx|.pptx|.pdf optionally followed by #<location>.`);return{path:t[1],at:t[2]?.trim()?t[2].trim():null}}function Qh(e,t){return t?`${e}#${t}`:e}var $W=e=>e>=55296&&e<=56319,zW=e=>e>=56320&&e<=57343;function MW(e,t,n=e.length){let o=Math.max(0,Math.min(t,e.length)),r=Math.max(o,Math.min(n,e.length));return o>0&&zW(e.charCodeAt(o))&&$W(e.charCodeAt(o-1))&&o--,r<e.length&&zW(e.charCodeAt(r))&&$W(e.charCodeAt(r-1))&&r--,e.slice(o,r)}var e4e=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,aw=e=>e.replace(e4e,"\uFFFD");function iw(e){return typeof e=="string"?aw(e):Array.isArray(e)?e.map(t=>iw(t)):e&&typeof e=="object"&&Object.getPrototypeOf(e)===Object.prototype?Object.fromEntries(Object.entries(e).map(([t,n])=>[t,iw(n)])):e}var EW=`${or.name}:windows:v1`,t4e=128;function TW(e){try{let t=JSON.parse(e.getItem(EW)??"{}");return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function eA(e,t){let n=TW(e)[t];return!n||typeof n!="object"?{}:{...typeof n.path=="string"?{path:n.path}:{},...Array.isArray(n.recent)?{recent:n.recent.filter(o=>typeof o?.path=="string"&&Jh(o.path)===o.kind)}:{}}}function AW(e,t,n){try{let o=TW(e),r={...eA(e,t),...n};delete o[t],o[t]=r;for(let i of Object.keys(o).slice(0,-t4e))delete o[i];e.setItem(EW,JSON.stringify(o))}catch{}}var $u=e=>e.filter(([t])=>e5.includes(t)).map(([,t])=>t),n4e={docx:"Word",xlsx:"Excel",pptx:"PowerPoint",pdf:"PDF"},IW=e5.filter(e=>e!=="pdf"),NW=[...IW.length===3?["Office"]:IW.map(e=>n4e[e]),...e5.includes("pdf")?["PDF"]:[]],eg=or.title.en,Lge=(()=>{let e=p4(NW,"en","or");return`${/^[AEIOU]/.test(e)?"an":"a"} ${e} file`})(),Dge=`${p4(NW)} files`,Bge=_8("en","or"),jge=$u([["docx","report.docx#p:12"],["xlsx","model.xlsx#Revenue!B2:F9"],["pptx","deck.pptx#slide:3"],["pdf","paper.pdf#page:5"]]).join(", "),Uge=$u([["docx","p:12"],["pptx","slide:3"],["pdf","page:5"],["xlsx","Revenue!B2:F9"]]).join(", "),Fge=$u([["docx","Word paragraphs and tables (markdown)"],["xlsx","spreadsheet cells as a grid with formulas"],["pptx","slides with their shapes and speaker notes"],["pdf","PDF page text"]]).join(", "),Hge=p4($u([["docx","paragraph"],["xlsx","cell range"],["pptx","slide"],["pptx","shape"],["pdf","page"]]),"en","or"),Vge=p4($u([["pdf","PDF pages"],["docx","long paragraphs"]]))||"long passages",OW=p4($u([["pptx","deck.pptx#slide:3"],["pdf","paper.pdf#page:2"],["docx","report.docx#p:12"],["xlsx","model.xlsx#Revenue!A1:H30"]]),"en","or");var LW=[{name:"capture_view",title:`Capture ${eg} view`,description:`Take a picture of a rendered document location in the ${eg} panel so you can see layout, charts, images and formatting that text extraction misses. Pass an anchor such as ${OW} (the document must be open in the panel; call open_document first), or omit it to capture what the user currently sees.`,inputSchema:{type:"object",properties:{anchor:{type:"string",maxLength:1200,description:"Location to capture; defaults to the visible view."},maxWidth:{type:"integer",minimum:320,maximum:2e3,description:"Maximum image width in pixels (default 1600)."}},additionalProperties:!1},annotations:{readOnlyHint:!0,idempotentHint:!0}}];function r4e(){let e=crypto.randomUUID(),t=()=>n.getHostCapabilities()?.experimental?.["zcode/surface"]?.stateKey??e,n=new rw({name:CW,version:PW},{tools:{listChanged:!0},availableDisplayModes:["inline","fullscreen"]},{autoResize:!1}),o=[],r=new Map,i=new Set,a,s=c=>void window.dispatchEvent(new Event(`office:${c}`));return n.ontoolresult=c=>{o.push(c),o.length>20&&o.shift(),s("toolresult")},n.onhostcontextchanged=()=>s("hostchange"),n.onlisttools=async()=>({tools:LW}),n.oncalltool=async(c,u)=>{if(!LW.some(d=>d.name===c.name))return{isError:!0,content:[{type:"text",text:`The ${eg} page has no tool ${c.name}.`}]};try{let d=Date.now()+2e4;for(;!r.has(c.name)&&Date.now()<d;)await new Promise(h=>{let S=()=>(i.delete(S),h());i.add(S),setTimeout(S,500)});let p=r.get(c.name);if(!p)throw new Error(`The ${eg} panel is still loading; try again in a moment.`);let m=u;return await p(c.arguments??{},m.mcpReq?.signal??m.signal)}catch(d){return{isError:!0,content:[{type:"text",text:d instanceof Error?d.message:String(d)}]}}},window.addEventListener("pagehide",()=>{n.callServerTool({name:"release_view",arguments:{viewId:t()}}).catch(()=>{})}),{app:n,get viewId(){return t()},ready:()=>a??=n.connect(new Zh(window.parent,window.parent)).then(()=>s("hostchange")),readWindow(){let c=n.getHostCapabilities()?.experimental?.["zcode/surface"];if(!c?.stateKey)return{};try{return eA(localStorage,c.stateKey)}catch{return{}}},saveWindow(c){let u=n.getHostCapabilities()?.experimental?.["zcode/surface"];if(u?.stateKey)try{AW(localStorage,u.stateKey,c)}catch{}},readDocument(){return this.readWindow().path??null},saveDocument(c){this.saveWindow({path:c})},takeResults:()=>o.splice(0,o.length),handleTool(c,u){r.set(c,u);for(let d of i)d()},get context(){return n.getHostContext()},get capabilities(){return n.getHostCapabilities()}}}function f4(){return window.__officeHost??=r4e()}async function nA(e){let t=f4();await t.ready();let o=(await t.app.readServerResource({uri:e})).contents[0];if(!o)throw new Error(`Empty resource ${e}`);return o}async function DW(e){let t=await nA(XT+e);if(typeof t.text!="string")throw new Error(`Asset ${e} is not text`);return t.text}function BW(e){let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}var tA=new Map;function jW(e){let t=tA.get(e);return t||(t=nA(XT+e).then(n=>{if(typeof n.blob!="string")throw new Error(`Asset ${e} is not binary`);return BW(n.blob)}),t.catch(()=>tA.delete(e)),tA.set(e,t)),t}async function UW(e,t){let n=new Uint8Array(e.bytes),o=0;for(let r=0;r<e.chunks;r++){t?.throwIfAborted();let i=await nA(`${kW}${e.token}/${r}`);if(typeof i.blob!="string")throw new Error("File chunk is not binary");let a=BW(i.blob);n.set(a,o),o+=a.byteLength}if(o!==e.bytes)throw new Error("The file changed while it was loading; reload it.");return n.buffer}var sw=H2(ho(),1);var tg=class extends Error{constructor(n,o){super(n);this.code=o;this.name="CallError"}};async function ls(e,t={}){let n=f4();await n.ready();let o=await n.app.callServerTool({name:e,arguments:t}),r=o.structuredContent,i=r?.error;if(o.isError||i){let a=o.content?.[0]?.text;throw new tg(i?.message??a??`${e} failed`,i?.code)}return r}var P8=e=>e.slice(e.lastIndexOf("/")+1),FW=e=>{let t=e.lastIndexOf("/");return t>0?e.slice(0,t):""};async function HW(e){let{id:t}=await ls("begin_file_import",{name:e.name,size:e.size});try{for(let o=0;o<e.size;o+=YT){let r=await new Promise((i,a)=>{let s=new FileReader;s.onload=()=>i(String(s.result).split(",")[1]),s.onerror=()=>a(s.error),s.readAsDataURL(e.slice(o,o+YT))});await ls("write_file_import",{id:t,offset:o,data:r})}return(await ls("finish_file_import",{id:t})).path}catch(n){throw await ls("cancel_file_import",{id:t}).catch(()=>{}),n}}var lw=(e,t)=>e.length>t?`${MW(e,0,t-1)}\u2026`:e;function rA(){return f4().readWindow().recent??[]}function VW(e){f4().saveWindow({recent:e})}function ng(e,t,n){let o=t instanceof tg?t.code:t?.name==="PasswordException"?"password":void 0,[r,i]=o&&e.errors[o]||e.errors.generic,a=t instanceof Error?t.message:String(t);return{path:n,title:r,detail:i||a}}function qW(){let[,e]=(0,sw.useState)(0);return(0,sw.useEffect)(()=>{let t=()=>e(n=>n+1);return window.addEventListener("office:hostchange",t),()=>window.removeEventListener("office:hostchange",t)},[]),f4().context}var o4e={docx:"Word",xlsx:"Excel",pptx:"PowerPoint",pdf:"PDF"},GW=e5.map(e=>o4e[e]),zu=e=>e5.includes(e),WW=zu("docx")||zu("pdf"),ZW={en:`any ${p4([...WW?["passage"]:[],...zu("xlsx")?["cell"]:[],...zu("pptx")?["slide"]:[]],"en","or")}`,zh:p4([...WW?["\u6BB5\u843D"]:[],...zu("xlsx")?["\u5355\u5143\u683C"]:[],...zu("pptx")?["\u5E7B\u706F\u7247"]:[]],"zh-CN","or")},oA=or.title["zh-CN"].replace(/[\x20-\x7e]$/,"$& "),i4e={title:or.title.en,openTitle:"Open a document",openFile:"Open file",emptyTitle:`Open your ${p4(GW)} file`,emptyDescription:`Read alongside your conversation and discuss ${ZW.en}.`,emptyCaption:`Choose a local file \xB7 ${_8("en","or")}`,importing:"Importing\u2026",importTooLarge:`Choose a file no larger than ${Kh/1024/1024} MiB.`,recent:"Recent",switchDocument:"Switch document",pagesAndOutline:"Pages and outline",outlineOnly:"Outline",pages:"Pages",slides:"Slides",outline:"Outline",find:"Find",findPlaceholder:"Find in document",findCount:(e,t)=>`${e} of ${t}`,noResults:"No results",previousMatch:"Previous match (\u21E7Enter)",nextMatch:"Next match (Enter)",closeFind:"Close (Esc)",more:"More",fitWidth:"Fit width",fitPage:"Fit page",actualSize:"Actual size",reload:"Reload from disk",previousPage:"Previous page",nextPage:"Next page",pageNumber:"Page number",ofPages:e=>`of ${e}`,zoomIn:"Zoom in (\u2318+)",zoomOut:"Zoom out (\u2318\u2212)",fit:"Fit",addToChat:"Add to chat",addShort:"Add",addToChatHint:"Attach this to your next message (\u2318/Ctrl+Enter)",added:"Added to chat",ask:"Ask",askPlaceholder:"Ask about this\u2026",send:"Send",cancel:"Cancel",sendKey:"send",cancelKey:"cancel",copy:"Copy",copied:"Copied",agent:"Agent",agentOf:(e,t)=>`Agent \xB7 ${e} of ${t}`,nextTarget:"Next",moreOn:(e,t)=>e===1?`1 more on ${t}`:`${e} more`,close:"Close",changed:"This file changed on disk.",reloadShort:"Reload",dismiss:"Dismiss",openAnother:"Open another file",sidePanel:"Open in side panel",meta:{pdf:e=>e===1?"1 page":`${e} pages`,pptx:e=>e===1?"1 slide":`${e} slides`,xlsx:e=>e===1?"1 sheet":`${e} sheets`,docx:e=>""},errors:{generic:["Couldn\u2019t open this document",""],password:["This PDF is password protected",`${or.title.en} can\u2019t open encrypted files yet.`],not_found:["This file no longer exists","It may have been moved or deleted."],file_too_large:["This file is too large to open",""],corrupt_file:["This file appears to be damaged",`${or.title.en} couldn\u2019t read its contents.`],unsupported_type:["This kind of file isn\u2019t supported",`${or.title.en} opens ${_8()} files.`],path_outside_workspace:["This file is outside the workspace",""]},sendFailed:"The message was not sent.",contextFailed:"ZCode did not accept the reference.",where:{page:e=>`Page ${e}`,pages:(e,t)=>`Pages ${e}\u2013${t}`,pageLower:e=>`page ${e}`,slide:e=>`Slide ${e}`,slides:(e,t)=>`Slides ${e}\u2013${t}`,slideLower:e=>`slide ${e}`,shape:e=>`Slide ${e} \xB7 Shape`,paragraph:e=>`Paragraph ${e}`,paragraphs:(e,t)=>`Paragraphs ${e}\u2013${t}`,paragraphLower:e=>`paragraph ${e}`,table:e=>`Table ${e}`,cell:(e,t,n)=>`Table ${e} \xB7 R${t}C${n}`}},a4e={title:or.title["zh-CN"],openTitle:"\u6253\u5F00\u6587\u6863",openFile:"\u6253\u5F00\u6587\u4EF6",emptyTitle:`\u6253\u5F00\u4F60\u7684 ${p4(GW,"zh-CN")} \u6587\u4EF6`,emptyDescription:`\u8FB9\u770B\u8FB9\u804A\uFF0C\u9009\u4E2D${ZW.zh}\u5373\u53EF\u5E26\u5165\u5BF9\u8BDD\u3002`,emptyCaption:`\u9009\u62E9\u672C\u5730\u6587\u4EF6 \xB7 ${_8("zh-CN","or")}`,importing:"\u6B63\u5728\u5BFC\u5165\u2026",importTooLarge:`\u8BF7\u9009\u62E9\u4E0D\u8D85\u8FC7 ${Kh/1024/1024} MiB \u7684\u6587\u4EF6\u3002`,recent:"\u6700\u8FD1",switchDocument:"\u5207\u6362\u6587\u6863",pagesAndOutline:"\u9875\u9762\u4E0E\u76EE\u5F55",outlineOnly:"\u76EE\u5F55",pages:"\u9875\u9762",slides:"\u5E7B\u706F\u7247",outline:"\u76EE\u5F55",find:"\u67E5\u627E",findPlaceholder:"\u5728\u6587\u6863\u4E2D\u67E5\u627E",findCount:(e,t)=>`${e} / ${t}`,noResults:"\u65E0\u7ED3\u679C",previousMatch:"\u4E0A\u4E00\u4E2A\uFF08\u21E7Enter\uFF09",nextMatch:"\u4E0B\u4E00\u4E2A\uFF08Enter\uFF09",closeFind:"\u5173\u95ED\uFF08Esc\uFF09",more:"\u66F4\u591A",fitWidth:"\u9002\u5E94\u5BBD\u5EA6",fitPage:"\u9002\u5E94\u9875\u9762",actualSize:"\u5B9E\u9645\u5927\u5C0F",reload:"\u4ECE\u78C1\u76D8\u91CD\u65B0\u52A0\u8F7D",previousPage:"\u4E0A\u4E00\u9875",nextPage:"\u4E0B\u4E00\u9875",pageNumber:"\u9875\u7801",ofPages:e=>`/ ${e}`,zoomIn:"\u653E\u5927\uFF08\u2318+\uFF09",zoomOut:"\u7F29\u5C0F\uFF08\u2318\u2212\uFF09",fit:"\u9002\u5E94",addToChat:"\u6DFB\u52A0\u5230\u5BF9\u8BDD",addShort:"\u6DFB\u52A0",addToChatHint:"\u9644\u52A0\u5230\u4E0B\u4E00\u6761\u6D88\u606F\uFF08\u2318/Ctrl+Enter\uFF09",added:"\u5DF2\u6DFB\u52A0\u5230\u5BF9\u8BDD",ask:"\u63D0\u95EE",askPlaceholder:"\u5C31\u8FD9\u91CC\u63D0\u95EE\u2026",send:"\u53D1\u9001",cancel:"\u53D6\u6D88",sendKey:"\u53D1\u9001",cancelKey:"\u53D6\u6D88",copy:"\u590D\u5236",copied:"\u5DF2\u590D\u5236",agent:"Agent",agentOf:(e,t)=>`Agent \xB7 \u7B2C ${e} \u5904\uFF0C\u5171 ${t} \u5904`,nextTarget:"\u4E0B\u4E00\u5904",moreOn:(e,t)=>e===1?`${t}\u8FD8\u6709 1 \u5904`:`\u8FD8\u6709 ${e} \u5904`,close:"\u5173\u95ED",changed:"\u6587\u4EF6\u5DF2\u5728\u78C1\u76D8\u4E0A\u66F4\u6539\u3002",reloadShort:"\u91CD\u65B0\u52A0\u8F7D",dismiss:"\u5FFD\u7565",openAnother:"\u6253\u5F00\u5176\u4ED6\u6587\u4EF6",sidePanel:"\u5728\u4FA7\u680F\u6253\u5F00",meta:{pdf:e=>`${e} \u9875`,pptx:e=>`${e} \u5F20\u5E7B\u706F\u7247`,xlsx:e=>`${e} \u4E2A\u5DE5\u4F5C\u8868`,docx:()=>""},errors:{generic:["\u65E0\u6CD5\u6253\u5F00\u8BE5\u6587\u6863",""],password:["\u8BE5 PDF \u53D7\u5BC6\u7801\u4FDD\u62A4",`${oA}\u6682\u4E0D\u652F\u6301\u6253\u5F00\u52A0\u5BC6\u6587\u4EF6\u3002`],not_found:["\u8BE5\u6587\u4EF6\u5DF2\u4E0D\u5B58\u5728","\u5B83\u53EF\u80FD\u5DF2\u88AB\u79FB\u52A8\u6216\u5220\u9664\u3002"],file_too_large:["\u6587\u4EF6\u592A\u5927\uFF0C\u65E0\u6CD5\u6253\u5F00",""],corrupt_file:["\u8BE5\u6587\u4EF6\u4F3C\u4E4E\u5DF2\u635F\u574F",`${oA}\u65E0\u6CD5\u8BFB\u53D6\u5176\u5185\u5BB9\u3002`],unsupported_type:["\u4E0D\u652F\u6301\u8FD9\u79CD\u6587\u4EF6",`${oA}\u53EF\u4EE5\u6253\u5F00 ${_8("zh-CN")} \u6587\u4EF6\u3002`],path_outside_workspace:["\u8BE5\u6587\u4EF6\u4E0D\u5728\u5DE5\u4F5C\u533A\u5185",""]},sendFailed:"\u6D88\u606F\u672A\u53D1\u9001\u3002",contextFailed:"ZCode \u672A\u63A5\u53D7\u8BE5\u5F15\u7528\u3002",where:{page:e=>`\u7B2C ${e} \u9875`,pages:(e,t)=>`\u7B2C ${e}\u2013${t} \u9875`,pageLower:e=>`\u7B2C ${e} \u9875`,slide:e=>`\u7B2C ${e} \u5F20\u5E7B\u706F\u7247`,slides:(e,t)=>`\u7B2C ${e}\u2013${t} \u5F20\u5E7B\u706F\u7247`,slideLower:e=>`\u7B2C ${e} \u5F20\u5E7B\u706F\u7247`,shape:e=>`\u7B2C ${e} \u5F20\u5E7B\u706F\u7247 \xB7 \u5F62\u72B6`,paragraph:e=>`\u7B2C ${e} \u6BB5`,paragraphs:(e,t)=>`\u7B2C ${e}\u2013${t} \u6BB5`,paragraphLower:e=>`\u7B2C ${e} \u6BB5`,table:e=>`\u8868\u683C ${e}`,cell:(e,t,n)=>`\u8868\u683C ${e} \xB7 R${t}C${n}`}},XW=e=>e?.toLowerCase().startsWith("zh")?a4e:i4e;function cw(e,t,n=!1){let o=t.where,r;if(r=/^page:(\d+)(?:-(\d+))?$/.exec(e))return r[2]?o.pages(r[1],r[2]):n?o.pageLower(r[1]):o.page(r[1]);if(r=/^slide:(\d+)\/shape:/.exec(e))return o.shape(r[1]);if(r=/^slide:(\d+)(?:-(\d+))?$/.exec(e))return r[2]?o.slides(r[1],r[2]):n?o.slideLower(r[1]):o.slide(r[1]);if(r=/^p:(\d+)(?:-(\d+))?$/.exec(e))return r[2]?o.paragraphs(r[1],r[2]):n?o.paragraphLower(r[1]):o.paragraph(r[1]);if(r=/^t:(\d+)\/r(\d+)c(\d+)$/.exec(e))return o.cell(r[1],r[2],r[3]);if(r=/^t:(\d+)$/.exec(e))return o.table(r[1]);let i=e.lastIndexOf("!");return i>0?`${e.slice(0,i).replace(/^'(.*)'$/,"$1").replace(/''/g,"'")} \xB7 ${e.slice(i+1)}`:e.replace(/^'(.*)'$/,"$1")}var iA=H2(Fo(),1),c4e={search:'<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>',x:'<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',"chevron-up":'<path d="m18 15-6-6-6 6"/>',"chevron-down":'<path d="m6 9 6 6 6-6"/>',minus:'<path d="M5 12h14"/>',plus:'<path d="M5 12h14"/><path d="M12 5v14"/>',ellipsis:'<circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/>',"panel-left":'<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/>',"file-text":'<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/>',copy:'<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>',"message-square-plus":'<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/><path d="M12 7v6"/><path d="M9 10h6"/>',"message-circle-question":'<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><path d="M12 17h.01"/>',check:'<path d="M20 6 9 17l-5-5"/>',"rotate-cw":'<path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/>',"arrow-down":'<path d="M12 5v14"/><path d="m19 12-7 7-7-7"/>',"arrow-up":'<path d="m5 12 7-7 7 7"/><path d="M12 19V5"/>',"folder-open":'<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"/>',"maximize-2":'<polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" x2="14" y1="3" y2="10"/><line x1="3" x2="10" y1="21" y2="14"/>'};function Q2({name:e,size:t=14,className:n}){return(0,iA.jsx)("svg",{className:`icon${n?` ${n}`:""}`,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",dangerouslySetInnerHTML:{__html:c4e[e]}})}var u4e={pdf:"PDF",docx:"W",xlsx:"X",pptx:"P"};function QW({kind:e}){return(0,iA.jsx)("span",{className:`filetype ${e}`,"aria-hidden":"true",children:u4e[e]})}var z0=H2(ho(),1);var p2=H2(Fo(),1);function d4e({handle:e,page:t,width:n,ratio:o,current:r,onPick:i,root:a}){let s=(0,z0.useRef)(null);return(0,z0.useEffect)(()=>{let l=s.current;if(!l||!e.thumbnail)return;let c=!1,u=new IntersectionObserver(d=>{c||!d.some(p=>p.isIntersecting)||(c=!0,u.disconnect(),e.thumbnail(t,n).then(p=>{l.replaceChildren(p),l.style.height=""},()=>{}))},{root:a.current,rootMargin:"300px 0px"});return u.observe(l),()=>u.disconnect()},[e,t,n,a]),(0,p2.jsxs)("button",{type:"button",className:`thumb${r?" on":""}`,"aria-current":r?"page":void 0,onClick:()=>i(t),"data-page":t,children:[(0,p2.jsx)("div",{ref:s,className:"mini",style:{width:n,height:Math.round(n*o)}}),(0,p2.jsx)("span",{children:t})]})}var eG=e=>/^(?:page|slide):(\d+)/.exec(e)?.[1]??"";function tG({t:e,info:t,handle:n,page:o,tab:r,docked:i,onTab:a,onPage:s,onOutline:l}){let c=(0,z0.useRef)(null),u=!!(n?.thumbnail&&o),d=t.outline.length>0,p=u&&(r==="pages"||!d)?"pages":"outline",m=t.kind==="pptx"?9/16:1.294;(0,z0.useEffect)(()=>{let S=c.current?.querySelector("[aria-current=page]");S&&c.current&&(c.current.scrollTop=S.offsetTop-c.current.clientHeight/3)},[p]);let h=(()=>{if(!o)return-1;let S=-1;return t.outline.forEach((v,g)=>{let y=Number(eG(v.at));y&&y<=o.current&&(S=g)}),S})();return(0,p2.jsxs)("nav",{className:`drawer${i?" docked":""}`,"aria-label":e.pagesAndOutline,children:[u&&d?(0,p2.jsxs)("div",{className:"seg",role:"tablist",children:[(0,p2.jsx)("button",{type:"button",role:"tab","aria-selected":p==="pages",className:p==="pages"?"on":"",onClick:()=>a("pages"),children:t.kind==="pptx"?e.slides:e.pages}),(0,p2.jsx)("button",{type:"button",role:"tab","aria-selected":p==="outline",className:p==="outline"?"on":"",onClick:()=>a("outline"),children:e.outline})]}):null,(0,p2.jsx)("div",{ref:c,className:p==="pages"?"thumbs":"outline",children:p==="pages"&&n&&o?Array.from({length:o.count},(S,v)=>(0,p2.jsx)(d4e,{handle:n,page:v+1,width:136,ratio:m,current:o.current===v+1,onPick:s,root:c},v)):t.outline.map((S,v)=>(0,p2.jsxs)("button",{type:"button",className:`oi level-${Math.min(3,Math.max(1,S.level))}${v===h?" on":""}`,"aria-current":v===h?"page":void 0,title:S.label,onClick:()=>l(S.at),children:[(0,p2.jsx)("span",{className:"label",children:S.label}),(0,p2.jsx)("span",{className:"n",children:eG(S.at)})]},`${S.at}-${v}`))})]})}function nG({t:e,onBrowse:t,importing:n}){return(0,p2.jsx)("div",{className:"empty",children:(0,p2.jsxs)("div",{className:"empty-content",children:[(0,p2.jsx)("h3",{children:e.emptyTitle}),(0,p2.jsx)("p",{className:"empty-description",children:e.emptyDescription}),(0,p2.jsxs)("button",{type:"button",className:"btn empty-open",onClick:t,disabled:n,children:[(0,p2.jsx)(Q2,{name:"folder-open",size:16}),n?e.importing:e.openFile]}),(0,p2.jsx)("p",{className:"empty-caption",children:e.emptyCaption})]})})}var p4e=["title","subtitle","line","line","short","heading","line","line","line","mid","figure"];function dw({kind:e}){if(e==="xlsx")return(0,p2.jsx)("div",{className:"skeleton sheet","aria-busy":"true",children:Array.from({length:18},(n,o)=>(0,p2.jsx)("div",{className:"skel-row"},o))});let t=e==="pptx";return(0,p2.jsx)("div",{className:"skeleton","aria-busy":"true",children:[0,1].map(n=>(0,p2.jsxs)("div",{className:`skelpage${t?" slide":""}`,children:[n===0&&!t?p4e.map((o,r)=>(0,p2.jsx)("div",{className:`skel ${o}`},r)):null,n===0&&t?(0,p2.jsxs)(p2.Fragment,{children:[(0,p2.jsx)("div",{className:"skel title left"}),(0,p2.jsx)("div",{className:"skel line"}),(0,p2.jsx)("div",{className:"skel mid"})]}):null]},n))})}function pw({t:e,title:t,detail:n,onOpenAnother:o}){return(0,p2.jsxs)("div",{className:"failed",role:"alert",children:[(0,p2.jsx)(Q2,{name:"file-text",size:28,className:"subtlest"}),(0,p2.jsxs)("div",{children:[(0,p2.jsx)("h3",{children:t}),n?(0,p2.jsx)("p",{children:n}):null]}),(0,p2.jsx)("button",{type:"button",className:"btn secondary",onClick:o,children:e.openAnother})]})}function rG({t:e,onReload:t,onDismiss:n}){return(0,p2.jsxs)("div",{className:"banner",role:"status",children:[(0,p2.jsx)("span",{children:e.changed}),(0,p2.jsx)("button",{type:"button",className:"btn sm primary",onClick:t,children:e.reloadShort}),(0,p2.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.dismiss,"aria-label":e.dismiss,onClick:n,children:(0,p2.jsx)(Q2,{name:"x"})})]})}function f4e({inputRef:e,t,importing:n,onImporting:o,onOpen:r,onError:i}){return(0,p2.jsx)("input",{ref:e,type:"file",hidden:!0,accept:e5.map(a=>`.${a}`).join(","),disabled:n,onChange:async a=>{let s=a.currentTarget.files?.[0];if(a.currentTarget.value="",!!s){o(!0);try{if(s.size>Kh)throw new Error(t.importTooLarge);r(await HW(s))}catch(l){i(l,s.name)}finally{o(!1)}}}})}function oG(e,t,n){let o=(0,z0.useRef)(null),[r,i]=(0,z0.useState)(!1);return{importing:r,browse:()=>o.current?.click(),input:(0,p2.jsx)(f4e,{inputRef:o,t:e,importing:r,onImporting:i,onOpen:t,onError:n})}}var O3=H2(Fo(),1);function iG({appRef:e,canvasRef:t,t:n,path:o,info:r,kind:i,showSkeleton:a,failure:s,nothing:l,onExpand:c,children:u}){return(0,O3.jsxs)("div",{ref:e,className:"app inline",children:[(0,O3.jsxs)("header",{className:"docbar",children:[(0,O3.jsxs)("div",{className:"doctitle static",title:o??void 0,children:[(0,O3.jsx)("span",{className:"name",children:o?P8(o):n.title}),r&&n.meta[r.kind](r.units)?(0,O3.jsx)("span",{className:"meta",children:n.meta[r.kind](r.units)}):null]}),(0,O3.jsx)("span",{className:"spacer"}),(0,O3.jsxs)("button",{type:"button",className:"btn sm",title:n.sidePanel,onClick:c,children:[(0,O3.jsx)(Q2,{name:"maximize-2",size:12}),n.sidePanel]})]}),(0,O3.jsx)("div",{className:"stage",children:(0,O3.jsxs)("div",{ref:t,className:"canvas",children:[u,a?(0,O3.jsx)(dw,{kind:i}):null,s?(0,O3.jsx)(pw,{t:n,title:s.title,detail:s.detail,onOpenAnother:c}):null,l?(0,O3.jsx)("div",{className:"failed muted",children:n.openTitle}):null,(0,O3.jsx)("button",{type:"button",className:"glance-cover","aria-label":n.sidePanel,onClick:c})]})})]})}var Zi=H2(ho(),1);var fw=H2(ho(),1),C8=8;function aA(e,t,n){let o=(0,fw.useRef)(null),{side:r,offset:i=8,dock:a=!1}=n;return(0,fw.useLayoutEffect)(()=>{let s=o.current,l=e.current;if(!s||!l)return;let c=0,u=()=>{c=0;let h=l.getBoundingClientRect(),S=s.offsetWidth,v=s.offsetHeight,g=t?.()??null,y=(N,U,z,Z)=>{s.style.visibility="",s.style.left=`${Math.round(N)}px`,s.style.top=`${Math.round(U)}px`,s.dataset.side=z,s.style.setProperty("--tip",`${Math.round(Math.max(14,Math.min(S-14,Z-N)))}px`)};if(!g){a?y((h.width-S)/2,C8,"none",h.width/2):s.style.visibility="hidden";return}if(g.bottom<h.top+4||g.top>h.bottom-4){s.style.visibility="hidden";return}let x=(g.left+g.right)/2-h.left,_=Math.max(C8,Math.min(h.width-S-C8,x-S/2)),$=g.top-h.top-v-i,k=g.bottom-h.top+i,L=$>=C8,I=k+v<=h.height-C8;(r==="top"||!I)&&L?y(_,$,"top",x):I?y(_,k,"bottom",x):y(_,r==="top"?C8:h.height-v-C8,"none",x)},d=()=>{c||(c=requestAnimationFrame(u))};u(),l.addEventListener("scroll",d,{capture:!0,passive:!0});let p=new ResizeObserver(d);p.observe(l),p.observe(s);let m=setInterval(d,250);return()=>{l.removeEventListener("scroll",d,{capture:!0}),p.disconnect(),clearInterval(m),c&&cancelAnimationFrame(c)}},[e,t,r,i,a]),o}var vt=H2(Fo(),1);function sA({className:e,onClose:t,children:n,label:o}){let r=(0,Zi.useRef)(null);(0,Zi.useEffect)(()=>{let a=l=>{let c=l.target;!r.current?.contains(c)&&!c.closest?.("[data-menu-trigger]")&&t()},s=l=>{l.key==="Escape"&&(l.stopPropagation(),t())};return document.addEventListener("pointerdown",a,!0),document.addEventListener("keydown",s,!0),r.current?.querySelector("[role^=menuitem]")?.focus(),()=>{document.removeEventListener("pointerdown",a,!0),document.removeEventListener("keydown",s,!0)}},[t]);let i=a=>{if(a.key!=="ArrowDown"&&a.key!=="ArrowUp")return;a.preventDefault();let s=[...r.current?.querySelectorAll("[role^=menuitem]")??[]],l=s.indexOf(document.activeElement);s[(l+(a.key==="ArrowDown"?1:-1)+s.length)%s.length]?.focus()};return(0,vt.jsx)("div",{ref:r,className:`menu ${e}`,role:"menu","aria-label":o,onKeyDown:i,children:n})}function y7({icon:e,checked:t,children:n,hint:o,onSelect:r}){return(0,vt.jsxs)("button",{type:"button",role:t===void 0?"menuitem":"menuitemradio","aria-checked":t,className:"mi",onClick:r,children:[(0,vt.jsx)("span",{className:"mi-icon",children:t?(0,vt.jsx)(Q2,{name:"check",size:16}):e}),(0,vt.jsx)("span",{className:"mi-label",children:n}),o?(0,vt.jsx)("span",{className:"mi-hint",children:o}):null]})}function sG({t:e,query:t,total:n,index:o,onQuery:r,onStep:i,onClose:a}){let s=(0,Zi.useRef)(null);(0,Zi.useEffect)(()=>{s.current?.focus(),s.current?.select()},[]);let l=!t.trim()||n===null?"":n?e.findCount(o+1,n):e.noResults;return(0,vt.jsxs)("div",{className:"docbar findbar",role:"search",children:[(0,vt.jsxs)("label",{className:"findfield",children:[(0,vt.jsx)(Q2,{name:"search",className:"muted"}),(0,vt.jsx)("input",{ref:s,className:"find-input",type:"text","aria-label":e.find,placeholder:e.findPlaceholder,value:t,onChange:c=>r(c.target.value),onKeyDown:c=>{c.key==="Enter"?(c.preventDefault(),i(c.shiftKey?-1:1)):c.key==="Escape"&&(c.preventDefault(),c.stopPropagation(),a())}}),(0,vt.jsx)("span",{className:"count","aria-live":"polite",children:l})]}),(0,vt.jsx)("button",{type:"button",className:"btn icon dim",title:e.previousMatch,"aria-label":e.previousMatch,disabled:!n,onClick:()=>i(-1),children:(0,vt.jsx)(Q2,{name:"chevron-up"})}),(0,vt.jsx)("button",{type:"button",className:"btn icon dim",title:e.nextMatch,"aria-label":e.nextMatch,disabled:!n,onClick:()=>i(1),children:(0,vt.jsx)(Q2,{name:"chevron-down"})}),(0,vt.jsx)("button",{type:"button",className:"btn icon dim",title:e.closeFind,"aria-label":e.closeFind,onClick:a,children:(0,vt.jsx)(Q2,{name:"x"})})]})}var m4e=1500;function lG({t:e,frame:t,page:n,zoom:o,onPage:r,onZoom:i,onFit:a}){let s=(0,Zi.useRef)(null),[l,c]=(0,Zi.useState)(!0),[u,d]=(0,Zi.useState)(null),p=(0,Zi.useRef)(!1);(0,Zi.useEffect)(()=>{let h=t.current;if(!h)return;let S=0,v=()=>{clearTimeout(S),S=window.setTimeout(()=>{!p.current&&!s.current?.contains(document.activeElement)&&c(!1)},m4e)},g=()=>{c(!0),v()},y=x=>{let _=h.getBoundingClientRect();x.clientY>_.bottom-80&&g()};return h.addEventListener("scroll",g,{capture:!0,passive:!0}),h.addEventListener("pointermove",y,{passive:!0}),v(),()=>{clearTimeout(S),h.removeEventListener("scroll",g,{capture:!0}),h.removeEventListener("pointermove",y)}},[t]);let m=()=>{let h=Number(u);d(null),Number.isInteger(h)&&h>=1&&r(Math.min(h,n.count))};return(0,vt.jsxs)("div",{ref:s,className:`pill${l?"":" faded"}`,onPointerEnter:()=>{p.current=!0,c(!0)},onPointerLeave:()=>{p.current=!1},onFocus:()=>c(!0),children:[(0,vt.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.previousPage,"aria-label":e.previousPage,disabled:n.current<=1,onClick:()=>r(n.current-1),children:(0,vt.jsx)(Q2,{name:"chevron-up"})}),(0,vt.jsxs)("span",{className:"pg",children:[(0,vt.jsx)("input",{className:"pgin","aria-label":e.pageNumber,inputMode:"numeric",style:{width:`${Math.max(2,String(n.count).length)+1.6}ch`},value:u??String(n.current),onFocus:h=>{d(String(n.current)),h.target.select()},onChange:h=>d(h.target.value.replace(/\D/g,"")),onBlur:()=>d(null),onKeyDown:h=>{h.key==="Enter"?(m(),h.currentTarget.blur()):h.key==="Escape"&&(h.stopPropagation(),d(null),h.currentTarget.blur())}}),(0,vt.jsx)("span",{children:e.ofPages(n.count)})]}),(0,vt.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.nextPage,"aria-label":e.nextPage,disabled:n.current>=n.count,onClick:()=>r(n.current+1),children:(0,vt.jsx)(Q2,{name:"chevron-down"})}),o?(0,vt.jsxs)(vt.Fragment,{children:[(0,vt.jsx)("span",{className:"vsep"}),(0,vt.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.zoomOut,"aria-label":e.zoomOut,disabled:o.mode!=="width"&&o.percent<=25,onClick:()=>i(-1),children:(0,vt.jsx)(Q2,{name:"minus"})}),(0,vt.jsx)("button",{type:"button",className:"zoom",title:e.fitWidth,onClick:a,children:o.mode==="width"?e.fit:`${o.percent}%`}),(0,vt.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.zoomIn,"aria-label":e.zoomIn,disabled:o.mode!=="width"&&o.percent>=400,onClick:()=>i(1),children:(0,vt.jsx)(Q2,{name:"plus"})})]}):null]})}var aG=e=>{e.target.closest("textarea")||e.preventDefault()};function cG({t:e,frame:t,locate:n,text:o,label:r,quote:i,short:a,mode:s,canAsk:l,copied:c,onAdd:u,onAsk:d,onCopy:p,onCancelAsk:m,onSend:h}){let S=s==="ask",v=aA(t,n,{side:S?"bottom":"top",dock:!0}),[g,y]=(0,Zi.useState)(""),[x,_]=(0,Zi.useState)(!1),$=async()=>{if(!g.trim()||x)return;_(!0);let k=await h(g.trim());_(!1),k&&y("")};return S?(0,vt.jsxs)("div",{ref:v,className:"pop ask",role:"dialog","aria-label":e.ask,onMouseDown:aG,children:[(0,vt.jsxs)("div",{className:"ctx",children:[(0,vt.jsx)("span",{className:"where",children:r}),i?(0,vt.jsxs)("span",{className:"q",children:["\u201C",i,"\u201D"]}):null]}),(0,vt.jsx)("textarea",{autoFocus:!0,className:"textarea",rows:2,"aria-label":e.askPlaceholder,placeholder:e.askPlaceholder,value:g,onChange:k=>y(k.target.value),onKeyDown:k=>{k.key==="Enter"&&!k.shiftKey&&!k.nativeEvent.isComposing?(k.preventDefault(),$()):k.key==="Escape"&&(k.preventDefault(),k.stopPropagation(),m())}}),(0,vt.jsxs)("div",{className:"row",children:[(0,vt.jsxs)("span",{className:"hint",children:[(0,vt.jsx)("kbd",{children:"\u21B5"})," ",e.sendKey]}),(0,vt.jsx)("button",{type:"button",className:"btn sm",onClick:m,children:e.cancel}),(0,vt.jsx)("button",{type:"button",className:"btn sm primary",disabled:!g.trim()||x,onClick:()=>void $(),children:e.send})]})]}):(0,vt.jsxs)("div",{ref:v,className:"pop bar",role:"toolbar","aria-label":r,onMouseDown:aG,children:[o?null:(0,vt.jsxs)(vt.Fragment,{children:[(0,vt.jsx)("span",{className:"where",children:r}),(0,vt.jsx)("span",{className:"vsep"})]}),(0,vt.jsx)("button",{type:"button",className:"btn lg",title:e.addToChatHint,onClick:u,disabled:s==="added",children:s==="added"?(0,vt.jsxs)(vt.Fragment,{children:[(0,vt.jsx)(Q2,{name:"check",size:16,className:"ok"}),e.added]}):(0,vt.jsxs)(vt.Fragment,{children:[(0,vt.jsx)(Q2,{name:"message-square-plus",size:16}),a?e.addShort:e.addToChat]})}),l?(0,vt.jsxs)("button",{type:"button",className:"btn lg",onClick:d,children:[(0,vt.jsx)(Q2,{name:"message-circle-question",size:16}),e.ask]}):null,o?(0,vt.jsxs)(vt.Fragment,{children:[(0,vt.jsx)("span",{className:"vsep"}),(0,vt.jsx)("button",{type:"button",className:"btn icon lg dim",title:c?e.copied:e.copy,"aria-label":c?e.copied:e.copy,onClick:p,children:(0,vt.jsx)(Q2,{name:c?"check":"copy"})})]}):null]})}function uG({t:e,frame:t,locate:n,note:o,index:r,total:i,onNext:a,onClose:s}){let l=aA(t,n,{side:"bottom",offset:6,dock:!0});return(0,vt.jsxs)("div",{ref:l,className:"callout",role:"note",children:[(0,vt.jsxs)("div",{className:"body",children:[(0,vt.jsxs)("div",{className:"who",children:[(0,vt.jsx)("span",{className:"dot"}),i>1?e.agentOf(r+1,i):e.agent]}),o?(0,vt.jsx)("div",{className:"text",children:o}):null]}),i>1?(0,vt.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.nextTarget,"aria-label":e.nextTarget,onClick:a,children:(0,vt.jsx)(Q2,{name:"chevron-down"})}):null,(0,vt.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.close,"aria-label":e.close,onClick:s,children:(0,vt.jsx)(Q2,{name:"x"})})]})}function dG({text:e,down:t,raised:n,onClick:o}){return(0,vt.jsxs)("button",{type:"button",className:`chip offscreen${n?" raised":""}`,onClick:o,children:[(0,vt.jsx)("span",{className:"dot"}),e,(0,vt.jsx)(Q2,{name:t?"arrow-down":"arrow-up",size:12})]})}function pG(e,t){return e.moreOn(t.length,cw(t[0],e,!0))}var kr=H2(Fo(),1);function fG({t:e,recent:t,currentPath:n,onOpen:o,onBrowse:r,onClose:i}){return(0,kr.jsxs)(sA,{className:"switcher",label:e.switchDocument,onClose:i,children:[t.length?(0,kr.jsx)("div",{className:"mlabel",children:e.recent}):null,t.map(a=>(0,kr.jsx)(y7,{icon:(0,kr.jsx)(QW,{kind:a.kind}),hint:a.path===n?(0,kr.jsx)(Q2,{name:"check",size:16}):P8(FW(a.path)),onSelect:()=>a.path===n?i():o(a.path),children:P8(a.path)},a.path)),t.length?(0,kr.jsx)("div",{className:"msep"}):null,(0,kr.jsx)(y7,{icon:(0,kr.jsx)(Q2,{name:"folder-open",size:16}),onSelect:r,children:e.openFile})]})}function mG({t:e,zoomable:t,zoomMode:n,onFit:o,onFind:r,onReload:i,onClose:a}){return(0,kr.jsxs)(sA,{className:"more",label:e.more,onClose:a,children:[t?(0,kr.jsxs)(kr.Fragment,{children:[(0,kr.jsx)(y7,{checked:n==="width",onSelect:()=>o("width"),children:e.fitWidth}),(0,kr.jsx)(y7,{checked:n==="page",onSelect:()=>o("page"),children:e.fitPage}),(0,kr.jsx)(y7,{checked:n==="actual",hint:"100%",onSelect:()=>o("actual"),children:e.actualSize}),(0,kr.jsx)("div",{className:"msep"})]}):null,(0,kr.jsx)(y7,{icon:(0,kr.jsx)(Q2,{name:"search",size:16}),hint:"\u2318F",onSelect:r,children:e.find}),(0,kr.jsx)(y7,{icon:(0,kr.jsx)(Q2,{name:"rotate-cw",size:16}),onSelect:i,children:e.reload})]})}var t5=H2(ho(),1),rg={open:!1,query:"",total:null,index:-1};function hG({viewer:e,docRef:t,ready:n,onOpen:o}){let[r,i]=(0,t5.useState)(rg),a=(0,t5.useRef)(0),s=(0,t5.useCallback)(()=>{t.current&&(o(),i(d=>({...d,open:!0})),requestAnimationFrame(()=>{let d=document.querySelector(".findbar .find-input");d?.focus(),d?.select()}))},[t,o]),l=(0,t5.useCallback)(()=>{a.current++,e.current?.clearFind(),i(rg)},[e]),c=(0,t5.useCallback)(d=>{i(p=>({...p,query:d,total:d.trim()?p.total:null}))},[]);(0,t5.useEffect)(()=>{if(!r.open||!n)return;let d=++a.current,p=setTimeout(async()=>{let m=e.current;if(!m)return;let h=await m.find(r.query).catch(()=>0);d===a.current&&(i(S=>({...S,total:h,index:h?0:-1})),h&&m.findGo(0))},200);return()=>clearTimeout(p)},[r.open,r.query,n,e]);let u=(0,t5.useCallback)(d=>{if(!r.total)return;let p=(r.index+d+r.total)%r.total;i(m=>({...m,index:p})),e.current?.findGo(p)},[r.total,r.index,e]);return{find:r,setFind:i,openFind:s,closeFind:l,queryFind:c,stepFind:u}}var gG=H2(ho(),1);function yG(e,t){(0,gG.useEffect)(()=>{f4().handleTool("capture_view",async o=>{let r=e.current;if(!r||!t.current)throw new Error(`No document is open in the ${or.title.en} panel. Call open_document first.`);let i=null;if(typeof o.anchor=="string"&&o.anchor.trim()){let l=RW(o.anchor);if(l.path.replace(/^\.\//,"")!==r.info.path)throw new Error(`The panel shows ${r.info.path}, not ${l.path}. Call open_document with that path first.`);i=l.at}let a=typeof o.maxWidth=="number"?Math.min(2e3,Math.max(320,o.maxWidth)):1600,s=await t.current.capture(i,a);return{content:[{type:"image",data:s.data,mimeType:"image/png"},{type:"text",text:`Captured ${Qh(r.info.path,s.at)} (${s.width}\xD7${s.height} px).`}]}})},[e,t])}var mw=H2(ho(),1);function vG(e,t){let[n,o]=(0,mw.useState)(null);return(0,mw.useEffect)(()=>{let r=e.current;if(!r||!t||t.targets.length<2){o(null);return}let i=0,a=()=>{i=0;let c=r.getBoundingClientRect(),u=[],d=[];t.targets.forEach((m,h)=>{if(h===t.index)return;let S=m.locate();S&&(S.top>c.bottom-8?u.push(h):S.bottom<c.top+8&&d.push(h))});let p=u.length?{indexes:u,down:!0}:d.length?{indexes:d,down:!1}:null;o(m=>JSON.stringify(m)===JSON.stringify(p)?m:p)},s=()=>{i||(i=requestAnimationFrame(a))};a(),r.addEventListener("scroll",s,{capture:!0,passive:!0});let l=setInterval(s,500);return()=>{r.removeEventListener("scroll",s,{capture:!0}),clearInterval(l),i&&cancelAnimationFrame(i)}},[t,e]),[n,o]}var bG=H2(ho(),1);function SG({docRef:e,viewer:t,picked:n,addReference:o,openFind:r,closeFind:i,clearSelection:a,paged:s,page:l,goToPage:c,drawer:u,setDrawer:d,docked:p,find:m,agent:h,setAgent:S}){(0,bG.useEffect)(()=>{let v=g=>{if(g.defaultPrevented)return;let y=g.metaKey||g.ctrlKey,x=g.target?.closest?.("input, textarea, [contenteditable]"),_=g.key.toLowerCase();if(y&&_==="f"&&e.current)g.preventDefault(),r();else if(y&&g.key==="Enter"&&n)g.preventDefault(),o();else if(y&&(g.key==="="||g.key==="+"))g.preventDefault(),t.current?.zoom(1);else if(y&&g.key==="-")g.preventDefault(),t.current?.zoom(-1);else if(y&&g.key==="0")g.preventDefault(),t.current?.fit("width");else if(!y&&!x&&s&&l&&["ArrowLeft","ArrowRight","PageUp","PageDown"].includes(g.key)){g.preventDefault();let $=g.key==="ArrowLeft"||g.key==="PageUp";c(l.current+($?-1:1))}else if(g.key==="Escape"&&!x){if(n)a();else if(u.open&&!p)d($=>({...$,open:!1}));else if(m.open)i();else if(h?.visible)S({...h,visible:!1});else return;g.preventDefault()}};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[n,o,r,i,a,s,l,c,u.open,p,m.open,h,e,t,d,S])}var gr=H2(ho(),1);var De=H2(ho(),1);var Rr=Uint8Array,Ca=Uint16Array,vA=Int32Array,hw=new Rr([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]),gw=new Rr([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]),pA=new Rr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),kG=function(e,t){for(var n=new Ca(31),o=0;o<31;++o)n[o]=t+=1<<e[o-1];for(var r=new vA(n[30]),o=1;o<30;++o)for(var i=n[o];i<n[o+1];++i)r[i]=i-n[o]<<5|o;return{b:n,r}},RG=kG(hw,2),$G=RG.b,fA=RG.r;$G[28]=258,fA[258]=28;var zG=kG(gw,0),h4e=zG.b,xG=zG.r,mA=new Ca(32768);for(ln=0;ln<32768;++ln)M0=(ln&43690)>>1|(ln&21845)<<1,M0=(M0&52428)>>2|(M0&13107)<<2,M0=(M0&61680)>>4|(M0&3855)<<4,mA[ln]=((M0&65280)>>8|(M0&255)<<8)>>1;var M0,ln,us=(function(e,t,n){for(var o=e.length,r=0,i=new Ca(t);r<o;++r)e[r]&&++i[e[r]-1];var a=new Ca(t);for(r=1;r<t;++r)a[r]=a[r-1]+i[r-1]<<1;var s;if(n){s=new Ca(1<<t);var l=15-t;for(r=0;r<o;++r)if(e[r])for(var c=r<<4|e[r],u=t-e[r],d=a[e[r]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)s[mA[d]>>l]=c}else for(s=new Ca(o),r=0;r<o;++r)e[r]&&(s[r]=mA[a[e[r]-1]++]>>15-e[r]);return s}),v7=new Rr(288);for(ln=0;ln<144;++ln)v7[ln]=8;var ln;for(ln=144;ln<256;++ln)v7[ln]=9;var ln;for(ln=256;ln<280;++ln)v7[ln]=7;var ln;for(ln=280;ln<288;++ln)v7[ln]=8;var ln,ag=new Rr(32);for(ln=0;ln<32;++ln)ag[ln]=5;var ln,g4e=us(v7,9,0),y4e=us(v7,9,1),v4e=us(ag,5,0),b4e=us(ag,5,1),lA=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},n5=function(e,t,n){var o=t/8|0;return(e[o]|e[o+1]<<8)>>(t&7)&n},cA=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},bA=function(e){return(e+7)/8|0},sg=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new Rr(e.subarray(t,n))};var S4e=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],L3=function(e,t,n){var o=new Error(t||S4e[e]);if(o.code=e,Error.captureStackTrace&&Error.captureStackTrace(o,L3),!n)throw o;return o},x4e=function(e,t,n,o){var r=e.length,i=o?o.length:0;if(!r||t.f&&!t.l)return n||new Rr(0);var a=!n,s=a||t.i!=2,l=t.i;a&&(n=new Rr(r*3));var c=function(Oe){var Be=n.length;if(Oe>Be){var c1=new Rr(Math.max(Be*2,Oe));c1.set(n),n=c1}},u=t.f||0,d=t.p||0,p=t.b||0,m=t.l,h=t.d,S=t.m,v=t.n,g=r*8;do{if(!m){u=n5(e,d,1);var y=n5(e,d+1,3);if(d+=3,y)if(y==1)m=y4e,h=b4e,S=9,v=5;else if(y==2){var k=n5(e,d,31)+257,L=n5(e,d+10,15)+4,I=k+n5(e,d+5,31)+1;d+=14;for(var N=new Rr(I),U=new Rr(19),z=0;z<L;++z)U[pA[z]]=n5(e,d+z*3,7);d+=L*3;for(var Z=lA(U),ie=(1<<Z)-1,ue=us(U,Z,1),z=0;z<I;){var X=ue[n5(e,d,ie)];d+=X&15;var x=X>>4;if(x<16)N[z++]=x;else{var W=0,Me=0;for(x==16?(Me=3+n5(e,d,3),d+=2,W=N[z-1]):x==17?(Me=3+n5(e,d,7),d+=3):x==18&&(Me=11+n5(e,d,127),d+=7);Me--;)N[z++]=W}}var Fe=N.subarray(0,k),Se=N.subarray(k);S=lA(Fe),v=lA(Se),m=us(Fe,S,1),h=us(Se,v,1)}else L3(1);else{var x=bA(d)+4,_=e[x-4]|e[x-3]<<8,$=x+_;if($>r){l&&L3(0);break}s&&c(p+_),n.set(e.subarray(x,$),p),t.b=p+=_,t.p=d=$*8,t.f=u;continue}if(d>g){l&&L3(0);break}}s&&c(p+131072);for(var $e=(1<<S)-1,He=(1<<v)-1,r1=d;;r1=d){var W=m[cA(e,d)&$e],b1=W>>4;if(d+=W&15,d>g){l&&L3(0);break}if(W||L3(2),b1<256)n[p++]=b1;else if(b1==256){r1=d,m=null;break}else{var p1=b1-254;if(b1>264){var z=b1-257,re=hw[z];p1=n5(e,d,(1<<re)-1)+$G[z],d+=re}var fe=h[cA(e,d)&He],Ve=fe>>4;fe||L3(3),d+=fe&15;var Se=h4e[Ve];if(Ve>3){var re=gw[Ve];Se+=cA(e,d)&(1<<re)-1,d+=re}if(d>g){l&&L3(0);break}s&&c(p+131072);var l1=p+p1;if(p<Se){var v1=i-Se,D1=Math.min(Se,l1);for(v1+p<0&&L3(3);p<D1;++p)n[p]=o[v1+p]}for(;p<l1;++p)n[p]=n[p-Se]}}t.l=m,t.p=r1,t.b=p,t.f=u,m&&(u=1,t.m=S,t.d=h,t.n=v)}while(!u);return p!=n.length&&a?sg(n,0,p):n.subarray(0,p)},E0=function(e,t,n){n<<=t&7;var o=t/8|0;e[o]|=n,e[o+1]|=n>>8},og=function(e,t,n){n<<=t&7;var o=t/8|0;e[o]|=n,e[o+1]|=n>>8,e[o+2]|=n>>16},uA=function(e,t){for(var n=[],o=0;o<e.length;++o)e[o]&&n.push({s:o,f:e[o]});var r=n.length,i=n.slice();if(!r)return{t:EG,l:0};if(r==1){var a=new Rr(n[0].s+1);return a[n[0].s]=1,{t:a,l:1}}n.sort(function($,k){return $.f-k.f}),n.push({s:-1,f:25001});var s=n[0],l=n[1],c=0,u=1,d=2;for(n[0]={s:-1,f:s.f+l.f,l:s,r:l};u!=r-1;)s=n[n[c].f<n[d].f?c++:d++],l=n[c!=u&&n[c].f<n[d].f?c++:d++],n[u++]={s:-1,f:s.f+l.f,l:s,r:l};for(var p=i[0].s,o=1;o<r;++o)i[o].s>p&&(p=i[o].s);var m=new Ca(p+1),h=hA(n[u-1],m,0);if(h>t){var o=0,S=0,v=h-t,g=1<<v;for(i.sort(function(k,L){return m[L.s]-m[k.s]||k.f-L.f});o<r;++o){var y=i[o].s;if(m[y]>t)S+=g-(1<<h-m[y]),m[y]=t;else break}for(S>>=v;S>0;){var x=i[o].s;m[x]<t?S-=1<<t-m[x]++-1:++o}for(;o>=0&&S;--o){var _=i[o].s;m[_]==t&&(--m[_],++S)}h=t}return{t:new Rr(m),l:h}},hA=function(e,t,n){return e.s==-1?Math.max(hA(e.l,t,n+1),hA(e.r,t,n+1)):t[e.s]=n},wG=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Ca(++t),o=0,r=e[0],i=1,a=function(l){n[o++]=l},s=1;s<=t;++s)if(e[s]==r&&s!=t)++i;else{if(!r&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(r),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(r);i=1,r=e[s]}return{c:n.subarray(0,o),n:t}},ig=function(e,t){for(var n=0,o=0;o<t.length;++o)n+=e[o]*t[o];return n},MG=function(e,t,n){var o=n.length,r=bA(t+2);e[r]=o&255,e[r+1]=o>>8,e[r+2]=e[r]^255,e[r+3]=e[r+1]^255;for(var i=0;i<o;++i)e[r+i+4]=n[i];return(r+4+o)*8},_G=function(e,t,n,o,r,i,a,s,l,c,u){E0(t,u++,n),++r[256];for(var d=uA(r,15),p=d.t,m=d.l,h=uA(i,15),S=h.t,v=h.l,g=wG(p),y=g.c,x=g.n,_=wG(S),$=_.c,k=_.n,L=new Ca(19),I=0;I<y.length;++I)++L[y[I]&31];for(var I=0;I<$.length;++I)++L[$[I]&31];for(var N=uA(L,7),U=N.t,z=N.l,Z=19;Z>4&&!U[pA[Z-1]];--Z);var ie=c+5<<3,ue=ig(r,v7)+ig(i,ag)+a,X=ig(r,p)+ig(i,S)+a+14+3*Z+ig(L,U)+2*L[16]+3*L[17]+7*L[18];if(l>=0&&ie<=ue&&ie<=X)return MG(t,u,e.subarray(l,l+c));var W,Me,Fe,Se;if(E0(t,u,1+(X<ue)),u+=2,X<ue){W=us(p,m,0),Me=p,Fe=us(S,v,0),Se=S;var $e=us(U,z,0);E0(t,u,x-257),E0(t,u+5,k-1),E0(t,u+10,Z-4),u+=14;for(var I=0;I<Z;++I)E0(t,u+3*I,U[pA[I]]);u+=3*Z;for(var He=[y,$],r1=0;r1<2;++r1)for(var b1=He[r1],I=0;I<b1.length;++I){var p1=b1[I]&31;E0(t,u,$e[p1]),u+=U[p1],p1>15&&(E0(t,u,b1[I]>>5&127),u+=b1[I]>>12)}}else W=g4e,Me=v7,Fe=v4e,Se=ag;for(var I=0;I<s;++I){var re=o[I];if(re>255){var p1=re>>18&31;og(t,u,W[p1+257]),u+=Me[p1+257],p1>7&&(E0(t,u,re>>23&31),u+=hw[p1]);var fe=re&31;og(t,u,Fe[fe]),u+=Se[fe],fe>3&&(og(t,u,re>>5&8191),u+=gw[fe])}else og(t,u,W[re]),u+=Me[re]}return og(t,u,W[256]),u+Me[256]},w4e=new vA([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),EG=new Rr(0),_4e=function(e,t,n,o,r,i){var a=i.z||e.length,s=new Rr(o+a+5*(1+Math.ceil(a/7e3))+r),l=s.subarray(o,s.length-r),c=i.l,u=(i.r||0)&7;if(t){u&&(l[0]=i.r>>3);for(var d=w4e[t-1],p=d>>13,m=d&8191,h=(1<<n)-1,S=i.p||new Ca(32768),v=i.h||new Ca(h+1),g=Math.ceil(n/3),y=2*g,x=function(_e){return(e[_e]^e[_e+1]<<g^e[_e+2]<<y)&h},_=new vA(25e3),$=new Ca(288),k=new Ca(32),L=0,I=0,N=i.i||0,U=0,z=i.w||0,Z=0;N+2<a;++N){var ie=x(N),ue=N&32767,X=v[ie];if(S[ue]=X,v[ie]=ue,z<=N){var W=a-N;if((L>7e3||U>24576)&&(W>423||!c)){u=_G(e,l,0,_,$,k,I,U,Z,N-Z,u),U=L=I=0,Z=N;for(var Me=0;Me<286;++Me)$[Me]=0;for(var Me=0;Me<30;++Me)k[Me]=0}var Fe=2,Se=0,$e=m,He=ue-X&32767;if(W>2&&ie==x(N-He))for(var r1=Math.min(p,W)-1,b1=Math.min(32767,N),p1=Math.min(258,W);He<=b1&&--$e&&ue!=X;){if(e[N+Fe]==e[N+Fe-He]){for(var re=0;re<p1&&e[N+re]==e[N+re-He];++re);if(re>Fe){if(Fe=re,Se=He,re>r1)break;for(var fe=Math.min(He,re-2),Ve=0,Me=0;Me<fe;++Me){var l1=N-He+Me&32767,v1=S[l1],D1=l1-v1&32767;D1>Ve&&(Ve=D1,X=l1)}}}ue=X,X=S[ue],He+=ue-X&32767}if(Se){_[U++]=268435456|fA[Fe]<<18|xG[Se];var Oe=fA[Fe]&31,Be=xG[Se]&31;I+=hw[Oe]+gw[Be],++$[257+Oe],++k[Be],z=N+Fe,++L}else _[U++]=e[N],++$[e[N]]}}for(N=Math.max(N,z);N<a;++N)_[U++]=e[N],++$[e[N]];u=_G(e,l,c,_,$,k,I,U,Z,N-Z,u),c||(i.r=u&7|l[u/8|0]<<3,u-=7,i.h=v,i.p=S,i.i=N,i.w=z)}else{for(var N=i.w||0;N<a+c;N+=65535){var c1=N+65535;c1>=a&&(l[u/8|0]=c,c1=a),u=MG(l,u+1,e.subarray(N,c1))}i.i=a}return sg(s,0,o+bA(u)+r)},P4e=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,o=9;--o;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),C4e=function(){var e=-1;return{p:function(t){for(var n=e,o=0;o<t.length;++o)n=P4e[n&255^t[o]]^n>>>8;e=n},d:function(){return~e}}};var k4e=function(e,t,n,o,r){if(!r&&(r={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),a=new Rr(i.length+e.length);a.set(i),a.set(e,i.length),e=a,r.w=i.length}return _4e(e,t.level==null?6:t.level,t.mem==null?r.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,o,r)},TG=function(e,t){var n={};for(var o in e)n[o]=e[o];for(var o in t)n[o]=t[o];return n};var cs=function(e,t){return e[t]|e[t+1]<<8},m4=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},dA=function(e,t){return m4(e,t)+m4(e,t+4)*4294967296},m3=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function R4e(e,t){return k4e(e,t||{},0,0)}function $4e(e,t){return x4e(e,{i:2},t&&t.out,t&&t.dictionary)}var AG=function(e,t,n,o){for(var r in e){var i=e[r],a=t+r,s=o;Array.isArray(i)&&(s=TG(o,i[1]),i=i[0]),ArrayBuffer.isView(i)?n[a]=[i,s]:(n[a+="/"]=[new Rr(0),s],AG(i,a,n,o))}},PG=typeof TextEncoder<"u"&&new TextEncoder,gA=typeof TextDecoder<"u"&&new TextDecoder,z4e=0;try{gA.decode(EG,{stream:!0}),z4e=1}catch{}var M4e=function(e){for(var t="",n=0;;){var o=e[n++],r=(o>127)+(o>223)+(o>239);if(n+r>e.length)return{s:t,r:sg(e,n-1)};r?r==3?(o=((o&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|o>>10,56320|o&1023)):r&1?t+=String.fromCharCode((o&31)<<6|e[n++]&63):t+=String.fromCharCode((o&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(o)}};function h4(e,t){if(t){for(var n=new Rr(e.length),o=0;o<e.length;++o)n[o]=e.charCodeAt(o);return n}if(PG)return PG.encode(e);for(var r=e.length,i=new Rr(e.length+(e.length>>1)),a=0,s=function(u){i[a++]=u},o=0;o<r;++o){if(a+5>i.length){var l=new Rr(a+8+(r-o<<1));l.set(i),i=l}var c=e.charCodeAt(o);c<128||t?s(c):c<2048?(s(192|c>>6),s(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|e.charCodeAt(++o)&1023,s(240|c>>18),s(128|c>>12&63),s(128|c>>6&63),s(128|c&63)):(s(224|c>>12),s(128|c>>6&63),s(128|c&63))}return sg(i,0,a)}function T0(e,t){if(t){for(var n="",o=0;o<e.length;o+=16384)n+=String.fromCharCode.apply(null,e.subarray(o,o+16384));return n}else{if(gA)return gA.decode(e);var r=M4e(e),i=r.s,n=r.r;return n.length&&L3(8),i}}var E4e=function(e,t){return t+30+cs(e,t+26)+cs(e,t+28)},T4e=function(e,t,n){var o=cs(e,t+28),r=cs(e,t+30),i=T0(e.subarray(t+46,t+46+o),!(cs(e,t+8)&2048)),a=t+46+o,s=A4e(e,a,r,n,m4(e,t+20),m4(e,t+24),m4(e,t+42)),l=s[0],c=s[1],u=s[2];return[cs(e,t+10),l,c,i,a+r+cs(e,t+32),u]},A4e=function(e,t,n,o,r,i,a){var s=r==4294967295,l=i==4294967295,c=a==4294967295,u=t+n,d=s+l+c;if(o&&d){for(;t+4<u;t+=4+cs(e,t+2))if(cs(e,t)==1)return[s?dA(e,t+4+8*l):r,l?dA(e,t+4):i,c?dA(e,t+4+8*(l+s)):a,1];o<2&&L3(13)}return[r,i,a,0]},yA=function(e){var t=0;if(e)for(var n in e){var o=e[n].length;o>65535&&L3(9),t+=o+4}return t},CG=function(e,t,n,o,r,i,a,s){var l=o.length,c=n.extra,u=s&&s.length,d=yA(c);m3(e,t,a!=null?33639248:67324752),t+=4,a!=null&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(i<0&&8),e[t++]=r&&8,e[t++]=n.compression&255,e[t++]=n.compression>>8;var p=new Date(n.mtime==null?Date.now():n.mtime),m=p.getFullYear()-1980;if((m<0||m>119)&&L3(10),m3(e,t,m<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>1),t+=4,i!=-1&&(m3(e,t,n.crc),m3(e,t+4,i<0?-i-2:i),m3(e,t+8,n.size)),m3(e,t+12,l),m3(e,t+14,d),t+=16,a!=null&&(m3(e,t,u),m3(e,t+6,n.attrs),m3(e,t+10,a),t+=14),e.set(o,t),t+=l,d)for(var h in c){var S=c[h],v=S.length;m3(e,t,+h),m3(e,t+2,v),e.set(S,t+4),t+=4+v}return u&&(e.set(s,t),t+=u),t},I4e=function(e,t,n,o,r){m3(e,t,101010256),m3(e,t+8,n),m3(e,t+10,n),m3(e,t+12,o),m3(e,t+16,r)};function yw(e,t){t||(t={});var n={},o=[];AG(e,"",n,t);var r=0,i=0;for(var a in n){var s=n[a],l=s[0],c=s[1],u=c.level==0?0:8,d=h4(a),p=d.length,m=c.comment,h=m&&h4(m),S=h&&h.length,v=yA(c.extra);p>65535&&L3(11);var g=u?R4e(l,c):l,y=g.length,x=C4e();x.p(l),o.push(TG(c,{size:l.length,crc:x.d(),c:g,f:d,m:h,u:p!=a.length||h&&m.length!=S,o:r,compression:u})),r+=30+p+v+y,i+=76+2*(p+v)+(S||0)+y}for(var _=new Rr(i+22),$=r,k=i-r,L=0;L<o.length;++L){var d=o[L];CG(_,d.o,d,d.f,d.u,d.c.length);var I=30+d.f.length+yA(d.extra);_.set(d.c,d.o+I),CG(_,r,d,d.f,d.u,d.c.length,d.o,d.m),r+=16+I+(d.m?d.m.length:0)}return I4e(_,r,o.length,k,$),_}function lg(e,t){for(var n={},o=e.length-22;m4(e,o)!=101010256;--o)(!o||e.length-o>65558)&&L3(13);var r=cs(e,o+8);if(!r)return{};var i=m4(e,o+16),a=m4(e,o-20)==117853008;if(a){var s=m4(e,o-12);a=m4(e,s)==101075792,a&&(r=m4(e,s+32),i=m4(e,s+48))}for(var l=t&&t.filter,c=0;c<r;++c){var u=T4e(e,i,a),d=u[0],p=u[1],m=u[2],h=u[3],S=u[4],v=u[5],g=E4e(e,v);i=S,(!l||l({name:h,size:p,originalSize:m,compression:d}))&&(d?d==8?n[h]=$4e(e.subarray(g,g+p),{out:new Rr(m)}):L3(14,"unknown compression type "+d):n[h]=sg(e,g,g+p))}return n}var j=H2(ho(),1);var b7=H2(ho(),1),VG=H2(OP(),1);function k8(e,t,n){let o=n.initialDeps??[],r,i=!0;function a(){var s,l,c;let u;n.key&&((s=n.debug)!=null&&s.call(n))&&(u=Date.now());let d=e();if(!(d.length!==o.length||d.some((h,S)=>o[S]!==h)))return r;o=d;let m;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(m=Date.now()),r=t(...d),n.key&&((c=n.debug)!=null&&c.call(n))){let h=Math.round((Date.now()-u)*100)/100,S=Math.round((Date.now()-m)*100)/100,v=S/16,g=(y,x)=>{for(y=String(y);y.length<x;)y=" "+y;return y};console.info(`%c\u23F1 ${g(S,5)} /${g(h,5)} ms`,`
116
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:Q.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:Q.string().optional().describe("User's timezone in IANA format."),userAgent:Q.string().optional().describe("Host application identifier."),platform:Q.union([Q.literal("web"),Q.literal("desktop"),Q.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:Q.object({touch:Q.boolean().optional().describe("Whether the device supports touch input."),hover:Q.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:Q.object({top:Q.number().describe("Top safe area inset in pixels."),right:Q.number().describe("Right safe area inset in pixels."),bottom:Q.number().describe("Bottom safe area inset in pixels."),left:Q.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),Wae=Q.object({method:Q.literal("ui/notifications/host-context-changed"),params:wW.describe("Partial context update containing only changed fields.")}),hge=Q.object({method:Q.literal("ui/update-model-context"),params:Q.object({content:Q.array(os).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:Q.record(Q.string(),Q.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),gge=Q.object({method:Q.literal("ui/initialize"),params:Q.object({appInfo:ns.describe("App identification (name and version)."),appCapabilities:Fae.describe("Features and capabilities this app provides."),protocolVersion:Q.string().describe("Protocol version this app supports.")})}),Gae=Q.object({protocolVersion:Q.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:ns.describe("Host application identification and version."),hostCapabilities:Uae.describe("Features and capabilities provided by the host."),hostContext:wW.describe("Rich context about the host environment.")}).passthrough(),Zae={target:"draft-2020-12"};async function SW(e,t){let n=e["~standard"];if(n.jsonSchema)return n.jsonSchema[t](Zae);throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function xW(e,t,n=""){let o=await e["~standard"].validate(t);if(o.issues){let r=o.issues.map(i=>{let a=i.path?.map(s=>typeof s=="object"?s.key:s).join(".");return a?`${a}: ${i.message}`:i.message}).join("; ");throw Error(n+r)}return o.value}function _W(e,t=document.documentElement){for(let[n,o]of Object.entries(e))o!==void 0&&t.style.setProperty(n,o)}function Xae(e,t){let n={...e,...t};return t.experimental!==void 0&&(n.experimental={...e.experimental,...t.experimental}),t.tools!==void 0&&(n.tools={...e.tools,...t.tools}),n}var rw=class e extends VT{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new qT;_methods=new WT;setRequestHandler=(...t)=>{let[n,...o]=vW("request",t)??t;this._methods.claim(n,"setRequestHandler"),super.setRequestHandler.call(this,n,...o)};setNotificationHandler=(...t)=>{let[n,...o]=vW("notification",t)??t;this._methods.claim(n,"setNotificationHandler"),super.setNotificationHandler.call(this,n,...o)};removeRequestHandler=t=>{this._methods.release(t),super.removeRequestHandler(t)};removeNotificationHandler=t=>{this._methods.release(t),super.removeNotificationHandler(t)};replaceRequestHandler=(t,...n)=>{this._methods.replace(t),super.setRequestHandler.call(this,t,...n)};_assertInitialized(t){if(this._initializedSent)return;let n=`[ext-apps] App.${t}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(n);console.warn(`${n}. This will throw in a future release.`)}eventSchemas={toolinput:Iae,toolinputpartial:Nae,toolresult:qae,toolcancelled:Oae,hostcontextchanged:Wae};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(t,n){n&&this._assertHandlerTiming(t),this._ensureEventSlot(t),this._events.setHandler(t,n)}addEventListener(t,n){this._assertHandlerTiming(t),this._ensureEventSlot(t),this._events.addEventListener(t,n)}removeEventListener(t,n){this._events.removeEventListener(t,n)}_ensureEventSlot(t){if(this._registeredEvents.has(t))return;let n=this.eventSchemas[t];if(!n)throw Error(`Unknown event: ${String(t)}`);this.setNotificationHandler(n.shape.method.value,{params:n.shape.params},o=>{let r=o;t==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...r}),this._events.dispatch(t,r)}),this._registeredEvents.add(t)}getEventHandler(t){return this._events.getHandler(t)}warnIfRequestHandlerReplaced(t,n,o){n&&o&&console.warn(`[MCP Apps] ${t} handler replaced. Previous handler will no longer be called.`)}constructor(t,n={},o={autoResize:!0}){super(o),this._appInfo=t,this._appCapabilities=n,this.options=o,this._methods.replace("notifications/cancelled"),this._methods.replace("notifications/progress"),!o.allowUnsafeEval&&Q.config({jitless:!0}),this.replaceRequestHandler("ping",r=>(console.log("Received ping:",r.params),{})),this.setEventHandler("hostcontextchanged",void 0)}buildContext(t){return t}registerAppCapabilities(t){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._appCapabilities=Xae(this._appCapabilities,t)}registerTool(t,n,o){if(this._registeredTools[t])throw Error(`Tool ${t} is already registered`);let r=this,i=()=>{r._initializedSent&&r._appCapabilities.tools?.listChanged&&r.sendToolListChanged()},a=n.inputSchema!==void 0,s={title:n.title,description:n.description,inputSchema:n.inputSchema,outputSchema:n.outputSchema,annotations:n.annotations,_meta:n._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(l){Object.assign(this,l),i()},remove(){r._registeredTools[t]===s&&(delete r._registeredTools[t],i())},handler:async(l,c)=>{if(!s.enabled)throw Error(`Tool ${t} is disabled`);let u;if(a){let d=s.inputSchema,p=d?await xW(d,l??{},`Invalid input for tool ${t}: `):l??{};u=await o(p,c)}else u=await o(c);return s.outputSchema&&!u.isError&&(u.structuredContent=await xW(s.outputSchema,u.structuredContent,`Invalid output for tool ${t}: `)),u}};return this._registeredTools[t]=s,!this._appCapabilities.tools&&!this.transport&&this.registerAppCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),s}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(t,n)=>{let o=this._registeredTools[t.name];if(!o)throw Error(`Tool ${t.name} not found`);return o.handler(t.arguments,n)},this.onlisttools=async(t,n)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([o,r])=>r.enabled).map(async([o,r])=>{let i={name:o,title:r.title,description:r.description,inputSchema:r.inputSchema?await SW(r.inputSchema,"input"):{type:"object",properties:{}}};return r.outputSchema&&(i.outputSchema=await SW(r.outputSchema,"output")),r.annotations&&(i.annotations=r.annotations),r._meta&&(i._meta=r._meta),i}))}))}async sendToolListChanged(t={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:t})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(t){this.setEventHandler("toolinput",t)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(t){this.setEventHandler("toolinputpartial",t)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(t){this.setEventHandler("toolresult",t)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(t){this.setEventHandler("toolcancelled",t)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(t){this.setEventHandler("hostcontextchanged",t)}_onteardown;get onteardown(){return this._onteardown}set onteardown(t){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,t),this._onteardown=t,this.replaceRequestHandler("ui/resource-teardown",{params:Bae.shape.params,result:jae},(n,o)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(n,o)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(t){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,t),this._oncalltool=t,this.replaceRequestHandler("tools/call",(n,o)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(n.params,o)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(t){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,t),this._onlisttools=t,this.replaceRequestHandler("tools/list",(n,o)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(n.params,o)})}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${t})`);break}}assertRequestHandlerCapability(t){switch(t){case"tools/call":case"tools/list":if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${t})`);return;default:return}}assertNotificationCapability(t){}async callServerTool(t,n){if(this._assertInitialized("callServerTool"),typeof t=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${t}"). Did you mean: callServerTool({ name: "${t}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:t},{onprogress:()=>{},resetTimeoutOnProgress:!0,...n})}async readServerResource(t,n){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:t},n)}async listServerResources(t,n){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:t},n)}async createSamplingMessage(t,n){return this._assertInitialized("createSamplingMessage"),await this.request({method:"sampling/createMessage",params:t},n)}sendMessage(t,n){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:t},Aae,n)}sendLog(t){return this.notification({method:"notifications/message",params:t})}updateModelContext(t,n){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:t},m7,n)}openLink(t,n){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:t},Eae,n)}sendOpenLink=this.openLink;downloadFile(t,n){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:t},Tae,n)}requestTeardown(t={}){return this.notification({method:"ui/notifications/request-teardown",params:t})}requestDisplayMode(t,n){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:t},Hae,n)}sendSizeChanged(t){return this.notification({method:"ui/notifications/size-changed",params:t})}setupSizeChangedNotifications(){let t=!1,n=0,o=0,r=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1;let a=document.documentElement,s=a.style.height;a.style.height="max-content";let l=Math.ceil(a.getBoundingClientRect().height);a.style.height=s;let c=Math.ceil(window.innerWidth);(c!==n||l!==o)&&(n=c,o=l,this.sendSizeChanged({width:c,height:l}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(t=new Zh(window.parent,window.parent),n){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1;try{await super.connect(t);let o=await this.request({method:"ui/initialize",params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:kae}},Gae,n);if(o===void 0)throw Error(`Server sent invalid initialize result: ${o}`);this._hostCapabilities=o.hostCapabilities,this._hostInfo=o.hostInfo,this._hostContext=o.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(o){throw this.close(),o}}};var or={name:"spreadsheets",version:"0.2.1",title:{en:"Spreadsheets","zh-CN":"\u7535\u5B50\u8868\u683C"},kinds:["xlsx"]};var PW=or.version,CW=or.name,Pge=or.name,Cge=`ui://${or.name}/panel.html`,XT=`ui://${or.name}/assets/`,kW=`ui://${or.name}/file/`;var e5=or.kinds,Kh=100*1024*1024,kge=512*1024*1024,YT=4*1024*1024,Rge=24*1024,Yh=class extends Error{constructor(n,o){super(o);this.code=n;this.name="OfficeError"}};function Jh(e){let t=e.toLowerCase().match(/\.([a-z]+)$/)?.[1];return e5.includes(t??"")?t:null}var Yae={en:{sep:", ",and:" and ",or:" or "},"zh-CN":{sep:"\u3001",and:"\u548C",or:"\u6216"}};function p4(e,t="en",n="and"){let o=Yae[t];if(e.length<2)return e.join("");let r=e[e.length-1],i=t==="zh-CN"&&/^[\x20-\x7e]/.test(r)?` ${o[n]} `:o[n];return`${e.slice(0,-1).join(o.sep)}${i}${r}`}function _8(e="en",t="and"){return p4(e5.map(n=>`.${n}`),e,t)}var as=(e,t)=>new Yh("invalid_anchor",`Cannot read location "${e}". ${t}`),ss={docx:"Use p:N, p:N-M, t:N or t:N/rRcC.",pptx:"Use slide:N, slide:N-M or slide:N/shape:ID.",pdf:"Use page:N or page:N-M.",xlsx:"Use Sheet, Sheet!A1 or Sheet!A1:C9 (quote names with spaces: 'My sheet'!A1)."};function KT(e,t,n){if(!t)throw as(e,ss[n]);let o=Number(t[1]),r=t[2]===void 0?o:Number(t[2]);if(!(o>=1)||!(r>=o)||r>1e6)throw as(e,ss[n]);return{from:o,to:r}}function Kae(e){let t="";for(let n=e;n>0;n=Math.floor((n-1)/26))t=String.fromCharCode(65+(n-1)%26)+t;return t}function JT(e){let t=/^\$?([A-Za-z]{1,3})\$?(\d{1,7})$/.exec(e);if(!t)return null;let n=0;for(let r of t[1].toUpperCase())n=n*26+(r.charCodeAt(0)-64);let o=Number(t[2]);return o<1||o>1048576||n>16384?null:{row:o,col:n}}var ow=e=>`${Kae(e.col)}${e.row}`;function Jae(e){return/^[A-Za-z_À-￿][\w.À-￿]*$/.test(e)&&!JT(e)?e:`'${e.replace(/'/g,"''")}'`}function Qae(e){let t,n;if(e.startsWith("'")){let s=1;for(t="";s<e.length;s++)if(e[s]==="'")if(e[s+1]==="'")t+="'",s++;else break;else t+=e[s];if(s>=e.length||(n=e.slice(s+1),n&&!n.startsWith("!")))throw as(e,ss.xlsx);n=n.slice(1)}else{let s=e.lastIndexOf("!");t=s<0?e:e.slice(0,s),n=s<0?"":e.slice(s+1)}if(!t||t.length>64)throw as(e,ss.xlsx);if(!n)return{kind:"xlsx",sheet:t};let[o,r=o]=n.split(":"),i=JT(o),a=JT(r);if(!i||!a)throw as(e,ss.xlsx);return{kind:"xlsx",sheet:t,range:{start:{row:Math.min(i.row,a.row),col:Math.min(i.col,a.col)},end:{row:Math.max(i.row,a.row),col:Math.max(i.col,a.col)}}}}function QT(e,t){let n=t.trim();if(!n||n.length>300)throw as(t,ss[e]);switch(e){case"docx":{let o=/^t:(\d+)(?:\/r(\d+)c(\d+))?$/i.exec(n);if(o){let r=Number(o[1]);if(r<1)throw as(n,ss.docx);if(o[2]===void 0)return{kind:e,type:"table",table:r};let i={row:Number(o[2]),col:Number(o[3])};if(i.row<1||i.col<1)throw as(n,ss.docx);return{kind:e,type:"table",table:r,cell:i}}return{kind:e,type:"paragraph",...KT(n,/^p:(\d+)(?:-(?:p:)?(\d+))?$/i.exec(n),e)}}case"pptx":{let o=/^slide:(\d+)\/shape:([\w-]{1,32})$/i.exec(n);if(o){let r=Number(o[1]);if(r<1)throw as(n,ss.pptx);return{kind:e,from:r,to:r,shape:o[2]}}return{kind:e,...KT(n,/^slide:(\d+)(?:-(?:slide:)?(\d+))?$/i.exec(n),e)}}case"pdf":return{kind:e,...KT(n,/^page:(\d+)(?:-(?:page:)?(\d+))?$/i.exec(n),e)};case"xlsx":return Qae(n)}}function Ru(e){let t=(n,o,r)=>o===r?`${n}:${o}`:`${n}:${o}-${r}`;switch(e.kind){case"docx":return e.type==="paragraph"?t("p",e.from,e.to):e.cell?`t:${e.table}/r${e.cell.row}c${e.cell.col}`:`t:${e.table}`;case"pptx":return e.shape?`slide:${e.from}/shape:${e.shape}`:t("slide",e.from,e.to);case"pdf":return t("page",e.from,e.to);case"xlsx":{let n=Jae(e.sheet);if(!e.range)return n;let{start:o,end:r}=e.range,i=ow(o),a=ow(r);return i===a?`${n}!${i}`:`${n}!${i}:${a}`}}}function RW(e){let t=/^(.*?\.(?:docx|xlsx|pptx|pdf))(?:#(.*))?$/i.exec(e.trim());if(!t)throw new Yh("invalid_anchor",`"${e}" is not a document anchor. Use <path>.docx|.xlsx|.pptx|.pdf optionally followed by #<location>.`);return{path:t[1],at:t[2]?.trim()?t[2].trim():null}}function Qh(e,t){return t?`${e}#${t}`:e}var $W=e=>e>=55296&&e<=56319,zW=e=>e>=56320&&e<=57343;function MW(e,t,n=e.length){let o=Math.max(0,Math.min(t,e.length)),r=Math.max(o,Math.min(n,e.length));return o>0&&zW(e.charCodeAt(o))&&$W(e.charCodeAt(o-1))&&o--,r<e.length&&zW(e.charCodeAt(r))&&$W(e.charCodeAt(r-1))&&r--,e.slice(o,r)}var e4e=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,aw=e=>e.replace(e4e,"\uFFFD");function iw(e){return typeof e=="string"?aw(e):Array.isArray(e)?e.map(t=>iw(t)):e&&typeof e=="object"&&Object.getPrototypeOf(e)===Object.prototype?Object.fromEntries(Object.entries(e).map(([t,n])=>[t,iw(n)])):e}var EW=`${or.name}:windows:v1`,t4e=128;function TW(e){try{let t=JSON.parse(e.getItem(EW)??"{}");return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function eA(e,t){let n=TW(e)[t];return!n||typeof n!="object"?{}:{...typeof n.path=="string"?{path:n.path}:{},...Array.isArray(n.recent)?{recent:n.recent.filter(o=>typeof o?.path=="string"&&Jh(o.path)===o.kind)}:{}}}function AW(e,t,n){try{let o=TW(e),r={...eA(e,t),...n};delete o[t],o[t]=r;for(let i of Object.keys(o).slice(0,-t4e))delete o[i];e.setItem(EW,JSON.stringify(o))}catch{}}var $u=e=>e.filter(([t])=>e5.includes(t)).map(([,t])=>t),n4e={docx:"Word",xlsx:"Excel",pptx:"PowerPoint",pdf:"PDF"},IW=e5.filter(e=>e!=="pdf"),NW=[...IW.length===3?["Office"]:IW.map(e=>n4e[e]),...e5.includes("pdf")?["PDF"]:[]],eg=or.title.en,Lge=(()=>{let e=p4(NW,"en","or");return`${/^[AEIOU]/.test(e)?"an":"a"} ${e} file`})(),Dge=`${p4(NW)} files`,Bge=_8("en","or"),jge=$u([["docx","report.docx#p:12"],["xlsx","model.xlsx#Revenue!B2:F9"],["pptx","deck.pptx#slide:3"],["pdf","paper.pdf#page:5"]]).join(", "),Uge=$u([["docx","p:12"],["pptx","slide:3"],["pdf","page:5"],["xlsx","Revenue!B2:F9"]]).join(", "),Fge=$u([["docx","Word paragraphs and tables (markdown)"],["xlsx","spreadsheet cells as a grid with formulas"],["pptx","slides with their shapes and speaker notes"],["pdf","PDF page text"]]).join(", "),Hge=p4($u([["docx","paragraph"],["xlsx","cell range"],["pptx","slide"],["pptx","shape"],["pdf","page"]]),"en","or"),Vge=p4($u([["pdf","PDF pages"],["docx","long paragraphs"]]))||"long passages",OW=p4($u([["pptx","deck.pptx#slide:3"],["pdf","paper.pdf#page:2"],["docx","report.docx#p:12"],["xlsx","model.xlsx#Revenue!A1:H30"]]),"en","or");var LW=[{name:"capture_view",title:`Capture ${eg} view`,description:`Take a picture of a rendered document location in the ${eg} panel so you can see layout, charts, images and formatting that text extraction misses. Pass an anchor such as ${OW} (the document must be open in the panel; call open_document first), or omit it to capture what the user currently sees.`,inputSchema:{type:"object",properties:{anchor:{type:"string",maxLength:1200,description:"Location to capture; defaults to the visible view."},maxWidth:{type:"integer",minimum:320,maximum:2e3,description:"Maximum image width in pixels (default 1600)."}},additionalProperties:!1},annotations:{readOnlyHint:!0,idempotentHint:!0}}];function r4e(){let e=crypto.randomUUID(),t=()=>n.getHostCapabilities()?.experimental?.["zcode/surface"]?.stateKey??e,n=new rw({name:CW,version:PW},{tools:{listChanged:!0},availableDisplayModes:["inline","fullscreen"]},{autoResize:!1}),o=[],r=new Map,i=new Set,a,s=c=>void window.dispatchEvent(new Event(`office:${c}`));return n.ontoolresult=c=>{o.push(c),o.length>20&&o.shift(),s("toolresult")},n.onhostcontextchanged=()=>s("hostchange"),n.onlisttools=async()=>({tools:LW}),n.oncalltool=async(c,u)=>{if(!LW.some(d=>d.name===c.name))return{isError:!0,content:[{type:"text",text:`The ${eg} page has no tool ${c.name}.`}]};try{let d=Date.now()+2e4;for(;!r.has(c.name)&&Date.now()<d;)await new Promise(h=>{let S=()=>(i.delete(S),h());i.add(S),setTimeout(S,500)});let p=r.get(c.name);if(!p)throw new Error(`The ${eg} panel is still loading; try again in a moment.`);let m=u;return await p(c.arguments??{},m.mcpReq?.signal??m.signal)}catch(d){return{isError:!0,content:[{type:"text",text:d instanceof Error?d.message:String(d)}]}}},window.addEventListener("pagehide",()=>{n.callServerTool({name:"release_view",arguments:{viewId:t()}}).catch(()=>{})}),{app:n,get viewId(){return t()},ready:()=>a??=n.connect(new Zh(window.parent,window.parent)).then(()=>s("hostchange")),readWindow(){let c=n.getHostCapabilities()?.experimental?.["zcode/surface"];if(!c?.stateKey)return{};try{return eA(localStorage,c.stateKey)}catch{return{}}},saveWindow(c){let u=n.getHostCapabilities()?.experimental?.["zcode/surface"];if(u?.stateKey)try{AW(localStorage,u.stateKey,c)}catch{}},readDocument(){return this.readWindow().path??null},saveDocument(c){this.saveWindow({path:c})},takeResults:()=>o.splice(0,o.length),handleTool(c,u){r.set(c,u);for(let d of i)d()},get context(){return n.getHostContext()},get capabilities(){return n.getHostCapabilities()}}}function f4(){return window.__officeHost??=r4e()}async function nA(e){let t=f4();await t.ready();let o=(await t.app.readServerResource({uri:e})).contents[0];if(!o)throw new Error(`Empty resource ${e}`);return o}async function DW(e){let t=await nA(XT+e);if(typeof t.text!="string")throw new Error(`Asset ${e} is not text`);return t.text}function BW(e){let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}var tA=new Map;function jW(e){let t=tA.get(e);return t||(t=nA(XT+e).then(n=>{if(typeof n.blob!="string")throw new Error(`Asset ${e} is not binary`);return BW(n.blob)}),t.catch(()=>tA.delete(e)),tA.set(e,t)),t}async function UW(e,t){let n=new Uint8Array(e.bytes),o=0;for(let r=0;r<e.chunks;r++){t?.throwIfAborted();let i=await nA(`${kW}${e.token}/${r}`);if(typeof i.blob!="string")throw new Error("File chunk is not binary");let a=BW(i.blob);n.set(a,o),o+=a.byteLength}if(o!==e.bytes)throw new Error("The file changed while it was loading; reload it.");return n.buffer}var sw=H2(ho(),1);var tg=class extends Error{constructor(n,o){super(n);this.code=o;this.name="CallError"}};async function ls(e,t={}){let n=f4();await n.ready();let o=await n.app.callServerTool({name:e,arguments:t}),r=o.structuredContent,i=r?.error;if(o.isError||i){let a=o.content?.[0]?.text;throw new tg(i?.message??a??`${e} failed`,i?.code)}return r}var P8=e=>e.slice(e.lastIndexOf("/")+1),FW=e=>{let t=e.lastIndexOf("/");return t>0?e.slice(0,t):""};async function HW(e){let{id:t}=await ls("begin_file_import",{name:e.name,size:e.size});try{for(let o=0;o<e.size;o+=YT){let r=await new Promise((i,a)=>{let s=new FileReader;s.onload=()=>i(String(s.result).split(",")[1]),s.onerror=()=>a(s.error),s.readAsDataURL(e.slice(o,o+YT))});await ls("write_file_import",{id:t,offset:o,data:r})}return(await ls("finish_file_import",{id:t})).path}catch(n){throw await ls("cancel_file_import",{id:t}).catch(()=>{}),n}}var lw=(e,t)=>e.length>t?`${MW(e,0,t-1)}\u2026`:e;function rA(){return f4().readWindow().recent??[]}function VW(e){f4().saveWindow({recent:e})}function ng(e,t,n){let o=t instanceof tg?t.code:t?.name==="PasswordException"?"password":void 0,[r,i]=o&&e.errors[o]||e.errors.generic,a=t instanceof Error?t.message:String(t);return{path:n,title:r,detail:i||a}}function qW(){let[,e]=(0,sw.useState)(0);return(0,sw.useEffect)(()=>{let t=()=>e(n=>n+1);return window.addEventListener("office:hostchange",t),()=>window.removeEventListener("office:hostchange",t)},[]),f4().context}var o4e={docx:"Word",xlsx:"Excel",pptx:"PowerPoint",pdf:"PDF"},GW=e5.map(e=>o4e[e]),zu=e=>e5.includes(e),WW=zu("docx")||zu("pdf"),ZW={en:`any ${p4([...WW?["passage"]:[],...zu("xlsx")?["cell"]:[],...zu("pptx")?["slide"]:[]],"en","or")}`,zh:p4([...WW?["\u6BB5\u843D"]:[],...zu("xlsx")?["\u5355\u5143\u683C"]:[],...zu("pptx")?["\u5E7B\u706F\u7247"]:[]],"zh-CN","or")},oA=or.title["zh-CN"].replace(/[\x20-\x7e]$/,"$& "),i4e={title:or.title.en,openTitle:"Open a document",openFile:"Open file",emptyTitle:`Open your ${p4(GW)} file`,emptyDescription:`Read alongside your conversation and discuss ${ZW.en}.`,emptyCaption:`Choose a local file \xB7 ${_8("en","or")}`,importing:"Importing\u2026",importTooLarge:`Choose a file no larger than ${Kh/1024/1024} MiB.`,recent:"Recent",switchDocument:"Switch document",pagesAndOutline:"Pages and outline",outlineOnly:"Outline",pages:"Pages",slides:"Slides",outline:"Outline",find:"Find",findPlaceholder:"Find in document",findCount:(e,t)=>`${e} of ${t}`,noResults:"No results",previousMatch:"Previous match (\u21E7Enter)",nextMatch:"Next match (Enter)",closeFind:"Close (Esc)",more:"More",fitWidth:"Fit width",fitPage:"Fit page",actualSize:"Actual size",reload:"Reload from disk",previousPage:"Previous page",nextPage:"Next page",pageNumber:"Page number",ofPages:e=>`of ${e}`,zoomIn:"Zoom in (\u2318+)",zoomOut:"Zoom out (\u2318\u2212)",fit:"Fit",addToChat:"Add to chat",addShort:"Add",addToChatHint:"Attach this to your next message (\u2318/Ctrl+Enter)",added:"Added to chat",ask:"Ask",askPlaceholder:"Ask about this\u2026",send:"Send",cancel:"Cancel",sendKey:"send",cancelKey:"cancel",copy:"Copy",copied:"Copied",agent:"Agent",agentOf:(e,t)=>`Agent \xB7 ${e} of ${t}`,nextTarget:"Next",moreOn:(e,t)=>e===1?`1 more on ${t}`:`${e} more`,close:"Close",changed:"This file changed on disk.",reloadShort:"Reload",dismiss:"Dismiss",openAnother:"Open another file",sidePanel:"Open in side panel",meta:{pdf:e=>e===1?"1 page":`${e} pages`,pptx:e=>e===1?"1 slide":`${e} slides`,xlsx:e=>e===1?"1 sheet":`${e} sheets`,docx:e=>""},errors:{generic:["Couldn\u2019t open this document",""],password:["This PDF is password protected",`${or.title.en} can\u2019t open encrypted files yet.`],not_found:["This file no longer exists","It may have been moved or deleted."],file_too_large:["This file is too large to open",""],corrupt_file:["This file appears to be damaged",`${or.title.en} couldn\u2019t read its contents.`],unsupported_type:["This kind of file isn\u2019t supported",`${or.title.en} opens ${_8()} files.`],path_outside_workspace:["This file is outside the workspace",""]},sendFailed:"The message was not sent.",contextFailed:"ZCode did not accept the reference.",where:{page:e=>`Page ${e}`,pages:(e,t)=>`Pages ${e}\u2013${t}`,pageLower:e=>`page ${e}`,slide:e=>`Slide ${e}`,slides:(e,t)=>`Slides ${e}\u2013${t}`,slideLower:e=>`slide ${e}`,shape:e=>`Slide ${e} \xB7 Shape`,paragraph:e=>`Paragraph ${e}`,paragraphs:(e,t)=>`Paragraphs ${e}\u2013${t}`,paragraphLower:e=>`paragraph ${e}`,table:e=>`Table ${e}`,cell:(e,t,n)=>`Table ${e} \xB7 R${t}C${n}`}},a4e={title:or.title["zh-CN"],openTitle:"\u6253\u5F00\u6587\u6863",openFile:"\u6253\u5F00\u6587\u4EF6",emptyTitle:`\u6253\u5F00\u4F60\u7684 ${p4(GW,"zh-CN")} \u6587\u4EF6`,emptyDescription:`\u8FB9\u770B\u8FB9\u804A\uFF0C\u9009\u4E2D${ZW.zh}\u5373\u53EF\u5E26\u5165\u5BF9\u8BDD\u3002`,emptyCaption:`\u9009\u62E9\u672C\u5730\u6587\u4EF6 \xB7 ${_8("zh-CN","or")}`,importing:"\u6B63\u5728\u5BFC\u5165\u2026",importTooLarge:`\u8BF7\u9009\u62E9\u4E0D\u8D85\u8FC7 ${Kh/1024/1024} MiB \u7684\u6587\u4EF6\u3002`,recent:"\u6700\u8FD1",switchDocument:"\u5207\u6362\u6587\u6863",pagesAndOutline:"\u9875\u9762\u4E0E\u76EE\u5F55",outlineOnly:"\u76EE\u5F55",pages:"\u9875\u9762",slides:"\u5E7B\u706F\u7247",outline:"\u76EE\u5F55",find:"\u67E5\u627E",findPlaceholder:"\u5728\u6587\u6863\u4E2D\u67E5\u627E",findCount:(e,t)=>`${e} / ${t}`,noResults:"\u65E0\u7ED3\u679C",previousMatch:"\u4E0A\u4E00\u4E2A\uFF08\u21E7Enter\uFF09",nextMatch:"\u4E0B\u4E00\u4E2A\uFF08Enter\uFF09",closeFind:"\u5173\u95ED\uFF08Esc\uFF09",more:"\u66F4\u591A",fitWidth:"\u9002\u5E94\u5BBD\u5EA6",fitPage:"\u9002\u5E94\u9875\u9762",actualSize:"\u5B9E\u9645\u5927\u5C0F",reload:"\u4ECE\u78C1\u76D8\u91CD\u65B0\u52A0\u8F7D",previousPage:"\u4E0A\u4E00\u9875",nextPage:"\u4E0B\u4E00\u9875",pageNumber:"\u9875\u7801",ofPages:e=>`/ ${e}`,zoomIn:"\u653E\u5927\uFF08\u2318+\uFF09",zoomOut:"\u7F29\u5C0F\uFF08\u2318\u2212\uFF09",fit:"\u9002\u5E94",addToChat:"\u6DFB\u52A0\u5230\u5BF9\u8BDD",addShort:"\u6DFB\u52A0",addToChatHint:"\u9644\u52A0\u5230\u4E0B\u4E00\u6761\u6D88\u606F\uFF08\u2318/Ctrl+Enter\uFF09",added:"\u5DF2\u6DFB\u52A0\u5230\u5BF9\u8BDD",ask:"\u63D0\u95EE",askPlaceholder:"\u5C31\u8FD9\u91CC\u63D0\u95EE\u2026",send:"\u53D1\u9001",cancel:"\u53D6\u6D88",sendKey:"\u53D1\u9001",cancelKey:"\u53D6\u6D88",copy:"\u590D\u5236",copied:"\u5DF2\u590D\u5236",agent:"Agent",agentOf:(e,t)=>`Agent \xB7 \u7B2C ${e} \u5904\uFF0C\u5171 ${t} \u5904`,nextTarget:"\u4E0B\u4E00\u5904",moreOn:(e,t)=>e===1?`${t}\u8FD8\u6709 1 \u5904`:`\u8FD8\u6709 ${e} \u5904`,close:"\u5173\u95ED",changed:"\u6587\u4EF6\u5DF2\u5728\u78C1\u76D8\u4E0A\u66F4\u6539\u3002",reloadShort:"\u91CD\u65B0\u52A0\u8F7D",dismiss:"\u5FFD\u7565",openAnother:"\u6253\u5F00\u5176\u4ED6\u6587\u4EF6",sidePanel:"\u5728\u4FA7\u680F\u6253\u5F00",meta:{pdf:e=>`${e} \u9875`,pptx:e=>`${e} \u5F20\u5E7B\u706F\u7247`,xlsx:e=>`${e} \u4E2A\u5DE5\u4F5C\u8868`,docx:()=>""},errors:{generic:["\u65E0\u6CD5\u6253\u5F00\u8BE5\u6587\u6863",""],password:["\u8BE5 PDF \u53D7\u5BC6\u7801\u4FDD\u62A4",`${oA}\u6682\u4E0D\u652F\u6301\u6253\u5F00\u52A0\u5BC6\u6587\u4EF6\u3002`],not_found:["\u8BE5\u6587\u4EF6\u5DF2\u4E0D\u5B58\u5728","\u5B83\u53EF\u80FD\u5DF2\u88AB\u79FB\u52A8\u6216\u5220\u9664\u3002"],file_too_large:["\u6587\u4EF6\u592A\u5927\uFF0C\u65E0\u6CD5\u6253\u5F00",""],corrupt_file:["\u8BE5\u6587\u4EF6\u4F3C\u4E4E\u5DF2\u635F\u574F",`${oA}\u65E0\u6CD5\u8BFB\u53D6\u5176\u5185\u5BB9\u3002`],unsupported_type:["\u4E0D\u652F\u6301\u8FD9\u79CD\u6587\u4EF6",`${oA}\u53EF\u4EE5\u6253\u5F00 ${_8("zh-CN")} \u6587\u4EF6\u3002`],path_outside_workspace:["\u8BE5\u6587\u4EF6\u4E0D\u5728\u5DE5\u4F5C\u533A\u5185",""]},sendFailed:"\u6D88\u606F\u672A\u53D1\u9001\u3002",contextFailed:"ZCode \u672A\u63A5\u53D7\u8BE5\u5F15\u7528\u3002",where:{page:e=>`\u7B2C ${e} \u9875`,pages:(e,t)=>`\u7B2C ${e}\u2013${t} \u9875`,pageLower:e=>`\u7B2C ${e} \u9875`,slide:e=>`\u7B2C ${e} \u5F20\u5E7B\u706F\u7247`,slides:(e,t)=>`\u7B2C ${e}\u2013${t} \u5F20\u5E7B\u706F\u7247`,slideLower:e=>`\u7B2C ${e} \u5F20\u5E7B\u706F\u7247`,shape:e=>`\u7B2C ${e} \u5F20\u5E7B\u706F\u7247 \xB7 \u5F62\u72B6`,paragraph:e=>`\u7B2C ${e} \u6BB5`,paragraphs:(e,t)=>`\u7B2C ${e}\u2013${t} \u6BB5`,paragraphLower:e=>`\u7B2C ${e} \u6BB5`,table:e=>`\u8868\u683C ${e}`,cell:(e,t,n)=>`\u8868\u683C ${e} \xB7 R${t}C${n}`}},XW=e=>e?.toLowerCase().startsWith("zh")?a4e:i4e;function cw(e,t,n=!1){let o=t.where,r;if(r=/^page:(\d+)(?:-(\d+))?$/.exec(e))return r[2]?o.pages(r[1],r[2]):n?o.pageLower(r[1]):o.page(r[1]);if(r=/^slide:(\d+)\/shape:/.exec(e))return o.shape(r[1]);if(r=/^slide:(\d+)(?:-(\d+))?$/.exec(e))return r[2]?o.slides(r[1],r[2]):n?o.slideLower(r[1]):o.slide(r[1]);if(r=/^p:(\d+)(?:-(\d+))?$/.exec(e))return r[2]?o.paragraphs(r[1],r[2]):n?o.paragraphLower(r[1]):o.paragraph(r[1]);if(r=/^t:(\d+)\/r(\d+)c(\d+)$/.exec(e))return o.cell(r[1],r[2],r[3]);if(r=/^t:(\d+)$/.exec(e))return o.table(r[1]);let i=e.lastIndexOf("!");return i>0?`${e.slice(0,i).replace(/^'(.*)'$/,"$1").replace(/''/g,"'")} \xB7 ${e.slice(i+1)}`:e.replace(/^'(.*)'$/,"$1")}var iA=H2(Fo(),1),c4e={search:'<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>',x:'<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',"chevron-up":'<path d="m18 15-6-6-6 6"/>',"chevron-down":'<path d="m6 9 6 6 6-6"/>',minus:'<path d="M5 12h14"/>',plus:'<path d="M5 12h14"/><path d="M12 5v14"/>',ellipsis:'<circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/>',"panel-left":'<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/>',"file-text":'<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/>',copy:'<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>',"message-square-plus":'<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/><path d="M12 7v6"/><path d="M9 10h6"/>',"message-circle-question":'<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><path d="M12 17h.01"/>',check:'<path d="M20 6 9 17l-5-5"/>',"rotate-cw":'<path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/>',"arrow-down":'<path d="M12 5v14"/><path d="m19 12-7 7-7-7"/>',"arrow-up":'<path d="m5 12 7-7 7 7"/><path d="M12 19V5"/>',"folder-open":'<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"/>',"maximize-2":'<polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" x2="14" y1="3" y2="10"/><line x1="3" x2="10" y1="21" y2="14"/>'};function Q2({name:e,size:t=14,className:n}){return(0,iA.jsx)("svg",{className:`icon${n?` ${n}`:""}`,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",dangerouslySetInnerHTML:{__html:c4e[e]}})}var u4e={pdf:"PDF",docx:"W",xlsx:"X",pptx:"P"};function QW({kind:e}){return(0,iA.jsx)("span",{className:`filetype ${e}`,"aria-hidden":"true",children:u4e[e]})}var z0=H2(ho(),1);var p2=H2(Fo(),1);function d4e({handle:e,page:t,width:n,ratio:o,current:r,onPick:i,root:a}){let s=(0,z0.useRef)(null);return(0,z0.useEffect)(()=>{let l=s.current;if(!l||!e.thumbnail)return;let c=!1,u=new IntersectionObserver(d=>{c||!d.some(p=>p.isIntersecting)||(c=!0,u.disconnect(),e.thumbnail(t,n).then(p=>{l.replaceChildren(p),l.style.height=""},()=>{}))},{root:a.current,rootMargin:"300px 0px"});return u.observe(l),()=>u.disconnect()},[e,t,n,a]),(0,p2.jsxs)("button",{type:"button",className:`thumb${r?" on":""}`,"aria-current":r?"page":void 0,onClick:()=>i(t),"data-page":t,children:[(0,p2.jsx)("div",{ref:s,className:"mini",style:{width:n,height:Math.round(n*o)}}),(0,p2.jsx)("span",{children:t})]})}var eG=e=>/^(?:page|slide):(\d+)/.exec(e)?.[1]??"";function tG({t:e,info:t,handle:n,page:o,tab:r,docked:i,onTab:a,onPage:s,onOutline:l}){let c=(0,z0.useRef)(null),u=!!(n?.thumbnail&&o),d=t.outline.length>0,p=u&&(r==="pages"||!d)?"pages":"outline",m=t.kind==="pptx"?9/16:1.294;(0,z0.useEffect)(()=>{let S=c.current?.querySelector("[aria-current=page]");S&&c.current&&(c.current.scrollTop=S.offsetTop-c.current.clientHeight/3)},[p]);let h=(()=>{if(!o)return-1;let S=-1;return t.outline.forEach((v,g)=>{let y=Number(eG(v.at));y&&y<=o.current&&(S=g)}),S})();return(0,p2.jsxs)("nav",{className:`drawer${i?" docked":""}`,"aria-label":e.pagesAndOutline,children:[u&&d?(0,p2.jsxs)("div",{className:"seg",role:"tablist",children:[(0,p2.jsx)("button",{type:"button",role:"tab","aria-selected":p==="pages",className:p==="pages"?"on":"",onClick:()=>a("pages"),children:t.kind==="pptx"?e.slides:e.pages}),(0,p2.jsx)("button",{type:"button",role:"tab","aria-selected":p==="outline",className:p==="outline"?"on":"",onClick:()=>a("outline"),children:e.outline})]}):null,(0,p2.jsx)("div",{ref:c,className:p==="pages"?"thumbs":"outline",children:p==="pages"&&n&&o?Array.from({length:o.count},(S,v)=>(0,p2.jsx)(d4e,{handle:n,page:v+1,width:136,ratio:m,current:o.current===v+1,onPick:s,root:c},v)):t.outline.map((S,v)=>(0,p2.jsxs)("button",{type:"button",className:`oi level-${Math.min(3,Math.max(1,S.level))}${v===h?" on":""}`,"aria-current":v===h?"page":void 0,title:S.label,onClick:()=>l(S.at),children:[(0,p2.jsx)("span",{className:"label",children:S.label}),(0,p2.jsx)("span",{className:"n",children:eG(S.at)})]},`${S.at}-${v}`))})]})}function nG({t:e,onBrowse:t,importing:n}){return(0,p2.jsx)("div",{className:"empty",children:(0,p2.jsxs)("div",{className:"empty-content",children:[(0,p2.jsx)("h3",{children:e.emptyTitle}),(0,p2.jsx)("p",{className:"empty-description",children:e.emptyDescription}),(0,p2.jsxs)("button",{type:"button",className:"btn empty-open",onClick:t,disabled:n,children:[(0,p2.jsx)(Q2,{name:"folder-open",size:16}),n?e.importing:e.openFile]}),(0,p2.jsx)("p",{className:"empty-caption",children:e.emptyCaption})]})})}var p4e=["title","subtitle","line","line","short","heading","line","line","line","mid","figure"];function dw({kind:e}){if(e==="xlsx")return(0,p2.jsx)("div",{className:"skeleton sheet","aria-busy":"true",children:Array.from({length:18},(n,o)=>(0,p2.jsx)("div",{className:"skel-row"},o))});let t=e==="pptx";return(0,p2.jsx)("div",{className:"skeleton","aria-busy":"true",children:[0,1].map(n=>(0,p2.jsxs)("div",{className:`skelpage${t?" slide":""}`,children:[n===0&&!t?p4e.map((o,r)=>(0,p2.jsx)("div",{className:`skel ${o}`},r)):null,n===0&&t?(0,p2.jsxs)(p2.Fragment,{children:[(0,p2.jsx)("div",{className:"skel title left"}),(0,p2.jsx)("div",{className:"skel line"}),(0,p2.jsx)("div",{className:"skel mid"})]}):null]},n))})}function pw({t:e,title:t,detail:n,onOpenAnother:o}){return(0,p2.jsxs)("div",{className:"failed",role:"alert",children:[(0,p2.jsx)(Q2,{name:"file-text",size:28,className:"subtlest"}),(0,p2.jsxs)("div",{children:[(0,p2.jsx)("h3",{children:t}),n?(0,p2.jsx)("p",{children:n}):null]}),(0,p2.jsx)("button",{type:"button",className:"btn secondary",onClick:o,children:e.openAnother})]})}function rG({t:e,onReload:t,onDismiss:n}){return(0,p2.jsxs)("div",{className:"banner",role:"status",children:[(0,p2.jsx)("span",{children:e.changed}),(0,p2.jsx)("button",{type:"button",className:"btn sm primary",onClick:t,children:e.reloadShort}),(0,p2.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.dismiss,"aria-label":e.dismiss,onClick:n,children:(0,p2.jsx)(Q2,{name:"x"})})]})}function f4e({inputRef:e,t,importing:n,onImporting:o,onOpen:r,onError:i}){return(0,p2.jsx)("input",{ref:e,type:"file",hidden:!0,accept:e5.map(a=>`.${a}`).join(","),disabled:n,onChange:async a=>{let s=a.currentTarget.files?.[0];if(a.currentTarget.value="",!!s){o(!0);try{if(s.size>Kh)throw new Error(t.importTooLarge);r(await HW(s))}catch(l){i(l,s.name)}finally{o(!1)}}}})}function oG(e,t,n){let o=(0,z0.useRef)(null),[r,i]=(0,z0.useState)(!1);return{importing:r,browse:()=>o.current?.click(),input:(0,p2.jsx)(f4e,{inputRef:o,t:e,importing:r,onImporting:i,onOpen:t,onError:n})}}var O3=H2(Fo(),1);function iG({appRef:e,canvasRef:t,t:n,path:o,info:r,kind:i,showSkeleton:a,failure:s,nothing:l,onExpand:c,children:u}){return(0,O3.jsxs)("div",{ref:e,className:"app inline",children:[(0,O3.jsxs)("header",{className:"docbar",children:[(0,O3.jsxs)("div",{className:"doctitle static",title:o??void 0,children:[(0,O3.jsx)("span",{className:"name",children:o?P8(o):n.title}),r&&n.meta[r.kind](r.units)?(0,O3.jsx)("span",{className:"meta",children:n.meta[r.kind](r.units)}):null]}),(0,O3.jsx)("span",{className:"spacer"}),(0,O3.jsxs)("button",{type:"button",className:"btn sm",title:n.sidePanel,onClick:c,children:[(0,O3.jsx)(Q2,{name:"maximize-2",size:12}),n.sidePanel]})]}),(0,O3.jsx)("div",{className:"stage",children:(0,O3.jsxs)("div",{ref:t,className:"canvas",children:[u,a?(0,O3.jsx)(dw,{kind:i}):null,s?(0,O3.jsx)(pw,{t:n,title:s.title,detail:s.detail,onOpenAnother:c}):null,l?(0,O3.jsx)("div",{className:"failed muted",children:n.openTitle}):null,(0,O3.jsx)("button",{type:"button",className:"glance-cover","aria-label":n.sidePanel,onClick:c})]})})]})}var Zi=H2(ho(),1);var fw=H2(ho(),1),C8=8;function aA(e,t,n){let o=(0,fw.useRef)(null),{side:r,offset:i=8,dock:a=!1}=n;return(0,fw.useLayoutEffect)(()=>{let s=o.current,l=e.current;if(!s||!l)return;let c=0,u=()=>{c=0;let h=l.getBoundingClientRect(),S=s.offsetWidth,v=s.offsetHeight,g=t?.()??null,y=(N,U,z,Z)=>{s.style.visibility="",s.style.left=`${Math.round(N)}px`,s.style.top=`${Math.round(U)}px`,s.dataset.side=z,s.style.setProperty("--tip",`${Math.round(Math.max(14,Math.min(S-14,Z-N)))}px`)};if(!g){a?y((h.width-S)/2,C8,"none",h.width/2):s.style.visibility="hidden";return}if(g.bottom<h.top+4||g.top>h.bottom-4){s.style.visibility="hidden";return}let x=(g.left+g.right)/2-h.left,_=Math.max(C8,Math.min(h.width-S-C8,x-S/2)),$=g.top-h.top-v-i,k=g.bottom-h.top+i,L=$>=C8,I=k+v<=h.height-C8;(r==="top"||!I)&&L?y(_,$,"top",x):I?y(_,k,"bottom",x):y(_,r==="top"?C8:h.height-v-C8,"none",x)},d=()=>{c||(c=requestAnimationFrame(u))};u(),l.addEventListener("scroll",d,{capture:!0,passive:!0});let p=new ResizeObserver(d);p.observe(l),p.observe(s);let m=setInterval(d,250);return()=>{l.removeEventListener("scroll",d,{capture:!0}),p.disconnect(),clearInterval(m),c&&cancelAnimationFrame(c)}},[e,t,r,i,a]),o}var vt=H2(Fo(),1);function sA({className:e,onClose:t,children:n,label:o}){let r=(0,Zi.useRef)(null);(0,Zi.useEffect)(()=>{let a=l=>{let c=l.target;!r.current?.contains(c)&&!c.closest?.("[data-menu-trigger]")&&t()},s=l=>{l.key==="Escape"&&(l.stopPropagation(),t())};return document.addEventListener("pointerdown",a,!0),document.addEventListener("keydown",s,!0),r.current?.querySelector("[role^=menuitem]")?.focus(),()=>{document.removeEventListener("pointerdown",a,!0),document.removeEventListener("keydown",s,!0)}},[t]);let i=a=>{if(a.key!=="ArrowDown"&&a.key!=="ArrowUp")return;a.preventDefault();let s=[...r.current?.querySelectorAll("[role^=menuitem]")??[]],l=s.indexOf(document.activeElement);s[(l+(a.key==="ArrowDown"?1:-1)+s.length)%s.length]?.focus()};return(0,vt.jsx)("div",{ref:r,className:`menu ${e}`,role:"menu","aria-label":o,onKeyDown:i,children:n})}function y7({icon:e,checked:t,children:n,hint:o,onSelect:r}){return(0,vt.jsxs)("button",{type:"button",role:t===void 0?"menuitem":"menuitemradio","aria-checked":t,className:"mi",onClick:r,children:[(0,vt.jsx)("span",{className:"mi-icon",children:t?(0,vt.jsx)(Q2,{name:"check",size:16}):e}),(0,vt.jsx)("span",{className:"mi-label",children:n}),o?(0,vt.jsx)("span",{className:"mi-hint",children:o}):null]})}function sG({t:e,query:t,total:n,index:o,onQuery:r,onStep:i,onClose:a}){let s=(0,Zi.useRef)(null);(0,Zi.useEffect)(()=>{s.current?.focus(),s.current?.select()},[]);let l=!t.trim()||n===null?"":n?e.findCount(o+1,n):e.noResults;return(0,vt.jsxs)("div",{className:"docbar findbar",role:"search",children:[(0,vt.jsxs)("label",{className:"findfield",children:[(0,vt.jsx)(Q2,{name:"search",className:"muted"}),(0,vt.jsx)("input",{ref:s,className:"find-input",type:"text","aria-label":e.find,placeholder:e.findPlaceholder,value:t,onChange:c=>r(c.target.value),onKeyDown:c=>{c.key==="Enter"?(c.preventDefault(),i(c.shiftKey?-1:1)):c.key==="Escape"&&(c.preventDefault(),c.stopPropagation(),a())}}),(0,vt.jsx)("span",{className:"count","aria-live":"polite",children:l})]}),(0,vt.jsx)("button",{type:"button",className:"btn icon dim",title:e.previousMatch,"aria-label":e.previousMatch,disabled:!n,onClick:()=>i(-1),children:(0,vt.jsx)(Q2,{name:"chevron-up"})}),(0,vt.jsx)("button",{type:"button",className:"btn icon dim",title:e.nextMatch,"aria-label":e.nextMatch,disabled:!n,onClick:()=>i(1),children:(0,vt.jsx)(Q2,{name:"chevron-down"})}),(0,vt.jsx)("button",{type:"button",className:"btn icon dim",title:e.closeFind,"aria-label":e.closeFind,onClick:a,children:(0,vt.jsx)(Q2,{name:"x"})})]})}var m4e=1500;function lG({t:e,frame:t,page:n,zoom:o,onPage:r,onZoom:i,onFit:a}){let s=(0,Zi.useRef)(null),[l,c]=(0,Zi.useState)(!0),[u,d]=(0,Zi.useState)(null),p=(0,Zi.useRef)(!1);(0,Zi.useEffect)(()=>{let h=t.current;if(!h)return;let S=0,v=()=>{clearTimeout(S),S=window.setTimeout(()=>{!p.current&&!s.current?.contains(document.activeElement)&&c(!1)},m4e)},g=()=>{c(!0),v()},y=x=>{let _=h.getBoundingClientRect();x.clientY>_.bottom-80&&g()};return h.addEventListener("scroll",g,{capture:!0,passive:!0}),h.addEventListener("pointermove",y,{passive:!0}),v(),()=>{clearTimeout(S),h.removeEventListener("scroll",g,{capture:!0}),h.removeEventListener("pointermove",y)}},[t]);let m=()=>{let h=Number(u);d(null),Number.isInteger(h)&&h>=1&&r(Math.min(h,n.count))};return(0,vt.jsxs)("div",{ref:s,className:`pill${l?"":" faded"}`,onPointerEnter:()=>{p.current=!0,c(!0)},onPointerLeave:()=>{p.current=!1},onFocus:()=>c(!0),children:[(0,vt.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.previousPage,"aria-label":e.previousPage,disabled:n.current<=1,onClick:()=>r(n.current-1),children:(0,vt.jsx)(Q2,{name:"chevron-up"})}),(0,vt.jsxs)("span",{className:"pg",children:[(0,vt.jsx)("input",{className:"pgin","aria-label":e.pageNumber,inputMode:"numeric",style:{width:`${Math.max(2,String(n.count).length)+1.6}ch`},value:u??String(n.current),onFocus:h=>{d(String(n.current)),h.target.select()},onChange:h=>d(h.target.value.replace(/\D/g,"")),onBlur:()=>d(null),onKeyDown:h=>{h.key==="Enter"?(m(),h.currentTarget.blur()):h.key==="Escape"&&(h.stopPropagation(),d(null),h.currentTarget.blur())}}),(0,vt.jsx)("span",{children:e.ofPages(n.count)})]}),(0,vt.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.nextPage,"aria-label":e.nextPage,disabled:n.current>=n.count,onClick:()=>r(n.current+1),children:(0,vt.jsx)(Q2,{name:"chevron-down"})}),o?(0,vt.jsxs)(vt.Fragment,{children:[(0,vt.jsx)("span",{className:"vsep"}),(0,vt.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.zoomOut,"aria-label":e.zoomOut,disabled:o.mode!=="width"&&o.percent<=25,onClick:()=>i(-1),children:(0,vt.jsx)(Q2,{name:"minus"})}),(0,vt.jsx)("button",{type:"button",className:"zoom",title:e.fitWidth,onClick:a,children:o.mode==="width"?e.fit:`${o.percent}%`}),(0,vt.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.zoomIn,"aria-label":e.zoomIn,disabled:o.mode!=="width"&&o.percent>=400,onClick:()=>i(1),children:(0,vt.jsx)(Q2,{name:"plus"})})]}):null]})}var aG=e=>{e.target.closest("textarea")||e.preventDefault()};function cG({t:e,frame:t,locate:n,text:o,label:r,quote:i,short:a,mode:s,canAsk:l,copied:c,onAdd:u,onAsk:d,onCopy:p,onCancelAsk:m,onSend:h}){let S=s==="ask",v=aA(t,n,{side:S?"bottom":"top",dock:!0}),[g,y]=(0,Zi.useState)(""),[x,_]=(0,Zi.useState)(!1),$=async()=>{if(!g.trim()||x)return;_(!0);let k=await h(g.trim());_(!1),k&&y("")};return S?(0,vt.jsxs)("div",{ref:v,className:"pop ask",role:"dialog","aria-label":e.ask,onMouseDown:aG,children:[(0,vt.jsxs)("div",{className:"ctx",children:[(0,vt.jsx)("span",{className:"where",children:r}),i?(0,vt.jsxs)("span",{className:"q",children:["\u201C",i,"\u201D"]}):null]}),(0,vt.jsx)("textarea",{autoFocus:!0,className:"textarea",rows:2,"aria-label":e.askPlaceholder,placeholder:e.askPlaceholder,value:g,onChange:k=>y(k.target.value),onKeyDown:k=>{k.key==="Enter"&&!k.shiftKey&&!k.nativeEvent.isComposing?(k.preventDefault(),$()):k.key==="Escape"&&(k.preventDefault(),k.stopPropagation(),m())}}),(0,vt.jsxs)("div",{className:"row",children:[(0,vt.jsxs)("span",{className:"hint",children:[(0,vt.jsx)("kbd",{children:"\u21B5"})," ",e.sendKey]}),(0,vt.jsx)("button",{type:"button",className:"btn sm",onClick:m,children:e.cancel}),(0,vt.jsx)("button",{type:"button",className:"btn sm primary",disabled:!g.trim()||x,onClick:()=>void $(),children:e.send})]})]}):(0,vt.jsxs)("div",{ref:v,className:"pop bar",role:"toolbar","aria-label":r,onMouseDown:aG,children:[o?null:(0,vt.jsxs)(vt.Fragment,{children:[(0,vt.jsx)("span",{className:"where",children:r}),(0,vt.jsx)("span",{className:"vsep"})]}),(0,vt.jsx)("button",{type:"button",className:"btn lg",title:e.addToChatHint,onClick:u,disabled:s==="added",children:s==="added"?(0,vt.jsxs)(vt.Fragment,{children:[(0,vt.jsx)(Q2,{name:"check",size:16,className:"ok"}),e.added]}):(0,vt.jsxs)(vt.Fragment,{children:[(0,vt.jsx)(Q2,{name:"message-square-plus",size:16}),a?e.addShort:e.addToChat]})}),l?(0,vt.jsxs)("button",{type:"button",className:"btn lg",onClick:d,children:[(0,vt.jsx)(Q2,{name:"message-circle-question",size:16}),e.ask]}):null,o?(0,vt.jsxs)(vt.Fragment,{children:[(0,vt.jsx)("span",{className:"vsep"}),(0,vt.jsx)("button",{type:"button",className:"btn icon lg dim",title:c?e.copied:e.copy,"aria-label":c?e.copied:e.copy,onClick:p,children:(0,vt.jsx)(Q2,{name:c?"check":"copy"})})]}):null]})}function uG({t:e,frame:t,locate:n,note:o,index:r,total:i,onNext:a,onClose:s}){let l=aA(t,n,{side:"bottom",offset:6,dock:!0});return(0,vt.jsxs)("div",{ref:l,className:"callout",role:"note",children:[(0,vt.jsxs)("div",{className:"body",children:[(0,vt.jsxs)("div",{className:"who",children:[(0,vt.jsx)("span",{className:"dot"}),i>1?e.agentOf(r+1,i):e.agent]}),o?(0,vt.jsx)("div",{className:"text",children:o}):null]}),i>1?(0,vt.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.nextTarget,"aria-label":e.nextTarget,onClick:a,children:(0,vt.jsx)(Q2,{name:"chevron-down"})}):null,(0,vt.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.close,"aria-label":e.close,onClick:s,children:(0,vt.jsx)(Q2,{name:"x"})})]})}function dG({text:e,down:t,raised:n,onClick:o}){return(0,vt.jsxs)("button",{type:"button",className:`chip offscreen${n?" raised":""}`,onClick:o,children:[(0,vt.jsx)("span",{className:"dot"}),e,(0,vt.jsx)(Q2,{name:t?"arrow-down":"arrow-up",size:12})]})}function pG(e,t){return e.moreOn(t.length,cw(t[0],e,!0))}var kr=H2(Fo(),1);function fG({t:e,recent:t,currentPath:n,onOpen:o,onBrowse:r,onClose:i}){return(0,kr.jsxs)(sA,{className:"switcher",label:e.switchDocument,onClose:i,children:[t.length?(0,kr.jsx)("div",{className:"mlabel",children:e.recent}):null,t.map(a=>(0,kr.jsx)(y7,{icon:(0,kr.jsx)(QW,{kind:a.kind}),hint:a.path===n?(0,kr.jsx)(Q2,{name:"check",size:16}):P8(FW(a.path)),onSelect:()=>a.path===n?i():o(a.path),children:P8(a.path)},a.path)),t.length?(0,kr.jsx)("div",{className:"msep"}):null,(0,kr.jsx)(y7,{icon:(0,kr.jsx)(Q2,{name:"folder-open",size:16}),onSelect:r,children:e.openFile})]})}function mG({t:e,zoomable:t,zoomMode:n,onFit:o,onFind:r,onReload:i,onClose:a}){return(0,kr.jsxs)(sA,{className:"more",label:e.more,onClose:a,children:[t?(0,kr.jsxs)(kr.Fragment,{children:[(0,kr.jsx)(y7,{checked:n==="width",onSelect:()=>o("width"),children:e.fitWidth}),(0,kr.jsx)(y7,{checked:n==="page",onSelect:()=>o("page"),children:e.fitPage}),(0,kr.jsx)(y7,{checked:n==="actual",hint:"100%",onSelect:()=>o("actual"),children:e.actualSize}),(0,kr.jsx)("div",{className:"msep"})]}):null,(0,kr.jsx)(y7,{icon:(0,kr.jsx)(Q2,{name:"search",size:16}),hint:"\u2318F",onSelect:r,children:e.find}),(0,kr.jsx)(y7,{icon:(0,kr.jsx)(Q2,{name:"rotate-cw",size:16}),onSelect:i,children:e.reload})]})}var t5=H2(ho(),1),rg={open:!1,query:"",total:null,index:-1};function hG({viewer:e,docRef:t,ready:n,onOpen:o}){let[r,i]=(0,t5.useState)(rg),a=(0,t5.useRef)(0),s=(0,t5.useCallback)(()=>{t.current&&(o(),i(d=>({...d,open:!0})),requestAnimationFrame(()=>{let d=document.querySelector(".findbar .find-input");d?.focus(),d?.select()}))},[t,o]),l=(0,t5.useCallback)(()=>{a.current++,e.current?.clearFind(),i(rg)},[e]),c=(0,t5.useCallback)(d=>{i(p=>({...p,query:d,total:d.trim()?p.total:null}))},[]);(0,t5.useEffect)(()=>{if(!r.open||!n)return;let d=++a.current,p=setTimeout(async()=>{let m=e.current;if(!m)return;let h=await m.find(r.query).catch(()=>0);d===a.current&&(i(S=>({...S,total:h,index:h?0:-1})),h&&m.findGo(0))},200);return()=>clearTimeout(p)},[r.open,r.query,n,e]);let u=(0,t5.useCallback)(d=>{if(!r.total)return;let p=(r.index+d+r.total)%r.total;i(m=>({...m,index:p})),e.current?.findGo(p)},[r.total,r.index,e]);return{find:r,setFind:i,openFind:s,closeFind:l,queryFind:c,stepFind:u}}var gG=H2(ho(),1);function yG(e,t){(0,gG.useEffect)(()=>{f4().handleTool("capture_view",async o=>{let r=e.current;if(!r||!t.current)throw new Error(`No document is open in the ${or.title.en} panel. Call open_document first.`);let i=null;if(typeof o.anchor=="string"&&o.anchor.trim()){let l=RW(o.anchor);if(l.path.replace(/^\.\//,"")!==r.info.path)throw new Error(`The panel shows ${r.info.path}, not ${l.path}. Call open_document with that path first.`);i=l.at}let a=typeof o.maxWidth=="number"?Math.min(2e3,Math.max(320,o.maxWidth)):1600,s=await t.current.capture(i,a);return{content:[{type:"image",data:s.data,mimeType:"image/png"},{type:"text",text:`Captured ${Qh(r.info.path,s.at)} (${s.width}\xD7${s.height} px).`}]}})},[e,t])}var mw=H2(ho(),1);function vG(e,t){let[n,o]=(0,mw.useState)(null);return(0,mw.useEffect)(()=>{let r=e.current;if(!r||!t||t.targets.length<2){o(null);return}let i=0,a=()=>{i=0;let c=r.getBoundingClientRect(),u=[],d=[];t.targets.forEach((m,h)=>{if(h===t.index)return;let S=m.locate();S&&(S.top>c.bottom-8?u.push(h):S.bottom<c.top+8&&d.push(h))});let p=u.length?{indexes:u,down:!0}:d.length?{indexes:d,down:!1}:null;o(m=>JSON.stringify(m)===JSON.stringify(p)?m:p)},s=()=>{i||(i=requestAnimationFrame(a))};a(),r.addEventListener("scroll",s,{capture:!0,passive:!0});let l=setInterval(s,500);return()=>{r.removeEventListener("scroll",s,{capture:!0}),clearInterval(l),i&&cancelAnimationFrame(i)}},[t,e]),[n,o]}var bG=H2(ho(),1);function SG({docRef:e,viewer:t,picked:n,addReference:o,openFind:r,closeFind:i,clearSelection:a,paged:s,page:l,goToPage:c,drawer:u,setDrawer:d,docked:p,find:m,agent:h,setAgent:S}){(0,bG.useEffect)(()=>{let v=g=>{if(g.defaultPrevented)return;let y=g.metaKey||g.ctrlKey,x=g.target?.closest?.("input, textarea, [contenteditable]"),_=g.key.toLowerCase();if(y&&_==="f"&&e.current)g.preventDefault(),r();else if(y&&g.key==="Enter"&&n)g.preventDefault(),o();else if(y&&(g.key==="="||g.key==="+"))g.preventDefault(),t.current?.zoom(1);else if(y&&g.key==="-")g.preventDefault(),t.current?.zoom(-1);else if(y&&g.key==="0")g.preventDefault(),t.current?.fit("width");else if(!y&&!x&&s&&l&&["ArrowLeft","ArrowRight","PageUp","PageDown"].includes(g.key)){g.preventDefault();let $=g.key==="ArrowLeft"||g.key==="PageUp";c(l.current+($?-1:1))}else if(g.key==="Escape"&&!x){if(n)a();else if(u.open&&!p)d($=>({...$,open:!1}));else if(m.open)i();else if(h?.visible)S({...h,visible:!1});else return;g.preventDefault()}};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[n,o,r,i,a,s,l,c,u.open,p,m.open,h,e,t,d,S])}var gr=H2(ho(),1);var De=H2(ho(),1);var Rr=Uint8Array,Ca=Uint16Array,vA=Int32Array,hw=new Rr([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]),gw=new Rr([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]),pA=new Rr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),kG=function(e,t){for(var n=new Ca(31),o=0;o<31;++o)n[o]=t+=1<<e[o-1];for(var r=new vA(n[30]),o=1;o<30;++o)for(var i=n[o];i<n[o+1];++i)r[i]=i-n[o]<<5|o;return{b:n,r}},RG=kG(hw,2),$G=RG.b,fA=RG.r;$G[28]=258,fA[258]=28;var zG=kG(gw,0),h4e=zG.b,xG=zG.r,mA=new Ca(32768);for(ln=0;ln<32768;++ln)M0=(ln&43690)>>1|(ln&21845)<<1,M0=(M0&52428)>>2|(M0&13107)<<2,M0=(M0&61680)>>4|(M0&3855)<<4,mA[ln]=((M0&65280)>>8|(M0&255)<<8)>>1;var M0,ln,us=(function(e,t,n){for(var o=e.length,r=0,i=new Ca(t);r<o;++r)e[r]&&++i[e[r]-1];var a=new Ca(t);for(r=1;r<t;++r)a[r]=a[r-1]+i[r-1]<<1;var s;if(n){s=new Ca(1<<t);var l=15-t;for(r=0;r<o;++r)if(e[r])for(var c=r<<4|e[r],u=t-e[r],d=a[e[r]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)s[mA[d]>>l]=c}else for(s=new Ca(o),r=0;r<o;++r)e[r]&&(s[r]=mA[a[e[r]-1]++]>>15-e[r]);return s}),v7=new Rr(288);for(ln=0;ln<144;++ln)v7[ln]=8;var ln;for(ln=144;ln<256;++ln)v7[ln]=9;var ln;for(ln=256;ln<280;++ln)v7[ln]=7;var ln;for(ln=280;ln<288;++ln)v7[ln]=8;var ln,ag=new Rr(32);for(ln=0;ln<32;++ln)ag[ln]=5;var ln,g4e=us(v7,9,0),y4e=us(v7,9,1),v4e=us(ag,5,0),b4e=us(ag,5,1),lA=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},n5=function(e,t,n){var o=t/8|0;return(e[o]|e[o+1]<<8)>>(t&7)&n},cA=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},bA=function(e){return(e+7)/8|0},sg=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new Rr(e.subarray(t,n))};var S4e=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],L3=function(e,t,n){var o=new Error(t||S4e[e]);if(o.code=e,Error.captureStackTrace&&Error.captureStackTrace(o,L3),!n)throw o;return o},x4e=function(e,t,n,o){var r=e.length,i=o?o.length:0;if(!r||t.f&&!t.l)return n||new Rr(0);var a=!n,s=a||t.i!=2,l=t.i;a&&(n=new Rr(r*3));var c=function(Oe){var Be=n.length;if(Oe>Be){var c1=new Rr(Math.max(Be*2,Oe));c1.set(n),n=c1}},u=t.f||0,d=t.p||0,p=t.b||0,m=t.l,h=t.d,S=t.m,v=t.n,g=r*8;do{if(!m){u=n5(e,d,1);var y=n5(e,d+1,3);if(d+=3,y)if(y==1)m=y4e,h=b4e,S=9,v=5;else if(y==2){var k=n5(e,d,31)+257,L=n5(e,d+10,15)+4,I=k+n5(e,d+5,31)+1;d+=14;for(var N=new Rr(I),U=new Rr(19),z=0;z<L;++z)U[pA[z]]=n5(e,d+z*3,7);d+=L*3;for(var Z=lA(U),ie=(1<<Z)-1,ue=us(U,Z,1),z=0;z<I;){var X=ue[n5(e,d,ie)];d+=X&15;var x=X>>4;if(x<16)N[z++]=x;else{var W=0,Me=0;for(x==16?(Me=3+n5(e,d,3),d+=2,W=N[z-1]):x==17?(Me=3+n5(e,d,7),d+=3):x==18&&(Me=11+n5(e,d,127),d+=7);Me--;)N[z++]=W}}var Fe=N.subarray(0,k),Se=N.subarray(k);S=lA(Fe),v=lA(Se),m=us(Fe,S,1),h=us(Se,v,1)}else L3(1);else{var x=bA(d)+4,_=e[x-4]|e[x-3]<<8,$=x+_;if($>r){l&&L3(0);break}s&&c(p+_),n.set(e.subarray(x,$),p),t.b=p+=_,t.p=d=$*8,t.f=u;continue}if(d>g){l&&L3(0);break}}s&&c(p+131072);for(var $e=(1<<S)-1,He=(1<<v)-1,r1=d;;r1=d){var W=m[cA(e,d)&$e],b1=W>>4;if(d+=W&15,d>g){l&&L3(0);break}if(W||L3(2),b1<256)n[p++]=b1;else if(b1==256){r1=d,m=null;break}else{var p1=b1-254;if(b1>264){var z=b1-257,re=hw[z];p1=n5(e,d,(1<<re)-1)+$G[z],d+=re}var fe=h[cA(e,d)&He],Ve=fe>>4;fe||L3(3),d+=fe&15;var Se=h4e[Ve];if(Ve>3){var re=gw[Ve];Se+=cA(e,d)&(1<<re)-1,d+=re}if(d>g){l&&L3(0);break}s&&c(p+131072);var l1=p+p1;if(p<Se){var v1=i-Se,D1=Math.min(Se,l1);for(v1+p<0&&L3(3);p<D1;++p)n[p]=o[v1+p]}for(;p<l1;++p)n[p]=n[p-Se]}}t.l=m,t.p=r1,t.b=p,t.f=u,m&&(u=1,t.m=S,t.d=h,t.n=v)}while(!u);return p!=n.length&&a?sg(n,0,p):n.subarray(0,p)},E0=function(e,t,n){n<<=t&7;var o=t/8|0;e[o]|=n,e[o+1]|=n>>8},og=function(e,t,n){n<<=t&7;var o=t/8|0;e[o]|=n,e[o+1]|=n>>8,e[o+2]|=n>>16},uA=function(e,t){for(var n=[],o=0;o<e.length;++o)e[o]&&n.push({s:o,f:e[o]});var r=n.length,i=n.slice();if(!r)return{t:EG,l:0};if(r==1){var a=new Rr(n[0].s+1);return a[n[0].s]=1,{t:a,l:1}}n.sort(function($,k){return $.f-k.f}),n.push({s:-1,f:25001});var s=n[0],l=n[1],c=0,u=1,d=2;for(n[0]={s:-1,f:s.f+l.f,l:s,r:l};u!=r-1;)s=n[n[c].f<n[d].f?c++:d++],l=n[c!=u&&n[c].f<n[d].f?c++:d++],n[u++]={s:-1,f:s.f+l.f,l:s,r:l};for(var p=i[0].s,o=1;o<r;++o)i[o].s>p&&(p=i[o].s);var m=new Ca(p+1),h=hA(n[u-1],m,0);if(h>t){var o=0,S=0,v=h-t,g=1<<v;for(i.sort(function(k,L){return m[L.s]-m[k.s]||k.f-L.f});o<r;++o){var y=i[o].s;if(m[y]>t)S+=g-(1<<h-m[y]),m[y]=t;else break}for(S>>=v;S>0;){var x=i[o].s;m[x]<t?S-=1<<t-m[x]++-1:++o}for(;o>=0&&S;--o){var _=i[o].s;m[_]==t&&(--m[_],++S)}h=t}return{t:new Rr(m),l:h}},hA=function(e,t,n){return e.s==-1?Math.max(hA(e.l,t,n+1),hA(e.r,t,n+1)):t[e.s]=n},wG=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Ca(++t),o=0,r=e[0],i=1,a=function(l){n[o++]=l},s=1;s<=t;++s)if(e[s]==r&&s!=t)++i;else{if(!r&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(r),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(r);i=1,r=e[s]}return{c:n.subarray(0,o),n:t}},ig=function(e,t){for(var n=0,o=0;o<t.length;++o)n+=e[o]*t[o];return n},MG=function(e,t,n){var o=n.length,r=bA(t+2);e[r]=o&255,e[r+1]=o>>8,e[r+2]=e[r]^255,e[r+3]=e[r+1]^255;for(var i=0;i<o;++i)e[r+i+4]=n[i];return(r+4+o)*8},_G=function(e,t,n,o,r,i,a,s,l,c,u){E0(t,u++,n),++r[256];for(var d=uA(r,15),p=d.t,m=d.l,h=uA(i,15),S=h.t,v=h.l,g=wG(p),y=g.c,x=g.n,_=wG(S),$=_.c,k=_.n,L=new Ca(19),I=0;I<y.length;++I)++L[y[I]&31];for(var I=0;I<$.length;++I)++L[$[I]&31];for(var N=uA(L,7),U=N.t,z=N.l,Z=19;Z>4&&!U[pA[Z-1]];--Z);var ie=c+5<<3,ue=ig(r,v7)+ig(i,ag)+a,X=ig(r,p)+ig(i,S)+a+14+3*Z+ig(L,U)+2*L[16]+3*L[17]+7*L[18];if(l>=0&&ie<=ue&&ie<=X)return MG(t,u,e.subarray(l,l+c));var W,Me,Fe,Se;if(E0(t,u,1+(X<ue)),u+=2,X<ue){W=us(p,m,0),Me=p,Fe=us(S,v,0),Se=S;var $e=us(U,z,0);E0(t,u,x-257),E0(t,u+5,k-1),E0(t,u+10,Z-4),u+=14;for(var I=0;I<Z;++I)E0(t,u+3*I,U[pA[I]]);u+=3*Z;for(var He=[y,$],r1=0;r1<2;++r1)for(var b1=He[r1],I=0;I<b1.length;++I){var p1=b1[I]&31;E0(t,u,$e[p1]),u+=U[p1],p1>15&&(E0(t,u,b1[I]>>5&127),u+=b1[I]>>12)}}else W=g4e,Me=v7,Fe=v4e,Se=ag;for(var I=0;I<s;++I){var re=o[I];if(re>255){var p1=re>>18&31;og(t,u,W[p1+257]),u+=Me[p1+257],p1>7&&(E0(t,u,re>>23&31),u+=hw[p1]);var fe=re&31;og(t,u,Fe[fe]),u+=Se[fe],fe>3&&(og(t,u,re>>5&8191),u+=gw[fe])}else og(t,u,W[re]),u+=Me[re]}return og(t,u,W[256]),u+Me[256]},w4e=new vA([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),EG=new Rr(0),_4e=function(e,t,n,o,r,i){var a=i.z||e.length,s=new Rr(o+a+5*(1+Math.ceil(a/7e3))+r),l=s.subarray(o,s.length-r),c=i.l,u=(i.r||0)&7;if(t){u&&(l[0]=i.r>>3);for(var d=w4e[t-1],p=d>>13,m=d&8191,h=(1<<n)-1,S=i.p||new Ca(32768),v=i.h||new Ca(h+1),g=Math.ceil(n/3),y=2*g,x=function(_e){return(e[_e]^e[_e+1]<<g^e[_e+2]<<y)&h},_=new vA(25e3),$=new Ca(288),k=new Ca(32),L=0,I=0,N=i.i||0,U=0,z=i.w||0,Z=0;N+2<a;++N){var ie=x(N),ue=N&32767,X=v[ie];if(S[ue]=X,v[ie]=ue,z<=N){var W=a-N;if((L>7e3||U>24576)&&(W>423||!c)){u=_G(e,l,0,_,$,k,I,U,Z,N-Z,u),U=L=I=0,Z=N;for(var Me=0;Me<286;++Me)$[Me]=0;for(var Me=0;Me<30;++Me)k[Me]=0}var Fe=2,Se=0,$e=m,He=ue-X&32767;if(W>2&&ie==x(N-He))for(var r1=Math.min(p,W)-1,b1=Math.min(32767,N),p1=Math.min(258,W);He<=b1&&--$e&&ue!=X;){if(e[N+Fe]==e[N+Fe-He]){for(var re=0;re<p1&&e[N+re]==e[N+re-He];++re);if(re>Fe){if(Fe=re,Se=He,re>r1)break;for(var fe=Math.min(He,re-2),Ve=0,Me=0;Me<fe;++Me){var l1=N-He+Me&32767,v1=S[l1],D1=l1-v1&32767;D1>Ve&&(Ve=D1,X=l1)}}}ue=X,X=S[ue],He+=ue-X&32767}if(Se){_[U++]=268435456|fA[Fe]<<18|xG[Se];var Oe=fA[Fe]&31,Be=xG[Se]&31;I+=hw[Oe]+gw[Be],++$[257+Oe],++k[Be],z=N+Fe,++L}else _[U++]=e[N],++$[e[N]]}}for(N=Math.max(N,z);N<a;++N)_[U++]=e[N],++$[e[N]];u=_G(e,l,c,_,$,k,I,U,Z,N-Z,u),c||(i.r=u&7|l[u/8|0]<<3,u-=7,i.h=v,i.p=S,i.i=N,i.w=z)}else{for(var N=i.w||0;N<a+c;N+=65535){var c1=N+65535;c1>=a&&(l[u/8|0]=c,c1=a),u=MG(l,u+1,e.subarray(N,c1))}i.i=a}return sg(s,0,o+bA(u)+r)},P4e=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,o=9;--o;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),C4e=function(){var e=-1;return{p:function(t){for(var n=e,o=0;o<t.length;++o)n=P4e[n&255^t[o]]^n>>>8;e=n},d:function(){return~e}}};var k4e=function(e,t,n,o,r){if(!r&&(r={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),a=new Rr(i.length+e.length);a.set(i),a.set(e,i.length),e=a,r.w=i.length}return _4e(e,t.level==null?6:t.level,t.mem==null?r.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,o,r)},TG=function(e,t){var n={};for(var o in e)n[o]=e[o];for(var o in t)n[o]=t[o];return n};var cs=function(e,t){return e[t]|e[t+1]<<8},m4=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},dA=function(e,t){return m4(e,t)+m4(e,t+4)*4294967296},m3=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function R4e(e,t){return k4e(e,t||{},0,0)}function $4e(e,t){return x4e(e,{i:2},t&&t.out,t&&t.dictionary)}var AG=function(e,t,n,o){for(var r in e){var i=e[r],a=t+r,s=o;Array.isArray(i)&&(s=TG(o,i[1]),i=i[0]),ArrayBuffer.isView(i)?n[a]=[i,s]:(n[a+="/"]=[new Rr(0),s],AG(i,a,n,o))}},PG=typeof TextEncoder<"u"&&new TextEncoder,gA=typeof TextDecoder<"u"&&new TextDecoder,z4e=0;try{gA.decode(EG,{stream:!0}),z4e=1}catch{}var M4e=function(e){for(var t="",n=0;;){var o=e[n++],r=(o>127)+(o>223)+(o>239);if(n+r>e.length)return{s:t,r:sg(e,n-1)};r?r==3?(o=((o&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|o>>10,56320|o&1023)):r&1?t+=String.fromCharCode((o&31)<<6|e[n++]&63):t+=String.fromCharCode((o&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(o)}};function h4(e,t){if(t){for(var n=new Rr(e.length),o=0;o<e.length;++o)n[o]=e.charCodeAt(o);return n}if(PG)return PG.encode(e);for(var r=e.length,i=new Rr(e.length+(e.length>>1)),a=0,s=function(u){i[a++]=u},o=0;o<r;++o){if(a+5>i.length){var l=new Rr(a+8+(r-o<<1));l.set(i),i=l}var c=e.charCodeAt(o);c<128||t?s(c):c<2048?(s(192|c>>6),s(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|e.charCodeAt(++o)&1023,s(240|c>>18),s(128|c>>12&63),s(128|c>>6&63),s(128|c&63)):(s(224|c>>12),s(128|c>>6&63),s(128|c&63))}return sg(i,0,a)}function T0(e,t){if(t){for(var n="",o=0;o<e.length;o+=16384)n+=String.fromCharCode.apply(null,e.subarray(o,o+16384));return n}else{if(gA)return gA.decode(e);var r=M4e(e),i=r.s,n=r.r;return n.length&&L3(8),i}}var E4e=function(e,t){return t+30+cs(e,t+26)+cs(e,t+28)},T4e=function(e,t,n){var o=cs(e,t+28),r=cs(e,t+30),i=T0(e.subarray(t+46,t+46+o),!(cs(e,t+8)&2048)),a=t+46+o,s=A4e(e,a,r,n,m4(e,t+20),m4(e,t+24),m4(e,t+42)),l=s[0],c=s[1],u=s[2];return[cs(e,t+10),l,c,i,a+r+cs(e,t+32),u]},A4e=function(e,t,n,o,r,i,a){var s=r==4294967295,l=i==4294967295,c=a==4294967295,u=t+n,d=s+l+c;if(o&&d){for(;t+4<u;t+=4+cs(e,t+2))if(cs(e,t)==1)return[s?dA(e,t+4+8*l):r,l?dA(e,t+4):i,c?dA(e,t+4+8*(l+s)):a,1];o<2&&L3(13)}return[r,i,a,0]},yA=function(e){var t=0;if(e)for(var n in e){var o=e[n].length;o>65535&&L3(9),t+=o+4}return t},CG=function(e,t,n,o,r,i,a,s){var l=o.length,c=n.extra,u=s&&s.length,d=yA(c);m3(e,t,a!=null?33639248:67324752),t+=4,a!=null&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(i<0&&8),e[t++]=r&&8,e[t++]=n.compression&255,e[t++]=n.compression>>8;var p=new Date(n.mtime==null?Date.now():n.mtime),m=p.getFullYear()-1980;if((m<0||m>119)&&L3(10),m3(e,t,m<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>1),t+=4,i!=-1&&(m3(e,t,n.crc),m3(e,t+4,i<0?-i-2:i),m3(e,t+8,n.size)),m3(e,t+12,l),m3(e,t+14,d),t+=16,a!=null&&(m3(e,t,u),m3(e,t+6,n.attrs),m3(e,t+10,a),t+=14),e.set(o,t),t+=l,d)for(var h in c){var S=c[h],v=S.length;m3(e,t,+h),m3(e,t+2,v),e.set(S,t+4),t+=4+v}return u&&(e.set(s,t),t+=u),t},I4e=function(e,t,n,o,r){m3(e,t,101010256),m3(e,t+8,n),m3(e,t+10,n),m3(e,t+12,o),m3(e,t+16,r)};function yw(e,t){t||(t={});var n={},o=[];AG(e,"",n,t);var r=0,i=0;for(var a in n){var s=n[a],l=s[0],c=s[1],u=c.level==0?0:8,d=h4(a),p=d.length,m=c.comment,h=m&&h4(m),S=h&&h.length,v=yA(c.extra);p>65535&&L3(11);var g=u?R4e(l,c):l,y=g.length,x=C4e();x.p(l),o.push(TG(c,{size:l.length,crc:x.d(),c:g,f:d,m:h,u:p!=a.length||h&&m.length!=S,o:r,compression:u})),r+=30+p+v+y,i+=76+2*(p+v)+(S||0)+y}for(var _=new Rr(i+22),$=r,k=i-r,L=0;L<o.length;++L){var d=o[L];CG(_,d.o,d,d.f,d.u,d.c.length);var I=30+d.f.length+yA(d.extra);_.set(d.c,d.o+I),CG(_,r,d,d.f,d.u,d.c.length,d.o,d.m),r+=16+I+(d.m?d.m.length:0)}return I4e(_,r,o.length,k,$),_}function lg(e,t){for(var n={},o=e.length-22;m4(e,o)!=101010256;--o)(!o||e.length-o>65558)&&L3(13);var r=cs(e,o+8);if(!r)return{};var i=m4(e,o+16),a=m4(e,o-20)==117853008;if(a){var s=m4(e,o-12);a=m4(e,s)==101075792,a&&(r=m4(e,s+32),i=m4(e,s+48))}for(var l=t&&t.filter,c=0;c<r;++c){var u=T4e(e,i,a),d=u[0],p=u[1],m=u[2],h=u[3],S=u[4],v=u[5],g=E4e(e,v);i=S,(!l||l({name:h,size:p,originalSize:m,compression:d}))&&(d?d==8?n[h]=$4e(e.subarray(g,g+p),{out:new Rr(m)}):L3(14,"unknown compression type "+d):n[h]=sg(e,g,g+p))}return n}var j=H2(ho(),1);var b7=H2(ho(),1),VG=H2(OP(),1);function k8(e,t,n){let o=n.initialDeps??[],r,i=!0;function a(){var s,l,c;let u;n.key&&((s=n.debug)!=null&&s.call(n))&&(u=Date.now());let d=e();if(!(d.length!==o.length||d.some((h,S)=>o[S]!==h)))return r;o=d;let m;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(m=Date.now()),r=t(...d),n.key&&((c=n.debug)!=null&&c.call(n))){let h=Math.round((Date.now()-u)*100)/100,S=Math.round((Date.now()-m)*100)/100,v=S/16,g=(y,x)=>{for(y=String(y);y.length<x;)y=" "+y;return y};console.info(`%c\u23F1 ${g(S,5)} /${g(h,5)} ms`,`
117
117
  font-size: .6rem;
118
118
  font-weight: bold;
119
119
  color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(r),i=!1,r}return a.updateDeps=s=>{o=s},a}function SA(e,t){if(e===void 0)throw new Error(`Unexpected undefined${t?`: ${t}`:""}`);return e}var IG=(e,t)=>Math.abs(e-t)<1.01,NG=(e,t,n)=>{let o;return function(...r){e.clearTimeout(o),o=e.setTimeout(()=>t.apply(this,r),n)}};var OG=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},N4e=e=>e,O4e=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let r=t;r<=n;r++)o.push(r);return o},BG=(e,t)=>{let n=e.scrollElement;if(!n)return;let o=e.targetWindow;if(!o)return;let r=a=>{let{width:s,height:l}=a;t({width:Math.round(s),height:Math.round(l)})};if(r(OG(n)),!o.ResizeObserver)return()=>{};let i=new o.ResizeObserver(a=>{let s=()=>{let l=a[0];if(l?.borderBoxSize){let c=l.borderBoxSize[0];if(c){r({width:c.inlineSize,height:c.blockSize});return}}r(OG(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},LG={passive:!0};var DG=typeof window>"u"?!0:"onscrollend"in window,jG=(e,t)=>{let n=e.scrollElement;if(!n)return;let o=e.targetWindow;if(!o)return;let r=0,i=e.options.useScrollendEvent&&DG?()=>{}:NG(o,()=>{t(r,!1)},e.options.isScrollingResetDelay),a=u=>()=>{let{horizontal:d,isRtl:p}=e.options;r=d?n.scrollLeft*(p&&-1||1):n.scrollTop,i(),t(r,u)},s=a(!0),l=a(!1);n.addEventListener("scroll",s,LG);let c=e.options.useScrollendEvent&&DG;return c&&n.addEventListener("scrollend",l,LG),()=>{n.removeEventListener("scroll",s),c&&n.removeEventListener("scrollend",l)}};var L4e=(e,t,n)=>{if(t?.borderBoxSize){let o=t.borderBoxSize[0];if(o)return Math.round(o[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]};var UG=(e,{adjustments:t=0,behavior:n},o)=>{var r,i;let a=e+t;(i=(r=o.scrollElement)==null?void 0:r.scrollTo)==null||i.call(r,{[o.options.horizontal?"left":"top"]:a,behavior:n})},vw=class{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var n,o,r;return((r=(o=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:o.now)==null?void 0:r.call(o))??Date.now()},this.observer=(()=>{let n=null,o=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(r=>{r.forEach(i=>{let a=()=>{let s=i.target,l=this.indexFromElement(s);if(!s.isConnected){this.observer.unobserve(s);return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(s,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var r;(r=o())==null||r.disconnect(),n=null},observe:r=>{var i;return(i=o())==null?void 0:i.observe(r,{box:"border-box"})},unobserve:r=>{var i;return(i=o())==null?void 0:i.unobserve(r)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([o,r])=>{typeof r>"u"&&delete n[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:N4e,rangeExtractor:O4e,onChange:()=>{},measureElement:L4e,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var o,r;(r=(o=this.options).onChange)==null||r.call(o,this,n)},this.maybeNotify=k8(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;let o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=i,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,o)=>{let r=new Map,i=new Map;for(let a=o-1;a>=0;a--){let s=n[a];if(r.has(s.lane))continue;let l=i.get(s.lane);if(l==null||s.end>l.end?i.set(s.lane,s):s.end<l.end&&r.set(s.lane,!0),r.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((a,s)=>a.end===s.end?a.index-s.index:a.end-s.end)[0]:void 0},this.getMeasurementOptions=k8(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,o,r,i,a,s)=>(this.prevLanes!==void 0&&this.prevLanes!==s&&(this.lanesChangedFlag=!0),this.prevLanes=s,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:a,lanes:s}),{key:!1}),this.getMeasurements=k8(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:a,lanes:s},l)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(let p of this.laneAssignments.keys())p>=n&&this.laneAssignments.delete(p);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(p=>{this.itemSizeCache.set(p.key,p.size)}));let c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);let u=this.measurementsCache.slice(0,c),d=new Array(s).fill(void 0);for(let p=0;p<c;p++){let m=u[p];m&&(d[m.lane]=p)}for(let p=c;p<n;p++){let m=i(p),h=this.laneAssignments.get(p),S,v;if(h!==void 0&&this.options.lanes>1){S=h;let _=d[S],$=_!==void 0?u[_]:void 0;v=$?$.end+this.options.gap:o+r}else{let _=this.options.lanes===1?u[p-1]:this.getFurthestMeasurement(u,p);v=_?_.end+this.options.gap:o+r,S=_?_.lane:p%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(p,S)}let g=l.get(m),y=typeof g=="number"?g:this.options.estimateSize(p),x=v+y;u[p]={index:p,start:v,size:y,end:x,key:m,lane:S},d[S]=p}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=k8(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,o,r,i)=>this.range=n.length>0&&o>0?D4e({measurements:n,outerSize:o,scrollOffset:r,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=k8(()=>{let n=null,o=null,r=this.calculateRange();return r&&(n=r.startIndex,o=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,o]},(n,o,r,i,a)=>i===null||a===null?[]:n({startIndex:i,endIndex:a,overscan:o,count:r}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{let o=this.options.indexAttribute,r=n.getAttribute(o);return r?parseInt(r,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var o;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;let r=this.scrollState.index??((o=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:o.index);if(r!==void 0&&this.range){let i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,r-i),s=Math.min(this.options.count-1,r+i);return n>=a&&n<=s}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((a,s)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(s))});return}let o=this.indexFromElement(n),r=this.options.getItemKey(o),i=this.elementsCache.get(r);i!==n&&(i&&this.observer.unobserve(i),this.observer.observe(n),this.elementsCache.set(r,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(o)&&this.resizeItem(o,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,o)=>{var r;let i=this.measurementsCache[n];if(!i)return;let a=this.itemSizeCache.get(i.key)??i.size,s=o-a;s!==0&&(((r=this.scrollState)==null?void 0:r.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(i,s,this):i.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(i.index),this.itemSizeCache=new Map(this.itemSizeCache.set(i.key,o)),this.notify(!1))},this.getVirtualItems=k8(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,o)=>{let r=[];for(let i=0,a=n.length;i<a;i++){let s=n[i],l=o[s];r.push(l)}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{let o=this.getMeasurements();if(o.length!==0)return SA(o[FG(0,o.length-1,r=>SA(o[r]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,o,r=0)=>{if(!this.scrollElement)return 0;let i=this.getSize(),a=this.getScrollOffset();o==="auto"&&(o=n>=a+i?"end":"start"),o==="center"?n+=(r-i)/2:o==="end"&&(n-=i);let s=this.getMaxScrollOffset();return Math.max(Math.min(s,n),0)},this.getOffsetForIndex=(n,o="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));let r=this.getSize(),i=this.getScrollOffset(),a=this.measurementsCache[n];if(!a)return;if(o==="auto")if(a.end>=i+r-this.options.scrollPaddingEnd)o="end";else if(a.start<=i+this.options.scrollPaddingStart)o="start";else return[i,o];if(o==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),o];let s=o==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,o,a.size),o]},this.scrollToOffset=(n,{align:o="start",behavior:r="auto"}={})=>{let i=this.getOffsetForAlignment(n,o),a=this.now();this.scrollState={index:null,align:o,behavior:r,startedAt:a,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:o="auto",behavior:r="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));let i=this.getOffsetForIndex(n,o);if(!i)return;let[a,s]=i,l=this.now();this.scrollState={index:n,align:s,behavior:r,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:o="auto"}={})=>{let r=this.getScrollOffset()+n,i=this.now();this.scrollState={index:null,align:"start",behavior:o,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var n;let o=this.getMeasurements(),r;if(o.length===0)r=this.options.paddingStart;else if(this.options.lanes===1)r=((n=o[o.length-1])==null?void 0:n.end)??0;else{let i=Array(this.options.lanes).fill(null),a=o.length-1;for(;a>=0&&i.some(s=>s===null);){let s=o[a];i[s.lane]===null&&(i[s.lane]=s.end),a--}r=Math.max(...i.filter(s=>s!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:o,behavior:r})=>{this.options.scrollToFn(n,{behavior:r,adjustments:o},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let o=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,r=o?o[0]:this.scrollState.lastTargetOffset,i=1,a=r!==this.scrollState.lastTargetOffset;if(!a&&IG(r,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.scrollState=null;return}}else this.scrollState.stableFrames=0,a&&(this.scrollState.lastTargetOffset=r,this.scrollState.behavior="auto",this._scrollToOffset(r,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}},FG=(e,t,n,o)=>{for(;e<=t;){let r=(e+t)/2|0,i=n(r);if(i<o)e=r+1;else if(i>o)t=r-1;else return r}return e>0?e-1:0};function D4e({measurements:e,outerSize:t,scrollOffset:n,lanes:o}){let r=e.length-1,i=l=>e[l].start;if(e.length<=o)return{startIndex:0,endIndex:r};let a=FG(0,r,i,n),s=a;if(o===1)for(;s<r&&e[s].end<n+t;)s++;else if(o>1){let l=Array(o).fill(0);for(;s<r&&l.some(u=>u<n+t);){let u=e[s];l[u.lane]=u.end,s++}let c=Array(o).fill(n+t);for(;a>=0&&c.some(u=>u>=n);){let u=e[a];c[u.lane]=u.start,a--}a=Math.max(0,a-a%o),s=Math.min(r,s+(o-1-s%o))}return{startIndex:a,endIndex:s}}var HG=typeof document<"u"?b7.useLayoutEffect:b7.useEffect;function B4e({useFlushSync:e=!0,...t}){let n=b7.useReducer(()=>({}),{})[1],o={...t,onChange:(i,a)=>{var s;e&&a?(0,VG.flushSync)(n):n(),(s=t.onChange)==null||s.call(t,i,a)}},[r]=b7.useState(()=>new vw(o));return r.setOptions(o),HG(()=>r._didMount(),[]),HG(()=>r._willUpdate()),r}function xA(e){return B4e({observeElementRect:BG,observeElementOffset:jG,scrollToFn:UG,...e})}function j4e(e){var t=0,n=e.children,o=n&&n.length;if(!o)t=1;else for(;--o>=0;)t+=n[o].value;e.value=t}function qG(){return this.eachAfter(j4e)}function WG(e,t){let n=-1;for(let o of this)e.call(t,o,++n,this);return this}function GG(e,t){for(var n=this,o=[n],r,i,a=-1;n=o.pop();)if(e.call(t,n,++a,this),r=n.children)for(i=r.length-1;i>=0;--i)o.push(r[i]);return this}function ZG(e,t){for(var n=this,o=[n],r=[],i,a,s,l=-1;n=o.pop();)if(r.push(n),i=n.children)for(a=0,s=i.length;a<s;++a)o.push(i[a]);for(;n=r.pop();)e.call(t,n,++l,this);return this}function XG(e,t){let n=-1;for(let o of this)if(e.call(t,o,++n,this))return o}function YG(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,o=t.children,r=o&&o.length;--r>=0;)n+=o[r].value;t.value=n})}function KG(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function JG(e){for(var t=this,n=U4e(t,e),o=[t];t!==n;)t=t.parent,o.push(t);for(var r=o.length;e!==n;)o.splice(r,0,e),e=e.parent;return o}function U4e(e,t){if(e===t)return e;var n=e.ancestors(),o=t.ancestors(),r=null;for(e=n.pop(),t=o.pop();e===t;)r=e,e=n.pop(),t=o.pop();return r}function QG(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function eZ(){return Array.from(this)}function tZ(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function nZ(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*rZ(){var e=this,t,n=[e],o,r,i;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,o=e.children)for(r=0,i=o.length;r<i;++r)n.push(o[r]);while(n.length)}function R8(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=V4e)):t===void 0&&(t=H4e);for(var n=new cg(e),o,r=[n],i,a,s,l;o=r.pop();)if((a=t(o.data))&&(l=(a=Array.from(a)).length))for(o.children=a,s=l-1;s>=0;--s)r.push(i=a[s]=new cg(a[s])),i.parent=o,i.depth=o.depth+1;return n.eachBefore(W4e)}function F4e(){return R8(this).eachBefore(q4e)}function H4e(e){return e.children}function V4e(e){return Array.isArray(e)?e[1]:null}function q4e(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function W4e(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function cg(e){this.data=e,this.depth=this.height=0,this.parent=null}cg.prototype=R8.prototype={constructor:cg,count:qG,each:WG,eachAfter:ZG,eachBefore:GG,find:XG,sum:YG,sort:KG,path:JG,ancestors:QG,descendants:eZ,leaves:tZ,links:nZ,copy:F4e,[Symbol.iterator]:rZ};function oZ(e){if(typeof e!="function")throw new Error;return e}function Mu(){return 0}function Eu(e){return function(){return e}}function bw(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function $8(e,t,n,o,r){for(var i=e.children,a,s=-1,l=i.length,c=e.value&&(o-t)/e.value;++s<l;)a=i[s],a.y0=n,a.y1=r,a.x0=t,a.x1=t+=a.value*c}function wA(){var e=1,t=1,n=0,o=!1;function r(a){var s=a.height+1;return a.x0=a.y0=n,a.x1=e,a.y1=t/s,a.eachBefore(i(t,s)),o&&a.eachBefore(bw),a}function i(a,s){return function(l){l.children&&$8(l,l.x0,a*(l.depth+1)/s,l.x1,a*(l.depth+2)/s);var c=l.x0,u=l.y0,d=l.x1-n,p=l.y1-n;d<c&&(c=d=(c+d)/2),p<u&&(u=p=(u+p)/2),l.x0=c,l.y0=u,l.x1=d,l.y1=p}}return r.round=function(a){return arguments.length?(o=!!a,r):o},r.size=function(a){return arguments.length?(e=+a[0],t=+a[1],r):[e,t]},r.padding=function(a){return arguments.length?(n=+a,r):n},r}function iZ(e,t,n,o,r){for(var i=e.children,a,s=-1,l=i.length,c=e.value&&(r-n)/e.value;++s<l;)a=i[s],a.x0=t,a.x1=o,a.y0=n,a.y1=n+=a.value*c}var G4e=(1+Math.sqrt(5))/2;function Z4e(e,t,n,o,r,i){for(var a=[],s=t.children,l,c,u=0,d=0,p=s.length,m,h,S=t.value,v,g,y,x,_,$,k;u<p;){m=r-n,h=i-o;do v=s[d++].value;while(!v&&d<p);for(g=y=v,$=Math.max(h/m,m/h)/(S*e),k=v*v*$,_=Math.max(y/k,k/g);d<p;++d){if(v+=c=s[d].value,c<g&&(g=c),c>y&&(y=c),k=v*v*$,x=Math.max(y/k,k/g),x>_){v-=c;break}_=x}a.push(l={value:v,dice:m<h,children:s.slice(u,d)}),l.dice?$8(l,n,o,r,S?o+=h*v/S:i):iZ(l,n,o,S?n+=m*v/S:r,i),S-=v,u=d}return a}var aZ=(function e(t){function n(o,r,i,a,s){Z4e(t,o,r,i,a,s)}return n.ratio=function(o){return e((o=+o)>1?o:1)},n})(G4e);function _A(){var e=aZ,t=!1,n=1,o=1,r=[0],i=Mu,a=Mu,s=Mu,l=Mu,c=Mu;function u(p){return p.x0=p.y0=0,p.x1=n,p.y1=o,p.eachBefore(d),r=[0],t&&p.eachBefore(bw),p}function d(p){var m=r[p.depth],h=p.x0+m,S=p.y0+m,v=p.x1-m,g=p.y1-m;v<h&&(h=v=(h+v)/2),g<S&&(S=g=(S+g)/2),p.x0=h,p.y0=S,p.x1=v,p.y1=g,p.children&&(m=r[p.depth+1]=i(p)/2,h+=c(p)-m,S+=a(p)-m,v-=s(p)-m,g-=l(p)-m,v<h&&(h=v=(h+v)/2),g<S&&(S=g=(S+g)/2),e(p,h,S,v,g))}return u.round=function(p){return arguments.length?(t=!!p,u):t},u.size=function(p){return arguments.length?(n=+p[0],o=+p[1],u):[n,o]},u.tile=function(p){return arguments.length?(e=oZ(p),u):e},u.padding=function(p){return arguments.length?u.paddingInner(p).paddingOuter(p):u.paddingInner()},u.paddingInner=function(p){return arguments.length?(i=typeof p=="function"?p:Eu(+p),u):i},u.paddingOuter=function(p){return arguments.length?u.paddingTop(p).paddingRight(p).paddingBottom(p).paddingLeft(p):u.paddingTop()},u.paddingTop=function(p){return arguments.length?(a=typeof p=="function"?p:Eu(+p),u):a},u.paddingRight=function(p){return arguments.length?(s=typeof p=="function"?p:Eu(+p),u):s},u.paddingBottom=function(p){return arguments.length?(l=typeof p=="function"?p:Eu(+p),u):l},u.paddingLeft=function(p){return arguments.length?(c=typeof p=="function"?p:Eu(+p),u):c},u}function PA(e,t,n,o,r){var i=e.children,a,s=i.length,l,c=new Array(s+1);for(c[0]=l=a=0;a<s;++a)c[a+1]=l+=i[a].value;u(0,s,e.value,t,n,o,r);function u(d,p,m,h,S,v,g){if(d>=p-1){var y=i[d];y.x0=h,y.y0=S,y.x1=v,y.y1=g;return}for(var x=c[d],_=m/2+x,$=d+1,k=p-1;$<k;){var L=$+k>>>1;c[L]<_?$=L+1:k=L}_-c[$-1]<c[$]-_&&d+1<$&&--$;var I=c[$]-x,N=m-I;if(v-h>g-S){var U=m?(h*N+v*I)/m:v;u(d,$,I,h,S,U,g),u($,p,N,U,S,v,g)}else{var z=m?(S*N+g*I)/m:g;u(d,$,I,h,S,v,z),u($,p,N,h,z,v,g)}}}function z8(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function CA(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Sw(e){let t,n,o;e.length!==2?(t=z8,n=(s,l)=>z8(e(s),l),o=(s,l)=>e(s)-l):(t=e===z8||e===CA?e:X4e,n=e,o=e);function r(s,l,c=0,u=s.length){if(c<u){if(t(l,l)!==0)return u;do{let d=c+u>>>1;n(s[d],l)<0?c=d+1:u=d}while(c<u)}return c}function i(s,l,c=0,u=s.length){if(c<u){if(t(l,l)!==0)return u;do{let d=c+u>>>1;n(s[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function a(s,l,c=0,u=s.length){let d=r(s,l,c,u-1);return d>c&&o(s[d-1],l)>-o(s[d],l)?d-1:d}return{left:r,center:a,right:i}}function X4e(){return 0}function kA(e){return e===null?NaN:+e}var sZ=Sw(z8),lZ=sZ.right,Y4e=sZ.left,K4e=Sw(kA).center,RA=lZ;var ka=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){let n=this._partials,o=0;for(let r=0;r<this._n&&r<32;r++){let i=n[r],a=t+i,s=Math.abs(t)<Math.abs(i)?t-(a-i):i-(a-t);s&&(n[o++]=s),t=a}return n[o]=t,this._n=o+1,this}valueOf(){let t=this._partials,n=this._n,o,r,i,a=0;if(n>0){for(a=t[--n];n>0&&(o=a,r=t[--n],a=o+r,i=r-(a-o),!i););n>0&&(i<0&&t[n-1]<0||i>0&&t[n-1]>0)&&(r=i*2,o=a+r,r==o-a&&(a=o))}return a}};var Tu=class extends Map{constructor(t,n=e5e){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(let[o,r]of t)this.set(o,r)}get(t){return super.get(cZ(this,t))}has(t){return super.has(cZ(this,t))}set(t,n){return super.set(J4e(this,t),n)}delete(t){return super.delete(Q4e(this,t))}};function cZ({_intern:e,_key:t},n){let o=t(n);return e.has(o)?e.get(o):n}function J4e({_intern:e,_key:t},n){let o=t(n);return e.has(o)?e.get(o):(e.set(o,n),n)}function Q4e({_intern:e,_key:t},n){let o=t(n);return e.has(o)&&(n=e.get(o),e.delete(o)),n}function e5e(e){return e!==null&&typeof e=="object"?e.valueOf():e}var t5e=Math.sqrt(50),n5e=Math.sqrt(10),r5e=Math.sqrt(2);function xw(e,t,n){let o=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(o)),i=o/Math.pow(10,r),a=i>=t5e?10:i>=n5e?5:i>=r5e?2:1,s,l,c;return r<0?(c=Math.pow(10,-r)/a,s=Math.round(e*c),l=Math.round(t*c),s/c<e&&++s,l/c>t&&--l,c=-c):(c=Math.pow(10,r)*a,s=Math.round(e/c),l=Math.round(t/c),s*c<e&&++s,l*c>t&&--l),l<s&&.5<=n&&n<2?xw(e,t,n*2):[s,l,c]}function ww(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let o=t<e,[r,i,a]=o?xw(t,e,n):xw(e,t,n);if(!(i>=r))return[];let s=i-r+1,l=new Array(s);if(o)if(a<0)for(let c=0;c<s;++c)l[c]=(i-c)/-a;else for(let c=0;c<s;++c)l[c]=(i-c)*a;else if(a<0)for(let c=0;c<s;++c)l[c]=(r+c)/-a;else for(let c=0;c<s;++c)l[c]=(r+c)*a;return l}function ug(e,t,n){return t=+t,e=+e,n=+n,xw(e,t,n)[2]}function $A(e,t,n){t=+t,e=+e,n=+n;let o=t<e,r=o?ug(t,e,n):ug(e,t,n);return(o?-1:1)*(r<0?1/-r:r)}function*o5e(e){for(let t of e)yield*t}function Au(e){return Array.from(o5e(e))}function _w(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var o=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(r);++o<r;)i[o]=e+o*n;return i}var D2=1e-6,uZ=1e-12,M2=Math.PI,Ho=M2/2,zA=M2/4,Vo=M2*2,qo=180/M2,Tn=M2/180,en=Math.abs,Pw=Math.atan,A0=Math.atan2,cn=Math.cos;var dZ=Math.exp;var pZ=Math.log;var Pn=Math.sin,fZ=Math.sign||function(e){return e>0?1:e<0?-1:0},Ra=Math.sqrt,mZ=Math.tan;function hZ(e){return e>1?0:e<-1?M2:Math.acos(e)}function I0(e){return e>1?Ho:e<-1?-Ho:Math.asin(e)}function Wo(){}function Cw(e,t){e&&yZ.hasOwnProperty(e.type)&&yZ[e.type](e,t)}var gZ={Feature:function(e,t){Cw(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,o=-1,r=n.length;++o<r;)Cw(n[o].geometry,t)}},yZ={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,o=-1,r=n.length;++o<r;)e=n[o],t.point(e[0],e[1],e[2])},LineString:function(e,t){MA(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,o=-1,r=n.length;++o<r;)MA(n[o],t,0)},Polygon:function(e,t){vZ(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,o=-1,r=n.length;++o<r;)vZ(n[o],t)},GeometryCollection:function(e,t){for(var n=e.geometries,o=-1,r=n.length;++o<r;)Cw(n[o],t)}};function MA(e,t,n){var o=-1,r=e.length-n,i;for(t.lineStart();++o<r;)i=e[o],t.point(i[0],i[1],i[2]);t.lineEnd()}function vZ(e,t){var n=-1,o=e.length;for(t.polygonStart();++n<o;)MA(e[n],t,1);t.polygonEnd()}function S7(e,t){e&&gZ.hasOwnProperty(e.type)?gZ[e.type](e,t):Cw(e,t)}function dg(e){return[A0(e[1],e[0]),I0(e[2])]}function ds(e){var t=e[0],n=e[1],o=cn(n);return[o*cn(t),o*Pn(t),Pn(n)]}function pg(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Iu(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function kw(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function fg(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function mg(e){var t=Ra(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function hg(e,t){function n(o,r){return o=e(o,r),t(o[0],o[1])}return e.invert&&t.invert&&(n.invert=function(o,r){return o=t.invert(o,r),o&&e.invert(o[0],o[1])}),n}function EA(e,t){return en(e)>M2&&(e-=Math.round(e/Vo)*Vo),[e,t]}EA.invert=EA;function TA(e,t,n){return(e%=Vo)?t||n?hg(SZ(e),xZ(t,n)):SZ(e):t||n?xZ(t,n):EA}function bZ(e){return function(t,n){return t+=e,en(t)>M2&&(t-=Math.round(t/Vo)*Vo),[t,n]}}function SZ(e){var t=bZ(e);return t.invert=bZ(-e),t}function xZ(e,t){var n=cn(e),o=Pn(e),r=cn(t),i=Pn(t);function a(s,l){var c=cn(l),u=cn(s)*c,d=Pn(s)*c,p=Pn(l),m=p*n+u*o;return[A0(d*r-m*i,u*n-p*o),I0(m*r+d*i)]}return a.invert=function(s,l){var c=cn(l),u=cn(s)*c,d=Pn(s)*c,p=Pn(l),m=p*r-d*i;return[A0(d*r+p*i,u*n+m*o),I0(m*n-u*o)]},a}function wZ(e){e=TA(e[0]*Tn,e[1]*Tn,e.length>2?e[2]*Tn:0);function t(n){return n=e(n[0]*Tn,n[1]*Tn),n[0]*=qo,n[1]*=qo,n}return t.invert=function(n){return n=e.invert(n[0]*Tn,n[1]*Tn),n[0]*=qo,n[1]*=qo,n},t}function PZ(e,t,n,o,r,i){if(n){var a=cn(t),s=Pn(t),l=o*n;r==null?(r=t+o*Vo,i=t-l/2):(r=_Z(a,r),i=_Z(a,i),(o>0?r<i:r>i)&&(r+=o*Vo));for(var c,u=r;o>0?u>i:u<i;u-=l)c=dg([a,-s*cn(u),-s*Pn(u)]),e.point(c[0],c[1])}}function _Z(e,t){t=ds(t),t[0]-=e,mg(t);var n=hZ(-t[1]);return((-t[2]<0?-n:n)+Vo-D2)%Vo}function Rw(){var e=[],t;return{point:function(n,o,r){t.push([n,o,r])},lineStart:function(){e.push(t=[])},lineEnd:Wo,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Nu(e,t){return en(e[0]-t[0])<D2&&en(e[1]-t[1])<D2}function $w(e,t,n,o){this.x=e,this.z=t,this.o=n,this.e=o,this.v=!1,this.n=this.p=null}function zw(e,t,n,o,r){var i=[],a=[],s,l;if(e.forEach(function(h){if(!((S=h.length-1)<=0)){var S,v=h[0],g=h[S],y;if(Nu(v,g)){if(!v[2]&&!g[2]){for(r.lineStart(),s=0;s<S;++s)r.point((v=h[s])[0],v[1]);r.lineEnd();return}g[0]+=2*D2}i.push(y=new $w(v,h,null,!0)),a.push(y.o=new $w(v,null,y,!1)),i.push(y=new $w(g,h,null,!1)),a.push(y.o=new $w(g,null,y,!0))}}),!!i.length){for(a.sort(t),CZ(i),CZ(a),s=0,l=a.length;s<l;++s)a[s].e=n=!n;for(var c=i[0],u,d;;){for(var p=c,m=!0;p.v;)if((p=p.n)===c)return;u=p.z,r.lineStart();do{if(p.v=p.o.v=!0,p.e){if(m)for(s=0,l=u.length;s<l;++s)r.point((d=u[s])[0],d[1]);else o(p.x,p.n.x,1,r);p=p.n}else{if(m)for(u=p.p.z,s=u.length-1;s>=0;--s)r.point((d=u[s])[0],d[1]);else o(p.x,p.p.x,-1,r);p=p.p}p=p.o,u=p.z,m=!m}while(!p.v);r.lineEnd()}}}function CZ(e){if(t=e.length){for(var t,n=0,o=e[0],r;++n<t;)o.n=r=e[n],r.p=o,o=r;o.n=r=e[0],r.p=o}}function AA(e){return en(e[0])<=M2?e[0]:fZ(e[0])*((en(e[0])+M2)%Vo-M2)}function kZ(e,t){var n=AA(t),o=t[1],r=Pn(o),i=[Pn(n),-cn(n),0],a=0,s=0,l=new ka;r===1?o=Ho+D2:r===-1&&(o=-Ho-D2);for(var c=0,u=e.length;c<u;++c)if(p=(d=e[c]).length)for(var d,p,m=d[p-1],h=AA(m),S=m[1]/2+zA,v=Pn(S),g=cn(S),y=0;y<p;++y,h=_,v=k,g=L,m=x){var x=d[y],_=AA(x),$=x[1]/2+zA,k=Pn($),L=cn($),I=_-h,N=I>=0?1:-1,U=N*I,z=U>M2,Z=v*k;if(l.add(A0(Z*N*Pn(U),g*L+Z*cn(U))),a+=z?I+N*Vo:I,z^h>=n^_>=n){var ie=Iu(ds(m),ds(x));mg(ie);var ue=Iu(i,ie);mg(ue);var X=(z^I>=0?-1:1)*I0(ue[2]);(o>X||o===X&&(ie[0]||ie[1]))&&(s+=z^I>=0?1:-1)}}return(a<-D2||a<D2&&l<-uZ)^s&1}function Mw(e,t,n,o){return function(r){var i=t(r),a=Rw(),s=t(a),l=!1,c,u,d,p={point:m,lineStart:S,lineEnd:v,polygonStart:function(){p.point=g,p.lineStart=y,p.lineEnd=x,u=[],c=[]},polygonEnd:function(){p.point=m,p.lineStart=S,p.lineEnd=v,u=Au(u);var _=kZ(c,o);u.length?(l||(r.polygonStart(),l=!0),zw(u,a5e,_,n,r)):_&&(l||(r.polygonStart(),l=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),l&&(r.polygonEnd(),l=!1),u=c=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function m(_,$){e(_,$)&&r.point(_,$)}function h(_,$){i.point(_,$)}function S(){p.point=h,i.lineStart()}function v(){p.point=m,i.lineEnd()}function g(_,$){d.push([_,$]),s.point(_,$)}function y(){s.lineStart(),d=[]}function x(){g(d[0][0],d[0][1]),s.lineEnd();var _=s.clean(),$=a.result(),k,L=$.length,I,N,U;if(d.pop(),c.push(d),d=null,!!L){if(_&1){if(N=$[0],(I=N.length-1)>0){for(l||(r.polygonStart(),l=!0),r.lineStart(),k=0;k<I;++k)r.point((U=N[k])[0],U[1]);r.lineEnd()}return}L>1&&_&2&&$.push($.pop().concat($.shift())),u.push($.filter(i5e))}}return p}}function i5e(e){return e.length>1}function a5e(e,t){return((e=e.x)[0]<0?e[1]-Ho-D2:Ho-e[1])-((t=t.x)[0]<0?t[1]-Ho-D2:Ho-t[1])}var IA=Mw(function(){return!0},s5e,c5e,[-M2,-Ho]);function s5e(e){var t=NaN,n=NaN,o=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(i,a){var s=i>0?M2:-M2,l=en(i-t);en(l-M2)<D2?(e.point(t,n=(n+a)/2>0?Ho:-Ho),e.point(o,n),e.lineEnd(),e.lineStart(),e.point(s,n),e.point(i,n),r=0):o!==s&&l>=M2&&(en(t-o)<D2&&(t-=o*D2),en(i-s)<D2&&(i-=s*D2),n=l5e(t,n,i,a),e.point(o,n),e.lineEnd(),e.lineStart(),e.point(s,n),r=0),e.point(t=i,n=a),o=s},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-r}}}function l5e(e,t,n,o){var r,i,a=Pn(e-n);return en(a)>D2?Pw((Pn(t)*(i=cn(o))*Pn(n)-Pn(o)*(r=cn(t))*Pn(e))/(r*i*a)):(t+o)/2}function c5e(e,t,n,o){var r;if(e==null)r=n*Ho,o.point(-M2,r),o.point(0,r),o.point(M2,r),o.point(M2,0),o.point(M2,-r),o.point(0,-r),o.point(-M2,-r),o.point(-M2,0),o.point(-M2,r);else if(en(e[0]-t[0])>D2){var i=e[0]<t[0]?M2:-M2;r=n*i/2,o.point(-i,r),o.point(0,r),o.point(i,r)}else o.point(t[0],t[1])}function RZ(e){var t=cn(e),n=2*Tn,o=t>0,r=en(t)>D2;function i(u,d,p,m){PZ(m,e,n,p,u,d)}function a(u,d){return cn(u)*cn(d)>t}function s(u){var d,p,m,h,S;return{lineStart:function(){h=m=!1,S=1},point:function(v,g){var y=[v,g],x,_=a(v,g),$=o?_?0:c(v,g):_?c(v+(v<0?M2:-M2),g):0;if(!d&&(h=m=_)&&u.lineStart(),_!==m&&(x=l(d,y),(!x||Nu(d,x)||Nu(y,x))&&(y[2]=1)),_!==m)S=0,_?(u.lineStart(),x=l(y,d),u.point(x[0],x[1])):(x=l(d,y),u.point(x[0],x[1],2),u.lineEnd()),d=x;else if(r&&d&&o^_){var k;!($&p)&&(k=l(y,d,!0))&&(S=0,o?(u.lineStart(),u.point(k[0][0],k[0][1]),u.point(k[1][0],k[1][1]),u.lineEnd()):(u.point(k[1][0],k[1][1]),u.lineEnd(),u.lineStart(),u.point(k[0][0],k[0][1],3)))}_&&(!d||!Nu(d,y))&&u.point(y[0],y[1]),d=y,m=_,p=$},lineEnd:function(){m&&u.lineEnd(),d=null},clean:function(){return S|(h&&m)<<1}}}function l(u,d,p){var m=ds(u),h=ds(d),S=[1,0,0],v=Iu(m,h),g=pg(v,v),y=v[0],x=g-y*y;if(!x)return!p&&u;var _=t*g/x,$=-t*y/x,k=Iu(S,v),L=fg(S,_),I=fg(v,$);kw(L,I);var N=k,U=pg(L,N),z=pg(N,N),Z=U*U-z*(pg(L,L)-1);if(!(Z<0)){var ie=Ra(Z),ue=fg(N,(-U-ie)/z);if(kw(ue,L),ue=dg(ue),!p)return ue;var X=u[0],W=d[0],Me=u[1],Fe=d[1],Se;W<X&&(Se=X,X=W,W=Se);var $e=W-X,He=en($e-M2)<D2,r1=He||$e<D2;if(!He&&Fe<Me&&(Se=Me,Me=Fe,Fe=Se),r1?He?Me+Fe>0^ue[1]<(en(ue[0]-X)<D2?Me:Fe):Me<=ue[1]&&ue[1]<=Fe:$e>M2^(X<=ue[0]&&ue[0]<=W)){var b1=fg(N,(-U+ie)/z);return kw(b1,L),[ue,dg(b1)]}}}function c(u,d){var p=o?e:M2-e,m=0;return u<-p?m|=1:u>p&&(m|=2),d<-p?m|=4:d>p&&(m|=8),m}return Mw(a,s,i,o?[0,-e]:[-M2,e-M2])}function $Z(e,t,n,o,r,i){var a=e[0],s=e[1],l=t[0],c=t[1],u=0,d=1,p=l-a,m=c-s,h;if(h=n-a,!(!p&&h>0)){if(h/=p,p<0){if(h<u)return;h<d&&(d=h)}else if(p>0){if(h>d)return;h>u&&(u=h)}if(h=r-a,!(!p&&h<0)){if(h/=p,p<0){if(h>d)return;h>u&&(u=h)}else if(p>0){if(h<u)return;h<d&&(d=h)}if(h=o-s,!(!m&&h>0)){if(h/=m,m<0){if(h<u)return;h<d&&(d=h)}else if(m>0){if(h>d)return;h>u&&(u=h)}if(h=i-s,!(!m&&h<0)){if(h/=m,m<0){if(h>d)return;h>u&&(u=h)}else if(m>0){if(h<u)return;h<d&&(d=h)}return u>0&&(e[0]=a+u*p,e[1]=s+u*m),d<1&&(t[0]=a+d*p,t[1]=s+d*m),!0}}}}}var gg=1e9,Ew=-gg;function yg(e,t,n,o){function r(c,u){return e<=c&&c<=n&&t<=u&&u<=o}function i(c,u,d,p){var m=0,h=0;if(c==null||(m=a(c,d))!==(h=a(u,d))||l(c,u)<0^d>0)do p.point(m===0||m===3?e:n,m>1?o:t);while((m=(m+d+4)%4)!==h);else p.point(u[0],u[1])}function a(c,u){return en(c[0]-e)<D2?u>0?0:3:en(c[0]-n)<D2?u>0?2:1:en(c[1]-t)<D2?u>0?1:0:u>0?3:2}function s(c,u){return l(c.x,u.x)}function l(c,u){var d=a(c,1),p=a(u,1);return d!==p?d-p:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=Rw(),p,m,h,S,v,g,y,x,_,$,k,L={point:I,lineStart:Z,lineEnd:ie,polygonStart:U,polygonEnd:z};function I(X,W){r(X,W)&&u.point(X,W)}function N(){for(var X=0,W=0,Me=m.length;W<Me;++W)for(var Fe=m[W],Se=1,$e=Fe.length,He=Fe[0],r1,b1,p1=He[0],re=He[1];Se<$e;++Se)r1=p1,b1=re,He=Fe[Se],p1=He[0],re=He[1],b1<=o?re>o&&(p1-r1)*(o-b1)>(re-b1)*(e-r1)&&++X:re<=o&&(p1-r1)*(o-b1)<(re-b1)*(e-r1)&&--X;return X}function U(){u=d,p=[],m=[],k=!0}function z(){var X=N(),W=k&&X,Me=(p=Au(p)).length;(W||Me)&&(c.polygonStart(),W&&(c.lineStart(),i(null,null,1,c),c.lineEnd()),Me&&zw(p,s,X,i,c),c.polygonEnd()),u=c,p=m=h=null}function Z(){L.point=ue,m&&m.push(h=[]),$=!0,_=!1,y=x=NaN}function ie(){p&&(ue(S,v),g&&_&&d.rejoin(),p.push(d.result())),L.point=I,_&&u.lineEnd()}function ue(X,W){var Me=r(X,W);if(m&&h.push([X,W]),$)S=X,v=W,g=Me,$=!1,Me&&(u.lineStart(),u.point(X,W));else if(Me&&_)u.point(X,W);else{var Fe=[y=Math.max(Ew,Math.min(gg,y)),x=Math.max(Ew,Math.min(gg,x))],Se=[X=Math.max(Ew,Math.min(gg,X)),W=Math.max(Ew,Math.min(gg,W))];$Z(Fe,Se,e,t,n,o)?(_||(u.lineStart(),u.point(Fe[0],Fe[1])),u.point(Se[0],Se[1]),Me||u.lineEnd(),k=!1):Me&&(u.lineStart(),u.point(X,W),k=!1)}y=X,x=W,_=Me}return L}}var x7=e=>e;var NA=new ka,OA=new ka,zZ,MZ,LA,DA,w7={point:Wo,lineStart:Wo,lineEnd:Wo,polygonStart:function(){w7.lineStart=u5e,w7.lineEnd=p5e},polygonEnd:function(){w7.lineStart=w7.lineEnd=w7.point=Wo,NA.add(en(OA)),OA=new ka},result:function(){var e=NA/2;return NA=new ka,e}};function u5e(){w7.point=d5e}function d5e(e,t){w7.point=EZ,zZ=LA=e,MZ=DA=t}function EZ(e,t){OA.add(DA*e-LA*t),LA=e,DA=t}function p5e(){EZ(zZ,MZ)}var BA=w7;var Ou=1/0,Tw=Ou,vg=-Ou,Aw=vg,f5e={point:m5e,lineStart:Wo,lineEnd:Wo,polygonStart:Wo,polygonEnd:Wo,result:function(){var e=[[Ou,Tw],[vg,Aw]];return vg=Aw=-(Tw=Ou=1/0),e}};function m5e(e,t){e<Ou&&(Ou=e),e>vg&&(vg=e),t<Tw&&(Tw=t),t>Aw&&(Aw=t)}var Lu=f5e;var jA=0,UA=0,bg=0,Iw=0,Nw=0,Du=0,FA=0,HA=0,Sg=0,IZ,NZ,ps,fs,r5={point:M8,lineStart:TZ,lineEnd:AZ,polygonStart:function(){r5.lineStart=y5e,r5.lineEnd=v5e},polygonEnd:function(){r5.point=M8,r5.lineStart=TZ,r5.lineEnd=AZ},result:function(){var e=Sg?[FA/Sg,HA/Sg]:Du?[Iw/Du,Nw/Du]:bg?[jA/bg,UA/bg]:[NaN,NaN];return jA=UA=bg=Iw=Nw=Du=FA=HA=Sg=0,e}};function M8(e,t){jA+=e,UA+=t,++bg}function TZ(){r5.point=h5e}function h5e(e,t){r5.point=g5e,M8(ps=e,fs=t)}function g5e(e,t){var n=e-ps,o=t-fs,r=Ra(n*n+o*o);Iw+=r*(ps+e)/2,Nw+=r*(fs+t)/2,Du+=r,M8(ps=e,fs=t)}function AZ(){r5.point=M8}function y5e(){r5.point=b5e}function v5e(){OZ(IZ,NZ)}function b5e(e,t){r5.point=OZ,M8(IZ=ps=e,NZ=fs=t)}function OZ(e,t){var n=e-ps,o=t-fs,r=Ra(n*n+o*o);Iw+=r*(ps+e)/2,Nw+=r*(fs+t)/2,Du+=r,r=fs*e-ps*t,FA+=r*(ps+e),HA+=r*(fs+t),Sg+=r*3,M8(ps=e,fs=t)}var VA=r5;function Ow(e){this._context=e}Ow.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Vo);break}}},result:Wo};var WA=new ka,qA,LZ,DZ,xg,wg,Lw={point:Wo,lineStart:function(){Lw.point=S5e},lineEnd:function(){qA&&BZ(LZ,DZ),Lw.point=Wo},polygonStart:function(){qA=!0},polygonEnd:function(){qA=null},result:function(){var e=+WA;return WA=new ka,e}};function S5e(e,t){Lw.point=BZ,LZ=xg=e,DZ=wg=t}function BZ(e,t){xg-=e,wg-=t,WA.add(Ra(xg*xg+wg*wg)),xg=e,wg=t}var GA=Lw;var jZ,Dw,UZ,FZ,Bu=class{constructor(t){this._append=t==null?HZ:x5e(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==UZ||this._append!==Dw){let o=this._radius,r=this._;this._="",this._append`m0,${o}a${o},${o} 0 1,1 0,${-2*o}a${o},${o} 0 1,1 0,${2*o}z`,UZ=o,Dw=this._append,FZ=this._,this._=r}this._+=FZ;break}}}result(){let t=this._;return this._="",t.length?t:null}};function HZ(e){let t=1;this._+=e[0];for(let n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function x5e(e){let t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return HZ;if(t!==jZ){let n=10**t;jZ=t,Dw=function(r){let i=1;this._+=r[0];for(let a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}return Dw}function ZA(e,t){let n=3,o=4.5,r,i;function a(s){return s&&(typeof o=="function"&&i.pointRadius(+o.apply(this,arguments)),S7(s,r(i))),i.result()}return a.area=function(s){return S7(s,r(BA)),BA.result()},a.measure=function(s){return S7(s,r(GA)),GA.result()},a.bounds=function(s){return S7(s,r(Lu)),Lu.result()},a.centroid=function(s){return S7(s,r(VA)),VA.result()},a.projection=function(s){return arguments.length?(r=s==null?(e=null,x7):(e=s).stream,a):e},a.context=function(s){return arguments.length?(i=s==null?(t=null,new Bu(n)):new Ow(t=s),typeof o!="function"&&i.pointRadius(o),a):t},a.pointRadius=function(s){return arguments.length?(o=typeof s=="function"?s:(i.pointRadius(+s),+s),a):o},a.digits=function(s){if(!arguments.length)return n;if(s==null)n=null;else{let l=Math.floor(s);if(!(l>=0))throw new RangeError(`invalid digits: ${s}`);n=l}return t===null&&(i=new Bu(n)),a},a.projection(e).digits(n).context(t)}function E8(e){return function(t){var n=new XA;for(var o in e)n[o]=e[o];return n.stream=t,n}}function XA(){}XA.prototype={constructor:XA,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function YA(e,t,n){var o=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),o!=null&&e.clipExtent(null),S7(n,e.stream(Lu)),t(Lu.result()),o!=null&&e.clipExtent(o),e}function _g(e,t,n){return YA(e,function(o){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=Math.min(r/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),s=+t[0][0]+(r-a*(o[1][0]+o[0][0]))/2,l=+t[0][1]+(i-a*(o[1][1]+o[0][1]))/2;e.scale(150*a).translate([s,l])},n)}function Bw(e,t,n){return _g(e,[[0,0],t],n)}function jw(e,t,n){return YA(e,function(o){var r=+t,i=r/(o[1][0]-o[0][0]),a=(r-i*(o[1][0]+o[0][0]))/2,s=-i*o[0][1];e.scale(150*i).translate([a,s])},n)}function Uw(e,t,n){return YA(e,function(o){var r=+t,i=r/(o[1][1]-o[0][1]),a=-i*o[0][0],s=(r-i*(o[1][1]+o[0][1]))/2;e.scale(150*i).translate([a,s])},n)}var VZ=16,w5e=cn(30*Tn);function KA(e,t){return+t?P5e(e,t):_5e(e)}function _5e(e){return E8({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function P5e(e,t){function n(o,r,i,a,s,l,c,u,d,p,m,h,S,v){var g=c-o,y=u-r,x=g*g+y*y;if(x>4*t&&S--){var _=a+p,$=s+m,k=l+h,L=Ra(_*_+$*$+k*k),I=I0(k/=L),N=en(en(k)-1)<D2||en(i-d)<D2?(i+d)/2:A0($,_),U=e(N,I),z=U[0],Z=U[1],ie=z-o,ue=Z-r,X=y*ie-g*ue;(X*X/x>t||en((g*ie+y*ue)/x-.5)>.3||a*p+s*m+l*h<w5e)&&(n(o,r,i,a,s,l,z,Z,N,_/=L,$/=L,k,S,v),v.point(z,Z),n(z,Z,N,_,$,k,c,u,d,p,m,h,S,v))}}return function(o){var r,i,a,s,l,c,u,d,p,m,h,S,v={point:g,lineStart:y,lineEnd:_,polygonStart:function(){o.polygonStart(),v.lineStart=$},polygonEnd:function(){o.polygonEnd(),v.lineStart=y}};function g(I,N){I=e(I,N),o.point(I[0],I[1])}function y(){d=NaN,v.point=x,o.lineStart()}function x(I,N){var U=ds([I,N]),z=e(I,N);n(d,p,u,m,h,S,d=z[0],p=z[1],u=I,m=U[0],h=U[1],S=U[2],VZ,o),o.point(d,p)}function _(){v.point=g,o.lineEnd()}function $(){y(),v.point=k,v.lineEnd=L}function k(I,N){x(r=I,N),i=d,a=p,s=m,l=h,c=S,v.point=x}function L(){n(d,p,u,m,h,S,i,a,r,s,l,c,VZ,o),v.lineEnd=_,_()}return v}}var C5e=E8({point:function(e,t){this.stream.point(e*Tn,t*Tn)}});function k5e(e){return E8({point:function(t,n){var o=e(t,n);return this.stream.point(o[0],o[1])}})}function R5e(e,t,n,o,r){function i(a,s){return a*=o,s*=r,[t+e*a,n-e*s]}return i.invert=function(a,s){return[(a-t)/e*o,(n-s)/e*r]},i}function qZ(e,t,n,o,r,i){if(!i)return R5e(e,t,n,o,r);var a=cn(i),s=Pn(i),l=a*e,c=s*e,u=a/e,d=s/e,p=(s*n-a*t)/e,m=(s*t+a*n)/e;function h(S,v){return S*=o,v*=r,[l*S-c*v+t,n-c*S-l*v]}return h.invert=function(S,v){return[o*(u*S-d*v+p),r*(m-d*S-u*v)]},h}function Pg(e){return $5e(function(){return e})()}function $5e(e){var t,n=150,o=480,r=250,i=0,a=0,s=0,l=0,c=0,u,d=0,p=1,m=1,h=null,S=IA,v=null,g,y,x,_=x7,$=.5,k,L,I,N,U;function z(X){return I(X[0]*Tn,X[1]*Tn)}function Z(X){return X=I.invert(X[0],X[1]),X&&[X[0]*qo,X[1]*qo]}z.stream=function(X){return N&&U===X?N:N=C5e(k5e(u)(S(k(_(U=X)))))},z.preclip=function(X){return arguments.length?(S=X,h=void 0,ue()):S},z.postclip=function(X){return arguments.length?(_=X,v=g=y=x=null,ue()):_},z.clipAngle=function(X){return arguments.length?(S=+X?RZ(h=X*Tn):(h=null,IA),ue()):h*qo},z.clipExtent=function(X){return arguments.length?(_=X==null?(v=g=y=x=null,x7):yg(v=+X[0][0],g=+X[0][1],y=+X[1][0],x=+X[1][1]),ue()):v==null?null:[[v,g],[y,x]]},z.scale=function(X){return arguments.length?(n=+X,ie()):n},z.translate=function(X){return arguments.length?(o=+X[0],r=+X[1],ie()):[o,r]},z.center=function(X){return arguments.length?(i=X[0]%360*Tn,a=X[1]%360*Tn,ie()):[i*qo,a*qo]},z.rotate=function(X){return arguments.length?(s=X[0]%360*Tn,l=X[1]%360*Tn,c=X.length>2?X[2]%360*Tn:0,ie()):[s*qo,l*qo,c*qo]},z.angle=function(X){return arguments.length?(d=X%360*Tn,ie()):d*qo},z.reflectX=function(X){return arguments.length?(p=X?-1:1,ie()):p<0},z.reflectY=function(X){return arguments.length?(m=X?-1:1,ie()):m<0},z.precision=function(X){return arguments.length?(k=KA(L,$=X*X),ue()):Ra($)},z.fitExtent=function(X,W){return _g(z,X,W)},z.fitSize=function(X,W){return Bw(z,X,W)},z.fitWidth=function(X,W){return jw(z,X,W)},z.fitHeight=function(X,W){return Uw(z,X,W)};function ie(){var X=qZ(n,0,0,p,m,d).apply(null,t(i,a)),W=qZ(n,o-X[0],r-X[1],p,m,d);return u=TA(s,l,c),L=hg(t,W),I=hg(u,L),k=KA(L,$),ue()}function ue(){return N=U=null,z}return function(){return t=e.apply(this,arguments),z.invert=t.invert&&Z,ie()}}function Fw(e,t){return[e,pZ(mZ((Ho+t)/2))]}Fw.invert=function(e,t){return[e,2*Pw(dZ(t))-Ho]};function JA(){return z5e(Fw).scale(961/Vo)}function z5e(e){var t=Pg(e),n=t.center,o=t.scale,r=t.translate,i=t.clipExtent,a=null,s,l,c;t.scale=function(d){return arguments.length?(o(d),u()):o()},t.translate=function(d){return arguments.length?(r(d),u()):r()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?a=s=l=c=null:(a=+d[0][0],s=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):a==null?null:[[a,s],[l,c]]};function u(){var d=M2*o(),p=t(wZ(t.rotate()).invert([0,0]));return i(a==null?[[p[0]-d,p[1]-d],[p[0]+d,p[1]+d]]:e===Fw?[[Math.max(p[0]-d,a),s],[Math.min(p[0]+d,l),c]]:[[a,Math.max(p[1]-d,s)],[l,Math.min(p[1]+d,c)]])}return u()}function QA(){var e=1,t=0,n=0,o=1,r=1,i=0,a,s,l=null,c,u,d,p=1,m=1,h=E8({point:function(_,$){var k=x([_,$]);this.stream.point(k[0],k[1])}}),S=x7,v,g;function y(){return p=e*o,m=e*r,v=g=null,x}function x(_){var $=_[0]*p,k=_[1]*m;if(i){var L=k*a-$*s;$=$*a+k*s,k=L}return[$+t,k+n]}return x.invert=function(_){var $=_[0]-t,k=_[1]-n;if(i){var L=k*a+$*s;$=$*a-k*s,k=L}return[$/p,k/m]},x.stream=function(_){return v&&g===_?v:v=h(S(g=_))},x.postclip=function(_){return arguments.length?(S=_,l=c=u=d=null,y()):S},x.clipExtent=function(_){return arguments.length?(S=_==null?(l=c=u=d=null,x7):yg(l=+_[0][0],c=+_[0][1],u=+_[1][0],d=+_[1][1]),y()):l==null?null:[[l,c],[u,d]]},x.scale=function(_){return arguments.length?(e=+_,y()):e},x.translate=function(_){return arguments.length?(t=+_[0],n=+_[1],y()):[t,n]},x.angle=function(_){return arguments.length?(i=_%360*Tn,s=Pn(i),a=cn(i),y()):i*qo},x.reflectX=function(_){return arguments.length?(o=_?-1:1,y()):o<0},x.reflectY=function(_){return arguments.length?(r=_?-1:1,y()):r<0},x.fitExtent=function(_,$){return _g(x,_,$)},x.fitSize=function(_,$){return Bw(x,_,$)},x.fitWidth=function(_,$){return jw(x,_,$)},x.fitHeight=function(_,$){return Uw(x,_,$)},x}function eI(e,t){var n=t*t,o=n*n;return[e*(.8707-.131979*n+o*(-.013791+o*(.003971*n-.001529*o))),t*(1.007226+n*(.015085+o*(-.044475+.028874*n-.005916*o)))]}eI.invert=function(e,t){var n=t,o=25,r;do{var i=n*n,a=i*i;n-=r=(n*(1.007226+i*(.015085+a*(-.044475+.028874*i-.005916*a)))-t)/(1.007226+i*(.015085*3+a*(-.044475*7+.028874*9*i-.005916*11*a)))}while(en(r)>D2&&--o>0);return[e/(.8707+(i=n*n)*(-.131979+i*(-.013791+i*i*i*(.003971-.001529*i)))),n]};function tI(){return Pg(eI).scale(175.295)}var Ta=H2(ho(),1);function ju(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}var WZ=Symbol("implicit");function Hw(){var e=new Tu,t=[],n=[],o=WZ;function r(i){let a=e.get(i);if(a===void 0){if(o!==WZ)return o;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return r.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new Tu;for(let a of i)e.has(a)||e.set(a,t.push(a)-1);return r},r.range=function(i){return arguments.length?(n=Array.from(i),r):n.slice()},r.unknown=function(i){return arguments.length?(o=i,r):o},r.copy=function(){return Hw(t,n).unknown(o)},ju.apply(r,arguments),r}function o5(){var e=Hw().unknown(void 0),t=e.domain,n=e.range,o=0,r=1,i,a,s=!1,l=0,c=0,u=.5;delete e.unknown;function d(){var p=t().length,m=r<o,h=m?r:o,S=m?o:r;i=(S-h)/Math.max(1,p-l+c*2),s&&(i=Math.floor(i)),h+=(S-h-i*(p-l))*u,a=i*(1-l),s&&(h=Math.round(h),a=Math.round(a));var v=_w(p).map(function(g){return h+i*g});return n(m?v.reverse():v)}return e.domain=function(p){return arguments.length?(t(p),d()):t()},e.range=function(p){return arguments.length?([o,r]=p,o=+o,r=+r,d()):[o,r]},e.rangeRound=function(p){return[o,r]=p,o=+o,r=+r,s=!0,d()},e.bandwidth=function(){return a},e.step=function(){return i},e.round=function(p){return arguments.length?(s=!!p,d()):s},e.padding=function(p){return arguments.length?(l=Math.min(1,c=+p),d()):l},e.paddingInner=function(p){return arguments.length?(l=Math.min(1,p),d()):l},e.paddingOuter=function(p){return arguments.length?(c=+p,d()):c},e.align=function(p){return arguments.length?(u=Math.max(0,Math.min(1,p)),d()):u},e.copy=function(){return o5(t(),[o,r]).round(s).paddingInner(l).paddingOuter(c).align(u)},ju.apply(d(),arguments)}function GZ(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return GZ(t())},e}function Vw(){return GZ(o5.apply(null,arguments).paddingInner(1))}function qw(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function nI(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Rg(){}var Cg=.7,Zw=1/Cg,Uu="\\s*([+-]?\\d+)\\s*",kg="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ms="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",M5e=/^#([0-9a-f]{3,8})$/,E5e=new RegExp(`^rgb\\(${Uu},${Uu},${Uu}\\)$`),T5e=new RegExp(`^rgb\\(${ms},${ms},${ms}\\)$`),A5e=new RegExp(`^rgba\\(${Uu},${Uu},${Uu},${kg}\\)$`),I5e=new RegExp(`^rgba\\(${ms},${ms},${ms},${kg}\\)$`),N5e=new RegExp(`^hsl\\(${kg},${ms},${ms}\\)$`),O5e=new RegExp(`^hsla\\(${kg},${ms},${ms},${kg}\\)$`),ZZ={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};qw(Rg,_7,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:XZ,formatHex:XZ,formatHex8:L5e,formatHsl:D5e,formatRgb:YZ,toString:YZ});function XZ(){return this.rgb().formatHex()}function L5e(){return this.rgb().formatHex8()}function D5e(){return nX(this).formatHsl()}function YZ(){return this.rgb().formatRgb()}function _7(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=M5e.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?KZ(t):n===3?new Xi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ww(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ww(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=E5e.exec(e))?new Xi(t[1],t[2],t[3],1):(t=T5e.exec(e))?new Xi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=A5e.exec(e))?Ww(t[1],t[2],t[3],t[4]):(t=I5e.exec(e))?Ww(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=N5e.exec(e))?eX(t[1],t[2]/100,t[3]/100,1):(t=O5e.exec(e))?eX(t[1],t[2]/100,t[3]/100,t[4]):ZZ.hasOwnProperty(e)?KZ(ZZ[e]):e==="transparent"?new Xi(NaN,NaN,NaN,0):null}function KZ(e){return new Xi(e>>16&255,e>>8&255,e&255,1)}function Ww(e,t,n,o){return o<=0&&(e=t=n=NaN),new Xi(e,t,n,o)}function B5e(e){return e instanceof Rg||(e=_7(e)),e?(e=e.rgb(),new Xi(e.r,e.g,e.b,e.opacity)):new Xi}function Fu(e,t,n,o){return arguments.length===1?B5e(e):new Xi(e,t,n,o??1)}function Xi(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}qw(Xi,Fu,nI(Rg,{brighter(e){return e=e==null?Zw:Math.pow(Zw,e),new Xi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Cg:Math.pow(Cg,e),new Xi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Xi(A8(this.r),A8(this.g),A8(this.b),Xw(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:JZ,formatHex:JZ,formatHex8:j5e,formatRgb:QZ,toString:QZ}));function JZ(){return`#${T8(this.r)}${T8(this.g)}${T8(this.b)}`}function j5e(){return`#${T8(this.r)}${T8(this.g)}${T8(this.b)}${T8((isNaN(this.opacity)?1:this.opacity)*255)}`}function QZ(){let e=Xw(this.opacity);return`${e===1?"rgb(":"rgba("}${A8(this.r)}, ${A8(this.g)}, ${A8(this.b)}${e===1?")":`, ${e})`}`}function Xw(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function A8(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function T8(e){return e=A8(e),(e<16?"0":"")+e.toString(16)}function eX(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new i5(e,t,n,o)}function nX(e){if(e instanceof i5)return new i5(e.h,e.s,e.l,e.opacity);if(e instanceof Rg||(e=_7(e)),!e)return new i5;if(e instanceof i5)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),a=NaN,s=i-r,l=(i+r)/2;return s?(t===i?a=(n-o)/s+(n<o)*6:n===i?a=(o-t)/s+2:a=(t-n)/s+4,s/=l<.5?i+r:2-i-r,a*=60):s=l>0&&l<1?0:a,new i5(a,s,l,e.opacity)}function rX(e,t,n,o){return arguments.length===1?nX(e):new i5(e,t,n,o??1)}function i5(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}qw(i5,rX,nI(Rg,{brighter(e){return e=e==null?Zw:Math.pow(Zw,e),new i5(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Cg:Math.pow(Cg,e),new i5(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new Xi(rI(e>=240?e-240:e+120,r,o),rI(e,r,o),rI(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new i5(tX(this.h),Gw(this.s),Gw(this.l),Xw(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Xw(this.opacity);return`${e===1?"hsl(":"hsla("}${tX(this.h)}, ${Gw(this.s)*100}%, ${Gw(this.l)*100}%${e===1?")":`, ${e})`}`}}));function tX(e){return e=(e||0)%360,e<0?e+360:e}function Gw(e){return Math.max(0,Math.min(1,e||0))}function rI(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function oI(e,t,n,o,r){var i=e*e,a=i*e;return((1-3*e+3*i-a)*t+(4-6*i+3*a)*n+(1+3*e+3*i-3*a)*o+a*r)/6}function oX(e){var t=e.length-1;return function(n){var o=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),r=e[o],i=e[o+1],a=o>0?e[o-1]:2*r-i,s=o<t-1?e[o+2]:2*i-r;return oI((n-o/t)*t,a,r,i,s)}}function iX(e){var t=e.length;return function(n){var o=Math.floor(((n%=1)<0?++n:n)*t),r=e[(o+t-1)%t],i=e[o%t],a=e[(o+1)%t],s=e[(o+2)%t];return oI((n-o/t)*t,r,i,a,s)}}var $g=e=>()=>e;function U5e(e,t){return function(n){return e+n*t}}function F5e(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function aX(e){return(e=+e)==1?Yw:function(t,n){return n-t?F5e(t,n,e):$g(isNaN(t)?n:t)}}function Yw(e,t){var n=t-e;return n?U5e(e,n):$g(isNaN(e)?t:e)}var iI=(function e(t){var n=aX(t);function o(r,i){var a=n((r=Fu(r)).r,(i=Fu(i)).r),s=n(r.g,i.g),l=n(r.b,i.b),c=Yw(r.opacity,i.opacity);return function(u){return r.r=a(u),r.g=s(u),r.b=l(u),r.opacity=c(u),r+""}}return o.gamma=e,o})(1);function sX(e){return function(t){var n=t.length,o=new Array(n),r=new Array(n),i=new Array(n),a,s;for(a=0;a<n;++a)s=Fu(t[a]),o[a]=s.r||0,r[a]=s.g||0,i[a]=s.b||0;return o=e(o),r=e(r),i=e(i),s.opacity=1,function(l){return s.r=o(l),s.g=r(l),s.b=i(l),s+""}}}var Lxe=sX(oX),Dxe=sX(iX);function lX(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(i){for(r=0;r<n;++r)o[r]=e[r]*(1-i)+t[r]*i;return o}}function cX(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function uX(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,r=new Array(o),i=new Array(n),a;for(a=0;a<o;++a)r[a]=I8(e[a],t[a]);for(;a<n;++a)i[a]=t[a];return function(s){for(a=0;a<o;++a)i[a]=r[a](s);return i}}function dX(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function P7(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function pX(e,t){var n={},o={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=I8(e[r],t[r]):o[r]=t[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var sI=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,aI=new RegExp(sI.source,"g");function H5e(e){return function(){return e}}function V5e(e){return function(t){return e(t)+""}}function fX(e,t){var n=sI.lastIndex=aI.lastIndex=0,o,r,i,a=-1,s=[],l=[];for(e=e+"",t=t+"";(o=sI.exec(e))&&(r=aI.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),s[a]?s[a]+=i:s[++a]=i),(o=o[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:P7(o,r)})),n=aI.lastIndex;return n<t.length&&(i=t.slice(n),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?V5e(l[0].x):H5e(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)s[(d=l[u]).i]=d.x(c);return s.join("")})}function I8(e,t){var n=typeof t,o;return t==null||n==="boolean"?$g(t):(n==="number"?P7:n==="string"?(o=_7(t))?(t=o,iI):fX:t instanceof _7?iI:t instanceof Date?dX:cX(t)?lX:Array.isArray(t)?uX:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?pX:P7)(e,t)}function lI(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function cI(e){return function(){return e}}function uI(e){return+e}var mX=[0,1];function Hu(e){return e}function dI(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:cI(isNaN(t)?NaN:.5)}function q5e(e,t){var n;return e>t&&(n=e,e=t,t=n),function(o){return Math.max(e,Math.min(t,o))}}function W5e(e,t,n){var o=e[0],r=e[1],i=t[0],a=t[1];return r<o?(o=dI(r,o),i=n(a,i)):(o=dI(o,r),i=n(i,a)),function(s){return i(o(s))}}function G5e(e,t,n){var o=Math.min(e.length,t.length)-1,r=new Array(o),i=new Array(o),a=-1;for(e[o]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<o;)r[a]=dI(e[a],e[a+1]),i[a]=n(t[a],t[a+1]);return function(s){var l=RA(e,s,1,o)-1;return i[l](r[l](s))}}function hX(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Z5e(){var e=mX,t=mX,n=I8,o,r,i,a=Hu,s,l,c;function u(){var p=Math.min(e.length,t.length);return a!==Hu&&(a=q5e(e[0],e[p-1])),s=p>2?G5e:W5e,l=c=null,d}function d(p){return p==null||isNaN(p=+p)?i:(l||(l=s(e.map(o),t,n)))(o(a(p)))}return d.invert=function(p){return a(r((c||(c=s(t,e.map(o),P7)))(p)))},d.domain=function(p){return arguments.length?(e=Array.from(p,uI),u()):e.slice()},d.range=function(p){return arguments.length?(t=Array.from(p),u()):t.slice()},d.rangeRound=function(p){return t=Array.from(p),n=lI,u()},d.clamp=function(p){return arguments.length?(a=p?!0:Hu,u()):a!==Hu},d.interpolate=function(p){return arguments.length?(n=p,u()):n},d.unknown=function(p){return arguments.length?(i=p,d):i},function(p,m){return o=p,r=m,u()}}function pI(){return Z5e()(Hu,Hu)}function gX(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function N8(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),o=e.slice(0,n);return[o.length>1?o[0]+o.slice(2):o,+e.slice(n+1)]}function hs(e){return e=N8(Math.abs(e)),e?e[1]:NaN}function yX(e,t){return function(n,o){for(var r=n.length,i=[],a=0,s=e[0],l=0;r>0&&s>0&&(l+s+1>o&&(s=Math.max(1,o-l)),i.push(n.substring(r-=s,r+s)),!((l+=s+1)>o));)s=e[a=(a+1)%e.length];return i.reverse().join(t)}}function vX(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var X5e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function C7(e){if(!(t=X5e.exec(e)))throw new Error("invalid format: "+e);var t;return new Kw({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}C7.prototype=Kw.prototype;function Kw(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Kw.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function bX(e){e:for(var t=e.length,n=1,o=-1,r;n<t;++n)switch(e[n]){case".":o=r=n;break;case"0":o===0&&(o=n),r=n;break;default:if(!+e[n])break e;o>0&&(o=0);break}return o>0?e.slice(0,o)+e.slice(r+1):e}var zg;function SX(e,t){var n=N8(e,t);if(!n)return zg=void 0,e.toPrecision(t);var o=n[0],r=n[1],i=r-(zg=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,a=o.length;return i===a?o:i>a?o+new Array(i-a+1).join("0"):i>0?o.slice(0,i)+"."+o.slice(i):"0."+new Array(1-i).join("0")+N8(e,Math.max(0,t+i-1))[0]}function fI(e,t){var n=N8(e,t);if(!n)return e+"";var o=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+o:o.length>r+1?o.slice(0,r+1)+"."+o.slice(r+1):o+new Array(r-o.length+2).join("0")}var mI={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:gX,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>fI(e*100,t),r:fI,s:SX,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function hI(e){return e}var xX=Array.prototype.map,wX=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function _X(e){var t=e.grouping===void 0||e.thousands===void 0?hI:yX(xX.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",o=e.currency===void 0?"":e.currency[1]+"",r=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?hI:vX(xX.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"\u2212":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(d,p){d=C7(d);var m=d.fill,h=d.align,S=d.sign,v=d.symbol,g=d.zero,y=d.width,x=d.comma,_=d.precision,$=d.trim,k=d.type;k==="n"?(x=!0,k="g"):mI[k]||(_===void 0&&(_=12),$=!0,k="g"),(g||m==="0"&&h==="=")&&(g=!0,m="0",h="=");var L=(p&&p.prefix!==void 0?p.prefix:"")+(v==="$"?n:v==="#"&&/[boxX]/.test(k)?"0"+k.toLowerCase():""),I=(v==="$"?o:/[%p]/.test(k)?a:"")+(p&&p.suffix!==void 0?p.suffix:""),N=mI[k],U=/[defgprs%]/.test(k);_=_===void 0?6:/[gprs]/.test(k)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function z(Z){var ie=L,ue=I,X,W,Me;if(k==="c")ue=N(Z)+ue,Z="";else{Z=+Z;var Fe=Z<0||1/Z<0;if(Z=isNaN(Z)?l:N(Math.abs(Z),_),$&&(Z=bX(Z)),Fe&&+Z==0&&S!=="+"&&(Fe=!1),ie=(Fe?S==="("?S:s:S==="-"||S==="("?"":S)+ie,ue=(k==="s"&&!isNaN(Z)&&zg!==void 0?wX[8+zg/3]:"")+ue+(Fe&&S==="("?")":""),U){for(X=-1,W=Z.length;++X<W;)if(Me=Z.charCodeAt(X),48>Me||Me>57){ue=(Me===46?r+Z.slice(X+1):Z.slice(X))+ue,Z=Z.slice(0,X);break}}}x&&!g&&(Z=t(Z,1/0));var Se=ie.length+Z.length+ue.length,$e=Se<y?new Array(y-Se+1).join(m):"";switch(x&&g&&(Z=t($e+Z,$e.length?y-ue.length:1/0),$e=""),h){case"<":Z=ie+Z+ue+$e;break;case"=":Z=ie+$e+Z+ue;break;case"^":Z=$e.slice(0,Se=$e.length>>1)+ie+Z+ue+$e.slice(Se);break;default:Z=$e+ie+Z+ue;break}return i(Z)}return z.toString=function(){return d+""},z}function u(d,p){var m=Math.max(-8,Math.min(8,Math.floor(hs(p)/3)))*3,h=Math.pow(10,-m),S=c((d=C7(d),d.type="f",d),{suffix:wX[8+m/3]});return function(v){return S(h*v)}}return{format:c,formatPrefix:u}}var Jw,Qw,e_;gI({thousands:",",grouping:[3],currency:["$",""]});function gI(e){return Jw=_X(e),Qw=Jw.format,e_=Jw.formatPrefix,Jw}function yI(e){return Math.max(0,-hs(Math.abs(e)))}function vI(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(hs(t)/3)))*3-hs(Math.abs(e)))}function bI(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,hs(t)-hs(e))+1}function SI(e,t,n,o){var r=$A(e,t,n),i;switch(o=C7(o??",f"),o.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return o.precision==null&&!isNaN(i=vI(r,a))&&(o.precision=i),e_(o,a)}case"":case"e":case"g":case"p":case"r":{o.precision==null&&!isNaN(i=bI(r,Math.max(Math.abs(e),Math.abs(t))))&&(o.precision=i-(o.type==="e"));break}case"f":case"%":{o.precision==null&&!isNaN(i=yI(r))&&(o.precision=i-(o.type==="%")*2);break}}return Qw(o)}function Y5e(e){var t=e.domain;return e.ticks=function(n){var o=t();return ww(o[0],o[o.length-1],n??10)},e.tickFormat=function(n,o){var r=t();return SI(r[0],r[r.length-1],n??10,o)},e.nice=function(n){n==null&&(n=10);var o=t(),r=0,i=o.length-1,a=o[r],s=o[i],l,c,u=10;for(s<a&&(c=a,a=s,s=c,c=r,r=i,i=c);u-- >0;){if(c=ug(a,s,n),c===l)return o[r]=a,o[i]=s,t(o);if(c>0)a=Math.floor(a/c)*c,s=Math.ceil(s/c)*c;else if(c<0)a=Math.ceil(a*c)/c,s=Math.floor(s*c)/c;else break;l=c}return e},e}function D3(){var e=pI();return e.copy=function(){return hX(e,D3())},ju.apply(e,arguments),Y5e(e)}function S2(e){return function(){return e}}var xI=Math.abs,h3=Math.atan2,a5=Math.cos,PX=Math.max,t_=Math.min,B3=Math.sin,qr=Math.sqrt,Go=1e-12,s5=Math.PI,Mg=s5/2,g4=2*s5;function CX(e){return e>1?0:e<-1?s5:Math.acos(e)}function wI(e){return e>=1?Mg:e<=-1?-Mg:Math.asin(e)}var _I=Math.PI,PI=2*_I,O8=1e-6,K5e=PI-O8;function kX(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function J5e(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return kX;let n=10**t;return function(o){this._+=o[0];for(let r=1,i=o.length;r<i;++r)this._+=Math.round(arguments[r]*n)/n+o[r]}}var L8=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?kX:J5e(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,o,r){this._append`Q${+t},${+n},${this._x1=+o},${this._y1=+r}`}bezierCurveTo(t,n,o,r,i,a){this._append`C${+t},${+n},${+o},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(t,n,o,r,i){if(t=+t,n=+n,o=+o,r=+r,i=+i,i<0)throw new Error(`negative radius: ${i}`);let a=this._x1,s=this._y1,l=o-t,c=r-n,u=a-t,d=s-n,p=u*u+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(p>O8)if(!(Math.abs(d*l-c*u)>O8)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let m=o-a,h=r-s,S=l*l+c*c,v=m*m+h*h,g=Math.sqrt(S),y=Math.sqrt(p),x=i*Math.tan((_I-Math.acos((S+p-v)/(2*g*y)))/2),_=x/y,$=x/g;Math.abs(_-1)>O8&&this._append`L${t+_*u},${n+_*d}`,this._append`A${i},${i},0,0,${+(d*m>u*h)},${this._x1=t+$*l},${this._y1=n+$*c}`}}arc(t,n,o,r,i,a){if(t=+t,n=+n,o=+o,a=!!a,o<0)throw new Error(`negative radius: ${o}`);let s=o*Math.cos(r),l=o*Math.sin(r),c=t+s,u=n+l,d=1^a,p=a?r-i:i-r;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>O8||Math.abs(this._y1-u)>O8)&&this._append`L${c},${u}`,o&&(p<0&&(p=p%PI+PI),p>K5e?this._append`A${o},${o},0,1,${d},${t-s},${n-l}A${o},${o},0,1,${d},${this._x1=c},${this._y1=u}`:p>O8&&this._append`A${o},${o},0,${+(p>=_I)},${d},${this._x1=t+o*Math.cos(i)},${this._y1=n+o*Math.sin(i)}`)}rect(t,n,o,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${o=+o}v${+r}h${-o}Z`}toString(){return this._}};function RX(){return new L8}RX.prototype=L8.prototype;function k7(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let o=Math.floor(n);if(!(o>=0))throw new RangeError(`invalid digits: ${n}`);t=o}return e},()=>new L8(t)}function Q5e(e){return e.innerRadius}function ese(e){return e.outerRadius}function tse(e){return e.startAngle}function nse(e){return e.endAngle}function rse(e){return e&&e.padAngle}function ose(e,t,n,o,r,i,a,s){var l=n-e,c=o-t,u=a-r,d=s-i,p=d*l-u*c;if(!(p*p<Go))return p=(u*(t-i)-d*(e-r))/p,[e+p*l,t+p*c]}function n_(e,t,n,o,r,i,a){var s=e-n,l=t-o,c=(a?i:-i)/qr(s*s+l*l),u=c*l,d=-c*s,p=e+u,m=t+d,h=n+u,S=o+d,v=(p+h)/2,g=(m+S)/2,y=h-p,x=S-m,_=y*y+x*x,$=r-i,k=p*S-h*m,L=(x<0?-1:1)*qr(PX(0,$*$*_-k*k)),I=(k*x-y*L)/_,N=(-k*y-x*L)/_,U=(k*x+y*L)/_,z=(-k*y+x*L)/_,Z=I-v,ie=N-g,ue=U-v,X=z-g;return Z*Z+ie*ie>ue*ue+X*X&&(I=U,N=z),{cx:I,cy:N,x01:-u,y01:-d,x11:I*(r/$-1),y11:N*(r/$-1)}}function Vu(){var e=Q5e,t=ese,n=S2(0),o=null,r=tse,i=nse,a=rse,s=null,l=k7(c);function c(){var u,d,p=+e.apply(this,arguments),m=+t.apply(this,arguments),h=r.apply(this,arguments)-Mg,S=i.apply(this,arguments)-Mg,v=xI(S-h),g=S>h;if(s||(s=u=l()),m<p&&(d=m,m=p,p=d),!(m>Go))s.moveTo(0,0);else if(v>g4-Go)s.moveTo(m*a5(h),m*B3(h)),s.arc(0,0,m,h,S,!g),p>Go&&(s.moveTo(p*a5(S),p*B3(S)),s.arc(0,0,p,S,h,g));else{var y=h,x=S,_=h,$=S,k=v,L=v,I=a.apply(this,arguments)/2,N=I>Go&&(o?+o.apply(this,arguments):qr(p*p+m*m)),U=t_(xI(m-p)/2,+n.apply(this,arguments)),z=U,Z=U,ie,ue;if(N>Go){var X=wI(N/p*B3(I)),W=wI(N/m*B3(I));(k-=X*2)>Go?(X*=g?1:-1,_+=X,$-=X):(k=0,_=$=(h+S)/2),(L-=W*2)>Go?(W*=g?1:-1,y+=W,x-=W):(L=0,y=x=(h+S)/2)}var Me=m*a5(y),Fe=m*B3(y),Se=p*a5($),$e=p*B3($);if(U>Go){var He=m*a5(x),r1=m*B3(x),b1=p*a5(_),p1=p*B3(_),re;if(v<s5)if(re=ose(Me,Fe,b1,p1,He,r1,Se,$e)){var fe=Me-re[0],Ve=Fe-re[1],l1=He-re[0],v1=r1-re[1],D1=1/B3(CX((fe*l1+Ve*v1)/(qr(fe*fe+Ve*Ve)*qr(l1*l1+v1*v1)))/2),Oe=qr(re[0]*re[0]+re[1]*re[1]);z=t_(U,(p-Oe)/(D1-1)),Z=t_(U,(m-Oe)/(D1+1))}else z=Z=0}L>Go?Z>Go?(ie=n_(b1,p1,Me,Fe,m,Z,g),ue=n_(He,r1,Se,$e,m,Z,g),s.moveTo(ie.cx+ie.x01,ie.cy+ie.y01),Z<U?s.arc(ie.cx,ie.cy,Z,h3(ie.y01,ie.x01),h3(ue.y01,ue.x01),!g):(s.arc(ie.cx,ie.cy,Z,h3(ie.y01,ie.x01),h3(ie.y11,ie.x11),!g),s.arc(0,0,m,h3(ie.cy+ie.y11,ie.cx+ie.x11),h3(ue.cy+ue.y11,ue.cx+ue.x11),!g),s.arc(ue.cx,ue.cy,Z,h3(ue.y11,ue.x11),h3(ue.y01,ue.x01),!g))):(s.moveTo(Me,Fe),s.arc(0,0,m,y,x,!g)):s.moveTo(Me,Fe),!(p>Go)||!(k>Go)?s.lineTo(Se,$e):z>Go?(ie=n_(Se,$e,He,r1,p,-z,g),ue=n_(Me,Fe,b1,p1,p,-z,g),s.lineTo(ie.cx+ie.x01,ie.cy+ie.y01),z<U?s.arc(ie.cx,ie.cy,z,h3(ie.y01,ie.x01),h3(ue.y01,ue.x01),!g):(s.arc(ie.cx,ie.cy,z,h3(ie.y01,ie.x01),h3(ie.y11,ie.x11),!g),s.arc(0,0,p,h3(ie.cy+ie.y11,ie.cx+ie.x11),h3(ue.cy+ue.y11,ue.cx+ue.x11),g),s.arc(ue.cx,ue.cy,z,h3(ue.y11,ue.x11),h3(ue.y01,ue.x01),!g))):s.arc(0,0,p,$,_,g)}if(s.closePath(),u)return s=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+r.apply(this,arguments)+ +i.apply(this,arguments))/2-s5/2;return[a5(d)*u,B3(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:S2(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:S2(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:S2(+u),c):n},c.padRadius=function(u){return arguments.length?(o=u==null?null:typeof u=="function"?u:S2(+u),c):o},c.startAngle=function(u){return arguments.length?(r=typeof u=="function"?u:S2(+u),c):r},c.endAngle=function(u){return arguments.length?(i=typeof u=="function"?u:S2(+u),c):i},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:S2(+u),c):a},c.context=function(u){return arguments.length?(s=u??null,c):s},c}var C_e=Array.prototype.slice;function qu(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function $X(e){this._context=e}$X.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function l5(e){return new $X(e)}function r_(e){return e[0]}function o_(e){return e[1]}function gs(e,t){var n=S2(!0),o=null,r=l5,i=null,a=k7(s);e=typeof e=="function"?e:e===void 0?r_:S2(e),t=typeof t=="function"?t:t===void 0?o_:S2(t);function s(l){var c,u=(l=qu(l)).length,d,p=!1,m;for(o==null&&(i=r(m=a())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===p&&((p=!p)?i.lineStart():i.lineEnd()),p&&i.point(+e(d,c,l),+t(d,c,l));if(m)return i=null,m+""||null}return s.x=function(l){return arguments.length?(e=typeof l=="function"?l:S2(+l),s):e},s.y=function(l){return arguments.length?(t=typeof l=="function"?l:S2(+l),s):t},s.defined=function(l){return arguments.length?(n=typeof l=="function"?l:S2(!!l),s):n},s.curve=function(l){return arguments.length?(r=l,o!=null&&(i=r(o)),s):r},s.context=function(l){return arguments.length?(l==null?o=i=null:i=r(o=l),s):o},s}function CI(e,t,n){var o=null,r=S2(!0),i=null,a=l5,s=null,l=k7(c);e=typeof e=="function"?e:e===void 0?r_:S2(+e),t=typeof t=="function"?t:t===void 0?S2(0):S2(+t),n=typeof n=="function"?n:n===void 0?o_:S2(+n);function c(d){var p,m,h,S=(d=qu(d)).length,v,g=!1,y,x=new Array(S),_=new Array(S);for(i==null&&(s=a(y=l())),p=0;p<=S;++p){if(!(p<S&&r(v=d[p],p,d))===g)if(g=!g)m=p,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=p-1;h>=m;--h)s.point(x[h],_[h]);s.lineEnd(),s.areaEnd()}g&&(x[p]=+e(v,p,d),_[p]=+t(v,p,d),s.point(o?+o(v,p,d):x[p],n?+n(v,p,d):_[p]))}if(y)return s=null,y+""||null}function u(){return gs().defined(r).curve(a).context(i)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:S2(+d),o=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:S2(+d),c):e},c.x1=function(d){return arguments.length?(o=d==null?null:typeof d=="function"?d:S2(+d),c):o},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:S2(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:S2(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:S2(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(o).y(t)},c.defined=function(d){return arguments.length?(r=typeof d=="function"?d:S2(!!d),c):r},c.curve=function(d){return arguments.length?(a=d,i!=null&&(s=a(i)),c):a},c.context=function(d){return arguments.length?(d==null?i=s=null:s=a(i=d),c):i},c}function zX(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function MX(e){return e}function Eg(){var e=MX,t=zX,n=null,o=S2(0),r=S2(g4),i=S2(0);function a(s){var l,c=(s=qu(s)).length,u,d,p=0,m=new Array(c),h=new Array(c),S=+o.apply(this,arguments),v=Math.min(g4,Math.max(-g4,r.apply(this,arguments)-S)),g,y=Math.min(Math.abs(v)/c,i.apply(this,arguments)),x=y*(v<0?-1:1),_;for(l=0;l<c;++l)(_=h[m[l]=l]=+e(s[l],l,s))>0&&(p+=_);for(t!=null?m.sort(function($,k){return t(h[$],h[k])}):n!=null&&m.sort(function($,k){return n(s[$],s[k])}),l=0,d=p?(v-c*x)/p:0;l<c;++l,S=g)u=m[l],_=h[u],g=S+(_>0?_*d:0)+x,h[u]={data:s[u],index:l,value:_,startAngle:S,endAngle:g,padAngle:y};return h}return a.value=function(s){return arguments.length?(e=typeof s=="function"?s:S2(+s),a):e},a.sortValues=function(s){return arguments.length?(t=s,n=null,a):t},a.sort=function(s){return arguments.length?(n=s,t=null,a):n},a.startAngle=function(s){return arguments.length?(o=typeof s=="function"?s:S2(+s),a):o},a.endAngle=function(s){return arguments.length?(r=typeof s=="function"?s:S2(+s),a):r},a.padAngle=function(s){return arguments.length?(i=typeof s=="function"?s:S2(+s),a):i},a}var Tg={draw(e,t){let n=qr(t/s5);e.moveTo(n,0),e.arc(0,0,n,0,g4)}};var kI={draw(e,t){let n=qr(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}};var EX=qr(1/3),ise=EX*2,RI={draw(e,t){let n=qr(t/ise),o=n*EX;e.moveTo(0,-n),e.lineTo(o,0),e.lineTo(0,n),e.lineTo(-o,0),e.closePath()}};var $I={draw(e,t){let n=qr(t),o=-n/2;e.rect(o,o,n,n)}};var ase=.8908130915292852,TX=B3(s5/10)/B3(7*s5/10),sse=B3(g4/10)*TX,lse=-a5(g4/10)*TX,zI={draw(e,t){let n=qr(t*ase),o=sse*n,r=lse*n;e.moveTo(0,-n),e.lineTo(o,r);for(let i=1;i<5;++i){let a=g4*i/5,s=a5(a),l=B3(a);e.lineTo(l*n,-s*n),e.lineTo(s*o-l*r,l*o+s*r)}e.closePath()}};var MI=qr(3),EI={draw(e,t){let n=-qr(t/(MI*3));e.moveTo(0,n*2),e.lineTo(-MI*n,-n),e.lineTo(MI*n,-n),e.closePath()}};function i_(e,t){let n=null,o=k7(r);e=typeof e=="function"?e:S2(e||Tg),t=typeof t=="function"?t:S2(t===void 0?64:+t);function r(){let i;if(n||(n=i=o()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return r.type=function(i){return arguments.length?(e=typeof i=="function"?i:S2(i),r):e},r.size=function(i){return arguments.length?(t=typeof i=="function"?i:S2(+i),r):t},r.context=function(i){return arguments.length?(n=i??null,r):n},r}function TI(){}function AX(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function a_(e,t){this._context=e,this._k=(1-t)/6}a_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:AX(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:AX(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var fPe=(function e(t){function n(o){return new a_(o,t)}return n.tension=function(o){return e(+o)},n})(0);function cse(e,t,n){var o=e._x1,r=e._y1,i=e._x2,a=e._y2;if(e._l01_a>Go){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);o=(o*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,r=(r*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Go){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);i=(i*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(o,r,i,a,e._x2,e._y2)}function IX(e,t){this._context=e,this._alpha=t}IX.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,o=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+o*o,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:cse(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var s_=(function e(t){function n(o){return t?new IX(o,t):new a_(o,0)}return n.alpha=function(o){return e(+o)},n})(.5);function NX(e){this._context=e}NX.prototype={areaStart:TI,areaEnd:TI,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function l_(e){return new NX(e)}function AI(e){return e}function c_(e){if(e==null)return AI;var t,n,o=e.scale[0],r=e.scale[1],i=e.translate[0],a=e.translate[1];return function(s,l){l||(t=n=0);var c=2,u=s.length,d=new Array(u);for(d[0]=(t+=s[0])*o+i,d[1]=(n+=s[1])*r+a;c<u;)d[c]=s[c],++c;return d}}function OX(e,t){for(var n,o=e.length,r=o-t;r<--o;)n=e[r],e[r++]=e[o],e[o]=n}function u_(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return LX(e,n)})}:LX(e,t)}function LX(e,t){var n=t.id,o=t.bbox,r=t.properties==null?{}:t.properties,i=II(e,t);return n==null&&o==null?{type:"Feature",properties:r,geometry:i}:o==null?{type:"Feature",id:n,properties:r,geometry:i}:{type:"Feature",id:n,bbox:o,properties:r,geometry:i}}function II(e,t){var n=c_(e.transform),o=e.arcs;function r(u,d){d.length&&d.pop();for(var p=o[u<0?~u:u],m=0,h=p.length;m<h;++m)d.push(n(p[m],m));u<0&&OX(d,h)}function i(u){return n(u)}function a(u){for(var d=[],p=0,m=u.length;p<m;++p)r(u[p],d);return d.length<2&&d.push(d[0]),d}function s(u){for(var d=a(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(s)}function c(u){var d=u.type,p;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":p=i(u.coordinates);break;case"MultiPoint":p=u.coordinates.map(i);break;case"LineString":p=a(u.arcs);break;case"MultiLineString":p=u.arcs.map(a);break;case"Polygon":p=l(u.arcs);break;case"MultiPolygon":p=u.arcs.map(l);break;default:return null}return{type:d,coordinates:p}}return c(t)}var DJ=H2(DX(),1),G0=H2(ho(),1),iy=H2(Fo(),1),K=H2(Fo(),1),y5=H2(ho(),1),ge=H2(Fo(),1),q8="http://schemas.openxmlformats.org/drawingml/2006/chart",Lg="http://schemas.openxmlformats.org/drawingml/2006/main",_se="http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",ZX="http://schemas.microsoft.com/office/2014/relationships/chartEx",Pse="http://schemas.microsoft.com/office/2011/relationships/chartStyle",Cse="http://schemas.microsoft.com/office/2011/relationships/chartColorStyle",kse=["#4472c4","#ed7d31","#a5a5a5","#ffc000","#5b9bd5","#70ad47","#264478","#9e480e","#636363","#997300"];function Rse(e){return`"${e.replace(/"/g,'""')}"`}function $se(e){let t=e.trim();return t.length<2||!t.startsWith('"')||!t.endsWith('"')?null:t.slice(1,-1).replace(/""/g,'"')}function zse(e){let t=[],n="",o=!1,r=!1,i=0;for(let a=0;a<e.length;a+=1){let s=e[a]??"",l=e[a+1]??"";if(o){n+=s,s==='"'&&l==='"'?(n+=l,a+=1):s==='"'&&(o=!1);continue}if(r){n+=s,s==="'"&&l==="'"?(n+=l,a+=1):s==="'"&&(r=!1);continue}if(s==='"'){o=!0,n+=s;continue}if(s==="'"){r=!0,n+=s;continue}if(s==="("){i+=1,n+=s;continue}if(s===")"){i=Math.max(0,i-1),n+=s;continue}if(s===","&&i===0){t.push(n.trim()),n="";continue}n+=s}return t.push(n.trim()),t}function Mse(e){let t=e.raw&&typeof e.raw=="object"?e.raw:null;return typeof t?.name=="string"&&t.name.length>0?t.name:null}function Ese(e,t){let n=e?.series[t];if(!e||!n)return"";let r=Mse(n)??Rse(n.name??`Series ${t+1}`),i=n.categoriesRef?.formula??"",a=n.valuesRef?.formula??"",s=String(t+1),l=n.bubbleSizeRef?.formula;return[`=SERIES(${r}`,i,a,s,...e.chartType==="Bubble"||l?[l??""]:[]].join(",")+")"}function Tse(e,t){let n=e.trim(),o=n.startsWith("=")?n.slice(1).trim():n,r=/^SERIES\s*\(([\s\S]*)\)$/i.exec(o);if(!r)return null;let i=zse(r[1]),a=t?.chartType==="Bubble";if(i.length<4||i.length>5||a&&i.length!==5)return null;let[s="",l="",c="",u="",d]=i;if(!l||!c)return null;let p=Number(u);if(!Number.isFinite(p))return null;let m=$se(s);return{bubbleSizeFormula:d&&d.length>0?d:void 0,categoryFormula:l,nameFormula:m==null&&s.length>0?s:void 0,nameLiteral:m??void 0,order:p,valueFormula:c}}function Ase(e,t,n,o){let r=Tse(n,e),i=e.series[t];if(!r||!i)return null;let a={...i.categoriesRef??{},formula:r.categoryFormula},s={...i.valuesRef??{},formula:r.valueFormula},l=e.chartType==="Bubble"||r.bubbleSizeFormula?{...i.bubbleSizeRef??{},formula:r.bubbleSizeFormula}:i.bubbleSizeRef??null,c={...i.raw??{}};r.nameFormula?c.name=r.nameFormula:delete c.name;let u={...i,bubbleSizeRef:l,bubbleSizes:o&&l?.formula?D7(o,e.workbookSheetIndex,l,"value").map(d=>typeof d=="number"&&Number.isFinite(d)?d:null):i.bubbleSizes,categories:o?D7(o,e.workbookSheetIndex,a,"category"):i.categories,categoriesRef:a,name:r.nameLiteral??(r.nameFormula&&o?YN(o,e.workbookSheetIndex,r.nameFormula):r.nameFormula??i.name),raw:c,values:o?D7(o,e.workbookSheetIndex,s,"value").map(d=>typeof d=="number"&&Number.isFinite(d)?d:null):i.values,valuesRef:s};return{...e,series:e.series.map((d,p)=>p===t?u:d)}}function XX(e){return e==="hidden"||e==="veryHidden"?e:"visible"}var ZN=9525,Ise={accent1:4,accent2:5,accent3:6,accent4:7,accent5:8,accent6:9,dk1:1,dk2:3,folHlink:11,hlink:10,lt1:0,lt2:2,tx1:1,tx2:3,bg1:0,bg2:2},UK=["barChart","lineChart","line3DChart","stockChart","radarChart","scatterChart","pieChart","pie3DChart","doughnutChart","areaChart","area3DChart","bar3DChart","ofPieChart","bubbleChart","surfaceChart","surface3DChart"];function Nse(e){return Math.max(0,Math.min(1,e))}function L7(e){return e!=null&&e.nodeType===1}function v5(e){let t=e.replace(/^#/,"");return t.length===8?`#${t.slice(2).toLowerCase()}`:t.length===6?`#${t.toLowerCase()}`:null}function Ose(e,t){if(!e)return;let n=e.match(/<a:srgbClr\b[^>]*\bval="([0-9a-fA-F]{6,8})"/i);if(n?.[1])return v5(n[1])??void 0;let o=e.match(/<a:schemeClr\b[^>]*\bval="([^"]+)"[^>]*>([\s\S]*?)<\/a:schemeClr>/i)??e.match(/<a:schemeClr\b[^>]*\bval="([^"]+)"[^>]*/i);if(!o?.[1])return;let r=WK(o[1],t);if(!r)return;let i=o[2]??"",a=1,s=0;for(let l of i.matchAll(/<a:(lumMod|lumOff|tint|shade)\b[^>]*\bval="(-?\d+(?:\.\d+)?)"/gi)){let c=l[1]?.toLowerCase(),u=Number(l[2]??Number.NaN);!c||!Number.isFinite(u)||(c==="lummod"?a*=u/1e5:c==="lumoff"?s+=u/1e5:c==="tint"?s+=(1-s)*(u/1e5):c==="shade"&&(a*=u/1e5))}return I_(r,a,s)??void 0}function T_(e,t=!1,n){let o=t?e.match(/<a:ln\b[\s\S]*?<\/a:ln>/i)?.[0]??"":e.match(/<a:solidFill\b[\s\S]*?<\/a:solidFill>/i)?.[0]??"";return Ose(o,n)}function Lse(e,t){let n=e.match(/<c:ser\b[\s\S]*?<\/c:ser>/gi)??[];return n.length===0?[]:n.map(o=>{let r=o.match(/<c:spPr\b[\s\S]*?<\/c:spPr>/i)?.[0]??"";return{color:T_(r,!1,t),lineColor:T_(r,!0,t)}})}function FK(e,t){let n=W0(e);if(n){let r=U7(n,"ser").map(i=>{let a=[];for(let s of Wr(i,"dPt")){let l=tn(s,"idx");if(l===void 0)continue;let c=d1(s,"spPr"),u=v4(c,t);a.push({color:g5(c,t)??void 0,explosion:tn(s,"explosion"),index:l,lineColor:u.color??void 0})}return a});if(r.some(i=>i.length>0))return r}let o=e.match(/<c:ser\b[\s\S]*?<\/c:ser>/gi)??[];return o.length===0?[]:o.map(r=>{let i=r.match(/<c:dPt\b[\s\S]*?<\/c:dPt>/gi)??[];if(i.length===0)return[];let a=[];for(let s of i){let l=s.match(/<c:idx\b[^>]*\bval="(-?\d+)"/i),c=l?.[1]?Number(l[1]):Number.NaN;if(!Number.isFinite(c))continue;let u=s.match(/<c:explosion\b[^>]*\bval="(-?\d+(?:\.\d+)?)"/i),d=u?.[1]?Number(u[1]):Number.NaN;a.push({color:T_(s,!1,t),explosion:Number.isFinite(d)?d:void 0,index:c,lineColor:T_(s,!0,t)})}return a})}function Dse(e){let t=Array.from(e.matchAll(/<c:pt\b[^>]*\bidx="(-?\d+)"[^>]*>[\s\S]*?<c:v>([^<]*)<\/c:v>[\s\S]*?<\/c:pt>/gi));if(t.length===0)return[];let n=e.match(/<c:ptCount\b[^>]*\bval="(\d+)"/i),o=n?.[1]?Number(n[1]):Number.NaN,r=t.reduce((s,l)=>{let c=Number(l[1]??Number.NaN);return Number.isFinite(c)?Math.max(s,c):s},-1),i=Math.max(t.length,Number.isFinite(o)?o:0,r+1),a=Array.from({length:i},()=>null);for(let s of t){let l=Number(s[1]??Number.NaN),c=(s[2]??"").trim(),u=Number(c);!Number.isFinite(l)||l<0||!Number.isFinite(u)||(a[l]=u)}return a}function HK(e){let t=e.match(/<c:ser\b[\s\S]*?<\/c:ser>/gi)??[];return t.length===0?[]:t.map(n=>{let o=n.match(/<c:bubbleSize\b[\s\S]*?<\/c:bubbleSize>/i)?.[0]??"";return o?Dse(o):[]})}function Bse(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&apos;/g,"'")}function A_(e){return(e??"").trim().replace(/\s+/g," ").toLowerCase()}function VK(e){let t=e.match(/<c:title\b[\s\S]*?<a:t>([\s\S]*?)<\/a:t>/i);if(!t?.[1])return null;let n=Bse(t[1]).trim();return n.length>0?n:null}function jse(e,t){let n=A_(t),o=Number.NEGATIVE_INFINITY,r=[];for(let[i,a]of Object.entries(e)){if(!/\/charts\/chart\d+\.xml$/i.test(i))continue;let s=T0(a);if(!/<c:bubbleChart\b/i.test(s))continue;let l=HK(s);if(!l.some(p=>p.some(m=>m!=null)))continue;let u=0,d=A_(VK(s));if(n.length>0&&d.length>0&&n===d&&(u+=100),r.length===0&&(u+=1),u>o&&(o=u,r=l,u>=100))break}return r}function Use(e){for(let t of UK)if(new RegExp(`<c:${t}\\b`,"i").test(e))return t;return""}function qK(e){if(!e)return null;for(let t of UK){let n=Wr(e,t)[0];if(n)return n}return null}function Fse(e){switch(e){case"line":case"lineMarker":return"ScatterLines";case"smooth":case"smoothMarker":return"ScatterSmooth";default:return"Scatter"}}function Hse(e,t,n,o){let r=A_(t),i=(n??"").trim(),a=Number.NEGATIVE_INFINITY,s=[];for(let[l,c]of Object.entries(e)){if(!/\/charts\/chart\d+\.xml$/i.test(l))continue;let u=T0(c),d=Use(u);if(!d)continue;let p=FK(u,o);if(!p.some(v=>v.some(g=>typeof g.color=="string"&&g.color.length>0||typeof g.explosion=="number")))continue;let h=0,S=A_(VK(u));if(r.length>0&&S.length>0&&r===S&&(h+=100),i&&d===i&&(h+=20),s.length===0&&(h+=1),h>a&&(a=h,s=p,h>=120))break}return s}function Vse(e){let t=v5(e);if(!t)return null;let n=/^#([0-9a-f]{6})$/.exec(t);return n?[Number.parseInt(n[1].slice(0,2),16),Number.parseInt(n[1].slice(2,4),16),Number.parseInt(n[1].slice(4,6),16)]:null}function qse(e,t,n){let o=e/255,r=t/255,i=n/255,a=Math.max(o,r,i),s=Math.min(o,r,i),l=(a+s)/2;if(a===s)return[0,0,l];let c=a-s,u=l>.5?c/(2-a-s):c/(a+s),d=0;switch(a){case o:d=(r-i)/c+(r<i?6:0);break;case r:d=(i-o)/c+2;break;default:d=(o-r)/c+4;break}return[d/6,u,l]}function jI(e,t,n){let o=n;return o<0&&(o+=1),o>1&&(o-=1),o<1/6?e+(t-e)*6*o:o<1/2?t:o<2/3?e+(t-e)*(2/3-o)*6:e}function Wse(e,t,n){if(t===0){let i=Math.round(n*255);return[i,i,i]}let o=n<.5?n*(1+t):n+t-n*t,r=2*n-o;return[Math.round(jI(r,o,e+1/3)*255),Math.round(jI(r,o,e)*255),Math.round(jI(r,o,e-1/3)*255)]}function Gse(e,t,n){return`#${[e,t,n].map(o=>Math.max(0,Math.min(255,Math.round(o))).toString(16).padStart(2,"0")).join("")}`}function I_(e,t=1,n=0){let o=Vse(e);if(!o)return v5(e);let[r,i,a]=qse(o[0],o[1],o[2]),s=Nse(a*t+n),[l,c,u]=Wse(r,i,s);return Gse(l,c,u)}function WK(e,t){if(!e)return null;let n=Ise[e];return n===void 0?null:t?.colorsByIndex[n]??null}function Zse(e,t){return e?e==="+mn-lt"||e==="+mn-ea"||e==="+mn-cs"?t?.minorLatinFont??null:e==="+mj-lt"||e==="+mj-ea"||e==="+mj-cs"?t?.majorLatinFont??null:e:null}function YX(e,t){if(!e)return null;let n=co(e,"defRPr")??co(e,"rPr");if(!n)return null;let o=d1(n,"latin")?.getAttribute("typeface")??d1(n,"ea")?.getAttribute("typeface")??d1(n,"cs")?.getAttribute("typeface")??null,r=Zse(o,t)?.trim()??"";return r.length>0?r:null}function H0(e,t){if(!e)return null;let n=null;if(e.localName==="srgbClr"?n=v5(`#${e.getAttribute("val")??""}`):e.localName==="schemeClr"?n=WK(e.getAttribute("val"),t):e.localName==="sysClr"&&(n=v5(`#${e.getAttribute("lastClr")??""}`)),!n)return null;let o=1,r=0;for(let i of Array.from(e.childNodes).filter(L7)){let a=Number(i.getAttribute("val")??Number.NaN);Number.isFinite(a)&&(i.localName==="lumMod"?o*=a/1e5:i.localName==="lumOff"?r+=a/1e5:i.localName==="tint"?r+=(1-r)*(a/1e5):i.localName==="shade"&&(o*=a/1e5))}return I_(n,o,r)}function KX(e){return!!(e&&(e.localName==="schemeClr"||e.localName==="srgbClr"||e.localName==="sysClr"))}function K_(e){if(!e)return null;if(KX(e))return e;for(let t of["srgbClr","schemeClr","sysClr"])for(let n of U7(e,t))if(KX(n))return n;return null}function g5(e,t){if(!e||d1(e,"noFill"))return null;let n=d1(e,"solidFill");if(n){let a=K_(Array.from(n.childNodes).find(L7)??null);return H0(a,t)}let o=d1(e,"gradFill"),r=o?U7(o,"gs").map(a=>({colorNode:Array.from(a.childNodes).find(L7)??null,position:Number(a.getAttribute("pos")??Number.NaN)})).filter(a=>!!a.colorNode):[];if(r.length===0)return null;r.sort((a,s)=>{let l=Number.isFinite(a.position)?a.position:0,c=Number.isFinite(s.position)?s.position:0;return l-c});let i=r.find(a=>Number.isFinite(a.position)&&a.position>=5e4)??r[Math.floor(r.length/2)]??r[0];return H0(i.colorNode,t)}function v4(e,t){let n=e?.localName==="ln"?e:e?d1(e,"ln"):null;if(!n)return{color:null,hidden:!1,widthPx:void 0};if(d1(n,"noFill"))return{color:null,hidden:!0,widthPx:void 0};let o=d1(n,"solidFill"),r=o?K_(Array.from(o.childNodes).find(L7)??null):null,i=Number(n.getAttribute("w")??Number.NaN);return{color:H0(r,t),hidden:!1,widthPx:Number.isFinite(i)?Math.max(1,i/ZN):void 0}}function UI(e){if(!e||typeof e!="object")return null;let t=e;return{overlay:typeof t.overlay=="boolean"?t.overlay:void 0,position:typeof t.position=="string"?t.position:void 0,raw:t}}function XN(e){if(e)switch(e){case"bottom":return"b";case"left":return"l";case"right":return"r";case"top":return"t";default:return e}}function tn(e,t){let n=e?d1(e,t):null,o=Number(n?.getAttribute("val")??Number.NaN);return Number.isFinite(o)?o:void 0}function y3(e,t){let n=e?d1(e,t):null;if(!n)return;let o=n.getAttribute("val");if(o==null||o==="1"||o==="true")return!0;if(o==="0"||o==="false")return!1}function JX(e){if(!e)return;let t=co(e,"defRPr")??co(e,"rPr"),n=Number(t?.getAttribute("sz")??Number.NaN);if(!(!Number.isFinite(n)||n<=0))return n/100}function Xse(e){let t=JX(d1(e,"txPr")),n=[];for(let o of Wr(e,"dLbl")){let r=tn(o,"idx");if(typeof r!="number"||!Number.isFinite(r))continue;let i=d1(o,"layout"),a=i?d1(i,"manualLayout"):null;n.push({deleted:y3(o,"delete"),fontSizePt:JX(d1(o,"txPr"))??t,index:r,showBubbleSize:y3(o,"showBubbleSize"),showCategoryName:y3(o,"showCatName"),showPercent:y3(o,"showPercent"),showSeriesName:y3(o,"showSerName"),showValue:y3(o,"showVal"),x:tn(a,"x"),y:tn(a,"y")})}return n}function QX(e){if(!e)return null;let t=Xse(e),n={pointLabels:t.length>0?t:void 0,raw:{},showBubbleSize:y3(e,"showBubbleSize"),showCategoryName:y3(e,"showCatName"),showLegendKey:y3(e,"showLegendKey"),showPercent:y3(e,"showPercent"),showSeriesName:y3(e,"showSerName"),showValue:y3(e,"showVal")};return n.showBubbleSize!==void 0||n.showCategoryName!==void 0||n.showLegendKey!==void 0||n.showPercent!==void 0||(n.pointLabels?.length??0)>0||n.showSeriesName!==void 0||n.showValue!==void 0?n:null}function Yse(e,t){let n=q0(`${kN(t)}/_rels/${t.split("/").pop()}.rels`),o=B7(e,n);if(!o)return new Map;let r=W0(o);if(!r)return new Map;let i=new Map;for(let a of U7(r,"Relationship")){let s=a.getAttribute("Type"),l=a.getAttribute("Target");!s||!l||i.set(s,GK(n,l))}return i}function Kse(e,t,n){let o=B7(e,t);if(!o)return[];let r=W0(o);return r?.documentElement?Array.from(r.documentElement.childNodes).filter(i=>L7(i)&&i.localName!=="variation").map(i=>H0(i,n)??H0(K_(i),n)).filter(i=>typeof i=="string"):[]}function Jse(e,t,n){let o=B7(e,t);if(!o)return{};let r=W0(o);if(!r)return{};let i=co(r,"dataPoint"),a=i?d1(i,"fillRef"):null,s=Number(a?.getAttribute("idx")??Number.NaN),l=co(r,"chartArea"),c=l?d1(l,"spPr"):null,u=l?d1(l,"fontRef"):null,d=u?H0(Array.from(u.childNodes).find(L7)??null,n):null,p=co(r,"title"),m=p?d1(p,"fontRef"):null,h=m?H0(Array.from(m.childNodes).find(L7)??null,n):null,S=co(r,"categoryAxis")??co(r,"valueAxis"),v=S?d1(S,"spPr"):null,g=S?d1(S,"fontRef"):null,y=c?d1(c,"noFill")!=null:!1;return{axisLabelColor:g?H0(Array.from(g.childNodes).find(L7)??null,n)??void 0:void 0,axisLineColor:v4(v,n).color??void 0,chartAreaBorderColor:v4(c,n).color??void 0,chartAreaFillColor:g5(c,n)??void 0,chartAreaNoFill:y,paletteOffset:Number.isFinite(s)?s:void 0,textColor:d??void 0,titleColor:h??d??void 0}}function Qse(e){let t=[4,5,6,7,8,9].map(n=>e?.colorsByIndex[n]??null).filter(n=>!!n);return t.length>0?t:kse}function e0e(e){return typeof e!="number"||!Number.isFinite(e)?null:e>=100?e-100:e}function t0e(e,t){let n=e0e(e);return n===34||t===!0&&n==null?["#5b9bd5","#ed7d31","#a5a5a5"]:n===35||n===36||t!==!0&&n==null?["#2f5597","#4472c4","#5b9bd5","#8faadc","#d9e2f3"]:null}function n0e(e){if(e.chartType!=="Surface")return;let t=t0e(e.chartStyleId,e.wireframe);(!e.chartColorPalette||e.chartColorPalette.length===0)&&t&&(e.chartColorPalette=t);let n=e.wireframe?"#d0d0d0":"#d9d9df",o=e.wireframe?"#a6a6a6":"#a8adb7";e.floor={...e.floor??{},fillColor:e.floor?.fillColor??n,lineColor:e.floor?.lineColor??o},e.sideWall={...e.sideWall??{},fillColor:e.sideWall?.fillColor??n,lineColor:e.sideWall?.lineColor??o},e.backWall={...e.backWall??{},fillColor:e.backWall?.fillColor??n,lineColor:e.backWall?.lineColor??o},!e.surfaceMaterial&&e.wireframe!==!0&&(e.surfaceMaterial="flat")}function fd(e,t){let n=typeof e.chartStyleId=="number"&&e.chartStyleId>=140&&e.chartStyleId<150,o=t?.colorsByIndex[1]??t?.colorsByIndex[3]??null,r=t?.minorLatinFont?.trim()||void 0,i=o?I_(o,.35,.55):null,a=o?I_(o,e.is3d?.28:.22,e.is3d?.6:.7):null;n&&(e.chartAreaFillColor=e.chartAreaFillColor??"#1f1f1f",e.chartAreaBorderColor=e.chartAreaBorderColor??"#1f1f1f",e.textColor=e.textColor??"#f5f5f5",e.titleColor=e.titleColor??"#f5f5f5",e.axisLabelColor=e.axisLabelColor??"#d9d9d9",e.axisLineColor=e.axisLineColor??"#8c8c8c"),e.chartAreaBorderColor=e.chartAreaBorderColor??a??void 0,e.textColor=e.textColor??o??void 0,e.titleColor=e.titleColor??o??void 0,e.axisLabelColor=e.axisLabelColor??i??o??void 0,e.axisLineColor=e.axisLineColor??i??o??void 0,e.fontFamily=e.fontFamily??r,e.titleFontFamily=e.titleFontFamily??e.fontFamily??r;let s=e.chartColorPalette&&e.chartColorPalette.length>0?e.chartColorPalette:Qse(t);(!e.chartColorPalette||e.chartColorPalette.length===0)&&(e.chartColorPalette=s),e.series=e.series.map((l,c)=>{let u=s[c%s.length];return{...l,color:l.color??l.lineColor??u,lineColor:l.lineColor??l.color??u,markerColor:l.markerColor??l.color??l.lineColor??u,markerLineColor:l.markerLineColor??l.lineColor??l.color??u}}),e.typeGroups=e.typeGroups?.map((l,c)=>({...l,series:l.series.map((u,d)=>{let p=s[(c+d)%s.length];return{...u,color:u.color??u.lineColor??p,lineColor:u.lineColor??u.color??p,markerColor:u.markerColor??u.color??u.lineColor??p,markerLineColor:u.markerLineColor??u.lineColor??u.color??p}})})),n0e(e)}function r0e(e,t){let n=[];for(let o of Wr(e,"dPt")){let r=tn(o,"idx");if(r===void 0)continue;let i=d1(o,"spPr"),a=v4(i,t);n.push({color:g5(i,t)??void 0,explosion:tn(o,"explosion"),index:r,lineColor:a.color??void 0})}return n}function o0e(e,t){let n=co(e,"invertSolidFillFmt"),o=n?d1(n,"spPr"):null;if(!o)return{color:void 0,lineColor:void 0};let r=v4(o,t);return{color:g5(o,t)??void 0,lineColor:r.color??void 0}}function Zu(e,t,n){if(!e)return null;let o=d1(e,"numRef")??d1(e,"strRef")??e,r=d1(o,t);if(!r)return null;let i=tn(r,"ptCount"),a=Wr(r,"pt").map(u=>{let d=Number(u.getAttribute("idx")??Number.NaN);return{index:Number.isFinite(d)?d:0,value:d1(u,"v")?.textContent??""}}).sort((u,d)=>u.index-d.index);if(a.length===0)return null;let s=a.reduce((u,d)=>Math.max(u,d.index),0),l=Math.max(a.length,Number.isFinite(i??Number.NaN)?Number(i):0,s+1),c=Array.from({length:l},()=>null);for(let u of a)n==="value"?c[u.index]=ey(u.value):c[u.index]=u.value.length>0?u.value:null;return c}function eY(e,t){if(!e)return null;let n=d1(e,"multiLvlStrRef")??e,o=d1(n,"multiLvlStrCache");if(!o)return null;let r=Wr(o,"lvl");if(r.length===0)return null;let i=tn(o,"ptCount"),a=t==="category"?r[r.length-1]??r[0]:r[0],s=Wr(a,"pt").map(d=>{let p=Number(d.getAttribute("idx")??Number.NaN);return{index:Number.isFinite(p)?p:0,value:d1(d,"v")?.textContent??""}}).sort((d,p)=>d.index-p.index);if(s.length===0)return null;let l=s.reduce((d,p)=>Math.max(d,p.index),0),c=Math.max(s.length,Number.isFinite(i??Number.NaN)?Number(i):0,l+1),u=Array.from({length:c},()=>null);for(let d of s){if(t==="value"){u[d.index]=ey(d.value);continue}u[d.index]=d.value.length>0?d.value:null}return u}function i0e(e,t,n){let o=Wr(t,"ser");e.series=e.series.map((r,i)=>{let a=o[i];if(!a)return r;let s=d1(a,"spPr"),l=d1(a,"marker"),c=d1(l??t,"spPr"),u=v4(s,n),d=v4(c,n),p=g5(s,n),m=tn(l,"size"),S=(l?d1(l,"symbol"):null)?.getAttribute("val")??void 0,v=r0e(a,n),g=tn(a,"explosion"),y=o0e(a,n),x=y3(a,"invertIfNegative"),_=e.chartType==="Scatter"||e.chartType==="ScatterLines"||e.chartType==="ScatterSmooth"||e.chartType==="Bubble",$=_?Zu(d1(a,"xVal"),"numCache","value")??eY(d1(a,"xVal"),"category"):Zu(d1(a,"cat"),"strCache","category")??Zu(d1(a,"cat"),"numCache","category")??eY(d1(a,"cat"),"category"),k=Zu(_?d1(a,"yVal"):d1(a,"val"),"numCache","value"),L=e.chartType==="Bubble"?Zu(d1(a,"bubbleSize"),"numCache","value"):null,I=r.shapeProperties&&typeof r.shapeProperties=="object"?r.shapeProperties:null,N=typeof I?.solidFillHex=="string"?v5(I.solidFillHex):null,U=typeof I?.lineColorHex=="string"?v5(I.lineColorHex):null,z=u.hidden?void 0:U??u.color??N??p??r.lineColor??r.color,Z=typeof r.categoriesRef?.formula=="string"&&r.categoriesRef.formula.length>0,ie=typeof r.valuesRef?.formula=="string"&&r.valuesRef.formula.length>0,ue=typeof r.bubbleSizeRef?.formula=="string"&&r.bubbleSizeRef.formula.length>0;return{...r,bubbleSizes:!ue&&L?L.map(X=>typeof X=="number"&&Number.isFinite(X)?X:null):r.bubbleSizes,categories:!Z&&$?$:r.categories,color:N??U??p??u.color??r.color,dataPointStyles:v.length>0?v:r.dataPointStyles,lineColor:z,lineWidthPx:u.hidden?void 0:u.widthPx??r.lineWidthPx,markerColor:N??U??g5(c,n)??p??u.color??void 0,markerLineColor:U??N??d.color??u.color??p??void 0,markerSize:m??r.markerSize,markerSymbol:S,smooth:y3(a,"smooth")??r.smooth,invertIfNegative:x??r.invertIfNegative,shapeProperties:{...r.shapeProperties,xmlExplosion:g??void 0,xmlFillColor:p??void 0,xmlLineHidden:u.hidden?!0:void 0,xmlLineColor:u.color??void 0,xmlLineWidthPx:u.widthPx??void 0,xmlNegativeFillColor:y.color??void 0,xmlNegativeLineColor:y.lineColor??void 0},negativeColor:y.color??r.negativeColor,negativeLineColor:y.lineColor??r.negativeLineColor,values:!ie&&k?k.map(X=>typeof X=="number"&&Number.isFinite(X)?X:null):r.values}})}function a0e(e,t,n,o){let r=B7(n,t);if(!r)return;let i=t?Yse(n,t):new Map,a=FK(r,o),s=Lse(r,o),l=HK(r),c=()=>{l.length>0&&(e.series=e.series.map((Oe,Be)=>{let c1=l[Be]??[];if(c1.length===0)return Oe;let _e=(Oe.bubbleSizes??[]).filter(pe=>typeof pe=="number"&&Number.isFinite(pe)).length,ve=c1.filter(pe=>typeof pe=="number"&&Number.isFinite(pe)).length;return _e>=ve?Oe:{...Oe,bubbleSizes:c1}})),a.length>0&&(e.series=e.series.map((Oe,Be)=>{let c1=a[Be]??[];if(c1.length===0)return Oe;let _e=new Map((Oe.dataPointStyles??[]).map(ve=>[ve.index,ve]));for(let ve of c1){let pe=_e.get(ve.index);_e.set(ve.index,{color:pe?.color??ve.color,explosion:pe?.explosion??ve.explosion,index:ve.index,lineColor:pe?.lineColor??ve.lineColor})}return{...Oe,dataPointStyles:Array.from(_e.values()).sort((ve,pe)=>ve.index-pe.index)}})),s.length>0&&(e.series=e.series.map((Oe,Be)=>{let c1=s[Be];if(!c1)return Oe;let _e=c1.color??c1.lineColor;return{...Oe,color:Oe.color??_e,lineColor:Oe.lineColor??c1.lineColor??_e,markerColor:Oe.markerColor??_e??Oe.color,markerLineColor:Oe.markerLineColor??c1.lineColor??_e??Oe.lineColor}}))},u=()=>{e.chartColorPalette=Kse(n,i.get(Cse),o);let Oe=Jse(n,i.get(Pse),o);return e.axisLabelColor=Oe.axisLabelColor??e.axisLabelColor,e.axisLineColor=Oe.axisLineColor??e.axisLineColor,e.chartAreaBorderColor=Oe.chartAreaBorderColor??e.chartAreaBorderColor,e.chartAreaFillColor=Oe.chartAreaFillColor??e.chartAreaFillColor,e.chartColorPaletteOffset=Oe.paletteOffset??e.chartColorPaletteOffset,e.textColor=Oe.textColor??e.textColor,e.titleColor=Oe.titleColor??e.titleColor,Oe},d=()=>{let Oe=p?.documentElement?co(p.documentElement,"plotArea"):null;if(!Oe)return;let Be=me=>{let ne=d1(me,"layoutPr"),Te=ne?d1(ne,"binning"):null;if(!Te)return null;let f1={};for(let M of Array.from(Te.attributes)){let K1=M.value,I1=Number(K1);f1[M.localName||M.name]=Number.isFinite(I1)&&K1.trim()!==""?I1:K1}return Object.keys(f1).length>0?f1:{}},c1=d1(Oe,"spPr");if(c1){let me=g5(c1,o),ne=v4(c1,o);me&&(e.chartAreaFillColor=e.chartAreaFillColor??me),ne.color&&(e.chartAreaBorderColor=e.chartAreaBorderColor??ne.color)}let _e=U7(Oe,"series");if(_e.length===0)return;e.series=e.series.map((me,ne)=>{let Te=_e[ne]??null;if(!Te)return me;let f1=d1(Te,"valueColors"),M=f1?Array.from(f1.childNodes).filter(dt=>dt.nodeType===Node.ELEMENT_NODE).map(dt=>H0(K_(dt)??dt,o)).filter(dt=>typeof dt=="string"&&dt.length>0):[],K1=M.length>0?{...me.raw&&typeof me.raw=="object"?me.raw:{},valueColors:M}:me.raw,I1=d1(Te,"spPr");if(!I1)return K1===me.raw?me:{...me,raw:K1};let t1=g5(I1,o),N1=v4(I1,o),V1=t1??N1.color??void 0;return{...me,color:me.color??V1,lineColor:me.lineColor??N1.color??t1??V1,lineWidthPx:me.lineWidthPx??(typeof N1.widthPx=="number"?N1.widthPx:void 0),markerColor:me.markerColor??V1??me.color,markerLineColor:me.markerLineColor??N1.color??V1??me.lineColor,raw:K1}});let ve=_e.map(me=>me.getAttribute("layoutId")??me.getAttribute("layout")),pe=ve.findIndex(me=>me==="clusteredColumn");if(pe>=0){let me=_e[pe]??null,ne=me?Be(me):null;if(ne){let Te={layoutId:"clusteredColumn",layoutPr:{binning:ne}},f1=ve.includes("paretoLine"),M=K1=>K1?YK(K1,Te,f1):null;if(e.typeGroups&&e.typeGroups.length>0){let K1=e.typeGroups.map(t1=>({...t1,series:[...t1.series]})),I1=K1.findIndex(t1=>t1.chartType==="ColumnClustered");if(I1>=0){let t1=K1[I1]?.series[0]??null,N1=M(t1);if(N1){K1[I1].series=[N1];let V1=K1.findIndex(dt=>dt.chartType==="Line");if(V1>=0&&K1[V1]?.series[0]){let dt=K1[V1].series[0],ft=KK(N1,{text:dt.name,...dt.raw&&typeof dt.raw=="object"?dt.raw:{}},0);K1[V1].series=[{...dt,categories:ft.categories,categoriesRef:ft.categoriesRef,raw:ft.raw,values:ft.values}],e.series=[N1,K1[V1].series[0]]}else e.series=[N1];e.typeGroups=K1}}else if(e.series[0]){let t1=M(e.series[0]);t1&&(e.series=[t1])}}else if(e.series[0]){let K1=M(e.series[0]);K1&&(e.series=[K1])}}}},p=W0(r),m=p?co(p,"chart"):null,h=m?d1(m,"plotArea"):null,S=p?.documentElement?co(p.documentElement,"style"):null,v=qK(h);if(!m||!v){u();let Oe=tn(S,"style");typeof Oe=="number"&&Number.isFinite(Oe)&&(e.chartStyleId=Oe),d(),c(),fd(e,o);return}let g=h;if(!g){u(),c(),fd(e,o);return}switch(v.localName){case"barChart":case"bar3DChart":{let Oe=d1(v,"grouping")?.getAttribute("val"),c1=d1(v,"barDir")?.getAttribute("val")==="bar";e.is3d=v.localName==="bar3DChart"?!0:e.is3d,Oe==="percentStacked"?e.chartType=c1?"BarPercentStacked":"ColumnPercentStacked":Oe==="stacked"?e.chartType=c1?"BarStacked":"ColumnStacked":e.chartType=c1?"BarClustered":"ColumnClustered";break}case"areaChart":case"area3DChart":{let Oe=d1(v,"grouping")?.getAttribute("val");e.is3d=v.localName==="area3DChart"?!0:e.is3d,Oe==="stacked"?e.chartType="AreaStacked":Oe==="percentStacked"?e.chartType="AreaPercentStacked":e.chartType="Area";break}case"lineChart":case"line3DChart":{let Oe=d1(v,"grouping")?.getAttribute("val");e.is3d=v.localName==="line3DChart"?!0:e.is3d,Oe==="stacked"?e.chartType="LineStacked":Oe==="percentStacked"?e.chartType="LinePercentStacked":e.chartType="Line";break}case"pieChart":e.chartType="Pie";break;case"pie3DChart":e.chartType="Pie3D",e.is3d=!0;break;case"doughnutChart":e.chartType="Doughnut";break;case"ofPieChart":e.chartType="BarOfPie";break;case"scatterChart":e.chartType=Fse(d1(v,"scatterStyle")?.getAttribute("val"));break;case"radarChart":e.chartType="Radar";break;case"surfaceChart":e.chartType="Surface",e.is3d=!1;break;case"surface3DChart":e.chartType="Surface",e.is3d=!0;break;case"stockChart":e.chartType="Stock";break;case"bubbleChart":e.chartType="Bubble";break;default:break}let y=d1(m,"legend"),x=y?d1(y,"legendPos")?.getAttribute("val")??void 0:void 0,_=y?d1(y,"overlay")?.getAttribute("val"):void 0;e.legend=y?{overlay:_==="1",position:XN(x),raw:e.legend?.raw}:e.legend;let $=y3(m,"plotVisOnly");$!==void 0&&(e.plotVisibleOnly=$),e.displayBlanksAs=d1(m,"dispBlanksAs")?.getAttribute("val")??e.displayBlanksAs;let k=Number(S?.getAttribute("val")??Number.NaN);e.chartStyleId=Number.isFinite(k)?k:e.chartStyleId,e.firstSliceAngle=tn(v,"firstSliceAng")??e.firstSliceAngle,e.gapWidth=tn(v,"gapWidth")??e.gapWidth,e.overlap=tn(v,"overlap")??e.overlap,e.bubbleScale=tn(v,"bubbleScale")??e.bubbleScale,e.varyColors=y3(v,"varyColors")??e.varyColors;let L=d1(v,"bubble3D");e.bubble3d=L?L.getAttribute("val")!=="0":e.bubble3d,e.holeSize=tn(v,"holeSize")??e.holeSize,e.radarStyle=d1(v,"radarStyle")?.getAttribute("val")??e.radarStyle,e.scatterStyle=d1(v,"scatterStyle")?.getAttribute("val")??e.scatterStyle,e.shape3d=d1(v,"shape")?.getAttribute("val")??e.shape3d;let I=d1(v,"wireframe");e.wireframe=I?I.getAttribute("val")!=="0":e.wireframe;let N=QX(d1(v,"dLbls")),U=Wr(v,"ser")[0]??null,z=QX(d1(U,"dLbls"));e.dataLabels=N??z??e.dataLabels;let Z=U?co(U,"sp3d"):null;e.surfaceMaterial=Z?.getAttribute("prstMaterial")??e.surfaceMaterial;let ie=Wr(v,"bandFmts")[0]??null,ue=ie?Wr(ie,"bandFmt"):[],X=ue.map(Oe=>{let Be=d1(Oe,"spPr");return g5(Be,o)??void 0}).filter(Oe=>typeof Oe=="string"&&Oe.length>0),W=ue.map(Oe=>{let Be=d1(Oe,"spPr");return v4(Be,o).color??void 0}).filter(Oe=>typeof Oe=="string"&&Oe.length>0);e.raw={...e.raw??{},bandFormatCount:ue.length>0?ue.length:void 0,bandFormatColors:X.length>0?X:void 0,bandFormatLineColors:W.length>0?W:void 0,date1904:y3(p?.documentElement??null,"date1904"),bubble3d:e.bubble3d,grouping:d1(v,"grouping")?.getAttribute("val")??void 0,ofPieType:d1(v,"ofPieType")?.getAttribute("val")??void 0,shape:d1(v,"shape")?.getAttribute("val")??void 0,secondPieSize:tn(v,"secondPieSize"),scatterStyle:e.scatterStyle,splitPos:tn(v,"splitPos"),splitType:d1(v,"splitType")?.getAttribute("val")??void 0,xmlChartType:v.localName};let Me=co(m,"view3D");Me&&(e.view3d={depthPercent:tn(Me,"depthPercent"),perspective:tn(Me,"perspective"),rAngAx:d1(Me,"rAngAx")?.getAttribute("val")==="1",rotX:tn(Me,"rotX"),rotY:tn(Me,"rotY")}),e.floor=qI(d1(m,"floor"),o)??e.floor,e.sideWall=qI(d1(m,"sideWall"),o)??e.sideWall,e.backWall=qI(d1(m,"backWall"),o)??e.backWall;let Fe=u(),Se=YX(d1(m,"txPr"),o),$e=YX(co(m,"title"),o);e.fontFamily=Se??e.fontFamily,e.titleFontFamily=$e??e.titleFontFamily??e.fontFamily;let He=p?.documentElement?d1(p.documentElement,"spPr"):null,r1=d1(g,"spPr"),b1=He?d1(He,"noFill")!=null:!1,p1=r1?d1(r1,"noFill")!=null:!1;if(e.raw={...e.raw??{},chartAreaNoFill:Fe.chartAreaNoFill===!0||b1,plotAreaNoFill:p1},He){let Oe=g5(He,o);Oe?e.chartAreaFillColor=Oe:d1(He,"noFill")&&(e.chartAreaFillColor="transparent");let Be=v4(He,o);Be.hidden?e.chartAreaBorderColor="transparent":Be.color&&(e.chartAreaBorderColor=Be.color)}!e.chartAreaFillColor&&(Fe.chartAreaNoFill===!0||p1)&&(e.chartAreaFillColor="transparent");let re=[...Wr(g,"catAx"),...Wr(g,"dateAx")],fe=Wr(g,"valAx"),Ve=Wr(g,"serAx")[0]??null,l1=e.chartType==="Scatter"||e.chartType==="ScatterLines"||e.chartType==="ScatterSmooth"||e.chartType==="Bubble",v1=re[0]??null,D1=fe[0]??null;if(!v1&&l1&&fe.length>=2&&(v1=fe.find(Oe=>{let Be=d1(Oe,"axPos")?.getAttribute("val");return Be==="b"||Be==="t"})??fe[0],D1=fe.find(Oe=>{let Be=d1(Oe,"axPos")?.getAttribute("val");return Be==="l"||Be==="r"})??fe[1]??fe[0]),e.categoryAxis=VI(e.categoryAxis,Xu(v1)),e.valueAxis=VI(e.valueAxis,Xu(D1)),e.seriesAxis=VI(e.seriesAxis,Xu(Ve)),e.axes=e.axes.length>0?e.axes.map((Oe,Be)=>Be===0&&v1?{...Oe,...Xu(v1)}:Be===1&&D1?{...Oe,...Xu(D1)}:Oe):e.axes,Ve){let Oe=Xu(Ve);Oe&&!e.axes.some(Be=>Be.id!=null&&Be.id===Oe.id)&&(e.axes=[...e.axes,Oe])}if(i0e(e,v,o),c(),e.chartType==="Bubble"){let Oe=jse(n,e.title);Oe.length>0&&(e.series=e.series.map((Be,c1)=>{let _e=Math.max(Be.values.length,Be.categories.length);if(_e<=1||(Be.bubbleSizes??[]).filter(ne=>typeof ne=="number"&&Number.isFinite(ne)).length>=_e)return Be;let pe=Oe[c1]??Oe[0]??[];return pe.filter(ne=>typeof ne=="number"&&Number.isFinite(ne)).length<_e?Be:{...Be,bubbleSizes:pe}}))}if((e.chartType==="Pie"||e.chartType==="Pie3D"||e.chartType==="PieExploded"||e.chartType==="Doughnut"||e.chartType==="BarOfPie")&&e.series.some(Be=>Math.max(Be.values.length,Be.categories.length)<=0?!1:(Be.dataPointStyles??[]).filter(ve=>typeof ve.color=="string"&&ve.color.length>0).length===0)){let Be=Hse(n,e.title,v.localName,o);Be.length>0&&(e.series=e.series.map((c1,_e)=>{let ve=Be[_e]??Be[0]??[];if(ve.length===0)return c1;let pe=new Map((c1.dataPointStyles??[]).map(me=>[me.index,me]));for(let me of ve){let ne=pe.get(me.index);pe.set(me.index,{color:ne?.color??me.color,explosion:ne?.explosion??me.explosion,index:me.index,lineColor:ne?.lineColor??me.lineColor})}return{...c1,dataPointStyles:Array.from(pe.values()).sort((me,ne)=>me.index-ne.index)}}))}fd(e,o)}function q0(e){return e.replace(/^\/+/,"").replace(/\\/g,"/")}function kN(e){let t=q0(e),n=t.lastIndexOf("/");return n>=0?t.slice(0,n):""}function GK(e,t){if(!t)return"";let n=t.replace(/\\/g,"/");if(n.startsWith("/"))return q0(n);let o=q0(e),r=kN(o);if(o.endsWith(".rels")){let s="/_rels/",l=o.lastIndexOf(s);if(l>=0){let c=o.slice(0,l),u=o.slice(l+s.length),d=u.endsWith(".rels")?u.slice(0,-5):u;r=kN(`${c}/${d}`)}}let i=[...r.split("/").filter(Boolean),...n.split("/").filter(Boolean)],a=[];for(let s of i)if(s!=="."){if(s===".."){a.pop();continue}a.push(s)}return a.join("/")}function B7(e,t){if(!t)return null;let n=e[q0(t)];return n?T0(n):null}function W0(e){if(typeof DOMParser>"u")return null;try{return new DOMParser().parseFromString(e,"application/xml")}catch{return null}}function ZK(e){return new XMLSerializer().serializeToString(e)}function Wr(e,t){return Array.from(e.childNodes).filter(n=>n.nodeType===Node.ELEMENT_NODE&&n.localName===t)}function RN(e,t){Wr(e,t).forEach(n=>n.parentNode?.removeChild(n))}function U7(e,t){return Array.from(e.getElementsByTagName("*")).filter(n=>n.localName===t)}function d1(e,t){return Wr(e,t)[0]??null}function co(e,t){return U7(e,t)[0]??null}function H3(e,t,n=e.namespaceURI??q8,o="c"){let r=d1(e,t);if(r)return r;let a=e.ownerDocument.createElementNS(n,`${o}:${t}`);return e.appendChild(a),a}function A7(e,t,n,o=e.namespaceURI??q8,r="c"){let i=H3(e,t,o,r);return i.textContent=n,i}function v3(e,t,n){let o=H3(e,t);return o.setAttribute("val",n?"1":"0"),o}function s0e(e,t,n){let o=H3(e,t);return o.setAttribute("val",String(Math.round(n))),o}function l0e(e){let t=e.trim();return t.startsWith("'")&&t.endsWith("'")?t.slice(1,-1).replace(/''/g,"'"):t}function c0e(e){let t=-1,n=!1;for(let o=0;o<e.length;o+=1){let r=e[o];if(r==="'")n=!n;else if(r==="!"&&!n){t=o;break}}return t<0?null:{range:e.slice(t+1),sheetName:l0e(e.slice(0,t))}}function tY(e){let t=/^\$?([A-Z]+)\$?(\d+)$/i.exec(e.trim());if(!t)return null;let n=0;for(let o of t[1].toUpperCase())n=n*26+(o.charCodeAt(0)-64);return{col:n-1,row:Number(t[2])-1}}function FI(e){let[t,n=t]=e.split(":"),o=tY(t??""),r=tY(n??"");return!o||!r?null:{end:{col:Math.max(o.col,r.col),row:Math.max(o.row,r.row)},start:{col:Math.min(o.col,r.col),row:Math.min(o.row,r.row)}}}function nY(e){let t=e+1,n="";for(;t>0;){let o=(t-1)%26;n=String.fromCharCode(65+o)+n,t=Math.floor((t-1)/26)}return n}function u0e(e,t,n){return`'${e.replace(/'/g,"''")}'!$${nY(t.col)}$${t.row+1}:$${nY(n.col)}$${n.row+1}`}function wd(e,t,n){if(!n)return{range:null,sheet:e.getSheet(t),sheetName:e.getSheet(t)?.name??""};let o=n.trim();if(o.length>0&&!o.includes("!"))try{let i=e.getNamedRange(o);if(typeof i=="string"&&i.length>0&&i!==o)return wd(e,t,i)}catch{}let r=c0e(o);if(!r)return{range:FI(o),sheet:e.getSheet(t),sheetName:e.getSheet(t)?.name??""};try{return{range:FI(r.range),sheet:e.getSheetByName(r.sheetName),sheetName:r.sheetName}}catch{return{range:FI(r.range),sheet:e.getSheet(t),sheetName:e.getSheet(t)?.name??""}}}function d0e(e,t,n,o){if(!n?.formula)return o;let r=wd(e,t,n.formula);if(!r.sheet||!r.range)return o;let{start:i}=r.range;if(i.row>0){let s=ty(typeof r.sheet.getFormattedValueAt=="function"?r.sheet.getFormattedValueAt(i.row-1,i.col):null);if(s.length>0)return s}let a=ty(typeof r.sheet.getFormattedValueAt=="function"?r.sheet.getFormattedValueAt(i.row,i.col):null);return a.length>0?a:o}function p0e(e,t,n){if(!n?.formula)return[];let o=wd(e,t,n.formula);if(!o.sheet||!o.range)return[];let r=[];for(let i=o.range.start.row;i<=o.range.end.row;i+=1){let a=[];for(let s=o.range.start.col;s<=o.range.end.col;s+=1){let l=typeof o.sheet.getCalculatedValueAt=="function"?o.sheet.getCalculatedValueAt(i,s):null,c=typeof o.sheet.getFormattedValueAt=="function"?o.sheet.getFormattedValueAt(i,s):l,u=ty(c??l),d=ey(l??c),p=u.length>0?u:d!=null?String(d):"";p.length>0&&a.push(p)}r.push(a)}return r}function f0e(e){if(!e||typeof e!="object")return null;let t=e,n=typeof t.position=="string"?XN(String(t.position)):void 0;return{overlay:typeof t.overlay=="boolean"?t.overlay:void 0,position:n,raw:t}}function m0e(e){if(e)return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase())}function h0e(e){if(!e||typeof e!="object")return null;let t=e,n=t.scaling&&typeof t.scaling=="object"?t.scaling:null,o=t.numberFormat&&typeof t.numberFormat=="object"?t.numberFormat:null;return{delete:typeof t.hidden=="boolean"?t.hidden:void 0,id:typeof t.id=="number"&&Number.isFinite(t.id)?t.id:void 0,crossId:typeof t.crossId=="number"&&Number.isFinite(t.crossId)?t.crossId:void 0,majorGridlines:t.majorGridlines!=null?!0:void 0,majorUnit:typeof n?.majorUnit=="number"?n.majorUnit:void 0,max:typeof n?.max=="number"?n.max:void 0,min:typeof n?.min=="number"?n.min:void 0,minorGridlines:t.minorGridlines!=null?!0:void 0,minorUnit:typeof n?.minorUnit=="number"?n.minorUnit:void 0,numberFormat:o?{formatCode:typeof o.formatCode=="string"?o.formatCode:void 0,sourceLinked:typeof o.sourceLinked=="boolean"?o.sourceLinked:void 0}:void 0,raw:t,position:typeof t.position=="string"?t.position:void 0,tickLabelSkip:typeof t.tickLabelSkip=="number"?t.tickLabelSkip:void 0,tickMarkSkip:typeof t.tickMarkSkip=="number"?t.tickMarkSkip:void 0}}function g0e(e){switch(e){case"boxWhisker":return"BoxWhisker";case"clusteredColumn":return"ColumnClustered";case"funnel":return"Funnel";case"paretoLine":return"Line";case"regionMap":return"RegionMap";case"sunburst":return"Sunburst";case"treemap":return"Treemap";case"waterfall":return"Waterfall";default:return e?`Unsupported(cx:${e})`:"ColumnClustered"}}function XK(e){if(!e||typeof e!="object")return;let t=e;return typeof t.layout=="string"?t.layout:typeof t.layoutId=="string"?t.layoutId:void 0}function rY(e){if(!e||typeof e!="object")return[];let t=e;return Array.isArray(t.axisIds)?t.axisIds.filter(n=>typeof n=="number"&&Number.isFinite(n)):Array.isArray(t.axisId)?t.axisId.flatMap(n=>typeof n=="number"&&Number.isFinite(n)?[n]:n&&typeof n=="object"&&typeof n.val=="number"?[n.val]:[]):typeof t.axisId=="number"&&Number.isFinite(t.axisId)?[t.axisId]:[]}function y0e(e){if(!Number.isFinite(e)||e<=0)return 1;let n=10**Math.floor(Math.log10(e)),o=e/n;return o<=1?n:o<=2?n*2:o<=5?n*5:n*10}function v0e(e,t,n,o){let r=o?n===0?"[":"(":"[",i=o?"]":")";return`${r}${Number(e.toFixed(6))},${Number(t.toFixed(6))}${i}`}function b0e(e,t,n){if(e.length===0)return[];let o=t&&typeof t=="object"?t:null,r=o?.layoutProperties&&typeof o.layoutProperties=="object"?o.layoutProperties:null,i=r?.binning&&typeof r.binning=="object"?r.binning:null,a=Math.min(...e),s=Math.max(...e),l=typeof i?.binSize=="number"&&Number.isFinite(i.binSize)&&i.binSize>0?i.binSize:void 0,c=typeof i?.binCount=="number"&&Number.isFinite(i.binCount)&&i.binCount>0?i.binCount:typeof i?.count=="number"&&Number.isFinite(i.count)&&i.count>0?i.count:void 0,u=i?.intervalClosed==="r"||i?.intervalClosed==="right",d=e.reduce((L,I)=>L+I,0)/e.length,p=e.reduce((L,I)=>L+(I-d)**2,0)/Math.max(1,e.length),m=Math.sqrt(Math.max(0,p)),h=e.every(L=>Math.abs(L-Math.round(L))<1e-9),S=m>0?3.49*m/Math.cbrt(e.length):void 0,v=c!=null?(s-a)/Math.max(1,c):S??(s-a)/Math.max(1,Math.ceil(Math.log2(e.length)+1)),g=l??(h?Math.max(1,Math.ceil(Math.max(v,1e-6))):y0e(Math.max(v,1e-6))),y=Math.max(g,1e-6),x=l!=null||c!=null?Math.floor(a/y)*y:a,_=Math.max(x+y,x+Math.ceil((s-x)/y)*y),$=Math.max(1,Math.ceil((_-x)/y)),k=Array.from({length:$},(L,I)=>{let N=x+y*I,U=N+y;return{count:0,label:v0e(N,U,I,u),lower:N,upper:U}});return e.forEach(L=>{if(!Number.isFinite(L))return;let I=(L-x)/y,N=Math.floor(I);u&&Math.abs(I-Math.round(I))<1e-9&&L>x&&(N-=1),L>=_&&(N=k.length-1),L<=x&&(N=0);let U=k[Math.max(0,Math.min(k.length-1,N))];U&&(U.count+=1)}),n&&k.sort((L,I)=>I.count-L.count||L.lower-I.lower),k}function YK(e,t,n){let o=XK(t),r=t&&typeof t=="object"?t:null;if(!!!(o==="clusteredColumn"&&r?.layoutProperties&&typeof r.layoutProperties=="object"&&r.layoutProperties.binning!=null))return e;let a=e.values.filter(l=>typeof l=="number"&&Number.isFinite(l));if(a.length===0)return e;let s=b0e(a,t,n);return s.length===0?e:{...e,categories:s.map(l=>l.label),categoriesRef:null,raw:{...e.raw,chartExHistogramBins:s,chartExSourceValues:a},values:s.map(l=>l.count)}}function KK(e,t,n){let o=e.values.map(s=>typeof s=="number"&&Number.isFinite(s)?s:0),r=o.reduce((s,l)=>s+l,0),i=0,a=o.map(s=>(i+=s,r>0?i/r*100:0));return{...e,color:void 0,lineColor:void 0,markerColor:void 0,markerLineColor:void 0,markerSize:7,markerSymbol:"circle",name:typeof t?.text=="string"?t.text:"Pareto",raw:{...e.raw??{},chartExLayout:"paretoLine",source:t&&typeof t=="object"?t:void 0},values:a}}function JK(e){if(typeof e=="string"&&e.length>0)return e;if(!e||typeof e!="object")return;let t=e;if(typeof t.formula=="string"&&t.formula.length>0)return t.formula;if(typeof t.text=="string"&&t.text.length>0)return t.text;if(typeof t.value=="string"&&t.value.length>0)return t.value}function S0e(e){if(typeof e=="string"&&e.length>0)return e;if(!e||typeof e!="object")return;let t=e;if(typeof t.text=="string"&&t.text.length>0)return t.text;let n=t.text&&typeof t.text=="object"?JK(t.text):void 0;return n||(typeof t.value=="string"&&t.value.length>0?t.value:void 0)}function x0e(e,t,n){if(!n)return null;let o=wd(e,t,n);return!o.sheet||!o.range||o.range.start.col<=0?null:md({formula:u0e(o.sheetName,{col:o.range.start.col-1,row:o.range.start.row},{col:o.range.start.col-1,row:o.range.end.row})})}function w0e(e,t,n,o,r,i,a){let s=o&&typeof o=="object"?o:{},l=typeof s.dataId=="number"?s.dataId:null,c=l!=null?r.get(l)??null:null,u=Array.isArray(c?.dimensions)?c.dimensions.filter(z=>!!(z&&typeof z=="object")):[],d=u.find(z=>z.dimType==="cat")??u.find(z=>z.dimType==="name")??null,p=u.find(z=>z.dimType==="val"||z.dimType==="y"||z.dimType==="colorVal"||z.dimType==="size")??u.find(z=>z!==d)??d,m=typeof d?.formula=="string"?d.formula:void 0,h=typeof p?.formula=="string"?p.formula:void 0,S=(a==="Sunburst"||a==="Treemap")&&!d&&typeof h=="string"?x0e(e,t,h):null,v=d?md({formula:m}):S,g=p?md({formula:h}):null,y=D7(e,t,g,"value"),x=y.map(z=>typeof z=="number"&&Number.isFinite(z)?z:null),_=a==="RegionMap"&&p?.dimType==="colorStr"?y.map(z=>{if(typeof z=="string"){let Z=z.trim();return Z.length>0?Z:null}return typeof z=="number"&&Number.isFinite(z)?String(z):null}):[],$=D7(e,t,v,"category"),k=a==="Sunburst"||a==="Treemap"?p0e(e,t,v):[],L=JK(s.text),I=s.shapeProperties&&typeof s.shapeProperties=="object"?s.shapeProperties:void 0,N=typeof I?.solidFillHex=="string"?v5(I.solidFillHex):null,U=typeof I?.lineColorHex=="string"?v5(I.lineColorHex):null;return{bubbleSizeRef:null,bubbleSizes:[],categories:$,categoriesRef:v,color:N??void 0,dataPoints:Array.isArray(s.dataPoints)?s.dataPoints:[],dataPointStyles:void 0,formatIdx:typeof s.formatIdx=="number"?s.formatIdx:void 0,hidden:typeof s.hidden=="boolean"?s.hidden:void 0,id:`${n}-series-${i}`,invertIfNegative:void 0,lineColor:U??N??void 0,lineWidthPx:typeof I?.lineWidth=="number"?Math.max(1,Number(I.lineWidth)/ZN):void 0,marker:void 0,markerColor:N??void 0,markerLineColor:U??N??void 0,markerSize:void 0,markerSymbol:void 0,name:typeof s.text=="string"?s.text:L?YN(e,t,L):d0e(e,t,g,`Series ${i+1}`),negativeColor:void 0,negativeLineColor:void 0,raw:{...s,chartExColorStrings:_,chartExHierarchyCategories:k,data:c,dimType:typeof p?.dimType=="string"?p.dimType:void 0},shapeProperties:I,smooth:void 0,values:x,valuesRef:g}}function _0e(e,t){if(e!=="Funnel"&&e!=="Waterfall"){if((e==="Sunburst"||e==="Treemap")&&t.length>1&&t.every(o=>(o.raw&&typeof o.raw=="object"?o.raw:null)?.dimType==="size")){let o=t.find(r=>r.hidden!==!0)??t[0]??null;return o?[{...o,dataPoints:[],hidden:!1}]:t}return t}let n=t.find(o=>o.hidden!==!0)??t[0]??null;return n?[{...n,categories:[],categoriesRef:null,dataPoints:[],hidden:!1}]:t}function P0e(e,t,n,o,r,i){let a=o&&typeof o=="object"?o:{},s=a.chartEx&&typeof a.chartEx=="object"?a.chartEx:{},l=s.plotArea&&typeof s.plotArea=="object"?s.plotArea:{},c=Array.isArray(l.series)?l.series:[],u=c.map(XK),d=Array.isArray(s.data)?s.data:[],p=new Map;d.forEach(X=>{if(!X||typeof X!="object")return;let W=X;typeof W.id=="number"&&p.set(W.id,W)});let m=Array.isArray(l.axes)?l.axes.map(h0e).filter(X=>!!X):[],h=typeof s.layout=="string"?s.layout:u.find(X=>typeof X=="string"&&X.length>0),S=m0e(h),v=S0e(s.title)??(s.title!=null?"Chart Title":S),g=g0e(h),y=c.map((X,W)=>w0e(e,t,`chart-ex-${t}-${r}`,X,p,W,g)),x=u.findIndex(X=>X==="clusteredColumn"),_=u.includes("paretoLine"),$=x>=0?rY(c[x]):[],k=u.findIndex(X=>X==="paretoLine"),L=k>=0?rY(c[k]):[],I=x>=0?YK(y[x]??y[0],c[x],_):null,N=_&&I&&I.values.length>0?KK(I,c[k],k):null,U=N?[I,N]:I?[I,...y.filter((X,W)=>W!==x)]:_0e(g,y),z=I?"ColumnClustered":g,Z=I?0:void 0,ie=N?[{axisIds:$,chartType:"ColumnClustered",gapWidth:0,raw:{gapWidth:0,layout:"clusteredColumn"},series:[I]},{axisIds:L,chartType:"Line",raw:{layout:"paretoLine"},series:[N]}]:[],ue={anchor:QK(a.anchor),autoTitleDeleted:void 0,axes:m,axisLabelColor:void 0,axisLineColor:void 0,categoryAxis:m[0]??null,chartAreaBorderColor:void 0,chartAreaFillColor:void 0,chartColorPalette:void 0,chartColorPaletteOffset:void 0,chartExLayout:h,chartPath:void 0,chartStyleId:void 0,chartType:z,dataLabels:c.length>0&&c[0]&&typeof c[0]=="object"?N_(c[0].dataLabels):null,displayBlanksAs:void 0,editable:!0,firstSliceAngle:void 0,fontFamily:void 0,gapWidth:Z,holeSize:void 0,id:`chart-ex-${t}-${r}`,is3d:void 0,legend:f0e(s.legend),name:typeof a.name=="string"?a.name:v,overlap:void 0,plotVisibleOnly:void 0,raw:s,radarStyle:void 0,scatterStyle:void 0,roundedCorners:void 0,shape3d:void 0,seriesAxis:null,series:U,sheetIndex:n,showDlblsOverMax:void 0,sideWall:null,backWall:null,bubbleScale:void 0,bubble3d:void 0,floor:null,surfaceMaterial:void 0,textColor:void 0,title:v,titleColor:void 0,titleFontFamily:void 0,typeGroups:ie,valueAxis:m.find(X=>X.numberFormat||X.majorGridlines)??m[1]??null,varyColors:typeof s.valueColors=="boolean"?s.valueColors:void 0,view3d:void 0,wireframe:void 0,workbookSheetIndex:t,zIndex:Array.isArray(a.drawingPath)&&typeof a.drawingPath[0]=="number"?a.drawingPath[0]+1:r+1};return fd(ue,i),ue}function ey(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(e&&typeof e=="object"){if(e.is_empty)return null;let t=[];typeof e.asNumber=="function"&&t.push(e.asNumber()),typeof e.toJs=="function"&&t.push(e.toJs()),typeof e.asText=="function"&&t.push(e.asText()),typeof e.toString=="function"&&t.push(e.toString());for(let n of t){if(typeof n=="number"&&Number.isFinite(n))return n;if(typeof n=="string"){let o=Number(n.replace(/,/g,""));if(Number.isFinite(o))return o}}}if(typeof e=="string"){let t=Number(e.replace(/,/g,""));return Number.isFinite(t)?t:null}return null}function ty(e){if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(e&&typeof e=="object"){if(e.is_empty)return"";let t=[];typeof e.asText=="function"&&t.push(e.asText()),typeof e.toJs=="function"&&t.push(e.toJs()),typeof e.toString=="function"&&t.push(e.toString());for(let n of t)if(n!=null)return typeof n=="string"?n:String(n)}return String(e)}function D7(e,t,n,o){if(!n?.formula)return n?.values??[];let r=wd(e,t,n.formula);if(!r.sheet||!r.range)return n.values??[];let i=[];for(let a=r.range.start.row;a<=r.range.end.row;a+=1)for(let s=r.range.start.col;s<=r.range.end.col;s+=1){let l=typeof r.sheet.getCalculatedValueAt=="function"?r.sheet.getCalculatedValueAt(a,s):null,c=typeof r.sheet.getFormattedValueAt=="function"?r.sheet.getFormattedValueAt(a,s):l;if(o==="value")i.push(ey(l??c));else{let u=ty(c??l),d=ey(l??c);i.push(u.length>0?u:d!==null?d:null)}}return i}function YN(e,t,n){if(typeof n!="string"||!n)return;let o=wd(e,t,n);if(!o.sheet||!o.range)return n;let r=typeof o.sheet.getFormattedValueAt=="function"?o.sheet.getFormattedValueAt(o.range.start.row,o.range.start.col):null;return ty(r)||n}function md(e){if(!e||typeof e!="object")return null;let t=e,n=Array.isArray(t.numbers)?t.numbers:Array.isArray(t.strings)?t.strings:void 0;return{formula:typeof t.formula=="string"?t.formula:void 0,refType:typeof t.refType=="string"?t.refType:void 0,values:n}}function HI(e){if(!e||typeof e!="object")return null;let t=e,n=t.axis&&typeof t.axis=="object"?t.axis:t,o=n.numberFormat&&typeof n.numberFormat=="object"?n.numberFormat:null;return{crossId:typeof t.crossId=="number"&&Number.isFinite(t.crossId)?t.crossId:void 0,crosses:typeof n.crosses=="string"?n.crosses:void 0,crossBetween:typeof n.crossBetween=="string"?n.crossBetween:void 0,delete:typeof n.delete=="boolean"?n.delete:void 0,id:typeof t.id=="number"&&Number.isFinite(t.id)?t.id:void 0,labelPosition:typeof n.labelPosition=="string"?n.labelPosition:void 0,logBase:typeof n.logBase=="number"?n.logBase:void 0,orientation:typeof n.orientation=="string"?n.orientation:void 0,majorUnit:typeof n.majorUnit=="number"?n.majorUnit:void 0,max:typeof n.maximum=="number"?n.maximum:void 0,min:typeof n.minimum=="number"?n.minimum:void 0,majorGridlines:typeof n.majorGridlines=="boolean"?n.majorGridlines:void 0,majorTickMark:typeof n.majorTickMark=="string"?n.majorTickMark:void 0,minorUnit:typeof n.minorUnit=="number"?n.minorUnit:void 0,minorGridlines:typeof n.minorGridlines=="boolean"?n.minorGridlines:void 0,minorTickMark:typeof n.minorTickMark=="string"?n.minorTickMark:void 0,numberFormat:o?{formatCode:typeof o.formatCode=="string"?o.formatCode:void 0,sourceLinked:typeof o.sourceLinked=="boolean"?o.sourceLinked:void 0}:void 0,position:typeof n.position=="string"?n.position:void 0,raw:n,shapeProperties:n.shapeProperties&&typeof n.shapeProperties=="object"?n.shapeProperties:void 0,tickLabelSkip:typeof n.tickLabelSkip=="number"&&Number.isFinite(n.tickLabelSkip)?n.tickLabelSkip:void 0,tickMarkSkip:typeof n.tickMarkSkip=="number"&&Number.isFinite(n.tickMarkSkip)?n.tickMarkSkip:void 0}}function VI(e,t){return t?{...e??{},...t}:e??null}function Xu(e){if(!e)return null;let t=d1(e,"numFmt"),n=d1(e,"scaling");return{crossId:tn(e,"crossAx"),crosses:d1(e,"crosses")?.getAttribute("val")??void 0,crossBetween:d1(e,"crossBetween")?.getAttribute("val")??void 0,delete:d1(e,"delete")?.getAttribute("val")==="1"?!0:d1(e,"delete")?.getAttribute("val")==="0"?!1:void 0,id:tn(e,"axId"),labelPosition:d1(e,"tickLblPos")?.getAttribute("val")??void 0,logBase:tn(d1(e,"scaling"),"logBase"),orientation:d1(n??e,"orientation")?.getAttribute("val")??void 0,majorGridlines:!!d1(e,"majorGridlines"),majorTickMark:d1(e,"majorTickMark")?.getAttribute("val")??void 0,majorUnit:tn(e,"majorUnit"),max:tn(n,"max"),min:tn(n,"min"),minorGridlines:!!d1(e,"minorGridlines"),minorTickMark:d1(e,"minorTickMark")?.getAttribute("val")??void 0,minorUnit:tn(e,"minorUnit"),numberFormat:t?{formatCode:t.getAttribute("formatCode")??void 0,sourceLinked:t.getAttribute("sourceLinked")==="1"?!0:t.getAttribute("sourceLinked")==="0"?!1:void 0}:void 0,position:d1(e,"axPos")?.getAttribute("val")??void 0,tickLabelSkip:tn(e,"tickLblSkip"),tickMarkSkip:tn(e,"tickMarkSkip")}}function qI(e,t){if(!e)return null;let n=d1(e,"spPr"),o=v4(n,t);return{fillColor:g5(n,t)??void 0,hidden:n?d1(n,"noFill")!=null:void 0,lineColor:o.color??void 0,thickness:tn(e,"thickness")}}function N_(e){if(!e||typeof e!="object")return null;let t=e,n=Array.isArray(t.pointLabels)?(()=>{let o=[];for(let r of t.pointLabels){if(!r||typeof r!="object")continue;let i=r,a=typeof i.index=="number"&&Number.isFinite(i.index)?i.index:null;if(a==null)continue;let s={index:a};typeof i.deleted=="boolean"&&(s.deleted=i.deleted),typeof i.fontSizePt=="number"&&Number.isFinite(i.fontSizePt)&&(s.fontSizePt=i.fontSizePt),typeof i.showBubbleSize=="boolean"&&(s.showBubbleSize=i.showBubbleSize),typeof i.showCategoryName=="boolean"&&(s.showCategoryName=i.showCategoryName),typeof i.showPercent=="boolean"&&(s.showPercent=i.showPercent),typeof i.showSeriesName=="boolean"&&(s.showSeriesName=i.showSeriesName),typeof i.showValue=="boolean"&&(s.showValue=i.showValue),typeof i.x=="number"&&Number.isFinite(i.x)&&(s.x=i.x),typeof i.y=="number"&&Number.isFinite(i.y)&&(s.y=i.y),o.push(s)}return o})():void 0;return{pointLabels:n&&n.length>0?n:void 0,raw:t,showBubbleSize:typeof t.showBubbleSize=="boolean"?t.showBubbleSize:void 0,showCategoryName:typeof(t.showCategoryName??t.visibilityCategoryName)=="boolean"?!!(t.showCategoryName??t.visibilityCategoryName):void 0,showLegendKey:typeof t.showLegendKey=="boolean"?t.showLegendKey:void 0,showPercent:typeof t.showPercent=="boolean"?t.showPercent:void 0,showSeriesName:typeof(t.showSeriesName??t.visibilitySeriesName)=="boolean"?!!(t.showSeriesName??t.visibilitySeriesName):void 0,showValue:typeof(t.showValue??t.visibilityValue)=="boolean"?!!(t.showValue??t.visibilityValue):void 0}}function QK(e){if(!e||typeof e!="object")return{kind:"two-cell",from:{col:0,colOffsetEmu:0,row:0,rowOffsetEmu:0},to:{col:8,colOffsetEmu:0,row:15,rowOffsetEmu:0}};let t=e,n=t.from&&typeof t.from=="object"?t.from:null;if(t.type==="oneCell")return{from:{col:typeof n?.col=="number"?n.col:0,colOffsetEmu:typeof n?.colOffsetEmu=="number"?n.colOffsetEmu:0,row:typeof n?.row=="number"?n.row:0,rowOffsetEmu:typeof n?.rowOffsetEmu=="number"?n.rowOffsetEmu:0},kind:"one-cell",sizeEmu:{cx:typeof t.widthEmu=="number"?t.widthEmu:0,cy:typeof t.heightEmu=="number"?t.heightEmu:0}};if(t.type==="absolute")return{kind:"absolute",positionEmu:{x:typeof t.xEmu=="number"?t.xEmu:0,y:typeof t.yEmu=="number"?t.yEmu:0},sizeEmu:{cx:typeof t.widthEmu=="number"?t.widthEmu:0,cy:typeof t.heightEmu=="number"?t.heightEmu:0}};let o=t.to&&typeof t.to=="object"?t.to:null,r=n?.col,i=n?.colOffsetEmu,a=n?.row,s=n?.rowOffsetEmu,l=o?.col,c=o?.colOffsetEmu,u=o?.row,d=o?.rowOffsetEmu;return{kind:"two-cell",from:{col:typeof r=="number"?r:0,colOffsetEmu:typeof i=="number"?i:0,row:typeof a=="number"?a:0,rowOffsetEmu:typeof s=="number"?s:0},to:{col:typeof l=="number"?l:0,colOffsetEmu:typeof c=="number"?c:0,row:typeof u=="number"?u:0,rowOffsetEmu:typeof d=="number"?d:0}}}function WI(e){if(!e)return null;let t=Number(d1(e,"col")?.textContent??Number.NaN),n=Number(d1(e,"row")?.textContent??Number.NaN),o=Number(d1(e,"colOff")?.textContent??0),r=Number(d1(e,"rowOff")?.textContent??0);return!Number.isFinite(t)||!Number.isFinite(n)?null:{col:Math.max(0,Math.round(t)),colOffsetEmu:Number.isFinite(o)?Math.max(0,Math.round(o)):0,row:Math.max(0,Math.round(n)),rowOffsetEmu:Number.isFinite(r)?Math.max(0,Math.round(r)):0}}function C0e(e){if(e.localName==="twoCellAnchor"){let s=WI(d1(e,"from")),l=WI(d1(e,"to"));return s&&l?{from:s,kind:"two-cell",to:l}:null}if(e.localName==="oneCellAnchor"){let s=WI(d1(e,"from")),l=d1(e,"ext"),c=Number(l?.getAttribute("cx")??Number.NaN),u=Number(l?.getAttribute("cy")??Number.NaN);return s&&Number.isFinite(c)&&Number.isFinite(u)?{from:s,kind:"one-cell",sizeEmu:{cx:Math.max(0,Math.round(c)),cy:Math.max(0,Math.round(u))}}:null}let t=d1(e,"pos"),n=d1(e,"ext"),o=Number(t?.getAttribute("x")??Number.NaN),r=Number(t?.getAttribute("y")??Number.NaN),i=Number(n?.getAttribute("cx")??Number.NaN),a=Number(n?.getAttribute("cy")??Number.NaN);return Number.isFinite(o)&&Number.isFinite(r)&&Number.isFinite(i)&&Number.isFinite(a)?{kind:"absolute",positionEmu:{x:Math.round(o),y:Math.round(r)},sizeEmu:{cx:Math.max(0,Math.round(i)),cy:Math.max(0,Math.round(a))}}:null}function k0e(e){if(e.kind!=="two-cell")return!1;let t=e.to.col<e.from.col||e.to.col===e.from.col&&e.to.colOffsetEmu<=e.from.colOffsetEmu,n=e.to.row<e.from.row||e.to.row===e.from.row&&e.to.rowOffsetEmu<=e.from.rowOffsetEmu;return t||n}function eJ(e,t,n,o,r){let i=o&&typeof o=="object"?o:{},a=md(i.categories),s=md(i.values),l=i.shapeProperties&&typeof i.shapeProperties=="object"?i.shapeProperties:void 0,c=typeof l?.solidFillHex=="string"?v5(l.solidFillHex):null,u=typeof l?.lineColorHex=="string"?v5(l.lineColorHex):null,d=md(i.bubbleSize??i.bubbleSizes??i.bubbles);return{bubbleSizeRef:d,bubbleSizes:D7(e,t,d,"value").map(p=>typeof p=="number"&&Number.isFinite(p)?p:null),categories:D7(e,t,a,"category"),categoriesRef:a,color:c??void 0,dataPoints:Array.isArray(i.dataPoints)?i.dataPoints:[],dataPointStyles:void 0,id:`${n}-series-${r}`,invertIfNegative:typeof i.invertIfNegative=="boolean"?i.invertIfNegative:void 0,lineColor:u??c??void 0,lineWidthPx:typeof l?.lineWidth=="number"?Math.max(1,Number(l.lineWidth)/ZN):void 0,marker:i.marker&&typeof i.marker=="object"?i.marker:void 0,markerColor:void 0,markerLineColor:void 0,markerSize:i.marker&&typeof i.marker=="object"&&typeof i.marker.size=="number"?Number(i.marker.size):void 0,markerSymbol:i.marker&&typeof i.marker=="object"&&typeof i.marker.symbol=="string"?String(i.marker.symbol):void 0,name:YN(e,t,i.name),negativeColor:void 0,negativeLineColor:void 0,raw:i,shapeProperties:l,smooth:typeof i.smooth=="boolean"?i.smooth:void 0,values:D7(e,t,s,"value").map(p=>typeof p=="number"&&Number.isFinite(p)?p:null),valuesRef:s}}function R0e(e,t,n,o,r){if(!o||typeof o!="object")return null;let i=o,a=Array.isArray(i.series)?i.series:[];return{axisIds:Array.isArray(i.axisIds)?i.axisIds.filter(s=>typeof s=="number"&&Number.isFinite(s)):void 0,chartType:typeof i.chartType=="string"?i.chartType:"ColumnClustered",dataLabels:N_(i.dataLabels),gapWidth:typeof i.gapWidth=="number"&&Number.isFinite(i.gapWidth)?i.gapWidth:void 0,is3d:typeof i.is3D=="boolean"?i.is3D:void 0,overlap:typeof i.overlap=="number"&&Number.isFinite(i.overlap)?i.overlap:void 0,raw:i,series:a.map((s,l)=>eJ(e,t,`${n}-group-${r}`,s,l)),varyColors:typeof i.varyColors=="boolean"?i.varyColors:void 0}}function $0e(e,t){let n=e&&typeof e=="object"?e:{};return{chartIds:Array.isArray(n.chartIds)?n.chartIds.filter(o=>typeof o=="string"):[],chartPath:typeof n.chartPath=="string"?n.chartPath:void 0,id:`chartsheet-${t}`,index:t,name:typeof n.name=="string"?n.name:`Chart ${t+1}`,raw:n,workbookSheetIndex:typeof n.workbookSheetIndex=="number"?n.workbookSheetIndex:void 0}}function z0e(e,t,n,o=!1){let r=Array.isArray(e.sheetOrder)?e.sheetOrder:[];return r.length===0?e.sheetNames.flatMap((i,a)=>{let s=e.getSheet(a),l=XX(s.visibility);return!o&&l!=="visible"?[]:[{id:`sheet-${a}`,index:a,kind:"sheet",name:i,sheetIndex:n.get(a)??a,visibility:l,workbookSheetIndex:a}]}):r.flatMap((i,a)=>{let s=typeof i.slotType=="string"?i.slotType:"worksheet",l=typeof i.index=="number"?i.index:a;if(s==="chartsheet"){let d=t[l];return d?[{chartsheetIndex:l,id:`chartsheet-${l}`,index:a,kind:"chartsheet",name:d.name}]:[]}let c=e.getSheet(l),u=XX(c.visibility);return!o&&u!=="visible"?[]:[{id:`sheet-${l}`,index:a,kind:"sheet",name:c.name,sheetIndex:n.get(l)??l,visibility:u,workbookSheetIndex:l}]})}function M0e(e,t){if(!t)return[];let n=[];for(let o of t.attachments){let r=B7(e,o.drawingPath),i=B7(e,o.drawingRelsPath);if(!r||!i)continue;let a=W0(r),s=W0(i);if(!a||!s)continue;let l=new Map;for(let d of U7(s,"Relationship")){let p=d.getAttribute("Id"),m=d.getAttribute("Target"),h=d.getAttribute("Type");p&&m&&l.set(p,{target:GK(o.drawingRelsPath??o.drawingPath,m),type:h})}let c=Array.from(a.documentElement.childNodes).filter(d=>d.nodeType===Node.ELEMENT_NODE&&(d.localName==="twoCellAnchor"||d.localName==="oneCellAnchor"||d.localName==="absoluteAnchor")),u=0;for(let d of c){let p=co(d,"graphicFrame"),m=p?co(p,"chart"):null,h=m?.getAttributeNS("http://schemas.openxmlformats.org/officeDocument/2006/relationships","id")??m?.getAttribute("r:id")??m?.getAttribute("id");if(!h)continue;let S=l.get(h);!S||S.type!==_se&&S.type!==ZX||(n.push({anchorIndex:u,anchor:C0e(d),chartKind:S.type===ZX?"modern":"classic",chartPath:S.target,drawingPath:o.drawingPath,workbookSheetIndex:t.workbookSheetIndex}),u+=1)}}return n}function E0e(e,t,n,o){for(let r=0;r<e.length;r+=1){let i=e[r]??[],a=M0e(n,o[r]??null),s={classic:a.filter(c=>c.chartKind==="classic"),modern:a.filter(c=>c.chartKind==="modern")},l={classic:0,modern:0};i.forEach(c=>{let u=c.id.startsWith("chart-ex-")?"modern":"classic",d=s[u][l[u]];l[u]+=1,d&&((d.anchor&&k0e(c.anchor)||d.anchor&&c.anchor.kind==="two-cell"&&c.anchor.from.col===0&&c.anchor.from.row===0)&&(c.anchor=d.anchor),c.chartPath=d.chartPath??void 0,t.set(c.id,d))})}}function j8(e,t,n,o=!1){let r=new Set,i=Array.from({length:e.sheetCount},(c,u)=>{let d=e.getSheet(u),p=d.charts,m=d.chartsEx,h=n.get(u)??u,S=p.map((g,y)=>{let x=`chart-${u}-${y}`;(g.hidden||!g.anchor)&&r.add(x);let _=g&&typeof g=="object"?g:{},$=_.chart&&typeof _.chart=="object"?_.chart:{},k=$.view3D&&typeof $.view3D=="object"?$.view3D:null,L=Array.isArray($.series)?$.series:[],I=N_($.dataLabels),N=L.length>0&&L[0]&&typeof L[0]=="object"?N_(L[0].dataLabels):null;return{anchor:QK(_.anchor),autoTitleDeleted:typeof $.autoTitleDeleted=="boolean"?$.autoTitleDeleted:void 0,axes:Array.isArray($.axes)?$.axes.map(HI).filter(U=>!!U):[],axisLabelColor:void 0,axisLineColor:void 0,categoryAxis:HI($.categoryAxis),chartAreaBorderColor:void 0,chartAreaFillColor:void 0,chartColorPalette:void 0,chartColorPaletteOffset:void 0,chartPath:void 0,chartStyleId:void 0,chartType:typeof $.chartType=="string"?$.chartType:"ColumnClustered",dataLabels:I??N,displayBlanksAs:typeof $.displayBlanksAs=="string"?$.displayBlanksAs:void 0,editable:!0,firstSliceAngle:typeof $.firstSliceAngle=="number"?$.firstSliceAngle:void 0,fontFamily:void 0,gapWidth:typeof $.gapWidth=="number"?$.gapWidth:void 0,holeSize:typeof $.holeSize=="number"?$.holeSize:void 0,id:x,is3d:typeof $.is3D=="boolean"?$.is3D:void 0,legend:UI($.legend)?{...UI($.legend),position:XN(UI($.legend)?.position)}:null,name:typeof _.name=="string"?_.name:void 0,overlap:typeof $.overlap=="number"?$.overlap:void 0,plotVisibleOnly:typeof $.plotVisibleOnly=="boolean"?$.plotVisibleOnly:void 0,raw:$,radarStyle:typeof $.radarStyle=="string"?$.radarStyle:void 0,scatterStyle:typeof $.scatterStyle=="string"?$.scatterStyle:void 0,roundedCorners:typeof $.roundedCorners=="boolean"?$.roundedCorners:void 0,shape3d:typeof $.shape=="string"?$.shape:typeof $.shape3d=="string"?$.shape3d:void 0,seriesAxis:null,series:L.map((U,z)=>eJ(e,u,x,U,z)),sheetIndex:h,showDlblsOverMax:typeof $.showDlblsOverMax=="boolean"?$.showDlblsOverMax:void 0,sideWall:null,backWall:null,bubbleScale:typeof $.bubbleScale=="number"?$.bubbleScale:void 0,bubble3d:typeof $.bubble3d=="boolean"?$.bubble3d:void 0,floor:null,surfaceMaterial:void 0,textColor:void 0,title:typeof $.title=="string"?$.title:void 0,titleColor:void 0,titleFontFamily:void 0,typeGroups:Array.isArray($.typeGroups)?$.typeGroups.map((U,z)=>R0e(e,u,x,U,z)).filter(U=>U!=null):[],valueAxis:HI($.valueAxis),varyColors:typeof $.varyColors=="boolean"?$.varyColors:void 0,view3d:k?{depthPercent:typeof k.depthPercent=="number"?k.depthPercent:void 0,perspective:typeof k.perspective=="number"?k.perspective:void 0,rAngAx:typeof k.rAngAx=="boolean"?k.rAngAx:typeof k.rightAngleAxes=="boolean"?k.rightAngleAxes:void 0,rotX:typeof k.rotX=="number"?k.rotX:typeof k.rotateX=="number"?k.rotateX:void 0,rotY:typeof k.rotY=="number"?k.rotY:typeof k.rotateY=="number"?k.rotateY:void 0}:void 0,wireframe:typeof $.wireframe=="boolean"?$.wireframe:void 0,workbookSheetIndex:u,zIndex:Array.isArray(_.drawingPath)&&typeof _.drawingPath[0]=="number"?_.drawingPath[0]+1:y+1}}),v=m.map((g,y)=>{let x=`chart-ex-${u}-${y}`;return(g.hidden||!g.anchor)&&r.add(x),P0e(e,u,h,g,y,t?.themePalette??null)});return[...S,...v]}),a=Array.isArray(e.chartsheets)?e.chartsheets.map((c,u)=>$0e(c,u)):[],s=z0e(e,a,n,o),l=new Map;if(t){E0e(i,l,t.archive,t.sheetOrigins);for(let c=0;c<i.length;c+=1)i[c]=(i[c]??[]).filter(u=>!r.has(u.id));for(let c of r)l.delete(c);for(let c of i)for(let u of c)a0e(u,u.chartPath,t.archive,t.themePalette),fd(u,t.themePalette)}else{for(let c=0;c<i.length;c+=1)i[c]=(i[c]??[]).filter(u=>!r.has(u.id));for(let c of i)for(let u of c)fd(u,null)}return{chartOriginsById:l,chartsByWorkbookSheetIndex:i,chartsheets:a,tabs:s}}function T0e(e){return Array.from(e.documentElement.childNodes).filter(t=>t.nodeType===Node.ELEMENT_NODE&&(t.localName==="twoCellAnchor"||t.localName==="oneCellAnchor"||t.localName==="absoluteAnchor")).filter(t=>{let n=d1(t,"graphicFrame");return!!(n&&co(n,"chart"))})}function GI(e,t){e&&(A7(e,"col",String(Math.max(0,Math.round(t.col)))),A7(e,"colOff",String(Math.max(0,Math.round(t.colOffsetEmu)))),A7(e,"row",String(Math.max(0,Math.round(t.row)))),A7(e,"rowOff",String(Math.max(0,Math.round(t.rowOffsetEmu)))))}function A0e(e,t){if(t.kind==="two-cell"){GI(d1(e,"from"),t.from),GI(d1(e,"to"),t.to);return}if(t.kind==="one-cell"){GI(d1(e,"from"),t.from);let r=d1(e,"ext");r&&(r.setAttribute("cx",String(Math.max(0,Math.round(t.sizeEmu.cx)))),r.setAttribute("cy",String(Math.max(0,Math.round(t.sizeEmu.cy)))));return}let n=d1(e,"pos");n&&(n.setAttribute("x",String(Math.max(0,Math.round(t.positionEmu.x)))),n.setAttribute("y",String(Math.max(0,Math.round(t.positionEmu.y)))));let o=d1(e,"ext");o&&(o.setAttribute("cx",String(Math.max(0,Math.round(t.sizeEmu.cx)))),o.setAttribute("cy",String(Math.max(0,Math.round(t.sizeEmu.cy)))))}function I0e(e,t){let n=d1(e,"title");if(!t){n?.remove();return}let o=n??e.insertBefore(e.ownerDocument.createElementNS(q8,"c:title"),e.firstChild);for(;o.firstChild;)o.removeChild(o.firstChild);let r=o.ownerDocument.createElementNS(q8,"c:tx"),i=o.ownerDocument.createElementNS(q8,"c:rich"),a=o.ownerDocument.createElementNS(Lg,"a:bodyPr"),s=o.ownerDocument.createElementNS(Lg,"a:lstStyle"),l=o.ownerDocument.createElementNS(Lg,"a:p"),c=o.ownerDocument.createElementNS(Lg,"a:r"),u=o.ownerDocument.createElementNS(Lg,"a:t");u.textContent=t,c.appendChild(u),l.appendChild(c),i.append(a,s,l),r.appendChild(i),o.appendChild(r)}function ZI(e,t,n){if(!n){RN(e,t);return}let o=H3(e,t);A7(o,"f",n)}function N0e(e,t){let n=t.raw&&typeof t.raw=="object"?t.raw:null,o=typeof n?.name=="string"&&n.name.length>0?n.name:void 0;if(!o&&t.name===void 0)return;let r=H3(e,"tx");if(RN(r,"strRef"),RN(r,"v"),o){let i=H3(r,"strRef");A7(i,"f",o);return}A7(r,"v",t.name??"")}function O0e(e,t){if(!t.series)return;let n=U7(e,"ser");t.series.forEach((o,r)=>{let i=n[r];if(i){if(N0e(i,o),o.categoriesRef?.formula){let a=d1(i,"xVal")??d1(i,"cat")??(t.chartType==="Scatter"||t.chartType==="ScatterLines"||t.chartType==="ScatterSmooth"||t.chartType==="Bubble"?H3(i,"xVal"):H3(i,"cat")),s=a.localName==="xVal"||d1(a,"numRef")?"numRef":"strRef";ZI(a,s,o.categoriesRef.formula)}if(o.valuesRef?.formula){let a=d1(i,"yVal")??d1(i,"val")??(t.chartType==="Scatter"||t.chartType==="ScatterLines"||t.chartType==="ScatterSmooth"||t.chartType==="Bubble"?H3(i,"yVal"):H3(i,"val"));ZI(a,"numRef",o.valuesRef.formula)}if(o.bubbleSizeRef){let a=d1(i,"bubbleSize")??H3(i,"bubbleSize");ZI(a,"numRef",o.bubbleSizeRef.formula)}o.invertIfNegative!==void 0&&v3(i,"invertIfNegative",o.invertIfNegative),o.smooth!==void 0&&v3(i,"smooth",o.smooth)}})}function oY(e,t){if(!(!e||!t)){if(t.position&&(A7(H3(e,"axPos"),"val",t.position),d1(e,"axPos")?.setAttribute("val",t.position)),t.majorGridlines!==void 0){let n=d1(e,"majorGridlines");t.majorGridlines&&!n?e.appendChild(e.ownerDocument.createElementNS(q8,"c:majorGridlines")):t.majorGridlines||n?.remove()}if(t.minorGridlines!==void 0){let n=d1(e,"minorGridlines");t.minorGridlines&&!n?e.appendChild(e.ownerDocument.createElementNS(q8,"c:minorGridlines")):t.minorGridlines||n?.remove()}if(t.majorTickMark&&(d1(e,"majorTickMark")?.setAttribute("val",t.majorTickMark)??v3(e,"majorTickMark",!1).setAttribute("val",t.majorTickMark)),t.minorTickMark&&(d1(e,"minorTickMark")?.setAttribute("val",t.minorTickMark)??v3(e,"minorTickMark",!1).setAttribute("val",t.minorTickMark)),t.labelPosition&&(d1(e,"tickLblPos")?.setAttribute("val",t.labelPosition)??v3(e,"tickLblPos",!1).setAttribute("val",t.labelPosition)),t.crosses&&(d1(e,"crosses")?.setAttribute("val",t.crosses)??v3(e,"crosses",!1).setAttribute("val",t.crosses)),t.crossBetween&&(d1(e,"crossBetween")?.setAttribute("val",t.crossBetween)??v3(e,"crossBetween",!1).setAttribute("val",t.crossBetween)),t.delete!==void 0&&v3(e,"delete",t.delete),t.numberFormat?.formatCode){let n=H3(e,"numFmt");n.setAttribute("formatCode",t.numberFormat.formatCode),t.numberFormat.sourceLinked!==void 0&&n.setAttribute("sourceLinked",t.numberFormat.sourceLinked?"1":"0")}}}function L0e(e,t){if(!t)return;let n=H3(e,"dLbls");t.showLegendKey!==void 0&&v3(n,"showLegendKey",t.showLegendKey),t.showValue!==void 0&&v3(n,"showVal",t.showValue),t.showCategoryName!==void 0&&v3(n,"showCatName",t.showCategoryName),t.showSeriesName!==void 0&&v3(n,"showSerName",t.showSeriesName),t.showPercent!==void 0&&v3(n,"showPercent",t.showPercent),t.showBubbleSize!==void 0&&v3(n,"showBubbleSize",t.showBubbleSize)}function iY(e,t,n,o){let r=t.chartOriginsById.get(n);if(!r)return!1;let i=B7(e.archive,r.drawingPath);if(!i)return!1;let a=W0(i);if(!a)return!1;let s=T0e(a)[r.anchorIndex];return s?(A0e(s,o),e.archive[q0(r.drawingPath)]=h4(ZK(a)),e.dirtyArchivePaths.add(q0(r.drawingPath)),!0):!1}function D0e(e,t,n,o){let r=t.chartOriginsById.get(n);if(!r?.chartPath)return!1;let i=B7(e.archive,r.chartPath);if(!i)return!1;let a=W0(i);if(!a)return!1;let s=co(a,"chart"),l=s?d1(s,"plotArea"):null,c=qK(l);return!s||!l||!c?!1:(o.title!==void 0&&I0e(s,o.title),o.displayBlanksAs&&H3(s,"dispBlanksAs").setAttribute("val",o.displayBlanksAs),o.roundedCorners!==void 0&&v3(s,"roundedCorners",o.roundedCorners),o.showDlblsOverMax!==void 0&&v3(s,"showDLblsOverMax",o.showDlblsOverMax),o.varyColors!==void 0&&v3(c,"varyColors",o.varyColors),o.gapWidth!==void 0&&s0e(c,"gapWidth",o.gapWidth),o.overlap!==void 0&&H3(c,"overlap").setAttribute("val",String(Math.round(o.overlap))),o.dataLabels&&L0e(c,o.dataLabels),O0e(l,o),oY(Wr(l,"catAx")[0]??Wr(l,"dateAx")[0]??Wr(l,"serAx")[0]??null,o.categoryAxis),oY(Wr(l,"valAx")[0]??null,o.valueAxis),e.archive[q0(r.chartPath)]=h4(ZK(a)),e.dirtyArchivePaths.add(q0(r.chartPath)),!0)}function KN(e){let t=e.replace(/^#/,"");return t.length===8?`#${t.slice(2).toLowerCase()}`:t.length===6?`#${t.toLowerCase()}`:null}function B0e(e){let t=KN(e),n=t?/^#([0-9a-f]{6})$/.exec(t):null;if(!n)return null;let o=n[1];return[Number.parseInt(o.slice(0,2),16),Number.parseInt(o.slice(2,4),16),Number.parseInt(o.slice(4,6),16)]}function j0e(e,t,n){let o=e/255,r=t/255,i=n/255,a=Math.max(o,r,i),s=Math.min(o,r,i),l=(a+s)/2;if(a===s)return[0,0,l];let c=a-s,u=l>.5?c/(2-a-s):c/(a+s),d=0;switch(a){case o:d=(r-i)/c+(r<i?6:0);break;case r:d=(i-o)/c+2;break;default:d=(o-r)/c+4;break}return[d/6,u,l]}function XI(e,t,n){let o=n;return o<0&&(o+=1),o>1&&(o-=1),o<1/6?e+(t-e)*6*o:o<1/2?t:o<2/3?e+(t-e)*(2/3-o)*6:e}function U0e(e,t,n){if(t===0){let i=Math.round(n*255);return[i,i,i]}let o=n<.5?n*(1+t):n+t-n*t,r=2*n-o;return[Math.round(XI(r,o,e+1/3)*255),Math.round(XI(r,o,e)*255),Math.round(XI(r,o,e-1/3)*255)]}function F0e(e,t,n){return`#${[e,t,n].map(o=>Math.max(0,Math.min(255,o)).toString(16).padStart(2,"0")).join("")}`}function H0e(e,t){let n=B0e(e);if(!n||!Number.isFinite(t)||t===0)return KN(e);let[o,r,i]=j0e(n[0],n[1],n[2]),a=t<0?i*(1+t):i*(1-t)+t,[s,l,c]=U0e(o,r,Math.max(0,Math.min(1,a)));return F0e(s,l,c)}function zr(e,t){if(!e)return null;let n=["hex","rgb","argb"].map(l=>e[l]).find(l=>typeof l=="string"&&l.trim().length>0);if(n)return KN(n);let o=e.theme,r=typeof o=="number"?o:typeof o=="string"&&o.trim().length>0?Number(o):Number.NaN,i=Number.isFinite(r)?t?.colorsByIndex[r]??null:null;if(!i)return null;let a=e.tint,s=typeof a=="number"?a:typeof a=="string"&&a.trim().length>0?Number(a):Number.NaN;return Number.isFinite(s)?H0e(i,s):i}function V0e(e,t){return e?e.fillType==="solid"?zr(e.color??e.foreground??e.background,t):e.fillType==="pattern"?zr(e.foreground??e.color??e.background,t):null:null}function tJ(e,t){if(!e)return{backgroundColor:null,backgroundImage:null};if(e.fillType==="gradient"){let o=(Array.isArray(e.stops)?e.stops:[]).map(r=>({color:zr(r.color,t),position:typeof r.position=="number"?r.position:Number(r.position)})).filter(r=>!!r.color&&Number.isFinite(r.position)).sort((r,i)=>r.position-i.position);if(o.length>0){if((typeof e.gradientType=="string"?e.gradientType:"linear")==="path")return{backgroundColor:o[o.length-1]?.color??null,backgroundImage:`radial-gradient(circle at center, ${o.map(l=>`${l.color} ${Math.max(0,Math.min(100,l.position*100))}%`).join(", ")})`};let i=typeof e.degree=="number"?e.degree:Number(e.degree??0),a=Number.isFinite(i)?90-i:90;return{backgroundColor:o[o.length-1]?.color??null,backgroundImage:`linear-gradient(${a}deg, ${o.map(s=>`${s.color} ${Math.max(0,Math.min(100,s.position*100))}%`).join(", ")})`}}}return{backgroundColor:V0e(e,t),backgroundImage:null}}var JN="http://schemas.openxmlformats.org/officeDocument/2006/relationships",nJ="http://schemas.openxmlformats.org/package/2006/relationships",rJ="http://schemas.openxmlformats.org/spreadsheetml/2006/main",$N="http://schemas.openxmlformats.org/package/2006/content-types",QN="http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",q0e="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",W0e="application/vnd.openxmlformats-officedocument.drawing+xml",vd=9525,zN=30,ny=16,oJ=64*vd,iJ=20*vd,O_=7,aY=new Map;function aJ(){if(typeof window>"u")return 1;let e=window.devicePixelRatio;return!Number.isFinite(e)||e<=0?1:1/e}function G0e(e,t){let n=typeof e=="string"&&e.trim().length>0?e.trim():"Calibri",o=typeof t=="number"&&Number.isFinite(t)&&t>0?t:11,r=`${n}|${o}`,i=aY.get(r);if(i!==void 0)return i;let s=`${o*(96/72)}px "${n}"`,l=O_;try{let c=typeof document<"u"?document.createElement("canvas").getContext("2d"):typeof OffscreenCanvas<"u"?new OffscreenCanvas(32,32).getContext("2d"):null;c&&(c.font=s,l=Math.max(1,c.measureText("0").width))}catch{l=O_}return aY.set(r,l),l}function ry(e,t=O_){if(!Number.isFinite(e)||e<=0)return zN;let n=Math.max(1,t),o=e<1?Math.floor(e*(n+5)+.5):Math.floor((256*e+Math.floor(128/n))/256*n);return Math.max(zN,o)}function Z0e(e,t=O_,n=ry(8.43,t)){let o=typeof e.defaultColumnWidth=="number"?e.defaultColumnWidth:Number.NaN;return Number.isFinite(o)&&o>0?ry(o,t):n}function X0e(e,t=Math.max(ny,Math.round(15*1.33))){let n=typeof e.defaultRowHeight=="number"?e.defaultRowHeight:Number.NaN;return Number.isFinite(n)&&n>0?Math.max(ny,Math.round(n*1.33)):t}function Y0e(e,t){if(!Number.isFinite(t)||t<0||typeof e.isRowHidden!="function")return[];let n=[];for(let o=0;o<=t;o+=1)e.isRowHidden(o)&&n.push(o);return n}function K0e(e,t){if(!Number.isFinite(t)||t<0||typeof e.isColumnHidden!="function")return[];let n=[];for(let o=0;o<=t;o+=1)e.isColumnHidden(o)&&n.push(o);return n}function J0e(e){let t={hasHorizontalMerges:!1,hasVerticalMerges:!1,maxHorizontalMergeEndCol:-1,maxVerticalMergeEndRow:-1},n=Array.isArray(e.mergedRegions)?e.mergedRegions:[];for(let o of n){let r=null;if(typeof o=="string")r=B_(o);else if(o&&typeof o=="object"){let i=o,a=typeof i.startRow=="number"?i.startRow:Number.NaN,s=typeof i.startCol=="number"?i.startCol:Number.NaN,l=typeof i.endRow=="number"?i.endRow:Number.NaN,c=typeof i.endCol=="number"?i.endCol:Number.NaN;[a,s,l,c].every(u=>Number.isFinite(u)&&u>=0)?r={end:{col:Math.max(s,c),row:Math.max(a,l)},start:{col:Math.min(s,c),row:Math.min(a,l)}}:typeof i.range=="string"&&(r=B_(i.range))}r&&(r.end.col>r.start.col&&(t.hasHorizontalMerges=!0,t.maxHorizontalMergeEndCol=Math.max(t.maxHorizontalMergeEndCol,r.end.col)),r.end.row>r.start.row&&(t.hasVerticalMerges=!0,t.maxVerticalMergeEndRow=Math.max(t.maxVerticalMergeEndRow,r.end.row)))}return t}function Q0e(e){let t=["lt1","dk1","lt2","dk2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],n={};return t.forEach((o,r)=>{let i=e.colors.get(o);i&&(n[r]=i)}),{colorsByIndex:n,majorLatinFont:e.majorLatinFont??void 0,minorLatinFont:e.minorLatinFont??void 0}}function E7(e){let t=new Uint8Array(e.byteLength);return t.set(e),t}function za(e){return e.replace(/\\/g,"/").replace(/^\/+/,"")}function e6e(...e){return za(e.join("/"))}function eO(e){let t=za(e),n=t.lastIndexOf("/");return n>=0?t.slice(0,n):""}function t6e(e,t){if(!t)return za(e);if(t.startsWith("#"))return t;if(t.startsWith("/"))return za(t);let n=eO(e).split("/").filter(Boolean);for(let o of t.split("/"))if(!(!o||o===".")){if(o===".."){n.pop();continue}n.push(o)}return za(n.join("/"))}function n6e(e,t){let n=eO(e).split("/").filter(Boolean),o=za(t).split("/").filter(Boolean),r=0;for(;r<n.length&&r<o.length&&n[r]===o[r];)r+=1;let i=n.slice(r).map(()=>".."),a=o.slice(r);return[...i,...a].join("/")||"."}function L_(e){let t=e.split("/").pop(),n=eO(e);return e6e(n,"_rels",`${t}.rels`)}function vi(e){let n=new DOMParser().parseFromString(e,"application/xml");return n.querySelector("parsererror")?null:n}function R_(e){return new XMLSerializer().serializeToString(e)}function Ea(e,t){let n=e[t];return n?T0(n):null}function r6e(e){let t=0;for(let n of e.toUpperCase()){if(n<"A"||n>"Z")return null;t=t*26+(n.charCodeAt(0)-64)}return t>0?t-1:null}function D_(e){let t=/^\$?([A-Za-z]+)\$?(\d+)$/.exec(e.trim());if(!t)return null;let n=r6e(t[1]??""),o=Number(t[2]??Number.NaN)-1;return n===null||!Number.isFinite(o)||o<0?null:{col:n,row:o}}function B_(e){let[t,n]=e.split(":"),o=D_(t??""),r=D_(n??t??"");return o&&r?{end:r,start:o}:null}function sJ(e){let t=e.trim(),n=t.lastIndexOf("!");return n>=0?t.slice(n+1):t}function o6e(e){let t=sJ(e).split(/\s+/)[0]??"";return D_(t)}function i6e(e){return B_(sJ(e))}function Ki(e){return!!(e&&e.nodeType===1)}function lr(e,t){return Array.from(e.getElementsByTagName("*")).filter(n=>Ki(n)&&n.localName===t)}function sr(e,t){return Array.from(e.childNodes).filter(n=>Ki(n)&&n.localName===t)}function P1(e,t){return sr(e,t)[0]??null}function $r(e,t){return lr(e,t)[0]??null}function a6e(e){let t=Ea(e,"xl/featurePropertyBag/featurePropertyBag.xml");if(!t)return new Set;let n=vi(t);if(!n?.documentElement)return new Set;let o=sr(n.documentElement,"bag"),r=o.map(l=>l.getAttribute("type")??""),i=new Set,a=o.find(l=>l.getAttribute("type")==="XFComplements")??null;return(a?lr(a,"bagId").map(l=>Number(l.textContent??Number.NaN)).filter(l=>Number.isFinite(l)):[]).forEach((l,c)=>{let u=o[l];if(!u||r[l]!=="XFComplement")return;let d=lr(u,"bagId").map(h=>Number(h.textContent??Number.NaN)).find(h=>Number.isFinite(h));if(d===void 0)return;let p=o[d];if(!p||r[d]!=="XFControls")return;let m=lr(p,"bagId").map(h=>Number(h.textContent??Number.NaN)).find(h=>Number.isFinite(h));m!==void 0&&r[m]==="Checkbox"&&i.add(c)}),i}function lJ(e){return e.getAttributeNS(JN,"id")??e.getAttribute("r:id")??e.getAttribute("id")}function sY(e){return e.getAttributeNS(JN,"embed")??e.getAttribute("r:embed")??e.getAttribute("embed")}function p_(e,t,n){let o=P1(e,t);o&&(o.textContent=n)}function YI(e,t){e&&(p_(e,"col",String(Math.max(0,t.col))),p_(e,"colOff",String(Math.max(0,Math.round(t.colOffsetEmu)))),p_(e,"row",String(Math.max(0,t.row))),p_(e,"rowOff",String(Math.max(0,Math.round(t.rowOffsetEmu)))))}function s6e(e){let t=Ea(e,"[Content_Types].xml"),n=new Map,o=new Map;if(!t)return{defaultEntries:n,overrideEntries:o};let r=vi(t);if(!r)return{defaultEntries:n,overrideEntries:o};for(let i of lr(r,"Default")){let a=i.getAttribute("Extension"),s=i.getAttribute("ContentType");a&&s&&n.set(a.toLowerCase(),s)}for(let i of lr(r,"Override")){let a=i.getAttribute("PartName"),s=i.getAttribute("ContentType");a&&s&&o.set(za(a),s)}return{defaultEntries:n,overrideEntries:o}}function lY(e,t){let n=za(t),o=e.overrideEntries.get(n);if(o)return o;let r=n.split(".").pop()?.toLowerCase();return r?e.defaultEntries.get(r)??"application/octet-stream":"application/octet-stream"}function tO(e,t,n){let o=Ea(e,t),r=new Map;if(!o)return r;let i=vi(o);if(!i)return r;for(let a of lr(i,"Relationship")){let s=a.getAttribute("Id"),l=a.getAttribute("Target"),c=a.getAttribute("Type");!s||!l||!c||r.set(s,{id:s,target:t6e(n,l),targetMode:a.getAttribute("TargetMode"),type:c})}return r}function cJ(e){let t=Ea(e,"xl/workbook.xml");if(!t)return[];let n=vi(t);if(!n)return[];let o=tO(e,"xl/_rels/workbook.xml.rels","xl/workbook.xml"),r=[];for(let i of lr(n,"sheet")){let a=lJ(i);if(!a)continue;let s=o.get(a);s&&r.push({name:i.getAttribute("name")??`Sheet ${r.length+1}`,path:s.target})}return r}function l6e(e){let t={colors:new Map([["accent1","#5b9bd5"],["accent2","#ed7d31"],["accent3","#a5a5a5"],["accent4","#ffc000"],["accent5","#4472c4"],["accent6","#70ad47"],["bg1","#ffffff"],["bg2","#e7e6e6"],["dk1","#000000"],["dk2","#6e747a"],["folHlink","#993366"],["hlink","#085296"],["lt1","#ffffff"],["lt2","#e7e6e6"],["tx1","#000000"],["tx2","#6e747a"]]),majorLatinFont:null,minorLatinFont:null},n=Ea(e,"xl/theme/theme1.xml");if(!n)return t;let o=vi(n);if(!o)return t;let r=new Map(t.colors),i=lr(o,"clrScheme")[0]??null;if(i)for(let c of Array.from(i.childNodes).filter(Ki)){let u=c.localName,d=P1(c,"srgbClr"),p=P1(c,"sysClr"),m=d?.getAttribute("val")??p?.getAttribute("lastClr");m&&r.set(u,oy(m))}let a=lr(o,"fontScheme")[0]??null,s=P1(P1(a,"majorFont"),"latin")?.getAttribute("typeface")??null,l=P1(P1(a,"minorFont"),"latin")?.getAttribute("typeface")??null;return r.set("bg1",r.get("lt1")??t.colors.get("bg1")??"#ffffff"),r.set("tx1",r.get("dk1")??t.colors.get("tx1")??"#000000"),r.set("bg2",r.get("lt2")??t.colors.get("bg2")??"#e7e6e6"),r.set("tx2",r.get("dk2")??t.colors.get("tx2")??"#6e747a"),{colors:r,majorLatinFont:s,minorLatinFont:l}}function So(e){if(!e)return;let t={},n=e.getAttribute("rgb"),o=e.getAttribute("theme"),r=e.getAttribute("tint"),i=e.getAttribute("indexed");return n&&(t.rgb=oy(n)),o!==null&&(t.theme=Number(o)),r!==null&&(t.tint=Number(r)),i!==null&&(t.indexed=Number(i)),Object.keys(t).length>0?t:void 0}function j0(e){if(!e)return!1;let t=e.getAttribute("val");return t===null||t!=="0"&&t!=="false"}function c6e(e,t){let n=[];for(let o of lr(e,"sparklineGroup")){let r=o.getAttribute("type"),i=r==="column"?"column":r==="stacked"?"winLoss":"line",a=P1(o,"markers"),s=P1(o,"negative"),l=zr(So(P1(o,"colorSeries")),t),c=zr(So(P1(o,"colorNegative")),t),u=zr(So(P1(o,"colorMarkers")),t),d=zr(So(P1(o,"colorFirst")),t),p=zr(So(P1(o,"colorLast")),t),m=zr(So(P1(o,"colorHigh")),t),h=zr(So(P1(o,"colorLow")),t),S=P1(o,"sparklines");if(S)for(let v of sr(S,"sparkline")){let g=P1(v,"f")?.textContent??"",y=P1(v,"sqref")?.textContent??"",x=i6e(g),_=o6e(y);!x||!_||n.push({color:l??void 0,firstColor:d??void 0,highColor:m??void 0,lastColor:p??void 0,lowColor:h??void 0,markerColor:u??void 0,markers:j0(a),negative:j0(s),negativeColor:c??void 0,range:x,target:_,type:i})}}return n}function uJ(e){if(!e)return;let t={},n=P1(e,"sz")?.getAttribute("val"),o=P1(e,"name")?.getAttribute("val"),r=P1(e,"family")?.getAttribute("val"),i=P1(e,"scheme")?.getAttribute("val"),a=P1(e,"charset")?.getAttribute("val"),s=P1(e,"vertAlign")?.getAttribute("val"),l=So(P1(e,"color"));return j0(P1(e,"b"))&&(t.bold=!0),j0(P1(e,"i"))&&(t.italic=!0),j0(P1(e,"strike"))&&(t.strikethrough=!0),P1(e,"u")&&(t.underline=P1(e,"u")?.getAttribute("val")??"single"),n!=null&&(t.size=Number(n)),o&&(t.name=o),r!=null&&(t.family=Number(r)),i&&(t.scheme=i),a!=null&&(t.charset=Number(a)),s&&(t.verticalAlign=s),j0(P1(e,"shadow"))&&(t.shadow=!0),j0(P1(e,"outline"))&&(t.outline=!0),j0(P1(e,"condense"))&&(t.condense=!0),j0(P1(e,"extend"))&&(t.extend=!0),l&&(t.color=l),Object.keys(t).length>0?t:void 0}function dJ(e){if(!e)return;let t=P1(e,"gradientFill");if(t){let s=Array.from(t.childNodes).filter(Ki).filter(l=>l.localName==="stop").map(l=>({color:So(Array.from(l.childNodes).find(Ki)??null),position:Number(l.getAttribute("position")??Number.NaN)})).filter(l=>l.color&&Number.isFinite(l.position));if(s.length>0)return{degree:Number(t.getAttribute("degree")??0),fillType:"gradient",gradientType:t.getAttribute("type")??"linear",stops:s}}let n=P1(e,"patternFill");if(!n)return;let o=n.getAttribute("patternType")??"none",r=So(P1(n,"fgColor")),i=So(P1(n,"bgColor")),a=r??i;if(o==="solid"&&a)return{color:a,fillType:"solid"};if((o==="none"||o==="gray125")&&(r||i))return{background:i,fillType:"pattern",foreground:r,patternType:o};if(o!=="none"&&o!=="gray125"&&(r||i))return{background:i,fillType:"pattern",foreground:r,patternType:o}}function u6e(e){if(!e)return;let t=e.getAttribute("style"),n=So(P1(e,"color"));if(!(!t||t==="none"))return{color:n,style:t}}function pJ(e){if(!e)return;let t={};return["top","right","bottom","left","horizontal","vertical"].forEach(n=>{let o=u6e(P1(e,n));o&&(t[n]=o)}),Object.keys(t).length>0?t:void 0}function fJ(e){if(!e)return;let t={},n=e.getAttribute("horizontal"),o=e.getAttribute("vertical"),r=e.getAttribute("wrapText"),i=e.getAttribute("indent"),a=e.getAttribute("shrinkToFit"),s=e.getAttribute("textRotation");if(n&&(t.horizontal=n),o&&(t.vertical=o),r!==null&&(t.wrapText=r==="1"),a!==null&&(t.shrinkToFit=a==="1"),i!==null&&(t.indent=Number(i)),s!==null){let l=Number(s);Number.isFinite(l)&&(t.textRotation=l)}return Object.keys(t).length>0?t:void 0}function d6e(e){if(!e)return{};let t={},n=uJ(P1(e,"font")),o=dJ(P1(e,"fill")),r=pJ(P1(e,"border")),i=fJ(P1(e,"alignment"));return n&&(t.font=n),o&&(t.fill=o),r&&(t.border=r),i&&(t.alignment=i),t}function cY(e,t,n,o,r){let i={},a=Number(e.getAttribute("fontId")??Number.NaN),s=Number(e.getAttribute("fillId")??Number.NaN),l=Number(e.getAttribute("borderId")??Number.NaN),c=fJ(P1(e,"alignment"));Number.isFinite(a)&&t[a]&&(i.font=t[a]),Number.isFinite(s)&&n[s]&&(i.fill=n[s]),Number.isFinite(l)&&o[l]&&(i.border=o[l]),c&&(i.alignment=c);let u=$r(e,"xfComplement"),d=Number(u?.getAttribute("i")??Number.NaN);return Number.isFinite(d)&&r?.has(d)&&(i.cellControl={kind:"checkbox"}),i}function p6e(e){let t=Ea(e,"xl/styles.xml");if(!t)return{defaultFont:null,namedCellStyleByName:{},styleById:{},tableStyleByName:{}};let n=vi(t);if(!n)return{defaultFont:null,namedCellStyleByName:{},styleById:{},tableStyleByName:{}};let o=$r(n,"fonts"),r=$r(n,"fills"),i=$r(n,"borders"),a=$r(n,"cellStyleXfs"),s=$r(n,"cellStyles"),l=$r(n,"cellXfs"),c=$r(n,"dxfs"),u=$r(n,"tableStyles");if(!l)return{defaultFont:null,namedCellStyleByName:{},styleById:{},tableStyleByName:{}};let d=a6e(e),p=sr(o??n.documentElement,"font").map(k=>uJ(k)),m=sr(r??n.documentElement,"fill").map(k=>dJ(k)),h=sr(i??n.documentElement,"border").map(k=>pJ(k)),S=sr(c??n.documentElement,"dxf").map(k=>d6e(k)),v=sr(a??n.documentElement,"xf").map(k=>cY(k,p,m,h,d)),g={},y={},x={};sr(l,"xf").forEach((k,L)=>{y[L]=cY(k,p,m,h,d)}),sr(s??n.documentElement,"cellStyle").forEach(k=>{let L=k.getAttribute("name"),I=Number(k.getAttribute("xfId")??Number.NaN);if(!L||!Number.isFinite(I))return;let N=v[I];N&&(g[L]=N)}),sr(u??n.documentElement,"tableStyle").forEach(k=>{let L=k.getAttribute("name");if(!L)return;let I={};sr(k,"tableStyleElement").forEach(N=>{let U=N.getAttribute("type"),z=Number(N.getAttribute("dxfId")??Number.NaN);if(!U||!Number.isFinite(z))return;let Z=S[z];Z&&(I[U]=Z)}),x[L]=I});let _=g.Normal?.font??y[0]?.font??p[0];return{defaultFont:_?{family:typeof _.name=="string"?_.name:void 0,sizePt:typeof _.size=="number"?_.size:void 0}:null,namedCellStyleByName:g,styleById:y,tableStyleByName:x}}function uY(e){return e?e.trim().split(/\s+/).flatMap(t=>{let n=B_(t);return n?[n]:[]}):[]}function Kg(e){if(!e)return null;let t=e.getAttribute("type");if(!t)return null;let n=e.getAttribute("val")??P1(e,"f")?.textContent??void 0,o=n!==void 0?Number(n):Number.NaN;return{type:t,value:Number.isFinite(o)?o:void 0}}function T7(e,t){if(!e)return;let n=e.getAttribute(t);if(n!==null)return n!=="0"&&n!=="false"}function f6e(e,t){let n=e.getAttribute("type"),o=Number(e.getAttribute("priority")??Number.NaN),r=Number.isFinite(o)?o:Number.MAX_SAFE_INTEGER;if(n==="colorScale"){let i=P1(e,"colorScale");if(!i)return null;let a=sr(i,"cfvo").map(l=>Kg(l)).filter(l=>!!l),s=sr(i,"color").map(l=>So(l)).filter(l=>!!l);return a.length===0||s.length===0?null:{cfvos:a,colors:s,kind:"colorScale",priority:r,ranges:t}}if(n==="dataBar"){let i=P1(e,"dataBar");if(!i)return null;let a=sr(i,"cfvo").map(l=>Kg(l)).filter(l=>!!l);if(a.length===0)return null;let s=$r(e,"id")?.textContent?.trim()||void 0;return{cfvos:a,color:So(P1(i,"color")),kind:"dataBar",priority:r,ranges:t,id:s}}if(n==="iconSet"){let i=P1(e,"iconSet");if(!i)return null;let a=i.getAttribute("iconSet"),s=sr(i,"cfvo").map(l=>Kg(l)).filter(l=>!!l);return!a||s.length===0?null:{cfvos:s,icons:s.map((l,c)=>({iconId:c,iconSet:a})),kind:"iconSet",priority:r,ranges:t,reverse:T7(i,"reverse"),showValue:T7(i,"showValue")}}return null}function m6e(e,t){let n=e.getAttribute("type"),o=e.getAttribute("id")??void 0,r=Number(e.getAttribute("priority")??Number.NaN),i=Number.isFinite(r)?r:Number.MAX_SAFE_INTEGER;if(n==="dataBar"){let a=P1(e,"dataBar");if(!a)return null;let s=sr(a,"cfvo").map(l=>Kg(l)).filter(l=>!!l);return s.length===0?null:{axisColor:So(P1(a,"axisColor")),border:T7(a,"border"),borderColor:So(P1(a,"borderColor")),cfvos:s,color:So(P1(a,"fillColor")),gradient:T7(a,"gradient"),kind:"dataBar",maxLength:Number(a.getAttribute("maxLength")??Number.NaN),minLength:Number(a.getAttribute("minLength")??Number.NaN),negativeBarBorderColorSameAsPositive:T7(a,"negativeBarBorderColorSameAsPositive"),negativeBorderColor:So(P1(a,"negativeBorderColor")),negativeFillColor:So(P1(a,"negativeFillColor")),priority:i,ranges:t,showValue:T7(a,"showValue"),id:o}}if(n==="iconSet"){let a=P1(e,"iconSet");if(!a)return null;let s=sr(a,"cfvo").map(c=>Kg(c)).filter(c=>!!c),l=sr(a,"cfIcon").map(c=>{let u=c.getAttribute("iconSet"),d=Number(c.getAttribute("iconId")??Number.NaN);return!u||!Number.isFinite(d)?null:{iconId:d,iconSet:u}}).filter(c=>!!c);return s.length===0||l.length===0?null:{cfvos:s,icons:l,kind:"iconSet",priority:i,ranges:t,reverse:T7(a,"reverse"),showValue:T7(a,"showValue"),id:o}}return null}function h6e(e,t){return e.kind!==t.kind?e:e.kind==="colorScale"&&t.kind==="colorScale"?{...e,...t,cfvos:t.cfvos.length>0?t.cfvos:e.cfvos,colors:t.colors.length>0?t.colors:e.colors,priority:Number.isFinite(t.priority)?t.priority:e.priority,ranges:t.ranges.length>0?t.ranges:e.ranges}:e.kind==="dataBar"&&t.kind==="dataBar"?{...e,...t,axisColor:t.axisColor??e.axisColor,border:t.border??e.border,cfvos:t.cfvos.length>0?t.cfvos:e.cfvos,color:t.color??e.color,negativeBarBorderColorSameAsPositive:t.negativeBarBorderColorSameAsPositive??e.negativeBarBorderColorSameAsPositive,negativeBorderColor:t.negativeBorderColor??e.negativeBorderColor,negativeFillColor:t.negativeFillColor??e.negativeFillColor,priority:Number.isFinite(t.priority)?t.priority:e.priority,ranges:t.ranges.length>0?t.ranges:e.ranges}:e.kind==="iconSet"&&t.kind==="iconSet"?{...e,...t,cfvos:t.cfvos.length>0?t.cfvos:e.cfvos,icons:t.icons.length>0?t.icons:e.icons,priority:Number.isFinite(t.priority)?t.priority:e.priority,ranges:t.ranges.length>0?t.ranges:e.ranges}:e}function g6e(e){let t=[],n=[];lr(e,"conditionalFormatting").forEach(a=>{let s=a.namespaceURI!==rJ,l=uY(s?P1(a,"sqref")?.textContent??"":a.getAttribute("sqref"));sr(a,"cfRule").forEach(c=>{let u=s?m6e(c,l):f6e(c,l);u&&(s?n.push(u):t.push(u))})});let o=[],r=new Set,i=new Map(n.filter(a=>typeof a.id=="string"&&a.id.length>0).map(a=>[a.id,a]));return t.forEach(a=>{let s=a.id?i.get(a.id):void 0;if(s){r.add(a.id),o.push(h6e(a,s));return}o.push(a)}),n.forEach(a=>{a.id&&r.has(a.id)||o.push(a)}),o.map(a=>{let s={...a};return delete s.id,s}).filter(a=>a.ranges.length>0).sort((a,s)=>a.priority-s.priority)}function y6e(e,t,n){let o=Ea(e,t);if(!o)return null;let r=vi(o);if(!r)return null;let i=n?.includeCachedFormulaValues??!0,a={},s=g6e(r),l=c6e(r,n?.themePalette),c=lr(r,"sheetFormatPr")[0]??null,u=lr(r,"sheetView")[0]??null,d={},p={},m={},h={},S=Number.POSITIVE_INFINITY,v=Number.POSITIVE_INFINITY,g=-1,y=-1,x=G0e(n?.defaultFont?.family,n?.defaultFont?.sizePt),_=Number(c?.getAttribute("defaultRowHeight")??15),$=Number(c?.getAttribute("defaultColWidth")??c?.getAttribute("baseColWidth")??8.43),k=Number(u?.getAttribute("zoomScale")??u?.getAttribute("zoomScaleNormal")??Number.NaN),L=Number.isFinite(k)&&k>0?k:100,I=z=>{if(!z)return;let Z=D_(z);Z&&(S=Math.min(S,Z.col),v=Math.min(v,Z.row),g=Math.max(g,Z.col),y=Math.max(y,Z.row))},N=z=>{if(P1(z,"f")||P1(z,"is"))return!0;let Z=P1(z,"v");return!!(Z&&(Z.textContent??"").length>0)};lr(r,"row").forEach(z=>{let Z=Number(z.getAttribute("r")??0)-1,ie=Number(z.getAttribute("ht")??Number.NaN),ue=Number(z.getAttribute("s")??Number.NaN);Z>=0&&Number.isFinite(ie)&&(d[Z]=Math.max(ny,Math.round(ie*1.33))),Z>=0&&Number.isFinite(ue)&&(m[Z]=ue),sr(z,"c").forEach(X=>{let W=X.getAttribute("r");if(N(X)&&I(W),i){let Me=P1(X,"f"),Fe=P1(X,"v");Me&&Fe&&W&&(a[W]=Fe.textContent??"")}})});let U=Math.max(g,0)+256;return lr(r,"col").forEach(z=>{let Z=Number(z.getAttribute("min")??0)-1,ie=Number(z.getAttribute("max")??0)-1,ue=Number(z.getAttribute("width")??Number.NaN),X=Number(z.getAttribute("style")??Number.NaN);if(!(!Number.isFinite(ue)&&!Number.isFinite(X))){for(let W=Z;W<=Math.min(ie,U);W+=1)if(W>=0){if(Number.isFinite(ue)){let Me=ry(ue,x);p[W]=Me}Number.isFinite(X)&&(h[W]=X)}}}),{cachedFormulaValues:a,columnWidthCharacterWidthPx:x,colWidthOverridesPx:p,colStyleIds:h,conditionalFormatRules:s,defaultColWidthPx:ry($,x),defaultRowHeightPx:Math.max(ny,Math.round(_*1.33)),hasHorizontalMerges:!1,hasVerticalMerges:!1,maxHorizontalMergeEndCol:-1,maxVerticalMergeEndRow:-1,maxContentCol:g,maxContentRow:y,minContentCol:Number.isFinite(S)?S:-1,minContentRow:Number.isFinite(v)?v:-1,hiddenCols:[],hiddenRows:[],rowHeightOverridesPx:d,rowStyleIds:m,showGridLines:(u?.getAttribute("showGridLines")??"1")!=="0",sparklines:l,zoomScale:L}}function v6e(e){return Math.max(0,Math.min(255,Math.round(e)))}function oy(e){let t=e.replace(/^#/,"");return t.length===8?`#${t.slice(2).toLowerCase()}`:t.length===6?`#${t.toLowerCase()}`:"#000000"}function b6e(e){let t=oy(e);return{b:Number.parseInt(t.slice(5,7),16),g:Number.parseInt(t.slice(3,5),16),r:Number.parseInt(t.slice(1,3),16)}}function mJ(e,t,n){return`#${[e,t,n].map(o=>v6e(o).toString(16).padStart(2,"0")).join("")}`}function S6e(e,t){let{r:n,g:o,b:r}=b6e(e),i=1,a=1,s=0;return t.forEach(l=>{let c=Number(l.getAttribute("val")??0),u=Number.isFinite(c)?c/1e5:0;switch(l.localName){case"alpha":i*=u;break;case"lumMod":a*=u;break;case"lumOff":s+=u;break;case"shade":n*=u,o*=u,r*=u;break;case"tint":n=n+(255-n)*u,o=o+(255-o)*u,r=r+(255-r)*u;break;default:break}}),(a!==1||s!==0)&&(n=n*a+255*s,o=o*a+255*s,r=r*a+255*s),{color:mJ(n,o,r),opacity:Math.max(0,Math.min(1,i))}}function x6e(e,t){if(!t)return null;let o={bg1:"bg1",bg2:"bg2",tx1:"tx1",tx2:"tx2"}[t]??t;return e.colors.get(o)??null}function J_(e,t){if(!e)return null;let n=null;if(e.localName==="srgbClr")n=oy(e.getAttribute("val")??"");else if(e.localName==="schemeClr")n=x6e(t,e.getAttribute("val"));else if(e.localName==="scrgbClr"){let o=Number(e.getAttribute("r")??0)*255/1e5,r=Number(e.getAttribute("g")??0)*255/1e5,i=Number(e.getAttribute("b")??0)*255/1e5;n=mJ(o,r,i)}else e.localName==="sysClr"&&(n=oy(e.getAttribute("lastClr")??""));return n?S6e(n,Array.from(e.childNodes).filter(Ki)):null}function nO(e,t){if(!e)return null;let n=P1(e,"solidFill");return n?J_(Array.from(n.childNodes).filter(Ki)[0]??null,t):null}function w6e(e,t){if(e)return e==="+mn-lt"||e==="+mn-ea"||e==="+mn-cs"?t.minorLatinFont??void 0:e==="+mj-lt"||e==="+mj-ea"||e==="+mj-cs"?t.majorLatinFont??void 0:e}function _6e(e){return!!(e&&e.startsWith("+"))}function P6e(e,t){if(!e)return;let n=P1(e,"latin")?.getAttribute("typeface")??null,o=P1(e,"ea")?.getAttribute("typeface")??null,r=P1(e,"cs")?.getAttribute("typeface")??null,i=[n,o,r],a=i.find(s=>s&&!_6e(s));return a||w6e(i.find(Boolean)??null,t)}function KI(e,t,n){if(!e)return{color:n?.color};let o=nO(e,t)??n??null,r=e.getAttribute("u");return{bold:e.getAttribute("b")==="1"||void 0,color:o?.color,fontFamily:P6e(e,t),fontSizePt:e.getAttribute("sz")?Number(e.getAttribute("sz"))/100:void 0,italic:e.getAttribute("i")==="1"||void 0,underline:r&&r!=="none"?!0:void 0}}function dY(...e){return e.reduce((t,n)=>n?{bold:n.bold??t.bold,color:n.color??t.color,fontFamily:n.fontFamily??t.fontFamily,fontSizePt:n.fontSizePt??t.fontSizePt,italic:n.italic??t.italic,underline:n.underline??t.underline}:t,{})}function Dg(e){if(!e)return null;let t=Number(P1(e,"col")?.textContent??0),n=Number(P1(e,"row")?.textContent??0),o=Number(P1(e,"colOff")?.textContent??0),r=Number(P1(e,"rowOff")?.textContent??0);return{col:t,colOffsetEmu:o,row:n,rowOffsetEmu:r}}function rO(e){if(e.type==="absolute")return{kind:"absolute",positionEmu:{x:e.xEmu,y:e.yEmu},sizeEmu:{cx:e.widthEmu,cy:e.heightEmu}};let t={col:e.from.col,colOffsetEmu:e.from.colOffsetEmu??0,row:e.from.row,rowOffsetEmu:e.from.rowOffsetEmu??0};return e.type==="oneCell"?{from:t,kind:"one-cell",sizeEmu:{cx:e.widthEmu,cy:e.heightEmu}}:{from:t,kind:"two-cell",to:{col:e.to.col,colOffsetEmu:e.to.colOffsetEmu??0,row:e.to.row,rowOffsetEmu:e.to.rowOffsetEmu??0}}}function hJ(e,t){if(e.kind==="absolute")return{heightEmu:e.sizeEmu.cy,type:"absolute",widthEmu:e.sizeEmu.cx,xEmu:e.positionEmu.x,yEmu:e.positionEmu.y};let n={col:e.from.col,colOffsetEmu:e.from.colOffsetEmu,row:e.from.row,rowOffsetEmu:e.from.rowOffsetEmu};return e.kind==="one-cell"?{from:n,heightEmu:e.sizeEmu.cy,type:"oneCell",widthEmu:e.sizeEmu.cx}:{editAs:t,from:n,to:{col:e.to.col,colOffsetEmu:e.to.colOffsetEmu,row:e.to.row,rowOffsetEmu:e.to.rowOffsetEmu},type:"twoCell"}}function C6e(e){if(e)switch(e.colorType){case"auto":return{colorType:"auto"};case"rgb":return{b:e.b,colorType:"rgb",g:e.g,r:e.r};case"argb":return{a:e.a,b:e.b,colorType:"argb",g:e.g,r:e.r};case"theme":return{colorType:"theme",themeIndex:e.index,tint:e.tint};case"indexed":return{colorType:"indexed",paletteIndex:e.index}}}function k6e(e){if(e)return{bold:e.bold,charset:e.charset,color:C6e(e.color),family:e.family,italic:e.italic,name:e.name,scheme:e.scheme,size:e.size,strikethrough:e.strikethrough,underline:e.underline,verticalAlign:e.verticalAlign}}function R6e(e){return{horizontalAlignment:e.horizontalAlignment,runs:e.runs.map(t=>({font:k6e(t.font),text:t.text})),verticalAlignment:e.verticalAlignment}}function $6e(e,t){if(e)switch(e.colorType){case"rgb":return zr({rgb:[e.r,e.g,e.b].map(n=>n.toString(16).padStart(2,"0")).join("")})??void 0;case"argb":return zr({argb:[e.a,e.r,e.g,e.b].map(n=>n.toString(16).padStart(2,"0")).join("")})??void 0;case"theme":return zr({theme:e.index,tint:e.tint},t)??void 0;default:return}}function Yu(e,t){let n=R6e(e),o=E6e(e.runs.map(a=>a.text).join("")),r=e.runs.find(a=>a.font)?.font,i=e.horizontalAlignment;return{caption:n,fontFamily:r?.name,fontSizePt:r?.size,label:o,textAlign:i==="left"||i==="center"||i==="right"?i:void 0,textColor:$6e(r?.color,t)}}function z6e(e,t){switch(e.kind){case"button":return{...Yu(e.caption,t),kind:"button"};case"checkbox":return{...Yu(e.caption,t),checked:e.state==="checked",kind:"checkbox",linkedCell:e.cellLink,no3D:e.no3D,state:e.state};case"optionButton":return{...Yu(e.caption,t),checked:e.state==="checked",firstInGroup:e.firstInGroup,kind:"radio",linkedCell:e.cellLink,no3D:e.no3D,state:e.state};case"label":return{...Yu(e.caption,t),kind:"label"};case"groupBox":return{...Yu(e.caption,t),kind:"group-box",no3D:e.no3D};case"listBox":return{inputRange:e.inputRange,kind:"listbox",linkedCell:e.cellLink,no3D:e.no3D,selected:[...e.selected],selection:e.selection};case"dropdown":return{inputRange:e.inputRange,kind:"dropdown",lines:e.lines,linkedCell:e.cellLink,no3D:e.no3D,selected:e.selected};case"scrollbar":return{horizontal:e.horizontal,increment:e.increment,kind:"scrollbar",linkedCell:e.cellLink,max:e.max,min:e.min,page:e.page,value:e.value};case"spinner":return{increment:e.increment,kind:"spinner",linkedCell:e.cellLink,max:e.max,min:e.min,value:e.value};case"unknown":return{...Yu(e.caption,t),kind:e.objectType.toLowerCase()==="editbox"?"editbox":"unknown",legacyObjectType:e.legacyObjectType,objectType:e.objectType,rawObj:e.rawObj,rawProperties:e.rawProperties}}}function M6e(e,t,n,o){return{altText:e.altText,anchor:rO(e.anchor),controlIndex:t,editAs:e.anchor.type==="twoCell"?e.anchor.editAs:void 0,hidden:e.hidden,id:`form-control-${n}-${t}`,locked:e.locked,macroName:e.formControl.macroName,name:e.name,printable:e.printable,rawClientData:e.formControl.rawClientData,sheetIndex:n,title:e.title,workbookSheetIndex:n,zIndex:(e.drawingPath[0]??t)+1,...z6e(e.formControl.kind,o)}}function oO(e,t){return Array.from({length:e.sheetCount},(n,o)=>{try{let r=e.getSheet(o).formControls;return Array.isArray(r)?r.flatMap((i,a)=>i.anchor?[M6e(i,a,o,t)]:[]):[]}catch{return[]}})}function E6e(e){if(!e)return;let t=e.replace(/\u00a0/g," ").replace(/\s+/g," ").trim();return t.length>0?t:void 0}function T6e(e){if(e.localName==="anchor"){let o=Dg(P1(e,"from")),r=Dg(P1(e,"to"));return o&&r?{from:o,kind:"two-cell",to:r}:null}if(e.localName==="twoCellAnchor"){let o=Dg(P1(e,"from")),r=Dg(P1(e,"to"));return o&&r?{from:o,kind:"two-cell",to:r}:null}if(e.localName==="oneCellAnchor"){let o=Dg(P1(e,"from")),r=P1(e,"ext");return o&&r?{from:o,kind:"one-cell",sizeEmu:{cx:Number(r.getAttribute("cx")??0),cy:Number(r.getAttribute("cy")??0)}}:null}let t=P1(e,"pos"),n=P1(e,"ext");return t&&n?{kind:"absolute",positionEmu:{x:Number(t.getAttribute("x")??0),y:Number(t.getAttribute("y")??0)},sizeEmu:{cx:Number(n.getAttribute("cx")??0),cy:Number(n.getAttribute("cy")??0)}}:null}function A6e(e){return e.kind==="absolute"?{cx:e.sizeEmu.cx,cy:e.sizeEmu.cy,x:e.positionEmu.x,y:e.positionEmu.y}:e.kind==="one-cell"?{cx:e.sizeEmu.cx,cy:e.sizeEmu.cy,x:e.from.colOffsetEmu,y:e.from.rowOffsetEmu}:{cx:Math.max(0,(e.to.col-e.from.col)*oJ+e.to.colOffsetEmu-e.from.colOffsetEmu),cy:Math.max(0,(e.to.row-e.from.row)*iJ+e.to.rowOffsetEmu-e.from.rowOffsetEmu),x:e.from.colOffsetEmu,y:e.from.rowOffsetEmu}}function I6e(e,t){return t<0?0:e?.colWidthOverridesPx[t]??e?.defaultColWidthPx??gi(oJ)}function N6e(e,t){return t<0?0:e?.rowHeightOverridesPx[t]??e?.defaultRowHeightPx??gi(iJ)}function JI(e,t){let n=0;for(let o=0;o<t;o+=1)n+=Yi(I6e(e,o));return n}function QI(e,t){let n=0;for(let o=0;o<t;o+=1)n+=Yi(N6e(e,o));return n}function O6e(e,t){if(e.kind==="absolute")return A6e(e);if(e.kind==="one-cell")return{cx:e.sizeEmu.cx,cy:e.sizeEmu.cy,x:JI(t,e.from.col)+e.from.colOffsetEmu,y:QI(t,e.from.row)+e.from.rowOffsetEmu};let n=JI(t,e.from.col)+e.from.colOffsetEmu,o=QI(t,e.from.row)+e.from.rowOffsetEmu,r=JI(t,e.to.col)+e.to.colOffsetEmu,i=QI(t,e.to.row)+e.to.rowOffsetEmu;return{cx:Math.max(0,r-n),cy:Math.max(0,i-o),x:n,y:o}}function gJ(e){return{kind:"absolute",positionEmu:{x:e.x,y:e.y},sizeEmu:{cx:e.cx,cy:e.cy}}}function yJ(e){if(!e)return null;let t=P1(e,"off"),n=P1(e,"ext");return!t||!n?null:{cx:Number(n.getAttribute("cx")??0),cy:Number(n.getAttribute("cy")??0),flipH:e.getAttribute("flipH")==="1",flipV:e.getAttribute("flipV")==="1",rot:Number(e.getAttribute("rot")??0)/6e4,x:Number(t.getAttribute("x")??0),y:Number(t.getAttribute("y")??0)}}function vJ(e,t){return{cx:e.cx*t.scaleX,cy:e.cy*t.scaleY,x:t.x+(e.x-t.chX)*t.scaleX,y:t.y+(e.y-t.chY)*t.scaleY}}function L6e(e,t,n,o){let r=$r(P1(e,"grpSpPr")??e,"xfrm"),i=O6e(n,o),a=yJ(r)??i,s=Math.abs(a.x-i.x)<=vd&&Math.abs(a.y-i.y)<=vd,l=P1(r??e,"chOff"),c=P1(r??e,"chExt"),u=a.cx!==0?i.cx/a.cx:1,d=a.cy!==0?i.cy/a.cy:1,p=!t&&(u<.85||u>1.15||d<.85||d>1.15),m=t?vJ(a,t):s?a:i,h=t?Number(l?.getAttribute("x")??0):p?a.x:Number(l?.getAttribute("x")??0),S=t?Number(l?.getAttribute("y")??0):p?a.y:Number(l?.getAttribute("y")??0),v=t?Number(c?.getAttribute("cx")??a.cx):p?a.cx:Number(c?.getAttribute("cx")??a.cx),g=t?Number(c?.getAttribute("cy")??a.cy):p?a.cy:Number(c?.getAttribute("cy")??a.cy);return{chCx:v,chCy:g,chX:h,chY:S,cx:m.cx,cy:m.cy,scaleX:v!==0?m.cx/v:t?.scaleX??1,scaleY:g!==0?m.cy/g:t?.scaleY??1,x:m.x,y:m.y}}function bJ(e,t,n){let o=$r(e,"xfrm"),r=yJ(o);if(r){let i=n?.scaleX??1,a=n?.scaleY??1;return{anchor:n?gJ(vJ(r,n)):t,flipH:r.flipH,flipV:r.flipV,rotationDeg:r.rot,scaleX:i,scaleY:a}}return{anchor:t,flipH:!1,flipV:!1,rotationDeg:0,scaleX:n?.scaleX??1,scaleY:n?.scaleY??1}}function D6e(e){switch(e){case"ctr":return"center";case"just":return"justify";case"r":return"right";case"l":return"left";default:return}}function B6e(e){switch(e){case"b":return"bottom";case"ctr":return"middle";default:return"top"}}function SJ(e){return e.documentElement?Array.from(e.documentElement.childNodes).filter(t=>Ki(t)&&(t.localName==="twoCellAnchor"||t.localName==="oneCellAnchor"||t.localName==="absoluteAnchor")):[]}function j6e(e,t,n){if(typeof URL<"u"&&typeof Blob<"u"){let i=URL.createObjectURL(new Blob([E7(e)],{type:t}));return n.push(i),i}let o="";for(let i of e)o+=String.fromCharCode(i);let r=typeof btoa=="function"?btoa(o):"";return`data:${t};base64,${r}`}function U6e(e){return e==="line"||e==="arc"||e==="leftBrace"}function F6e(e,t,n){let o=$r(e,"ln"),r=t?P1(t,"lnRef"):null;if(!o&&!r)return;if(o&&P1(o,"noFill"))return{none:!0};let i=nO(o,n)??J_(Array.from(r?.childNodes??[]).filter(Ki)[0]??null,n),a=Number(o?.getAttribute("w")??0);return{color:i?.color,dash:P1(o??e,"prstDash")?.getAttribute("val")??void 0,headEndType:P1(o??e,"headEnd")?.getAttribute("type")??void 0,none:!1,opacity:i?.opacity,tailEndType:P1(o??e,"tailEnd")?.getAttribute("type")??void 0,widthPx:a>0?gi(a):void 0}}function H6e(e,t,n,o){let r=P1(e,"spPr")??e;if(P1(r,"noFill"))return{none:!0};if(U6e(o))return{none:!0};let a=t?P1(t,"fillRef"):null,s=nO(r,n)??J_(Array.from(a?.childNodes??[]).filter(Ki)[0]??null,n);if(s)return{color:s.color,none:!1,opacity:s.opacity}}function eN(e){if(!e)return null;let t=Number(e.getAttribute("x")??Number.NaN),n=Number(e.getAttribute("y")??Number.NaN);return Number.isFinite(t)&&Number.isFinite(n)?{x:t,y:n}:null}function V6e(e){let t=$r(e,"path");if(!t)return;let n=Number(t.getAttribute("w")??Number.NaN),o=Number(t.getAttribute("h")??Number.NaN);if(!Number.isFinite(n)||!Number.isFinite(o)||n<=0||o<=0)return;let r=[],i=null;for(let a of Array.from(t.childNodes).filter(Ki)){if(a.localName==="moveTo"){let s=eN(P1(a,"pt"));s&&(r.push(`M ${s.x} ${s.y}`),i=s);continue}if(a.localName==="lnTo"){let s=eN(P1(a,"pt"));s&&(!i||s.x!==i.x||s.y!==i.y)&&(r.push(`L ${s.x} ${s.y}`),i=s);continue}if(a.localName==="cubicBezTo"){let s=sr(a,"pt").map(eN).filter(l=>l!==null);s.length===3&&(r.push(`C ${s[0].x} ${s[0].y} ${s[1].x} ${s[1].y} ${s[2].x} ${s[2].y}`),i=s[2]);continue}a.localName==="close"&&(r.push("Z"),i=null)}if(r.length!==0)return{path:r.join(" "),viewBox:{height:o,width:n}}}function q6e(e){let t=$r(e,"prstGeom");if(!t)return;let n={};return sr(P1(t,"avLst"),"gd").forEach(o=>{let r=o.getAttribute("name"),a=(o.getAttribute("fmla")??"").match(/^val\s+(-?\d+(?:\.\d+)?)$/);if(!r||!a)return;let s=Number.parseFloat(a[1]??"");Number.isFinite(s)&&(n[r]=s)}),Object.keys(n).length>0?n:void 0}function W6e(e,t,n){let o=P1(e,"txBody");if(!o)return[];let r=t?P1(t,"fontRef"):null,i=J_(Array.from(r?.childNodes??[]).filter(Ki)[0]??null,n),a=P1(o,"lstStyle"),s=[];return sr(o,"p").forEach(l=>{let c=P1(l,"pPr"),u=Number(c?.getAttribute("lvl")??0),d=P1(a??o,`lvl${u+1}pPr`),p=dY(KI(P1(d??o,"defRPr"),n,i),KI(P1(c??l,"defRPr"),n,i)),m=[],h=!1;if(Array.from(l.childNodes).filter(Ki).forEach(S=>{if(S.localName==="br"){h=!0,m.push({text:`