Void

A modification for grok.com

Tính đến 28-02-2026. Xem phiên bản mới nhất.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Void
// @namespace    https://github.com/imjustprism/Void
// @version      0.2.1
// @description  A modification for grok.com
// @author       Void Contributors
// @match        *://grok.com/*
// @run-at       document-start
// @grant        unsafeWindow
// @grant        GM_xmlhttpRequest
// @grant        GM_getValue
// @grant        GM_setValue
// @grant        GM_deleteValue
// @grant        GM_listValues
// @license      GPL-3.0-or-later
// ==/UserScript==

(()=>{var As=Object.defineProperty;var zo=(e,t)=>{for(var o in t)As(e,o,{get:t[o],enumerable:!0,configurable:!0,set:(n)=>t[o]=()=>n})};var hr={};zo(hr,{waitFor:()=>be,syncLazyModules:()=>kt,subscribe:()=>mt,stopPlugin:()=>wo,startPlugin:()=>Te,sleep:()=>Oi,showToast:()=>Ns,showNotice:()=>Eo,search:()=>Zs,sanitizeFilename:()=>bo,requireModule:()=>tn,removeChatBarButton:()=>Do,registerStyle:()=>P,registerPlugin:()=>Io,proxyLazy:()=>he,plugins:()=>L,patches:()=>R,patchStats:()=>Se,patchResults:()=>Jt,patchReport:()=>Ir,openModal:()=>Yn,onlyOnce:()=>Ai,onceReady:()=>Zt,migrateSettingsToPlugin:()=>Yi,migratePluginSettings:()=>Xi,migratePluginSetting:()=>qi,mergeDefaults:()=>je,matchesPattern:()=>Dt,matchesAllPatterns:()=>De,mapMangledModuleLazy:()=>Ys,mapMangledModule:()=>Hr,mapMangledCssClasses:()=>_r,makeLazy:()=>Pt,isTruthy:()=>Bi,isPluginEnabled:()=>B,isObject:()=>pt,isNonNullish:()=>Vi,isBlacklisted:()=>te,initSettings:()=>vo,init:()=>yr,importModule:()=>Js,getTurbopackHelpers:()=>tt,getRuntimeModuleCache:()=>Dr,getRuntimeFactoryRegistry:()=>Oe,getModuleCache:()=>z,formatDuration:()=>$t,formatCountdown:()=>ho,findStoreLazy:()=>Ws,findStore:()=>Rr,findModuleId:()=>Ur,findModuleFactory:()=>Qo,findLazy:()=>Jo,findExportedComponentLazy:()=>$e,findExportedComponent:()=>w,findCssClassesLazy:()=>js,findCssClasses:()=>zr,findComponentByCodeLazy:()=>Hs,findComponentByCode:()=>Gr,findByPropsLazy:()=>d,findByProps:()=>no,findByCodeLazy:()=>Us,findByCode:()=>$r,findBulk:()=>qs,findAll:()=>_s,find:()=>ot,filters:()=>_,fetchExternal:()=>fe,extractAndLoadChunksLazy:()=>Ks,extractAndLoadChunks:()=>jr,errorMessage:()=>So,enableStyle:()=>Ge,downloadFile:()=>xo,dispatch:()=>Co,disableStyle:()=>ne,definePluginSettings:()=>me,definePlugin:()=>h,debounce:()=>Cn,copyToClipboard:()=>yo,confirm:()=>ws,common:()=>mr,closeNotice:()=>En,closeModal:()=>Kn,closeAllModals:()=>vs,classes:()=>Z,classNameFactory:()=>I,clamp:()=>$i,addPatch:()=>kn,addChatBarButton:()=>Mo,ToastType:()=>fr,StartAt:()=>nt,SettingsStore:()=>H,Settings:()=>b,PlainSettings:()=>Gt,OptionType:()=>Ce,NoticeType:()=>ko,Logger:()=>D,DefaultChunkLoadRegex:()=>en,ChunkPathRegex:()=>Wr});var on={};zo(on,{WorkspaceStore:()=>ai,WorkspaceConnectorsStore:()=>yi,WorkspaceCollectionsStore:()=>gi,UpsellStore:()=>oi,TourGuideStore:()=>ii,TextToSpeechStore:()=>pi,TasksStore:()=>fi,TabsManagerStore:()=>Zr,SubscriptionsStore:()=>ao,SourcesSelectorStore:()=>ri,ShareStore:()=>ni,SettingsStore:()=>Xr,SettingsDialogStore:()=>qr,SessionStore:()=>ro,RoutingStore:()=>Kr,ResponseStore:()=>io,ReportStore:()=>di,PersonalityStore:()=>ui,NotificationsStore:()=>Jr,ModesStore:()=>ei,ModelsStore:()=>so,MentionMenuStore:()=>li,MediaStore:()=>Qr,FileStore:()=>Yr,FeatureStore:()=>U,DevModelsStore:()=>si,ConversationStore:()=>Nt,CommandMenuStore:()=>ti,ChatPageStore:()=>Le,AssetStore:()=>ci,ArtifactStore:()=>mi});var Sr=["arguments","caller","prototype"],Je=Symbol.for("void.lazy.get"),_o=Symbol.for("void.lazy.cached"),jt={};for(let e of["apply","construct","defineProperty","deleteProperty","getPrototypeOf","has","isExtensible","preventExtensions","set","setPrototypeOf"])jt[e]=(t,...o)=>Reflect[e](t[Je]?.()??t,...o);jt.ownKeys=(e)=>{let t=e[Je]?.()??e,o=Reflect.ownKeys(t);for(let n of Sr)if(!o.includes(n))o.push(n);return o};jt.getOwnPropertyDescriptor=(e,t)=>{if(typeof t==="string"&&Sr.includes(t))return Reflect.getOwnPropertyDescriptor(e,t);let o=e[Je]?.()??e,n=Reflect.getOwnPropertyDescriptor(o,t);if(n)Object.defineProperty(e,t,n);return n};function Pt(e){let t,o=!1;return()=>{if(!o){if(t=e(),t!=null)o=!0}return t}}function he(e){let t=Pt(e),o=Object.assign(()=>{},{[_o]:void 0,[Je](){let n=t();return o[_o]=n,n}});return new Proxy(o,{...jt,get(n,i,s){if(i===_o||i===Je)return Reflect.get(n,i,s);let a=n[Je]();if(a==null)return;if(typeof a==="object"||typeof a==="function")return Reflect.get(a,i,s);throw Error("proxyLazy: factory returned a primitive value")}})}var Uo=null;function xr(e){Uo=e}function T(e,t){let o=null,n=(i)=>{if(o??=t(),!o||!Uo)return null;return Uo(o,i)};return Object.defineProperty(n,"name",{value:e}),new Proxy(n,{get(i,s){if(s==="$$voidGetWrapped")return()=>o??t();if(s==="displayName"){if(o??=t(),o)return o[s]}return Reflect.get(i,s)}})}var $s=typeof window<"u",Tt={reset:"\x1B[0m",bold:"\x1B[1m",green:"\x1B[32m",red:"\x1B[31m",yellow:"\x1B[33m",magenta:"\x1B[35m",gray:"\x1B[90m"};class D{name;color;constructor(e,t="white"){this.name=e;this.color=t}_log(e,t){if($s){console[e](`%c Void %c %c ${this.name} `,"background: white; color: black; font-weight: bold; border-radius: 5px;","",`background: ${this.color}; color: black; font-weight: bold; border-radius: 5px;`,...t);return}let n={error:Tt.red,warn:Tt.yellow}[e]??Tt.green,i=`${Tt.bold}${n}[${this.name}]${Tt.reset}`;console[e](i,...t)}log(...e){this._log("log",e)}info(...e){this._log("info",e)}error(...e){this._log("error",e)}warn(...e){this._log("warn",e)}debug(...e){this._log("debug",e)}}function Mt(e,t){let o=e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]/g," ").replace(/\b\w/g,(n)=>n.toUpperCase());if(!t)return o;return Object.entries(t).reduce((n,[i,s])=>n.replace(new RegExp(`\\b${i}\\b`,"g"),s),o)}function br(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xt(e,t,o){return`${e} ${e===1?t:o??t+"s"}`}function Dt(e,t){if(typeof t==="string")return e.includes(t);return t.lastIndex=0,t.test(e)}function De(e,t){return t.every((o)=>Dt(e,o))}var Lt=Symbol("Void.originalFactory"),vt=Symbol("Void.patched"),qt=Symbol("Void.patchedBy"),wt=Symbol("Void.patchedCode");var xe=new D("TurbopackPatcher","#e78284"),Yt=typeof unsafeWindow<"u"?unsafeWindow:window,Wo=2147483646,Gs=Symbol.for("motionComponentSymbol"),Rs=0,Cr=(e,t,o)=>{let n=`__void_eval_${Rs++}`,i=document.createElement("script"),s=`window["${n}"]=(${e});`;if(t)s=`${t}
${s}`;if(o)s+=`
${o}`;i.textContent=s,(document.head??document.documentElement).appendChild(i),i.remove();let a=Yt[n];if(delete Yt[n],!a)throw Error("Factory compilation failed (CSP?)");return a},Kt=new Set,R=[],Ve=new Map,Qe=new Map,et=null,G=null,O=null,It=null,Ko,Zt=new Promise((e)=>Ko=e);var Jt=[],Se={applied:0,noEffect:0,errors:0,patchedModules:new Set};function z(){return Ve}function Dr(){return G}var Pr=0;function kt(){if(!G)return;let e=0;for(let t in G)e++;if(e===Pr)return;for(let t in G){let o=G[t];if(o?.exports==null)continue;let n=Number(t);if(!Ve.has(n))Qt(o.exports,n)}Pr=e}function Oe(){return O}function tt(){return It}function Lr(e,t){Qe.set(e,t)}function vr(e){Qe.delete(e)}var jo=new Set;function Et(e){return jo.add(e),()=>jo.delete(e)}var Xo=new WeakSet;function qo(e){if(e==null)return!0;let t=typeof e;if(t!=="object"&&t!=="function")return!0;if(e===window||e===document||e===document.documentElement)return!0;try{if(e[Symbol.toStringTag]==="DOMTokenList")return!0;if(e[Gs])return!0}catch{return!0}return e instanceof HTMLElement||e instanceof ArrayBuffer||e instanceof MessagePort||e instanceof Map||e instanceof Set||ArrayBuffer.isView(e)||typeof WebSocket<"u"&&e instanceof WebSocket}function wr(){let e=console.warn;console.warn=(...t)=>{if(t.some((o)=>typeof o==="string"&&(o.includes("has been renamed to")||o.includes("silence this warning"))))return;if(t.length===1&&t[0]==="")return;e.apply(console,t)};try{for(let[,t]of Ve){if(qo(t)){if(t!=null&&(typeof t==="object"||typeof t==="function"))Xo.add(t);continue}if(typeof t!=="object")continue;for(let o in t)try{let n=t[o];if(qo(n)&&n!=null&&(typeof n==="object"||typeof n==="function"))Xo.add(n)}catch{}}}finally{console.warn=e}}function te(e){if(e==null)return!1;let t=typeof e;if(t!=="object"&&t!=="function")return!1;if(Xo.has(e))return!0;return qo(e)}function Qt(e,t){if(e==null)return;if(Ve.get(t)===e)return;if(Ve.set(t,e),Qe.size)for(let[o,n]of[...Qe])try{if(!Qe.has(o))continue;if(o(e))Qe.delete(o),n(e,t)}catch(i){xe.error("WaitFor listener error:",i)}for(let o of[...jo])try{o()}catch{}}function zs(e,t){if(!R.length)return t;let o=String(t),n=o,i=t,s=new Set;for(let a=0;a<R.length;a++){let c=R[a];if(c.predicate&&!c.predicate())continue;if(!(Array.isArray(c.find)?De(o,c.find):Dt(o,c.find)))continue;let u=Array.isArray(c.replacement)?c.replacement:[c.replacement],m=n,y=i,v=!0,S=0,W={plugin:c.plugin,find:String(c.find),moduleId:e,replacements:[]};for(let k of u){if(k.predicate&&!k.predicate())continue;let $=n,j=i;try{let{match:V}=k,se=performance.now(),g=n.replace(V,k.replace),K=performance.now()-se;if(g===n){if(Se.noEffect++,W.replacements.push({match:String(V),status:"noEffect"}),!c.noWarn&&!k.noWarn)xe.error(`Patch by ${c.plugin} had no effect: ${String(V)}`);if(c.group){v=!1;break}continue}n=g,i=Cr(n),i[Lt]=t,i[vt]=!0,i[wt]=n,s.add(c.plugin),Se.applied++,S++,Se.patchedModules.add(e),W.replacements.push({match:String(V),status:"applied"})}catch(V){if(Se.errors++,W.replacements.push({match:String(k.match),status:"error"}),xe.error(`Error in patch by ${c.plugin} on module ${e}:`,V),n=$,i=j,c.group){n=m,i=y,s.delete(c.plugin);break}}}if(Jt.push(W),c.group&&!v){if(Se.applied-=S,n=m,i=y,s.delete(c.plugin),!c.noWarn)xe.warn(`Group patch by ${c.plugin} failed, reverting`);continue}if(!c.all)R.splice(a--,1)}if(s.size){let a=[...s].join(", ");i=Cr(n,`// Turbopack Module ${e} - Patched by ${a}`,`//# sourceURL=file:///TurbopackModule${e}`),i[Lt]=t,i[vt]=!0,i[wt]=n,i[qt]=[...s]}return i}function Yo(e,t){let o=zs(e,t),n=o[Lt]??t,i=function(s,a,c){if(!It)It=s;if(!G&&s.c){G=s.c,Er(G);for(let l of Kt)try{l()}catch{}Kt.clear()}if(!O&&s.M)O=s.M;try{o.call(this,s,a,c)}catch(l){if(o===t)throw l;xe.error(`Patched module ${a?.id??e} errored, using original:`,l);try{n.call(this,s,a,c)}catch(u){throw xe.error(`Original module ${a?.id??e} also errored:`,u),u}}try{let l=a?.id??e;if(a?.exports!=null)Qt(a.exports,l)}catch{}};if(i.toString=()=>String(t),i[Lt]=n,o[vt])i[vt]=!0,i[qt]=o[qt],i[wt]=o[wt];return i}function Ho(...e){let t=e[0];if(!Array.isArray(t))return et(...e);let o=null,n=new Map;for(let i=1;i<t.length;i++){if(typeof t[i]!=="function")continue;let s=t[i-1];if(typeof s!=="number")continue;if(!o)o=[...t];let a=t[i],c=n.get(a);if(c)o[i]=c;else{let l=Yo(s,a);n.set(a,l),o[i]=l}}return et.call(null,o??t)}function Ir(){return{stats:{...Se,patchedModules:[...Se.patchedModules]},results:Jt,orphaned:R.filter((e)=>!e.all).map((e)=>({plugin:e.plugin,find:String(e.find)}))}}function kr(){let e=R.filter((t)=>!t.all);if(e.length)xe.warn(`${e.length} patch(es) found no module:`,e.map((t)=>`${t.plugin}: ${String(t.find)}`))}function Er(e){let t=0;for(let o in e){let n=e[o];if(n?.exports==null)continue;let i=Number(o);if(Ve.get(i)!==n.exports)Qt(n.exports,i),t++}}function eo(){if(!G)return;let e=0;for(let t in G){let o=G[t];if(o?.exports==null)continue;let n=Number(t);if(Ve.get(n)!==o.exports)Qt(o.exports,n),e++}if(e>0)xe.info(`Rescan found ${e} new/updated modules`)}function Tr(){let e=Map.prototype.set,t=null;Map.prototype.set=function(o,n){if(!t&&typeof o==="number"&&typeof n==="function")t=this;return e.call(this,o,n)};try{et(["void-factory-probe",Wo,()=>{}])}finally{Map.prototype.set=e}return t?.delete(Wo),t}function Mr(e){let t=Wo-1;e.set(t,(o)=>{if(!It)It=o;if(!G&&o.c){G=o.c,Er(G);for(let n of Kt)try{n()}catch{}Kt.clear()}if(!O&&o.M)O=o.M}),et(["void-cache-probe",{otherChunks:[],runtimeModuleIds:[t]}]),Promise.resolve().then(()=>e.delete(t))}function Fr(){let e=Yt.TURBOPACK;if(e&&!Array.isArray(e)&&typeof e.push==="function"){if(et=e.push.bind(e),e.push=(...n)=>Ho(...n),O=Tr(),O)for(let[n,i]of O)O.set(n,Yo(n,i));if(!G&&O)Mr(O);return}let t=[];if(Array.isArray(e))t.push(...e);let o=e??[];if(Object.defineProperty(Yt,"TURBOPACK",{configurable:!0,get(){return o},set(n){if(n&&!Array.isArray(n)&&typeof n.push==="function"){let i=n;et=i.push.bind(i),i.push=(...s)=>Ho(...s),o=i;for(let s of t)try{Ho(s)}catch(a){xe.error("Failed to process queued chunk:",a)}if(t.length=0,O=Tr(),O)for(let[s,a]of O)O.set(s,Yo(s,a));if(!G&&O)Mr(O)}else o=n}}),Array.isArray(o)){let n=o.push.bind(o);o.push=(...i)=>{return t.push(...i),n(...i)}}}var oe=new D("TurbopackFinder","#a6d189"),Zo=!1;function Ft(e){if(Zo)return e();Zo=!0;let t=console.warn;console.warn=(...o)=>{if(o.some((n)=>typeof n==="string"&&(n.includes("has been renamed to")||n.includes("silence this warning"))))return;if(o.length===1&&o[0]==="")return;t.apply(console,o)};try{return e()}finally{console.warn=t,Zo=!1}}var Nr=new WeakMap;function oo(e){let t=Nr.get(e);if(t===void 0)t=String(e),Nr.set(e,t);return t}function Ar(e){if(e.startsWith("use"))return e;return e.endsWith("Store")?`use${e}`:`use${e}Store`}var _={byProps:(...e)=>{return e.length===1?(t)=>t[e[0]]!=null:(t)=>e.every((o)=>t[o]!=null)},byCode:(...e)=>{return(t)=>{if(typeof t!=="function")return!1;return De(oo(t),e)}},byDisplayName:(e)=>{return(t)=>t?.displayName===e||t?.render?.displayName===e},byStoreName:(e)=>{let t=Ar(e);return(o)=>{if(typeof o!=="object"||o===null)return!1;let n=o[t];return typeof n==="function"&&typeof n.getState==="function"}},componentByCode:(...e)=>{let t=_.byCode(...e);return(o)=>{if(t(o))return!0;if(!o?.$$typeof)return!1;if(o.type)return t(o.type);if(o.render)return t(o.render);return!1}},byClassName:(...e)=>{return(t)=>{if(typeof t!=="object"||t===null)return!1;return e.every((o)=>typeof t[o]==="string")}}};function Ae(e,t=!1,o=!1){return Ft(()=>{let n=Br(e,t,o);if(!t&&n)return n;if(t&&n.length)return n;let i=z().size;if(kt(),z().size===i)return n;return Br(e,t,o)})}function Br(e,t,o){let n=[],i=t?new Set:null,s=z();for(let[,a]of s){if(a==null||te(a))continue;try{if(e(a)){if(!t)return a;if(!i.has(a))i.add(a),n.push(a);continue}}catch{}if(!o&&typeof a==="object")for(let c in a)try{let l=a[c];if(l==null||te(l))continue;if(e(l)){if(!t)return l;if(!i.has(l))i.add(l),n.push(l)}}catch{}}return t?n:null}function ot(e){return Ae(e)}function _s(e){return Ae(e,!0)}function Jo(e){let t=Ae(e);if(t)return t;return he(()=>Ae(e))}function no(...e){return ot(_.byProps(...e))}function d(...e){return he(()=>no(...e))}function $r(...e){return ot(_.byCode(...e))}function Us(...e){return he(()=>$r(...e))}function Gr(...e){return ot(_.componentByCode(...e))}function Hs(...e){return T("findComponentByCode",()=>Gr(...e))}function w(...e){return Ft(()=>{let t=Vr(e);if(t)return t;let o=z().size;if(kt(),z().size===o)return null;return Vr(e)})}function Vr(e){let t=z();for(let[,o]of t){if(o==null||typeof o!=="object"||te(o))continue;for(let n of e)try{let i=o[n];if(i==null||te(i))continue;if(typeof i==="function"||i?.$$typeof)return i}catch{}}return null}function $e(...e){return T(e[0],()=>w(...e))}function Rr(e){let t=Ar(e),o=ot(_.byStoreName(e));return o?.[t]??o}function Ws(e){return he(()=>Rr(e))}function zr(...e){let t=Ae(_.byClassName(...e),!1,!0);if(!t)return{};return _r(t,e)}function js(...e){return he(()=>zr(...e))}function Xs(e){return new RegExp(`(?:\\b|_)${br(e)}(?:\\b|_)`)}function _r(e,t){let o={};for(let n of t){let i=Xs(n),s=!1;for(let a in e)if(typeof e[a]==="string"&&i.test(e[a])){o[n]=e[a],s=!0;break}if(!s)oe.warn(`mapMangledCssClasses: class "${n}" not found in module`)}return o}function qs(...e){let{length:t}=e;if(t<2)return oe.warn("findBulk called with fewer than 2 filters, use find instead."),t===1?[ot(e[0])]:[];return Ft(()=>{let o=[...e],n=Array(t).fill(null),i=0,s=z();e:for(let[,a]of s){if(a==null||te(a))continue;for(let c=0;c<t;c++){let l=o[c];if(!l)continue;try{if(l(a)){if(n[c]=a,o[c]=void 0,++i===t)break e}}catch{}}if(typeof a==="object")for(let c in a)try{let l=a[c];if(l==null||te(l))continue;for(let u=0;u<t;u++){let m=o[u];if(!m)continue;if(m(l)){if(n[u]=l,o[u]=void 0,++i===t)break e;break}}}catch{}}if(i!==t)oe.warn(`findBulk: got ${t} filters but only found ${i} modules.`);return n})}function Qo(...e){let t=Oe();if(!t)return null;for(let[o,n]of t)if(De(oo(n),e))return[o,n];return null}function Ur(...e){return Qo(...e)?.[0]??null}function Hr(e,t){let o={},n=Ur(...e);if(n==null)return o;let i=tn(n);if(i==null)return o;return Ft(()=>{let s=Object.entries(t),a=0;e:for(let c in i)try{let l=i[c];for(let u=0;u<s.length;u++){let[m,y]=s[u];if(m in o)continue;if(y(l)){if(o[m]=l,++a===s.length)break e;break}}}catch{}return o})}function Ys(e,t){return he(()=>Hr(e,t))}var to="[A-Za-z_$][\\w$]*",en=new RegExp(`Promise\\.all\\(\\[([^\\]]+)\\]\\.map\\(${to}=>${to}\\.l\\(${to}\\)\\)\\)\\.then\\(\\(\\)=>${to}\\((\\d+)\\)\\)`),Wr=/"(static\/chunks\/[^"]+)"/g;async function jr(e,t=en){let o=Qo(...e);if(!o)return oe.warn("extractAndLoadChunks: no module factory found for:",e),!1;let n=oo(o[1]).match(t);if(!n)return oe.warn("extractAndLoadChunks: no chunk loading pattern found in factory for:",e),!1;let[,i,s]=n;if(s==null)return oe.warn("extractAndLoadChunks: matcher did not capture entry point ID for:",e),!1;let a=tt();if(!a)return oe.warn("extractAndLoadChunks: Turbopack helpers not available."),!1;if(i){let l=Array.from(i.matchAll(Wr),(u)=>u[1]);if(l.length)try{await Promise.all(l.map((u)=>a.l(u)))}catch(u){return oe.warn("extractAndLoadChunks: chunk loading failed:",u),!1}}let c=Number(s);try{tn(c)}catch(l){return oe.warn("extractAndLoadChunks: entry point module failed:",l),!1}return!0}function Ks(e,t=en){return Pt(()=>jr(e,t))}function Zs(...e){let t={},o=Oe();if(!o)return t;for(let[n,i]of o)if(De(oo(i),e))t[n]=i;return t}function tn(e){let t=z();if(t.has(e))return t.get(e);let o=tt();if(!o)return null;try{return o.i(e)}catch{return null}}function Js(e){let t=tt();if(!t)return Promise.reject(Error("Turbopack helpers not available"));return t.A(e)}function Or(e,t){return Ft(()=>{if(te(e))return null;try{if(t(e))return e;if(typeof e==="object"&&e!==null)for(let o in e)try{let n=e[o];if(n!=null&&!te(n)&&t(n))return n}catch{}}catch{}return null})}function be(e,t,o=0){let n=Ae(e);if(n)return t(n,-1),()=>{};let i=(u)=>Or(u,e)!=null,s=(u,m)=>{try{let y=Or(u,e);if(y)t(y,m)}catch(y){oe.error("waitFor callback error:",y)}},a=null;Lr(i,(u,m)=>{if(a)clearTimeout(a);s(u,m)});let l=()=>{if(a)clearTimeout(a);vr(i)};if(o>0)a=setTimeout(()=>{if(a=null,z().size>0&&!Ae(e))oe.warn(`waitFor timed out after ${o}ms:`,e),l()},o);return l}var ro=d("useSession","SessionStoreProvider"),Xr=d("useSettingsStore","TOOL_NAMES"),qr=d("useSettingsDialogStore"),U=d("useFeatureStore"),Yr=d("useFileStore"),Nt=d("useConversationStore","createOptimisticConversation"),io=d("useResponseStore","createOptimisticResponse"),Kr=d("useRoutingStore","formatUrl"),so=d("useModelsStore"),Le=d("useChatPageStore","getLatestThreadMessageId"),Zr=d("useTabsManagerStore"),ao=d("useSubscriptionsStore"),Jr=d("useNotificationsStore","useNotificationsStoreInit"),Qr=d("useMediaStore","useImagineModeStore"),ei=d("useModesStore"),ti=d("useCommandMenuStore","createSelection"),oi=d("useUpsellStore","useShouldShowUpgradeButton"),ni=d("useShareStore"),ri=d("useSourcesSelectorStore"),ii=d("useTourGuideStore","useTourGuideTooltip"),si=d("useDevModelsStore","DRAFT_MODEL_ID"),ai=d("useWorkspaceStore","useWorkspacesList"),li=d("useMentionMenuStore"),ci=d("useAssetStore"),ui=d("usePersonalityStore","DEFAULT_CUSTOM_PERSONALITY"),di=d("useReportStore"),pi=d("useTextToSpeechStore"),fi=d("useTasksStore"),mi=d("useArtifactStore","useArtifactEdits"),gi=d("useWorkspaceCollectionsStore","useWorkspaceActiveCollectionIds"),yi=d("useWorkspaceConnectorsStore","useWorkspaceActiveConnectorIds");var Qs=new D("Styles","#a6d189"),Si=new Map,lo=new Map,Bt=null,co=[];function nn(){if(Bt)return Bt;if(!document.head)return null;return Bt=document.createElement("void-styles"),document.head.appendChild(Bt),Bt}function hi(){let e=nn();if(!e)return;for(let[t,o]of co)rn(e,t,o);co=[]}function rn(e,t,o){let n=lo.get(t);if(n){if(n.textContent!==o)n.textContent=o;return}let i=document.createElement("style");i.dataset.void=t,i.textContent=o,e.appendChild(i),lo.set(t,i)}function P(e,t){Si.set(e,t);let o=nn();if(o)rn(o,e,t);else if(co.push([e,t]),co.length===1)if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",hi,{once:!0});else hi()}function Ge(e){let t=lo.get(e);if(t){if(t.disabled)return t.disabled=!1,!0;return!1}let o=Si.get(e);if(!o)return Qs.warn(`Style "${e}" not registered.`),!1;let n=nn();if(!n)return!1;return rn(n,e,o),!0}function ne(e){let t=lo.get(e);if(!t)return!1;return t.disabled=!0,!0}var I=(e="")=>(...t)=>{let o=new Set;for(let n of t)if(typeof n==="string")o.add(n);else if(Array.isArray(n))n.forEach((i)=>o.add(i));else if(n&&typeof n==="object")Object.entries(n).forEach(([i,s])=>s&&o.add(i));return Array.from(o,(n)=>e+n).join(" ")};function Z(...e){return e.filter(Boolean).join(" ")}function sn(e){let t=typeof e==="string",o=t?e:e.source;if(o=o.replaceAll(/#{i18n::([^}]+)}/g,(i,s)=>t?`"${s}"`:`"${s.replaceAll(".","\\.")}"`),!t)o=o.replaceAll(/(\\*)\\i/g,(i,s)=>s.length%2===0?`${s}(?:[A-Za-z_$][\\w$]*)`:i.slice(1)),o=o.replaceAll(/\\e\{(\w+)\}/g,(i,s)=>`["']${s}["'],\\(\\)=>(?:[A-Za-z_$][\\w$]*)`);if(o===(t?e:e.source))return e;if(t)return o;let n=new RegExp(o,e.flags);return n.toString=e.toString.bind(e),n}function ea(e,t){if(typeof e!=="function")return e.replaceAll("$self",t);return(o,...n)=>e(o,...n).replaceAll("$self",t)}function xi(e,t){e.match=sn(e.match),e.replace=ea(e.replace,t)}function bi(e){if(Array.isArray(e.find))e.find=e.find.map((t)=>sn(t));else e.find=sn(e.find)}function h(e){return e}var nt;((n)=>{n.Init="Init";n.DOMContentLoaded="DOMContentLoaded";n.TurbopackReady="TurbopackReady"})(nt||={});var Ce;((l)=>{l[l.STRING=0]="STRING";l[l.NUMBER=1]="NUMBER";l[l.BIGINT=2]="BIGINT";l[l.BOOLEAN=3]="BOOLEAN";l[l.SELECT=4]="SELECT";l[l.SLIDER=5]="SLIDER";l[l.COMPONENT=6]="COMPONENT";l[l.CUSTOM=7]="CUSTOM"})(Ce||={});var r,x,A,an,X,ae,Vt,q,re,Ot;be(_.byProps("useReducedMotion"),(e)=>{({useReducedMotion:Ot}=e)});be(_.byProps("useState","createElement"),(e)=>{let t=e;r=t,{useState:x,useEffect:A,useLayoutEffect:an,useMemo:X,useRef:ae,useReducer:Vt,useCallback:q,createElement:re}=t,xr(t.createElement)});var rt=Symbol.for("react.fragment"),Ci=d("createPortal","flushSync");var Pi=null;be(_.byProps("Button","ButtonWithTooltipOptimized"),(e)=>{Pi=e});var Ti=(e)=>T(e,()=>Pi?.[e]??w(e)),E=Ti("Button"),Re=Ti("ButtonWithTooltip"),uo=T("Card",()=>w("Card")),Mi=null;be(_.byProps("Dialog","DialogContent","DialogHeader"),(e)=>{Mi=e});var ze=(e)=>T(e,()=>Mi?.[e]??w(e)),ve=ze("Dialog"),we=ze("DialogContent"),Ie=ze("DialogHeader"),ke=ze("DialogTitle"),it=ze("DialogDescription"),st=ze("DialogFooter"),po=ze("DialogClose"),at=T("DropdownMenuItem",()=>w("DropdownMenuItem")),Q=T("Input",()=>w("Input")),fo=T("MotionDiv",()=>no("motion")?.motion?.div),le=T("Select",()=>w("Select")),ce=T("SelectTrigger",()=>w("SelectTrigger")),ue=T("SelectContent",()=>w("SelectContent")),F=T("SelectItem",()=>w("SelectItem")),de=T("SelectValue",()=>w("SelectValue")),Ee=T("Separator",()=>w("Separator")),pe=T("SettingsRow",()=>w("SettingsRow")),lt=T("SettingsTitle",()=>w("SettingsTitle")),ct=T("SettingsDescription",()=>w("SettingsDescription")),Y=T("Switch",()=>w("Switch")),_e=T("Tooltip",()=>w("Tooltip")),Ue=T("TooltipTrigger",()=>w("TooltipTrigger")),He=T("TooltipContent",()=>w("TooltipContent")),{toast:Di}=d("toast","Toaster"),ln=d("Sidebar","SidebarContent","SidebarProvider"),cn=T("AnimatePresence",()=>w("AnimatePresence"));var un=d("chatApi","modelsApi"),dn=d("Toaster","toast"),We=d("cn","middleTruncate"),pn=d("reasoningModeToRequestKind","reasoningModeToDeepsearchPreset"),ta=d("create","useStore"),oa=d("useTranslation"),na=d("useRouter","usePathname");var ra="inline-flex items-center rounded-full border border-input-border px-2 py-0.5 text-[10px] font-semibold transition-colors",ia={default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"bg-popover border-border-l1 text-fg-secondary-foreground hover:bg-popover/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-secondary"};function fn({variant:e="secondary",className:t,children:o,...n}){return r.createElement("div",{className:We.cn(ra,ia[e],t),...n},o)}var sa="w-full max-w-md p-6 rounded-2xl border border-border-l1 flex flex-col gap-6";function At({open:e,onOpenChange:t,title:o,description:n,confirmText:i="Confirm",cancelText:s="Cancel",danger:a,onConfirm:c}){return r.createElement(ve,{open:e,onOpenChange:t},r.createElement(we,{className:sa},r.createElement(Ie,null,r.createElement(ke,null,o),r.createElement(it,null,n)),r.createElement(st,null,r.createElement(E,{variant:"secondary",size:"md",onClick:()=>t(!1)},s),r.createElement(E,{variant:a?"danger":"primary",size:"md",onClick:()=>{t(!1),c()}},i))))}var mo=null;function aa(){if(mo)return mo;return mo=class extends r.Component{constructor(t){super(t);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t){this.props.onError?.(t)}render(){if(this.state.hasError)return this.props.fallback??null;return this.props.children??null}},mo}function la(e){let t=aa();return r.createElement(t,{...e})}var N=la;Object.defineProperty(N,"wrap",{value(e,t=null){let o=(n)=>r.createElement(N,{fallback:t},r.createElement(e,{...n}));return Object.defineProperty(o,"name",{value:`ErrorBoundary(${e.displayName??e.name??"Unknown"})`}),o},configurable:!0});P("ErrorCard",`.void-error-card-root {
    padding: 1rem;
    border-radius: var(--radius);
    background: hsl(var(--red-800) / 60%);
    border: 1px solid hsl(var(--red-700));
    color: hsl(var(--fg-danger));
}

