class-studys 9.0.0 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/index-COUSXtyQ-8068ec8f.js +2 -2
- package/ignite-ember.css +182 -0
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./boot-D3vqjHTs-8068ec8f.js","./proxy-runtime-hRo6K69j-8068ec8f.js","./react-BNEptbwn-8068ec8f.js","./motion-B1hdS1Lc-8068ec8f.js","./DarkVeil-CC-BBhGo-8068ec8f.js","./ogl-BWe_HKY6-8068ec8f.js","./AiPage-CbTtOj3W-8068ec8f.js","./fingerprint-Y5nV5FVa-8068ec8f.js","./markdown-BtlGIx_H-8068ec8f.js","./markdown-dIRGbAJA-8068ec8f.css","./AiPage-CTjB7gWo-8068ec8f.css","./GamesPage-D-HV0rpM-8068ec8f.js","./GamesPage--YRYDVtw-8068ec8f.css","./SettingsPage-CsV-N8Y0-8068ec8f.js","./settings-page-B-LiQw8a-8068ec8f.css","./AccountPage-DmlYaBSE-8068ec8f.js","./AccountPage-fg4fizGa-8068ec8f.css","./PlusPage-DBE836ej-8068ec8f.js","./PlusPage-vOvT9Zss-8068ec8f.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
var Kn=Object.defineProperty;var Ht=e=>{throw TypeError(e)};var Gn=(e,t,s)=>t in e?Kn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var ke=(e,t,s)=>Gn(e,typeof t!="symbol"?t+"":t,s),ot=(e,t,s)=>t.has(e)||Ht("Cannot "+s);var r=(e,t,s)=>(ot(e,t,"read from private field"),s?s.call(e):t.get(e)),se=(e,t,s)=>t.has(e)?Ht("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),W=(e,t,s,i)=>(ot(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),H=(e,t,s)=>(ot(e,t,"access private method"),s);import{j as n,r as l,c as Jn}from"./react-BNEptbwn-8068ec8f.js";import{A as Ue,m as Te,R as Yn,a as Xn}from"./motion-B1hdS1Lc-8068ec8f.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function s(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function i(o){if(o.ep)return;o.ep=!0;const c=s(o);fetch(o.href,c)}})();const Vt=(()=>{const e=window;if(e.__lcHs)return e.__lcHs;const t={ps:History.prototype.pushState,rs:History.prototype.replaceState};return e.__lcHs=t,t})();function an(){const e=history;try{Object.defineProperty(e,"pushState",{value:Vt.ps.bind(e),configurable:!0,writable:!0}),Object.defineProperty(e,"replaceState",{value:Vt.rs.bind(e),configurable:!0,writable:!0})}catch{}}function Qn(e,t=null){history.replaceState(t,"",e)}an();const _t=typeof document<"u"?document.baseURI:"/";function Ze(e="",t=_t){const s=e.trim();return s?/^(https?:|data:|blob:)/i.test(s)?s:s.startsWith("#")?new URL(s,t).href:new URL(s.replace(/^\/+/,""),t).href:new URL(".",t).href}function ei(e="",t=_t){return new URL(Ze(e,t)).pathname}function Kt(){return new URL(".",_t).href}const Zn="modulepreload",es=function(e,t){return new URL(e,t).href},Gt={},Ae=function(t,s,i){let o=Promise.resolve();if(s&&s.length>0){let u=function(f){return Promise.all(f.map(g=>Promise.resolve(g).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};const h=document.getElementsByTagName("link"),m=document.querySelector("meta[property=csp-nonce]"),b=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));o=u(s.map(f=>{if(f=es(f,i),f in Gt)return;Gt[f]=!0;const g=f.endsWith(".css"),y=g?'[rel="stylesheet"]':"";if(!!i)for(let j=h.length-1;j>=0;j--){const I=h[j];if(I.href===f&&(!g||I.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${y}`))return;const k=document.createElement("link");if(k.rel=g?"stylesheet":Zn,g||(k.as="script"),k.crossOrigin="",k.href=f,b&&k.setAttribute("nonce",b),document.head.appendChild(k),g)return new Promise((j,I)=>{k.addEventListener("load",j),k.addEventListener("error",()=>I(new Error(`Unable to preload CSS for ${f}`)))})}))}function c(u){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=u,window.dispatchEvent(h),!h.defaultPrevented)throw u}return o.then(u=>{for(const h of u||[])h.status==="rejected"&&c(h.reason);return t().catch(c)})},cn="z9k2r",ut=["settings","tabs","theme","bookmarks","ai.model","ai.threads","_gs5mofn.collapsed","api.base","api.pinned","api.custom","ads.notice","games.saved.v2"],Nt="8068ec8f48688e3d";function ln(e){let t=2166136261;for(let s=0;s<e.length;s++)t^=e.charCodeAt(s),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function un(e,t){return ln(e?`${e} ${t}`:t)}function et(e){return un(Nt,e)}function Qe(e){try{return localStorage.getItem(e)}catch{return null}}function Tt(e,t){try{localStorage.setItem(e,t)}catch{}}function dn(e){try{localStorage.removeItem(e)}catch{}}function ts(){const e=Qe(cn);if(e===null)return null;try{const t=JSON.parse(e);if(typeof(t==null?void 0:t.salt)=="string"&&Array.isArray(t.names))return t}catch{}return null}let Ce;function hn(){Tt(cn,JSON.stringify({salt:Nt,names:[...Ce]}))}function ns(){const e=ts(),t=e?e.salt:null;if(Ce=new Set([...ut,...(e==null?void 0:e.names)??[]]),t!==Nt)for(const s of Ce){const i=t===null?ln(s):un(t,s),o=et(s);if(i===o)continue;const c=Qe(i);c!==null&&(Qe(o)===null&&Tt(o,c),dn(i))}hn()}function ss(e){Ce.has(e)||(Ce.add(e),hn())}if(typeof window<"u")try{ns()}catch{Ce=new Set(ut)}else Ce=new Set(ut);function ge(e){return Qe(et(e))}function we(e,t){ss(e),Tt(et(e),t)}function ye(e){dn(et(e))}function tt(e,t){const s=ge(e);if(s===null)return t;try{return JSON.parse(s)}catch{return t}}function nt(e,t){we(e,JSON.stringify(t))}const pn={id:"tiktok",url:"https://www.tiktok.com/",label:"TikTok"},fn={id:"discord",url:"https://discord.com/_9gmixa5",label:"Discord"},rs=[pn,fn];function mn(){const e=tt("bookmarks",null);return Array.isArray(e)?e.filter(t=>typeof(t==null?void 0:t.url)=="string"&&typeof(t==null?void 0:t.id)=="string").map(t=>t.id==="instagram"?pn:t.id==="spotify"?fn:t):rs}function bn(e){nt("bookmarks",e)}function Jt(e,t){return{id:`bm-${Date.now().toString(36)}-${Math.floor(Math.random()*1e4).toString(36)}`,url:e,label:t}}function _e(e){try{return new URL(e).hostname}catch{return null}}function is(e){const t=_e(e);return t?[`https://icons.duckduckgo.com/ip3/${t}.ico`,`https://www.google.com/s2/favicons?domain=${t}&sz=64`]:[]}const Z=e=>({width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0});function ti({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),n.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),n.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]})}function Pt({size:e=16}){return n.jsx("svg",{...Z(e),children:n.jsx("polyline",{points:"15 18 9 12 15 6"})})}function Lt({size:e=16}){return n.jsx("svg",{...Z(e),children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})}function It({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("polyline",{points:"23 4 23 10 17 10"}),n.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})}function Me({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("circle",{cx:"11",cy:"11",r:"7"}),n.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}function dt({size:e=16}){return n.jsx("svg",{...Z(e),children:n.jsx("path",{d:"M12 5v14M5 12h14"})})}function gn({size:e=14}){return n.jsx("svg",{...Z(e),children:n.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}function wn({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),n.jsx("line",{x1:"9",y1:"4",x2:"9",y2:"20"})]})}function os({size:e=16}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.6,strokeLinecap:"round","aria-hidden":!0,children:[n.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"21"}),n.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),n.jsx("line",{x1:"6.3",y1:"6.3",x2:"17.7",y2:"17.7"}),n.jsx("line",{x1:"17.7",y1:"6.3",x2:"6.3",y2:"17.7"})]})}function vn({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}function Rt({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("path",{d:"M12 3l1.7 4.3L18 9l-4.3 1.7L12 15l-1.7-4.3L6 9l4.3-1.7z"}),n.jsx("path",{d:"M18.5 14l.9 2.1 2.1.9-2.1.9-.9 2.1-.9-2.1-2.1-.9 2.1-.9z"})]})}function Mt({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("line",{x1:"6",y1:"11",x2:"10",y2:"11"}),n.jsx("line",{x1:"8",y1:"9",x2:"8",y2:"13"}),n.jsx("line",{x1:"15",y1:"12",x2:"15.01",y2:"12"}),n.jsx("line",{x1:"18",y1:"10",x2:"18.01",y2:"10"}),n.jsx("rect",{x:"2",y:"6",width:"20",height:"12",rx:"2"})]})}function ni({size:e=16}){return n.jsx("svg",{...Z(e),children:n.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})})}function si({size:e=16}){return n.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":!0,children:n.jsx("rect",{x:"7",y:"7",width:"10",height:"10",rx:"2",fill:"currentColor"})})}function ri({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),n.jsx("circle",{cx:"9",cy:"9",r:"2"}),n.jsx("path",{d:"M21 15l-5-5L5 21"})]})}function ii({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("circle",{cx:"12",cy:"12",r:"9"}),n.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),n.jsx("ellipse",{cx:"12",cy:"12",rx:"4",ry:"9"})]})}function oi({size:e=14}){return n.jsx("svg",{...Z(e),children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})}function ai({size:e=14}){return n.jsxs("svg",{...Z(e),children:[n.jsx("path",{d:"M12 20h9"}),n.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z"})]})}function ci({size:e=14}){return n.jsxs("svg",{...Z(e),children:[n.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),n.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h10"})]})}function li({size:e=14}){return n.jsx("svg",{...Z(e),children:n.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"})})}function as({size:e=14,filled:t=!1}){return n.jsx("svg",{...Z(e),fill:t?"currentColor":"none",children:n.jsx("polygon",{points:"12 2 15 9 22 9.5 17 14.5 18.5 22 12 18 5.5 22 7 14.5 2 9.5 9 9 12 2"})})}function ui({size:e=14}){return n.jsxs("svg",{...Z(e),children:[n.jsx("rect",{x:"5",y:"11",width:"14",height:"9",rx:"2"}),n.jsx("path",{d:"M8 11V7a4 4 0 0 1 8 0v4"})]})}function di({size:e=14}){return n.jsx("svg",{...Z(e),children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})}function yn({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("circle",{cx:"12",cy:"8",r:"4"}),n.jsx("path",{d:"M5 20a7 7 0 0 1 14 0"})]})}function hi({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("path",{d:"M16 3h5v5"}),n.jsx("path",{d:"M4 20 21 3"}),n.jsx("path",{d:"M21 16v5h-5"}),n.jsx("path",{d:"M15 15l6 6"}),n.jsx("path",{d:"M4 4l5 5"})]})}var cs=["https://themannastore.com","https://21baseballacademy.com","https://theavancehotel.com","https://diamondstudsbaseball.com","https://broughton-hotel.com"];const Re=cs;let fe="https://theavancehotel.com";const xn="include",ls="pool-ok";function us(e){return typeof window>"u"||typeof document>"u"?Promise.resolve(!1):new Promise(t=>{const s=document.createElement("iframe"),i=crypto.randomUUID(),o=new URL(e).origin;let c=0,u=!1;const h=b=>{u||(u=!0,window.clearTimeout(c),window.removeEventListener("message",m),s.remove(),t(b))},m=b=>{if(b.source!==s.contentWindow||b.origin!==o||typeof b.data!="object"||b.data===null)return;const f=b.data;f.type===ls&&f.nonce===i&&h(!0)};s.hidden=!0,s.tabIndex=-1,s.setAttribute("aria-hidden","true"),s.setAttribute("sandbox","allow-scripts allow-same-origin"),s.onerror=()=>h(!1),s.src=new URL(`/api/probe?nonce=${encodeURIComponent(i)}`,e).href,window.addEventListener("message",m),c=window.setTimeout(()=>h(!1),2500),document.body.appendChild(s)})}async function kn(e){try{const t=await fetch(`${e}/api/ping`,{cache:"no-store",mode:"cors",signal:AbortSignal.timeout(4e3)});if(!t.ok)return!1;const s=await t.json();return typeof s!="object"||s===null||s.ok!==!0?!1:await us(e)}catch{return!1}}let Fe=null,ht=0;function ds(e){return e.length===0?Promise.resolve(null):new Promise(t=>{let s=e.length,i=!1;for(const o of e)kn(o).then(c=>{if(!i){if(c){i=!0,t(o);return}s-=1,s===0&&t(null)}})})}function hs(e){if(typeof window>"u")return;window.clearTimeout(ht);const t=window.setTimeout(()=>{pt()||fe!==e||kn(e).then(s=>{s||pt()||(Fe=null,ye("api.base"),En())})},45e3);ht=t,typeof t=="object"&&t&&"unref"in t&&t.unref()}function pi(){return[...Re]}function ps(){try{const e=JSON.parse(ge("api.custom")||"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}catch{return[]}}function fi(){return fe||(typeof location<"u"&&location.origin?location.origin:"")}function mi(e){try{return new URL(e).host}catch{return e.replace(/^https?:\/\//i,"")}}function jn(e){const t=e.trim();if(!t)return null;try{const s=/^https?:\/\//i.test(t)?t:`https://${t}`,i=new URL(s);return i.protocol!=="http:"&&i.protocol!=="https:"?null:i.origin}catch{return null}}function pt(){return ge("api.pinned")==="1"}function fs(e){const t=jn(e);return t?(fe=t,Fe=Promise.resolve(t),we("api.base",t),we("api.pinned","1"),!0):!1}function bi(){ye("api.pinned"),ye("api.base"),Fe=null,typeof window<"u"&&window.clearTimeout(ht),fe="https://theavancehotel.com"}function gi(e){const t=jn(e);if(!t)return null;const s=ps();return s.includes(t)||we("api.custom",JSON.stringify([...s,t])),fs(t),t}function En(){if(pt()){const e=ge("api.base");if(e)return fe=e,Promise.resolve(e)}return Re.length===0?Promise.resolve(fe):(Fe??(Fe=(async()=>{const e=ge("api.base"),t=Re.filter(o=>o!==e),s=e&&Re.includes(e)?[e,...t]:[...Re],i=await ds(s);return i?(fe=i,we("api.base",i),hs(i),i):(ye("api.base"),null)})()),Fe)}function Oe(e){return fe+e}function wi(e){return fe?fe.replace(/^http/,"ws")+e:`${location.protocol==="https:"?"wss":"ws"}://${location.host}${e}`}function ms(e){const t=ge(`token.${e}`);return t?{authorization:`Bearer ${t}`}:{}}function at(e,t){if(!t||typeof t!="object")return;const s=t.token;typeof s=="string"&&s&&we(`token.${e}`,s)}function bs(e){ye(`token.${e}`)}async function gs(e){try{const t=await fetch(Oe(`/api/ac?q=${encodeURIComponent(e)}`),{credentials:xn});if(!t.ok)return[];const s=await t.json();return Array.isArray(s)?s.filter(i=>typeof i=="string").slice(0,8):[]}catch{return[]}}function Cn(e){const[t,s]=l.useState([]);return l.useEffect(()=>{const i=e.trim();if(i.length<2){s([]);return}let o=!0;return gs(i).then(c=>{o&&s(c)}),()=>{o=!1}},[e]),t}function ct(e){if(!e)return"";try{const t=new URL(e),s=t.pathname==="/"?"":t.pathname;return t.hostname+s+t.search}catch{return e}}function Dt({url:e,variant:t,disabled:s,bookmarked:i,autoFocus:o,onNavigate:c,onToggleBookmark:u}){const[h,m]=l.useState(ct(e)),[b,f]=l.useState(!1),[g,y]=l.useState(-1),P=l.useRef(null),k=l.useRef(null),j=Cn(b?h:"");l.useEffect(()=>{b||m(ct(e))},[e,b]),l.useEffect(()=>{y(-1)},[j]);const I=()=>g>=0&&j[g]?j[g]:h,T=$=>{var q;const Y=$.trim();Y&&(c(Y),(q=P.current)==null||q.blur())},J=$=>{var Y;$.key==="Escape"?(m(ct(e)),(Y=P.current)==null||Y.blur()):$.key==="Enter"?($.preventDefault(),T(I())):$.key==="ArrowDown"?($.preventDefault(),y(q=>Math.min(j.length-1,q+1))):$.key==="ArrowUp"&&($.preventDefault(),y(q=>Math.max(-1,q-1)))},ne=n.jsx("input",{ref:P,value:h,disabled:s,autoFocus:o,placeholder:"Search or enter URL",spellCheck:!1,autoComplete:"off",onChange:$=>m($.target.value),onKeyDown:J,onFocus:$=>{k.current&&window.clearTimeout(k.current),f(!0),m(e||h),requestAnimationFrame(()=>$.target.select())},onBlur:()=>{k.current=window.setTimeout(()=>f(!1),120)}}),B=b&&j.length>0&&n.jsx("ul",{className:"omnibox-suggestions",children:j.map(($,Y)=>n.jsxs("li",{className:`omnibox-suggestion ${Y===g?"selected":""}`,onMouseEnter:()=>y(Y),onMouseDown:q=>q.preventDefault(),onClick:()=>T($),children:[n.jsx(Me,{size:13}),n.jsx("span",{children:$})]},`${$}-${Y}`))});return t==="_2ta3awx"?n.jsxs("div",{className:"newtab-search-wrap",children:[n.jsxs("form",{className:`_25dnvc2 ${b?"focused":""}`,onSubmit:$=>{$.preventDefault(),T(I())},children:[n.jsx(Me,{size:18}),ne]}),B]}):t==="_gs5mofn"?n.jsxs("div",{className:"sidebar-omnibox-wrap",children:[n.jsxs("form",{className:`sidebar-omnibox ${b?"focused":""}`,onSubmit:$=>{$.preventDefault(),T(I())},children:[n.jsx(Me,{size:13}),ne]}),B]}):n.jsxs("div",{className:"omnibox-wrap",children:[n.jsxs("form",{className:`_w5gq50s ${b?"focused":""}`,onSubmit:$=>{$.preventDefault(),T(I())},children:[ne,e&&u&&n.jsx("button",{type:"button",className:`omnibox-star ${i?"filled":""}`,"aria-label":i?"Remove bookmark":"Add bookmark",onMouseDown:$=>$.preventDefault(),onClick:u,children:n.jsx(as,{size:14,filled:i})})]}),B]})}function An({url:e,size:t=24,fallback:s}){const i=is(e),[o,c]=l.useState(0);return l.useEffect(()=>{c(0)},[e]),!e||o>=i.length?s?n.jsx("span",{className:"favicon-fallback",style:{width:t,height:t},children:s}):n.jsx("img",{src:Ze("favicon.svg"),alt:"",width:t,height:t}):n.jsx("img",{src:i[o],alt:"",width:t,height:t,onError:()=>c(u=>u+1)})}const ws={"/a":"ai","/g":"games","/s":"settings","/u":"account","/p":"plus"},vs={ai:"/a",games:"/g",settings:"/s",account:"/u",plus:"/p"},ys={ai:"Ignite AI",games:"Education",settings:"Settings",account:"Account",plus:"IGNITE OS Plus"};function be(e){return ws[e]??null}function xs(e){return vs[e]}function Sn(e,t){const s=be(e);return s==="ai"?n.jsx(Rt,{size:t}):s==="games"?n.jsx(Mt,{size:t}):e?n.jsx(An,{url:e,size:t+1}):n.jsx(os,{size:t})}function ks(e){return n.jsx("aside",{className:`_gs5mofn ${e.collapsed?"_hmrd7qx":""}`,children:e.collapsed?n.jsx(Es,{...e}):n.jsx(js,{...e})})}function js({tabs:e,activeId:t,activeUrl:s,bookmarks:i,disabled:o,onSelect:c,onNew:u,onClose:h,onReorder:m,onNavigate:b,onOpenBookmark:f,onAddBookmark:g,onRemoveBookmark:y,onToggleCollapse:P,onOpenAi:k,onOpenGames:j,onOpenSettings:I,onOpenAccount:T,onBack:J,onForward:ne,onReload:B}){const $=!!s,Y=be(s),q=e.filter(F=>!be(F.url)),ee=e.filter(F=>be(F.url));return n.jsxs("div",{className:"_shpbk0d",children:[n.jsxs("div",{className:"sidebar-header",children:[n.jsxs("div",{className:"header-left",children:[n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Back",disabled:o||!$,onClick:J,children:n.jsx(Pt,{})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Forward",disabled:o||!$,onClick:ne,children:n.jsx(Lt,{})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Reload",disabled:o||!$,onClick:B,children:n.jsx(It,{})})]}),n.jsx("div",{className:"header-right",children:n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Collapse _gs5mofn",onClick:P,children:n.jsx(wn,{})})})]}),n.jsx(Dt,{url:s,variant:"_gs5mofn",disabled:o,onNavigate:b}),n.jsxs("div",{className:"bookmarks-grid",children:[i.map(F=>n.jsx("button",{className:"bookmark-tile",type:"button",title:F.label??_e(F.url)??F.url,onClick:()=>f(F.url),onContextMenu:E=>{E.preventDefault(),y(F.id)},children:n.jsx(An,{url:F.url,size:22,fallback:(F.label??_e(F.url)??"?").slice(0,1).toUpperCase()})},F.id)),n.jsx("button",{className:"bookmark-tile bookmark-add",type:"button","aria-label":"Add bookmark",onClick:g,children:n.jsx(dt,{size:16})})]}),n.jsxs("button",{className:"new-tab",type:"button",onClick:u,children:[n.jsx("span",{className:"_5t7l5je",children:n.jsx(dt,{size:15})}),n.jsx("span",{children:"New tab"})]}),n.jsx(Yn,{as:"ul",axis:"y",values:q,onReorder:F=>m([...F,...ee]),className:"tab-list",children:n.jsx(Ue,{mode:"popLayout",initial:!1,children:q.map(F=>n.jsxs(Xn,{value:F,as:"li",className:`tab-item ${F.id===t?"active":""}`,onClick:()=>c(F.id),title:F.title||_e(F.url)||"New tab",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,scale:.9,transition:{duration:.55,ease:[.16,1,.3,1]}},transition:{type:"spring",stiffness:700,damping:38,mass:.6},dragTransition:{bounceStiffness:700,bounceDamping:38},whileDrag:{scale:1.03},children:[n.jsx("span",{className:"_5t7l5je",children:Sn(F.url,15)}),n.jsx("span",{className:"tab-title",children:F.title||_e(F.url)||"New tab"}),q.length>1&&n.jsx("button",{className:"tab-close",type:"button","aria-label":"Close tab",onPointerDown:E=>E.stopPropagation(),onClick:E=>{E.stopPropagation(),h(F.id)},children:n.jsx(gn,{size:13})})]},F.id))})}),n.jsxs("button",{className:`_u1z2hr2 ${Y==="ai"?"active":""}`,type:"button",onClick:k,children:[n.jsx("span",{className:"_5t7l5je",children:n.jsx(Rt,{size:15})}),n.jsx("span",{children:"AI"})]}),n.jsxs("button",{className:`_u1z2hr2 ${Y==="games"?"active":""}`,type:"button",onClick:j,children:[n.jsx("span",{className:"_5t7l5je",children:n.jsx(Mt,{size:15})}),n.jsx("span",{children:"Education"})]}),n.jsxs("button",{className:`_u1z2hr2 ${Y==="account"?"active":""}`,type:"button",onClick:T,children:[n.jsx("span",{className:"_5t7l5je",children:n.jsx(yn,{size:15})}),n.jsx("span",{children:"Account"})]}),n.jsxs("button",{className:`_u1z2hr2 ${Y==="settings"?"active":""}`,type:"button",onClick:I,children:[n.jsx("span",{className:"_5t7l5je",children:n.jsx(vn,{size:15})}),n.jsx("span",{children:"Settings"})]})]})}function Es({tabs:e,activeId:t,activeUrl:s,disabled:i,onSelect:o,onNew:c,onToggleCollapse:u,onOpenAi:h,onOpenGames:m,onOpenSettings:b,onOpenAccount:f,onBack:g,onForward:y,onReload:P}){const k=!!s,j=be(s),I=e.filter(T=>!be(T.url));return n.jsxs("div",{className:"_shpbk0d _hmrd7qx",children:[n.jsx("div",{className:"_8i3hapm",children:n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Expand _gs5mofn",title:"Expand _gs5mofn",onClick:u,children:n.jsx(wn,{})})}),n.jsxs("div",{className:"_9a6ojvc",children:[n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Back",title:"Back",disabled:i||!k,onClick:g,children:n.jsx(Pt,{size:15})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Forward",title:"Forward",disabled:i||!k,onClick:y,children:n.jsx(Lt,{size:15})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Reload",title:"Reload",disabled:i||!k,onClick:P,children:n.jsx(It,{size:15})})]}),n.jsx("button",{className:"_54mv697 compact-add",type:"button","aria-label":"New tab",title:"New tab",onClick:c,children:n.jsx(dt,{size:16})}),n.jsx("ul",{className:"_cnmfi4r",children:n.jsx(Ue,{mode:"popLayout",initial:!1,children:I.map(T=>n.jsx(Te.li,{layout:!0,className:`_54mv697 ${T.id===t?"active":""}`,onClick:()=>o(T.id),title:T.title||_e(T.url)||"New tab",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8,transition:{duration:.5,ease:[.16,1,.3,1]}},transition:{duration:.18,ease:[.16,1,.3,1]},whileTap:{scale:.92},children:Sn(T.url,17)},T.id))})}),n.jsxs("div",{className:"_c2b13pw",children:[n.jsx("button",{className:`_1lqv40d ${j==="ai"?"active":""}`,type:"button","aria-label":"AI",title:"AI",onClick:h,children:n.jsx(Rt,{size:14})}),n.jsx("button",{className:`_1lqv40d ${j==="games"?"active":""}`,type:"button","aria-label":"Education",title:"Education",onClick:m,children:n.jsx(Mt,{size:14})}),n.jsx("button",{className:`_1lqv40d ${j==="account"?"active":""}`,type:"button","aria-label":"Account",title:"Account",onClick:f,children:n.jsx(yn,{size:14})}),n.jsx("button",{className:`_1lqv40d ${j==="settings"?"active":""}`,type:"button","aria-label":"Settings",title:"Settings",onClick:b,children:n.jsx(vn,{size:14})})]})]})}function Cs({url:e,disabled:t,collapsed:s,internal:i,bookmarked:o,onNavigate:c,onBack:u,onForward:h,onReload:m,onToggleBookmark:b}){return n.jsxs("div",{className:"_ynqudi4",children:[s&&!i&&n.jsxs("div",{className:"nav-group",children:[n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Back",disabled:t||!e,onClick:u,children:n.jsx(Pt,{})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Forward",disabled:t||!e,onClick:h,children:n.jsx(Lt,{})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Reload",disabled:t||!e,onClick:m,children:n.jsx(It,{})})]}),n.jsx(Dt,{url:e,variant:"_ynqudi4",disabled:t,bookmarked:i?!1:o,onNavigate:c,onToggleBookmark:i?void 0:b})]})}function As(){return n.jsxs("div",{className:"app-footer",children:[n.jsxs("a",{className:"discord-link",href:"https://discord.gg/chromebook",target:"_blank",rel:"noopener noreferrer","aria-label":"Join our Discord server (opens in a new tab)",children:[n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M20.32 4.37a19.79 19.79 0 0 0-4.89-1.52c-.21.38-.45.89-.62 1.3a18.43 18.43 0 0 0-5.62 0c-.17-.41-.42-.92-.63-1.3a19.74 19.74 0 0 0-4.89 1.53C.58 8.97-.26 13.45.16 17.87a19.9 19.9 0 0 0 6 3.03c.49-.66.92-1.36 1.29-2.1-.71-.26-1.38-.59-2.02-.98.17-.12.34-.25.5-.38 3.88 1.81 8.08 1.81 11.92 0 .16.13.33.26.5.38-.64.39-1.32.72-2.02.99.37.73.8 1.43 1.29 2.09a19.82 19.82 0 0 0 6-3.03c.5-5.13-.85-9.57-3.3-13.5ZM8.02 15.15c-1.17 0-2.13-1.07-2.13-2.39s.94-2.39 2.13-2.39c1.19 0 2.15 1.08 2.13 2.39 0 1.32-.94 2.39-2.13 2.39Zm7.96 0c-1.17 0-2.13-1.07-2.13-2.39s.94-2.39 2.13-2.39c1.19 0 2.15 1.08 2.13 2.39 0 1.32-.94 2.39-2.13 2.39Z"})}),"Join Discord"]}),n.jsx("span",{className:"build-id",title:"a0658664f8adc57eb7e44cf1829ae71127c42057",children:"a0658664f8adc57eb7e44cf1829ae71127c42057".slice(0,7)})]})}const Ft=["accelerometer","autoplay","clipboard-read","clipboard-write","encrypted-media","fullscreen","gamepad","gyroscope","keyboard-lock","keyboard-map","pointer-lock","screen-wake-lock","xr-spatial-tracking"],Ss=Ft,_n=Ft.map(e=>`${e} *`).join("; ");Ft.map(e=>`${e}=*`).join(", ");function _s(e){return e.split(/[\s=]/)[0]??""}function Nn(e){const t=(e.getAttribute("allow")??"").split(";").map(o=>o.trim()).filter(Boolean),s=new Set(t.map(_s).filter(Boolean));for(const o of Ss)s.has(o)||t.push(`${o} *`);const i=t.join("; ");e.getAttribute("allow")!==i&&e.setAttribute("allow",i),e.allowFullscreen=!0}function Ns(e){const t=e.getElementsByTagName("iframe"),s=()=>{for(let o=0;o<t.length;o+=1)Nn(t[o])};s();const i=new MutationObserver(s);return i.observe(e.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["allow"]}),i}function Ts(){return{frames:new Map,titleObservers:new Map,allowObservers:new Map,retryTimers:new Map}}function Ps(e,t){var o,c;const s=e.retryTimers.get(t);s&&clearTimeout(s),e.retryTimers.delete(t),(o=e.titleObservers.get(t))==null||o.disconnect(),e.titleObservers.delete(t),(c=e.allowObservers.get(t))==null||c.disconnect(),e.allowObservers.delete(t);const i=e.frames.get(t);if(i){const u=i.controller.frames.indexOf(i);u>=0&&i.controller.frames.splice(u,1)}e.frames.delete(t)}function Yt(e,t,s,i){var h,m;const o=s.retryTimers.get(t);o&&clearTimeout(o),s.retryTimers.delete(t),(h=s.titleObservers.get(t))==null||h.disconnect(),(m=s.allowObservers.get(t))==null||m.disconnect(),Nn(e);let c=0;const u=()=>{let b=null;try{b=e.contentDocument}catch{b=null}if(!b){if(++c<30){const P=setTimeout(()=>{s.retryTimers.delete(t),u()},200);s.retryTimers.set(t,P)}return}s.retryTimers.delete(t);const f=()=>{var k;const P=(k=b.title)==null?void 0:k.trim();P&&i(P)};f();const g=new MutationObserver(f),y=b.head??b.documentElement;y&&g.observe(y,{subtree:!0,childList:!0,characterData:!0}),s.titleObservers.set(t,g),s.allowObservers.set(t,Ns(b))};u()}function Ls(e,t,s,i,o){const c=new window._dln2p7n.Plugin(`_8qzdbvk${s}`);c.tap(e.hooks.init.post,u=>{const h=u;h.isTopLevel&&(o.onUrl(h.client.url.href),Yt(t,s,i,o.onTitle),c.tap(h.client.hooks.lifecycle.navigate,(m,b)=>{const f=b.url;let g=f;try{g=new URL(f,h.client.url.href).href}catch{}o.onUrl(g),Yt(t,s,i,o.onTitle)}))})}function Is(e,t,s,i,o){const c=i.frames.get(t);if(c)return c;const u=e.createFrame(s);return Ls(u,s,t,i,o),i.frames.set(t,u),u}function Rs(){return navigator.hardwareConcurrency<=4||(navigator.deviceMemory??8)<=4}const Ms=l.forwardRef(function({controller:t,tabs:s,activeId:i,onUrl:o,onTitle:c},u){const h=l.useRef(new Map),m=l.useRef(Ts()),b=l.useRef(new Map),f=l.useRef(new Map),g=l.useRef(Rs()).current,[,y]=l.useReducer(k=>k+1,0),P=l.useCallback(()=>{if(t)for(const k of s){const j=b.current.get(k.id);if(!j||f.current.get(k.id)===j)continue;const I=h.current.get(k.id);if(!I)continue;const T=Is(t,k.id,I,m.current,{onUrl:J=>o(k.id,J),onTitle:J=>c(k.id,J)});f.current.set(k.id,j),T.go(j)}},[t,s,o,c]);return l.useEffect(()=>{P()},[P]),l.useEffect(()=>{const k=s.find(j=>j.id===i);k&&k.url&&!be(k.url)&&(b.current.has(k.id)||b.current.set(k.id,k.url),P())},[i,s,P]),l.useEffect(()=>{const k=new Set(s.map(I=>I.id)),j=g?new Set([i]):k;for(const I of m.current.frames.keys())j.has(I)||(Ps(m.current,I),f.current.delete(I));for(const I of b.current.keys())k.has(I)||(b.current.delete(I),f.current.delete(I))},[i,s,g]),l.useImperativeHandle(u,()=>({goTo(k,j){b.current.set(k,j),y()},back(){var k,j;try{(j=(k=h.current.get(i))==null?void 0:k.contentWindow)==null||j.history.back()}catch{}},forward(){var k,j;try{(j=(k=h.current.get(i))==null?void 0:k.contentWindow)==null||j.history.forward()}catch{}},reload(){const k=b.current.get(i),j=m.current.frames.get(i);j&&k&&j.go(k)},getIframe(k){return h.current.get(k)}}),[i]),n.jsx("div",{className:"_rxi5qmt",children:t&&s.filter(k=>!be(k.url)&&(!g||k.id===i)).map(k=>n.jsx("iframe",{title:k.title,ref:j=>{j?h.current.set(k.id,j):h.current.delete(k.id)},className:"_0h17hzp","data-visible":k.id===i&&!!k.url,allow:_n,allowFullScreen:!0,onPointerDown:j=>j.currentTarget.focus()},k.id))})});const IGNITE_HUE=228;const IGNITE_TILES=[{n:"Google",u:"https://www.google.com",g:"G",c:"linear-gradient(160deg,#ffd27a,#ff8a2b 55%,#c2310a)"},{n:"YouTube",u:"https://www.youtube.com",g:"\u25B6",c:"linear-gradient(160deg,#ff9a8a,#f0432a 55%,#8c1608)"},{n:"Wikipedia",u:"https://en.wikipedia.org",g:"W",c:"linear-gradient(160deg,#ffcf6b,#ff9a1f 55%,#d96a00)"},{n:"Reddit",u:"https://www.reddit.com",g:"R",c:"linear-gradient(160deg,#ffa86b,#ff4a1a 55%,#8a1208)"},{n:"GitHub",u:"https://github.com",g:"</>",c:"linear-gradient(160deg,#d9a38a,#9a4a2a 55%,#3d1a0e)"},{n:"Khan Academy",u:"https://www.khanacademy.org",g:"K",c:"linear-gradient(160deg,#ffc08a,#ff6a1a 55%,#b53a0a)"}];const IGNITE_STEPS=[{s:".ignite-hero",t:"Welcome to Ignite OS",d:"This is your home screen. Everything lives in the sidebar on the left and the search bar below. This tour takes about 30 seconds."},{s:".newtab-search-wrap",t:"Search or enter a URL",d:"Type a search or a web address here and press Enter. Suggestions appear as you type."},{s:".ignite-apps",t:"Quick apps",d:"One-tap shortcuts to popular sites. Tap an icon to open it in a new tab."},{s:".sidebar-header",t:"Navigation",d:"Back, forward and reload for the current tab. The button on the right collapses the sidebar."},{s:".sidebar-omnibox-wrap",t:"Sidebar search",d:"The same search bar, always one tap away while you browse."},{s:".bookmarks-grid",t:"Bookmarks",d:"Your saved sites. Tap a tile to open it, or press + to save the page you are on."},{s:".new-tab",t:"New tab",d:"Opens another tab. Your open tabs are listed right below."},{s:".tab-list",t:"Open tabs",d:"Switch between tabs here. The highlighted one is the tab you are viewing."},{s:"._u1z2hr2",i:0,t:"AI",d:"Chat with the built-in AI assistant."},{s:"._u1z2hr2",i:1,t:"Education",d:"The games library (94+ games with thumbnails) and study tools live here."},{s:"._u1z2hr2",i:2,t:"Account",d:"Sign in and manage your Ignite OS account."},{s:"._u1z2hr2",i:3,t:"Settings",d:"Search engine, tab cloak and privacy options."},{s:".app-footer",t:"Community",d:"Join the Discord for help and updates. You can replay this tour any time with the Take the tour button on the home screen."}];function IgniteTour({rootRef:e,open:t,onClose:s}){const[i,o]=l.useState(0),[,c]=l.useState(0);l.useEffect(()=>{if(!t)return;o(0);const h=()=>c(m=>m+1),m=b=>{b.key==="Escape"&&s()};return window.addEventListener("resize",h),window.addEventListener("keydown",m),()=>{window.removeEventListener("resize",h),window.removeEventListener("keydown",m)}},[t]);if(!t)return null;const u=IGNITE_STEPS[i],h=e.current?e.current.getRootNode():null,m=h&&h.querySelectorAll?h.querySelectorAll(u.s)[u.i||0]:null,f=m?m.getBoundingClientRect():null,g=f&&f.width>0&&f.height>0?f:null,y=window.innerWidth,b=window.innerHeight,x=Math.min(340,y-24);let k,j;g?(g.right<320&&y>700?(k=g.right+20,j=g.top):(k=Math.min(Math.max(g.left,12),y-x-12),j=g.bottom+18,j+190>b&&(j=Math.max(12,g.top-198))),j=Math.min(Math.max(j,12),b-200)):(k=(y-x)/2,j=b/2-90);const w=i===IGNITE_STEPS.length-1;return n.jsxs("div",{className:"ignite-tour",role:"dialog","aria-label":"Ignite OS tour",children:[n.jsx("div",{className:"ignite-tour-scrim",onClick:s}),g&&n.jsx("div",{className:"ignite-tour-ring",style:{top:g.top-6,left:g.left-6,width:g.width+12,height:g.height+12}}),n.jsxs("div",{className:"ignite-tour-card",style:{left:k,top:j,width:x},children:[n.jsxs("div",{className:"ignite-tour-step",children:["Step ",i+1," of ",IGNITE_STEPS.length]}),n.jsx("h3",{children:u.t}),n.jsx("p",{children:u.d}),n.jsxs("div",{className:"ignite-tour-actions",children:[n.jsx("button",{type:"button",className:"ignite-tour-skip",onClick:s,children:"Skip"}),n.jsxs("span",{children:[i>0&&n.jsx("button",{type:"button",className:"ignite-tour-btn",onClick:()=>o(i-1),children:"Back"}),n.jsx("button",{type:"button",className:"ignite-tour-btn primary",onClick:()=>w?s():o(i+1),children:w?"Done":"Next"})]})]})]})]})}function Ds({disabled:e,onNavigate:t}){const r=l.useRef(null),[o,c]=l.useState(()=>new Date),[d,p]=l.useState(()=>{try{return!localStorage.getItem("ignite.tour.v1")}catch{return!1}});l.useEffect(()=>{const i=setInterval(()=>c(new Date),15e3);return()=>clearInterval(i)},[]);const q=()=>{p(!1);try{localStorage.setItem("ignite.tour.v1","1")}catch{}},h=o.getHours(),m=h<5?"Late night session":h<12?"Good morning":h<18?"Good afternoon":"Good evening",b=o.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}).replace(/\s?[AP]M$/i,""),f=o.toLocaleDateString([],{weekday:"long",month:"long",day:"numeric"});return n.jsxs("div",{ref:r,className:"_2ta3awx ignite-home",children:[n.jsxs("div",{className:"_hfs48s5 ignite-os-home",children:[n.jsxs("div",{className:"ignite-hero",children:[n.jsxs("div",{className:"ignite-brand",children:[n.jsx("span",{className:"ignite-flame","aria-hidden":"true",children:n.jsx("svg",{viewBox:"0 0 64 64",children:n.jsx("path",{d:"M33 4c1 9-4 12-9 18-4 5-6 10-3 16 2 5 7 8 11 9-5-5-5-11 0-15 2 4 5 5 6 10 3-3 4-9 1-14 6 3 9 10 7 16-2 8-9 12-16 12C20 56 12 49 12 40c0-9 6-13 10-19 4-6 8-10 11-17z"})})}),n.jsxs("h1",{className:"ignite-wordmark","aria-label":"Ignite OS",children:[n.jsx("b",{children:"Ignite"})," OS"]})]}),n.jsx("div",{className:"ignite-clock",children:b}),n.jsx("div",{className:"ignite-date",children:f}),n.jsx("p",{className:"ignite-greeting",children:m+". Search the web or jump into an app."})]}),n.jsx(Dt,{variant:"_2ta3awx",url:"",disabled:e,autoFocus:!d,onNavigate:t}),n.jsx("div",{className:"ignite-apps",role:"list",children:IGNITE_TILES.map(i=>n.jsxs("button",{type:"button",role:"listitem",className:"ignite-app",disabled:e,onClick:()=>t(i.u),children:[n.jsx("span",{className:"ignite-app-icon",children:n.jsx("span",{children:i.g})}),n.jsx("span",{className:"ignite-app-label",children:i.n})]},i.n))}),n.jsx("button",{type:"button",className:"ignite-tour-open",onClick:()=>p(!0),children:"Take the tour"})]}),n.jsx(IgniteTour,{rootRef:r,open:d,onClose:q})]})}function Fs({open:e,onClose:t,onSubmit:s}){const[i,o]=l.useState(""),c=l.useRef(null);if(l.useEffect(()=>{if(!e)return;o(""),requestAnimationFrame(()=>{var m;return(m=c.current)==null?void 0:m.focus()});const h=m=>{m.key==="Escape"&&t()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,t]),!e)return null;const u=h=>{h.preventDefault();const m=i.trim();m&&(s(m),t())};return n.jsx("div",{className:"_t97drno",onClick:t,children:n.jsxs("div",{className:"modal",onClick:h=>h.stopPropagation(),children:[n.jsx("div",{className:"modal-title",children:"Add bookmark"}),n.jsxs("form",{onSubmit:u,children:[n.jsx("div",{className:"modal-field",children:n.jsx("input",{ref:c,value:i,onChange:h=>o(h.target.value),placeholder:"https://example.com",spellCheck:!1,autoComplete:"off"})}),n.jsxs("div",{className:"modal-actions",children:[n.jsx("button",{type:"button",className:"modal-btn ghost",onClick:t,children:"Cancel"}),n.jsx("button",{type:"submit",className:"modal-btn primary",disabled:!i.trim(),children:"Add"})]})]})]})})}function Os({open:e,onAccept:t,onUpgrade:s}){const i=l.useRef(null);return l.useEffect(()=>{if(!e)return;requestAnimationFrame(()=>{var c;return(c=i.current)==null?void 0:c.focus()});const o=c=>{c.key==="Enter"&&t()};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e,t]),n.jsx(Ue,{children:e&&n.jsx(Te.div,{className:"_t97drno _ndpzvua",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2,ease:"easeOut"},children:n.jsxs(Te.div,{className:"modal _vepqnuc",role:"dialog","aria-labelledby":"ads-notice-title",initial:{opacity:0,y:12,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:8,scale:.97},transition:{duration:.28,ease:[.16,1,.3,1]},children:[n.jsx("div",{className:"modal-title",id:"ads-notice-title",children:"A quick note about ads"}),n.jsx("p",{className:"ads-notice-body",children:"Ads help keep IGNITE OS free to run. You may see a few while using the site."}),n.jsx("p",{className:"ads-notice-body",children:"Ignore any ad that asks you to download something, install an extension, or enable notifications — those are not from us."}),n.jsxs("p",{className:"ads-notice-plus",children:["Prefer no ads?"," ",n.jsx("button",{type:"button",className:"ads-notice-plus-link",onClick:s,children:"Upgrade to Plus"})]}),n.jsx("div",{className:"modal-actions",children:n.jsx("button",{ref:i,type:"button",className:"modal-btn primary",onClick:t,children:"Okay"})})]})})})}function Us({open:e,onClose:t,onUpgrade:s}){return l.useEffect(()=>{if(!e)return;const i=window.setTimeout(t,6e3);return()=>window.clearTimeout(i)},[e,t]),n.jsx(Ue,{children:e&&n.jsxs(Te.aside,{className:"plus-perks-toast",role:"status","aria-live":"polite",initial:{opacity:0,y:16,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.98},transition:{duration:.28,ease:[.16,1,.3,1]},children:[n.jsx("button",{type:"button",className:"plus-perks-toast-x",onClick:t,"aria-label":"Dismiss",children:n.jsx(gn,{size:14})}),n.jsx("div",{className:"plus-perks-toast-title",children:"IGNITE OS Plus"}),n.jsx("p",{className:"plus-perks-toast-body",children:"Go ad-free, unlock 3M tokens/day, and get exclusive links."}),n.jsx("button",{type:"button",className:"plus-perks-toast-cta",onClick:s,children:"Learn more"})]})})}function $s({open:e,onClose:t,onSubmit:s}){const[i,o]=l.useState(""),[c,u]=l.useState(0),h=l.useRef(null),m=Cn(e?i:"");l.useEffect(()=>{e&&(o(""),u(0),requestAnimationFrame(()=>{var g;return(g=h.current)==null?void 0:g.focus()}))},[e]),l.useEffect(()=>{u(0)},[m]);const b=g=>{const y=g.trim();y&&(s(y),t())},f=g=>{g.key==="Enter"?(g.preventDefault(),b(m[c]??i)):g.key==="ArrowDown"?(g.preventDefault(),u(y=>Math.min(m.length-1,y+1))):g.key==="ArrowUp"&&(g.preventDefault(),u(y=>Math.max(0,y-1)))};return n.jsx(Ue,{children:e&&n.jsx(Te.div,{className:"spotlight-backdrop",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16,ease:"easeOut"},children:n.jsxs(Te.div,{className:"spotlight",onClick:g=>g.stopPropagation(),initial:{opacity:0,y:-10,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.97},transition:{duration:.2,ease:[.16,1,.3,1]},children:[n.jsxs("div",{className:"spotlight-input",children:[n.jsx(Me,{size:18}),n.jsx("input",{ref:h,value:i,placeholder:"Search or enter URL",spellCheck:!1,autoComplete:"off",onChange:g=>o(g.target.value),onKeyDown:f})]}),m.length>0&&n.jsx("ul",{className:"spotlight-list",children:m.map((g,y)=>n.jsxs("li",{className:`spotlight-item ${y===c?"selected":""}`,onMouseEnter:()=>u(y),onMouseDown:P=>P.preventDefault(),onClick:()=>b(g),children:[n.jsx(Me,{size:14}),n.jsx("span",{children:g})]},`${g}-${y}`))})]})})})}function Tn(){return n.jsxs("p",{className:"plus-blocked-note",children:["Checkout opens a secure Stripe page, which may be blocked on your network. If it doesn't load, join"," ",n.jsx("a",{href:"https://discord.gg/chromebook",target:"_blank",rel:"noreferrer",children:"discord.gg/chromebook"})," ","to purchase there."]})}function Bs({open:e,onClose:t,account:s,heading:i,blurb:o,onSignUp:c}){if(!e)return null;const u=s.status==="signed-in",h=()=>{var f;u?s.checkout(((f=s.user)==null?void 0:f.email)??void 0):c==null||c()},m=i??"IGNITE OS Plus",b=o??"Unlock 3M tokens/day, exclusive links, and an ad-free experience.";return n.jsx("div",{className:"_t97drno upgrade-backdrop",onClick:t,children:n.jsxs("div",{className:"modal",onClick:f=>f.stopPropagation(),children:[n.jsx("div",{className:"modal-title",children:m}),n.jsx("p",{style:{margin:"0 0 0.9rem",fontSize:13,color:"var(--muted)"},children:b}),u&&n.jsx(Tn,{}),n.jsxs("div",{className:"modal-actions",children:[n.jsx("button",{type:"button",className:"modal-btn ghost",onClick:t,children:"Not now"}),n.jsx("button",{type:"button",className:"modal-btn primary",onClick:h,children:u?"Upgrade to Plus":"Sign up to upgrade"})]})]})})}function He(){return{id:`tab-${Date.now().toString(36)}-${Math.floor(Math.random()*1e6).toString(36)}`,title:"New Tab",url:""}}function qs(e){const t=e;return!!t&&typeof t.id=="string"&&typeof t.title=="string"&&typeof t.url=="string"}function zs(){const e=tt("tabs",{}),t=Array.isArray(e.tabs)?e.tabs.filter(qs):[];if(t.length>0){const s=t.some(i=>i.id===e.activeId)?e.activeId:t[0].id;return{tabs:t,activeId:s}}return Pn()}function Pn(){const e=He();return{tabs:[e],activeId:e.id}}function Ws(e,t){switch(t.type){case"open":{const s=He();return{tabs:[...e.tabs,s],activeId:s.id}}case"openInternal":{const s=e.tabs.find(o=>o.url===t.url);if(s)return{...e,activeId:s.id};const i={...He(),url:t.url,title:t.title};return{tabs:[...e.tabs,i],activeId:i.id}}case"openUrl":{const s={...He(),url:t.url,title:t.title};return{tabs:[...e.tabs,s],activeId:s.id}}case"close":{const s=e.tabs.findIndex(c=>c.id===t.id);if(s===-1)return e;const i=e.tabs.filter(c=>c.id!==t.id);if(i.length===0)return Pn();let o=e.activeId;return o===t.id&&(o=i[Math.min(s,i.length-1)].id),{tabs:i,activeId:o}}case"activate":return e.activeId===t.id?e:{...e,activeId:t.id};case"patch":return{...e,tabs:e.tabs.map(s=>s.id===t.id?{...s,...t.patch}:s)};case"reorder":return{...e,tabs:t.tabs};default:return e}}function Hs(){const[e,t]=l.useReducer(Ws,void 0,zs);l.useEffect(()=>{nt("tabs",e)},[e]);const s=l.useCallback(()=>t({type:"open"}),[]),i=l.useCallback((f,g)=>t({type:"openInternal",url:f,title:g}),[]),o=l.useCallback((f,g)=>t({type:"openUrl",url:f,title:g}),[]),c=l.useCallback(f=>t({type:"close",id:f}),[]),u=l.useCallback(f=>t({type:"activate",id:f}),[]),h=l.useCallback((f,g)=>t({type:"patch",id:f,patch:g}),[]),m=l.useCallback(f=>t({type:"reorder",tabs:f}),[]),b=l.useMemo(()=>e.tabs.find(f=>f.id===e.activeId)??e.tabs[0],[e.tabs,e.activeId]);return{tabs:e.tabs,activeId:e.activeId,activeTab:b,open:s,openInternal:i,openUrl:o,close:c,activate:u,patch:h,reorder:m}}function Vs(){const[e,t]=l.useState(()=>mn());l.useEffect(()=>{bn(e)},[e]);const s=l.useCallback(u=>{const h=u.trim();if(!h)return;const m=/^https?:\/\//.test(h)?h:`https://${h}`;t(b=>[...b,Jt(m)])},[]),i=l.useCallback(u=>{t(h=>h.filter(m=>m.id!==u))},[]),o=l.useCallback((u,h)=>{u&&t(m=>{const b=m.findIndex(f=>f.url===u);return b>=0?m.filter((f,g)=>g!==b):[...m,Jt(u,h)]})},[]),c=l.useCallback(u=>!!u&&e.some(h=>h.url===u),[e]);return{bookmarks:e,add:s,remove:i,toggleForUrl:o,has:c}}const ft=[{id:"dark",name:"Dark",mode:"dark"},{id:"light",name:"Light",mode:"light"}],Ks="dark";function mt(e){return ft.find(t=>t.id===e)??ft[0]}function Ot(){const e=ge("theme");return e&&ft.some(t=>t.id===e)?e:e&&e.includes("light")?"light":Ks}function Ut(e){const t=mt(e),s=document.documentElement;s.dataset.theme=t.mode,s.style.removeProperty("--wallpaper"),we("theme",t.id)}function Gs(){const[e,t]=l.useState(Ot),s=l.useRef(!1);l.useEffect(()=>{if(!s.current){s.current=!0;return}const c=document.documentElement;c.classList.add("theme-anim"),Ut(e);const u=window.setTimeout(()=>c.classList.remove("theme-anim"),320);return()=>window.clearTimeout(u)},[e]);const i=l.useCallback(c=>t(c),[]),o=l.useCallback(()=>{t(c=>mt(c).mode==="dark"?"light":"dark")},[]);return{id:e,mode:mt(e).mode,set:i,toggle:o}}const Xt=[{id:"none",label:"None",title:"",favicon:""},{id:"google-classroom",label:"Google Classroom",title:"Home - Classroom",favicon:"https://ssl.gstatic.com/classroom/favicon.png"},{id:"google-forms",label:"Google Forms",title:"Untitled form - Google Forms",favicon:"https://ssl.gstatic.com/docs/spreadsheets/forms/forms_icon_2023q4.ico"},{id:"google-drive",label:"Google Drive",title:"My Drive - Google Drive",favicon:"https://ssl.gstatic.com/images/branding/product/1x/drive_2020q4_32dp.png"},{id:"google-docs",label:"Google Docs",title:"Untitled document - Google Docs",favicon:"https://ssl.gstatic.com/docs/documents/images/kix-favicon7.ico"},{id:"kahoot",label:"Kahoot!",title:"Kahoot!",favicon:"https://kahoot.com/favicon.ico"},{id:"quizlet",label:"Quizlet",title:"Quizlet",favicon:"https://quizlet.com/favicon.ico"},{id:"custom",label:"Custom",title:"",favicon:""}],Ln="Ignite OS",Js=Ze("branding/ignite-os-browser-834cc7f9f1eda4fb.png"),Ys="about:blank";let In=!1;function vi(e){In=e}function Xs(){return In}function yi(e){return Xt.find(t=>t.id===e)??Xt[0]}function Qs(){let e=document.querySelector('link[rel~="icon"]');return e||(e=document.createElement("link"),e.rel="icon",document.head.appendChild(e)),e}function Zs(e,t){const s=e.trim(),i=t.trim();document.title=s||Ln,Qs().href=i||Js}function xi(e){const t=e.trim();if(!t)return{valid:!1,error:"URL is required"};const s=/^https?:\/\//i.test(t)?t:`https://${t}`;let i;try{i=new URL(s)}catch{return{valid:!1,error:"Invalid URL format"}}return i.protocol!=="http:"&&i.protocol!=="https:"?{valid:!1,error:"URL must start with http:// or https://"}:{valid:!0,value:i.toString()}}function er(e,t,s,i){const o=e.document;o.open(),o.close();const c=o.documentElement;let u=o.head,h=o.body;u||(u=o.createElement("head"),c.appendChild(u)),h||(h=o.createElement("body"),c.appendChild(h));const m=o.createElement("meta");m.setAttribute("charset","utf-8"),u.appendChild(m);const b=o.createElement("meta");if(b.name="_rxi5qmt",b.content="width=device-width,initial-scale=1",u.appendChild(b),o.title=s.trim()||Ln,i.trim()){const y=o.createElement("link");y.rel="icon",y.href=i.trim(),u.appendChild(y)}const f=o.createElement("style");f.textContent="html,body{margin:0;height:100%;background:#000}iframe{display:block;width:100%;height:100%;border:0}",u.appendChild(f);const g=o.createElement("iframe");g.src=t,g.referrerPolicy="no-referrer",g.allow=_n,g.allowFullscreen=!0,h.appendChild(g)}function tr(e,t,s){let i=window;try{window.top&&window.top!==window.self&&(i=window.top)}catch{}const o=i.open(Ys,"_blank");if(!o)return{ok:!1,error:"Popup blocked — allow popups for this site, then try again."};const c=location.href.startsWith("about:")?Ze():location.href;try{er(o,c,t,s)}catch{return{ok:!1,error:"Couldn't write to the new window."}}return window.setTimeout(()=>{try{i.location.replace(e)}catch{window.location.replace(e)}},40),{ok:!0}}let $t=document.body;function nr(e){$t=e}function sr(){return $t}function rr(){return $t}function Qt(e){return e===" "?"space":e.trim().toLowerCase()}function ir(e){const t=e;return!!t&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)}function or(e){l.useEffect(()=>{Zs(e.coverTitle,e.coverFavicon)},[e.coverTitle,e.coverFavicon]),l.useEffect(()=>{const s=Qt(e.exitKey),i=e.exitUrl;if(!s||!i)return;const o=h=>{if(!(h.repeat||Xs()||ir(h.target))&&Qt(h.key)===s){h.preventDefault();try{if(window.top&&window.top!==window.self){window.top.location.assign(i);return}}catch{}window.location.assign(i)}},c=sr(),u=o;return c.addEventListener("keydown",u,!0),()=>c.removeEventListener("keydown",u,!0)},[e.exitKey,e.exitUrl]),l.useEffect(()=>{if(!e.confirmLeave)return;const s=i=>{i.preventDefault(),i.returnValue=""};return window.addEventListener("beforeunload",s),()=>window.removeEventListener("beforeunload",s)},[e.confirmLeave]);const t=l.useRef(!1);l.useEffect(()=>{if(!e.autoCoverFrame||t.current||window.self!==window.top)return;const s=()=>{t.current||(t.current=!0,i(),tr(e.exitUrl,e.coverTitle,e.coverFavicon))},i=()=>{window.removeEventListener("pointerdown",s),window.removeEventListener("keydown",s)};return window.addEventListener("pointerdown",s),window.addEventListener("keydown",s),i},[e.autoCoverFrame,e.exitUrl,e.coverTitle,e.coverFavicon])}const bt=[{id:"google",name:"Google",template:"https://www.google.com/search?q=%s"},{id:"duckduckgo",name:"DuckDuckGo",template:"https://duckduckgo.com/?q=%s"},{id:"bing",name:"Bing",template:"https://www.bing.com/search?q=%s"},{id:"brave",name:"Brave",template:"https://search.brave.com/search?q=%s"}],pe={searchEngineId:"duckduckgo",coverPreset:"none",coverTitle:"",coverFavicon:"",autoCoverFrame:!1,exitKey:"`",exitUrl:"https://docs.google.com/document/u/0/",confirmLeave:!1,backgroundMode:"full",accent:"#ffffff",adblock:!0};function ar(e){return bt.some(t=>t.id===e)}function cr(e){return e==="full"||e==="reduced"||e==="mesh"||e==="off"}function lr(e){return typeof e=="string"&&/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e)}function Ie(e,t){return typeof e=="string"?e:t}function lt(e,t){return typeof e=="boolean"?e:t}function Bt(){const e=tt("settings",{});return{searchEngineId:ar(e.searchEngineId)?e.searchEngineId:pe.searchEngineId,coverPreset:Ie(e.coverPreset??e.cloakPreset,pe.coverPreset),coverTitle:Ie(e.coverTitle??e.cloakTitle,pe.coverTitle),coverFavicon:Ie(e.coverFavicon??e.cloakFavicon,pe.coverFavicon),autoCoverFrame:lt(e.autoCoverFrame??e.autoAboutBlank,pe.autoCoverFrame),exitKey:Ie(e.exitKey??e.panicKey,pe.exitKey),exitUrl:Ie(e.exitUrl??e.panicUrl,pe.exitUrl),confirmLeave:lt(e.confirmLeave,pe.confirmLeave),backgroundMode:cr(e.backgroundMode)?e.backgroundMode:pe.backgroundMode,accent:lr(e.accent)?e.accent:pe.accent,adblock:lt(e.adblock,pe.adblock)}}function Rn(e){nt("settings",e)}function Zt(e){return(bt.find(t=>t.id===e)??bt[0]).template}function ur(){const[e,t]=l.useState(Bt);l.useEffect(()=>{Rn(e)},[e]);const s=l.useCallback(i=>{t(o=>({...o,...i}))},[]);return{settings:e,update:s}}function dr(e){const t=l.useRef(e);t.current=e,l.useEffect(()=>{const s=i=>{if(!(i.ctrlKey||i.metaKey)||i.altKey)return;const o=i.key.toLowerCase();o==="t"?(i.preventDefault(),t.current.onNewTab()):o==="w"?(i.preventDefault(),t.current.onCloseTab()):o==="k"?(i.preventDefault(),t.current.onSpotlight()):o>="1"&&o<="9"&&(i.preventDefault(),t.current.onJumpToTab(Number(o)))};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[])}function hr(e){const[t,s]=l.useState(null),[i,o]=l.useState(null);return l.useEffect(()=>{let c=!0,u=0;const h=window.requestIdleCallback,m=f=>h?h(f,{timeout:2500}):window.setTimeout(f,200),b=()=>{Ae(async()=>{const{rebootController:f}=await import("./boot-D3vqjHTs-8068ec8f.js");return{rebootController:f}},__vite__mapDeps([0,1,2,3]),import.meta.url).then(({rebootController:f})=>f().then(g=>{an(),c&&s(g)},g=>{c&&(u+=1,u<30?window.setTimeout(b,Math.min(1e3*u,5e3)):o(g instanceof Error?g:new Error(String(g))))}))};return m(b),()=>{c=!1}},[e]),{controller:t,error:i}}let je=null,qe=null,Ve=null,Ke=!1;const en=new WeakSet;function Mn(){if(!je||Ve===null)return;const e=Ve;Ve=null,Ke=!0;try{je.cookieJar.clear(),je.cookieJar.load(e),je.persistCookies().finally(()=>{Ke=!1})}catch{Ke=!1}}function pr(e,t){if(qe=t,!!e){if(je=e,!en.has(e)){const s=e.persistCookies.bind(e);e.persistCookies=(async()=>{await s(),Ke||qe==null||qe()}),en.add(e)}Mn()}}function fr(){if(!je)return null;try{return je.cookieJar.dump()}catch{return null}}function mr(e){Ve=e,Mn()}const br="https://www.google.com/search?q=%s";function gr(e){return/\s/.test(e)?!1:/^https?:\/\//.test(e)||e.startsWith("localhost")?!0:/^[^\s.]+\.[^\s.]{2,}/.test(e)}function tn(e,t=br){const s=e.trim();return s?/^https?:\/\//.test(s)?s:gr(s)?`https://${s}`:t.replace("%s",encodeURIComponent(s)):""}class gt extends Error{constructor(s,i,o=null){super(i);ke(this,"status");ke(this,"code");this.status=s,this.code=o}}const ce="/api/account";async function wr(e){const t=await e.text();try{const s=JSON.parse(t);return{message:s.error??t,code:s.code??null}}catch{return{message:t||e.statusText,code:null}}}function vr(){async function e(t,s,i){const o={...i==null?void 0:i.headers};let c=i==null?void 0:i.body;(i==null?void 0:i.json)!==void 0&&(o["content-type"]="application/json",c=JSON.stringify(i.json));const u=await fetch(Oe(t+s),{...i,headers:{...o,...ms("account")},body:c,credentials:xn});if(!u.ok){const{message:h,code:m}=await wr(u);throw new gt(u.status,h,m)}if(u.status!==204)return await u.json()}return{me:()=>e(ce,"/me"),login:(t,s,i)=>e(ce,"/auth/login",{method:"POST",json:{email:t,password:s,captcha:i}}).then(o=>(at("account",o),o)),requestSetPassword:(t,s)=>e(ce,"/auth/set-password/request",{method:"POST",json:{email:t,captcha:s}}),setPassword:(t,s,i)=>e(ce,"/auth/set-password",{method:"POST",json:{email:t,code:s,password:i}}).then(o=>(at("account",o),o)),requestReset:(t,s)=>e(ce,"/auth/reset/request",{method:"POST",json:{email:t,captcha:s}}),reset:(t,s,i)=>e(ce,"/auth/reset",{method:"POST",json:{email:t,code:s,password:i}}).then(o=>(at("account",o),o)),logout:()=>(bs("account"),e(ce,"/logout",{method:"POST"})),getSync:()=>e(ce,"/me/sync"),putSync:t=>e(ce,"/me/sync",{method:"PUT",json:{data:t}}),billingStatus:()=>e(ce,"/billing/status"),checkout:(t,s)=>e(ce,"/billing/checkout",{method:"POST",json:{email:t,origin:s}}),billingPortal:t=>e(ce,"/billing/portal",{method:"POST",json:{origin:t}}),verifyCheckout:t=>e(ce,`/billing/verify?session_id=${encodeURIComponent(t)}`),setDiscord:t=>e(ce,"/me/discord",{method:"POST",json:{discordHandle:t}})}}function yr(){const e={bookmarks:mn(),settings:Bt(),themeId:Ot()},t=fr();return t!==null&&(e.proxyCookies=t),e}function xr(e){if(typeof e!="object"||e===null)return;const{bookmarks:t,settings:s,themeId:i,proxyCookies:o}=e;Array.isArray(t)&&bn(t),s&&typeof s=="object"&&Rn({...Bt(),...s}),typeof i=="string"&&Ut(i),typeof o=="string"&&mr(o)}var ze={exports:{}},nn;function kr(){return nn||(nn=1,(function(e,t){(()=>{var q,ee,F,E,R,S,M,z,oe,re,le,p,ue,ie,de,he,me,C,Se,wt,vt,Ge,yt,xt,kt,Dn,jt,Fn,On,Et,Je,Ct,Un,Ye,Be,$n,Xe;const s="vibrate"in navigator&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(typeof window>"u")return;const i=["#f5c2e7","#cba6f7","#f38ba8","#fab387","#f9e2af","#a6e3a1","#94e2d5","#89dceb","#b4befe"],o=(G,_,a)=>{const d=_===0?"9999px":"0",w=_===a-1?"9999px":"0";return`color:#1e1e2e;background:${(v=>{if(v==="cap")return"#89b4fa";let x=0;for(let A=0;A<v.length;A++)x=v.charCodeAt(A)+((x<<5)-x);return i[Math.abs(x)%i.length]})(G)};margin-left:${_?"-6px":0};padding:0 6px;border-radius:${d} ${w} ${w} ${d};font-weight:600`},c={};for(const G of["debug","info","warn","error"])c[G]=(_,...a)=>{if(window.CAP_SILENT||G==="debug"&&!window.CAP_DEBUG)return;const d=_.map(v=>`%c${v}`).join(" "),w=_.map((v,x)=>o(v,x,_.length))};const u=G=>G?["cap",G]:["cap"],h=G=>`${Math.round(performance.now()-G)}ms`,m=(G,_)=>Object.assign(new Error(_),{code:G}),b=(G,_={})=>window!=null&&window.CAP_CUSTOM_FETCH?window.CAP_CUSTOM_FETCH(G,_):fetch(G,_),f=(G,_)=>_?_.aborted?Promise.reject(m("aborted","aborted")):Promise.race([G,new Promise((a,d)=>_.addEventListener("abort",()=>d(m("aborted","aborted")),{once:!0}))]):G,g="initial-state,verifying-label,solved-label,error-label,required-label,troubleshooting-label,group-aria-label,verify-aria-label,verifying-aria-label,verified-aria-label,error-aria-label".split(","),y={"zh-cn":"确认你是真人/正在验证.../你是真人/出错了。请重试。/请确认你是真人/故障排除/Cap 验证/点击以确认你是真人/正在验证你是真人,请稍候/我们已确认你是真人,你可以继续了/发生错误,请重试",es:"Verifica que eres humano/Verificando.../Eres humano/Error. Inténtalo de nuevo./Verifica que eres humano/Solucionar problemas/Verificación de Cap/Haz clic para verificar que eres humano/Verificando que eres humano, espera/Hemos verificado que eres humano, ya puedes continuar/Se produjo un error, inténtalo de nuevo",hi:"पुष्टि करें कि आप मानव हैं/सत्यापित हो रहा है.../आप मानव हैं/त्रुटि। पुनः प्रयास करें।/कृपया पुष्टि करें कि आप मानव हैं/समस्या निवारण/Cap सत्यापन/पुष्टि करने के लिए क्लिक करें कि आप मानव हैं/सत्यापित किया जा रहा है कि आप मानव हैं, प्रतीक्षा करें/हमने पुष्टि कर दी है कि आप मानव हैं, अब आप जारी रख सकते हैं/एक त्रुटि हुई, पुनः प्रयास करें",ar:"تحقق من أنك إنسان/جارٍ التحقق.../أنت إنسان/خطأ. حاول مرة أخرى./يرجى التحقق من أنك إنسان/استكشاف الأخطاء وإصلاحها/تحقق Cap/انقر للتحقق من أنك إنسان/جارٍ التحقق من أنك إنسان، يرجى الانتظار/لقد تحققنا من أنك إنسان، يمكنك المتابعة الآن/حدث خطأ، يرجى المحاولة مرة أخرى",pt:"Sou humano/Verificando.../Você é humano/Erro. Tente novamente./Verifique que você é humano/Solução de problemas/Verificação Cap/Clique para verificar que você é humano/Verificando que você é humano, aguarde/Verificamos que você é humano, você pode continuar/Ocorreu um erro, tente novamente",ru:"Я человек/Проверка.../Вы человек/Ошибка. Повторите./Подтвердите, что вы человек/Устранение неполадок/Проверка Cap/Нажмите, чтобы подтвердить, что вы человек/Проверяем, что вы человек, подождите/Мы подтвердили, что вы человек, можете продолжить/Произошла ошибка, повторите попытку",ja:"私は人間です/確認中.../あなたは人間です/エラー。再試行を。/あなたが人間であることを確認してください/トラブルシューティング/Cap 認証/クリックして人間であることを確認/あなたが人間であることを確認しています。お待ちください/あなたが人間であることを確認しました。続行できます/エラーが発生しました。もう一度お試しください",de:"Ich bin ein Mensch/Wird überprüft.../Sie sind ein Mensch/Fehler. Erneut versuchen./Bitte bestätigen Sie, dass Sie ein Mensch sind/Fehlerbehebung/Cap-Verifizierung/Klicken, um zu bestätigen, dass Sie ein Mensch sind/Überprüfung, ob Sie ein Mensch sind, bitte warten/Wir haben bestätigt, dass Sie ein Mensch sind, Sie können fortfahren/Ein Fehler ist aufgetreten, bitte erneut versuchen",fr:"Je suis humain/Vérification.../Vous êtes humain/Erreur. Réessayez./Veuillez vérifier que vous êtes humain/Dépannage/Vérification Cap/Cliquez pour vérifier que vous êtes humain/Vérification que vous êtes humain, veuillez patienter/Nous avons vérifié que vous êtes humain, vous pouvez continuer/Une erreur s'est produite, veuillez réessayer"};function P(G,_){let a=(function(v){let x=2166136261;for(let A=0;A<v.length;A++)x^=v.charCodeAt(A),x+=(x<<1)+(x<<4)+(x<<7)+(x<<8)+(x<<24);return x>>>0})(G),d="";function w(){return a^=a<<13,a^=a>>>17,a^=a<<5,a>>>0}for(;d.length<_;)d+=w().toString(16).padStart(8,"0");return d.substring(0,_)}let k=null;async function j(G){const _=(d=>{const w=atob(d),v=new Uint8Array(w.length);for(let x=0;x<w.length;x++)v[x]=w.charCodeAt(x);return v})(G),a=new TextDecoder().decode(await(async function(d){if(typeof DecompressionStream<"u")try{const w=new DecompressionStream("deflate-raw"),v=w.writable.getWriter(),x=w.readable.getReader();v.write(d).then(()=>v.close()).catch(()=>{});const A=[];for(;;){const{done:X,value:te}=await x.read();if(X)break;A.push(te)}let N=0;for(const X of A)N+=X.length;const O=new Uint8Array(N);let L=0;for(const X of A)O.set(X,L),L+=X.length;return O}catch{}return k||(k=new Promise((w,v)=>{const x=window.CAP_PAKO_URL||"https://cdn.jsdelivr.net/npm/pako@2.1.0/dist/pako_inflate.min.js";c.debug(u("instr"),"DecompressionStream unavailable, loading pako from",x);const A=document.createElement("script");A.src=x;const N=window.CAP_SCRIPT_NONCE||window.CAP_CSS_NONCE;N&&A.setAttribute("nonce",N),A.onload=()=>{var O;(O=window.pako)!=null&&O.inflateRaw?w(window.pako):v(new Error("pako loaded but inflateRaw is missing"))},A.onerror=()=>{k=null,v(new Error(`failed to load pako fallback from ${x}`))},document.head.appendChild(A)})),(await k).inflateRaw(d)})(_));return new Promise(d=>{var w=setTimeout(()=>{A(),d({__timeout:!0})},2e4),v=document.createElement("iframe");v.setAttribute("sandbox","allow-scripts"),v.setAttribute("aria-hidden","true"),v.style.cssText="position:absolute;width:1px;height:1px;top:-9999px;left:-9999px;border:none;opacity:0;pointer-events:none;";var x=!1;function A(){x||(x=!0,clearTimeout(w),window.removeEventListener("message",N),v.parentNode&&v.parentNode.removeChild(v))}function N(X){if(v.contentWindow&&X.source===v.contentWindow){var te=X.data;te&&typeof te=="object"&&(te.type==="cap:instr"?(A(),te.blocked?d({__blocked:!0,blockReason:te.blockReason||"automated_browser"}):te.result?d(te.result):d({__timeout:!0})):te.type==="cap:error"&&(A(),d({__timeout:!0})))}}window.addEventListener("message",N);const O=window.CAP_SCRIPT_NONCE||window.CAP_CSS_NONCE,L=O?` nonce="${String(O).replace(/"/g,""")}"`:"";v.srcdoc='<!DOCTYPE html><html><head><meta charset="UTF-8"></head><body><script'+L+">"+a+`
|
|
3
|
-
<\/script></body></html>`,document.body.appendChild(v)})}let I=null;const T=()=>{if(I)return I;const G=window.CAP_CUSTOM_WASM_URL||"https://cdn.jsdelivr.net/npm/@cap.js/wasm@0.0.7/browser/cap_wasm_bg.wasm",_=performance.now();return c.debug(u("wasm"),"fetching",G),I=fetch(G).then(a=>{if(!a.ok)throw new Error(`Failed to fetch wasm: ${a.status}`);return a.arrayBuffer()}).then(a=>WebAssembly.compile(a)).then(a=>(c.debug(u("wasm"),`ready in ${h(_)}`),a)).catch(a=>{throw I=null,c.warn(u("wasm"),`load failed (${h(_)}):`,a.message||a),a}),I};typeof WebAssembly=="object"&&typeof WebAssembly.compile=="function"&&T().catch(()=>{});let J=null;function ne(){return J||(J=URL.createObjectURL(new Blob(['(()=>{const e=(e,...t)=>{self.CAP_SILENT||console[e]("[cap worker]",...t)},t=async({salt:t,target:n})=>{let s=0;const r=new TextEncoder,o=4*n.length,a=Math.floor(o/8),l=o%8,i=n.length%2==0?n:`${n}0`,c=i.length/2,f=new Uint8Array(c);for(let e=0;e<c;e++)f[e]=parseInt(i.substring(2*e,2*e+2),16);const g=l>0?255<<8-l&255:0;for(;;)try{for(let e=0;e<5e4;e++){const e=t+s,n=r.encode(e),o=await crypto.subtle.digest("SHA-256",n),i=new Uint8Array(o);let c=!0;for(let e=0;e<a;e++)if(i[e]!==f[e]){c=!1;break}if(c&&l>0&&(i[a]&g)!==(f[a]&g)&&(c=!1),c)return void self.postMessage({nonce:s,found:!0});s++}}catch(t){return e("error","fallback solver crashed:",t.message||t),void self.postMessage({found:!1,error:t.message})}},n=e=>{const t=BigInt("0x"+e.N);let n=BigInt("0x"+e.x);const s=0|e.t,r=Math.max(64,Math.floor(s/50)),o=performance.now();for(let e=0;e<s;e+=r){const o=Math.min(s,e+r);for(let s=e;s<o;s++)n=n*n%t;o<s&&self.postMessage({progress:o/s})}self.postMessage({found:!0,y:n.toString(16),durationMs:(performance.now()-o).toFixed(2)})};if("object"!=typeof WebAssembly||"function"!=typeof WebAssembly?.instantiate)return e("warn","WebAssembly unavailable, using JS fallback solver (significantly slower)"),void(self.onmessage=async({data:e})=>"rsw"===e?.kind?n(e):t({salt:e.salt,target:e.target}));let s=null;self.onmessage=async({data:r})=>{if("rsw"===r?.kind)return n(r);const{salt:o,target:a,wasmModule:l}=r;if(l instanceof WebAssembly.Module&&null===s){const n=(t=>{try{let e,n=0,r=null;const o=()=>(null!==r&&0!==r.byteLength||(r=new Uint8Array(e.memory.buffer)),r),a=new TextEncoder,l=(e,t,s)=>{if(void 0===s){const s=a.encode(e),r=t(s.length,1)>>>0;return o().subarray(r,r+s.length).set(s),n=s.length,r}let r=e.length,l=t(r,1)>>>0;const i=o();let c=0;for(;c<r;c++){const t=e.charCodeAt(c);if(t>127)break;i[l+c]=t}if(c!==r){0!==c&&(e=e.slice(c));const t=c+3*e.length;l=s(l,r,t,1)>>>0,r=t;const n=o().subarray(l+c,l+r),{written:i}=a.encodeInto(e,n);c+=i,l=s(l,r,c,1)>>>0}return n=c,l},i={wbg:{}};i.wbg.__wbindgen_init_externref_table=()=>{const t=e.__wbindgen_export_0,n=t.grow(4);t.set(0,void 0),t.set(n+0,void 0),t.set(n+1,null),t.set(n+2,!0),t.set(n+3,!1)};const c=new WebAssembly.Instance(t,i);return e=c.exports,e.__wbindgen_start&&e.__wbindgen_start(),s=(t,s)=>{const r=l(t,e.__wbindgen_malloc,e.__wbindgen_realloc),o=n,a=l(s,e.__wbindgen_malloc,e.__wbindgen_realloc),i=n;return BigInt.asUintN(64,e.solve_pow(r,o,a,i))},!0}catch(t){return e("error","wasm init failed:",t.message||t),!1}})(l);if(!n)return e("warn","wasm init failed, falling back to JS solver"),t({salt:o,target:a})}if(null===s)return e("warn","no wasm module provided, falling back to JS solver"),t({salt:o,target:a});try{const e=performance.now(),t=s(o,a),n=performance.now();self.postMessage({nonce:Number(t),found:!0,durationMs:(n-e).toFixed(2)})}catch(t){e("error","solve_pow threw:",t.message||t),self.postMessage({found:!1,error:t.message||String(t)})}},self.onerror=e=>{self.postMessage({found:!1,error:e})}})();'],{type:"application/javascript"})),J)}class B{constructor(_){this._size=_,this._workers=[],this._idle=[],this._queue=[],this._wasmModule=null,this._spawnFailures=0}setWasm(_){this._wasmModule=_}_spawn(){const _=ne(),a=new Worker(_);return a._busy=!1,this._workers.push(a),this._idle.push(a),a}_replaceWorker(_){const a=this._workers.indexOf(_);a!==-1&&this._workers.splice(a,1);const d=this._idle.indexOf(_);d!==-1&&this._idle.splice(d,1);try{_.terminate()}catch{}return this._spawnFailures++,c.warn(u("pool"),`worker died, replacing (attempt ${this._spawnFailures}/3)`),this._spawnFailures>3?(c.error(u("pool"),"worker spawn failed repeatedly, giving up"),null):this._spawn()}_ensureSize(_){for(;this._workers.length<_;)this._spawn()}run(_,a){return new Promise((d,w)=>{this._queue.push({salt:_,target:a,resolve:d,reject:w}),this._dispatch()})}runMsg(_,a){return new Promise((d,w)=>{this._queue.push({msg:_,onProgress:a,resolve:d,reject:w}),this._dispatch()})}_dispatch(){for(;this._idle.length>0&&this._queue.length>0;){const _=this._idle.shift(),a=this._queue.shift(),{resolve:d,reject:w}=a,v=a.msg!==void 0;let x=!1;const A=({data:O})=>{if(!x){if(!O||typeof O.progress!="number"||O.found)x=!0,_.removeEventListener("message",A),_.removeEventListener("error",N),this._spawnFailures=0,this._idle.push(_),O.found?d(v?O:O.nonce):w(new Error(O.error||"worker failed")),this._dispatch();else if(a.onProgress)try{a.onProgress(O.progress)}catch{}}},N=O=>{if(x)return;x=!0,_.removeEventListener("message",A),_.removeEventListener("error",N);const L=this._replaceWorker(_);w(O),L&&this._dispatch()};_.addEventListener("message",A),_.addEventListener("error",N),v?_.postMessage(a.msg):this._wasmModule?_.postMessage({salt:a.salt,target:a.target,wasmModule:this._wasmModule},[]):_.postMessage({salt:a.salt,target:a.target})}}terminate(){for(const _ of this._workers)try{_.terminate()}catch{}this._workers=[],this._idle=[],this._queue=[]}}class $ extends HTMLElement{constructor(){super();se(this,C);se(this,q,null);se(this,ee,navigator.hardwareConcurrency||8);ke(this,"token",null);se(this,F);se(this,E);se(this,R);se(this,S);se(this,M);se(this,z);se(this,oe,!1);se(this,re);se(this,le);se(this,p,null);se(this,ue,null);se(this,ie,null);se(this,de,null);se(this,he,null);se(this,me,null);se(this,Be,()=>{if(r(this,E)){try{this.scrollIntoView({behavior:"smooth",block:"center"})}catch{this.scrollIntoView()}r(this,E).classList.remove("invalid"),r(this,E).offsetWidth,r(this,E).classList.add("invalid"),setTimeout(()=>{var a;return(a=r(this,E))==null?void 0:a.classList.remove("invalid")},1500)}});r(this,re)&&r(this,re).forEach((a,d)=>{this.removeEventListener(d.slice(2),a)}),W(this,re,new Map),this.boundHandleProgress=this.handleProgress.bind(this),this.boundHandleSolve=this.handleSolve.bind(this),this.boundHandleError=this.handleError.bind(this),this.boundHandleReset=this.handleReset.bind(this);try{W(this,le,this.attachInternals())}catch{}}getI18nText(a,d){var w;return this.getAttribute(`data-cap-i18n-${a}`)||((w=r(this,he))==null?void 0:w[a])||d}static get observedAttributes(){return["onsolve","onprogress","onreset","onerror","data-cap-worker-count","data-cap-i18n-initial-state","required"]}initialize(){ne(),W(this,me,new AbortController),r(this,p)||W(this,p,H(this,C,wt).call(this)),r(this,ie)||(W(this,ie,new B(1)),r(this,ie)._spawn())}attributeChangedCallback(a,d,w){var v;if(a.startsWith("on")){const x=a.slice(2),A=r(this,re).get(a);if(A&&this.removeEventListener(x,A),w){const N=O=>{const L=this.getAttribute(a);typeof window[L]=="function"&&window[L].call(this,O)};r(this,re).set(a,N),this.addEventListener(x,N)}}a==="data-cap-worker-count"&&this.setWorkersCount(parseInt(w,10)),a==="data-cap-i18n-initial-state"&&r(this,E)&&((v=r(this,E))!=null&&v.querySelector(".label.active"))&&this.animateLabel(this.getI18nText("initial-state","Verify you're human")),a==="required"&&H(this,C,Ye).call(this)}async connectedCallback(){W(this,z,this),this.shadowRoot?W(this,F,this.shadowRoot):W(this,F,this.attachShadow({mode:"open"})),r(this,E)||W(this,E,document.createElement("div")),H(this,C,Un).call(this),this.createUI(),this.addEventListeners(),this.initialize(),r(this,R).removeAttribute("disabled");const a=this.getAttribute("data-cap-worker-count"),d=a?parseInt(a,10):null;this.setWorkersCount(d||navigator.hardwareConcurrency||8),r(this,z).innerHTML=`<input type="hidden" name="${r(this,C,Et)}">`,c.debug(u(),`widget ready (workers=${r(this,ee)}, haptics=${r(this,C,Se)})`),H(this,C,yt).call(this),H(this,C,Ye).call(this),this.addEventListener("invalid",r(this,Be))}async solve(){var w,v;if(r(this,oe))return;H(this,C,Xe).call(this);const a=performance.now(),d=(w=r(this,me))==null?void 0:w.signal;c.debug(u("solve"),"starting");try{W(this,oe,!0),this.updateUI("verifying",this.getI18nText("verifying-label","Verifying..."),!0),r(this,R).setAttribute("aria-label",this.getI18nText("verifying-aria-label","Verifying you're a human, please wait")),this.dispatchEvent("progress",{progress:0});try{let x,A,N=this.getAttribute("data-cap-api-endpoint");if(!N&&(window!=null&&window.CAP_CUSTOM_FETCH))N="/";else if(!N)throw m("missing_endpoint","Missing API endpoint. Either custom fetch or an API endpoint must be provided.");if(N.endsWith("/")||(N+="/"),r(this,p).state==="done"&&r(this,p).token&&r(this,p).tokenExpires&&Date.now()<r(this,p).tokenExpires)return H(this,C,Ct).call(this);if(r(this,p).state==="done")x=r(this,p).results,A=r(this,p).challengeResp,this.dispatchEvent("progress",{progress:100});else if(r(this,p).state==="solving"||r(this,p).state==="redeeming"||r(this,p).state==="fetching"||r(this,p).state==="waiting"){r(this,p).state==="waiting"&&(r(this,ue)&&(clearTimeout(r(this,ue)),W(this,ue,null)),r(this,p).state="waiting",H(this,C,jt).call(this)),r(this,p).pendingPromotion=r(this,ee),r(this,p).promoteFn&&r(this,p).promoteFn(r(this,ee));const V=setInterval(()=>{if(d!=null&&d.aborted||!r(this,p))return void clearInterval(V);const Q=r(this,p).state;if(Q==="done"||Q==="error")return void clearInterval(V);const xe=r(this,p).challenges?r(this,p).challenges.length:1,Pe=r(this,p).completedCount,Le=Q==="redeeming"?99:Q==="fetching"||Q==="waiting"?0:Math.min(98,Math.round(Pe/xe*100));this.dispatchEvent("progress",{progress:Le})},150);if(await new Promise(Q=>r(this,p).onSettled(Q)),clearInterval(V),(d==null?void 0:d.aborted)||!r(this,p))return;if(r(this,p).state==="idle"&&((v=r(this,p).challengeResp)==null?void 0:v.format)===2&&Array.isArray(r(this,p).challengeResp.challenges))A=r(this,p).challengeResp,r(this,p).challengeResp=null,x=await this.solveChallengesV2(A.challenges,d);else{if(r(this,p).state!=="done")throw m("solve_failed","Unable to solve challenge, self-hosted instance likely down. This is not an issue with Cap.");if(r(this,p).token&&r(this,p).tokenExpires&&Date.now()<r(this,p).tokenExpires)return H(this,C,Ct).call(this);x=r(this,p).results,A=r(this,p).challengeResp,this.dispatchEvent("progress",{progress:100})}}else{const V=r(this,p).challengeResp;if((V==null?void 0:V.format)===2&&Array.isArray(V.challenges))A=V,r(this,p).challengeResp=null;else{const Q=await b(`${N}challenge`,{method:"POST",signal:d});try{A=await Q.json()}catch{throw m("challenge_parse_error","Failed to parse challenge response from server")}if(A.error)throw m("network_error",A.error)}if(A.format===2&&Array.isArray(A.challenges))x=await this.solveChallengesV2(A.challenges,d);else{const{challenge:Q,token:xe}=A;let Pe=Q;if(!Array.isArray(Pe)){let Le=0;Pe=Array.from({length:Q.c},()=>(Le++,[P(`${xe}${Le}`,Q.s),P(`${xe}${Le}d`,Q.d)]))}x=await this.solveChallenges(Pe,d)}}const O=A.instrumentation?j(A.instrumentation):Promise.resolve(null),L=await O;if(d!=null&&d.aborted||!r(this,p))return;if(L!=null&&L.__timeout||L!=null&&L.__blocked){b(`${N}redeem`,{method:"POST",body:JSON.stringify({token:A.token,solutions:x,...L.__blocked&&{instr_blocked:!0},...L.__timeout&&{instr_timeout:!0}}),headers:{"Content-Type":"application/json"},signal:d}).catch(()=>{}),this.updateUIBlocked(this.getI18nText("error-label","Error"),L==null?void 0:L.__blocked),r(this,R).setAttribute("aria-label",this.getI18nText("error-aria-label","An error occurred, please try again"));const V=L!=null&&L.__blocked?"instr_blocked":"instr_timeout",Q=L!=null&&L.__blocked?`Instrumentation blocked (${L.blockReason||"automated_browser"})`:"Instrumentation timed out";this.removeEventListener("error",this.boundHandleError);const xe=new CustomEvent("error",{bubbles:!0,composed:!0,detail:{isCap:!0,code:V,message:Q}});return super.dispatchEvent(xe),this.addEventListener("error",this.boundHandleError),this.executeAttributeCode("onerror",xe),c.error(u("instr"),`[${V}] ${Q}`),void W(this,oe,!1)}const{token:X}=A,te=await b(`${N}redeem`,{method:"POST",body:JSON.stringify({token:X,solutions:x,...L&&{instr:L}}),headers:{"Content-Type":"application/json"},signal:d});let U;try{U=await te.json()}catch{throw m("redeem_failed","Failed to parse server response")}if(d!=null&&d.aborted||!r(this,p))return;if(this.dispatchEvent("progress",{progress:100}),!U.success)throw m("invalid_solution",U.error||"Invalid solution");H(this,C,Je).call(this,U.token),this.dispatchEvent("solve",{token:U.token}),this.token=U.token,H(this,C,vt).call(this),r(this,q)&&clearTimeout(r(this,q));const K=new Date(U.expires).getTime()-Date.now();return K>0&&K<864e5?W(this,q,setTimeout(()=>this.reset(),K)):this.error("Invalid expiration time","invalid_expires"),r(this,R).setAttribute("aria-label",this.getI18nText("verified-aria-label","We have verified you're a human, you may now continue")),r(this,C,Se)&&navigator.vibrate([10,50,20,30,40]),c.debug(u("solve"),`verified in ${h(a)}`),H(this,C,kt).call(this),{success:!0,token:this.token}}catch(x){if(d!=null&&d.aborted||!r(this,p))return;throw r(this,R).setAttribute("aria-label",this.getI18nText("error-aria-label","An error occurred, please try again")),this.error(x.message,x.code||"solve_failed"),x}}finally{W(this,oe,!1)}}async solveChallengesV2(a,d){const w=a.length;let v=0;const x=new Array(a.length);for(let U=0;U<a.length;U++){const K=a[U];if(!K||typeof K!="object"||K.protocol!=="sha256-pow"&&K.protocol!=="rsw"&&K.protocol!=="instrumentation")throw m("challenge_unsupported",`unsupported format-2 protocol '${K==null?void 0:K.protocol}'`)}let A=null;if(typeof WebAssembly=="object"&&typeof WebAssembly.instantiate=="function")try{A=await T()}catch(U){c.warn(u("wasm"),"unavailable, falling back to JS solver:",U.message||U)}const N=Math.max(1,Math.min(r(this,ee),a.length)),O=new B(N);O.setWasm(A),O._ensureSize(N);const L=(U,K)=>Promise.race([U,new Promise((V,Q)=>setTimeout(()=>Q(new Error(`[cap] ${K} timed out after 60000ms`)),6e4))]),X=new Array(a.length).fill(0),te=()=>{const U=X.reduce((V,Q)=>V+Q,0)+v,K=Math.min(99,Math.round(U/w*100));this.dispatchEvent("progress",{progress:K})};try{await f(Promise.all(a.map((U,K)=>U.protocol==="sha256-pow"?L(O.run(U.payload.salt,U.payload.target),`sha256-pow worker #${K}`).then(V=>{x[K]={nonce:Number(V)},X[K]=0,v++,te()}):U.protocol==="rsw"?L(O.runMsg({kind:"rsw",N:U.payload.N,x:U.payload.x,t:0|U.payload.t},V=>{X[K]=V,te()}),`rsw worker #${K}`).then(V=>{x[K]={y:V.y},X[K]=0,v++,te()}):j(U.payload.blob).then(V=>{x[K]=V!=null&&V.__timeout?{timeout:!0}:V!=null&&V.__blocked?{blocked:!0}:{instr:V},X[K]=0,v++,te()}))),d)}finally{O.terminate()}return x}async solveChallenges(a,d){const w=a.length;let v=0,x=null;const A=typeof WebAssembly=="object"&&typeof WebAssembly.instantiate=="function";if(A)try{x=await T()}catch(L){c.warn(u("wasm"),"unavailable, falling back to JS solver:",L.message||L)}if(!A&&(c.warn(u("wasm"),"WebAssembly disabled in this browser, solver will be ~10x slower"),!r(this,F).querySelector(".warning"))){const L=document.createElement("div");L.className="warning",L.style.cssText="width:var(--cap-widget-width,230px);background:rgb(237,56,46);color:white;padding:4px 6px;padding-bottom:calc(var(--cap-border-radius,14px) + 5px);font-size:10px;box-sizing:border-box;font-family:system-ui;border-top-left-radius:8px;border-top-right-radius:8px;text-align:center;user-select:none;margin-bottom:-35.5px;opacity:0;transition:margin-bottom .3s,opacity .3s;",L.innerText=this.getI18nText("wasm-disabled","Enable WASM for significantly faster solving"),r(this,F).insertBefore(L,r(this,F).firstChild),setTimeout(()=>{L.style.marginBottom="calc(-1 * var(--cap-border-radius, 14px))",L.style.opacity=1},10)}const N=new B(r(this,ee));N.setWasm(x),N._ensureSize(r(this,ee));const O=[];try{for(let L=0;L<a.length;L+=r(this,ee)){const X=a.slice(L,Math.min(L+r(this,ee),a.length)),te=await f(Promise.all(X.map(([U,K])=>N.run(U,K).then(V=>{v++;const Q=Math.min(99,Math.round((0+v)/w*100));return this.dispatchEvent("progress",{progress:Q}),V}))),d);O.push(...te)}}finally{N.terminate()}return O}setWorkersCount(a){const d=parseInt(a,10),w=Math.min(navigator.hardwareConcurrency||8,16);W(this,ee,!Number.isNaN(d)&&d>0&&d<=w?d:navigator.hardwareConcurrency||8)}createUI(){r(this,E).classList.add("captcha"),r(this,E).setAttribute("role","group"),r(this,E).setAttribute("aria-label",this.getI18nText("group-aria-label","Cap verification")),W(this,R,document.createElement("div")),r(this,R).className="captcha-trigger",r(this,R).setAttribute("part","trigger"),r(this,R).setAttribute("role","button"),r(this,R).setAttribute("tabindex","0"),r(this,R).setAttribute("aria-label",this.getI18nText("verify-aria-label","Click to verify you're a human")),r(this,R).setAttribute("aria-live","polite"),r(this,R).setAttribute("disabled","true"),r(this,R).innerHTML=`<div class="checkbox" part="checkbox" aria-hidden="true"><svg class="progress-ring" viewBox="0 0 32 32" aria-hidden="true"><circle class="progress-ring-bg" cx="16" cy="16" r="14"></circle><circle class="progress-ring-circle" cx="16" cy="16" r="14"></circle></svg></div><p part="label" class="label-wrapper"><span class="label active">${this.getI18nText("initial-state","Verify you're human")}</span></p>`,r(this,E).appendChild(r(this,R)),W(this,M,document.createElement("a")),r(this,M).className="cap-troubleshoot-link",r(this,M).setAttribute("part","troubleshoot"),r(this,M).setAttribute("target","_blank"),r(this,M).setAttribute("rel","noopener"),r(this,M).hidden=!0,r(this,E).appendChild(r(this,M)),W(this,S,document.createElement("a")),r(this,S).className="credits",r(this,S).setAttribute("aria-label","Secured by Cap"),r(this,S).setAttribute("href","https://trycap.dev"),r(this,S).setAttribute("target","_blank"),r(this,S).setAttribute("title","Secured by Cap: The self-hosted CAPTCHA for the modern web."),r(this,S).textContent="Cap",r(this,E).appendChild(r(this,S)),r(this,F).innerHTML=`<style${window.CAP_CSS_NONCE?` nonce=${window.CAP_CSS_NONCE}`:""}>:host{display:inline-block}@media (prefers-reduced-motion:reduce){.captcha,.captcha *{transition:none!important;animation:none!important}.label{filter:none!important;opacity:1!important;transition:none!important;transform:none!important}.label:not(.active),.label.exit{display:none!important}}.captcha,.captcha *{box-sizing:border-box}.captcha{width:var(--cap-widget-width,260px);height:var(--cap-widget-height,58px);background-color:var(--cap-background,#fdfdfd);border:1px solid var(--cap-border-color,#dddddd8f);border-radius:var(--cap-border-radius,14px);-webkit-user-select:none;user-select:none;cursor:pointer;-webkit-tap-highlight-color:#fff0;color:var(--cap-color,#212121);font-family:var(--cap-font,system, -apple-system, "BlinkMacSystemFont", ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", "Ubuntu", "arial", sans-serif);transition:filter .2s,transform .2s,height .2s;display:inline-block;position:relative;overflow:hidden}.captcha.has-troubleshoot{height:calc(var(--cap-widget-height,58px) + 26px)}.captcha.has-troubleshoot .captcha-trigger{inset-block-end:26px}.captcha:not([data-state]):active{transform:scale(.97)}.captcha:hover{filter:brightness(98%)}.captcha-trigger{padding:var(--cap-widget-padding,14px);align-items:center;gap:var(--cap-gap,15px);border-radius:inherit;transition:inset .2s;display:flex;position:absolute;inset:0}.captcha-trigger:focus-visible{outline:2px solid var(--cap-focus-ring,#06c);outline-offset:-3px}.checkbox{width:var(--cap-checkbox-size,25px);height:var(--cap-checkbox-size,25px);border:var(--cap-checkbox-border,1px solid #aaaaaad1);border-radius:var(--cap-checkbox-border-radius,6px);background-color:var(--cap-checkbox-background,#fafafa91);margin-top:var(--cap-checkbox-margin,2px);margin-bottom:var(--cap-checkbox-margin,2px);flex-shrink:0;transition:opacity .2s}.captcha p{-webkit-user-select:none;user-select:none;margin:0;font-size:15px;font-weight:500}.label-wrapper{flex:1;align-items:center;min-width:0;height:2em;display:flex;position:relative;overflow:hidden}.label-wrapper:before,.label-wrapper:after{content:"";pointer-events:none;z-index:1;width:100%;height:.6em;position:absolute;inset-inline-start:0}.label-wrapper:before{background:linear-gradient(to bottom, var(--cap-background,#fdfdfd), transparent);top:0}.label-wrapper:after{background:linear-gradient(to top, var(--cap-background,#fdfdfd), transparent);bottom:0}.label{white-space:nowrap;opacity:0;filter:blur(2px);transition:transform .5s cubic-bezier(.25,1,.5,1),opacity .5s,filter .5s;position:absolute;transform:translateY(100%)}.label.active{opacity:1;filter:none;transform:translateY(0)}.label.exit{opacity:0;filter:blur(2px);transform:translateY(-100%)}.checkbox .progress-ring{width:100%;height:100%;display:none;transform:rotate(-90deg)}.checkbox .progress-ring-bg{fill:none;stroke:var(--cap-spinner-background-color,#eee);stroke-width:var(--cap-spinner-thickness,3)}.checkbox .progress-ring-circle{fill:none;stroke:var(--cap-spinner-color,#000);stroke-width:var(--cap-spinner-thickness,3);stroke-linecap:round;stroke-dasharray:87.96;stroke-dashoffset:87.96px;transition:stroke-dashoffset .3s}.captcha[data-state=verifying] .checkbox{background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;display:flex;transform:scale(1.1)}.captcha[data-state=verifying] .checkbox .progress-ring{display:block}.captcha[data-state=done] .checkbox{background-image:var(--cap-checkmark,url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cstyle%3E%40keyframes%20anim%7B0%25%7Bstroke-dashoffset%3A23.21320343017578px%7Dto%7Bstroke-dashoffset%3A0%7D%7D%3C%2Fstyle%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%2300a67d%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20d%3D%22m5%2012%205%205L20%207%22%20style%3D%22stroke-dashoffset%3A0%3Bstroke-dasharray%3A23.21320343017578px%3Banimation%3Aanim%20.5s%20ease%22%2F%3E%3C%2Fsvg%3E));background-size:cover;border:1px solid #0000}.captcha[data-state=done] .checkbox .progress-ring{display:none}.captcha[data-state=error] .checkbox{background-image:var(--cap-error-cross,url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 24 24'%3E%3Cpath fill='%23f55b50' d='M11 15h2v2h-2zm0-8h2v6h-2zm1-5C6.47 2 2 6.5 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2m0 18a8 8 0 0 1-8-8a8 8 0 0 1 8-8a8 8 0 0 1 8 8a8 8 0 0 1-8 8'/%3E%3C%2Fsvg%3E"));background-size:cover;border:1px solid #0000}.captcha[data-state=error] .checkbox .progress-ring{display:none}.captcha.invalid{border-color:var(--cap-invalid-border-color,#f55b50);box-shadow:0 0 0 3px var(--cap-invalid-ring-color,#f55b5033);animation:.5s cubic-bezier(.36,.07,.19,.97) cap-shake}@keyframes cap-shake{10%,90%{transform:translate(-1px)}20%,80%{transform:translate(2px)}30%,50%,70%{transform:translate(-4px)}40%,60%{transform:translate(4px)}}@media (prefers-reduced-motion:reduce){.captcha.invalid{animation:none!important}}.captcha-trigger[disabled]{cursor:not-allowed}.captcha[data-state=verifying] .captcha-trigger{cursor:progress}.captcha[data-state=done] .captcha-trigger{cursor:default}.credits{color:var(--cap-color,#212121);text-underline-offset:.18em;z-index:2;border-radius:4px;justify-content:flex-end;align-items:center;min-width:24px;min-height:24px;padding:4px 6px;text-decoration:underline;text-decoration-thickness:.08em;position:absolute;inset-block-end:4px;inset-inline-end:4px;opacity:.8!important;font-size:12px!important;display:inline-flex!important}.captcha .credits{visibility:visible!important;pointer-events:all!important;display:inline-flex!important}.credits:focus-visible{outline:2px solid var(--cap-focus-ring,#06c);outline-offset:2px;opacity:1!important}.cap-troubleshoot-link{min-width:24px;min-height:24px;color:var(--cap-troubleshoot-color,#0050a0);text-underline-offset:.15em;cursor:pointer;z-index:2;border-radius:4px;align-items:center;padding:4px 6px;font-size:13px;font-weight:500;text-decoration:underline;text-decoration-thickness:.08em;display:inline-flex;position:absolute;inset-block-end:4px;inset-inline-start:14px}.cap-troubleshoot-link[hidden]{display:none}.cap-troubleshoot-link:hover{opacity:.85}.cap-troubleshoot-link:focus-visible{outline:2px solid var(--cap-focus-ring,#06c);outline-offset:2px}@media (forced-colors:active){.captcha,.checkbox{border-color:canvastext}:is(.captcha-trigger:focus-visible,.credits:focus-visible,.cap-troubleshoot-link:focus-visible){outline-color:highlight}.progress-ring-bg{stroke:graytext}.progress-ring-circle{stroke:canvastext}.captcha.invalid{box-shadow:none;border-color:mark}.credits{opacity:1!important}}</style>`,r(this,F).appendChild(r(this,E)),H(this,C,Xe).call(this),setTimeout(()=>H(this,C,Xe).call(this),100)}addEventListeners(){r(this,R)&&(r(this,S).addEventListener("click",a=>{a.preventDefault(),window.open(`https://trycap.dev/?${new URLSearchParams({utm_source:"cap_widget",utm_medium:"referral",utm_campaign:"widget",utm_content:window.CAP_DISABLE_WIDGET_REF?"":location.hostname,ref:window.CAP_DISABLE_WIDGET_REF?"":location.href||"",sub:window.CAP_DISABLE_WIDGET_REF?"":document.referrer||""}).toString()}`,"_blank")}),r(this,R).addEventListener("click",()=>{r(this,R).hasAttribute("disabled")||this.solve()}),r(this,R).addEventListener("mousedown",()=>{!r(this,R).hasAttribute("disabled")&&r(this,C,Se)&&navigator.vibrate(5)}),r(this,R).addEventListener("keydown",a=>{a.target===r(this,R)&&(a.key!=="Enter"&&a.key!==" "||r(this,R).hasAttribute("disabled")||(a.preventDefault(),a.stopPropagation(),this.solve()))}),this.addEventListener("progress",this.boundHandleProgress),this.addEventListener("solve",this.boundHandleSolve),this.addEventListener("error",this.boundHandleError),this.addEventListener("reset",this.boundHandleReset))}animateLabel(a){var x;if(!r(this,R))return;const d=r(this,R).querySelector(".label-wrapper");if(!d)return;if((x=window.matchMedia)!=null&&x.call(window,"(prefers-reduced-motion: reduce)").matches){const A=d.querySelector(".label.active");if(A)A.textContent=a;else{const N=document.createElement("span");N.className="label active",N.textContent=a,d.appendChild(N)}return}const w=d.querySelector(".label.active"),v=document.createElement("span");v.className="label",v.textContent=a,d.appendChild(v),v.offsetWidth,v.classList.add("active"),w&&(w.classList.remove("active"),w.classList.add("exit"),w.addEventListener("transitionend",()=>w.remove(),{once:!0}))}updateUI(a,d,w=!1){r(this,E)&&r(this,R)&&(r(this,E).setAttribute("data-state",a),r(this,E).classList.remove("has-troubleshoot"),this.animateLabel(d),r(this,M)&&(r(this,M).hidden=!0),w?r(this,R).setAttribute("disabled","true"):r(this,R).removeAttribute("disabled"))}updateUIBlocked(a,d=!1){if(r(this,E)&&r(this,R)&&(r(this,E).setAttribute("data-state","error"),r(this,R).removeAttribute("disabled"),this.animateLabel(a),r(this,M)))if(d){const w=this.getAttribute("data-cap-troubleshooting-url")||"https://trycap.dev/guide/troubleshooting/instrumentation.html";r(this,M).setAttribute("href",w),r(this,M).textContent=this.getI18nText("troubleshooting-label","Troubleshoot"),r(this,M).hidden=!1,r(this,E).classList.add("has-troubleshoot")}else r(this,M).hidden=!0,r(this,E).classList.remove("has-troubleshoot")}handleProgress(a){if(!r(this,R))return;const d=r(this,R).querySelector(".progress-ring-circle");if(d){const v=2*Math.PI*14,x=v-a.detail.progress/100*v;d.style.strokeDashoffset=x}const w=r(this,R).querySelector(".label-wrapper");if(w){const v=w.querySelector(".label.active");v&&(v.textContent=`${this.getI18nText("verifying-label","Verifying...")}`)}this.executeAttributeCode("onprogress",a)}handleSolve(a){var d,w,v;this.updateUI("done",this.getI18nText("solved-label","You're a human"),!0),this.executeAttributeCode("onsolve",a),(w=(d=r(this,le))==null?void 0:d.setValidity)==null||w.call(d,{}),(v=r(this,E))==null||v.classList.remove("invalid")}handleError(a){this.updateUI("error",this.getI18nText("error-label","Error. Try again.")),this.executeAttributeCode("onerror",a),r(this,C,Se)&&navigator.vibrate([10,40,10])}handleReset(a){this.updateUI("",this.getI18nText("initial-state","I'm a human")),this.executeAttributeCode("onreset",a),H(this,C,Ye).call(this)}executeAttributeCode(a,d){const w=this.getAttribute(a);w&&(c.warn(u(),"inline `onxxx='…'` handlers are deprecated. use `addEventListener` callbacks instead."),new Function("event",w).call(this,d))}error(a="Unknown error",d="unknown"){c.error(u("solve"),`[${d}] ${a}`),this.dispatchEvent("error",{isCap:!0,code:d,message:a})}dispatchEvent(a,d={}){const w=new CustomEvent(a,{bubbles:!0,composed:!0,detail:d});super.dispatchEvent(w)}reset(){r(this,q)&&(clearTimeout(r(this,q)),W(this,q,null)),this.token=null,this.dispatchEvent("reset"),H(this,C,Je).call(this,"")}get tokenValue(){return this.token}disconnectedCallback(){var a;(a=r(this,me))==null||a.abort(),this.removeEventListener("progress",this.boundHandleProgress),this.removeEventListener("solve",this.boundHandleSolve),this.removeEventListener("error",this.boundHandleError),this.removeEventListener("reset",this.boundHandleReset),r(this,re).forEach((d,w)=>{this.removeEventListener(w.slice(2),d)}),r(this,re).clear(),r(this,F)&&(r(this,F).innerHTML=""),this.reset(),this.cleanup()}cleanup(){r(this,q)&&(clearTimeout(r(this,q)),W(this,q,null)),H(this,C,Ge).call(this),r(this,ue)&&(clearTimeout(r(this,ue)),W(this,ue,null)),r(this,ie)&&(r(this,ie).terminate(),W(this,ie,null)),r(this,p)&&(r(this,p).state="error",r(this,p).notify(),W(this,p,null))}}q=new WeakMap,ee=new WeakMap,F=new WeakMap,E=new WeakMap,R=new WeakMap,S=new WeakMap,M=new WeakMap,z=new WeakMap,oe=new WeakMap,re=new WeakMap,le=new WeakMap,p=new WeakMap,ue=new WeakMap,ie=new WeakMap,de=new WeakMap,he=new WeakMap,me=new WeakMap,C=new WeakSet,Se=function(){return s&&!window.CAP_DISABLE_HAPTICS&&!this.hasAttribute("data-cap-disable-haptics")},wt=function(){return{state:"idle",challengeResp:null,challenges:null,results:[],completedCount:0,solvePromise:null,promoteFn:null,_listeners:[],pendingPromotion:null,token:null,tokenExpires:null,notify(){for(const a of this._listeners)a();this._listeners=[]},onSettled(a){this.state==="done"||this.state==="error"?a():this._listeners.push(a)}}},vt=function(){W(this,p,H(this,C,wt).call(this)),H(this,C,yt).call(this)},Ge=function(){r(this,de)&&(window.removeEventListener("mousemove",r(this,de)),window.removeEventListener("touchstart",r(this,de)),window.removeEventListener("keydown",r(this,de)),W(this,de,null))},yt=function(){H(this,C,Ge).call(this);const a=()=>{H(this,C,Ge).call(this),H(this,C,Dn).call(this)};W(this,de,a),window.addEventListener("mousemove",a,{passive:!0}),window.addEventListener("touchstart",a,{passive:!0}),window.addEventListener("keydown",a,{passive:!0})},xt=function(){return typeof this.checkVisibility=="function"?this.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):!!(this.offsetParent||this.getClientRects().length>0)},kt=function(){H(this,C,xt).call(this)||c.info(u("challenges"),"solved invisible challenge")},Dn=function(){r(this,p).state==="idle"&&H(this,C,xt).call(this)&&(r(this,p).state="waiting",W(this,ue,setTimeout(()=>{H(this,C,jt).call(this)},2500)))},jt=async function(){var d;if(r(this,p).state!=="waiting")return;r(this,p).state="fetching",r(this,p)._t0=performance.now();let a=this.getAttribute("data-cap-api-endpoint");if(!a&&(window!=null&&window.CAP_CUSTOM_FETCH)&&(a="/"),a){a.endsWith("/")||(a+="/");try{const w=await b(`${a}challenge`,{method:"POST",signal:(d=r(this,me))==null?void 0:d.signal});let v;try{v=await w.json()}catch{throw new Error("Failed to parse speculative challenge response")}if(v.error)throw new Error(v.error);if(!r(this,p))return;if(v._apiEndpoint=a,r(this,p).challengeResp=v,v.format===2&&Array.isArray(v.challenges))return r(this,p).state="idle",void r(this,p).notify();const{challenge:x,token:A}=v;let N=x;if(!Array.isArray(N)){let O=0;N=Array.from({length:x.c},()=>(O++,[P(`${A}${O}`,x.s),P(`${A}${O}d`,x.d)]))}r(this,p).challenges=N,r(this,p).state="solving",r(this,p).solvePromise=H(this,C,Fn).call(this,N)}catch{if(!r(this,p))return;r(this,p).state="error",r(this,p).notify()}}else r(this,p).state="idle"},Fn=async function(a){ne();let d=null;try{d=await T()}catch{}r(this,ie)||(W(this,ie,new B(1)),r(this,ie)._spawn()),r(this,ie).setWasm(d);const w=a.length,v=new Array(w);let x=1,A=!1;r(this,p).promoteFn=O=>{A||(A=!0,x=O,r(this,ie)._size=O,r(this,ie)._ensureSize(O))},r(this,p).pendingPromotion!==null&&(r(this,p).promoteFn(r(this,p).pendingPromotion),r(this,p).pendingPromotion=null);let N=0;for(;N<w;){const O=x,L=[],X=[];for(let U=0;U<O&&N<w;U++)X.push(N),L.push(a[N]),N++;r(this,ie)._ensureSize(Math.max(x,O));const te=await Promise.all(L.map(U=>r(this,ie).run(U[0],U[1]).then(K=>(r(this,p)&&r(this,p).completedCount++,K))));for(let U=0;U<X.length;U++)v[X[U]]=te[U];!A&&N<w&&await new Promise(U=>setTimeout(U,120))}return r(this,p)&&(r(this,p).results=v,r(this,p).state="redeeming",H(this,C,On).call(this,v)),v},On=async function(a){var d;try{if(!r(this,p))return;const w=r(this,p).challengeResp,v=w._apiEndpoint;if(!v)throw m("missing_endpoint","speculative redeem: missing apiEndpoint");let x=null;if(w.instrumentation){if(x=await j(w.instrumentation),!r(this,p))return;if(x!=null&&x.__timeout||x!=null&&x.__blocked)return r(this,p).state="done",void r(this,p).notify()}const A=await b(`${v}redeem`,{method:"POST",body:JSON.stringify({token:w.token,solutions:a,...x&&{instr:x}}),headers:{"Content-Type":"application/json"},signal:(d=r(this,me))==null?void 0:d.signal});let N;try{N=await A.json()}catch{throw new Error("Failed to parse speculative redeem response")}if(!r(this,p))return;if(!N.success)throw new Error(N.error||"Speculative redeem failed");r(this,p).token=N.token,r(this,p).tokenExpires=new Date(N.expires).getTime(),r(this,p).state="done",r(this,p)._invisibleElapsed=r(this,p)._t0?h(r(this,p)._t0):"?",r(this,p).notify()}catch{if(!r(this,p))return;r(this,p).state="done",r(this,p).notify()}},Et=function(){return this.getAttribute("data-cap-hidden-field-name")||"cap-token"},Je=function(a){const d=this.querySelector(`input[name='${r(this,C,Et)}']`);d&&(d.value=a)},Ct=function(){c.debug(u("solve"),`served from speculative cache (saved ${r(this,p)._invisibleElapsed||"?"})`),this.dispatchEvent("progress",{progress:100}),H(this,C,Je).call(this,r(this,p).token),this.dispatchEvent("solve",{token:r(this,p).token}),this.token=r(this,p).token;const a=r(this,p).tokenExpires-Date.now();return r(this,q)&&clearTimeout(r(this,q)),W(this,q,setTimeout(()=>this.reset(),a)),r(this,R).setAttribute("aria-label",this.getI18nText("verified-aria-label","We have verified you're a human, you may now continue")),r(this,C,Se)&&navigator.vibrate([10,50,20,30,40]),H(this,C,kt).call(this),H(this,C,vt).call(this),W(this,oe,!1),{success:!0,token:this.token}},Un=function(){W(this,he,(function(a){const d=a?[a]:navigator.languages||[navigator.language||""];for(let w of d){if(!w)continue;if(w=w.toLowerCase(),w==="en"||w.startsWith("en-"))return null;const v=y[w]?w:y[w.split("-")[0]]?w.split("-")[0]:null;if(!v)return null;const x=y[v].split("/"),A={};return g.forEach((N,O)=>{A[N]=x[O]}),A}return null})(window.CAP_LANG||this.getAttribute("data-cap-lang")))},Ye=function(){var a;(a=r(this,le))!=null&&a.setValidity&&(this.hasAttribute("required")&&!this.token?r(this,le).setValidity({valueMissing:!0},this.getI18nText("required-label","Please verify you're human"),r(this,E)||this):r(this,le).setValidity({}))},Be=new WeakMap,$n=function(){if(!r(this,z))return!1;const a=r(this,z).getBoundingClientRect();if(a.width===0&&a.height===0)return!0;const d=window.getComputedStyle(r(this,z));return d.display==="none"||d.visibility==="hidden"},Xe=function(){r(this,S)&&r(this,E)&&!H(this,C,$n).call(this)&&(r(this,S).isConnected&&r(this,S).parentNode===r(this,E)||r(this,E).appendChild(r(this,S)),r(this,S).textContent&&r(this,S).textContent.trim()||(r(this,S).textContent="Cap"),r(this,S).getAttribute("href")!=="https://trycap.dev"&&r(this,S).setAttribute("href","https://trycap.dev"),r(this,S).style.cssText=["display: inline-flex !important","visibility: visible !important","opacity: 0.8 !important","pointer-events: all !important","font-size: 12px !important","transform: none !important","clip-path: none !important","filter: none !important","position: absolute !important"].join("; "))},ke($,"formAssociated",!0);class Y{constructor(_={},a){const d=a||document.createElement("cap-widget");if(Object.entries(_).forEach(([w,v])=>{d.setAttribute(w,v)}),!_.apiEndpoint&&!(window!=null&&window.CAP_CUSTOM_FETCH))throw d.remove(),new Error("Missing API endpoint. Either custom fetch or an API endpoint must be provided.");_.apiEndpoint&&d.setAttribute("data-cap-api-endpoint",_.apiEndpoint),a||d.hasAttribute("data-cap-disable-haptics")||d.setAttribute("data-cap-disable-haptics",""),this.widget=d,this.solve=this.widget.solve.bind(this.widget),this.reset=this.widget.reset.bind(this.widget),this.addEventListener=this.widget.addEventListener.bind(this.widget),Object.defineProperty(this,"token",{get:()=>d.token,configurable:!0,enumerable:!0}),a||(d.style.display="none",document.documentElement.appendChild(d))}}window.Cap=Y,customElements.get("cap-widget")||window!=null&&window.CAP_DONT_SKIP_REDEFINE?customElements.get("cap-widget")&&c.warn(u(),"cap-widget custom element already defined, skipping re-define. set window.CAP_DONT_SKIP_REDEFINE = true to override"):customElements.define("cap-widget",$),e.exports=Y,t.default=Y})()})(ze,ze.exports)),ze.exports}kr();function sn(e=Oe("/api/account/cap/")){return new Promise((t,s)=>{const i=document.createElement("div");i.className="cap-overlay";const o=document.createElement("div");o.className="cap-overlay-panel";const c=document.createElement("div");c.className="cap-overlay-title",c.textContent="Verify you're human";const u=document.createElement("cap-widget");u.setAttribute("data-cap-api-endpoint",e);const h=document.createElement("button");h.type="button",h.className="cap-overlay-cancel",h.textContent="Cancel";let m=!1;const b=()=>{m=!0,i.remove()},f=()=>{m||(b(),s(new Error("captcha-failed")))};u.addEventListener("solve",g=>{var P;const y=(P=g.detail)==null?void 0:P.token;b(),y?t(y):s(new Error("captcha-failed"))}),u.addEventListener("error",f),h.addEventListener("click",f),i.addEventListener("mousedown",g=>{g.target===i&&f()}),o.append(c,u,h),i.append(o),rr().append(i)})}const jr=2e3,Bn=l.createContext(null);function Er(){const[e,t]=l.useState({status:"loading"}),[s,i]=l.useState(null),[o,c]=l.useState(!1),[u,h]=l.useState(!1),[m,b]=l.useState(null),[f,g]=l.useState(!1),y=l.useMemo(()=>vr(),[]),P=l.useRef(null),k=l.useCallback(async()=>{try{const S=await y.billingStatus();b(S),h(S.active)}catch{b(null)}finally{g(!0)}},[y]),j=l.useCallback(async()=>{try{await y.putSync(yr())}catch{}},[y]),I=l.useCallback(async()=>{try{const{data:S}=await y.getSync();S?xr(S):await j()}catch{}},[y,j]),T=l.useCallback(async(S,M)=>{t({status:"signed-in",user:S}),h(M),await I()},[I]);l.useEffect(()=>{let S=!1;return y.me().then(async({user:M,active:z})=>{S||await T(M,z)}).catch(()=>{S||(t({status:"signed-out"}),g(!0))}),()=>{S=!0}},[y,T]),l.useEffect(()=>{if(e.status==="signed-in"){g(!1),k();return}b(null),h(!1)},[e.status,k]),l.useEffect(()=>()=>{P.current&&window.clearTimeout(P.current)},[]);const J=(S,M)=>S instanceof Error&&S.message==="captcha-failed"?"Captcha failed. Please try again.":S instanceof gt?S.message:M,ne=l.useCallback(async(S,M)=>{c(!0),i(null);try{const{user:z,active:oe}=await y.login(S,M,await sn(Oe("/api/account/cap/")));return await T(z,oe),{ok:!0}}catch(z){return z instanceof gt&&z.code==="needs_password"?{ok:!1,needsPassword:!0}:(i(J(z,"Couldn't sign in.")),{ok:!1})}finally{c(!1)}},[y,T]),B=l.useCallback(async(S,M)=>{c(!0),i(null);try{const z=await sn(Oe("/api/account/cap/"));return M==="reset"?await y.requestReset(S,z):await y.requestSetPassword(S,z),!0}catch(z){return i(J(z,"Couldn't send a code.")),!1}finally{c(!1)}},[y]),$=l.useCallback(async(S,M,z,oe)=>{c(!0),i(null);try{const{user:re,active:le}=oe==="reset"?await y.reset(S,M,z):await y.setPassword(S,M,z);return await T(re,le),!0}catch(re){return i(J(re,"Couldn't verify the code.")),!1}finally{c(!1)}},[y,T]),Y=l.useCallback(async()=>{try{await y.logout()}catch{}t({status:"signed-out"})},[y]),q=l.useCallback(()=>{e.status==="signed-in"&&(P.current&&window.clearTimeout(P.current),P.current=window.setTimeout(()=>void j(),jr))},[e.status,j]),ee=l.useCallback(async S=>{try{const{url:M}=await y.checkout(S,Kt());window.location.href=M}catch(M){i(J(M,"Couldn't start checkout."))}},[y]),F=l.useCallback(async()=>{try{const{url:S}=await y.billingPortal(Kt());window.location.href=S}catch(S){i(J(S,"Couldn't open billing."))}},[y]),E=l.useCallback(async S=>{try{const M=await y.verifyCheckout(S);if(M.active){h(!0),await k();try{const{user:z,active:oe}=await y.me();t({status:"signed-in",user:z}),h(oe)}catch{}}return M}catch{return null}},[y,k]),R=l.useCallback(async S=>{c(!0),i(null);try{const{user:M,active:z}=await y.setDiscord(S);return t({status:"signed-in",user:M}),h(z),!0}catch(M){return i(J(M,"Couldn't save Discord.")),!1}finally{c(!1)}},[y]);return{status:e.status,user:e.status==="signed-in"?e.user:null,busy:o,authError:s,clearError:()=>i(null),billing:m,isPlus:u,entitlementReady:f,signIn:ne,sendCode:B,submitCode:$,logout:Y,scheduleSync:q,checkout:ee,manageBilling:F,verifyReturn:E,refreshBilling:k,setDiscord:R}}function Cr({children:e}){const t=Er();return n.jsx(Bn.Provider,{value:t,children:e})}function qn(){const e=l.useContext(Bn);if(!e)throw new Error("useAccount requires AccountProvider");return e}const Ar=2500,Sr=200;function zn(e){const t=window;let s=!1,i=0,o=0,c=0,u=0;const h=()=>{s||e()},m=()=>{if(t.requestIdleCallback){c=t.requestIdleCallback(h,{timeout:Ar});return}u=window.setTimeout(h,Sr)},b=()=>{i=window.requestAnimationFrame(()=>{o=window.requestAnimationFrame(m)})};return document.readyState==="complete"?b():window.addEventListener("load",b,{once:!0}),()=>{s=!0,window.removeEventListener("load",b),window.cancelAnimationFrame(i),window.cancelAnimationFrame(o),c&&t.cancelIdleCallback&&t.cancelIdleCallback(c),window.clearTimeout(u)}}const _r="//rv.curbingspider.com/rS4UwuG85t7WA/147093",Nr="//hj.doebirddrowner.com/sUWrzqOhnYv92MH6/147094",ve=new Map;let Ne=!1,At=!1,St=!1,Ee=null;function Tr(e){return new URLSearchParams(e).has("skip")}function Wn(){St||(St=!0,window.location.reload())}function rn(e,t){if(ve.has(e))return;const s=document.createElement("script");ve.set(e,s),s.dataset.cfasync="false",s.src=t,s.dataset.ext=t,s.async=!0,s.type="text/javascript",s.addEventListener("load",()=>{if(ve.get(e)!==s){Wn();return}if(At=!0,!Ne||!De()){Hn();return}},{once:!0}),s.addEventListener("error",()=>{s.remove(),ve.get(e)===s&&ve.delete(e)},{once:!0}),(document.head??document.documentElement).appendChild(s)}function Hn(){Ee==null||Ee(),Ee=null,Ne=!1;for(const t of ve.values())t.remove();ve.clear();const e=At;At=!1,e&&Wn()}function De(){return window.location.hostname!=="localhost"}function Pr(){const e=window.location.hostname!=="IGNITE OSon.top";!De()||Ee||Ne&&ve.size===(e?2:1)||(Ne||(St=!1),Ne=!0,Ee=zn(()=>{Ee=null,Ne&&(rn("pop",new URL(_r,document.baseURI).href),e&&rn("social",new URL(Nr,document.baseURI).href))}))}function Lr(e){const t=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e)?e:"#ffffff";document.documentElement.style.setProperty("--accent",t)}const Ir=l.lazy(()=>Ae(()=>import("./DarkVeil-CC-BBhGo-8068ec8f.js"),__vite__mapDeps([4,2,5]),import.meta.url));function Rr(e){const[t,s]=l.useState(!1);return l.useEffect(()=>zn(()=>s(!0)),[]),t?n.jsx(l.Suspense,{fallback:null,children:n.jsx(Ir,{...e})}):null}const Mr=l.lazy(()=>Ae(()=>import("./AiPage-CbTtOj3W-8068ec8f.js"),__vite__mapDeps([6,2,7,8,9,3,10]),import.meta.url).then(e=>({default:e.AiPage}))),Dr=l.lazy(()=>Ae(()=>import("./GamesPage-D-HV0rpM-8068ec8f.js"),__vite__mapDeps([11,2,3,12]),import.meta.url).then(e=>({default:e.GamesPage}))),Fr=l.lazy(()=>Ae(()=>import("./SettingsPage-CsV-N8Y0-8068ec8f.js"),__vite__mapDeps([13,2,3,14]),import.meta.url).then(e=>({default:e.SettingsPage}))),Or=l.lazy(()=>Ae(()=>import("./AccountPage-DmlYaBSE-8068ec8f.js"),__vite__mapDeps([15,2,3,14,16]),import.meta.url).then(e=>({default:e.AccountPage}))),Ur=l.lazy(()=>Ae(()=>import("./PlusPage-DBE836ej-8068ec8f.js"),__vite__mapDeps([17,2,3,18,16,14]),import.meta.url).then(e=>({default:e.PlusPage})));function $r(){const{tabs:e,activeId:t,activeTab:s,open:i,openInternal:o,openUrl:c,close:u,activate:h,patch:m,reorder:b}=Hs(),{settings:f,update:g}=ur(),{controller:y}=hr(f.adblock),P=Vs(),k=Gs(),j=qn(),I=(s==null?void 0:s.url)??"",T=be(I),J=l.useRef(!1),[ne]=l.useState(()=>Tr(window.location.search)),[B,$]=l.useState(()=>tt("_gs5mofn.collapsed",!1)),Y=l.useRef(!1),[q,ee]=l.useState(!1),[F,E]=l.useState(!1),[R,S]=l.useState(()=>De()&&!ne&&ge("ads.notice")!=="seen"),[M,z]=l.useState(null),[oe,re]=l.useState(!1),le=l.useRef(!1),p=l.useRef(null);l.useEffect(()=>{!ne||!De()||we("ads.notice","seen")},[ne]),l.useEffect(()=>{j.isPlus&&(S(!1),z(null),re(!1))},[j.isPlus]),l.useEffect(()=>{j.status==="loading"||j.isPlus||R||M||le.current||(le.current=!0,re(!0))},[j.status,j.isPlus,R,M]),l.useEffect(()=>{if(!(j.status==="loading"||!j.entitlementReady)){if(j.isPlus||!De()){Hn(),J.current=!1;return}J.current||R||ge("ads.notice")==="seen"&&(J.current=!0,Pr())}},[j.status,j.entitlementReady,j.isPlus,R,T]),l.useEffect(()=>{pr(y,j.scheduleSync)},[y,j.scheduleSync]),l.useEffect(()=>{j.scheduleSync()},[P.bookmarks,f,k.id,j.scheduleSync]),l.useEffect(()=>Lr(f.accent),[f.accent]),or(f);const ue=l.useCallback(()=>{we("ads.notice","seen"),S(!1)},[]),ie=l.useCallback((D,ae)=>m(D,{url:ae}),[m]),de=l.useCallback((D,ae)=>m(D,{title:ae}),[m]),he=l.useCallback((D,ae)=>{var Wt;const $e=tn(ae,Zt(f.searchEngineId));$e&&(m(D,{url:$e,title:$e}),(Wt=p.current)==null||Wt.goTo(D,$e))},[m,f.searchEngineId]),me=()=>{ye("tabs"),ye("bookmarks"),ye("settings"),location.reload()},C=l.useCallback(D=>o(xs(D),ys[D]),[o]),st=!1,rt=!I,it=!!I&&!T,qt=rt?"":I;l.useEffect(()=>{},[C]),l.useEffect(()=>{},[T]);const zt=l.useRef(T);l.useEffect(()=>{!Y.current&&T==="ai"&&zt.current!==T&&$(!0),zt.current=T},[T]);const Vn=l.useCallback(()=>{Y.current=!0,$(D=>{const ae=!D;return nt("_gs5mofn.collapsed",ae),ae})},[]);return dr({onNewTab:i,onCloseTab:()=>u(t),onSpotlight:()=>E(D=>!D),onJumpToTab:D=>{const ae=D===9?e[e.length-1]:e[D-1];ae&&h(ae.id)}}),n.jsxs("div",{className:`_9gmixa5 ${it?"_z51tprw":""}`,children:[n.jsx("div",{className:f.backgroundMode==="mesh"?"_v4jfozk mesh":"_v4jfozk","aria-hidden":!0,children:(f.backgroundMode==="full"||f.backgroundMode==="reduced")&&!it&&n.jsx(Rr,{hueShift:IGNITE_HUE,speed:f.backgroundMode==="reduced"?1.2:2.1,warpAmount:1.1,scanlineFrequency:.5,resolutionScale:f.backgroundMode==="reduced"?.45:1})}),n.jsx("div",{className:"_rx2al0e","aria-hidden":!0}),n.jsx(ks,{tabs:e,activeId:t,activeUrl:qt,bookmarks:P.bookmarks,disabled:st,collapsed:B,onSelect:h,onNew:i,onClose:u,onReorder:b,onNavigate:D=>he(t,D),onOpenBookmark:D=>he(t,D),onAddBookmark:()=>ee(!0),onRemoveBookmark:P.remove,onToggleCollapse:Vn,onOpenAi:()=>C("ai"),onOpenGames:()=>C("games"),onOpenSettings:()=>C("settings"),onOpenAccount:()=>C("account"),onBack:()=>{var D;return(D=p.current)==null?void 0:D.back()},onForward:()=>{var D;return(D=p.current)==null?void 0:D.forward()},onReload:()=>{var D;return(D=p.current)==null?void 0:D.reload()}}),n.jsxs("main",{className:"content",children:[(it||T)&&n.jsx(Cs,{url:qt,disabled:st,collapsed:B,internal:!!T,bookmarked:P.has(I),onNavigate:D=>he(t,D),onBack:()=>{var D;return(D=p.current)==null?void 0:D.back()},onForward:()=>{var D;return(D=p.current)==null?void 0:D.forward()},onReload:()=>{var D;return(D=p.current)==null?void 0:D.reload()},onToggleBookmark:()=>P.toggleForUrl(I,s==null?void 0:s.title)}),n.jsxs("div",{className:"_vcmyz3z",children:[n.jsx(Ms,{ref:p,controller:y,tabs:e,activeId:t,onUrl:ie,onTitle:de}),rt&&n.jsx(Ds,{disabled:st,onNavigate:D=>he(t,D)}),n.jsxs(l.Suspense,{fallback:null,children:[T==="ai"&&n.jsx(Mr,{account:j,onOpenAccount:()=>C("account")}),T==="games"&&n.jsx(Dr,{controller:y,onOpenUrl:D=>{const ae=tn(D,Zt(f.searchEngineId));ae&&c(ae,ae)}}),T==="settings"&&n.jsx(Fr,{settings:f,onUpdate:g,onClearData:me,showPlusCta:!j.isPlus&&j.status!=="loading",onUpgradePlus:()=>z("settings")}),T==="account"&&n.jsx(Or,{account:j}),T==="plus"&&n.jsx(Ur,{account:j,onOpenAccount:()=>C("account")})]})]})]}),n.jsx(Fs,{open:q,onClose:()=>ee(!1),onSubmit:P.add}),n.jsx(Os,{open:R&&!M,onAccept:ue,onUpgrade:()=>z("ads")}),n.jsx(Us,{open:oe&&!R&&!M&&!j.isPlus,onClose:()=>re(!1),onUpgrade:()=>{re(!1),z("settings")}}),n.jsx(Bs,{open:M!==null,onClose:()=>z(null),account:j,heading:M==="ads"?"Go ad-free with IGNITE OS Plus":"IGNITE OS Plus",blurb:M==="ads"?"IGNITE OS Plus removes ads entirely, plus 3M tokens/day and exclusive links.":"Remove ads, unlock 3M tokens/day, and get exclusive links.",onSignUp:()=>{z(null),C("account")}}),n.jsx($s,{open:F,onClose:()=>E(!1),onSubmit:D=>he(t,D)}),rt&&n.jsx(As,{})]})}const Br={login:"Welcome back",setup:"Activate your account",reset:"Reset password"};function qr({account:e,brand:t,loginTagline:s,onSubscribe:i,claim:o}){const[c,u]=l.useState("login"),[h,m]=l.useState("form"),[b,f]=l.useState((o==null?void 0:o.email)??""),[g,y]=l.useState(""),[P,k]=l.useState(""),[j,I]=l.useState(null),[T,J]=l.useState(0);l.useEffect(()=>{o&&(f(o.email),o.needsPassword?(u("setup"),m("code"),I("Payment confirmed — enter the code we emailed to set your password."),e.sendCode(o.email,"set-password"),J(30)):(u("login"),I("Payment confirmed — sign in to continue.")))},[o]),l.useEffect(()=>{if(T<=0)return;const E=window.setTimeout(()=>J(R=>R-1),1e3);return()=>window.clearTimeout(E)},[T]);const ne=E=>{e.clearError(),u(E),m("form"),y(""),k(""),I(null),J(0)},B=e.busy,$=async()=>{(await e.signIn(b,g)).needsPassword&&(u("setup"),m("form"),I("Finish activating your account by setting a password."))},Y=async()=>{const E=c==="reset"?"reset":"set-password";await e.sendCode(b,E)&&(m("code"),I(null),J(30))},q=()=>e.submitCode(b,P,g,c==="reset"?"reset":"set-password"),ee=async()=>{await e.sendCode(b,c==="reset"?"reset":"set-password")&&(I("New code sent. If you don't receive anything, check your spam — if you used a school email, our mail might not deliver."),J(30))},F=h==="code"?"Enter the 6-digit code we emailed you. If you don't receive anything, check your spam — if you used a school email, our mail might not deliver.":c==="login"?s??"Sign in to continue.":c==="setup"?"Enter your email and choose a password to get started.":"Enter your email and a new password — we'll email you a code to confirm.";return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"_xdv7bcm",children:[t,n.jsx("h1",{children:Br[c]}),n.jsx("p",{className:"account-auth-auth-sub",children:F})]}),n.jsxs("div",{className:"account-auth-auth-form",children:[j&&n.jsx("div",{className:"account-auth-auth-ok",children:j}),e.authError&&n.jsx("div",{className:"account-auth-error",children:e.authError}),c==="login"&&n.jsxs(n.Fragment,{children:[n.jsxs("label",{children:[n.jsx("span",{children:"Email"}),n.jsx("input",{type:"email",placeholder:"you@example.com",value:b,onChange:E=>f(E.target.value),autoComplete:"email",disabled:B})]}),n.jsxs("label",{children:[n.jsx("span",{children:"Password"}),n.jsx("input",{type:"password",value:g,onChange:E=>y(E.target.value),autoComplete:"current-password",disabled:B,onKeyDown:E=>E.key==="Enter"&&void $()})]}),n.jsx("button",{type:"button",className:"account-auth-btn primary account-auth-auth-primary",disabled:B||!b.trim()||g.length<8,onClick:()=>void $(),children:B?"Please wait…":"Sign in"}),n.jsxs("div",{className:"account-auth-auth-alt",children:[n.jsx("button",{type:"button",className:"account-auth-auth-link",disabled:B,onClick:()=>ne("reset"),children:"Forgot password?"}),n.jsx("span",{className:"account-auth-auth-dot",children:"·"}),n.jsx("button",{type:"button",className:"account-auth-auth-link",disabled:B,onClick:()=>ne("setup"),children:"First time? Activate"})]}),i&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"account-auth-btn account-auth-auth-primary",disabled:B,onClick:()=>i(b),children:"Subscribe to IGNITE OS Plus"}),n.jsx(Tn,{})]})]}),c!=="login"&&h==="form"&&n.jsxs(n.Fragment,{children:[n.jsxs("label",{children:[n.jsx("span",{children:"Email"}),n.jsx("input",{type:"email",placeholder:"you@example.com",value:b,onChange:E=>f(E.target.value),autoComplete:"email",disabled:B})]}),c==="reset"&&n.jsxs("label",{children:[n.jsx("span",{children:"New password"}),n.jsx("input",{type:"password",value:g,onChange:E=>y(E.target.value),autoComplete:"new-password",disabled:B})]}),c==="setup"&&n.jsxs("label",{children:[n.jsx("span",{children:"Choose a password"}),n.jsx("input",{type:"password",value:g,onChange:E=>y(E.target.value),autoComplete:"new-password",disabled:B})]}),n.jsx("button",{type:"button",className:"account-auth-btn primary account-auth-auth-primary",disabled:B||!b.trim()||g.length<8,onClick:()=>void Y(),children:B?"Please wait…":"Send code"}),n.jsx("div",{className:"account-auth-auth-alt",children:n.jsx("button",{type:"button",className:"account-auth-auth-link",disabled:B,onClick:()=>ne("login"),children:"Back to sign in"})})]}),c!=="login"&&h==="code"&&n.jsxs(n.Fragment,{children:[g.length===0&&n.jsxs("label",{children:[n.jsx("span",{children:c==="reset"?"New password":"Choose a password"}),n.jsx("input",{type:"password",value:g,onChange:E=>y(E.target.value),autoComplete:"new-password",disabled:B})]}),n.jsxs("label",{children:[n.jsx("span",{children:"6-digit code"}),n.jsx("input",{inputMode:"numeric",autoComplete:"one-time-code",placeholder:"000000",maxLength:6,value:P,onChange:E=>k(E.target.value.replace(/\D/g,"").slice(0,6)),disabled:B,autoFocus:!0,onKeyDown:E=>E.key==="Enter"&&void q()})]}),n.jsx("button",{type:"button",className:"account-auth-btn primary account-auth-auth-primary",disabled:B||P.length!==6||g.length<8,onClick:()=>void q(),children:B?"Please wait…":c==="reset"?"Reset password":"Activate account"}),n.jsxs("div",{className:"account-auth-auth-alt",children:[n.jsx("button",{type:"button",className:"account-auth-auth-link",disabled:B||T>0,onClick:()=>void ee(),children:T>0?`Resend in ${T}s`:"Resend code"}),n.jsx("span",{className:"account-auth-auth-dot",children:"·"}),n.jsx("button",{type:"button",className:"account-auth-auth-link",disabled:B,onClick:()=>ne("login"),children:"Back to sign in"})]})]})]})]})}function zr(){const e=qn(),[t,s]=l.useState("idle"),[i,o]=l.useState(null),[c,u]=l.useState(!1),h=l.useRef(e.verifyReturn);h.current=e.verifyReturn;const m=l.useRef(!1);if(l.useEffect(()=>{if(m.current)return;m.current=!0;const f=new URLSearchParams(window.location.search),g=f.get("checkout");if(g!=="success"&&g!=="cancel"||(Qn(window.location.pathname),g!=="success"))return;const y=f.get("session_id");y&&(s("checking"),h.current(y).then(P=>{P!=null&&P.email?(o({email:P.email,needsPassword:P.needsPassword}),u(!0)):s("error")}))},[]),l.useEffect(()=>{!c||t!=="checking"||e.status==="loading"||s(e.status==="signed-in"?"done":"claim")},[c,t,e.status]),l.useEffect(()=>{t==="claim"&&e.status==="signed-in"&&s("done")},[t,e.status]),t==="idle")return null;const b=()=>s("idle");return n.jsx("div",{className:"_t97drno",onClick:t==="checking"?void 0:b,children:n.jsxs("div",{className:"modal",onClick:f=>f.stopPropagation(),children:[t==="checking"&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"modal-title",children:"IGNITE OS+"}),n.jsx("p",{style:{margin:0,fontSize:13,color:"var(--muted)"},children:"Confirming your subscription…"})]}),t==="claim"&&i&&n.jsx(qr,{account:e,claim:i,brand:n.jsx("div",{className:"modal-title",children:"IGNITE OS+"})}),t==="done"&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"modal-title",children:"You're on Plus"}),n.jsxs("p",{style:{margin:"0 0 0.9rem",fontSize:13,color:"var(--muted)"},children:[i!=null&&i.email?`${i.email} is subscribed.`:"Your subscription is active."," Your Plus perks are unlocked."]}),n.jsx("div",{className:"modal-actions",children:n.jsx("button",{type:"button",className:"modal-btn primary",onClick:b,children:"Continue"})})]}),t==="error"&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"modal-title",children:"Couldn't confirm payment"}),n.jsx("p",{style:{margin:"0 0 0.9rem",fontSize:13,color:"var(--muted)"},children:"We couldn't confirm your checkout. If you were charged, reach out on Discord and we'll sort it out."}),n.jsx("div",{className:"modal-actions",children:n.jsx("button",{type:"button",className:"modal-btn ghost",onClick:b,children:"Close"})})]})]})})}class Wr extends l.Component{constructor(){super(...arguments);ke(this,"state",{error:null,info:null});ke(this,"reset",()=>this.setState({error:null,info:null}))}static getDerivedStateFromError(s){return{error:s}}componentDidCatch(s,i){this.setState({info:i})}render(){const{error:s,info:i}=this.state;if(!s)return this.props.children;const o=!1;return n.jsx("div",{className:"fixed inset-0 flex items-center justify-center overflow-auto bg-bg p-8 text-text",children:n.jsxs("div",{className:"w-[min(560px,100%)] rounded-[var(--radius)] border border-border bg-surface p-6 backdrop-blur-xl",children:[n.jsx("span",{className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[color-mix(in_srgb,#ff6b6b_45%,var(--border-2))] bg-[color-mix(in_srgb,#ff6b6b_18%,transparent)] text-lg font-bold text-[#ff8f8f]",children:"!"}),n.jsx("h1",{className:"mt-3.5 mb-1 text-[22px] tracking-tight",children:"Something broke"}),n.jsx("p",{className:"m-0 text-sm leading-normal text-muted",children:"An unexpected error crashed this view. You can try again, or reload IGNITE OS."}),n.jsxs("div",{className:"mt-[1.1rem] flex gap-2",children:[n.jsx("button",{type:"button",className:"h-[38px] rounded-[var(--radius-sm)] border border-transparent bg-text px-4 text-[13px] font-semibold text-bg hover:brightness-95",onClick:this.reset,children:"Try again"}),n.jsx("button",{type:"button",className:"h-[38px] rounded-[var(--radius-sm)] border border-border bg-surface-2 px-4 text-[13px] font-semibold text-text hover:brightness-95",onClick:()=>window.location.reload(),children:"Reload IGNITE OS"})]}),n.jsxs("details",{className:"mt-5",open:o,children:[n.jsxs("summary",{className:"cursor-pointer break-words text-[13px] font-semibold text-[#ff8f8f]",children:[s.name,": ",s.message]}),o]})]})})}}function Hr(){return n.jsx(Wr,{children:n.jsx(Cr,{children:n.jsxs(n.Fragment,{children:[n.jsx($r,{}),n.jsx(zr,{})]})})})}function Vr(){return n.jsx("div",{className:"_t97drno backend-unavailable-backdrop",children:n.jsxs("section",{className:"modal backend-unavailable-modal",role:"alertdialog","aria-labelledby":"backend-unavailable-title",children:[n.jsx("div",{className:"modal-title",id:"backend-unavailable-title",children:"No available backend"}),n.jsx("p",{className:"backend-unavailable-body",children:"IGNITE OS couldn’t reach any of its available links. They may be blocked by your network or temporarily offline."}),n.jsx("p",{className:"backend-unavailable-help",children:"Try again in a moment. If this keeps happening, switch networks or ask for a new link."}),n.jsx("div",{className:"modal-actions",children:n.jsx("button",{type:"button",className:"modal-btn primary",onClick:()=>window.location.reload(),children:"Try again"})})]})})}const Kr=["assets.fern.best","checkout.jbquarterhorseranch.com","books.llteamstore.com"];let We=null;const Gr=new Set;function on(){for(const e of Gr)e()}async function Jr(e){try{const t=await fetch(`https://${e}/`,{method:"GET",redirect:"manual",cache:"no-store",mode:"cors"});return t.type==="opaqueredirect"||t.status===303}catch{return!1}}function Yr(){return We||(We=(async()=>{for(const e of Kr)if(await Jr(e))return on(),e;return on(),null})(),We)}Ut(Ot());Yr();En().then(e=>{const t=document.getElementById("root");let s=t;try{s=t.attachShadow({mode:"closed"})}catch{}if(nr(s),s instanceof ShadowRoot){const i=new Set,o=()=>{for(const c of document.querySelectorAll('link[rel="stylesheet"], style'))i.has(c)||(i.add(c),s.append(c.cloneNode(!0)))};o(),new MutationObserver(o).observe(document.head,{childList:!0})}Jn.createRoot(s).render(n.jsxs(l.StrictMode,{children:[n.jsx(Hr,{}),e===null&&n.jsx(Vr,{})]}))});export{qr as $,pi as A,ps as B,xn as C,pt as D,ai as E,mi as F,ii as G,bi as H,ri as I,fs as J,gi as K,ui as L,ti as M,fi as N,bt as O,dt as P,Xt as Q,It as R,hi as S,li as T,Bs as U,os as V,Ze as W,yi as X,xi as Y,tr as Z,vi as _,ye as a,Tn as a0,wi as a1,Bt as a2,ei as a3,_t as a4,Oe as b,ms as c,ci as d,Pt as e,Lt as f,gn as g,si as h,ni as i,Rt as j,Me as k,oi as l,di as m,sr as n,rr as o,wn as p,ge as q,tt as r,En as s,Ts as t,Is as u,Ps as v,we as w,_n as x,as as y,nt as z};
|
|
2
|
+
var Kn=Object.defineProperty;var Ht=e=>{throw TypeError(e)};var Gn=(e,t,s)=>t in e?Kn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var ke=(e,t,s)=>Gn(e,typeof t!="symbol"?t+"":t,s),ot=(e,t,s)=>t.has(e)||Ht("Cannot "+s);var r=(e,t,s)=>(ot(e,t,"read from private field"),s?s.call(e):t.get(e)),se=(e,t,s)=>t.has(e)?Ht("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),W=(e,t,s,i)=>(ot(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),H=(e,t,s)=>(ot(e,t,"access private method"),s);import{j as n,r as l,c as Jn}from"./react-BNEptbwn-8068ec8f.js";import{A as Ue,m as Te,R as Yn,a as Xn}from"./motion-B1hdS1Lc-8068ec8f.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function s(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function i(o){if(o.ep)return;o.ep=!0;const c=s(o);fetch(o.href,c)}})();const Vt=(()=>{const e=window;if(e.__lcHs)return e.__lcHs;const t={ps:History.prototype.pushState,rs:History.prototype.replaceState};return e.__lcHs=t,t})();function an(){const e=history;try{Object.defineProperty(e,"pushState",{value:Vt.ps.bind(e),configurable:!0,writable:!0}),Object.defineProperty(e,"replaceState",{value:Vt.rs.bind(e),configurable:!0,writable:!0})}catch{}}function Qn(e,t=null){history.replaceState(t,"",e)}an();const _t=typeof document<"u"?document.baseURI:"/";function Ze(e="",t=_t){const s=e.trim();return s?/^(https?:|data:|blob:)/i.test(s)?s:s.startsWith("#")?new URL(s,t).href:new URL(s.replace(/^\/+/,""),t).href:new URL(".",t).href}function ei(e="",t=_t){return new URL(Ze(e,t)).pathname}function Kt(){return new URL(".",_t).href}const Zn="modulepreload",es=function(e,t){return new URL(e,t).href},Gt={},Ae=function(t,s,i){let o=Promise.resolve();if(s&&s.length>0){let u=function(f){return Promise.all(f.map(g=>Promise.resolve(g).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};const h=document.getElementsByTagName("link"),m=document.querySelector("meta[property=csp-nonce]"),b=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));o=u(s.map(f=>{if(f=es(f,i),f in Gt)return;Gt[f]=!0;const g=f.endsWith(".css"),y=g?'[rel="stylesheet"]':"";if(!!i)for(let j=h.length-1;j>=0;j--){const I=h[j];if(I.href===f&&(!g||I.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${y}`))return;const k=document.createElement("link");if(k.rel=g?"stylesheet":Zn,g||(k.as="script"),k.crossOrigin="",k.href=f,b&&k.setAttribute("nonce",b),document.head.appendChild(k),g)return new Promise((j,I)=>{k.addEventListener("load",j),k.addEventListener("error",()=>I(new Error(`Unable to preload CSS for ${f}`)))})}))}function c(u){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=u,window.dispatchEvent(h),!h.defaultPrevented)throw u}return o.then(u=>{for(const h of u||[])h.status==="rejected"&&c(h.reason);return t().catch(c)})},cn="z9k2r",ut=["settings","tabs","theme","bookmarks","ai.model","ai.threads","_gs5mofn.collapsed","api.base","api.pinned","api.custom","ads.notice","games.saved.v2"],Nt="8068ec8f48688e3d";function ln(e){let t=2166136261;for(let s=0;s<e.length;s++)t^=e.charCodeAt(s),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function un(e,t){return ln(e?`${e} ${t}`:t)}function et(e){return un(Nt,e)}function Qe(e){try{return localStorage.getItem(e)}catch{return null}}function Tt(e,t){try{localStorage.setItem(e,t)}catch{}}function dn(e){try{localStorage.removeItem(e)}catch{}}function ts(){const e=Qe(cn);if(e===null)return null;try{const t=JSON.parse(e);if(typeof(t==null?void 0:t.salt)=="string"&&Array.isArray(t.names))return t}catch{}return null}let Ce;function hn(){Tt(cn,JSON.stringify({salt:Nt,names:[...Ce]}))}function ns(){const e=ts(),t=e?e.salt:null;if(Ce=new Set([...ut,...(e==null?void 0:e.names)??[]]),t!==Nt)for(const s of Ce){const i=t===null?ln(s):un(t,s),o=et(s);if(i===o)continue;const c=Qe(i);c!==null&&(Qe(o)===null&&Tt(o,c),dn(i))}hn()}function ss(e){Ce.has(e)||(Ce.add(e),hn())}if(typeof window<"u")try{ns()}catch{Ce=new Set(ut)}else Ce=new Set(ut);function ge(e){return Qe(et(e))}function we(e,t){ss(e),Tt(et(e),t)}function ye(e){dn(et(e))}function tt(e,t){const s=ge(e);if(s===null)return t;try{return JSON.parse(s)}catch{return t}}function nt(e,t){we(e,JSON.stringify(t))}const pn={id:"tiktok",url:"https://www.tiktok.com/",label:"TikTok"},fn={id:"discord",url:"https://discord.com/_9gmixa5",label:"Discord"},rs=[pn,fn];function mn(){const e=tt("bookmarks",null);return Array.isArray(e)?e.filter(t=>typeof(t==null?void 0:t.url)=="string"&&typeof(t==null?void 0:t.id)=="string").map(t=>t.id==="instagram"?pn:t.id==="spotify"?fn:t):rs}function bn(e){nt("bookmarks",e)}function Jt(e,t){return{id:`bm-${Date.now().toString(36)}-${Math.floor(Math.random()*1e4).toString(36)}`,url:e,label:t}}function _e(e){try{return new URL(e).hostname}catch{return null}}function is(e){const t=_e(e);return t?[`https://icons.duckduckgo.com/ip3/${t}.ico`,`https://www.google.com/s2/favicons?domain=${t}&sz=64`]:[]}const Z=e=>({width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0});function ti({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),n.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),n.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]})}function Pt({size:e=16}){return n.jsx("svg",{...Z(e),children:n.jsx("polyline",{points:"15 18 9 12 15 6"})})}function Lt({size:e=16}){return n.jsx("svg",{...Z(e),children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})}function It({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("polyline",{points:"23 4 23 10 17 10"}),n.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})}function Me({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("circle",{cx:"11",cy:"11",r:"7"}),n.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}function dt({size:e=16}){return n.jsx("svg",{...Z(e),children:n.jsx("path",{d:"M12 5v14M5 12h14"})})}function gn({size:e=14}){return n.jsx("svg",{...Z(e),children:n.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}function wn({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),n.jsx("line",{x1:"9",y1:"4",x2:"9",y2:"20"})]})}function os({size:e=16}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.6,strokeLinecap:"round","aria-hidden":!0,children:[n.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"21"}),n.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),n.jsx("line",{x1:"6.3",y1:"6.3",x2:"17.7",y2:"17.7"}),n.jsx("line",{x1:"17.7",y1:"6.3",x2:"6.3",y2:"17.7"})]})}function vn({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}function Rt({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("path",{d:"M12 3l1.7 4.3L18 9l-4.3 1.7L12 15l-1.7-4.3L6 9l4.3-1.7z"}),n.jsx("path",{d:"M18.5 14l.9 2.1 2.1.9-2.1.9-.9 2.1-.9-2.1-2.1-.9 2.1-.9z"})]})}function Mt({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("line",{x1:"6",y1:"11",x2:"10",y2:"11"}),n.jsx("line",{x1:"8",y1:"9",x2:"8",y2:"13"}),n.jsx("line",{x1:"15",y1:"12",x2:"15.01",y2:"12"}),n.jsx("line",{x1:"18",y1:"10",x2:"18.01",y2:"10"}),n.jsx("rect",{x:"2",y:"6",width:"20",height:"12",rx:"2"})]})}function ni({size:e=16}){return n.jsx("svg",{...Z(e),children:n.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})})}function si({size:e=16}){return n.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":!0,children:n.jsx("rect",{x:"7",y:"7",width:"10",height:"10",rx:"2",fill:"currentColor"})})}function ri({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),n.jsx("circle",{cx:"9",cy:"9",r:"2"}),n.jsx("path",{d:"M21 15l-5-5L5 21"})]})}function ii({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("circle",{cx:"12",cy:"12",r:"9"}),n.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),n.jsx("ellipse",{cx:"12",cy:"12",rx:"4",ry:"9"})]})}function oi({size:e=14}){return n.jsx("svg",{...Z(e),children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})}function ai({size:e=14}){return n.jsxs("svg",{...Z(e),children:[n.jsx("path",{d:"M12 20h9"}),n.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z"})]})}function ci({size:e=14}){return n.jsxs("svg",{...Z(e),children:[n.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),n.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h10"})]})}function li({size:e=14}){return n.jsx("svg",{...Z(e),children:n.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"})})}function as({size:e=14,filled:t=!1}){return n.jsx("svg",{...Z(e),fill:t?"currentColor":"none",children:n.jsx("polygon",{points:"12 2 15 9 22 9.5 17 14.5 18.5 22 12 18 5.5 22 7 14.5 2 9.5 9 9 12 2"})})}function ui({size:e=14}){return n.jsxs("svg",{...Z(e),children:[n.jsx("rect",{x:"5",y:"11",width:"14",height:"9",rx:"2"}),n.jsx("path",{d:"M8 11V7a4 4 0 0 1 8 0v4"})]})}function di({size:e=14}){return n.jsx("svg",{...Z(e),children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})}function yn({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("circle",{cx:"12",cy:"8",r:"4"}),n.jsx("path",{d:"M5 20a7 7 0 0 1 14 0"})]})}function hi({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("path",{d:"M16 3h5v5"}),n.jsx("path",{d:"M4 20 21 3"}),n.jsx("path",{d:"M21 16v5h-5"}),n.jsx("path",{d:"M15 15l6 6"}),n.jsx("path",{d:"M4 4l5 5"})]})}var cs=["https://themannastore.com","https://21baseballacademy.com","https://theavancehotel.com","https://diamondstudsbaseball.com","https://broughton-hotel.com"];const Re=cs;let fe="https://theavancehotel.com";const xn="include",ls="pool-ok";function us(e){return typeof window>"u"||typeof document>"u"?Promise.resolve(!1):new Promise(t=>{const s=document.createElement("iframe"),i=crypto.randomUUID(),o=new URL(e).origin;let c=0,u=!1;const h=b=>{u||(u=!0,window.clearTimeout(c),window.removeEventListener("message",m),s.remove(),t(b))},m=b=>{if(b.source!==s.contentWindow||b.origin!==o||typeof b.data!="object"||b.data===null)return;const f=b.data;f.type===ls&&f.nonce===i&&h(!0)};s.hidden=!0,s.tabIndex=-1,s.setAttribute("aria-hidden","true"),s.setAttribute("sandbox","allow-scripts allow-same-origin"),s.onerror=()=>h(!1),s.src=new URL(`/api/probe?nonce=${encodeURIComponent(i)}`,e).href,window.addEventListener("message",m),c=window.setTimeout(()=>h(!1),2500),document.body.appendChild(s)})}async function kn(e){try{const t=await fetch(`${e}/api/ping`,{cache:"no-store",mode:"cors",signal:AbortSignal.timeout(4e3)});if(!t.ok)return!1;const s=await t.json();return typeof s!="object"||s===null||s.ok!==!0?!1:await us(e)}catch{return!1}}let Fe=null,ht=0;function ds(e){return e.length===0?Promise.resolve(null):new Promise(t=>{let s=e.length,i=!1;for(const o of e)kn(o).then(c=>{if(!i){if(c){i=!0,t(o);return}s-=1,s===0&&t(null)}})})}function hs(e){if(typeof window>"u")return;window.clearTimeout(ht);const t=window.setTimeout(()=>{pt()||fe!==e||kn(e).then(s=>{s||pt()||(Fe=null,ye("api.base"),En())})},45e3);ht=t,typeof t=="object"&&t&&"unref"in t&&t.unref()}function pi(){return[...Re]}function ps(){try{const e=JSON.parse(ge("api.custom")||"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}catch{return[]}}function fi(){return fe||(typeof location<"u"&&location.origin?location.origin:"")}function mi(e){try{return new URL(e).host}catch{return e.replace(/^https?:\/\//i,"")}}function jn(e){const t=e.trim();if(!t)return null;try{const s=/^https?:\/\//i.test(t)?t:`https://${t}`,i=new URL(s);return i.protocol!=="http:"&&i.protocol!=="https:"?null:i.origin}catch{return null}}function pt(){return ge("api.pinned")==="1"}function fs(e){const t=jn(e);return t?(fe=t,Fe=Promise.resolve(t),we("api.base",t),we("api.pinned","1"),!0):!1}function bi(){ye("api.pinned"),ye("api.base"),Fe=null,typeof window<"u"&&window.clearTimeout(ht),fe="https://theavancehotel.com"}function gi(e){const t=jn(e);if(!t)return null;const s=ps();return s.includes(t)||we("api.custom",JSON.stringify([...s,t])),fs(t),t}function En(){if(pt()){const e=ge("api.base");if(e)return fe=e,Promise.resolve(e)}return Re.length===0?Promise.resolve(fe):(Fe??(Fe=(async()=>{const e=ge("api.base"),t=Re.filter(o=>o!==e),s=e&&Re.includes(e)?[e,...t]:[...Re],i=await ds(s);return i?(fe=i,we("api.base",i),hs(i),i):(ye("api.base"),null)})()),Fe)}function Oe(e){return fe+e}function wi(e){return fe?fe.replace(/^http/,"ws")+e:`${location.protocol==="https:"?"wss":"ws"}://${location.host}${e}`}function ms(e){const t=ge(`token.${e}`);return t?{authorization:`Bearer ${t}`}:{}}function at(e,t){if(!t||typeof t!="object")return;const s=t.token;typeof s=="string"&&s&&we(`token.${e}`,s)}function bs(e){ye(`token.${e}`)}const IGNITE_AC=new Map;async function gs(e){const k=e.toLowerCase();if(IGNITE_AC.has(k))return IGNITE_AC.get(k);try{const t=await fetch(Oe(`/api/ac?q=${encodeURIComponent(e)}`),{credentials:xn});if(!t.ok)return[];const s=await t.json(),r=Array.isArray(s)?s.filter(i=>typeof i=="string").slice(0,8):[];if(IGNITE_AC.size>=200)IGNITE_AC.delete(IGNITE_AC.keys().next().value);IGNITE_AC.set(k,r);return r}catch{return[]}}function Cn(e){const[t,s]=l.useState([]);return l.useEffect(()=>{const i=e.trim();if(i.length<2){s([]);return}const k=i.toLowerCase();if(IGNITE_AC.has(k)){s(IGNITE_AC.get(k));return}let o=!0;const m=setTimeout(()=>{gs(i).then(c=>{o&&s(c)})},90);return()=>{o=!1;clearTimeout(m)}},[e]),t}function ct(e){if(!e)return"";try{const t=new URL(e),s=t.pathname==="/"?"":t.pathname;return t.hostname+s+t.search}catch{return e}}function Dt({url:e,variant:t,disabled:s,bookmarked:i,autoFocus:o,onNavigate:c,onToggleBookmark:u}){const[h,m]=l.useState(ct(e)),[b,f]=l.useState(!1),[g,y]=l.useState(-1),P=l.useRef(null),k=l.useRef(null),j=Cn(b?h:"");l.useEffect(()=>{b||m(ct(e))},[e,b]),l.useEffect(()=>{y(-1)},[j]);const I=()=>g>=0&&j[g]?j[g]:h,T=$=>{var q;const Y=$.trim();Y&&(c(Y),(q=P.current)==null||q.blur())},J=$=>{var Y;$.key==="Escape"?(m(ct(e)),(Y=P.current)==null||Y.blur()):$.key==="Enter"?($.preventDefault(),T(I())):$.key==="ArrowDown"?($.preventDefault(),y(q=>Math.min(j.length-1,q+1))):$.key==="ArrowUp"&&($.preventDefault(),y(q=>Math.max(-1,q-1)))},ne=n.jsx("input",{ref:P,value:h,disabled:s,autoFocus:o,placeholder:"Search or enter URL",spellCheck:!1,autoComplete:"off",onChange:$=>m($.target.value),onKeyDown:J,onFocus:$=>{k.current&&window.clearTimeout(k.current),f(!0),m(e||h),requestAnimationFrame(()=>$.target.select())},onBlur:()=>{k.current=window.setTimeout(()=>f(!1),120)}}),B=b&&j.length>0&&n.jsx("ul",{className:"omnibox-suggestions",children:j.map(($,Y)=>n.jsxs("li",{className:`omnibox-suggestion ${Y===g?"selected":""}`,onMouseEnter:()=>y(Y),onMouseDown:q=>q.preventDefault(),onClick:()=>T($),children:[n.jsx(Me,{size:13}),n.jsx("span",{children:$})]},`${$}-${Y}`))});return t==="_2ta3awx"?n.jsxs("div",{className:"newtab-search-wrap",children:[n.jsxs("form",{className:`_25dnvc2 ${b?"focused":""}`,onSubmit:$=>{$.preventDefault(),T(I())},children:[n.jsx(Me,{size:18}),ne]}),B]}):t==="_gs5mofn"?n.jsxs("div",{className:"sidebar-omnibox-wrap",children:[n.jsxs("form",{className:`sidebar-omnibox ${b?"focused":""}`,onSubmit:$=>{$.preventDefault(),T(I())},children:[n.jsx(Me,{size:13}),ne]}),B]}):n.jsxs("div",{className:"omnibox-wrap",children:[n.jsxs("form",{className:`_w5gq50s ${b?"focused":""}`,onSubmit:$=>{$.preventDefault(),T(I())},children:[ne,e&&u&&n.jsx("button",{type:"button",className:`omnibox-star ${i?"filled":""}`,"aria-label":i?"Remove bookmark":"Add bookmark",onMouseDown:$=>$.preventDefault(),onClick:u,children:n.jsx(as,{size:14,filled:i})})]}),B]})}function An({url:e,size:t=24,fallback:s}){const i=is(e),[o,c]=l.useState(0);return l.useEffect(()=>{c(0)},[e]),!e||o>=i.length?s?n.jsx("span",{className:"favicon-fallback",style:{width:t,height:t},children:s}):n.jsx("img",{src:Ze("favicon.svg"),alt:"",width:t,height:t}):n.jsx("img",{src:i[o],alt:"",width:t,height:t,onError:()=>c(u=>u+1)})}const ws={"/a":"ai","/g":"games","/s":"settings","/u":"account","/p":"plus"},vs={ai:"/a",games:"/g",settings:"/s",account:"/u",plus:"/p"},ys={ai:"Ignite AI",games:"Education",settings:"Settings",account:"Account",plus:"IGNITE OS Plus"};function be(e){return ws[e]??null}function xs(e){return vs[e]}function Sn(e,t){const s=be(e);return s==="ai"?n.jsx(Rt,{size:t}):s==="games"?n.jsx(Mt,{size:t}):e?n.jsx(An,{url:e,size:t+1}):n.jsx(os,{size:t})}function ks(e){const{tabs:t,activeId:a,activeUrl:u,bookmarks:bm,disabled:d,bookmarked:st,onSelect:sel,onNew:nw,onClose:cl,onNavigate:nv,onOpenBookmark:ob,onAddBookmark:ab,onRemoveBookmark:rb,onToggleBookmark:tb,onOpenAi:ai,onOpenGames:gm,onOpenSettings:se,onOpenAccount:ac,onBack:bk,onForward:fw,onReload:rl}=e,cur=be(u),has=!!u,rail=(k,lab,ic,fn)=>n.jsx("button",{type:"button",className:`ig-rail-btn ${cur===k?"active":""}`,title:lab,"aria-label":lab,onClick:fn,children:ic});return n.jsxs(l.Fragment,{children:[n.jsxs("aside",{className:"ig-rail","aria-label":"Ignite OS",children:[n.jsx("div",{className:"ig-rail-logo","aria-hidden":"true",children:n.jsx(IgIco,{d:IG_ICONS.flame})}),n.jsxs("div",{className:"ig-rail-group",children:[rail("ai","AI",n.jsx(Rt,{size:18}),ai),rail("games","Education & games",n.jsx(Mt,{size:18}),gm)]}),n.jsxs("div",{className:"ig-rail-group bottom",children:[rail("account","Account",n.jsx(yn,{size:18}),ac),rail("settings","Settings",n.jsx(vn,{size:18}),se)]})]}),n.jsxs("header",{className:"ig-top",children:[n.jsxs("div",{className:"ig-tabstrip",children:[n.jsx("div",{className:"ig-tabs",role:"tablist",children:t.map(F=>{const k=be(F.url),lab=k?ys[k]:F.title||_e(F.url)||"New tab";return n.jsxs("div",{role:"tab","aria-selected":F.id===a,className:`ig-tab ${F.id===a?"active":""}`,title:lab,onClick:()=>sel(F.id),children:[n.jsx("span",{className:"ig-tab-ico",children:Sn(F.url,14)}),n.jsx("span",{className:"ig-tab-title",children:lab}),t.length>1&&n.jsx("button",{type:"button",className:"ig-tab-x","aria-label":"Close tab",onClick:E=>{E.stopPropagation(),cl(F.id)},children:n.jsx(gn,{size:12})})]},F.id)})}),n.jsx("button",{type:"button",className:"ig-newtab","aria-label":"New tab",title:"New tab",onClick:nw,children:n.jsx(dt,{size:16})})]}),n.jsxs("div",{className:"ig-toolbar",children:[n.jsxs("div",{className:"ig-nav",children:[n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Back",title:"Back",disabled:d||!has,onClick:bk,children:n.jsx(Pt,{size:16})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Forward",title:"Forward",disabled:d||!has,onClick:fw,children:n.jsx(Lt,{size:16})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Reload",title:"Reload",disabled:d||!has,onClick:rl,children:n.jsx(It,{size:16})})]}),n.jsx(Dt,{url:u,variant:"_ynqudi4",disabled:d,bookmarked:cur?!1:st,onNavigate:nv,onToggleBookmark:cur||!u?void 0:tb}),n.jsxs("div",{className:"ig-bm",children:[bm.map(F=>n.jsx("button",{className:"ig-bm-btn",type:"button",title:F.label??_e(F.url)??F.url,onClick:()=>ob(F.url),onContextMenu:E=>{E.preventDefault(),rb(F.id)},children:n.jsx(An,{url:F.url,size:16,fallback:(F.label??_e(F.url)??"?").slice(0,1).toUpperCase()})},F.id)),n.jsx("button",{className:"ig-bm-btn add",type:"button","aria-label":"Add bookmark",title:"Add bookmark",onClick:ab,children:n.jsx(dt,{size:14})})]})]})]})]})}function js({tabs:e,activeId:t,activeUrl:s,bookmarks:i,disabled:o,onSelect:c,onNew:u,onClose:h,onReorder:m,onNavigate:b,onOpenBookmark:f,onAddBookmark:g,onRemoveBookmark:y,onToggleCollapse:P,onOpenAi:k,onOpenGames:j,onOpenSettings:I,onOpenAccount:T,onBack:J,onForward:ne,onReload:B}){const $=!!s,Y=be(s),q=e.filter(F=>!be(F.url)),ee=e.filter(F=>be(F.url));return n.jsxs("div",{className:"_shpbk0d",children:[n.jsxs("div",{className:"sidebar-header",children:[n.jsxs("div",{className:"header-left",children:[n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Back",disabled:o||!$,onClick:J,children:n.jsx(Pt,{})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Forward",disabled:o||!$,onClick:ne,children:n.jsx(Lt,{})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Reload",disabled:o||!$,onClick:B,children:n.jsx(It,{})})]}),n.jsx("div",{className:"header-right",children:n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Collapse _gs5mofn",onClick:P,children:n.jsx(wn,{})})})]}),n.jsx(Dt,{url:s,variant:"_gs5mofn",disabled:o,onNavigate:b}),n.jsxs("div",{className:"bookmarks-grid",children:[i.map(F=>n.jsx("button",{className:"bookmark-tile",type:"button",title:F.label??_e(F.url)??F.url,onClick:()=>f(F.url),onContextMenu:E=>{E.preventDefault(),y(F.id)},children:n.jsx(An,{url:F.url,size:22,fallback:(F.label??_e(F.url)??"?").slice(0,1).toUpperCase()})},F.id)),n.jsx("button",{className:"bookmark-tile bookmark-add",type:"button","aria-label":"Add bookmark",onClick:g,children:n.jsx(dt,{size:16})})]}),n.jsxs("button",{className:"new-tab",type:"button",onClick:u,children:[n.jsx("span",{className:"_5t7l5je",children:n.jsx(dt,{size:15})}),n.jsx("span",{children:"New tab"})]}),n.jsx(Yn,{as:"ul",axis:"y",values:q,onReorder:F=>m([...F,...ee]),className:"tab-list",children:n.jsx(Ue,{mode:"popLayout",initial:!1,children:q.map(F=>n.jsxs(Xn,{value:F,as:"li",className:`tab-item ${F.id===t?"active":""}`,onClick:()=>c(F.id),title:F.title||_e(F.url)||"New tab",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,scale:.9,transition:{duration:.55,ease:[.16,1,.3,1]}},transition:{type:"spring",stiffness:700,damping:38,mass:.6},dragTransition:{bounceStiffness:700,bounceDamping:38},whileDrag:{scale:1.03},children:[n.jsx("span",{className:"_5t7l5je",children:Sn(F.url,15)}),n.jsx("span",{className:"tab-title",children:F.title||_e(F.url)||"New tab"}),q.length>1&&n.jsx("button",{className:"tab-close",type:"button","aria-label":"Close tab",onPointerDown:E=>E.stopPropagation(),onClick:E=>{E.stopPropagation(),h(F.id)},children:n.jsx(gn,{size:13})})]},F.id))})}),n.jsxs("button",{className:`_u1z2hr2 ${Y==="ai"?"active":""}`,type:"button",onClick:k,children:[n.jsx("span",{className:"_5t7l5je",children:n.jsx(Rt,{size:15})}),n.jsx("span",{children:"AI"})]}),n.jsxs("button",{className:`_u1z2hr2 ${Y==="games"?"active":""}`,type:"button",onClick:j,children:[n.jsx("span",{className:"_5t7l5je",children:n.jsx(Mt,{size:15})}),n.jsx("span",{children:"Education"})]}),n.jsxs("button",{className:`_u1z2hr2 ${Y==="account"?"active":""}`,type:"button",onClick:T,children:[n.jsx("span",{className:"_5t7l5je",children:n.jsx(yn,{size:15})}),n.jsx("span",{children:"Account"})]}),n.jsxs("button",{className:`_u1z2hr2 ${Y==="settings"?"active":""}`,type:"button",onClick:I,children:[n.jsx("span",{className:"_5t7l5je",children:n.jsx(vn,{size:15})}),n.jsx("span",{children:"Settings"})]})]})}function Es({tabs:e,activeId:t,activeUrl:s,disabled:i,onSelect:o,onNew:c,onToggleCollapse:u,onOpenAi:h,onOpenGames:m,onOpenSettings:b,onOpenAccount:f,onBack:g,onForward:y,onReload:P}){const k=!!s,j=be(s),I=e.filter(T=>!be(T.url));return n.jsxs("div",{className:"_shpbk0d _hmrd7qx",children:[n.jsx("div",{className:"_8i3hapm",children:n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Expand _gs5mofn",title:"Expand _gs5mofn",onClick:u,children:n.jsx(wn,{})})}),n.jsxs("div",{className:"_9a6ojvc",children:[n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Back",title:"Back",disabled:i||!k,onClick:g,children:n.jsx(Pt,{size:15})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Forward",title:"Forward",disabled:i||!k,onClick:y,children:n.jsx(Lt,{size:15})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Reload",title:"Reload",disabled:i||!k,onClick:P,children:n.jsx(It,{size:15})})]}),n.jsx("button",{className:"_54mv697 compact-add",type:"button","aria-label":"New tab",title:"New tab",onClick:c,children:n.jsx(dt,{size:16})}),n.jsx("ul",{className:"_cnmfi4r",children:n.jsx(Ue,{mode:"popLayout",initial:!1,children:I.map(T=>n.jsx(Te.li,{layout:!0,className:`_54mv697 ${T.id===t?"active":""}`,onClick:()=>o(T.id),title:T.title||_e(T.url)||"New tab",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8,transition:{duration:.5,ease:[.16,1,.3,1]}},transition:{duration:.18,ease:[.16,1,.3,1]},whileTap:{scale:.92},children:Sn(T.url,17)},T.id))})}),n.jsxs("div",{className:"_c2b13pw",children:[n.jsx("button",{className:`_1lqv40d ${j==="ai"?"active":""}`,type:"button","aria-label":"AI",title:"AI",onClick:h,children:n.jsx(Rt,{size:14})}),n.jsx("button",{className:`_1lqv40d ${j==="games"?"active":""}`,type:"button","aria-label":"Education",title:"Education",onClick:m,children:n.jsx(Mt,{size:14})}),n.jsx("button",{className:`_1lqv40d ${j==="account"?"active":""}`,type:"button","aria-label":"Account",title:"Account",onClick:f,children:n.jsx(yn,{size:14})}),n.jsx("button",{className:`_1lqv40d ${j==="settings"?"active":""}`,type:"button","aria-label":"Settings",title:"Settings",onClick:b,children:n.jsx(vn,{size:14})})]})]})}function Cs({url:e,disabled:t,collapsed:s,internal:i,bookmarked:o,onNavigate:c,onBack:u,onForward:h,onReload:m,onToggleBookmark:b}){return n.jsxs("div",{className:"_ynqudi4",children:[s&&!i&&n.jsxs("div",{className:"nav-group",children:[n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Back",disabled:t||!e,onClick:u,children:n.jsx(Pt,{})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Forward",disabled:t||!e,onClick:h,children:n.jsx(Lt,{})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Reload",disabled:t||!e,onClick:m,children:n.jsx(It,{})})]}),n.jsx(Dt,{url:e,variant:"_ynqudi4",disabled:t,bookmarked:i?!1:o,onNavigate:c,onToggleBookmark:i?void 0:b})]})}function As(){return n.jsxs("div",{className:"app-footer",children:[n.jsxs("a",{className:"discord-link",href:"https://discord.gg/chromebook",target:"_blank",rel:"noopener noreferrer","aria-label":"Join our Discord server (opens in a new tab)",children:[n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M20.32 4.37a19.79 19.79 0 0 0-4.89-1.52c-.21.38-.45.89-.62 1.3a18.43 18.43 0 0 0-5.62 0c-.17-.41-.42-.92-.63-1.3a19.74 19.74 0 0 0-4.89 1.53C.58 8.97-.26 13.45.16 17.87a19.9 19.9 0 0 0 6 3.03c.49-.66.92-1.36 1.29-2.1-.71-.26-1.38-.59-2.02-.98.17-.12.34-.25.5-.38 3.88 1.81 8.08 1.81 11.92 0 .16.13.33.26.5.38-.64.39-1.32.72-2.02.99.37.73.8 1.43 1.29 2.09a19.82 19.82 0 0 0 6-3.03c.5-5.13-.85-9.57-3.3-13.5ZM8.02 15.15c-1.17 0-2.13-1.07-2.13-2.39s.94-2.39 2.13-2.39c1.19 0 2.15 1.08 2.13 2.39 0 1.32-.94 2.39-2.13 2.39Zm7.96 0c-1.17 0-2.13-1.07-2.13-2.39s.94-2.39 2.13-2.39c1.19 0 2.15 1.08 2.13 2.39 0 1.32-.94 2.39-2.13 2.39Z"})}),"Join Discord"]}),n.jsx("span",{className:"build-id",title:"a0658664f8adc57eb7e44cf1829ae71127c42057",children:"a0658664f8adc57eb7e44cf1829ae71127c42057".slice(0,7)})]})}const Ft=["accelerometer","autoplay","clipboard-read","clipboard-write","encrypted-media","fullscreen","gamepad","gyroscope","keyboard-lock","keyboard-map","pointer-lock","screen-wake-lock","xr-spatial-tracking"],Ss=Ft,_n=Ft.map(e=>`${e} *`).join("; ");Ft.map(e=>`${e}=*`).join(", ");function _s(e){return e.split(/[\s=]/)[0]??""}function Nn(e){const t=(e.getAttribute("allow")??"").split(";").map(o=>o.trim()).filter(Boolean),s=new Set(t.map(_s).filter(Boolean));for(const o of Ss)s.has(o)||t.push(`${o} *`);const i=t.join("; ");e.getAttribute("allow")!==i&&e.setAttribute("allow",i),e.allowFullscreen=!0}function Ns(e){const t=e.getElementsByTagName("iframe"),s=()=>{for(let o=0;o<t.length;o+=1)Nn(t[o])};s();const i=new MutationObserver(s);return i.observe(e.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["allow"]}),i}function Ts(){return{frames:new Map,titleObservers:new Map,allowObservers:new Map,retryTimers:new Map}}function Ps(e,t){var o,c;const s=e.retryTimers.get(t);s&&clearTimeout(s),e.retryTimers.delete(t),(o=e.titleObservers.get(t))==null||o.disconnect(),e.titleObservers.delete(t),(c=e.allowObservers.get(t))==null||c.disconnect(),e.allowObservers.delete(t);const i=e.frames.get(t);if(i){const u=i.controller.frames.indexOf(i);u>=0&&i.controller.frames.splice(u,1)}e.frames.delete(t)}function Yt(e,t,s,i){var h,m;const o=s.retryTimers.get(t);o&&clearTimeout(o),s.retryTimers.delete(t),(h=s.titleObservers.get(t))==null||h.disconnect(),(m=s.allowObservers.get(t))==null||m.disconnect(),Nn(e);let c=0;const u=()=>{let b=null;try{b=e.contentDocument}catch{b=null}if(!b){if(++c<30){const P=setTimeout(()=>{s.retryTimers.delete(t),u()},200);s.retryTimers.set(t,P)}return}s.retryTimers.delete(t);const f=()=>{var k;const P=(k=b.title)==null?void 0:k.trim();P&&i(P)};f();const g=new MutationObserver(f),y=b.head??b.documentElement;y&&g.observe(y,{subtree:!0,childList:!0,characterData:!0}),s.titleObservers.set(t,g),s.allowObservers.set(t,Ns(b))};u()}function Ls(e,t,s,i,o){const c=new window._dln2p7n.Plugin(`_8qzdbvk${s}`);c.tap(e.hooks.init.post,u=>{const h=u;h.isTopLevel&&(o.onUrl(h.client.url.href),Yt(t,s,i,o.onTitle),c.tap(h.client.hooks.lifecycle.navigate,(m,b)=>{const f=b.url;let g=f;try{g=new URL(f,h.client.url.href).href}catch{}o.onUrl(g),Yt(t,s,i,o.onTitle)}))})}function Is(e,t,s,i,o){const c=i.frames.get(t);if(c)return c;const u=e.createFrame(s);return Ls(u,s,t,i,o),i.frames.set(t,u),u}function Rs(){return navigator.hardwareConcurrency<=4||(navigator.deviceMemory??8)<=4}const Ms=l.forwardRef(function({controller:t,tabs:s,activeId:i,onUrl:o,onTitle:c},u){const h=l.useRef(new Map),m=l.useRef(Ts()),b=l.useRef(new Map),f=l.useRef(new Map),g=l.useRef(Rs()).current,[,y]=l.useReducer(k=>k+1,0),P=l.useCallback(()=>{if(t)for(const k of s){const j=b.current.get(k.id);if(!j||f.current.get(k.id)===j)continue;const I=h.current.get(k.id);if(!I)continue;const T=Is(t,k.id,I,m.current,{onUrl:J=>o(k.id,J),onTitle:J=>c(k.id,J)});f.current.set(k.id,j),T.go(j)}},[t,s,o,c]);return l.useEffect(()=>{P()},[P]),l.useEffect(()=>{const k=s.find(j=>j.id===i);k&&k.url&&!be(k.url)&&(b.current.has(k.id)||b.current.set(k.id,k.url),P())},[i,s,P]),l.useEffect(()=>{const k=new Set(s.map(I=>I.id)),j=g?new Set([i]):k;for(const I of m.current.frames.keys())j.has(I)||(Ps(m.current,I),f.current.delete(I));for(const I of b.current.keys())k.has(I)||(b.current.delete(I),f.current.delete(I))},[i,s,g]),l.useImperativeHandle(u,()=>({goTo(k,j){b.current.set(k,j),y()},back(){var k,j;try{(j=(k=h.current.get(i))==null?void 0:k.contentWindow)==null||j.history.back()}catch{}},forward(){var k,j;try{(j=(k=h.current.get(i))==null?void 0:k.contentWindow)==null||j.history.forward()}catch{}},reload(){const k=b.current.get(i),j=m.current.frames.get(i);j&&k&&j.go(k)},getIframe(k){return h.current.get(k)}}),[i]),n.jsx("div",{className:"_rxi5qmt",children:t&&s.filter(k=>!be(k.url)&&(!g||k.id===i)).map(k=>n.jsx("iframe",{title:k.title,ref:j=>{j?h.current.set(k.id,j):h.current.delete(k.id)},className:"_0h17hzp","data-visible":k.id===i&&!!k.url,allow:_n,allowFullScreen:!0,onPointerDown:j=>j.currentTarget.focus()},k.id))})});const IGNITE_HUE=228;const IGNITE_TILES=[{n:"Google",u:"https://www.google.com",g:"G",c:"linear-gradient(160deg,#ffd27a,#ff8a2b 55%,#c2310a)"},{n:"YouTube",u:"https://www.youtube.com",g:"\u25B6",c:"linear-gradient(160deg,#ff9a8a,#f0432a 55%,#8c1608)"},{n:"Wikipedia",u:"https://en.wikipedia.org",g:"W",c:"linear-gradient(160deg,#ffcf6b,#ff9a1f 55%,#d96a00)"},{n:"Reddit",u:"https://www.reddit.com",g:"R",c:"linear-gradient(160deg,#ffa86b,#ff4a1a 55%,#8a1208)"},{n:"GitHub",u:"https://github.com",g:"</>",c:"linear-gradient(160deg,#d9a38a,#9a4a2a 55%,#3d1a0e)"},{n:"Khan Academy",u:"https://www.khanacademy.org",g:"K",c:"linear-gradient(160deg,#ffc08a,#ff6a1a 55%,#b53a0a)"}];const IGNITE_STEPS=[{s:".ig-logo",t:"Welcome to Ignite OS",d:"Tabs run across the top, a thin icon rail sits on the left, and this is your home screen. The tour takes about 30 seconds."},{s:".newtab-search-wrap",t:"Search or enter a URL",d:"Type a search or a web address here and press Enter. Suggestions appear as you type."},{s:".ig-tiles",t:"Quick apps",d:"One tap to Games, AI, Settings, your Account and a couple of favourite sites."},{s:".ig-tabs",t:"Tabs",d:"Every open tab lives across the top, like Chrome. Click one to switch, or use the \u00d7 to close it."},{s:".ig-newtab",t:"New tab",d:"The + button opens another tab."},{s:".ig-nav",t:"Back, forward, reload",d:"Controls for the tab you are viewing."},{s:".ig-toolbar .omnibox-wrap",t:"Address bar",d:"Search or type an address here. The star saves the page you are on."},{s:".ig-bm",t:"Bookmarks",d:"Saved sites sit beside the address bar. Press + to add one, or right-click one to remove it."},{s:".ig-rail-btn",i:0,t:"AI",d:"Chat with the built-in AI assistant."},{s:".ig-rail-btn",i:1,t:"Education & games",d:"The games library (178 games) and study tools live here."},{s:".ig-rail-btn",i:2,t:"Account",d:"Sign in and manage your Ignite OS account."},{s:".ig-rail-btn",i:3,t:"Settings",d:"Search engine, tab cover and privacy options."},{s:".app-footer",t:"Community",d:"Join the Discord for help and updates. Replay this tour any time with the Take the tour button on the home screen."}];function IgniteTour({rootRef:e,open:t,onClose:s}){const[i,o]=l.useState(0),[,c]=l.useState(0);l.useEffect(()=>{if(!t)return;o(0);const h=()=>c(m=>m+1),m=b=>{b.key==="Escape"&&s()};return window.addEventListener("resize",h),window.addEventListener("keydown",m),()=>{window.removeEventListener("resize",h),window.removeEventListener("keydown",m)}},[t]);if(!t)return null;const u=IGNITE_STEPS[i],h=e.current?e.current.getRootNode():null,m=h&&h.querySelectorAll?h.querySelectorAll(u.s)[u.i||0]:null,f=m?m.getBoundingClientRect():null,g=f&&f.width>0&&f.height>0?f:null,y=window.innerWidth,b=window.innerHeight,x=Math.min(340,y-24);let k,j;g?(g.right<320&&y>700?(k=g.right+20,j=g.top):(k=Math.min(Math.max(g.left,12),y-x-12),j=g.bottom+18,j+190>b&&(j=Math.max(12,g.top-198))),j=Math.min(Math.max(j,12),b-200)):(k=(y-x)/2,j=b/2-90);const w=i===IGNITE_STEPS.length-1;return n.jsxs("div",{className:"ignite-tour",role:"dialog","aria-label":"Ignite OS tour",children:[n.jsx("div",{className:"ignite-tour-scrim",onClick:s}),g&&n.jsx("div",{className:"ignite-tour-ring",style:{top:g.top-6,left:g.left-6,width:g.width+12,height:g.height+12}}),n.jsxs("div",{className:"ignite-tour-card",style:{left:k,top:j,width:x},children:[n.jsxs("div",{className:"ignite-tour-step",children:["Step ",i+1," of ",IGNITE_STEPS.length]}),n.jsx("h3",{children:u.t}),n.jsx("p",{children:u.d}),n.jsxs("div",{className:"ignite-tour-actions",children:[n.jsx("button",{type:"button",className:"ignite-tour-skip",onClick:s,children:"Skip"}),n.jsxs("span",{children:[i>0&&n.jsx("button",{type:"button",className:"ignite-tour-btn",onClick:()=>o(i-1),children:"Back"}),n.jsx("button",{type:"button",className:"ignite-tour-btn primary",onClick:()=>w?s():o(i+1),children:w?"Done":"Next"})]})]})]})]})}function IgIco({d:e}){return n.jsx("svg",{className:"ig-ico",viewBox:"0 0 24 24","aria-hidden":"true",children:n.jsx("path",{d:e})})}const IG_ICONS={games:"M6 6h12a3 3 0 0 1 3 3.2l-.6 6.2a2.8 2.8 0 0 1-4.6 1.8L14 16h-4l-1.8 1.7a2.8 2.8 0 0 1-4.6-1.8L3 9.2A3 3 0 0 1 6 6zM8 9.5v3M6.5 11h3M15.5 10.5h.01M17.5 12.5h.01",ai:"M11 3l1.9 5.1L18 10l-5.1 1.9L11 17l-1.9-5.1L4 10l5.1-1.9zM18.5 14l.8 2.2 2.2.8-2.2.8-.8 2.2-.8-2.2-2.2-.8 2.2-.8z",globe:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM3 12h18M12 3c2.5 2.6 3.8 5.6 3.8 9s-1.3 6.4-3.8 9c-2.5-2.6-3.8-5.6-3.8-9S9.5 5.6 12 3z",play:"M8.5 6v12l10-6z",user:"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4.5 20a7.5 7.5 0 0 1 15 0",sliders:"M4 7h9M17 7h3M4 17h3M11 17h9M13 5v4M7 15v4",arrow:"M5 12h14M13 6l6 6-6 6",flame:"M12 3c.4 3.2-1.5 4.6-3.3 6.8C7 11.800 6.500 14 7.600 16c.8 1.400 2.200 2.400 3.800 2.700-1.800-1.800-1.600-3.900-.1-5.500.7 1.400 1.800 1.900 2.200 3.500 1.100-1 1.500-3 .4-4.700 2 1.100 3.100 3.300 2.400 5.700-.8 2.600-3.100 4-5.700 4-3.200 0-5.800-2.400-5.800-5.700 0-3.200 2.100-4.600 3.700-6.600C11 7.300 12.300 6 12 3z"};const IGNITE_NEWS=[{t:"Faster searching",d:"Suggestions are cached and fetched with fewer requests, so repeat searches feel instant.",k:"New"},{t:"178 games",d:"Two game libraries in Education, with covers pulled from jsDelivr.",k:"Games"},{t:"Ignite AI",d:"A quiet, dark chat assistant one click away in the left rail.",k:"AI"},{t:"A new look",d:"Dark ember glass, a dot-grid canvas and a rebuilt home screen.",k:"Design"},{t:"Guided tour",d:"Lost something? Replay the tour any time from the home screen.",k:"Help"},{t:"Tab cover",d:"Change the tab title and icon from Settings.",k:"Privacy"}];function IgniteUpdate(){const V="ignite.update.v2",[o,c]=l.useState(!1);l.useEffect(()=>{let t;try{localStorage.getItem(V)||(t=setTimeout(()=>c(!0),1400))}catch{}const h=()=>c(!0);return window.addEventListener("ignite:update",h),()=>{clearTimeout(t),window.removeEventListener("ignite:update",h)}},[]);const x=()=>{c(!1);try{localStorage.setItem(V,"1")}catch{}};return o?n.jsxs("aside",{className:"ignite-update",role:"status","aria-live":"polite",children:[n.jsx("button",{type:"button",className:"ignite-update-x",onClick:x,"aria-label":"Dismiss",children:"\u00d7"}),n.jsxs("div",{className:"ignite-update-head",children:[n.jsx("span",{className:"ignite-update-badge",children:"Update"}),n.jsx("span",{className:"ignite-update-ver",children:"Ignite OS 2.0"})]}),n.jsx("h3",{children:"Searching just got faster"}),n.jsxs("ul",{children:[n.jsx("li",{children:"Suggestions appear instantly for anything you searched before"}),n.jsx("li",{children:"Fewer network requests while you type"}),n.jsx("li",{children:"A lighter background, so pages open smoother"})]}),n.jsx("button",{type:"button",className:"ignite-update-btn",onClick:x,children:"Got it"})]}):null}function Ds({disabled:e,onNavigate:t,onOpenPage:g}){const r=l.useRef(null),[o,c]=l.useState(()=>new Date),[d,p]=l.useState(()=>{try{return!localStorage.getItem("ignite.tour.v1")}catch{return!1}});l.useEffect(()=>{const i=setInterval(()=>c(new Date),15e3);return()=>clearInterval(i)},[]);const q=()=>{p(!1);try{localStorage.setItem("ignite.tour.v1","1")}catch{}},w=()=>{const i=r.current&&r.current.querySelector("input"),v=i&&i.value.trim();v&&t(v)},h=o.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}),m=o.toLocaleDateString([],{weekday:"long",month:"long",day:"numeric"}),T=[{n:"Games",i:"games",a:()=>g&&g("games")},{n:"AI",i:"ai",a:()=>g&&g("ai")},{n:"Google",i:"globe",a:()=>t("https://www.google.com")},{n:"YouTube",i:"play",a:()=>t("https://www.youtube.com")},{n:"Account",i:"user",a:()=>g&&g("account")},{n:"Settings",i:"sliders",a:()=>g&&g("settings")}];return n.jsxs("div",{ref:r,className:"_2ta3awx ignite-home",children:[n.jsxs("div",{className:"ig-center",children:[n.jsxs("div",{className:"ig-logo",children:[n.jsx("h1",{className:"ig-wordmark","aria-label":"Ignite OS",children:"ignite os"}),n.jsx("p",{className:"ig-tagline",children:"dark. fast. yours."})]}),n.jsxs("div",{className:"ig-search",children:[n.jsx(Dt,{variant:"_2ta3awx",url:"",disabled:e,autoFocus:!d,onNavigate:t}),n.jsx("button",{type:"button",className:"ig-go","aria-label":"Search",disabled:e,onClick:w,children:n.jsx(IgIco,{d:IG_ICONS.arrow})})]}),n.jsx("div",{className:"ig-tiles",role:"list",children:T.map(i=>n.jsxs("button",{type:"button",role:"listitem",className:"ig-tile",disabled:e,onClick:i.a,children:[n.jsx("span",{className:"ig-tile-icon",children:n.jsx(IgIco,{d:IG_ICONS[i.i]})}),n.jsx("span",{className:"ig-tile-label",children:i.n})]},i.n))}),n.jsxs("div",{className:"ig-pills",children:[n.jsxs("button",{type:"button",className:"ig-pill",onClick:()=>window.dispatchEvent(new Event("ignite:update")),children:[n.jsx("i",{className:"ig-dot"}),"v2.0 \u00b7 faster searching"]}),n.jsxs("button",{type:"button",className:"ig-pill",onClick:()=>p(!0),children:[n.jsx(IgIco,{d:IG_ICONS.flame}),"Take the tour"]})]}),n.jsxs("div",{className:"ig-clock",children:[n.jsx("div",{className:"ig-clock-time",children:h}),n.jsx("div",{className:"ig-clock-date",children:m})]})]}),n.jsx("div",{className:"ig-news","aria-label":"What\u2019s new",children:n.jsx("div",{className:"ig-news-track",children:[...IGNITE_NEWS,...IGNITE_NEWS].map((i,k)=>n.jsxs("article",{className:"ig-news-card","aria-hidden":k>=IGNITE_NEWS.length?"true":void 0,children:[n.jsxs("header",{children:[n.jsx("b",{children:i.t}),n.jsx("span",{children:i.k})]}),n.jsx("p",{children:i.d})]},k))})}),n.jsx(IgniteTour,{rootRef:r,open:d,onClose:q})]})}function Fs({open:e,onClose:t,onSubmit:s}){const[i,o]=l.useState(""),c=l.useRef(null);if(l.useEffect(()=>{if(!e)return;o(""),requestAnimationFrame(()=>{var m;return(m=c.current)==null?void 0:m.focus()});const h=m=>{m.key==="Escape"&&t()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,t]),!e)return null;const u=h=>{h.preventDefault();const m=i.trim();m&&(s(m),t())};return n.jsx("div",{className:"_t97drno",onClick:t,children:n.jsxs("div",{className:"modal",onClick:h=>h.stopPropagation(),children:[n.jsx("div",{className:"modal-title",children:"Add bookmark"}),n.jsxs("form",{onSubmit:u,children:[n.jsx("div",{className:"modal-field",children:n.jsx("input",{ref:c,value:i,onChange:h=>o(h.target.value),placeholder:"https://example.com",spellCheck:!1,autoComplete:"off"})}),n.jsxs("div",{className:"modal-actions",children:[n.jsx("button",{type:"button",className:"modal-btn ghost",onClick:t,children:"Cancel"}),n.jsx("button",{type:"submit",className:"modal-btn primary",disabled:!i.trim(),children:"Add"})]})]})]})})}function Os({open:e,onAccept:t,onUpgrade:s}){const i=l.useRef(null);return l.useEffect(()=>{if(!e)return;requestAnimationFrame(()=>{var c;return(c=i.current)==null?void 0:c.focus()});const o=c=>{c.key==="Enter"&&t()};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e,t]),n.jsx(Ue,{children:e&&n.jsx(Te.div,{className:"_t97drno _ndpzvua",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2,ease:"easeOut"},children:n.jsxs(Te.div,{className:"modal _vepqnuc",role:"dialog","aria-labelledby":"ads-notice-title",initial:{opacity:0,y:12,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:8,scale:.97},transition:{duration:.28,ease:[.16,1,.3,1]},children:[n.jsx("div",{className:"modal-title",id:"ads-notice-title",children:"A quick note about ads"}),n.jsx("p",{className:"ads-notice-body",children:"Ads help keep IGNITE OS free to run. You may see a few while using the site."}),n.jsx("p",{className:"ads-notice-body",children:"Ignore any ad that asks you to download something, install an extension, or enable notifications — those are not from us."}),n.jsxs("p",{className:"ads-notice-plus",children:["Prefer no ads?"," ",n.jsx("button",{type:"button",className:"ads-notice-plus-link",onClick:s,children:"Upgrade to Plus"})]}),n.jsx("div",{className:"modal-actions",children:n.jsx("button",{ref:i,type:"button",className:"modal-btn primary",onClick:t,children:"Okay"})})]})})})}function Us({open:e,onClose:t,onUpgrade:s}){return l.useEffect(()=>{if(!e)return;const i=window.setTimeout(t,6e3);return()=>window.clearTimeout(i)},[e,t]),n.jsx(Ue,{children:e&&n.jsxs(Te.aside,{className:"plus-perks-toast",role:"status","aria-live":"polite",initial:{opacity:0,y:16,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.98},transition:{duration:.28,ease:[.16,1,.3,1]},children:[n.jsx("button",{type:"button",className:"plus-perks-toast-x",onClick:t,"aria-label":"Dismiss",children:n.jsx(gn,{size:14})}),n.jsx("div",{className:"plus-perks-toast-title",children:"IGNITE OS Plus"}),n.jsx("p",{className:"plus-perks-toast-body",children:"Go ad-free, unlock 3M tokens/day, and get exclusive links."}),n.jsx("button",{type:"button",className:"plus-perks-toast-cta",onClick:s,children:"Learn more"})]})})}function $s({open:e,onClose:t,onSubmit:s}){const[i,o]=l.useState(""),[c,u]=l.useState(0),h=l.useRef(null),m=Cn(e?i:"");l.useEffect(()=>{e&&(o(""),u(0),requestAnimationFrame(()=>{var g;return(g=h.current)==null?void 0:g.focus()}))},[e]),l.useEffect(()=>{u(0)},[m]);const b=g=>{const y=g.trim();y&&(s(y),t())},f=g=>{g.key==="Enter"?(g.preventDefault(),b(m[c]??i)):g.key==="ArrowDown"?(g.preventDefault(),u(y=>Math.min(m.length-1,y+1))):g.key==="ArrowUp"&&(g.preventDefault(),u(y=>Math.max(0,y-1)))};return n.jsx(Ue,{children:e&&n.jsx(Te.div,{className:"spotlight-backdrop",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16,ease:"easeOut"},children:n.jsxs(Te.div,{className:"spotlight",onClick:g=>g.stopPropagation(),initial:{opacity:0,y:-10,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.97},transition:{duration:.2,ease:[.16,1,.3,1]},children:[n.jsxs("div",{className:"spotlight-input",children:[n.jsx(Me,{size:18}),n.jsx("input",{ref:h,value:i,placeholder:"Search or enter URL",spellCheck:!1,autoComplete:"off",onChange:g=>o(g.target.value),onKeyDown:f})]}),m.length>0&&n.jsx("ul",{className:"spotlight-list",children:m.map((g,y)=>n.jsxs("li",{className:`spotlight-item ${y===c?"selected":""}`,onMouseEnter:()=>u(y),onMouseDown:P=>P.preventDefault(),onClick:()=>b(g),children:[n.jsx(Me,{size:14}),n.jsx("span",{children:g})]},`${g}-${y}`))})]})})})}function Tn(){return n.jsxs("p",{className:"plus-blocked-note",children:["Checkout opens a secure Stripe page, which may be blocked on your network. If it doesn't load, join"," ",n.jsx("a",{href:"https://discord.gg/chromebook",target:"_blank",rel:"noreferrer",children:"discord.gg/chromebook"})," ","to purchase there."]})}function Bs({open:e,onClose:t,account:s,heading:i,blurb:o,onSignUp:c}){if(!e)return null;const u=s.status==="signed-in",h=()=>{var f;u?s.checkout(((f=s.user)==null?void 0:f.email)??void 0):c==null||c()},m=i??"IGNITE OS Plus",b=o??"Unlock 3M tokens/day, exclusive links, and an ad-free experience.";return n.jsx("div",{className:"_t97drno upgrade-backdrop",onClick:t,children:n.jsxs("div",{className:"modal",onClick:f=>f.stopPropagation(),children:[n.jsx("div",{className:"modal-title",children:m}),n.jsx("p",{style:{margin:"0 0 0.9rem",fontSize:13,color:"var(--muted)"},children:b}),u&&n.jsx(Tn,{}),n.jsxs("div",{className:"modal-actions",children:[n.jsx("button",{type:"button",className:"modal-btn ghost",onClick:t,children:"Not now"}),n.jsx("button",{type:"button",className:"modal-btn primary",onClick:h,children:u?"Upgrade to Plus":"Sign up to upgrade"})]})]})})}function He(){return{id:`tab-${Date.now().toString(36)}-${Math.floor(Math.random()*1e6).toString(36)}`,title:"New Tab",url:""}}function qs(e){const t=e;return!!t&&typeof t.id=="string"&&typeof t.title=="string"&&typeof t.url=="string"}function zs(){const e=tt("tabs",{}),t=Array.isArray(e.tabs)?e.tabs.filter(qs):[];if(t.length>0){const s=t.some(i=>i.id===e.activeId)?e.activeId:t[0].id;return{tabs:t,activeId:s}}return Pn()}function Pn(){const e=He();return{tabs:[e],activeId:e.id}}function Ws(e,t){switch(t.type){case"open":{const s=He();return{tabs:[...e.tabs,s],activeId:s.id}}case"openInternal":{const s=e.tabs.find(o=>o.url===t.url);if(s)return{...e,activeId:s.id};const i={...He(),url:t.url,title:t.title};return{tabs:[...e.tabs,i],activeId:i.id}}case"openUrl":{const s={...He(),url:t.url,title:t.title};return{tabs:[...e.tabs,s],activeId:s.id}}case"close":{const s=e.tabs.findIndex(c=>c.id===t.id);if(s===-1)return e;const i=e.tabs.filter(c=>c.id!==t.id);if(i.length===0)return Pn();let o=e.activeId;return o===t.id&&(o=i[Math.min(s,i.length-1)].id),{tabs:i,activeId:o}}case"activate":return e.activeId===t.id?e:{...e,activeId:t.id};case"patch":return{...e,tabs:e.tabs.map(s=>s.id===t.id?{...s,...t.patch}:s)};case"reorder":return{...e,tabs:t.tabs};default:return e}}function Hs(){const[e,t]=l.useReducer(Ws,void 0,zs);l.useEffect(()=>{nt("tabs",e)},[e]);const s=l.useCallback(()=>t({type:"open"}),[]),i=l.useCallback((f,g)=>t({type:"openInternal",url:f,title:g}),[]),o=l.useCallback((f,g)=>t({type:"openUrl",url:f,title:g}),[]),c=l.useCallback(f=>t({type:"close",id:f}),[]),u=l.useCallback(f=>t({type:"activate",id:f}),[]),h=l.useCallback((f,g)=>t({type:"patch",id:f,patch:g}),[]),m=l.useCallback(f=>t({type:"reorder",tabs:f}),[]),b=l.useMemo(()=>e.tabs.find(f=>f.id===e.activeId)??e.tabs[0],[e.tabs,e.activeId]);return{tabs:e.tabs,activeId:e.activeId,activeTab:b,open:s,openInternal:i,openUrl:o,close:c,activate:u,patch:h,reorder:m}}function Vs(){const[e,t]=l.useState(()=>mn());l.useEffect(()=>{bn(e)},[e]);const s=l.useCallback(u=>{const h=u.trim();if(!h)return;const m=/^https?:\/\//.test(h)?h:`https://${h}`;t(b=>[...b,Jt(m)])},[]),i=l.useCallback(u=>{t(h=>h.filter(m=>m.id!==u))},[]),o=l.useCallback((u,h)=>{u&&t(m=>{const b=m.findIndex(f=>f.url===u);return b>=0?m.filter((f,g)=>g!==b):[...m,Jt(u,h)]})},[]),c=l.useCallback(u=>!!u&&e.some(h=>h.url===u),[e]);return{bookmarks:e,add:s,remove:i,toggleForUrl:o,has:c}}const ft=[{id:"dark",name:"Dark",mode:"dark"},{id:"light",name:"Light",mode:"light"}],Ks="dark";function mt(e){return ft.find(t=>t.id===e)??ft[0]}function Ot(){const e=ge("theme");return e&&ft.some(t=>t.id===e)?e:e&&e.includes("light")?"light":Ks}function Ut(e){const t=mt(e),s=document.documentElement;s.dataset.theme=t.mode,s.style.removeProperty("--wallpaper"),we("theme",t.id)}function Gs(){const[e,t]=l.useState(Ot),s=l.useRef(!1);l.useEffect(()=>{if(!s.current){s.current=!0;return}const c=document.documentElement;c.classList.add("theme-anim"),Ut(e);const u=window.setTimeout(()=>c.classList.remove("theme-anim"),320);return()=>window.clearTimeout(u)},[e]);const i=l.useCallback(c=>t(c),[]),o=l.useCallback(()=>{t(c=>mt(c).mode==="dark"?"light":"dark")},[]);return{id:e,mode:mt(e).mode,set:i,toggle:o}}const Xt=[{id:"none",label:"None",title:"",favicon:""},{id:"google-classroom",label:"Google Classroom",title:"Home - Classroom",favicon:"https://ssl.gstatic.com/classroom/favicon.png"},{id:"google-forms",label:"Google Forms",title:"Untitled form - Google Forms",favicon:"https://ssl.gstatic.com/docs/spreadsheets/forms/forms_icon_2023q4.ico"},{id:"google-drive",label:"Google Drive",title:"My Drive - Google Drive",favicon:"https://ssl.gstatic.com/images/branding/product/1x/drive_2020q4_32dp.png"},{id:"google-docs",label:"Google Docs",title:"Untitled document - Google Docs",favicon:"https://ssl.gstatic.com/docs/documents/images/kix-favicon7.ico"},{id:"kahoot",label:"Kahoot!",title:"Kahoot!",favicon:"https://kahoot.com/favicon.ico"},{id:"quizlet",label:"Quizlet",title:"Quizlet",favicon:"https://quizlet.com/favicon.ico"},{id:"custom",label:"Custom",title:"",favicon:""}],Ln="Ignite OS",Js=Ze("branding/ignite-os-browser-834cc7f9f1eda4fb.png"),Ys="about:blank";let In=!1;function vi(e){In=e}function Xs(){return In}function yi(e){return Xt.find(t=>t.id===e)??Xt[0]}function Qs(){let e=document.querySelector('link[rel~="icon"]');return e||(e=document.createElement("link"),e.rel="icon",document.head.appendChild(e)),e}function Zs(e,t){const s=e.trim(),i=t.trim();document.title=s||Ln,Qs().href=i||Js}function xi(e){const t=e.trim();if(!t)return{valid:!1,error:"URL is required"};const s=/^https?:\/\//i.test(t)?t:`https://${t}`;let i;try{i=new URL(s)}catch{return{valid:!1,error:"Invalid URL format"}}return i.protocol!=="http:"&&i.protocol!=="https:"?{valid:!1,error:"URL must start with http:// or https://"}:{valid:!0,value:i.toString()}}function er(e,t,s,i){const o=e.document;o.open(),o.close();const c=o.documentElement;let u=o.head,h=o.body;u||(u=o.createElement("head"),c.appendChild(u)),h||(h=o.createElement("body"),c.appendChild(h));const m=o.createElement("meta");m.setAttribute("charset","utf-8"),u.appendChild(m);const b=o.createElement("meta");if(b.name="_rxi5qmt",b.content="width=device-width,initial-scale=1",u.appendChild(b),o.title=s.trim()||Ln,i.trim()){const y=o.createElement("link");y.rel="icon",y.href=i.trim(),u.appendChild(y)}const f=o.createElement("style");f.textContent="html,body{margin:0;height:100%;background:#000}iframe{display:block;width:100%;height:100%;border:0}",u.appendChild(f);const g=o.createElement("iframe");g.src=t,g.referrerPolicy="no-referrer",g.allow=_n,g.allowFullscreen=!0,h.appendChild(g)}function tr(e,t,s){let i=window;try{window.top&&window.top!==window.self&&(i=window.top)}catch{}const o=i.open(Ys,"_blank");if(!o)return{ok:!1,error:"Popup blocked — allow popups for this site, then try again."};const c=location.href.startsWith("about:")?Ze():location.href;try{er(o,c,t,s)}catch{return{ok:!1,error:"Couldn't write to the new window."}}return window.setTimeout(()=>{try{i.location.replace(e)}catch{window.location.replace(e)}},40),{ok:!0}}let $t=document.body;function nr(e){$t=e}function sr(){return $t}function rr(){return $t}function Qt(e){return e===" "?"space":e.trim().toLowerCase()}function ir(e){const t=e;return!!t&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)}function or(e){l.useEffect(()=>{Zs(e.coverTitle,e.coverFavicon)},[e.coverTitle,e.coverFavicon]),l.useEffect(()=>{const s=Qt(e.exitKey),i=e.exitUrl;if(!s||!i)return;const o=h=>{if(!(h.repeat||Xs()||ir(h.target))&&Qt(h.key)===s){h.preventDefault();try{if(window.top&&window.top!==window.self){window.top.location.assign(i);return}}catch{}window.location.assign(i)}},c=sr(),u=o;return c.addEventListener("keydown",u,!0),()=>c.removeEventListener("keydown",u,!0)},[e.exitKey,e.exitUrl]),l.useEffect(()=>{if(!e.confirmLeave)return;const s=i=>{i.preventDefault(),i.returnValue=""};return window.addEventListener("beforeunload",s),()=>window.removeEventListener("beforeunload",s)},[e.confirmLeave]);const t=l.useRef(!1);l.useEffect(()=>{if(!e.autoCoverFrame||t.current||window.self!==window.top)return;const s=()=>{t.current||(t.current=!0,i(),tr(e.exitUrl,e.coverTitle,e.coverFavicon))},i=()=>{window.removeEventListener("pointerdown",s),window.removeEventListener("keydown",s)};return window.addEventListener("pointerdown",s),window.addEventListener("keydown",s),i},[e.autoCoverFrame,e.exitUrl,e.coverTitle,e.coverFavicon])}const bt=[{id:"google",name:"Google",template:"https://www.google.com/search?q=%s"},{id:"duckduckgo",name:"DuckDuckGo",template:"https://duckduckgo.com/?q=%s"},{id:"bing",name:"Bing",template:"https://www.bing.com/search?q=%s"},{id:"brave",name:"Brave",template:"https://search.brave.com/search?q=%s"}],pe={searchEngineId:"duckduckgo",coverPreset:"none",coverTitle:"",coverFavicon:"",autoCoverFrame:!1,exitKey:"`",exitUrl:"https://docs.google.com/document/u/0/",confirmLeave:!1,backgroundMode:"full",accent:"#ffffff",adblock:!0};function ar(e){return bt.some(t=>t.id===e)}function cr(e){return e==="full"||e==="reduced"||e==="mesh"||e==="off"}function lr(e){return typeof e=="string"&&/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e)}function Ie(e,t){return typeof e=="string"?e:t}function lt(e,t){return typeof e=="boolean"?e:t}function Bt(){const e=tt("settings",{});return{searchEngineId:ar(e.searchEngineId)?e.searchEngineId:pe.searchEngineId,coverPreset:Ie(e.coverPreset??e.cloakPreset,pe.coverPreset),coverTitle:Ie(e.coverTitle??e.cloakTitle,pe.coverTitle),coverFavicon:Ie(e.coverFavicon??e.cloakFavicon,pe.coverFavicon),autoCoverFrame:lt(e.autoCoverFrame??e.autoAboutBlank,pe.autoCoverFrame),exitKey:Ie(e.exitKey??e.panicKey,pe.exitKey),exitUrl:Ie(e.exitUrl??e.panicUrl,pe.exitUrl),confirmLeave:lt(e.confirmLeave,pe.confirmLeave),backgroundMode:cr(e.backgroundMode)?e.backgroundMode:pe.backgroundMode,accent:lr(e.accent)?e.accent:pe.accent,adblock:lt(e.adblock,pe.adblock)}}function Rn(e){nt("settings",e)}function Zt(e){return(bt.find(t=>t.id===e)??bt[0]).template}function ur(){const[e,t]=l.useState(Bt);l.useEffect(()=>{Rn(e)},[e]);const s=l.useCallback(i=>{t(o=>({...o,...i}))},[]);return{settings:e,update:s}}function dr(e){const t=l.useRef(e);t.current=e,l.useEffect(()=>{const s=i=>{if(!(i.ctrlKey||i.metaKey)||i.altKey)return;const o=i.key.toLowerCase();o==="t"?(i.preventDefault(),t.current.onNewTab()):o==="w"?(i.preventDefault(),t.current.onCloseTab()):o==="k"?(i.preventDefault(),t.current.onSpotlight()):o>="1"&&o<="9"&&(i.preventDefault(),t.current.onJumpToTab(Number(o)))};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[])}function hr(e){const[t,s]=l.useState(null),[i,o]=l.useState(null);return l.useEffect(()=>{let c=!0,u=0;const h=window.requestIdleCallback,m=f=>h?h(f,{timeout:2500}):window.setTimeout(f,200),b=()=>{Ae(async()=>{const{rebootController:f}=await import("./boot-D3vqjHTs-8068ec8f.js");return{rebootController:f}},__vite__mapDeps([0,1,2,3]),import.meta.url).then(({rebootController:f})=>f().then(g=>{an(),c&&s(g)},g=>{c&&(u+=1,u<30?window.setTimeout(b,Math.min(1e3*u,5e3)):o(g instanceof Error?g:new Error(String(g))))}))};return m(b),()=>{c=!1}},[e]),{controller:t,error:i}}let je=null,qe=null,Ve=null,Ke=!1;const en=new WeakSet;function Mn(){if(!je||Ve===null)return;const e=Ve;Ve=null,Ke=!0;try{je.cookieJar.clear(),je.cookieJar.load(e),je.persistCookies().finally(()=>{Ke=!1})}catch{Ke=!1}}function pr(e,t){if(qe=t,!!e){if(je=e,!en.has(e)){const s=e.persistCookies.bind(e);e.persistCookies=(async()=>{await s(),Ke||qe==null||qe()}),en.add(e)}Mn()}}function fr(){if(!je)return null;try{return je.cookieJar.dump()}catch{return null}}function mr(e){Ve=e,Mn()}const br="https://www.google.com/search?q=%s";function gr(e){return/\s/.test(e)?!1:/^https?:\/\//.test(e)||e.startsWith("localhost")?!0:/^[^\s.]+\.[^\s.]{2,}/.test(e)}function tn(e,t=br){const s=e.trim();return s?/^https?:\/\//.test(s)?s:gr(s)?`https://${s}`:t.replace("%s",encodeURIComponent(s)):""}class gt extends Error{constructor(s,i,o=null){super(i);ke(this,"status");ke(this,"code");this.status=s,this.code=o}}const ce="/api/account";async function wr(e){const t=await e.text();try{const s=JSON.parse(t);return{message:s.error??t,code:s.code??null}}catch{return{message:t||e.statusText,code:null}}}function vr(){async function e(t,s,i){const o={...i==null?void 0:i.headers};let c=i==null?void 0:i.body;(i==null?void 0:i.json)!==void 0&&(o["content-type"]="application/json",c=JSON.stringify(i.json));const u=await fetch(Oe(t+s),{...i,headers:{...o,...ms("account")},body:c,credentials:xn});if(!u.ok){const{message:h,code:m}=await wr(u);throw new gt(u.status,h,m)}if(u.status!==204)return await u.json()}return{me:()=>e(ce,"/me"),login:(t,s,i)=>e(ce,"/auth/login",{method:"POST",json:{email:t,password:s,captcha:i}}).then(o=>(at("account",o),o)),requestSetPassword:(t,s)=>e(ce,"/auth/set-password/request",{method:"POST",json:{email:t,captcha:s}}),setPassword:(t,s,i)=>e(ce,"/auth/set-password",{method:"POST",json:{email:t,code:s,password:i}}).then(o=>(at("account",o),o)),requestReset:(t,s)=>e(ce,"/auth/reset/request",{method:"POST",json:{email:t,captcha:s}}),reset:(t,s,i)=>e(ce,"/auth/reset",{method:"POST",json:{email:t,code:s,password:i}}).then(o=>(at("account",o),o)),logout:()=>(bs("account"),e(ce,"/logout",{method:"POST"})),getSync:()=>e(ce,"/me/sync"),putSync:t=>e(ce,"/me/sync",{method:"PUT",json:{data:t}}),billingStatus:()=>e(ce,"/billing/status"),checkout:(t,s)=>e(ce,"/billing/checkout",{method:"POST",json:{email:t,origin:s}}),billingPortal:t=>e(ce,"/billing/portal",{method:"POST",json:{origin:t}}),verifyCheckout:t=>e(ce,`/billing/verify?session_id=${encodeURIComponent(t)}`),setDiscord:t=>e(ce,"/me/discord",{method:"POST",json:{discordHandle:t}})}}function yr(){const e={bookmarks:mn(),settings:Bt(),themeId:Ot()},t=fr();return t!==null&&(e.proxyCookies=t),e}function xr(e){if(typeof e!="object"||e===null)return;const{bookmarks:t,settings:s,themeId:i,proxyCookies:o}=e;Array.isArray(t)&&bn(t),s&&typeof s=="object"&&Rn({...Bt(),...s}),typeof i=="string"&&Ut(i),typeof o=="string"&&mr(o)}var ze={exports:{}},nn;function kr(){return nn||(nn=1,(function(e,t){(()=>{var q,ee,F,E,R,S,M,z,oe,re,le,p,ue,ie,de,he,me,C,Se,wt,vt,Ge,yt,xt,kt,Dn,jt,Fn,On,Et,Je,Ct,Un,Ye,Be,$n,Xe;const s="vibrate"in navigator&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(typeof window>"u")return;const i=["#f5c2e7","#cba6f7","#f38ba8","#fab387","#f9e2af","#a6e3a1","#94e2d5","#89dceb","#b4befe"],o=(G,_,a)=>{const d=_===0?"9999px":"0",w=_===a-1?"9999px":"0";return`color:#1e1e2e;background:${(v=>{if(v==="cap")return"#89b4fa";let x=0;for(let A=0;A<v.length;A++)x=v.charCodeAt(A)+((x<<5)-x);return i[Math.abs(x)%i.length]})(G)};margin-left:${_?"-6px":0};padding:0 6px;border-radius:${d} ${w} ${w} ${d};font-weight:600`},c={};for(const G of["debug","info","warn","error"])c[G]=(_,...a)=>{if(window.CAP_SILENT||G==="debug"&&!window.CAP_DEBUG)return;const d=_.map(v=>`%c${v}`).join(" "),w=_.map((v,x)=>o(v,x,_.length))};const u=G=>G?["cap",G]:["cap"],h=G=>`${Math.round(performance.now()-G)}ms`,m=(G,_)=>Object.assign(new Error(_),{code:G}),b=(G,_={})=>window!=null&&window.CAP_CUSTOM_FETCH?window.CAP_CUSTOM_FETCH(G,_):fetch(G,_),f=(G,_)=>_?_.aborted?Promise.reject(m("aborted","aborted")):Promise.race([G,new Promise((a,d)=>_.addEventListener("abort",()=>d(m("aborted","aborted")),{once:!0}))]):G,g="initial-state,verifying-label,solved-label,error-label,required-label,troubleshooting-label,group-aria-label,verify-aria-label,verifying-aria-label,verified-aria-label,error-aria-label".split(","),y={"zh-cn":"确认你是真人/正在验证.../你是真人/出错了。请重试。/请确认你是真人/故障排除/Cap 验证/点击以确认你是真人/正在验证你是真人,请稍候/我们已确认你是真人,你可以继续了/发生错误,请重试",es:"Verifica que eres humano/Verificando.../Eres humano/Error. Inténtalo de nuevo./Verifica que eres humano/Solucionar problemas/Verificación de Cap/Haz clic para verificar que eres humano/Verificando que eres humano, espera/Hemos verificado que eres humano, ya puedes continuar/Se produjo un error, inténtalo de nuevo",hi:"पुष्टि करें कि आप मानव हैं/सत्यापित हो रहा है.../आप मानव हैं/त्रुटि। पुनः प्रयास करें।/कृपया पुष्टि करें कि आप मानव हैं/समस्या निवारण/Cap सत्यापन/पुष्टि करने के लिए क्लिक करें कि आप मानव हैं/सत्यापित किया जा रहा है कि आप मानव हैं, प्रतीक्षा करें/हमने पुष्टि कर दी है कि आप मानव हैं, अब आप जारी रख सकते हैं/एक त्रुटि हुई, पुनः प्रयास करें",ar:"تحقق من أنك إنسان/جارٍ التحقق.../أنت إنسان/خطأ. حاول مرة أخرى./يرجى التحقق من أنك إنسان/استكشاف الأخطاء وإصلاحها/تحقق Cap/انقر للتحقق من أنك إنسان/جارٍ التحقق من أنك إنسان، يرجى الانتظار/لقد تحققنا من أنك إنسان، يمكنك المتابعة الآن/حدث خطأ، يرجى المحاولة مرة أخرى",pt:"Sou humano/Verificando.../Você é humano/Erro. Tente novamente./Verifique que você é humano/Solução de problemas/Verificação Cap/Clique para verificar que você é humano/Verificando que você é humano, aguarde/Verificamos que você é humano, você pode continuar/Ocorreu um erro, tente novamente",ru:"Я человек/Проверка.../Вы человек/Ошибка. Повторите./Подтвердите, что вы человек/Устранение неполадок/Проверка Cap/Нажмите, чтобы подтвердить, что вы человек/Проверяем, что вы человек, подождите/Мы подтвердили, что вы человек, можете продолжить/Произошла ошибка, повторите попытку",ja:"私は人間です/確認中.../あなたは人間です/エラー。再試行を。/あなたが人間であることを確認してください/トラブルシューティング/Cap 認証/クリックして人間であることを確認/あなたが人間であることを確認しています。お待ちください/あなたが人間であることを確認しました。続行できます/エラーが発生しました。もう一度お試しください",de:"Ich bin ein Mensch/Wird überprüft.../Sie sind ein Mensch/Fehler. Erneut versuchen./Bitte bestätigen Sie, dass Sie ein Mensch sind/Fehlerbehebung/Cap-Verifizierung/Klicken, um zu bestätigen, dass Sie ein Mensch sind/Überprüfung, ob Sie ein Mensch sind, bitte warten/Wir haben bestätigt, dass Sie ein Mensch sind, Sie können fortfahren/Ein Fehler ist aufgetreten, bitte erneut versuchen",fr:"Je suis humain/Vérification.../Vous êtes humain/Erreur. Réessayez./Veuillez vérifier que vous êtes humain/Dépannage/Vérification Cap/Cliquez pour vérifier que vous êtes humain/Vérification que vous êtes humain, veuillez patienter/Nous avons vérifié que vous êtes humain, vous pouvez continuer/Une erreur s'est produite, veuillez réessayer"};function P(G,_){let a=(function(v){let x=2166136261;for(let A=0;A<v.length;A++)x^=v.charCodeAt(A),x+=(x<<1)+(x<<4)+(x<<7)+(x<<8)+(x<<24);return x>>>0})(G),d="";function w(){return a^=a<<13,a^=a>>>17,a^=a<<5,a>>>0}for(;d.length<_;)d+=w().toString(16).padStart(8,"0");return d.substring(0,_)}let k=null;async function j(G){const _=(d=>{const w=atob(d),v=new Uint8Array(w.length);for(let x=0;x<w.length;x++)v[x]=w.charCodeAt(x);return v})(G),a=new TextDecoder().decode(await(async function(d){if(typeof DecompressionStream<"u")try{const w=new DecompressionStream("deflate-raw"),v=w.writable.getWriter(),x=w.readable.getReader();v.write(d).then(()=>v.close()).catch(()=>{});const A=[];for(;;){const{done:X,value:te}=await x.read();if(X)break;A.push(te)}let N=0;for(const X of A)N+=X.length;const O=new Uint8Array(N);let L=0;for(const X of A)O.set(X,L),L+=X.length;return O}catch{}return k||(k=new Promise((w,v)=>{const x=window.CAP_PAKO_URL||"https://cdn.jsdelivr.net/npm/pako@2.1.0/dist/pako_inflate.min.js";c.debug(u("instr"),"DecompressionStream unavailable, loading pako from",x);const A=document.createElement("script");A.src=x;const N=window.CAP_SCRIPT_NONCE||window.CAP_CSS_NONCE;N&&A.setAttribute("nonce",N),A.onload=()=>{var O;(O=window.pako)!=null&&O.inflateRaw?w(window.pako):v(new Error("pako loaded but inflateRaw is missing"))},A.onerror=()=>{k=null,v(new Error(`failed to load pako fallback from ${x}`))},document.head.appendChild(A)})),(await k).inflateRaw(d)})(_));return new Promise(d=>{var w=setTimeout(()=>{A(),d({__timeout:!0})},2e4),v=document.createElement("iframe");v.setAttribute("sandbox","allow-scripts"),v.setAttribute("aria-hidden","true"),v.style.cssText="position:absolute;width:1px;height:1px;top:-9999px;left:-9999px;border:none;opacity:0;pointer-events:none;";var x=!1;function A(){x||(x=!0,clearTimeout(w),window.removeEventListener("message",N),v.parentNode&&v.parentNode.removeChild(v))}function N(X){if(v.contentWindow&&X.source===v.contentWindow){var te=X.data;te&&typeof te=="object"&&(te.type==="cap:instr"?(A(),te.blocked?d({__blocked:!0,blockReason:te.blockReason||"automated_browser"}):te.result?d(te.result):d({__timeout:!0})):te.type==="cap:error"&&(A(),d({__timeout:!0})))}}window.addEventListener("message",N);const O=window.CAP_SCRIPT_NONCE||window.CAP_CSS_NONCE,L=O?` nonce="${String(O).replace(/"/g,""")}"`:"";v.srcdoc='<!DOCTYPE html><html><head><meta charset="UTF-8"></head><body><script'+L+">"+a+`
|
|
3
|
+
<\/script></body></html>`,document.body.appendChild(v)})}let I=null;const T=()=>{if(I)return I;const G=window.CAP_CUSTOM_WASM_URL||"https://cdn.jsdelivr.net/npm/@cap.js/wasm@0.0.7/browser/cap_wasm_bg.wasm",_=performance.now();return c.debug(u("wasm"),"fetching",G),I=fetch(G).then(a=>{if(!a.ok)throw new Error(`Failed to fetch wasm: ${a.status}`);return a.arrayBuffer()}).then(a=>WebAssembly.compile(a)).then(a=>(c.debug(u("wasm"),`ready in ${h(_)}`),a)).catch(a=>{throw I=null,c.warn(u("wasm"),`load failed (${h(_)}):`,a.message||a),a}),I};typeof WebAssembly=="object"&&typeof WebAssembly.compile=="function"&&T().catch(()=>{});let J=null;function ne(){return J||(J=URL.createObjectURL(new Blob(['(()=>{const e=(e,...t)=>{self.CAP_SILENT||console[e]("[cap worker]",...t)},t=async({salt:t,target:n})=>{let s=0;const r=new TextEncoder,o=4*n.length,a=Math.floor(o/8),l=o%8,i=n.length%2==0?n:`${n}0`,c=i.length/2,f=new Uint8Array(c);for(let e=0;e<c;e++)f[e]=parseInt(i.substring(2*e,2*e+2),16);const g=l>0?255<<8-l&255:0;for(;;)try{for(let e=0;e<5e4;e++){const e=t+s,n=r.encode(e),o=await crypto.subtle.digest("SHA-256",n),i=new Uint8Array(o);let c=!0;for(let e=0;e<a;e++)if(i[e]!==f[e]){c=!1;break}if(c&&l>0&&(i[a]&g)!==(f[a]&g)&&(c=!1),c)return void self.postMessage({nonce:s,found:!0});s++}}catch(t){return e("error","fallback solver crashed:",t.message||t),void self.postMessage({found:!1,error:t.message})}},n=e=>{const t=BigInt("0x"+e.N);let n=BigInt("0x"+e.x);const s=0|e.t,r=Math.max(64,Math.floor(s/50)),o=performance.now();for(let e=0;e<s;e+=r){const o=Math.min(s,e+r);for(let s=e;s<o;s++)n=n*n%t;o<s&&self.postMessage({progress:o/s})}self.postMessage({found:!0,y:n.toString(16),durationMs:(performance.now()-o).toFixed(2)})};if("object"!=typeof WebAssembly||"function"!=typeof WebAssembly?.instantiate)return e("warn","WebAssembly unavailable, using JS fallback solver (significantly slower)"),void(self.onmessage=async({data:e})=>"rsw"===e?.kind?n(e):t({salt:e.salt,target:e.target}));let s=null;self.onmessage=async({data:r})=>{if("rsw"===r?.kind)return n(r);const{salt:o,target:a,wasmModule:l}=r;if(l instanceof WebAssembly.Module&&null===s){const n=(t=>{try{let e,n=0,r=null;const o=()=>(null!==r&&0!==r.byteLength||(r=new Uint8Array(e.memory.buffer)),r),a=new TextEncoder,l=(e,t,s)=>{if(void 0===s){const s=a.encode(e),r=t(s.length,1)>>>0;return o().subarray(r,r+s.length).set(s),n=s.length,r}let r=e.length,l=t(r,1)>>>0;const i=o();let c=0;for(;c<r;c++){const t=e.charCodeAt(c);if(t>127)break;i[l+c]=t}if(c!==r){0!==c&&(e=e.slice(c));const t=c+3*e.length;l=s(l,r,t,1)>>>0,r=t;const n=o().subarray(l+c,l+r),{written:i}=a.encodeInto(e,n);c+=i,l=s(l,r,c,1)>>>0}return n=c,l},i={wbg:{}};i.wbg.__wbindgen_init_externref_table=()=>{const t=e.__wbindgen_export_0,n=t.grow(4);t.set(0,void 0),t.set(n+0,void 0),t.set(n+1,null),t.set(n+2,!0),t.set(n+3,!1)};const c=new WebAssembly.Instance(t,i);return e=c.exports,e.__wbindgen_start&&e.__wbindgen_start(),s=(t,s)=>{const r=l(t,e.__wbindgen_malloc,e.__wbindgen_realloc),o=n,a=l(s,e.__wbindgen_malloc,e.__wbindgen_realloc),i=n;return BigInt.asUintN(64,e.solve_pow(r,o,a,i))},!0}catch(t){return e("error","wasm init failed:",t.message||t),!1}})(l);if(!n)return e("warn","wasm init failed, falling back to JS solver"),t({salt:o,target:a})}if(null===s)return e("warn","no wasm module provided, falling back to JS solver"),t({salt:o,target:a});try{const e=performance.now(),t=s(o,a),n=performance.now();self.postMessage({nonce:Number(t),found:!0,durationMs:(n-e).toFixed(2)})}catch(t){e("error","solve_pow threw:",t.message||t),self.postMessage({found:!1,error:t.message||String(t)})}},self.onerror=e=>{self.postMessage({found:!1,error:e})}})();'],{type:"application/javascript"})),J)}class B{constructor(_){this._size=_,this._workers=[],this._idle=[],this._queue=[],this._wasmModule=null,this._spawnFailures=0}setWasm(_){this._wasmModule=_}_spawn(){const _=ne(),a=new Worker(_);return a._busy=!1,this._workers.push(a),this._idle.push(a),a}_replaceWorker(_){const a=this._workers.indexOf(_);a!==-1&&this._workers.splice(a,1);const d=this._idle.indexOf(_);d!==-1&&this._idle.splice(d,1);try{_.terminate()}catch{}return this._spawnFailures++,c.warn(u("pool"),`worker died, replacing (attempt ${this._spawnFailures}/3)`),this._spawnFailures>3?(c.error(u("pool"),"worker spawn failed repeatedly, giving up"),null):this._spawn()}_ensureSize(_){for(;this._workers.length<_;)this._spawn()}run(_,a){return new Promise((d,w)=>{this._queue.push({salt:_,target:a,resolve:d,reject:w}),this._dispatch()})}runMsg(_,a){return new Promise((d,w)=>{this._queue.push({msg:_,onProgress:a,resolve:d,reject:w}),this._dispatch()})}_dispatch(){for(;this._idle.length>0&&this._queue.length>0;){const _=this._idle.shift(),a=this._queue.shift(),{resolve:d,reject:w}=a,v=a.msg!==void 0;let x=!1;const A=({data:O})=>{if(!x){if(!O||typeof O.progress!="number"||O.found)x=!0,_.removeEventListener("message",A),_.removeEventListener("error",N),this._spawnFailures=0,this._idle.push(_),O.found?d(v?O:O.nonce):w(new Error(O.error||"worker failed")),this._dispatch();else if(a.onProgress)try{a.onProgress(O.progress)}catch{}}},N=O=>{if(x)return;x=!0,_.removeEventListener("message",A),_.removeEventListener("error",N);const L=this._replaceWorker(_);w(O),L&&this._dispatch()};_.addEventListener("message",A),_.addEventListener("error",N),v?_.postMessage(a.msg):this._wasmModule?_.postMessage({salt:a.salt,target:a.target,wasmModule:this._wasmModule},[]):_.postMessage({salt:a.salt,target:a.target})}}terminate(){for(const _ of this._workers)try{_.terminate()}catch{}this._workers=[],this._idle=[],this._queue=[]}}class $ extends HTMLElement{constructor(){super();se(this,C);se(this,q,null);se(this,ee,navigator.hardwareConcurrency||8);ke(this,"token",null);se(this,F);se(this,E);se(this,R);se(this,S);se(this,M);se(this,z);se(this,oe,!1);se(this,re);se(this,le);se(this,p,null);se(this,ue,null);se(this,ie,null);se(this,de,null);se(this,he,null);se(this,me,null);se(this,Be,()=>{if(r(this,E)){try{this.scrollIntoView({behavior:"smooth",block:"center"})}catch{this.scrollIntoView()}r(this,E).classList.remove("invalid"),r(this,E).offsetWidth,r(this,E).classList.add("invalid"),setTimeout(()=>{var a;return(a=r(this,E))==null?void 0:a.classList.remove("invalid")},1500)}});r(this,re)&&r(this,re).forEach((a,d)=>{this.removeEventListener(d.slice(2),a)}),W(this,re,new Map),this.boundHandleProgress=this.handleProgress.bind(this),this.boundHandleSolve=this.handleSolve.bind(this),this.boundHandleError=this.handleError.bind(this),this.boundHandleReset=this.handleReset.bind(this);try{W(this,le,this.attachInternals())}catch{}}getI18nText(a,d){var w;return this.getAttribute(`data-cap-i18n-${a}`)||((w=r(this,he))==null?void 0:w[a])||d}static get observedAttributes(){return["onsolve","onprogress","onreset","onerror","data-cap-worker-count","data-cap-i18n-initial-state","required"]}initialize(){ne(),W(this,me,new AbortController),r(this,p)||W(this,p,H(this,C,wt).call(this)),r(this,ie)||(W(this,ie,new B(1)),r(this,ie)._spawn())}attributeChangedCallback(a,d,w){var v;if(a.startsWith("on")){const x=a.slice(2),A=r(this,re).get(a);if(A&&this.removeEventListener(x,A),w){const N=O=>{const L=this.getAttribute(a);typeof window[L]=="function"&&window[L].call(this,O)};r(this,re).set(a,N),this.addEventListener(x,N)}}a==="data-cap-worker-count"&&this.setWorkersCount(parseInt(w,10)),a==="data-cap-i18n-initial-state"&&r(this,E)&&((v=r(this,E))!=null&&v.querySelector(".label.active"))&&this.animateLabel(this.getI18nText("initial-state","Verify you're human")),a==="required"&&H(this,C,Ye).call(this)}async connectedCallback(){W(this,z,this),this.shadowRoot?W(this,F,this.shadowRoot):W(this,F,this.attachShadow({mode:"open"})),r(this,E)||W(this,E,document.createElement("div")),H(this,C,Un).call(this),this.createUI(),this.addEventListeners(),this.initialize(),r(this,R).removeAttribute("disabled");const a=this.getAttribute("data-cap-worker-count"),d=a?parseInt(a,10):null;this.setWorkersCount(d||navigator.hardwareConcurrency||8),r(this,z).innerHTML=`<input type="hidden" name="${r(this,C,Et)}">`,c.debug(u(),`widget ready (workers=${r(this,ee)}, haptics=${r(this,C,Se)})`),H(this,C,yt).call(this),H(this,C,Ye).call(this),this.addEventListener("invalid",r(this,Be))}async solve(){var w,v;if(r(this,oe))return;H(this,C,Xe).call(this);const a=performance.now(),d=(w=r(this,me))==null?void 0:w.signal;c.debug(u("solve"),"starting");try{W(this,oe,!0),this.updateUI("verifying",this.getI18nText("verifying-label","Verifying..."),!0),r(this,R).setAttribute("aria-label",this.getI18nText("verifying-aria-label","Verifying you're a human, please wait")),this.dispatchEvent("progress",{progress:0});try{let x,A,N=this.getAttribute("data-cap-api-endpoint");if(!N&&(window!=null&&window.CAP_CUSTOM_FETCH))N="/";else if(!N)throw m("missing_endpoint","Missing API endpoint. Either custom fetch or an API endpoint must be provided.");if(N.endsWith("/")||(N+="/"),r(this,p).state==="done"&&r(this,p).token&&r(this,p).tokenExpires&&Date.now()<r(this,p).tokenExpires)return H(this,C,Ct).call(this);if(r(this,p).state==="done")x=r(this,p).results,A=r(this,p).challengeResp,this.dispatchEvent("progress",{progress:100});else if(r(this,p).state==="solving"||r(this,p).state==="redeeming"||r(this,p).state==="fetching"||r(this,p).state==="waiting"){r(this,p).state==="waiting"&&(r(this,ue)&&(clearTimeout(r(this,ue)),W(this,ue,null)),r(this,p).state="waiting",H(this,C,jt).call(this)),r(this,p).pendingPromotion=r(this,ee),r(this,p).promoteFn&&r(this,p).promoteFn(r(this,ee));const V=setInterval(()=>{if(d!=null&&d.aborted||!r(this,p))return void clearInterval(V);const Q=r(this,p).state;if(Q==="done"||Q==="error")return void clearInterval(V);const xe=r(this,p).challenges?r(this,p).challenges.length:1,Pe=r(this,p).completedCount,Le=Q==="redeeming"?99:Q==="fetching"||Q==="waiting"?0:Math.min(98,Math.round(Pe/xe*100));this.dispatchEvent("progress",{progress:Le})},150);if(await new Promise(Q=>r(this,p).onSettled(Q)),clearInterval(V),(d==null?void 0:d.aborted)||!r(this,p))return;if(r(this,p).state==="idle"&&((v=r(this,p).challengeResp)==null?void 0:v.format)===2&&Array.isArray(r(this,p).challengeResp.challenges))A=r(this,p).challengeResp,r(this,p).challengeResp=null,x=await this.solveChallengesV2(A.challenges,d);else{if(r(this,p).state!=="done")throw m("solve_failed","Unable to solve challenge, self-hosted instance likely down. This is not an issue with Cap.");if(r(this,p).token&&r(this,p).tokenExpires&&Date.now()<r(this,p).tokenExpires)return H(this,C,Ct).call(this);x=r(this,p).results,A=r(this,p).challengeResp,this.dispatchEvent("progress",{progress:100})}}else{const V=r(this,p).challengeResp;if((V==null?void 0:V.format)===2&&Array.isArray(V.challenges))A=V,r(this,p).challengeResp=null;else{const Q=await b(`${N}challenge`,{method:"POST",signal:d});try{A=await Q.json()}catch{throw m("challenge_parse_error","Failed to parse challenge response from server")}if(A.error)throw m("network_error",A.error)}if(A.format===2&&Array.isArray(A.challenges))x=await this.solveChallengesV2(A.challenges,d);else{const{challenge:Q,token:xe}=A;let Pe=Q;if(!Array.isArray(Pe)){let Le=0;Pe=Array.from({length:Q.c},()=>(Le++,[P(`${xe}${Le}`,Q.s),P(`${xe}${Le}d`,Q.d)]))}x=await this.solveChallenges(Pe,d)}}const O=A.instrumentation?j(A.instrumentation):Promise.resolve(null),L=await O;if(d!=null&&d.aborted||!r(this,p))return;if(L!=null&&L.__timeout||L!=null&&L.__blocked){b(`${N}redeem`,{method:"POST",body:JSON.stringify({token:A.token,solutions:x,...L.__blocked&&{instr_blocked:!0},...L.__timeout&&{instr_timeout:!0}}),headers:{"Content-Type":"application/json"},signal:d}).catch(()=>{}),this.updateUIBlocked(this.getI18nText("error-label","Error"),L==null?void 0:L.__blocked),r(this,R).setAttribute("aria-label",this.getI18nText("error-aria-label","An error occurred, please try again"));const V=L!=null&&L.__blocked?"instr_blocked":"instr_timeout",Q=L!=null&&L.__blocked?`Instrumentation blocked (${L.blockReason||"automated_browser"})`:"Instrumentation timed out";this.removeEventListener("error",this.boundHandleError);const xe=new CustomEvent("error",{bubbles:!0,composed:!0,detail:{isCap:!0,code:V,message:Q}});return super.dispatchEvent(xe),this.addEventListener("error",this.boundHandleError),this.executeAttributeCode("onerror",xe),c.error(u("instr"),`[${V}] ${Q}`),void W(this,oe,!1)}const{token:X}=A,te=await b(`${N}redeem`,{method:"POST",body:JSON.stringify({token:X,solutions:x,...L&&{instr:L}}),headers:{"Content-Type":"application/json"},signal:d});let U;try{U=await te.json()}catch{throw m("redeem_failed","Failed to parse server response")}if(d!=null&&d.aborted||!r(this,p))return;if(this.dispatchEvent("progress",{progress:100}),!U.success)throw m("invalid_solution",U.error||"Invalid solution");H(this,C,Je).call(this,U.token),this.dispatchEvent("solve",{token:U.token}),this.token=U.token,H(this,C,vt).call(this),r(this,q)&&clearTimeout(r(this,q));const K=new Date(U.expires).getTime()-Date.now();return K>0&&K<864e5?W(this,q,setTimeout(()=>this.reset(),K)):this.error("Invalid expiration time","invalid_expires"),r(this,R).setAttribute("aria-label",this.getI18nText("verified-aria-label","We have verified you're a human, you may now continue")),r(this,C,Se)&&navigator.vibrate([10,50,20,30,40]),c.debug(u("solve"),`verified in ${h(a)}`),H(this,C,kt).call(this),{success:!0,token:this.token}}catch(x){if(d!=null&&d.aborted||!r(this,p))return;throw r(this,R).setAttribute("aria-label",this.getI18nText("error-aria-label","An error occurred, please try again")),this.error(x.message,x.code||"solve_failed"),x}}finally{W(this,oe,!1)}}async solveChallengesV2(a,d){const w=a.length;let v=0;const x=new Array(a.length);for(let U=0;U<a.length;U++){const K=a[U];if(!K||typeof K!="object"||K.protocol!=="sha256-pow"&&K.protocol!=="rsw"&&K.protocol!=="instrumentation")throw m("challenge_unsupported",`unsupported format-2 protocol '${K==null?void 0:K.protocol}'`)}let A=null;if(typeof WebAssembly=="object"&&typeof WebAssembly.instantiate=="function")try{A=await T()}catch(U){c.warn(u("wasm"),"unavailable, falling back to JS solver:",U.message||U)}const N=Math.max(1,Math.min(r(this,ee),a.length)),O=new B(N);O.setWasm(A),O._ensureSize(N);const L=(U,K)=>Promise.race([U,new Promise((V,Q)=>setTimeout(()=>Q(new Error(`[cap] ${K} timed out after 60000ms`)),6e4))]),X=new Array(a.length).fill(0),te=()=>{const U=X.reduce((V,Q)=>V+Q,0)+v,K=Math.min(99,Math.round(U/w*100));this.dispatchEvent("progress",{progress:K})};try{await f(Promise.all(a.map((U,K)=>U.protocol==="sha256-pow"?L(O.run(U.payload.salt,U.payload.target),`sha256-pow worker #${K}`).then(V=>{x[K]={nonce:Number(V)},X[K]=0,v++,te()}):U.protocol==="rsw"?L(O.runMsg({kind:"rsw",N:U.payload.N,x:U.payload.x,t:0|U.payload.t},V=>{X[K]=V,te()}),`rsw worker #${K}`).then(V=>{x[K]={y:V.y},X[K]=0,v++,te()}):j(U.payload.blob).then(V=>{x[K]=V!=null&&V.__timeout?{timeout:!0}:V!=null&&V.__blocked?{blocked:!0}:{instr:V},X[K]=0,v++,te()}))),d)}finally{O.terminate()}return x}async solveChallenges(a,d){const w=a.length;let v=0,x=null;const A=typeof WebAssembly=="object"&&typeof WebAssembly.instantiate=="function";if(A)try{x=await T()}catch(L){c.warn(u("wasm"),"unavailable, falling back to JS solver:",L.message||L)}if(!A&&(c.warn(u("wasm"),"WebAssembly disabled in this browser, solver will be ~10x slower"),!r(this,F).querySelector(".warning"))){const L=document.createElement("div");L.className="warning",L.style.cssText="width:var(--cap-widget-width,230px);background:rgb(237,56,46);color:white;padding:4px 6px;padding-bottom:calc(var(--cap-border-radius,14px) + 5px);font-size:10px;box-sizing:border-box;font-family:system-ui;border-top-left-radius:8px;border-top-right-radius:8px;text-align:center;user-select:none;margin-bottom:-35.5px;opacity:0;transition:margin-bottom .3s,opacity .3s;",L.innerText=this.getI18nText("wasm-disabled","Enable WASM for significantly faster solving"),r(this,F).insertBefore(L,r(this,F).firstChild),setTimeout(()=>{L.style.marginBottom="calc(-1 * var(--cap-border-radius, 14px))",L.style.opacity=1},10)}const N=new B(r(this,ee));N.setWasm(x),N._ensureSize(r(this,ee));const O=[];try{for(let L=0;L<a.length;L+=r(this,ee)){const X=a.slice(L,Math.min(L+r(this,ee),a.length)),te=await f(Promise.all(X.map(([U,K])=>N.run(U,K).then(V=>{v++;const Q=Math.min(99,Math.round((0+v)/w*100));return this.dispatchEvent("progress",{progress:Q}),V}))),d);O.push(...te)}}finally{N.terminate()}return O}setWorkersCount(a){const d=parseInt(a,10),w=Math.min(navigator.hardwareConcurrency||8,16);W(this,ee,!Number.isNaN(d)&&d>0&&d<=w?d:navigator.hardwareConcurrency||8)}createUI(){r(this,E).classList.add("captcha"),r(this,E).setAttribute("role","group"),r(this,E).setAttribute("aria-label",this.getI18nText("group-aria-label","Cap verification")),W(this,R,document.createElement("div")),r(this,R).className="captcha-trigger",r(this,R).setAttribute("part","trigger"),r(this,R).setAttribute("role","button"),r(this,R).setAttribute("tabindex","0"),r(this,R).setAttribute("aria-label",this.getI18nText("verify-aria-label","Click to verify you're a human")),r(this,R).setAttribute("aria-live","polite"),r(this,R).setAttribute("disabled","true"),r(this,R).innerHTML=`<div class="checkbox" part="checkbox" aria-hidden="true"><svg class="progress-ring" viewBox="0 0 32 32" aria-hidden="true"><circle class="progress-ring-bg" cx="16" cy="16" r="14"></circle><circle class="progress-ring-circle" cx="16" cy="16" r="14"></circle></svg></div><p part="label" class="label-wrapper"><span class="label active">${this.getI18nText("initial-state","Verify you're human")}</span></p>`,r(this,E).appendChild(r(this,R)),W(this,M,document.createElement("a")),r(this,M).className="cap-troubleshoot-link",r(this,M).setAttribute("part","troubleshoot"),r(this,M).setAttribute("target","_blank"),r(this,M).setAttribute("rel","noopener"),r(this,M).hidden=!0,r(this,E).appendChild(r(this,M)),W(this,S,document.createElement("a")),r(this,S).className="credits",r(this,S).setAttribute("aria-label","Secured by Cap"),r(this,S).setAttribute("href","https://trycap.dev"),r(this,S).setAttribute("target","_blank"),r(this,S).setAttribute("title","Secured by Cap: The self-hosted CAPTCHA for the modern web."),r(this,S).textContent="Cap",r(this,E).appendChild(r(this,S)),r(this,F).innerHTML=`<style${window.CAP_CSS_NONCE?` nonce=${window.CAP_CSS_NONCE}`:""}>:host{display:inline-block}@media (prefers-reduced-motion:reduce){.captcha,.captcha *{transition:none!important;animation:none!important}.label{filter:none!important;opacity:1!important;transition:none!important;transform:none!important}.label:not(.active),.label.exit{display:none!important}}.captcha,.captcha *{box-sizing:border-box}.captcha{width:var(--cap-widget-width,260px);height:var(--cap-widget-height,58px);background-color:var(--cap-background,#fdfdfd);border:1px solid var(--cap-border-color,#dddddd8f);border-radius:var(--cap-border-radius,14px);-webkit-user-select:none;user-select:none;cursor:pointer;-webkit-tap-highlight-color:#fff0;color:var(--cap-color,#212121);font-family:var(--cap-font,system, -apple-system, "BlinkMacSystemFont", ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", "Ubuntu", "arial", sans-serif);transition:filter .2s,transform .2s,height .2s;display:inline-block;position:relative;overflow:hidden}.captcha.has-troubleshoot{height:calc(var(--cap-widget-height,58px) + 26px)}.captcha.has-troubleshoot .captcha-trigger{inset-block-end:26px}.captcha:not([data-state]):active{transform:scale(.97)}.captcha:hover{filter:brightness(98%)}.captcha-trigger{padding:var(--cap-widget-padding,14px);align-items:center;gap:var(--cap-gap,15px);border-radius:inherit;transition:inset .2s;display:flex;position:absolute;inset:0}.captcha-trigger:focus-visible{outline:2px solid var(--cap-focus-ring,#06c);outline-offset:-3px}.checkbox{width:var(--cap-checkbox-size,25px);height:var(--cap-checkbox-size,25px);border:var(--cap-checkbox-border,1px solid #aaaaaad1);border-radius:var(--cap-checkbox-border-radius,6px);background-color:var(--cap-checkbox-background,#fafafa91);margin-top:var(--cap-checkbox-margin,2px);margin-bottom:var(--cap-checkbox-margin,2px);flex-shrink:0;transition:opacity .2s}.captcha p{-webkit-user-select:none;user-select:none;margin:0;font-size:15px;font-weight:500}.label-wrapper{flex:1;align-items:center;min-width:0;height:2em;display:flex;position:relative;overflow:hidden}.label-wrapper:before,.label-wrapper:after{content:"";pointer-events:none;z-index:1;width:100%;height:.6em;position:absolute;inset-inline-start:0}.label-wrapper:before{background:linear-gradient(to bottom, var(--cap-background,#fdfdfd), transparent);top:0}.label-wrapper:after{background:linear-gradient(to top, var(--cap-background,#fdfdfd), transparent);bottom:0}.label{white-space:nowrap;opacity:0;filter:blur(2px);transition:transform .5s cubic-bezier(.25,1,.5,1),opacity .5s,filter .5s;position:absolute;transform:translateY(100%)}.label.active{opacity:1;filter:none;transform:translateY(0)}.label.exit{opacity:0;filter:blur(2px);transform:translateY(-100%)}.checkbox .progress-ring{width:100%;height:100%;display:none;transform:rotate(-90deg)}.checkbox .progress-ring-bg{fill:none;stroke:var(--cap-spinner-background-color,#eee);stroke-width:var(--cap-spinner-thickness,3)}.checkbox .progress-ring-circle{fill:none;stroke:var(--cap-spinner-color,#000);stroke-width:var(--cap-spinner-thickness,3);stroke-linecap:round;stroke-dasharray:87.96;stroke-dashoffset:87.96px;transition:stroke-dashoffset .3s}.captcha[data-state=verifying] .checkbox{background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;display:flex;transform:scale(1.1)}.captcha[data-state=verifying] .checkbox .progress-ring{display:block}.captcha[data-state=done] .checkbox{background-image:var(--cap-checkmark,url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cstyle%3E%40keyframes%20anim%7B0%25%7Bstroke-dashoffset%3A23.21320343017578px%7Dto%7Bstroke-dashoffset%3A0%7D%7D%3C%2Fstyle%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%2300a67d%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20d%3D%22m5%2012%205%205L20%207%22%20style%3D%22stroke-dashoffset%3A0%3Bstroke-dasharray%3A23.21320343017578px%3Banimation%3Aanim%20.5s%20ease%22%2F%3E%3C%2Fsvg%3E));background-size:cover;border:1px solid #0000}.captcha[data-state=done] .checkbox .progress-ring{display:none}.captcha[data-state=error] .checkbox{background-image:var(--cap-error-cross,url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 24 24'%3E%3Cpath fill='%23f55b50' d='M11 15h2v2h-2zm0-8h2v6h-2zm1-5C6.47 2 2 6.5 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2m0 18a8 8 0 0 1-8-8a8 8 0 0 1 8-8a8 8 0 0 1 8 8a8 8 0 0 1-8 8'/%3E%3C%2Fsvg%3E"));background-size:cover;border:1px solid #0000}.captcha[data-state=error] .checkbox .progress-ring{display:none}.captcha.invalid{border-color:var(--cap-invalid-border-color,#f55b50);box-shadow:0 0 0 3px var(--cap-invalid-ring-color,#f55b5033);animation:.5s cubic-bezier(.36,.07,.19,.97) cap-shake}@keyframes cap-shake{10%,90%{transform:translate(-1px)}20%,80%{transform:translate(2px)}30%,50%,70%{transform:translate(-4px)}40%,60%{transform:translate(4px)}}@media (prefers-reduced-motion:reduce){.captcha.invalid{animation:none!important}}.captcha-trigger[disabled]{cursor:not-allowed}.captcha[data-state=verifying] .captcha-trigger{cursor:progress}.captcha[data-state=done] .captcha-trigger{cursor:default}.credits{color:var(--cap-color,#212121);text-underline-offset:.18em;z-index:2;border-radius:4px;justify-content:flex-end;align-items:center;min-width:24px;min-height:24px;padding:4px 6px;text-decoration:underline;text-decoration-thickness:.08em;position:absolute;inset-block-end:4px;inset-inline-end:4px;opacity:.8!important;font-size:12px!important;display:inline-flex!important}.captcha .credits{visibility:visible!important;pointer-events:all!important;display:inline-flex!important}.credits:focus-visible{outline:2px solid var(--cap-focus-ring,#06c);outline-offset:2px;opacity:1!important}.cap-troubleshoot-link{min-width:24px;min-height:24px;color:var(--cap-troubleshoot-color,#0050a0);text-underline-offset:.15em;cursor:pointer;z-index:2;border-radius:4px;align-items:center;padding:4px 6px;font-size:13px;font-weight:500;text-decoration:underline;text-decoration-thickness:.08em;display:inline-flex;position:absolute;inset-block-end:4px;inset-inline-start:14px}.cap-troubleshoot-link[hidden]{display:none}.cap-troubleshoot-link:hover{opacity:.85}.cap-troubleshoot-link:focus-visible{outline:2px solid var(--cap-focus-ring,#06c);outline-offset:2px}@media (forced-colors:active){.captcha,.checkbox{border-color:canvastext}:is(.captcha-trigger:focus-visible,.credits:focus-visible,.cap-troubleshoot-link:focus-visible){outline-color:highlight}.progress-ring-bg{stroke:graytext}.progress-ring-circle{stroke:canvastext}.captcha.invalid{box-shadow:none;border-color:mark}.credits{opacity:1!important}}</style>`,r(this,F).appendChild(r(this,E)),H(this,C,Xe).call(this),setTimeout(()=>H(this,C,Xe).call(this),100)}addEventListeners(){r(this,R)&&(r(this,S).addEventListener("click",a=>{a.preventDefault(),window.open(`https://trycap.dev/?${new URLSearchParams({utm_source:"cap_widget",utm_medium:"referral",utm_campaign:"widget",utm_content:window.CAP_DISABLE_WIDGET_REF?"":location.hostname,ref:window.CAP_DISABLE_WIDGET_REF?"":location.href||"",sub:window.CAP_DISABLE_WIDGET_REF?"":document.referrer||""}).toString()}`,"_blank")}),r(this,R).addEventListener("click",()=>{r(this,R).hasAttribute("disabled")||this.solve()}),r(this,R).addEventListener("mousedown",()=>{!r(this,R).hasAttribute("disabled")&&r(this,C,Se)&&navigator.vibrate(5)}),r(this,R).addEventListener("keydown",a=>{a.target===r(this,R)&&(a.key!=="Enter"&&a.key!==" "||r(this,R).hasAttribute("disabled")||(a.preventDefault(),a.stopPropagation(),this.solve()))}),this.addEventListener("progress",this.boundHandleProgress),this.addEventListener("solve",this.boundHandleSolve),this.addEventListener("error",this.boundHandleError),this.addEventListener("reset",this.boundHandleReset))}animateLabel(a){var x;if(!r(this,R))return;const d=r(this,R).querySelector(".label-wrapper");if(!d)return;if((x=window.matchMedia)!=null&&x.call(window,"(prefers-reduced-motion: reduce)").matches){const A=d.querySelector(".label.active");if(A)A.textContent=a;else{const N=document.createElement("span");N.className="label active",N.textContent=a,d.appendChild(N)}return}const w=d.querySelector(".label.active"),v=document.createElement("span");v.className="label",v.textContent=a,d.appendChild(v),v.offsetWidth,v.classList.add("active"),w&&(w.classList.remove("active"),w.classList.add("exit"),w.addEventListener("transitionend",()=>w.remove(),{once:!0}))}updateUI(a,d,w=!1){r(this,E)&&r(this,R)&&(r(this,E).setAttribute("data-state",a),r(this,E).classList.remove("has-troubleshoot"),this.animateLabel(d),r(this,M)&&(r(this,M).hidden=!0),w?r(this,R).setAttribute("disabled","true"):r(this,R).removeAttribute("disabled"))}updateUIBlocked(a,d=!1){if(r(this,E)&&r(this,R)&&(r(this,E).setAttribute("data-state","error"),r(this,R).removeAttribute("disabled"),this.animateLabel(a),r(this,M)))if(d){const w=this.getAttribute("data-cap-troubleshooting-url")||"https://trycap.dev/guide/troubleshooting/instrumentation.html";r(this,M).setAttribute("href",w),r(this,M).textContent=this.getI18nText("troubleshooting-label","Troubleshoot"),r(this,M).hidden=!1,r(this,E).classList.add("has-troubleshoot")}else r(this,M).hidden=!0,r(this,E).classList.remove("has-troubleshoot")}handleProgress(a){if(!r(this,R))return;const d=r(this,R).querySelector(".progress-ring-circle");if(d){const v=2*Math.PI*14,x=v-a.detail.progress/100*v;d.style.strokeDashoffset=x}const w=r(this,R).querySelector(".label-wrapper");if(w){const v=w.querySelector(".label.active");v&&(v.textContent=`${this.getI18nText("verifying-label","Verifying...")}`)}this.executeAttributeCode("onprogress",a)}handleSolve(a){var d,w,v;this.updateUI("done",this.getI18nText("solved-label","You're a human"),!0),this.executeAttributeCode("onsolve",a),(w=(d=r(this,le))==null?void 0:d.setValidity)==null||w.call(d,{}),(v=r(this,E))==null||v.classList.remove("invalid")}handleError(a){this.updateUI("error",this.getI18nText("error-label","Error. Try again.")),this.executeAttributeCode("onerror",a),r(this,C,Se)&&navigator.vibrate([10,40,10])}handleReset(a){this.updateUI("",this.getI18nText("initial-state","I'm a human")),this.executeAttributeCode("onreset",a),H(this,C,Ye).call(this)}executeAttributeCode(a,d){const w=this.getAttribute(a);w&&(c.warn(u(),"inline `onxxx='…'` handlers are deprecated. use `addEventListener` callbacks instead."),new Function("event",w).call(this,d))}error(a="Unknown error",d="unknown"){c.error(u("solve"),`[${d}] ${a}`),this.dispatchEvent("error",{isCap:!0,code:d,message:a})}dispatchEvent(a,d={}){const w=new CustomEvent(a,{bubbles:!0,composed:!0,detail:d});super.dispatchEvent(w)}reset(){r(this,q)&&(clearTimeout(r(this,q)),W(this,q,null)),this.token=null,this.dispatchEvent("reset"),H(this,C,Je).call(this,"")}get tokenValue(){return this.token}disconnectedCallback(){var a;(a=r(this,me))==null||a.abort(),this.removeEventListener("progress",this.boundHandleProgress),this.removeEventListener("solve",this.boundHandleSolve),this.removeEventListener("error",this.boundHandleError),this.removeEventListener("reset",this.boundHandleReset),r(this,re).forEach((d,w)=>{this.removeEventListener(w.slice(2),d)}),r(this,re).clear(),r(this,F)&&(r(this,F).innerHTML=""),this.reset(),this.cleanup()}cleanup(){r(this,q)&&(clearTimeout(r(this,q)),W(this,q,null)),H(this,C,Ge).call(this),r(this,ue)&&(clearTimeout(r(this,ue)),W(this,ue,null)),r(this,ie)&&(r(this,ie).terminate(),W(this,ie,null)),r(this,p)&&(r(this,p).state="error",r(this,p).notify(),W(this,p,null))}}q=new WeakMap,ee=new WeakMap,F=new WeakMap,E=new WeakMap,R=new WeakMap,S=new WeakMap,M=new WeakMap,z=new WeakMap,oe=new WeakMap,re=new WeakMap,le=new WeakMap,p=new WeakMap,ue=new WeakMap,ie=new WeakMap,de=new WeakMap,he=new WeakMap,me=new WeakMap,C=new WeakSet,Se=function(){return s&&!window.CAP_DISABLE_HAPTICS&&!this.hasAttribute("data-cap-disable-haptics")},wt=function(){return{state:"idle",challengeResp:null,challenges:null,results:[],completedCount:0,solvePromise:null,promoteFn:null,_listeners:[],pendingPromotion:null,token:null,tokenExpires:null,notify(){for(const a of this._listeners)a();this._listeners=[]},onSettled(a){this.state==="done"||this.state==="error"?a():this._listeners.push(a)}}},vt=function(){W(this,p,H(this,C,wt).call(this)),H(this,C,yt).call(this)},Ge=function(){r(this,de)&&(window.removeEventListener("mousemove",r(this,de)),window.removeEventListener("touchstart",r(this,de)),window.removeEventListener("keydown",r(this,de)),W(this,de,null))},yt=function(){H(this,C,Ge).call(this);const a=()=>{H(this,C,Ge).call(this),H(this,C,Dn).call(this)};W(this,de,a),window.addEventListener("mousemove",a,{passive:!0}),window.addEventListener("touchstart",a,{passive:!0}),window.addEventListener("keydown",a,{passive:!0})},xt=function(){return typeof this.checkVisibility=="function"?this.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):!!(this.offsetParent||this.getClientRects().length>0)},kt=function(){H(this,C,xt).call(this)||c.info(u("challenges"),"solved invisible challenge")},Dn=function(){r(this,p).state==="idle"&&H(this,C,xt).call(this)&&(r(this,p).state="waiting",W(this,ue,setTimeout(()=>{H(this,C,jt).call(this)},2500)))},jt=async function(){var d;if(r(this,p).state!=="waiting")return;r(this,p).state="fetching",r(this,p)._t0=performance.now();let a=this.getAttribute("data-cap-api-endpoint");if(!a&&(window!=null&&window.CAP_CUSTOM_FETCH)&&(a="/"),a){a.endsWith("/")||(a+="/");try{const w=await b(`${a}challenge`,{method:"POST",signal:(d=r(this,me))==null?void 0:d.signal});let v;try{v=await w.json()}catch{throw new Error("Failed to parse speculative challenge response")}if(v.error)throw new Error(v.error);if(!r(this,p))return;if(v._apiEndpoint=a,r(this,p).challengeResp=v,v.format===2&&Array.isArray(v.challenges))return r(this,p).state="idle",void r(this,p).notify();const{challenge:x,token:A}=v;let N=x;if(!Array.isArray(N)){let O=0;N=Array.from({length:x.c},()=>(O++,[P(`${A}${O}`,x.s),P(`${A}${O}d`,x.d)]))}r(this,p).challenges=N,r(this,p).state="solving",r(this,p).solvePromise=H(this,C,Fn).call(this,N)}catch{if(!r(this,p))return;r(this,p).state="error",r(this,p).notify()}}else r(this,p).state="idle"},Fn=async function(a){ne();let d=null;try{d=await T()}catch{}r(this,ie)||(W(this,ie,new B(1)),r(this,ie)._spawn()),r(this,ie).setWasm(d);const w=a.length,v=new Array(w);let x=1,A=!1;r(this,p).promoteFn=O=>{A||(A=!0,x=O,r(this,ie)._size=O,r(this,ie)._ensureSize(O))},r(this,p).pendingPromotion!==null&&(r(this,p).promoteFn(r(this,p).pendingPromotion),r(this,p).pendingPromotion=null);let N=0;for(;N<w;){const O=x,L=[],X=[];for(let U=0;U<O&&N<w;U++)X.push(N),L.push(a[N]),N++;r(this,ie)._ensureSize(Math.max(x,O));const te=await Promise.all(L.map(U=>r(this,ie).run(U[0],U[1]).then(K=>(r(this,p)&&r(this,p).completedCount++,K))));for(let U=0;U<X.length;U++)v[X[U]]=te[U];!A&&N<w&&await new Promise(U=>setTimeout(U,120))}return r(this,p)&&(r(this,p).results=v,r(this,p).state="redeeming",H(this,C,On).call(this,v)),v},On=async function(a){var d;try{if(!r(this,p))return;const w=r(this,p).challengeResp,v=w._apiEndpoint;if(!v)throw m("missing_endpoint","speculative redeem: missing apiEndpoint");let x=null;if(w.instrumentation){if(x=await j(w.instrumentation),!r(this,p))return;if(x!=null&&x.__timeout||x!=null&&x.__blocked)return r(this,p).state="done",void r(this,p).notify()}const A=await b(`${v}redeem`,{method:"POST",body:JSON.stringify({token:w.token,solutions:a,...x&&{instr:x}}),headers:{"Content-Type":"application/json"},signal:(d=r(this,me))==null?void 0:d.signal});let N;try{N=await A.json()}catch{throw new Error("Failed to parse speculative redeem response")}if(!r(this,p))return;if(!N.success)throw new Error(N.error||"Speculative redeem failed");r(this,p).token=N.token,r(this,p).tokenExpires=new Date(N.expires).getTime(),r(this,p).state="done",r(this,p)._invisibleElapsed=r(this,p)._t0?h(r(this,p)._t0):"?",r(this,p).notify()}catch{if(!r(this,p))return;r(this,p).state="done",r(this,p).notify()}},Et=function(){return this.getAttribute("data-cap-hidden-field-name")||"cap-token"},Je=function(a){const d=this.querySelector(`input[name='${r(this,C,Et)}']`);d&&(d.value=a)},Ct=function(){c.debug(u("solve"),`served from speculative cache (saved ${r(this,p)._invisibleElapsed||"?"})`),this.dispatchEvent("progress",{progress:100}),H(this,C,Je).call(this,r(this,p).token),this.dispatchEvent("solve",{token:r(this,p).token}),this.token=r(this,p).token;const a=r(this,p).tokenExpires-Date.now();return r(this,q)&&clearTimeout(r(this,q)),W(this,q,setTimeout(()=>this.reset(),a)),r(this,R).setAttribute("aria-label",this.getI18nText("verified-aria-label","We have verified you're a human, you may now continue")),r(this,C,Se)&&navigator.vibrate([10,50,20,30,40]),H(this,C,kt).call(this),H(this,C,vt).call(this),W(this,oe,!1),{success:!0,token:this.token}},Un=function(){W(this,he,(function(a){const d=a?[a]:navigator.languages||[navigator.language||""];for(let w of d){if(!w)continue;if(w=w.toLowerCase(),w==="en"||w.startsWith("en-"))return null;const v=y[w]?w:y[w.split("-")[0]]?w.split("-")[0]:null;if(!v)return null;const x=y[v].split("/"),A={};return g.forEach((N,O)=>{A[N]=x[O]}),A}return null})(window.CAP_LANG||this.getAttribute("data-cap-lang")))},Ye=function(){var a;(a=r(this,le))!=null&&a.setValidity&&(this.hasAttribute("required")&&!this.token?r(this,le).setValidity({valueMissing:!0},this.getI18nText("required-label","Please verify you're human"),r(this,E)||this):r(this,le).setValidity({}))},Be=new WeakMap,$n=function(){if(!r(this,z))return!1;const a=r(this,z).getBoundingClientRect();if(a.width===0&&a.height===0)return!0;const d=window.getComputedStyle(r(this,z));return d.display==="none"||d.visibility==="hidden"},Xe=function(){r(this,S)&&r(this,E)&&!H(this,C,$n).call(this)&&(r(this,S).isConnected&&r(this,S).parentNode===r(this,E)||r(this,E).appendChild(r(this,S)),r(this,S).textContent&&r(this,S).textContent.trim()||(r(this,S).textContent="Cap"),r(this,S).getAttribute("href")!=="https://trycap.dev"&&r(this,S).setAttribute("href","https://trycap.dev"),r(this,S).style.cssText=["display: inline-flex !important","visibility: visible !important","opacity: 0.8 !important","pointer-events: all !important","font-size: 12px !important","transform: none !important","clip-path: none !important","filter: none !important","position: absolute !important"].join("; "))},ke($,"formAssociated",!0);class Y{constructor(_={},a){const d=a||document.createElement("cap-widget");if(Object.entries(_).forEach(([w,v])=>{d.setAttribute(w,v)}),!_.apiEndpoint&&!(window!=null&&window.CAP_CUSTOM_FETCH))throw d.remove(),new Error("Missing API endpoint. Either custom fetch or an API endpoint must be provided.");_.apiEndpoint&&d.setAttribute("data-cap-api-endpoint",_.apiEndpoint),a||d.hasAttribute("data-cap-disable-haptics")||d.setAttribute("data-cap-disable-haptics",""),this.widget=d,this.solve=this.widget.solve.bind(this.widget),this.reset=this.widget.reset.bind(this.widget),this.addEventListener=this.widget.addEventListener.bind(this.widget),Object.defineProperty(this,"token",{get:()=>d.token,configurable:!0,enumerable:!0}),a||(d.style.display="none",document.documentElement.appendChild(d))}}window.Cap=Y,customElements.get("cap-widget")||window!=null&&window.CAP_DONT_SKIP_REDEFINE?customElements.get("cap-widget")&&c.warn(u(),"cap-widget custom element already defined, skipping re-define. set window.CAP_DONT_SKIP_REDEFINE = true to override"):customElements.define("cap-widget",$),e.exports=Y,t.default=Y})()})(ze,ze.exports)),ze.exports}kr();function sn(e=Oe("/api/account/cap/")){return new Promise((t,s)=>{const i=document.createElement("div");i.className="cap-overlay";const o=document.createElement("div");o.className="cap-overlay-panel";const c=document.createElement("div");c.className="cap-overlay-title",c.textContent="Verify you're human";const u=document.createElement("cap-widget");u.setAttribute("data-cap-api-endpoint",e);const h=document.createElement("button");h.type="button",h.className="cap-overlay-cancel",h.textContent="Cancel";let m=!1;const b=()=>{m=!0,i.remove()},f=()=>{m||(b(),s(new Error("captcha-failed")))};u.addEventListener("solve",g=>{var P;const y=(P=g.detail)==null?void 0:P.token;b(),y?t(y):s(new Error("captcha-failed"))}),u.addEventListener("error",f),h.addEventListener("click",f),i.addEventListener("mousedown",g=>{g.target===i&&f()}),o.append(c,u,h),i.append(o),rr().append(i)})}const jr=2e3,Bn=l.createContext(null);function Er(){const[e,t]=l.useState({status:"loading"}),[s,i]=l.useState(null),[o,c]=l.useState(!1),[u,h]=l.useState(!1),[m,b]=l.useState(null),[f,g]=l.useState(!1),y=l.useMemo(()=>vr(),[]),P=l.useRef(null),k=l.useCallback(async()=>{try{const S=await y.billingStatus();b(S),h(S.active)}catch{b(null)}finally{g(!0)}},[y]),j=l.useCallback(async()=>{try{await y.putSync(yr())}catch{}},[y]),I=l.useCallback(async()=>{try{const{data:S}=await y.getSync();S?xr(S):await j()}catch{}},[y,j]),T=l.useCallback(async(S,M)=>{t({status:"signed-in",user:S}),h(M),await I()},[I]);l.useEffect(()=>{let S=!1;return y.me().then(async({user:M,active:z})=>{S||await T(M,z)}).catch(()=>{S||(t({status:"signed-out"}),g(!0))}),()=>{S=!0}},[y,T]),l.useEffect(()=>{if(e.status==="signed-in"){g(!1),k();return}b(null),h(!1)},[e.status,k]),l.useEffect(()=>()=>{P.current&&window.clearTimeout(P.current)},[]);const J=(S,M)=>S instanceof Error&&S.message==="captcha-failed"?"Captcha failed. Please try again.":S instanceof gt?S.message:M,ne=l.useCallback(async(S,M)=>{c(!0),i(null);try{const{user:z,active:oe}=await y.login(S,M,await sn(Oe("/api/account/cap/")));return await T(z,oe),{ok:!0}}catch(z){return z instanceof gt&&z.code==="needs_password"?{ok:!1,needsPassword:!0}:(i(J(z,"Couldn't sign in.")),{ok:!1})}finally{c(!1)}},[y,T]),B=l.useCallback(async(S,M)=>{c(!0),i(null);try{const z=await sn(Oe("/api/account/cap/"));return M==="reset"?await y.requestReset(S,z):await y.requestSetPassword(S,z),!0}catch(z){return i(J(z,"Couldn't send a code.")),!1}finally{c(!1)}},[y]),$=l.useCallback(async(S,M,z,oe)=>{c(!0),i(null);try{const{user:re,active:le}=oe==="reset"?await y.reset(S,M,z):await y.setPassword(S,M,z);return await T(re,le),!0}catch(re){return i(J(re,"Couldn't verify the code.")),!1}finally{c(!1)}},[y,T]),Y=l.useCallback(async()=>{try{await y.logout()}catch{}t({status:"signed-out"})},[y]),q=l.useCallback(()=>{e.status==="signed-in"&&(P.current&&window.clearTimeout(P.current),P.current=window.setTimeout(()=>void j(),jr))},[e.status,j]),ee=l.useCallback(async S=>{try{const{url:M}=await y.checkout(S,Kt());window.location.href=M}catch(M){i(J(M,"Couldn't start checkout."))}},[y]),F=l.useCallback(async()=>{try{const{url:S}=await y.billingPortal(Kt());window.location.href=S}catch(S){i(J(S,"Couldn't open billing."))}},[y]),E=l.useCallback(async S=>{try{const M=await y.verifyCheckout(S);if(M.active){h(!0),await k();try{const{user:z,active:oe}=await y.me();t({status:"signed-in",user:z}),h(oe)}catch{}}return M}catch{return null}},[y,k]),R=l.useCallback(async S=>{c(!0),i(null);try{const{user:M,active:z}=await y.setDiscord(S);return t({status:"signed-in",user:M}),h(z),!0}catch(M){return i(J(M,"Couldn't save Discord.")),!1}finally{c(!1)}},[y]);return{status:e.status,user:e.status==="signed-in"?e.user:null,busy:o,authError:s,clearError:()=>i(null),billing:m,isPlus:u,entitlementReady:f,signIn:ne,sendCode:B,submitCode:$,logout:Y,scheduleSync:q,checkout:ee,manageBilling:F,verifyReturn:E,refreshBilling:k,setDiscord:R}}function Cr({children:e}){const t=Er();return n.jsx(Bn.Provider,{value:t,children:e})}function qn(){const e=l.useContext(Bn);if(!e)throw new Error("useAccount requires AccountProvider");return e}const Ar=2500,Sr=200;function zn(e){const t=window;let s=!1,i=0,o=0,c=0,u=0;const h=()=>{s||e()},m=()=>{if(t.requestIdleCallback){c=t.requestIdleCallback(h,{timeout:Ar});return}u=window.setTimeout(h,Sr)},b=()=>{i=window.requestAnimationFrame(()=>{o=window.requestAnimationFrame(m)})};return document.readyState==="complete"?b():window.addEventListener("load",b,{once:!0}),()=>{s=!0,window.removeEventListener("load",b),window.cancelAnimationFrame(i),window.cancelAnimationFrame(o),c&&t.cancelIdleCallback&&t.cancelIdleCallback(c),window.clearTimeout(u)}}const _r="//rv.curbingspider.com/rS4UwuG85t7WA/147093",Nr="//hj.doebirddrowner.com/sUWrzqOhnYv92MH6/147094",ve=new Map;let Ne=!1,At=!1,St=!1,Ee=null;function Tr(e){return new URLSearchParams(e).has("skip")}function Wn(){St||(St=!0,window.location.reload())}function rn(e,t){if(ve.has(e))return;const s=document.createElement("script");ve.set(e,s),s.dataset.cfasync="false",s.src=t,s.dataset.ext=t,s.async=!0,s.type="text/javascript",s.addEventListener("load",()=>{if(ve.get(e)!==s){Wn();return}if(At=!0,!Ne||!De()){Hn();return}},{once:!0}),s.addEventListener("error",()=>{s.remove(),ve.get(e)===s&&ve.delete(e)},{once:!0}),(document.head??document.documentElement).appendChild(s)}function Hn(){Ee==null||Ee(),Ee=null,Ne=!1;for(const t of ve.values())t.remove();ve.clear();const e=At;At=!1,e&&Wn()}function De(){return window.location.hostname!=="localhost"}function Pr(){const e=window.location.hostname!=="IGNITE OSon.top";!De()||Ee||Ne&&ve.size===(e?2:1)||(Ne||(St=!1),Ne=!0,Ee=zn(()=>{Ee=null,Ne&&(rn("pop",new URL(_r,document.baseURI).href),e&&rn("social",new URL(Nr,document.baseURI).href))}))}function Lr(e){const t=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e)?e:"#ffffff";document.documentElement.style.setProperty("--accent",t)}const Ir=l.lazy(()=>Ae(()=>import("./DarkVeil-CC-BBhGo-8068ec8f.js"),__vite__mapDeps([4,2,5]),import.meta.url));function Rr(e){const[t,s]=l.useState(!1);return l.useEffect(()=>zn(()=>s(!0)),[]),t?n.jsx(l.Suspense,{fallback:null,children:n.jsx(Ir,{...e})}):null}const Mr=l.lazy(()=>Ae(()=>import("./AiPage-CbTtOj3W-8068ec8f.js"),__vite__mapDeps([6,2,7,8,9,3,10]),import.meta.url).then(e=>({default:e.AiPage}))),Dr=l.lazy(()=>Ae(()=>import("./GamesPage-D-HV0rpM-8068ec8f.js"),__vite__mapDeps([11,2,3,12]),import.meta.url).then(e=>({default:e.GamesPage}))),Fr=l.lazy(()=>Ae(()=>import("./SettingsPage-CsV-N8Y0-8068ec8f.js"),__vite__mapDeps([13,2,3,14]),import.meta.url).then(e=>({default:e.SettingsPage}))),Or=l.lazy(()=>Ae(()=>import("./AccountPage-DmlYaBSE-8068ec8f.js"),__vite__mapDeps([15,2,3,14,16]),import.meta.url).then(e=>({default:e.AccountPage}))),Ur=l.lazy(()=>Ae(()=>import("./PlusPage-DBE836ej-8068ec8f.js"),__vite__mapDeps([17,2,3,18,16,14]),import.meta.url).then(e=>({default:e.PlusPage})));function $r(){const{tabs:e,activeId:t,activeTab:s,open:i,openInternal:o,openUrl:c,close:u,activate:h,patch:m,reorder:b}=Hs(),{settings:f,update:g}=ur(),{controller:y}=hr(f.adblock),P=Vs(),k=Gs(),j=qn(),I=(s==null?void 0:s.url)??"",T=be(I),J=l.useRef(!1),[ne]=l.useState(()=>Tr(window.location.search)),[B,$]=l.useState(()=>tt("_gs5mofn.collapsed",!1)),Y=l.useRef(!1),[q,ee]=l.useState(!1),[F,E]=l.useState(!1),[R,S]=l.useState(()=>De()&&!ne&&ge("ads.notice")!=="seen"),[M,z]=l.useState(null),[oe,re]=l.useState(!1),le=l.useRef(!1),p=l.useRef(null);l.useEffect(()=>{!ne||!De()||we("ads.notice","seen")},[ne]),l.useEffect(()=>{j.isPlus&&(S(!1),z(null),re(!1))},[j.isPlus]),l.useEffect(()=>{j.status==="loading"||j.isPlus||R||M||le.current||(le.current=!0,re(!0))},[j.status,j.isPlus,R,M]),l.useEffect(()=>{if(!(j.status==="loading"||!j.entitlementReady)){if(j.isPlus||!De()){Hn(),J.current=!1;return}J.current||R||ge("ads.notice")==="seen"&&(J.current=!0,Pr())}},[j.status,j.entitlementReady,j.isPlus,R,T]),l.useEffect(()=>{pr(y,j.scheduleSync)},[y,j.scheduleSync]),l.useEffect(()=>{j.scheduleSync()},[P.bookmarks,f,k.id,j.scheduleSync]),l.useEffect(()=>Lr(f.accent),[f.accent]),or(f);const ue=l.useCallback(()=>{we("ads.notice","seen"),S(!1)},[]),ie=l.useCallback((D,ae)=>m(D,{url:ae}),[m]),de=l.useCallback((D,ae)=>m(D,{title:ae}),[m]),he=l.useCallback((D,ae)=>{var Wt;const $e=tn(ae,Zt(f.searchEngineId));$e&&(m(D,{url:$e,title:$e}),(Wt=p.current)==null||Wt.goTo(D,$e))},[m,f.searchEngineId]),me=()=>{ye("tabs"),ye("bookmarks"),ye("settings"),location.reload()},C=l.useCallback(D=>o(xs(D),ys[D]),[o]),st=!1,rt=!I,it=!!I&&!T,qt=rt?"":I;l.useEffect(()=>{},[C]),l.useEffect(()=>{},[T]);const zt=l.useRef(T);l.useEffect(()=>{!Y.current&&T==="ai"&&zt.current!==T&&$(!0),zt.current=T},[T]);const Vn=l.useCallback(()=>{Y.current=!0,$(D=>{const ae=!D;return nt("_gs5mofn.collapsed",ae),ae})},[]);return dr({onNewTab:i,onCloseTab:()=>u(t),onSpotlight:()=>E(D=>!D),onJumpToTab:D=>{const ae=D===9?e[e.length-1]:e[D-1];ae&&h(ae.id)}}),n.jsxs("div",{className:`_9gmixa5 ${it?"_z51tprw":""}`,children:[n.jsx("div",{className:f.backgroundMode==="mesh"?"_v4jfozk mesh":"_v4jfozk","aria-hidden":!0,children:!1&&n.jsx(Rr,{hueShift:IGNITE_HUE,speed:f.backgroundMode==="reduced"?1.2:2.1,warpAmount:1.1,scanlineFrequency:.5,resolutionScale:f.backgroundMode==="reduced"?.45:1})}),n.jsx("div",{className:"_rx2al0e","aria-hidden":!0}),n.jsx(ks,{tabs:e,activeId:t,activeUrl:qt,bookmarks:P.bookmarks,disabled:st,collapsed:B,onSelect:h,onNew:i,onClose:u,onReorder:b,onNavigate:D=>he(t,D),onOpenBookmark:D=>he(t,D),onAddBookmark:()=>ee(!0),onRemoveBookmark:P.remove,bookmarked:P.has(I),onToggleBookmark:()=>P.toggleForUrl(I,s==null?void 0:s.title),onToggleCollapse:Vn,onOpenAi:()=>C("ai"),onOpenGames:()=>C("games"),onOpenSettings:()=>C("settings"),onOpenAccount:()=>C("account"),onBack:()=>{var D;return(D=p.current)==null?void 0:D.back()},onForward:()=>{var D;return(D=p.current)==null?void 0:D.forward()},onReload:()=>{var D;return(D=p.current)==null?void 0:D.reload()}}),n.jsxs("main",{className:"content",children:[(it||T)&&n.jsx(Cs,{url:qt,disabled:st,collapsed:B,internal:!!T,bookmarked:P.has(I),onNavigate:D=>he(t,D),onBack:()=>{var D;return(D=p.current)==null?void 0:D.back()},onForward:()=>{var D;return(D=p.current)==null?void 0:D.forward()},onReload:()=>{var D;return(D=p.current)==null?void 0:D.reload()},onToggleBookmark:()=>P.toggleForUrl(I,s==null?void 0:s.title)}),n.jsxs("div",{className:"_vcmyz3z",children:[n.jsx(Ms,{ref:p,controller:y,tabs:e,activeId:t,onUrl:ie,onTitle:de}),rt&&n.jsx(Ds,{disabled:st,onNavigate:D=>he(t,D),onOpenPage:D=>C(D)}),n.jsxs(l.Suspense,{fallback:null,children:[T==="ai"&&n.jsx(Mr,{account:j,onOpenAccount:()=>C("account")}),T==="games"&&n.jsx(Dr,{controller:y,onOpenUrl:D=>{const ae=tn(D,Zt(f.searchEngineId));ae&&c(ae,ae)}}),T==="settings"&&n.jsx(Fr,{settings:f,onUpdate:g,onClearData:me,showPlusCta:!j.isPlus&&j.status!=="loading",onUpgradePlus:()=>z("settings")}),T==="account"&&n.jsx(Or,{account:j}),T==="plus"&&n.jsx(Ur,{account:j,onOpenAccount:()=>C("account")})]})]})]}),n.jsx(IgniteUpdate,{}),n.jsx(Fs,{open:q,onClose:()=>ee(!1),onSubmit:P.add}),n.jsx(Os,{open:R&&!M,onAccept:ue,onUpgrade:()=>z("ads")}),n.jsx(Us,{open:oe&&!R&&!M&&!j.isPlus,onClose:()=>re(!1),onUpgrade:()=>{re(!1),z("settings")}}),n.jsx(Bs,{open:M!==null,onClose:()=>z(null),account:j,heading:M==="ads"?"Go ad-free with IGNITE OS Plus":"IGNITE OS Plus",blurb:M==="ads"?"IGNITE OS Plus removes ads entirely, plus 3M tokens/day and exclusive links.":"Remove ads, unlock 3M tokens/day, and get exclusive links.",onSignUp:()=>{z(null),C("account")}}),n.jsx($s,{open:F,onClose:()=>E(!1),onSubmit:D=>he(t,D)}),rt&&n.jsx(As,{})]})}const Br={login:"Welcome back",setup:"Activate your account",reset:"Reset password"};function qr({account:e,brand:t,loginTagline:s,onSubscribe:i,claim:o}){const[c,u]=l.useState("login"),[h,m]=l.useState("form"),[b,f]=l.useState((o==null?void 0:o.email)??""),[g,y]=l.useState(""),[P,k]=l.useState(""),[j,I]=l.useState(null),[T,J]=l.useState(0);l.useEffect(()=>{o&&(f(o.email),o.needsPassword?(u("setup"),m("code"),I("Payment confirmed — enter the code we emailed to set your password."),e.sendCode(o.email,"set-password"),J(30)):(u("login"),I("Payment confirmed — sign in to continue.")))},[o]),l.useEffect(()=>{if(T<=0)return;const E=window.setTimeout(()=>J(R=>R-1),1e3);return()=>window.clearTimeout(E)},[T]);const ne=E=>{e.clearError(),u(E),m("form"),y(""),k(""),I(null),J(0)},B=e.busy,$=async()=>{(await e.signIn(b,g)).needsPassword&&(u("setup"),m("form"),I("Finish activating your account by setting a password."))},Y=async()=>{const E=c==="reset"?"reset":"set-password";await e.sendCode(b,E)&&(m("code"),I(null),J(30))},q=()=>e.submitCode(b,P,g,c==="reset"?"reset":"set-password"),ee=async()=>{await e.sendCode(b,c==="reset"?"reset":"set-password")&&(I("New code sent. If you don't receive anything, check your spam — if you used a school email, our mail might not deliver."),J(30))},F=h==="code"?"Enter the 6-digit code we emailed you. If you don't receive anything, check your spam — if you used a school email, our mail might not deliver.":c==="login"?s??"Sign in to continue.":c==="setup"?"Enter your email and choose a password to get started.":"Enter your email and a new password — we'll email you a code to confirm.";return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"_xdv7bcm",children:[t,n.jsx("h1",{children:Br[c]}),n.jsx("p",{className:"account-auth-auth-sub",children:F})]}),n.jsxs("div",{className:"account-auth-auth-form",children:[j&&n.jsx("div",{className:"account-auth-auth-ok",children:j}),e.authError&&n.jsx("div",{className:"account-auth-error",children:e.authError}),c==="login"&&n.jsxs(n.Fragment,{children:[n.jsxs("label",{children:[n.jsx("span",{children:"Email"}),n.jsx("input",{type:"email",placeholder:"you@example.com",value:b,onChange:E=>f(E.target.value),autoComplete:"email",disabled:B})]}),n.jsxs("label",{children:[n.jsx("span",{children:"Password"}),n.jsx("input",{type:"password",value:g,onChange:E=>y(E.target.value),autoComplete:"current-password",disabled:B,onKeyDown:E=>E.key==="Enter"&&void $()})]}),n.jsx("button",{type:"button",className:"account-auth-btn primary account-auth-auth-primary",disabled:B||!b.trim()||g.length<8,onClick:()=>void $(),children:B?"Please wait…":"Sign in"}),n.jsxs("div",{className:"account-auth-auth-alt",children:[n.jsx("button",{type:"button",className:"account-auth-auth-link",disabled:B,onClick:()=>ne("reset"),children:"Forgot password?"}),n.jsx("span",{className:"account-auth-auth-dot",children:"·"}),n.jsx("button",{type:"button",className:"account-auth-auth-link",disabled:B,onClick:()=>ne("setup"),children:"First time? Activate"})]}),i&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"account-auth-btn account-auth-auth-primary",disabled:B,onClick:()=>i(b),children:"Subscribe to IGNITE OS Plus"}),n.jsx(Tn,{})]})]}),c!=="login"&&h==="form"&&n.jsxs(n.Fragment,{children:[n.jsxs("label",{children:[n.jsx("span",{children:"Email"}),n.jsx("input",{type:"email",placeholder:"you@example.com",value:b,onChange:E=>f(E.target.value),autoComplete:"email",disabled:B})]}),c==="reset"&&n.jsxs("label",{children:[n.jsx("span",{children:"New password"}),n.jsx("input",{type:"password",value:g,onChange:E=>y(E.target.value),autoComplete:"new-password",disabled:B})]}),c==="setup"&&n.jsxs("label",{children:[n.jsx("span",{children:"Choose a password"}),n.jsx("input",{type:"password",value:g,onChange:E=>y(E.target.value),autoComplete:"new-password",disabled:B})]}),n.jsx("button",{type:"button",className:"account-auth-btn primary account-auth-auth-primary",disabled:B||!b.trim()||g.length<8,onClick:()=>void Y(),children:B?"Please wait…":"Send code"}),n.jsx("div",{className:"account-auth-auth-alt",children:n.jsx("button",{type:"button",className:"account-auth-auth-link",disabled:B,onClick:()=>ne("login"),children:"Back to sign in"})})]}),c!=="login"&&h==="code"&&n.jsxs(n.Fragment,{children:[g.length===0&&n.jsxs("label",{children:[n.jsx("span",{children:c==="reset"?"New password":"Choose a password"}),n.jsx("input",{type:"password",value:g,onChange:E=>y(E.target.value),autoComplete:"new-password",disabled:B})]}),n.jsxs("label",{children:[n.jsx("span",{children:"6-digit code"}),n.jsx("input",{inputMode:"numeric",autoComplete:"one-time-code",placeholder:"000000",maxLength:6,value:P,onChange:E=>k(E.target.value.replace(/\D/g,"").slice(0,6)),disabled:B,autoFocus:!0,onKeyDown:E=>E.key==="Enter"&&void q()})]}),n.jsx("button",{type:"button",className:"account-auth-btn primary account-auth-auth-primary",disabled:B||P.length!==6||g.length<8,onClick:()=>void q(),children:B?"Please wait…":c==="reset"?"Reset password":"Activate account"}),n.jsxs("div",{className:"account-auth-auth-alt",children:[n.jsx("button",{type:"button",className:"account-auth-auth-link",disabled:B||T>0,onClick:()=>void ee(),children:T>0?`Resend in ${T}s`:"Resend code"}),n.jsx("span",{className:"account-auth-auth-dot",children:"·"}),n.jsx("button",{type:"button",className:"account-auth-auth-link",disabled:B,onClick:()=>ne("login"),children:"Back to sign in"})]})]})]})]})}function zr(){const e=qn(),[t,s]=l.useState("idle"),[i,o]=l.useState(null),[c,u]=l.useState(!1),h=l.useRef(e.verifyReturn);h.current=e.verifyReturn;const m=l.useRef(!1);if(l.useEffect(()=>{if(m.current)return;m.current=!0;const f=new URLSearchParams(window.location.search),g=f.get("checkout");if(g!=="success"&&g!=="cancel"||(Qn(window.location.pathname),g!=="success"))return;const y=f.get("session_id");y&&(s("checking"),h.current(y).then(P=>{P!=null&&P.email?(o({email:P.email,needsPassword:P.needsPassword}),u(!0)):s("error")}))},[]),l.useEffect(()=>{!c||t!=="checking"||e.status==="loading"||s(e.status==="signed-in"?"done":"claim")},[c,t,e.status]),l.useEffect(()=>{t==="claim"&&e.status==="signed-in"&&s("done")},[t,e.status]),t==="idle")return null;const b=()=>s("idle");return n.jsx("div",{className:"_t97drno",onClick:t==="checking"?void 0:b,children:n.jsxs("div",{className:"modal",onClick:f=>f.stopPropagation(),children:[t==="checking"&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"modal-title",children:"IGNITE OS+"}),n.jsx("p",{style:{margin:0,fontSize:13,color:"var(--muted)"},children:"Confirming your subscription…"})]}),t==="claim"&&i&&n.jsx(qr,{account:e,claim:i,brand:n.jsx("div",{className:"modal-title",children:"IGNITE OS+"})}),t==="done"&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"modal-title",children:"You're on Plus"}),n.jsxs("p",{style:{margin:"0 0 0.9rem",fontSize:13,color:"var(--muted)"},children:[i!=null&&i.email?`${i.email} is subscribed.`:"Your subscription is active."," Your Plus perks are unlocked."]}),n.jsx("div",{className:"modal-actions",children:n.jsx("button",{type:"button",className:"modal-btn primary",onClick:b,children:"Continue"})})]}),t==="error"&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"modal-title",children:"Couldn't confirm payment"}),n.jsx("p",{style:{margin:"0 0 0.9rem",fontSize:13,color:"var(--muted)"},children:"We couldn't confirm your checkout. If you were charged, reach out on Discord and we'll sort it out."}),n.jsx("div",{className:"modal-actions",children:n.jsx("button",{type:"button",className:"modal-btn ghost",onClick:b,children:"Close"})})]})]})})}class Wr extends l.Component{constructor(){super(...arguments);ke(this,"state",{error:null,info:null});ke(this,"reset",()=>this.setState({error:null,info:null}))}static getDerivedStateFromError(s){return{error:s}}componentDidCatch(s,i){this.setState({info:i})}render(){const{error:s,info:i}=this.state;if(!s)return this.props.children;const o=!1;return n.jsx("div",{className:"fixed inset-0 flex items-center justify-center overflow-auto bg-bg p-8 text-text",children:n.jsxs("div",{className:"w-[min(560px,100%)] rounded-[var(--radius)] border border-border bg-surface p-6 backdrop-blur-xl",children:[n.jsx("span",{className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[color-mix(in_srgb,#ff6b6b_45%,var(--border-2))] bg-[color-mix(in_srgb,#ff6b6b_18%,transparent)] text-lg font-bold text-[#ff8f8f]",children:"!"}),n.jsx("h1",{className:"mt-3.5 mb-1 text-[22px] tracking-tight",children:"Something broke"}),n.jsx("p",{className:"m-0 text-sm leading-normal text-muted",children:"An unexpected error crashed this view. You can try again, or reload IGNITE OS."}),n.jsxs("div",{className:"mt-[1.1rem] flex gap-2",children:[n.jsx("button",{type:"button",className:"h-[38px] rounded-[var(--radius-sm)] border border-transparent bg-text px-4 text-[13px] font-semibold text-bg hover:brightness-95",onClick:this.reset,children:"Try again"}),n.jsx("button",{type:"button",className:"h-[38px] rounded-[var(--radius-sm)] border border-border bg-surface-2 px-4 text-[13px] font-semibold text-text hover:brightness-95",onClick:()=>window.location.reload(),children:"Reload IGNITE OS"})]}),n.jsxs("details",{className:"mt-5",open:o,children:[n.jsxs("summary",{className:"cursor-pointer break-words text-[13px] font-semibold text-[#ff8f8f]",children:[s.name,": ",s.message]}),o]})]})})}}function Hr(){return n.jsx(Wr,{children:n.jsx(Cr,{children:n.jsxs(n.Fragment,{children:[n.jsx($r,{}),n.jsx(zr,{})]})})})}function Vr(){return n.jsx("div",{className:"_t97drno backend-unavailable-backdrop",children:n.jsxs("section",{className:"modal backend-unavailable-modal",role:"alertdialog","aria-labelledby":"backend-unavailable-title",children:[n.jsx("div",{className:"modal-title",id:"backend-unavailable-title",children:"No available backend"}),n.jsx("p",{className:"backend-unavailable-body",children:"IGNITE OS couldn’t reach any of its available links. They may be blocked by your network or temporarily offline."}),n.jsx("p",{className:"backend-unavailable-help",children:"Try again in a moment. If this keeps happening, switch networks or ask for a new link."}),n.jsx("div",{className:"modal-actions",children:n.jsx("button",{type:"button",className:"modal-btn primary",onClick:()=>window.location.reload(),children:"Try again"})})]})})}const Kr=["assets.fern.best","checkout.jbquarterhorseranch.com","books.llteamstore.com"];let We=null;const Gr=new Set;function on(){for(const e of Gr)e()}async function Jr(e){try{const t=await fetch(`https://${e}/`,{method:"GET",redirect:"manual",cache:"no-store",mode:"cors"});return t.type==="opaqueredirect"||t.status===303}catch{return!1}}function Yr(){return We||(We=(async()=>{for(const e of Kr)if(await Jr(e))return on(),e;return on(),null})(),We)}Ut(Ot());Yr();En().then(e=>{const t=document.getElementById("root");let s=t;try{s=t.attachShadow({mode:"closed"})}catch{}if(nr(s),s instanceof ShadowRoot){const i=new Set,o=()=>{for(const c of document.querySelectorAll('link[rel="stylesheet"], style'))i.has(c)||(i.add(c),s.append(c.cloneNode(!0)))};o(),new MutationObserver(o).observe(document.head,{childList:!0})}Jn.createRoot(s).render(n.jsxs(l.StrictMode,{children:[n.jsx(Hr,{}),e===null&&n.jsx(Vr,{})]}))});export{qr as $,pi as A,ps as B,xn as C,pt as D,ai as E,mi as F,ii as G,bi as H,ri as I,fs as J,gi as K,ui as L,ti as M,fi as N,bt as O,dt as P,Xt as Q,It as R,hi as S,li as T,Bs as U,os as V,Ze as W,yi as X,xi as Y,tr as Z,vi as _,ye as a,Tn as a0,wi as a1,Bt as a2,ei as a3,_t as a4,Oe as b,ms as c,ci as d,Pt as e,Lt as f,gn as g,si as h,ni as i,Rt as j,Me as k,oi as l,di as m,sr as n,rr as o,wn as p,ge as q,tt as r,En as s,Ts as t,Is as u,Ps as v,we as w,_n as x,as as y,nt as z};
|
package/ignite-ember.css
CHANGED
|
@@ -235,3 +235,185 @@ button:focus-visible { outline: 2px solid rgba(201,112,58,.7); outline-offset: 2
|
|
|
235
235
|
.ai-rail { background: linear-gradient(180deg, rgba(20,18,20,.6), rgba(12,11,13,.7)) !important; border-right: 1px solid rgba(255,255,255,.06) !important; }
|
|
236
236
|
.ai-empty-title { font-family: var(--font-round); font-weight: 600; letter-spacing: -.02em; }
|
|
237
237
|
.settings-swatch.active, .settings-swatch[aria-pressed=true] { outline: 2px solid rgba(201,112,58,.8); outline-offset: 2px; }
|
|
238
|
+
|
|
239
|
+
/* =====================================================================
|
|
240
|
+
Ignite OS 2.0 — new canvas + home screen
|
|
241
|
+
===================================================================== */
|
|
242
|
+
:root { --bg: #0a0708; --mesh-base: #0a0708; }
|
|
243
|
+
body { background: #0a0708; }
|
|
244
|
+
|
|
245
|
+
/* dot-grid canvas with a low ember glow (replaces the old aurora) */
|
|
246
|
+
._v4jfozk, ._v4jfozk.mesh {
|
|
247
|
+
background:
|
|
248
|
+
radial-gradient(circle at 1px 1px, rgba(255,235,220,.07) 1px, transparent 0) 0 0 / 24px 24px,
|
|
249
|
+
radial-gradient(60% 38% at 50% -4%, rgba(201,112,58,.16), transparent 72%),
|
|
250
|
+
radial-gradient(40% 30% at 85% 100%, rgba(140,60,30,.10), transparent 70%),
|
|
251
|
+
#0a0708 !important;
|
|
252
|
+
}
|
|
253
|
+
._v4jfozk::before, ._v4jfozk::after { display: none !important; }
|
|
254
|
+
._rx2al0e { background: none !important; }
|
|
255
|
+
|
|
256
|
+
/* home layout */
|
|
257
|
+
.ignite-home { display: flex !important; flex-direction: column; align-items: center !important; justify-content: space-between; gap: 0; padding: clamp(22px, 5vh, 56px) clamp(16px, 4vw, 44px) 0 !important; overflow: hidden; }
|
|
258
|
+
.ignite-home:before { display: none !important; }
|
|
259
|
+
.ig-center { width: 100%; max-width: 680px; margin: auto; display: flex; flex-direction: column; align-items: center; gap: 22px; }
|
|
260
|
+
|
|
261
|
+
.ig-logo { text-align: center; }
|
|
262
|
+
.ig-wordmark {
|
|
263
|
+
margin: 0; font-family: var(--font-round); font-weight: 700; letter-spacing: -.045em; line-height: 1;
|
|
264
|
+
font-size: clamp(54px, 9vw, 84px); color: #f4ede8;
|
|
265
|
+
text-shadow: 0 0 38px rgba(201,112,58,.45), 0 0 90px rgba(201,112,58,.18);
|
|
266
|
+
}
|
|
267
|
+
.ig-tagline { margin: 10px 0 0; font-size: 14px; font-weight: 500; letter-spacing: .06em; color: var(--muted); }
|
|
268
|
+
|
|
269
|
+
.ig-search { position: relative; width: 100%; }
|
|
270
|
+
.ig-search .newtab-search-wrap { width: 100%; }
|
|
271
|
+
.ig-search ._25dnvc2 { height: 54px; padding-right: 60px !important; }
|
|
272
|
+
.ig-go {
|
|
273
|
+
position: absolute; right: 8px; top: 8px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; z-index: 3;
|
|
274
|
+
background: linear-gradient(180deg, #b8653a, #8e4624); border: 1px solid rgba(255,255,255,.14); color: #fff6ee;
|
|
275
|
+
box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 6px 16px rgba(0,0,0,.4); transition: transform .15s, filter .2s;
|
|
276
|
+
}
|
|
277
|
+
.ig-go:hover { filter: brightness(1.12); } .ig-go:active { transform: scale(.92); } .ig-go:disabled { opacity: .5; }
|
|
278
|
+
.ig-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
|
|
279
|
+
|
|
280
|
+
.ig-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 14px; }
|
|
281
|
+
.ig-tile { display: flex; flex-direction: column; align-items: center; gap: 9px; background: none; border: 0; cursor: pointer; color: var(--text); padding: 0; }
|
|
282
|
+
.ig-tile:disabled { opacity: .5; cursor: default; }
|
|
283
|
+
.ig-tile-icon {
|
|
284
|
+
width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; color: var(--ember-soft);
|
|
285
|
+
background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
|
|
286
|
+
border: 1px solid rgba(255,255,255,.08); box-shadow: var(--glass-hi), 0 8px 18px rgba(0,0,0,.35);
|
|
287
|
+
transition: transform .2s cubic-bezier(.3,1.4,.5,1), border-color .2s, color .2s;
|
|
288
|
+
}
|
|
289
|
+
.ig-tile-icon .ig-ico { width: 24px; height: 24px; }
|
|
290
|
+
.ig-tile:hover .ig-tile-icon { transform: translateY(-3px); border-color: rgba(201,112,58,.5); color: #f0b48c; }
|
|
291
|
+
.ig-tile:active .ig-tile-icon { transform: scale(.94); }
|
|
292
|
+
.ig-tile-label { font-size: 12px; font-weight: 500; color: var(--muted); }
|
|
293
|
+
|
|
294
|
+
.ig-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
|
|
295
|
+
.ig-pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer;
|
|
296
|
+
background: var(--glass); border: 1px solid rgba(255,255,255,.09); transition: color .2s, border-color .2s; }
|
|
297
|
+
.ig-pill:hover { color: var(--text); border-color: rgba(201,112,58,.45); }
|
|
298
|
+
.ig-pill .ig-ico { width: 15px; height: 15px; color: var(--ember); }
|
|
299
|
+
.ig-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 10px rgba(201,112,58,.9); animation: igpulse 2.4s ease-in-out infinite; }
|
|
300
|
+
@keyframes igpulse { 50% { opacity: .35; } }
|
|
301
|
+
|
|
302
|
+
.ig-clock { width: 220px; padding: 22px 0 20px; border-radius: 24px; text-align: center;
|
|
303
|
+
background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015)); border: 1px solid rgba(255,255,255,.07); box-shadow: var(--glass-hi); }
|
|
304
|
+
.ig-clock-time { font-family: var(--font-round); font-weight: 600; font-size: 34px; letter-spacing: -.03em; color: #f1ebe6; }
|
|
305
|
+
.ig-clock-date { margin-top: 4px; font-size: 12.5px; color: var(--muted-2); }
|
|
306
|
+
|
|
307
|
+
/* what's-new strip (auto-scrolling) */
|
|
308
|
+
.ig-news { width: calc(100% + 2 * clamp(16px, 4vw, 44px)); margin: 18px 0 0; padding: 0 0 clamp(14px, 3vh, 28px); overflow: hidden;
|
|
309
|
+
-webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
|
|
310
|
+
.ig-news-track { display: flex; gap: 14px; width: max-content; animation: ignews 60s linear infinite; }
|
|
311
|
+
.ig-news:hover .ig-news-track { animation-play-state: paused; }
|
|
312
|
+
@keyframes ignews { to { transform: translateX(-50%); } }
|
|
313
|
+
.ig-news-card { width: 290px; flex: none; padding: 14px 16px 16px; border-radius: 20px; background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015)); border: 1px solid rgba(255,255,255,.07); }
|
|
314
|
+
.ig-news-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
|
|
315
|
+
.ig-news-card b { font-size: 13.5px; color: var(--text); font-weight: 650; }
|
|
316
|
+
.ig-news-card header span { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ember); }
|
|
317
|
+
.ig-news-card p { margin: 8px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
|
|
318
|
+
|
|
319
|
+
@media (max-height: 760px) { .ig-clock { display: none; } }
|
|
320
|
+
@media (max-width: 700px) { .ig-news-card { width: 250px; } }
|
|
321
|
+
|
|
322
|
+
/* update notification */
|
|
323
|
+
.ignite-update {
|
|
324
|
+
position: fixed; top: 64px; right: 18px; z-index: 150; width: min(340px, calc(100vw - 28px)); padding: 16px 18px 16px; border-radius: 22px;
|
|
325
|
+
background: linear-gradient(180deg, rgba(30,26,28,.96), rgba(16,14,16,.98)); border: 1px solid rgba(255,255,255,.1);
|
|
326
|
+
box-shadow: var(--glass-hi), 0 22px 60px rgba(0,0,0,.65); -webkit-backdrop-filter: blur(26px); backdrop-filter: blur(26px);
|
|
327
|
+
animation: igrise .45s cubic-bezier(.2,1.1,.4,1) both;
|
|
328
|
+
}
|
|
329
|
+
@keyframes igrise { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
|
|
330
|
+
.ignite-update-x { position: absolute; top: 10px; right: 12px; width: 26px; height: 26px; border-radius: 50%; background: none; border: 0; color: var(--muted-2); font-size: 20px; line-height: 1; cursor: pointer; }
|
|
331
|
+
.ignite-update-x:hover { color: var(--text); background: rgba(255,255,255,.07); }
|
|
332
|
+
.ignite-update-head { display: flex; align-items: center; gap: 8px; }
|
|
333
|
+
.ignite-update-badge { font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; color: #fff6ee; background: linear-gradient(180deg, #b8653a, #8e4624); }
|
|
334
|
+
.ignite-update-ver { font-size: 12px; font-weight: 600; color: var(--muted-2); }
|
|
335
|
+
.ignite-update h3 { margin: 10px 0 8px; font-family: var(--font-round); font-size: 17px; letter-spacing: -.02em; color: var(--text); }
|
|
336
|
+
.ignite-update ul { margin: 0 0 14px; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--muted); }
|
|
337
|
+
.ignite-update li::marker { color: var(--ember); }
|
|
338
|
+
.ignite-update-btn { height: 34px; padding: 0 18px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; color: #fff6ee;
|
|
339
|
+
background: linear-gradient(180deg, #b8653a, #8e4624); border: 1px solid rgba(255,255,255,.14); }
|
|
340
|
+
|
|
341
|
+
/* =====================================================================
|
|
342
|
+
Shell: thin icon rail (left) + Chrome-style tab bar & toolbar (top)
|
|
343
|
+
===================================================================== */
|
|
344
|
+
:root { --ig-rail-w: 52px; --ig-tabs-h: 38px; --ig-bar-h: 46px; --ig-top-h: 84px; --ig-bar: #151113; --ig-strip: #0b0809; }
|
|
345
|
+
|
|
346
|
+
/* the old sidebar/page bar are gone; page content sits under the new top bar */
|
|
347
|
+
._ynqudi4 { display: none !important; }
|
|
348
|
+
._9gmixa5 .content { padding-top: var(--ig-top-h); }
|
|
349
|
+
|
|
350
|
+
/* ---- left rail: flat, full height, part of the page ---- */
|
|
351
|
+
.ig-rail {
|
|
352
|
+
position: relative; z-index: 7; flex: none; width: var(--ig-rail-w); height: 100%;
|
|
353
|
+
display: flex; flex-direction: column; align-items: center; padding: 0 0 10px;
|
|
354
|
+
background: var(--ig-strip); border-right: 1px solid rgba(255,255,255,.06);
|
|
355
|
+
}
|
|
356
|
+
.ig-rail-logo { width: 100%; height: var(--ig-tabs-h); display: grid; place-items: center; color: var(--ember); }
|
|
357
|
+
.ig-rail-logo .ig-ico { width: 20px; height: 20px; fill: currentColor; stroke: none; filter: drop-shadow(0 0 8px rgba(201,112,58,.5)); }
|
|
358
|
+
.ig-rail-group { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: calc(var(--ig-bar-h) - 14px); }
|
|
359
|
+
.ig-rail-group.bottom { margin-top: auto; }
|
|
360
|
+
.ig-rail-btn {
|
|
361
|
+
position: relative; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--muted-2); background: none; border: 0; cursor: pointer;
|
|
362
|
+
transition: background .15s, color .15s;
|
|
363
|
+
}
|
|
364
|
+
.ig-rail-btn:hover { background: rgba(255,255,255,.07); color: var(--text); }
|
|
365
|
+
.ig-rail-btn.active { color: var(--ember-soft); background: rgba(201,112,58,.14); }
|
|
366
|
+
.ig-rail-btn.active::before { content: ''; position: absolute; left: -7px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ember); }
|
|
367
|
+
|
|
368
|
+
/* ---- top: tab strip + toolbar ---- */
|
|
369
|
+
.ig-top { position: absolute; z-index: 6; top: 0; left: var(--ig-rail-w); right: 0; height: var(--ig-top-h); display: flex; flex-direction: column; }
|
|
370
|
+
.ig-tabstrip { height: var(--ig-tabs-h); display: flex; align-items: flex-end; gap: 4px; padding: 0 8px; background: var(--ig-strip); }
|
|
371
|
+
.ig-tabs { display: flex; align-items: flex-end; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
|
|
372
|
+
.ig-tabs::-webkit-scrollbar { display: none; }
|
|
373
|
+
.ig-tab {
|
|
374
|
+
position: relative; display: flex; align-items: center; gap: 8px; height: 32px; min-width: 120px; max-width: 220px; flex: 0 1 220px; padding: 0 10px 0 12px;
|
|
375
|
+
border-radius: 10px 10px 0 0; color: var(--muted); font-size: 12.5px; cursor: default; user-select: none; transition: background .15s, color .15s;
|
|
376
|
+
}
|
|
377
|
+
.ig-tab:hover:not(.active) { background: rgba(255,255,255,.05); color: var(--text); }
|
|
378
|
+
.ig-tab.active { background: var(--ig-bar); color: var(--text); }
|
|
379
|
+
.ig-tab.active::before, .ig-tab.active::after { content: ''; position: absolute; bottom: 0; width: 10px; height: 10px; pointer-events: none; }
|
|
380
|
+
.ig-tab.active::before { left: -10px; background: radial-gradient(circle at 0 0, transparent 10px, var(--ig-bar) 10.5px); }
|
|
381
|
+
.ig-tab.active::after { right: -10px; background: radial-gradient(circle at 100% 0, transparent 10px, var(--ig-bar) 10.5px); }
|
|
382
|
+
.ig-tab + .ig-tab:not(.active)::before { content: ''; position: absolute; left: -2px; top: 9px; bottom: 9px; width: 1px; background: rgba(255,255,255,.08); }
|
|
383
|
+
.ig-tab.active + .ig-tab::before, .ig-tab:not(.active) + .ig-tab.active::marker { display: none; }
|
|
384
|
+
.ig-tab-ico { flex: none; width: 16px; height: 16px; display: grid; place-items: center; }
|
|
385
|
+
.ig-tab-ico img { width: 14px; height: 14px; border-radius: 3px; }
|
|
386
|
+
.ig-tab-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
387
|
+
.ig-tab-x { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: var(--muted-2); background: none; border: 0; cursor: pointer; opacity: 0; transition: opacity .15s, background .15s; }
|
|
388
|
+
.ig-tab:hover .ig-tab-x, .ig-tab.active .ig-tab-x { opacity: 1; }
|
|
389
|
+
.ig-tab-x:hover { background: rgba(255,255,255,.12); color: var(--text); }
|
|
390
|
+
.ig-newtab { flex: none; width: 28px; height: 28px; margin: 0 0 3px 2px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); background: none; border: 0; cursor: pointer; transition: background .15s, color .15s; }
|
|
391
|
+
.ig-newtab:hover { background: rgba(255,255,255,.08); color: var(--text); }
|
|
392
|
+
|
|
393
|
+
.ig-toolbar { height: var(--ig-bar-h); display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--ig-bar); border-bottom: 1px solid rgba(255,255,255,.06); }
|
|
394
|
+
.ig-nav { display: flex; align-items: center; gap: 2px; flex: none; }
|
|
395
|
+
.ig-nav ._1lqv40d { width: 30px; height: 30px; border-radius: 50%; }
|
|
396
|
+
.ig-toolbar .omnibox-wrap { position: relative; flex: 1; min-width: 0; }
|
|
397
|
+
.ig-toolbar .omnibox-wrap form, .ig-toolbar ._w5gq50s {
|
|
398
|
+
display: flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px !important;
|
|
399
|
+
background: rgba(255,255,255,.06) !important; border: 1px solid transparent !important; box-shadow: none !important; -webkit-backdrop-filter: none; backdrop-filter: none;
|
|
400
|
+
}
|
|
401
|
+
.ig-toolbar .omnibox-wrap form:hover { background: rgba(255,255,255,.085) !important; }
|
|
402
|
+
.ig-toolbar .omnibox-wrap form:focus-within, .ig-toolbar ._w5gq50s.focused { border-color: rgba(201,112,58,.6) !important; background: rgba(255,255,255,.08) !important; box-shadow: 0 0 0 3px rgba(201,112,58,.13) !important; }
|
|
403
|
+
.ig-toolbar .omnibox-wrap input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; font-size: 13px; color: var(--text); }
|
|
404
|
+
.ig-bm { display: flex; align-items: center; gap: 2px; flex: none; max-width: 32%; overflow-x: auto; scrollbar-width: none; }
|
|
405
|
+
.ig-bm::-webkit-scrollbar { display: none; }
|
|
406
|
+
.ig-bm-btn { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--ember-soft); background: none; border: 0; cursor: pointer; transition: background .15s; }
|
|
407
|
+
.ig-bm-btn:hover { background: rgba(255,255,255,.08); }
|
|
408
|
+
.ig-bm-btn img { width: 16px; height: 16px; border-radius: 3px; }
|
|
409
|
+
.ig-bm-btn.add { color: var(--muted-2); }
|
|
410
|
+
|
|
411
|
+
/* the home / pages sit flush under the bar */
|
|
412
|
+
.ignite-home { padding-top: clamp(10px, 3vh, 36px) !important; }
|
|
413
|
+
.ignite-update { top: calc(var(--ig-top-h) + 12px); }
|
|
414
|
+
|
|
415
|
+
@media (max-width: 700px) {
|
|
416
|
+
:root { --ig-rail-w: 46px; }
|
|
417
|
+
.ig-bm { display: none; }
|
|
418
|
+
.ig-tab { min-width: 96px; }
|
|
419
|
+
}
|