Void

A modification for grok.com

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.

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

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.5
// @description  A modification for grok.com
// @author       Prism & Void Contributors
// @environment  Production
// @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
// @supportURL   https://discord.gg/4Rx3qUCR5Y
// ==/UserScript==

(()=>{var ya=Object.defineProperty;var ha=(e)=>e;function Sa(e,t){this[e]=ha.bind(null,t)}var Qo=(e,t)=>{for(var o in t)ya(e,o,{get:t[o],enumerable:!0,configurable:!0,set:Sa.bind(t,o)})};var Vr={};Qo(Vr,{waitFor:()=>U,syncLazyModules:()=>nt,subscribe:()=>Ct,stopPlugin:()=>$o,startPlugin:()=>Te,sleep:()=>Ss,showToast:()=>qo,showNotice:()=>Go,search:()=>Na,sanitizeFilename:()=>ko,requireModule:()=>fn,removeChatBarButton:()=>Bo,registerStyle:()=>T,registerPlugin:()=>Ro,proxyLazy:()=>xe,plugins:()=>D,patches:()=>_,patchStats:()=>Ce,patchResults:()=>no,patchReport:()=>qr,openModal:()=>mr,onlyOnce:()=>xs,onceReady:()=>oo,migrateSettingsToPlugin:()=>Fs,migratePluginSettings:()=>ks,migratePluginSetting:()=>Es,mergeDefaults:()=>qe,matchesPattern:()=>Et,matchesAllPatterns:()=>Me,mapMangledModuleLazy:()=>Fa,mapMangledModule:()=>ui,mapMangledCssClasses:()=>ci,makeLazy:()=>wt,isZustandStore:()=>pn,isTruthy:()=>ys,isPluginEnabled:()=>V,isObject:()=>St,isNonNullish:()=>hs,isBlacklisted:()=>J,initSettings:()=>Oo,init:()=>Br,importModule:()=>Ba,getTurbopackHelpers:()=>rt,getRuntimeModuleCache:()=>Hr,getRuntimeFactoryRegistry:()=>$e,getModuleCache:()=>N,getAllStores:()=>La,formatDuration:()=>Ut,formatCountdown:()=>Lo,findStoreLazy:()=>wa,findStore:()=>ai,findModuleId:()=>pi,findModuleFactory:()=>dn,findLazy:()=>un,findExportedComponentLazy:()=>Da,findExportedComponent:()=>x,findCssClassesLazy:()=>Ia,findCssClasses:()=>li,findComponentByCodeLazy:()=>va,findComponentByCode:()=>ii,findByPropsLazy:()=>u,findByProps:()=>co,findByCodeLazy:()=>Ma,findByCode:()=>ri,findBulk:()=>Ea,findAll:()=>Ta,find:()=>st,filters:()=>I,fetchExternal:()=>ge,extractAndLoadChunksLazy:()=>Aa,extractAndLoadChunks:()=>mi,errorMessage:()=>Io,enableStyle:()=>ze,dispatch:()=>Eo,disableStyle:()=>ne,definePluginSettings:()=>te,definePlugin:()=>S,debounce:()=>Cs,copyToClipboard:()=>wo,confirm:()=>pa,common:()=>br,closeNotice:()=>Xn,closeModal:()=>fr,closeAllModals:()=>ca,classes:()=>K,classNameFactory:()=>k,clamp:()=>bs,addPatch:()=>jn,addChatBarButton:()=>No,ToastType:()=>Xo,StartAt:()=>lt,SettingsStore:()=>X,Settings:()=>P,PlainSettings:()=>Ht,OptionType:()=>re,NoticeType:()=>zo,Logger:()=>b,DefaultChunkLoadRegex:()=>mn,ChunkPathRegex:()=>di});var gn={};Qo(gn,{WorkspaceStore:()=>Hi,WorkspaceConnectorsStore:()=>Ui,WorkspaceCollectionsStore:()=>_i,UpsellStore:()=>Gi,TourGuideStore:()=>zi,TextToSpeechStore:()=>Ri,TasksStore:()=>$i,TabsManagerStore:()=>Oi,SuggestionStore:()=>Vi,SubscriptionsStore:()=>mo,SourcesSelectorStore:()=>Bi,ShopStore:()=>Ni,ShareStore:()=>Ai,SettingsStore:()=>Fi,SettingsDialogStore:()=>Ei,SessionStore:()=>uo,RoutingStore:()=>ki,ResponseStore:()=>Ii,ReportStore:()=>Li,PersonalityStore:()=>wi,NotificationsStore:()=>Di,ModesStore:()=>vi,ModelsStore:()=>po,MentionMenuStore:()=>Mi,MediaStore:()=>Ti,ImageEditorStore:()=>Pi,HighlightsStore:()=>bi,FilesPageStore:()=>at,FileStore:()=>Ci,FeatureStore:()=>H,DictationStore:()=>xi,DevModelsStore:()=>Si,ConversationStore:()=>Vt,CommandMenuStore:()=>hi,CodePageStore:()=>yi,ChatPageStore:()=>ce,AssetStore:()=>gi,ArtifactStore:()=>fi});var Or=["arguments","caller","prototype"],et=Symbol.for("void.lazy.get"),Jo=Symbol.for("void.lazy.cached"),Qt={};for(let e of["apply","construct","defineProperty","deleteProperty","getPrototypeOf","has","isExtensible","preventExtensions","set","setPrototypeOf"])Qt[e]=(t,...o)=>Reflect[e](t[et]?.()??t,...o);Qt.ownKeys=(e)=>{let t=e[et]?.()??e,o=Reflect.ownKeys(t);for(let n of Or)if(!o.includes(n))o.push(n);return o};Qt.getOwnPropertyDescriptor=(e,t)=>{if(typeof t==="string"&&Or.includes(t))return Reflect.getOwnPropertyDescriptor(e,t);let o=e[et]?.()??e,n=Reflect.getOwnPropertyDescriptor(o,t);if(n)Object.defineProperty(e,t,n);return n};function wt(e){let t,o=!1;return()=>{if(!o){if(t=e(),t!=null)o=!0}return t}}function xe(e){let t=wt(e),o=Object.assign(()=>{},{[Jo]:void 0,[et](){let n=t();return o[Jo]=n,n}});return new Proxy(o,{...Qt,get(n,i,s){if(i===Jo||i===et)return Reflect.get(n,i,s);let a=n[et]();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 en=null;function $r(e){en=e}function h(e,t){let o=null,n=(i)=>{if(o??=t(),!o||!en)return null;return en(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 xa=typeof window<"u",Lt={reset:"\x1B[0m",bold:"\x1B[1m",green:"\x1B[32m",red:"\x1B[31m",yellow:"\x1B[33m",magenta:"\x1B[35m",gray:"\x1B[90m"};class b{name;color;constructor(e,t="white"){this.name=e;this.color=t}_log(e,t){if(xa){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:Lt.red,warn:Lt.yellow}[e]??Lt.green,i=`${Lt.bold}${n}[${this.name}]${Lt.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 It(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 Rr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kt(e,t,o){return`${e} ${e===1?t:o??t+"s"}`}function Et(e,t){if(typeof t==="string")return e.includes(t);return t.lastIndex=0,t.test(e)}function Me(e,t){return t.every((o)=>Et(e,o))}var Ft=Symbol("Void.originalFactory"),At=Symbol("Void.patched"),Jt=Symbol("Void.patchedBy"),Nt=Symbol("Void.patchedCode");var be=new b("TurbopackPatcher","#e78284"),eo=typeof unsafeWindow<"u"?unsafeWindow:window,on=2147483646,Ca=Symbol.for("motionComponentSymbol"),ba=0,zr=(e,t,o)=>{let n=`__void_eval_${ba++}`,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=eo[n];if(delete eo[n],!a)throw Error("Factory compilation failed (CSP?)");return a},to=new Set,_=[],Oe=new Map,tt=new Map,ot=null,G=null,O=null,Bt=null,ln,oo=new Promise((e)=>ln=e);var no=[],Ce={applied:0,noEffect:0,errors:0,patchedModules:new Set};function N(){return Oe}function Hr(){return G}var Gr=0;function nt(){if(!G)return;let e=0;for(let t in G)e++;if(e===Gr)return;for(let t in G){let o=G[t];if(o?.exports==null)continue;let n=Number(t);if(!Oe.has(n))io(o.exports,n)}Gr=e}function $e(){return O}function rt(){return Bt}function Wr(e,t){tt.set(e,t)}function jr(e){tt.delete(e)}var nn=new Set;function ro(e){return nn.add(e),()=>nn.delete(e)}var rn=new WeakSet;function sn(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[Ca])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 Xr(){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 Oe){if(sn(t)){if(t!=null&&(typeof t==="object"||typeof t==="function"))rn.add(t);continue}if(typeof t!=="object")continue;for(let o in t)try{let n=t[o];if(sn(n)&&n!=null&&(typeof n==="object"||typeof n==="function"))rn.add(n)}catch{}}}finally{console.warn=e}}function J(e){if(e==null)return!1;let t=typeof e;if(t!=="object"&&t!=="function")return!1;if(rn.has(e))return!0;return sn(e)}function io(e,t){if(e==null)return;if(Oe.get(t)===e)return;if(Oe.set(t,e),tt.size)for(let[o,n]of[...tt])try{if(!tt.has(o))continue;if(o(e))tt.delete(o),n(e,t)}catch(i){be.error("WaitFor listener error:",i)}for(let o of[...nn])try{o()}catch{}}function Pa(e,t){if(!_.length)return t;let o=String(t),n=o,i=t,s=new Set;for(let a=0;a<_.length;a++){let c=_[a];if(c.predicate&&!c.predicate())continue;if(!(Array.isArray(c.find)?Me(o,c.find):Et(o,c.find)))continue;let p=Array.isArray(c.replacement)?c.replacement:[c.replacement],y=n,w=i,f=!0,L=0,$={plugin:c.plugin,find:String(c.find),moduleId:e,replacements:[]};for(let R of p){if(R.predicate&&!R.predicate())continue;let Be=n,Se=i;try{let{match:z}=R,d=performance.now(),Q=n.replace(z,R.replace),Ve=performance.now()-d;if(Q===n){if(Ce.noEffect++,$.replacements.push({match:String(z),status:"noEffect"}),!c.noWarn&&!R.noWarn)be.error(`Patch by ${c.plugin} had no effect: ${String(z)}`);if(c.group){f=!1;break}continue}n=Q,i=zr(n),i[Ft]=t,i[At]=!0,i[Nt]=n,s.add(c.plugin),Ce.applied++,L++,Ce.patchedModules.add(e),$.replacements.push({match:String(z),status:"applied"})}catch(z){if(Ce.errors++,$.replacements.push({match:String(R.match),status:"error"}),be.error(`Error in patch by ${c.plugin} on module ${e}:`,z),n=Be,i=Se,c.group){n=y,i=w,s.delete(c.plugin);break}}}if(no.push($),c.group&&!f){if(Ce.applied-=L,n=y,i=w,s.delete(c.plugin),!c.noWarn)be.warn(`Group patch by ${c.plugin} failed, reverting`);continue}if(!c.all)_.splice(a--,1)}if(s.size){let a=[...s].join(", ");i=zr(n,`// Turbopack Module ${e} - Patched by ${a}`,`//# sourceURL=file:///TurbopackModule${e}`),i[Ft]=t,i[At]=!0,i[Nt]=n,i[Jt]=[...s]}return i}function an(e,t){let o=Pa(e,t),n=o[Ft]??t,i=function(s,a,c){if(!Bt)Bt=s;if(!G&&s.c){G=s.c,Kr(G);for(let l of to)try{l()}catch{}to.clear()}if(!O&&s.M)O=s.M;try{o.call(this,s,a,c)}catch(l){if(o===t)throw l;be.error(`Patched module ${a?.id??e} errored, using original:`,l);try{n.call(this,s,a,c)}catch(p){throw be.error(`Original module ${a?.id??e} also errored:`,p),p}}try{let l=a?.id??e;if(a?.exports!=null)io(a.exports,l)}catch{}};if(i.toString=()=>String(t),i[Ft]=n,o[At])i[At]=!0,i[Jt]=o[Jt],i[Nt]=o[Nt];return i}function tn(...e){let t=e[0];if(!Array.isArray(t))return ot(...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=an(s,a);n.set(a,l),o[i]=l}}return ot.call(null,o??t)}function qr(){return{stats:{...Ce,patchedModules:[...Ce.patchedModules]},results:no,orphaned:_.filter((e)=>!e.all).map((e)=>({plugin:e.plugin,find:String(e.find)}))}}function Yr(){let e=_.filter((t)=>!t.all);if(e.length)be.warn(`${e.length} patch(es) found no module:`,e.map((t)=>`${t.plugin}: ${String(t.find)}`))}function Kr(e){let t=0;for(let o in e){let n=e[o];if(n?.exports==null)continue;let i=Number(o);if(Oe.get(i)!==n.exports)io(n.exports,i),t++}}function so(){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(Oe.get(n)!==o.exports)io(o.exports,n),e++}if(e>0)be.info(`Rescan found ${e} new/updated modules`)}function _r(){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{ot(["void-factory-probe",on,()=>{}])}finally{Map.prototype.set=e}return t?.delete(on),t}function Ur(e){let t=on-1;e.set(t,(o)=>{if(!Bt)Bt=o;if(!G&&o.c){G=o.c,Kr(G);for(let n of to)try{n()}catch{}to.clear()}if(!O&&o.M)O=o.M}),ot(["void-cache-probe",{otherChunks:[],runtimeModuleIds:[t]}]),Promise.resolve().then(()=>e.delete(t))}function Zr(){let e=eo.TURBOPACK;if(e&&!Array.isArray(e)&&typeof e.push==="function"){if(ot=e.push.bind(e),e.push=(...n)=>tn(...n),O=_r(),O)for(let[n,i]of O)O.set(n,an(n,i));if(!G&&O)Ur(O);return}let t=[];if(Array.isArray(e))t.push(...e);let o=e??[];if(Object.defineProperty(eo,"TURBOPACK",{configurable:!0,get(){return o},set(n){if(n&&!Array.isArray(n)&&typeof n.push==="function"){let i=n;ot=i.push.bind(i),i.push=(...s)=>tn(...s),o=i;for(let s of t)try{tn(s)}catch(a){be.error("Failed to process queued chunk:",a)}if(t.length=0,O=_r(),O)for(let[s,a]of O)O.set(s,an(s,a));if(!G&&O)Ur(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 b("TurbopackFinder","#a6d189"),cn=!1;function it(e){if(cn)return e();cn=!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,cn=!1}}var Qr=new WeakMap,le=new Map;function lo(e){let t=Qr.get(e);if(t===void 0)t=String(e),Qr.set(e,t);return t}function ni(e){if(e.startsWith("use"))return e;return e.endsWith("Store")?`use${e}`:`use${e}Store`}function pn(e){return typeof e==="function"&&typeof e.getState==="function"&&typeof e.setState==="function"&&typeof e.subscribe==="function"}var I={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 Me(lo(t),e)}},byDisplayName:(e)=>{return(t)=>t?.displayName===e||t?.render?.displayName===e},byStoreName:(e)=>{let t=ni(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=I.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 Re(e,t=!1,o=!1){return it(()=>{let n=Jr(e,t,o);if(!t&&n)return n;if(t&&n.length)return n;let i=N().size;if(nt(),N().size===i)return n;return Jr(e,t,o)})}function Jr(e,t,o){let n=[],i=t?new Set:null,s=N();for(let[,a]of s){if(a==null||J(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||J(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 st(e){return Re(e)}function Ta(e){return Re(e,!0)}function un(e){let t=Re(e);if(t)return t;return xe(()=>Re(e))}function co(...e){return st(I.byProps(...e))}function u(...e){return xe(()=>co(...e))}function ri(...e){return st(I.byCode(...e))}function Ma(...e){return xe(()=>ri(...e))}function ii(...e){return st(I.componentByCode(...e))}function va(...e){return h("findComponentByCode",()=>ii(...e))}function x(...e){return it(()=>{let t=ei(e);if(t)return t;let o=N().size;if(nt(),N().size===o)return null;return ei(e)})}function ei(e){let t=N();for(let[,o]of t){if(o==null||typeof o!=="object"||J(o))continue;for(let n of e)try{let i=o[n];if(i==null||J(i))continue;if(typeof i==="function"||i?.$$typeof)return i}catch{}}return null}function Da(...e){return h(e[0],()=>x(...e))}function ti(){for(let[,e]of N()){if(e==null||typeof e!=="object"||J(e))continue;for(let t in e)try{if(le.has(t))continue;let o=e[t];if(pn(o))le.set(t,o)}catch{}}}function si(){it(()=>{ti();let e=N().size;if(nt(),N().size!==e)ti()})}function ai(e){let t=ni(e);if(le.has(t))return le.get(t);if(!le.size)si();if(le.has(t))return le.get(t);let o=st(I.byStoreName(e)),n=o?.[t]??o;if(n&&pn(n))le.set(t,n);return n}function wa(e){return xe(()=>ai(e))}function La(){if(!le.size)si();return new Map(le)}function li(...e){let t=Re(I.byClassName(...e),!1,!0);if(!t)return{};return ci(t,e)}function Ia(...e){return xe(()=>li(...e))}function ka(e){return new RegExp(`(?:\\b|_)${Rr(e)}(?:\\b|_)`)}function ci(e,t){let o={};for(let n of t){let i=ka(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 Ea(...e){let{length:t}=e;if(t<2)return oe.warn("findBulk called with fewer than 2 filters, use find instead."),t===1?[st(e[0])]:[];return it(()=>{let o=[...e],n=Array(t).fill(null),i=0,s=N();e:for(let[,a]of s){if(a==null||J(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||J(l))continue;for(let p=0;p<t;p++){let y=o[p];if(!y)continue;if(y(l)){if(n[p]=l,o[p]=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 dn(...e){let t=$e();if(!t)return null;for(let[o,n]of t)if(Me(lo(n),e))return[o,n];return null}function pi(...e){return dn(...e)?.[0]??null}function ui(e,t){let o={},n=pi(...e);if(n==null)return o;let i=fn(n);if(i==null)return o;return it(()=>{let s=Object.entries(t),a=0;e:for(let c in i)try{let l=i[c];for(let p=0;p<s.length;p++){let[y,w]=s[p];if(y in o)continue;if(w(l)){if(o[y]=l,++a===s.length)break e;break}}}catch{}return o})}function Fa(e,t){return xe(()=>ui(e,t))}var ao="[A-Za-z_$][\\w$]*",mn=new RegExp(`Promise\\.all\\(\\[([^\\]]+)\\]\\.map\\(${ao}=>${ao}\\.l\\(${ao}\\)\\)\\)\\.then\\(\\(\\)=>${ao}\\((\\d+)\\)\\)`),di=/"(static\/chunks\/[^"]+)"/g;async function mi(e,t=mn){let o=dn(...e);if(!o)return oe.warn("extractAndLoadChunks: no module factory found for:",e),!1;let n=lo(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=rt();if(!a)return oe.warn("extractAndLoadChunks: Turbopack helpers not available."),!1;if(i){let l=Array.from(i.matchAll(di),(p)=>p[1]);if(l.length)try{await Promise.all(l.map((p)=>a.l(p)))}catch(p){return oe.warn("extractAndLoadChunks: chunk loading failed:",p),!1}}let c=Number(s);try{fn(c)}catch(l){return oe.warn("extractAndLoadChunks: entry point module failed:",l),!1}return!0}function Aa(e,t=mn){return wt(()=>mi(e,t))}function Na(...e){let t={},o=$e();if(!o)return t;for(let[n,i]of o)if(Me(lo(i),e))t[n]=i;return t}function fn(e){let t=N();if(t.has(e))return t.get(e);let o=rt();if(!o)return null;try{return o.i(e)}catch{return null}}function Ba(e){let t=rt();if(!t)return Promise.reject(Error("Turbopack helpers not available"));return t.A(e)}function oi(e,t){return it(()=>{if(J(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&&!J(n)&&t(n))return n}catch{}}catch{}return null})}function U(e,t,o=0){let n=Re(e);if(n)return t(n,-1),()=>{};let i=(p)=>oi(p,e)!=null,s=(p,y)=>{try{let w=oi(p,e);if(w)t(w,y)}catch(w){oe.error("waitFor callback error:",w)}},a=null;Wr(i,(p,y)=>{if(a)clearTimeout(a);s(p,y)});let l=()=>{if(a)clearTimeout(a);jr(i)};if(o>0)a=setTimeout(()=>{if(a=null,N().size>0&&!Re(e))oe.warn(`waitFor timed out after ${o}ms:`,e),l()},o);return l}var fi=u("useArtifactStore","useArtifactEdits"),gi=u("useAssetStore"),ce=u("useChatPageStore","getLatestThreadMessageId"),yi=u("useCodePageStore"),hi=u("useCommandMenuStore","createSelection"),Vt=u("useConversationStore","createOptimisticConversation"),Si=u("useDevModelsStore","DRAFT_MODEL_ID"),xi=u("useDictationStore"),H=u("useFeatureStore"),at=u("useFilesPageStore","useAssetsList"),Ci=u("useFileStore"),bi=u("useHighlightsStore"),Pi=u("useImageEditorStore"),Ti=u("useMediaStore","useImagineModeStore"),Mi=u("useMentionMenuStore"),po=u("useModelsStore"),vi=u("useModesStore"),Di=u("useNotificationsStore","useNotificationsStoreInit"),wi=u("usePersonalityStore","DEFAULT_CUSTOM_PERSONALITY"),Li=u("useReportStore"),Ii=u("useResponseStore","createOptimisticResponse"),ki=u("useRoutingStore","formatUrl"),uo=u("useSession","SessionStoreProvider"),Ei=u("useSettingsDialogStore"),Fi=u("useSettingsStore","TOOL_NAMES"),Ai=u("useShareStore"),Ni=u("useShopStore"),Bi=u("useSourcesSelectorStore"),mo=u("useSubscriptionsStore"),Vi=u("useSuggestionStore","useSuggestionStoreInit"),Oi=u("useTabsManagerStore"),$i=u("useTasksStore"),Ri=u("useTextToSpeechStore"),zi=u("useTourGuideStore","useTourGuideTooltip"),Gi=u("useUpsellStore","useShouldShowUpgradeButton"),_i=u("useWorkspaceCollectionsStore","useWorkspaceActiveCollectionIds"),Ui=u("useWorkspaceConnectorsStore","useWorkspaceActiveConnectorIds"),Hi=u("useWorkspaceStore","useWorkspacesList");var Va=new b("Styles","#a6d189"),ji=new Map,fo=new Map,Ot=null,go=[];function yn(){if(Ot)return Ot;if(!document.head)return null;return Ot=document.createElement("void-styles"),document.head.appendChild(Ot),Ot}function Wi(){let e=yn();if(!e)return;for(let[t,o]of go)hn(e,t,o);go=[]}function hn(e,t,o){let n=fo.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),fo.set(t,i)}function T(e,t){ji.set(e,t);let o=yn();if(o)hn(o,e,t);else if(go.push([e,t]),go.length===1)if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",Wi,{once:!0});else Wi()}function ze(e){let t=fo.get(e);if(t){if(t.disabled)return t.disabled=!1,!0;return!1}let o=ji.get(e);if(!o)return Va.warn(`Style "${e}" not registered.`),!1;let n=yn();if(!n)return!1;return hn(n,e,o),!0}function ne(e){let t=fo.get(e);if(!t)return!1;return t.disabled=!0,!0}var k=(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 K(...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 Oa(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=Oa(e.replace,t)}function qi(e){if(Array.isArray(e.find))e.find=e.find.map((t)=>Sn(t));else e.find=Sn(e.find)}function S(e){return e}var lt;((n)=>{n.Init="Init";n.DOMContentLoaded="DOMContentLoaded";n.TurbopackReady="TurbopackReady"})(lt||={});var re;((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"})(re||={});var r,M,W,xn,A,pe,$t,q,Cn,bn,Pn,Tn,Rt,ie,zt;U(I.byProps("useReducedMotion"),(e)=>{({useReducedMotion:zt}=e)});U(I.byProps("useState","createElement"),(e)=>{let t=e;r=t,{useState:M,useEffect:W,useLayoutEffect:xn,useMemo:A,useRef:pe,useReducer:$t,useCallback:q,useContext:Cn,useId:bn,useTransition:Pn,useDeferredValue:Tn,useSyncExternalStore:Rt,createElement:ie}=t,$r(t.createElement)});var ve=Symbol.for("react.fragment"),Yi=u("createPortal","flushSync");var Ki=null;U(I.byProps("Button","ButtonWithTooltipOptimized"),(e)=>{Ki=e});var Zi=(e)=>h(e,()=>Ki?.[e]??x(e)),E=Zi("Button"),Ge=Zi("ButtonWithTooltip"),yo=h("Card",()=>x("Card")),Qi=null;U(I.byProps("Dialog","DialogContent","DialogHeader"),(e)=>{Qi=e});var _e=(e)=>h(e,()=>Qi?.[e]??x(e)),De=_e("Dialog"),we=_e("DialogContent"),Le=_e("DialogHeader"),Ie=_e("DialogTitle"),ct=_e("DialogDescription"),pt=_e("DialogFooter"),ho=_e("DialogClose"),Ji=null;U(I.byProps("DropdownMenu","DropdownMenuContent","DropdownMenuTrigger"),(e)=>{Ji=e});var se=(e)=>h(e,()=>Ji?.[e]??x(e)),$a=se("DropdownMenu"),Ra=se("DropdownMenuTrigger"),za=se("DropdownMenuContent"),ut=se("DropdownMenuItem"),Ga=se("DropdownMenuCheckboxItem"),_a=se("DropdownMenuRadioGroup"),Ua=se("DropdownMenuRadioItem"),Ha=se("DropdownMenuSeparator"),Wa=se("DropdownMenuSub"),ja=se("DropdownMenuSubTrigger"),Xa=se("DropdownMenuSubContent"),es=null;U(I.byProps("ContextMenu","ContextMenuContent","ContextMenuTrigger"),(e)=>{es=e});var ke=(e)=>h(e,()=>es?.[e]??x(e)),qa=ke("ContextMenu"),Ya=ke("ContextMenuTrigger"),Ka=ke("ContextMenuContent"),Za=ke("ContextMenuItem"),Qa=ke("ContextMenuSeparator"),Ja=ke("ContextMenuSub"),el=ke("ContextMenuSubTrigger"),tl=ke("ContextMenuSubContent"),ee=h("Input",()=>x("Input")),So=h("MotionDiv",()=>co("motion")?.motion?.div),ue=h("Select",()=>x("Select")),de=h("SelectTrigger",()=>x("SelectTrigger")),me=h("SelectContent",()=>x("SelectContent")),B=h("SelectItem",()=>x("SelectItem")),fe=h("SelectValue",()=>x("SelectValue")),Ee=h("Separator",()=>x("Separator")),ts=h("Skeleton",()=>x("Skeleton")),xo=h("Slider",()=>x("Slider")),dt=h("SettingsRow",()=>x("SettingsRow")),mt=h("SettingsTitle",()=>x("SettingsTitle")),ft=h("SettingsDescription",()=>x("SettingsDescription")),Y=h("Switch",()=>x("Switch")),Ue=h("Tooltip",()=>x("Tooltip")),He=h("TooltipTrigger",()=>x("TooltipTrigger")),We=h("TooltipContent",()=>x("TooltipContent")),{toast:os}=u("toast","Toaster"),ol=h("Textarea",()=>x("Textarea")),nl=h("Checkbox",()=>x("Checkbox")),rl=h("Spinner",()=>x("Spinner")),il=h("Avatar",()=>x("Avatar")),ns=null;U(I.byProps("Popover","PopoverContent","PopoverTrigger"),(e)=>{ns=e});var Co=(e)=>h(e,()=>ns?.[e]??x(e)),sl=Co("Popover"),al=Co("PopoverTrigger"),ll=Co("PopoverContent"),cl=Co("PopoverArrow"),rs=null;U(I.byProps("Tabs","TabsList","TabsTrigger","TabsContent"),(e)=>{rs=e});var bo=(e)=>h(e,()=>rs?.[e]??x(e)),pl=bo("Tabs"),ul=bo("TabsList"),dl=bo("TabsTrigger"),ml=bo("TabsContent"),is=null;U(I.byProps("Accordion","AccordionContent","AccordionItem"),(e)=>{is=e});var Po=(e)=>h(e,()=>is?.[e]??x(e)),fl=Po("Accordion"),gl=Po("AccordionItem"),yl=Po("AccordionTrigger"),hl=Po("AccordionContent"),ss=null;U(I.byProps("Command","CommandInput","CommandList","CommandItem"),(e)=>{ss=e});var gt=(e)=>h(e,()=>ss?.[e]??x(e)),Sl=gt("Command"),xl=gt("CommandInput"),Cl=gt("CommandList"),bl=gt("CommandItem"),Pl=gt("CommandGroup"),Tl=gt("CommandEmpty"),Ml=h("ResponsiveDialog",()=>x("ResponsiveDialog")),Mn=u("Sidebar","SidebarContent","SidebarProvider"),vn=h("AnimatePresence",()=>x("AnimatePresence"));var Gt=u("chatApi","modelsApi"),Dn=u("Toaster","toast"),je=u("cn","middleTruncate"),wn=u("reasoningModeToRequestKind","reasoningModeToDeepsearchPreset"),vl=u("create","useStore"),Dl=u("useTranslation"),wl=u("getEnv","useEnvironment"),Ll=u("getCachedAssetUrl","getAssetUrl"),Il=u("downloadImage"),Ln=u("downloadBlob","downloadUri"),kl=u("useRateLimits"),El=u("useRouter","usePathname"),In=u("useQuery"),Fl=u("copyAndToast"),_t=u("initMonaco");var Al="inline-flex items-center rounded-full border border-input-border px-2 py-0.5 text-[10px] font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",Nl={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 To({variant:e="secondary",className:t,children:o,...n}){return r.createElement("div",{className:je.cn(Al,Nl[e],t),...n},o)}var Bl="w-full max-w-md p-6 rounded-2xl border border-border-l1 flex flex-col gap-6";function Xe({open:e,onOpenChange:t,title:o,description:n,confirmText:i="Confirm",cancelText:s="Cancel",danger:a,onConfirm:c}){return r.createElement(De,{open:e,onOpenChange:t},r.createElement(we,{className:Bl},r.createElement(Le,null,r.createElement(Ie,null,o),r.createElement(ct,null,n)),r.createElement(pt,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 Vl(){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 Ol(e){let t=Vl();return r.createElement(t,{...e})}var F=Ol;Object.defineProperty(F,"wrap",{value(e,t=null){let o=(n)=>r.createElement(F,{fallback:t},r.createElement(e,{...n}));return Object.defineProperty(o,"name",{value:`ErrorBoundary(${e.displayName??e.name??"Unknown"})`}),o},configurable:!0});T("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 Yp=k("void-error-card-");function m({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 yt({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 j=(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),kn=(e={})=>j(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"})),as=(e={})=>j(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"})),En=(e={})=>j(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"})),Fn=(e={})=>j(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"})),An=(e={})=>j(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"})),vo=(e={})=>j(e,r.createElement("path",{d:"m12 14 4-4"}),r.createElement("path",{d:"M3.34 19a10 10 0 1 1 17.32 0"}));var ls=(e={})=>j(e,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"})),cs=(e={})=>j(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"})),Nn=(e={})=>j(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"})),ps=(e={})=>j(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"})),Do=(e={})=>j(e,r.createElement("circle",{cx:"12",cy:"12",r:"10"}),r.createElement("path",{d:"M12 6v6l4 2"})),Bn=(e={})=>j(e,r.createElement("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),r.createElement("polyline",{points:"7 10 12 15 17 10"}),r.createElement("line",{x1:"12",x2:"12",y1:"15",y2:"3"})),Vn=(e={})=>j(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"})),us=(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"})),ds=(e={})=>j(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"})),ms=(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"}));var fs=(e={})=>j(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 $l={primary:"",secondary:"text-secondary",muted:"text-muted-foreground"};function Fe({color:e="secondary",className:t,children:o,...n}){return r.createElement("p",{className:je.cn("text-xs text-pretty",$l[e],t),...n},o)}var Rl={xs:"text-xs",sm:"text-sm",base:"text-base",lg:"text-lg",xl:"text-xl","2xl":"text-2xl"},zl={normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},Gl={primary:"",secondary:"text-secondary",muted:"text-muted-foreground"};function g({size:e="sm",weight:t="normal",color:o="primary",as:n="div",className:i,...s}){return ie(n,{className:je.cn(Rl[e],zl[t],Gl[o],i),...s})}var _l={width:"auto",opacity:1},gs={width:0,opacity:0},Ul={duration:0.2,ease:"easeOut"},Hl="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 ht({icon:e,children:t,tooltip:o,onClick:n,className:i,iconOnly:s,"aria-label":a}){let c=typeof o==="string"?o:a,l=zt(),p=pe(!1),y=!s&&!!t;return W(()=>{if(y)p.current=!0},[y]),r.createElement(Ge,{variant:"none",size:"none",className:K("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:K(Hl,"flex items-center justify-center",y?"px-2.5 gap-1.5 text-xs font-medium tabular-nums":"aspect-square gap-0.5",i)},e,s!=null?r.createElement(vn,null,y&&r.createElement(So,{initial:l||!p.current?!1:gs,animate:_l,exit:gs,transition:l?{duration:0}:Ul,className:"flex items-center overflow-hidden whitespace-nowrap"},t)):t))}function ys(e){return Boolean(e)}function hs(e){return e!=null}function St(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function qe(e,t){for(let o in t){if(o==="__proto__"||o==="constructor"||o==="prototype")continue;let n=e[o];if(St(n))qe(n,t[o]);else if(n===void 0)e[o]=t[o]}return e}function Ss(e){return new Promise((t)=>setTimeout(t,e))}async function wo(e){try{await navigator.clipboard.writeText(e)}catch{if(typeof GM_setClipboard==="function")GM_setClipboard(e)}}function xs(e){let t,o=!1;return(...n)=>{if(o)return t;return o=!0,t=e(...n),t}}function Cs(e,t){let o,n=(...i)=>{clearTimeout(o),o=setTimeout(()=>e(...i),t)};return n.cancel=()=>clearTimeout(o),n}function ge(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 xt(){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 On=(e)=>String(e).padStart(2,"0");function Lo(e){let t=Math.floor(e/3600),o=Math.floor(e%3600/60),n=e%60;return t>0?`${t}:${On(o)}:${On(n)}`:`${o}:${On(n)}`}function Ut(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 bs(e,t,o){return Math.min(Math.max(e,t),o)}function Io(e){return e instanceof Error?e.message:String(e)}function ko(e,t="file"){return e.replace(/[^a-zA-Z0-9 ]/g,"").trim().replace(/\s+/g,"-")||t}var $n=new Map;function Ct(e,t){let o=$n.get(e);if(!o)o=new Set,$n.set(e,o);return o.add(t),()=>{o.delete(t)}}function Eo(e,t){let o=$n.get(e);if(!o?.size)return;for(let n of[...o])n(t)}function bt(e){return typeof e==="function"?e():e}function Pt(e){Rt(e.subscribe,e.getSnapshot)}function Ye(){return $t((e)=>e+1,0)[1]}function Rn(e,t){W(()=>Ct(e,t),[e,t])}function Ke(e,t,o){return A(()=>{let n=t.toLowerCase().trim();if(!n)return e;return e.filter((i)=>o(i).toLowerCase().includes(n))},[e,t,o])}function Fo(e){let[t,o]=M(e),n=pe(e);if(n.current!==e)n.current=e,o(e);return W(()=>{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 Ao=new Map,zn=xt();function No(e,t){Ao.set(e,t),zn.notify()}function Bo(e){Ao.delete(e),zn.notify()}function Wl(e,t){if(e.render){let o=e.render;return r.createElement(o,{iconOnly:t})}return r.createElement(ht,{icon:bt(e.icon),tooltip:bt(e.tooltip),onClick:e.onClick,iconOnly:t})}function Ps({iconOnly:e}){if(Pt(zn),!Ao.size)return null;let t=[...Ao.entries()].sort(([,o],[,n])=>(o.order??0)-(n.order??0));return r.createElement(r.Fragment,null,t.map(([o,n])=>r.createElement(F,{key:o},Wl(n,e))))}var Gn=new Map,_n=xt();function Ts(e){let t=Gn.get(e);if(!t)t=new Map,Gn.set(e,t);return t}function Ms(e,t,o){Ts(e).set(t,o),_n.notify()}function vs(e,t){Ts(e).delete(t),_n.notify()}function jl(e,t){if(e.render){let o=e.render;return r.createElement(o,{...t})}return r.createElement(ut,{onSelect:()=>e.onSelect?.(t)},bt(e.icon),bt(e.label))}function Ds({location:e,...t}){Pt(_n);let o=Gn.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(F,{key:i,fallback:null},jl(s,t))))}var Xl=null;function ws(){return Xl??=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 Ls(e){let t=await ws();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 Vo(e,t){let o=await ws();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 ql=new b("SettingsStore");function Is(e,t){let o=e.get(t);if(!o)o=new Set,e.set(t,o);return o}class Un{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 p=c(l);if(p!==void 0)o[n]=p,i=p}break}}if(St(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 Vo("VoidSettings",e).catch(()=>{})}catch(e){ql.error("Failed to save settings:",e)}}markAsChanged(){this.notifyListeners("")}addGlobalChangeListener(e){this.globalListeners.add(e)}removeGlobalChangeListener(e){this.globalListeners.delete(e)}addChangeListener(e,t){Is(this.pathListeners,e).add(t)}removeChangeListener(e,t){this.pathListeners.get(e)?.delete(t)}addPrefixChangeListener(e,t){Is(this.prefixListeners,e).add(t)}removePrefixChangeListener(e,t){this.prefixListeners.get(e)?.delete(t)}}var Pe=new b("Settings"),Hn={plugins:{},notifications:{timeout:5000,position:"bottom-right"}},Ze={};qe(Ze,Hn);var X=new Un(Ze),Ht=Ze,P=X.store;async function Oo(){if(typeof GM_getValue==="function"){try{let t=GM_getValue("VoidSettings",null);if(t)Object.assign(Ze,JSON.parse(t))}catch(t){Pe.error("Failed to load settings:",t)}qe(Ze,Hn);return}let e=null;try{e=await Ls("VoidSettings")}catch(t){Pe.warn("Failed to read IndexedDB:",t)}if(!e){if(e=Yl(),e)Vo("VoidSettings",e).catch((t)=>Pe.debug("Failed to persist settings to IndexedDB:",t))}if(e)try{Object.assign(Ze,JSON.parse(e))}catch(t){Pe.error("Failed to parse settings:",t)}qe(Ze,Hn)}function Yl(){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 ks(e,...t){let{plugins:o}=X.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],X.markAsChanged();break}}function Es(e,t,o){let n=X.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],X.markAsChanged()}function Fs(e,t,...o){let n=X.plain.plugins[t];if(!n)return;let i=X.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}`),X.markAsChanged()}function Kl(e){if("default"in e)return e.default;if(e.type===4)return e.options.find((t)=>t.default)?.value;return}function te(e,t){let o="",n={get store(){if(!o)throw Error("Cannot access settings before plugin is initialized");return P.plugins[o]},get plain(){if(!o)throw Error("Cannot access settings before plugin is initialized");return Ht.plugins[o]},def:e,checks:t??{},get pluginName(){return o},set pluginName(i){if(o=i,!i)return;if(!Ht.plugins[i])Ht.plugins[i]={enabled:!1};X.setDefaultGetter(`plugins.${i}`,(s)=>{let a=e[s];return a?Kl(a):void 0})},use(i){let s=Ye();return W(()=>{let a=`plugins.${o}`;if(i?.length){let c=i.map((p)=>`${a}.${String(p)}`),l=(p)=>{if(c.some((y)=>p.startsWith(y)))s()};return X.addPrefixChangeListener(a,l),()=>X.removePrefixChangeListener(a,l)}return X.addPrefixChangeListener(a,s),()=>X.removePrefixChangeListener(a,s)},[]),n.store},withPrivateSettings(){return this}};return n}var ye=new b("PluginManager","#b4befe"),D={},Wn=new Map,As=!1,Zl=gn;function V(e){let t=D[e];if(!t)return!1;if(t.required)return!0;if(t.isDependency)return!0;return P.plugins[e]?.enabled??t.enabledByDefault??!1}function jn(e,t){let o=e;if(o.plugin=t,o.predicate&&!o.predicate())return;if(qi(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()),_.push(o)}function Ns(e,t=new Set){if(!e.dependencies)return!0;for(let o of e.dependencies){let n=D[o];if(!n)return ye.warn(`Missing dependency ${o} for ${e.name}`),!1;if(n.started)continue;if(t.has(o))return ye.error(`Circular dependency detected: ${e.name} -> ${o}`),!1;if(n.isDependency=!0,P.plugins[o]={...P.plugins[o],enabled:!0},t.add(o),!Ns(n,t))return!1;if(!Te(n))return!1}return!0}function Ql(e){let t=Zl[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(!Ns(e))return ye.error(`Failed to start dependencies for ${e.name}`),!1;if(e.managedStyle)ze(e.managedStyle);if(!e.hidden&&!t)ye.info(`Starting plugin ${e.name}`);if(e.start?.(),e.chatBarButton)No(e.name,e.chatBarButton);if(e.contextMenuItems)for(let[n,i]of Object.entries(e.contextMenuItems))Ms(n,e.name,i);let o=[];if(e.events)for(let[n,i]of Object.entries(e.events))o.push(Ct(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=Ql(n);if(!s){ye.warn(`Store "${n}" not found for plugin ${e.name}`);continue}let a=(l,p)=>{try{i.handler(l,p)}catch(y){ye.error(`Zustand handler error in ${e.name} for ${n}:`,y)}},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)Wn.set(e.name,o);return e.started=!0,!0}catch(o){return ye.error(`Failed to start plugin ${e.name}:`,o),!1}}function $o(e){if(!e.started)return!0;try{let t=Wn.get(e.name);if(t){for(let o of t)o();Wn.delete(e.name)}if(Bo(e.name),e.contextMenuItems)for(let o of Object.keys(e.contextMenuItems))vs(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 ye.error(`Failed to stop plugin ${e.name}:`,t),!1}}function Wt(e){for(let t in D){let o=D[t];if(!V(t))continue;if((o.startAt??"Init")!==e)continue;Te(o)}}function Ro(e){if(D[e.name])return;if(D[e.name]=e,e.started=!1,e.settings)e.settings.pluginName=e.name}function Bs(){if(As)return;As=!0;let e=new Set;for(let n in D){if(!V(n))continue;let i=D[n];if(i.dependencies?.forEach((s)=>{let a=D[s];if(!a){ye.warn(`Plugin ${n} has unresolved dependency ${s}`);return}P.plugins[s]={...P.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=D[n];if(!i)continue;P.plugins[n]={...P.plugins[n],enabled:!0},i.isDependency=!0}for(let n in D){if(!V(n))continue;let i=D[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)jn(s,n)}let t=Object.values(D).filter((n)=>!n.hidden),o=t.filter((n)=>V(n.name)).length;ye.info(`${o}/${t.length} plugins enabled, ${_.length} patches`)}var Os=new b("Notices"),zo;((n)=>{n.INFO="log";n.WARNING="warn";n.ERROR="error"})(zo||={});var Tt=null,Qe=null;function Vs(e){try{localStorage.removeItem(`banner-${e}`)}catch(t){Os.debug("Failed to clear banner dismissal:",t)}}function Go(e){let t=`void-notice-${Date.now()}`;if(Qe)clearTimeout(Qe),Qe=null;if(Tt)Vs(Tt);Vs(t);let{config:o}=H.useFeatureStore.getState();if(H.useFeatureStore.setState({config:{...o,banner:{type:e.type??"log",message:e.message,sentAt:t}}}),Tt=t,e.timeout)Qe=setTimeout(Xn,e.timeout);return t}function Xn(){if(!Tt)return;if(Qe)clearTimeout(Qe),Qe=null;try{localStorage.setItem(`banner-${Tt}`,"true")}catch(t){Os.debug("Failed to persist banner dismissal:",t)}let{config:e}=H.useFeatureStore.getState();H.useFeatureStore.setState({config:{...e,banner:{}}}),Tt=null}var qn=new b("UpdateChecker","#85c1dc");function Jl(e,t){let o=e.split(".").map(Number),n=t.split(".").map(Number);for(let i=0;i<Math.max(o.length,n.length);i++){let s=o[i]??0,a=n[i]??0;if(s>a)return!0;if(s<a)return!1}return!1}async function $s(){try{let e=await ge("https://raw.githubusercontent.com/imjustprism/Void/main/package.json");if(!e.ok)return;let{version:t}=await e.json();if(!t||!Jl(t,"0.2.5")){qn.info("Up to date (0.2.5)");return}qn.info(`Update available: ${"0.2.5"} → ${t}`),Go({message:"Void is outdated, please update to the latest version to avoid potential bugs.",type:"warn"})}catch(e){qn.warn("Failed to check for updates",e)}}var C=Object.freeze({Prism:"Prism",adryd:"adryd"});var jt=S({name:"FixChrome",description:"Fixes Chromium-specific performance issues like backdrop blur lag.",authors:[C.Prism],required:!0,patches:[{find:"bg-overlay backdrop-blur-[2px]",all:!0,replacement:{match:/backdrop-blur-\[2px\] /,replace:" "}}]});var Yn=S({name:"NoTelemetry",description:"Disables all tracking, telemetry, and event logging.",authors:[C.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 $1(){}"}},{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",[])'}]},{find:"isEnvVarsSet(){return void 0!=",replacement:{match:/isEnvVarsSet\(\)\{return void 0!=\i&&""!=\i\|\|!!this\.customEndpoint\}/,replace:"isEnvVarsSet(){return false}"}}]});T("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 Rs=new b("Themes","#c6a0f6");function zs(){return P.plugins.Settings??{}}function Ae(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 ec(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 ae(){let e=zs();return Array.isArray(e.themes)?e.themes:[]}function _o(){return zs().themesEnabled!==!1}function Uo(e){let t=P.plugins.Settings;P.plugins.Settings={...t,themes:e}}function Gs(e){let t=P.plugins.Settings;P.plugins.Settings={...t,themesEnabled:e};for(let o of ae())if(o.enabled)if(e)ze(Ae(o.url));else ne(Ae(o.url))}function tc(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 _s(e){tc(e);let t=ae();if(t.some((a)=>a.url===e))throw Error("This theme is already added.");let o=await ge(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=ec(n),s={url:e,name:i.name||oc(e),author:i.author,description:i.description,enabled:!1};return T(Ae(e),n),ne(Ae(e)),Uo([...t,s]),Rs.info(`Added theme "${s.name}" from ${e}`),s}function Us(e){ne(Ae(e)),Uo(ae().filter((t)=>t.url!==e))}async function Hs(e){if(Uo(ae().map((i)=>i.url===e?{...i,enabled:!0}:i)),!_o())return;let t=Ae(e);if(ze(t))return;let o=await ge(e);if(!o.ok)return;let n=await o.text();T(t,n)}function Ws(e){Uo(ae().map((t)=>t.url===e?{...t,enabled:!1}:t)),ne(Ae(e))}async function js(){if(!_o())return;let e=ae().filter((o)=>o.enabled),t=await Promise.allSettled(e.map(async(o)=>{let n=await ge(o.url);if(!n.ok)throw Error(`HTTP ${n.status}`);let i=await n.text();T(Ae(o.url),i)}));for(let o=0;o<t.length;o++)if(t[o].status==="rejected")Rs.warn(`Failed to load theme "${e[o].name}":`,t[o].reason)}function oc(e){return(e.split("/").pop()??e).replace(/\.css$/i,"").replace(/[-_]/g," ")}T("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 Kn=k("void-css-"),Xs="void-custom-css",nc=un((e)=>e.darkTheme?.base==="vs-dark");function Ho(){return P.plugins.Settings??{}}function Zn(e){T(Xs,e)}function rc(){ne(Xs)}function ic(e){let t=P.plugins.Settings;if(P.plugins.Settings={...t,customCSSEnabled:e},e){let o=typeof Ho().customCSS==="string"?Ho().customCSS:"";if(o)Zn(o)}else rc()}function Xt(){let e=Ho(),t=e.customCSS;if(typeof t==="string"&&t&&e.customCSSEnabled!==!1)return Zn(t),t;return typeof t==="string"?t:""}function sc(e){let t=P.plugins.Settings,o=t?.customCSSEnabled!==!1;if(P.plugins.Settings={...t,customCSS:e},o)Zn(e)}function Qn(){let e=pe(null),t=pe(null),[o,n]=M(()=>Ho().customCSSEnabled!==!1),i=(s)=>{n(s),ic(s)};return W(()=>{if(!e.current)return;let s=!1,a=null;return(async()=>{if(!_t.monacoInstance)await _t.initMonaco();if(s)return;let c=_t.monacoInstance;c.editor.defineTheme("grok-dark",nc.darkTheme),a=c.editor.create(e.current,{value:Xt(),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(()=>sc(a.getValue()))})(),()=>{s=!0,a?.dispose(),t.current=null}},[]),W(()=>{t.current?.updateOptions({readOnly:!o})},[o]),r.createElement(m,{flexDirection:"column",gap:"1rem"},r.createElement(m,{alignItems:"center",justifyContent:"space-between",style:{padding:"0 0.75rem"}},r.createElement(m,{flexDirection:"column",gap:"0"},r.createElement(g,{size:"sm",weight:"medium"},"Quick CSS"),r.createElement(g,{size:"xs",color:"secondary"},"Custom CSS applied live as you type.")),r.createElement(Y,{checked:o,onCheckedChange:i})),r.createElement("div",{className:Kn("block")},r.createElement("div",{className:Kn("header")},r.createElement(g,{as:"span"},"CSS")),r.createElement("div",{ref:e,className:Kn("editor")})))}T("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));
}
`);T("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 ac=[{key:"dev",icon:ms,tooltip:"Dev Only"},{key:"chrome",icon:En,tooltip:"Chromium Only"},{key:"preview",icon:ps,tooltip:"Preview plugin, may be removed once Grok ships this."}];function qs({plugin:e,className:t}){return ac.map((o)=>e[o.key]?r.createElement(Ue,{key:o.key},r.createElement(He,{asChild:!0},r.createElement("span",{className:t},r.createElement(o.icon,null))),r.createElement(We,null,o.tooltip)):null)}function Ys(e){if("default"in e)return e.default;if("options"in e&&e.type===4)return e.options.find((t)=>t.default)?.value}function Jn([,e]){return e.type!==7&&!(("hidden"in e)&&e.hidden)}function Ks(e){return!!e.settings?.def&&Object.entries(e.settings.def).some(Jn)}var Z=k("void-plugin-card-");function Wo({name:e,onSettings:t,onReload:o}){let n=D[e],i=Ye(),s=V(e),a=s&&!n.started&&!n.required,c=!!n.patches?.length,l=()=>{if(P.plugins[e]={...P.plugins[e],enabled:!s},!s)Te(n,!0);else $o(n);if(i(),Eo("pluginToggle"),c)o(e)};return r.createElement("div",{className:K(Z("root"),n.required&&Z("required"),a&&Z("crashed"))},r.createElement("div",{className:Z("body")},r.createElement(m,{alignItems:"center",justifyContent:"space-between",gap:"0.5rem"},r.createElement(g,{as:"span",className:Z("name")},e,a&&r.createElement(Ue,null,r.createElement(He,{asChild:!0},r.createElement(g,{as:"span",className:Z("crashed-icon")},r.createElement(fs,null))),r.createElement(We,null,"This plugin failed to start")),n.required&&r.createElement(Ue,null,r.createElement(He,{asChild:!0},r.createElement(g,{as:"span",className:Z("required-icon")},r.createElement(Fn,null))),r.createElement(We,null,"This plugin is required for Void to work")),r.createElement(qs,{plugin:n,className:Z("badge")})),r.createElement(m,{alignItems:"center",gap:"0.375rem",className:Z("controls")},Ks(n)&&r.createElement(E,{variant:"tertiary",size:"xs",shape:"square",onClick:()=>t(e)},r.createElement(ds,{size:16})),r.createElement(Y,{checked:s,disabled:n.required,onCheckedChange:l}))),n.description&&r.createElement("div",{className:Z("desc")},n.description)),r.createElement("div",{className:Z("separator")}),r.createElement("div",{className:Z("footer")},r.createElement("div",{className:Z("authors")},n.authors?.length?n.authors.join(", "):" ")))}T("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 Mt(e,t,o){let[n,i]=M((P.plugins[e]??{})[t]??Ys(o)),s=q((a)=>{i(a),P.plugins[e]={...P.plugins[e],[t]:a},o.onChange?.(a)},[t,e,o]);return[n,s]}function qt({id:e,setting:t}){return r.createElement(m,{flexDirection:"column",gap:"0"},r.createElement(mt,null,It(e)),"description"in t&&t.description&&r.createElement(ft,null,t.description))}function lc({id:e,setting:t,pluginName:o}){let[n,i]=Mt(o,e,t);return r.createElement(dt,{action:r.createElement(Y,{checked:!!n,onCheckedChange:i})},r.createElement(qt,{id:e,setting:t}))}function cc({id:e,setting:t,pluginName:o}){let[n,i]=Mt(o,e,t);if(!("options"in t))return null;return r.createElement(m,{flexDirection:"column",gap:"0.5rem"},r.createElement(qt,{id:e,setting:t}),r.createElement(ue,{value:String(n??""),onValueChange:i},r.createElement(de,null,r.createElement(fe,null)),r.createElement(me,null,t.options.map((s)=>r.createElement(B,{key:String(s.value),value:String(s.value)},s.label)))))}function pc({id:e,setting:t,pluginName:o}){let[n,i]=Mt(o,e,t);if(!("min"in t))return null;let{min:s,max:a}=t;return r.createElement(m,{flexDirection:"column",gap:"0.5rem"},r.createElement(qt,{id:e,setting:t}),r.createElement(m,{gap:"8px",className:"items-center"},r.createElement(xo,{value:[n??s],min:s,max:a,step:1,onValueChange:([c])=>i(c),className:"w-32"}),r.createElement(g,{size:"sm",color:"secondary",className:"tabular-nums w-6 text-right"},n)))}function uc({setting:e,pluginName:t}){let[,o]=Mt(t,"component",e);if(!("component"in e))return null;let n=e.component;return r.createElement(n,{setValue:o,option:e})}function Zs({id:e,setting:t,pluginName:o}){let[n,i]=Mt(o,e,t);return r.createElement(m,{flexDirection:"column",gap:"0.5rem"},r.createElement(qt,{id:e,setting:t}),r.createElement(ee,{type:"number",value:n??"",onChange:(s)=>{let a=Number(s.target.value);if(!isNaN(a))i(a)},className:"w-24"}))}function dc({id:e,setting:t,pluginName:o}){let[n,i]=Mt(o,e,t);return r.createElement(m,{flexDirection:"column",gap:"0.5rem"},r.createElement(qt,{id:e,setting:t}),r.createElement(ee,{type:"text",value:n??"",onChange:(s)=>i(s.target.value),placeholder:"placeholder"in t?t.placeholder:void 0,className:"w-full"}))}var mc={3:lc,4:cc,5:pc,6:uc,1:Zs,2:Zs,0:dc,7:null};function er({id:e,setting:t,pluginName:o}){let n=mc[t.type];if(!n)return null;return r.createElement(n,{id:e,setting:t,pluginName:o})}var tr=k("void-plugin-dialog-");function or({plugin:e,open:t,onClose:o}){let n=Object.entries(e.settings?.def??{}).filter(Jn);return r.createElement(De,{open:t,onOpenChange:(i)=>{if(!i)o()}},r.createElement(we,{className:tr("content"),"aria-describedby":void 0},r.createElement(ho,{asChild:!0},r.createElement(E,{variant:"tertiary",size:"sm",shape:"square",className:tr("close")},r.createElement(us,null))),r.createElement(Le,{className:tr("header")},r.createElement(Ie,null,e.name),e.description&&r.createElement(g,{size:"xs",color:"secondary"},e.description)),r.createElement(Ee,null),e.authors?.length&&r.createElement(m,{flexDirection:"column",gap:"0.25rem"},r.createElement(g,{size:"sm",weight:"medium"},"Authors"),r.createElement(g,{size:"xs",color:"secondary"},e.authors.join(", "))),r.createElement(m,{flexDirection:"column",gap:"0.25rem"},r.createElement(g,{size:"sm",weight:"medium"},"Settings"),n.length?r.createElement(m,{flexDirection:"column",gap:"0.75rem",className:"mt-2"},n.map(([i,s])=>r.createElement(er,{key:i,id:i,setting:s,pluginName:e.name}))):r.createElement(g,{size:"xs",color:"secondary"},"No configurable settings."))))}var fc=k("void-plugins-"),vt=null,jo=new Set,nr=!1,Qs=(e)=>`${e} ${D[e].description??""}`;function rr(){let[e,t]=M(""),[o,n]=M("all"),[i,s]=M(null),[a,c]=M(!1),{userPlugins:l,requiredPlugins:p}=A(()=>{let d=[],Q=[];for(let Ve of Object.keys(D).sort((v,Dt)=>v.localeCompare(Dt))){if(D[Ve].hidden)continue;if(D[Ve].required)Q.push(Ve);else d.push(Ve)}return{userPlugins:d,requiredPlugins:Q}},[]);W(()=>{if(vt)return;vt=new Map;for(let d of l)vt.set(d,V(d));for(let d of p)vt.set(d,V(d))},[l,p]);let y=A(()=>{if(o==="all")return l;let d=o==="enabled";return l.filter((Q)=>V(Q)===d)},[o,l]),w=A(()=>{if(o==="all")return p;let d=o==="enabled";return p.filter((Q)=>V(Q)===d)},[o,p]),f=Ke(y,e,Qs),L=Ke(w,e,Qs),$=i?D[i]:null,R=f.length||L.length,Be=jo.size>0,Se=q((d)=>{if(!vt)return;if(V(d)===vt.get(d))jo.delete(d);else jo.add(d);if(jo.size){if(!nr)c(!0)}else c(!1),nr=!1},[]),z=q(()=>{nr=!0,c(!1)},[]);return r.createElement(m,{flexDirection:"column",gap:"1.5rem"},r.createElement(m,{flexDirection:"column",gap:"0",style:{padding:"0 0.75rem"}},r.createElement(g,{size:"sm",weight:"medium"},"Plugins"),r.createElement(g,{size:"xs",color:"secondary"},"Pick which plugins to use. Some need a page reload to kick in.")),Be&&!a&&r.createElement(m,{alignItems:"center",className:K(fc("reload-banner"),"mx-3")},r.createElement(g,{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(m,{alignItems:"center",gap:"0.75rem",style:{padding:"0 0.75rem"}},r.createElement(ee,{type:"text",placeholder:`Search ${y.length+w.length} plugins...`,value:e,onChange:(d)=>t(d.target.value),className:"flex-1 min-w-0"}),r.createElement(ue,{value:o,onValueChange:(d)=>n(d)},r.createElement(de,{className:"w-28"},r.createElement(fe,null)),r.createElement(me,null,r.createElement(B,{value:"all"},"All"),r.createElement(B,{value:"enabled"},"Enabled"),r.createElement(B,{value:"disabled"},"Disabled")))),f.length>0&&r.createElement(yt,{columns:"repeat(2, 1fr)",style:{padding:"0 0.75rem"}},f.map((d)=>r.createElement(Wo,{key:d,name:d,onSettings:s,onReload:Se}))),L.length>0&&r.createElement(r.Fragment,null,r.createElement(Ee,{className:"mx-3 w-auto"}),r.createElement(yt,{columns:"repeat(2, 1fr)",style:{padding:"0 0.75rem"}},L.map((d)=>r.createElement(Wo,{key:d,name:d,onSettings:s,onReload:Se})))),!R&&r.createElement(Fe,{color:"secondary",className:"text-center py-8"},e?"No plugins match your search.":"No plugins available."),$&&r.createElement(or,{plugin:$,open:!0,onClose:()=>s(null)}),r.createElement(Xe,{open:a,onOpenChange:(d)=>{if(!d)z()},title:"Reload required",description:"This plugin patches Grok's code, so you need to reload the page.",confirmText:"Reload",cancelText:"Later",onConfirm:()=>location.reload()}))}T("ThemesTab",`.void-themes-add-error {
    font-size: 0.75rem;
    color: hsl(var(--fg-danger));
}
`);T("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 Ne=k("void-theme-card-");function ir({theme:e,globalEnabled:t,onRemove:o,onToggle:n}){let i=()=>{if(e.enabled)Ws(e.url);else Hs(e.url);n()};return r.createElement("div",{className:Ne("root")},r.createElement("div",{className:Ne("body")},r.createElement(m,{alignItems:"center",justifyContent:"space-between",gap:"0.5rem"},r.createElement(g,{as:"span",className:Ne("name")},e.name??e.url),r.createElement(m,{alignItems:"center",gap:"0.375rem",className:Ne("controls")},r.createElement(Ge,{variant:"tertiary",size:"xs",shape:"square",tooltipContent:"Copy URL",onClick:()=>wo(e.url)},r.createElement(as,{size:16})),r.createElement(Ge,{variant:"tertiary",size:"xs",shape:"square",tooltipContent:"Remove",onClick:()=>o(e.url)},r.createElement(cs,{size:16})),r.createElement(Y,{checked:e.enabled,disabled:!t,onCheckedChange:i}))),e.description&&r.createElement("div",{className:Ne("desc")},e.description)),r.createElement("div",{className:Ne("separator")}),r.createElement("div",{className:Ne("footer")},r.createElement("div",{className:Ne("author")},e.author??" ")))}var gc=k("void-themes-"),yc=(e)=>`${e.name} ${e.description} ${e.author}`;function sr(){let[e,t]=M(""),[o,n]=M("all"),[i,s]=M(""),[a,c]=M(""),[l,p]=M(!1),[y,w]=M(_o),[f,L]=M(ae),$=A(()=>{if(o==="all")return f;let v=o==="enabled";return f.filter((Dt)=>Dt.enabled===v)},[f,o]),R=Ke($,e,yc),Be=(v)=>{w(v),Gs(v)},Se=async()=>{let v=i.trim();if(!v)return;c(""),p(!0);try{await _s(v),s(""),L(ae())}catch(Dt){c(Io(Dt))}finally{p(!1)}},[z,d]=M(null),Q=z?f.find((v)=>v.url===z):null,Ve=()=>{if(!z)return;Us(z),d(null),L(ae())};return r.createElement(m,{flexDirection:"column",gap:"2rem"},r.createElement(m,{alignItems:"center",justifyContent:"space-between",style:{padding:"0 0.75rem"}},r.createElement(m,{flexDirection:"column",gap:"0"},r.createElement(g,{size:"sm",weight:"medium"},"Themes"),r.createElement(g,{size:"xs",color:"secondary"},"Custom CSS themes for Grok. Paste a URL to a .css file to add one.")),r.createElement(Y,{checked:y,onCheckedChange:Be})),r.createElement(m,{flexDirection:"column",gap:"0.5rem",style:{padding:"0 0.75rem"}},r.createElement(m,{alignItems:"center",gap:"0.5rem"},r.createElement(ee,{type:"text",placeholder:"https://raw.githubusercontent.com/...",value:i,onChange:(v)=>{s(v.target.value),c("")},onKeyDown:(v)=>{if(v.key==="Enter")Se()},className:"flex-1 min-w-0"}),r.createElement(E,{variant:"primary",size:"sm",className:"h-9",onClick:Se,disabled:l||!i.trim()},l?"Importing...":"Import")),a&&r.createElement(g,{size:"xs",className:gc("add-error")},a)),f.length>0&&r.createElement(m,{flexDirection:"column",gap:"0.375rem",style:{padding:"0 0.75rem"}},r.createElement(m,{flexDirection:"column",gap:"0"},r.createElement(g,{size:"sm",weight:"medium"},"Installed Themes"),r.createElement(g,{size:"xs",color:"secondary"},"Re-fetched every page load. Use the switch above to disable all themes at once.")),r.createElement(g,{size:"xs",color:"secondary"},`${kt(f.length,"theme")} installed · ${f.filter((v)=>v.enabled).length} enabled`)),f.length>0&&r.createElement(m,{alignItems:"center",gap:"0.75rem",style:{padding:"0 0.75rem"}},r.createElement(ee,{type:"text",placeholder:`Search ${f.length} themes...`,value:e,onChange:(v)=>t(v.target.value),className:"flex-1 min-w-0"}),r.createElement(ue,{value:o,onValueChange:(v)=>n(v)},r.createElement(de,{className:"w-28"},r.createElement(fe,null)),r.createElement(me,null,r.createElement(B,{value:"all"},"All"),r.createElement(B,{value:"enabled"},"Enabled"),r.createElement(B,{value:"disabled"},"Disabled")))),R.length>0&&r.createElement(yt,{columns:"repeat(2, 1fr)",style:{padding:"0 0.75rem"}},R.map((v)=>r.createElement(ir,{key:v.url,theme:v,globalEnabled:y,onRemove:d,onToggle:()=>L(ae())}))),f.length>0&&!R.length&&r.createElement(Fe,{color:"secondary",className:"text-center py-8"},"No themes match your search."),!f.length&&r.createElement(Fe,{color:"secondary",className:"text-center py-8"},"No themes added yet. Paste a URL above to add one."),r.createElement(Xe,{open:z!=null,onOpenChange:(v)=>{if(!v)d(null)},title:"Remove theme",description:`Are you sure you want to remove "${Q?.name??"this theme"}"?`,confirmText:"Remove",cancelText:"Cancel",danger:!0,onConfirm:Ve}))}var Js=F.wrap(Qn),ea=F.wrap(rr),ta=F.wrap(sr);T("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-obfuscated-chip {
    margin-left: 6px;
    vertical-align: middle;
    background: hsl(var(--purple-700) / 60%);
    color: hsl(var(--purple-200));
}

.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 Xo;((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"})(Xo||={});var hc=["message","success","error","info","warning","loading"];function qo(e,t=0,o){let n=hc[t];Dn.toast[n](e,o)}var he=k("void-experiments-"),Sc=86400000,Yt=te({notifyNewFlags:{type:3,description:"Show a notification when new experiment flags are added.",default:!0}}).withPrivateSettings();function ra(e){return Object.keys(e).filter((t)=>typeof e[t]==="boolean")}function oa(e){let t=ra(e);if(!t.length)return;let o=Yt.plain.knownFlags,n=o==null,i=o??{},s=Date.now(),a=n;if(!n){let p=Object.values(i);if(p.length>1&&p.every((y)=>y===p[0]&&y!==0)){for(let y of Object.keys(i))i[y]=0;a=!0}}let c=[];for(let p of t)if(!(p in i)){if(i[p]=n?0:s,!n)c.push(p);a=!0}let l=new Set(t);for(let p of Object.keys(i))if(!l.has(p))delete i[p],a=!0;if(a)Yt.store.knownFlags={...i};if(c.length&&Yt.store.notifyNewFlags)qo(`${kt(c.length,"new experiment flag")} added`,3)}function na(e){let t=Yt.plain.knownFlags?.[e];if(t==null)return!1;return Date.now()-t<Sc}var xc={Mcp:"MCP",Ui:"UI",Api:"API",Url:"URL",Gcal:"GCal",Mie:"MIE",Xlsx:"XLSX",Nux:"NUX",Xai:"xAI",Grok:"Grok",Id:"ID"};function lr(e){if(e.includes("_")||e.includes("-")||e.length<10)return null;if(!/^[A-Za-z0-9+/=]+$/.test(e))return null;try{let t=atob(e);if(/^[a-z][a-z0-9_]+$/.test(t))return t}catch{return null}return null}var ar=(e)=>It(lr(e)??e,xc);function Cc({flagKey:e,isNew:t}){let o=H.useFeatureStore((l)=>l.config[e]),n=H.useFeatureStore((l)=>l.overrides[e]),i=n!==void 0,s=i?!!n:!!o,a=A(()=>lr(e),[e]),c=q((l)=>{let{setOverride:p,clearOverride:y,config:w}=H.useFeatureStore.getState();if(l===!!w[e])y(e);else p(e,l)},[e]);return r.createElement(dt,{action:r.createElement(Y,{checked:s,onCheckedChange:c})},r.createElement(mt,null,ar(e),t&&r.createElement(To,{className:he("new-chip")},"NEW"),a&&r.createElement(To,{className:he("obfuscated-chip")},"OBFUSCATED"),i&&r.createElement(g,{size:"xs",as:"span",className:he("modified")},"(modified)")),r.createElement(ft,null,a??e))}function bc(){let[e,t]=M(""),[o,n]=M("all"),i=H.useFeatureStore((f)=>f.config),s=H.useFeatureStore((f)=>f.overrides),a=A(()=>ra(i).sort(),[i]),c=q((f)=>{let L=lr(f);return L?`${f} ${L} ${ar(f)}`:`${f} ${ar(f)}`},[]),l=q((f)=>{if(o==="all")return!0;let L=s[f],$=L!==void 0?!!L:!!i[f];if(o==="enabled")return $;if(o==="disabled")return!$;if(o==="new")return na(f);return L!==void 0},[o,i,s]),p=A(()=>a.filter(l),[a,l]),y=Ke(p,e,c),w=Object.keys(s).length;return r.createElement(m,{flexDirection:"column",gap:"1rem",className:he("root")},r.createElement(m,{flexDirection:"column",gap:"0",className:he("section")},r.createElement(g,{size:"sm",weight:"medium"},"Experiments"),r.createElement(g,{size:"xs",color:"secondary"},"Toggle unreleased Grok features. These are experimental and may break things.")),r.createElement(yo,{variant:"ghost",className:he("warning")},r.createElement(m,{alignItems:"center",justifyContent:"space-between",gap:"0.75rem"},r.createElement(g,{size:"xs",className:he("warning-text")},"Only enable flags you understand. Changing the wrong setting can break Grok or cause unexpected behavior."),w>0&&r.createElement(E,{variant:"secondary",size:"sm",className:he("clear-btn"),onClick:()=>H.useFeatureStore.getState().clearAllOverrides()},"Clear ",kt(w,"override")))),r.createElement(m,{alignItems:"center",gap:"0.5rem",className:he("section")},r.createElement(ee,{placeholder:`Search ${p.length} flags...`,value:e,onChange:(f)=>t(f.target.value),className:"flex-1"}),r.createElement(ue,{value:o,onValueChange:(f)=>n(f)},r.createElement(de,{className:"w-28"},r.createElement(fe,null)),r.createElement(me,null,r.createElement(B,{value:"all"},"All"),r.createElement(B,{value:"enabled"},"Enabled"),r.createElement(B,{value:"disabled"},"Disabled"),r.createElement(B,{value:"new"},"New"),r.createElement(B,{value:"modified"},"Modified")))),y.map((f)=>r.createElement(F,{key:f,fallback:null},r.createElement(Cc,{flagKey:f,isNew:na(f)}))),!y.length&&r.createElement(Fe,{color:"muted",className:he("empty")},e?`No flags matching "${e}"`:`No ${o} flags`))}var ia=F.wrap(bc),cr=S({name:"Experiments",description:"Unlock and toggle unreleased Grok features.",authors:[C.Prism],settings:Yt,startAt:"TurbopackReady",start(){let e=H.useFeatureStore.getState();if(e.status==="ready")oa(e.config)},zustand:{FeatureStore:{selector:(e)=>e.status==="ready"?e.config:null,handler(e){if(e)oa(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 aa=k("void-settings-"),pr=te({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}}),Pc=[{id:"void_plugins_tab",name:"Plugins",icon:Vn,component:ea},{id:"void_themes_tab",name:"Themes",icon:An,component:ta},{id:"void_css_tab",name:"Quick CSS",icon:kn,component:Js},{id:"void_experiments_tab",name:"Experiments",icon:Nn,component:ia,plugin:"Experiments"}];function la(){return Pc.filter((e)=>!e.plugin||V(e.plugin))}function ur(){return r.createElement(g,{as:"span",color:"secondary"},"•")}function sa({href:e,children:t}){return r.createElement("a",{href:e,target:"_blank",rel:"noreferrer",className:K(aa("version-link"),"pointer-events-auto")},r.createElement(g,{as:"span",color:"secondary"},t))}function Tc(){return r.createElement(m,{flexDirection:"column",gap:"0",className:K(aa("version"),"absolute bottom-0 left-0 right-0 p-3 opacity-30 text-secondary pointer-events-none")},r.createElement(m,{alignItems:"center",gap:"0.25rem"},r.createElement(sa,{href:"https://github.com/imjustprism/Void"},"Void"),r.createElement(ur,null),r.createElement(g,{as:"span",color:"secondary"},"v0.2.5"),r.createElement(ur,null),r.createElement(sa,{href:"https://github.com/imjustprism/Void/commit/c3d3010"},"(c3d3010)")),r.createElement(m,{alignItems:"center",gap:"0.25rem"},r.createElement(g,{as:"span",color:"secondary"},"Production"),r.createElement(ur,null),r.createElement(g,{as:"span",color:"secondary"},"Userscript")))}function Mc({jsx:e,TabButton:t}){let o=Ye();return Rn("pluginToggle",o),r.createElement(ve,null,la().map((n)=>e(t,{key:n.id,icon:n.icon,text:n.name,tab:n.id})))}function vc({jsx:e,activeTab:t,Wrapper:o}){let n=Ye();Rn("pluginToggle",n);let i=la().find((s)=>s.id===t);if(!i)return null;return e(o,{key:i.id,children:e(i.component,{})})}var dr=S({name:"Settings",description:"Adds Void settings UI.",authors:[C.Prism],required:!0,settings:pr,_hideUserId(){return pr.store.hideUserId},_fixDialogFlash(){return pr.store.fixDialogFlash},renderTabs(e,t){return[r.createElement(Mc,{key:"void-tabs",jsx:e,TabButton:t}),r.createElement(Tc,{key:"void-version"})]},renderPanels(e,t,o){return[r.createElement(vc,{key:"void-panels",jsx:e,activeTab:t,Wrapper:o})]},start(){if(T("void-global","[data-sonner-toast] [data-title]{font-weight:400}"),document.head)Xt();else document.addEventListener("DOMContentLoaded",Xt,{once:!0});js()},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 Dc=0,Je=[],Kt=xt();function mr(e,t){let o=t?.modalKey??`void-modal-${Dc++}`;return Je.push({key:o,render:e}),Kt.notify(),o}function fr(e){let t=Je.findIndex((o)=>o.key===e);if(t!==-1)Je.splice(t,1),Kt.notify()}function ca(){Je.length=0,Kt.notify()}function pa(e){return new Promise((t)=>{let o=mr(({onClose:i})=>{let s=(a)=>{t(a),i()};return r.createElement(Le,null,r.createElement(Ie,null,e.title),r.createElement(ct,null,e.body),r.createElement(pt,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=Kt.subscribe(()=>{if(!Je.some((i)=>i.key===o))n(),t(!1)})})}function wc({entry:e}){let t=q(()=>fr(e.key),[e.key]);return r.createElement(De,{open:!0,onOpenChange:(o)=>{if(!o)t()}},r.createElement(we,{"aria-describedby":void 0},e.render({onClose:t})))}function ua(){if(Pt(Kt),!Je.length)return null;return r.createElement(r.Fragment,null,Je.map((e)=>r.createElement(wc,{key:e.key,entry:e})))}var gr=S({name:"ChatBarButtonAPI",description:"Adds buttons to the chat input bar.",authors:[C.Prism],required:!0,hidden:!0,renderButtons(e){return ie(ve,null,ie(Ps,{iconOnly:e}),ie(ua,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 yr=S({name:"ContextMenuAPI",description:"Adds items to context menus.",authors:[C.Prism],required:!0,hidden:!0,renderItems(e,t){return ie(Ds,{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 Yo=S({name:"BackgroundThinking",description:"Lets Grok think in the background while you are away.",authors:[C.Prism],patches:[{find:'"bgThinkingDefaultOptinSet"',replacement:{match:/\.success\?(\i)\.data:null/,replace:".success?$1.data:{enabled:!0,maxConcurrentRequests:3}"}}]});var Lc=new b("BetterFiles"),Ic=te({skipDeleteConfirm:{type:3,description:"Skip the delete confirmation when deleting files from the list.",default:!1}});function kc(){let[e,t]=M(!1),o=at.useFilesPageStore((s)=>s.list),n=at.useFilesPageStore((s)=>s.deleteAsset);if(!o.length)return null;let i=async()=>{let s=[...o];for(let a of s)try{await n(a)}catch(c){Lc.error("Failed to delete asset",a,c)}};return r.createElement(ve,null,r.createElement(E,{variant:"tertiary",shape:"square",size:"sm",onClick:()=>t(!0)},r.createElement(ls,{size:18,className:"text-fg-secondary"})),r.createElement(Xe,{open:e,onOpenChange:t,title:"Delete all files",description:`Are you sure you want to delete all ${o.length} files? This cannot be undone.`,confirmText:"Delete all",danger:!0,onConfirm:i}))}var hr=S({name:"BetterFiles",description:"Adds bulk delete and optional skip of delete confirmation on the files page.",authors:[C.Prism],settings:Ic,renderDeleteAllButton:F.wrap(kc),_deleteFile(e){at.useFilesPageStore.getState().deleteAsset(e)},patches:[{find:"title-and-button",noWarn:!0,replacement:[{match:/"files-search-open-button.label".{0,25}\)\}\)\]\}\)/,replace:"$&,$self.renderDeleteAllButton()"},{match:/(\i)\(\{type:"delete",assetId:(\i)\.assetId\}\)/,replace:'$self.settings.store.skipDeleteConfirm?$self._deleteFile($2.assetId):$1({type:"delete",assetId:$2.assetId})'}]}]});var Ec={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"},Fc={"0":"Free","1":"X Premium","2":"X Premium+"};function Ac(e,t){if(e)return Ec[e]??e;return Fc[t??"0"]??"Free"}function Nc(){let{open:e}=Mn.useSidebar(),{user:t}=uo.useSession(),o=mo.useSubscriptionsStore((n)=>n.bestSubscription);if(!e||!t)return null;return r.createElement(m,{flexDirection:"column",justifyContent:"center",gap:"0",className:"min-w-0 overflow-hidden"},r.createElement(g,{as:"span",size:"sm",weight:"medium",className:"truncate"},t.givenName||t.email?.split("@")[0]||"User"),r.createElement(g,{as:"span",size:"xs",color:"secondary",className:"truncate"},Ac(o,t.sessionTierId)))}var Sr=S({name:"BetterSidebar",description:"Shows your name and plan in the sidebar footer.",authors:[C.Prism],renderUserInfo:F.wrap(Nc),patches:[{find:"AvatarDropdownMenu,{}),",replacement:{match:/AvatarDropdownMenu,\{\}\)/,replace:"$&,$self.renderUserInfo()"}}]});var xr=S({name:"Cleaner",description:"Hides upgrade nags and upsell banners.",authors:[C.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 Cr=S({name:"ConsoleJanitor",description:"Silences noisy warnings and info logs in the browser console.",authors:[C.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"}},{find:"pressure_observer",replacement:{match:/"PressureObserver"in window/,replace:"false"}}]});var br={};Qo(br,{zustandCreate:()=>vl,useTransition:()=>Pn,useSyncExternalStore:()=>Rt,useState:()=>M,useRef:()=>pe,useReducer:()=>$t,useReducedMotion:()=>zt,useMemo:()=>A,useLayoutEffect:()=>xn,useId:()=>bn,useEffect:()=>W,useDeferredValue:()=>Tn,useContext:()=>Cn,useCallback:()=>q,toast:()=>os,onceReady:()=>oo,i18n:()=>Dl,createElement:()=>ie,WorkspaceStore:()=>Hi,WorkspaceConnectorsStore:()=>Ui,WorkspaceCollectionsStore:()=>_i,UpsellStore:()=>Gi,TourGuideStore:()=>zi,TooltipTrigger:()=>He,TooltipContent:()=>We,Tooltip:()=>Ue,Toaster:()=>Dn,Textarea:()=>ol,TextToSpeechStore:()=>Ri,TasksStore:()=>$i,TanStackQuery:()=>In,TabsTrigger:()=>dl,TabsManagerStore:()=>Oi,TabsList:()=>ul,TabsContent:()=>ml,Tabs:()=>pl,Switch:()=>Y,SuggestionStore:()=>Vi,SubscriptionsStore:()=>mo,Spinner:()=>rl,SourcesSelectorStore:()=>Bi,Slider:()=>xo,Skeleton:()=>ts,SidebarComponents:()=>Mn,ShopStore:()=>Ni,ShareStore:()=>Ai,SettingsTitle:()=>mt,SettingsStore:()=>Fi,SettingsRow:()=>dt,SettingsDialogStore:()=>Ei,SettingsDescription:()=>ft,SessionStore:()=>uo,Separator:()=>Ee,SelectValue:()=>fe,SelectTrigger:()=>de,SelectItem:()=>B,SelectContent:()=>me,Select:()=>ue,RoutingStore:()=>ki,ResponsiveDialog:()=>Ml,ResponseStore:()=>Ii,ReportStore:()=>Li,ReasoningModeUtils:()=>wn,ReactDOM:()=>Yi,React:()=>r,RateLimitUtils:()=>kl,PopoverTrigger:()=>al,PopoverContent:()=>ll,PopoverArrow:()=>cl,Popover:()=>sl,PersonalityStore:()=>wi,NotificationsStore:()=>Di,NextRouter:()=>El,MotionDiv:()=>So,MonacoModule:()=>_t,ModesStore:()=>vi,ModelsStore:()=>po,MentionMenuStore:()=>Mi,MediaStore:()=>Ti,LazyComponent:()=>h,Input:()=>ee,ImageEditorStore:()=>Pi,HighlightsStore:()=>bi,Fragment:()=>ve,FilesPageStore:()=>at,FileUtils:()=>Ln,FileStore:()=>Ci,FeatureStore:()=>H,EnvUtils:()=>wl,DropdownMenuTrigger:()=>Ra,DropdownMenuSubTrigger:()=>ja,DropdownMenuSubContent:()=>Xa,DropdownMenuSub:()=>Wa,DropdownMenuSeparator:()=>Ha,DropdownMenuRadioItem:()=>Ua,DropdownMenuRadioGroup:()=>_a,DropdownMenuItem:()=>ut,DropdownMenuContent:()=>za,DropdownMenuCheckboxItem:()=>Ga,DropdownMenu:()=>$a,DownloadUtils:()=>Il,DictationStore:()=>xi,DialogTitle:()=>Ie,DialogHeader:()=>Le,DialogFooter:()=>pt,DialogDescription:()=>ct,DialogContent:()=>we,DialogClose:()=>ho,Dialog:()=>De,DevModelsStore:()=>Si,CopyUtils:()=>Fl,ConversationStore:()=>Vt,ContextMenuTrigger:()=>Ya,ContextMenuSubTrigger:()=>el,ContextMenuSubContent:()=>tl,ContextMenuSub:()=>Ja,ContextMenuSeparator:()=>Qa,ContextMenuItem:()=>Za,ContextMenuContent:()=>Ka,ContextMenu:()=>qa,CommandMenuStore:()=>hi,CommandList:()=>Cl,CommandItem:()=>bl,CommandInput:()=>xl,CommandGroup:()=>Pl,CommandEmpty:()=>Tl,Command:()=>Sl,CodePageStore:()=>yi,ClassNames:()=>je,Checkbox:()=>nl,ChatPageStore:()=>ce,Card:()=>yo,ButtonWithTooltip:()=>Ge,Button:()=>E,Avatar:()=>il,AssetUtils:()=>Ll,AssetStore:()=>gi,ArtifactStore:()=>fi,ApiClients:()=>Gt,AnimatePresence:()=>vn,AccordionTrigger:()=>yl,AccordionItem:()=>gl,AccordionContent:()=>hl,Accordion:()=>fl});var Bc=new b("ExportChat");function Vc(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 Oc(e){let{responses:t}=await Gt.chatApi.chatListResponses({conversationId:e})??{};if(!t?.length)return;let n=Vt.useConversationStore.getState().byId[e]?.title??"Untitled Chat";await Ln.downloadBlob(new Blob([JSON.stringify({conversationId:e,title:n,exportedAt:new Date().toISOString(),messages:t.map(Vc)},null,2)],{type:"application/json"}),`${ko(n,"chat")}.json`)}function $c({conversationId:e}){let t=ce.useChatPageStore((o)=>o.conversationId===e&&!!o.streamedMessageId);return r.createElement(ut,{onSelect:()=>Oc(e).catch((o)=>Bc.error("Failed to export chat",o)),disabled:t},r.createElement(Bn,{size:16,className:"me-2"}),"Export")}var Pr=S({name:"ExportChat",description:"Export conversations as JSON from the right-click menu.",authors:[C.Prism],contextMenuItems:{conversation:{label:"Export",render:F.wrap($c)}}});function Rc(e){let o=e.target.closest("[id^='response-']");if(!o)return;o.querySelector("[aria-label='Edit']")?.click()}var Tr=S({name:"MessageClickActions",description:"Double-click your own messages to edit them.",authors:[C.Prism],eventListeners:[{event:"dblclick",handler:Rc}]});var zc=new b("NoAutoplay"),da=te({playOnHover:{type:3,description:"Play video thumbnails when hovered.",default:!0}}),Mr=new WeakMap;function Gc(e){Mr.set(e,e.play().catch((t)=>zc.error("Failed to play video",t)))}function _c(e){let t=Mr.get(e);if(Mr.delete(e),t)t.then(()=>{e.pause(),e.currentTime=0});else e.pause(),e.currentTime=0}var Uc=(e)=>{let t=e.currentTarget.querySelector("video");if(t)Gc(t)},Hc=(e)=>{let t=e.currentTarget.querySelector("video");if(t)_c(t)},vr=S({name:"NoAutoplay",description:"Stops video thumbnails from autoplaying on the Imagine page.",authors:[C.Prism],settings:da,_hoverProps(){if(!da.store.playOnHover)return{};return{onMouseEnter:Uc,onMouseLeave:Hc}},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 Wc=new b("Oneko"),jc="https://raw.githubusercontent.com/adryd325/oneko.js/c4ee66353b11a44e4a5b7e914a81f8d33111555e/oneko.js",Xc="https://raw.githubusercontent.com/adryd325/oneko.js/14bab15a755d0e35cd4ae19c931d96d306f99f42/oneko.gif",Dr=!1,wr=S({name:"Oneko",description:"Cat follows your mouse cursor.",authors:[C.adryd],cleanupSelectors:["#oneko"],start(){Dr=!1,ge(jc).then((e)=>e.text()).then((e)=>e.replace("./oneko.gif",Xc).replace("(isReducedMotion)","(false)")).then((e)=>{if(Dr)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)})}).catch((e)=>Wc.error("Failed to load oneko script",e))},stop(){Dr=!0}});var ma=te({showMaxCount:{type:3,description:"Show the maximum count alongside remaining.",default:!0}}),Zo={remaining:-1,total:-1,windowSeconds:0,waitSeconds:null};function kr(e){return e!=null&&e>0?Math.ceil(e):null}function Ko(e,t,o){return{remaining:e.remainingQueries,total:Math.floor(t/e.cost),windowSeconds:o,waitSeconds:kr(e.waitTimeSeconds)}}function Lr(e,t){let o=e.windowSizeSeconds,n=e.totalTokens??0;if(n>0){if(t==="fast"&&e.lowEffortRateLimits)return Ko(e.lowEffortRateLimits,n,o);if(t==="expert"&&e.highEffortRateLimits)return Ko(e.highEffortRateLimits,n,o);if(e.highEffortRateLimits)return Ko(e.highEffortRateLimits,n,o);if(e.lowEffortRateLimits)return Ko(e.lowEffortRateLimits,n,o);return{remaining:e.remainingTokens??0,total:n,windowSeconds:o,waitSeconds:kr(e.waitTimeSeconds)}}if(e.totalQueries>0)return{remaining:e.remainingQueries,total:e.totalQueries,windowSeconds:o,waitSeconds:kr(e.waitTimeSeconds)};return{...Zo,windowSeconds:o}}function Ir(e,t,o,n){return In.useQuery({queryKey:["void-rate-limits",e,t,o],queryFn:()=>Gt.rateLimitsApi.rateLimitsGetRateLimits({body:{modelName:e,requestKind:t}}),enabled:n&&!!e,staleTime:1e4,placeholderData:(i)=>i})}function Zt(e,t){if(e.waitSeconds!=null&&e.waitSeconds>0)return Lo(e.waitSeconds);if(e.total<0)return"...";if(e.total===0)return"∞";return t||!ma.store.showMaxCount?String(e.remaining):`${e.remaining}/${e.total}`}function qc({usage:e}){let t=Fo(e.waitSeconds),o=t!=null&&t>0,n=o?{...e,waitSeconds:t}:e,i=e.windowSeconds>0?`Resets every ${Ut(e.windowSeconds)}`:"";return r.createElement(ht,{icon:o?r.createElement(Do,{size:18}):r.createElement(vo,{size:18}),tooltip:i||void 0,className:o?"text-fg-danger":void 0},Zt(n))}function Yc({fast:e,expert:t}){let o=Fo(e.waitSeconds),n=Fo(t.waitSeconds),i=o!=null&&o>0,s=n!=null&&n>0,a=i||s,c=i?{...e,waitSeconds:o}:e,l=s?{...t,waitSeconds:n}:t,p=e.windowSeconds??t.windowSeconds,y=p>0?` · resets every ${Ut(p)}`:"";return r.createElement(ht,{icon:a?r.createElement(Do,{size:18}):r.createElement(vo,{size:18}),tooltip:`Fast ${Zt(c)} · Expert ${Zt(l)}${y}`,className:a?"text-fg-danger":void 0},Zt(c,!0),r.createElement(Ee,{orientation:"vertical",className:"mx-1 h-3 w-0.5"}),Zt(l,!0))}function Kc(e){let t=ce.useChatPageStore((d)=>d.modelMode),o=ce.useChatPageStore((d)=>d.reasoningMode),n=ce.useChatPageStore((d)=>d.conversationId),i=ce.useChatPageStore((d)=>d.lastMessageId),s=ce.useChatPageStore((d)=>!!d.streamedMessageId),a=po.useModelsStore((d)=>d.modelByMode),c=wn.reasoningModeToRequestKind?.(o)??"DEFAULT",l=t==="auto",p=a?.fast?.modelId,y=a?.expert?.modelId,w=!l?a?.[t]?.modelId:void 0,f=`${n}:${i}`,L=Ir(p,c,f,l&&!s),$=Ir(y,c,f,l&&!s),R=Ir(w,c,f,!l&&!s),Be=A(()=>L.data?Lr(L.data,"fast"):Zo,[L.data]),Se=A(()=>$.data?Lr($.data,"expert"):Zo,[$.data]),z=A(()=>R.data?Lr(R.data,t):Zo,[R.data,t]);if(l)return r.createElement(Yc,{fast:Be,expert:Se});return r.createElement(qc,{usage:z})}var Er=S({name:"RateLimitDisplay",description:"Shows rate limit usage next to the chat input.",authors:[C.Prism],settings:ma,chatBarButton:{render:Kc}});var Fr=S({name:"Starry",description:"Enables Grok's native starry idle background with shooting stars.",authors:[C.Prism],patches:[{find:"inactivityDelay:1e4,fadeInDuration:1e4",replacement:[{match:/\i\.SHOW_STARRY_IDLE&&!\i&&\i&&"main"===\i\.page&&/,replace:"true&&"},{match:/inactivityDelay:1e4,fadeInDuration:1e4/,replace:"inactivityDelay:0,fadeInDuration:0"}]}]});jt.chrome=!0;jt.hidden=!window.chrome;Yo.preview=!0;var Ar={[jt.name]:jt,[Yn.name]:Yn,[dr.name]:dr,[gr.name]:gr,[yr.name]:yr,[Yo.name]:Yo,[hr.name]:hr,[Sr.name]:Sr,[xr.name]:xr,[Cr.name]:Cr,[cr.name]:cr,[Pr.name]:Pr,[Tr.name]:Tr,[vr.name]:vr,[wr.name]:wr,[Er.name]:Er,[Fr.name]:Fr};var Nr=new b("TurbopackPatcher","#e78284"),fa=500,Zc=0.4,Qc=15000,Jc=15000,ep=5000;function tp(){if(!_.some((n)=>!n.all))return;let t=ro(()=>{if(!_.some((n)=>!n.all))t(),clearTimeout(o)}),o=setTimeout(()=>{t(),Yr()},ep)}function op(){let e=()=>Object.values(D).filter((s)=>!s.started&&V(s.name)&&(s.startAt??"Init")==="TurbopackReady");if(!e().length)return;let t=null,n=ro(()=>{if(t)clearTimeout(t);t=setTimeout(()=>{t=null,so();for(let s of e())Te(s,!0);if(!e().length)n(),clearTimeout(i),Nr.info("All previously failed plugins started after late module load")},200)}),i=setTimeout(()=>{if(n(),t)clearTimeout(t);so();let s=e();for(let c of s)Te(c,!0);let a=e();if(a.length)Nr.warn(`${a.length} plugin(s) still failed after retry window: ${a.map((c)=>c.name).join(", ")}`)},Jc)}function np(){let e=$e();if(!e)return!1;return N().size/e.size>=Zc}function rp(){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();so(),Xr(),ln(),Wt("TurbopackReady"),Nr.info(`${N().size} modules loaded, ready`),op(),tp(),$s()},a=()=>{if(i)return;if(e)clearTimeout(e);if(np()){s();return}e=setTimeout(a,fa)};n=U(I.byProps("useRoutingStore","formatUrl"),()=>{n=null,a()}),o=ro(()=>{if(!i&&!n&&e)clearTimeout(e),e=setTimeout(a,fa)}),t=setTimeout(s,Qc)}function Br(){Zr();for(let e in Ar)Ro(Ar[e]);if(Bs(),Wt("Init"),document.readyState==="loading")document.addEventListener("DOMContentLoaded",()=>Wt("DOMContentLoaded"),{once:!0});else Wt("DOMContentLoaded");rp()}var ga=typeof unsafeWindow<"u"?unsafeWindow:window;if(!ga.Void)Object.defineProperty(ga,"Void",{value:Vr,writable:!1,configurable:!0}),Oo().then(()=>Br());})();