.void-error-card-header {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.void-error-card-root code {
    display: block;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: calc(var(--radius) / 2);
    background: hsl(var(--black) / 20%);
    font-size: 0.85em;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}
`);var yc=I("void-error-card-");function p({flexDirection:e,gap:t="1em",justifyContent:o,alignItems:n,flexWrap:i,children:s,style:a,ref:c,...l}){return r.createElement("div",{ref:c,style:{display:"flex",flexDirection:e,gap:t,justifyContent:o,alignItems:n,flexWrap:i,...a},...l},s)}function ut({columns:e,rows:t,gap:o="0.75rem",justifyItems:n,alignItems:i,children:s,style:a,...c}){return r.createElement("div",{style:{display:"grid",gridTemplateColumns:e,gridTemplateRows:t,gap:o,justifyItems:n,alignItems:i,...a},...c},s)}var ee=(e,...t)=>r.createElement("svg",{width:e.size??"1em",height:e.size??"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:e.className},t),mn=(e={})=>ee(e,r.createElement("path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"}),r.createElement("path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"})),Li=(e={})=>ee(e,r.createElement("rect",{x:"3",y:"8",width:"13",height:"13",rx:"4",stroke:"currentColor"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13 2.00004L12.8842 2.00002C12.0666 1.99982 11.5094 1.99968 11.0246 2.09611C9.92585 2.31466 8.95982 2.88816 8.25008 3.69274C7.90896 4.07944 7.62676 4.51983 7.41722 5.00004H9.76392C10.189 4.52493 10.7628 4.18736 11.4147 4.05768C11.6802 4.00488 12.0228 4.00004 13 4.00004H14.6C15.7366 4.00004 16.5289 4.00081 17.1458 4.05121C17.7509 4.10066 18.0986 4.19283 18.362 4.32702C18.9265 4.61464 19.3854 5.07358 19.673 5.63807C19.8072 5.90142 19.8994 6.24911 19.9488 6.85428C19.9992 7.47112 20 8.26343 20 9.40004V11C20 11.9773 19.9952 12.3199 19.9424 12.5853C19.8127 13.2373 19.4748 13.8114 19 14.2361V16.5829C20.4795 15.9374 21.5804 14.602 21.9039 12.9755C22.0004 12.4907 22.0002 11.9334 22 11.1158L22 11V9.40004V9.35725C22 8.27346 22 7.3993 21.9422 6.69141C21.8826 5.96256 21.7568 5.32238 21.455 4.73008C20.9757 3.78927 20.2108 3.02437 19.27 2.545C18.6777 2.24322 18.0375 2.1174 17.3086 2.05785C16.6007 2.00002 15.7266 2.00003 14.6428 2.00004L14.6 2.00004H13Z",fill:"currentColor"})),gn=(e={})=>ee(e,r.createElement("path",{d:"M10.88 21.94 15.46 14"}),r.createElement("path",{d:"M21.17 8H12"}),r.createElement("path",{d:"M3.95 6.06 8.54 14"}),r.createElement("circle",{cx:"12",cy:"12",r:"10"}),r.createElement("circle",{cx:"12",cy:"12",r:"4"})),yn=(e={})=>ee(e,r.createElement("circle",{cx:"12",cy:"12",r:"10"}),r.createElement("line",{x1:"12",x2:"12",y1:"8",y2:"12"}),r.createElement("line",{x1:"12",x2:"12.01",y1:"16",y2:"16"})),hn=(e={})=>ee(e,r.createElement("path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z"}),r.createElement("circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor"}),r.createElement("circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor"}),r.createElement("circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor"}),r.createElement("circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor"})),go=(e={})=>ee(e,r.createElement("path",{d:"m12 14 4-4"}),r.createElement("path",{d:"M3.34 19a10 10 0 1 1 17.32 0"}));var vi=(e={})=>ee(e,r.createElement("path",{d:"M10 11v6"}),r.createElement("path",{d:"M14 11v6"}),r.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}),r.createElement("path",{d:"M3 6h18"}),r.createElement("path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})),Sn=(e={})=>ee(e,r.createElement("path",{d:"M21 7 6.82 21.18a2.83 2.83 0 0 1-3.99-.01a2.83 2.83 0 0 1 0-4L17 3"}),r.createElement("path",{d:"m16 2 6 6"}),r.createElement("path",{d:"M12 16H4"})),wi=(e={})=>ee(e,r.createElement("path",{d:"m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44"}),r.createElement("path",{d:"m13.56 11.747 4.332-.924"}),r.createElement("path",{d:"m16 21-3.105-6.21"}),r.createElement("path",{d:"M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z"}),r.createElement("path",{d:"m6.158 8.633 1.114 4.456"}),r.createElement("path",{d:"m8 21 3.105-6.21"}),r.createElement("circle",{cx:"12",cy:"13",r:"2"})),xn=(e={})=>ee(e,r.createElement("path",{d:"m19 5 3-3"}),r.createElement("path",{d:"m2 22 3-3"}),r.createElement("path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z"}),r.createElement("path",{d:"M7.5 13.5 10 11"}),r.createElement("path",{d:"M10.5 16.5 13 14"}),r.createElement("path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z"})),Ii=(e={})=>r.createElement("svg",{width:e.size??"1em",height:e.size??"1em",viewBox:"0 0 15 15",fill:"none",className:e.className},r.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})),ki=(e={})=>ee(e,r.createElement("circle",{cx:"12",cy:"12",r:"1"}),r.createElement("circle",{cx:"12",cy:"5",r:"1"}),r.createElement("circle",{cx:"12",cy:"19",r:"1"})),Ei=(e={})=>r.createElement("svg",{width:e.size??"1em",height:e.size??"1em",viewBox:"0 0 24 24",fill:"currentColor",className:e.className},r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 3C9.86974 3 8.36758 3.44687 7.30331 4.30861C6.24544 5.16518 5.77303 6.31294 5.44931 7.34656C5.34315 7.68552 5.24989 8.01119 5.16061 8.32293C4.67184 10.0297 4.3026 11.3191 2.59045 12.0877L2 12.3528V13C2 13.5638 2.1227 14.0439 2.36548 14.4568C2.59992 14.8555 2.9079 15.1234 3.14945 15.3133C3.24924 15.3917 3.33688 15.4587 3.41432 15.5178L3.41445 15.5179C3.75134 15.7753 3.89523 15.8852 4.00625 16.153C4.02083 16.1882 4.05258 16.3202 4.01681 16.6105C3.98277 16.8867 3.89932 17.2176 3.78078 17.5898C3.67031 17.9367 3.54072 18.2855 3.41195 18.6321L3.38617 18.7015C3.25634 19.0512 3.11722 19.4276 3.03341 19.7437L2.70025 21H7.87689L12 22.0308L16.1231 21H21.3378L20.9591 19.7169C20.8577 19.3732 20.7296 19.016 20.6096 18.6814L20.6 18.6547C20.4736 18.302 20.3539 17.9667 20.2541 17.6336C20.0498 16.9516 19.971 16.4061 20.0567 15.9647C20.0994 15.7444 20.1593 15.7043 20.6831 15.3528L20.697 15.3435C20.9367 15.1826 21.2889 14.9346 21.5621 14.5365C21.8517 14.1145 22 13.6069 22 13V12.3528L21.4095 12.0877C19.6974 11.3191 19.3282 10.0297 18.8394 8.32294L18.8392 8.32236C18.75 8.01083 18.6568 7.68526 18.5507 7.34656C18.227 6.31294 17.7546 5.16518 16.6967 4.30861C15.6324 3.44687 14.1303 3 12 3ZM11 10.625C11 11.7986 10.3284 12.75 9.5 12.75C8.67157 12.75 8 11.7986 8 10.625C8 9.4514 8.67157 8.5 9.5 8.5C10.3284 8.5 11 9.4514 11 10.625ZM14.5 12.75C15.3284 12.75 16 11.7986 16 10.625C16 9.4514 15.3284 8.5 14.5 8.5C13.6716 8.5 13 9.4514 13 10.625C13 11.7986 13.6716 12.75 14.5 12.75Z"})),Fi=(e={})=>ee(e,r.createElement("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}),r.createElement("path",{d:"M12 9v4"}),r.createElement("path",{d:"M12 17h.01"}));var ca={primary:"",secondary:"text-secondary",muted:"text-muted-foreground"};function Fe({color:e="secondary",className:t,children:o,...n}){return r.createElement("p",{className:We.cn("text-xs text-pretty",ca[e],t),...n},o)}var ua={xs:"text-xs",sm:"text-sm",base:"text-base",lg:"text-lg",xl:"text-xl","2xl":"text-2xl"},da={normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},pa={primary:"",secondary:"text-secondary",muted:"text-muted-foreground"};function f({size:e="sm",weight:t="normal",color:o="primary",as:n="div",className:i,...s}){return re(n,{className:We.cn(ua[e],da[t],pa[o],i),...s})}var fa={width:"auto",opacity:1},Ni={width:0,opacity:0},ma={duration:0.2,ease:"easeOut"},ga="h-10 relative rounded-full ring-1 ring-inset transition-colors duration-150 ease-out text-fg-primary ring-border-l1 hover:bg-surface-l3";function dt({icon:e,children:t,tooltip:o,onClick:n,className:i,iconOnly:s,"aria-label":a}){let c=typeof o==="string"?o:a,l=Ot(),u=ae(!1),m=!s&&!!t;return A(()=>{if(m)u.current=!0},[m]),r.createElement(Re,{variant:"none",size:"none",className:Z("group flex flex-col justify-center rounded-full","focus:outline-none focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"),tooltipContent:o,tooltipProps:{delayDuration:600},tooltipContentProps:{side:"top"},onClick:n,"aria-label":c},r.createElement("div",{className:Z(ga,"flex items-center justify-center",m?"px-2.5 gap-1.5 text-xs font-medium tabular-nums":"aspect-square gap-0.5",i)},e,s!=null?r.createElement(cn,null,m&&r.createElement(fo,{initial:l||!u.current?!1:Ni,animate:fa,exit:Ni,transition:l?{duration:0}:ma,className:"flex items-center overflow-hidden whitespace-nowrap"},t)):t))}function Bi(e){return Boolean(e)}function Vi(e){return e!=null}function pt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function je(e,t){for(let o in t){if(o==="__proto__"||o==="constructor"||o==="prototype")continue;let n=e[o];if(pt(n))je(n,t[o]);else if(n===void 0)e[o]=t[o]}return e}function Oi(e){return new Promise((t)=>setTimeout(t,e))}async function yo(e){try{await navigator.clipboard.writeText(e)}catch{if(typeof GM_setClipboard==="function")GM_setClipboard(e)}}function Ai(e){let t,o=!1;return(...n)=>{if(o)return t;return o=!0,t=e(...n),t}}function Cn(e,t){let o,n=(...i)=>{clearTimeout(o),o=setTimeout(()=>e(...i),t)};return n.cancel=()=>clearTimeout(o),n}function fe(e){if(typeof GM_xmlhttpRequest>"u")return fetch(e);return new Promise((t,o)=>{GM_xmlhttpRequest({method:"GET",url:e,responseType:"blob",onload(n){let i=n.response;t(new Response(i,{status:n.status,statusText:n.statusText}))},ontimeout(){o(Error("fetch timeout"))},onerror(){o(Error("fetch error"))},onabort(){o(Error("fetch aborted"))}})})}function ft(){let e=new Set,t=0;return{notify(){t++;for(let o of e)o()},subscribe(o){return e.add(o),()=>{e.delete(o)}},getSnapshot(){return t}}}var bn=(e)=>String(e).padStart(2,"0");function ho(e){let t=Math.floor(e/3600),o=Math.floor(e%3600/60),n=e%60;return t>0?`${t}:${bn(o)}:${bn(n)}`:`${o}:${bn(n)}`}function $t(e){let t=Math.floor(e/3600),o=Math.floor(e%3600/60);if(t>0&&o>0)return`${t}h ${o}m`;return t>0?`${t}h`:`${o}m`}function $i(e,t,o){return Math.min(Math.max(e,t),o)}function So(e){return e instanceof Error?e.message:String(e)}function xo(e,t,o="application/octet-stream"){let n=new Blob([t],{type:o}),i=URL.createObjectURL(n),s=document.createElement("a");s.href=i,s.download=e,s.click(),URL.revokeObjectURL(i)}function bo(e,t="file"){return e.replace(/[^a-zA-Z0-9 ]/g,"").trim().replace(/\s+/g,"-")||t}var Pn=new Map;function mt(e,t){let o=Pn.get(e);if(!o)o=new Set,Pn.set(e,o);return o.add(t),()=>{o.delete(t)}}function Co(e,t){let o=Pn.get(e);if(!o?.size)return;for(let n of[...o])n(t)}function gt(e){return typeof e==="function"?e():e}function yt(e){r.useSyncExternalStore(e.subscribe,e.getSnapshot)}function Xe(){return Vt((e)=>e+1,0)[1]}function Tn(e,t){A(()=>mt(e,t),[e,t])}function qe(e,t,o){return X(()=>{let n=t.toLowerCase().trim();if(!n)return e;return e.filter((i)=>o(i).toLowerCase().includes(n))},[e,t,o])}function Po(e){let[t,o]=x(e),n=ae(e);if(n.current!==e)n.current=e,o(e);return A(()=>{if(t==null||t<=0)return;let i=setInterval(()=>o((s)=>s!=null&&s>1?s-1:null),1000);return()=>clearInterval(i)},[t!=null&&t>0]),t}var To=new Map,Mn=ft();function Mo(e,t){To.set(e,t),Mn.notify()}function Do(e){To.delete(e),Mn.notify()}function ya(e,t){if(e.render){let o=e.render;return r.createElement(o,{iconOnly:t})}return r.createElement(dt,{icon:gt(e.icon),tooltip:gt(e.tooltip),onClick:e.onClick,iconOnly:t})}function Gi({iconOnly:e}){if(yt(Mn),!To.size)return null;let t=[...To.entries()].sort(([,o],[,n])=>(o.order??0)-(n.order??0));return r.createElement(r.Fragment,null,t.map(([o,n])=>r.createElement(N,{key:o},ya(n,e))))}var Dn=new Map,Ln=ft();function Ri(e){let t=Dn.get(e);if(!t)t=new Map,Dn.set(e,t);return t}function zi(e,t,o){Ri(e).set(t,o),Ln.notify()}function _i(e,t){Ri(e).delete(t),Ln.notify()}function ha(e,t){if(e.render){let o=e.render;return r.createElement(o,{...t})}return r.createElement(at,{onSelect:()=>e.onSelect?.(t)},gt(e.icon),gt(e.label))}function Ui({location:e,...t}){yt(Ln);let o=Dn.get(e);if(!o?.size)return null;let n=[...o.entries()].sort(([,i],[,s])=>(i.order??0)-(s.order??0));return r.createElement(r.Fragment,null,n.map(([i,s])=>r.createElement(N,{key:i,fallback:null},ha(s,t))))}var Sa=null;function Hi(){return Sa??=new Promise((e,t)=>{let o=indexedDB.open("Void",1);o.onupgradeneeded=()=>{if(!o.result.objectStoreNames.contains("kv"))o.result.createObjectStore("kv")},o.onsuccess=()=>e(o.result),o.onerror=()=>t(o.error)})}async function Wi(e){let t=await Hi();return new Promise((o,n)=>{let s=t.transaction("kv","readonly").objectStore("kv").get(e);s.onsuccess=()=>o(s.result),s.onerror=()=>n(s.error)})}async function Lo(e,t){let o=await Hi();return new Promise((n,i)=>{let a=o.transaction("kv","readwrite").objectStore("kv").put(t,e);a.onsuccess=()=>n(),a.onerror=()=>i(a.error)})}var xa=new D("SettingsStore");function ji(e,t){let o=e.get(t);if(!o)o=new Set,e.set(t,o);return o}class vn{globalListeners=new Set;pathListeners=new Map;prefixListeners=new Map;defaultGetters=new Map;saveTimer=null;constructor(e){this.plain=e,this.store=this.makeProxy(e)}setDefaultGetter(e,t){this.defaultGetters.set(e,t)}makeProxy(e,t=""){return new Proxy(e,{get:(o,n)=>{let i=o[n];if(i===void 0&&n!=="__proto__"){let s=t?`${t}.${n}`:n;for(let[a,c]of this.defaultGetters)if(s.startsWith(a)){let l=s.slice(a.length+1);if(l&&!l.includes(".")){let u=c(l);if(u!==void 0)o[n]=u,i=u}break}}if(pt(i))return this.makeProxy(i,t?`${t}.${n}`:n);return i},set:(o,n,i)=>{if(o[n]===i)return!0;o[n]=i;let s=t?`${t}.${n}`:n;return this.notifyListeners(s),!0},deleteProperty:(o,n)=>{if(!(n in o))return!0;delete o[n];let i=t?`${t}.${n}`:n;return this.notifyListeners(i),!0}})}notifyListeners(e){for(let o of this.globalListeners)o(e);let t=this.pathListeners.get(e);if(t)for(let o of t)o(e);for(let[o,n]of this.prefixListeners)if(e.startsWith(o))for(let i of n)i(e);this.scheduleSave()}scheduleSave(){if(this.saveTimer)return;this.saveTimer=setTimeout(()=>{this.saveTimer=null,this.save()},100)}save(){try{let e=JSON.stringify(this.plain);if(typeof GM_setValue==="function")GM_setValue("VoidSettings",e);else Lo("VoidSettings",e).catch(()=>{})}catch(e){xa.error("Failed to save settings:",e)}}markAsChanged(){this.notifyListeners("")}addGlobalChangeListener(e){this.globalListeners.add(e)}removeGlobalChangeListener(e){this.globalListeners.delete(e)}addChangeListener(e,t){ji(this.pathListeners,e).add(t)}removeChangeListener(e,t){this.pathListeners.get(e)?.delete(t)}addPrefixChangeListener(e,t){ji(this.prefixListeners,e).add(t)}removePrefixChangeListener(e,t){this.prefixListeners.get(e)?.delete(t)}}var Pe=new D("Settings"),wn={plugins:{},notifications:{timeout:5000,position:"bottom-right"}},Ye={};je(Ye,wn);var H=new vn(Ye),Gt=Ye,b=H.store;async function vo(){if(typeof GM_getValue==="function"){try{let t=GM_getValue("VoidSettings",null);if(t)Object.assign(Ye,JSON.parse(t))}catch(t){Pe.error("Failed to load settings:",t)}je(Ye,wn);return}let e=null;try{e=await Wi("VoidSettings")}catch(t){Pe.warn("Failed to read IndexedDB:",t)}if(!e){if(e=ba(),e)Lo("VoidSettings",e).catch((t)=>Pe.debug("Failed to persist settings to IndexedDB:",t))}if(e)try{Object.assign(Ye,JSON.parse(e))}catch(t){Pe.error("Failed to parse settings:",t)}je(Ye,wn)}function ba(){try{let e=localStorage.getItem("VoidSettings");if(e)return localStorage.removeItem("VoidSettings"),Pe.info("Migrated settings from localStorage to IndexedDB"),e}catch(e){Pe.warn("Failed to read localStorage:",e)}return null}function Xi(e,...t){let{plugins:o}=H.plain;if(e in o)return;for(let n of t)if(n in o){Pe.info(`Migrating settings from old name ${n} to ${e}`),o[e]=o[n],delete o[n],H.markAsChanged();break}}function qi(e,t,o){let n=H.plain.plugins[e];if(!n||!(o in n)||t in n)return;Pe.info(`Migrating setting ${o} -> ${t} in ${e}`),n[t]=n[o],delete n[o],H.markAsChanged()}function Yi(e,t,...o){let n=H.plain.plugins[t];if(!n)return;let i=H.plain.plugins[e]??={enabled:!1},s=!1;for(let a of o)if(a in n&&!(a in i))i[a]=n[a],delete n[a],s=!0;if(s)Pe.info(`Migrated settings [${o.join(", ")}] from ${t} to ${e}`),H.markAsChanged()}function Ca(e){if("default"in e)return e.default;if(e.type===4)return e.options.find((t)=>t.default)?.value;return}function me(e,t){let o="",n={get store(){if(!o)throw Error("Cannot access settings before plugin is initialized");return b.plugins[o]},get plain(){if(!o)throw Error("Cannot access settings before plugin is initialized");return Gt.plugins[o]},def:e,checks:t??{},get pluginName(){return o},set pluginName(i){if(o=i,!i)return;if(!Gt.plugins[i])Gt.plugins[i]={enabled:!1};H.setDefaultGetter(`plugins.${i}`,(s)=>{let a=e[s];return a?Ca(a):void 0})},use(i){let s=Xe();return A(()=>{let a=`plugins.${o}`;if(i?.length){let c=i.map((u)=>`${a}.${String(u)}`),l=(u)=>{if(c.some((m)=>u.startsWith(m)))s()};return H.addPrefixChangeListener(a,l),()=>H.removePrefixChangeListener(a,l)}return H.addPrefixChangeListener(a,s),()=>H.removePrefixChangeListener(a,s)},[]),n.store},withPrivateSettings(){return this}};return n}var ge=new D("PluginManager","#b4befe"),L={},In=new Map,Ki=!1,Pa=on;function B(e){let t=L[e];if(!t)return!1;if(t.required)return!0;if(t.isDependency)return!0;return b.plugins[e]?.enabled??t.enabledByDefault??!1}function kn(e,t){let o=e;if(o.plugin=t,o.predicate&&!o.predicate())return;if(bi(o),!Array.isArray(o.replacement))o.replacement=[o.replacement];let n=`Void.plugins[${JSON.stringify(t)}]`;for(let i of o.replacement)xi(i,n);o.replacement=o.replacement.filter(({predicate:i})=>!i||i()),R.push(o)}function Zi(e,t=new Set){if(!e.dependencies)return!0;for(let o of e.dependencies){let n=L[o];if(!n)return ge.warn(`Missing dependency ${o} for ${e.name}`),!1;if(n.started)continue;if(t.has(o))return ge.error(`Circular dependency detected: ${e.name} -> ${o}`),!1;if(n.isDependency=!0,b.plugins[o]={...b.plugins[o],enabled:!0},t.add(o),!Zi(n,t))return!1;if(!Te(n))return!1}return!0}function Ta(e){let t=Pa[e];if(!t)return null;let o=`use${e}`,n=t[o];if(n&&typeof n.subscribe==="function")return n;for(let i in t){let s=t[i];if(s&&typeof s.subscribe==="function")return s}return null}function Te(e,t=!1){if(e.started)return!0;try{if(!Zi(e))return ge.error(`Failed to start dependencies for ${e.name}`),!1;if(e.managedStyle)Ge(e.managedStyle);if(!e.hidden&&!t)ge.info(`Starting plugin ${e.name}`);if(e.start?.(),e.chatBarButton)Mo(e.name,e.chatBarButton);if(e.contextMenuItems)for(let[n,i]of Object.entries(e.contextMenuItems))zi(n,e.name,i);let o=[];if(e.events)for(let[n,i]of Object.entries(e.events))o.push(mt(n,i));if(e.storeSubscriptions?.length)for(let n of e.storeSubscriptions)o.push(n.store.subscribe(n.callback,n.selector));if(e.zustand)for(let[n,i]of Object.entries(e.zustand)){let s=Ta(n);if(!s){ge.warn(`Store "${n}" not found for plugin ${e.name}`);continue}let a=(l,u)=>{try{i.handler(l,u)}catch(m){ge.error(`Zustand handler error in ${e.name} for ${n}:`,m)}},c=i.selector?s.subscribe(i.selector,a):s.subscribe(a);o.push(c)}if(e.eventListeners)for(let n of e.eventListeners){let i=n.target==="window"?window:document;i.addEventListener(n.event,n.handler,n.options),o.push(()=>i.removeEventListener(n.event,n.handler,n.options))}if(o.length)In.set(e.name,o);return e.started=!0,!0}catch(o){return ge.error(`Failed to start plugin ${e.name}:`,o),!1}}function wo(e){if(!e.started)return!0;try{let t=In.get(e.name);if(t){for(let o of t)o();In.delete(e.name)}if(Do(e.name),e.contextMenuItems)for(let o of Object.keys(e.contextMenuItems))_i(o,e.name);if(e.managedStyle)ne(e.managedStyle);if(e.cleanupSelectors)for(let o of e.cleanupSelectors)document.querySelectorAll(o).forEach((n)=>n.remove());return e.stop?.(),e.started=!1,!0}catch(t){return ge.error(`Failed to stop plugin ${e.name}:`,t),!1}}function Rt(e){for(let t in L){let o=L[t];if(!B(t))continue;if((o.startAt??"Init")!==e)continue;Te(o)}}function Io(e){if(L[e.name])return;if(L[e.name]=e,e.started=!1,e.settings)e.settings.pluginName=e.name}function Ji(){if(Ki)return;Ki=!0;let e=new Set;for(let n in L){if(!B(n))continue;let i=L[n];if(i.dependencies?.forEach((s)=>{let a=L[s];if(!a){ge.warn(`Plugin ${n} has unresolved dependency ${s}`);return}b.plugins[s]={...b.plugins[s],enabled:!0},a.isDependency=!0}),i.chatBarButton)e.add("ChatBarButtonAPI");if(i.contextMenuItems)e.add("ContextMenuAPI")}for(let n of e){let i=L[n];if(!i)continue;b.plugins[n]={...b.plugins[n],enabled:!0},i.isDependency=!0}for(let n in L){if(!B(n))continue;let i=L[n];for(let s of Object.keys(i)){if(s==="start"||s==="stop")continue;let a=i[s];if(typeof a==="function"&&!a.$$voidBound){let c=a.bind(i);c.$$voidBound=!0,i[s]=c}}if(i.patches)for(let s of i.patches)kn(s,n)}let t=Object.values(L).filter((n)=>!n.hidden),o=t.filter((n)=>B(n.name)).length;ge.info(`${o}/${t.length} plugins enabled, ${R.length} patches`)}var es=new D("Notices"),ko;((n)=>{n.INFO="log";n.WARNING="warn";n.ERROR="error"})(ko||={});var ht=null,Ke=null;function Qi(e){try{localStorage.removeItem(`banner-${e}`)}catch(t){es.debug("Failed to clear banner dismissal:",t)}}function Eo(e){let t=`void-notice-${Date.now()}`;if(Ke)clearTimeout(Ke),Ke=null;if(ht)Qi(ht);Qi(t);let{config:o}=U.useFeatureStore.getState();if(U.useFeatureStore.setState({config:{...o,banner:{type:e.type??"log",message:e.message,sentAt:t}}}),ht=t,e.timeout)Ke=setTimeout(En,e.timeout);return t}function En(){if(!ht)return;if(Ke)clearTimeout(Ke),Ke=null;try{localStorage.setItem(`banner-${ht}`,"true")}catch(t){es.debug("Failed to persist banner dismissal:",t)}let{config:e}=U.useFeatureStore.getState();U.useFeatureStore.setState({config:{...e,banner:{}}}),ht=null}var Fn=new D("UpdateChecker","#85c1dc");async function ts(){try{let e=await fe("https://raw.githubusercontent.com/imjustprism/Void/main/package.json");if(!e.ok)return;let{version:t}=await e.json();if(!t||t==="0.2.1"){Fn.info("Up to date (0.2.1)");return}Fn.info(`Update available: ${"0.2.1"} → ${t}`),Eo({message:"Void is outdated, please update to the latest version to avoid potential bugs.",type:"warn"})}catch(e){Fn.warn("Failed to check for updates",e)}}P("settings",`.void-settings-version,
.void-settings-version * {
    user-select: text;
    font-size: 0.625rem !important;
    line-height: 1rem !important;
}

.void-settings-version-link {
    text-decoration: none;
    color: inherit;
}

.void-settings-version-link:hover {
    text-decoration: underline;
}
`);var os=new D("Themes","#c6a0f6");function ns(){return b.plugins.Settings??{}}function Ne(e){let t=0;for(let o=0;o<e.length;o++)t=(t<<5)-t+e.charCodeAt(o)|0;return`void-theme-${(t>>>0).toString(36)}`}function Ma(e){let t={name:"",author:"",description:""},o=e.match(/\/\*\*[\s\S]*?\*\//);if(!o)return t;let n=o[0].match(/@name\s+(.+)/),i=o[0].match(/@author\s+(.+)/),s=o[0].match(/@description\s+(.+)/);if(n)t.name=n[1].trim();if(i)t.author=i[1].trim();if(s)t.description=s[1].trim();return t}function ie(){let e=ns();return Array.isArray(e.themes)?e.themes:[]}function Fo(){return ns().themesEnabled!==!1}function No(e){let t=b.plugins.Settings;b.plugins.Settings={...t,themes:e}}function rs(e){let t=b.plugins.Settings;b.plugins.Settings={...t,themesEnabled:e};for(let o of ie())if(o.enabled)if(e)Ge(Ne(o.url));else ne(Ne(o.url))}function Da(e){try{let t=new URL(e);if(t.protocol!=="https:"&&t.protocol!=="http:")throw 0}catch{throw Error("Enter a valid URL.")}if(!/\.css$/i.test(e))throw Error("URL must point to a .css file.")}async function is(e){Da(e);let t=ie();if(t.some((a)=>a.url===e))throw Error("This theme is already added.");let o=await fe(e);if(!o.ok)throw Error(`Failed to fetch theme (${o.status}).`);let n=await o.text();if(!n.trim())throw Error("Theme file is empty.");let i=Ma(n),s={url:e,name:i.name||La(e),author:i.author,description:i.description,enabled:!1};return P(Ne(e),n),ne(Ne(e)),No([...t,s]),os.info(`Added theme "${s.name}" from ${e}`),s}function ss(e){ne(Ne(e)),No(ie().filter((t)=>t.url!==e))}async function as(e){if(No(ie().map((i)=>i.url===e?{...i,enabled:!0}:i)),!Fo())return;let t=Ne(e);if(Ge(t))return;let o=await fe(e);if(!o.ok)return;let n=await o.text();P(t,n)}function ls(e){No(ie().map((t)=>t.url===e?{...t,enabled:!1}:t)),ne(Ne(e))}async function cs(){if(!Fo())return;let e=ie().filter((o)=>o.enabled),t=await Promise.allSettled(e.map(async(o)=>{let n=await fe(o.url);if(!n.ok)throw Error(`HTTP ${n.status}`);let i=await n.text();P(Ne(o.url),i)}));for(let o=0;o<t.length;o++)if(t[o].status==="rejected")os.warn(`Failed to load theme "${e[o].name}":`,t[o].reason)}function La(e){return(e.split("/").pop()??e).replace(/\.css$/i,"").replace(/[-_]/g," ")}P("CustomCSSTab",`.void-css-block {
    display: flex;
    flex-direction: column;
    min-height: 400px;
    margin: 0 0.75rem;
    border: 1px solid var(--border-l1);
    border-radius: 0.75rem;
    overflow: hidden;
}

.void-css-header {
    display: flex;
    align-items: center;
    height: 2.5rem;
    padding: 0 1rem;
    background: hsl(var(--surface-base));
    border-radius: 0.75rem 0.75rem 0 0;
}

.void-css-header span {
    font-family: var(--font-ibm-plex-mono), monospace;
    font-size: 0.75rem;
    color: hsl(var(--fg-secondary));
    user-select: none;
}

.void-css-editor {
    flex: 1;
    background: hsl(var(--surface-inset));
    border-radius: 0 0 0.75rem 0.75rem;
}

.void-css-editor .monaco-editor,
.void-css-editor .monaco-editor .overflow-guard {
    border-radius: 0 0 0.75rem 0.75rem;
}

.void-css-editor .monaco-editor .focused .selected-text,
.void-css-editor .monaco-editor.focused {
    outline: none !important;
    border: none !important;
}

.void-css-editor .monaco-editor,
.void-css-editor .monaco-editor .inputarea {
    outline: none !important;
    box-shadow: none !important;
}

.void-css-editor .monaco-editor .cursors-layer > .cursor {
    visibility: hidden !important;
}

.void-css-editor .monaco-editor.focused .cursors-layer > .cursor {
    visibility: inherit !important;
}

.void-css-editor .monaco-editor .current-line-margin-both {
    border: none !important;
}
`);var Nn=I("void-css-"),us="void-custom-css",Bn=d("initMonaco"),va=Jo((e)=>e.darkTheme?.base==="vs-dark");function Bo(){return b.plugins.Settings??{}}function Vn(e){P(us,e)}function wa(){ne(us)}function Ia(e){let t=b.plugins.Settings;if(b.plugins.Settings={...t,customCSSEnabled:e},e){let o=typeof Bo().customCSS==="string"?Bo().customCSS:"";if(o)Vn(o)}else wa()}function zt(){let e=Bo(),t=e.customCSS;if(typeof t==="string"&&t&&e.customCSSEnabled!==!1)return Vn(t),t;return typeof t==="string"?t:""}function ka(e){let t=b.plugins.Settings,o=t?.customCSSEnabled!==!1;if(b.plugins.Settings={...t,customCSS:e},o)Vn(e)}function On(){let e=ae(null),t=ae(null),[o,n]=x(()=>Bo().customCSSEnabled!==!1),i=(s)=>{n(s),Ia(s)};return A(()=>{if(!e.current)return;let s=!1,a=null;return(async()=>{if(!Bn.monacoInstance)await Bn.initMonaco();if(s)return;let c=Bn.monacoInstance;c.editor.defineTheme("grok-dark",va.darkTheme),a=c.editor.create(e.current,{value:zt(),language:"css",theme:"grok-dark",minimap:{enabled:!1},scrollbar:{vertical:"hidden",horizontal:"hidden"},overviewRulerLanes:0,hideCursorInOverviewRuler:!0,overviewRulerBorder:!1,folding:!1,glyphMargin:!1,fontSize:13,lineNumbers:"off",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:4,wordWrap:"on",padding:{top:8},renderLineHighlight:"none",renderLineHighlightOnlyWhenFocus:!0,lineDecorationsWidth:0,readOnly:!o}),t.current=a,a.onDidChangeModelContent(()=>ka(a.getValue()))})(),()=>{s=!0,a?.dispose(),t.current=null}},[]),A(()=>{t.current?.updateOptions({readOnly:!o})},[o]),r.createElement(p,{flexDirection:"column",gap:"1rem"},r.createElement(p,{alignItems:"center",justifyContent:"space-between",style:{padding:"0 0.75rem"}},r.createElement(p,{flexDirection:"column",gap:"0"},r.createElement(f,{size:"sm",weight:"medium"},"Quick CSS"),r.createElement(f,{size:"xs",color:"secondary"},"Custom CSS applied live as you type.")),r.createElement(Y,{checked:o,onCheckedChange:i})),r.createElement("div",{className:Nn("block")},r.createElement("div",{className:Nn("header")},r.createElement(f,{as:"span"},"CSS")),r.createElement("div",{ref:e,className:Nn("editor")})))}P("PluginsTab",`.void-plugins-reload-banner {
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius);
    background: hsl(var(--yellow-800) / 60%);
    border: 1px solid hsl(var(--yellow-700));
    color: hsl(var(--fg-warning));
}
`);P("PluginCard",`.void-plugin-card-root {
    padding: 0;
    display: flex;
    flex-direction: column;
    border-radius: 0.375rem;
    border: 1px solid var(--border-l1);
    background: var(--card);
    min-height: 120px;
}

