sliccy 1.24.0 → 1.24.2

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 (24) hide show
  1. package/dist/ui/assets/{___vite-browser-external_commonjs-proxy-BWNVNhfA.js → ___vite-browser-external_commonjs-proxy-BrXJLmR5.js} +1 -1
  2. package/dist/ui/assets/{anthropic-DpIVtAz7.js → anthropic-Co5yczSF.js} +1 -1
  3. package/dist/ui/assets/{azure-openai-responses-DM6ZhYp3.js → azure-openai-responses-BmhLV3xP.js} +1 -1
  4. package/dist/ui/assets/{bsh-watchdog-u_kfEll6.js → bsh-watchdog-EvXUkmgJ.js} +1 -1
  5. package/dist/ui/assets/{google-DxQyzZcF.js → google-C4s9ConA.js} +1 -1
  6. package/dist/ui/assets/{google-gemini-cli-D8wlpibe.js → google-gemini-cli-jlzqmHjU.js} +1 -1
  7. package/dist/ui/assets/{google-shared-DdOR1KIz.js → google-shared-C2u8GljL.js} +1 -1
  8. package/dist/ui/assets/{google-vertex-EcFAaDcq.js → google-vertex-CzELRrnV.js} +1 -1
  9. package/dist/ui/assets/{index-Dw4MBGs3.js → index-9S0E3bQQ.js} +233 -233
  10. package/dist/ui/assets/{index-BX1RqpKx.js → index-BcaUwaS0.js} +1 -1
  11. package/dist/ui/assets/{index-J5ks5yhg.js → index-C806HqzC.js} +1 -1
  12. package/dist/ui/assets/{index-BxsPIYVT.js → index-CoWLq2e5.js} +1 -1
  13. package/dist/ui/assets/{index-CWnZsBG7.js → index-moXwjkel.js} +1 -1
  14. package/dist/ui/assets/{json-parse-0sc64RJd.js → json-parse-BPYifSYg.js} +1 -1
  15. package/dist/ui/assets/{mistral-7wTQY92Z.js → mistral-B2p6u0e_.js} +1 -1
  16. package/dist/ui/assets/{offscreen-client-Ch5qQdZk.js → offscreen-client-3_Ih46w9.js} +1 -1
  17. package/dist/ui/assets/{openai-codex-responses-BKiIVXQr.js → openai-codex-responses-D07wKmVX.js} +1 -1
  18. package/dist/ui/assets/{openai-completions-X6jnU-kX.js → openai-completions-BNodmqJk.js} +1 -1
  19. package/dist/ui/assets/{openai-responses-BH3tsCV7.js → openai-responses-OdVdJrop.js} +1 -1
  20. package/dist/ui/assets/{openai-responses-shared-DCfz91fA.js → openai-responses-shared-BPHlF6pD.js} +1 -1
  21. package/dist/ui/assets/{sql-wasm-bQNzDNj9.js → sql-wasm-DwRqTar6.js} +1 -1
  22. package/dist/ui/index.html +1 -1
  23. package/dist/ui/packages/webapp/index.html +1 -1
  24. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import{O as C}from"./client-DFw1b8C8.js";import{t as S,A as M,g as I,b as q,s as b,d as O,a as P}from"./index-Dw4MBGs3.js";import{p as v}from"./json-parse-0sc64RJd.js";import{s as x}from"./sanitize-unicode-cmozpu7l.js";import{h as N,b as F}from"./github-copilot-headers-CrHPofPv.js";var T={};function B(e){for(const s of e)if(s.role==="toolResult"||s.role==="assistant"&&s.content.some(t=>t.type==="toolCall"))return!0;return!1}const j=(e,s,t)=>{const n=new M;return(async()=>{const o={role:"assistant",content:[],api:e.api,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{const r=t?.apiKey||I(e.provider)||"",i=D(e,s,r,t?.headers);let p=U(e,s,t);const g=await t?.onPayload?.(p,e);g!==void 0&&(p=g);const h=await i.chat.completions.create(p,{signal:t?.signal});n.push({type:"start",partial:o});let a=null;const d=o.content,R=()=>d.length-1,k=f=>{f&&(f.type==="text"?n.push({type:"text_end",contentIndex:R(),content:f.text,partial:o}):f.type==="thinking"?n.push({type:"thinking_end",contentIndex:R(),content:f.thinking,partial:o}):f.type==="toolCall"&&(f.arguments=v(f.partialArgs),delete f.partialArgs,n.push({type:"toolcall_end",contentIndex:R(),toolCall:f,partial:o})))};for await(const f of h){if(!f||typeof f!="object")continue;o.responseId||=f.id,f.usage&&(o.usage=E(f.usage,e));const c=Array.isArray(f.choices)?f.choices[0]:void 0;if(c){if(!f.usage&&c.usage&&(o.usage=E(c.usage,e)),c.finish_reason){const m=K(c.finish_reason);o.stopReason=m.stopReason,m.errorMessage&&(o.errorMessage=m.errorMessage)}if(c.delta){c.delta.content!==null&&c.delta.content!==void 0&&c.delta.content.length>0&&((!a||a.type!=="text")&&(k(a),a={type:"text",text:""},o.content.push(a),n.push({type:"text_start",contentIndex:R(),partial:o})),a.type==="text"&&(a.text+=c.delta.content,n.push({type:"text_delta",contentIndex:R(),delta:c.delta.content,partial:o})));const m=["reasoning_content","reasoning","reasoning_text"];let l=null;for(const u of m)if(c.delta[u]!==null&&c.delta[u]!==void 0&&c.delta[u].length>0&&!l){l=u;break}if(l&&((!a||a.type!=="thinking")&&(k(a),a={type:"thinking",thinking:"",thinkingSignature:l},o.content.push(a),n.push({type:"thinking_start",contentIndex:R(),partial:o})),a.type==="thinking")){const u=c.delta[l];a.thinking+=u,n.push({type:"thinking_delta",contentIndex:R(),delta:u,partial:o})}if(c?.delta?.tool_calls){for(const u of c.delta.tool_calls)if((!a||a.type!=="toolCall"||u.id&&a.id!==u.id)&&(k(a),a={type:"toolCall",id:u.id||"",name:u.function?.name||"",arguments:{},partialArgs:""},o.content.push(a),n.push({type:"toolcall_start",contentIndex:R(),partial:o})),a.type==="toolCall"){u.id&&(a.id=u.id),u.function?.name&&(a.name=u.function.name);let _="";u.function?.arguments&&(_=u.function.arguments,a.partialArgs+=u.function.arguments,a.arguments=v(a.partialArgs)),n.push({type:"toolcall_delta",contentIndex:R(),delta:_,partial:o})}}const y=c.delta.reasoning_details;if(y&&Array.isArray(y)){for(const u of y)if(u.type==="reasoning.encrypted"&&u.id&&u.data){const _=o.content.find(A=>A.type==="toolCall"&&A.id===u.id);_&&(_.thoughtSignature=JSON.stringify(u))}}}}}if(k(a),t?.signal?.aborted)throw new Error("Request was aborted");if(o.stopReason==="aborted")throw new Error("Request was aborted");if(o.stopReason==="error")throw new Error(o.errorMessage||"Provider returned an error stop reason");n.push({type:"done",reason:o.stopReason,message:o}),n.end()}catch(r){for(const p of o.content)delete p.index;o.stopReason=t?.signal?.aborted?"aborted":"error",o.errorMessage=r instanceof Error?r.message:JSON.stringify(r);const i=r?.error?.metadata?.raw;i&&(o.errorMessage+=`
1
+ import{O as C}from"./client-DFw1b8C8.js";import{t as S,A as M,g as I,b as q,s as b,d as O,a as P}from"./index-9S0E3bQQ.js";import{p as v}from"./json-parse-BPYifSYg.js";import{s as x}from"./sanitize-unicode-cmozpu7l.js";import{h as N,b as F}from"./github-copilot-headers-CrHPofPv.js";var T={};function B(e){for(const s of e)if(s.role==="toolResult"||s.role==="assistant"&&s.content.some(t=>t.type==="toolCall"))return!0;return!1}const j=(e,s,t)=>{const n=new M;return(async()=>{const o={role:"assistant",content:[],api:e.api,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{const r=t?.apiKey||I(e.provider)||"",i=D(e,s,r,t?.headers);let p=U(e,s,t);const g=await t?.onPayload?.(p,e);g!==void 0&&(p=g);const h=await i.chat.completions.create(p,{signal:t?.signal});n.push({type:"start",partial:o});let a=null;const d=o.content,R=()=>d.length-1,k=f=>{f&&(f.type==="text"?n.push({type:"text_end",contentIndex:R(),content:f.text,partial:o}):f.type==="thinking"?n.push({type:"thinking_end",contentIndex:R(),content:f.thinking,partial:o}):f.type==="toolCall"&&(f.arguments=v(f.partialArgs),delete f.partialArgs,n.push({type:"toolcall_end",contentIndex:R(),toolCall:f,partial:o})))};for await(const f of h){if(!f||typeof f!="object")continue;o.responseId||=f.id,f.usage&&(o.usage=E(f.usage,e));const c=Array.isArray(f.choices)?f.choices[0]:void 0;if(c){if(!f.usage&&c.usage&&(o.usage=E(c.usage,e)),c.finish_reason){const m=K(c.finish_reason);o.stopReason=m.stopReason,m.errorMessage&&(o.errorMessage=m.errorMessage)}if(c.delta){c.delta.content!==null&&c.delta.content!==void 0&&c.delta.content.length>0&&((!a||a.type!=="text")&&(k(a),a={type:"text",text:""},o.content.push(a),n.push({type:"text_start",contentIndex:R(),partial:o})),a.type==="text"&&(a.text+=c.delta.content,n.push({type:"text_delta",contentIndex:R(),delta:c.delta.content,partial:o})));const m=["reasoning_content","reasoning","reasoning_text"];let l=null;for(const u of m)if(c.delta[u]!==null&&c.delta[u]!==void 0&&c.delta[u].length>0&&!l){l=u;break}if(l&&((!a||a.type!=="thinking")&&(k(a),a={type:"thinking",thinking:"",thinkingSignature:l},o.content.push(a),n.push({type:"thinking_start",contentIndex:R(),partial:o})),a.type==="thinking")){const u=c.delta[l];a.thinking+=u,n.push({type:"thinking_delta",contentIndex:R(),delta:u,partial:o})}if(c?.delta?.tool_calls){for(const u of c.delta.tool_calls)if((!a||a.type!=="toolCall"||u.id&&a.id!==u.id)&&(k(a),a={type:"toolCall",id:u.id||"",name:u.function?.name||"",arguments:{},partialArgs:""},o.content.push(a),n.push({type:"toolcall_start",contentIndex:R(),partial:o})),a.type==="toolCall"){u.id&&(a.id=u.id),u.function?.name&&(a.name=u.function.name);let _="";u.function?.arguments&&(_=u.function.arguments,a.partialArgs+=u.function.arguments,a.arguments=v(a.partialArgs)),n.push({type:"toolcall_delta",contentIndex:R(),delta:_,partial:o})}}const y=c.delta.reasoning_details;if(y&&Array.isArray(y)){for(const u of y)if(u.type==="reasoning.encrypted"&&u.id&&u.data){const _=o.content.find(A=>A.type==="toolCall"&&A.id===u.id);_&&(_.thoughtSignature=JSON.stringify(u))}}}}}if(k(a),t?.signal?.aborted)throw new Error("Request was aborted");if(o.stopReason==="aborted")throw new Error("Request was aborted");if(o.stopReason==="error")throw new Error(o.errorMessage||"Provider returned an error stop reason");n.push({type:"done",reason:o.stopReason,message:o}),n.end()}catch(r){for(const p of o.content)delete p.index;o.stopReason=t?.signal?.aborted?"aborted":"error",o.errorMessage=r instanceof Error?r.message:JSON.stringify(r);const i=r?.error?.metadata?.raw;i&&(o.errorMessage+=`
2
2
  ${i}`),n.push({type:"error",reason:o.stopReason,error:o}),n.end()}})(),n},X=(e,s,t)=>{const n=t?.apiKey||I(e.provider);if(!n)throw new Error(`No API key for provider: ${e.provider}`);const o=q(e,t,n),r=b(e)?t?.reasoning:O(t?.reasoning),i=t?.toolChoice;return j(e,s,{...o,reasoningEffort:r,toolChoice:i})};function D(e,s,t,n){if(!t){if(!T.OPENAI_API_KEY)throw new Error("OpenAI API key is required. Set OPENAI_API_KEY environment variable or pass it as an argument.");t=T.OPENAI_API_KEY}const o={...e.headers};if(e.provider==="github-copilot"){const r=N(s.messages),i=F({messages:s.messages,hasImages:r});Object.assign(o,i)}return n&&Object.assign(o,n),new C({apiKey:t,baseURL:e.baseUrl,dangerouslyAllowBrowser:!0,defaultHeaders:o})}function U(e,s,t){const n=W(e),o=z(e,s,n);G(e,o);const r={model:e.id,messages:o,stream:!0};if(n.supportsUsageInStreaming!==!1&&(r.stream_options={include_usage:!0}),n.supportsStore&&(r.store=!1),t?.maxTokens&&(n.maxTokensField==="max_tokens"?r.max_tokens=t.maxTokens:r.max_completion_tokens=t.maxTokens),t?.temperature!==void 0&&(r.temperature=t.temperature),s.tools?r.tools=$(s.tools,n):B(s.messages)&&(r.tools=[]),t?.toolChoice&&(r.tool_choice=t.toolChoice),n.thinkingFormat==="zai"&&e.reasoning)r.enable_thinking=!!t?.reasoningEffort;else if(n.thinkingFormat==="qwen"&&e.reasoning)r.enable_thinking=!!t?.reasoningEffort;else if(n.thinkingFormat==="qwen-chat-template"&&e.reasoning)r.chat_template_kwargs={enable_thinking:!!t?.reasoningEffort};else if(n.thinkingFormat==="openrouter"&&e.reasoning){const i=r;t?.reasoningEffort?i.reasoning={effort:w(t.reasoningEffort,n.reasoningEffortMap)}:i.reasoning={effort:"none"}}else t?.reasoningEffort&&e.reasoning&&n.supportsReasoningEffort&&(r.reasoning_effort=w(t.reasoningEffort,n.reasoningEffortMap));if(e.baseUrl.includes("openrouter.ai")&&e.compat?.openRouterRouting&&(r.provider=e.compat.openRouterRouting),e.baseUrl.includes("ai-gateway.vercel.sh")&&e.compat?.vercelGatewayRouting){const i=e.compat.vercelGatewayRouting;if(i.only||i.order){const p={};i.only&&(p.only=i.only),i.order&&(p.order=i.order),r.providerOptions={gateway:p}}}return r}function w(e,s){return s[e]??e}function G(e,s){if(!(e.provider!=="openrouter"||!e.id.startsWith("anthropic/")))for(let t=s.length-1;t>=0;t--){const n=s[t];if(n.role!=="user"&&n.role!=="assistant")continue;const o=n.content;if(typeof o=="string"){n.content=[Object.assign({type:"text",text:o},{cache_control:{type:"ephemeral"}})];return}if(Array.isArray(o))for(let r=o.length-1;r>=0;r--){const i=o[r];if(i?.type==="text"){Object.assign(i,{cache_control:{type:"ephemeral"}});return}}}}function z(e,s,t){const n=[],o=p=>{if(p.includes("|")){const[g]=p.split("|");return g.replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,40)}return e.provider==="openai"&&p.length>40?p.slice(0,40):p},r=S(s.messages,e,p=>o(p));if(s.systemPrompt){const g=e.reasoning&&t.supportsDeveloperRole?"developer":"system";n.push({role:g,content:x(s.systemPrompt)})}let i=null;for(let p=0;p<r.length;p++){const g=r[p];if(t.requiresAssistantAfterToolResult&&i==="toolResult"&&g.role==="user"&&n.push({role:"assistant",content:"I have processed the tool results."}),g.role==="user")if(typeof g.content=="string")n.push({role:"user",content:x(g.content)});else{const h=g.content.map(d=>d.type==="text"?{type:"text",text:x(d.text)}:{type:"image_url",image_url:{url:`data:${d.mimeType};base64,${d.data}`}}),a=e.input.includes("image")?h:h.filter(d=>d.type!=="image_url");if(a.length===0)continue;n.push({role:"user",content:a})}else if(g.role==="assistant"){const h={role:"assistant",content:t.requiresAssistantAfterToolResult?"":null},d=g.content.filter(l=>l.type==="text").filter(l=>l.text&&l.text.trim().length>0);d.length>0&&(h.content=d.map(l=>x(l.text)).join(""));const k=g.content.filter(l=>l.type==="thinking").filter(l=>l.thinking&&l.thinking.trim().length>0);if(k.length>0)if(t.requiresThinkingAsText){const l=k.map(u=>u.thinking).join(`
3
3
 
4
4
  `),y=h.content;y?y.unshift({type:"text",text:l}):h.content=[{type:"text",text:l}]}else{const l=k[0].thinkingSignature;l&&l.length>0&&(h[l]=k.map(y=>y.thinking).join(`
@@ -1 +1 @@
1
- import{O as d}from"./client-DFw1b8C8.js";import{A as m,g as u,b as l,s as g,d as h}from"./index-Dw4MBGs3.js";import{h as v,b as R}from"./github-copilot-headers-CrHPofPv.js";import{p as y,c as _,a as E}from"./openai-responses-shared-DCfz91fA.js";import"./hash-DMDecQcg.js";import"./json-parse-0sc64RJd.js";import"./sanitize-unicode-cmozpu7l.js";var c={};const w=new Set(["openai","openai-codex","opencode"]);function A(e){return e||(typeof process<"u"&&c.PI_CACHE_RETENTION==="long"?"long":"short")}function b(e,a){if(a==="long"&&e.includes("api.openai.com"))return"24h"}const I=(e,a,r)=>{const n=new m;return(async()=>{const t={role:"assistant",content:[],api:e.api,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{const s=r?.apiKey||u(e.provider)||"",o=O(e,a,s,r?.headers);let i=P(e,a,r);const p=await r?.onPayload?.(i,e);p!==void 0&&(i=p);const f=await o.responses.create(i,r?.signal?{signal:r.signal}:void 0);if(n.push({type:"start",partial:t}),await y(f,t,n,e,{serviceTier:r?.serviceTier,applyServiceTierPricing:S}),r?.signal?.aborted)throw new Error("Request was aborted");if(t.stopReason==="aborted"||t.stopReason==="error")throw new Error("An unknown error occurred");n.push({type:"done",reason:t.stopReason,message:t}),n.end()}catch(s){for(const o of t.content)delete o.index;t.stopReason=r?.signal?.aborted?"aborted":"error",t.errorMessage=s instanceof Error?s.message:JSON.stringify(s),n.push({type:"error",reason:t.stopReason,error:t}),n.end()}})(),n},W=(e,a,r)=>{const n=r?.apiKey||u(e.provider);if(!n)throw new Error(`No API key for provider: ${e.provider}`);const t=l(e,r,n),s=g(e)?r?.reasoning:h(r?.reasoning);return I(e,a,{...t,reasoningEffort:s})};function O(e,a,r,n){if(!r){if(!c.OPENAI_API_KEY)throw new Error("OpenAI API key is required. Set OPENAI_API_KEY environment variable or pass it as an argument.");r=c.OPENAI_API_KEY}const t={...e.headers};if(e.provider==="github-copilot"){const s=v(a.messages),o=R({messages:a.messages,hasImages:s});Object.assign(t,o)}return n&&Object.assign(t,n),new d({apiKey:r,baseURL:e.baseUrl,dangerouslyAllowBrowser:!0,defaultHeaders:t})}function P(e,a,r){const n=_(e,a,w),t=A(r?.cacheRetention),s={model:e.id,input:n,stream:!0,prompt_cache_key:t==="none"?void 0:r?.sessionId,prompt_cache_retention:b(e.baseUrl,t),store:!1};return r?.maxTokens&&(s.max_output_tokens=r?.maxTokens),r?.temperature!==void 0&&(s.temperature=r?.temperature),r?.serviceTier!==void 0&&(s.service_tier=r.serviceTier),a.tools&&(s.tools=E(a.tools)),e.reasoning&&(r?.reasoningEffort||r?.reasoningSummary?(s.reasoning={effort:r?.reasoningEffort||"medium",summary:r?.reasoningSummary||"auto"},s.include=["reasoning.encrypted_content"]):s.reasoning={effort:"none"}),s}function T(e){switch(e){case"flex":return .5;case"priority":return 2;default:return 1}}function S(e,a){const r=T(a);r!==1&&(e.cost.input*=r,e.cost.output*=r,e.cost.cacheRead*=r,e.cost.cacheWrite*=r,e.cost.total=e.cost.input+e.cost.output+e.cost.cacheRead+e.cost.cacheWrite)}export{I as streamOpenAIResponses,W as streamSimpleOpenAIResponses};
1
+ import{O as d}from"./client-DFw1b8C8.js";import{A as m,g as u,b as l,s as g,d as h}from"./index-9S0E3bQQ.js";import{h as v,b as R}from"./github-copilot-headers-CrHPofPv.js";import{p as y,c as _,a as E}from"./openai-responses-shared-BPHlF6pD.js";import"./hash-DMDecQcg.js";import"./json-parse-BPYifSYg.js";import"./sanitize-unicode-cmozpu7l.js";var c={};const w=new Set(["openai","openai-codex","opencode"]);function A(e){return e||(typeof process<"u"&&c.PI_CACHE_RETENTION==="long"?"long":"short")}function b(e,a){if(a==="long"&&e.includes("api.openai.com"))return"24h"}const I=(e,a,r)=>{const n=new m;return(async()=>{const t={role:"assistant",content:[],api:e.api,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{const s=r?.apiKey||u(e.provider)||"",o=O(e,a,s,r?.headers);let i=P(e,a,r);const p=await r?.onPayload?.(i,e);p!==void 0&&(i=p);const f=await o.responses.create(i,r?.signal?{signal:r.signal}:void 0);if(n.push({type:"start",partial:t}),await y(f,t,n,e,{serviceTier:r?.serviceTier,applyServiceTierPricing:S}),r?.signal?.aborted)throw new Error("Request was aborted");if(t.stopReason==="aborted"||t.stopReason==="error")throw new Error("An unknown error occurred");n.push({type:"done",reason:t.stopReason,message:t}),n.end()}catch(s){for(const o of t.content)delete o.index;t.stopReason=r?.signal?.aborted?"aborted":"error",t.errorMessage=s instanceof Error?s.message:JSON.stringify(s),n.push({type:"error",reason:t.stopReason,error:t}),n.end()}})(),n},W=(e,a,r)=>{const n=r?.apiKey||u(e.provider);if(!n)throw new Error(`No API key for provider: ${e.provider}`);const t=l(e,r,n),s=g(e)?r?.reasoning:h(r?.reasoning);return I(e,a,{...t,reasoningEffort:s})};function O(e,a,r,n){if(!r){if(!c.OPENAI_API_KEY)throw new Error("OpenAI API key is required. Set OPENAI_API_KEY environment variable or pass it as an argument.");r=c.OPENAI_API_KEY}const t={...e.headers};if(e.provider==="github-copilot"){const s=v(a.messages),o=R({messages:a.messages,hasImages:s});Object.assign(t,o)}return n&&Object.assign(t,n),new d({apiKey:r,baseURL:e.baseUrl,dangerouslyAllowBrowser:!0,defaultHeaders:t})}function P(e,a,r){const n=_(e,a,w),t=A(r?.cacheRetention),s={model:e.id,input:n,stream:!0,prompt_cache_key:t==="none"?void 0:r?.sessionId,prompt_cache_retention:b(e.baseUrl,t),store:!1};return r?.maxTokens&&(s.max_output_tokens=r?.maxTokens),r?.temperature!==void 0&&(s.temperature=r?.temperature),r?.serviceTier!==void 0&&(s.service_tier=r.serviceTier),a.tools&&(s.tools=E(a.tools)),e.reasoning&&(r?.reasoningEffort||r?.reasoningSummary?(s.reasoning={effort:r?.reasoningEffort||"medium",summary:r?.reasoningSummary||"auto"},s.include=["reasoning.encrypted_content"]):s.reasoning={effort:"none"}),s}function T(e){switch(e){case"flex":return .5;case"priority":return 2;default:return 1}}function S(e,a){const r=T(a);r!==1&&(e.cost.input*=r,e.cost.output*=r,e.cost.cacheRead*=r,e.cost.cacheWrite*=r,e.cost.total=e.cost.input+e.cost.output+e.cost.cacheRead+e.cost.cacheWrite)}export{I as streamOpenAIResponses,W as streamSimpleOpenAIResponses};
@@ -1,4 +1,4 @@
1
- import{a as $,t as v}from"./index-Dw4MBGs3.js";import{s as S}from"./hash-DMDecQcg.js";import{p as x}from"./json-parse-0sc64RJd.js";import{s as _}from"./sanitize-unicode-cmozpu7l.js";function C(o,t){const l={v:1,id:o};return t&&(l.phase=t),JSON.stringify(l)}function T(o){if(o){if(o.startsWith("{"))try{const t=JSON.parse(o);if(t.v===1&&typeof t.id=="string")return t.phase==="commentary"||t.phase==="final_answer"?{id:t.id,phase:t.phase}:{id:t.id}}catch{}return{id:o}}}function b(o,t,l,h){const y=[],s=n=>{const r=n.replace(/[^a-zA-Z0-9_-]/g,"_");return(r.length>64?r.slice(0,64):r).replace(/_+$/,"")},i=n=>{const r=`fc_${S(n)}`;return r.length>64?r.slice(0,64):r},k=(n,r,m)=>{if(!l.has(o.provider)||!n.includes("|"))return s(n);const[f,g]=n.split("|"),d=s(f);let p=m.provider!==o.provider||m.api!==o.api?i(g):s(g);return p.startsWith("fc_")||(p=s(`fc_${p}`)),`${d}|${p}`},u=v(t.messages,o,k);if((h?.includeSystemPrompt??!0)&&t.systemPrompt){const n=o.reasoning?"developer":"system";y.push({role:n,content:_(t.systemPrompt)})}let e=0;for(const n of u){if(n.role==="user")if(typeof n.content=="string")y.push({role:"user",content:[{type:"input_text",text:_(n.content)}]});else{const r=n.content.map(f=>f.type==="text"?{type:"input_text",text:_(f.text)}:{type:"input_image",detail:"auto",image_url:`data:${f.mimeType};base64,${f.data}`}),m=o.input.includes("image")?r:r.filter(f=>f.type!=="input_image");if(m.length===0)continue;y.push({role:"user",content:m})}else if(n.role==="assistant"){const r=[],m=n,f=m.model!==o.id&&m.provider===o.provider&&m.api===o.api;for(const g of n.content)if(g.type==="thinking"){if(g.thinkingSignature){const d=JSON.parse(g.thinkingSignature);r.push(d)}}else if(g.type==="text"){const d=g,c=T(d.textSignature);let p=c?.id;p?p.length>64&&(p=`msg_${S(p)}`):p=`msg_${e}`,r.push({type:"message",role:"assistant",content:[{type:"output_text",text:_(d.text),annotations:[]}],status:"completed",id:p,phase:c?.phase})}else if(g.type==="toolCall"){const d=g,[c,p]=d.id.split("|");let I=p;f&&I?.startsWith("fc_")&&(I=void 0),r.push({type:"function_call",id:I,call_id:c,name:d.name,arguments:JSON.stringify(d.arguments)})}if(r.length===0)continue;y.push(...r)}else if(n.role==="toolResult"){const r=n.content.filter(c=>c.type==="text").map(c=>c.text).join(`
1
+ import{a as $,t as v}from"./index-9S0E3bQQ.js";import{s as S}from"./hash-DMDecQcg.js";import{p as x}from"./json-parse-BPYifSYg.js";import{s as _}from"./sanitize-unicode-cmozpu7l.js";function C(o,t){const l={v:1,id:o};return t&&(l.phase=t),JSON.stringify(l)}function T(o){if(o){if(o.startsWith("{"))try{const t=JSON.parse(o);if(t.v===1&&typeof t.id=="string")return t.phase==="commentary"||t.phase==="final_answer"?{id:t.id,phase:t.phase}:{id:t.id}}catch{}return{id:o}}}function b(o,t,l,h){const y=[],s=n=>{const r=n.replace(/[^a-zA-Z0-9_-]/g,"_");return(r.length>64?r.slice(0,64):r).replace(/_+$/,"")},i=n=>{const r=`fc_${S(n)}`;return r.length>64?r.slice(0,64):r},k=(n,r,m)=>{if(!l.has(o.provider)||!n.includes("|"))return s(n);const[f,g]=n.split("|"),d=s(f);let p=m.provider!==o.provider||m.api!==o.api?i(g):s(g);return p.startsWith("fc_")||(p=s(`fc_${p}`)),`${d}|${p}`},u=v(t.messages,o,k);if((h?.includeSystemPrompt??!0)&&t.systemPrompt){const n=o.reasoning?"developer":"system";y.push({role:n,content:_(t.systemPrompt)})}let e=0;for(const n of u){if(n.role==="user")if(typeof n.content=="string")y.push({role:"user",content:[{type:"input_text",text:_(n.content)}]});else{const r=n.content.map(f=>f.type==="text"?{type:"input_text",text:_(f.text)}:{type:"input_image",detail:"auto",image_url:`data:${f.mimeType};base64,${f.data}`}),m=o.input.includes("image")?r:r.filter(f=>f.type!=="input_image");if(m.length===0)continue;y.push({role:"user",content:m})}else if(n.role==="assistant"){const r=[],m=n,f=m.model!==o.id&&m.provider===o.provider&&m.api===o.api;for(const g of n.content)if(g.type==="thinking"){if(g.thinkingSignature){const d=JSON.parse(g.thinkingSignature);r.push(d)}}else if(g.type==="text"){const d=g,c=T(d.textSignature);let p=c?.id;p?p.length>64&&(p=`msg_${S(p)}`):p=`msg_${e}`,r.push({type:"message",role:"assistant",content:[{type:"output_text",text:_(d.text),annotations:[]}],status:"completed",id:p,phase:c?.phase})}else if(g.type==="toolCall"){const d=g,[c,p]=d.id.split("|");let I=p;f&&I?.startsWith("fc_")&&(I=void 0),r.push({type:"function_call",id:I,call_id:c,name:d.name,arguments:JSON.stringify(d.arguments)})}if(r.length===0)continue;y.push(...r)}else if(n.role==="toolResult"){const r=n.content.filter(c=>c.type==="text").map(c=>c.text).join(`
2
2
  `),m=n.content.some(c=>c.type==="image"),f=r.length>0,[g]=n.toolCallId.split("|");let d;if(m&&o.input.includes("image")){const c=[];f&&c.push({type:"input_text",text:_(r)});for(const p of n.content)p.type==="image"&&c.push({type:"input_image",detail:"auto",image_url:`data:${p.mimeType};base64,${p.data}`});d=c}else d=_(f?r:"(see attached image)");y.push({type:"function_call_output",call_id:g,output:d})}e++}return y}function M(o,t){const l=t?.strict===void 0?!1:t.strict;return o.map(h=>({type:"function",name:h.name,description:h.description,parameters:h.parameters,strict:l}))}async function N(o,t,l,h,y){let s=null,i=null;const k=t.content,u=()=>k.length-1;for await(const a of o)if(a.type==="response.created")t.responseId=a.response.id;else if(a.type==="response.output_item.added"){const e=a.item;e.type==="reasoning"?(s=e,i={type:"thinking",thinking:""},t.content.push(i),l.push({type:"thinking_start",contentIndex:u(),partial:t})):e.type==="message"?(s=e,i={type:"text",text:""},t.content.push(i),l.push({type:"text_start",contentIndex:u(),partial:t})):e.type==="function_call"&&(s=e,i={type:"toolCall",id:`${e.call_id}|${e.id}`,name:e.name,arguments:{},partialJson:e.arguments||""},t.content.push(i),l.push({type:"toolcall_start",contentIndex:u(),partial:t}))}else if(a.type==="response.reasoning_summary_part.added")s&&s.type==="reasoning"&&(s.summary=s.summary||[],s.summary.push(a.part));else if(a.type==="response.reasoning_summary_text.delta"){if(s?.type==="reasoning"&&i?.type==="thinking"){s.summary=s.summary||[];const e=s.summary[s.summary.length-1];e&&(i.thinking+=a.delta,e.text+=a.delta,l.push({type:"thinking_delta",contentIndex:u(),delta:a.delta,partial:t}))}}else if(a.type==="response.reasoning_summary_part.done"){if(s?.type==="reasoning"&&i?.type==="thinking"){s.summary=s.summary||[];const e=s.summary[s.summary.length-1];e&&(i.thinking+=`
3
3
 
4
4
  `,e.text+=`
@@ -1,2 +1,2 @@
1
- import{G as nn}from"./index-Dw4MBGs3.js";import{r as nt}from"./___vite-browser-external_commonjs-proxy-BWNVNhfA.js";function on(j,De){for(var z=0;z<De.length;z++){const Q=De[z];if(typeof Q!="string"&&!Array.isArray(Q)){for(const F in Q)if(F!=="default"&&!(F in j)){const ie=Object.getOwnPropertyDescriptor(Q,F);ie&&Object.defineProperty(j,F,ie.get?ie:{enumerable:!0,get:()=>Q[F]})}}}return Object.freeze(Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}))}var hr={exports:{}},it;function an(){return it||(it=1,(function(j,De){var z=void 0,Q=function(F){return z||(z=new Promise(function(ie,at){var I=typeof F<"u"?F:{},mr=I.onAbort;I.onAbort=function(e){at(new Error(e)),mr&&mr(e)},I.postRun=I.postRun||[],I.postRun.push(function(){ie(I)}),j=void 0;var s;s||=typeof I<"u"?I:{};var ut=!!globalThis.window,Ie=!!globalThis.WorkerGlobalScope,de=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";s.onRuntimeInitialized=function(){function e(o,l){switch(typeof l){case"boolean":rn(o,l?1:0);break;case"number":Ht(o,l);break;case"string":Kt(o,l,-1,-1);break;case"object":if(l===null)Kr(o);else if(l.length!=null){var h=Le(l.length);q.set(l,h),en(o,h,l.length,-1),ce(h)}else Ue(o,"Wrong API use : tried to return a value of an unknown type ("+l+").",-1);break;default:Kr(o)}}function r(o,l){for(var h=[],m=0;m<o;m+=1){var w=W(l+4*m,"i32"),y=Yt(w);if(y===1||y===2)w=Jt(w);else if(y===3)w=Gt(w);else if(y===4){y=w,w=Ct(y),y=Zt(y);for(var T=new Uint8Array(w),L=0;L<w;L+=1)T[L]=q[y+L];w=T}else w=null;h.push(w)}return h}function t(o,l){this.Qa=o,this.db=l,this.Oa=1,this.lb=[]}function n(o,l){if(this.db=l,this.eb=Oe(o),this.eb===null)throw Error("Unable to allocate memory for the SQL string");this.kb=this.eb,this.Za=this.qb=null}function i(o){if(this.filename="dbfile_"+(4294967295*Math.random()>>>0),o!=null){var l=this.filename,h="/",m=l;if(h&&(h=typeof h=="string"?h:Je(h),m=l?Ce(h+"/"+l):h),l=qr(!0,!0),m=kt(m,l),o){if(typeof o=="string"){h=Array(o.length);for(var w=0,y=o.length;w<y;++w)h[w]=o.charCodeAt(w);o=h}Ne(m,l|146),h=ne(m,577),Qr(h,o,0,o.length,0),nr(h),Ne(m,l)}}this.handleError(c(this.filename,a)),this.db=W(a,"i32"),rt(this.db),this.fb={},this.Sa={}}var a=H(4),u=s.cwrap,c=u("sqlite3_open","number",["string","number"]),b=u("sqlite3_close_v2","number",["number"]),p=u("sqlite3_exec","number",["number","string","number","number","number"]),g=u("sqlite3_changes","number",["number"]),M=u("sqlite3_prepare_v2","number",["number","string","number","number","number"]),Cr=u("sqlite3_sql","string",["number"]),Ot=u("sqlite3_normalized_sql","string",["number"]),Gr=u("sqlite3_prepare_v2","number",["number","number","number","number","number"]),Lt=u("sqlite3_bind_text","number",["number","number","number","number","number"]),Zr=u("sqlite3_bind_blob","number",["number","number","number","number","number"]),xt=u("sqlite3_bind_double","number",["number","number","number"]),Tt=u("sqlite3_bind_int","number",["number","number","number"]),Pt=u("sqlite3_bind_parameter_index","number",["number","string"]),Ut=u("sqlite3_step","number",["number"]),Dt=u("sqlite3_errmsg","string",["number"]),It=u("sqlite3_column_count","number",["number"]),Wt=u("sqlite3_data_count","number",["number"]),jt=u("sqlite3_column_double","number",["number","number"]),Jr=u("sqlite3_column_text","string",["number","number"]),zt=u("sqlite3_column_blob","number",["number","number"]),Qt=u("sqlite3_column_bytes","number",["number","number"]),Ft=u("sqlite3_column_type","number",["number","number"]),$t=u("sqlite3_column_name","string",["number","number"]),Bt=u("sqlite3_reset","number",["number"]),Vt=u("sqlite3_clear_bindings","number",["number"]),Xt=u("sqlite3_finalize","number",["number"]),Hr=u("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),Yt=u("sqlite3_value_type","number",["number"]),Ct=u("sqlite3_value_bytes","number",["number"]),Gt=u("sqlite3_value_text","string",["number"]),Zt=u("sqlite3_value_blob","number",["number"]),Jt=u("sqlite3_value_double","number",["number"]),Ht=u("sqlite3_result_double","",["number","number"]),Kr=u("sqlite3_result_null","",["number"]),Kt=u("sqlite3_result_text","",["number","string","number","number"]),en=u("sqlite3_result_blob","",["number","number","number","number"]),rn=u("sqlite3_result_int","",["number","number"]),Ue=u("sqlite3_result_error","",["number","string","number"]),et=u("sqlite3_aggregate_context","number",["number","number"]),rt=u("RegisterExtensionFunctions","number",["number"]),tt=u("sqlite3_update_hook","number",["number","number","number"]);t.prototype.bind=function(o){if(!this.Qa)throw"Statement closed";return this.reset(),Array.isArray(o)?this.Cb(o):o!=null&&typeof o=="object"?this.Db(o):!0},t.prototype.step=function(){if(!this.Qa)throw"Statement closed";this.Oa=1;var o=Ut(this.Qa);switch(o){case 100:return!0;case 101:return!1;default:throw this.db.handleError(o)}},t.prototype.wb=function(o){return o==null&&(o=this.Oa,this.Oa+=1),jt(this.Qa,o)},t.prototype.Gb=function(o){if(o==null&&(o=this.Oa,this.Oa+=1),o=Jr(this.Qa,o),typeof BigInt!="function")throw Error("BigInt is not supported");return BigInt(o)},t.prototype.Hb=function(o){return o==null&&(o=this.Oa,this.Oa+=1),Jr(this.Qa,o)},t.prototype.getBlob=function(o){o==null&&(o=this.Oa,this.Oa+=1);var l=Qt(this.Qa,o);o=zt(this.Qa,o);for(var h=new Uint8Array(l),m=0;m<l;m+=1)h[m]=q[o+m];return h},t.prototype.get=function(o,l){l=l||{},o!=null&&this.bind(o)&&this.step(),o=[];for(var h=Wt(this.Qa),m=0;m<h;m+=1)switch(Ft(this.Qa,m)){case 1:var w=l.useBigInt?this.Gb(m):this.wb(m);o.push(w);break;case 2:o.push(this.wb(m));break;case 3:o.push(this.Hb(m));break;case 4:o.push(this.getBlob(m));break;default:o.push(null)}return o},t.prototype.getColumnNames=function(){for(var o=[],l=It(this.Qa),h=0;h<l;h+=1)o.push($t(this.Qa,h));return o},t.prototype.getAsObject=function(o,l){o=this.get(o,l),l=this.getColumnNames();for(var h={},m=0;m<l.length;m+=1)h[l[m]]=o[m];return h},t.prototype.getSQL=function(){return Cr(this.Qa)},t.prototype.getNormalizedSQL=function(){return Ot(this.Qa)},t.prototype.run=function(o){return o!=null&&this.bind(o),this.step(),this.reset()},t.prototype.tb=function(o,l){l==null&&(l=this.Oa,this.Oa+=1),o=Oe(o),this.lb.push(o),this.db.handleError(Lt(this.Qa,l,o,-1,0))},t.prototype.Bb=function(o,l){l==null&&(l=this.Oa,this.Oa+=1);var h=Le(o.length);q.set(o,h),this.lb.push(h),this.db.handleError(Zr(this.Qa,l,h,o.length,0))},t.prototype.sb=function(o,l){l==null&&(l=this.Oa,this.Oa+=1),this.db.handleError((o===(o|0)?Tt:xt)(this.Qa,l,o))},t.prototype.Eb=function(o){o==null&&(o=this.Oa,this.Oa+=1),Zr(this.Qa,o,0,0,0)},t.prototype.ub=function(o,l){switch(l==null&&(l=this.Oa,this.Oa+=1),typeof o){case"string":this.tb(o,l);return;case"number":this.sb(o,l);return;case"bigint":this.tb(o.toString(),l);return;case"boolean":this.sb(o+0,l);return;case"object":if(o===null){this.Eb(l);return}if(o.length!=null){this.Bb(o,l);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+o+")."},t.prototype.Db=function(o){var l=this;return Object.keys(o).forEach(function(h){var m=Pt(l.Qa,h);m!==0&&l.ub(o[h],m)}),!0},t.prototype.Cb=function(o){for(var l=0;l<o.length;l+=1)this.ub(o[l],l+1);return!0},t.prototype.reset=function(){return this.freemem(),Vt(this.Qa)===0&&Bt(this.Qa)===0},t.prototype.freemem=function(){for(var o;(o=this.lb.pop())!==void 0;)ce(o)},t.prototype.free=function(){this.freemem();var o=Xt(this.Qa)===0;return delete this.db.fb[this.Qa],this.Qa=0,o},n.prototype.next=function(){if(this.eb===null)return{done:!0};if(this.Za!==null&&(this.Za.free(),this.Za=null),!this.db.db)throw this.nb(),Error("Database closed");var o=Te(),l=H(4);le(a),le(l);try{this.db.handleError(Gr(this.db.db,this.kb,-1,a,l)),this.kb=W(l,"i32");var h=W(a,"i32");return h===0?(this.nb(),{done:!0}):(this.Za=new t(h,this.db),this.db.fb[h]=this.Za,{value:this.Za,done:!1})}catch(m){throw this.qb=E(this.kb),this.nb(),m}finally{xe(o)}},n.prototype.nb=function(){ce(this.eb),this.eb=null},n.prototype.getRemainingSQL=function(){return this.qb!==null?this.qb:E(this.kb)},typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"&&(n.prototype[Symbol.iterator]=function(){return this}),i.prototype.run=function(o,l){if(!this.db)throw"Database closed";if(l){o=this.prepare(o,l);try{o.step()}finally{o.free()}}else this.handleError(p(this.db,o,0,0,a));return this},i.prototype.exec=function(o,l,h){if(!this.db)throw"Database closed";var m=null,w=null,y=null;try{y=w=Oe(o);var T=H(4);for(o=[];W(y,"i8")!==0;){le(a),le(T),this.handleError(Gr(this.db,y,-1,a,T));var L=W(a,"i32");if(y=W(T,"i32"),L!==0){var R=null;for(m=new t(L,this),l!=null&&m.bind(l);m.step();)R===null&&(R={columns:m.getColumnNames(),values:[]},o.push(R)),R.values.push(m.get(null,h));m.free()}}return o}catch(P){throw m&&m.free(),P}finally{w&&ce(w)}},i.prototype.each=function(o,l,h,m,w){typeof l=="function"&&(m=h,h=l,l=void 0),o=this.prepare(o,l);try{for(;o.step();)h(o.getAsObject(null,w))}finally{o.free()}if(typeof m=="function")return m()},i.prototype.prepare=function(o,l){if(le(a),this.handleError(M(this.db,o,-1,a,0)),o=W(a,"i32"),o===0)throw"Nothing to prepare";var h=new t(o,this);return l!=null&&h.bind(l),this.fb[o]=h},i.prototype.iterateStatements=function(o){return new n(o,this)},i.prototype.export=function(){Object.values(this.fb).forEach(function(l){l.free()}),Object.values(this.Sa).forEach(V),this.Sa={},this.handleError(b(this.db));var o=Et(this.filename);return this.handleError(c(this.filename,a)),this.db=W(a,"i32"),rt(this.db),o},i.prototype.close=function(){this.db!==null&&(Object.values(this.fb).forEach(function(o){o.free()}),Object.values(this.Sa).forEach(V),this.Sa={},this.Ya&&(V(this.Ya),this.Ya=void 0),this.handleError(b(this.db)),Dr("/"+this.filename),this.db=null)},i.prototype.handleError=function(o){if(o===0)return null;throw o=Dt(this.db),Error(o)},i.prototype.getRowsModified=function(){return g(this.db)},i.prototype.create_function=function(o,l){Object.prototype.hasOwnProperty.call(this.Sa,o)&&(V(this.Sa[o]),delete this.Sa[o]);var h=me(function(m,w,y){w=r(w,y);try{var T=l.apply(null,w)}catch(L){Ue(m,L,-1);return}e(m,T)},"viii");return this.Sa[o]=h,this.handleError(Hr(this.db,o,l.length,1,0,h,0,0,0)),this},i.prototype.create_aggregate=function(o,l){var h=l.init||function(){return null},m=l.finalize||function(R){return R},w=l.step;if(!w)throw"An aggregate function must have a step function in "+o;var y={};Object.hasOwnProperty.call(this.Sa,o)&&(V(this.Sa[o]),delete this.Sa[o]),l=o+"__finalize",Object.hasOwnProperty.call(this.Sa,l)&&(V(this.Sa[l]),delete this.Sa[l]);var T=me(function(R,P,fr){var K=et(R,1);Object.hasOwnProperty.call(y,K)||(y[K]=h()),P=r(P,fr),P=[y[K]].concat(P);try{y[K]=w.apply(null,P)}catch(tn){delete y[K],Ue(R,tn,-1)}},"viii"),L=me(function(R){var P=et(R,1);try{var fr=m(y[P])}catch(K){delete y[P],Ue(R,K,-1);return}e(R,fr),delete y[P]},"vi");return this.Sa[o]=T,this.Sa[l]=L,this.handleError(Hr(this.db,o,w.length-1,1,0,0,T,L,0)),this},i.prototype.updateHook=function(o){return this.Ya&&(tt(this.db,0,0),V(this.Ya),this.Ya=void 0),o?(this.Ya=me(function(l,h,m,w,y){switch(h){case 18:l="insert";break;case 23:l="update";break;case 9:l="delete";break;default:throw"unknown operationCode in updateHook callback: "+h}if(m=E(m),w=E(w),y>Number.MAX_SAFE_INTEGER)throw"rowId too big to fit inside a Number";o(l,m,w,Number(y))},"viiiij"),tt(this.db,this.Ya,0),this):this},s.Database=i};var We="./this.program",pe=(e,r)=>{throw r},je=globalThis.document?.currentScript?.src;typeof __filename<"u"?je=__filename:Ie&&(je=self.location.href);var we="",ze,be;if(de){var Qe=nt;we=__dirname+"/",be=e=>(e=ve(e)?new URL(e):e,Qe.readFileSync(e)),ze=async e=>(e=ve(e)?new URL(e):e,Qe.readFileSync(e,void 0)),1<process.argv.length&&(We=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),j.exports=s,pe=(e,r)=>{throw process.exitCode=e,r}}else if(ut||Ie){try{we=new URL(".",je).href}catch{}Ie&&(be=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),ze=async e=>{if(ve(e))return new Promise((t,n)=>{var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=()=>{i.status==200||i.status==0&&i.response?t(i.response):n(i.status)},i.onerror=n,i.send(null)});var r=await fetch(e,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw Error(r.status+" : "+r.url)}}var Fe=console.log.bind(console),Y=console.error.bind(console),oe,ye=!1,$e,ve=e=>e.startsWith("file://"),q,N,ae,k,v,Be,Ve,x;function cr(){var e=Pe.buffer;q=new Int8Array(e),ae=new Int16Array(e),N=new Uint8Array(e),k=new Int32Array(e),v=new Uint32Array(e),Be=new Float32Array(e),Ve=new Float64Array(e),x=new BigInt64Array(e),new BigUint64Array(e)}function ue(e){throw s.onAbort?.(e),e="Aborted("+e+")",Y(e),ye=!0,new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info.")}var Xe;async function st(e){if(!oe)try{var r=await ze(e);return new Uint8Array(r)}catch{}if(e==Xe&&oe)e=new Uint8Array(oe);else if(be)e=be(e);else throw"both async and sync fetching of the wasm failed";return e}async function lt(e,r){try{var t=await st(e);return await WebAssembly.instantiate(t,r)}catch(n){Y(`failed to asynchronously prepare wasm: ${n}`),ue(n)}}async function ft(e){var r=Xe;if(!oe&&!ve(r)&&!de)try{var t=fetch(r,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(t,e)}catch(n){Y(`wasm streaming compile failed: ${n}`),Y("falling back to ArrayBuffer instantiation")}return lt(r,e)}class Ye{name="ExitStatus";constructor(r){this.message=`Program terminated with exit(${r})`,this.status=r}}var dr=e=>{for(;0<e.length;)e.shift()(s)},pr=[],wr=[],ht=()=>{var e=s.preRun.shift();wr.push(e)},C=0,se=null;function W(e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":return q[e];case"i8":return q[e];case"i16":return ae[e>>1];case"i32":return k[e>>2];case"i64":return x[e>>3];case"float":return Be[e>>2];case"double":return Ve[e>>3];case"*":return v[e>>2];default:ue(`invalid type for getValue: ${r}`)}}var _e=!0;function le(e){var r="i32";switch(r.endsWith("*")&&(r="*"),r){case"i1":q[e]=0;break;case"i8":q[e]=0;break;case"i16":ae[e>>1]=0;break;case"i32":k[e>>2]=0;break;case"i64":x[e>>3]=BigInt(0);break;case"float":Be[e>>2]=0;break;case"double":Ve[e>>3]=0;break;case"*":v[e>>2]=0;break;default:ue(`invalid type for setValue: ${r}`)}}var br=new TextDecoder,yr=(e,r,t,n)=>{if(t=r+t,n)return t;for(;e[r]&&!(r>=t);)++r;return r},E=(e,r,t)=>e?br.decode(N.subarray(e,yr(N,e,r,t))):"",vr=(e,r)=>{for(var t=0,n=e.length-1;0<=n;n--){var i=e[n];i==="."?e.splice(n,1):i===".."?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},Ce=e=>{var r=e.charAt(0)==="/",t=e.slice(-1)==="/";return(e=vr(e.split("/").filter(n=>!!n),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},_r=e=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=r[0],r=r[1],!e&&!r?".":(r&&=r.slice(0,-1),e+r)},ge=e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],mt=()=>{if(de){var e=nt;return r=>e.randomFillSync(r)}return r=>crypto.getRandomValues(r)},gr=e=>{(gr=mt())(e)},ct=(...e)=>{for(var r="",t=!1,n=e.length-1;-1<=n&&!t;n--){if(t=0<=n?e[n]:"/",typeof t!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";r=t+"/"+r,t=t.charAt(0)==="/"}return r=vr(r.split("/").filter(i=>!!i),!t).join("/"),(t?"/":"")+r||"."},ke=e=>{var r=yr(e,0);return br.decode(e.buffer?e.subarray(0,r):new Uint8Array(e.slice(0,r)))},Ge=[],ee=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);127>=n?r++:2047>=n?r+=2:55296<=n&&57343>=n?(r+=4,++t):r+=3}return r},U=(e,r,t,n)=>{if(!(0<n))return 0;var i=t;n=t+n-1;for(var a=0;a<e.length;++a){var u=e.codePointAt(a);if(127>=u){if(t>=n)break;r[t++]=u}else if(2047>=u){if(t+1>=n)break;r[t++]=192|u>>6,r[t++]=128|u&63}else if(65535>=u){if(t+2>=n)break;r[t++]=224|u>>12,r[t++]=128|u>>6&63,r[t++]=128|u&63}else{if(t+3>=n)break;r[t++]=240|u>>18,r[t++]=128|u>>12&63,r[t++]=128|u>>6&63,r[t++]=128|u&63,a++}}return r[t]=0,t-i},kr=[];function Er(e,r){kr[e]={input:[],output:[],cb:r},rr(e,dt)}var dt={open(e){var r=kr[e.node.rdev];if(!r)throw new f(43);e.tty=r,e.seekable=!1},close(e){e.tty.cb.fsync(e.tty)},fsync(e){e.tty.cb.fsync(e.tty)},read(e,r,t,n){if(!e.tty||!e.tty.cb.xb)throw new f(60);for(var i=0,a=0;a<n;a++){try{var u=e.tty.cb.xb(e.tty)}catch{throw new f(29)}if(u===void 0&&i===0)throw new f(6);if(u==null)break;i++,r[t+a]=u}return i&&(e.node.atime=Date.now()),i},write(e,r,t,n){if(!e.tty||!e.tty.cb.rb)throw new f(60);try{for(var i=0;i<n;i++)e.tty.cb.rb(e.tty,r[t+i])}catch{throw new f(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),i}},pt={xb(){e:{if(!Ge.length){var e=null;if(de){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=Qe.readSync(n,r,0,256)}catch(i){if(i.toString().includes("EOF"))t=0;else throw i}0<t&&(e=r.slice(0,t).toString("utf-8"))}else globalThis.window?.prompt&&(e=window.prompt("Input: "),e!==null&&(e+=`
1
+ import{G as nn}from"./index-9S0E3bQQ.js";import{r as nt}from"./___vite-browser-external_commonjs-proxy-BrXJLmR5.js";function on(j,De){for(var z=0;z<De.length;z++){const Q=De[z];if(typeof Q!="string"&&!Array.isArray(Q)){for(const F in Q)if(F!=="default"&&!(F in j)){const ie=Object.getOwnPropertyDescriptor(Q,F);ie&&Object.defineProperty(j,F,ie.get?ie:{enumerable:!0,get:()=>Q[F]})}}}return Object.freeze(Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}))}var hr={exports:{}},it;function an(){return it||(it=1,(function(j,De){var z=void 0,Q=function(F){return z||(z=new Promise(function(ie,at){var I=typeof F<"u"?F:{},mr=I.onAbort;I.onAbort=function(e){at(new Error(e)),mr&&mr(e)},I.postRun=I.postRun||[],I.postRun.push(function(){ie(I)}),j=void 0;var s;s||=typeof I<"u"?I:{};var ut=!!globalThis.window,Ie=!!globalThis.WorkerGlobalScope,de=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";s.onRuntimeInitialized=function(){function e(o,l){switch(typeof l){case"boolean":rn(o,l?1:0);break;case"number":Ht(o,l);break;case"string":Kt(o,l,-1,-1);break;case"object":if(l===null)Kr(o);else if(l.length!=null){var h=Le(l.length);q.set(l,h),en(o,h,l.length,-1),ce(h)}else Ue(o,"Wrong API use : tried to return a value of an unknown type ("+l+").",-1);break;default:Kr(o)}}function r(o,l){for(var h=[],m=0;m<o;m+=1){var w=W(l+4*m,"i32"),y=Yt(w);if(y===1||y===2)w=Jt(w);else if(y===3)w=Gt(w);else if(y===4){y=w,w=Ct(y),y=Zt(y);for(var T=new Uint8Array(w),L=0;L<w;L+=1)T[L]=q[y+L];w=T}else w=null;h.push(w)}return h}function t(o,l){this.Qa=o,this.db=l,this.Oa=1,this.lb=[]}function n(o,l){if(this.db=l,this.eb=Oe(o),this.eb===null)throw Error("Unable to allocate memory for the SQL string");this.kb=this.eb,this.Za=this.qb=null}function i(o){if(this.filename="dbfile_"+(4294967295*Math.random()>>>0),o!=null){var l=this.filename,h="/",m=l;if(h&&(h=typeof h=="string"?h:Je(h),m=l?Ce(h+"/"+l):h),l=qr(!0,!0),m=kt(m,l),o){if(typeof o=="string"){h=Array(o.length);for(var w=0,y=o.length;w<y;++w)h[w]=o.charCodeAt(w);o=h}Ne(m,l|146),h=ne(m,577),Qr(h,o,0,o.length,0),nr(h),Ne(m,l)}}this.handleError(c(this.filename,a)),this.db=W(a,"i32"),rt(this.db),this.fb={},this.Sa={}}var a=H(4),u=s.cwrap,c=u("sqlite3_open","number",["string","number"]),b=u("sqlite3_close_v2","number",["number"]),p=u("sqlite3_exec","number",["number","string","number","number","number"]),g=u("sqlite3_changes","number",["number"]),M=u("sqlite3_prepare_v2","number",["number","string","number","number","number"]),Cr=u("sqlite3_sql","string",["number"]),Ot=u("sqlite3_normalized_sql","string",["number"]),Gr=u("sqlite3_prepare_v2","number",["number","number","number","number","number"]),Lt=u("sqlite3_bind_text","number",["number","number","number","number","number"]),Zr=u("sqlite3_bind_blob","number",["number","number","number","number","number"]),xt=u("sqlite3_bind_double","number",["number","number","number"]),Tt=u("sqlite3_bind_int","number",["number","number","number"]),Pt=u("sqlite3_bind_parameter_index","number",["number","string"]),Ut=u("sqlite3_step","number",["number"]),Dt=u("sqlite3_errmsg","string",["number"]),It=u("sqlite3_column_count","number",["number"]),Wt=u("sqlite3_data_count","number",["number"]),jt=u("sqlite3_column_double","number",["number","number"]),Jr=u("sqlite3_column_text","string",["number","number"]),zt=u("sqlite3_column_blob","number",["number","number"]),Qt=u("sqlite3_column_bytes","number",["number","number"]),Ft=u("sqlite3_column_type","number",["number","number"]),$t=u("sqlite3_column_name","string",["number","number"]),Bt=u("sqlite3_reset","number",["number"]),Vt=u("sqlite3_clear_bindings","number",["number"]),Xt=u("sqlite3_finalize","number",["number"]),Hr=u("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),Yt=u("sqlite3_value_type","number",["number"]),Ct=u("sqlite3_value_bytes","number",["number"]),Gt=u("sqlite3_value_text","string",["number"]),Zt=u("sqlite3_value_blob","number",["number"]),Jt=u("sqlite3_value_double","number",["number"]),Ht=u("sqlite3_result_double","",["number","number"]),Kr=u("sqlite3_result_null","",["number"]),Kt=u("sqlite3_result_text","",["number","string","number","number"]),en=u("sqlite3_result_blob","",["number","number","number","number"]),rn=u("sqlite3_result_int","",["number","number"]),Ue=u("sqlite3_result_error","",["number","string","number"]),et=u("sqlite3_aggregate_context","number",["number","number"]),rt=u("RegisterExtensionFunctions","number",["number"]),tt=u("sqlite3_update_hook","number",["number","number","number"]);t.prototype.bind=function(o){if(!this.Qa)throw"Statement closed";return this.reset(),Array.isArray(o)?this.Cb(o):o!=null&&typeof o=="object"?this.Db(o):!0},t.prototype.step=function(){if(!this.Qa)throw"Statement closed";this.Oa=1;var o=Ut(this.Qa);switch(o){case 100:return!0;case 101:return!1;default:throw this.db.handleError(o)}},t.prototype.wb=function(o){return o==null&&(o=this.Oa,this.Oa+=1),jt(this.Qa,o)},t.prototype.Gb=function(o){if(o==null&&(o=this.Oa,this.Oa+=1),o=Jr(this.Qa,o),typeof BigInt!="function")throw Error("BigInt is not supported");return BigInt(o)},t.prototype.Hb=function(o){return o==null&&(o=this.Oa,this.Oa+=1),Jr(this.Qa,o)},t.prototype.getBlob=function(o){o==null&&(o=this.Oa,this.Oa+=1);var l=Qt(this.Qa,o);o=zt(this.Qa,o);for(var h=new Uint8Array(l),m=0;m<l;m+=1)h[m]=q[o+m];return h},t.prototype.get=function(o,l){l=l||{},o!=null&&this.bind(o)&&this.step(),o=[];for(var h=Wt(this.Qa),m=0;m<h;m+=1)switch(Ft(this.Qa,m)){case 1:var w=l.useBigInt?this.Gb(m):this.wb(m);o.push(w);break;case 2:o.push(this.wb(m));break;case 3:o.push(this.Hb(m));break;case 4:o.push(this.getBlob(m));break;default:o.push(null)}return o},t.prototype.getColumnNames=function(){for(var o=[],l=It(this.Qa),h=0;h<l;h+=1)o.push($t(this.Qa,h));return o},t.prototype.getAsObject=function(o,l){o=this.get(o,l),l=this.getColumnNames();for(var h={},m=0;m<l.length;m+=1)h[l[m]]=o[m];return h},t.prototype.getSQL=function(){return Cr(this.Qa)},t.prototype.getNormalizedSQL=function(){return Ot(this.Qa)},t.prototype.run=function(o){return o!=null&&this.bind(o),this.step(),this.reset()},t.prototype.tb=function(o,l){l==null&&(l=this.Oa,this.Oa+=1),o=Oe(o),this.lb.push(o),this.db.handleError(Lt(this.Qa,l,o,-1,0))},t.prototype.Bb=function(o,l){l==null&&(l=this.Oa,this.Oa+=1);var h=Le(o.length);q.set(o,h),this.lb.push(h),this.db.handleError(Zr(this.Qa,l,h,o.length,0))},t.prototype.sb=function(o,l){l==null&&(l=this.Oa,this.Oa+=1),this.db.handleError((o===(o|0)?Tt:xt)(this.Qa,l,o))},t.prototype.Eb=function(o){o==null&&(o=this.Oa,this.Oa+=1),Zr(this.Qa,o,0,0,0)},t.prototype.ub=function(o,l){switch(l==null&&(l=this.Oa,this.Oa+=1),typeof o){case"string":this.tb(o,l);return;case"number":this.sb(o,l);return;case"bigint":this.tb(o.toString(),l);return;case"boolean":this.sb(o+0,l);return;case"object":if(o===null){this.Eb(l);return}if(o.length!=null){this.Bb(o,l);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+o+")."},t.prototype.Db=function(o){var l=this;return Object.keys(o).forEach(function(h){var m=Pt(l.Qa,h);m!==0&&l.ub(o[h],m)}),!0},t.prototype.Cb=function(o){for(var l=0;l<o.length;l+=1)this.ub(o[l],l+1);return!0},t.prototype.reset=function(){return this.freemem(),Vt(this.Qa)===0&&Bt(this.Qa)===0},t.prototype.freemem=function(){for(var o;(o=this.lb.pop())!==void 0;)ce(o)},t.prototype.free=function(){this.freemem();var o=Xt(this.Qa)===0;return delete this.db.fb[this.Qa],this.Qa=0,o},n.prototype.next=function(){if(this.eb===null)return{done:!0};if(this.Za!==null&&(this.Za.free(),this.Za=null),!this.db.db)throw this.nb(),Error("Database closed");var o=Te(),l=H(4);le(a),le(l);try{this.db.handleError(Gr(this.db.db,this.kb,-1,a,l)),this.kb=W(l,"i32");var h=W(a,"i32");return h===0?(this.nb(),{done:!0}):(this.Za=new t(h,this.db),this.db.fb[h]=this.Za,{value:this.Za,done:!1})}catch(m){throw this.qb=E(this.kb),this.nb(),m}finally{xe(o)}},n.prototype.nb=function(){ce(this.eb),this.eb=null},n.prototype.getRemainingSQL=function(){return this.qb!==null?this.qb:E(this.kb)},typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"&&(n.prototype[Symbol.iterator]=function(){return this}),i.prototype.run=function(o,l){if(!this.db)throw"Database closed";if(l){o=this.prepare(o,l);try{o.step()}finally{o.free()}}else this.handleError(p(this.db,o,0,0,a));return this},i.prototype.exec=function(o,l,h){if(!this.db)throw"Database closed";var m=null,w=null,y=null;try{y=w=Oe(o);var T=H(4);for(o=[];W(y,"i8")!==0;){le(a),le(T),this.handleError(Gr(this.db,y,-1,a,T));var L=W(a,"i32");if(y=W(T,"i32"),L!==0){var R=null;for(m=new t(L,this),l!=null&&m.bind(l);m.step();)R===null&&(R={columns:m.getColumnNames(),values:[]},o.push(R)),R.values.push(m.get(null,h));m.free()}}return o}catch(P){throw m&&m.free(),P}finally{w&&ce(w)}},i.prototype.each=function(o,l,h,m,w){typeof l=="function"&&(m=h,h=l,l=void 0),o=this.prepare(o,l);try{for(;o.step();)h(o.getAsObject(null,w))}finally{o.free()}if(typeof m=="function")return m()},i.prototype.prepare=function(o,l){if(le(a),this.handleError(M(this.db,o,-1,a,0)),o=W(a,"i32"),o===0)throw"Nothing to prepare";var h=new t(o,this);return l!=null&&h.bind(l),this.fb[o]=h},i.prototype.iterateStatements=function(o){return new n(o,this)},i.prototype.export=function(){Object.values(this.fb).forEach(function(l){l.free()}),Object.values(this.Sa).forEach(V),this.Sa={},this.handleError(b(this.db));var o=Et(this.filename);return this.handleError(c(this.filename,a)),this.db=W(a,"i32"),rt(this.db),o},i.prototype.close=function(){this.db!==null&&(Object.values(this.fb).forEach(function(o){o.free()}),Object.values(this.Sa).forEach(V),this.Sa={},this.Ya&&(V(this.Ya),this.Ya=void 0),this.handleError(b(this.db)),Dr("/"+this.filename),this.db=null)},i.prototype.handleError=function(o){if(o===0)return null;throw o=Dt(this.db),Error(o)},i.prototype.getRowsModified=function(){return g(this.db)},i.prototype.create_function=function(o,l){Object.prototype.hasOwnProperty.call(this.Sa,o)&&(V(this.Sa[o]),delete this.Sa[o]);var h=me(function(m,w,y){w=r(w,y);try{var T=l.apply(null,w)}catch(L){Ue(m,L,-1);return}e(m,T)},"viii");return this.Sa[o]=h,this.handleError(Hr(this.db,o,l.length,1,0,h,0,0,0)),this},i.prototype.create_aggregate=function(o,l){var h=l.init||function(){return null},m=l.finalize||function(R){return R},w=l.step;if(!w)throw"An aggregate function must have a step function in "+o;var y={};Object.hasOwnProperty.call(this.Sa,o)&&(V(this.Sa[o]),delete this.Sa[o]),l=o+"__finalize",Object.hasOwnProperty.call(this.Sa,l)&&(V(this.Sa[l]),delete this.Sa[l]);var T=me(function(R,P,fr){var K=et(R,1);Object.hasOwnProperty.call(y,K)||(y[K]=h()),P=r(P,fr),P=[y[K]].concat(P);try{y[K]=w.apply(null,P)}catch(tn){delete y[K],Ue(R,tn,-1)}},"viii"),L=me(function(R){var P=et(R,1);try{var fr=m(y[P])}catch(K){delete y[P],Ue(R,K,-1);return}e(R,fr),delete y[P]},"vi");return this.Sa[o]=T,this.Sa[l]=L,this.handleError(Hr(this.db,o,w.length-1,1,0,0,T,L,0)),this},i.prototype.updateHook=function(o){return this.Ya&&(tt(this.db,0,0),V(this.Ya),this.Ya=void 0),o?(this.Ya=me(function(l,h,m,w,y){switch(h){case 18:l="insert";break;case 23:l="update";break;case 9:l="delete";break;default:throw"unknown operationCode in updateHook callback: "+h}if(m=E(m),w=E(w),y>Number.MAX_SAFE_INTEGER)throw"rowId too big to fit inside a Number";o(l,m,w,Number(y))},"viiiij"),tt(this.db,this.Ya,0),this):this},s.Database=i};var We="./this.program",pe=(e,r)=>{throw r},je=globalThis.document?.currentScript?.src;typeof __filename<"u"?je=__filename:Ie&&(je=self.location.href);var we="",ze,be;if(de){var Qe=nt;we=__dirname+"/",be=e=>(e=ve(e)?new URL(e):e,Qe.readFileSync(e)),ze=async e=>(e=ve(e)?new URL(e):e,Qe.readFileSync(e,void 0)),1<process.argv.length&&(We=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),j.exports=s,pe=(e,r)=>{throw process.exitCode=e,r}}else if(ut||Ie){try{we=new URL(".",je).href}catch{}Ie&&(be=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),ze=async e=>{if(ve(e))return new Promise((t,n)=>{var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=()=>{i.status==200||i.status==0&&i.response?t(i.response):n(i.status)},i.onerror=n,i.send(null)});var r=await fetch(e,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw Error(r.status+" : "+r.url)}}var Fe=console.log.bind(console),Y=console.error.bind(console),oe,ye=!1,$e,ve=e=>e.startsWith("file://"),q,N,ae,k,v,Be,Ve,x;function cr(){var e=Pe.buffer;q=new Int8Array(e),ae=new Int16Array(e),N=new Uint8Array(e),k=new Int32Array(e),v=new Uint32Array(e),Be=new Float32Array(e),Ve=new Float64Array(e),x=new BigInt64Array(e),new BigUint64Array(e)}function ue(e){throw s.onAbort?.(e),e="Aborted("+e+")",Y(e),ye=!0,new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info.")}var Xe;async function st(e){if(!oe)try{var r=await ze(e);return new Uint8Array(r)}catch{}if(e==Xe&&oe)e=new Uint8Array(oe);else if(be)e=be(e);else throw"both async and sync fetching of the wasm failed";return e}async function lt(e,r){try{var t=await st(e);return await WebAssembly.instantiate(t,r)}catch(n){Y(`failed to asynchronously prepare wasm: ${n}`),ue(n)}}async function ft(e){var r=Xe;if(!oe&&!ve(r)&&!de)try{var t=fetch(r,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(t,e)}catch(n){Y(`wasm streaming compile failed: ${n}`),Y("falling back to ArrayBuffer instantiation")}return lt(r,e)}class Ye{name="ExitStatus";constructor(r){this.message=`Program terminated with exit(${r})`,this.status=r}}var dr=e=>{for(;0<e.length;)e.shift()(s)},pr=[],wr=[],ht=()=>{var e=s.preRun.shift();wr.push(e)},C=0,se=null;function W(e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":return q[e];case"i8":return q[e];case"i16":return ae[e>>1];case"i32":return k[e>>2];case"i64":return x[e>>3];case"float":return Be[e>>2];case"double":return Ve[e>>3];case"*":return v[e>>2];default:ue(`invalid type for getValue: ${r}`)}}var _e=!0;function le(e){var r="i32";switch(r.endsWith("*")&&(r="*"),r){case"i1":q[e]=0;break;case"i8":q[e]=0;break;case"i16":ae[e>>1]=0;break;case"i32":k[e>>2]=0;break;case"i64":x[e>>3]=BigInt(0);break;case"float":Be[e>>2]=0;break;case"double":Ve[e>>3]=0;break;case"*":v[e>>2]=0;break;default:ue(`invalid type for setValue: ${r}`)}}var br=new TextDecoder,yr=(e,r,t,n)=>{if(t=r+t,n)return t;for(;e[r]&&!(r>=t);)++r;return r},E=(e,r,t)=>e?br.decode(N.subarray(e,yr(N,e,r,t))):"",vr=(e,r)=>{for(var t=0,n=e.length-1;0<=n;n--){var i=e[n];i==="."?e.splice(n,1):i===".."?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},Ce=e=>{var r=e.charAt(0)==="/",t=e.slice(-1)==="/";return(e=vr(e.split("/").filter(n=>!!n),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},_r=e=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=r[0],r=r[1],!e&&!r?".":(r&&=r.slice(0,-1),e+r)},ge=e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],mt=()=>{if(de){var e=nt;return r=>e.randomFillSync(r)}return r=>crypto.getRandomValues(r)},gr=e=>{(gr=mt())(e)},ct=(...e)=>{for(var r="",t=!1,n=e.length-1;-1<=n&&!t;n--){if(t=0<=n?e[n]:"/",typeof t!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";r=t+"/"+r,t=t.charAt(0)==="/"}return r=vr(r.split("/").filter(i=>!!i),!t).join("/"),(t?"/":"")+r||"."},ke=e=>{var r=yr(e,0);return br.decode(e.buffer?e.subarray(0,r):new Uint8Array(e.slice(0,r)))},Ge=[],ee=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);127>=n?r++:2047>=n?r+=2:55296<=n&&57343>=n?(r+=4,++t):r+=3}return r},U=(e,r,t,n)=>{if(!(0<n))return 0;var i=t;n=t+n-1;for(var a=0;a<e.length;++a){var u=e.codePointAt(a);if(127>=u){if(t>=n)break;r[t++]=u}else if(2047>=u){if(t+1>=n)break;r[t++]=192|u>>6,r[t++]=128|u&63}else if(65535>=u){if(t+2>=n)break;r[t++]=224|u>>12,r[t++]=128|u>>6&63,r[t++]=128|u&63}else{if(t+3>=n)break;r[t++]=240|u>>18,r[t++]=128|u>>12&63,r[t++]=128|u>>6&63,r[t++]=128|u&63,a++}}return r[t]=0,t-i},kr=[];function Er(e,r){kr[e]={input:[],output:[],cb:r},rr(e,dt)}var dt={open(e){var r=kr[e.node.rdev];if(!r)throw new f(43);e.tty=r,e.seekable=!1},close(e){e.tty.cb.fsync(e.tty)},fsync(e){e.tty.cb.fsync(e.tty)},read(e,r,t,n){if(!e.tty||!e.tty.cb.xb)throw new f(60);for(var i=0,a=0;a<n;a++){try{var u=e.tty.cb.xb(e.tty)}catch{throw new f(29)}if(u===void 0&&i===0)throw new f(6);if(u==null)break;i++,r[t+a]=u}return i&&(e.node.atime=Date.now()),i},write(e,r,t,n){if(!e.tty||!e.tty.cb.rb)throw new f(60);try{for(var i=0;i<n;i++)e.tty.cb.rb(e.tty,r[t+i])}catch{throw new f(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),i}},pt={xb(){e:{if(!Ge.length){var e=null;if(de){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=Qe.readSync(n,r,0,256)}catch(i){if(i.toString().includes("EOF"))t=0;else throw i}0<t&&(e=r.slice(0,t).toString("utf-8"))}else globalThis.window?.prompt&&(e=window.prompt("Input: "),e!==null&&(e+=`
2
2
  `));if(!e){e=null;break e}r=Array(ee(e)+1),e=U(e,r,0,r.length),r.length=e,Ge=r}e=Ge.shift()}return e},rb(e,r){r===null||r===10?(Fe(ke(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){0<e.output?.length&&(Fe(ke(e.output)),e.output=[])},Tb(){return{Ob:25856,Qb:5,Nb:191,Pb:35387,Mb:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},Ub(){return 0},Vb(){return[24,80]}},wt={rb(e,r){r===null||r===10?(Y(ke(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){0<e.output?.length&&(Y(ke(e.output)),e.output=[])}},d={Wa:null,Xa(){return d.createNode(null,"/",16895,0)},createNode(e,r,t,n){if((t&61440)===24576||(t&61440)===4096)throw new f(63);return d.Wa||(d.Wa={dir:{node:{Ta:d.La.Ta,Ua:d.La.Ua,lookup:d.La.lookup,hb:d.La.hb,rename:d.La.rename,unlink:d.La.unlink,rmdir:d.La.rmdir,readdir:d.La.readdir,symlink:d.La.symlink},stream:{Va:d.Ma.Va}},file:{node:{Ta:d.La.Ta,Ua:d.La.Ua},stream:{Va:d.Ma.Va,read:d.Ma.read,write:d.Ma.write,ib:d.Ma.ib,jb:d.Ma.jb}},link:{node:{Ta:d.La.Ta,Ua:d.La.Ua,readlink:d.La.readlink},stream:{}},vb:{node:{Ta:d.La.Ta,Ua:d.La.Ua},stream:gt}}),t=Rr(e,r,t,n),S(t.mode)?(t.La=d.Wa.dir.node,t.Ma=d.Wa.dir.stream,t.Na={}):(t.mode&61440)===32768?(t.La=d.Wa.file.node,t.Ma=d.Wa.file.stream,t.Ra=0,t.Na=null):(t.mode&61440)===40960?(t.La=d.Wa.link.node,t.Ma=d.Wa.link.stream):(t.mode&61440)===8192&&(t.La=d.Wa.vb.node,t.Ma=d.Wa.vb.stream),t.atime=t.mtime=t.ctime=Date.now(),e&&(e.Na[r]=t,e.atime=e.mtime=e.ctime=t.atime),t},Sb(e){return e.Na?e.Na.subarray?e.Na.subarray(0,e.Ra):new Uint8Array(e.Na):new Uint8Array(0)},La:{Ta(e){var r={};return r.dev=(e.mode&61440)===8192?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,S(e.mode)?r.size=4096:(e.mode&61440)===32768?r.size=e.Ra:(e.mode&61440)===40960?r.size=e.link.length:r.size=0,r.atime=new Date(e.atime),r.mtime=new Date(e.mtime),r.ctime=new Date(e.ctime),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},Ua(e,r){for(var t of["mode","atime","mtime","ctime"])r[t]!=null&&(e[t]=r[t]);r.size!==void 0&&(r=r.size,e.Ra!=r&&(r==0?(e.Na=null,e.Ra=0):(t=e.Na,e.Na=new Uint8Array(r),t&&e.Na.set(t.subarray(0,Math.min(r,e.Ra))),e.Ra=r)))},lookup(){throw d.mb||(d.mb=new f(44),d.mb.stack="<generic error, no stack>"),d.mb},hb(e,r,t,n){return d.createNode(e,r,t,n)},rename(e,r,t){try{var n=G(r,t)}catch{}if(n){if(S(e.mode))for(var i in n.Na)throw new f(55);Ke(n)}delete e.parent.Na[e.name],r.Na[t]=e,e.name=t,r.ctime=r.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,r){delete e.Na[r],e.ctime=e.mtime=Date.now()},rmdir(e,r){var t=G(e,r),n;for(n in t.Na)throw new f(55);delete e.Na[r],e.ctime=e.mtime=Date.now()},readdir(e){return[".","..",...Object.keys(e.Na)]},symlink(e,r,t){return e=d.createNode(e,r,41471,0),e.link=t,e},readlink(e){if((e.mode&61440)!==40960)throw new f(28);return e.link}},Ma:{read(e,r,t,n,i){var a=e.node.Na;if(i>=e.node.Ra)return 0;if(e=Math.min(e.node.Ra-i,n),8<e&&a.subarray)r.set(a.subarray(i,i+e),t);else for(n=0;n<e;n++)r[t+n]=a[i+n];return e},write(e,r,t,n,i,a){if(r.buffer===q.buffer&&(a=!1),!n)return 0;if(e=e.node,e.mtime=e.ctime=Date.now(),r.subarray&&(!e.Na||e.Na.subarray)){if(a)return e.Na=r.subarray(t,t+n),e.Ra=n;if(e.Ra===0&&i===0)return e.Na=r.slice(t,t+n),e.Ra=n;if(i+n<=e.Ra)return e.Na.set(r.subarray(t,t+n),i),n}a=i+n;var u=e.Na?e.Na.length:0;if(u>=a||(a=Math.max(a,u*(1048576>u?2:1.125)>>>0),u!=0&&(a=Math.max(a,256)),u=e.Na,e.Na=new Uint8Array(a),0<e.Ra&&e.Na.set(u.subarray(0,e.Ra),0)),e.Na.subarray&&r.subarray)e.Na.set(r.subarray(t,t+n),i);else for(a=0;a<n;a++)e.Na[i+a]=r[t+a];return e.Ra=Math.max(e.Ra,i+n),n},Va(e,r,t){if(t===1?r+=e.position:t===2&&(e.node.mode&61440)===32768&&(r+=e.node.Ra),0>r)throw new f(28);return r},ib(e,r,t,n,i){if((e.node.mode&61440)!==32768)throw new f(43);if(e=e.node.Na,i&2||!e||e.buffer!==q.buffer){i=!0,n=65536*Math.ceil(r/65536);var a=Xr(65536,n);if(a&&N.fill(0,a,a+n),n=a,!n)throw new f(48);e&&((0<t||t+r<e.length)&&(e.subarray?e=e.subarray(t,t+r):e=Array.prototype.slice.call(e,t,t+r)),q.set(e,n))}else i=!1,n=e.byteOffset;return{Kb:n,Ab:i}},jb(e,r,t,n){return d.Ma.write(e,r,0,n,t,!1),0}}},qr=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},Ze=null,Mr={},re=[],bt=1,$=null,Nr=!1,Ar=!0,Sr={},f=class{name="ErrnoError";constructor(e){this.Pa=e}},yt=class{gb={};node=null;get flags(){return this.gb.flags}set flags(e){this.gb.flags=e}get position(){return this.gb.position}set position(e){this.gb.position=e}},vt=class{La={};Ma={};ab=null;constructor(e,r,t,n){e||=this,this.parent=e,this.Xa=e.Xa,this.id=bt++,this.name=r,this.mode=t,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&365)===365}set read(e){e?this.mode|=365:this.mode&=-366}get write(){return(this.mode&146)===146}set write(e){e?this.mode|=146:this.mode&=-147}};function O(e,r={}){if(!e)throw new f(44);r.ob??(r.ob=!0),e.charAt(0)==="/"||(e="//"+e);var t=0;e:for(;40>t;t++){e=e.split("/").filter(c=>!!c);for(var n=Ze,i="/",a=0;a<e.length;a++){var u=a===e.length-1;if(u&&r.parent)break;if(e[a]!==".")if(e[a]==="..")if(i=_r(i),n===n.parent){e=i+"/"+e.slice(a+1).join("/"),t--;continue e}else n=n.parent;else{i=Ce(i+"/"+e[a]);try{n=G(n,e[a])}catch(c){if(c?.Pa===44&&u&&r.Jb)return{path:i};throw c}if(!n.ab||u&&!r.ob||(n=n.ab.root),(n.mode&61440)===40960&&(!u||r.$a)){if(!n.La.readlink)throw new f(52);n=n.La.readlink(n),n.charAt(0)==="/"||(n=_r(i)+"/"+n),e=n+"/"+e.slice(a+1).join("/");continue e}}}return{path:i,node:n}}throw new f(32)}function Je(e){for(var r;;){if(e===e.parent)return e=e.Xa.zb,r?e[e.length-1]!=="/"?`${e}/${r}`:e+r:e;r=r?`${e.name}/${r}`:e.name,e=e.parent}}function He(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%$.length}function Ke(e){var r=He(e.parent.id,e.name);if($[r]===e)$[r]=e.bb;else for(r=$[r];r;){if(r.bb===e){r.bb=e.bb;break}r=r.bb}}function G(e,r){var t=S(e.mode)?(t=te(e,"x"))?t:e.La.lookup?0:2:54;if(t)throw new f(t);for(t=$[He(e.id,r)];t;t=t.bb){var n=t.name;if(t.parent.id===e.id&&n===r)return t}return e.La.lookup(e,r)}function Rr(e,r,t,n){return e=new vt(e,r,t,n),r=He(e.parent.id,e.name),e.bb=$[r],$[r]=e}function S(e){return(e&61440)===16384}function Or(e){var r=["r","w","rw"][e&3];return e&512&&(r+="w"),r}function te(e,r){if(Ar)return 0;if(!r.includes("r")||e.mode&292){if(r.includes("w")&&!(e.mode&146)||r.includes("x")&&!(e.mode&73))return 2}else return 2;return 0}function Lr(e,r){if(!S(e.mode))return 54;try{return G(e,r),20}catch{}return te(e,"wx")}function xr(e,r,t){try{var n=G(e,r)}catch(i){return i.Pa}if(e=te(e,"wx"))return e;if(t){if(!S(n.mode))return 54;if(n===n.parent||Je(n)==="/")return 10}else if(S(n.mode))return 31;return 0}function Ee(e){if(!e)throw new f(63);return e}function A(e){if(e=re[e],!e)throw new f(8);return e}function Tr(e,r=-1){if(e=Object.assign(new yt,e),r==-1)e:{for(r=0;4096>=r;r++)if(!re[r])break e;throw new f(33)}return e.fd=r,re[r]=e}function _t(e,r=-1){return e=Tr(e,r),e.Ma?.Rb?.(e),e}function er(e,r,t){var n=e?.Ma.Ua;e=n?e:r,n??=r.La.Ua,Ee(n),n(e,t)}var gt={open(e){e.Ma=Mr[e.node.rdev].Ma,e.Ma.open?.(e)},Va(){throw new f(70)}};function rr(e,r){Mr[e]={Ma:r}}function Pr(e,r){var t=r==="/";if(t&&Ze)throw new f(10);if(!t&&r){var n=O(r,{ob:!1});if(r=n.path,n=n.node,n.ab)throw new f(10);if(!S(n.mode))throw new f(54)}r={type:e,Wb:{},zb:r,Ib:[]},e=e.Xa(r),e.Xa=r,r.root=e,t?Ze=e:n&&(n.ab=r,n.Xa&&n.Xa.Ib.push(r))}function qe(e,r,t){var n=O(e,{parent:!0}).node;if(e=ge(e),!e)throw new f(28);if(e==="."||e==="..")throw new f(20);var i=Lr(n,e);if(i)throw new f(i);if(!n.La.hb)throw new f(63);return n.La.hb(n,e,r,t)}function kt(e,r=438){return qe(e,r&4095|32768,0)}function D(e,r=511){return qe(e,r&1023|16384,0)}function Me(e,r,t){typeof t>"u"&&(t=r,r=438),qe(e,r|8192,t)}function tr(e,r){if(!ct(e))throw new f(44);var t=O(r,{parent:!0}).node;if(!t)throw new f(44);r=ge(r);var n=Lr(t,r);if(n)throw new f(n);if(!t.La.symlink)throw new f(63);t.La.symlink(t,r,e)}function Ur(e){var r=O(e,{parent:!0}).node;e=ge(e);var t=G(r,e),n=xr(r,e,!0);if(n)throw new f(n);if(!r.La.rmdir)throw new f(63);if(t.ab)throw new f(10);r.La.rmdir(r,e),Ke(t)}function Dr(e){var r=O(e,{parent:!0}).node;if(!r)throw new f(44);e=ge(e);var t=G(r,e),n=xr(r,e,!1);if(n)throw new f(n);if(!r.La.unlink)throw new f(63);if(t.ab)throw new f(10);r.La.unlink(r,e),Ke(t)}function fe(e,r){return e=O(e,{$a:!r}).node,Ee(e.La.Ta)(e)}function Ir(e,r,t,n){er(e,r,{mode:t&4095|r.mode&-4096,ctime:Date.now(),Fb:n})}function Ne(e,r){e=typeof e=="string"?O(e,{$a:!0}).node:e,Ir(null,e,r)}function Wr(e,r,t){if(S(r.mode))throw new f(31);if((r.mode&61440)!==32768)throw new f(28);var n=te(r,"w");if(n)throw new f(n);er(e,r,{size:t,timestamp:Date.now()})}function ne(e,r,t=438){if(e==="")throw new f(44);if(typeof r=="string"){var n={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[r];if(typeof n>"u")throw Error(`Unknown file open mode: ${r}`);r=n}if(t=r&64?t&4095|32768:0,typeof e=="object")n=e;else{var i=e.endsWith("/");e=O(e,{$a:!(r&131072),Jb:!0}),n=e.node,e=e.path}var a=!1;if(r&64)if(n){if(r&128)throw new f(20)}else{if(i)throw new f(31);n=qe(e,t|511,0),a=!0}if(!n)throw new f(44);if((n.mode&61440)===8192&&(r&=-513),r&65536&&!S(n.mode))throw new f(54);if(!a&&(i=n?(n.mode&61440)===40960?32:S(n.mode)&&(Or(r)!=="r"||r&576)?31:te(n,Or(r)):44))throw new f(i);return r&512&&!a&&(i=n,i=typeof i=="string"?O(i,{$a:!0}).node:i,Wr(null,i,0)),r&=-131713,i=Tr({node:n,path:Je(n),flags:r,seekable:!0,position:0,Ma:n.Ma,Lb:[],error:!1}),i.Ma.open&&i.Ma.open(i),a&&Ne(n,t&511),!s.logReadFiles||r&1||e in Sr||(Sr[e]=1),i}function nr(e){if(e.fd===null)throw new f(8);e.pb&&(e.pb=null);try{e.Ma.close&&e.Ma.close(e)}catch(r){throw r}finally{re[e.fd]=null}e.fd=null}function jr(e,r,t){if(e.fd===null)throw new f(8);if(!e.seekable||!e.Ma.Va)throw new f(70);if(t!=0&&t!=1&&t!=2)throw new f(28);e.position=e.Ma.Va(e,r,t),e.Lb=[]}function zr(e,r,t,n,i){if(0>n||0>i)throw new f(28);if(e.fd===null)throw new f(8);if((e.flags&2097155)===1)throw new f(8);if(S(e.node.mode))throw new f(31);if(!e.Ma.read)throw new f(28);var a=typeof i<"u";if(!a)i=e.position;else if(!e.seekable)throw new f(70);return r=e.Ma.read(e,r,t,n,i),a||(e.position+=r),r}function Qr(e,r,t,n,i){if(0>n||0>i)throw new f(28);if(e.fd===null)throw new f(8);if((e.flags&2097155)===0)throw new f(8);if(S(e.node.mode))throw new f(31);if(!e.Ma.write)throw new f(28);e.seekable&&e.flags&1024&&jr(e,0,2);var a=typeof i<"u";if(!a)i=e.position;else if(!e.seekable)throw new f(70);return r=e.Ma.write(e,r,t,n,i,void 0),a||(e.position+=r),r}function Et(e){var r=r||0;r=ne(e,r),e=fe(e).size;var t=new Uint8Array(e);return zr(r,t,0,e,0),nr(r),t}function B(e,r,t){e=Ce("/dev/"+e);var n=qr(!!r,!!t);B.yb??(B.yb=64);var i=B.yb++<<8|0;rr(i,{open(a){a.seekable=!1},close(){t?.buffer?.length&&t(10)},read(a,u,c,b){for(var p=0,g=0;g<b;g++){try{var M=r()}catch{throw new f(29)}if(M===void 0&&p===0)throw new f(6);if(M==null)break;p++,u[c+g]=M}return p&&(a.node.atime=Date.now()),p},write(a,u,c,b){for(var p=0;p<b;p++)try{t(u[c+p])}catch{throw new f(29)}return b&&(a.node.mtime=a.node.ctime=Date.now()),p}}),Me(e,n,i)}var _={};function Z(e,r,t){if(r.charAt(0)==="/")return r;if(e=e===-100?"/":A(e).path,r.length==0){if(!t)throw new f(44);return e}return e+"/"+r}function Ae(e,r){v[e>>2]=r.dev,v[e+4>>2]=r.mode,v[e+8>>2]=r.nlink,v[e+12>>2]=r.uid,v[e+16>>2]=r.gid,v[e+20>>2]=r.rdev,x[e+24>>3]=BigInt(r.size),k[e+32>>2]=4096,k[e+36>>2]=r.blocks;var t=r.atime.getTime(),n=r.mtime.getTime(),i=r.ctime.getTime();return x[e+40>>3]=BigInt(Math.floor(t/1e3)),v[e+48>>2]=t%1e3*1e6,x[e+56>>3]=BigInt(Math.floor(n/1e3)),v[e+64>>2]=n%1e3*1e6,x[e+72>>3]=BigInt(Math.floor(i/1e3)),v[e+80>>2]=i%1e3*1e6,x[e+88>>3]=BigInt(r.ino),0}var Se=void 0,Re=()=>{var e=k[+Se>>2];return Se+=4,e},ir=0,qt=[0,31,60,91,121,152,182,213,244,274,305,335],Mt=[0,31,59,90,120,151,181,212,243,273,304,334],he={},Fr=e=>{$e=e,_e||0<ir||(s.onExit?.(e),ye=!0),pe(e,new Ye(e))},Nt=e=>{if(!ye)try{e()}catch(r){r instanceof Ye||r=="unwind"||pe(1,r)}finally{if(!(_e||0<ir))try{$e=e=$e,Fr(e)}catch(r){r instanceof Ye||r=="unwind"||pe(1,r)}}},or={},$r=()=>{if(!ar){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:We||"./this.program"},r;for(r in or)or[r]===void 0?delete e[r]:e[r]=or[r];var t=[];for(r in e)t.push(`${r}=${e[r]}`);ar=t}return ar},ar,At=(e,r,t,n)=>{var i={string:p=>{var g=0;if(p!=null&&p!==0){g=ee(p)+1;var M=H(g);U(p,N,M,g),g=M}return g},array:p=>{var g=H(p.length);return q.set(p,g),g}};e=s["_"+e];var a=[],u=0;if(n)for(var c=0;c<n.length;c++){var b=i[t[c]];b?(u===0&&(u=Te()),a[c]=b(n[c])):a[c]=n[c]}return t=e(...a),t=(function(p){return u!==0&&xe(u),r==="string"?E(p):r==="boolean"?!!p:p})(t)},Oe=e=>{var r=ee(e)+1,t=Le(r);return t&&U(e,N,t,r),t},J,ur=[],V=e=>{J.delete(X.get(e)),X.set(e,null),ur.push(e)},Br=e=>{const r=e.length;return[r%128|128,r>>7,...e]},St={i:127,p:127,j:126,f:125,d:124,e:111},Vr=e=>Br(Array.from(e,r=>St[r])),me=(e,r)=>{if(!J){J=new WeakMap;var t=X.length;if(J)for(var n=0;n<0+t;n++){var i=X.get(n);i&&J.set(i,n)}}if(t=J.get(e)||0)return t;t=ur.length?ur.pop():X.grow(1);try{X.set(t,e)}catch(a){if(!(a instanceof TypeError))throw a;r=Uint8Array.of(0,97,115,109,1,0,0,0,1,...Br([1,96,...Vr(r.slice(1)),...Vr(r[0]==="v"?"":r[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),r=new WebAssembly.Module(r),r=new WebAssembly.Instance(r,{e:{f:e}}).exports.f,X.set(t,r)}return J.set(e,t),t};if($=Array(4096),Pr(d,"/"),D("/tmp"),D("/home"),D("/home/web_user"),(function(){D("/dev"),rr(259,{read:()=>0,write:(n,i,a,u)=>u,Va:()=>0}),Me("/dev/null",259),Er(1280,pt),Er(1536,wt),Me("/dev/tty",1280),Me("/dev/tty1",1536);var e=new Uint8Array(1024),r=0,t=()=>(r===0&&(gr(e),r=e.byteLength),e[--r]);B("random",t),B("urandom",t),D("/dev/shm"),D("/dev/shm/tmp")})(),(function(){D("/proc");var e=D("/proc/self");D("/proc/self/fd"),Pr({Xa(){var r=Rr(e,"fd",16895,73);return r.Ma={Va:d.Ma.Va},r.La={lookup(t,n){t=+n;var i=A(t);return t={parent:null,Xa:{zb:"fake"},La:{readlink:()=>i.path},id:t+1},t.parent=t},readdir(){return Array.from(re.entries()).filter(([,t])=>t).map(([t])=>t.toString())}},r}},"/proc/self/fd")})(),s.noExitRuntime&&(_e=s.noExitRuntime),s.print&&(Fe=s.print),s.printErr&&(Y=s.printErr),s.wasmBinary&&(oe=s.wasmBinary),s.thisProgram&&(We=s.thisProgram),s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);0<s.preInit.length;)s.preInit.shift()();s.stackSave=()=>Te(),s.stackRestore=e=>xe(e),s.stackAlloc=e=>H(e),s.cwrap=(e,r,t,n)=>{var i=!t||t.every(a=>a==="number"||a==="boolean");return r!=="string"&&i&&!n?s["_"+e]:(...a)=>At(e,r,t,a)},s.addFunction=me,s.removeFunction=V,s.UTF8ToString=E,s.stringToNewUTF8=Oe,s.writeArrayToMemory=(e,r)=>{q.set(e,r)};var Le,ce,Xr,Yr,xe,H,Te,Pe,X,Rt={a:(e,r,t,n)=>ue(`Assertion failed: ${E(e)}, at: `+[r?E(r):"unknown filename",t,n?E(n):"unknown function"]),i:function(e,r){try{return e=E(e),Ne(e,r),0}catch(t){if(typeof _>"u"||t.name!=="ErrnoError")throw t;return-t.Pa}},L:function(e,r,t){try{if(r=E(r),r=Z(e,r),t&-8)return-28;var n=O(r,{$a:!0}).node;return n?(e="",t&4&&(e+="r"),t&2&&(e+="w"),t&1&&(e+="x"),e&&te(n,e)?-2:0):-44}catch(i){if(typeof _>"u"||i.name!=="ErrnoError")throw i;return-i.Pa}},j:function(e,r){try{var t=A(e);return Ir(t,t.node,r,!1),0}catch(n){if(typeof _>"u"||n.name!=="ErrnoError")throw n;return-n.Pa}},h:function(e){try{var r=A(e);return er(r,r.node,{timestamp:Date.now(),Fb:!1}),0}catch(t){if(typeof _>"u"||t.name!=="ErrnoError")throw t;return-t.Pa}},b:function(e,r,t){Se=t;try{var n=A(e);switch(r){case 0:var i=Re();if(0>i)break;for(;re[i];)i++;return _t(n,i).fd;case 1:case 2:return 0;case 3:return n.flags;case 4:return i=Re(),n.flags|=i,0;case 12:return i=Re(),ae[i+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(a){if(typeof _>"u"||a.name!=="ErrnoError")throw a;return-a.Pa}},g:function(e,r){try{var t=A(e),n=t.node,i=t.Ma.Ta;e=i?t:n,i??=n.La.Ta,Ee(i);var a=i(e);return Ae(r,a)}catch(u){if(typeof _>"u"||u.name!=="ErrnoError")throw u;return-u.Pa}},H:function(e,r){r=-9007199254740992>r||9007199254740992<r?NaN:Number(r);try{if(isNaN(r))return-61;var t=A(e);if(0>r||(t.flags&2097155)===0)throw new f(28);return Wr(t,t.node,r),0}catch(n){if(typeof _>"u"||n.name!=="ErrnoError")throw n;return-n.Pa}},G:function(e,r){try{if(r===0)return-28;var t=ee("/")+1;return r<t?-68:(U("/",N,e,r),t)}catch(n){if(typeof _>"u"||n.name!=="ErrnoError")throw n;return-n.Pa}},K:function(e,r){try{return e=E(e),Ae(r,fe(e,!0))}catch(t){if(typeof _>"u"||t.name!=="ErrnoError")throw t;return-t.Pa}},C:function(e,r,t){try{return r=E(r),r=Z(e,r),D(r,t),0}catch(n){if(typeof _>"u"||n.name!=="ErrnoError")throw n;return-n.Pa}},J:function(e,r,t,n){try{r=E(r);var i=n&256;return r=Z(e,r,n&4096),Ae(t,i?fe(r,!0):fe(r))}catch(a){if(typeof _>"u"||a.name!=="ErrnoError")throw a;return-a.Pa}},x:function(e,r,t,n){Se=n;try{r=E(r),r=Z(e,r);var i=n?Re():0;return ne(r,t,i).fd}catch(a){if(typeof _>"u"||a.name!=="ErrnoError")throw a;return-a.Pa}},v:function(e,r,t,n){try{if(r=E(r),r=Z(e,r),0>=n)return-28;var i=O(r).node;if(!i)throw new f(44);if(!i.La.readlink)throw new f(28);var a=i.La.readlink(i),u=Math.min(n,ee(a)),c=q[t+u];return U(a,N,t,n+1),q[t+u]=c,u}catch(b){if(typeof _>"u"||b.name!=="ErrnoError")throw b;return-b.Pa}},u:function(e){try{return e=E(e),Ur(e),0}catch(r){if(typeof _>"u"||r.name!=="ErrnoError")throw r;return-r.Pa}},f:function(e,r){try{return e=E(e),Ae(r,fe(e))}catch(t){if(typeof _>"u"||t.name!=="ErrnoError")throw t;return-t.Pa}},r:function(e,r,t){try{if(r=E(r),r=Z(e,r),t)if(t===512)Ur(r);else return-28;else Dr(r);return 0}catch(n){if(typeof _>"u"||n.name!=="ErrnoError")throw n;return-n.Pa}},q:function(e,r,t){try{r=E(r),r=Z(e,r,!0);var n=Date.now(),i,a;if(t){var u=v[t>>2]+4294967296*k[t+4>>2],c=k[t+8>>2];c==1073741823?i=n:c==1073741822?i=null:i=1e3*u+c/1e6,t+=16,u=v[t>>2]+4294967296*k[t+4>>2],c=k[t+8>>2],c==1073741823?a=n:c==1073741822?a=null:a=1e3*u+c/1e6}else a=i=n;if((a??i)!==null){e=i;var b=O(r,{$a:!0}).node;Ee(b.La.Ua)(b,{atime:e,mtime:a})}return 0}catch(p){if(typeof _>"u"||p.name!=="ErrnoError")throw p;return-p.Pa}},m:()=>ue(""),l:()=>{_e=!1,ir=0},A:function(e,r){e=-9007199254740992>e||9007199254740992<e?NaN:Number(e),e=new Date(1e3*e),k[r>>2]=e.getSeconds(),k[r+4>>2]=e.getMinutes(),k[r+8>>2]=e.getHours(),k[r+12>>2]=e.getDate(),k[r+16>>2]=e.getMonth(),k[r+20>>2]=e.getFullYear()-1900,k[r+24>>2]=e.getDay();var t=e.getFullYear();k[r+28>>2]=(t%4!==0||t%100===0&&t%400!==0?Mt:qt)[e.getMonth()]+e.getDate()-1|0,k[r+36>>2]=-(60*e.getTimezoneOffset()),t=new Date(e.getFullYear(),6,1).getTimezoneOffset();var n=new Date(e.getFullYear(),0,1).getTimezoneOffset();k[r+32>>2]=(t!=n&&e.getTimezoneOffset()==Math.min(n,t))|0},y:function(e,r,t,n,i,a,u){i=-9007199254740992>i||9007199254740992<i?NaN:Number(i);try{var c=A(n);if((r&2)!==0&&(t&2)===0&&(c.flags&2097155)!==2)throw new f(2);if((c.flags&2097155)===1)throw new f(2);if(!c.Ma.ib)throw new f(43);if(!e)throw new f(28);var b=c.Ma.ib(c,e,i,r,t),p=b.Kb;return k[a>>2]=b.Ab,v[u>>2]=p,0}catch(g){if(typeof _>"u"||g.name!=="ErrnoError")throw g;return-g.Pa}},z:function(e,r,t,n,i,a){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a);try{var u=A(i);if(t&2){if(t=a,(u.node.mode&61440)!==32768)throw new f(43);if(!(n&2)){var c=N.slice(e,e+r);u.Ma.jb&&u.Ma.jb(u,c,t,r,n)}}}catch(b){if(typeof _>"u"||b.name!=="ErrnoError")throw b;return-b.Pa}},n:(e,r)=>{if(he[e]&&(clearTimeout(he[e].id),delete he[e]),!r)return 0;var t=setTimeout(()=>{delete he[e],Nt(()=>Yr(e,performance.now()))},r);return he[e]={id:t,Xb:r},0},B:(e,r,t,n)=>{var i=new Date().getFullYear(),a=new Date(i,0,1).getTimezoneOffset();i=new Date(i,6,1).getTimezoneOffset(),v[e>>2]=60*Math.max(a,i),k[r>>2]=+(a!=i),r=u=>{var c=Math.abs(u);return`UTC${0<=u?"-":"+"}${String(Math.floor(c/60)).padStart(2,"0")}${String(c%60).padStart(2,"0")}`},e=r(a),r=r(i),i<a?(U(e,N,t,17),U(r,N,n,17)):(U(e,N,n,17),U(r,N,t,17))},d:()=>Date.now(),s:()=>2147483648,c:()=>performance.now(),o:e=>{var r=N.length;if(e>>>=0,2147483648<e)return!1;for(var t=1;4>=t;t*=2){var n=r*(1+.2/t);n=Math.min(n,e+100663296);e:{n=(Math.min(2147483648,65536*Math.ceil(Math.max(e,n)/65536))-Pe.buffer.byteLength+65535)/65536|0;try{Pe.grow(n),cr();var i=1;break e}catch{}i=void 0}if(i)return!0}return!1},E:(e,r)=>{var t=0,n=0,i;for(i of $r()){var a=r+t;v[e+n>>2]=a,t+=U(i,N,a,1/0)+1,n+=4}return 0},F:(e,r)=>{var t=$r();v[e>>2]=t.length,e=0;for(var n of t)e+=ee(n)+1;return v[r>>2]=e,0},e:function(e){try{var r=A(e);return nr(r),0}catch(t){if(typeof _>"u"||t.name!=="ErrnoError")throw t;return t.Pa}},p:function(e,r){try{var t=A(e);return q[r]=t.tty?2:S(t.mode)?3:(t.mode&61440)===40960?7:4,ae[r+2>>1]=0,x[r+8>>3]=BigInt(0),x[r+16>>3]=BigInt(0),0}catch(n){if(typeof _>"u"||n.name!=="ErrnoError")throw n;return n.Pa}},w:function(e,r,t,n){try{e:{var i=A(e);e=r;for(var a,u=r=0;u<t;u++){var c=v[e>>2],b=v[e+4>>2];e+=8;var p=zr(i,q,c,b,a);if(0>p){var g=-1;break e}if(r+=p,p<b)break;typeof a<"u"&&(a+=p)}g=r}return v[n>>2]=g,0}catch(M){if(typeof _>"u"||M.name!=="ErrnoError")throw M;return M.Pa}},D:function(e,r,t,n){r=-9007199254740992>r||9007199254740992<r?NaN:Number(r);try{if(isNaN(r))return 61;var i=A(e);return jr(i,r,t),x[n>>3]=BigInt(i.position),i.pb&&r===0&&t===0&&(i.pb=null),0}catch(a){if(typeof _>"u"||a.name!=="ErrnoError")throw a;return a.Pa}},I:function(e){try{var r=A(e);return r.Ma?.fsync?.(r)}catch(t){if(typeof _>"u"||t.name!=="ErrnoError")throw t;return t.Pa}},t:function(e,r,t,n){try{e:{var i=A(e);e=r;for(var a,u=r=0;u<t;u++){var c=v[e>>2],b=v[e+4>>2];e+=8;var p=Qr(i,q,c,b,a);if(0>p){var g=-1;break e}if(r+=p,p<b)break;typeof a<"u"&&(a+=p)}g=r}return v[n>>2]=g,0}catch(M){if(typeof _>"u"||M.name!=="ErrnoError")throw M;return M.Pa}},k:Fr};function sr(){function e(){if(s.calledRun=!0,!ye){if(!s.noFSInit&&!Nr){var r,t;Nr=!0,r??=s.stdin,t??=s.stdout,n??=s.stderr,r?B("stdin",r):tr("/dev/tty","/dev/stdin"),t?B("stdout",null,t):tr("/dev/tty","/dev/stdout"),n?B("stderr",null,n):tr("/dev/tty1","/dev/stderr"),ne("/dev/stdin",0),ne("/dev/stdout",1),ne("/dev/stderr",1)}if(lr.N(),Ar=!1,s.onRuntimeInitialized?.(),s.postRun)for(typeof s.postRun=="function"&&(s.postRun=[s.postRun]);s.postRun.length;){var n=s.postRun.shift();pr.push(n)}dr(pr)}}if(0<C)se=sr;else{if(s.preRun)for(typeof s.preRun=="function"&&(s.preRun=[s.preRun]);s.preRun.length;)ht();dr(wr),0<C?se=sr:s.setStatus?(s.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>s.setStatus(""),1),e()},1)):e()}}var lr;return(async function(){function e(t){return t=lr=t.exports,s._sqlite3_free=t.P,s._sqlite3_value_text=t.Q,s._sqlite3_prepare_v2=t.R,s._sqlite3_step=t.S,s._sqlite3_reset=t.T,s._sqlite3_exec=t.U,s._sqlite3_finalize=t.V,s._sqlite3_column_name=t.W,s._sqlite3_column_text=t.X,s._sqlite3_column_type=t.Y,s._sqlite3_errmsg=t.Z,s._sqlite3_clear_bindings=t._,s._sqlite3_value_blob=t.$,s._sqlite3_value_bytes=t.aa,s._sqlite3_value_double=t.ba,s._sqlite3_value_int=t.ca,s._sqlite3_value_type=t.da,s._sqlite3_result_blob=t.ea,s._sqlite3_result_double=t.fa,s._sqlite3_result_error=t.ga,s._sqlite3_result_int=t.ha,s._sqlite3_result_int64=t.ia,s._sqlite3_result_null=t.ja,s._sqlite3_result_text=t.ka,s._sqlite3_aggregate_context=t.la,s._sqlite3_column_count=t.ma,s._sqlite3_data_count=t.na,s._sqlite3_column_blob=t.oa,s._sqlite3_column_bytes=t.pa,s._sqlite3_column_double=t.qa,s._sqlite3_bind_blob=t.ra,s._sqlite3_bind_double=t.sa,s._sqlite3_bind_int=t.ta,s._sqlite3_bind_text=t.ua,s._sqlite3_bind_parameter_index=t.va,s._sqlite3_sql=t.wa,s._sqlite3_normalized_sql=t.xa,s._sqlite3_changes=t.ya,s._sqlite3_close_v2=t.za,s._sqlite3_create_function_v2=t.Aa,s._sqlite3_update_hook=t.Ba,s._sqlite3_open=t.Ca,Le=s._malloc=t.Da,ce=s._free=t.Ea,s._RegisterExtensionFunctions=t.Fa,Xr=t.Ga,Yr=t.Ha,xe=t.Ia,H=t.Ja,Te=t.Ka,Pe=t.M,X=t.O,cr(),C--,s.monitorRunDependencies?.(C),C==0&&se&&(t=se,se=null,t()),lr}C++,s.monitorRunDependencies?.(C);var r={a:Rt};return s.instantiateWasm?new Promise(t=>{s.instantiateWasm(r,(n,i)=>{t(e(n))})}):(Xe??=s.locateFile?s.locateFile("sql-wasm.wasm",we):we+"sql-wasm.wasm",e((await ft(r)).instance))})(),sr(),I}),z)};j.exports=Q,j.exports.default=Q})(hr)),hr.exports}var ot=an();const un=nn(ot),fn=on({__proto__:null,default:un},[ot]);export{fn as s};
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>slicc</title>
7
7
  <link rel="icon" type="image/png" href="/logos/sliccy-color-1scoops-32x32.png" />
8
- <script type="module" crossorigin src="/assets/index-Dw4MBGs3.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-9S0E3bQQ.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-BlSQnyL2.css">
10
10
  </head>
11
11
  <body>
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>slicc</title>
7
7
  <link rel="icon" type="image/png" href="/logos/sliccy-color-1scoops-32x32.png" />
8
- <script type="module" crossorigin src="/assets/index-Dw4MBGs3.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-9S0E3bQQ.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-BlSQnyL2.css">
10
10
  </head>
11
11
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sliccy",
3
- "version": "1.24.0",
3
+ "version": "1.24.2",
4
4
  "description": "Browser-based coding agent with thin CLI server",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",