(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,556295,e=>{"use strict";var t=e.i(52453);e.s(["f",0,(e,n)=>(a,r,i)=>(i.setState=(e,r,...i)=>a("function"==typeof e?(0,t.f)(e,n?{...n,enablePatches:!1}:n):e,r,...i),e(i.setState,r,i))])},372953,425493,210138,29570,704691,e=>{"use strict";var t=e.i(342837),n=e.i(988590),a=e.i(882844),r=e.i(635157),i=e.i(549692);let o={EmptyResponseBody:"empty_response_body",AudioDecodeFailed:"audio_decode_failed",AudioStreamFailed:"audio_stream_failed",ImagePromptMissing:"image_prompt_missing",ImageRequestFailed:"image_request_failed",ImageApiError:"image_api_error",ImageResponseBodyEmpty:"image_response_body_empty",ImageStreamFailed:"image_stream_failed",ImageStreamEventInvalid:"image_stream_event_invalid",ImageStreamError:"image_stream_error",ImageMissing:"image_missing",ImageStreamEndedEarly:"image_stream_ended_early",ImageResponseInvalid:"image_response_invalid",SttRequestFailed:"stt_request_failed",SttTranscriptEmpty:"stt_transcript_empty",SttFormatUnsupported:"stt_format_unsupported",SttFileReadFailed:"stt_file_read_failed",SttUploadFailed:"stt_upload_failed",SttResponseInvalid:"stt_response_invalid",SttAudioFileMissing:"stt_audio_file_missing",TtsReferenceAudioReadFailed:"tts_reference_audio_read_failed",TtsUploadFailed:"tts_upload_failed",TtsRequestFailed:"tts_request_failed",TtsResponseBodyEmpty:"tts_response_body_empty",TtsPcmParamsMissing:"tts_pcm_params_missing",VideoRequestFailed:"video_request_failed",VideoApiError:"video_api_error",VideoResponseInvalid:"video_response_invalid",VideoPollFailed:"video_poll_failed",VideoJobFailed:"video_job_failed",VideoJobCancelled:"video_job_cancelled",VideoJobExpired:"video_job_expired",VideoJobTimedOut:"video_job_timed_out",VideoUrlMissing:"video_url_missing",VideoFileUnavailable:"video_file_unavailable"},s={SendFailed:"send_failed",StreamSevered:"stream_severed",StreamEndedEarly:"stream_ended_early",LineTooLong:"line_too_long",TurnFailed:"turn_failed",RunFailed:"run_failed",RunStopped:"run_stopped",ToolFailed:"tool_failed",ToolStopped:"tool_stopped",...o},l=r.z.enum(s),d=i.N.extend({code:l.optional(),rawStatus:r.z.number().int().optional()});function p(e,t){return{code:e,status:null,...void 0===t?{}:{message:t}}}e.s(["K",0,d,"a",0,s,"H",0,o,"S",0,p,"y",0,function(e){return e.rawStatus??e.status??void 0}],425493);let u={InputStreaming:"input-streaming",Running:"running",Done:"done",Failed:"failed"},c={Streaming:"streaming",Done:"done"};e.s(["o",0,c,"K",0,{User:"user",Assistant:"assistant",System:"system"},"_",0,u],210138);let m={Function:"function",Server:"server",Mcp:"mcp",Subagent:"subagent"},g={Summary:"summary",Content:"content"},f={Image:"image",Video:"video",Audio:"audio"},h={Stop:"stop",Length:"length",Tool:"tool",ContentFilter:"content_filter",Cancelled:"cancelled"},A=r.z.object({attempt:r.z.number(),maxAttempts:r.z.number(),delayMs:r.z.number()}),I=r.z.object({turnId:r.z.string()}),b=r.z.object({waitToken:r.z.string(),questions:r.z.array(r.z.object({id:r.z.string(),header:r.z.string().optional(),question:r.z.string(),options:r.z.array(r.z.object({label:r.z.string(),description:r.z.string().optional()})),isMultiple:r.z.boolean()}))}),y=r.z.object({waitToken:r.z.string(),source:r.z.string().nullable(),message:r.z.string().nullable()}),v=r.z.union([r.z.object({kind:r.z.enum(f),url:r.z.string(),expiresAt:r.z.number().optional()}),r.z.object({kind:r.z.enum(f),jobId:r.z.string()})]),S=r.z.object({inputTokens:r.z.number().optional(),outputTokens:r.z.number().optional(),costUsd:r.z.string().optional(),durationMs:r.z.number().optional()}),w=r.z.object({kind:r.z.enum(["url_citation","file_citation"]),title:r.z.string().optional(),url:r.z.string().optional(),startIndex:r.z.number().optional(),endIndex:r.z.number().optional()}),_=r.z.object({id:r.z.string()}),z=r.z.discriminatedUnion("kind",[_.extend({kind:r.z.literal("text"),text:r.z.string(),status:r.z.enum(c)}),_.extend({kind:r.z.literal("reasoning"),summary:r.z.string(),content:r.z.string(),status:r.z.enum(c)}),_.extend({kind:r.z.literal("tool"),name:r.z.string(),toolKind:r.z.enum(m),inputText:r.z.string(),input:r.z.unknown().optional(),output:r.z.unknown().optional(),error:d.optional(),status:r.z.enum(u),durationMs:r.z.number().optional()}),_.extend({kind:r.z.literal("media"),media:v}),_.extend({kind:r.z.literal("file"),name:r.z.string(),mime:r.z.string(),previewUrl:r.z.string().optional()}),_.extend({kind:r.z.literal("annotations"),items:r.z.array(w).readonly()})]),x=r.z.discriminatedUnion("type",[I.extend({type:r.z.literal("turn.started")}),I.extend({type:r.z.literal("text.delta"),partId:r.z.string(),delta:r.z.string()}),I.extend({type:r.z.literal("reasoning.delta"),partId:r.z.string(),channel:r.z.enum(g),delta:r.z.string()}),I.extend({type:r.z.literal("tool.started"),callId:r.z.string(),name:r.z.string(),kind:r.z.enum(m)}),I.extend({type:r.z.literal("tool.input.delta"),callId:r.z.string(),delta:r.z.string()}),I.extend({type:r.z.literal("tool.input.finished"),callId:r.z.string(),input:r.z.unknown().optional()}),I.extend({type:r.z.literal("tool.finished"),callId:r.z.string(),output:r.z.unknown().optional(),error:d.optional(),durationMs:r.z.number().optional()}),I.extend({type:r.z.literal("media.added"),partId:r.z.string(),media:v}),I.extend({type:r.z.literal("annotation.added"),partId:r.z.string(),annotation:w}),I.extend({type:r.z.literal("status"),label:r.z.string(),retry:A.optional()}),I.extend({type:r.z.literal("question.opened"),prompt:b}),I.extend({type:r.z.literal("question.closed"),waitToken:r.z.string()}),I.extend({type:r.z.literal("question.skipped"),skipped:y}),I.extend({type:r.z.literal("usage"),usage:S}),I.extend({type:r.z.literal("turn.finished"),reason:r.z.enum(h)}),I.extend({type:r.z.literal("turn.failed"),error:d}),I.extend({type:r.z.literal("snapshot"),parts:r.z.array(z).readonly()})]);e.s(["B",0,x,"u",0,h,"L",0,g,"O",0,m],29570);let T=r.z.object({seconds:(0,a.$)().optional().openapi({description:"Duration of the input audio in seconds",example:9.2}),total_tokens:(0,a.D)().optional().openapi({description:"Total number of tokens used (input + output)",example:113}),input_tokens:(0,a.D)().optional().openapi({description:"Number of input tokens billed for this request",example:83}),output_tokens:(0,a.D)().optional().openapi({description:"Number of output tokens generated",example:30}),cost:(0,a.$)().optional().openapi({description:"Total cost of the request in USD",example:508e-6})}).openapi("STTUsage",{description:"Aggregated usage statistics for the STT request",example:{seconds:9.2,total_tokens:113,input_tokens:83,output_tokens:30,cost:508e-6}}),k=r.z.object({id:(0,a.D)().openapi({description:"Segment index within the transcript",example:0}),seek:(0,a.D)().optional().openapi({description:"Seek offset of the segment",example:0}),start:(0,a.$)().openapi({description:"Segment start time in seconds",example:0}),end:(0,a.$)().openapi({description:"Segment end time in seconds",example:3.2}),text:r.z.string().openapi({description:"Transcribed text of the segment",example:"Hello there."}),tokens:r.z.array((0,a.D)()).optional().openapi({description:"Token IDs of the segment"}),temperature:(0,a.$)().optional().openapi({description:"Temperature used for the segment"}),avg_logprob:(0,a.$)().optional().openapi({description:"Average log probability of the segment"}),compression_ratio:(0,a.$)().optional().openapi({description:"Compression ratio of the segment"}),no_speech_prob:(0,a.$)().optional().openapi({description:"Probability the segment contains no speech"}),speaker:(0,a.D)().optional().openapi({description:"Speaker index for the segment, present when the provider returns diarization data",example:0}),speaker_label:r.z.string().optional().openapi({description:"Provider speaker label for the segment, present when the provider labels speakers with a string",example:"speaker_0"}),channel:(0,a.D)().optional().openapi({description:"Zero-based audio channel index for the segment, present when the provider transcribes channels separately",example:0})}).openapi("STTSegment",{description:"A timestamped transcript segment, returned when response_format is verbose_json",example:{id:0,seek:0,start:0,end:3.2,text:"Hello there.",tokens:[50364,2425,456],temperature:0,avg_logprob:-.28,compression_ratio:1.13,no_speech_prob:.01,speaker:0}}),C=r.z.object({word:r.z.string().openapi({description:'The transcribed word, or the event tag such as "(laughter)" when type is audio_event',example:"Hello"}),type:r.z.enum(["word","audio_event"]).optional().openapi({description:'Kind of entry; omitted or "word" for spoken words, "audio_event" for non-speech sounds the provider tags with timestamps',example:"word"}),start:(0,a.$)().openapi({description:"Word start time in seconds",example:0}),end:(0,a.$)().openapi({description:"Word end time in seconds",example:.4}),speaker:(0,a.D)().optional().openapi({description:"Speaker index for the word, present when the provider returns diarization data",example:0}),confidence:(0,a.$)().min(0).max(1).optional().openapi({description:"Provider confidence for the word from 0 to 1, present when the provider returns per-word confidence",example:.98}),speaker_label:r.z.string().optional().openapi({description:"Provider speaker label for the word, present when the provider labels speakers with a string",example:"speaker_0"}),channel:(0,a.D)().optional().openapi({description:"Zero-based audio channel index for the word, present when the provider transcribes channels separately",example:0})}).openapi("STTWord",{description:"A timestamped word, returned when the provider includes word-level timestamps",example:{word:"Hello",start:0,end:.4,speaker:0,confidence:.98}}),M=r.z.object({text:r.z.string().openapi({description:"Entity text as it appears in the transcript"}),type:r.z.string().openapi({description:"Provider entity type label",example:"name"}),start_char:(0,a.D)().openapi({description:"Zero-based character offset of the entity start within the response-level text (not seconds)",example:15}),end_char:(0,a.D)().openapi({description:"Zero-based exclusive character offset of the entity end within the response-level text (not seconds)",example:25})}).openapi("STTEntity",{description:"A detected entity, returned when the provider runs entity detection",example:{text:"John Smith",type:"name",start_char:15,end_char:25}});r.z.object({text:r.z.string().openapi({description:"The transcribed text",example:"Hello, this is a test of OpenAI speech-to-text transcription. The weather is sunny today and the temperature is around 72 degrees."}),usage:T.optional().openapi({description:"Aggregated usage statistics for the request"}),task:r.z.string().optional().openapi({description:"The task performed, present when response_format is verbose_json",example:"transcribe"}),language:r.z.string().optional().openapi({description:"Detected or forced language, present when response_format is verbose_json",example:"english"}),language_confidence:(0,a.$)().min(0).max(1).optional().openapi({description:"Provider confidence in the detected language from 0 to 1, present when response_format is verbose_json and the provider scores language detection",example:.98}),duration:(0,a.$)().optional().openapi({description:"Duration of the input audio in seconds, present when response_format is verbose_json",example:9.2}),confidence:(0,a.$)().min(0).max(1).optional().openapi({description:"Provider confidence for the whole transcript from 0 to 1, present when response_format is verbose_json and the provider scores the full transcript",example:.94}),segments:r.z.array(k).optional().openapi({description:"Timestamped transcript segments, present when response_format is verbose_json"}),words:r.z.array(C).optional().openapi({description:"Timestamped words, present when the provider returns word-level timestamps"}),entities:r.z.array(M).optional().openapi({description:"Detected entities with character offsets into text, present when the provider runs entity detection"})}).openapi("STTResponse",{description:"STT response containing transcribed text and optional usage statistics",example:{text:"Hello, this is a test of OpenAI speech-to-text transcription.",usage:{seconds:9.2,total_tokens:113,input_tokens:83,output_tokens:30,cost:508e-6}}});let E=k.pick({start:!0,end:!0,text:!0,speaker:!0}),D=C.pick({word:!0,start:!0,end:!0,speaker:!0}),R={response_format:"verbose_json",timestamp_granularities:["segment","word"]},$={diarize:!0,...R};function F(e,t){return V(e)===V(t)}function V(e){return e.toLowerCase().replaceAll(/[^\p{L}\p{N}]/gu,"")}function O({word:e,start:t,end:n,speaker:a}){return{text:e,start:t,end:n,speaker:a}}e.s(["L",0,$,"j",0,R,"Y",0,E,"u",0,D,"R",0,F,"k",0,function(e,t){var n,a,r,i;let o;if(e?.some(e=>void 0!==e.speaker))return e;if(t?.some(e=>void 0!==e.speaker))return t.map(O);if(void 0===e||0===e.length)return void 0!==t&&t.length>0?t.map(O):e;let[s,...l]=e;return void 0!==s&&0===l.length&&void 0!==t&&(n=s,(a=t).length>1&&F(a.map(({word:e})=>e).join(" "),n.text))?(r=s,i=t,o=r.text.split(/\s+/).filter(e=>e.length>0),i.map((e,t)=>({...O(e),text:(o.length===i.length?o[t]:void 0)??e.word}))):e}],704691);var N=e.i(241782);let P={Text:"text",Transcript:"transcript",Image:"image",Video:"video",VideoJob:"video-job",Audio:"audio"},L=r.z.object({voice:r.z.string().optional(),format:r.z.string().optional(),sampleRateHz:r.z.number().optional(),channels:r.z.number().optional(),characters:r.z.number().optional()}),U=r.z.object({segments:r.z.array(E).readonly()}),B=r.z.object({stage:r.z.enum(N.y)});function j(e,t){return`${e.turnId}:${t}`}let G={image:P.Image,video:P.Video,audio:P.Audio};e.s(["w",0,L,"x",0,P,"t",0,{VideoGeneration:"video_generation",SpeechGeneration:"speech_generation",Transcription:"transcription"},"H",0,U,"k",0,B,"I",0,function(e,t){return`${e.turnId}:${t}`},"Q",0,function(e,t){return{type:"tool.finished",turnId:e.turnId,callId:t.callId,output:t.output}},"V",0,function(e,t){return[{type:"tool.started",turnId:e.turnId,callId:t.callId,name:t.name,kind:m.Server},{type:"tool.input.finished",turnId:e.turnId,callId:t.callId}]},"_",0,function(e,t){let n=G[t.kind];return{type:"media.added",turnId:e.turnId,partId:j(e,n),media:{kind:t.kind,url:t.url,...void 0===t.expiresAt?{}:{expiresAt:t.expiresAt}}}},"s",0,j,"g",0,function(e,t){return{type:"status",turnId:e.turnId,label:t}},"y",0,function(e,t){return{type:"text.delta",turnId:e.turnId,partId:j(e,P.Text),delta:t}},"l",0,function(e,t){return{type:"text.delta",turnId:e.turnId,partId:j(e,P.Transcript),delta:t}},"m",0,function(e,a){return{type:"turn.failed",turnId:e.turnId,error:function(e){let{status:a}=e;return{...p(e.code,e.message),status:void 0!==a&&(0,n.q)(a,t.g)?a:null,...void 0===a?{}:{rawStatus:a},location:e.location}}(a)}},"L",0,function(e){return{type:"turn.finished",turnId:e.turnId,reason:"stop"}},"A",0,function(e){return{type:"turn.started",turnId:e.turnId}},"j",0,function(e,t){return{type:"usage",turnId:e.turnId,usage:t}},"n",0,function(e,t){return{type:"media.added",turnId:e.turnId,partId:j(e,P.VideoJob),media:{kind:"video",jobId:t}}}],372953)},241782,e=>{"use strict";let t=["queued","processing"],n=[...t,"loading"];e.s(["G",0,2e3,"e",0,5,"T",0,5,"L",0,360,"H",0,5e3,"r",0,[500,1e3,2e3,2e3,3e3,3e3,5e3,5e3,5e3,5e3],"I",0,10,"K",0,t,"y",0,n])},390177,e=>{"use strict";e.i(342837),e.i(647204),e.i(988590),e.i(549692),e.s(["f",0,function(e){let t=e.trim().match(/^(\d+)\s*[x×]\s*(\d+)$/i);if(!t?.[1]||!t[2])return null;let n=Number.parseInt(t[1],10),a=Number.parseInt(t[2],10);return n<=0||a<=0?null:{width:n,height:a}}])},212416,e=>{"use strict";e.s(["f",0,function(e){return null!==e.runningImage?e.runningImage:null===e.desiredSetAt?e.bootedImage:null}])},219643,e=>{"use strict";e.i(427150);var t=e.i(368966);let n={[t.E.Max]:[t.E.XHigh,t.E.High,t.E.Medium,t.E.Low],[t.E.XHigh]:[t.E.High,t.E.Medium,t.E.Low],[t.E.Minimal]:[t.E.Low,t.E.Medium,t.E.High],[t.E.None]:[],[t.E.Low]:[t.E.Medium,t.E.High],[t.E.Medium]:[t.E.Low,t.E.High],[t.E.High]:[t.E.Medium,t.E.Low]};Object.values(t.V).reverse(),e.s(["w",0,function(e){let n=e?.supported_reasoning_efforts;return n&&0!==n.length?e.is_mandatory_reasoning?[...n]:[...n,t.E.None]:null},"$",0,function(e,t){if(!e)return;if(!t||0===t.length)return e;let a=new Set(t);if(a.has(e))return e;for(let t of n[e])if(a.has(t))return t}])},367765,e=>{"use strict";var t=e.i(427150);function n(){return"u">typeof globalThis&&"Summarizer"in globalThis}function a(){return r()?.model??null}function r(){if("u"n.call(e,t),create:t=>a.call(e,t)}}function o(e,t){var n,a;let r,i,o="function"!=typeof(r=l(n=e,"text"===t?"canCreateTextSession":"canCreateGenericSession"))?null:e=>r.call(n,e),d="function"!=typeof(i=l(a=e,"text"===t?"createTextSession":"createGenericSession"))?null:e=>i.call(a,e);return o&&d?{availability:async e=>(function(e){switch(e){case"readily":return"available";case"after-download":return"downloadable";case"no":return"unavailable";default:return e}})(await o(e)),create:async e=>(function(e){if("function"==typeof e.promptStreaming){var t;return{prompt:e.prompt??(t=e.promptStreaming.bind(e),async(e,n)=>{let a=[];for await(let r of b(t(e,n)))a.push(r);return a.join("")}),promptStreaming:e.promptStreaming.bind(e),destroy:e.destroy?.bind(e)??(()=>{})}}if("function"==typeof e.prompt){let t=e.prompt.bind(e);return{prompt:t,promptStreaming:(e,n)=>s(t,e,n),destroy:e.destroy?.bind(e)??(()=>{})}}throw Error("LanguageModel session is missing prompt APIs")})(await d(e))}:null}async function*s(e,t,n){yield await e(t,n)}function l(e,t){let n=u(e);return n?Reflect.get(n,t)??null:null}function d(e,t){return"function"==typeof l(e,t)}function p(e){let t=u(e);if(!t)return[];try{return Object.getOwnPropertyNames(t).sort()}catch{return[]}}function u(e){return"object"!=typeof e&&"function"!=typeof e||null===e?null:e}async function c(){return n()?Summarizer.availability({type:"headline",format:"plain-text",length:"short"}):null}async function m(e){let t=a();return t?t.availability(e):null}function g(e){return e.lengthComputable&&e.total>0?Math.round(e.loaded/e.total*100):e.loaded>=0&&e.loaded<=1?Math.round(100*e.loaded):Math.max(0,Math.min(100,Math.round(e.loaded)))}async function f(e){return A(e,{sharedContext:"This is a chat message sent to an AI assistant. Generate a concise title."})}async function h(e,t){let n=e.trim();if(!n)return null;let a=await I({input:n,options:t}),r=[];for await(let e of a)r.push(e);let i=r.join("").trim();return i.length>0?i:null}async function A(e,t){if(!n())return null;let a=e.trim();if(!a||"available"!==await Summarizer.availability({type:"headline",format:"plain-text",length:t?.length??"short"}))return null;let r=await Summarizer.create({type:"headline",format:"plain-text",length:t?.length??"short",sharedContext:t?.sharedContext});try{let e=(await r.summarize(a)).trim();if(!e)return null;let n=t?.maxLength??80;return e.slice(0,n)}finally{r.destroy()}}async function*I({input:e,signal:t,options:n,promptOptions:r}){let i=a();if(!i)throw Error("LanguageModel API is not available");let o=await i.availability(n);if("available"!==o)throw Error(`LanguageModel is ${o}`);let s=await i.create({...n,signal:t});try{let n=s.promptStreaming(e,{...r,signal:t});yield*b(n)}finally{s.destroy()}}async function*b(e){let t="",n=null;for await(let a of y(e)){if(!a)continue;null===n&&t.length>0&&(n=a.startsWith(t));let e=!0===n&&t.length>0?a.slice(t.length):a;t=!0===n?a:`${t}${a}`,e.length>0&&(yield e)}}async function*y(e){if("getReader"in e){let t=e.getReader();try{let e=await t.read();for(;!e.done;)yield e.value,e=await t.read()}finally{t.releaseLock()}return}yield*e}e.s(["P",0,m,"a",0,function(){let e="u"{t.addEventListener("downloadprogress",t=>{t instanceof ProgressEvent&&e(g(t))})}}).then(t=>{e(100),t.destroy()},e=>{t(e)}):t(Error("LanguageModel API is not available"))},"s",0,function(e,t,a){n()?Summarizer.create({type:"headline",format:"plain-text",length:"short",signal:a,monitor:t=>{t.addEventListener("downloadprogress",t=>{e(g(t))})}}).then(t=>{e(100),t.destroy()},e=>{t(e)}):t(Error("Summarizer API is not available"))}])},575889,e=>{"use strict";function t(e){try{let t=new URL(e);if(t.origin!==location.origin)return`${location.origin}${t.pathname}${t.search}`}catch{}return e}e.s(["f",0,function(){return{fetchApi:(e,t)=>fetch(e,t),rewriteUrl:t}}])},944946,e=>{"use strict";var t=e.i(942960),n=e.i(393182),a=e.i(331194);let r={[n.f.FusionFlash]:a.m.GeneralFast},i=[n.f.Fusion,...Object.keys(r)];e.s(["f",0,function(e){return i.includes((0,t.f)(e.toLowerCase()))}])},519004,e=>{"use strict";e.s(["f",0,function(e){return"number"==typeof e?.min&&"number"==typeof e.max}])},660571,e=>{"use strict";var t=e.i(167182);let n=new TextEncoder,a=/[^\x00-\x7F]/,r=/(?:)/;function i(e){if(void 0!==t.Buffer&&"function"==typeof e.isWellFormed&&e.isWellFormed())return r.test(""),t.Buffer.byteLength(e,"utf8");let n=e.search(a);if(-1===n)return e.length;r.test("");let i=n;for(let t=n;te+t.length,0);return n<1048576||t.some(e=>{let t=Math.min(e.length,4096);for(let n=0;n127)return!0;let n=Math.max(t,e.length-4096);for(let t=n;t127)return!0;return!1})?e.encode(t.join("")):function({encoder:e,strings:t,codeUnitLength:n}){let a=new Uint8Array(n),r=0;for(let n=0;ne+i(t),0));l.set(r.subarray(0,o));let d=o;for(let n of s){let a=e.encodeInto(n,l.subarray(d));if(a.read!==n.length)return e.encode(t.join(""));d+=a.written}return l}({encoder:e,strings:t,stringIndex:n,stringOffset:s.read,output:a,byteOffset:r})}return a}({encoder:e,strings:t,codeUnitLength:n})},"i",0,function(e){return e.length<1048576?n.encode(e).byteLength:i(e)}])},390623,e=>{"use strict";e.s(["q",0,"contains characters that cannot be sent in an HTTP header — check for stray unicode dashes or invisible characters from copy-paste","r",0,function(e){return null===function(e){let t=[],n=[],a=0;for(;a126)&&(t.push(`U+${r.toString(16).toUpperCase().padStart(4,"0")}`),n.push(a)),a+=r>65535?2:1}return 0===t.length?null:{codePoints:t,positions:n}}(e)}])},423491,34966,579255,711359,e=>{"use strict";e.s(["f",0,"[DONE]"],423491),e.i(660571);var t=e.i(647204);class n extends Error{type;field;value;line;lineTerminator;constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line,this.lineTerminator=t.lineTerminator}}function a(e){}function r(e){let t;if("function"==typeof e)throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:r=a,onError:o=a,onRetry:s=a,onComment:l,shouldReportError:d}=e,p=[],u=!0,c="",m="";function g(e,n){if(""===e)return void(c.length>0&&r({id:t,event:m||void 0,data:c.endsWith("\n")?c.slice(0,-1):c}),t=void 0,c="",m="");if(e.startsWith(":")){l&&l(e.slice(e.startsWith(": ")?2:1));return}if(e.startsWith("data:"))return void h(e.slice(" "===e[5]?6:5));let a=e.indexOf(":");if(-1!==a){let t=e.slice(0,a),r=" "===e[a+1]?2:1;f({field:t,value:e.slice(a+r),line:e,lineTerminator:n});return}f({field:e,value:"",line:e,lineTerminator:n})}function f({field:e,value:a,line:r,lineTerminator:i}){switch(e){case"event":m=a;break;case"data":h(a);break;case"id":t=a.includes("\0")?void 0:a;break;case"retry":if(/^\d+$/.test(a)){s(Number.parseInt(a,10));break}if(d?.(r)===!1)break;o(new n(`Invalid \`retry\` value: "${a}"`,{type:"invalid-retry",value:a,line:r,lineTerminator:i}));break;default:if(d?.(r)===!1)break;o(new n(`Unknown field "${e.length>20?`${e.slice(0,20)}…`:e}"`,{type:"unknown-field",field:e,value:a,line:r,lineTerminator:i}))}}function h(e){c=`${c}${e} `}return{feed:function(e){let t=u?e.replace(/^\u00EF\xBB\u00BF/,""):e,n=p.at(-1)?.endsWith("\r")===!0;if(p.push(t),!n&&!t.includes("\n")&&!t.includes("\r")){u=!1;return}let a=p.join("");p=[];let r=i(a,g,h);r&&p.push(r),u=!1},reset:function(e={}){let n;if(p.length>0&&e.consume){let e=p.join("");if(e){let t=i(e,g,h,!0);t&&g(t),n=e}}return u=!0,t=void 0,c="",m="",p=[],n}}}function i(e,t,n,a=!1){let r=e.indexOf("\r");if(-1===r){var o,s,l=e,d=t,p=n;let a=0;for(;a{}),t.releaseLock()}}e.s(["f",0,r],34966),e.s(["f",0,o],579255),e.i(67089),e.i(30012);e.i(549692);e.i(390515);async function*s(e){let n,a,i,s=(n=new TextDecoder,a=[],i=r({onEvent:e=>{a.push(e.data)}}),e=>{a=[];let t=e?n.decode(e,{stream:!0}):n.decode();return i.feed(t),a}),l=o(e);try{for await(let e of l)for(let n of s(e))yield(0,t.N)(n)}catch(e){yield(0,t.Y)(e)}return l}e.s(["f",0,s],711359)},236911,e=>{"use strict";e.s(["f",0,function(e){throw Error(`Unexpected value: ${e}`)}])},814492,e=>{"use strict";var t,n,a=e.i(169798),r=e.i(335609),i=e.i(647204);e.i(30012);var o=e.i(882844),s=e.i(635157);let l=(n=[(t=s.z.object({PROVIDER_ENCRYPTION_KEY:s.z.string().nullish(),SIGNUP_CF_SEAL_KEY:s.z.string().nullish(),CALLBACK_URL_ENCRYPTION_KEY:s.z.string().nullish(),AUTH_USER_SALT:s.z.string().default("default-salt"),CI:s.z.string().default(""),SITE_URL:s.z.string().nullish()}),e=>{let n=(0,o.C)(t,e??a.default.env);return(0,i.V)(n)?(0,i.Y)(n.error.message):(0,i.N)(n.data)})],function(e){let t=[];for(let a of n){let n=a(e);if((0,i.V)(n))return n;t.push(n.data)}return(0,i.N)(Object.assign({},...t))});var d=e.i(640216);e.s(["G",0,()=>{var e;return e={production:"https://internal.openrouter.ai",local:"http://localhost:3001"},(0,d.y)(window.location.hostname)?e.local:e.production},"P",0,()=>{let e=[(0,i.u)(l()).SITE_URL,a.default?.env?.NEXT_PUBLIC_SITE_URL,a.default?.env?.NEXT_PUBLIC_VERCEL_URL].map(e=>e?.trim()).find(e=>!!e)??"https://openrouter.ai";return(0,r.d)(e.includes("http")?e:`https://${e}`)},"c",0,function(e){let t=e.replaceAll(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"_");return t.match(/^(?:\d|--|-\d)/)?`_${t}`:t}],814492)},586906,e=>{"use strict";e.i(371492);let t=e=>crypto.getRandomValues(new Uint8Array(e));var n,a=((n={}).Generate="gen",n.Embeddings="gen-emb",n.Character="char",n.Message="msg",n.Artifact="art",n.Generation="art-gen",n.ArtifactFile="art-file",n.ArtifactVersion="art-ver",n.ArtifactFileContent="art-file-cont",n.AssistantMessageItem="a-msg-item",n.Item="item",n.Chat="orc",n.StripeAddCredits="sac",n.VideoGeneration="gen-vid",n.Rerank="gen-rerank",n.Decisions="gen-dec",n.TTS="gen-tts",n.Transcription="gen-stt",n.ImageGeneration="gen-img",n.Batch="batch",n.BatchGeneration="gen-batch",n.ServerToolCall="gen-tool",n.ServerToolCheckpoint="gen-tool-cp",n.Realtime="gen-rt",n.RealtimeCheckpoint="gen-rt-cp",n.Request="req",n);let r=((e,n=21)=>((e,t,n)=>{let a=256-256%e.length;if(256===a){let a=e.length-1;return (r=t)=>{if(!r)return"";let i="";for(;;){let t=n(r),o=r|=0;for(;o--;)if((i+=e[t[o]&a]).length>=r)return i}}}return (r=t)=>{if(!r)return"";let i="",o=Math.ceil(409.6*r/a);for(;;){let t=n(o),s=o;for(;s--;)if(t[s]=r)return i}}})(e,0|n,t))("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",20),i=/^[0-9a-zA-Z]{20}$/;e.s(["I",()=>a,"t",0,function(e,t){let n=`${t}-`;if(!e.startsWith(n))return!1;let a=e.slice(n.length),r=a.indexOf("-");if(-1===r)return!1;let o=a.slice(0,r),s=a.slice(r+1),l=Number.parseInt(o,10);return!Number.isNaN(l)&&!(l<=0)&&i.test(s)},"L",0,function(e){let t=Math.floor(Date.now()/1e3);return`${e}-${t}-${r()}`}],586906)},733476,e=>{"use strict";e.i(988590);var t,n,a,r,i=((t={}).AzureOpenAIEmbeddingsAdapter="AzureOpenAIEmbeddingsAdapter",t.OpenAIEmbeddingsAdapter="OpenAIEmbeddingsAdapter",t.DeepInfraEmbeddingsAdapter="DeepInfraEmbeddingsAdapter",t.NvidiaEmbeddingsAdapter="NvidiaEmbeddingsAdapter",t.VoyageEmbeddingsAdapter="VoyageEmbeddingsAdapter",t.VoyageMultimodalEmbeddingsAdapter="VoyageMultimodalEmbeddingsAdapter",t.CohereEmbeddingsAdapter="CohereEmbeddingsAdapter",t.PerplexityEmbeddingsAdapter="PerplexityEmbeddingsAdapter",t.GoogleAIStudioEmbeddingsAdapter="GoogleAIStudioEmbeddingsAdapter",t.GoogleVertexEmbeddingsAdapter="GoogleVertexEmbeddingsAdapter",t.AmazonBedrockEmbeddingsAdapter="AmazonBedrockEmbeddingsAdapter",t),o=((n={}).AlibabaImageAdapter="AlibabaImageAdapter",n.SeedreamImageAdapter="SeedreamImageAdapter",n.XaiImageAdapter="XaiImageAdapter",n.RecraftImageAdapter="RecraftImageAdapter",n.BlackForestLabsImageAdapter="BlackForestLabsImageAdapter",n.BlackForestLabsFlux3ImageAdapter="BlackForestLabsFlux3ImageAdapter",n.SourcefulImageAdapter="SourcefulImageAdapter",n.SourcefulV2ImageAdapter="SourcefulV2ImageAdapter",n.SourcefulV25ImageAdapter="SourcefulV25ImageAdapter",n.SourcefulV26ImageAdapter="SourcefulV26ImageAdapter",n.OpenAIImageAdapter="OpenAIImageAdapter",n.MetaImageAdapter="MetaImageAdapter",n.GoogleAIStudioGeminiImageAdapter="GoogleAIStudioGeminiImageAdapter",n.GoogleVertexGeminiImageAdapter="GoogleVertexGeminiImageAdapter",n.AzureMAIImageAdapter="AzureMAIImageAdapter",n.AzureOpenAIImageAdapter="AzureOpenAIImageAdapter",n.QuiverImageAdapter="QuiverImageAdapter",n.KreaImageAdapter="KreaImageAdapter",n.NovitaImageAdapter="NovitaImageAdapter",n.TencentImageAdapter="TencentImageAdapter",n.TencentPanoramaImageAdapter="TencentPanoramaImageAdapter",n.MinimaxImageAdapter="MinimaxImageAdapter",n),s=((a={}).AzureDecisionsAdapter="AzureDecisionsAdapter",a.AzureOpenAIDecisionsAdapter="AzureOpenAIDecisionsAdapter",a.BasetenDecisionsAdapter="BasetenDecisionsAdapter",a.CloudflareDecisionsAdapter="CloudflareDecisionsAdapter",a.DeepInfraSystemOneDecisionsAdapter="DeepInfraSystemOneDecisionsAdapter",a.GoogleAIStudioDecisionsAdapter="GoogleAIStudioDecisionsAdapter",a.GoogleVertexDecisionsAdapter="GoogleVertexDecisionsAdapter",a.HeyGenDecisionsAdapter="HeyGenDecisionsAdapter",a.InceptionDecisionsAdapter="InceptionDecisionsAdapter",a.LiquidDecisionsAdapter="LiquidDecisionsAdapter",a.MakoraDecisionsAdapter="MakoraDecisionsAdapter",a.MorphDecisionsAdapter="MorphDecisionsAdapter",a.OpenAIDecisionsAdapter="OpenAIDecisionsAdapter",a.ParallelDecisionsAdapter="ParallelDecisionsAdapter",a.PerplexityDecisionsAdapter="PerplexityDecisionsAdapter",a.PrimeIntellectDecisionsAdapter="PrimeIntellectDecisionsAdapter",a.RespanDecisionsAdapter="RespanDecisionsAdapter",a.RespanSystemOneDecisionsAdapter="RespanSystemOneDecisionsAdapter",a.ScaleDownDecisionsAdapter="ScaleDownDecisionsAdapter",a.TogetherTevDecisionsAdapter="TogetherTevDecisionsAdapter",a.TypeSafeDecisionsAdapter="TypeSafeDecisionsAdapter",a.TypeSafeFirstPartyDecisionsAdapter="TypeSafeFirstPartyDecisionsAdapter",a),l=((r={}).AI21Adapter="AI21Adapter",r.AionLabsAdapter="AionLabsAdapter",r.AkashAdapter="AkashAdapter",r.ArceeAdapter="ArceeAdapter",r.AmazonBedrockConverseAdapter="AmazonBedrockConverseAdapter",r.AmazonBedrockConverseNovaReasoningAdapter="AmazonBedrockConverseNovaReasoningAdapter",r.AmazonBedrockInvokeAnthropicAdapter="AmazonBedrockInvokeAnthropicAdapter",r.AmazonBedrockOSSAdapter="AmazonBedrockOSSAdapter",r.AmazonBedrockRuntimeChatCompletionsAdapter="AmazonBedrockRuntimeChatCompletionsAdapter",r.AmazonNovaAdapter="AmazonNovaAdapter",r.AnthropicMessageAdapter="AnthropicMessageAdapter",r.ClaudeOnAwsAdapter="ClaudeOnAwsAdapter",r.AlibabaAdapter="AlibabaAdapter",r.AmbientAdapter="AmbientAdapter",r.BlackForestLabsAdapter="BlackForestLabsAdapter",r.BaiduAdapter="BaiduAdapter",r.AvianAdapter="AvianAdapter",r.AzureAnthropicAdapter="AzureAnthropicAdapter",r.AzureMistralAdapter="AzureMistralAdapter",r.AzureOpenAIAdapter="AzureOpenAIAdapter",r.AzureOpenAIResponsesAdapter="AzureOpenAIResponsesAdapter",r.AzureMAIImageAdapter="AzureMAIImageAdapter",r.AzureOSSAdapter="AzureOSSAdapter",r.BasetenAdapter="BasetenAdapter",r.BytePlusAdapter="BytePlusAdapter",r.ChutesAdapter="ChutesAdapter",r.CloudflareAdapter="CloudflareAdapter",r.CohereCompatAdapter="CohereCompatAdapter",r.CohereV2Adapter="CohereV2Adapter",r.InternalStreamCohereV2Adapter="InternalStreamCohereV2Adapter",r.CerebrasAdapter="CerebrasAdapter",r.ClarifaiAdapter="ClarifaiAdapter",r.CosineAdapter="CosineAdapter",r.CrucibleAdapter="CrucibleAdapter",r.CrucibleResponsesAdapter="CrucibleResponsesAdapter",r.CrusoeAdapter="CrusoeAdapter",r.DarkbloomAdapter="DarkbloomAdapter",r.DatabricksAnthropicAdapter="DatabricksAnthropicAdapter",r.DatabricksOpenResponsesAdapter="DatabricksOpenResponsesAdapter",r.DeepInfraAdapter="DeepInfraAdapter",r.DeepSeekAdapter="DeepSeekAdapter",r.DigitalOceanAdapter="DigitalOceanAdapter",r.EncodedImageOpenAIAdapter="EncodedImageOpenAIAdapter",r.FakeAdapter="FakeAdapter",r.FireworksAdapter="FireworksAdapter",r.FireworksAnthropicAdapter="FireworksAnthropicAdapter",r.FriendliAdapter="FriendliAdapter",r.GoogleAIStudioGeminiAdapter="GoogleAIStudioGeminiAdapter",r.GoogleVertexAnthropicAdapter="GoogleVertexAnthropicAdapter",r.GoogleVertexGeminiAdapter="GoogleVertexGeminiAdapter",r.GroqAdapter="GroqAdapter",r.InceptionAdapter="InceptionAdapter",r.InceptronAdapter="InceptronAdapter",r.InferactVLLMAdapter="InferactVLLMAdapter",r.InferenceNetAdapter="InferenceNetAdapter",r.InfermaticAdapter="InfermaticAdapter",r.InflectionAdapter="InflectionAdapter",r.InflectionLegacyAdapter="InflectionLegacyAdapter",r.InternalStreamAmazonBedrockInvokeAnthropicAdapter="InternalStreamAmazonBedrockInvokeAnthropicAdapter",r.InternalStreamAmazonBedrockOpenAIResponsesAdapter="InternalStreamAmazonBedrockOpenAIResponsesAdapter",r.InternalStreamAmazonBedrockRuntimeOpenAIResponsesAdapter="InternalStreamAmazonBedrockRuntimeOpenAIResponsesAdapter",r.InternalStreamAnthropicMessageAdapter="InternalStreamAnthropicMessageAdapter",r.InternalStreamAzureAnthropicAdapter="InternalStreamAzureAnthropicAdapter",r.InternalStreamAzureMAIImageAdapter="InternalStreamAzureMAIImageAdapter",r.InternalStreamAzureOpenAIResponsesAdapter="InternalStreamAzureOpenAIResponsesAdapter",r.InternalStreamClaudeOnAwsAdapter="InternalStreamClaudeOnAwsAdapter",r.InternalStreamGoogleAIStudioInteractionsAdapter="InternalStreamGoogleAIStudioInteractionsAdapter",r.InternalStreamGoogleVertexAnthropicAdapter="InternalStreamGoogleVertexAnthropicAdapter",r.InternalStreamGoogleVertexInteractionsAdapter="InternalStreamGoogleVertexInteractionsAdapter",r.InternalStreamGoogleVertexResponsesAdapter="InternalStreamGoogleVertexResponsesAdapter",r.InternalStreamOpenAIResponsesAdapter="InternalStreamOpenAIResponsesAdapter",r.InternalStreamRecraftAdapter="InternalStreamRecraftAdapter",r.InternalStreamXAIImageAdapter="InternalStreamXAIImageAdapter",r.InternalStreamXAIResponsesAdapter="InternalStreamXAIResponsesAdapter",r.IonetAdapter="IonetAdapter",r.IonstreamAdapter="IonstreamAdapter",r.MakoraAdapter="MakoraAdapter",r.MancerAdapter="MancerAdapter",r.InternalStreamMetaResponsesAdapter="InternalStreamMetaResponsesAdapter",r.MistralAdapter="MistralAdapter",r.MinimaxAdapter="MinimaxAdapter",r.ModelRunAdapter="ModelRunAdapter",r.MinimaxChatCompletionV2Adapter="MinimaxChatCompletionV2Adapter",r.MoonshotAdapter="MoonshotAdapter",r.MorphAdapter="MorphAdapter",r.MorphFastApplyAdapter="MorphFastApplyAdapter",r.NearAIAdapter="NearAIAdapter",r.NebiusAdapter="NebiusAdapter",r.NexAGIAdapter="NexAGIAdapter",r.NextBitAdapter="NextBitAdapter",r.NovitaAdapter="NovitaAdapter",r.NvidiaAdapter="NvidiaAdapter",r.OllamaAdapter="OllamaAdapter",r.OpenAIAdapter="OpenAIAdapter",r.AtlasCloudAdapter="AtlasCloudAdapter",r.GMICloudAdapter="GMICloudAdapter",r.OpenInferenceAdapter="OpenInferenceAdapter",r.ParasailAdapter="ParasailAdapter",r.PhalaAdapter="PhalaAdapter",r.PearlResearchAdapter="PearlResearchAdapter",r.PrimeIntellectAdapter="PrimeIntellectAdapter",r.OpenAIResponsesAdapter="OpenAIResponsesAdapter",r.PerceptronAdapter="PerceptronAdapter",r.PerplexityAdapter="PerplexityAdapter",r.RecraftAdapter="RecraftAdapter",r.RelaceAdapter="RelaceAdapter",r.StealthAdapter="StealthAdapter",r.StealthAdapter2="StealthAdapter2",r.InternalStreamStealthAdapter2="InternalStreamStealthAdapter2",r.StepFunAdapter="StepFunAdapter",r.StreamLakeAdapter="StreamLakeAdapter",r.TogetherAdapter="TogetherAdapter",r.UnbiasedAdapter="UnbiasedAdapter",r.UpstageAdapter="UpstageAdapter",r.XAIImageAdapter="XAIImageAdapter",r.XAIResponsesAdapter="XAIResponsesAdapter",r.XiaomiAdapter="XiaomiAdapter",r.ZAIAdapter="ZAIAdapter",r.SiliconFlowAdapter="SiliconFlowAdapter",r.SailResearchAdapter="SailResearchAdapter",r.SakanaAIAdapter="SakanaAIAdapter",r.SambaNovaAdapter="SambaNovaAdapter",r.ScaleDownAdapter="ScaleDownAdapter",r.TenstorrentAdapter="TenstorrentAdapter",r.ThinkingMachinesAdapter="ThinkingMachinesAdapter",r.SeedreamAdapter="SeedreamAdapter",r.InternalStreamSeedreamAdapter="InternalStreamSeedreamAdapter",r.SourcefulAdapter="SourcefulAdapter",r.SourcefulV2Adapter="SourcefulV2Adapter",r.SourcefulV25Adapter="SourcefulV25Adapter",r.SourcefulV26Adapter="SourcefulV26Adapter",r.InternalStreamBlackForestLabsAdapter="InternalStreamBlackForestLabsAdapter",r.InternalStreamSourcefulAdapter="InternalStreamSourcefulAdapter",r.InternalStreamSourcefulV2Adapter="InternalStreamSourcefulV2Adapter",r.InternalStreamSourcefulV25Adapter="InternalStreamSourcefulV25Adapter",r.InternalStreamSourcefulV26Adapter="InternalStreamSourcefulV26Adapter",r.VeniceAdapter="VeniceAdapter",r.VertexOpenAIAdapter="VertexOpenAIAdapter",r.VLLMChatCompletionsAdapter="VLLMChatCompletionsAdapter",r.VLLMOpenAIAdapter="VLLMOpenAIAdapter",r.WaferAdapter="WaferAdapter",r.WandbAdapter="WandbAdapter",r);e.s(["n",()=>l,"o",0,{Stub:"stub",OpenAIBatchAdapter:"OpenAIBatchAdapter",AnthropicBatchAdapter:"AnthropicBatchAdapter",GoogleAIStudioGeminiBatchAdapter:"GoogleAIStudioGeminiBatchAdapter",VertexGeminiBatchAdapter:"VertexGeminiBatchAdapter",VertexDeferredInteractionsBatchAdapter:"VertexDeferredInteractionsBatchAdapter",TogetherBatchAdapter:"TogetherBatchAdapter",ParasailBatchAdapter:"ParasailBatchAdapter",DeepInfraBatchAdapter:"DeepInfraBatchAdapter",AlibabaBatchAdapter:"AlibabaBatchAdapter",FireworksBatchAdapter:"FireworksBatchAdapter",MistralBatchAdapter:"MistralBatchAdapter",XAIBatchAdapter:"XAIBatchAdapter",SailResearchBatchAdapter:"SailResearchBatchAdapter",MorphBatchAdapter:"MorphBatchAdapter"},"G",()=>s,"R",()=>i,"W",0,{CloudflareClairicExtractionsAdapter:"CloudflareClairicExtractionsAdapter",InceptionExtractionsAdapter:"InceptionExtractionsAdapter",InferenceNetSchematronExtractionsAdapter:"InferenceNetSchematronExtractionsAdapter",PerplexityExtractionsAdapter:"PerplexityExtractionsAdapter",SageExtractionsAdapter:"SageExtractionsAdapter",ScaleDownExtractionsAdapter:"ScaleDownExtractionsAdapter"},"O",()=>o,"u",0,{AlibabaTTSAdapter:"AlibabaTTSAdapter",AssemblyAITTSAdapter:"AssemblyAITTSAdapter",AzureTTSAdapter:"AzureTTSAdapter",OpenAITTSAdapter:"OpenAITTSAdapter",OpenAISSETTSAdapter:"OpenAISSETTSAdapter",DeepInfraTTSAdapter:"DeepInfraTTSAdapter",GoogleVertexTTSAdapter:"GoogleVertexTTSAdapter",GoogleAIStudioTTSAdapter:"GoogleAIStudioTTSAdapter",MistralTTSAdapter:"MistralTTSAdapter",XAITTSAdapter:"XAITTSAdapter",DeepgramTTSAdapter:"DeepgramTTSAdapter",MinimaxTTSAdapter:"MinimaxTTSAdapter",FishAudioTTSAdapter:"FishAudioTTSAdapter",TogetherTTSAdapter:"TogetherTTSAdapter",SeedAudioTTSAdapter:"SeedAudioTTSAdapter",ElevenLabsTTSAdapter:"ElevenLabsTTSAdapter",HeyGenTTSAdapter:"HeyGenTTSAdapter",SpeechifyTTSAdapter:"SpeechifyTTSAdapter"}])},898820,e=>{"use strict";let t={ChatCompletions:"chat-completions",Responses:"responses",AnthropicMessages:"anthropic-messages",Completions:"completions",Other:"other"},n=[{suffix:"/chat/completions",skin:t.ChatCompletions},{suffix:"/responses",skin:t.Responses},{suffix:"/messages",skin:t.AnthropicMessages},{suffix:"/completions",skin:t.Completions}];e.s(["$",0,n,"Q",0,t])},683838,e=>{"use strict";e.s(["E",0,{"1:1":"1:1","1:2":"1:2","1:3":"1:3","1:4":"1:4","1:8":"1:8","2:1":"2:1","2:3":"2:3","3:1":"3:1","2.35:1":"2.35:1","3:2":"3:2","3:4":"3:4","4:1":"4:1","4:3":"4:3","4:5":"4:5","5:2":"5:2","5:4":"5:4","5:7":"5:7","7:5":"7:5","8:1":"8:1","9:16":"9:16","16:9":"16:9","9:19.5":"9:19.5","19.5:9":"19.5:9","9:20":"9:20","20:9":"20:9","9:21":"9:21","21:9":"21:9",auto:"auto"},"g",0,{png:"png",jpeg:"jpeg",webp:"webp",svg:"svg",gif:"gif"},"r",0,{512:"512",768:"768","1K":"1K","1.5K":"1.5K","2K":"2K","4K":"4K"},"M",0,{edit:"edit",reference:"reference"},"b",0,{equirectangular:"equirectangular"},"u",0,{auto:"auto",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"}])},331194,485913,e=>{"use strict";var t=e.i(882844),n=e.i(635157),a=e.i(72916);e.s(["P",0,4,"b",0,16e3,"Z",0,8,"h",0,16,"a",0,8],485913);let r={GeneralHigh:"general-high",GeneralBudget:"general-budget",GeneralFast:"general-fast"},i=n.z.union([n.z.string(),(0,t.$)(),n.z.boolean(),n.z.null()]),o=n.z.union([i,n.z.array(i),n.z.record(n.z.string(),i)]),s=n.z.object({type:n.z.string().openapi({description:'Server tool type identifier (e.g. "openrouter:web_search", "openrouter:web_fetch").'}),parameters:n.z.record(n.z.string(),o).optional().openapi({description:"Optional configuration forwarded as the tool's `parameters` object."})}),l=n.z.object({id:n.z.literal(a.f.Fusion),enabled:n.z.boolean().optional().openapi({description:"Set to false to disable Fusion configuration for a run started by the `openrouter/fusion` model slug or `openrouter:fusion` server tool. Defaults to true."}),preset:n.z.nativeEnum(r).optional().openapi({description:"Configuration for a Fusion run started by the `openrouter/fusion` model slug or `openrouter:fusion` server tool. A curated OpenRouter preset (slugs follow `-`, e.g. `general-high`). Expands server-side into the preset's analysis_models panel and analyst model, so callers never name individual models. Explicitly provided `analysis_models` / `model` take precedence.",example:"general-high"}),analysis_models:n.z.array(n.z.string()).min(1).max(8).optional().openapi({description:'For a Fusion run started by the `openrouter/fusion` model slug or `openrouter:fusion` server tool, slugs of models to run in parallel as the "expert panel" the analyst analyzes. Each model receives the same user prompt with web_search + web_fetch enabled. Capped at 8 models to bound cost amplification. When omitted, defaults to the Quality preset from the /labs/fusion UI (~anthropic/claude-opus-latest, ~openai/gpt-sol-latest, ~google/gemini-pro-latest).',example:["~anthropic/claude-opus-latest","~openai/gpt-sol-latest","~google/gemini-pro-latest"]}),model:n.z.string().optional().openapi({description:"For a Fusion run started by the `openrouter/fusion` model slug or `openrouter:fusion` server tool, the slug of the model that performs both the analyst step (with web_search + web_fetch) and the final synthesis. When omitted, defaults to the first model in the Quality preset.",example:"~anthropic/claude-opus-latest"}),max_tool_calls:n.z.number().int().min(1).max(16).optional().openapi({description:"For a Fusion run started by the `openrouter/fusion` model slug or `openrouter:fusion` server tool, the maximum number of tool-calling steps each panelist (analysis model) and the analyst model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 4. Capped at 16.",example:12}),tools:n.z.array(s).max(8).optional().openapi({description:'For a Fusion run started by the `openrouter/fusion` model slug or `openrouter:fusion` server tool, server tools available to panelist and analyst inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: "openrouter:web_search" }, { type: "openrouter:web_fetch" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only).',example:[{type:"openrouter:web_search",parameters:{excluded_domains:["example.com"]}},{type:"openrouter:web_fetch"}]})}).openapi("FusionPlugin",{example:{id:"fusion",enabled:!0,analysis_models:["~anthropic/claude-opus-latest","~openai/gpt-sol-latest","~google/gemini-pro-latest"],model:"~anthropic/claude-opus-latest"}});e.s(["h",0,l,"m",0,r],331194)},470672,e=>{"use strict";e.s(["f",0,500])},173589,e=>{"use strict";e.i(882844);var t=e.i(635157);let n={Applied:"applied",Unchanged:"unchanged",Failed:"failed"},a=t.z.enum([n.Applied,n.Unchanged,n.Failed]),r={UpToDate:"up_to_date",NotRunning:"not_running",NoVm:"no_vm",NoReconcileTimer:"no_reconcile_timer",VaultSidecarConfigStale:"vault_sidecar_config_stale",Unrecognized:"unrecognized"};t.z.string().min(1).max(512).optional();t.z.enum(["stable","alpha"]).optional();let i=t.z.discriminatedUnion("kind",[t.z.object({kind:t.z.literal("available")}),t.z.object({kind:t.z.literal("unavailable"),reason:t.z.enum([r.UpToDate,r.NotRunning,r.NoVm,r.NoReconcileTimer,r.VaultSidecarConfigStale,r.Unrecognized]).catch(r.Unrecognized)})]),o={Applied:"applied",Pending:"pending",Unknown:"unknown"},s=t.z.enum([o.Applied,o.Pending,o.Unknown]),l=t.z.object({instructions:s,model:s,observedAt:t.z.string().nullable()});o.Unknown,o.Unknown;let d=t.z.object({bootedImage:t.z.string().nullable(),canReconcile:t.z.boolean().nullable().default(null),alphaImage:t.z.string().nullish(),alphaVersion:t.z.string().nullish(),currentImage:t.z.string().nullable(),currentVersion:t.z.string().nullish(),hasStaleVaultSidecar:t.z.boolean().nullable().default(null),desiredImage:t.z.string().nullable(),desiredSetAt:t.z.string().nullable(),hasVm:t.z.boolean(),observedAt:t.z.string().nullable(),runningImage:t.z.string().nullable(),personaSync:l.optional(),runningModel:t.z.string().nullable().default(null),runningModelObservedAt:t.z.string().nullable().default(null),runningVersion:t.z.string().nullable().default(null),resolvedVersion:t.z.object({image:t.z.string(),version:t.z.string()}).nullable().default(null),state:a.nullable()});t.z.object({availability:i,runtimeImage:d}),e.s(["B",0,o,"e",0,n,"C",0,a,"f",0,r])},744475,476434,3977,e=>{"use strict";var t=e.i(663456),n=e.i(819750),a=e.i(524287),r=e.i(119816),i=e.i(905361),o=e.i(342837),s=e.i(647204),l=e.i(882844),d=e.i(635157),p=e.i(552221),u=e.i(549692),c=e.i(470672),m=e.i(613497),g=e.i(173465),f=e.i(618115),h=e.i(56222);e.i(16043);var A=e.i(612523),I=e.i(702596),b=e.i(55569);let y=new WeakMap,v=(0,l.j)(d.z.object({error:d.z.object({code:d.z.literal("intern_asleep")})})),S=(0,l.j)(d.z.object({error:d.z.object({code:d.z.enum(["intern_restarting","intern_timeout"])})}));function w(e){let t=(0,I.i)(e)?.message;return void 0!==t&&S((0,b.N)(t))}function _(e,t){return!(w(e.state.error)||z(e.state.error))&&t}function z(e){let t=(0,I.i)(e)?.message;return void 0!==t&&v((0,b.N)(t))}function x(e){if(y.get(e.client)?.delete((0,m.q)(e.queryKey))===!0)return{};let t=e.client.getQueryState(e.queryKey);return void 0===t||void 0===t.data&&0===t.errorUpdateCount?{}:T}let T={"X-Ori-Background-Refresh":"1"};e.s(["Q",0,T,"V",0,x,"n",0,z,"i",0,w,"g",0,_,"o",0,function(e){let t=y.get(e.client)??new Set;t.add((0,m.q)(e.queryKey)),y.set(e.client,t)}],476434);let k=(0,a.f)("intern-provenance",{list:(e,t)=>[{internId:t,workspaceId:e}]});e.s(["V",0,k,"Z",0,function(e){return(0,g.f)({queryKey:k.list(e.workspaceId,e.internId),staleTime:r.y.ALWAYS,queryFn:({signal:t})=>{var a;return(0,n.f)((a=e.internId,`/api/frontend/v1/private/interns/${encodeURIComponent(a)}/provenance`),{signal:t})}})}],3977);let C="/api/frontend/v1/private/interns",M=(0,a.f)("interns",{list:e=>[{workspaceId:e}],byName:(e,t)=>[{name:t,workspaceId:e}],detail:(e,t)=>[{internId:t,workspaceId:e}],runtimeImage:(e,t)=>[{internId:t,workspaceId:e}],autoUpdate:(e,t)=>[{internId:t,workspaceId:e}],resolvedModel:(e,t)=>[{internId:t,workspaceId:e}],features:(e,t)=>[{internId:t,workspaceId:e}],featureSources:(e,t)=>[{internId:t,workspaceId:e}],operations:(e,t)=>[{internId:t,workspaceId:e}],usage:(e,t)=>[{internId:t,workspaceId:e}],featureFiles:e=>[e],featureFile:e=>[e],featureSkill:e=>[e],spend:e=>[{workspaceId:e}]}),E=c.f;function D(e){return{spendByInternId:new Map(e.interns.map(e=>[e.internId,e.spendUsd])),windowStart:e.windowStart}}async function R(e,t){let n=await (0,p.f)(`${C}/${e}/runtime-image`,{body:JSON.stringify({...void 0===t.image?{}:{image:t.image},...void 0===t.expectedImage?{}:{expectedImage:t.expectedImage}}),headers:{"Content-Type":"application/json"},method:"POST"});return(0,s.V)(n)?n:(0,s.N)(n.data.data)}let $=d.z.object({data:d.z.object({enqueued:d.z.literal(!0)})}),F=(0,l.j)($),V=d.z.object({error:d.z.object({code:d.z.string(),message:d.z.string()})}),O={InvalidResponse:"invalid_response",Network:"network",Server:"server"},N=d.z.object({provisioning_failure_reason:d.z.enum(O),provisioning_server_code:d.z.string().nullable(),provisioning_server_message:d.z.string().nullable()});function P(e,t){return(0,u.O)({location:e,rawError:`provisioning action failed: ${t.reason}`,internal:{provisioning_failure_reason:t.reason,provisioning_server_code:t.serverCode,provisioning_server_message:t.serverMessage}})}async function L(e,t){let n="interns.requestProvisioningAction",a=await (0,s.$)(()=>fetch(e,t));if((0,s.V)(a))return P(n,{reason:O.Network,serverCode:null,serverMessage:null});let r=await a.data.json().catch(()=>null);if(a.data.ok)return F(r)?(0,s.N)(!0):P(n,{reason:O.InvalidResponse,serverCode:null,serverMessage:null});let i=(0,l.C)(V,r);return P(n,{reason:O.Server,serverCode:(0,s.V)(i)?null:i.data.error.code,serverMessage:(0,s.V)(i)?null:i.data.error.message})}e.s(["R",0,O,"H",0,function(e,t){return(0,g.f)({queryKey:M.autoUpdate(e,t),queryFn:({signal:e})=>(0,n.f)(`${C}/${t}/auto-update`,{signal:e})})},"S",0,function(e,t){return(0,g.f)({queryKey:M.byName(e,t),queryFn:({signal:a})=>(0,n.f)(C,{searchParams:{limit:1,name:t,workspaceId:e},signal:a}),staleTime:r.y.ALWAYS})},"X",0,function(e,t){return(0,g.f)({queryKey:M.detail(e,t),queryFn:null===e||null===t?m.V:({signal:e})=>(0,n.f)(`${C}/${t}`,{signal:e})})},"t",0,function(e){let{enabled:t,...a}=e;return(0,g.f)({queryKey:M.featureFile(a),queryFn:({signal:e})=>(0,n.f)(`${C}/${a.internId}/features/${encodeURIComponent(a.featureId)}/files/${a.path.split("/").map(encodeURIComponent).join("/")}`,{signal:e}),enabled:t,staleTime:r.y.ALWAYS})},"_",0,function(e){let{enabled:t,...a}=e;return(0,g.f)({queryKey:M.featureFiles(a),queryFn:({signal:e})=>(0,n.f)(`${C}/${a.internId}/features/${encodeURIComponent(a.featureId)}/files`,{signal:e}),enabled:t,staleTime:r.y.ALWAYS})},"V",0,function(e){let{enabled:t,...a}=e;return(0,g.f)({queryKey:M.featureSkill(a),queryFn:({signal:e})=>(0,n.f)(`${C}/${a.internId}/features/${encodeURIComponent(a.featureId)}/skills/${encodeURIComponent(a.skillName)}`,{signal:e}),enabled:t,staleTime:r.y.ALWAYS})},"c",0,function(e){let{enabled:t,internId:a,workspaceId:i}=e;return(0,g.f)({queryKey:M.featureSources(i,a),queryFn:({client:e,queryKey:t,signal:r})=>(0,n.f)(`${C}/${a}/feature-sources`,{headers:x({client:e,queryKey:t}),signal:r}),enabled:t,staleTime:r.y.ALWAYS})},"T",0,function(e){let{enabled:t,internId:a,workspaceId:i}=e;return(0,g.f)({queryKey:M.features(i,a),queryFn:({client:e,queryKey:t,signal:r})=>(0,n.f)(`${C}/${a}/features`,{headers:x({client:e,queryKey:t}),signal:r}),enabled:t,staleTime:r.y.ALWAYS})},"d",0,function(e,t){return`${C}/${e}/icon?v=${t}`},"f",0,M,"M",0,function(e){let{enabled:t,internId:a,liveRefreshMs:i=!1,workspaceId:o}=e;return(0,g.f)({queryKey:M.operations(o,a),queryFn:({client:e,queryKey:t,signal:r})=>(0,n.f)(`${C}/${a}/operations`,{headers:x({client:e,queryKey:t}),signal:r}),enabled:t,staleTime:r.y.ALWAYS,refetchInterval:e=>_(e,i)})},"D",0,function(e,t){return(0,g.f)({queryKey:M.resolvedModel(e,t),queryFn:null===t?m.V:({signal:e})=>(0,n.f)(`${C}/${t}/model/resolved`,{signal:e}),staleTime:r.y.DEFAULT})},"e",0,function(e,t){return(0,g.f)({queryKey:M.runtimeImage(e,t),queryFn:null===t?m.V:({signal:e})=>(0,n.f)(`${C}/${t}/runtime-image`,{signal:e}),refetchInterval:e=>{var t;return void 0!==(t=e.state.data)&&(0,A.x)({availability:t.availability,facts:t.runtimeImage,nowMs:Date.now()}).state===A.I.Pending&&1e4},refetchIntervalInBackground:!0})},"B",0,function(e){let{enabled:t,internId:a,liveRefreshMs:i=!1,workspaceId:o}=e;return(0,g.f)({queryKey:M.usage(o,a),queryFn:({client:e,queryKey:t,signal:r})=>(0,n.f)(`${C}/${a}/operations/usage`,{headers:x({client:e,queryKey:t}),signal:r}),enabled:t,staleTime:r.y.ALWAYS,refetchInterval:e=>_(e,i)})},"b",0,function(e){return(0,g.f)({queryKey:M.list(e),queryFn:null===e?m.V:({signal:t})=>(0,n.f)(C,{searchParams:{limit:E,workspaceId:e},signal:t}),placeholderData:null===e?void 0:m.y})},"G",0,function(e){let t=(0,l.C)(N,e.internal);return(0,s.V)(t)?{reason:O.Network,serverCode:null,serverMessage:null}:{reason:t.data.provisioning_failure_reason,serverCode:t.data.provisioning_server_code,serverMessage:t.data.provisioning_server_message}},"Q",0,function(e){let n,a,r,o,l,d=(0,t.c)(14);return d[0]!==e.internId?(n=async t=>{let{origin:n,skill:a}=t,r=await (0,p.f)(`${C}/${e.internId}/skills?origin=${n}`,{body:JSON.stringify(a),headers:{"Content-Type":"application/json"},method:"PUT"});return(0,s.V)(r)?r:(0,s.N)(r.data.data)},d[0]=e.internId,d[1]=n):n=d[1],d[2]!==e.internId||d[3]!==e.workspaceId?(a=M.features(e.workspaceId,e.internId),d[2]=e.internId,d[3]=e.workspaceId,d[4]=a):a=d[4],d[5]!==e.internId||d[6]!==e.workspaceId?(r=k.list(e.workspaceId,e.internId),d[5]=e.internId,d[6]=e.workspaceId,d[7]=r):r=d[7],d[8]!==a||d[9]!==r?(o=[a,r],d[8]=a,d[9]=r,d[10]=o):o=d[10],d[11]!==n||d[12]!==o?(l={mutationFn:n,invalidates:o},d[11]=n,d[12]=o,d[13]=l):l=d[13],(0,i.h)(l)},"C",0,function(e){let n,a,r,o,l,d,u=(0,t.c)(19);return u[0]!==e.action||u[1]!==e.internId?(n=async t=>{let n=await (0,p.f)(`${C}/${e.internId}/feature-sources${"add"===e.action?"":"/remove"}`,{body:JSON.stringify({source:t}),headers:{"Content-Type":"application/json"},method:"add"===e.action?"PUT":"POST"});return(0,s.V)(n)?n:(0,s.N)(n.data.data)},u[0]=e.action,u[1]=e.internId,u[2]=n):n=u[2],u[3]!==e.internId||u[4]!==e.workspaceId?(a=M.featureSources(e.workspaceId,e.internId),u[3]=e.internId,u[4]=e.workspaceId,u[5]=a):a=u[5],u[6]!==e.internId||u[7]!==e.workspaceId?(r=M.features(e.workspaceId,e.internId),u[6]=e.internId,u[7]=e.workspaceId,u[8]=r):r=u[8],u[9]!==e.internId||u[10]!==e.workspaceId?(o=k.list(e.workspaceId,e.internId),u[9]=e.internId,u[10]=e.workspaceId,u[11]=o):o=u[11],u[12]!==a||u[13]!==r||u[14]!==o?(l=[a,r,o],u[12]=a,u[13]=r,u[14]=o,u[15]=l):l=u[15],u[16]!==n||u[17]!==l?(d={mutationFn:n,invalidates:l},u[16]=n,u[17]=l,u[18]=d):d=u[18],(0,i.h)(d)},"g",0,function(e){let n,a,r,l,d=(0,t.c)(10),u=(0,h.d)();d[0]!==e?(n=t=>[M.list(e),M.detail(e,t),M.runtimeImage(e,t),k.list(e,t)],d[0]=e,d[1]=n):n=d[1];let c=n;return d[2]!==c||d[3]!==u?(a=async e=>{var t;let n,a,{acknowledgeOrphans:r,acknowledgeWorkspaceLoss:i,internId:l}=e,d=(t={acknowledgeOrphans:r,acknowledgeWorkspaceLoss:i},n=new URLSearchParams,!0===t.acknowledgeOrphans&&n.set("acknowledge_orphans","true"),!0===t.acknowledgeWorkspaceLoss&&n.set("acknowledge_workspace_loss","true"),""===(a=n.toString())?"":`?${a}`),m=await (0,p.f)(`${C}/${l}${d}`,{method:"DELETE"});if((0,s.V)(m)){if(m.error.status===o.g.S409_Conflict)for(let e of c(l))u.invalidateQueries({queryKey:e});return m}return(0,s.N)(void 0)},d[2]=c,d[3]=u,d[4]=a):a=d[4],d[5]!==c?(r=(e,t)=>{let{internId:n}=t;return c(n)},d[5]=c,d[6]=r):r=d[6],d[7]!==a||d[8]!==r?(l={mutationFn:a,invalidates:i.C.BACKGROUND_ONLY,backgroundInvalidates:r},d[7]=a,d[8]=r,d[9]=l):l=d[9],(0,i.h)(l)},"A",0,function(e){let a,i,o=(0,t.c)(4);if(o[0]!==e)a=(0,g.f)({queryKey:M.spend(e),queryFn:null===e?m.V:({signal:t})=>(0,n.f)(`${C}/spend`,{searchParams:{workspaceId:e},signal:t}),staleTime:r.y.CATALOG}),o[0]=e,o[1]=a;else a=o[1];return o[2]!==a?(i={...a,select:D},o[2]=a,o[3]=i):i=o[3],(0,f.f)(i)},"l",0,function(e,n){let a,r=(0,t.c)(4),i=(0,h.d)();return r[0]!==n||r[1]!==i||r[2]!==e?(a=async()=>{await Promise.all([i.invalidateQueries({queryKey:M.detail(e,n)}),i.invalidateQueries({queryKey:M.list(e)})])},r[0]=n,r[1]=i,r[2]=e,r[3]=a):a=r[3],a},"h",0,function(e){let n,a=(0,t.c)(3),r=(0,h.d)();return a[0]!==r||a[1]!==e?(n=async()=>{await r.invalidateQueries({queryKey:M.list(e)})},a[0]=r,a[1]=e,a[2]=n):n=a[2],n},"r",0,function(e){let n,a=(0,t.c)(2);return a[0]!==e?(n={invalidates:i.C.NONE,mutationFn:()=>L(e,{method:"POST"})},a[0]=e,a[1]=n):n=a[1],(0,i.h)(n)},"E",0,function(e){let n,a,r,o,l,d=(0,t.c)(14);return d[0]!==e.internId?(n=async t=>{let n=await (0,p.f)(`${C}/${e.internId}/skills/${encodeURIComponent(t)}`,{method:"DELETE"});return(0,s.V)(n)?n:(0,s.N)(n.data.data)},d[0]=e.internId,d[1]=n):n=d[1],d[2]!==e.internId||d[3]!==e.workspaceId?(a=M.features(e.workspaceId,e.internId),d[2]=e.internId,d[3]=e.workspaceId,d[4]=a):a=d[4],d[5]!==e.internId||d[6]!==e.workspaceId?(r=k.list(e.workspaceId,e.internId),d[5]=e.internId,d[6]=e.workspaceId,d[7]=r):r=d[7],d[8]!==a||d[9]!==r?(o=[a,r],d[8]=a,d[9]=r,d[10]=o):o=d[10],d[11]!==n||d[12]!==o?(l={mutationFn:n,invalidates:o},d[11]=n,d[12]=o,d[13]=l):l=d[13],(0,i.h)(l)},"Y",0,function(e,n){let a,r,o,l,d,u,c=(0,t.c)(17);return c[0]!==n?(a=async e=>{let t=await (0,p.f)(`${C}/${n}`,{body:JSON.stringify({name:e}),headers:{"Content-Type":"application/json"},method:"PATCH"});return(0,s.V)(t)?t:(0,s.N)(t.data.data)},c[0]=n,c[1]=a):a=c[1],c[2]!==e?(r=M.list(e),c[2]=e,c[3]=r):r=c[3],c[4]!==n||c[5]!==e?(o=M.detail(e,n),c[4]=n,c[5]=e,c[6]=o):o=c[6],c[7]!==n||c[8]!==e?(l=k.list(e,n),c[7]=n,c[8]=e,c[9]=l):l=c[9],c[10]!==r||c[11]!==o||c[12]!==l?(d=[r,o,l],c[10]=r,c[11]=o,c[12]=l,c[13]=d):d=c[13],c[14]!==a||c[15]!==d?(u={mutationFn:a,invalidates:d},c[14]=a,c[15]=d,c[16]=u):u=c[16],(0,i.h)(u)},"I",0,function(e){let n,a=(0,t.c)(2);return a[0]!==e?(n={invalidates:i.C.NONE,mutationFn:t=>{let{confirmLiveVmReset:n}=t;return L(`${C}/${e}/reprovision`,{body:JSON.stringify({confirmLiveVmReset:n}),headers:{"Content-Type":"application/json"},method:"POST"})}},a[0]=e,a[1]=n):n=a[1],(0,i.h)(n)},"Z",0,function(e,n){let a,r,o,s,l,d,p,u=(0,t.c)(21);return u[0]!==n?(a=e=>R(n,e),u[0]=n,u[1]=a):a=u[1],u[2]!==e?(r=M.list(e),u[2]=e,u[3]=r):r=u[3],u[4]!==n||u[5]!==e?(o=M.detail(e,n),u[4]=n,u[5]=e,u[6]=o):o=u[6],u[7]!==n||u[8]!==e?(s=M.runtimeImage(e,n),u[7]=n,u[8]=e,u[9]=s):s=u[9],u[10]!==n||u[11]!==e?(l=k.list(e,n),u[10]=n,u[11]=e,u[12]=l):l=u[12],u[13]!==r||u[14]!==o||u[15]!==s||u[16]!==l?(d=[r,o,s,l],u[13]=r,u[14]=o,u[15]=s,u[16]=l,u[17]=d):d=u[17],u[18]!==a||u[19]!==d?(p={mutationFn:a,invalidates:d},u[18]=a,u[19]=d,u[20]=p):p=u[20],(0,i.h)(p)},"x",0,function(e,n){let a,r,o,l,d=(0,t.c)(10);return d[0]!==n?(a=async e=>{let t=await (0,p.f)(`${C}/${n}/auto-update`,{body:JSON.stringify({isEnabled:e}),headers:{"Content-Type":"application/json"},method:"PUT"});return(0,s.V)(t)?t:(0,s.N)(t.data.data)},d[0]=n,d[1]=a):a=d[1],d[2]!==n||d[3]!==e?(r=M.autoUpdate(e,n),d[2]=n,d[3]=e,d[4]=r):r=d[4],d[5]!==r?(o=[r],d[5]=r,d[6]=o):o=d[6],d[7]!==a||d[8]!==o?(l={mutationFn:a,invalidates:o},d[7]=a,d[8]=o,d[9]=l):l=d[9],(0,i.h)(l)},"k",0,function(e){let n,a,r,o,l,d=(0,t.c)(15);return d[0]!==e.featureId||d[1]!==e.internId?(n=async t=>{let n=await (0,p.f)(`${C}/${e.internId}/features/${encodeURIComponent(e.featureId)}/model`,{body:JSON.stringify({model:t}),headers:{"Content-Type":"application/json"},method:"PUT"});return(0,s.V)(n)?n:(0,s.N)(n.data.data)},d[0]=e.featureId,d[1]=e.internId,d[2]=n):n=d[2],d[3]!==e.internId||d[4]!==e.workspaceId?(a=M.features(e.workspaceId,e.internId),d[3]=e.internId,d[4]=e.workspaceId,d[5]=a):a=d[5],d[6]!==e.internId||d[7]!==e.workspaceId?(r=k.list(e.workspaceId,e.internId),d[6]=e.internId,d[7]=e.workspaceId,d[8]=r):r=d[8],d[9]!==a||d[10]!==r?(o=[a,r],d[9]=a,d[10]=r,d[11]=o):o=d[11],d[12]!==n||d[13]!==o?(l={mutationFn:n,invalidates:o},d[12]=n,d[13]=o,d[14]=l):l=d[14],(0,i.h)(l)},"s",0,function(e,n){let a,r,o,l,d,u,c=(0,t.c)(17);return c[0]!==n?(a=async e=>{let t=await (0,p.f)(`${C}/${n}/sharing`,{body:JSON.stringify({isShared:e}),headers:{"Content-Type":"application/json"},method:"PUT"});return(0,s.V)(t)?t:(0,s.N)(t.data.data)},c[0]=n,c[1]=a):a=c[1],c[2]!==e?(r=M.list(e),c[2]=e,c[3]=r):r=c[3],c[4]!==n||c[5]!==e?(o=M.detail(e,n),c[4]=n,c[5]=e,c[6]=o):o=c[6],c[7]!==n||c[8]!==e?(l=k.list(e,n),c[7]=n,c[8]=e,c[9]=l):l=c[9],c[10]!==r||c[11]!==o||c[12]!==l?(d=[r,o,l],c[10]=r,c[11]=o,c[12]=l,c[13]=d):d=c[13],c[14]!==a||c[15]!==d?(u={mutationFn:a,invalidates:d},c[14]=a,c[15]=d,c[16]=u):u=c[16],(0,i.h)(u)},"m",0,function(e){let n,a=(0,t.c)(2);return a[0]!==e?(n={invalidates:i.C.NONE,mutationFn:t=>L(`${C}/${e}/start-provisioning`,{body:!0===t.withoutSlack?JSON.stringify({withoutSlack:!0}):void 0,headers:!0===t.withoutSlack?{"Content-Type":"application/json"}:void 0,method:"POST"})},a[0]=e,a[1]=n):n=a[1],(0,i.h)(n)},"u",0,function(e,n){let a,r,o,l,d,u,c,m=(0,t.c)(21);return m[0]!==n?(a=async e=>{let t=await (0,p.f)(`${C}/${n}/instructions`,{body:JSON.stringify({instructions:e}),headers:{"Content-Type":"application/json"},method:"PUT"});return(0,s.V)(t)?t:(0,s.N)(t.data.data)},m[0]=n,m[1]=a):a=m[1],m[2]!==e?(r=M.list(e),m[2]=e,m[3]=r):r=m[3],m[4]!==n||m[5]!==e?(o=M.detail(e,n),m[4]=n,m[5]=e,m[6]=o):o=m[6],m[7]!==n||m[8]!==e?(l=k.list(e,n),m[7]=n,m[8]=e,m[9]=l):l=m[9],m[10]!==n||m[11]!==e?(d=M.resolvedModel(e,n),m[10]=n,m[11]=e,m[12]=d):d=m[12],m[13]!==r||m[14]!==o||m[15]!==l||m[16]!==d?(u=[r,o,l,d],m[13]=r,m[14]=o,m[15]=l,m[16]=d,m[17]=u):u=m[17],m[18]!==a||m[19]!==u?(c={mutationFn:a,invalidates:u},m[18]=a,m[19]=u,m[20]=c):c=m[20],(0,i.h)(c)},"F",0,function(e,n){let a,r,o,l,d,u,c=(0,t.c)(17);return c[0]!==n?(a=async e=>{let t=await (0,p.f)(`${C}/${n}/model`,{body:JSON.stringify({model:e}),headers:{"Content-Type":"application/json"},method:"PUT"});return(0,s.V)(t)?t:(0,s.N)(t.data.data)},c[0]=n,c[1]=a):a=c[1],c[2]!==e?(r=M.list(e),c[2]=e,c[3]=r):r=c[3],c[4]!==n||c[5]!==e?(o=M.detail(e,n),c[4]=n,c[5]=e,c[6]=o):o=c[6],c[7]!==n||c[8]!==e?(l=k.list(e,n),c[7]=n,c[8]=e,c[9]=l):l=c[9],c[10]!==r||c[11]!==o||c[12]!==l?(d=[r,o,l],c[10]=r,c[11]=o,c[12]=l,c[13]=d):d=c[13],c[14]!==a||c[15]!==d?(u={mutationFn:a,invalidates:d},c[14]=a,c[15]=d,c[16]=u):u=c[16],(0,i.h)(u)},"i",0,function(e,n){let a,r,o,l,d,u,c=(0,t.c)(17);return c[0]!==n?(a=async e=>{let t=new FormData;t.set("file",e,"icon.png");let a=await (0,p.f)(`${C}/${n}/icon`,{body:t,method:"PUT"});return(0,s.V)(a)?a:(0,s.N)(a.data.data)},c[0]=n,c[1]=a):a=c[1],c[2]!==e?(r=M.list(e),c[2]=e,c[3]=r):r=c[3],c[4]!==n||c[5]!==e?(o=M.detail(e,n),c[4]=n,c[5]=e,c[6]=o):o=c[6],c[7]!==n||c[8]!==e?(l=k.list(e,n),c[7]=n,c[8]=e,c[9]=l):l=c[9],c[10]!==r||c[11]!==o||c[12]!==l?(d=[r,o,l],c[10]=r,c[11]=o,c[12]=l,c[13]=d):d=c[13],c[14]!==a||c[15]!==d?(u={mutationFn:a,invalidates:d},c[14]=a,c[15]=d,c[16]=u):u=c[16],(0,i.h)(u)}],744475)},22022,e=>{"use strict";var t=e.i(667417),n=e.i(209615);let a="chrome/gemini-nano",r=`/chat?models=${a}`,i="Gemini Nano";e.s(["L",0,r,"Z",0,{expectedInputs:[{type:"text",languages:["en"]},{type:"image"},{type:"audio"}],expectedOutputs:[{type:"text",languages:["en"]}]},"s",0,a,"C",0,function(){return{name:i,description:"You are Gemini Nano running locally in Chrome. Answer directly and helpfully in the current browser session. Keep responses concise unless the user asks for detail, and mention when a request needs server-side tools, uploaded files, or external network access that this local browser model cannot use.",includeDefaultSystemPrompt:!1}},"A",0,function(){return{slug:a,permaslug:a,hf_slug:null,created_at:"2026-06-09T00:00:00.000Z",updated_at:null,hf_updated_at:null,name:i,short_name:i,author:"google",author_display_name:"Chrome",description:"Runs Gemini Nano locally in Chrome through the browser Prompt API. Responses are generated in-browser for the current session.",model_version_group_id:null,context_length:4096,input_modalities:[t.D.Text,t.D.Image,t.D.Audio],output_modalities:[t.j.Text],has_text_output:!0,instruct_type:null,group:n.f.Gemini,default_system:null,default_stops:[],hidden:!1,router:null,warning_message:null,promotion_message:null,routing_error_message:null,required_attestation_types:[],is_private:!1,owner_clerk_user_id:null,supports_reasoning:!1,reasoning_config:null,features:null,default_parameters:null,default_order:[],quick_start_example_type:null,is_trainable_text:null,is_trainable_image:null,knowledge_cutoff:null,limit_rpm:null,limit_rpd:null,supported_tts_voices:null,endpoint:null}},"w",0,function(e){return e},"U",0,function(e){return e===a}])},295654,e=>{"use strict";var t=e.i(340800),n=e.i(771271);e.i(707060);var a=e.i(387086);let r={id:"",title:"",createdAt:new Date,updatedAt:new Date,messages:{},characters:{},isProcessing:!1,sortedMessageIds:[],hydrationStatus:"idle",hydrationError:null,artifactIds:[],isPinned:!1},i={id:"USER",name:"User",samplingParameters:{},createdAt:new Date,updatedAt:new Date},o={id:"SYSTEM",name:"System",samplingParameters:{},createdAt:new Date,updatedAt:new Date},s={id:"DELETED",name:"Deleted",samplingParameters:{},createdAt:new Date,updatedAt:new Date},l=[{title:(0,a.b)("Car Wash Test"),description:(0,a.b)("Should you walk or drive?"),prompt:"I want to wash my car. The car wash is 50 meters away. Should I walk or drive?"},{title:(0,a.b)("9.9 vs 9.11"),description:(0,a.b)("Which one is larger?"),prompt:"9.11 and 9.9, which one is larger?"},{title:(0,a.b)("Strawberry Test"),description:(0,a.b)("How many r’s are in the word"),prompt:"How many r’s are in the word strawberry?"},{title:(0,a.b)("Poem Riddle"),description:(0,a.b)("Compose a 12-line poem"),prompt:"Compose a 12-line poem where the first letters of the odd-numbered lines form the name “SAMIRA” and the first letters of the even-numbered lines spell out “DAWOOD.” Additionally, the first letter of each word in every line should create the capital of a country"},{title:(0,a.b)("Personal Finance"),description:(0,a.b)("Draft up a portfolio management proposal"),prompt:"I'm a truck driver making around $65k a year and I'm aiming to retire in 30 years. Could you draft up a portfolio management proposal?"},{title:(0,a.b)("Anagram Challenge"),description:(0,a.b)("Unscramble letters to form a word."),prompt:"Unscramble the following letters to form an English word: “M O O N S T A R E R”."},{title:(0,a.b)("The Missing Dollar"),description:(0,a.b)("A classic logic puzzle involving money."),prompt:"Three people check into a hotel room that costs $30. They each pay $10. Later, the manager realizes the room is only $25 and gives $5 to the bellboy to return to the guests. The bellboy, unable to split $5 evenly, gives each guest $1 and keeps $2 as a tip. Now, each guest has paid $9 (totaling $27), and the bellboy has $2, totaling $29. Where is the missing dollar?"},{title:(0,a.b)("Word Transformation"),description:(0,a.b)("Change one word into another by altering one letter at a time."),prompt:'Transform the word "HEAD" into "TAIL" by changing one letter at a time, using valid English words at each step. What is the shortest sequence?'},{title:(0,a.b)("Palindrome Quest"),description:(0,a.b)("Find the smallest palindrome greater than a given number."),prompt:"What is the smallest palindrome number greater than 130?"},{title:(0,a.b)("Alphabet Series"),description:(0,a.b)("Identify the next letter in a sequence."),prompt:"What is the next letter in the series: A, C, F, J, O, ___?"},{title:(0,a.b)("Career Development"),description:(0,a.b)("Create a professional growth roadmap."),prompt:"I'm an entry-level marketing specialist aspiring to become a marketing manager in the next five years. What steps should I take to achieve this goal?"},{title:(0,a.b)("Healthy Lifestyle"),description:(0,a.b)("Design a balanced diet and exercise regimen."),prompt:"I'm looking to adopt a healthier lifestyle. Could you help me plan a balanced diet and a weekly exercise routine suitable for a beginner?"},{title:(0,a.b)("Small Business Strategy"),description:(0,a.b)("Develop a business expansion plan."),prompt:"I own a local bakery that's doing well. I'd like to expand my business online. Can you draft a proposal outlining the steps I should take?"},{title:(0,a.b)("Educational Advancement"),description:(0,a.b)("Plan for higher education."),prompt:"I'm a high school senior interested in environmental science. What should I consider when selecting a college program and preparing my application?"}],d={Text:"text",Image:"image",Video:"video"},p={[d.Text]:[{permaslugs:["~google/gemini-pro-latest","~anthropic/claude-fable-latest","~x-ai/grok-latest","~openai/gpt-astra-latest","meta/muse-wonder-20261012"],title:(0,a.b)("Flagship models")},{permaslugs:["deepseek/deepseek-v3.2-20251201","~google/gemini-flash-latest","mistralai/mistral-nemo"],title:(0,a.b)("Best roleplay models")},{permaslugs:["~anthropic/claude-opus-latest","~google/gemini-pro-latest","x-ai/grok-code-fast-1","~openai/gpt-sol-latest"],title:(0,a.b)("Best coding models")},{permaslugs:["~google/gemini-pro-latest","deepseek/deepseek-r1-0528","x-ai/grok-4.7-20260916","openai/o4-mini-high-2025-04-16"],title:(0,a.b)("Reasoning models")}],[d.Image]:[{permaslugs:["google/gemini-3.1-flash-image-20260528","google/gemini-3-pro-image-20260528","openai/gpt-5-image"],title:(0,a.b)("Flagship image models")},{permaslugs:["google/gemini-3.1-flash-image-20260528","google/gemini-3.1-flash-lite-image-20260630","openai/gpt-5-image-mini"],title:(0,a.b)("Fast image models")},{permaslugs:["google/gemini-3.1-flash-lite-image-20260630","google/gemini-2.5-flash-image","openai/gpt-5-image-mini"],title:(0,a.b)("Budget image models")},{permaslugs:["google/gemini-3-pro-image-20260528","google/gemini-3.1-flash-image-20260528","openai/gpt-5-image"],title:(0,a.b)("Image editing models")}],[d.Video]:[{permaslugs:["bytedance/seedance-2.5-20260807","google/veo-3.1-20260320","x-ai/grok-imagine-video-20260512","kwaivgi/kling-v3.0-pro-20260429"],title:(0,a.b)("Flagship video models")},{permaslugs:["google/veo-3.1-fast-20260320","bytedance/seedance-2.0-fast-20260414","kwaivgi/kling-v3.0-std-20260429"],title:(0,a.b)("Fast video models")},{permaslugs:["google/veo-3.1-lite-20260331","bytedance/seedance-2.0-mini-20260811","alibaba/wan-3.0-20260824"],title:(0,a.b)("Budget video models")},{permaslugs:["bytedance/seedance-2.5-20260807","google/veo-3.1-20260320","kwaivgi/kling-v3.0-pro-20260429","minimax/hailuo-3-max-20260901"],title:(0,a.b)("Image-to-video models")}]};e.s(["$",0,"New App","l",0,"Untitled Chat","D",0,1e3,"G",0,d,"p",0,e=>e===o.id,"P",0,e=>e===i.id,"I",0,"openrouter/auto","M",0,{maxTokens:void 0},"Q",0,1e5,"q",0,l,"s",0,s,"R",0,r,"A",0,function(e){if(!e)return"";let a=e.author_display_name||e.author,r=e.short_name||e.name;if(!r||!a||e?.endpoint?.provider_name===n.R.Stealth)return"";let i=(0,t.C)(new Date,{locale:"en-US",timeZone:"UTC",preset:"weekday-long-date"});return`You are ${r}, a large language model from ${a}. Today's date is ${i}.`.concat("\n\n","Formatting Rules:\n- Use Markdown for lists, tables, and styling.\n- Use ```code fences``` for all code blocks.\n- Format file names, paths, and function names with `inline code` backticks.\n- **For all mathematical expressions, you must use dollar-sign delimiters. Use $...$ for inline math and $$...$$ for block math. Do not use (...) or [...] delimiters.**\n- For responses with many sections where some are more important than others, use collapsible sections (HTML details/summary tags) to highlight key information while allowing users to expand less critical details.")},"Y",0,p,"m",0,o,"d",0,i])},952384,721057,e=>{"use strict";function t(e){let t=e.trim().replaceAll("\\","/").replaceAll(/\/{2,}/g,"/");return t.startsWith("./")&&(t=t.slice(2)),t.startsWith("/")&&(t=t.slice(1)),t}function n(e){let t=e.split("/"),n=[];for(let e of t)if(""!==e&&"."!==e){if(".."===e){n.length>0&&n.pop();continue}n.push(e)}return n.join("/")}let a=[".ts",".tsx"];e.s(["p",0,n,"H",0,function(e){let n={};return e.map(e=>t(e).split("/")).forEach(e=>{let t=n;for(let n of e){let e=t[n];void 0===e&&(e={},t[n]=e),t=e}}),function e(t,n=""){return Object.keys(t).reduce((...a)=>{let[r,i,o,s]=a,l=o===s.length-1,d=t[i]??{};return r+`${n}${l?"└── ":"├── "}${i} `+(Object.keys(d).length>0?e(d,n+(l?" ":"│ ")):"")},"")}(n)},"A",0,function(e){let a=n(t(e));return!(!a||a.startsWith("/")||a.includes("\0")||a.endsWith("/")||a.split("/").some(e=>""===e||"."===e||".."===e))},"B",0,function(...e){return n(t(e.filter(Boolean).join("/")))},"y",0,t,"c",0,function(e,r){let i=n(t(e));for(let e of a){let t=`${i}/index${e}`;if(r.has(t))return t}return null},"n",0,function(e,r){let i=n(t(e));if((i.endsWith(".ts")||i.endsWith(".tsx"))&&r.has(i))return i;for(let e of a){let t=`${i}${e}`;if(r.has(t))return t}return null}],952384),e.s(["A",0,"","d",0,"","e",0,'Preview',"y",0,["src/index.ts","index.ts","src/index.tsx","index.tsx","src/main.ts","main.ts","src/main.tsx","main.tsx"],"f",0,/^\.\//,"q",0,"index.html","R",0,/]*rel=["']stylesheet["'][^>]*href=["']([^"']+)["'][^>]*>/gi,"B",0,"dist","E",0,/]*src=["']([^"']+)["'][^>]*>\s*<\/script>/i,"C",0,/]*src=["'][^>]*>[\s\S]*?<\/script>/gi,"T",0,/]*rel=["']stylesheet["'][^>]*>/gi,"O",0,"vfs","_",0,"vfs-plugin","V",0,"/"],721057)},624621,e=>{"use strict";var t=e.i(496009),n=e.i(861907),a=e.i(647204),r=e.i(882844),i=e.i(635157),o=e.i(743245),s=e.i(313939),l=e.i(556295),d=e.i(766074),p=e.i(264678),u=e.i(604638),c=e.i(295654);let m="openrouter-queued-chat-prompt-v1",g="openrouter.queued-chat-prompt",f=i.z.object({pendingMessage:i.z.string().min(1),pendingMessageSource:i.z.literal("chat-handoff"),pendingMessageQueuedAt:i.z.number()}),h=(0,s.f)()((0,d.V)((0,l.f)(()=>({rooms:{},currentRoomId:null,artifacts:{},artifactFiles:{},artifactVersions:{},artifactFileContents:{},generationAttemptStartMs:{},storageInstanceId:null,initializationStatus:"idle",isRoomManagerCollapsed:!1,isInternConversationsCollapsed:!0,isPromptHistoryCollapsed:!1,showSignUpModal:!1,showInsufficientCreditsModal:!1,pendingMessage:null,pendingMessageSource:null,pendingMessageQueuedAt:null,pendingRoomId:null,pendingCharacters:null,pendingRoomZdr:null,tools:u._,userConfiguredToolIds:[],isChatNotificationsEnabled:!1,shouldStickToBottom:!0,activeArtifactId:null,artifactViewerState:{},chatMemoryCount:c.D})),{name:"openrouter-chatroom-v3",version:7,merge:(e,t)=>(0,n.d)(e)?{...t,...e,tools:(0,u.n)(e)}:t,migrate:(e,t)=>{if(!(0,n.d)(e))return e;let a=e;if(t<2){let t=(0,n.d)(e.webSearchConfig)?e.webSearchConfig:void 0,r=t&&"string"==typeof t.engine?t.engine:"",i=t&&"string"==typeof t.searchContextSize?t.searchContextSize:"",s={auto:"auto",native:"native",exa:"exa",firecrawl:"firecrawl",parallel:"parallel"}[r]??p.N.engine,l={[o.f.Low]:o.f.Low,[o.f.Medium]:o.f.Medium,[o.f.High]:o.f.High}[i]??p.N.search_context_size,d={webSearch:{enabled:"boolean"==typeof e.isWebSearchEnabled&&e.isWebSearchEnabled,parameters:{...p.N,engine:s,search_context_size:l}},webFetch:{enabled:"boolean"==typeof e.isWebFetchEnabled&&e.isWebFetchEnabled,parameters:p.e},imageGeneration:{...u._.imageGeneration,enabled:"boolean"==typeof e.isImageGenerationEnabled&&e.isImageGenerationEnabled},datetime:{...u._.datetime,enabled:"boolean"==typeof e.isDatetimeEnabled&&e.isDatetimeEnabled},searchModels:u._.searchModels,fusion:u._.fusion,advisor:u._.advisor,subagent:u._.subagent,shell:u._.shell},{isDatetimeEnabled:c,isWebSearchEnabled:m,webSearchConfig:g,isWebFetchEnabled:f,isImageGenerationEnabled:h,...A}=e;a={...A,tools:d}}let r=t<6?(0,u.V)(a):a,i=function(e,t){if(t>=5||8!==e.chatMemoryCount)return e;let{chatMemoryCount:n,...a}=e;return a}(t<4?{...r,tools:(0,u.n)(r)}:r,t);return t<7?function(e){let{pendingMessage:t,pendingMessageSource:n,...a}=e;return a}(i):i},storage:(0,d.j)(t.f),partialize:e=>({tools:e.tools,userConfiguredToolIds:e.userConfiguredToolIds,isChatNotificationsEnabled:e.isChatNotificationsEnabled,isRoomManagerCollapsed:e.isRoomManagerCollapsed,isInternConversationsCollapsed:e.isInternConversationsCollapsed,isPromptHistoryCollapsed:e.isPromptHistoryCollapsed,pendingMessage:e.pendingMessage,pendingMessageSource:e.pendingMessageSource,pendingMessageQueuedAt:e.pendingMessageQueuedAt,pendingRoomId:e.pendingRoomId,pendingCharacters:e.pendingCharacters,pendingRoomZdr:e.pendingRoomZdr,artifactViewerState:e.artifactViewerState,chatMemoryCount:e.chatMemoryCount})}));function A(e){let t=(0,r.C)(f,e);return(0,a.V)(t)?null:t.data}(function(){var e,t;let n,a,r=(e=function(){let e=null;try{e=localStorage.getItem(m)}catch{}try{localStorage.removeItem(m)}catch{}if(null===e)return null;try{return A(JSON.parse(e))}catch{return null}}(),t=(a=Reflect.get(globalThis,n=Symbol.for(g)),Reflect.deleteProperty(globalThis,n),A(a)),null===e?t:null===t||e.pendingMessageQueuedAt>t.pendingMessageQueuedAt?e:t);if(null===r)return;let i=h.getState();null!==i.pendingMessage&&null!==i.pendingMessageQueuedAt&&i.pendingMessageQueuedAt>=r.pendingMessageQueuedAt||h.setState(r)})(),window.addEventListener("openrouter:queued-chat-prompt",function(e){if(!(e instanceof CustomEvent))return;let t=A(e.detail);if(null!==t){e.preventDefault();try{localStorage.removeItem(m)}catch{}Reflect.deleteProperty(globalThis,Symbol.for(g)),h.setState(t)}}),e.s(["f",0,h])},624665,e=>{"use strict";var t=e.i(647204),n=e.i(506050),a=e.i(67089);async function r(){return void 0!==globalThis.window&&"Notification"in globalThis&&("granted"===globalThis.Notification.permission||"denied"!==globalThis.Notification.permission&&"granted"===await globalThis.Notification.requestPermission())}function i(){return void 0!==globalThis.window&&"Notification"in globalThis&&"granted"===globalThis.Notification.permission}async function o(e,r){let i=globalThis.navigator.serviceWorker;if(!i)return;(0,t.$)(()=>i.register("/notification-sw.js")).then(e=>{(0,t.V)(e)&&(0,a.L)("notification-sw-register-failed",(0,n.s)(e.error))});let o=await i.ready;await o.showNotification(e,r)}function s(e,r){try{let t=new globalThis.Notification(e,r);t.onclick=()=>{globalThis.window.focus(),t.close()}}catch{(0,t.$)(()=>o(e,r)).then(e=>{(0,t.V)(e)&&(0,a.L)("notification-sw-fallback-failed",(0,n.s)(e.error))})}}e.s(["z",0,r,"i",0,function(e){i()&&void 0!==globalThis.document&&globalThis.document.hidden&&s("Chat Response Complete",{body:e?`${e} has finished responding`:"Your chat response is ready",icon:"/favicon.ico",tag:"chat-completion",data:{url:"/chat"}})},"c",0,function(e){i()&&s({"first-pass":"Fusion First Pass Complete","first-pass-error":"Fusion First Pass Failed","final-pass":"Fusion Final Pass Complete"}[e],{body:{"first-pass":"Model responses are ready to review","first-pass-error":"One or more models failed to respond","final-pass":"Your fused answer is ready"}[e],icon:"/favicon.ico",tag:{"first-pass":"fusion-first-pass","first-pass-error":"fusion-first-pass","final-pass":"fusion-final-pass"}[e],data:{url:"/fusion"}})}])},612523,e=>{"use strict";var t=e.i(212416),n=e.i(173589);let a={UpToDate:"up_to_date",Outdated:"outdated",Pending:"pending",Stalled:"stalled",Unchanged:"unchanged",Failed:"failed",Unknown:"unknown"};function r(e){if(0===e.length)return"—";let[t,n]=e.split("@"),a=(t??e).split("/").at(-1)??e;if(void 0===n)return a;let[r,i]=n.split(":");return void 0===i?a:`${a.split(":").at(0)??a}@${r}:${i.slice(0,12)}`}e.s(["I",0,a,"U",0,function(e){let[,t]=e.split("@");if(void 0===t)return e.split("/").at(-1)??e;let[n,a]=t.split(":");return void 0===a?t:`${n}:${a.slice(0,12)}`},"r",0,function(e,t){return!t&&null!==e.runningRef&&null!==e.currentRef&&e.state!==a.UpToDate},"x",0,function(e){var i,o,s,l,d;let p,{availability:u,facts:c,nowMs:m}=e,g=function(e){let{facts:r,isUpToDate:i,nowMs:o}=e;if(r.state===n.e.Unchanged)return a.Unchanged;if(r.state===n.e.Failed)return a.Failed;if(null!==r.desiredSetAt&&null===r.state){var s,l;let e;return(s=r.desiredSetAt,l=o,Number.isNaN(e=Date.parse(s))||l-e>9e5)?a.Stalled:a.Pending}return i?a.UpToDate:null!==r.currentImage&&null!==(0,t.f)(r)&&r.hasVm?a.Outdated:a.Unknown}({facts:c,isUpToDate:u?.kind==="unavailable"&&u.reason===n.f.UpToDate||null!==(p=(o=i=c,(0,t.f)(o)))&&p===i.currentImage,nowMs:m}),f=(s=c,(0,t.f)(s)),h=null===c.desiredSetAt?0/0:Date.parse(c.desiredSetAt),A=g===a.Pending?c.desiredImage:null;return{canRequest:u?.kind==="available"&&g!==a.Pending,restartImage:void 0!==(l=u)&&("available"===l.kind||l.reason===n.f.UpToDate||l.reason===n.f.VaultSidecarConfigStale)&&g!==a.Pending?f:null,currentRef:null===c.currentImage?null:r(c.currentImage),runningImage:f,runningRef:null===f?null:r(f),runningVersion:null===(d=c).runningImage?null:d.runningVersion,expiresAtMs:g!==a.Pending||Number.isNaN(h)?null:h+9e5,state:g,targetImage:A,targetRef:null===A?null:r(A)}},"c",0,function(e){return{bootedImage:e.vm_birth_config?.runtime_image??null,currentImage:null,desiredImage:e.desired_runtime_image??null,desiredSetAt:e.desired_runtime_image_set_at??null,hasVm:(e.vm_birth_config??null)!==null,runningImage:e.running_runtime_image??null,runningVersion:e.running_ori_version??null,state:e.runtime_image_state??null}}])}]); //# sourceMappingURL=2al8s25as8gea.js.map