.void-plugin-card-body {
    padding: 0.625rem 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.void-plugin-card-name {
    font-size: 0.875rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
}

.void-plugin-card-required-icon,
.void-plugin-card-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: hsl(var(--fg-tertiary));
    flex-shrink: 0;
    line-height: 0;
}

.void-plugin-card-desc {
    font-size: 0.75rem;
    color: hsl(var(--fg-secondary));
    line-height: 1.5;
    margin-top: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.void-plugin-card-controls {
    flex-shrink: 0;
}

.void-plugin-card-separator {
    height: 1px;
    background: var(--border-l1);
}

.void-plugin-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0.75rem;
    gap: 0.75rem;
}

.void-plugin-card-authors {
    font-size: 0.7rem;
    color: hsl(var(--fg-tertiary));
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.void-plugin-card-required {
    opacity: 0.4;
}

.void-plugin-card-crashed {
    opacity: 0.5;
    border-color: hsl(var(--red-700));
}

.void-plugin-card-crashed-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: hsl(var(--fg-danger));
    flex-shrink: 0;
    line-height: 0;
}

.void-plugin-card-crashed-icon svg {
    width: 1em;
    height: 1em;
}
`);var Ea=[{key:"dev",icon:Ei,tooltip:"Dev Only"},{key:"chrome",icon:gn,tooltip:"Chromium Only"},{key:"preview",icon:wi,tooltip:"Preview plugin, may be removed once Grok ships this."}];function ds({plugin:e,className:t}){return Ea.map((o)=>e[o.key]?r.createElement(_e,{key:o.key},r.createElement(Ue,{asChild:!0},r.createElement("span",{className:t},r.createElement(o.icon,null))),r.createElement(He,null,o.tooltip)):null)}function ps(e){if("default"in e)return e.default;if("options"in e&&e.type===4)return e.options.find((t)=>t.default)?.value}function An([,e]){return e.type!==7&&!(("hidden"in e)&&e.hidden)}function fs(e){return!!e.settings?.def&&Object.entries(e.settings.def).some(An)}var J=I("void-plugin-card-");function Vo({name:e,onSettings:t,onReload:o}){let n=L[e],i=Xe(),s=B(e),a=s&&!n.started&&!n.required,c=!!n.patches?.length,l=()=>{if(b.plugins[e]={...b.plugins[e],enabled:!s},!s)Te(n,!0);else wo(n);if(i(),Co("pluginToggle"),c)o(e)};return r.createElement("div",{className:Z(J("root"),n.required&&J("required"),a&&J("crashed"))},r.createElement("div",{className:J("body")},r.createElement(p,{alignItems:"center",justifyContent:"space-between",gap:"0.5rem"},r.createElement(f,{as:"span",className:J("name")},e,a&&r.createElement(_e,null,r.createElement(Ue,{asChild:!0},r.createElement(f,{as:"span",className:J("crashed-icon")},r.createElement(Fi,null))),r.createElement(He,null,"This plugin failed to start")),n.required&&r.createElement(_e,null,r.createElement(Ue,{asChild:!0},r.createElement(f,{as:"span",className:J("required-icon")},r.createElement(yn,null))),r.createElement(He,null,"This plugin is required for Void to work")),r.createElement(ds,{plugin:n,className:J("badge")})),r.createElement(p,{alignItems:"center",gap:"0.375rem",className:J("controls")},fs(n)&&r.createElement(E,{variant:"tertiary",size:"xs",shape:"circle",onClick:()=>t(e)},r.createElement(ki,{size:16})),r.createElement(Y,{checked:s,disabled:n.required,onCheckedChange:l}))),n.description&&r.createElement("div",{className:J("desc")},n.description)),r.createElement("div",{className:J("separator")}),r.createElement("div",{className:J("footer")},r.createElement("div",{className:J("authors")},n.authors?.length?n.authors.join(", "):" ")))}P("PluginDialog",`.void-plugin-dialog-content {
    width: 600px;
    min-height: 420px;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border-l1);
    background: var(--background);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* SettingsRow has px-3 built in, strip it so fields align with the title */
.void-plugin-dialog-content .px-3 {
    padding-left: 0;
    padding-right: 0;
}

.void-plugin-dialog-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    z-index: 10;
}

.void-plugin-dialog-header {
    text-align: left;
}
`);function St(e,t,o){let[n,i]=x((b.plugins[e]??{})[t]??ps(o)),s=q((a)=>{i(a),b.plugins[e]={...b.plugins[e],[t]:a},o.onChange?.(a)},[t,e,o]);return[n,s]}function _t({id:e,setting:t}){return r.createElement(p,{flexDirection:"column",gap:"0"},r.createElement(lt,null,Mt(e)),"description"in t&&t.description&&r.createElement(ct,null,t.description))}function Fa({id:e,setting:t,pluginName:o}){let[n,i]=St(o,e,t);return r.createElement(pe,{action:r.createElement(Y,{checked:!!n,onCheckedChange:i})},r.createElement(_t,{id:e,setting:t}))}function Na({id:e,setting:t,pluginName:o}){let[n,i]=St(o,e,t);if(!("options"in t))return null;return r.createElement(pe,{action:r.createElement(le,{value:String(n??""),onValueChange:i},r.createElement(ce,null,r.createElement(de,null)),r.createElement(ue,null,t.options.map((s)=>r.createElement(F,{key:String(s.value),value:String(s.value)},s.label))))},r.createElement(_t,{id:e,setting:t}))}function Ba({id:e,setting:t,pluginName:o}){let[n,i]=St(o,e,t);if(!("markers"in t))return null;let{markers:s,stickToMarkers:a}=t;return r.createElement(pe,{action:r.createElement("input",{type:"range",min:s[0],max:s[s.length-1],value:n??s[0],onChange:(c)=>{let l=Number(c.target.value);if(a)l=s.reduce((u,m)=>Math.abs(m-l)<Math.abs(u-l)?m:u);i(l)},className:"w-24"})},r.createElement(_t,{id:e,setting:t}))}function Va({setting:e,pluginName:t}){let[,o]=St(t,"component",e);if(!("component"in e))return null;let n=e.component;return r.createElement(n,{setValue:o,option:e})}function ms({id:e,setting:t,pluginName:o}){let[n,i]=St(o,e,t);return r.createElement(pe,{action:r.createElement(Q,{type:"number",value:n??"",onChange:(s)=>{let a=Number(s.target.value);if(!isNaN(a))i(a)},className:"w-24"})},r.createElement(_t,{id:e,setting:t}))}function Oa({id:e,setting:t,pluginName:o}){let[n,i]=St(o,e,t);return r.createElement(pe,{action:r.createElement(Q,{type:"text",value:n??"",onChange:(s)=>i(s.target.value),placeholder:"placeholder"in t?t.placeholder:void 0,className:"w-40"})},r.createElement(_t,{id:e,setting:t}))}var Aa={3:Fa,4:Na,5:Ba,6:Va,1:ms,2:ms,0:Oa,7:null};function $n({id:e,setting:t,pluginName:o}){let n=Aa[t.type];if(!n)return null;return r.createElement(n,{id:e,setting:t,pluginName:o})}var Gn=I("void-plugin-dialog-");function Rn({plugin:e,open:t,onClose:o}){let n=Object.entries(e.settings?.def??{}).filter(An);return r.createElement(ve,{open:t,onOpenChange:(i)=>{if(!i)o()}},r.createElement(we,{className:Gn("content"),"aria-describedby":void 0},r.createElement(po,{asChild:!0},r.createElement(E,{variant:"tertiary",size:"sm",shape:"circle",className:Gn("close")},r.createElement(Ii,null))),r.createElement(Ie,{className:Gn("header")},r.createElement(ke,null,e.name),e.description&&r.createElement(f,{size:"xs",color:"secondary"},e.description)),r.createElement(Ee,null),e.authors?.length&&r.createElement(p,{flexDirection:"column",gap:"0.25rem"},r.createElement(f,{size:"sm",weight:"medium"},"Authors"),r.createElement(f,{size:"xs",color:"secondary"},e.authors.join(", "))),r.createElement(p,{flexDirection:"column",gap:"0.25rem"},r.createElement(f,{size:"sm",weight:"medium"},"Settings"),n.length?r.createElement(p,{flexDirection:"column",gap:"0.75rem",className:"mt-2"},n.map(([i,s])=>r.createElement($n,{key:i,id:i,setting:s,pluginName:e.name}))):r.createElement(f,{size:"xs",color:"secondary"},"No configurable settings."))))}var $a=I("void-plugins-"),xt=null,Oo=new Set,zn=!1,gs=(e)=>`${e} ${L[e].description??""}`;function _n(){let[e,t]=x(""),[o,n]=x("all"),[i,s]=x(null),[a,c]=x(!1),{userPlugins:l,requiredPlugins:u}=X(()=>{let g=[],K=[];for(let C of Object.keys(L).sort((Ct,Os)=>Ct.localeCompare(Os))){if(L[C].hidden)continue;if(L[C].required)K.push(C);else g.push(C)}return{userPlugins:g,requiredPlugins:K}},[]);A(()=>{if(xt)return;xt=new Map;for(let g of l)xt.set(g,B(g));for(let g of u)xt.set(g,B(g))},[l,u]);let m=l.length+u.length,y=X(()=>{if(o==="all")return l;let g=o==="enabled";return l.filter((K)=>B(K)===g)},[o,l]),v=X(()=>{if(o==="all")return u;let g=o==="enabled";return u.filter((K)=>B(K)===g)},[o,u]),S=qe(y,e,gs),W=qe(v,e,gs),k=i?L[i]:null,$=S.length||W.length,j=Oo.size>0,V=q((g)=>{if(!xt)return;if(B(g)===xt.get(g))Oo.delete(g);else Oo.add(g);if(Oo.size){if(!zn)c(!0)}else c(!1),zn=!1},[]),se=q(()=>{zn=!0,c(!1)},[]);return r.createElement(p,{flexDirection:"column",gap:"1.5rem"},r.createElement(p,{flexDirection:"column",gap:"0",style:{padding:"0 0.75rem"}},r.createElement(f,{size:"sm",weight:"medium"},"Plugins"),r.createElement(f,{size:"xs",color:"secondary"},"Pick which plugins to use. Some need a page reload to kick in.")),j&&!a&&r.createElement(p,{alignItems:"center",className:Z($a("reload-banner"),"mx-3")},r.createElement(f,{size:"xs",className:"text-inherit flex-1"},"Reload the page to apply plugin changes."),r.createElement(E,{variant:"secondary",size:"sm",onClick:()=>location.reload()},"Reload")),r.createElement(p,{alignItems:"center",gap:"0.75rem",style:{padding:"0 0.75rem"}},r.createElement(Q,{type:"text",placeholder:`Search ${m} plugins...`,value:e,onChange:(g)=>t(g.target.value),className:"flex-1 min-w-0"}),r.createElement(le,{value:o,onValueChange:(g)=>n(g)},r.createElement(ce,{className:"w-28"},r.createElement(de,null)),r.createElement(ue,null,r.createElement(F,{value:"all"},"All"),r.createElement(F,{value:"enabled"},"Enabled"),r.createElement(F,{value:"disabled"},"Disabled")))),S.length>0&&r.createElement(ut,{columns:"repeat(2, 1fr)",style:{padding:"0 0.75rem"}},S.map((g)=>r.createElement(Vo,{key:g,name:g,onSettings:s,onReload:V}))),W.length>0&&r.createElement(r.Fragment,null,r.createElement(Ee,{className:"mx-3 w-auto"}),r.createElement(ut,{columns:"repeat(2, 1fr)",style:{padding:"0 0.75rem"}},W.map((g)=>r.createElement(Vo,{key:g,name:g,onSettings:s,onReload:V})))),!$&&r.createElement(Fe,{color:"secondary",className:"text-center py-8"},e?"No plugins match your search.":"No plugins available."),k&&r.createElement(Rn,{plugin:k,open:!0,onClose:()=>s(null)}),r.createElement(At,{open:a,onOpenChange:(g)=>{if(!g)se()},title:"Reload required",description:"This plugin patches Grok's code, so you need to reload the page.",confirmText:"Reload",cancelText:"Later",onConfirm:()=>location.reload()}))}P("ThemesTab",`.void-themes-add-error {
    font-size: 0.75rem;
    color: hsl(var(--fg-danger));
}
`);P("ThemeCard",`.void-theme-card-root {
    padding: 0;
    display: flex;
    flex-direction: column;
    border-radius: 0.375rem;
    border: 1px solid var(--border-l1);
    background: var(--card);
}

.void-theme-card-body {
    padding: 0.625rem 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.void-theme-card-name {
    font-size: 0.875rem;
    font-weight: 400;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.void-theme-card-controls {
    flex-shrink: 0;
}

.void-theme-card-desc {
    font-size: 0.75rem;
    color: hsl(var(--fg-secondary));
    line-height: 1.5;
    margin-top: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.void-theme-card-separator {
    height: 1px;
    background: var(--border-l1);
}

.void-theme-card-footer {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
}

.void-theme-card-author {
    font-size: 0.7rem;
    color: hsl(var(--fg-tertiary));
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
`);var Be=I("void-theme-card-");function Un({theme:e,globalEnabled:t,onRemove:o,onToggle:n}){let i=()=>{if(e.enabled)ls(e.url);else as(e.url);n()};return r.createElement("div",{className:Be("root")},r.createElement("div",{className:Be("body")},r.createElement(p,{alignItems:"center",justifyContent:"space-between",gap:"0.5rem"},r.createElement(f,{as:"span",className:Be("name")},e.name??e.url),r.createElement(p,{alignItems:"center",gap:"0.375rem",className:Be("controls")},r.createElement(Re,{variant:"tertiary",size:"xs",shape:"circle",tooltipContent:"Copy URL",onClick:()=>yo(e.url)},r.createElement(Li,{size:16})),r.createElement(Re,{variant:"tertiary",size:"xs",shape:"circle",tooltipContent:"Remove",onClick:()=>o(e.url)},r.createElement(vi,{size:16})),r.createElement(Y,{checked:e.enabled,disabled:!t,onCheckedChange:i}))),e.description&&r.createElement("div",{className:Be("desc")},e.description)),r.createElement("div",{className:Be("separator")}),r.createElement("div",{className:Be("footer")},r.createElement("div",{className:Be("author")},e.author??" ")))}var Ga=I("void-themes-"),Ra=(e)=>`${e.name} ${e.description} ${e.author}`;function Hn(){let[e,t]=x(""),[o,n]=x("all"),[i,s]=x(""),[a,c]=x(""),[l,u]=x(!1),[m,y]=x(Fo),[v,S]=x(ie),W=X(()=>{if(o==="all")return v;let C=o==="enabled";return v.filter((Ct)=>Ct.enabled===C)},[v,o]),k=qe(W,e,Ra),$=(C)=>{y(C),rs(C)},j=async()=>{let C=i.trim();if(!C)return;c(""),u(!0);try{await is(C),s(""),S(ie())}catch(Ct){c(So(Ct))}finally{u(!1)}},[V,se]=x(null),g=V?v.find((C)=>C.url===V):null,K=()=>{if(!V)return;ss(V),se(null),S(ie())};return r.createElement(p,{flexDirection:"column",gap:"2rem"},r.createElement(p,{alignItems:"center",justifyContent:"space-between",style:{padding:"0 0.75rem"}},r.createElement(p,{flexDirection:"column",gap:"0"},r.createElement(f,{size:"sm",weight:"medium"},"Themes"),r.createElement(f,{size:"xs",color:"secondary"},"Custom CSS themes for Grok. Paste a URL to a .css file to add one.")),r.createElement(Y,{checked:m,onCheckedChange:$})),r.createElement(p,{flexDirection:"column",gap:"0.5rem",style:{padding:"0 0.75rem"}},r.createElement(p,{alignItems:"center",gap:"0.5rem"},r.createElement(Q,{type:"text",placeholder:"https://raw.githubusercontent.com/...",value:i,onChange:(C)=>{s(C.target.value),c("")},onKeyDown:(C)=>{if(C.key==="Enter")j()},className:"flex-1 min-w-0"}),r.createElement(E,{variant:"primary",size:"sm",className:"h-9",onClick:j,disabled:l||!i.trim()},l?"Importing...":"Import")),a&&r.createElement(f,{size:"xs",className:Ga("add-error")},a)),v.length>0&&r.createElement(p,{flexDirection:"column",gap:"0.375rem",style:{padding:"0 0.75rem"}},r.createElement(p,{flexDirection:"column",gap:"0"},r.createElement(f,{size:"sm",weight:"medium"},"Installed Themes"),r.createElement(f,{size:"xs",color:"secondary"},"Re-fetched every page load. Use the switch above to disable all themes at once.")),r.createElement(f,{size:"xs",color:"secondary"},`${Xt(v.length,"theme")} installed · ${v.filter((C)=>C.enabled).length} enabled`)),v.length>0&&r.createElement(p,{alignItems:"center",gap:"0.75rem",style:{padding:"0 0.75rem"}},r.createElement(Q,{type:"text",placeholder:`Search ${v.length} themes...`,value:e,onChange:(C)=>t(C.target.value),className:"flex-1 min-w-0"}),r.createElement(le,{value:o,onValueChange:(C)=>n(C)},r.createElement(ce,{className:"w-28"},r.createElement(de,null)),r.createElement(ue,null,r.createElement(F,{value:"all"},"All"),r.createElement(F,{value:"enabled"},"Enabled"),r.createElement(F,{value:"disabled"},"Disabled")))),k.length>0&&r.createElement(ut,{columns:"repeat(2, 1fr)",style:{padding:"0 0.75rem"}},k.map((C)=>r.createElement(Un,{key:C.url,theme:C,globalEnabled:m,onRemove:se,onToggle:()=>S(ie())}))),v.length>0&&!k.length&&r.createElement(Fe,{color:"secondary",className:"text-center py-8"},"No themes match your search."),!v.length&&r.createElement(Fe,{color:"secondary",className:"text-center py-8"},"No themes added yet. Paste a URL above to add one."),r.createElement(At,{open:V!=null,onOpenChange:(C)=>{if(!C)se(null)},title:"Remove theme",description:`Are you sure you want to remove "${g?.name??"this theme"}"?`,confirmText:"Remove",cancelText:"Cancel",danger:!0,onConfirm:K}))}var ys=N.wrap(On),hs=N.wrap(_n),Ss=N.wrap(Hn);P("experiments",`.void-experiments-section {
    padding: 0 0.75rem;
}

.void-experiments-modified {
    margin-left: 6px;
    color: hsl(var(--fg-warning));
}

.void-experiments-new-chip {
    margin-left: 6px;
    vertical-align: middle;
}

.void-experiments-warning {
    margin: 0 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius);
    background: hsl(var(--yellow-800) / 60%);
    border-color: hsl(var(--yellow-700));
    color: hsl(var(--fg-warning));
}

.void-experiments-warning-text {
    color: inherit;
    line-height: 1.5;
}

.void-experiments-clear-btn {
    flex-shrink: 0;
    border-color: hsl(var(--yellow-700));
    color: hsl(var(--fg-warning));
}

.void-experiments-empty {
    text-align: center;
    padding: 2rem;
}
`);var M=Object.freeze({Prism:"Prism",adryd:"adryd"});var Me=I("void-experiments-"),za=86400000,Ao=me({}).withPrivateSettings();function Cs(e){return Object.keys(e).filter((t)=>typeof e[t]==="boolean")}function xs(e){let t=Cs(e);if(!t.length)return;let o=Ao.plain.knownFlags,n=o==null,i=o??{},s=Date.now(),a=n;if(!n){let l=Object.values(i);if(l.length>1&&l.every((u)=>u===l[0]&&u!==0)){for(let u of Object.keys(i))i[u]=0;a=!0}}for(let l of t)if(!(l in i))i[l]=n?0:s,a=!0;let c=new Set(t);for(let l of Object.keys(i))if(!c.has(l))delete i[l],a=!0;if(a)Ao.store.knownFlags={...i}}function bs(e){let t=Ao.plain.knownFlags?.[e];if(t==null)return!1;return Date.now()-t<za}var _a={Mcp:"MCP",Ui:"UI",Api:"API",Url:"URL",Gcal:"GCal",Mie:"MIE",Xlsx:"XLSX",Nux:"NUX",Xai:"xAI",Grok:"Grok",Id:"ID"},Ps=(e)=>Mt(e,_a);function Ua({flagKey:e,isNew:t}){let o=U.useFeatureStore((c)=>c.config[e]),n=U.useFeatureStore((c)=>c.overrides[e]),i=n!==void 0,s=i?!!n:!!o,a=q((c)=>{let{setOverride:l,clearOverride:u,config:m}=U.useFeatureStore.getState();if(c===!!m[e])u(e);else l(e,c)},[e]);return r.createElement(pe,{action:r.createElement(Y,{checked:s,onCheckedChange:a})},r.createElement(lt,null,Ps(e),t&&r.createElement(fn,{className:Me("new-chip")},"NEW"),i&&r.createElement(f,{size:"xs",as:"span",className:Me("modified")},"(modified)")),r.createElement(ct,null,e))}function Ha(){let[e,t]=x(""),[o,n]=x("all"),i=U.useFeatureStore((y)=>y.config),s=U.useFeatureStore((y)=>y.overrides),a=X(()=>Cs(i).sort(),[i]),c=q((y)=>`${y} ${Ps(y)}`,[]),l=qe(a,e,c),u=X(()=>{if(o==="all")return l;return l.filter((y)=>{let v=s[y],S=v!==void 0?!!v:!!i[y];if(o==="enabled")return S;if(o==="disabled")return!S;if(o==="new")return bs(y);if(o==="modified")return v!==void 0})},[l,o,i,s]),m=Object.keys(s).length;return r.createElement(p,{flexDirection:"column",gap:"1rem",className:Me("root")},r.createElement(p,{flexDirection:"column",gap:"0",className:Me("section")},r.createElement(f,{size:"sm",weight:"medium"},"Experiments"),r.createElement(f,{size:"xs",color:"secondary"},"Toggle unreleased Grok features. These are experimental and may break things.")),r.createElement(uo,{variant:"ghost",className:Me("warning")},r.createElement(p,{alignItems:"center",justifyContent:"space-between",gap:"0.75rem"},r.createElement(f,{size:"xs",className:Me("warning-text")},"Only enable flags you understand. Changing the wrong setting can break Grok or cause unexpected behavior."),m>0&&r.createElement(E,{variant:"secondary",size:"sm",className:Me("clear-btn"),onClick:()=>U.useFeatureStore.getState().clearAllOverrides()},"Clear ",Xt(m,"override")))),r.createElement(p,{alignItems:"center",gap:"0.5rem",className:Me("section")},r.createElement(Q,{placeholder:`Search ${a.length} flags...`,value:e,onChange:(y)=>t(y.target.value),className:"flex-1"}),r.createElement(le,{value:o,onValueChange:(y)=>n(y)},r.createElement(ce,{className:"w-28"},r.createElement(de,null)),r.createElement(ue,null,r.createElement(F,{value:"all"},"All"),r.createElement(F,{value:"enabled"},"Enabled"),r.createElement(F,{value:"disabled"},"Disabled"),r.createElement(F,{value:"new"},"New"),r.createElement(F,{value:"modified"},"Modified")))),u.map((y)=>r.createElement(N,{key:y,fallback:null},r.createElement(Ua,{flagKey:y,isNew:bs(y)}))),!u.length&&r.createElement(Fe,{color:"muted",className:Me("empty")},e?`No flags matching "${e}"`:`No ${o} flags`))}var Ts=N.wrap(Ha),Wn=h({name:"Experiments",description:"Unlock and toggle unreleased Grok features.",authors:[M.Prism],settings:Ao,startAt:"TurbopackReady",start(){let e=U.useFeatureStore.getState();if(e.status==="ready")xs(e.config)},zustand:{FeatureStore:{selector:(e)=>e.status==="ready"?e.config:null,handler(e){if(e)xs(e)}}},patches:[{find:'ENABLE_SCREEN_SHARING:"enable_screen_sharing"',all:!0,replacement:{match:/\i&&(void 0!==\i\[\i\])/,replace:"$1"}},{find:"Feature flag overrides active",replacement:{match:/\i\.toast\.warning\(\i\("Feature flag overrides active","Feature flag overrides active"\)\)/,replace:"void 0"}}]});var Ds=I("void-settings-"),jn=me({hideUserId:{type:3,description:"Hide your user ID from the account settings page.",default:!0},fixDialogFlash:{type:3,description:"Fix the white border flash when clicking inside dialogs.",default:!0}}),Wa=[{id:"void_plugins_tab",name:"Plugins",icon:xn,component:hs},{id:"void_themes_tab",name:"Themes",icon:hn,component:Ss},{id:"void_css_tab",name:"Quick CSS",icon:mn,component:ys},{id:"void_experiments_tab",name:"Experiments",icon:Sn,component:Ts,plugin:"Experiments"}];function Ls(){return Wa.filter((e)=>!e.plugin||B(e.plugin))}function Xn(){return r.createElement(f,{as:"span",color:"secondary"},"•")}function Ms({href:e,children:t}){return r.createElement("a",{href:e,target:"_blank",rel:"noreferrer",className:Z(Ds("version-link"),"pointer-events-auto")},r.createElement(f,{as:"span",color:"secondary"},t))}function ja(){return r.createElement(p,{flexDirection:"column",gap:"0",className:Z(Ds("version"),"absolute bottom-0 left-0 right-0 p-3 opacity-30 text-secondary pointer-events-none")},r.createElement(p,{alignItems:"center",gap:"0.25rem"},r.createElement(Ms,{href:"https://github.com/imjustprism/Void"},"Void"),r.createElement(Xn,null),r.createElement(f,{as:"span",color:"secondary"},"v0.2.1"),r.createElement(Xn,null),r.createElement(Ms,{href:"https://github.com/imjustprism/Void/commit/efce377"},"(efce377)")),r.createElement(p,{alignItems:"center",gap:"0.25rem"},r.createElement(f,{as:"span",color:"secondary"},"Production"),r.createElement(Xn,null),r.createElement(f,{as:"span",color:"secondary"},"Userscript")))}function Xa({jsx:e,TabButton:t}){let o=Xe();return Tn("pluginToggle",o),r.createElement(rt,null,Ls().map((n)=>e(t,{key:n.id,icon:n.icon,text:n.name,tab:n.id})))}function qa({jsx:e,activeTab:t,Wrapper:o}){let n=Xe();Tn("pluginToggle",n);let i=Ls().find((s)=>s.id===t);if(!i)return null;return e(o,{key:i.id,children:e(i.component,{})})}var qn=h({name:"Settings",description:"Adds Void settings UI.",authors:["Prism"],required:!0,settings:jn,_hideUserId(){return jn.store.hideUserId},_fixDialogFlash(){return jn.store.fixDialogFlash},renderTabs(e,t){return[r.createElement(Xa,{key:"void-tabs",jsx:e,TabButton:t}),r.createElement(ja,{key:"void-version"})]},renderPanels(e,t,o){return[r.createElement(qa,{key:"void-panels",jsx:e,activeTab:t,Wrapper:o})]},start(){if(P("void-global","[data-sonner-toast] [data-title]{font-weight:400}"),document.head)zt();else document.addEventListener("DOMContentLoaded",zt,{once:!0});cs()},patches:[{find:'DialogOverlay",()=>',all:!0,replacement:{match:/dark:border-border-l1 duration-200/,replace:'dark:border-border-l1 "+($self._fixDialogFlash()?"outline-none ":"")+"duration-200'}},{find:"pressed_cmd_settings",replacement:[{match:/(\i\.jsx)\)\((\i),\{icon:\i\.DatabaseIcon,.{0,80}tab:"data"\}\)/,replace:"$&,...$self.renderTabs($1,$2)"},{match:/"data"===(\i)&&\i\.user&&\(0,(\i\.jsx)\)\((\i),\{children:/,replace:"...$self.renderPanels($2,$1,$3),$&"},{match:/\i\.user&&\(0,\i\.jsx\)\("div",.{0,120}:\i\.userId\}\)/,replace:"!$self._hideUserId()&&$&"}]}]});var Ya=0,Ze=[],Ut=ft();function Yn(e,t){let o=t?.modalKey??`void-modal-${Ya++}`;return Ze.push({key:o,render:e}),Ut.notify(),o}function Kn(e){let t=Ze.findIndex((o)=>o.key===e);if(t!==-1)Ze.splice(t,1),Ut.notify()}function vs(){Ze.length=0,Ut.notify()}function ws(e){return new Promise((t)=>{let o=Yn(({onClose:i})=>{let s=(a)=>{t(a),i()};return r.createElement(Ie,null,r.createElement(ke,null,e.title),r.createElement(it,null,e.body),r.createElement(st,null,r.createElement(E,{variant:"secondary",size:"md",onClick:()=>s(!1)},e.cancelText??"Cancel"),r.createElement(E,{variant:e.danger?"danger":"primary",size:"md",onClick:()=>s(!0)},e.confirmText??"Confirm")))}),n=Ut.subscribe(()=>{if(!Ze.some((i)=>i.key===o))n(),t(!1)})})}function Ka({entry:e}){let t=q(()=>Kn(e.key),[e.key]);return r.createElement(ve,{open:!0,onOpenChange:(o)=>{if(!o)t()}},r.createElement(we,{"aria-describedby":void 0},e.render({onClose:t})))}function Is(){if(yt(Ut),!Ze.length)return null;return r.createElement(r.Fragment,null,Ze.map((e)=>r.createElement(Ka,{key:e.key,entry:e})))}var Zn=h({name:"ChatBarButtonAPI",description:"Adds buttons to the chat input bar.",authors:["Prism"],required:!0,hidden:!0,renderButtons(e){return re(rt,null,re(Gi,{iconOnly:e}),re(Is,null))},patches:[{find:"ImagineSelector,{iconOnlyTrigger",all:!0,replacement:[{match:/ModelModeSelect,\{iconOnlyTrigger:(\i)\}\)\}\),/,replace:"$&$self.renderButtons($1),"},{match:/paddingInlineEnd:\i\?void 0:(\i)\?/,replace:"paddingInlineEnd:$1?"}]}]});var Jn=h({name:"ContextMenuAPI",description:"Adds items to context menus.",authors:["Prism"],required:!0,hidden:!0,renderItems(e,t){return re(Ui,{location:e,...t})},patches:[{find:"handleIsolateClick,children:[i&&",all:!0,group:!0,replacement:[{match:/onSaveEdit:(\i)\}\)/,replace:"onSaveEdit:$1,id:arguments[0].id})"},{match:/onEditClick:(\i)\}\)/,replace:"onEditClick:$1,...arguments[0]})"},{match:/"Delete","Delete"\)\]\}\)/,replace:'$&,$self.renderItems("conversation",{conversationId:arguments[0].id})'}]},{find:'"CopyButton",()=>',all:!0,replacement:{match:/slice\(0,5\)\}\}\)\}\)\]\}\)/,replace:'$&,$self.renderItems("message",{response:arguments[0].response})'}},{find:'"AvatarDropdownMenu",()=>',all:!0,replacement:{match:/"Sign Out"\)\]\}\)/,replace:'$&,$self.renderItems("user")'}}]});var $o=h({name:"BackgroundThinking",description:"Lets Grok think in the background while you are away.",authors:[M.Prism],patches:[{find:'"bgThinkingDefaultOptinSet"',replacement:{match:/\.success\?(\i)\.data:null/,replace:".success?$1.data:{enabled:!0,maxConcurrentRequests:3}"}}]});var Za={SUBSCRIPTION_TIER_INVALID:"Free",SUBSCRIPTION_TIER_X_BASIC:"Basic",SUBSCRIPTION_TIER_X_PREMIUM:"Premium",SUBSCRIPTION_TIER_X_PREMIUM_PLUS:"Premium+",SUBSCRIPTION_TIER_GROK_PRO:"SuperGrok",SUBSCRIPTION_TIER_SUPER_GROK_PRO:"SuperGrok Pro"},Ja={"0":"Free","1":"X Premium","2":"X Premium+"};function Qa(e,t){if(e)return Za[e]??e;return Ja[t??"0"]??"Free"}function el(){let{open:e}=ln.useSidebar(),{user:t}=ro.useSession(),o=ao.useSubscriptionsStore((n)=>n.bestSubscription);if(!e||!t)return null;return r.createElement(p,{flexDirection:"column",justifyContent:"center",gap:"0",className:"min-w-0 overflow-hidden"},r.createElement(f,{as:"span",size:"sm",weight:"medium",className:"truncate"},t.givenName||t.email?.split("@")[0]||"User"),r.createElement(f,{as:"span",size:"xs",color:"secondary",className:"truncate"},Qa(o,t.sessionTierId)))}var Qn=h({name:"BetterSidebar",description:"Shows your name and plan in the sidebar footer.",authors:[M.Prism],renderUserInfo:N.wrap(el),patches:[{find:"AvatarDropdownMenu,{}),",replacement:{match:/AvatarDropdownMenu,\{\}\)/,replace:"$&,$self.renderUserInfo()"}}]});var er=h({name:"Cleaner",description:"Hides upgrade nags and upsell banners.",authors:[M.Prism],patches:[{find:'"user-dropdown.upgrade","Upgrade plan"',all:!0,replacement:{match:/\i(?:\|\|\i)+(?=\?null:.{0,160}"user-dropdown\.upgrade")/,replace:"true"}},{find:'"UpsellCard",()=>',all:!0,replacement:{match:/"UpsellCard",\(\)=>\i/,replace:'"UpsellCard",()=>()=>null'}},{find:'"UpsellSuperGrokSmall",()=>',all:!0,replacement:{match:/"UpsellSuperGrokSmall",\(\)=>\i/,replace:'"UpsellSuperGrokSmall",()=>()=>null'}},{find:"group/model-mode-select-upsell",replacement:{match:/(?<=useCheckSubscriptionOffer\)\(\);).{0,30}return null;/,replace:"return null;"}}]});var tr=h({name:"ConsoleJanitor",description:"Silences noisy warnings and info logs in the browser console.",authors:[M.Prism],patches:[{find:"x.ai/careers",replacement:{match:/console\.info\("[^"]{0,2000}"\)/,replace:"void 0"}},{find:"DialogDescriptionWarning",all:!0,replacement:{match:/console\.warn\(\i\)/,replace:"void 0"}}]});var tl=$e("DownloadIcon");function ol(e){return{id:e.responseId,sender:e.sender,message:e.message,query:e.query,createTime:e.createTime,model:e.requestMetadata?.model??e.model,...e.thinkingTrace&&{thinkingTrace:e.thinkingTrace},...e.webSearchResults?.length&&{webSearchResults:e.webSearchResults},...e.generatedImageUrls?.length&&{generatedImageUrls:e.generatedImageUrls},...e.fileAttachments?.length&&{fileAttachments:e.fileAttachments},...e.steps?.length&&{steps:e.steps}}}async function nl(e){let t=await io.useResponseStore.getState().loadInitialResponses(e,!0);if(!t?.length)return;let n=Nt.useConversationStore.getState().byId[e]?.title??"Untitled Chat";xo(`${bo(n,"chat")}.json`,JSON.stringify({conversationId:e,title:n,exportedAt:new Date().toISOString(),messages:t.map(ol)},null,2),"application/json")}function rl({conversationId:e}){return r.createElement(at,{onSelect:()=>nl(e)},r.createElement(tl,{size:16,className:"me-2"}),"Export")}var or=h({name:"ExportChat",description:"Export conversations as JSON from the right-click menu.",authors:[M.Prism],contextMenuItems:{conversation:{label:"Export",render:rl}}});var Ht=h({name:"FixChrome",description:"Fixes Chromium-specific performance issues like backdrop blur lag.",authors:[M.Prism],required:!0,patches:[{find:"bg-overlay backdrop-blur-[2px]",all:!0,replacement:{match:/backdrop-blur-\[2px\] /,replace:" "}}]});function il(e){let o=e.target.closest("[id^='response-']");if(!o)return;o.querySelector("[aria-label='Edit']")?.click()}var nr=h({name:"MessageClickActions",description:"Double-click your own messages to edit them.",authors:[M.Prism],eventListeners:[{event:"dblclick",handler:il}]});var ks=me({playOnHover:{type:3,description:"Play video thumbnails when hovered.",default:!0}}),rr=new WeakMap;function sl(e){rr.set(e,e.play().catch(()=>{}))}function al(e){let t=rr.get(e);if(rr.delete(e),t)t.then(()=>{e.pause(),e.currentTime=0});else e.pause(),e.currentTime=0}var ll=(e)=>{let t=e.currentTarget.querySelector("video");if(t)sl(t)},cl=(e)=>{let t=e.currentTarget.querySelector("video");if(t)al(t)},ir=h({name:"NoAutoplay",description:"Stops video thumbnails from autoplaying on the Imagine page.",authors:[M.Prism],settings:ks,_hoverProps(){if(!ks.store.playOnHover)return{};return{onMouseEnter:ll,onMouseLeave:cl}},patches:[{find:"group/media-post-masonry-card",group:!0,replacement:[{match:/muted:!0,autoPlay:!0/,replace:"muted:!0,autoPlay:!1"},{match:/onMouseOver:\i\?\(\)=>\i\(!0\):void 0,onMouseLeave:\i\?\(\)=>\i\(!1\):void 0/,replace:"$&,...$self._hoverProps()"}]}]});var sr=h({name:"NoTelemetry",description:"Disables Sentry, Mixpanel, and metric logging.",authors:[M.Prism],required:!0,patches:[{find:"ingest.us.sentry.io",replacement:{match:/dsn:"https:\/\/.{0,80}\.ingest\.us\.sentry\.io\/.{0,30}"/,replace:'dsn:""'}},{find:'"after-init"),(0,',replacement:{match:/function \i\(\)\{if\(Object\.prototype\.hasOwnProperty[\s\S]{0,450}setHasMixpanelInitialized\)\(!0\)\}\}\)\}/,replace:"function p(){}"}},{find:"sendBatchLogEvent",all:!0,replacement:[{match:/"sendBatchLogEvent",\i=>\{\i\(this\.address\+.{0,40},\i\)\}/,replace:'"sendBatchLogEvent",()=>{}'},{match:/"sendBatchLogExperimentExposure",\i=>\{\i\(this\.address\+.{0,50},\i\)\}/,replace:'"sendBatchLogExperimentExposure",()=>{}'},{match:/"\/api\/log_metric",\i\)/,replace:'"/api/log_metric",[])'}]}]});var ul="https://raw.githubusercontent.com/adryd325/oneko.js/c4ee66353b11a44e4a5b7e914a81f8d33111555e/oneko.js",dl="https://raw.githubusercontent.com/adryd325/oneko.js/14bab15a755d0e35cd4ae19c931d96d306f99f42/oneko.gif",ar=!1,lr=h({name:"Oneko",description:"Cat follows your mouse cursor.",authors:[M.adryd],cleanupSelectors:["#oneko"],start(){ar=!1,fe(ul).then((e)=>e.text()).then((e)=>e.replace("./oneko.gif",dl).replace("(isReducedMotion)","(false)")).then((e)=>{if(ar)return;let t=new Blob([e],{type:"text/javascript"}),o=document.createElement("script");o.src=URL.createObjectURL(t),document.head.appendChild(o),o.addEventListener("load",()=>{o.remove(),URL.revokeObjectURL(o.src)})})},stop(){ar=!0}});var pl=new D("RateLimitDisplay","#ef9f76"),Es=me({showMaxCount:{type:3,description:"Show the maximum count alongside remaining.",default:!0}}),Fs=$e("ClockIcon"),ye={remaining:-1,total:-1,windowSeconds:0,waitSeconds:null};function cr(e){return e!=null&&e>0?Math.ceil(e):null}function Go(e,t,o){return{remaining:e.remainingQueries,total:Math.floor(t/e.cost),windowSeconds:o,waitSeconds:cr(e.waitTimeSeconds)}}function Wt(e,t){let o=e.windowSizeSeconds,n=e.totalTokens??0;if(n>0){if(t==="fast"&&e.lowEffortRateLimits)return Go(e.lowEffortRateLimits,n,o);if(t==="expert"&&e.highEffortRateLimits)return Go(e.highEffortRateLimits,n,o);if(e.highEffortRateLimits)return Go(e.highEffortRateLimits,n,o);if(e.lowEffortRateLimits)return Go(e.lowEffortRateLimits,n,o);return{remaining:e.remainingTokens??0,total:n,windowSeconds:o,waitSeconds:cr(e.waitTimeSeconds)}}if(e.totalQueries>0)return{remaining:e.remainingQueries,total:e.totalQueries,windowSeconds:o,waitSeconds:cr(e.waitTimeSeconds)};return{...ye,windowSeconds:o}}function Ro(e,t){return un.rateLimitsApi.rateLimitsGetRateLimits({body:{modelName:e,requestKind:t}})}function bt(e,t){if(e.waitSeconds!=null&&e.waitSeconds>0)return ho(e.waitSeconds);if(e.total<0)return"...";if(e.total===0)return"∞";return t||!Es.store.showMaxCount?String(e.remaining):`${e.remaining}/${e.total}`}function fl({usage:e,iconOnly:t}){let o=Po(e.waitSeconds),n=o!=null&&o>0,i=n?{...e,waitSeconds:o}:e,s=e.windowSeconds>0?`Resets every ${$t(e.windowSeconds)}`:"",a=t?[bt(i),s].filter(Boolean).join(" · "):s||void 0;return r.createElement(dt,{icon:n?r.createElement(Fs,{size:18}):r.createElement(go,{size:18}),tooltip:a,className:n?"text-fg-danger":void 0,iconOnly:t},bt(i))}function ml({fast:e,expert:t,iconOnly:o}){let n=Po(e.waitSeconds),i=Po(t.waitSeconds),s=n!=null&&n>0,a=i!=null&&i>0,c=s||a,l=s?{...e,waitSeconds:n}:e,u=a?{...t,waitSeconds:i}:t,m=e.windowSeconds??t.windowSeconds,y=m>0?` · resets every ${$t(m)}`:"";return r.createElement(dt,{icon:c?r.createElement(Fs,{size:18}):r.createElement(go,{size:18}),tooltip:`Fast ${bt(l)} · Expert ${bt(u)}${y}`,className:c?"text-fg-danger":void 0,iconOnly:o},bt(l,!0),r.createElement(Ee,{orientation:"vertical",className:"mx-1 h-3 w-0.5"}),bt(u,!0))}function gl({iconOnly:e}){let t=Le.useChatPageStore((S)=>S.modelMode),o=Le.useChatPageStore((S)=>S.reasoningMode),n=Le.useChatPageStore((S)=>S.conversationId),i=Le.useChatPageStore((S)=>S.lastMessageId),s=Le.useChatPageStore((S)=>!!S.streamedMessageId),a=so.useModelsStore((S)=>S.modelByMode),[c,l]=x(ye),[u,m]=x(ye),[y,v]=x(ye);if(A(()=>{if(t==="auto"&&s)return;let S=pn.reasoningModeToRequestKind?.(o)??"DEFAULT",W=($)=>pl.error("Failed to fetch rate limits",$),k=!1;if(t==="auto"){let $=a?.fast?.modelId,j=a?.expert?.modelId;if(!$&&!j)return;let V=$===j,se=$??j;if(V&&se)Ro(se,S).then((g)=>{if(k)return;l(Wt(g,"fast")),m(Wt(g,"expert")),v(ye)}).catch(W);else Promise.all([$?Ro($,S):null,j?Ro(j,S):null]).then(([g,K])=>{if(k)return;l(g?Wt(g,"fast"):ye),m(K?Wt(K,"expert"):ye),v(ye)}).catch(W)}else{let $=a?.[t]?.modelId;if(!$)return;Ro($,S).then((j)=>{if(k)return;l(ye),m(ye),v(Wt(j,t))}).catch(W)}return()=>{k=!0}},[t,o,n,i,s,a]),t==="auto")return r.createElement(ml,{fast:c,expert:u,iconOnly:e});return r.createElement(fl,{usage:y,iconOnly:e})}var ur=h({name:"RateLimitDisplay",description:"Shows rate limit usage next to the chat input.",authors:[M.Prism],settings:Es,chatBarButton:{render:gl}});var yl=$e("StarsBackground"),dr=h({name:"Starry",description:"Always-on starry background animation.",authors:[M.Prism],_stars:N.wrap(()=>r.createElement(yl,{key:"void-starry",className:"fixed inset-0 z-0 pointer-events-none"})),patches:[{find:'"drop-container"',group:!0,replacement:[{match:/\(0,(\i)\.jsx\)(\("div",.{0,80}"drop-container")/,replace:"(0,$1.jsxs)$2"},{match:/"drop-container",children:(\(0,\i\.jsx\)\(\i,\{backend:\i,.{0,120}children:\i\}\)\}\))\}\)/,replace:'"drop-container",children:[$self._stars(),$1]})'}]}]});$o.preview=!0;Ht.chrome=!0;Ht.hidden=!window.chrome;var pr={[qn.name]:qn,[Zn.name]:Zn,[Jn.name]:Jn,[$o.name]:$o,[Qn.name]:Qn,[er.name]:er,[tr.name]:tr,[Wn.name]:Wn,[or.name]:or,[Ht.name]:Ht,[nr.name]:nr,[ir.name]:ir,[sr.name]:sr,[lr.name]:lr,[ur.name]:ur,[dr.name]:dr};var fr;((a)=>{a[a.MESSAGE=0]="MESSAGE";a[a.SUCCESS=1]="SUCCESS";a[a.ERROR=2]="ERROR";a[a.INFO=3]="INFO";a[a.WARNING=4]="WARNING";a[a.LOADING=5]="LOADING"})(fr||={});var hl=["message","success","error","info","warning","loading"];function Ns(e,t=0,o){let n=hl[t];dn.toast[n](e,o)}var mr={};zo(mr,{zustandCreate:()=>ta,useState:()=>x,useRef:()=>ae,useReducer:()=>Vt,useReducedMotion:()=>Ot,useMemo:()=>X,useLayoutEffect:()=>an,useEffect:()=>A,useCallback:()=>q,toast:()=>Di,onceReady:()=>Zt,i18n:()=>oa,createElement:()=>re,WorkspaceStore:()=>ai,WorkspaceConnectorsStore:()=>yi,WorkspaceCollectionsStore:()=>gi,UpsellStore:()=>oi,TourGuideStore:()=>ii,TooltipTrigger:()=>Ue,TooltipContent:()=>He,Tooltip:()=>_e,Toaster:()=>dn,TextToSpeechStore:()=>pi,TasksStore:()=>fi,TabsManagerStore:()=>Zr,Switch:()=>Y,SubscriptionsStore:()=>ao,SourcesSelectorStore:()=>ri,SidebarComponents:()=>ln,ShareStore:()=>ni,SettingsTitle:()=>lt,SettingsStore:()=>Xr,SettingsRow:()=>pe,SettingsDialogStore:()=>qr,SettingsDescription:()=>ct,SessionStore:()=>ro,Separator:()=>Ee,SelectValue:()=>de,SelectTrigger:()=>ce,SelectItem:()=>F,SelectContent:()=>ue,Select:()=>le,RoutingStore:()=>Kr,ResponseStore:()=>io,ReportStore:()=>di,ReasoningModeUtils:()=>pn,ReactDOM:()=>Ci,React:()=>r,PersonalityStore:()=>ui,NotificationsStore:()=>Jr,NextRouter:()=>na,MotionDiv:()=>fo,ModesStore:()=>ei,ModelsStore:()=>so,MentionMenuStore:()=>li,MediaStore:()=>Qr,LazyComponent:()=>T,Input:()=>Q,Fragment:()=>rt,FileStore:()=>Yr,FeatureStore:()=>U,DropdownMenuItem:()=>at,DialogTitle:()=>ke,DialogHeader:()=>Ie,DialogFooter:()=>st,DialogDescription:()=>it,DialogContent:()=>we,DialogClose:()=>po,Dialog:()=>ve,DevModelsStore:()=>si,ConversationStore:()=>Nt,CommandMenuStore:()=>ti,ClassNames:()=>We,ChatPageStore:()=>Le,Card:()=>uo,ButtonWithTooltip:()=>Re,Button:()=>E,AssetStore:()=>ci,ArtifactStore:()=>mi,ApiClients:()=>un,AnimatePresence:()=>cn});var gr=new D("TurbopackPatcher","#e78284"),Bs=500,Sl=0.4,xl=15000,bl=15000,Cl=5000;function Pl(){if(!R.some((n)=>!n.all))return;let t=Et(()=>{if(!R.some((n)=>!n.all))t(),clearTimeout(o)}),o=setTimeout(()=>{t(),kr()},Cl)}function Tl(){let e=()=>Object.values(L).filter((s)=>!s.started&&B(s.name)&&(s.startAt??"Init")==="TurbopackReady");if(!e().length)return;let t=null,n=Et(()=>{if(t)clearTimeout(t);t=setTimeout(()=>{t=null,eo();for(let s of e())Te(s,!0);if(!e().length)n(),clearTimeout(i),gr.info("All previously failed plugins started after late module load")},200)}),i=setTimeout(()=>{if(n(),t)clearTimeout(t);eo();let s=e();for(let c of s)Te(c,!0);let a=e();if(a.length)gr.warn(`${a.length} plugin(s) still failed after retry window: ${a.map((c)=>c.name).join(", ")}`)},bl)}function Ml(){let e=Oe();if(!e)return!1;return z().size/e.size>=Sl}function Dl(){let e=null,t=null,o=null,n=null,i=!1,s=()=>{if(i)return;if(i=!0,e)clearTimeout(e);if(t)clearTimeout(t);if(o)o();if(n)n();eo(),wr(),Ko(),Rt("TurbopackReady"),gr.info(`${z().size} modules loaded, ready`),Tl(),Pl(),ts()},a=()=>{if(i)return;if(e)clearTimeout(e);if(Ml()){s();return}e=setTimeout(a,Bs)};n=be(_.byProps("useRoutingStore","formatUrl"),()=>{n=null,a()}),o=Et(()=>{if(!i&&!n&&e)clearTimeout(e),e=setTimeout(a,Bs)}),t=setTimeout(s,xl)}function yr(){Fr();for(let e in pr)Io(pr[e]);if(Ji(),Rt("Init"),document.readyState==="loading")document.addEventListener("DOMContentLoaded",()=>Rt("DOMContentLoaded"),{once:!0});else Rt("DOMContentLoaded");Dl()}var Vs=typeof unsafeWindow<"u"?unsafeWindow:window;if(!Vs.Void)Object.defineProperty(Vs,"Void",{value:hr,writable:!1,configurable:!0}),vo().then(()=>yr());})();