@skybridge/devtools 2.0.0-alpha.f41c087 → 2.0.0-alpha.ff0caf0

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.
@@ -75,7 +75,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
75
75
  `;break;case`id`:s=t.includes(`\0`)?void 0:t;break;case`retry`:/^\d+$/.test(t)?r(parseInt(t,10)):n(new mx(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:i}));break;default:n(new mx(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:`unknown-field`,field:e,value:t,line:i}));break}}function p(){c.length>0&&t({id:s,event:l||void 0,data:c.endsWith(`
76
76
  `)?c.slice(0,-1):c}),s=void 0,c=``,l=``}function m(e={}){a&&e.consume&&d(a),o=!0,s=void 0,c=``,l=``,a=``}return{feed:u,reset:m}}function _x(e){let t=[],n=``,r=0;for(;r<e.length;){let i=e.indexOf(`\r`,r),a=e.indexOf(`
77
77
  `,r),o=-1;if(i!==-1&&a!==-1?o=Math.min(i,a):i===-1?a!==-1&&(o=a):o=i===e.length-1?-1:i,o===-1){n=e.slice(r);break}else{let n=e.slice(r,o);t.push(n),r=o+1,e[r-1]===`\r`&&e[r]===`
78
- `&&r++}}return[t,n]}var vx=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n}={}){let r;super({start(i){r=gx({onEvent:e=>{i.enqueue(e)},onError(t){e===`terminate`?i.error(t):typeof e==`function`&&e(t)},onRetry:t,onComment:n})},transform(e){r.feed(e)}})}},yx=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthClientFlowError`})}static[Symbol.hasInstance](e){return pv(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return pv(this,e)}constructor(e){super(e),this.name=new.target.name,fv(this,new.target)}},bx=class extends yx{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.IssuerMismatchError`})}kind;expected;received;constructor(e,t,n){super(`Issuer mismatch in ${e===`metadata`?`authorization server metadata (RFC 8414 §3.3)`:`authorization response (RFC 9207)`}: expected ${JSON.stringify(t)}, received ${JSON.stringify(n)}`),this.kind=e,this.expected=t,this.received=n}},xx=class extends yx{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.RegistrationRejectedError`})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`),this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},Sx=class extends yx{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsecureTokenEndpointError`})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},Cx=class extends yx{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.AuthorizationServerMismatchError`})}constructor(e,t){super(`Authorization server changed between redirect and callback (redirected to ${JSON.stringify(e)}, callback resolved ${JSON.stringify(t)}); refusing to send authorization_code/code_verifier to a different token endpoint`),this.recordedIssuer=e,this.currentIssuer=t}},wx=class extends yx{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsufficientScopeError`})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:``}`),this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}};function Tx(e,t,n){if(e!==void 0)return e.issuer===void 0?(n?.canPersistStamp!==!1&&console.warn(`[mcp-sdk] SEP-2352: stored OAuth credential has no 'issuer' stamp (pre-upgrade storage or provider not round-tripping the value). SEP-2352 isolation is inactive for this read; ensure your provider round-trips the issuer field.`),e):Ex(e.issuer,t)?e:void 0}function Ex(e,t){return e===t||e.endsWith(`/`)&&e.slice(0,-1)===t||t.endsWith(`/`)&&t.slice(0,-1)===e}function Dx(e){if(e==null)return!1;let t=e;return typeof t.tokens==`function`&&typeof t.clientInformation==`function`}async function Ox(e,t,n){let{resourceMetadataUrl:r,scope:i}=eS(t.response);if(await Yx(e,{serverUrl:t.serverUrl,resourceMetadataUrl:r,scope:i,fetchFn:t.fetchFn,...n})!==`AUTHORIZED`)throw new Ax}function kx(e,t){return{token:async()=>(await e.tokens())?.access_token,onUnauthorized:async n=>Ox(e,n,t)}}var Ax=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnauthorizedError`})}static[Symbol.hasInstance](e){return pv(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return pv(this,e)}constructor(e){super(e??`Unauthorized`),this.name=`UnauthorizedError`,fv(this,new.target)}};function jx(e){return e?.authorization_response_iss_parameter_supported===!0}function Mx({iss:e,expectedIssuer:t,issParameterSupported:n}){if(t!==void 0){if(e===void 0){if(n)throw new bx(`authorization_response`,t,void 0);return}if(e!==t)throw new bx(`authorization_response`,t,e)}}function Nx(...e){let t=new Set;for(let n of e)if(n)for(let e of n.split(/\s+/))e&&t.add(e);return t.size>0?[...t].join(` `):void 0}function Px(e,t){if(!e)return!1;let n=new Set((t??``).split(/\s+/).filter(Boolean));for(let t of e.split(/\s+/))if(t&&!n.has(t))return!0;return!1}async function Fx(e,t,n,r,i){if(typeof e==`string`)return{authorizationCode:e,iss:t};let a=e.get(`iss`)??void 0,o=e.get(`code`);if(o)return{authorizationCode:o,iss:a};let s=(await n.discoveryState?.())?.authorizationServerMetadata;if(!s)try{s=(await uS(r,i)).authorizationServerMetadata}catch{s=void 0}if(!s)throw new Ax(`Authorization callback failed and the issuer could not be verified`);Mx({iss:a,expectedIssuer:s.issuer,issParameterSupported:jx(s)});let c=e.get(`error`);throw c?new hv(c,e.get(`error_description`)??c,e.get(`error_uri`)??void 0):new Ax("Authorization callback contained neither `code` nor `error`")}function Ix(e){return[`client_secret_basic`,`client_secret_post`,`none`].includes(e)}var Lx=`code`,Rx=`S256`;function zx(e,t){let n=e.client_secret!==void 0;return`token_endpoint_auth_method`in e&&e.token_endpoint_auth_method&&Ix(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?`client_secret_basic`:`none`:n&&t.includes(`client_secret_basic`)?`client_secret_basic`:n&&t.includes(`client_secret_post`)?`client_secret_post`:t.includes(`none`)?`none`:n?`client_secret_post`:`none`}function Bx(e,t,n,r){let{client_id:i,client_secret:a}=t;switch(e){case`client_secret_basic`:Vx(i,a,n);return;case`client_secret_post`:Hx(i,a,r);return;case`none`:Ux(i,r);return;default:throw Error(`Unsupported client authentication method: ${e}`)}}function Vx(e,t,n){if(!t)throw Error(`client_secret_basic authentication requires a client_secret`);let r=btoa(`${e}:${t}`);n.set(`Authorization`,`Basic ${r}`)}function Hx(e,t,n){n.set(`client_id`,e),t&&n.set(`client_secret`,t)}function Ux(e,t){t.set(`client_id`,e)}function Wx(e){return e===`localhost`||e===`127.0.0.1`||e===`[::1]`||e===`::1`}function Gx(e){let t=new URL(String(e));if(t.protocol!==`https:`&&!Wx(t.hostname))throw new Sx(t.href);return t}function Kx(e){for(let t of e??[]){let e;try{e=new URL(t)}catch{continue}if(e.protocol!==`http:`&&e.protocol!==`https:`||Wx(e.hostname))return`native`}return`web`}function qx(e){let t=e.clientMetadata;return{...t,grant_types:t.grant_types??(e.redirectUrl===void 0?void 0:[`authorization_code`,`refresh_token`]),application_type:t.application_type??Kx(t.redirect_uris)}}async function Jx(e){let t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{let e=iv.parse(JSON.parse(n));return hv.fromResponse(e)}catch(e){let r=`${t?`HTTP ${t}: `:``}Invalid OAuth error response: ${e}. Raw body: ${n}`;return new hv(mv.ServerError,r)}}async function Yx(e,t){try{return await Zx(e,t)}catch(n){if(n instanceof hv){if(n.code===mv.InvalidClient||n.code===mv.UnauthorizedClient)return await e.invalidateCredentials?.(`client`),await e.invalidateCredentials?.(`tokens`),await Zx(e,t);if(n.code===mv.InvalidGrant)return await e.invalidateCredentials?.(`tokens`),await Zx(e,t)}throw n}}function Xx(e){let{requestedScope:t,resourceMetadata:n,authServerMetadata:r,clientMetadata:i}=e,a=t||n?.scopes_supported?.join(` `)||i.scope;return a&&r?.scopes_supported?.includes(`offline_access`)&&!a.split(` `).includes(`offline_access`)&&i.grant_types?.includes(`refresh_token`)&&(a=`${a} offline_access`),a}async function Zx(e,{serverUrl:t,authorizationCode:n,iss:r,scope:i,resourceMetadataUrl:a,fetchFn:o,skipIssuerMetadataValidation:s,forceReauthorization:c}){let l=qx(e),u=await e.discoveryState?.(),d,f,p,m,h=a;if(!h&&u?.resourceMetadataUrl&&(h=new URL(u.resourceMetadataUrl)),u?.authorizationServerUrl){if(f=u.authorizationServerUrl,d=u.resourceMetadata,p=u.authorizationServerMetadata??await lS(f,{fetchFn:o,skipIssuerValidation:s}),!d)try{d=await nS(t,{resourceMetadataUrl:h},o)}catch(e){if(e instanceof TypeError)throw e}(p!==u.authorizationServerMetadata||d!==u.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(f),resourceMetadataUrl:h?.toString(),resourceMetadata:d,authorizationServerMetadata:p})}else{let e=await uS(t,{resourceMetadataUrl:h,fetchFn:o,skipIssuerMetadataValidation:s});f=e.authorizationServerUrl,p=e.authorizationServerMetadata,d=e.resourceMetadata,m={authorizationServerUrl:String(f),resourceMetadataUrl:h?.toString(),resourceMetadata:d,authorizationServerMetadata:p}}let g=p?.issuer??String(f),_={issuer:g};if(await e.saveAuthorizationServerUrl?.(g),n!==void 0){let t=u?.authorizationServerMetadata?.issuer??u?.authorizationServerUrl;if(t===void 0){if(e.saveDiscoveryState!==void 0)throw new Cx(`discoveryState was not available on the callback leg; ensure your provider persists discoveryState alongside codeVerifier`,g);console.warn(`[mcp-sdk] OAuthClientProvider does not implement saveDiscoveryState()/discoveryState(); the SEP-2352 callback-leg authorization-server binding cannot be checked. Implement discoveryState (persist alongside codeVerifier) — see docs/migration/upgrade-to-v2.md §SEP-2352.`)}else if(!Ex(t,g))throw new Cx(t,g)}m&&await e.saveDiscoveryState?.(m);let v=await $x(t,e,d);v&&await e.saveResourceUrl?.(String(v));let y=Xx({requestedScope:i,resourceMetadata:d,authServerMetadata:p,clientMetadata:e.clientMetadata}),b=await Promise.resolve(e.clientInformation(_)),x=Tx(b,g,{canPersistStamp:e.saveClientInformation!==void 0});if(x===void 0&&b?.issuer&&e.saveClientInformation===void 0)throw new Cx(b.issuer,g);if(x&&x.issuer===void 0&&(x={...x,issuer:g},await e.saveClientInformation?.(x,_)),!x){if(n!==void 0)throw Error(`Existing OAuth client information is required when exchanging an authorization code`);let t=p?.client_id_metadata_document_supported===!0,r=e.clientMetadataUrl;if(r&&!Qx(r))throw new hv(mv.InvalidClientMetadata,`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${r}`);if(t&&r)x={client_id:r,issuer:g},await e.saveClientInformation?.(x,_);else{if(!e.saveClientInformation)throw Error(`OAuth client information must be saveable for dynamic registration`);x={...await gS(f,{metadata:p,clientMetadata:l,scope:y,fetchFn:o}),issuer:g},await e.saveClientInformation(x,_)}}let S=!e.redirectUrl;if(n!==void 0||S){n!==void 0&&Mx({iss:r,expectedIssuer:p?.issuer,issParameterSupported:jx(p)});let t=await hS(e,f,{metadata:p,resource:v,authorizationCode:n,iss:r,scope:y,fetchFn:o});return await e.saveTokens({...t,issuer:g},_),`AUTHORIZED`}let C=Tx(await e.tokens(_),g);if(C&&C.issuer===void 0&&(C={...C,issuer:g},await e.saveTokens(C,_)),C?.refresh_token&&!c)try{let t=await mS(f,{metadata:p,clientInformation:x,refreshToken:C.refresh_token,resource:v,addClientAuthentication:e.addClientAuthentication,fetchFn:o});return await e.saveTokens({...t,issuer:g},_),`AUTHORIZED`}catch(e){if(e instanceof Sx||!(!(e instanceof hv)||e.code===mv.ServerError))throw e}let w=e.state?await e.state():void 0,{authorizationUrl:T,codeVerifier:E}=await dS(f,{metadata:p,clientInformation:x,state:w,redirectUrl:e.redirectUrl,scope:y,resource:v});return await e.saveCodeVerifier(E),await e.redirectToAuthorization(T),`REDIRECT`}function Qx(e){if(!e)return!1;try{let t=new URL(e);return t.protocol===`https:`&&t.pathname!==`/`}catch{return!1}}async function $x(e,t,n){let r=yee(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!bee({requestedResource:r,configuredResource:n.resource}))throw Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function eS(e){let t=e.headers.get(`WWW-Authenticate`);if(!t)return{};let[n,r]=t.split(` `);if(n?.toLowerCase()!==`bearer`||!r)return{};let i=tS(e,`resource_metadata`)||void 0,a;if(i)try{a=new URL(i)}catch{}let o=tS(e,`scope`)||void 0,s=tS(e,`error`)||void 0,c=tS(e,`error_description`)||void 0;return{resourceMetadataUrl:a,scope:o,error:s,errorDescription:c}}function tS(e,t){let n=e.headers.get(`WWW-Authenticate`);if(!n)return null;let r=new RegExp(String.raw`${t}=(?:"([^"]+)"|([^\s,]+))`),i=n.match(r);if(i){let e=i[1]||i[2];if(e)return e}return null}async function nS(e,t,n=fetch){let r=await sS(e,`oauth-protected-resource`,n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.text?.().catch(()=>{}),Error(`Resource server does not implement OAuth 2.0 Protected Resource Metadata.`);if(!r.ok)throw await r.text?.().catch(()=>{}),Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return Q_.parse(await r.json())}async function rS(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(!(r instanceof TypeError))throw r;if(t)try{return await n(e,{})}catch(e){if(!(e instanceof TypeError))throw e;return}return}}function iS(e,t=``,n={}){return t.endsWith(`/`)&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function aS(e,t,n=fetch){return await rS(e,{"MCP-Protocol-Version":t},n)}function oS(e,t){return e?t===`/`?!1:e.status>=400&&e.status<500||e.status===502:!0}async function sS(e,t,n,r){let i=new URL(e),a=r?.protocolVersion??`2025-11-25`,o;if(r?.metadataUrl)o=new URL(r.metadataUrl);else{let e=iS(t,i.pathname);o=new URL(e,r?.metadataServerUrl??i),o.search=i.search}let s=await aS(o,a,n);return!r?.metadataUrl&&oS(s,i.pathname)&&(s=await aS(new URL(`/.well-known/${t}`,i),a,n)),s}function cS(e){let t=typeof e==`string`?new URL(e):e,n=t.pathname!==`/`,r=[];if(!n)return r.push({url:new URL(`/.well-known/oauth-authorization-server`,t.origin),type:`oauth`},{url:new URL(`/.well-known/openid-configuration`,t.origin),type:`oidc`}),r;let i=t.pathname;return i.endsWith(`/`)&&(i=i.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${i}`,t.origin),type:`oauth`},{url:new URL(`/.well-known/openid-configuration${i}`,t.origin),type:`oidc`},{url:new URL(`${i}/.well-known/openid-configuration`,t.origin),type:`oidc`}),r}async function lS(e,{fetchFn:t=fetch,protocolVersion:n=Rm,skipIssuerValidation:r=!1}={}){let i={"MCP-Protocol-Version":n,Accept:`application/json`},a=cS(e);for(let{url:n,type:o}of a){let a=await rS(n,i,t);if(!a)continue;if(!a.ok){if(await a.text?.().catch(()=>{}),a.status>=400&&a.status<500||a.status===502)continue;throw Error(`HTTP ${a.status} trying to load ${o===`oauth`?`OAuth`:`OpenID provider`} metadata from ${n}`)}let s=o===`oauth`?$_.parse(await a.json()):tv.parse(await a.json());if(!r){let t=typeof e==`string`?e:e.href;if(!(s.issuer===t||t.endsWith(`/`)&&s.issuer===t.slice(0,-1)))throw new bx(`metadata`,t,s.issuer)}return s}}async function uS(e,t){let n,r;try{n=await nS(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch(e){if(e instanceof TypeError)throw e}r||=String(new URL(`/`,e));let i=await lS(r,{fetchFn:t?.fetchFn,skipIssuerValidation:t?.skipIssuerMetadataValidation});return{authorizationServerUrl:r,authorizationServerMetadata:i,resourceMetadata:n}}async function dS(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:i,state:a,resource:o}){let s;if(t){if(s=new URL(t.authorization_endpoint),!t.response_types_supported.includes(Lx))throw Error(`Incompatible auth server: does not support response type ${Lx}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(Rx))throw Error(`Incompatible auth server: does not support code challenge method ${Rx}`)}else s=new URL(`/authorize`,e);let c=await px(),l=c.code_verifier,u=c.code_challenge;return s.searchParams.set(`response_type`,Lx),s.searchParams.set(`client_id`,n.client_id),s.searchParams.set(`code_challenge`,u),s.searchParams.set(`code_challenge_method`,Rx),s.searchParams.set(`redirect_uri`,String(r)),a&&s.searchParams.set(`state`,a),i&&s.searchParams.set(`scope`,i),i?.split(` `).includes(`offline_access`)&&s.searchParams.append(`prompt`,`consent`),o&&s.searchParams.set(`resource`,o.href),{authorizationUrl:s,codeVerifier:l}}function fS(e,t,n){return new URLSearchParams({grant_type:`authorization_code`,code:e,code_verifier:t,redirect_uri:String(n)})}async function pS(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:i,resource:a,fetchFn:o}){let s=Gx(t?.token_endpoint??new URL(`/token`,e)),c=new Headers({"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`});a&&n.set(`resource`,a.href),i?await i(c,n,s,t):r&&Bx(zx(r,t?.token_endpoint_auth_methods_supported??[]),r,c,n);let l=await(o??fetch)(s,{method:`POST`,headers:c,body:n});if(!l.ok)throw await Jx(l);let u=await l.json();try{return nv.parse(u)}catch(e){throw typeof u==`object`&&u&&`error`in u?await Jx(JSON.stringify(u)):e}}async function mS(e,{metadata:t,clientInformation:n,refreshToken:r,resource:i,addClientAuthentication:a,fetchFn:o}){return{refresh_token:r,...await pS(e,{metadata:t,tokenRequestParams:new URLSearchParams({grant_type:`refresh_token`,refresh_token:r}),clientInformation:n,addClientAuthentication:a,resource:i,fetchFn:o})}}async function hS(e,t,{metadata:n,resource:r,authorizationCode:i,iss:a,scope:o,fetchFn:s}={}){i!==void 0&&Mx({iss:a,expectedIssuer:n?.issuer,issParameterSupported:jx(n)});let c=o??e.clientMetadata.scope,l;if(e.prepareTokenRequest&&(l=await e.prepareTokenRequest(c)),!l){if(!i)throw Error(`Either provider.prepareTokenRequest() or authorizationCode is required`);if(!e.redirectUrl)throw Error(`redirectUrl is required for authorization_code flow`);l=fS(i,await e.codeVerifier(),e.redirectUrl)}let u=await e.clientInformation({issuer:n?.issuer??String(t)});return pS(t,{metadata:n,tokenRequestParams:l,clientInformation:u??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:s})}async function gS(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:i}){let a;if(t){if(!t.registration_endpoint)throw Error(`Incompatible auth server: does not support dynamic client registration`);a=new URL(t.registration_endpoint)}else a=new URL(`/register`,e);let o={...n,...r===void 0?{}:{scope:r}},s=await(i??fetch)(a,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(o)});if(!s.ok)throw new xx({status:s.status,body:await s.text(),submittedMetadata:o});return cv.parse(await s.json())}var _S=new Set([`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`server/discover`]),vS=class{_entries=new Map;_maxEntries;_stamp=0;_cappedSize=0;constructor(e){this._maxEntries=e?.maxEntries??512}get size(){return this._entries.size}get(e){return this._entries.get(yS(e))}set(e,t){let n=yS(e),r=_S.has(e.method),i=!this._entries.has(n);if(!r&&i&&this._maxEntries>0&&this._cappedSize>=this._maxEntries){for(let e of this._entries.keys())if(!_S.has(e.slice(0,e.indexOf(`\0`)))){this._entries.delete(e),this._cappedSize--;break}}let a=++this._stamp;return this._entries.set(n,{...t,stamp:a}),i&&!r&&this._cappedSize++,a}delete(e){this._entries.delete(yS(e))&&!_S.has(e.method)&&this._cappedSize--}evict(e){let t=`${e}\0`,n=_S.has(e);for(let e of this._entries.keys())e.startsWith(t)&&(this._entries.delete(e),n||this._cappedSize--)}clear(){this._entries.clear(),this._cappedSize=0}};function yS(e){return`${e.method}\0${JSON.stringify([e.partition??``,e.params??``])}`}function bS(e,t){return t===void 0?e:`${e}\0${t}`}var xS=864e5,SS=class{_evictionGeneration=new Map;_toolIndex;_toolOutputValidatorIndex;_serverIdentity=``;constructor(e,t,n=()=>{},r=``,i=Date.now){this._store=e,this._isUserSupplied=t,this._reportError=n,this._cachePartition=r,this._now=i}now(){return this._now()}setServerIdentity(e){this._serverIdentity=e}_partitionFor(e){return JSON.stringify([this._serverIdentity,e===`public`?``:this._cachePartition])}async _probe(e,t){let n={method:e,params:t??``},r=this._partitionFor(`private`),i=await this._store.get({...n,partition:r});if(i!==void 0)return i;let a=this._partitionFor(`public`);if(a===r)return;let o=await this._store.get({...n,partition:a});return o?.scope===`public`?o:void 0}async evict(e){this._evictionGeneration.set(e,(this._evictionGeneration.get(e)??0)+1),await this._deleteBoth(e,``)}async _deleteBoth(e,t){let n=this._partitionFor(`private`),r=this._partitionFor(`public`);try{await this._store.delete({method:e,params:t,partition:n})}catch(e){this._reportError(e)}if(r!==n)try{await this._store.delete({method:e,params:t,partition:r})}catch(e){this._reportError(e)}}async evictKey(e,t){let n=bS(e,t),r=this._evictionGeneration.get(n);r!==void 0&&this._evictionGeneration.set(n,r+1),await this._deleteBoth(e,t)}captureGeneration(e,t){let n=bS(e,t),r=this._evictionGeneration.get(n)??0;return this._evictionGeneration.set(n,r),r}async write(e,t,n,r){if((this._evictionGeneration.get(bS(e,r?.params))??0)!==n)return;let i=r?.params??``,a=this._partitionFor(`private`),o=this._partitionFor(`public`),s=(r?.scope??`private`)===`public`?o:a;try{await this._store.set({method:e,params:i,partition:s},{value:CS(t),expiresAt:r?.expiresAt,scope:r?.scope})}catch(e){this._reportError(e)}if(o!==a)try{await this._store.delete({method:e,params:i,partition:s===a?o:a})}catch(e){this._reportError(e)}}async read(e,t){let n=await this._probe(e,t);if(!(n?.expiresAt===void 0||!(n.expiresAt>this.now())))try{let e=JSON.parse(n.value);if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`cached document is not an object`);return{value:e}}catch(n){this._reportError(n),await this._deleteBoth(e,t??``);return}}resetForReconnect(){this._isUserSupplied||this._store.clear(),this._evictionGeneration.clear(),this._toolIndex=void 0,this._toolOutputValidatorIndex=void 0,this._serverIdentity=``}async toolDefinition(e){let t=await this._probe(`tools/list`);if(t===void 0){this._toolIndex=void 0;return}if(this._toolIndex?.stamp!==t.stamp){let e=this._decodeListTools(t),n=new Map;if(e!==void 0)for(let t of e.tools)n.set(t.name,t);this._toolIndex={stamp:t.stamp,byName:n}}return this._toolIndex.byName.get(e)}async outputValidator(e,t){let n=await this._probe(`tools/list`);if(n===void 0){this._toolOutputValidatorIndex=void 0;return}if(this._toolOutputValidatorIndex?.stamp!==n.stamp){let e=this._decodeListTools(n)??{tools:[]},r=new Map;for(let n of e.tools){let e=t(n);e!==void 0&&r.set(n.name,e)}this._toolOutputValidatorIndex={stamp:n.stamp,byName:r}}return this._toolOutputValidatorIndex.byName.get(e)}_decodeListTools(e){try{let t=JSON.parse(e.value);if(!Array.isArray(t?.tools)||!t.tools.every(e=>typeof e==`object`&&!!e))throw TypeError(`cached tools/list document has a malformed tools array`);return t}catch(e){this._reportError(e);return}}};function CS(e){let t;try{t=JSON.stringify(e)}catch(e){throw TypeError(`cache value is not JSON-serializable: ${e instanceof Error?e.message:String(e)}`)}if(typeof t!=`string`)throw TypeError(`cache value is not JSON-serializable: it has no JSON representation`);return t}var wS=Symbol.for(`mcp.authSeamEscape`);function TS(e){if(typeof e==`object`&&e||typeof e==`function`)try{Object.defineProperty(e,wS,{value:!0,configurable:!0})}catch{}return e}function ES(e){return(typeof e==`object`&&!!e||typeof e==`function`)&&e[wS]===!0}var DS=-32022,OS=new Set([-32001,-32020,-32021]);function kS(e,t){switch(e.kind){case`result`:return AS(e.result,t);case`rpc-error`:return jS(e,t);case`http-error`:return MS(e,t);case`network-error`:return NS(e.error,t);case`auth-required`:return{kind:`error`,error:e.error};case`closed`:return t.transportKind===`stdio`?{kind:`legacy`}:NS(Error(`Connection closed during the version negotiation probe`),t);case`timeout`:return t.transportKind===`stdio`?{kind:`legacy`}:{kind:`error`,error:new _v(gv.RequestTimeout,`Version negotiation probe timed out after ${e.timeoutMs}ms`,{timeout:e.timeoutMs})}}}function AS(e,t){let n=zy(Ry).validateResult(`server/discover`,e);if(!n.ok)return{kind:`legacy`};let r=n.value.supportedVersions,i=t.clientModernVersions.find(e=>r.includes(e));return i===void 0?t.fallbackAvailable?{kind:`legacy`}:{kind:`error`,error:new iy({supported:[...r],requested:t.requestedVersion})}:{kind:`modern`,version:i,discover:n.value}}function jS(e,t){let{code:n,message:r,data:i}=e;if(n===DS){let e=IS(i);if(e===void 0)return{kind:`legacy`};let n=new iy({supported:e,requested:LS(i)??t.requestedVersion},r),a=Cv(e),o=t.clientModernVersions.find(e=>a.includes(e));return o===void 0?a.length>0?{kind:`error`,error:n}:t.fallbackAvailable?{kind:`legacy`}:{kind:`error`,error:n}:{kind:`corrective`,version:o,error:n}}return OS.has(n),{kind:`legacy`}}function MS(e,t){if(e.status===401||e.status===403){let t=e.status===403;return{kind:`error`,error:new vv(t?gv.ClientHttpForbidden:gv.ClientHttpAuthentication,`Version negotiation failed: ${t?`the server denied access (HTTP 403)`:`the server requires authorization (HTTP 401)`}`,{status:e.status,statusText:e.statusText,text:e.body})}}if(e.status>=500)return{kind:`error`,error:new vv(gv.EraNegotiationFailed,`Version negotiation failed: the server answered the probe with HTTP ${e.status}`,{status:e.status,statusText:e.statusText,text:e.body})};let n=RS(e.body);return n===void 0?{kind:`legacy`}:jS(n,t)}function NS(e,t){return t.environment===`browser`&&PS(e)?{kind:`legacy`}:{kind:`error`,error:new _v(gv.EraNegotiationFailed,`Version negotiation probe failed: ${FS(e)}`,{cause:e})}}function PS(e){return e instanceof TypeError||e instanceof Error&&e.name===`TypeError`}function FS(e){return e instanceof Error?e.message:String(e)}function IS(e){if(typeof e!=`object`||!e)return;let t=e.supported;if(!(!Array.isArray(t)||t.length===0||!t.every(e=>typeof e==`string`)))return t}function LS(e){if(typeof e!=`object`||!e)return;let t=e.requested;return typeof t==`string`?t:void 0}function RS(e){if(e===void 0||e===``)return;let t;try{t=JSON.parse(e)}catch{return}if(typeof t!=`object`||!t)return;let n=t.error;if(typeof n!=`object`||!n)return;let{code:r,message:i,data:a}=n;if(typeof r==`number`)return{code:r,message:typeof i==`string`?i:``,data:a}}var zS=`legacy`;function BS(e,t){let n=e?.mode??zS;if(n===`legacy`)return{kind:`legacy`};let r=e?.probe??{};if(typeof n==`object`){if(!xv(n.pin))throw TypeError(`versionNegotiation: { pin: '${n.pin}' } is not a modern protocol revision — pinning is for 2026-07-28 and later; omit versionNegotiation (or use mode: 'legacy') for 2025-era servers.`);return{kind:`pin`,version:n.pin,probe:r}}let i=t?Cv(t):[];return{kind:`auto`,modernVersions:i.length>0?i:[...bv],fallbackAvailable:!t||Sv(t).length>0,probe:r}}function VS(){let e=globalThis;return e.window!==void 0&&e.document!==void 0?`browser`:`node`}function HS(e){return`stderr`in e&&`pid`in e?`stdio`:`http`}var US=class e{_pending;_probeCounter=0;_savedOnMessage;_savedOnError;_savedOnClose;_closeDelivered=!1;constructor(e){this._transport=e,this._savedOnMessage=e.onmessage,this._savedOnError=e.onerror,this._savedOnClose=e.onclose}static async open(t){let n=new e(t);t.onmessage=e=>{let t=n._pending;if(t!==void 0&&(qy(e)||Jy(e))&&e.id===t.id){n._pending=void 0,qy(e)?t.resolve({kind:`response`,result:e.result}):t.resolve({kind:`response`,error:e.error});return}},t.onerror=e=>{n._savedOnError?.(e)},t.onclose=()=>{let e=n._pending;e!==void 0&&(n._pending=void 0,e.resolve({kind:`closed`})),n._closeDelivered=!0,n._savedOnClose?.()};try{await t.start()}catch(e){throw n.detach(),e}return n}async exchange(e,t){let n=`server-discover-probe-${++this._probeCounter}`;return new Promise(r=>{let i=!1,a=e=>{i||(i=!0,clearTimeout(o),this._pending?.id===n&&(this._pending=void 0),r(e))},o=setTimeout(()=>a({kind:`timeout`}),t);this._pending={id:n,resolve:a},this._transport.send(e(n)).catch(e=>a({kind:`send-error`,error:e}))})}detach(){if(this._pending=void 0,this._transport.onmessage=this._savedOnMessage,this._transport.onerror=this._savedOnError,this._closeDelivered&&this._savedOnClose!==void 0){let e=this._savedOnClose,t=this._transport,n=!1,r=()=>{if(!n){n=!0;return}e()};t.onclose=r,WS.set(t,()=>{t.onclose===r&&(t.onclose=e)})}else this._transport.onclose=this._savedOnClose}release(){this.detach();let e=this._transport,t=e.start,n=!0;e.start=async function(){if(n){n=!1,e.start=t;return}return t.call(e)}}},WS=new WeakMap;function GS(e){let t=WS.get(e);WS.delete(e),t?.()}function KS(e,t,n,r){return{jsonrpc:`2.0`,id:e,method:`server/discover`,params:{_meta:zy(t).outboundEnvelope({protocolVersion:t,clientInfo:n,clientCapabilities:r})}}}function qS(e,t){switch(e.kind){case`response`:return e.error===void 0?{kind:`result`,result:e.result}:{kind:`rpc-error`,...e.error};case`send-error`:{let t=e.error;if(ES(t)||t instanceof Ax||t instanceof Error&&t.name===`UnauthorizedError`)return{kind:`auth-required`,error:t};if(t instanceof vv){let e=t.data?.text;return{kind:`http-error`,status:t.data.status,body:typeof e==`string`?e:void 0,statusText:t.data.statusText}}return{kind:`network-error`,error:t}}case`closed`:return{kind:`closed`};case`timeout`:return{kind:`timeout`,timeoutMs:t}}}async function JS(e,t){let n=e.probe.timeoutMs??t.defaultTimeoutMs,r=Math.max(0,e.probe.maxRetries??0),i=e.kind===`pin`?[e.version]:e.modernVersions,a=e.kind===`auto`&&e.fallbackAvailable,o=await US.open(t.transport),s=async()=>{let s=i[0],c=!1,l=r;for(;;){let r=await o.exchange(e=>KS(e,s,t.clientInfo,t.capabilities),n);if(r.kind===`timeout`&&l>0){l--;continue}let u=qS(r,n),d=kS(u,{clientModernVersions:i,requestedVersion:s,fallbackAvailable:a,environment:t.environment,transportKind:t.transportKind});switch(d.kind){case`modern`:return{era:`modern`,version:d.version,discover:d.discover};case`corrective`:if(c)throw d.error;c=!0,s=d.version;continue;case`legacy`:{let n=u.kind===`closed`?`the connection closed during the server/discover probe`:void 0;if(e.kind===`pin`)throw new _v(gv.EraNegotiationFailed,n===void 0?`Version negotiation failed: the server did not offer pinned protocol version ${e.version} via server/discover (no fallback in pin mode)`:`Version negotiation failed: ${n} before the server offered pinned protocol version ${e.version} (no fallback in pin mode)`);if(!e.fallbackAvailable)throw new _v(gv.EraNegotiationFailed,n===void 0?`Version negotiation failed: the server gave no modern evidence and this client supports no pre-2026-07-28 protocol version to fall back to`:`Version negotiation failed: ${n} and this client supports no pre-2026-07-28 protocol version to fall back to`);if(n!==void 0&&t.disposableProbe!==!0)throw new _v(gv.EraNegotiationFailed,`Version negotiation failed: ${n} (this transport probed in place — the disposable sibling probe requires the SDK's base StdioClientTransport)`);return{era:`legacy`}}case`error`:throw d.error}}},c;try{c=await s()}catch(e){throw o.detach(),e}return o.release(),c}function YS(e){let t=Object.getPrototypeOf(e);if(t===null||!Object.prototype.hasOwnProperty.call(t,`_dispose`))return;let n=e._serverParams;return typeof n==`object`&&n&&typeof n.command==`string`?n:void 0}async function XS(e,t,n,r){let i=t.constructor,a=new i({...n,stderr:`ignore`}),o=t.close,s=!1,c,l=new Promise((e,t)=>{c=()=>t(ZS())});t.close=async function(){return s=!0,c?.(),o.call(t)};let u;try{let t=JS(e,{...r,transport:a,transportKind:`stdio`,disposableProbe:!0});t.catch(()=>{}),u=await Promise.race([t,l])}finally{await QS(a),t.close=o}if(s)throw ZS();return u}function ZS(){return new _v(gv.EraNegotiationFailed,`Version negotiation failed: the transport was closed during the server/discover probe`)}async function QS(e){try{let t=e._dispose;await(typeof t==`function`?t.call(e):e.close())}catch{}}function $S(e){let t=e._meta?.[Um];return pte.Implementation(t)?t:void 0}function eC(e,t){if(!(!e||typeof t!=`object`||!t)){if(e.type===`object`&&e.properties&&typeof e.properties==`object`){let n=t,r=e.properties;for(let e of Object.keys(r)){let t=r[e];n[e]===void 0&&Object.prototype.hasOwnProperty.call(t,`default`)&&(n[e]=t.default),n[e]!==void 0&&eC(t,n[e])}}if(Array.isArray(e.anyOf))for(let n of e.anyOf)typeof n!=`boolean`&&eC(n,t);if(Array.isArray(e.oneOf))for(let n of e.oneOf)typeof n!=`boolean`&&eC(n,t)}}function tC(e){if(!e)return{supportsFormMode:!1,supportsUrlMode:!1};let t=e.form!==void 0,n=e.url!==void 0;return{supportsFormMode:t||!t&&!n,supportsUrlMode:n}}function nC(e){if(typeof e==`object`&&e&&(e.kind===`legacy`&&!(`supportedVersions`in e)&&!(`discover`in e)||e.kind===`modern`&&jh.safeParse(e.discover).success))return e;throw new _v(gv.EraNegotiationFailed,`connect({ prior }): unrecognized prior — expected { kind: 'modern', discover } or { kind: 'legacy' }`)}var rC={"notifications/tools/list_changed":[`tools/list`],"notifications/prompts/list_changed":[`prompts/list`],"notifications/resources/list_changed":[`resources/list`,`resources/templates/list`]},iC=64,aC=class extends vte{_serverCapabilities;_serverVersion;_capabilities;_instructions;_jsonSchemaValidator;_cache;_defaultCacheTtlMs;_listMaxPages;_listChangedDebounceTimers=new Map;_listChangedConfig;_enforceStrictCapabilities;_versionNegotiation;_supportedProtocolVersionsOption;_inputRequiredDriverConfig;_listenState=new Map;_nextListenId=0;_autoOpenedSubscription;_discoverResult;_resetConnectionState(){if(this._negotiatedProtocolVersion=void 0,this._serverCapabilities=void 0,this._serverVersion=void 0,this._instructions=void 0,this._discoverResult=void 0,this._autoOpenedSubscription=void 0,this._listenState.size>0){let e=new _v(gv.ConnectionClosed,`subscriptions/listen: client reconnected or closed; subscription state from the previous connection was reset`);for(let t of this._listenState.values())t.settle({cause:`remote`,error:e})}this._listenState.clear();for(let e of this._listChangedDebounceTimers.values())clearTimeout(e);this._listChangedDebounceTimers.clear(),this._cache.resetForReconnect()}async close(){try{await super.close()}finally{this._resetConnectionState()}}constructor(e,t){super(t),this._clientInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new sx,this._enforceStrictCapabilities=t?.enforceStrictCapabilities??!1,this._versionNegotiation=t?.versionNegotiation,this._supportedProtocolVersionsOption=t?.supportedProtocolVersions,this._inputRequiredDriverConfig=ate(t?.inputRequired),this._cache=new SS(t?.responseCacheStore??new vS,t?.responseCacheStore!==void 0,e=>this._reportStoreError(e),t?.cachePartition??``),this._defaultCacheTtlMs=t?.defaultCacheTtlMs??0,this._listMaxPages=t?.listMaxPages??iC,t?.listChanged&&(this._listChangedConfig=t.listChanged)}buildContext(e,t){return e}_shouldDropInbound(e){if(this._negotiatedProtocolVersion!==void 0&&xv(this._negotiatedProtocolVersion)&&Gy(e))return`drop`}_outboundMetaEnvelope(){let e=this._negotiatedProtocolVersion;if(e!==void 0)return this._wireCodec().outboundEnvelope({protocolVersion:e,clientInfo:this._clientInfo,clientCapabilities:this._capabilities})}_resolveNonCompleteResult(e,t){return this._inputRequiredDriverConfig.autoFulfill?wte({getRequestHandler:e=>this._getRequestHandler(e),buildContext:e=>this.buildContext(e,void 0),sessionId:this.transport?.sessionId},this._inputRequiredDriverConfig,e,t):Promise.reject(new _v(gv.UnsupportedResultType,`Unsupported result type 'input_required' for ${t.request.method}: multi-round-trip auto-fulfilment is not enabled on this instance — pass allowInputRequired: true to handle it manually, or enable inputRequired.autoFulfill`,{resultType:`input_required`,method:t.request.method}))}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler(`tools`,`notifications/tools/list_changed`,e.tools,async()=>(await this.listTools(void 0,{cacheMode:`refresh`})).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler(`prompts`,`notifications/prompts/list_changed`,e.prompts,async()=>(await this.listPrompts(void 0,{cacheMode:`refresh`})).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler(`resources`,`notifications/resources/list_changed`,e.resources,async()=>(await this.listResources(void 0,{cacheMode:`refresh`})).resources)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after connecting to transport`);this._capabilities=yte(this._capabilities,e)}setVersionNegotiation(e){if(this.transport)throw Error(`Cannot configure version negotiation after connecting to transport`);this._versionNegotiation=e}_wrapHandler(e,t){return e===`elicitation/create`?async(e,n)=>{let r=zy(this._negotiatedProtocolVersion),i=r.validateRequest(`elicitation/create`,e);if(!i.ok&&i.reason===`not-in-era`&&(i=r.validateInputRequest(`elicitation/create`,e)),!i.ok)throw new ty(i.reason===`not-in-era`?ey.InternalError:ey.InvalidParams,i.reason===`not-in-era`?`No wire schema for elicitation/create in the resolved era`:`Invalid elicitation request: ${i.message}`);let{params:a}=i.value;a.mode=a.mode??`form`;let{supportsFormMode:o,supportsUrlMode:s}=tC(this._capabilities.elicitation);if(a.mode===`form`&&!o)throw new ty(ey.InvalidParams,`Client does not support form-mode elicitation requests`);if(a.mode===`url`&&!s)throw new ty(ey.InvalidParams,`Client does not support URL-mode elicitation requests`);let c=await t(e,n),l=r.validateResult(`elicitation/create`,c);if(!l.ok&&l.reason===`not-in-era`&&(l=r.validateInputResponse(`elicitation/create`,c)),!l.ok)throw new ty(l.reason===`not-in-era`?ey.InternalError:ey.InvalidParams,l.reason===`not-in-era`?`No wire schema for elicitation/create in the resolved era`:`Invalid elicitation result: ${l.message}`);let u=l.value,d=a.mode===`form`?a.requestedSchema:void 0;if(a.mode===`form`&&u.action===`accept`&&u.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{eC(d,u.content)}catch{}return u}:e===`sampling/createMessage`?async(e,n)=>{let r=zy(this._negotiatedProtocolVersion),i=r.validateRequest(`sampling/createMessage`,e);if(!i.ok&&i.reason===`not-in-era`&&(i=r.validateInputRequest(`sampling/createMessage`,e)),!i.ok)throw new ty(i.reason===`not-in-era`?ey.InternalError:ey.InvalidParams,i.reason===`not-in-era`?`No wire schema for sampling/createMessage in the resolved era`:`Invalid sampling request: ${i.message}`);let{params:a}=i.value,o=await t(e,n),s=!!(a.tools||a.toolChoice),c=r.samplingResultVariant(s,o);if(!c.ok&&c.reason===`not-in-era`&&(c=r.validateInputResponse(`sampling/createMessage`,o)),!c.ok)throw new ty(c.reason===`not-in-era`?ey.InternalError:ey.InvalidParams,c.reason===`not-in-era`?`No result schema for sampling/createMessage in the resolved era`:`Invalid sampling result: ${c.message}`);return c.value}:t}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new _v(gv.CapabilityNotSupported,`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(t?.prior!=null)return this._connectFromPrior(e,nC(t.prior),t);let n=BS(this._versionNegotiation,this._supportedProtocolVersionsOption);return n.kind===`legacy`?this._connectPlainLegacy(e,t):this._connectNegotiated(e,n,t)}async _connectPlainLegacy(e,t){if(await super.connect(e),e.sessionId!==void 0){let t=this._negotiatedProtocolVersion;t!==void 0&&e.setProtocolVersion?.(t);return}this._resetConnectionState(),await this._legacyHandshake(e,t)}async _legacyHandshake(e,t){let n=Sv(this._supportedProtocolVersions);try{let r=n[0];if(r===void 0)throw new _v(gv.EraNegotiationFailed,`Cannot run the initialize handshake: supportedProtocolVersions contains no pre-2026-07-28 protocol version`);let i=await this.request({method:`initialize`,params:{protocolVersion:r,capabilities:this._capabilities,clientInfo:this._clientInfo}},t);if(i===void 0)throw Error(`Server sent invalid initialize result: ${i}`);if(!n.includes(i.protocolVersion))throw Error(`Server's protocol version is not supported: ${i.protocolVersion}`);this._serverCapabilities=i.capabilities,this._serverVersion=i.serverInfo,this._cache.setServerIdentity(this._deriveServerIdentity(e)),e.setProtocolVersion&&e.setProtocolVersion(i.protocolVersion),this._instructions=i.instructions,await this.notification({method:`notifications/initialized`}),this._negotiatedProtocolVersion=i.protocolVersion,this._listChangedConfig&&this._setupListChangedHandlers(this._listChangedConfig)}catch(e){throw this.close(),e}}async _connectNegotiated(e,t,n){if(e.sessionId!==void 0){await super.connect(e);let t=this._negotiatedProtocolVersion;t!==void 0&&e.setProtocolVersion&&e.setProtocolVersion(t);return}this._resetConnectionState();let r;try{let i=HS(e),a={clientInfo:this._clientInfo,capabilities:this._capabilities,environment:VS(),defaultTimeoutMs:n?.timeout??6e4},o=i===`stdio`?YS(e):void 0;r=o===void 0?await JS(t,{...a,transport:e,transportKind:i}):await XS(t,e,o,a)}catch(t){throw await e.close().catch(()=>{}),GS(e),t}if(GS(e),await super.connect(e),r.era===`legacy`){await this._legacyHandshake(e,n);return}if(this._serverCapabilities=r.discover.capabilities,this._serverVersion=$S(r.discover),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=r.discover.instructions,this._discoverResult=r.discover,this._negotiatedProtocolVersion=r.version,e.setProtocolVersion&&e.setProtocolVersion(r.version),this._listChangedConfig){let e=this._listChangedConfig,t=this._serverCapabilities,r={...e.tools&&t?.tools?.listChanged&&{tools:e.tools},...e.prompts&&t?.prompts?.listChanged&&{prompts:e.prompts},...e.resources&&t?.resources?.listChanged&&{resources:e.resources}},i=!0;try{this._setupListChangedHandlers(r)}catch(e){i=!1,this.onerror?.(e instanceof Error?e:Error(String(e)))}let a=i?{...r.tools&&{toolsListChanged:!0},...r.prompts&&{promptsListChanged:!0},...r.resources&&{resourcesListChanged:!0}}:{};if(Object.keys(a).length>0){let e=new AbortController,t=()=>e.abort(n?.signal?.reason);n?.signal?.aborted&&t(),n?.signal?.addEventListener(`abort`,t);try{this._autoOpenedSubscription=await this.listen(a,{timeout:n?.timeout,signal:e.signal})}catch(e){if(n?.signal?.aborted)throw await this.close().catch(()=>{}),e;this.onerror?.(e instanceof Error?e:Error(String(e)))}finally{n?.signal?.removeEventListener(`abort`,t)}}}}async _connectFromPrior(e,t,n){if(t.kind===`legacy`)return this._connectPlainLegacy(e,n);let r=t.discover;this._resetConnectionState();let i=this._supportedProtocolVersionsOption,a=(i&&Cv(i).length>0?Cv(i):bv).find(e=>r.supportedVersions.includes(e));if(a===void 0)throw new _v(gv.EraNegotiationFailed,`connect({ prior }) with a modern verdict requires a 2026-07-28+ mutual protocol version; the supplied DiscoverResult and this client's supportedProtocolVersions have no modern overlap. For a server known to be legacy, pass prior: { kind: 'legacy' } to skip the probe and initialize directly, or use versionNegotiation: { mode: 'auto' } to re-probe with legacy fallback.`);if(await super.connect(e),this._discoverResult=r,this._serverCapabilities=r.capabilities,this._serverVersion=$S(r),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=r.instructions,this._negotiatedProtocolVersion=a,e.setProtocolVersion?.(a),this._listChangedConfig)try{this._setupListChangedHandlers(this._listChangedConfig)}catch(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}_deriveServerIdentity(e){let t=this._serverVersion;return t===void 0?e.sessionId??`anonymous:${Date.now()}-${Math.random().toString(36).slice(2)}`:`${t.name}@${t.version}`}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}getProtocolEra(){let e=this._negotiatedProtocolVersion;if(e!==void 0)return xv(e)?`modern`:`legacy`}getInstructions(){return this._instructions}getDiscoverResult(){return this._discoverResult}assertCapabilityForMethod(e){switch(e){case`logging/setLevel`:if(!this._serverCapabilities?.logging)throw new _v(gv.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case`prompts/get`:case`prompts/list`:if(!this._serverCapabilities?.prompts)throw new _v(gv.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case`resources/list`:case`resources/templates/list`:case`resources/read`:case`resources/subscribe`:case`resources/unsubscribe`:if(!this._serverCapabilities?.resources)throw new _v(gv.CapabilityNotSupported,`Server does not support resources (required for ${e})`);if(e===`resources/subscribe`&&!this._serverCapabilities.resources.subscribe)throw new _v(gv.CapabilityNotSupported,`Server does not support resource subscriptions (required for ${e})`);break;case`tools/call`:case`tools/list`:if(!this._serverCapabilities?.tools)throw new _v(gv.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case`completion/complete`:if(!this._serverCapabilities?.completions)throw new _v(gv.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case`initialize`:break;case`server/discover`:break;case`ping`:break}}assertNotificationCapability(e){switch(e){case`notifications/roots/list_changed`:if(!this._capabilities.roots?.listChanged)throw new _v(gv.CapabilityNotSupported,`Client does not support roots list changed notifications (required for ${e})`);break;case`notifications/initialized`:break;case`notifications/cancelled`:break;case`notifications/progress`:break}}assertRequestHandlerCapability(e){switch(e){case`sampling/createMessage`:if(!this._capabilities.sampling)throw new _v(gv.CapabilityNotSupported,`Client does not support sampling capability (required for ${e})`);break;case`elicitation/create`:if(!this._capabilities.elicitation)throw new _v(gv.CapabilityNotSupported,`Client does not support elicitation capability (required for ${e})`);break;case`roots/list`:if(!this._capabilities.roots)throw new _v(gv.CapabilityNotSupported,`Client does not support roots capability (required for ${e})`);break;case`ping`:break}}async ping(e){return this.request({method:`ping`},e)}async discover(e){let t=await this._requestWithSchema({method:`server/discover`},jh,e);return this._discoverResult=t,t}async complete(e,t){return this.request({method:`completion/complete`,params:e},t)}async setLoggingLevel(e,t){return this.request({method:`logging/setLevel`,params:{level:e}},t)}async getPrompt(e,t){return this.request({method:`prompts/get`,params:e},t)}async listPrompts(e,t){if(!this._serverCapabilities?.prompts&&!this._enforceStrictCapabilities)return console.debug(`Client.listPrompts() called but server does not advertise prompts capability - returning empty list`),{prompts:[]};if(e?.cursor!==void 0)return this.request({method:`prompts/list`,params:e},t);let n=await this._serveFromCache(`prompts/list`,void 0,t);return n===void 0?this._listAllPages(`prompts/list`,e,t,(e,t)=>e.prompts.push(...t.prompts)):n}async listResources(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug(`Client.listResources() called but server does not advertise resources capability - returning empty list`),{resources:[]};if(e?.cursor!==void 0)return this.request({method:`resources/list`,params:e},t);let n=await this._serveFromCache(`resources/list`,void 0,t);return n===void 0?this._listAllPages(`resources/list`,e,t,(e,t)=>e.resources.push(...t.resources)):n}async listResourceTemplates(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug(`Client.listResourceTemplates() called but server does not advertise resources capability - returning empty list`),{resourceTemplates:[]};if(e?.cursor!==void 0)return this.request({method:`resources/templates/list`,params:e},t);let n=await this._serveFromCache(`resources/templates/list`,void 0,t);return n===void 0?this._listAllPages(`resources/templates/list`,e,t,(e,t)=>e.resourceTemplates.push(...t.resourceTemplates)):n}async _listAllPages(e,t,n,r,i){let a=n?.cacheMode===`bypass`,o=this._cache.captureGeneration(e),s=await this.request({method:e,...t&&{params:{...t}}},n),c=s.nextCursor,l=new Set,u=1;for(;c!==void 0&&!l.has(c);){if(this._listMaxPages!==0&&u>=this._listMaxPages)throw new _v(gv.ListPaginationExceeded,`${e}: exceeded listMaxPages (${this._listMaxPages}); server pagination did not terminate`,{method:e,listMaxPages:this._listMaxPages});l.add(c);let i=await this.request({method:e,params:{...t,cursor:c}},n);r(s,i),c=i.nextCursor,u++}return delete s.nextCursor,i?.(s),a||await this._cache.write(e,s,o,this._freshness(s)),s}_freshness(e,t){let n=e,r=typeof n.ttlMs==`number`?n.ttlMs:this._defaultCacheTtlMs,i=n.cacheScope===`public`?`public`:`private`;return{expiresAt:this._cache.now()+Math.min(Math.max(0,r),xS),scope:i,params:t}}async _serveFromCache(e,t,n){if(n?.cacheMode===`bypass`||n?.cacheMode===`refresh`)return;let r=await this._cache.read(e,t).catch(e=>void this._reportStoreError(e));if(r!==void 0){if(n?.signal?.aborted){let e=n.signal.reason;throw e instanceof _v?e:new _v(gv.RequestTimeout,String(e))}return r.value}}_reportStoreError(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}_compileOutputValidator(e){if(e.outputSchema)try{return{ok:!0,validator:this._jsonSchemaValidator.getValidator(e.outputSchema)}}catch(e){return{ok:!1,compileError:e}}}async _resolveXMcpHeaderScan(e,t){let n=t??await this._cache.toolDefinition(e);return n===void 0?void 0:Zy(n.inputSchema)}async readResource(e,t){let n=await this._serveFromCache(`resources/read`,e.uri,t);if(n!==void 0)return n;let r=this._cache.captureGeneration(`resources/read`,e.uri),i=await this.request({method:`resources/read`,params:e},t);if(t?.cacheMode!==`bypass`){let n=this._freshness(i,e.uri);n.expiresAt>this._cache.now()?await this._cache.write(`resources/read`,i,r,n):t?.cacheMode===`refresh`&&await this._cache.evictKey(`resources/read`,e.uri)}return i}async subscribeResource(e,t){return this.request({method:`resources/subscribe`,params:e},t)}async unsubscribeResource(e,t){return this.request({method:`resources/unsubscribe`,params:e},t)}async listen(e,t){if(this.transport===void 0)throw new _v(gv.NotConnected,`Not connected`);let n=this._negotiatedProtocolVersion;if(n===void 0||!xv(n))throw new _v(gv.MethodNotSupportedByProtocolVersion,`subscriptions/listen requires a 2026-07-28-era connection (negotiated: ${n??`none`}). On a 2025-era connection, change notifications are delivered unsolicited: use ClientOptions.listChanged and resources/subscribe instead.`,{method:`subscriptions/listen`,protocolVersion:n});if(t?.signal?.aborted){let e=t.signal.reason;throw e instanceof _v?e:new _v(gv.RequestTimeout,String(e))}let r=new AbortController,i=`listen:${this._nextListenId++}`,a=`opening`,o,s,c,l,u=new Promise((e,t)=>{c=e,l=t}),d,f=new Promise(e=>{d=e}),p=e=>{if(a===`closed`)return;let n=a===`opening`;if(o!==void 0&&(clearTimeout(o),o=void 0),`ack`in e){a=`open`,c(e.ack);return}a=`closed`,s!==void 0&&t?.signal?.removeEventListener(`abort`,s),this._listenState.delete(i),r.abort(),d(e.cause),n&&l(e.error??new _v(gv.ConnectionClosed,`subscriptions/listen closed before the server acknowledged`))},m=async()=>{r.abort(),await this.notification({method:`notifications/cancelled`,params:{requestId:i}}).catch(()=>{})},h=async()=>{a!==`closed`&&(p({cause:`local`}),await m())};this._listenState.set(i,{settle:p});let g=t?.timeout??6e4;if(o=setTimeout(()=>{p({cause:`remote`,error:new _v(gv.RequestTimeout,`subscriptions/listen ack timed out`,{timeout:g})}),m().catch(()=>{})},g),t?.signal){let e=t.signal;s=()=>{if(a===`closed`)return;let t=e.reason;p({cause:`local`,error:t instanceof Error?t:Error(String(t??`Aborted`))}),m().catch(()=>{})},e.addEventListener(`abort`,s,{once:!0})}let _={jsonrpc:`2.0`,id:i,method:`subscriptions/listen`,params:{_meta:{...this._outboundMetaEnvelope()},notifications:e}};try{await this.transport.send(_,{requestSignal:r.signal,onRequestStreamEnd:()=>p({cause:`remote`,error:Error(`subscriptions/listen: stream ended`)})})}catch(e){p({cause:`remote`,error:e instanceof Error?e:Error(String(e))})}return{honoredFilter:await u,close:h,closed:f}}get autoOpenedSubscription(){return this._autoOpenedSubscription}_onnotification(e,t){let n=Object.hasOwn(rC,e.method)?rC[e.method]:void 0;if(e.method===`notifications/resources/updated`){let t=e.params?.uri;typeof t==`string`&&this._cache.evictKey(`resources/read`,t)}else if(n!==void 0)for(let e of n)this._cache.evict(e);if(e.method===`notifications/subscriptions/acknowledged`){let t=e.params?._meta?.[Gm],n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){let t=this._wireCodec().validateNotification(`notifications/subscriptions/acknowledged`,e);n.settle({ack:t.ok?t.value.params.notifications:{}});return}}if(e.method===`notifications/cancelled`){let t=e.params?.requestId,n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){n.settle({cause:`remote`,error:Error(`subscriptions/listen: server cancelled the subscription`)});return}}super._onnotification(e,t)}_onresponse(e){let t=e.id,n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){Jy(e)?n.settle({cause:`remote`,error:ty.fromError(e.error.code,e.error.message,e.error.data)}):n.settle({cause:`graceful`,error:new _v(gv.ConnectionClosed,`subscriptions/listen: server closed the subscription gracefully before acknowledging`)});return}super._onresponse(e)}_onclose(){if(this._listenState.size>0){let e=new _v(gv.ConnectionClosed,`Connection closed`);for(let t of this._listenState.values())t.settle({cause:`remote`,error:e});this._listenState.clear()}super._onclose()}async callTool(e,t){let n=this.getProtocolEra()===`modern`&&VS()!==`browser`,r=async()=>{if(!n)return t;let r;try{r=await this._resolveXMcpHeaderScan(e.name,t?.toolDefinition)}catch(e){this._reportStoreError(e)}if(!r?.valid||r.declarations.length===0)return t;let i=zee(r.declarations,e.arguments);return Object.keys(i).length===0?t:{...t,headers:{...t?.headers,...i}}},i=t?.toolDefinition===void 0?await this._cache.outputValidator(e.name,e=>this._compileOutputValidator(e)).catch(e=>void this._reportStoreError(e)):this._compileOutputValidator(t.toolDefinition),a=()=>{if(i===void 0||i.ok)return;let t=i.compileError,n=(t instanceof Error?t.message:String(t)).slice(0,200);throw new ty(ey.InvalidParams,`Tool '${e.name}' has an invalid outputSchema: ${n}`)};a();let o;try{o=await this.request({method:`tools/call`,params:e},await r())}catch(s){let c=s instanceof ty&&s.code===-32020;if(!n||!c||t?.toolDefinition!==void 0)throw s;let l={signal:t?.signal,timeout:t?.timeout,cacheMode:`refresh`};await this._cache.evict(`tools/list`),await this.listTools(void 0,l).catch(e=>this._reportStoreError(e)),i=await this._cache.outputValidator(e.name,e=>this._compileOutputValidator(e)).catch(e=>void this._reportStoreError(e)),a(),o=await this.request({method:`tools/call`,params:e},await r())}let s=i!==void 0&&i.ok?i.validator:void 0;if(s){if(o.structuredContent===void 0&&!o.isError)throw new ty(ey.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent!==void 0&&!o.isError)try{let e=s(o.structuredContent);if(!e.valid)throw new ty(ey.InvalidParams,`Structured content does not match the tool's output schema: ${e.errorMessage}`)}catch(e){throw e instanceof ty?e:new ty(ey.InvalidParams,`Failed to validate structured content: ${e instanceof Error?e.message:String(e)}`)}}return o}async listTools(e,t){if(!this._serverCapabilities?.tools&&!this._enforceStrictCapabilities)return console.debug(`Client.listTools() called but server does not advertise tools capability - returning empty list`),{tools:[]};if(e?.cursor!==void 0){let n=await this.request({method:`tools/list`,params:e},t);return this._excludeInvalidXMcpHeaderTools(n),n}let n=await this._serveFromCache(`tools/list`,void 0,t);return n===void 0?this._listAllPages(`tools/list`,e,t,(e,t)=>e.tools.push(...t.tools),e=>this._excludeInvalidXMcpHeaderTools(e)):n}_excludeInvalidXMcpHeaderTools(e){if(this.getProtocolEra()!==`modern`||!this.transport||HS(this.transport)===`stdio`)return;let t=e.tools.filter(e=>{let t=Zy(e.inputSchema);return t.valid?!0:(console.warn(`[mcp-sdk] excluding tool '${e.name}' from tools/list: invalid x-mcp-header declaration — ${t.reason}`),!1)});t.length!==e.tools.length&&(e.tools=t)}_setupListChangedHandler(e,t,n,r){let i=nb(Bg,n);if(!i.success)throw Error(`Invalid ${e} listChanged options: ${i.error.message}`);if(typeof n.onChanged!=`function`)throw TypeError(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:a,debounceMs:o}=i.data,{onChanged:s}=n,c=async()=>{if(!a){s(null,null);return}try{s(null,await r())}catch(e){s(e instanceof Error?e:Error(String(e)),null)}};this.setNotificationHandler(t,()=>{if(o){let t=this._listChangedDebounceTimers.get(e);t&&clearTimeout(t);let n=setTimeout(c,o);this._listChangedDebounceTimers.set(e,n)}else c()})}async sendRootsListChanged(){return this.notification({method:`notifications/roots/list_changed`})}};(class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SseError`})}static[Symbol.hasInstance](e){return pv(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return pv(this,e)}constructor(e,t,n){super(`SSE error: ${t}`),this.code=e,this.event=n,fv(this,new.target)}});var oC=1,sC={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},cC=new Set([`authorization`,`content-type`,`mcp-protocol-version`,`mcp-method`,`mcp-name`,`mcp-session-id`]);function lC(e,t){if(typeof AbortSignal.any==`function`)return AbortSignal.any([e,t]);let n=new AbortController;if(e.aborted)return n.abort(e.reason),n.signal;if(t.aborted)return n.abort(t.reason),n.signal;let r=()=>{e.removeEventListener(`abort`,i),t.removeEventListener(`abort`,a)};function i(){r(),n.abort(e.reason)}function a(){r(),n.abort(t.reason)}return e.addEventListener(`abort`,i,{once:!0}),t.addEventListener(`abort`,a,{once:!0}),n.signal}var uC=class{_abortController;_url;_resourceMetadataUrl;_scope;_requestInit;_authProvider;_oauthProvider;_skipIssuerMetadataValidation;_fetch;_fetchWithInit;_sessionId;_reconnectionOptions;_protocolVersion;_onInsufficientScope;_maxStepUpRetries;_serverRetryMs;_reconnectionScheduler;_cancelReconnection;onclose;onerror;onmessage;hasPerRequestStream=!0;constructor(e,t){this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._skipIssuerMetadataValidation=t?.skipIssuerMetadataValidation,Dx(t?.authProvider)?(this._oauthProvider=t.authProvider,this._authProvider=kx(t.authProvider,{skipIssuerMetadataValidation:t.skipIssuerMetadataValidation})):this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=Ote(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._protocolVersion=t?.protocolVersion,this._reconnectionOptions=t?.reconnectionOptions??sC,this._reconnectionScheduler=t?.reconnectionScheduler,this._onInsufficientScope=t?.onInsufficientScope??`reauthorize`,this._maxStepUpRetries=Math.max(0,t?.maxStepUpRetries??oC)}async _stepUpAuthorize(e,t){try{return await this._stepUpAuthorizeInner(e,t)}catch(e){throw TS(e)}}async _stepUpAuthorizeInner(e,t){if(this._onInsufficientScope===`throw`||!this._oauthProvider)throw new wx({requiredScope:e.scope,resourceMetadataUrl:e.resourceMetadataUrl,errorDescription:e.errorDescription});if(t>=this._maxStepUpRetries)throw new vv(gv.ClientHttpForbidden,`Server returned 403 insufficient_scope after step-up re-authorization (retry limit ${this._maxStepUpRetries} reached)`,{status:403,statusText:e.statusText??`Forbidden`,text:e.text});e.resourceMetadataUrl&&(this._resourceMetadataUrl=e.resourceMetadataUrl);let n=await this._oauthProvider.tokens(),r=Nx(this._scope,n?.scope,e.scope);this._scope=r;let i=Px(r,n?.scope);return Yx(this._oauthProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:r,forceReauthorization:i,fetchFn:this._fetchWithInit,skipIssuerMetadataValidation:this._skipIssuerMetadataValidation})}async _commonHeaders(){let e={},t;try{t=await this._authProvider?.token()}catch(e){throw TS(e)}t&&(e.Authorization=`Bearer ${t}`),this._sessionId&&(e[`mcp-session-id`]=this._sessionId),this._protocolVersion&&(e[`mcp-protocol-version`]=this._protocolVersion);let n=Sb(this._requestInit?.headers);return new Headers({...e,...n})}_applyBodyDerivedHeaders(e,t){if(Array.isArray(t)||!Gy(t))return;let n=t.params?._meta?.[Vm];if(typeof n!=`string`)return;e.set(`mcp-protocol-version`,n),e.set(`mcp-method`,t.method);let r=t.params,i=t.method===`resources/read`?typeof r?.uri==`string`?r.uri:void 0:typeof r?.name==`string`?r.name:void 0;i!==void 0&&e.set(`mcp-name`,tb(i))}_isModernEnvelopedRequest(e){if(Array.isArray(e)||!Gy(e))return!1;let t=e.params?._meta?.[Vm];return typeof t==`string`&&xv(t)}async _startOrAuthSse(e,t=!1,n=0){let{resumptionToken:r,requestSignal:i}=e,a=()=>this._abortController?.signal.aborted===!0||i?.aborted===!0;try{let a=await this._commonHeaders(),o=[...a.get(`accept`)?.split(`,`).map(e=>e.trim().toLowerCase())??[],`text/event-stream`];a.set(`accept`,[...new Set(o)].join(`, `)),r&&a.set(`last-event-id`,r);let s=this._abortController?.signal,c=i!==void 0&&s!==void 0?lC(s,i):i??s,l=await(this._fetch??fetch)(this._url,{...this._requestInit,method:`GET`,headers:a,signal:c});if(!l.ok){if(l.status===401&&this._authProvider){if(l.headers.has(`www-authenticate`)){let{resourceMetadataUrl:e,scope:t}=eS(l);this._resourceMetadataUrl=e,this._scope=Nx(this._scope,t)}if(this._authProvider.onUnauthorized&&!t){try{await this._authProvider.onUnauthorized({response:l,serverUrl:this._url,fetchFn:this._fetchWithInit})}catch(e){throw TS(e)}return await l.text?.().catch(()=>{}),this._startOrAuthSse(e,!0,n)}throw await l.text?.().catch(()=>{}),TS(t?new vv(gv.ClientHttpAuthentication,`Server returned 401 after re-authentication`,{status:401,statusText:l.statusText}):new Ax)}if(l.status===403){let{resourceMetadataUrl:r,scope:i,error:a,errorDescription:o}=eS(l);if(a===`insufficient_scope`){let a=await l.text?.().catch(()=>null);if(await this._stepUpAuthorize({scope:i,resourceMetadataUrl:r,errorDescription:o,statusText:l.statusText,text:a},n)!==`AUTHORIZED`)throw TS(new Ax);return this._startOrAuthSse(e,t,n+1)}}if(await l.text?.().catch(()=>{}),l.status===405){e.onRequestStreamEnd?.();return}throw new vv(gv.ClientHttpFailedToOpenStream,`Failed to open SSE stream: ${l.statusText}`,{status:l.status,statusText:l.statusText})}this._handleSseStream(l.body,e,!0)}catch(e){throw a()||this.onerror?.(e),e}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let t=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,r=this._reconnectionOptions.maxReconnectionDelay;return Math.min(t*n**+e,r)}_scheduleReconnection(e,t=0){let n=this._reconnectionOptions.maxRetries;if(t>=n){this.onerror?.(Error(`Maximum reconnection attempts (${n}) exceeded.`)),e.onRequestStreamEnd?.();return}let r=this._getNextReconnectionDelay(t),i=()=>{this._cancelReconnection=void 0,!(this._abortController?.signal.aborted||e.requestSignal?.aborted)&&this._startOrAuthSse(e).catch(n=>{if(!(this._abortController?.signal.aborted||e.requestSignal?.aborted)){this.onerror?.(Error(`Failed to reconnect SSE stream: ${n instanceof Error?n.message:String(n)}`));try{this._scheduleReconnection(e,t+1)}catch(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}}})};if(this._reconnectionScheduler){let e=this._reconnectionScheduler(i,r,t);this._cancelReconnection=typeof e==`function`?e:void 0}else{let e=setTimeout(i,r);this._cancelReconnection=()=>clearTimeout(e)}}_handleSseStream(e,t,n){if(!e){t.onRequestStreamEnd?.();return}let{onresumptiontoken:r,replayMessageId:i,requestSignal:a,onRequestStreamEnd:o}=t,s=()=>this._abortController?.signal.aborted===!0||a?.aborted===!0,c,l=!1,u=!1;(async()=>{try{let t=e.pipeThrough(new TextDecoderStream).pipeThrough(new vx({onRetry:e=>{this._serverRetryMs=e}})).getReader();for(;;){let{value:e,done:n}=await t.read();if(n)break;if(e.id&&(c=e.id,l=!0,r?.(e.id)),e.data&&(!e.event||e.event===`message`))try{let t=ph.parse(JSON.parse(e.data));(qy(t)||Jy(t))&&(u=!0,i!==void 0&&(t.id=i)),this.onmessage?.(t)}catch(e){this.onerror?.(e)}}(n||l)&&!u&&this._abortController&&!s()?this._scheduleReconnection({resumptionToken:c,onresumptiontoken:r,replayMessageId:i,requestSignal:a,onRequestStreamEnd:o},0):s()||o?.()}catch(e){if(s())return;if(this.onerror?.(Error(`SSE stream disconnected: ${e}`)),(n||l)&&!u&&this._abortController&&!s())try{this._scheduleReconnection({resumptionToken:c,onresumptiontoken:r,replayMessageId:i,requestSignal:a,onRequestStreamEnd:o},0)}catch(e){this.onerror?.(Error(`Failed to reconnect: ${e instanceof Error?e.message:String(e)}`)),o?.()}else o?.()}})()}async start(){if(this._abortController)throw Error(`StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.`);this._abortController=new AbortController}async finishAuth(e,t){if(!this._oauthProvider)throw new Ax(`finishAuth requires an OAuthClientProvider`);let{authorizationCode:n,iss:r}=await Fx(e,t,this._oauthProvider,this._url,{fetchFn:this._fetchWithInit,resourceMetadataUrl:this._resourceMetadataUrl});if(await Yx(this._oauthProvider,{serverUrl:this._url,authorizationCode:n,iss:r,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit,skipIssuerMetadataValidation:this._skipIssuerMetadataValidation})!==`AUTHORIZED`)throw new Ax(`Failed to authorize`)}async close(){try{this._cancelReconnection?.()}finally{this._cancelReconnection=void 0,this._abortController?.abort(),this.onclose?.()}}async send(e,t){return this._send(e,t,!1)}async _send(e,t,n,r=0){try{let{resumptionToken:i,onresumptiontoken:a}=t||{};if(i){this._startOrAuthSse({resumptionToken:i,replayMessageId:Gy(e)?e.id:void 0,requestSignal:t?.requestSignal}).catch(e=>this.onerror?.(e));return}let o=await this._commonHeaders();this._applyBodyDerivedHeaders(o,e);let s=Array.isArray(e)?e.some(e=>Yy(e)):Yy(e);if(s&&o.delete(`mcp-session-id`),t?.headers!==void 0)for(let[e,n]of Object.entries(t.headers))cC.has(e.toLowerCase())||o.set(e,n);o.set(`content-type`,`application/json`);let c=[...o.get(`accept`)?.split(`,`).map(e=>e.trim().toLowerCase())??[],`application/json`,`text/event-stream`];o.set(`accept`,[...new Set(c)].join(`, `));let l=this._abortController?.signal,u=t?.requestSignal!==void 0&&l!==void 0?lC(l,t.requestSignal):t?.requestSignal??l,d={...this._requestInit,method:`POST`,headers:o,body:JSON.stringify(e),signal:u},f=await(this._fetch??fetch)(this._url,d);if(s&&f.ok&&(this._sessionId=f.headers.get(`mcp-session-id`)||void 0),!f.ok){if(f.status===401&&this._authProvider){if(f.headers.has(`www-authenticate`)){let{resourceMetadataUrl:e,scope:t}=eS(f);this._resourceMetadataUrl=e,this._scope=Nx(this._scope,t)}if(this._authProvider.onUnauthorized&&!n){try{await this._authProvider.onUnauthorized({response:f,serverUrl:this._url,fetchFn:this._fetchWithInit})}catch(e){throw TS(e)}return await f.text?.().catch(()=>{}),this._send(e,t,!0,r)}throw await f.text?.().catch(()=>{}),TS(n?new vv(gv.ClientHttpAuthentication,`Server returned 401 after re-authentication`,{status:401,statusText:f.statusText}):new Ax)}let i=await f.text?.().catch(()=>null);if(f.status===403){let{resourceMetadataUrl:a,scope:o,error:s,errorDescription:c}=eS(f);if(s===`insufficient_scope`){if(await this._stepUpAuthorize({scope:o,resourceMetadataUrl:a,errorDescription:c,statusText:f.statusText,text:i},r)!==`AUTHORIZED`)throw TS(new Ax);return this._send(e,t,n,r+1)}}if(f.status===400&&typeof i==`string`&&this._isModernEnvelopedRequest(e))try{let t=ph.parse(JSON.parse(i)),n=(Array.isArray(e)?e:[e]).filter(e=>Gy(e));if(Jy(t)&&n.some(e=>e.id===t.id)){this.onmessage?.(t);return}}catch{}throw new vv(gv.ClientHttpNotImplemented,`Error POSTing to endpoint: ${i}`,{status:f.status,statusText:f.statusText,text:i})}if(f.status===202){await f.text?.().catch(()=>{}),kee(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(e=>this.onerror?.(e));return}let p=(Array.isArray(e)?e:[e]).some(e=>`method`in e&&`id`in e&&e.id!==void 0),m=f.headers.get(`content-type`),h=Dte(m);if(p)if(h===`text/event-stream`)this._handleSseStream(f.body,{onresumptiontoken:a,requestSignal:t?.requestSignal,onRequestStreamEnd:t?.onRequestStreamEnd},!1);else if(h===`application/json`){let e=await f.json(),t=Array.isArray(e)?e.map(e=>ph.parse(e)):[ph.parse(e)];for(let e of t)this.onmessage?.(e)}else throw await f.text?.().catch(()=>{}),new _v(gv.ClientHttpUnexpectedContent,`Unexpected content type: ${m}`,{contentType:m});else await f.text?.().catch(()=>{})}catch(e){throw t?.requestSignal?.aborted!==!0&&this.onerror?.(e),e}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let e=await this._commonHeaders(),t={...this._requestInit,method:`DELETE`,headers:e,signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._url,t);if(await n.text?.().catch(()=>{}),!n.ok&&n.status!==405)throw new vv(gv.ClientHttpFailedToTerminateSession,`Failed to terminate session: ${n.statusText}`,{status:n.status,statusText:n.statusText});this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,t){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:t?.onresumptiontoken})}},dC=5e3,fC=2e4;function pC(e){try{let t=JSON.stringify(e);return t?Math.ceil(new TextEncoder().encode(t).length/4):0}catch{return 0}}function mC(e){let{meta:t,...n}=e;return pC(n)}function hC(e){return pC(e?.modelContent)}function gC(e,t){let n=mC(e);n>=5e3&&console.warn(`[skybridge] Tool "${t}" returned ${n} estimated model-visible tokens; this reaches the ${dC}-token warning threshold and may overload model context. Content and structured content are included in this estimate.`)}function _C(e,t){let n=pC(e);n>=2e4&&console.warn(`[skybridge] ${t} is persisting ${n} estimated tokens in model-visible view state; this reaches the ${fC}-token warning threshold and may overload model context. Persisted view state and data-llm context are included in this estimate.`)}function vC(e,t){if(e instanceof Promise)throw Error(t)}function yC(e,t){let n={},r=[];for(let i in e){let a=e[i][`~standard`].validate(t[i]);if(vC(a,`Validation must be synchronous, but ${i} returned a Promise.`),a.issues){r.push(...a.issues.map(e=>({...e,message:e.message,path:[i,...e.path??[]]})));continue}n[i]=a.value}return r.length?{issues:r}:{value:n}}function bC(e){let t=e.runtimeEnvStrict??e.runtimeEnv??{};if(e.emptyStringAsUndefined??!1)for(let[e,n]of Object.entries(t))n===``&&delete t[e];if(e.skipValidation){if(e.extends)for(let t of e.extends)t.skipValidation=!0;return t}let n=typeof e.client==`object`?e.client:{},r=typeof e.server==`object`?e.server:{},i=typeof e.shared==`object`?e.shared:{},a=e.isServer??(typeof window>`u`||`Deno`in window),o=a?{...r,...i,...n}:{...n,...i},s=(e.createFinalSchema?.(o,a))?.[`~standard`].validate(t)??yC(o,t);vC(s,`Validation must be synchronous`);let c=e.onValidationError??(e=>{throw console.error(`❌ Invalid environment variables:`,e),Error(`Invalid environment variables`)}),l=e.onInvalidAccess??(()=>{throw Error(`❌ Attempted to access a server-side environment variable on the client`)});if(s.issues)return c(s.issues);let u=t=>!e.clientPrefix||!t.startsWith(e.clientPrefix)&&!(t in i),d=e=>a||!u(e),f=e=>e==="__esModule"||e===`$$typeof`,p=(e.extends??[]).reduce((e,t)=>Object.assign(e,t),{}),m=Object.assign(p,s.value);return new Proxy(m,{get(e,t){if(typeof t==`string`&&!f(t))return d(t)?Reflect.get(e,t):l(t)}})}var xC=bC({clientPrefix:`VITE_`,client:{VITE_MCP_SERVER_URL:G().default(`${window.location.origin}/mcp`)},runtimeEnv:{BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1},emptyStringAsUndefined:!0}),SC=u(_(),1),CC=typeof global==`object`&&global&&global.Object===Object&&global,wC=typeof self==`object`&&self&&self.Object===Object&&self,TC=CC||wC||Function(`return this`)(),EC=TC.Symbol,DC=Object.prototype,OC=DC.hasOwnProperty,kC=DC.toString,AC=EC?EC.toStringTag:void 0;function jC(e){var t=OC.call(e,AC),n=e[AC];try{e[AC]=void 0;var r=!0}catch{}var i=kC.call(e);return r&&(t?e[AC]=n:delete e[AC]),i}var MC=Object.prototype.toString;function NC(e){return MC.call(e)}var PC=`[object Null]`,FC=`[object Undefined]`,IC=EC?EC.toStringTag:void 0;function LC(e){return e==null?e===void 0?FC:PC:IC&&IC in Object(e)?jC(e):NC(e)}function RC(e){return typeof e==`object`&&!!e}var zC=`[object Symbol]`;function BC(e){return typeof e==`symbol`||RC(e)&&LC(e)==zC}function VC(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var HC=Array.isArray,UC=1/0,WC=EC?EC.prototype:void 0,GC=WC?WC.toString:void 0;function KC(e){if(typeof e==`string`)return e;if(HC(e))return VC(e,KC)+``;if(BC(e))return GC?GC.call(e):``;var t=e+``;return t==`0`&&1/e==-UC?`-0`:t}var qC=/\s/;function JC(e){for(var t=e.length;t--&&qC.test(e.charAt(t)););return t}var YC=/^\s+/;function XC(e){return e&&e.slice(0,JC(e)+1).replace(YC,``)}function ZC(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var QC=NaN,$C=/^[-+]0x[0-9a-f]+$/i,ew=/^0b[01]+$/i,tw=/^0o[0-7]+$/i,nw=parseInt;function kte(e){if(typeof e==`number`)return e;if(BC(e))return QC;if(ZC(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=ZC(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=XC(e);var n=ew.test(e);return n||tw.test(e)?nw(e.slice(2),n?2:8):$C.test(e)?QC:+e}var rw=1/0,Ate=17976931348623157e292;function jte(e){return e?(e=kte(e),e===rw||e===-rw?(e<0?-1:1)*Ate:e===e?e:0):e===0?e:0}function iw(e){var t=jte(e),n=t%1;return t===t?n?t-n:t:0}function aw(e){return e}var Mte=`[object AsyncFunction]`,Nte=`[object Function]`,Pte=`[object GeneratorFunction]`,Fte=`[object Proxy]`;function ow(e){if(!ZC(e))return!1;var t=LC(e);return t==Nte||t==Pte||t==Mte||t==Fte}var sw=TC[`__core-js_shared__`],cw=function(){var e=/[^.]+$/.exec(sw&&sw.keys&&sw.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function Ite(e){return!!cw&&cw in e}var Lte=Function.prototype.toString;function lw(e){if(e!=null){try{return Lte.call(e)}catch{}try{return e+``}catch{}}return``}var Rte=/[\\^$.*+?()[\]{}|]/g,zte=/^\[object .+?Constructor\]$/,Bte=Function.prototype,Vte=Object.prototype,Hte=Bte.toString,Ute=Vte.hasOwnProperty,Wte=RegExp(`^`+Hte.call(Ute).replace(Rte,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function Gte(e){return!ZC(e)||Ite(e)?!1:(ow(e)?Wte:zte).test(lw(e))}function Kte(e,t){return e?.[t]}function uw(e,t){var n=Kte(e,t);return Gte(n)?n:void 0}var dw=uw(TC,`WeakMap`),fw=Object.create,pw=function(){function e(){}return function(t){if(!ZC(t))return{};if(fw)return fw(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function qte(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function mw(){}function hw(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}var Jte=800,Yte=16,Xte=Date.now;function Zte(e){var t=0,n=0;return function(){var r=Xte(),i=Yte-(r-n);if(n=r,i>0){if(++t>=Jte)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Qte(e){return function(){return e}}var gw=function(){try{var e=uw(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),_w=Zte(gw?function(e,t){return gw(e,`toString`,{configurable:!0,enumerable:!1,value:Qte(t),writable:!0})}:aw);function vw(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function $te(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function ene(e){return e!==e}function tne(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function yw(e,t,n){return t===t?tne(e,t,n):$te(e,ene,n)}function bw(e,t){return!!(e!=null&&e.length)&&yw(e,t,0)>-1}var nne=9007199254740991,rne=/^(?:0|[1-9]\d*)$/;function xw(e,t){var n=typeof e;return t??=nne,!!t&&(n==`number`||n!=`symbol`&&rne.test(e))&&e>-1&&e%1==0&&e<t}function Sw(e,t,n){t==`__proto__`&&gw?gw(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Cw(e,t){return e===t||e!==e&&t!==t}var ine=Object.prototype.hasOwnProperty;function ww(e,t,n){var r=e[t];(!(ine.call(e,t)&&Cw(r,n))||n===void 0&&!(t in e))&&Sw(e,t,n)}function Tw(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?Sw(n,s,c):ww(n,s,c)}return n}var Ew=Math.max;function Dw(e,t,n){return t=Ew(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=Ew(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),qte(e,this,s)}}function Ow(e,t){return _w(Dw(e,t,aw),e+``)}var ane=9007199254740991;function kw(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=ane}function Aw(e){return e!=null&&kw(e.length)&&!ow(e)}function one(e,t,n){if(!ZC(n))return!1;var r=typeof t;return(r==`number`?Aw(n)&&xw(t,n.length):r==`string`&&t in n)?Cw(n[t],e):!1}function jw(e){return Ow(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&one(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var sne=Object.prototype;function Mw(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||sne)}function Nw(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var cne=`[object Arguments]`;function Pw(e){return RC(e)&&LC(e)==cne}var Fw=Object.prototype,lne=Fw.hasOwnProperty,une=Fw.propertyIsEnumerable,Iw=Pw(function(){return arguments}())?Pw:function(e){return RC(e)&&lne.call(e,`callee`)&&!une.call(e,`callee`)};function dne(){return!1}var Lw=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Rw=Lw&&typeof module==`object`&&module&&!module.nodeType&&module,zw=Rw&&Rw.exports===Lw?TC.Buffer:void 0,Bw=(zw?zw.isBuffer:void 0)||dne,fne=`[object Arguments]`,pne=`[object Array]`,mne=`[object Boolean]`,hne=`[object Date]`,gne=`[object Error]`,_ne=`[object Function]`,vne=`[object Map]`,yne=`[object Number]`,bne=`[object Object]`,xne=`[object RegExp]`,Sne=`[object Set]`,Cne=`[object String]`,wne=`[object WeakMap]`,Tne=`[object ArrayBuffer]`,Ene=`[object DataView]`,Dne=`[object Float32Array]`,One=`[object Float64Array]`,kne=`[object Int8Array]`,Ane=`[object Int16Array]`,jne=`[object Int32Array]`,Mne=`[object Uint8Array]`,Nne=`[object Uint8ClampedArray]`,Pne=`[object Uint16Array]`,Fne=`[object Uint32Array]`,Vw={};Vw[Dne]=Vw[One]=Vw[kne]=Vw[Ane]=Vw[jne]=Vw[Mne]=Vw[Nne]=Vw[Pne]=Vw[Fne]=!0,Vw[fne]=Vw[pne]=Vw[Tne]=Vw[mne]=Vw[Ene]=Vw[hne]=Vw[gne]=Vw[_ne]=Vw[vne]=Vw[yne]=Vw[bne]=Vw[xne]=Vw[Sne]=Vw[Cne]=Vw[wne]=!1;function Ine(e){return RC(e)&&kw(e.length)&&!!Vw[LC(e)]}function Hw(e){return function(t){return e(t)}}var Uw=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Ww=Uw&&typeof module==`object`&&module&&!module.nodeType&&module,Gw=Ww&&Ww.exports===Uw&&CC.process,Kw=function(){try{return Ww&&Ww.require&&Ww.require(`util`).types||Gw&&Gw.binding&&Gw.binding(`util`)}catch{}}(),qw=Kw&&Kw.isTypedArray,Jw=qw?Hw(qw):Ine,Lne=Object.prototype.hasOwnProperty;function Yw(e,t){var n=HC(e),r=!n&&Iw(e),i=!n&&!r&&Bw(e),a=!n&&!r&&!i&&Jw(e),o=n||r||i||a,s=o?Nw(e.length,String):[],c=s.length;for(var l in e)(t||Lne.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||xw(l,c)))&&s.push(l);return s}function Xw(e,t){return function(n){return e(t(n))}}var Rne=Xw(Object.keys,Object),zne=Object.prototype.hasOwnProperty;function Zw(e){if(!Mw(e))return Rne(e);var t=[];for(var n in Object(e))zne.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Qw(e){return Aw(e)?Yw(e):Zw(e)}var Bne=Object.prototype.hasOwnProperty,Vne=jw(function(e,t){if(Mw(t)||Aw(t)){Tw(t,Qw(t),e);return}for(var n in t)Bne.call(t,n)&&ww(e,n,t[n])});function Hne(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Une=Object.prototype.hasOwnProperty;function Wne(e){if(!ZC(e))return Hne(e);var t=Mw(e),n=[];for(var r in e)r==`constructor`&&(t||!Une.call(e,r))||n.push(r);return n}function $w(e){return Aw(e)?Yw(e,!0):Wne(e)}var Gne=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Kne=/^\w*$/;function eT(e,t){if(HC(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||BC(e)?!0:Kne.test(e)||!Gne.test(e)||t!=null&&e in Object(t)}var tT=uw(Object,`create`);function qne(){this.__data__=tT?tT(null):{},this.size=0}function Jne(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var Yne=`__lodash_hash_undefined__`,Xne=Object.prototype.hasOwnProperty;function Zne(e){var t=this.__data__;if(tT){var n=t[e];return n===Yne?void 0:n}return Xne.call(t,e)?t[e]:void 0}var Qne=Object.prototype.hasOwnProperty;function $ne(e){var t=this.__data__;return tT?t[e]!==void 0:Qne.call(t,e)}var ere=`__lodash_hash_undefined__`;function tre(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=tT&&t===void 0?ere:t,this}function nT(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}nT.prototype.clear=qne,nT.prototype.delete=Jne,nT.prototype.get=Zne,nT.prototype.has=$ne,nT.prototype.set=tre;function nre(){this.__data__=[],this.size=0}function rT(e,t){for(var n=e.length;n--;)if(Cw(e[n][0],t))return n;return-1}var rre=Array.prototype.splice;function ire(e){var t=this.__data__,n=rT(t,e);return n<0?!1:(n==t.length-1?t.pop():rre.call(t,n,1),--this.size,!0)}function are(e){var t=this.__data__,n=rT(t,e);return n<0?void 0:t[n][1]}function ore(e){return rT(this.__data__,e)>-1}function sre(e,t){var n=this.__data__,r=rT(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function iT(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}iT.prototype.clear=nre,iT.prototype.delete=ire,iT.prototype.get=are,iT.prototype.has=ore,iT.prototype.set=sre;var aT=uw(TC,`Map`);function cre(){this.size=0,this.__data__={hash:new nT,map:new(aT||iT),string:new nT}}function lre(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function oT(e,t){var n=e.__data__;return lre(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function ure(e){var t=oT(this,e).delete(e);return this.size-=+!!t,t}function dre(e){return oT(this,e).get(e)}function fre(e){return oT(this,e).has(e)}function pre(e,t){var n=oT(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function sT(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}sT.prototype.clear=cre,sT.prototype.delete=ure,sT.prototype.get=dre,sT.prototype.has=fre,sT.prototype.set=pre;var mre=`Expected a function`;function cT(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(mre);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(cT.Cache||sT),n}cT.Cache=sT;var hre=500;function gre(e){var t=cT(e,function(e){return n.size===hre&&n.clear(),e}),n=t.cache;return t}var _re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vre=/\\(\\)?/g,lT=gre(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(_re,function(e,n,r,i){t.push(r?i.replace(vre,`$1`):n||e)}),t});function uT(e){return e==null?``:KC(e)}function dT(e,t){return HC(e)?e:eT(e,t)?[e]:lT(uT(e))}var yre=1/0;function fT(e){if(typeof e==`string`||BC(e))return e;var t=e+``;return t==`0`&&1/e==-yre?`-0`:t}function pT(e,t){t=dT(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[fT(t[n++])];return n&&n==r?e:void 0}function X(e,t,n){var r=e==null?void 0:pT(e,t);return r===void 0?n:r}function mT(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var hT=EC?EC.isConcatSpreadable:void 0;function bre(e){return HC(e)||Iw(e)||!!(hT&&e&&e[hT])}function gT(e,t,n,r,i){var a=-1,o=e.length;for(n||=bre,i||=[];++a<o;){var s=e[a];t>0&&n(s)?t>1?gT(s,t-1,n,r,i):mT(i,s):r||(i[i.length]=s)}return i}function _T(e){return e!=null&&e.length?gT(e,1):[]}function vT(e){return _w(Dw(e,void 0,_T),e+``)}var yT=Xw(Object.getPrototypeOf,Object),xre=`[object Object]`,Sre=Function.prototype,Cre=Object.prototype,bT=Sre.toString,wre=Cre.hasOwnProperty,Tre=bT.call(Object);function xT(e){if(!RC(e)||LC(e)!=xre)return!1;var t=yT(e);if(t===null)return!0;var n=wre.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&bT.call(n)==Tre}function Ere(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}function Dre(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function Ore(){this.__data__=new iT,this.size=0}function kre(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Are(e){return this.__data__.get(e)}function jre(e){return this.__data__.has(e)}var Mre=200;function Nre(e,t){var n=this.__data__;if(n instanceof iT){var r=n.__data__;if(!aT||r.length<Mre-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new sT(r)}return n.set(e,t),this.size=n.size,this}function ST(e){var t=this.__data__=new iT(e);this.size=t.size}ST.prototype.clear=Ore,ST.prototype.delete=kre,ST.prototype.get=Are,ST.prototype.has=jre,ST.prototype.set=Nre;function Pre(e,t){return e&&Tw(t,Qw(t),e)}function Fre(e,t){return e&&Tw(t,$w(t),e)}var CT=typeof exports==`object`&&exports&&!exports.nodeType&&exports,wT=CT&&typeof module==`object`&&module&&!module.nodeType&&module,TT=wT&&wT.exports===CT?TC.Buffer:void 0,ET=TT?TT.allocUnsafe:void 0;function DT(e,t){if(t)return e.slice();var n=e.length,r=ET?ET(n):new e.constructor(n);return e.copy(r),r}function Ire(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function OT(){return[]}var Lre=Object.prototype.propertyIsEnumerable,kT=Object.getOwnPropertySymbols,AT=kT?function(e){return e==null?[]:(e=Object(e),Ire(kT(e),function(t){return Lre.call(e,t)}))}:OT;function Rre(e,t){return Tw(e,AT(e),t)}var jT=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)mT(t,AT(e)),e=yT(e);return t}:OT;function zre(e,t){return Tw(e,jT(e),t)}function MT(e,t,n){var r=t(e);return HC(e)?r:mT(r,n(e))}function NT(e){return MT(e,Qw,AT)}function PT(e){return MT(e,$w,jT)}var FT=uw(TC,`DataView`),IT=uw(TC,`Promise`),LT=uw(TC,`Set`),RT=`[object Map]`,Bre=`[object Object]`,zT=`[object Promise]`,BT=`[object Set]`,VT=`[object WeakMap]`,HT=`[object DataView]`,Vre=lw(FT),Hre=lw(aT),Ure=lw(IT),Wre=lw(LT),Gre=lw(dw),UT=LC;(FT&&UT(new FT(new ArrayBuffer(1)))!=HT||aT&&UT(new aT)!=RT||IT&&UT(IT.resolve())!=zT||LT&&UT(new LT)!=BT||dw&&UT(new dw)!=VT)&&(UT=function(e){var t=LC(e),n=t==Bre?e.constructor:void 0,r=n?lw(n):``;if(r)switch(r){case Vre:return HT;case Hre:return RT;case Ure:return zT;case Wre:return BT;case Gre:return VT}return t});var WT=UT,Kre=Object.prototype.hasOwnProperty;function qre(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&Kre.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}var GT=TC.Uint8Array;function KT(e){var t=new e.constructor(e.byteLength);return new GT(t).set(new GT(e)),t}function Jre(e,t){var n=t?KT(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Yre=/\w*$/;function Xre(e){var t=new e.constructor(e.source,Yre.exec(e));return t.lastIndex=e.lastIndex,t}var qT=EC?EC.prototype:void 0,JT=qT?qT.valueOf:void 0;function Zre(e){return JT?Object(JT.call(e)):{}}function YT(e,t){var n=t?KT(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Qre=`[object Boolean]`,$re=`[object Date]`,eie=`[object Map]`,tie=`[object Number]`,nie=`[object RegExp]`,rie=`[object Set]`,iie=`[object String]`,aie=`[object Symbol]`,oie=`[object ArrayBuffer]`,sie=`[object DataView]`,cie=`[object Float32Array]`,lie=`[object Float64Array]`,uie=`[object Int8Array]`,die=`[object Int16Array]`,fie=`[object Int32Array]`,pie=`[object Uint8Array]`,mie=`[object Uint8ClampedArray]`,hie=`[object Uint16Array]`,gie=`[object Uint32Array]`;function _ie(e,t,n){var r=e.constructor;switch(t){case oie:return KT(e);case Qre:case $re:return new r(+e);case sie:return Jre(e,n);case cie:case lie:case uie:case die:case fie:case pie:case mie:case hie:case gie:return YT(e,n);case eie:return new r;case tie:case iie:return new r(e);case nie:return Xre(e);case rie:return new r;case aie:return Zre(e)}}function XT(e){return typeof e.constructor==`function`&&!Mw(e)?pw(yT(e)):{}}var vie=`[object Map]`;function yie(e){return RC(e)&&WT(e)==vie}var ZT=Kw&&Kw.isMap,bie=ZT?Hw(ZT):yie,xie=`[object Set]`;function Sie(e){return RC(e)&&WT(e)==xie}var QT=Kw&&Kw.isSet,Cie=QT?Hw(QT):Sie,wie=1,Tie=2,Eie=4,$T=`[object Arguments]`,Die=`[object Array]`,Oie=`[object Boolean]`,kie=`[object Date]`,Aie=`[object Error]`,eE=`[object Function]`,jie=`[object GeneratorFunction]`,Mie=`[object Map]`,Nie=`[object Number]`,tE=`[object Object]`,Pie=`[object RegExp]`,Fie=`[object Set]`,Iie=`[object String]`,Lie=`[object Symbol]`,Rie=`[object WeakMap]`,zie=`[object ArrayBuffer]`,Bie=`[object DataView]`,Vie=`[object Float32Array]`,Hie=`[object Float64Array]`,Uie=`[object Int8Array]`,Wie=`[object Int16Array]`,Gie=`[object Int32Array]`,Kie=`[object Uint8Array]`,qie=`[object Uint8ClampedArray]`,Jie=`[object Uint16Array]`,Yie=`[object Uint32Array]`,nE={};nE[$T]=nE[Die]=nE[zie]=nE[Bie]=nE[Oie]=nE[kie]=nE[Vie]=nE[Hie]=nE[Uie]=nE[Wie]=nE[Gie]=nE[Mie]=nE[Nie]=nE[tE]=nE[Pie]=nE[Fie]=nE[Iie]=nE[Lie]=nE[Kie]=nE[qie]=nE[Jie]=nE[Yie]=!0,nE[Aie]=nE[eE]=nE[Rie]=!1;function rE(e,t,n,r,i,a){var o,s=t&wie,c=t&Tie,l=t&Eie;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!ZC(e))return e;var u=HC(e);if(u){if(o=qre(e),!s)return hw(e,o)}else{var d=WT(e),f=d==eE||d==jie;if(Bw(e))return DT(e,s);if(d==tE||d==$T||f&&!i){if(o=c||f?{}:XT(e),!s)return c?zre(e,Fre(o,e)):Rre(e,Pre(o,e))}else{if(!nE[d])return i?e:{};o=_ie(e,d,s)}}a||=new ST;var p=a.get(e);if(p)return p;a.set(e,o),Cie(e)?e.forEach(function(r){o.add(rE(r,t,n,r,e,a))}):bie(e)&&e.forEach(function(r,i){o.set(i,rE(r,t,n,i,e,a))});var m=u?void 0:(l?c?PT:NT:c?$w:Qw)(e);return vw(m||e,function(r,i){m&&(i=r,r=e[i]),ww(o,i,rE(r,t,n,i,e,a))}),o}var Xie=1,Zie=4;function iE(e){return rE(e,Xie|Zie)}var Qie=`__lodash_hash_undefined__`;function $ie(e){return this.__data__.set(e,Qie),this}function eae(e){return this.__data__.has(e)}function aE(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new sT;++t<n;)this.add(e[t])}aE.prototype.add=aE.prototype.push=$ie,aE.prototype.has=eae;function tae(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function oE(e,t){return e.has(t)}var nae=1,rae=2;function sE(e,t,n,r,i,a){var o=n&nae,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&rae?new aE:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!tae(t,function(e,t){if(!oE(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}function iae(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function cE(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var aae=1,oae=2,sae=`[object Boolean]`,cae=`[object Date]`,lae=`[object Error]`,uae=`[object Map]`,dae=`[object Number]`,fae=`[object RegExp]`,pae=`[object Set]`,mae=`[object String]`,hae=`[object Symbol]`,gae=`[object ArrayBuffer]`,_ae=`[object DataView]`,lE=EC?EC.prototype:void 0,uE=lE?lE.valueOf:void 0;function vae(e,t,n,r,i,a,o){switch(n){case _ae:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case gae:return!(e.byteLength!=t.byteLength||!a(new GT(e),new GT(t)));case sae:case cae:case dae:return Cw(+e,+t);case lae:return e.name==t.name&&e.message==t.message;case fae:case mae:return e==t+``;case uae:var s=iae;case pae:var c=r&aae;if(s||=cE,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=oae,o.set(e,t);var u=sE(s(e),s(t),r,i,a,o);return o.delete(e),u;case hae:if(uE)return uE.call(e)==uE.call(t)}return!1}var yae=1,bae=Object.prototype.hasOwnProperty;function xae(e,t,n,r,i,a){var o=n&yae,s=NT(e),c=s.length;if(c!=NT(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:bae.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var Sae=1,dE=`[object Arguments]`,fE=`[object Array]`,pE=`[object Object]`,mE=Object.prototype.hasOwnProperty;function Cae(e,t,n,r,i,a){var o=HC(e),s=HC(t),c=o?fE:WT(e),l=s?fE:WT(t);c=c==dE?pE:c,l=l==dE?pE:l;var u=c==pE,d=l==pE,f=c==l;if(f&&Bw(e)){if(!Bw(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new ST,o||Jw(e)?sE(e,t,n,r,i,a):vae(e,t,c,n,r,i,a);if(!(n&Sae)){var p=u&&mE.call(e,`__wrapped__`),m=d&&mE.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new ST,i(h,g,n,r,a)}}return f?(a||=new ST,xae(e,t,n,r,i,a)):!1}function hE(e,t,n,r,i){return e===t?!0:e==null||t==null||!RC(e)&&!RC(t)?e!==e&&t!==t:Cae(e,t,n,r,hE,i)}var wae=1,Tae=2;function Eae(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var c=s[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new ST;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?hE(u,l,wae|Tae,r,d):f))return!1}}return!0}function gE(e){return e===e&&!ZC(e)}function Dae(e){for(var t=Qw(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,gE(i)]}return t}function _E(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}function Oae(e){var t=Dae(e);return t.length==1&&t[0][2]?_E(t[0][0],t[0][1]):function(n){return n===e||Eae(n,e,t)}}function vE(e,t){return e!=null&&t in Object(e)}function yE(e,t,n){t=dT(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=fT(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&kw(i)&&xw(o,i)&&(HC(e)||Iw(e)))}function bE(e,t){return e!=null&&yE(e,t,vE)}var xE=1,SE=2;function CE(e,t){return eT(e)&&gE(t)?_E(fT(e),t):function(n){var r=X(n,e);return r===void 0&&r===t?bE(n,e):hE(t,r,xE|SE)}}function kae(e){return function(t){return t?.[e]}}function Aae(e){return function(t){return pT(t,e)}}function jae(e){return eT(e)?kae(fT(e)):Aae(e)}function wE(e){return typeof e==`function`?e:e==null?aw:typeof e==`object`?HC(e)?CE(e[0],e[1]):Oae(e):jae(e)}function Mae(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var TE=Mae();function EE(e,t){return e&&TE(e,t,Qw)}function DE(e,t){return function(n,r){if(n==null)return n;if(!Aw(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var OE=DE(EE);function kE(e,t,n){(n!==void 0&&!Cw(e[t],n)||n===void 0&&!(t in e))&&Sw(e,t,n)}function AE(e){return RC(e)&&Aw(e)}function jE(e,t){if(!(t===`constructor`&&typeof e[t]==`function`)&&t!=`__proto__`)return e[t]}function Nae(e){return Tw(e,$w(e))}function Pae(e,t,n,r,i,a,o){var s=jE(e,n),c=jE(t,n),l=o.get(c);if(l){kE(e,n,l);return}var u=a?a(s,c,n+``,e,t,o):void 0,d=u===void 0;if(d){var f=HC(c),p=!f&&Bw(c),m=!f&&!p&&Jw(c);u=c,f||p||m?HC(s)?u=s:AE(s)?u=hw(s):p?(d=!1,u=DT(c,!0)):m?(d=!1,u=YT(c,!0)):u=[]:xT(c)||Iw(c)?(u=s,Iw(s)?u=Nae(s):(!ZC(s)||ow(s))&&(u=XT(c))):d=!1}d&&(o.set(c,u),i(u,c,r,a,o),o.delete(c)),kE(e,n,u)}function ME(e,t,n,r,i){e!==t&&TE(t,function(a,o){if(i||=new ST,ZC(a))Pae(e,t,o,n,ME,r,i);else{var s=r?r(jE(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),kE(e,o,s)}},$w)}function NE(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var Fae=200;function Iae(e,t,n,r){var i=-1,a=bw,o=!0,s=e.length,c=[],l=t.length;if(!s)return c;n&&(t=VC(t,Hw(n))),r?(a=NE,o=!1):t.length>=Fae&&(a=oE,o=!1,t=new aE(t));outer:for(;++i<s;){var u=e[i],d=n==null?u:n(u);if(u=r||u!==0?u:0,o&&d===d){for(var f=l;f--;)if(t[f]===d)continue outer;c.push(u)}else a(t,d,r)||c.push(u)}return c}var Lae=Ow(function(e,t){return AE(e)?Iae(e,gT(t,1,AE,!0)):[]});function PE(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function FE(e){return typeof e==`function`?e:aw}function Rae(e,t){return(HC(e)?vw:OE)(e,FE(t))}var IE=1/0;function LE(e){return e!=null&&e.length?gT(e,IE):[]}var RE=Object.prototype.hasOwnProperty;function zE(e,t){return e!=null&&RE.call(e,t)}function BE(e,t){return e!=null&&yE(e,t,zE)}var VE=`[object String]`;function HE(e){return typeof e==`string`||!HC(e)&&RC(e)&&LC(e)==VE}function UE(e,t){return VC(t,function(t){return e[t]})}function WE(e){return e==null?[]:UE(e,Qw(e))}var GE=Math.max;function KE(e,t,n,r){e=Aw(e)?e:WE(e),n=n&&!r?iw(n):0;var i=e.length;return n<0&&(n=GE(i+n,0)),HE(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&yw(e,t,n)>-1}var qE=Math.min;function JE(e,t,n){for(var r=n?NE:bw,i=e[0].length,a=e.length,o=a,s=Array(a),c=1/0,l=[];o--;){var u=e[o];o&&t&&(u=VC(u,Hw(t))),c=qE(u.length,c),s[o]=!n&&(t||i>=120&&u.length>=120)?new aE(o&&u):void 0}u=e[0];var d=-1,f=s[0];outer:for(;++d<i&&l.length<c;){var p=u[d],m=t?t(p):p;if(p=n||p!==0?p:0,!(f?oE(f,m):r(l,m,n))){for(o=a;--o;){var h=s[o];if(!(h?oE(h,m):r(e[o],m,n)))continue outer}f&&f.push(m),l.push(p)}}return l}function YE(e){return AE(e)?e:[]}var XE=Ow(function(e){var t=VC(e,YE);return t.length&&t[0]===e[0]?JE(t):[]});function ZE(e,t){return t.length<2?e:pT(e,Ere(t,0,-1))}var QE=`[object Map]`,$E=`[object Set]`,eD=Object.prototype.hasOwnProperty;function tD(e){if(e==null)return!0;if(Aw(e)&&(HC(e)||typeof e==`string`||typeof e.splice==`function`||Bw(e)||Jw(e)||Iw(e)))return!e.length;var t=WT(e);if(t==QE||t==$E)return!e.size;if(Mw(e))return!Zw(e).length;for(var n in e)if(eD.call(e,n))return!1;return!0}function nD(e,t){return hE(e,t)}var zae=`[object Number]`;function rD(e){return typeof e==`number`||RC(e)&&LC(e)==zae}function iD(e){return e==null}function aD(e){return e===void 0}var Bae=jw(function(e,t,n){ME(e,t,n)}),Vae=Object.prototype.hasOwnProperty;function oD(e,t){t=dT(t,e);var n=-1,r=t.length;if(!r)return!0;for(;++n<r;){var i=fT(t[n]);if(i===`__proto__`&&!Vae.call(e,`__proto__`)||(i===`constructor`||i===`prototype`)&&n<r-1)return!1}var a=ZE(e,t);return a==null||delete a[fT(PE(t))]}function Hae(e){return xT(e)?void 0:e}var Uae=1,Wae=2,Gae=4,sD=vT(function(e,t){var n={};if(e==null)return n;var r=!1;t=VC(t,function(t){return t=dT(t,e),r||=t.length>1,t}),Tw(e,PT(e),n),r&&(n=rE(n,Uae|Wae|Gae,Hae));for(var i=t.length;i--;)oD(n,t[i]);return n});function cD(e,t,n,r){if(!ZC(e))return e;t=dT(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var c=fT(t[i]),l=n;if(c===`__proto__`||c===`constructor`||c===`prototype`)return e;if(i!=o){var u=s[c];l=r?r(u,c,s):void 0,l===void 0&&(l=ZC(u)?u:xw(t[i+1])?[]:{})}ww(s,c,l),s=s[c]}return e}function lD(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=pT(e,o);n(s,o)&&cD(a,dT(o,e),s)}return a}function Kae(e,t){if(e==null)return{};var n=VC(PT(e),function(e){return[e]});return t=wE(t),lD(e,n,function(e,n){return t(e,n[0])})}function qae(e,t){return lD(e,t,function(t,n){return bE(e,n)})}var uD=vT(function(e,t){return e==null?{}:qae(e,t)});function Jae(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}function Yae(e,t,n){var r=HC(e)?Dre:Jae,i=arguments.length<3;return r(e,wE(t,4),n,i,OE)}function dD(e,t,n){return e==null?e:cD(e,t,n)}function Xae(e,t,n,r){return r=typeof r==`function`?r:void 0,e==null?e:cD(e,t,n,r)}var Zae=9007199254740991,fD=4294967295,Qae=Math.min;function pD(e,t){if(e=iw(e),e<1||e>Zae)return[];var n=fD,r=Qae(e,fD);t=FE(t),e-=fD;for(var i=Nw(r,t);++n<e;)t(n);return i}function mD(e){return HC(e)?VC(e,fT):BC(e)?[e]:hw(lT(uT(e)))}function $ae(e,t,n){var r=HC(e),i=r||Bw(e)||Jw(e);if(t=wE(t,4),n==null){var a=e&&e.constructor;n=i?r?new a:[]:ZC(e)&&ow(a)?pw(yT(e)):{}}return(i?vw:EE)(e,function(e,r,i){return t(n,e,r,i)}),n}var eoe=LT&&1/cE(new LT([,-0]))[1]==1/0?function(e){return new LT(e)}:mw,toe=200;function hD(e,t,n){var r=-1,i=bw,a=e.length,o=!0,s=[],c=s;if(n)o=!1,i=NE;else if(a>=toe){var l=t?null:eoe(e);if(l)return cE(l);o=!1,i=oE,c=new aE}else c=t?[]:s;outer:for(;++r<a;){var u=e[r],d=t?t(u):u;if(u=n||u!==0?u:0,o&&d===d){for(var f=c.length;f--;)if(c[f]===d)continue outer;t&&c.push(d),s.push(u)}else i(c,d,n)||(c!==s&&c.push(d),s.push(u))}return s}var noe=Ow(function(e){return hD(gT(e,1,AE,!0))});function gD(e){return e&&e.length?hD(e):[]}var _D=0;function vD(e){var t=++_D;return uT(e)+t}function yD(e,t){return e==null||oD(e,t)}var bD=as()(e=>({tools:{},setToolData:(t,n)=>e(e=>{let r=e.tools[t];if(r){let t=!0;for(let e of Object.keys(n))if(r[e]!==n[e]){t=!1;break}if(t)return e}return SD(e,`tools.${t}`,{...r??{},...n})}),updateOpenaiObject:(t,n,r)=>e(e=>e.tools[t]?.openaiObject?SD(e,`tools.${t}.openaiObject.${n}`,r):e),pushOpenAiLog:(t,n)=>e(e=>{let r=e.tools[t]?.openaiLogs||[];return SD(e,`tools.${t}.openaiLogs`,[...r,{...n,id:crypto.randomUUID()}])}),clearOpenAiLogs:t=>e(e=>e.tools[t]?.openaiLogs?.length?SD(e,`tools.${t}.openaiLogs`,[]):e),setOpenInAppUrl:(t,n)=>e(e=>e.tools[t]?.openInAppUrl===n?e:SD(e,`tools.${t}.openInAppUrl`,n))})),xD=e=>{let{tools:t}=bD();return t[e]},SD=(e,t,n)=>{let r=iE(e);return dD(r,t,n),r};function CD(e,t,n){try{return e(t)}catch(e){return n?dt(25,t,e,n):dt(24,t,e),null}}function wD(e){function t(t){if(t===void 0)return null;let n=``;if(Array.isArray(t)){if(t[0]===void 0)return null;n=t[0]}return typeof t==`string`&&(n=t),CD(e.parse,n)}return{type:`single`,eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide(n){return t(n)??e}}},withOptions(e){return{...this,...e}}}}var TD=wD({parse:e=>e,serialize:String});wD({parse:e=>{let t=parseInt(e);return t==t?t:null},serialize:e=>``+Math.round(e)}),wD({parse:e=>{let t=parseInt(e);return t==t?t-1:null},serialize:e=>``+Math.round(e+1)}),wD({parse:e=>{let t=parseInt(e,16);return t==t?t:null},serialize:e=>{let t=Math.round(e).toString(16);return(t.length&1?`0`:``)+t}}),wD({parse:e=>{let t=parseFloat(e);return t==t?t:null},serialize:String}),wD({parse:e=>e.toLowerCase()===`true`,serialize:String});function ED(e,t){return e.valueOf()===t.valueOf()}wD({parse:e=>{let t=parseInt(e);return t==t?new Date(t):null},serialize:e=>``+e.valueOf(),eq:ED}),wD({parse:e=>{let t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:ED}),wD({parse:e=>{let t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:ED});var DD=vt(`sync-emitter`,()=>Mt()),OD={};function kD(e,t={}){let n=(0,b.useId)(),r=Ct(),i=wt(),{history:a=r?.history??`replace`,scroll:o=r?.scroll??!1,shallow:s=r?.shallow??!0,throttleMs:c=kt.timeMs,limitUrlUpdates:l=r?.limitUrlUpdates,clearOnDefault:u=r?.clearOnDefault??!0,startTransition:d,urlKeys:f=OD}=t,p=Object.keys(e).join(`,`),m=(0,b.useMemo)(()=>Object.fromEntries(Object.keys(e).map(e=>[e,f[e]??e])),[p,JSON.stringify(f)]),h=St(Object.values(m)),g=h.searchParams,_=(0,b.useRef)({}),v=(0,b.useRef)(null),y=(0,b.useRef)(null),x=(0,b.useMemo)(()=>Object.fromEntries(Object.keys(e).map(t=>[t,e[t].defaultValue??null])),[Object.values(e).map(({defaultValue:e})=>e).join(`,`)]),S=Ut(Object.values(m)),[C,w]=(0,b.useState)(()=>AD(e,f,g,S).state),T=(0,b.useRef)(C),E=Object.values(m).map(e=>`${e}=${g.getAll(e)}`).join(`&`)+JSON.stringify(S),D=()=>{let{state:t,hasChanged:r}=AD(e,f,g,S,_.current,T.current);r&&(ut(1,n,p,t),T.current=t,w(t))},O=Object.keys(_.current).join(`&`)!==Object.values(m).join(`&`),k=y.current===null||y.current===(h.pathname??location.pathname);(O||k&&v.current!==E)&&(v.current=E,D(),O&&(_.current=Object.fromEntries(Object.entries(m).map(([t,n])=>[n,e[t]?.type===`multi`?g.getAll(n):g.get(n)??null])))),(0,b.useEffect)(()=>{y.current=h.pathname??location.pathname,D()},[E,h.pathname]),(0,b.useEffect)(()=>{let t=Object.keys(e).reduce((t,r)=>(t[r]=({state:t,query:i})=>{w(a=>{let{defaultValue:o}=e[r],s=m[r],c=t??o??null,l=a[r]??o??null;return Object.is(l,c)?(ut(2,n,p,s,t,o,T.current),a):(T.current={...T.current,[r]:c},_.current[s]=i,ut(3,n,p,s,t,o,T.current),T.current)})},t),{});for(let r of Object.keys(e)){let e=m[r];ut(4,n,e,p),DD.on(e,t[r])}return()=>{for(let r of Object.keys(e)){let e=m[r];ut(5,n,e,p),DD.off(e,t[r])}}},[p,m]);let A=(0,b.useCallback)((t,r={})=>{let f=Object.fromEntries(Object.keys(e).map(e=>[e,null])),g=typeof t==`function`?t(jD(T.current,x))??f:t??f;ut(6,n,p,g);let _,v=0,y=!1,b=[];for(let[t,n]of Object.entries(g)){let f=e[t],p=m[t];if(!f||n===void 0)continue;(r.clearOnDefault??f.clearOnDefault??u)&&n!==null&&f.defaultValue!==void 0&&(f.eq??((e,t)=>e===t))(n,f.defaultValue)&&(n=null);let g=n===null?null:(f.serialize??String)(n);DD.emit(p,{state:n,query:g});let x={key:p,query:g,options:{history:r.history??f.history??a,shallow:r.shallow??f.shallow??s,scroll:r.scroll??f.scroll??o,startTransition:r.startTransition??f.startTransition??d}},S=r.limitUrlUpdates??f.limitUrlUpdates??l;if(S?.method===`debounce`){let e=S.timeMs??kt.timeMs,t=Ht.push(x,e,h,i);v<e&&(_=t,v=e)}else{let e=S?.timeMs??r.throttleMs??f.throttleMs??c;b.push(Ht.abort(p)),Rt.push(x,e),y=!0}}let S=b.reduce((e,t)=>t(e),y?Rt.flush(h,i):Rt.getPendingPromise(h));return _??S},[p,a,s,o,c,l?.method,l?.timeMs,d,m,h.updateUrl,h.getSearchParamsSnapshot,h.rateLimitFactor,i,x]);return[(0,b.useMemo)(()=>jD(C,x),[C,x]),A]}function AD(e,t,n,r,i,a){let o=!1,s=Object.entries(e).reduce((e,[s,c])=>{let l=t?.[s]??s,u=r[l],d=c.type===`multi`?[]:null,f=u===void 0?(c.type===`multi`?n.getAll(l):n.get(l))??d:u;return i&&a&&Tt(i[l]??d,f)?(e[s]=a[s]??null,e):(o=!0,e[s]=(At(f)?null:CD(c.parse,f,l))??null,i&&(i[l]=f),e)},{});if(!o){let t=Object.keys(e),n=Object.keys(a??{});o=t.length!==n.length||t.some(e=>!n.includes(e))}return{state:s,hasChanged:o}}function jD(e,t){return Object.fromEntries(Object.keys(e).map(n=>[n,e[n]??t[n]??null]))}function MD(e,t={}){let{parse:n,type:r,serialize:i,eq:a,defaultValue:o,...s}=t,[{[e]:c},l]=kD({[e]:{parse:n??(e=>e),type:r,serialize:i,eq:a,defaultValue:o}},s);return[c,(0,b.useCallback)((t,n={})=>l(n=>({[e]:typeof t==`function`?t(n[e]):t}),n),[e,l])]}function ND(){return MD(`tool`,TD)}var PD=new He,FD=`skybridge-devtools-oauth`,ID={clientInfo:`${FD}:client-info`,tokens:`${FD}:tokens`,codeVerifier:`${FD}:code-verifier`,state:`${FD}:state`,discovery:`${FD}:discovery`},LD=class{get redirectUrl(){let e=new URL(window.location.origin+window.location.pathname);return e.searchParams.set(`oauth_callback`,`true`),e.toString()}get clientMetadata(){return{redirect_uris:[this.redirectUrl],token_endpoint_auth_method:`none`,grant_types:[`authorization_code`,`refresh_token`],response_types:[`code`],client_name:`Skybridge Devtools`,client_uri:window.location.origin}}clientInformation(){let e=localStorage.getItem(ID.clientInfo);return e?JSON.parse(e):void 0}saveClientInformation(e){localStorage.setItem(ID.clientInfo,JSON.stringify(e))}tokens(){let e=localStorage.getItem(ID.tokens);return e?JSON.parse(e):void 0}saveTokens(e){localStorage.setItem(ID.tokens,JSON.stringify(e))}state(){let e=localStorage.getItem(ID.state);if(e)return e;let t=crypto.randomUUID();return localStorage.setItem(ID.state,t),t}expectedState(){return localStorage.getItem(ID.state)??void 0}redirectToAuthorization(e){window.location.href=e.toString()}saveCodeVerifier(e){localStorage.setItem(ID.codeVerifier,e)}codeVerifier(){let e=localStorage.getItem(ID.codeVerifier);if(!e)throw Error(`Missing PKCE code verifier: the sign-in flow was not started in this browser, or its storage was cleared. Retry signing in.`);return e}saveDiscoveryState(e){localStorage.setItem(ID.discovery,JSON.stringify(e))}discoveryState(){let e=localStorage.getItem(ID.discovery);return e?JSON.parse(e):void 0}invalidateCredentials(e){(e===`all`||e===`tokens`)&&localStorage.removeItem(ID.tokens),(e===`all`||e===`client`)&&localStorage.removeItem(ID.clientInfo),(e===`all`||e===`verifier`)&&(localStorage.removeItem(ID.codeVerifier),localStorage.removeItem(ID.state)),(e===`all`||e===`discovery`)&&localStorage.removeItem(ID.discovery)}},RD=new class{client=null;transport=null;async connect(e,t){let n=typeof e==`string`?new URL(e):e;this.transport=new uC(n,{authProvider:t,fetch:(e,t)=>{let r=e instanceof Request?e.url:String(e);if(new URL(r).origin!==n.origin)return fetch(e,t);let i=new Headers(t?.headers);return i.set(`x-forwarded-host`,n.host),i.set(`x-forwarded-proto`,n.protocol.replace(/:$/,``)),fetch(e,{...t,headers:i})}}),this.client=new aC({name:`mcp-client`,version:`1.0.0`},{capabilities:{experimental:{tools:{},resources:{},prompts:{}}}}),await this.client.connect(this.transport)}async listTools(){if(!this.client)throw Error(`Client not connected. Call connect() first.`);try{return(await this.client.listTools()).tools}catch(e){if(e instanceof ty&&e.code===-32601)return[];throw e}}async callTool(e,t){if(!this.client)throw Error(`Client not connected. Call connect() first.`);let{_meta:n,...r}=await this.client.callTool({name:e,arguments:t??{}});return{...r,meta:n}}async listResources(){if(!this.client)throw Error(`Client not connected. Call connect() first.`);return(await this.client.listResources()).resources}async readResource(e){if(!this.client)throw Error(`Client not connected. Call connect() first.`);return await this.client.readResource({uri:e})}async listPrompts(){if(!this.client)throw Error(`Client not connected. Call connect() first.`);return(await this.client.listPrompts()).prompts}async getPrompt(e,t){if(!this.client)throw Error(`Client not connected. Call connect() first.`);return await this.client.getPrompt({name:e,...t&&{arguments:t}})}getServerInfo(){if(!this.client)throw Error(`Client not connected. Call connect() first.`);return this.client.getServerVersion()}async finishAuth(e){if(!this.transport)throw Error(`Transport not available. Call connect() first.`);await this.transport.finishAuth(e)}async close(){this.client&&=(await this.client.close(),null),this.transport&&=null}},zD=null,BD=()=>xC.VITE_MCP_SERVER_URL;function VD(e){let t=e._meta?.securitySchemes;return!!t?.length&&t.every(e=>e?.type!==`noauth`)}function HD(e){return e instanceof Ax||e instanceof vv&&e.status===401}async function UD(){let e=BD(),{setStatus:t,setRequiresAuth:n,setHasAuthRequiredTools:r,setIsSignedIn:i,setError:a}=os.getState();t(`connecting`),a(null),await RD.close();let o=!1;try{(await nS(e))?.authorization_servers?.length&&(o=!0)}catch{}n(o);let s=o?new LD:null,c=!!s?.tokens();zD=s;let l=(e,n)=>{i(!1),r(!1),t(n),n===`error`&&a(e instanceof Error?e.message:`Connection failed`)};try{await RD.connect(e,c&&s?s:void 0)}catch(t){if(!HD(t)||!s){l(t,`error`);return}try{await RD.close(),await RD.connect(e,s)}catch(e){l(e,HD(e)?`unauthenticated`:`error`);return}}let u=null;try{u=await RD.listTools()}catch{}i(!!s?.tokens()),r((u??[]).some(VD)),t(`authenticated`),u?PD.setQueryData([`list-tools`],u):PD.invalidateQueries({queryKey:[`list-tools`]})}async function WD(){let e=BD(),t=zD??new LD;zD=t,t.invalidateCredentials(`all`),await Yx(t,{serverUrl:e})}async function GD(e,t,n){let r=BD(),i=new LD,a=i.expectedState();if(!a||n!==a)throw i.invalidateCredentials(`verifier`),Error(`OAuth callback state mismatch: the response does not match the sign-in this browser started. Retry signing in.`);await Yx(i,{serverUrl:r,authorizationCode:e,iss:t}),i.invalidateCredentials(`verifier`),await UD()}async function KD(){zD?.invalidateCredentials(`all`),zD=null,await RD.close(),os.getState().reset(),PD.invalidateQueries({queryKey:[`list-tools`]})}var qD=()=>{let e=fs();return{...e,view:{mode:e.displayMode},toolInput:{},toolOutput:null,toolResponseMetadata:null,widgetState:null}},JD=()=>{let{data:e}=st({queryKey:[`list-tools`],queryFn:()=>RD.listTools()});return e},YD=()=>{if(os(e=>e.status)===`authenticated`)return RD.getServerInfo()},XD=()=>{let{setToolData:e}=bD();return ct({mutationFn:async({toolName:t,args:n})=>{e(t,{input:n??{},response:void 0,durationMs:null,openaiRef:null,openaiLogs:[],openaiObject:null,openInAppUrl:null});let r=performance.now(),i=await RD.callTool(t,n);gC(i,t);let a=Math.round(performance.now()-r),o=Date.now();return e(t,{input:n??{},response:i,durationMs:a,openaiRef:null,openaiLogs:[{id:crypto.randomUUID(),timestamp:o-a,source:`server`,command:`callTool`,args:{name:t,args:n??{}},type:`default`},{id:crypto.randomUUID(),timestamp:o,source:`server`,command:`callTool response`,args:i,type:`response`}],openaiObject:{...qD(),toolInput:n??{},toolOutput:i.structuredContent,toolResponseMetadata:i.meta??null,widgetState:null},openInAppUrl:null}),i}})},ZD=()=>{let[e]=ND();return JD().find(t=>t.name===e)??null},roe=()=>{let e=ZD();if(!e)throw Error(`No tool is currently selected`);return e},ioe=e=>st({queryKey:[`resource`,e],queryFn:async()=>{if(!e)throw Error(`Resource URI is required`);return await RD.readResource(e)}}),QD=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Li(`Primitive.${t}`),r=b.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,H.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function $D(e,t){e&&SC.flushSync(()=>e.dispatchEvent(t))}var aoe=`Separator`,eO=`horizontal`,ooe=[`horizontal`,`vertical`],tO=b.forwardRef((e,t)=>{let{decorative:n,orientation:r=eO,...i}=e,a=soe(r)?r:eO,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,H.jsx)(QD.div,{"data-orientation":a,...o,...i,ref:t})});tO.displayName=aoe;function soe(e){return ooe.includes(e)}var nO=tO;function rO({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,H.jsx)(nO,{"data-slot":`separator`,decorative:n,orientation:t,className:Mr(`shrink-0 bg-border-secondary`,`data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full`,`data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}var coe={idle:{bg:`bg-gray-100`,dot:`bg-gray-400`,text:`text-gray-600`,label:`Disconnected`},connecting:{bg:`bg-yellow-100`,dot:`bg-yellow-500`,text:`text-yellow-800`,label:`Connecting...`},authenticated:{bg:`bg-green-100`,dot:`bg-green-500`,text:`text-green-800`,label:`Connected`},unauthenticated:{bg:`bg-orange-100`,dot:`bg-orange-500`,text:`text-orange-800`,label:`Login required`},error:{bg:`bg-red-100`,dot:`bg-red-500`,text:`text-red-800`,label:`Error`}};function loe({status:e}){let t=coe[e];return(0,H.jsxs)(`span`,{className:`flex items-center gap-1 rounded-full ${t.bg} px-2 py-0.5 text-xs font-semibold ${t.text}`,children:[(0,H.jsx)(`span`,{className:`h-2 w-2 rounded-full ${t.dot} mr-1 inline-block`}),t.label]})}var uoe=Ni([`w-full rounded-md border px-4 py-3`,`grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 items-start`,`[&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:mt-0.5`,`[&>:not(svg)]:col-start-2`].join(` `),{variants:{variant:{default:`bg-muted border-border [&>svg]:text-muted-foreground`,destructive:`bg-destructive/10 border-destructive/30 [&>svg]:text-destructive`,warning:`bg-badge-warning/10 border-badge-warning/30 [&>svg]:text-badge-warning`,success:`bg-badge-success/10 border-badge-success/30 [&>svg]:text-badge-success`}},defaultVariants:{variant:`default`}});function doe({className:e,variant:t,...n}){return(0,H.jsx)(`div`,{role:`alert`,className:Mr(uoe({variant:t}),e),...n})}function foe({className:e,...t}){return(0,H.jsx)(`p`,{className:Mr(`type-text-sm font-semibold leading-snug`,e),...t})}function poe({className:e,...t}){return(0,H.jsx)(`div`,{className:Mr(`type-text-sm text-muted-foreground [&_p]:leading-relaxed`,e),...t})}function iO({title:e,description:t,className:n}){return(0,H.jsxs)(doe,{variant:`warning`,className:n,children:[(0,H.jsx)(Oi,{}),(0,H.jsx)(foe,{children:e}),(0,H.jsx)(poe,{children:t})]})}var moe=Object.defineProperty,aO=(e,t)=>moe(e,`name`,{value:t,configurable:!0}),oO=!!(typeof window<`u`&&window.document&&window.document.createElement);function sO(e,t,{checkForDefaultPrevented:n=!0}={}){return aO(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}aO(sO,`composeEventHandlers`);function hoe(e){if(!oO)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}aO(hoe,`getOwnerWindow`);function cO(e){if(!oO)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}aO(cO,`getOwnerDocument`);function lO(e,t=!1){let{activeElement:n}=cO(e);if(!n?.nodeName)return null;if(uO(n)&&n.contentDocument)return lO(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=cO(n).getElementById(e);if(t)return t}}return n}aO(lO,`getActiveElement`);function uO(e){return e.tagName===`IFRAME`}aO(uO,`isFrame`);function dO(e,t=[]){let n=[];function r(t,r){let i=b.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=b.useMemo(()=>o,Object.values(o));return(0,H.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=b.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>b.createContext(e));return function(n){let r=n?.[e]||t;return b.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,goe(i,...t)]}function goe(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function fO(e){let t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>((...e)=>t.current?.(...e)),[])}var _oe=Object.defineProperty,pO=(e,t)=>_oe(e,`name`,{value:t,configurable:!0}),mO=`dismissableLayer.update`,voe=`dismissableLayer.pointerDownOutside`,yoe=`dismissableLayer.focusOutside`,hO,gO=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),_O=b.forwardRef(pO(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=b.useContext(gO),[d,f]=b.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=b.useState({}),h=Ii(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=y>=v,C=b.useRef(!1),w=yO(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:b.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=bO(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?y===g.length-1:!1,D=fO(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return b.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),b.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(hO=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),xO(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=hO))}},[d,p,n,u]),b.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),xO())},[d,u]),b.useEffect(()=>{let e=pO(()=>m({}),`handleUpdate`);return document.addEventListener(mO,e),()=>document.removeEventListener(mO,e)},[]),(0,H.jsx)(QD.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:sO(e.onFocusCapture,T.onFocusCapture),onBlurCapture:sO(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:sO(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function vO(){let e=b.useContext(gO),[t,n]=b.useState(null);return b.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}pO(vO,`useDismissableLayerSurface`);var boe=pO(()=>!0,`IS_TRUE`);function yO(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=boe}=t,s=fO(e),c=b.useRef(!1),l=b.useRef(!1),u=b.useRef(new Map),d=b.useRef(()=>{});return b.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}pO(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}pO(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}pO(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}pO(p,`handleInteractionBubble`);let m=pO(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||SO(voe,s,p,{discrete:!0})};if(pO(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:pO(()=>c.current=!0,`onPointerDownCapture`)}}pO(yO,`usePointerDownOutside`);function bO(e,t=globalThis?.document){let n=fO(e),r=b.useRef(!1);return b.useEffect(()=>{let e=pO(e=>{e.target&&!r.current&&SO(yoe,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:pO(()=>r.current=!0,`onFocusCapture`),onBlurCapture:pO(()=>r.current=!1,`onBlurCapture`)}}pO(bO,`useFocusOutside`);function xO(){let e=new CustomEvent(mO);document.dispatchEvent(e)}pO(xO,`dispatchUpdate`);function SO(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?$D(i,a):i.dispatchEvent(a)}pO(SO,`handleAndDispatchCustomEvent`);var CO=0,wO=null;function TO(){b.useEffect(()=>{wO||={start:EO(),end:EO()};let{start:e,end:t}=wO;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),CO++,()=>{CO===1&&(wO?.start.remove(),wO?.end.remove(),wO=null),CO=Math.max(0,CO-1)}},[])}function EO(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var xoe=Object.defineProperty,DO=(e,t)=>xoe(e,`name`,{value:t,configurable:!0}),OO=`focusScope.autoFocusOnMount`,kO=`focusScope.autoFocusOnUnmount`,AO={bubbles:!1,cancelable:!0},jO=b.forwardRef(DO(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=b.useState(null),l=fO(i),u=fO(a),d=b.useRef(null),f=Ii(t,c),p=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:RO(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||RO(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&RO(s)};DO(e,`handleFocusIn`),DO(t,`handleFocusOut`),DO(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),b.useEffect(()=>{if(s){zO.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(OO,AO);s.addEventListener(OO,l),s.dispatchEvent(t),t.defaultPrevented||(MO(HO(PO(s)),{select:!0}),document.activeElement===e&&RO(s))}return()=>{s.removeEventListener(OO,l),setTimeout(()=>{let t=new CustomEvent(kO,AO);s.addEventListener(kO,u),s.dispatchEvent(t),t.defaultPrevented||RO(e??document.body,{select:!0}),s.removeEventListener(kO,u),zO.remove(p)},0)}}},[s,l,u,p]);let m=b.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=NO(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&RO(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&RO(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,H.jsx)(QD.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function MO(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(RO(r,{select:t}),document.activeElement!==n)return}DO(MO,`focusFirst`);function NO(e){let t=PO(e);return[FO(t,e),FO(t.reverse(),e)]}DO(NO,`getTabbableEdges`);function PO(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:DO(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}DO(PO,`getTabbableCandidates`);function FO(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):IO(r,{upTo:t})))return r}DO(FO,`findVisible`);function IO(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}DO(IO,`isHidden`);function LO(e){return e instanceof HTMLInputElement&&`select`in e}DO(LO,`isSelectableInput`);function RO(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&LO(e)&&t&&e.select()}}DO(RO,`focus`);var zO=BO();function BO(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=VO(e,t),e.unshift(t)},remove(t){e=VO(e,t),e[0]?.resume()}}}DO(BO,`createFocusScopesStack`);function VO(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}DO(VO,`arrayRemove`);function HO(e){return e.filter(e=>e.tagName!==`A`)}DO(HO,`removeLinks`);var UO=globalThis?.document?b.useLayoutEffect:()=>{},WO=b.useId||(()=>void 0),GO=0;function KO(e){let[t,n]=b.useState(WO());return UO(()=>{e||n(e=>e??String(GO++))},[e]),e||(t?`radix-${t}`:``)}var qO=[`top`,`right`,`bottom`,`left`],JO=Math.min,YO=Math.max,XO=Math.round,ZO=Math.floor,QO=e=>({x:e,y:e}),$O={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ek(e,t,n){return YO(e,JO(t,n))}function tk(e,t){return typeof e==`function`?e(t):e}function nk(e){return e.split(`-`)[0]}function rk(e){return e.split(`-`)[1]}function ik(e){return e===`x`?`y`:`x`}function ak(e){return e===`y`?`height`:`width`}function ok(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function sk(e){return ik(ok(e))}function ck(e,t,n){n===void 0&&(n=!1);let r=rk(e),i=sk(e),a=ak(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=_k(o)),[o,_k(o)]}function lk(e){let t=_k(e);return[uk(e),t,uk(t)]}function uk(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var dk=[`left`,`right`],fk=[`right`,`left`],pk=[`top`,`bottom`],mk=[`bottom`,`top`];function hk(e,t,n){switch(e){case`top`:case`bottom`:return n?t?fk:dk:t?dk:fk;case`left`:case`right`:return t?pk:mk;default:return[]}}function gk(e,t,n,r){let i=rk(e),a=hk(nk(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(uk)))),a}function _k(e){let t=nk(e);return $O[t]+e.slice(t.length)}function vk(e){return{top:0,right:0,bottom:0,left:0,...e}}function yk(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:vk(e)}function bk(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function xk(e,t,n){let{reference:r,floating:i}=e,a=ok(t),o=sk(t),s=ak(o),c=nk(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(rk(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Sk(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=tk(t,e),p=yk(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=bk(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=bk(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ck=50,wk=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Sk},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=xk(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ck&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=xk(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Tk=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=tk(e,t)||{};if(l==null)return{};let d=yk(u),f={x:n,y:r},p=sk(i),m=ak(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=JO(d[_],T),D=JO(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=ek(O,A,k),M=!c.arrow&&rk(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),Ek=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=tk(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=nk(r),_=ok(o),v=nk(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[_k(o)]:lk(o)),x=p!==`none`;!d&&x&&b.push(...gk(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ck(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==ok(t))||T.every(e=>ok(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=ok(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Dk(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ok(e){return qO.some(t=>e[t]>=0)}var kk=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=tk(e,t);switch(i){case`referenceHidden`:{let e=Dk(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ok(e)}}}case`escaped`:{let e=Dk(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ok(e)}}}default:return{}}}}},Ak=new Set([`left`,`top`]);async function jk(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=nk(n),s=rk(n),c=ok(n)===`y`,l=Ak.has(o)?-1:1,u=a&&c?-1:1,d=tk(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Mk=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await jk(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Nk=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=tk(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=ok(nk(i)),p=ik(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=ek(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=ek(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Pk=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=tk(e,t),u={x:n,y:r},d=ok(i),f=ik(d),p=u[f],m=u[d],h=tk(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ak.has(nk(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Fk=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=tk(e,t),u=await o.detectOverflow(t,l),d=nk(i),f=rk(i),p=ok(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=JO(h-u[g],v),x=JO(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=YO(u.left,0),t=YO(u.right,0),n=YO(u.top,0),r=YO(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:YO(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:YO(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Ik(){return typeof window<`u`}function Lk(e){return Bk(e)?(e.nodeName||``).toLowerCase():`#document`}function Rk(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zk(e){return((Bk(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Bk(e){return Ik()?e instanceof Node||e instanceof Rk(e).Node:!1}function Vk(e){return Ik()?e instanceof Element||e instanceof Rk(e).Element:!1}function Hk(e){return Ik()?e instanceof HTMLElement||e instanceof Rk(e).HTMLElement:!1}function Uk(e){return!Ik()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Rk(e).ShadowRoot}function Wk(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=tA(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Gk(e){return/^(table|td|th)$/.test(Lk(e))}function Kk(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var qk=/transform|translate|scale|rotate|perspective|filter/,Jk=/paint|layout|strict|content/,Yk=e=>!!e&&e!==`none`,Xk;function Zk(e){let t=Vk(e)?tA(e):e;return Yk(t.transform)||Yk(t.translate)||Yk(t.scale)||Yk(t.rotate)||Yk(t.perspective)||!$k()&&(Yk(t.backdropFilter)||Yk(t.filter))||qk.test(t.willChange||``)||Jk.test(t.contain||``)}function Qk(e){let t=rA(e);for(;Hk(t)&&!eA(t);){if(Zk(t))return t;if(Kk(t))return null;t=rA(t)}return null}function $k(){return Xk??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Xk}function eA(e){return/^(html|body|#document)$/.test(Lk(e))}function tA(e){return Rk(e).getComputedStyle(e)}function nA(e){return Vk(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rA(e){if(Lk(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Uk(e)&&e.host||zk(e);return Uk(t)?t.host:t}function iA(e){let t=rA(e);return eA(t)?e.ownerDocument?e.ownerDocument.body:e.body:Hk(t)&&Wk(t)?t:iA(t)}function aA(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=iA(e),i=r===e.ownerDocument?.body,a=Rk(r);if(i){let e=oA(a);return t.concat(a,a.visualViewport||[],Wk(r)?r:[],e&&n?aA(e):[])}else return t.concat(r,aA(r,[],n))}function oA(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sA(e){let t=tA(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Hk(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=XO(n)!==a||XO(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function cA(e){return Vk(e)?e:e.contextElement}function lA(e){let t=cA(e);if(!Hk(t))return QO(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=sA(t),o=(a?XO(n.width):n.width)/r,s=(a?XO(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Soe=QO(0);function uA(e){let t=Rk(e);return!$k()||!t.visualViewport?Soe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Coe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Rk(e)?!1:t}function dA(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=cA(e),o=QO(1);t&&(r?Vk(r)&&(o=lA(r)):o=lA(e));let s=Coe(a,n,r)?uA(a):QO(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Rk(a),t=r&&Vk(r)?Rk(r):r,n=e,i=oA(n);for(;i&&r&&t!==n;){let e=lA(i),t=i.getBoundingClientRect(),r=tA(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Rk(i),i=oA(n)}}return bk({width:u,height:d,x:c,y:l})}function fA(e,t){let n=nA(e).scrollLeft;return t?t.left+n:dA(zk(e)).left+n}function pA(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-fA(e,n),y:n.top+t.scrollTop}}function woe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=zk(r),s=t?Kk(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=QO(1),u=QO(0),d=Hk(r);if((d||!d&&!a)&&((Lk(r)!==`body`||Wk(o))&&(c=nA(r)),d)){let e=dA(r);l=lA(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?pA(o,c):QO(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Toe(e){return Array.from(e.getClientRects())}function Eoe(e){let t=zk(e),n=nA(e),r=e.ownerDocument.body,i=YO(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=YO(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+fA(e),s=-n.scrollTop;return tA(r).direction===`rtl`&&(o+=YO(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var mA=25;function Doe(e,t){let n=Rk(e),r=zk(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=$k();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=fA(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=mA&&(a-=o)}else l<=mA&&(a+=l);return{width:a,height:o,x:s,y:c}}function Ooe(e,t){let n=dA(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Hk(e)?lA(e):QO(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function hA(e,t,n){let r;if(t===`viewport`)r=Doe(e,n);else if(t===`document`)r=Eoe(zk(e));else if(Vk(t))r=Ooe(t,n);else{let n=uA(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return bk(r)}function gA(e,t){let n=rA(e);return n===t||!Vk(n)||eA(n)?!1:tA(n).position===`fixed`||gA(n,t)}function koe(e,t){let n=t.get(e);if(n)return n;let r=aA(e,[],!1).filter(e=>Vk(e)&&Lk(e)!==`body`),i=null,a=tA(e).position===`fixed`,o=a?rA(e):e;for(;Vk(o)&&!eA(o);){let t=tA(o),n=Zk(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Wk(o)&&!n&&gA(e,o))?r=r.filter(e=>e!==o):i=t,o=rA(o)}return t.set(e,r),r}function Aoe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Kk(t)?[]:koe(t,this._c):[].concat(n),r],o=hA(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=hA(t,a[e],i);s=YO(n.top,s),c=JO(n.right,c),l=JO(n.bottom,l),u=YO(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function joe(e){let{width:t,height:n}=sA(e);return{width:t,height:n}}function Moe(e,t,n){let r=Hk(t),i=zk(t),a=n===`fixed`,o=dA(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=QO(0);function l(){c.x=fA(i)}if(r||!r&&!a)if((Lk(t)!==`body`||Wk(i))&&(s=nA(t)),r){let e=dA(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?pA(i,s):QO(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function _A(e){return tA(e).position===`static`}function vA(e,t){if(!Hk(e)||tA(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return zk(e)===n&&(n=n.ownerDocument.body),n}function yA(e,t){let n=Rk(e);if(Kk(e))return n;if(!Hk(e)){let t=rA(e);for(;t&&!eA(t);){if(Vk(t)&&!_A(t))return t;t=rA(t)}return n}let r=vA(e,t);for(;r&&Gk(r)&&_A(r);)r=vA(r,t);return r&&eA(r)&&_A(r)&&!Zk(r)?n:r||Qk(e)||n}var Noe=async function(e){let t=this.getOffsetParent||yA,n=this.getDimensions,r=await n(e.floating);return{reference:Moe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Poe(e){return tA(e).direction===`rtl`}var Foe={convertOffsetParentRelativeRectToViewportRelativeRect:woe,getDocumentElement:zk,getClippingRect:Aoe,getOffsetParent:yA,getElementRects:Noe,getClientRects:Toe,getDimensions:joe,getScale:lA,isElement:Vk,isRTL:Poe};function bA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ioe(e,t){let n=null,r,i=zk(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=ZO(d),h=ZO(i.clientWidth-(u+f)),g=ZO(i.clientHeight-(d+p)),_=ZO(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:YO(0,JO(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!bA(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function xA(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=cA(e),u=i||a?[...l?aA(l):[],...t?aA(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ioe(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?dA(e):null;c&&g();function g(){let t=dA(e);h&&!bA(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Loe=Mk,Roe=Nk,zoe=Ek,Boe=Fk,Voe=kk,SA=Tk,Hoe=Pk,Uoe=(e,t,n)=>{let r=new Map,i={platform:Foe,...n},a={...i.platform,_c:r};return wk(e,t,{...i,platform:a})},CA=typeof document<`u`?b.useLayoutEffect:function(){};function wA(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!wA(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!wA(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function TA(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function EA(e,t){let n=TA(e);return Math.round(t*n)/n}function DA(e){let t=b.useRef(e);return CA(()=>{t.current=e}),t}function OA(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=b.useState(r);wA(f,r)||p(r);let[m,h]=b.useState(null),[g,_]=b.useState(null),v=b.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),y=b.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=b.useRef(null),w=b.useRef(null),T=b.useRef(u),E=c!=null,D=DA(c),O=DA(i),k=DA(l),A=b.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Uoe(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!wA(T.current,t)&&(T.current=t,SC.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);CA(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=b.useRef(!1);CA(()=>(j.current=!0,()=>{j.current=!1}),[]),CA(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=b.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:y}),[v,y]),N=b.useMemo(()=>({reference:x,floating:S}),[x,S]),P=b.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=EA(N.floating,u.x),r=EA(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...TA(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return b.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Woe=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:SA({element:r.current,padding:i}).fn(n):r?SA({element:r,padding:i}).fn(n):{}}}},kA=(e,t)=>{let n=Loe(e);return{name:n.name,fn:n.fn,options:[e,t]}},AA=(e,t)=>{let n=Roe(e);return{name:n.name,fn:n.fn,options:[e,t]}},jA=(e,t)=>({fn:Hoe(e).fn,options:[e,t]}),MA=(e,t)=>{let n=zoe(e);return{name:n.name,fn:n.fn,options:[e,t]}},NA=(e,t)=>{let n=Boe(e);return{name:n.name,fn:n.fn,options:[e,t]}},PA=(e,t)=>{let n=Voe(e);return{name:n.name,fn:n.fn,options:[e,t]}},FA=(e,t)=>{let n=Woe(e);return{name:n.name,fn:n.fn,options:[e,t]}};function IA(e){let[t,n]=b.useState(void 0);return UO(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var Goe=Object.defineProperty,LA=(e,t)=>Goe(e,`name`,{value:t,configurable:!0}),RA=`Popper`,[zA,BA]=dO(RA),[Koe,VA]=zA(RA),qoe=LA(e=>{let{__scopePopper:t,children:n}=e,[r,i]=b.useState(null),[a,o]=b.useState(void 0);return(0,H.jsx)(Koe,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Joe=`PopperAnchor`,Yoe=b.forwardRef(LA(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=VA(Joe,n),o=b.useRef(null),s=a.onAnchorChange,c=Ii(t,b.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=b.useRef(null);b.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&WA(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,H.jsx)(QD.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),HA=`PopperContent`,[Xoe,Zoe]=zA(HA),Qoe=b.forwardRef(LA(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=VA(HA,n),[_,v]=b.useState(null),y=Ii(t,v),[x,S]=b.useState(null),C=IA(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(UA),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=OA({strategy:`fixed`,placement:E,whileElementsMounted:LA((...e)=>xA(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[kA({mainAxis:i+T,alignmentAxis:o}),c&&AA({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?jA():void 0,...A}),c&&MA({...A}),NA({...A,apply:LA(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&FA({element:x,padding:s}),$oe({arrowWidth:w,arrowHeight:T}),f&&PA({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),I=g.setPlacementState;UO(()=>(I(N),()=>{I(void 0)}),[N,I]);let[L,ee]=WA(N),te=fO(m);UO(()=>{P&&te?.()},[P,te]);let ne=F.arrow?.x,R=F.arrow?.y,z=F.arrow?.centerOffset!==0,[B,re]=b.useState();return UO(()=>{_&&re(window.getComputedStyle(_).zIndex)},[_]),(0,H.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:B,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,H.jsx)(Xoe,{scope:n,placedSide:L,placedAlign:ee,onArrowChange:S,arrowX:ne,arrowY:R,shouldHideArrow:z,children:(0,H.jsx)(QD.div,{"data-side":L,"data-align":ee,...h,ref:y,style:{...h.style,animation:P?h.style?.animation:`none`}})})})},`PopperContent`));function UA(e){return e!==null}LA(UA,`isNotNull`);var $oe=LA(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=WA(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function WA(e){let[t,n=`center`]=e.split(`-`);return[t,n]}LA(WA,`getSideAndAlignFromPlacement`);var GA=qoe,KA=Yoe,qA=Qoe,ese=Object.defineProperty,JA=b.forwardRef(((e,t)=>ese(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=b.useState(!1);UO(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?SC.createPortal((0,H.jsx)(QD.div,{...r,ref:t}),o):null},`Portal`)),tse=Object.defineProperty,YA=(e,t)=>tse(e,`name`,{value:t,configurable:!0});function XA(e,t){return b.useReducer((e,n)=>t[e][n]??e,e)}YA(XA,`useStateMachine`);var ZA=YA(e=>{let{present:t,children:n}=e,r=QA(t),i=typeof n==`function`?n({present:r.isPresent}):b.Children.only(n),a=ej(r.ref,nj(i));return typeof n==`function`||r.isPresent?b.cloneElement(i,{ref:a}):null},`Presence`);function QA(e){let[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),a=b.useRef(`none`),o=b.useRef(void 0),[s,c]=XA(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return b.useEffect(()=>{s===`mounted`?(a.current=o.current??tj(r.current),o.current=void 0):a.current=`none`},[s]),UO(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=tj(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),UO(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=YA(a=>{let o=tj(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=YA(e=>{e.target===t&&(a.current=tj(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:b.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=tj(t)}else r.current=null;n(e)},[])}}YA(QA,`usePresence`);function $A(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}YA($A,`setRef`);function ej(...e){let t=b.useRef(e);return t.current=e,b.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=$A(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():$A(n[e],null)}}},[])}YA(ej,`useStableComposedRefs`);function tj(e){return e?.animationName||`none`}YA(tj,`getAnimationName`);function nj(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}YA(nj,`getElementRef`);var rj=b.useEffectEvent,ij=b.useInsertionEffect;function nse(e){if(typeof rj==`function`)return rj(e);let t=b.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof ij==`function`?ij(()=>{t.current=e}):UO(()=>{t.current=e}),b.useMemo(()=>((...e)=>t.current?.(...e)),[])}var rse=Object.defineProperty,aj=(e,t)=>rse(e,`name`,{value:t,configurable:!0}),ise=b.useInsertionEffect||UO;function oj({prop:e,defaultProp:t,onChange:n=aj(()=>{},`onChange`),caller:r}){let[i,a,o]=sj({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,b.useCallback(t=>{if(s){let n=cj(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}aj(oj,`useControllableState`);function sj({defaultProp:e,onChange:t}){let[n,r]=b.useState(e),i=b.useRef(n),a=b.useRef(t);return ise(()=>{a.current=t},[t]),b.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}aj(sj,`useUncontrolledState`);function cj(e){return typeof e==`function`}aj(cj,`isFunction`);var lj=Symbol(`RADIX:SYNC_STATE`);function ase(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=nse(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=b.useReducer((t,n)=>{if(n.type===lj)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=b.useRef(p);b.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=b.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return b.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:lj,state:i})},[i,d.state,c]),[h,f]}aj(ase,`useControllableStateReducer`);var ose=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},uj=new WeakMap,dj=new WeakMap,fj={},pj=0,mj=function(e){return e&&(e.host||mj(e.parentNode))},sse=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=mj(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},cse=function(e,t,n,r){var i=sse(t,Array.isArray(e)?e:[e]);fj[n]||(fj[n]=new WeakMap);var a=fj[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(uj.get(e)||0)+1,l=(a.get(e)||0)+1;uj.set(e,c),a.set(e,l),o.push(e),c===1&&i&&dj.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),pj++,function(){o.forEach(function(e){var t=uj.get(e)-1,i=a.get(e)-1;uj.set(e,t),a.set(e,i),t||(dj.has(e)||e.removeAttribute(r),dj.delete(e)),i||e.removeAttribute(n)}),pj--,pj||(uj=new WeakMap,uj=new WeakMap,dj=new WeakMap,fj={})}},hj=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ose(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),cse(r,i,n,`aria-hidden`)):function(){return null}},gj=function(){return gj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},gj.apply(this,arguments)};function _j(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function vj(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function yj(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function bj(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var xj=`right-scroll-bar-position`,Sj=`width-before-scroll-bar`,Cj=`with-scroll-bars-hidden`,wj=`--removed-body-scroll-bar-size`;function Tj(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ej(e,t){var n=(0,b.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Dj=typeof window<`u`?b.useLayoutEffect:b.useEffect,Oj=new WeakMap;function kj(e,t){var n=Ej(t||null,function(t){return e.forEach(function(e){return Tj(e,t)})});return Dj(function(){var t=Oj.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Tj(e,null)}),i.forEach(function(e){r.has(e)||Tj(e,a)})}Oj.set(n,e)},[e]),n}function Aj(e){return e}function jj(e,t){t===void 0&&(t=Aj);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Mj(e){e===void 0&&(e={});var t=jj(null);return t.options=gj({async:!0,ssr:!1},e),t}var Nj=function(e){var t=e.sideCar,n=_j(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return b.createElement(r,gj({},n))};Nj.isSideCarExport=!0;function Pj(e,t){return e.useMedium(t),Nj}var Fj=Mj(),Ij=function(){},Lj=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:Ij,onWheelCapture:Ij,onTouchMoveCapture:Ij}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,x=_j(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=kj([n,t]),w=gj(gj({},x),i);return b.createElement(b.Fragment,null,u&&b.createElement(S,{sideCar:Fj,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?b.cloneElement(b.Children.only(s),gj(gj({},w),{ref:C})):b.createElement(v,gj({},w,{className:c,ref:C}),s))});Lj.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Lj.classNames={fullWidth:Sj,zeroRight:xj};var Rj,zj=function(){if(Rj)return Rj;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Bj(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=zj();return t&&e.setAttribute(`nonce`,t),e}function Vj(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Hj(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Uj=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Bj())&&(Vj(t,n),Hj(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Wj=function(){var e=Uj();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Gj=function(){var e=Wj();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Kj={left:0,top:0,right:0,gap:0},qj=function(e){return parseInt(e||``,10)||0},Jj=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[qj(n),qj(r),qj(i)]},Yj=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Kj;var t=Jj(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Xj=Gj(),Zj=`data-scroll-locked`,Qj=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
78
+ `&&r++}}return[t,n]}var vx=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n}={}){let r;super({start(i){r=gx({onEvent:e=>{i.enqueue(e)},onError(t){e===`terminate`?i.error(t):typeof e==`function`&&e(t)},onRetry:t,onComment:n})},transform(e){r.feed(e)}})}},yx=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthClientFlowError`})}static[Symbol.hasInstance](e){return pv(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return pv(this,e)}constructor(e){super(e),this.name=new.target.name,fv(this,new.target)}},bx=class extends yx{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.IssuerMismatchError`})}kind;expected;received;constructor(e,t,n){super(`Issuer mismatch in ${e===`metadata`?`authorization server metadata (RFC 8414 §3.3)`:`authorization response (RFC 9207)`}: expected ${JSON.stringify(t)}, received ${JSON.stringify(n)}`),this.kind=e,this.expected=t,this.received=n}},xx=class extends yx{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.RegistrationRejectedError`})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`),this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},Sx=class extends yx{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsecureTokenEndpointError`})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},Cx=class extends yx{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.AuthorizationServerMismatchError`})}constructor(e,t){super(`Authorization server changed between redirect and callback (redirected to ${JSON.stringify(e)}, callback resolved ${JSON.stringify(t)}); refusing to send authorization_code/code_verifier to a different token endpoint`),this.recordedIssuer=e,this.currentIssuer=t}},wx=class extends yx{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsufficientScopeError`})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:``}`),this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}};function Tx(e,t,n){if(e!==void 0)return e.issuer===void 0?(n?.canPersistStamp!==!1&&console.warn(`[mcp-sdk] SEP-2352: stored OAuth credential has no 'issuer' stamp (pre-upgrade storage or provider not round-tripping the value). SEP-2352 isolation is inactive for this read; ensure your provider round-trips the issuer field.`),e):Ex(e.issuer,t)?e:void 0}function Ex(e,t){return e===t||e.endsWith(`/`)&&e.slice(0,-1)===t||t.endsWith(`/`)&&t.slice(0,-1)===e}function Dx(e){if(e==null)return!1;let t=e;return typeof t.tokens==`function`&&typeof t.clientInformation==`function`}async function Ox(e,t,n){let{resourceMetadataUrl:r,scope:i}=eS(t.response);if(await Yx(e,{serverUrl:t.serverUrl,resourceMetadataUrl:r,scope:i,fetchFn:t.fetchFn,...n})!==`AUTHORIZED`)throw new Ax}function kx(e,t){return{token:async()=>(await e.tokens())?.access_token,onUnauthorized:async n=>Ox(e,n,t)}}var Ax=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnauthorizedError`})}static[Symbol.hasInstance](e){return pv(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return pv(this,e)}constructor(e){super(e??`Unauthorized`),this.name=`UnauthorizedError`,fv(this,new.target)}};function jx(e){return e?.authorization_response_iss_parameter_supported===!0}function Mx({iss:e,expectedIssuer:t,issParameterSupported:n}){if(t!==void 0){if(e===void 0){if(n)throw new bx(`authorization_response`,t,void 0);return}if(e!==t)throw new bx(`authorization_response`,t,e)}}function Nx(...e){let t=new Set;for(let n of e)if(n)for(let e of n.split(/\s+/))e&&t.add(e);return t.size>0?[...t].join(` `):void 0}function Px(e,t){if(!e)return!1;let n=new Set((t??``).split(/\s+/).filter(Boolean));for(let t of e.split(/\s+/))if(t&&!n.has(t))return!0;return!1}async function Fx(e,t,n,r,i){if(typeof e==`string`)return{authorizationCode:e,iss:t};let a=e.get(`iss`)??void 0,o=e.get(`code`);if(o)return{authorizationCode:o,iss:a};let s=(await n.discoveryState?.())?.authorizationServerMetadata;if(!s)try{s=(await uS(r,i)).authorizationServerMetadata}catch{s=void 0}if(!s)throw new Ax(`Authorization callback failed and the issuer could not be verified`);Mx({iss:a,expectedIssuer:s.issuer,issParameterSupported:jx(s)});let c=e.get(`error`);throw c?new hv(c,e.get(`error_description`)??c,e.get(`error_uri`)??void 0):new Ax("Authorization callback contained neither `code` nor `error`")}function Ix(e){return[`client_secret_basic`,`client_secret_post`,`none`].includes(e)}var Lx=`code`,Rx=`S256`;function zx(e,t){let n=e.client_secret!==void 0;return`token_endpoint_auth_method`in e&&e.token_endpoint_auth_method&&Ix(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?`client_secret_basic`:`none`:n&&t.includes(`client_secret_basic`)?`client_secret_basic`:n&&t.includes(`client_secret_post`)?`client_secret_post`:t.includes(`none`)?`none`:n?`client_secret_post`:`none`}function Bx(e,t,n,r){let{client_id:i,client_secret:a}=t;switch(e){case`client_secret_basic`:Vx(i,a,n);return;case`client_secret_post`:Hx(i,a,r);return;case`none`:Ux(i,r);return;default:throw Error(`Unsupported client authentication method: ${e}`)}}function Vx(e,t,n){if(!t)throw Error(`client_secret_basic authentication requires a client_secret`);let r=btoa(`${e}:${t}`);n.set(`Authorization`,`Basic ${r}`)}function Hx(e,t,n){n.set(`client_id`,e),t&&n.set(`client_secret`,t)}function Ux(e,t){t.set(`client_id`,e)}function Wx(e){return e===`localhost`||e===`127.0.0.1`||e===`[::1]`||e===`::1`}function Gx(e){let t=new URL(String(e));if(t.protocol!==`https:`&&!Wx(t.hostname))throw new Sx(t.href);return t}function Kx(e){for(let t of e??[]){let e;try{e=new URL(t)}catch{continue}if(e.protocol!==`http:`&&e.protocol!==`https:`||Wx(e.hostname))return`native`}return`web`}function qx(e){let t=e.clientMetadata;return{...t,grant_types:t.grant_types??(e.redirectUrl===void 0?void 0:[`authorization_code`,`refresh_token`]),application_type:t.application_type??Kx(t.redirect_uris)}}async function Jx(e){let t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{let e=iv.parse(JSON.parse(n));return hv.fromResponse(e)}catch(e){let r=`${t?`HTTP ${t}: `:``}Invalid OAuth error response: ${e}. Raw body: ${n}`;return new hv(mv.ServerError,r)}}async function Yx(e,t){try{return await Zx(e,t)}catch(n){if(n instanceof hv){if(n.code===mv.InvalidClient||n.code===mv.UnauthorizedClient)return await e.invalidateCredentials?.(`client`),await e.invalidateCredentials?.(`tokens`),await Zx(e,t);if(n.code===mv.InvalidGrant)return await e.invalidateCredentials?.(`tokens`),await Zx(e,t)}throw n}}function Xx(e){let{requestedScope:t,resourceMetadata:n,authServerMetadata:r,clientMetadata:i}=e,a=t||n?.scopes_supported?.join(` `)||i.scope;return a&&r?.scopes_supported?.includes(`offline_access`)&&!a.split(` `).includes(`offline_access`)&&i.grant_types?.includes(`refresh_token`)&&(a=`${a} offline_access`),a}async function Zx(e,{serverUrl:t,authorizationCode:n,iss:r,scope:i,resourceMetadataUrl:a,fetchFn:o,skipIssuerMetadataValidation:s,forceReauthorization:c}){let l=qx(e),u=await e.discoveryState?.(),d,f,p,m,h=a;if(!h&&u?.resourceMetadataUrl&&(h=new URL(u.resourceMetadataUrl)),u?.authorizationServerUrl){if(f=u.authorizationServerUrl,d=u.resourceMetadata,p=u.authorizationServerMetadata??await lS(f,{fetchFn:o,skipIssuerValidation:s}),!d)try{d=await nS(t,{resourceMetadataUrl:h},o)}catch(e){if(e instanceof TypeError)throw e}(p!==u.authorizationServerMetadata||d!==u.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(f),resourceMetadataUrl:h?.toString(),resourceMetadata:d,authorizationServerMetadata:p})}else{let e=await uS(t,{resourceMetadataUrl:h,fetchFn:o,skipIssuerMetadataValidation:s});f=e.authorizationServerUrl,p=e.authorizationServerMetadata,d=e.resourceMetadata,m={authorizationServerUrl:String(f),resourceMetadataUrl:h?.toString(),resourceMetadata:d,authorizationServerMetadata:p}}let g=p?.issuer??String(f),_={issuer:g};if(await e.saveAuthorizationServerUrl?.(g),n!==void 0){let t=u?.authorizationServerMetadata?.issuer??u?.authorizationServerUrl;if(t===void 0){if(e.saveDiscoveryState!==void 0)throw new Cx(`discoveryState was not available on the callback leg; ensure your provider persists discoveryState alongside codeVerifier`,g);console.warn(`[mcp-sdk] OAuthClientProvider does not implement saveDiscoveryState()/discoveryState(); the SEP-2352 callback-leg authorization-server binding cannot be checked. Implement discoveryState (persist alongside codeVerifier) — see docs/migration/upgrade-to-v2.md §SEP-2352.`)}else if(!Ex(t,g))throw new Cx(t,g)}m&&await e.saveDiscoveryState?.(m);let v=await $x(t,e,d);v&&await e.saveResourceUrl?.(String(v));let y=Xx({requestedScope:i,resourceMetadata:d,authServerMetadata:p,clientMetadata:e.clientMetadata}),b=await Promise.resolve(e.clientInformation(_)),x=Tx(b,g,{canPersistStamp:e.saveClientInformation!==void 0});if(x===void 0&&b?.issuer&&e.saveClientInformation===void 0)throw new Cx(b.issuer,g);if(x&&x.issuer===void 0&&(x={...x,issuer:g},await e.saveClientInformation?.(x,_)),!x){if(n!==void 0)throw Error(`Existing OAuth client information is required when exchanging an authorization code`);let t=p?.client_id_metadata_document_supported===!0,r=e.clientMetadataUrl;if(r&&!Qx(r))throw new hv(mv.InvalidClientMetadata,`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${r}`);if(t&&r)x={client_id:r,issuer:g},await e.saveClientInformation?.(x,_);else{if(!e.saveClientInformation)throw Error(`OAuth client information must be saveable for dynamic registration`);x={...await gS(f,{metadata:p,clientMetadata:l,scope:y,fetchFn:o}),issuer:g},await e.saveClientInformation(x,_)}}let S=!e.redirectUrl;if(n!==void 0||S){n!==void 0&&Mx({iss:r,expectedIssuer:p?.issuer,issParameterSupported:jx(p)});let t=await hS(e,f,{metadata:p,resource:v,authorizationCode:n,iss:r,scope:y,fetchFn:o});return await e.saveTokens({...t,issuer:g},_),`AUTHORIZED`}let C=Tx(await e.tokens(_),g);if(C&&C.issuer===void 0&&(C={...C,issuer:g},await e.saveTokens(C,_)),C?.refresh_token&&!c)try{let t=await mS(f,{metadata:p,clientInformation:x,refreshToken:C.refresh_token,resource:v,addClientAuthentication:e.addClientAuthentication,fetchFn:o});return await e.saveTokens({...t,issuer:g},_),`AUTHORIZED`}catch(e){if(e instanceof Sx||!(!(e instanceof hv)||e.code===mv.ServerError))throw e}let w=e.state?await e.state():void 0,{authorizationUrl:T,codeVerifier:E}=await dS(f,{metadata:p,clientInformation:x,state:w,redirectUrl:e.redirectUrl,scope:y,resource:v});return await e.saveCodeVerifier(E),await e.redirectToAuthorization(T),`REDIRECT`}function Qx(e){if(!e)return!1;try{let t=new URL(e);return t.protocol===`https:`&&t.pathname!==`/`}catch{return!1}}async function $x(e,t,n){let r=yee(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!bee({requestedResource:r,configuredResource:n.resource}))throw Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function eS(e){let t=e.headers.get(`WWW-Authenticate`);if(!t)return{};let[n,r]=t.split(` `);if(n?.toLowerCase()!==`bearer`||!r)return{};let i=tS(e,`resource_metadata`)||void 0,a;if(i)try{a=new URL(i)}catch{}let o=tS(e,`scope`)||void 0,s=tS(e,`error`)||void 0,c=tS(e,`error_description`)||void 0;return{resourceMetadataUrl:a,scope:o,error:s,errorDescription:c}}function tS(e,t){let n=e.headers.get(`WWW-Authenticate`);if(!n)return null;let r=new RegExp(String.raw`${t}=(?:"([^"]+)"|([^\s,]+))`),i=n.match(r);if(i){let e=i[1]||i[2];if(e)return e}return null}async function nS(e,t,n=fetch){let r=await sS(e,`oauth-protected-resource`,n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.text?.().catch(()=>{}),Error(`Resource server does not implement OAuth 2.0 Protected Resource Metadata.`);if(!r.ok)throw await r.text?.().catch(()=>{}),Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return Q_.parse(await r.json())}async function rS(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(!(r instanceof TypeError))throw r;if(t)try{return await n(e,{})}catch(e){if(!(e instanceof TypeError))throw e;return}return}}function iS(e,t=``,n={}){return t.endsWith(`/`)&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function aS(e,t,n=fetch){return await rS(e,{"MCP-Protocol-Version":t},n)}function oS(e,t){return e?t===`/`?!1:e.status>=400&&e.status<500||e.status===502:!0}async function sS(e,t,n,r){let i=new URL(e),a=r?.protocolVersion??`2025-11-25`,o;if(r?.metadataUrl)o=new URL(r.metadataUrl);else{let e=iS(t,i.pathname);o=new URL(e,r?.metadataServerUrl??i),o.search=i.search}let s=await aS(o,a,n);return!r?.metadataUrl&&oS(s,i.pathname)&&(s=await aS(new URL(`/.well-known/${t}`,i),a,n)),s}function cS(e){let t=typeof e==`string`?new URL(e):e,n=t.pathname!==`/`,r=[];if(!n)return r.push({url:new URL(`/.well-known/oauth-authorization-server`,t.origin),type:`oauth`},{url:new URL(`/.well-known/openid-configuration`,t.origin),type:`oidc`}),r;let i=t.pathname;return i.endsWith(`/`)&&(i=i.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${i}`,t.origin),type:`oauth`},{url:new URL(`/.well-known/openid-configuration${i}`,t.origin),type:`oidc`},{url:new URL(`${i}/.well-known/openid-configuration`,t.origin),type:`oidc`}),r}async function lS(e,{fetchFn:t=fetch,protocolVersion:n=Rm,skipIssuerValidation:r=!1}={}){let i={"MCP-Protocol-Version":n,Accept:`application/json`},a=cS(e);for(let{url:n,type:o}of a){let a=await rS(n,i,t);if(!a)continue;if(!a.ok){if(await a.text?.().catch(()=>{}),a.status>=400&&a.status<500||a.status===502)continue;throw Error(`HTTP ${a.status} trying to load ${o===`oauth`?`OAuth`:`OpenID provider`} metadata from ${n}`)}let s=o===`oauth`?$_.parse(await a.json()):tv.parse(await a.json());if(!r){let t=typeof e==`string`?e:e.href;if(!(s.issuer===t||t.endsWith(`/`)&&s.issuer===t.slice(0,-1)))throw new bx(`metadata`,t,s.issuer)}return s}}async function uS(e,t){let n,r;try{n=await nS(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch(e){if(e instanceof TypeError)throw e}r||=String(new URL(`/`,e));let i=await lS(r,{fetchFn:t?.fetchFn,skipIssuerValidation:t?.skipIssuerMetadataValidation});return{authorizationServerUrl:r,authorizationServerMetadata:i,resourceMetadata:n}}async function dS(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:i,state:a,resource:o}){let s;if(t){if(s=new URL(t.authorization_endpoint),!t.response_types_supported.includes(Lx))throw Error(`Incompatible auth server: does not support response type ${Lx}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(Rx))throw Error(`Incompatible auth server: does not support code challenge method ${Rx}`)}else s=new URL(`/authorize`,e);let c=await px(),l=c.code_verifier,u=c.code_challenge;return s.searchParams.set(`response_type`,Lx),s.searchParams.set(`client_id`,n.client_id),s.searchParams.set(`code_challenge`,u),s.searchParams.set(`code_challenge_method`,Rx),s.searchParams.set(`redirect_uri`,String(r)),a&&s.searchParams.set(`state`,a),i&&s.searchParams.set(`scope`,i),i?.split(` `).includes(`offline_access`)&&s.searchParams.append(`prompt`,`consent`),o&&s.searchParams.set(`resource`,o.href),{authorizationUrl:s,codeVerifier:l}}function fS(e,t,n){return new URLSearchParams({grant_type:`authorization_code`,code:e,code_verifier:t,redirect_uri:String(n)})}async function pS(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:i,resource:a,fetchFn:o}){let s=Gx(t?.token_endpoint??new URL(`/token`,e)),c=new Headers({"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`});a&&n.set(`resource`,a.href),i?await i(c,n,s,t):r&&Bx(zx(r,t?.token_endpoint_auth_methods_supported??[]),r,c,n);let l=await(o??fetch)(s,{method:`POST`,headers:c,body:n});if(!l.ok)throw await Jx(l);let u=await l.json();try{return nv.parse(u)}catch(e){throw typeof u==`object`&&u&&`error`in u?await Jx(JSON.stringify(u)):e}}async function mS(e,{metadata:t,clientInformation:n,refreshToken:r,resource:i,addClientAuthentication:a,fetchFn:o}){return{refresh_token:r,...await pS(e,{metadata:t,tokenRequestParams:new URLSearchParams({grant_type:`refresh_token`,refresh_token:r}),clientInformation:n,addClientAuthentication:a,resource:i,fetchFn:o})}}async function hS(e,t,{metadata:n,resource:r,authorizationCode:i,iss:a,scope:o,fetchFn:s}={}){i!==void 0&&Mx({iss:a,expectedIssuer:n?.issuer,issParameterSupported:jx(n)});let c=o??e.clientMetadata.scope,l;if(e.prepareTokenRequest&&(l=await e.prepareTokenRequest(c)),!l){if(!i)throw Error(`Either provider.prepareTokenRequest() or authorizationCode is required`);if(!e.redirectUrl)throw Error(`redirectUrl is required for authorization_code flow`);l=fS(i,await e.codeVerifier(),e.redirectUrl)}let u=await e.clientInformation({issuer:n?.issuer??String(t)});return pS(t,{metadata:n,tokenRequestParams:l,clientInformation:u??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:s})}async function gS(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:i}){let a;if(t){if(!t.registration_endpoint)throw Error(`Incompatible auth server: does not support dynamic client registration`);a=new URL(t.registration_endpoint)}else a=new URL(`/register`,e);let o={...n,...r===void 0?{}:{scope:r}},s=await(i??fetch)(a,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(o)});if(!s.ok)throw new xx({status:s.status,body:await s.text(),submittedMetadata:o});return cv.parse(await s.json())}var _S=new Set([`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`server/discover`]),vS=class{_entries=new Map;_maxEntries;_stamp=0;_cappedSize=0;constructor(e){this._maxEntries=e?.maxEntries??512}get size(){return this._entries.size}get(e){return this._entries.get(yS(e))}set(e,t){let n=yS(e),r=_S.has(e.method),i=!this._entries.has(n);if(!r&&i&&this._maxEntries>0&&this._cappedSize>=this._maxEntries){for(let e of this._entries.keys())if(!_S.has(e.slice(0,e.indexOf(`\0`)))){this._entries.delete(e),this._cappedSize--;break}}let a=++this._stamp;return this._entries.set(n,{...t,stamp:a}),i&&!r&&this._cappedSize++,a}delete(e){this._entries.delete(yS(e))&&!_S.has(e.method)&&this._cappedSize--}evict(e){let t=`${e}\0`,n=_S.has(e);for(let e of this._entries.keys())e.startsWith(t)&&(this._entries.delete(e),n||this._cappedSize--)}clear(){this._entries.clear(),this._cappedSize=0}};function yS(e){return`${e.method}\0${JSON.stringify([e.partition??``,e.params??``])}`}function bS(e,t){return t===void 0?e:`${e}\0${t}`}var xS=864e5,SS=class{_evictionGeneration=new Map;_toolIndex;_toolOutputValidatorIndex;_serverIdentity=``;constructor(e,t,n=()=>{},r=``,i=Date.now){this._store=e,this._isUserSupplied=t,this._reportError=n,this._cachePartition=r,this._now=i}now(){return this._now()}setServerIdentity(e){this._serverIdentity=e}_partitionFor(e){return JSON.stringify([this._serverIdentity,e===`public`?``:this._cachePartition])}async _probe(e,t){let n={method:e,params:t??``},r=this._partitionFor(`private`),i=await this._store.get({...n,partition:r});if(i!==void 0)return i;let a=this._partitionFor(`public`);if(a===r)return;let o=await this._store.get({...n,partition:a});return o?.scope===`public`?o:void 0}async evict(e){this._evictionGeneration.set(e,(this._evictionGeneration.get(e)??0)+1),await this._deleteBoth(e,``)}async _deleteBoth(e,t){let n=this._partitionFor(`private`),r=this._partitionFor(`public`);try{await this._store.delete({method:e,params:t,partition:n})}catch(e){this._reportError(e)}if(r!==n)try{await this._store.delete({method:e,params:t,partition:r})}catch(e){this._reportError(e)}}async evictKey(e,t){let n=bS(e,t),r=this._evictionGeneration.get(n);r!==void 0&&this._evictionGeneration.set(n,r+1),await this._deleteBoth(e,t)}captureGeneration(e,t){let n=bS(e,t),r=this._evictionGeneration.get(n)??0;return this._evictionGeneration.set(n,r),r}async write(e,t,n,r){if((this._evictionGeneration.get(bS(e,r?.params))??0)!==n)return;let i=r?.params??``,a=this._partitionFor(`private`),o=this._partitionFor(`public`),s=(r?.scope??`private`)===`public`?o:a;try{await this._store.set({method:e,params:i,partition:s},{value:CS(t),expiresAt:r?.expiresAt,scope:r?.scope})}catch(e){this._reportError(e)}if(o!==a)try{await this._store.delete({method:e,params:i,partition:s===a?o:a})}catch(e){this._reportError(e)}}async read(e,t){let n=await this._probe(e,t);if(!(n?.expiresAt===void 0||!(n.expiresAt>this.now())))try{let e=JSON.parse(n.value);if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`cached document is not an object`);return{value:e}}catch(n){this._reportError(n),await this._deleteBoth(e,t??``);return}}resetForReconnect(){this._isUserSupplied||this._store.clear(),this._evictionGeneration.clear(),this._toolIndex=void 0,this._toolOutputValidatorIndex=void 0,this._serverIdentity=``}async toolDefinition(e){let t=await this._probe(`tools/list`);if(t===void 0){this._toolIndex=void 0;return}if(this._toolIndex?.stamp!==t.stamp){let e=this._decodeListTools(t),n=new Map;if(e!==void 0)for(let t of e.tools)n.set(t.name,t);this._toolIndex={stamp:t.stamp,byName:n}}return this._toolIndex.byName.get(e)}async outputValidator(e,t){let n=await this._probe(`tools/list`);if(n===void 0){this._toolOutputValidatorIndex=void 0;return}if(this._toolOutputValidatorIndex?.stamp!==n.stamp){let e=this._decodeListTools(n)??{tools:[]},r=new Map;for(let n of e.tools){let e=t(n);e!==void 0&&r.set(n.name,e)}this._toolOutputValidatorIndex={stamp:n.stamp,byName:r}}return this._toolOutputValidatorIndex.byName.get(e)}_decodeListTools(e){try{let t=JSON.parse(e.value);if(!Array.isArray(t?.tools)||!t.tools.every(e=>typeof e==`object`&&!!e))throw TypeError(`cached tools/list document has a malformed tools array`);return t}catch(e){this._reportError(e);return}}};function CS(e){let t;try{t=JSON.stringify(e)}catch(e){throw TypeError(`cache value is not JSON-serializable: ${e instanceof Error?e.message:String(e)}`)}if(typeof t!=`string`)throw TypeError(`cache value is not JSON-serializable: it has no JSON representation`);return t}var wS=Symbol.for(`mcp.authSeamEscape`);function TS(e){if(typeof e==`object`&&e||typeof e==`function`)try{Object.defineProperty(e,wS,{value:!0,configurable:!0})}catch{}return e}function ES(e){return(typeof e==`object`&&!!e||typeof e==`function`)&&e[wS]===!0}var DS=-32022,OS=new Set([-32001,-32020,-32021]);function kS(e,t){switch(e.kind){case`result`:return AS(e.result,t);case`rpc-error`:return jS(e,t);case`http-error`:return MS(e,t);case`network-error`:return NS(e.error,t);case`auth-required`:return{kind:`error`,error:e.error};case`closed`:return t.transportKind===`stdio`?{kind:`legacy`}:NS(Error(`Connection closed during the version negotiation probe`),t);case`timeout`:return t.transportKind===`stdio`?{kind:`legacy`}:{kind:`error`,error:new _v(gv.RequestTimeout,`Version negotiation probe timed out after ${e.timeoutMs}ms`,{timeout:e.timeoutMs})}}}function AS(e,t){let n=zy(Ry).validateResult(`server/discover`,e);if(!n.ok)return{kind:`legacy`};let r=n.value.supportedVersions,i=t.clientModernVersions.find(e=>r.includes(e));return i===void 0?t.fallbackAvailable?{kind:`legacy`}:{kind:`error`,error:new iy({supported:[...r],requested:t.requestedVersion})}:{kind:`modern`,version:i,discover:n.value}}function jS(e,t){let{code:n,message:r,data:i}=e;if(n===DS){let e=IS(i);if(e===void 0)return{kind:`legacy`};let n=new iy({supported:e,requested:LS(i)??t.requestedVersion},r),a=Cv(e),o=t.clientModernVersions.find(e=>a.includes(e));return o===void 0?a.length>0?{kind:`error`,error:n}:t.fallbackAvailable?{kind:`legacy`}:{kind:`error`,error:n}:{kind:`corrective`,version:o,error:n}}return OS.has(n),{kind:`legacy`}}function MS(e,t){if(e.status===401||e.status===403){let t=e.status===403;return{kind:`error`,error:new vv(t?gv.ClientHttpForbidden:gv.ClientHttpAuthentication,`Version negotiation failed: ${t?`the server denied access (HTTP 403)`:`the server requires authorization (HTTP 401)`}`,{status:e.status,statusText:e.statusText,text:e.body})}}if(e.status>=500)return{kind:`error`,error:new vv(gv.EraNegotiationFailed,`Version negotiation failed: the server answered the probe with HTTP ${e.status}`,{status:e.status,statusText:e.statusText,text:e.body})};let n=RS(e.body);return n===void 0?{kind:`legacy`}:jS(n,t)}function NS(e,t){return t.environment===`browser`&&PS(e)?{kind:`legacy`}:{kind:`error`,error:new _v(gv.EraNegotiationFailed,`Version negotiation probe failed: ${FS(e)}`,{cause:e})}}function PS(e){return e instanceof TypeError||e instanceof Error&&e.name===`TypeError`}function FS(e){return e instanceof Error?e.message:String(e)}function IS(e){if(typeof e!=`object`||!e)return;let t=e.supported;if(!(!Array.isArray(t)||t.length===0||!t.every(e=>typeof e==`string`)))return t}function LS(e){if(typeof e!=`object`||!e)return;let t=e.requested;return typeof t==`string`?t:void 0}function RS(e){if(e===void 0||e===``)return;let t;try{t=JSON.parse(e)}catch{return}if(typeof t!=`object`||!t)return;let n=t.error;if(typeof n!=`object`||!n)return;let{code:r,message:i,data:a}=n;if(typeof r==`number`)return{code:r,message:typeof i==`string`?i:``,data:a}}var zS=`legacy`;function BS(e,t){let n=e?.mode??zS;if(n===`legacy`)return{kind:`legacy`};let r=e?.probe??{};if(typeof n==`object`){if(!xv(n.pin))throw TypeError(`versionNegotiation: { pin: '${n.pin}' } is not a modern protocol revision — pinning is for 2026-07-28 and later; omit versionNegotiation (or use mode: 'legacy') for 2025-era servers.`);return{kind:`pin`,version:n.pin,probe:r}}let i=t?Cv(t):[];return{kind:`auto`,modernVersions:i.length>0?i:[...bv],fallbackAvailable:!t||Sv(t).length>0,probe:r}}function VS(){let e=globalThis;return e.window!==void 0&&e.document!==void 0?`browser`:`node`}function HS(e){return`stderr`in e&&`pid`in e?`stdio`:`http`}var US=class e{_pending;_probeCounter=0;_savedOnMessage;_savedOnError;_savedOnClose;_closeDelivered=!1;constructor(e){this._transport=e,this._savedOnMessage=e.onmessage,this._savedOnError=e.onerror,this._savedOnClose=e.onclose}static async open(t){let n=new e(t);t.onmessage=e=>{let t=n._pending;if(t!==void 0&&(qy(e)||Jy(e))&&e.id===t.id){n._pending=void 0,qy(e)?t.resolve({kind:`response`,result:e.result}):t.resolve({kind:`response`,error:e.error});return}},t.onerror=e=>{n._savedOnError?.(e)},t.onclose=()=>{let e=n._pending;e!==void 0&&(n._pending=void 0,e.resolve({kind:`closed`})),n._closeDelivered=!0,n._savedOnClose?.()};try{await t.start()}catch(e){throw n.detach(),e}return n}async exchange(e,t){let n=`server-discover-probe-${++this._probeCounter}`;return new Promise(r=>{let i=!1,a=e=>{i||(i=!0,clearTimeout(o),this._pending?.id===n&&(this._pending=void 0),r(e))},o=setTimeout(()=>a({kind:`timeout`}),t);this._pending={id:n,resolve:a},this._transport.send(e(n)).catch(e=>a({kind:`send-error`,error:e}))})}detach(){if(this._pending=void 0,this._transport.onmessage=this._savedOnMessage,this._transport.onerror=this._savedOnError,this._closeDelivered&&this._savedOnClose!==void 0){let e=this._savedOnClose,t=this._transport,n=!1,r=()=>{if(!n){n=!0;return}e()};t.onclose=r,WS.set(t,()=>{t.onclose===r&&(t.onclose=e)})}else this._transport.onclose=this._savedOnClose}release(){this.detach();let e=this._transport,t=e.start,n=!0;e.start=async function(){if(n){n=!1,e.start=t;return}return t.call(e)}}},WS=new WeakMap;function GS(e){let t=WS.get(e);WS.delete(e),t?.()}function KS(e,t,n,r){return{jsonrpc:`2.0`,id:e,method:`server/discover`,params:{_meta:zy(t).outboundEnvelope({protocolVersion:t,clientInfo:n,clientCapabilities:r})}}}function qS(e,t){switch(e.kind){case`response`:return e.error===void 0?{kind:`result`,result:e.result}:{kind:`rpc-error`,...e.error};case`send-error`:{let t=e.error;if(ES(t)||t instanceof Ax||t instanceof Error&&t.name===`UnauthorizedError`)return{kind:`auth-required`,error:t};if(t instanceof vv){let e=t.data?.text;return{kind:`http-error`,status:t.data.status,body:typeof e==`string`?e:void 0,statusText:t.data.statusText}}return{kind:`network-error`,error:t}}case`closed`:return{kind:`closed`};case`timeout`:return{kind:`timeout`,timeoutMs:t}}}async function JS(e,t){let n=e.probe.timeoutMs??t.defaultTimeoutMs,r=Math.max(0,e.probe.maxRetries??0),i=e.kind===`pin`?[e.version]:e.modernVersions,a=e.kind===`auto`&&e.fallbackAvailable,o=await US.open(t.transport),s=async()=>{let s=i[0],c=!1,l=r;for(;;){let r=await o.exchange(e=>KS(e,s,t.clientInfo,t.capabilities),n);if(r.kind===`timeout`&&l>0){l--;continue}let u=qS(r,n),d=kS(u,{clientModernVersions:i,requestedVersion:s,fallbackAvailable:a,environment:t.environment,transportKind:t.transportKind});switch(d.kind){case`modern`:return{era:`modern`,version:d.version,discover:d.discover};case`corrective`:if(c)throw d.error;c=!0,s=d.version;continue;case`legacy`:{let n=u.kind===`closed`?`the connection closed during the server/discover probe`:void 0;if(e.kind===`pin`)throw new _v(gv.EraNegotiationFailed,n===void 0?`Version negotiation failed: the server did not offer pinned protocol version ${e.version} via server/discover (no fallback in pin mode)`:`Version negotiation failed: ${n} before the server offered pinned protocol version ${e.version} (no fallback in pin mode)`);if(!e.fallbackAvailable)throw new _v(gv.EraNegotiationFailed,n===void 0?`Version negotiation failed: the server gave no modern evidence and this client supports no pre-2026-07-28 protocol version to fall back to`:`Version negotiation failed: ${n} and this client supports no pre-2026-07-28 protocol version to fall back to`);if(n!==void 0&&t.disposableProbe!==!0)throw new _v(gv.EraNegotiationFailed,`Version negotiation failed: ${n} (this transport probed in place — the disposable sibling probe requires the SDK's base StdioClientTransport)`);return{era:`legacy`}}case`error`:throw d.error}}},c;try{c=await s()}catch(e){throw o.detach(),e}return o.release(),c}function YS(e){let t=Object.getPrototypeOf(e);if(t===null||!Object.prototype.hasOwnProperty.call(t,`_dispose`))return;let n=e._serverParams;return typeof n==`object`&&n&&typeof n.command==`string`?n:void 0}async function XS(e,t,n,r){let i=t.constructor,a=new i({...n,stderr:`ignore`}),o=t.close,s=!1,c,l=new Promise((e,t)=>{c=()=>t(ZS())});t.close=async function(){return s=!0,c?.(),o.call(t)};let u;try{let t=JS(e,{...r,transport:a,transportKind:`stdio`,disposableProbe:!0});t.catch(()=>{}),u=await Promise.race([t,l])}finally{await QS(a),t.close=o}if(s)throw ZS();return u}function ZS(){return new _v(gv.EraNegotiationFailed,`Version negotiation failed: the transport was closed during the server/discover probe`)}async function QS(e){try{let t=e._dispose;await(typeof t==`function`?t.call(e):e.close())}catch{}}function $S(e){let t=e._meta?.[Um];return pte.Implementation(t)?t:void 0}function eC(e,t){if(!(!e||typeof t!=`object`||!t)){if(e.type===`object`&&e.properties&&typeof e.properties==`object`){let n=t,r=e.properties;for(let e of Object.keys(r)){let t=r[e];n[e]===void 0&&Object.prototype.hasOwnProperty.call(t,`default`)&&(n[e]=t.default),n[e]!==void 0&&eC(t,n[e])}}if(Array.isArray(e.anyOf))for(let n of e.anyOf)typeof n!=`boolean`&&eC(n,t);if(Array.isArray(e.oneOf))for(let n of e.oneOf)typeof n!=`boolean`&&eC(n,t)}}function tC(e){if(!e)return{supportsFormMode:!1,supportsUrlMode:!1};let t=e.form!==void 0,n=e.url!==void 0;return{supportsFormMode:t||!t&&!n,supportsUrlMode:n}}function nC(e){if(typeof e==`object`&&e&&(e.kind===`legacy`&&!(`supportedVersions`in e)&&!(`discover`in e)||e.kind===`modern`&&jh.safeParse(e.discover).success))return e;throw new _v(gv.EraNegotiationFailed,`connect({ prior }): unrecognized prior — expected { kind: 'modern', discover } or { kind: 'legacy' }`)}var rC={"notifications/tools/list_changed":[`tools/list`],"notifications/prompts/list_changed":[`prompts/list`],"notifications/resources/list_changed":[`resources/list`,`resources/templates/list`]},iC=64,aC=class extends vte{_serverCapabilities;_serverVersion;_capabilities;_instructions;_jsonSchemaValidator;_cache;_defaultCacheTtlMs;_listMaxPages;_listChangedDebounceTimers=new Map;_listChangedConfig;_enforceStrictCapabilities;_versionNegotiation;_supportedProtocolVersionsOption;_inputRequiredDriverConfig;_listenState=new Map;_nextListenId=0;_autoOpenedSubscription;_discoverResult;_resetConnectionState(){if(this._negotiatedProtocolVersion=void 0,this._serverCapabilities=void 0,this._serverVersion=void 0,this._instructions=void 0,this._discoverResult=void 0,this._autoOpenedSubscription=void 0,this._listenState.size>0){let e=new _v(gv.ConnectionClosed,`subscriptions/listen: client reconnected or closed; subscription state from the previous connection was reset`);for(let t of this._listenState.values())t.settle({cause:`remote`,error:e})}this._listenState.clear();for(let e of this._listChangedDebounceTimers.values())clearTimeout(e);this._listChangedDebounceTimers.clear(),this._cache.resetForReconnect()}async close(){try{await super.close()}finally{this._resetConnectionState()}}constructor(e,t){super(t),this._clientInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new sx,this._enforceStrictCapabilities=t?.enforceStrictCapabilities??!1,this._versionNegotiation=t?.versionNegotiation,this._supportedProtocolVersionsOption=t?.supportedProtocolVersions,this._inputRequiredDriverConfig=ate(t?.inputRequired),this._cache=new SS(t?.responseCacheStore??new vS,t?.responseCacheStore!==void 0,e=>this._reportStoreError(e),t?.cachePartition??``),this._defaultCacheTtlMs=t?.defaultCacheTtlMs??0,this._listMaxPages=t?.listMaxPages??iC,t?.listChanged&&(this._listChangedConfig=t.listChanged)}buildContext(e,t){return e}_shouldDropInbound(e){if(this._negotiatedProtocolVersion!==void 0&&xv(this._negotiatedProtocolVersion)&&Gy(e))return`drop`}_outboundMetaEnvelope(){let e=this._negotiatedProtocolVersion;if(e!==void 0)return this._wireCodec().outboundEnvelope({protocolVersion:e,clientInfo:this._clientInfo,clientCapabilities:this._capabilities})}_resolveNonCompleteResult(e,t){return this._inputRequiredDriverConfig.autoFulfill?wte({getRequestHandler:e=>this._getRequestHandler(e),buildContext:e=>this.buildContext(e,void 0),sessionId:this.transport?.sessionId},this._inputRequiredDriverConfig,e,t):Promise.reject(new _v(gv.UnsupportedResultType,`Unsupported result type 'input_required' for ${t.request.method}: multi-round-trip auto-fulfilment is not enabled on this instance — pass allowInputRequired: true to handle it manually, or enable inputRequired.autoFulfill`,{resultType:`input_required`,method:t.request.method}))}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler(`tools`,`notifications/tools/list_changed`,e.tools,async()=>(await this.listTools(void 0,{cacheMode:`refresh`})).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler(`prompts`,`notifications/prompts/list_changed`,e.prompts,async()=>(await this.listPrompts(void 0,{cacheMode:`refresh`})).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler(`resources`,`notifications/resources/list_changed`,e.resources,async()=>(await this.listResources(void 0,{cacheMode:`refresh`})).resources)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after connecting to transport`);this._capabilities=yte(this._capabilities,e)}setVersionNegotiation(e){if(this.transport)throw Error(`Cannot configure version negotiation after connecting to transport`);this._versionNegotiation=e}_wrapHandler(e,t){return e===`elicitation/create`?async(e,n)=>{let r=zy(this._negotiatedProtocolVersion),i=r.validateRequest(`elicitation/create`,e);if(!i.ok&&i.reason===`not-in-era`&&(i=r.validateInputRequest(`elicitation/create`,e)),!i.ok)throw new ty(i.reason===`not-in-era`?ey.InternalError:ey.InvalidParams,i.reason===`not-in-era`?`No wire schema for elicitation/create in the resolved era`:`Invalid elicitation request: ${i.message}`);let{params:a}=i.value;a.mode=a.mode??`form`;let{supportsFormMode:o,supportsUrlMode:s}=tC(this._capabilities.elicitation);if(a.mode===`form`&&!o)throw new ty(ey.InvalidParams,`Client does not support form-mode elicitation requests`);if(a.mode===`url`&&!s)throw new ty(ey.InvalidParams,`Client does not support URL-mode elicitation requests`);let c=await t(e,n),l=r.validateResult(`elicitation/create`,c);if(!l.ok&&l.reason===`not-in-era`&&(l=r.validateInputResponse(`elicitation/create`,c)),!l.ok)throw new ty(l.reason===`not-in-era`?ey.InternalError:ey.InvalidParams,l.reason===`not-in-era`?`No wire schema for elicitation/create in the resolved era`:`Invalid elicitation result: ${l.message}`);let u=l.value,d=a.mode===`form`?a.requestedSchema:void 0;if(a.mode===`form`&&u.action===`accept`&&u.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{eC(d,u.content)}catch{}return u}:e===`sampling/createMessage`?async(e,n)=>{let r=zy(this._negotiatedProtocolVersion),i=r.validateRequest(`sampling/createMessage`,e);if(!i.ok&&i.reason===`not-in-era`&&(i=r.validateInputRequest(`sampling/createMessage`,e)),!i.ok)throw new ty(i.reason===`not-in-era`?ey.InternalError:ey.InvalidParams,i.reason===`not-in-era`?`No wire schema for sampling/createMessage in the resolved era`:`Invalid sampling request: ${i.message}`);let{params:a}=i.value,o=await t(e,n),s=!!(a.tools||a.toolChoice),c=r.samplingResultVariant(s,o);if(!c.ok&&c.reason===`not-in-era`&&(c=r.validateInputResponse(`sampling/createMessage`,o)),!c.ok)throw new ty(c.reason===`not-in-era`?ey.InternalError:ey.InvalidParams,c.reason===`not-in-era`?`No result schema for sampling/createMessage in the resolved era`:`Invalid sampling result: ${c.message}`);return c.value}:t}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new _v(gv.CapabilityNotSupported,`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(t?.prior!=null)return this._connectFromPrior(e,nC(t.prior),t);let n=BS(this._versionNegotiation,this._supportedProtocolVersionsOption);return n.kind===`legacy`?this._connectPlainLegacy(e,t):this._connectNegotiated(e,n,t)}async _connectPlainLegacy(e,t){if(await super.connect(e),e.sessionId!==void 0){let t=this._negotiatedProtocolVersion;t!==void 0&&e.setProtocolVersion?.(t);return}this._resetConnectionState(),await this._legacyHandshake(e,t)}async _legacyHandshake(e,t){let n=Sv(this._supportedProtocolVersions);try{let r=n[0];if(r===void 0)throw new _v(gv.EraNegotiationFailed,`Cannot run the initialize handshake: supportedProtocolVersions contains no pre-2026-07-28 protocol version`);let i=await this.request({method:`initialize`,params:{protocolVersion:r,capabilities:this._capabilities,clientInfo:this._clientInfo}},t);if(i===void 0)throw Error(`Server sent invalid initialize result: ${i}`);if(!n.includes(i.protocolVersion))throw Error(`Server's protocol version is not supported: ${i.protocolVersion}`);this._serverCapabilities=i.capabilities,this._serverVersion=i.serverInfo,this._cache.setServerIdentity(this._deriveServerIdentity(e)),e.setProtocolVersion&&e.setProtocolVersion(i.protocolVersion),this._instructions=i.instructions,await this.notification({method:`notifications/initialized`}),this._negotiatedProtocolVersion=i.protocolVersion,this._listChangedConfig&&this._setupListChangedHandlers(this._listChangedConfig)}catch(e){throw this.close(),e}}async _connectNegotiated(e,t,n){if(e.sessionId!==void 0){await super.connect(e);let t=this._negotiatedProtocolVersion;t!==void 0&&e.setProtocolVersion&&e.setProtocolVersion(t);return}this._resetConnectionState();let r;try{let i=HS(e),a={clientInfo:this._clientInfo,capabilities:this._capabilities,environment:VS(),defaultTimeoutMs:n?.timeout??6e4},o=i===`stdio`?YS(e):void 0;r=o===void 0?await JS(t,{...a,transport:e,transportKind:i}):await XS(t,e,o,a)}catch(t){throw await e.close().catch(()=>{}),GS(e),t}if(GS(e),await super.connect(e),r.era===`legacy`){await this._legacyHandshake(e,n);return}if(this._serverCapabilities=r.discover.capabilities,this._serverVersion=$S(r.discover),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=r.discover.instructions,this._discoverResult=r.discover,this._negotiatedProtocolVersion=r.version,e.setProtocolVersion&&e.setProtocolVersion(r.version),this._listChangedConfig){let e=this._listChangedConfig,t=this._serverCapabilities,r={...e.tools&&t?.tools?.listChanged&&{tools:e.tools},...e.prompts&&t?.prompts?.listChanged&&{prompts:e.prompts},...e.resources&&t?.resources?.listChanged&&{resources:e.resources}},i=!0;try{this._setupListChangedHandlers(r)}catch(e){i=!1,this.onerror?.(e instanceof Error?e:Error(String(e)))}let a=i?{...r.tools&&{toolsListChanged:!0},...r.prompts&&{promptsListChanged:!0},...r.resources&&{resourcesListChanged:!0}}:{};if(Object.keys(a).length>0){let e=new AbortController,t=()=>e.abort(n?.signal?.reason);n?.signal?.aborted&&t(),n?.signal?.addEventListener(`abort`,t);try{this._autoOpenedSubscription=await this.listen(a,{timeout:n?.timeout,signal:e.signal})}catch(e){if(n?.signal?.aborted)throw await this.close().catch(()=>{}),e;this.onerror?.(e instanceof Error?e:Error(String(e)))}finally{n?.signal?.removeEventListener(`abort`,t)}}}}async _connectFromPrior(e,t,n){if(t.kind===`legacy`)return this._connectPlainLegacy(e,n);let r=t.discover;this._resetConnectionState();let i=this._supportedProtocolVersionsOption,a=(i&&Cv(i).length>0?Cv(i):bv).find(e=>r.supportedVersions.includes(e));if(a===void 0)throw new _v(gv.EraNegotiationFailed,`connect({ prior }) with a modern verdict requires a 2026-07-28+ mutual protocol version; the supplied DiscoverResult and this client's supportedProtocolVersions have no modern overlap. For a server known to be legacy, pass prior: { kind: 'legacy' } to skip the probe and initialize directly, or use versionNegotiation: { mode: 'auto' } to re-probe with legacy fallback.`);if(await super.connect(e),this._discoverResult=r,this._serverCapabilities=r.capabilities,this._serverVersion=$S(r),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=r.instructions,this._negotiatedProtocolVersion=a,e.setProtocolVersion?.(a),this._listChangedConfig)try{this._setupListChangedHandlers(this._listChangedConfig)}catch(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}_deriveServerIdentity(e){let t=this._serverVersion;return t===void 0?e.sessionId??`anonymous:${Date.now()}-${Math.random().toString(36).slice(2)}`:`${t.name}@${t.version}`}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}getProtocolEra(){let e=this._negotiatedProtocolVersion;if(e!==void 0)return xv(e)?`modern`:`legacy`}getInstructions(){return this._instructions}getDiscoverResult(){return this._discoverResult}assertCapabilityForMethod(e){switch(e){case`logging/setLevel`:if(!this._serverCapabilities?.logging)throw new _v(gv.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case`prompts/get`:case`prompts/list`:if(!this._serverCapabilities?.prompts)throw new _v(gv.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case`resources/list`:case`resources/templates/list`:case`resources/read`:case`resources/subscribe`:case`resources/unsubscribe`:if(!this._serverCapabilities?.resources)throw new _v(gv.CapabilityNotSupported,`Server does not support resources (required for ${e})`);if(e===`resources/subscribe`&&!this._serverCapabilities.resources.subscribe)throw new _v(gv.CapabilityNotSupported,`Server does not support resource subscriptions (required for ${e})`);break;case`tools/call`:case`tools/list`:if(!this._serverCapabilities?.tools)throw new _v(gv.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case`completion/complete`:if(!this._serverCapabilities?.completions)throw new _v(gv.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case`initialize`:break;case`server/discover`:break;case`ping`:break}}assertNotificationCapability(e){switch(e){case`notifications/roots/list_changed`:if(!this._capabilities.roots?.listChanged)throw new _v(gv.CapabilityNotSupported,`Client does not support roots list changed notifications (required for ${e})`);break;case`notifications/initialized`:break;case`notifications/cancelled`:break;case`notifications/progress`:break}}assertRequestHandlerCapability(e){switch(e){case`sampling/createMessage`:if(!this._capabilities.sampling)throw new _v(gv.CapabilityNotSupported,`Client does not support sampling capability (required for ${e})`);break;case`elicitation/create`:if(!this._capabilities.elicitation)throw new _v(gv.CapabilityNotSupported,`Client does not support elicitation capability (required for ${e})`);break;case`roots/list`:if(!this._capabilities.roots)throw new _v(gv.CapabilityNotSupported,`Client does not support roots capability (required for ${e})`);break;case`ping`:break}}async ping(e){return this.request({method:`ping`},e)}async discover(e){let t=await this._requestWithSchema({method:`server/discover`},jh,e);return this._discoverResult=t,t}async complete(e,t){return this.request({method:`completion/complete`,params:e},t)}async setLoggingLevel(e,t){return this.request({method:`logging/setLevel`,params:{level:e}},t)}async getPrompt(e,t){return this.request({method:`prompts/get`,params:e},t)}async listPrompts(e,t){if(!this._serverCapabilities?.prompts&&!this._enforceStrictCapabilities)return console.debug(`Client.listPrompts() called but server does not advertise prompts capability - returning empty list`),{prompts:[]};if(e?.cursor!==void 0)return this.request({method:`prompts/list`,params:e},t);let n=await this._serveFromCache(`prompts/list`,void 0,t);return n===void 0?this._listAllPages(`prompts/list`,e,t,(e,t)=>e.prompts.push(...t.prompts)):n}async listResources(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug(`Client.listResources() called but server does not advertise resources capability - returning empty list`),{resources:[]};if(e?.cursor!==void 0)return this.request({method:`resources/list`,params:e},t);let n=await this._serveFromCache(`resources/list`,void 0,t);return n===void 0?this._listAllPages(`resources/list`,e,t,(e,t)=>e.resources.push(...t.resources)):n}async listResourceTemplates(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug(`Client.listResourceTemplates() called but server does not advertise resources capability - returning empty list`),{resourceTemplates:[]};if(e?.cursor!==void 0)return this.request({method:`resources/templates/list`,params:e},t);let n=await this._serveFromCache(`resources/templates/list`,void 0,t);return n===void 0?this._listAllPages(`resources/templates/list`,e,t,(e,t)=>e.resourceTemplates.push(...t.resourceTemplates)):n}async _listAllPages(e,t,n,r,i){let a=n?.cacheMode===`bypass`,o=this._cache.captureGeneration(e),s=await this.request({method:e,...t&&{params:{...t}}},n),c=s.nextCursor,l=new Set,u=1;for(;c!==void 0&&!l.has(c);){if(this._listMaxPages!==0&&u>=this._listMaxPages)throw new _v(gv.ListPaginationExceeded,`${e}: exceeded listMaxPages (${this._listMaxPages}); server pagination did not terminate`,{method:e,listMaxPages:this._listMaxPages});l.add(c);let i=await this.request({method:e,params:{...t,cursor:c}},n);r(s,i),c=i.nextCursor,u++}return delete s.nextCursor,i?.(s),a||await this._cache.write(e,s,o,this._freshness(s)),s}_freshness(e,t){let n=e,r=typeof n.ttlMs==`number`?n.ttlMs:this._defaultCacheTtlMs,i=n.cacheScope===`public`?`public`:`private`;return{expiresAt:this._cache.now()+Math.min(Math.max(0,r),xS),scope:i,params:t}}async _serveFromCache(e,t,n){if(n?.cacheMode===`bypass`||n?.cacheMode===`refresh`)return;let r=await this._cache.read(e,t).catch(e=>void this._reportStoreError(e));if(r!==void 0){if(n?.signal?.aborted){let e=n.signal.reason;throw e instanceof _v?e:new _v(gv.RequestTimeout,String(e))}return r.value}}_reportStoreError(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}_compileOutputValidator(e){if(e.outputSchema)try{return{ok:!0,validator:this._jsonSchemaValidator.getValidator(e.outputSchema)}}catch(e){return{ok:!1,compileError:e}}}async _resolveXMcpHeaderScan(e,t){let n=t??await this._cache.toolDefinition(e);return n===void 0?void 0:Zy(n.inputSchema)}async readResource(e,t){let n=await this._serveFromCache(`resources/read`,e.uri,t);if(n!==void 0)return n;let r=this._cache.captureGeneration(`resources/read`,e.uri),i=await this.request({method:`resources/read`,params:e},t);if(t?.cacheMode!==`bypass`){let n=this._freshness(i,e.uri);n.expiresAt>this._cache.now()?await this._cache.write(`resources/read`,i,r,n):t?.cacheMode===`refresh`&&await this._cache.evictKey(`resources/read`,e.uri)}return i}async subscribeResource(e,t){return this.request({method:`resources/subscribe`,params:e},t)}async unsubscribeResource(e,t){return this.request({method:`resources/unsubscribe`,params:e},t)}async listen(e,t){if(this.transport===void 0)throw new _v(gv.NotConnected,`Not connected`);let n=this._negotiatedProtocolVersion;if(n===void 0||!xv(n))throw new _v(gv.MethodNotSupportedByProtocolVersion,`subscriptions/listen requires a 2026-07-28-era connection (negotiated: ${n??`none`}). On a 2025-era connection, change notifications are delivered unsolicited: use ClientOptions.listChanged and resources/subscribe instead.`,{method:`subscriptions/listen`,protocolVersion:n});if(t?.signal?.aborted){let e=t.signal.reason;throw e instanceof _v?e:new _v(gv.RequestTimeout,String(e))}let r=new AbortController,i=`listen:${this._nextListenId++}`,a=`opening`,o,s,c,l,u=new Promise((e,t)=>{c=e,l=t}),d,f=new Promise(e=>{d=e}),p=e=>{if(a===`closed`)return;let n=a===`opening`;if(o!==void 0&&(clearTimeout(o),o=void 0),`ack`in e){a=`open`,c(e.ack);return}a=`closed`,s!==void 0&&t?.signal?.removeEventListener(`abort`,s),this._listenState.delete(i),r.abort(),d(e.cause),n&&l(e.error??new _v(gv.ConnectionClosed,`subscriptions/listen closed before the server acknowledged`))},m=async()=>{r.abort(),await this.notification({method:`notifications/cancelled`,params:{requestId:i}}).catch(()=>{})},h=async()=>{a!==`closed`&&(p({cause:`local`}),await m())};this._listenState.set(i,{settle:p});let g=t?.timeout??6e4;if(o=setTimeout(()=>{p({cause:`remote`,error:new _v(gv.RequestTimeout,`subscriptions/listen ack timed out`,{timeout:g})}),m().catch(()=>{})},g),t?.signal){let e=t.signal;s=()=>{if(a===`closed`)return;let t=e.reason;p({cause:`local`,error:t instanceof Error?t:Error(String(t??`Aborted`))}),m().catch(()=>{})},e.addEventListener(`abort`,s,{once:!0})}let _={jsonrpc:`2.0`,id:i,method:`subscriptions/listen`,params:{_meta:{...this._outboundMetaEnvelope()},notifications:e}};try{await this.transport.send(_,{requestSignal:r.signal,onRequestStreamEnd:()=>p({cause:`remote`,error:Error(`subscriptions/listen: stream ended`)})})}catch(e){p({cause:`remote`,error:e instanceof Error?e:Error(String(e))})}return{honoredFilter:await u,close:h,closed:f}}get autoOpenedSubscription(){return this._autoOpenedSubscription}_onnotification(e,t){let n=Object.hasOwn(rC,e.method)?rC[e.method]:void 0;if(e.method===`notifications/resources/updated`){let t=e.params?.uri;typeof t==`string`&&this._cache.evictKey(`resources/read`,t)}else if(n!==void 0)for(let e of n)this._cache.evict(e);if(e.method===`notifications/subscriptions/acknowledged`){let t=e.params?._meta?.[Gm],n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){let t=this._wireCodec().validateNotification(`notifications/subscriptions/acknowledged`,e);n.settle({ack:t.ok?t.value.params.notifications:{}});return}}if(e.method===`notifications/cancelled`){let t=e.params?.requestId,n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){n.settle({cause:`remote`,error:Error(`subscriptions/listen: server cancelled the subscription`)});return}}super._onnotification(e,t)}_onresponse(e){let t=e.id,n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){Jy(e)?n.settle({cause:`remote`,error:ty.fromError(e.error.code,e.error.message,e.error.data)}):n.settle({cause:`graceful`,error:new _v(gv.ConnectionClosed,`subscriptions/listen: server closed the subscription gracefully before acknowledging`)});return}super._onresponse(e)}_onclose(){if(this._listenState.size>0){let e=new _v(gv.ConnectionClosed,`Connection closed`);for(let t of this._listenState.values())t.settle({cause:`remote`,error:e});this._listenState.clear()}super._onclose()}async callTool(e,t){let n=this.getProtocolEra()===`modern`&&VS()!==`browser`,r=async()=>{if(!n)return t;let r;try{r=await this._resolveXMcpHeaderScan(e.name,t?.toolDefinition)}catch(e){this._reportStoreError(e)}if(!r?.valid||r.declarations.length===0)return t;let i=zee(r.declarations,e.arguments);return Object.keys(i).length===0?t:{...t,headers:{...t?.headers,...i}}},i=t?.toolDefinition===void 0?await this._cache.outputValidator(e.name,e=>this._compileOutputValidator(e)).catch(e=>void this._reportStoreError(e)):this._compileOutputValidator(t.toolDefinition),a=()=>{if(i===void 0||i.ok)return;let t=i.compileError,n=(t instanceof Error?t.message:String(t)).slice(0,200);throw new ty(ey.InvalidParams,`Tool '${e.name}' has an invalid outputSchema: ${n}`)};a();let o;try{o=await this.request({method:`tools/call`,params:e},await r())}catch(s){let c=s instanceof ty&&s.code===-32020;if(!n||!c||t?.toolDefinition!==void 0)throw s;let l={signal:t?.signal,timeout:t?.timeout,cacheMode:`refresh`};await this._cache.evict(`tools/list`),await this.listTools(void 0,l).catch(e=>this._reportStoreError(e)),i=await this._cache.outputValidator(e.name,e=>this._compileOutputValidator(e)).catch(e=>void this._reportStoreError(e)),a(),o=await this.request({method:`tools/call`,params:e},await r())}let s=i!==void 0&&i.ok?i.validator:void 0;if(s){if(o.structuredContent===void 0&&!o.isError)throw new ty(ey.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent!==void 0&&!o.isError)try{let e=s(o.structuredContent);if(!e.valid)throw new ty(ey.InvalidParams,`Structured content does not match the tool's output schema: ${e.errorMessage}`)}catch(e){throw e instanceof ty?e:new ty(ey.InvalidParams,`Failed to validate structured content: ${e instanceof Error?e.message:String(e)}`)}}return o}async listTools(e,t){if(!this._serverCapabilities?.tools&&!this._enforceStrictCapabilities)return console.debug(`Client.listTools() called but server does not advertise tools capability - returning empty list`),{tools:[]};if(e?.cursor!==void 0){let n=await this.request({method:`tools/list`,params:e},t);return this._excludeInvalidXMcpHeaderTools(n),n}let n=await this._serveFromCache(`tools/list`,void 0,t);return n===void 0?this._listAllPages(`tools/list`,e,t,(e,t)=>e.tools.push(...t.tools),e=>this._excludeInvalidXMcpHeaderTools(e)):n}_excludeInvalidXMcpHeaderTools(e){if(this.getProtocolEra()!==`modern`||!this.transport||HS(this.transport)===`stdio`)return;let t=e.tools.filter(e=>{let t=Zy(e.inputSchema);return t.valid?!0:(console.warn(`[mcp-sdk] excluding tool '${e.name}' from tools/list: invalid x-mcp-header declaration — ${t.reason}`),!1)});t.length!==e.tools.length&&(e.tools=t)}_setupListChangedHandler(e,t,n,r){let i=nb(Bg,n);if(!i.success)throw Error(`Invalid ${e} listChanged options: ${i.error.message}`);if(typeof n.onChanged!=`function`)throw TypeError(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:a,debounceMs:o}=i.data,{onChanged:s}=n,c=async()=>{if(!a){s(null,null);return}try{s(null,await r())}catch(e){s(e instanceof Error?e:Error(String(e)),null)}};this.setNotificationHandler(t,()=>{if(o){let t=this._listChangedDebounceTimers.get(e);t&&clearTimeout(t);let n=setTimeout(c,o);this._listChangedDebounceTimers.set(e,n)}else c()})}async sendRootsListChanged(){return this.notification({method:`notifications/roots/list_changed`})}};(class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SseError`})}static[Symbol.hasInstance](e){return pv(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return pv(this,e)}constructor(e,t,n){super(`SSE error: ${t}`),this.code=e,this.event=n,fv(this,new.target)}});var oC=1,sC={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},cC=new Set([`authorization`,`content-type`,`mcp-protocol-version`,`mcp-method`,`mcp-name`,`mcp-session-id`]);function lC(e,t){if(typeof AbortSignal.any==`function`)return AbortSignal.any([e,t]);let n=new AbortController;if(e.aborted)return n.abort(e.reason),n.signal;if(t.aborted)return n.abort(t.reason),n.signal;let r=()=>{e.removeEventListener(`abort`,i),t.removeEventListener(`abort`,a)};function i(){r(),n.abort(e.reason)}function a(){r(),n.abort(t.reason)}return e.addEventListener(`abort`,i,{once:!0}),t.addEventListener(`abort`,a,{once:!0}),n.signal}var uC=class{_abortController;_url;_resourceMetadataUrl;_scope;_requestInit;_authProvider;_oauthProvider;_skipIssuerMetadataValidation;_fetch;_fetchWithInit;_sessionId;_reconnectionOptions;_protocolVersion;_onInsufficientScope;_maxStepUpRetries;_serverRetryMs;_reconnectionScheduler;_cancelReconnection;onclose;onerror;onmessage;hasPerRequestStream=!0;constructor(e,t){this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._skipIssuerMetadataValidation=t?.skipIssuerMetadataValidation,Dx(t?.authProvider)?(this._oauthProvider=t.authProvider,this._authProvider=kx(t.authProvider,{skipIssuerMetadataValidation:t.skipIssuerMetadataValidation})):this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=Ote(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._protocolVersion=t?.protocolVersion,this._reconnectionOptions=t?.reconnectionOptions??sC,this._reconnectionScheduler=t?.reconnectionScheduler,this._onInsufficientScope=t?.onInsufficientScope??`reauthorize`,this._maxStepUpRetries=Math.max(0,t?.maxStepUpRetries??oC)}async _stepUpAuthorize(e,t){try{return await this._stepUpAuthorizeInner(e,t)}catch(e){throw TS(e)}}async _stepUpAuthorizeInner(e,t){if(this._onInsufficientScope===`throw`||!this._oauthProvider)throw new wx({requiredScope:e.scope,resourceMetadataUrl:e.resourceMetadataUrl,errorDescription:e.errorDescription});if(t>=this._maxStepUpRetries)throw new vv(gv.ClientHttpForbidden,`Server returned 403 insufficient_scope after step-up re-authorization (retry limit ${this._maxStepUpRetries} reached)`,{status:403,statusText:e.statusText??`Forbidden`,text:e.text});e.resourceMetadataUrl&&(this._resourceMetadataUrl=e.resourceMetadataUrl);let n=await this._oauthProvider.tokens(),r=Nx(this._scope,n?.scope,e.scope);this._scope=r;let i=Px(r,n?.scope);return Yx(this._oauthProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:r,forceReauthorization:i,fetchFn:this._fetchWithInit,skipIssuerMetadataValidation:this._skipIssuerMetadataValidation})}async _commonHeaders(){let e={},t;try{t=await this._authProvider?.token()}catch(e){throw TS(e)}t&&(e.Authorization=`Bearer ${t}`),this._sessionId&&(e[`mcp-session-id`]=this._sessionId),this._protocolVersion&&(e[`mcp-protocol-version`]=this._protocolVersion);let n=Sb(this._requestInit?.headers);return new Headers({...e,...n})}_applyBodyDerivedHeaders(e,t){if(Array.isArray(t)||!Gy(t))return;let n=t.params?._meta?.[Vm];if(typeof n!=`string`)return;e.set(`mcp-protocol-version`,n),e.set(`mcp-method`,t.method);let r=t.params,i=t.method===`resources/read`?typeof r?.uri==`string`?r.uri:void 0:typeof r?.name==`string`?r.name:void 0;i!==void 0&&e.set(`mcp-name`,tb(i))}_isModernEnvelopedRequest(e){if(Array.isArray(e)||!Gy(e))return!1;let t=e.params?._meta?.[Vm];return typeof t==`string`&&xv(t)}async _startOrAuthSse(e,t=!1,n=0){let{resumptionToken:r,requestSignal:i}=e,a=()=>this._abortController?.signal.aborted===!0||i?.aborted===!0;try{let a=await this._commonHeaders(),o=[...a.get(`accept`)?.split(`,`).map(e=>e.trim().toLowerCase())??[],`text/event-stream`];a.set(`accept`,[...new Set(o)].join(`, `)),r&&a.set(`last-event-id`,r);let s=this._abortController?.signal,c=i!==void 0&&s!==void 0?lC(s,i):i??s,l=await(this._fetch??fetch)(this._url,{...this._requestInit,method:`GET`,headers:a,signal:c});if(!l.ok){if(l.status===401&&this._authProvider){if(l.headers.has(`www-authenticate`)){let{resourceMetadataUrl:e,scope:t}=eS(l);this._resourceMetadataUrl=e,this._scope=Nx(this._scope,t)}if(this._authProvider.onUnauthorized&&!t){try{await this._authProvider.onUnauthorized({response:l,serverUrl:this._url,fetchFn:this._fetchWithInit})}catch(e){throw TS(e)}return await l.text?.().catch(()=>{}),this._startOrAuthSse(e,!0,n)}throw await l.text?.().catch(()=>{}),TS(t?new vv(gv.ClientHttpAuthentication,`Server returned 401 after re-authentication`,{status:401,statusText:l.statusText}):new Ax)}if(l.status===403){let{resourceMetadataUrl:r,scope:i,error:a,errorDescription:o}=eS(l);if(a===`insufficient_scope`){let a=await l.text?.().catch(()=>null);if(await this._stepUpAuthorize({scope:i,resourceMetadataUrl:r,errorDescription:o,statusText:l.statusText,text:a},n)!==`AUTHORIZED`)throw TS(new Ax);return this._startOrAuthSse(e,t,n+1)}}if(await l.text?.().catch(()=>{}),l.status===405){e.onRequestStreamEnd?.();return}throw new vv(gv.ClientHttpFailedToOpenStream,`Failed to open SSE stream: ${l.statusText}`,{status:l.status,statusText:l.statusText})}this._handleSseStream(l.body,e,!0)}catch(e){throw a()||this.onerror?.(e),e}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let t=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,r=this._reconnectionOptions.maxReconnectionDelay;return Math.min(t*n**+e,r)}_scheduleReconnection(e,t=0){let n=this._reconnectionOptions.maxRetries;if(t>=n){this.onerror?.(Error(`Maximum reconnection attempts (${n}) exceeded.`)),e.onRequestStreamEnd?.();return}let r=this._getNextReconnectionDelay(t),i=()=>{this._cancelReconnection=void 0,!(this._abortController?.signal.aborted||e.requestSignal?.aborted)&&this._startOrAuthSse(e).catch(n=>{if(!(this._abortController?.signal.aborted||e.requestSignal?.aborted)){this.onerror?.(Error(`Failed to reconnect SSE stream: ${n instanceof Error?n.message:String(n)}`));try{this._scheduleReconnection(e,t+1)}catch(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}}})};if(this._reconnectionScheduler){let e=this._reconnectionScheduler(i,r,t);this._cancelReconnection=typeof e==`function`?e:void 0}else{let e=setTimeout(i,r);this._cancelReconnection=()=>clearTimeout(e)}}_handleSseStream(e,t,n){if(!e){t.onRequestStreamEnd?.();return}let{onresumptiontoken:r,replayMessageId:i,requestSignal:a,onRequestStreamEnd:o}=t,s=()=>this._abortController?.signal.aborted===!0||a?.aborted===!0,c,l=!1,u=!1;(async()=>{try{let t=e.pipeThrough(new TextDecoderStream).pipeThrough(new vx({onRetry:e=>{this._serverRetryMs=e}})).getReader();for(;;){let{value:e,done:n}=await t.read();if(n)break;if(e.id&&(c=e.id,l=!0,r?.(e.id)),e.data&&(!e.event||e.event===`message`))try{let t=ph.parse(JSON.parse(e.data));(qy(t)||Jy(t))&&(u=!0,i!==void 0&&(t.id=i)),this.onmessage?.(t)}catch(e){this.onerror?.(e)}}(n||l)&&!u&&this._abortController&&!s()?this._scheduleReconnection({resumptionToken:c,onresumptiontoken:r,replayMessageId:i,requestSignal:a,onRequestStreamEnd:o},0):s()||o?.()}catch(e){if(s())return;if(this.onerror?.(Error(`SSE stream disconnected: ${e}`)),(n||l)&&!u&&this._abortController&&!s())try{this._scheduleReconnection({resumptionToken:c,onresumptiontoken:r,replayMessageId:i,requestSignal:a,onRequestStreamEnd:o},0)}catch(e){this.onerror?.(Error(`Failed to reconnect: ${e instanceof Error?e.message:String(e)}`)),o?.()}else o?.()}})()}async start(){if(this._abortController)throw Error(`StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.`);this._abortController=new AbortController}async finishAuth(e,t){if(!this._oauthProvider)throw new Ax(`finishAuth requires an OAuthClientProvider`);let{authorizationCode:n,iss:r}=await Fx(e,t,this._oauthProvider,this._url,{fetchFn:this._fetchWithInit,resourceMetadataUrl:this._resourceMetadataUrl});if(await Yx(this._oauthProvider,{serverUrl:this._url,authorizationCode:n,iss:r,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit,skipIssuerMetadataValidation:this._skipIssuerMetadataValidation})!==`AUTHORIZED`)throw new Ax(`Failed to authorize`)}async close(){try{this._cancelReconnection?.()}finally{this._cancelReconnection=void 0,this._abortController?.abort(),this.onclose?.()}}async send(e,t){return this._send(e,t,!1)}async _send(e,t,n,r=0){try{let{resumptionToken:i,onresumptiontoken:a}=t||{};if(i){this._startOrAuthSse({resumptionToken:i,replayMessageId:Gy(e)?e.id:void 0,requestSignal:t?.requestSignal}).catch(e=>this.onerror?.(e));return}let o=await this._commonHeaders();this._applyBodyDerivedHeaders(o,e);let s=Array.isArray(e)?e.some(e=>Yy(e)):Yy(e);if(s&&o.delete(`mcp-session-id`),t?.headers!==void 0)for(let[e,n]of Object.entries(t.headers))cC.has(e.toLowerCase())||o.set(e,n);o.set(`content-type`,`application/json`);let c=[...o.get(`accept`)?.split(`,`).map(e=>e.trim().toLowerCase())??[],`application/json`,`text/event-stream`];o.set(`accept`,[...new Set(c)].join(`, `));let l=this._abortController?.signal,u=t?.requestSignal!==void 0&&l!==void 0?lC(l,t.requestSignal):t?.requestSignal??l,d={...this._requestInit,method:`POST`,headers:o,body:JSON.stringify(e),signal:u},f=await(this._fetch??fetch)(this._url,d);if(s&&f.ok&&(this._sessionId=f.headers.get(`mcp-session-id`)||void 0),!f.ok){if(f.status===401&&this._authProvider){if(f.headers.has(`www-authenticate`)){let{resourceMetadataUrl:e,scope:t}=eS(f);this._resourceMetadataUrl=e,this._scope=Nx(this._scope,t)}if(this._authProvider.onUnauthorized&&!n){try{await this._authProvider.onUnauthorized({response:f,serverUrl:this._url,fetchFn:this._fetchWithInit})}catch(e){throw TS(e)}return await f.text?.().catch(()=>{}),this._send(e,t,!0,r)}throw await f.text?.().catch(()=>{}),TS(n?new vv(gv.ClientHttpAuthentication,`Server returned 401 after re-authentication`,{status:401,statusText:f.statusText}):new Ax)}let i=await f.text?.().catch(()=>null);if(f.status===403){let{resourceMetadataUrl:a,scope:o,error:s,errorDescription:c}=eS(f);if(s===`insufficient_scope`){if(await this._stepUpAuthorize({scope:o,resourceMetadataUrl:a,errorDescription:c,statusText:f.statusText,text:i},r)!==`AUTHORIZED`)throw TS(new Ax);return this._send(e,t,n,r+1)}}if(f.status===400&&typeof i==`string`&&this._isModernEnvelopedRequest(e))try{let t=ph.parse(JSON.parse(i)),n=(Array.isArray(e)?e:[e]).filter(e=>Gy(e));if(Jy(t)&&n.some(e=>e.id===t.id)){this.onmessage?.(t);return}}catch{}throw new vv(gv.ClientHttpNotImplemented,`Error POSTing to endpoint: ${i}`,{status:f.status,statusText:f.statusText,text:i})}if(f.status===202){await f.text?.().catch(()=>{}),kee(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(e=>this.onerror?.(e));return}let p=(Array.isArray(e)?e:[e]).some(e=>`method`in e&&`id`in e&&e.id!==void 0),m=f.headers.get(`content-type`),h=Dte(m);if(p)if(h===`text/event-stream`)this._handleSseStream(f.body,{onresumptiontoken:a,requestSignal:t?.requestSignal,onRequestStreamEnd:t?.onRequestStreamEnd},!1);else if(h===`application/json`){let e=await f.json(),t=Array.isArray(e)?e.map(e=>ph.parse(e)):[ph.parse(e)];for(let e of t)this.onmessage?.(e)}else throw await f.text?.().catch(()=>{}),new _v(gv.ClientHttpUnexpectedContent,`Unexpected content type: ${m}`,{contentType:m});else await f.text?.().catch(()=>{})}catch(e){throw t?.requestSignal?.aborted!==!0&&this.onerror?.(e),e}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let e=await this._commonHeaders(),t={...this._requestInit,method:`DELETE`,headers:e,signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._url,t);if(await n.text?.().catch(()=>{}),!n.ok&&n.status!==405)throw new vv(gv.ClientHttpFailedToTerminateSession,`Failed to terminate session: ${n.statusText}`,{status:n.status,statusText:n.statusText});this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,t){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:t?.onresumptiontoken})}},dC=5e3,fC=2e4;function pC(e){try{let t=JSON.stringify(e);return t?Math.ceil(new TextEncoder().encode(t).length/4):0}catch{return 0}}function mC(e){let{meta:t,...n}=e;return pC(n)}function hC(e){return pC(e?.modelContent)}function gC(e,t){let n=mC(e);n>=5e3&&console.warn(`[skybridge] Tool "${t}" returned ${n} estimated model-visible tokens; this reaches the ${dC}-token warning threshold and may overload model context. Content and structured content are included in this estimate.`)}function _C(e,t){let n=pC(e);n>=2e4&&console.warn(`[skybridge] ${t} is persisting ${n} estimated tokens in model-visible view state; this reaches the ${fC}-token warning threshold and may overload model context. Persisted view state and data-llm context are included in this estimate.`)}function vC(e,t){if(e instanceof Promise)throw Error(t)}function yC(e,t){let n={},r=[];for(let i in e){let a=e[i][`~standard`].validate(t[i]);if(vC(a,`Validation must be synchronous, but ${i} returned a Promise.`),a.issues){r.push(...a.issues.map(e=>({...e,message:e.message,path:[i,...e.path??[]]})));continue}n[i]=a.value}return r.length?{issues:r}:{value:n}}function bC(e){let t=e.runtimeEnvStrict??e.runtimeEnv??{};if(e.emptyStringAsUndefined??!1)for(let[e,n]of Object.entries(t))n===``&&delete t[e];if(e.skipValidation){if(e.extends)for(let t of e.extends)t.skipValidation=!0;return t}let n=typeof e.client==`object`?e.client:{},r=typeof e.server==`object`?e.server:{},i=typeof e.shared==`object`?e.shared:{},a=e.isServer??(typeof window>`u`||`Deno`in window),o=a?{...r,...i,...n}:{...n,...i},s=(e.createFinalSchema?.(o,a))?.[`~standard`].validate(t)??yC(o,t);vC(s,`Validation must be synchronous`);let c=e.onValidationError??(e=>{throw console.error(`❌ Invalid environment variables:`,e),Error(`Invalid environment variables`)}),l=e.onInvalidAccess??(()=>{throw Error(`❌ Attempted to access a server-side environment variable on the client`)});if(s.issues)return c(s.issues);let u=t=>!e.clientPrefix||!t.startsWith(e.clientPrefix)&&!(t in i),d=e=>a||!u(e),f=e=>e==="__esModule"||e===`$$typeof`,p=(e.extends??[]).reduce((e,t)=>Object.assign(e,t),{}),m=Object.assign(p,s.value);return new Proxy(m,{get(e,t){if(typeof t==`string`&&!f(t))return d(t)?Reflect.get(e,t):l(t)}})}var xC=bC({clientPrefix:`VITE_`,client:{VITE_MCP_SERVER_URL:G().default(`${window.location.origin}/mcp`)},runtimeEnv:{BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1},emptyStringAsUndefined:!0}),SC=u(_(),1),CC=typeof global==`object`&&global&&global.Object===Object&&global,wC=typeof self==`object`&&self&&self.Object===Object&&self,TC=CC||wC||Function(`return this`)(),EC=TC.Symbol,DC=Object.prototype,OC=DC.hasOwnProperty,kC=DC.toString,AC=EC?EC.toStringTag:void 0;function jC(e){var t=OC.call(e,AC),n=e[AC];try{e[AC]=void 0;var r=!0}catch{}var i=kC.call(e);return r&&(t?e[AC]=n:delete e[AC]),i}var MC=Object.prototype.toString;function NC(e){return MC.call(e)}var PC=`[object Null]`,FC=`[object Undefined]`,IC=EC?EC.toStringTag:void 0;function LC(e){return e==null?e===void 0?FC:PC:IC&&IC in Object(e)?jC(e):NC(e)}function RC(e){return typeof e==`object`&&!!e}var zC=`[object Symbol]`;function BC(e){return typeof e==`symbol`||RC(e)&&LC(e)==zC}function VC(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var HC=Array.isArray,UC=1/0,WC=EC?EC.prototype:void 0,GC=WC?WC.toString:void 0;function KC(e){if(typeof e==`string`)return e;if(HC(e))return VC(e,KC)+``;if(BC(e))return GC?GC.call(e):``;var t=e+``;return t==`0`&&1/e==-UC?`-0`:t}var qC=/\s/;function JC(e){for(var t=e.length;t--&&qC.test(e.charAt(t)););return t}var YC=/^\s+/;function XC(e){return e&&e.slice(0,JC(e)+1).replace(YC,``)}function ZC(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var QC=NaN,$C=/^[-+]0x[0-9a-f]+$/i,ew=/^0b[01]+$/i,tw=/^0o[0-7]+$/i,nw=parseInt;function kte(e){if(typeof e==`number`)return e;if(BC(e))return QC;if(ZC(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=ZC(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=XC(e);var n=ew.test(e);return n||tw.test(e)?nw(e.slice(2),n?2:8):$C.test(e)?QC:+e}var rw=1/0,Ate=17976931348623157e292;function jte(e){return e?(e=kte(e),e===rw||e===-rw?(e<0?-1:1)*Ate:e===e?e:0):e===0?e:0}function iw(e){var t=jte(e),n=t%1;return t===t?n?t-n:t:0}function aw(e){return e}var Mte=`[object AsyncFunction]`,Nte=`[object Function]`,Pte=`[object GeneratorFunction]`,Fte=`[object Proxy]`;function ow(e){if(!ZC(e))return!1;var t=LC(e);return t==Nte||t==Pte||t==Mte||t==Fte}var sw=TC[`__core-js_shared__`],cw=function(){var e=/[^.]+$/.exec(sw&&sw.keys&&sw.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function Ite(e){return!!cw&&cw in e}var Lte=Function.prototype.toString;function lw(e){if(e!=null){try{return Lte.call(e)}catch{}try{return e+``}catch{}}return``}var Rte=/[\\^$.*+?()[\]{}|]/g,zte=/^\[object .+?Constructor\]$/,Bte=Function.prototype,Vte=Object.prototype,Hte=Bte.toString,Ute=Vte.hasOwnProperty,Wte=RegExp(`^`+Hte.call(Ute).replace(Rte,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function Gte(e){return!ZC(e)||Ite(e)?!1:(ow(e)?Wte:zte).test(lw(e))}function Kte(e,t){return e?.[t]}function uw(e,t){var n=Kte(e,t);return Gte(n)?n:void 0}var dw=uw(TC,`WeakMap`),fw=Object.create,pw=function(){function e(){}return function(t){if(!ZC(t))return{};if(fw)return fw(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function qte(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function mw(){}function hw(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}var Jte=800,Yte=16,Xte=Date.now;function Zte(e){var t=0,n=0;return function(){var r=Xte(),i=Yte-(r-n);if(n=r,i>0){if(++t>=Jte)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Qte(e){return function(){return e}}var gw=function(){try{var e=uw(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),_w=Zte(gw?function(e,t){return gw(e,`toString`,{configurable:!0,enumerable:!1,value:Qte(t),writable:!0})}:aw);function vw(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function $te(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function ene(e){return e!==e}function tne(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function yw(e,t,n){return t===t?tne(e,t,n):$te(e,ene,n)}function bw(e,t){return!!(e!=null&&e.length)&&yw(e,t,0)>-1}var nne=9007199254740991,rne=/^(?:0|[1-9]\d*)$/;function xw(e,t){var n=typeof e;return t??=nne,!!t&&(n==`number`||n!=`symbol`&&rne.test(e))&&e>-1&&e%1==0&&e<t}function Sw(e,t,n){t==`__proto__`&&gw?gw(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Cw(e,t){return e===t||e!==e&&t!==t}var ine=Object.prototype.hasOwnProperty;function ww(e,t,n){var r=e[t];(!(ine.call(e,t)&&Cw(r,n))||n===void 0&&!(t in e))&&Sw(e,t,n)}function Tw(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?Sw(n,s,c):ww(n,s,c)}return n}var Ew=Math.max;function Dw(e,t,n){return t=Ew(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=Ew(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),qte(e,this,s)}}function Ow(e,t){return _w(Dw(e,t,aw),e+``)}var ane=9007199254740991;function kw(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=ane}function Aw(e){return e!=null&&kw(e.length)&&!ow(e)}function one(e,t,n){if(!ZC(n))return!1;var r=typeof t;return(r==`number`?Aw(n)&&xw(t,n.length):r==`string`&&t in n)?Cw(n[t],e):!1}function jw(e){return Ow(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&one(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var sne=Object.prototype;function Mw(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||sne)}function Nw(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var cne=`[object Arguments]`;function Pw(e){return RC(e)&&LC(e)==cne}var Fw=Object.prototype,lne=Fw.hasOwnProperty,une=Fw.propertyIsEnumerable,Iw=Pw(function(){return arguments}())?Pw:function(e){return RC(e)&&lne.call(e,`callee`)&&!une.call(e,`callee`)};function dne(){return!1}var Lw=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Rw=Lw&&typeof module==`object`&&module&&!module.nodeType&&module,zw=Rw&&Rw.exports===Lw?TC.Buffer:void 0,Bw=(zw?zw.isBuffer:void 0)||dne,fne=`[object Arguments]`,pne=`[object Array]`,mne=`[object Boolean]`,hne=`[object Date]`,gne=`[object Error]`,_ne=`[object Function]`,vne=`[object Map]`,yne=`[object Number]`,bne=`[object Object]`,xne=`[object RegExp]`,Sne=`[object Set]`,Cne=`[object String]`,wne=`[object WeakMap]`,Tne=`[object ArrayBuffer]`,Ene=`[object DataView]`,Dne=`[object Float32Array]`,One=`[object Float64Array]`,kne=`[object Int8Array]`,Ane=`[object Int16Array]`,jne=`[object Int32Array]`,Mne=`[object Uint8Array]`,Nne=`[object Uint8ClampedArray]`,Pne=`[object Uint16Array]`,Fne=`[object Uint32Array]`,Vw={};Vw[Dne]=Vw[One]=Vw[kne]=Vw[Ane]=Vw[jne]=Vw[Mne]=Vw[Nne]=Vw[Pne]=Vw[Fne]=!0,Vw[fne]=Vw[pne]=Vw[Tne]=Vw[mne]=Vw[Ene]=Vw[hne]=Vw[gne]=Vw[_ne]=Vw[vne]=Vw[yne]=Vw[bne]=Vw[xne]=Vw[Sne]=Vw[Cne]=Vw[wne]=!1;function Ine(e){return RC(e)&&kw(e.length)&&!!Vw[LC(e)]}function Hw(e){return function(t){return e(t)}}var Uw=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Ww=Uw&&typeof module==`object`&&module&&!module.nodeType&&module,Gw=Ww&&Ww.exports===Uw&&CC.process,Kw=function(){try{return Ww&&Ww.require&&Ww.require(`util`).types||Gw&&Gw.binding&&Gw.binding(`util`)}catch{}}(),qw=Kw&&Kw.isTypedArray,Jw=qw?Hw(qw):Ine,Lne=Object.prototype.hasOwnProperty;function Yw(e,t){var n=HC(e),r=!n&&Iw(e),i=!n&&!r&&Bw(e),a=!n&&!r&&!i&&Jw(e),o=n||r||i||a,s=o?Nw(e.length,String):[],c=s.length;for(var l in e)(t||Lne.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||xw(l,c)))&&s.push(l);return s}function Xw(e,t){return function(n){return e(t(n))}}var Rne=Xw(Object.keys,Object),zne=Object.prototype.hasOwnProperty;function Zw(e){if(!Mw(e))return Rne(e);var t=[];for(var n in Object(e))zne.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Qw(e){return Aw(e)?Yw(e):Zw(e)}var Bne=Object.prototype.hasOwnProperty,Vne=jw(function(e,t){if(Mw(t)||Aw(t)){Tw(t,Qw(t),e);return}for(var n in t)Bne.call(t,n)&&ww(e,n,t[n])});function Hne(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Une=Object.prototype.hasOwnProperty;function Wne(e){if(!ZC(e))return Hne(e);var t=Mw(e),n=[];for(var r in e)r==`constructor`&&(t||!Une.call(e,r))||n.push(r);return n}function $w(e){return Aw(e)?Yw(e,!0):Wne(e)}var Gne=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Kne=/^\w*$/;function eT(e,t){if(HC(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||BC(e)?!0:Kne.test(e)||!Gne.test(e)||t!=null&&e in Object(t)}var tT=uw(Object,`create`);function qne(){this.__data__=tT?tT(null):{},this.size=0}function Jne(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var Yne=`__lodash_hash_undefined__`,Xne=Object.prototype.hasOwnProperty;function Zne(e){var t=this.__data__;if(tT){var n=t[e];return n===Yne?void 0:n}return Xne.call(t,e)?t[e]:void 0}var Qne=Object.prototype.hasOwnProperty;function $ne(e){var t=this.__data__;return tT?t[e]!==void 0:Qne.call(t,e)}var ere=`__lodash_hash_undefined__`;function tre(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=tT&&t===void 0?ere:t,this}function nT(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}nT.prototype.clear=qne,nT.prototype.delete=Jne,nT.prototype.get=Zne,nT.prototype.has=$ne,nT.prototype.set=tre;function nre(){this.__data__=[],this.size=0}function rT(e,t){for(var n=e.length;n--;)if(Cw(e[n][0],t))return n;return-1}var rre=Array.prototype.splice;function ire(e){var t=this.__data__,n=rT(t,e);return n<0?!1:(n==t.length-1?t.pop():rre.call(t,n,1),--this.size,!0)}function are(e){var t=this.__data__,n=rT(t,e);return n<0?void 0:t[n][1]}function ore(e){return rT(this.__data__,e)>-1}function sre(e,t){var n=this.__data__,r=rT(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function iT(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}iT.prototype.clear=nre,iT.prototype.delete=ire,iT.prototype.get=are,iT.prototype.has=ore,iT.prototype.set=sre;var aT=uw(TC,`Map`);function cre(){this.size=0,this.__data__={hash:new nT,map:new(aT||iT),string:new nT}}function lre(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function oT(e,t){var n=e.__data__;return lre(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function ure(e){var t=oT(this,e).delete(e);return this.size-=+!!t,t}function dre(e){return oT(this,e).get(e)}function fre(e){return oT(this,e).has(e)}function pre(e,t){var n=oT(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function sT(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}sT.prototype.clear=cre,sT.prototype.delete=ure,sT.prototype.get=dre,sT.prototype.has=fre,sT.prototype.set=pre;var mre=`Expected a function`;function cT(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(mre);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(cT.Cache||sT),n}cT.Cache=sT;var hre=500;function gre(e){var t=cT(e,function(e){return n.size===hre&&n.clear(),e}),n=t.cache;return t}var _re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vre=/\\(\\)?/g,lT=gre(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(_re,function(e,n,r,i){t.push(r?i.replace(vre,`$1`):n||e)}),t});function uT(e){return e==null?``:KC(e)}function dT(e,t){return HC(e)?e:eT(e,t)?[e]:lT(uT(e))}var yre=1/0;function fT(e){if(typeof e==`string`||BC(e))return e;var t=e+``;return t==`0`&&1/e==-yre?`-0`:t}function pT(e,t){t=dT(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[fT(t[n++])];return n&&n==r?e:void 0}function X(e,t,n){var r=e==null?void 0:pT(e,t);return r===void 0?n:r}function mT(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var hT=EC?EC.isConcatSpreadable:void 0;function bre(e){return HC(e)||Iw(e)||!!(hT&&e&&e[hT])}function gT(e,t,n,r,i){var a=-1,o=e.length;for(n||=bre,i||=[];++a<o;){var s=e[a];t>0&&n(s)?t>1?gT(s,t-1,n,r,i):mT(i,s):r||(i[i.length]=s)}return i}function _T(e){return e!=null&&e.length?gT(e,1):[]}function vT(e){return _w(Dw(e,void 0,_T),e+``)}var yT=Xw(Object.getPrototypeOf,Object),xre=`[object Object]`,Sre=Function.prototype,Cre=Object.prototype,bT=Sre.toString,wre=Cre.hasOwnProperty,Tre=bT.call(Object);function xT(e){if(!RC(e)||LC(e)!=xre)return!1;var t=yT(e);if(t===null)return!0;var n=wre.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&bT.call(n)==Tre}function Ere(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}function Dre(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function Ore(){this.__data__=new iT,this.size=0}function kre(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Are(e){return this.__data__.get(e)}function jre(e){return this.__data__.has(e)}var Mre=200;function Nre(e,t){var n=this.__data__;if(n instanceof iT){var r=n.__data__;if(!aT||r.length<Mre-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new sT(r)}return n.set(e,t),this.size=n.size,this}function ST(e){var t=this.__data__=new iT(e);this.size=t.size}ST.prototype.clear=Ore,ST.prototype.delete=kre,ST.prototype.get=Are,ST.prototype.has=jre,ST.prototype.set=Nre;function Pre(e,t){return e&&Tw(t,Qw(t),e)}function Fre(e,t){return e&&Tw(t,$w(t),e)}var CT=typeof exports==`object`&&exports&&!exports.nodeType&&exports,wT=CT&&typeof module==`object`&&module&&!module.nodeType&&module,TT=wT&&wT.exports===CT?TC.Buffer:void 0,ET=TT?TT.allocUnsafe:void 0;function DT(e,t){if(t)return e.slice();var n=e.length,r=ET?ET(n):new e.constructor(n);return e.copy(r),r}function Ire(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function OT(){return[]}var Lre=Object.prototype.propertyIsEnumerable,kT=Object.getOwnPropertySymbols,AT=kT?function(e){return e==null?[]:(e=Object(e),Ire(kT(e),function(t){return Lre.call(e,t)}))}:OT;function Rre(e,t){return Tw(e,AT(e),t)}var jT=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)mT(t,AT(e)),e=yT(e);return t}:OT;function zre(e,t){return Tw(e,jT(e),t)}function MT(e,t,n){var r=t(e);return HC(e)?r:mT(r,n(e))}function NT(e){return MT(e,Qw,AT)}function PT(e){return MT(e,$w,jT)}var FT=uw(TC,`DataView`),IT=uw(TC,`Promise`),LT=uw(TC,`Set`),RT=`[object Map]`,Bre=`[object Object]`,zT=`[object Promise]`,BT=`[object Set]`,VT=`[object WeakMap]`,HT=`[object DataView]`,Vre=lw(FT),Hre=lw(aT),Ure=lw(IT),Wre=lw(LT),Gre=lw(dw),UT=LC;(FT&&UT(new FT(new ArrayBuffer(1)))!=HT||aT&&UT(new aT)!=RT||IT&&UT(IT.resolve())!=zT||LT&&UT(new LT)!=BT||dw&&UT(new dw)!=VT)&&(UT=function(e){var t=LC(e),n=t==Bre?e.constructor:void 0,r=n?lw(n):``;if(r)switch(r){case Vre:return HT;case Hre:return RT;case Ure:return zT;case Wre:return BT;case Gre:return VT}return t});var WT=UT,Kre=Object.prototype.hasOwnProperty;function qre(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&Kre.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}var GT=TC.Uint8Array;function KT(e){var t=new e.constructor(e.byteLength);return new GT(t).set(new GT(e)),t}function Jre(e,t){var n=t?KT(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Yre=/\w*$/;function Xre(e){var t=new e.constructor(e.source,Yre.exec(e));return t.lastIndex=e.lastIndex,t}var qT=EC?EC.prototype:void 0,JT=qT?qT.valueOf:void 0;function Zre(e){return JT?Object(JT.call(e)):{}}function YT(e,t){var n=t?KT(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Qre=`[object Boolean]`,$re=`[object Date]`,eie=`[object Map]`,tie=`[object Number]`,nie=`[object RegExp]`,rie=`[object Set]`,iie=`[object String]`,aie=`[object Symbol]`,oie=`[object ArrayBuffer]`,sie=`[object DataView]`,cie=`[object Float32Array]`,lie=`[object Float64Array]`,uie=`[object Int8Array]`,die=`[object Int16Array]`,fie=`[object Int32Array]`,pie=`[object Uint8Array]`,mie=`[object Uint8ClampedArray]`,hie=`[object Uint16Array]`,gie=`[object Uint32Array]`;function _ie(e,t,n){var r=e.constructor;switch(t){case oie:return KT(e);case Qre:case $re:return new r(+e);case sie:return Jre(e,n);case cie:case lie:case uie:case die:case fie:case pie:case mie:case hie:case gie:return YT(e,n);case eie:return new r;case tie:case iie:return new r(e);case nie:return Xre(e);case rie:return new r;case aie:return Zre(e)}}function XT(e){return typeof e.constructor==`function`&&!Mw(e)?pw(yT(e)):{}}var vie=`[object Map]`;function yie(e){return RC(e)&&WT(e)==vie}var ZT=Kw&&Kw.isMap,bie=ZT?Hw(ZT):yie,xie=`[object Set]`;function Sie(e){return RC(e)&&WT(e)==xie}var QT=Kw&&Kw.isSet,Cie=QT?Hw(QT):Sie,wie=1,Tie=2,Eie=4,$T=`[object Arguments]`,Die=`[object Array]`,Oie=`[object Boolean]`,kie=`[object Date]`,Aie=`[object Error]`,eE=`[object Function]`,jie=`[object GeneratorFunction]`,Mie=`[object Map]`,Nie=`[object Number]`,tE=`[object Object]`,Pie=`[object RegExp]`,Fie=`[object Set]`,Iie=`[object String]`,Lie=`[object Symbol]`,Rie=`[object WeakMap]`,zie=`[object ArrayBuffer]`,Bie=`[object DataView]`,Vie=`[object Float32Array]`,Hie=`[object Float64Array]`,Uie=`[object Int8Array]`,Wie=`[object Int16Array]`,Gie=`[object Int32Array]`,Kie=`[object Uint8Array]`,qie=`[object Uint8ClampedArray]`,Jie=`[object Uint16Array]`,Yie=`[object Uint32Array]`,nE={};nE[$T]=nE[Die]=nE[zie]=nE[Bie]=nE[Oie]=nE[kie]=nE[Vie]=nE[Hie]=nE[Uie]=nE[Wie]=nE[Gie]=nE[Mie]=nE[Nie]=nE[tE]=nE[Pie]=nE[Fie]=nE[Iie]=nE[Lie]=nE[Kie]=nE[qie]=nE[Jie]=nE[Yie]=!0,nE[Aie]=nE[eE]=nE[Rie]=!1;function rE(e,t,n,r,i,a){var o,s=t&wie,c=t&Tie,l=t&Eie;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!ZC(e))return e;var u=HC(e);if(u){if(o=qre(e),!s)return hw(e,o)}else{var d=WT(e),f=d==eE||d==jie;if(Bw(e))return DT(e,s);if(d==tE||d==$T||f&&!i){if(o=c||f?{}:XT(e),!s)return c?zre(e,Fre(o,e)):Rre(e,Pre(o,e))}else{if(!nE[d])return i?e:{};o=_ie(e,d,s)}}a||=new ST;var p=a.get(e);if(p)return p;a.set(e,o),Cie(e)?e.forEach(function(r){o.add(rE(r,t,n,r,e,a))}):bie(e)&&e.forEach(function(r,i){o.set(i,rE(r,t,n,i,e,a))});var m=u?void 0:(l?c?PT:NT:c?$w:Qw)(e);return vw(m||e,function(r,i){m&&(i=r,r=e[i]),ww(o,i,rE(r,t,n,i,e,a))}),o}var Xie=1,Zie=4;function iE(e){return rE(e,Xie|Zie)}var Qie=`__lodash_hash_undefined__`;function $ie(e){return this.__data__.set(e,Qie),this}function eae(e){return this.__data__.has(e)}function aE(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new sT;++t<n;)this.add(e[t])}aE.prototype.add=aE.prototype.push=$ie,aE.prototype.has=eae;function tae(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function oE(e,t){return e.has(t)}var nae=1,rae=2;function sE(e,t,n,r,i,a){var o=n&nae,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&rae?new aE:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!tae(t,function(e,t){if(!oE(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}function iae(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function cE(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var aae=1,oae=2,sae=`[object Boolean]`,cae=`[object Date]`,lae=`[object Error]`,uae=`[object Map]`,dae=`[object Number]`,fae=`[object RegExp]`,pae=`[object Set]`,mae=`[object String]`,hae=`[object Symbol]`,gae=`[object ArrayBuffer]`,_ae=`[object DataView]`,lE=EC?EC.prototype:void 0,uE=lE?lE.valueOf:void 0;function vae(e,t,n,r,i,a,o){switch(n){case _ae:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case gae:return!(e.byteLength!=t.byteLength||!a(new GT(e),new GT(t)));case sae:case cae:case dae:return Cw(+e,+t);case lae:return e.name==t.name&&e.message==t.message;case fae:case mae:return e==t+``;case uae:var s=iae;case pae:var c=r&aae;if(s||=cE,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=oae,o.set(e,t);var u=sE(s(e),s(t),r,i,a,o);return o.delete(e),u;case hae:if(uE)return uE.call(e)==uE.call(t)}return!1}var yae=1,bae=Object.prototype.hasOwnProperty;function xae(e,t,n,r,i,a){var o=n&yae,s=NT(e),c=s.length;if(c!=NT(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:bae.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var Sae=1,dE=`[object Arguments]`,fE=`[object Array]`,pE=`[object Object]`,mE=Object.prototype.hasOwnProperty;function Cae(e,t,n,r,i,a){var o=HC(e),s=HC(t),c=o?fE:WT(e),l=s?fE:WT(t);c=c==dE?pE:c,l=l==dE?pE:l;var u=c==pE,d=l==pE,f=c==l;if(f&&Bw(e)){if(!Bw(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new ST,o||Jw(e)?sE(e,t,n,r,i,a):vae(e,t,c,n,r,i,a);if(!(n&Sae)){var p=u&&mE.call(e,`__wrapped__`),m=d&&mE.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new ST,i(h,g,n,r,a)}}return f?(a||=new ST,xae(e,t,n,r,i,a)):!1}function hE(e,t,n,r,i){return e===t?!0:e==null||t==null||!RC(e)&&!RC(t)?e!==e&&t!==t:Cae(e,t,n,r,hE,i)}var wae=1,Tae=2;function Eae(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var c=s[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new ST;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?hE(u,l,wae|Tae,r,d):f))return!1}}return!0}function gE(e){return e===e&&!ZC(e)}function Dae(e){for(var t=Qw(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,gE(i)]}return t}function _E(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}function Oae(e){var t=Dae(e);return t.length==1&&t[0][2]?_E(t[0][0],t[0][1]):function(n){return n===e||Eae(n,e,t)}}function vE(e,t){return e!=null&&t in Object(e)}function yE(e,t,n){t=dT(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=fT(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&kw(i)&&xw(o,i)&&(HC(e)||Iw(e)))}function bE(e,t){return e!=null&&yE(e,t,vE)}var xE=1,SE=2;function CE(e,t){return eT(e)&&gE(t)?_E(fT(e),t):function(n){var r=X(n,e);return r===void 0&&r===t?bE(n,e):hE(t,r,xE|SE)}}function kae(e){return function(t){return t?.[e]}}function Aae(e){return function(t){return pT(t,e)}}function jae(e){return eT(e)?kae(fT(e)):Aae(e)}function wE(e){return typeof e==`function`?e:e==null?aw:typeof e==`object`?HC(e)?CE(e[0],e[1]):Oae(e):jae(e)}function Mae(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var TE=Mae();function EE(e,t){return e&&TE(e,t,Qw)}function DE(e,t){return function(n,r){if(n==null)return n;if(!Aw(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var OE=DE(EE);function kE(e,t,n){(n!==void 0&&!Cw(e[t],n)||n===void 0&&!(t in e))&&Sw(e,t,n)}function AE(e){return RC(e)&&Aw(e)}function jE(e,t){if(!(t===`constructor`&&typeof e[t]==`function`)&&t!=`__proto__`)return e[t]}function Nae(e){return Tw(e,$w(e))}function Pae(e,t,n,r,i,a,o){var s=jE(e,n),c=jE(t,n),l=o.get(c);if(l){kE(e,n,l);return}var u=a?a(s,c,n+``,e,t,o):void 0,d=u===void 0;if(d){var f=HC(c),p=!f&&Bw(c),m=!f&&!p&&Jw(c);u=c,f||p||m?HC(s)?u=s:AE(s)?u=hw(s):p?(d=!1,u=DT(c,!0)):m?(d=!1,u=YT(c,!0)):u=[]:xT(c)||Iw(c)?(u=s,Iw(s)?u=Nae(s):(!ZC(s)||ow(s))&&(u=XT(c))):d=!1}d&&(o.set(c,u),i(u,c,r,a,o),o.delete(c)),kE(e,n,u)}function ME(e,t,n,r,i){e!==t&&TE(t,function(a,o){if(i||=new ST,ZC(a))Pae(e,t,o,n,ME,r,i);else{var s=r?r(jE(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),kE(e,o,s)}},$w)}function NE(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var Fae=200;function Iae(e,t,n,r){var i=-1,a=bw,o=!0,s=e.length,c=[],l=t.length;if(!s)return c;n&&(t=VC(t,Hw(n))),r?(a=NE,o=!1):t.length>=Fae&&(a=oE,o=!1,t=new aE(t));outer:for(;++i<s;){var u=e[i],d=n==null?u:n(u);if(u=r||u!==0?u:0,o&&d===d){for(var f=l;f--;)if(t[f]===d)continue outer;c.push(u)}else a(t,d,r)||c.push(u)}return c}var Lae=Ow(function(e,t){return AE(e)?Iae(e,gT(t,1,AE,!0)):[]});function PE(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function FE(e){return typeof e==`function`?e:aw}function Rae(e,t){return(HC(e)?vw:OE)(e,FE(t))}var IE=1/0;function LE(e){return e!=null&&e.length?gT(e,IE):[]}var RE=Object.prototype.hasOwnProperty;function zE(e,t){return e!=null&&RE.call(e,t)}function BE(e,t){return e!=null&&yE(e,t,zE)}var VE=`[object String]`;function HE(e){return typeof e==`string`||!HC(e)&&RC(e)&&LC(e)==VE}function UE(e,t){return VC(t,function(t){return e[t]})}function WE(e){return e==null?[]:UE(e,Qw(e))}var GE=Math.max;function KE(e,t,n,r){e=Aw(e)?e:WE(e),n=n&&!r?iw(n):0;var i=e.length;return n<0&&(n=GE(i+n,0)),HE(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&yw(e,t,n)>-1}var qE=Math.min;function JE(e,t,n){for(var r=n?NE:bw,i=e[0].length,a=e.length,o=a,s=Array(a),c=1/0,l=[];o--;){var u=e[o];o&&t&&(u=VC(u,Hw(t))),c=qE(u.length,c),s[o]=!n&&(t||i>=120&&u.length>=120)?new aE(o&&u):void 0}u=e[0];var d=-1,f=s[0];outer:for(;++d<i&&l.length<c;){var p=u[d],m=t?t(p):p;if(p=n||p!==0?p:0,!(f?oE(f,m):r(l,m,n))){for(o=a;--o;){var h=s[o];if(!(h?oE(h,m):r(e[o],m,n)))continue outer}f&&f.push(m),l.push(p)}}return l}function YE(e){return AE(e)?e:[]}var XE=Ow(function(e){var t=VC(e,YE);return t.length&&t[0]===e[0]?JE(t):[]});function ZE(e,t){return t.length<2?e:pT(e,Ere(t,0,-1))}var QE=`[object Map]`,$E=`[object Set]`,eD=Object.prototype.hasOwnProperty;function tD(e){if(e==null)return!0;if(Aw(e)&&(HC(e)||typeof e==`string`||typeof e.splice==`function`||Bw(e)||Jw(e)||Iw(e)))return!e.length;var t=WT(e);if(t==QE||t==$E)return!e.size;if(Mw(e))return!Zw(e).length;for(var n in e)if(eD.call(e,n))return!1;return!0}function nD(e,t){return hE(e,t)}var zae=`[object Number]`;function rD(e){return typeof e==`number`||RC(e)&&LC(e)==zae}function iD(e){return e==null}function aD(e){return e===void 0}var Bae=jw(function(e,t,n){ME(e,t,n)}),Vae=Object.prototype.hasOwnProperty;function oD(e,t){t=dT(t,e);var n=-1,r=t.length;if(!r)return!0;for(;++n<r;){var i=fT(t[n]);if(i===`__proto__`&&!Vae.call(e,`__proto__`)||(i===`constructor`||i===`prototype`)&&n<r-1)return!1}var a=ZE(e,t);return a==null||delete a[fT(PE(t))]}function Hae(e){return xT(e)?void 0:e}var Uae=1,Wae=2,Gae=4,sD=vT(function(e,t){var n={};if(e==null)return n;var r=!1;t=VC(t,function(t){return t=dT(t,e),r||=t.length>1,t}),Tw(e,PT(e),n),r&&(n=rE(n,Uae|Wae|Gae,Hae));for(var i=t.length;i--;)oD(n,t[i]);return n});function cD(e,t,n,r){if(!ZC(e))return e;t=dT(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var c=fT(t[i]),l=n;if(c===`__proto__`||c===`constructor`||c===`prototype`)return e;if(i!=o){var u=s[c];l=r?r(u,c,s):void 0,l===void 0&&(l=ZC(u)?u:xw(t[i+1])?[]:{})}ww(s,c,l),s=s[c]}return e}function lD(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=pT(e,o);n(s,o)&&cD(a,dT(o,e),s)}return a}function Kae(e,t){if(e==null)return{};var n=VC(PT(e),function(e){return[e]});return t=wE(t),lD(e,n,function(e,n){return t(e,n[0])})}function qae(e,t){return lD(e,t,function(t,n){return bE(e,n)})}var uD=vT(function(e,t){return e==null?{}:qae(e,t)});function Jae(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}function Yae(e,t,n){var r=HC(e)?Dre:Jae,i=arguments.length<3;return r(e,wE(t,4),n,i,OE)}function dD(e,t,n){return e==null?e:cD(e,t,n)}function Xae(e,t,n,r){return r=typeof r==`function`?r:void 0,e==null?e:cD(e,t,n,r)}var Zae=9007199254740991,fD=4294967295,Qae=Math.min;function pD(e,t){if(e=iw(e),e<1||e>Zae)return[];var n=fD,r=Qae(e,fD);t=FE(t),e-=fD;for(var i=Nw(r,t);++n<e;)t(n);return i}function mD(e){return HC(e)?VC(e,fT):BC(e)?[e]:hw(lT(uT(e)))}function $ae(e,t,n){var r=HC(e),i=r||Bw(e)||Jw(e);if(t=wE(t,4),n==null){var a=e&&e.constructor;n=i?r?new a:[]:ZC(e)&&ow(a)?pw(yT(e)):{}}return(i?vw:EE)(e,function(e,r,i){return t(n,e,r,i)}),n}var eoe=LT&&1/cE(new LT([,-0]))[1]==1/0?function(e){return new LT(e)}:mw,toe=200;function hD(e,t,n){var r=-1,i=bw,a=e.length,o=!0,s=[],c=s;if(n)o=!1,i=NE;else if(a>=toe){var l=t?null:eoe(e);if(l)return cE(l);o=!1,i=oE,c=new aE}else c=t?[]:s;outer:for(;++r<a;){var u=e[r],d=t?t(u):u;if(u=n||u!==0?u:0,o&&d===d){for(var f=c.length;f--;)if(c[f]===d)continue outer;t&&c.push(d),s.push(u)}else i(c,d,n)||(c!==s&&c.push(d),s.push(u))}return s}var noe=Ow(function(e){return hD(gT(e,1,AE,!0))});function gD(e){return e&&e.length?hD(e):[]}var _D=0;function vD(e){var t=++_D;return uT(e)+t}function yD(e,t){return e==null||oD(e,t)}var bD=as()(e=>({tools:{},setToolData:(t,n)=>e(e=>{let r=e.tools[t];if(r){let t=!0;for(let e of Object.keys(n))if(r[e]!==n[e]){t=!1;break}if(t)return e}return SD(e,`tools.${t}`,{...r??{},...n})}),updateOpenaiObject:(t,n,r)=>e(e=>e.tools[t]?.openaiObject?SD(e,`tools.${t}.openaiObject.${n}`,r):e),pushOpenAiLog:(t,n)=>e(e=>{let r=e.tools[t]?.openaiLogs||[];return SD(e,`tools.${t}.openaiLogs`,[...r,{...n,id:crypto.randomUUID()}])}),clearOpenAiLogs:t=>e(e=>e.tools[t]?.openaiLogs?.length?SD(e,`tools.${t}.openaiLogs`,[]):e),setOpenInAppUrl:(t,n)=>e(e=>e.tools[t]?.openInAppUrl===n?e:SD(e,`tools.${t}.openInAppUrl`,n))})),xD=e=>{let{tools:t}=bD();return t[e]},SD=(e,t,n)=>{let r=iE(e);return dD(r,t,n),r};function CD(e,t,n){try{return e(t)}catch(e){return n?dt(25,t,e,n):dt(24,t,e),null}}function wD(e){function t(t){if(t===void 0)return null;let n=``;if(Array.isArray(t)){if(t[0]===void 0)return null;n=t[0]}return typeof t==`string`&&(n=t),CD(e.parse,n)}return{type:`single`,eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide(n){return t(n)??e}}},withOptions(e){return{...this,...e}}}}var TD=wD({parse:e=>e,serialize:String});wD({parse:e=>{let t=parseInt(e);return t==t?t:null},serialize:e=>``+Math.round(e)}),wD({parse:e=>{let t=parseInt(e);return t==t?t-1:null},serialize:e=>``+Math.round(e+1)}),wD({parse:e=>{let t=parseInt(e,16);return t==t?t:null},serialize:e=>{let t=Math.round(e).toString(16);return(t.length&1?`0`:``)+t}}),wD({parse:e=>{let t=parseFloat(e);return t==t?t:null},serialize:String}),wD({parse:e=>e.toLowerCase()===`true`,serialize:String});function ED(e,t){return e.valueOf()===t.valueOf()}wD({parse:e=>{let t=parseInt(e);return t==t?new Date(t):null},serialize:e=>``+e.valueOf(),eq:ED}),wD({parse:e=>{let t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:ED}),wD({parse:e=>{let t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:ED});var DD=vt(`sync-emitter`,()=>Mt()),OD={};function kD(e,t={}){let n=(0,b.useId)(),r=Ct(),i=wt(),{history:a=r?.history??`replace`,scroll:o=r?.scroll??!1,shallow:s=r?.shallow??!0,throttleMs:c=kt.timeMs,limitUrlUpdates:l=r?.limitUrlUpdates,clearOnDefault:u=r?.clearOnDefault??!0,startTransition:d,urlKeys:f=OD}=t,p=Object.keys(e).join(`,`),m=(0,b.useMemo)(()=>Object.fromEntries(Object.keys(e).map(e=>[e,f[e]??e])),[p,JSON.stringify(f)]),h=St(Object.values(m)),g=h.searchParams,_=(0,b.useRef)({}),v=(0,b.useRef)(null),y=(0,b.useRef)(null),x=(0,b.useMemo)(()=>Object.fromEntries(Object.keys(e).map(t=>[t,e[t].defaultValue??null])),[Object.values(e).map(({defaultValue:e})=>e).join(`,`)]),S=Ut(Object.values(m)),[C,w]=(0,b.useState)(()=>AD(e,f,g,S).state),T=(0,b.useRef)(C),E=Object.values(m).map(e=>`${e}=${g.getAll(e)}`).join(`&`)+JSON.stringify(S),D=()=>{let{state:t,hasChanged:r}=AD(e,f,g,S,_.current,T.current);r&&(ut(1,n,p,t),T.current=t,w(t))},O=Object.keys(_.current).join(`&`)!==Object.values(m).join(`&`),k=y.current===null||y.current===(h.pathname??location.pathname);(O||k&&v.current!==E)&&(v.current=E,D(),O&&(_.current=Object.fromEntries(Object.entries(m).map(([t,n])=>[n,e[t]?.type===`multi`?g.getAll(n):g.get(n)??null])))),(0,b.useEffect)(()=>{y.current=h.pathname??location.pathname,D()},[E,h.pathname]),(0,b.useEffect)(()=>{let t=Object.keys(e).reduce((t,r)=>(t[r]=({state:t,query:i})=>{w(a=>{let{defaultValue:o}=e[r],s=m[r],c=t??o??null,l=a[r]??o??null;return Object.is(l,c)?(ut(2,n,p,s,t,o,T.current),a):(T.current={...T.current,[r]:c},_.current[s]=i,ut(3,n,p,s,t,o,T.current),T.current)})},t),{});for(let r of Object.keys(e)){let e=m[r];ut(4,n,e,p),DD.on(e,t[r])}return()=>{for(let r of Object.keys(e)){let e=m[r];ut(5,n,e,p),DD.off(e,t[r])}}},[p,m]);let A=(0,b.useCallback)((t,r={})=>{let f=Object.fromEntries(Object.keys(e).map(e=>[e,null])),g=typeof t==`function`?t(jD(T.current,x))??f:t??f;ut(6,n,p,g);let _,v=0,y=!1,b=[];for(let[t,n]of Object.entries(g)){let f=e[t],p=m[t];if(!f||n===void 0)continue;(r.clearOnDefault??f.clearOnDefault??u)&&n!==null&&f.defaultValue!==void 0&&(f.eq??((e,t)=>e===t))(n,f.defaultValue)&&(n=null);let g=n===null?null:(f.serialize??String)(n);DD.emit(p,{state:n,query:g});let x={key:p,query:g,options:{history:r.history??f.history??a,shallow:r.shallow??f.shallow??s,scroll:r.scroll??f.scroll??o,startTransition:r.startTransition??f.startTransition??d}},S=r.limitUrlUpdates??f.limitUrlUpdates??l;if(S?.method===`debounce`){let e=S.timeMs??kt.timeMs,t=Ht.push(x,e,h,i);v<e&&(_=t,v=e)}else{let e=S?.timeMs??r.throttleMs??f.throttleMs??c;b.push(Ht.abort(p)),Rt.push(x,e),y=!0}}let S=b.reduce((e,t)=>t(e),y?Rt.flush(h,i):Rt.getPendingPromise(h));return _??S},[p,a,s,o,c,l?.method,l?.timeMs,d,m,h.updateUrl,h.getSearchParamsSnapshot,h.rateLimitFactor,i,x]);return[(0,b.useMemo)(()=>jD(C,x),[C,x]),A]}function AD(e,t,n,r,i,a){let o=!1,s=Object.entries(e).reduce((e,[s,c])=>{let l=t?.[s]??s,u=r[l],d=c.type===`multi`?[]:null,f=u===void 0?(c.type===`multi`?n.getAll(l):n.get(l))??d:u;return i&&a&&Tt(i[l]??d,f)?(e[s]=a[s]??null,e):(o=!0,e[s]=(At(f)?null:CD(c.parse,f,l))??null,i&&(i[l]=f),e)},{});if(!o){let t=Object.keys(e),n=Object.keys(a??{});o=t.length!==n.length||t.some(e=>!n.includes(e))}return{state:s,hasChanged:o}}function jD(e,t){return Object.fromEntries(Object.keys(e).map(n=>[n,e[n]??t[n]??null]))}function MD(e,t={}){let{parse:n,type:r,serialize:i,eq:a,defaultValue:o,...s}=t,[{[e]:c},l]=kD({[e]:{parse:n??(e=>e),type:r,serialize:i,eq:a,defaultValue:o}},s);return[c,(0,b.useCallback)((t,n={})=>l(n=>({[e]:typeof t==`function`?t(n[e]):t}),n),[e,l])]}function ND(){return MD(`tool`,TD)}var PD=new He,FD=`skybridge-devtools-oauth`,ID={clientInfo:`${FD}:client-info`,tokens:`${FD}:tokens`,codeVerifier:`${FD}:code-verifier`,state:`${FD}:state`,discovery:`${FD}:discovery`},LD=class{get redirectUrl(){let e=new URL(window.location.origin+window.location.pathname);return e.searchParams.set(`oauth_callback`,`true`),e.toString()}get clientMetadata(){return{redirect_uris:[this.redirectUrl],token_endpoint_auth_method:`none`,grant_types:[`authorization_code`,`refresh_token`],response_types:[`code`],client_name:`Skybridge Devtools`,client_uri:window.location.origin}}clientInformation(){let e=localStorage.getItem(ID.clientInfo);return e?JSON.parse(e):void 0}saveClientInformation(e){localStorage.setItem(ID.clientInfo,JSON.stringify(e))}tokens(){let e=localStorage.getItem(ID.tokens);return e?JSON.parse(e):void 0}saveTokens(e){localStorage.setItem(ID.tokens,JSON.stringify(e))}state(){let e=localStorage.getItem(ID.state);if(e)return e;let t=crypto.randomUUID();return localStorage.setItem(ID.state,t),t}expectedState(){return localStorage.getItem(ID.state)??void 0}redirectToAuthorization(e){window.location.href=e.toString()}saveCodeVerifier(e){localStorage.setItem(ID.codeVerifier,e)}codeVerifier(){let e=localStorage.getItem(ID.codeVerifier);if(!e)throw Error(`Missing PKCE code verifier: the sign-in flow was not started in this browser, or its storage was cleared. Retry signing in.`);return e}saveDiscoveryState(e){localStorage.setItem(ID.discovery,JSON.stringify(e))}discoveryState(){let e=localStorage.getItem(ID.discovery);return e?JSON.parse(e):void 0}invalidateCredentials(e){(e===`all`||e===`tokens`)&&localStorage.removeItem(ID.tokens),(e===`all`||e===`client`)&&localStorage.removeItem(ID.clientInfo),(e===`all`||e===`verifier`)&&(localStorage.removeItem(ID.codeVerifier),localStorage.removeItem(ID.state)),(e===`all`||e===`discovery`)&&localStorage.removeItem(ID.discovery)}},RD=new class{client=null;transport=null;async connect(e,t){let n=typeof e==`string`?new URL(e):e;this.transport=new uC(n,{authProvider:t,fetch:(e,t)=>{let r=e instanceof Request?e.url:String(e);if(new URL(r).origin!==n.origin)return fetch(e,t);let i=new Headers(t?.headers);return i.set(`x-forwarded-host`,n.host),i.set(`x-forwarded-proto`,n.protocol.replace(/:$/,``)),fetch(e,{...t,headers:i})}}),this.client=new aC({name:`mcp-client`,version:`1.0.0`},{capabilities:{experimental:{tools:{},resources:{},prompts:{}}}}),await this.client.connect(this.transport)}async listTools(){if(!this.client)throw Error(`Client not connected. Call connect() first.`);try{return(await this.client.listTools()).tools}catch(e){if(e instanceof ty&&e.code===-32601)return[];throw e}}async callTool(e,t){if(!this.client)throw Error(`Client not connected. Call connect() first.`);let{_meta:n,...r}=await this.client.callTool({name:e,arguments:t??{}});return{...r,meta:n}}async listResources(){if(!this.client)throw Error(`Client not connected. Call connect() first.`);return(await this.client.listResources()).resources}async readResource(e){if(!this.client)throw Error(`Client not connected. Call connect() first.`);return await this.client.readResource({uri:e})}async listPrompts(){if(!this.client)throw Error(`Client not connected. Call connect() first.`);return(await this.client.listPrompts()).prompts}async getPrompt(e,t){if(!this.client)throw Error(`Client not connected. Call connect() first.`);return await this.client.getPrompt({name:e,...t&&{arguments:t}})}getServerInfo(){if(!this.client)throw Error(`Client not connected. Call connect() first.`);return this.client.getServerVersion()}async close(){this.client&&=(await this.client.close(),null),this.transport=null}},zD=null,BD=()=>xC.VITE_MCP_SERVER_URL;function VD(e){let t=e._meta?.securitySchemes;return!!t?.length&&t.every(e=>e?.type!==`noauth`)}function HD(e){return e instanceof Ax||e instanceof vv&&e.status===401}async function UD(){let e=BD(),{setStatus:t,setRequiresAuth:n,setHasAuthRequiredTools:r,setIsSignedIn:i,setError:a}=os.getState();t(`connecting`),a(null),await RD.close();let o=!1;try{(await nS(e))?.authorization_servers?.length&&(o=!0)}catch{}n(o);let s=o?new LD:null,c=!!s?.tokens();zD=s;let l=(e,n)=>{i(!1),r(!1),t(n),n===`error`&&a(e instanceof Error?e.message:`Connection failed`)};try{await RD.connect(e,c&&s?s:void 0)}catch(t){if(!HD(t)||!s){l(t,`error`);return}try{await RD.close(),await RD.connect(e,s)}catch(e){l(e,HD(e)?`unauthenticated`:`error`);return}}let u=null;try{u=await RD.listTools()}catch{}i(!!s?.tokens()),r((u??[]).some(VD)),t(`authenticated`),u?PD.setQueryData([`list-tools`],u):PD.invalidateQueries({queryKey:[`list-tools`]})}async function WD(){let e=BD(),t=zD??new LD;zD=t,t.invalidateCredentials(`all`),await Yx(t,{serverUrl:e})}async function GD(e,t,n){let r=BD(),i=new LD,a=i.expectedState();if(!a||n!==a)throw i.invalidateCredentials(`verifier`),Error(`OAuth callback state mismatch: the response does not match the sign-in this browser started. Retry signing in.`);await Yx(i,{serverUrl:r,authorizationCode:e,iss:t}),i.invalidateCredentials(`verifier`),await UD()}async function KD(){zD?.invalidateCredentials(`all`),zD=null,await RD.close(),os.getState().reset(),PD.invalidateQueries({queryKey:[`list-tools`]})}var qD=()=>{let e=fs();return{...e,view:{mode:e.displayMode},toolInput:{},toolOutput:null,toolResponseMetadata:null,widgetState:null}},JD=()=>{let{data:e}=st({queryKey:[`list-tools`],queryFn:()=>RD.listTools()});return e},YD=()=>{if(os(e=>e.status)===`authenticated`)return RD.getServerInfo()},XD=()=>{let{setToolData:e}=bD();return ct({mutationFn:async({toolName:t,args:n})=>{e(t,{input:n??{},response:void 0,durationMs:null,openaiRef:null,openaiLogs:[],openaiObject:null,openInAppUrl:null});let r=performance.now(),i=await RD.callTool(t,n);gC(i,t);let a=Math.round(performance.now()-r),o=Date.now();return e(t,{input:n??{},response:i,durationMs:a,openaiRef:null,openaiLogs:[{id:crypto.randomUUID(),timestamp:o-a,source:`server`,command:`callTool`,args:{name:t,args:n??{}},type:`default`},{id:crypto.randomUUID(),timestamp:o,source:`server`,command:`callTool response`,args:i,type:`response`}],openaiObject:{...qD(),toolInput:n??{},toolOutput:i.structuredContent,toolResponseMetadata:i.meta??null,widgetState:null},openInAppUrl:null}),i}})},ZD=()=>{let[e]=ND();return JD().find(t=>t.name===e)??null},roe=()=>{let e=ZD();if(!e)throw Error(`No tool is currently selected`);return e},ioe=e=>st({queryKey:[`resource`,e],queryFn:async()=>{if(!e)throw Error(`Resource URI is required`);return await RD.readResource(e)}}),QD=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Li(`Primitive.${t}`),r=b.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,H.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function $D(e,t){e&&SC.flushSync(()=>e.dispatchEvent(t))}var aoe=`Separator`,eO=`horizontal`,ooe=[`horizontal`,`vertical`],tO=b.forwardRef((e,t)=>{let{decorative:n,orientation:r=eO,...i}=e,a=soe(r)?r:eO,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,H.jsx)(QD.div,{"data-orientation":a,...o,...i,ref:t})});tO.displayName=aoe;function soe(e){return ooe.includes(e)}var nO=tO;function rO({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,H.jsx)(nO,{"data-slot":`separator`,decorative:n,orientation:t,className:Mr(`shrink-0 bg-border-secondary`,`data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full`,`data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}var coe={idle:{bg:`bg-gray-100`,dot:`bg-gray-400`,text:`text-gray-600`,label:`Disconnected`},connecting:{bg:`bg-yellow-100`,dot:`bg-yellow-500`,text:`text-yellow-800`,label:`Connecting...`},authenticated:{bg:`bg-green-100`,dot:`bg-green-500`,text:`text-green-800`,label:`Connected`},unauthenticated:{bg:`bg-orange-100`,dot:`bg-orange-500`,text:`text-orange-800`,label:`Login required`},error:{bg:`bg-red-100`,dot:`bg-red-500`,text:`text-red-800`,label:`Error`}};function loe({status:e}){let t=coe[e];return(0,H.jsxs)(`span`,{className:`flex items-center gap-1 rounded-full ${t.bg} px-2 py-0.5 text-xs font-semibold ${t.text}`,children:[(0,H.jsx)(`span`,{className:`h-2 w-2 rounded-full ${t.dot} mr-1 inline-block`}),t.label]})}var uoe=Ni([`w-full rounded-md border px-4 py-3`,`grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 items-start`,`[&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:mt-0.5`,`[&>:not(svg)]:col-start-2`].join(` `),{variants:{variant:{default:`bg-muted border-border [&>svg]:text-muted-foreground`,destructive:`bg-destructive/10 border-destructive/30 [&>svg]:text-destructive`,warning:`bg-badge-warning/10 border-badge-warning/30 [&>svg]:text-badge-warning`,success:`bg-badge-success/10 border-badge-success/30 [&>svg]:text-badge-success`}},defaultVariants:{variant:`default`}});function doe({className:e,variant:t,...n}){return(0,H.jsx)(`div`,{role:`alert`,className:Mr(uoe({variant:t}),e),...n})}function foe({className:e,...t}){return(0,H.jsx)(`p`,{className:Mr(`type-text-sm font-semibold leading-snug`,e),...t})}function poe({className:e,...t}){return(0,H.jsx)(`div`,{className:Mr(`type-text-sm text-muted-foreground [&_p]:leading-relaxed`,e),...t})}function iO({title:e,description:t,className:n}){return(0,H.jsxs)(doe,{variant:`warning`,className:n,children:[(0,H.jsx)(Oi,{}),(0,H.jsx)(foe,{children:e}),(0,H.jsx)(poe,{children:t})]})}var moe=Object.defineProperty,aO=(e,t)=>moe(e,`name`,{value:t,configurable:!0}),oO=!!(typeof window<`u`&&window.document&&window.document.createElement);function sO(e,t,{checkForDefaultPrevented:n=!0}={}){return aO(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}aO(sO,`composeEventHandlers`);function hoe(e){if(!oO)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}aO(hoe,`getOwnerWindow`);function cO(e){if(!oO)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}aO(cO,`getOwnerDocument`);function lO(e,t=!1){let{activeElement:n}=cO(e);if(!n?.nodeName)return null;if(uO(n)&&n.contentDocument)return lO(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=cO(n).getElementById(e);if(t)return t}}return n}aO(lO,`getActiveElement`);function uO(e){return e.tagName===`IFRAME`}aO(uO,`isFrame`);function dO(e,t=[]){let n=[];function r(t,r){let i=b.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=b.useMemo(()=>o,Object.values(o));return(0,H.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=b.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>b.createContext(e));return function(n){let r=n?.[e]||t;return b.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,goe(i,...t)]}function goe(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function fO(e){let t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>((...e)=>t.current?.(...e)),[])}var _oe=Object.defineProperty,pO=(e,t)=>_oe(e,`name`,{value:t,configurable:!0}),mO=`dismissableLayer.update`,voe=`dismissableLayer.pointerDownOutside`,yoe=`dismissableLayer.focusOutside`,hO,gO=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),_O=b.forwardRef(pO(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=b.useContext(gO),[d,f]=b.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=b.useState({}),h=Ii(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=y>=v,C=b.useRef(!1),w=yO(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:b.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=bO(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?y===g.length-1:!1,D=fO(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return b.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),b.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(hO=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),xO(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=hO))}},[d,p,n,u]),b.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),xO())},[d,u]),b.useEffect(()=>{let e=pO(()=>m({}),`handleUpdate`);return document.addEventListener(mO,e),()=>document.removeEventListener(mO,e)},[]),(0,H.jsx)(QD.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:sO(e.onFocusCapture,T.onFocusCapture),onBlurCapture:sO(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:sO(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function vO(){let e=b.useContext(gO),[t,n]=b.useState(null);return b.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}pO(vO,`useDismissableLayerSurface`);var boe=pO(()=>!0,`IS_TRUE`);function yO(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=boe}=t,s=fO(e),c=b.useRef(!1),l=b.useRef(!1),u=b.useRef(new Map),d=b.useRef(()=>{});return b.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}pO(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}pO(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}pO(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}pO(p,`handleInteractionBubble`);let m=pO(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||SO(voe,s,p,{discrete:!0})};if(pO(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:pO(()=>c.current=!0,`onPointerDownCapture`)}}pO(yO,`usePointerDownOutside`);function bO(e,t=globalThis?.document){let n=fO(e),r=b.useRef(!1);return b.useEffect(()=>{let e=pO(e=>{e.target&&!r.current&&SO(yoe,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:pO(()=>r.current=!0,`onFocusCapture`),onBlurCapture:pO(()=>r.current=!1,`onBlurCapture`)}}pO(bO,`useFocusOutside`);function xO(){let e=new CustomEvent(mO);document.dispatchEvent(e)}pO(xO,`dispatchUpdate`);function SO(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?$D(i,a):i.dispatchEvent(a)}pO(SO,`handleAndDispatchCustomEvent`);var CO=0,wO=null;function TO(){b.useEffect(()=>{wO||={start:EO(),end:EO()};let{start:e,end:t}=wO;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),CO++,()=>{CO===1&&(wO?.start.remove(),wO?.end.remove(),wO=null),CO=Math.max(0,CO-1)}},[])}function EO(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var xoe=Object.defineProperty,DO=(e,t)=>xoe(e,`name`,{value:t,configurable:!0}),OO=`focusScope.autoFocusOnMount`,kO=`focusScope.autoFocusOnUnmount`,AO={bubbles:!1,cancelable:!0},jO=b.forwardRef(DO(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=b.useState(null),l=fO(i),u=fO(a),d=b.useRef(null),f=Ii(t,c),p=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:RO(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||RO(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&RO(s)};DO(e,`handleFocusIn`),DO(t,`handleFocusOut`),DO(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),b.useEffect(()=>{if(s){zO.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(OO,AO);s.addEventListener(OO,l),s.dispatchEvent(t),t.defaultPrevented||(MO(HO(PO(s)),{select:!0}),document.activeElement===e&&RO(s))}return()=>{s.removeEventListener(OO,l),setTimeout(()=>{let t=new CustomEvent(kO,AO);s.addEventListener(kO,u),s.dispatchEvent(t),t.defaultPrevented||RO(e??document.body,{select:!0}),s.removeEventListener(kO,u),zO.remove(p)},0)}}},[s,l,u,p]);let m=b.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=NO(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&RO(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&RO(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,H.jsx)(QD.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function MO(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(RO(r,{select:t}),document.activeElement!==n)return}DO(MO,`focusFirst`);function NO(e){let t=PO(e);return[FO(t,e),FO(t.reverse(),e)]}DO(NO,`getTabbableEdges`);function PO(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:DO(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}DO(PO,`getTabbableCandidates`);function FO(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):IO(r,{upTo:t})))return r}DO(FO,`findVisible`);function IO(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}DO(IO,`isHidden`);function LO(e){return e instanceof HTMLInputElement&&`select`in e}DO(LO,`isSelectableInput`);function RO(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&LO(e)&&t&&e.select()}}DO(RO,`focus`);var zO=BO();function BO(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=VO(e,t),e.unshift(t)},remove(t){e=VO(e,t),e[0]?.resume()}}}DO(BO,`createFocusScopesStack`);function VO(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}DO(VO,`arrayRemove`);function HO(e){return e.filter(e=>e.tagName!==`A`)}DO(HO,`removeLinks`);var UO=globalThis?.document?b.useLayoutEffect:()=>{},WO=b.useId||(()=>void 0),GO=0;function KO(e){let[t,n]=b.useState(WO());return UO(()=>{e||n(e=>e??String(GO++))},[e]),e||(t?`radix-${t}`:``)}var qO=[`top`,`right`,`bottom`,`left`],JO=Math.min,YO=Math.max,XO=Math.round,ZO=Math.floor,QO=e=>({x:e,y:e}),$O={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ek(e,t,n){return YO(e,JO(t,n))}function tk(e,t){return typeof e==`function`?e(t):e}function nk(e){return e.split(`-`)[0]}function rk(e){return e.split(`-`)[1]}function ik(e){return e===`x`?`y`:`x`}function ak(e){return e===`y`?`height`:`width`}function ok(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function sk(e){return ik(ok(e))}function ck(e,t,n){n===void 0&&(n=!1);let r=rk(e),i=sk(e),a=ak(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=_k(o)),[o,_k(o)]}function lk(e){let t=_k(e);return[uk(e),t,uk(t)]}function uk(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var dk=[`left`,`right`],fk=[`right`,`left`],pk=[`top`,`bottom`],mk=[`bottom`,`top`];function hk(e,t,n){switch(e){case`top`:case`bottom`:return n?t?fk:dk:t?dk:fk;case`left`:case`right`:return t?pk:mk;default:return[]}}function gk(e,t,n,r){let i=rk(e),a=hk(nk(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(uk)))),a}function _k(e){let t=nk(e);return $O[t]+e.slice(t.length)}function vk(e){return{top:0,right:0,bottom:0,left:0,...e}}function yk(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:vk(e)}function bk(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function xk(e,t,n){let{reference:r,floating:i}=e,a=ok(t),o=sk(t),s=ak(o),c=nk(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(rk(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Sk(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=tk(t,e),p=yk(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=bk(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=bk(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ck=50,wk=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Sk},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=xk(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ck&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=xk(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Tk=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=tk(e,t)||{};if(l==null)return{};let d=yk(u),f={x:n,y:r},p=sk(i),m=ak(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=JO(d[_],T),D=JO(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=ek(O,A,k),M=!c.arrow&&rk(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),Ek=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=tk(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=nk(r),_=ok(o),v=nk(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[_k(o)]:lk(o)),x=p!==`none`;!d&&x&&b.push(...gk(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ck(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==ok(t))||T.every(e=>ok(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=ok(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Dk(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ok(e){return qO.some(t=>e[t]>=0)}var kk=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=tk(e,t);switch(i){case`referenceHidden`:{let e=Dk(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ok(e)}}}case`escaped`:{let e=Dk(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ok(e)}}}default:return{}}}}},Ak=new Set([`left`,`top`]);async function jk(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=nk(n),s=rk(n),c=ok(n)===`y`,l=Ak.has(o)?-1:1,u=a&&c?-1:1,d=tk(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Mk=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await jk(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Nk=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=tk(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=ok(nk(i)),p=ik(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=ek(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=ek(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Pk=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=tk(e,t),u={x:n,y:r},d=ok(i),f=ik(d),p=u[f],m=u[d],h=tk(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ak.has(nk(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Fk=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=tk(e,t),u=await o.detectOverflow(t,l),d=nk(i),f=rk(i),p=ok(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=JO(h-u[g],v),x=JO(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=YO(u.left,0),t=YO(u.right,0),n=YO(u.top,0),r=YO(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:YO(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:YO(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Ik(){return typeof window<`u`}function Lk(e){return Bk(e)?(e.nodeName||``).toLowerCase():`#document`}function Rk(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zk(e){return((Bk(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Bk(e){return Ik()?e instanceof Node||e instanceof Rk(e).Node:!1}function Vk(e){return Ik()?e instanceof Element||e instanceof Rk(e).Element:!1}function Hk(e){return Ik()?e instanceof HTMLElement||e instanceof Rk(e).HTMLElement:!1}function Uk(e){return!Ik()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Rk(e).ShadowRoot}function Wk(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=tA(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Gk(e){return/^(table|td|th)$/.test(Lk(e))}function Kk(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var qk=/transform|translate|scale|rotate|perspective|filter/,Jk=/paint|layout|strict|content/,Yk=e=>!!e&&e!==`none`,Xk;function Zk(e){let t=Vk(e)?tA(e):e;return Yk(t.transform)||Yk(t.translate)||Yk(t.scale)||Yk(t.rotate)||Yk(t.perspective)||!$k()&&(Yk(t.backdropFilter)||Yk(t.filter))||qk.test(t.willChange||``)||Jk.test(t.contain||``)}function Qk(e){let t=rA(e);for(;Hk(t)&&!eA(t);){if(Zk(t))return t;if(Kk(t))return null;t=rA(t)}return null}function $k(){return Xk??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Xk}function eA(e){return/^(html|body|#document)$/.test(Lk(e))}function tA(e){return Rk(e).getComputedStyle(e)}function nA(e){return Vk(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rA(e){if(Lk(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Uk(e)&&e.host||zk(e);return Uk(t)?t.host:t}function iA(e){let t=rA(e);return eA(t)?e.ownerDocument?e.ownerDocument.body:e.body:Hk(t)&&Wk(t)?t:iA(t)}function aA(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=iA(e),i=r===e.ownerDocument?.body,a=Rk(r);if(i){let e=oA(a);return t.concat(a,a.visualViewport||[],Wk(r)?r:[],e&&n?aA(e):[])}else return t.concat(r,aA(r,[],n))}function oA(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sA(e){let t=tA(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Hk(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=XO(n)!==a||XO(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function cA(e){return Vk(e)?e:e.contextElement}function lA(e){let t=cA(e);if(!Hk(t))return QO(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=sA(t),o=(a?XO(n.width):n.width)/r,s=(a?XO(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Soe=QO(0);function uA(e){let t=Rk(e);return!$k()||!t.visualViewport?Soe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Coe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Rk(e)?!1:t}function dA(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=cA(e),o=QO(1);t&&(r?Vk(r)&&(o=lA(r)):o=lA(e));let s=Coe(a,n,r)?uA(a):QO(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Rk(a),t=r&&Vk(r)?Rk(r):r,n=e,i=oA(n);for(;i&&r&&t!==n;){let e=lA(i),t=i.getBoundingClientRect(),r=tA(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Rk(i),i=oA(n)}}return bk({width:u,height:d,x:c,y:l})}function fA(e,t){let n=nA(e).scrollLeft;return t?t.left+n:dA(zk(e)).left+n}function pA(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-fA(e,n),y:n.top+t.scrollTop}}function woe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=zk(r),s=t?Kk(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=QO(1),u=QO(0),d=Hk(r);if((d||!d&&!a)&&((Lk(r)!==`body`||Wk(o))&&(c=nA(r)),d)){let e=dA(r);l=lA(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?pA(o,c):QO(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Toe(e){return Array.from(e.getClientRects())}function Eoe(e){let t=zk(e),n=nA(e),r=e.ownerDocument.body,i=YO(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=YO(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+fA(e),s=-n.scrollTop;return tA(r).direction===`rtl`&&(o+=YO(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var mA=25;function Doe(e,t){let n=Rk(e),r=zk(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=$k();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=fA(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=mA&&(a-=o)}else l<=mA&&(a+=l);return{width:a,height:o,x:s,y:c}}function Ooe(e,t){let n=dA(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Hk(e)?lA(e):QO(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function hA(e,t,n){let r;if(t===`viewport`)r=Doe(e,n);else if(t===`document`)r=Eoe(zk(e));else if(Vk(t))r=Ooe(t,n);else{let n=uA(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return bk(r)}function gA(e,t){let n=rA(e);return n===t||!Vk(n)||eA(n)?!1:tA(n).position===`fixed`||gA(n,t)}function koe(e,t){let n=t.get(e);if(n)return n;let r=aA(e,[],!1).filter(e=>Vk(e)&&Lk(e)!==`body`),i=null,a=tA(e).position===`fixed`,o=a?rA(e):e;for(;Vk(o)&&!eA(o);){let t=tA(o),n=Zk(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Wk(o)&&!n&&gA(e,o))?r=r.filter(e=>e!==o):i=t,o=rA(o)}return t.set(e,r),r}function Aoe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Kk(t)?[]:koe(t,this._c):[].concat(n),r],o=hA(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=hA(t,a[e],i);s=YO(n.top,s),c=JO(n.right,c),l=JO(n.bottom,l),u=YO(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function joe(e){let{width:t,height:n}=sA(e);return{width:t,height:n}}function Moe(e,t,n){let r=Hk(t),i=zk(t),a=n===`fixed`,o=dA(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=QO(0);function l(){c.x=fA(i)}if(r||!r&&!a)if((Lk(t)!==`body`||Wk(i))&&(s=nA(t)),r){let e=dA(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?pA(i,s):QO(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function _A(e){return tA(e).position===`static`}function vA(e,t){if(!Hk(e)||tA(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return zk(e)===n&&(n=n.ownerDocument.body),n}function yA(e,t){let n=Rk(e);if(Kk(e))return n;if(!Hk(e)){let t=rA(e);for(;t&&!eA(t);){if(Vk(t)&&!_A(t))return t;t=rA(t)}return n}let r=vA(e,t);for(;r&&Gk(r)&&_A(r);)r=vA(r,t);return r&&eA(r)&&_A(r)&&!Zk(r)?n:r||Qk(e)||n}var Noe=async function(e){let t=this.getOffsetParent||yA,n=this.getDimensions,r=await n(e.floating);return{reference:Moe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Poe(e){return tA(e).direction===`rtl`}var Foe={convertOffsetParentRelativeRectToViewportRelativeRect:woe,getDocumentElement:zk,getClippingRect:Aoe,getOffsetParent:yA,getElementRects:Noe,getClientRects:Toe,getDimensions:joe,getScale:lA,isElement:Vk,isRTL:Poe};function bA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ioe(e,t){let n=null,r,i=zk(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=ZO(d),h=ZO(i.clientWidth-(u+f)),g=ZO(i.clientHeight-(d+p)),_=ZO(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:YO(0,JO(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!bA(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function xA(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=cA(e),u=i||a?[...l?aA(l):[],...t?aA(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ioe(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?dA(e):null;c&&g();function g(){let t=dA(e);h&&!bA(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Loe=Mk,Roe=Nk,zoe=Ek,Boe=Fk,Voe=kk,SA=Tk,Hoe=Pk,Uoe=(e,t,n)=>{let r=new Map,i={platform:Foe,...n},a={...i.platform,_c:r};return wk(e,t,{...i,platform:a})},CA=typeof document<`u`?b.useLayoutEffect:function(){};function wA(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!wA(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!wA(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function TA(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function EA(e,t){let n=TA(e);return Math.round(t*n)/n}function DA(e){let t=b.useRef(e);return CA(()=>{t.current=e}),t}function OA(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=b.useState(r);wA(f,r)||p(r);let[m,h]=b.useState(null),[g,_]=b.useState(null),v=b.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),y=b.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=b.useRef(null),w=b.useRef(null),T=b.useRef(u),E=c!=null,D=DA(c),O=DA(i),k=DA(l),A=b.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Uoe(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!wA(T.current,t)&&(T.current=t,SC.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);CA(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=b.useRef(!1);CA(()=>(j.current=!0,()=>{j.current=!1}),[]),CA(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=b.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:y}),[v,y]),N=b.useMemo(()=>({reference:x,floating:S}),[x,S]),P=b.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=EA(N.floating,u.x),r=EA(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...TA(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return b.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Woe=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:SA({element:r.current,padding:i}).fn(n):r?SA({element:r,padding:i}).fn(n):{}}}},kA=(e,t)=>{let n=Loe(e);return{name:n.name,fn:n.fn,options:[e,t]}},AA=(e,t)=>{let n=Roe(e);return{name:n.name,fn:n.fn,options:[e,t]}},jA=(e,t)=>({fn:Hoe(e).fn,options:[e,t]}),MA=(e,t)=>{let n=zoe(e);return{name:n.name,fn:n.fn,options:[e,t]}},NA=(e,t)=>{let n=Boe(e);return{name:n.name,fn:n.fn,options:[e,t]}},PA=(e,t)=>{let n=Voe(e);return{name:n.name,fn:n.fn,options:[e,t]}},FA=(e,t)=>{let n=Woe(e);return{name:n.name,fn:n.fn,options:[e,t]}};function IA(e){let[t,n]=b.useState(void 0);return UO(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var Goe=Object.defineProperty,LA=(e,t)=>Goe(e,`name`,{value:t,configurable:!0}),RA=`Popper`,[zA,BA]=dO(RA),[Koe,VA]=zA(RA),qoe=LA(e=>{let{__scopePopper:t,children:n}=e,[r,i]=b.useState(null),[a,o]=b.useState(void 0);return(0,H.jsx)(Koe,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Joe=`PopperAnchor`,Yoe=b.forwardRef(LA(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=VA(Joe,n),o=b.useRef(null),s=a.onAnchorChange,c=Ii(t,b.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=b.useRef(null);b.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&WA(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,H.jsx)(QD.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),HA=`PopperContent`,[Xoe,Zoe]=zA(HA),Qoe=b.forwardRef(LA(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=VA(HA,n),[_,v]=b.useState(null),y=Ii(t,v),[x,S]=b.useState(null),C=IA(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(UA),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=OA({strategy:`fixed`,placement:E,whileElementsMounted:LA((...e)=>xA(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[kA({mainAxis:i+T,alignmentAxis:o}),c&&AA({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?jA():void 0,...A}),c&&MA({...A}),NA({...A,apply:LA(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&FA({element:x,padding:s}),$oe({arrowWidth:w,arrowHeight:T}),f&&PA({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),I=g.setPlacementState;UO(()=>(I(N),()=>{I(void 0)}),[N,I]);let[L,ee]=WA(N),te=fO(m);UO(()=>{P&&te?.()},[P,te]);let ne=F.arrow?.x,R=F.arrow?.y,z=F.arrow?.centerOffset!==0,[B,re]=b.useState();return UO(()=>{_&&re(window.getComputedStyle(_).zIndex)},[_]),(0,H.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:B,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,H.jsx)(Xoe,{scope:n,placedSide:L,placedAlign:ee,onArrowChange:S,arrowX:ne,arrowY:R,shouldHideArrow:z,children:(0,H.jsx)(QD.div,{"data-side":L,"data-align":ee,...h,ref:y,style:{...h.style,animation:P?h.style?.animation:`none`}})})})},`PopperContent`));function UA(e){return e!==null}LA(UA,`isNotNull`);var $oe=LA(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=WA(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function WA(e){let[t,n=`center`]=e.split(`-`);return[t,n]}LA(WA,`getSideAndAlignFromPlacement`);var GA=qoe,KA=Yoe,qA=Qoe,ese=Object.defineProperty,JA=b.forwardRef(((e,t)=>ese(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=b.useState(!1);UO(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?SC.createPortal((0,H.jsx)(QD.div,{...r,ref:t}),o):null},`Portal`)),tse=Object.defineProperty,YA=(e,t)=>tse(e,`name`,{value:t,configurable:!0});function XA(e,t){return b.useReducer((e,n)=>t[e][n]??e,e)}YA(XA,`useStateMachine`);var ZA=YA(e=>{let{present:t,children:n}=e,r=QA(t),i=typeof n==`function`?n({present:r.isPresent}):b.Children.only(n),a=ej(r.ref,nj(i));return typeof n==`function`||r.isPresent?b.cloneElement(i,{ref:a}):null},`Presence`);function QA(e){let[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),a=b.useRef(`none`),o=b.useRef(void 0),[s,c]=XA(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return b.useEffect(()=>{s===`mounted`?(a.current=o.current??tj(r.current),o.current=void 0):a.current=`none`},[s]),UO(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=tj(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),UO(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=YA(a=>{let o=tj(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=YA(e=>{e.target===t&&(a.current=tj(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:b.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=tj(t)}else r.current=null;n(e)},[])}}YA(QA,`usePresence`);function $A(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}YA($A,`setRef`);function ej(...e){let t=b.useRef(e);return t.current=e,b.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=$A(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():$A(n[e],null)}}},[])}YA(ej,`useStableComposedRefs`);function tj(e){return e?.animationName||`none`}YA(tj,`getAnimationName`);function nj(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}YA(nj,`getElementRef`);var rj=b.useEffectEvent,ij=b.useInsertionEffect;function nse(e){if(typeof rj==`function`)return rj(e);let t=b.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof ij==`function`?ij(()=>{t.current=e}):UO(()=>{t.current=e}),b.useMemo(()=>((...e)=>t.current?.(...e)),[])}var rse=Object.defineProperty,aj=(e,t)=>rse(e,`name`,{value:t,configurable:!0}),ise=b.useInsertionEffect||UO;function oj({prop:e,defaultProp:t,onChange:n=aj(()=>{},`onChange`),caller:r}){let[i,a,o]=sj({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,b.useCallback(t=>{if(s){let n=cj(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}aj(oj,`useControllableState`);function sj({defaultProp:e,onChange:t}){let[n,r]=b.useState(e),i=b.useRef(n),a=b.useRef(t);return ise(()=>{a.current=t},[t]),b.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}aj(sj,`useUncontrolledState`);function cj(e){return typeof e==`function`}aj(cj,`isFunction`);var lj=Symbol(`RADIX:SYNC_STATE`);function ase(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=nse(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=b.useReducer((t,n)=>{if(n.type===lj)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=b.useRef(p);b.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=b.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return b.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:lj,state:i})},[i,d.state,c]),[h,f]}aj(ase,`useControllableStateReducer`);var ose=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},uj=new WeakMap,dj=new WeakMap,fj={},pj=0,mj=function(e){return e&&(e.host||mj(e.parentNode))},sse=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=mj(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},cse=function(e,t,n,r){var i=sse(t,Array.isArray(e)?e:[e]);fj[n]||(fj[n]=new WeakMap);var a=fj[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(uj.get(e)||0)+1,l=(a.get(e)||0)+1;uj.set(e,c),a.set(e,l),o.push(e),c===1&&i&&dj.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),pj++,function(){o.forEach(function(e){var t=uj.get(e)-1,i=a.get(e)-1;uj.set(e,t),a.set(e,i),t||(dj.has(e)||e.removeAttribute(r),dj.delete(e)),i||e.removeAttribute(n)}),pj--,pj||(uj=new WeakMap,uj=new WeakMap,dj=new WeakMap,fj={})}},hj=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ose(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),cse(r,i,n,`aria-hidden`)):function(){return null}},gj=function(){return gj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},gj.apply(this,arguments)};function _j(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function vj(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function yj(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function bj(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var xj=`right-scroll-bar-position`,Sj=`width-before-scroll-bar`,Cj=`with-scroll-bars-hidden`,wj=`--removed-body-scroll-bar-size`;function Tj(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ej(e,t){var n=(0,b.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Dj=typeof window<`u`?b.useLayoutEffect:b.useEffect,Oj=new WeakMap;function kj(e,t){var n=Ej(t||null,function(t){return e.forEach(function(e){return Tj(e,t)})});return Dj(function(){var t=Oj.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Tj(e,null)}),i.forEach(function(e){r.has(e)||Tj(e,a)})}Oj.set(n,e)},[e]),n}function Aj(e){return e}function jj(e,t){t===void 0&&(t=Aj);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Mj(e){e===void 0&&(e={});var t=jj(null);return t.options=gj({async:!0,ssr:!1},e),t}var Nj=function(e){var t=e.sideCar,n=_j(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return b.createElement(r,gj({},n))};Nj.isSideCarExport=!0;function Pj(e,t){return e.useMedium(t),Nj}var Fj=Mj(),Ij=function(){},Lj=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:Ij,onWheelCapture:Ij,onTouchMoveCapture:Ij}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,x=_j(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=kj([n,t]),w=gj(gj({},x),i);return b.createElement(b.Fragment,null,u&&b.createElement(S,{sideCar:Fj,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?b.cloneElement(b.Children.only(s),gj(gj({},w),{ref:C})):b.createElement(v,gj({},w,{className:c,ref:C}),s))});Lj.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Lj.classNames={fullWidth:Sj,zeroRight:xj};var Rj,zj=function(){if(Rj)return Rj;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Bj(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=zj();return t&&e.setAttribute(`nonce`,t),e}function Vj(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Hj(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Uj=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Bj())&&(Vj(t,n),Hj(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Wj=function(){var e=Uj();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Gj=function(){var e=Wj();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Kj={left:0,top:0,right:0,gap:0},qj=function(e){return parseInt(e||``,10)||0},Jj=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[qj(n),qj(r),qj(i)]},Yj=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Kj;var t=Jj(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Xj=Gj(),Zj=`data-scroll-locked`,Qj=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
79
79
  .${Cj} {
80
80
  overflow: hidden ${r};
81
81
  padding-right: ${s}px ${r};
@@ -199,7 +199,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
199
199
  font-style: italic;
200
200
  font-display: swap;
201
201
  }
202
- `;function jue(e){return{styles:{variables:sz,css:{fonts:cz}},containerDimensions:{width:e?mN.width-Aue:720,maxHeight:5e3},availableDisplayModes:[`inline`,`fullscreen`],userAgent:navigator.userAgent,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone}}function Mue(e,t){e.contentWindow?.postMessage(t,`*`)}function lz(e,t,n){e({jsonrpc:`2.0`,id:t,result:n})}function uz(e,t,n,r){e({jsonrpc:`2.0`,id:t,error:{code:n,message:r}})}function dz(e,t,n){switch(e){case`chatgpt`:return kue(t,n);case`claude`:return jue(n);case null:return{}}}function Nue(){let e=ds.getState(),t=ps(e.userAgent);return{...dz(e.previewClient,e.theme,t),theme:e.theme,locale:e.locale,displayMode:e.displayMode,safeAreaInsets:e.safeArea?.insets??{top:0,right:0,bottom:0,left:0},platform:t?`mobile`:`web`,deviceCapabilities:e.userAgent?.capabilities}}function Pue(e,t,n,r){let i=t=>Mue(e,t),a=async a=>{if(a.source!==e.contentWindow)return;let o=a.data;if(o?.jsonrpc!==`2.0`)return;let{id:s,method:c,params:l}=o;if(c!==`ui/notifications/size-changed`&&c!==`ui/notifications/request-teardown`&&s!==void 0)switch(c){case`ui/initialize`:{lz(i,s,{protocolVersion:`2025-06-18`,hostInfo:{name:`skybridge-devtools`,version:`0.0.1`},hostCapabilities:{openLinks:{},serverTools:{}},hostContext:Nue()});let e=r();e.toolInput!=null&&i({jsonrpc:`2.0`,method:`ui/notifications/tool-input`,params:{arguments:e.toolInput}}),(e.toolOutput!=null||e.toolResponseMetadata!=null)&&i({jsonrpc:`2.0`,method:`ui/notifications/tool-result`,params:{content:[],structuredContent:e.toolOutput??{},isError:!1,_meta:e.toolResponseMetadata??{}}});break}case`ui/update-model-context`:n(`mcp:updateModelContext`,l??{}),lz(i,s,{});break;case`ui/request-display-mode`:{let e=l?.mode??`inline`,t=ds.getState(),n=hs(e,t);t.setPreference(`displayMode`,n),lz(i,s,{mode:n});break}case`ui/open-link`:{let e=l?.url;e&&window.open(e,`_blank`,`noopener,noreferrer`),lz(i,s,{});break}case`ui/download-file`:uz(i,s,-32603,`downloadFile capability disabled in devtools`);break;case`tools/call`:{let e=l?.name??``,r=l?.arguments??{};n(`mcp:tools/call`,{name:e,args:r});try{let a=await t(e,r);n(`mcp:tools/call response`,a,`response`),lz(i,s,a)}catch(e){let t=e instanceof Error?e.message:String(e);uz(i,s,-32603,t)}break}default:s!==void 0&&uz(i,s,-32601,`Method not found: ${c}`)}};window.addEventListener(`message`,a);let o=ds.subscribe((e,t)=>{let n={};e.theme!==t.theme&&(n.theme=e.theme,e.previewClient===`chatgpt`&&(n.styles={variables:oz(e.theme)})),(e.previewClient!==t.previewClient||e.previewClient!==null&&e.userAgent!==t.userAgent)&&Object.assign(n,dz(e.previewClient,e.theme,ps(e.userAgent))),e.locale!==t.locale&&(n.locale=e.locale),e.displayMode!==t.displayMode&&(n.displayMode=e.displayMode),e.safeArea!==t.safeArea&&(n.safeAreaInsets=e.safeArea?.insets),e.userAgent!==t.userAgent&&(n.platform=e.userAgent?.device?.type===`mobile`?`mobile`:`web`,n.deviceCapabilities=e.userAgent?.capabilities),Object.keys(n).length>0&&i({jsonrpc:`2.0`,method:`ui/notifications/host-context-changed`,params:n})});return()=>{window.removeEventListener(`message`,a),o()}}function Fue(e,t){e.contentWindow?.postMessage({jsonrpc:`2.0`,method:`ui/notifications/tool-input`,params:{arguments:t}},`*`)}function Iue(e,t){e.contentWindow?.postMessage({jsonrpc:`2.0`,method:`ui/notifications/tool-result`,params:{content:t.content??[],structuredContent:t.structuredContent??{},isError:t.isError??!1,_meta:t._meta??{}}},`*`)}var fz=`openai:set_globals`,Lue=class extends CustomEvent{type=fz};function Rue(e,t,n,r,i){return{callTool:async(e,n)=>{t(`callTool`,{name:e,args:n});let i=await r(e,n??{});return t(`← callTool response`,i,`response`),i},sendFollowUpMessage:async e=>{t(`sendFollowUpMessage`,e)},requestClose:async()=>{t(`requestClose`,{})},openExternal:e=>{window.open(e.href,`_blank`,`noopener,noreferrer`),t(`openExternal`,e)},requestDisplayMode:async r=>{t(`requestDisplayMode`,r);let i=ds.getState(),a=hs(r.mode,i);return e.displayMode=a,n(`displayMode`,a),i.setPreference(`displayMode`,a),{mode:a}},setWidgetState:async r=>{_C(r.modelContent,`setWidgetState`),t(`setWidgetState`,r),e.widgetState=r,n(`widgetState`,r)},requestModal:async r=>{t(`requestModal`,r),e.displayMode=`modal`,e.view={mode:`modal`,params:r.params},n(`displayMode`,`modal`)},uploadFile:async e=>(t(`uploadFile`,{name:e.name,size:e.size}),{fileId:`123`}),getFileDownloadUrl:async e=>(t(`getFileDownloadUrl`,e),{downloadUrl:`https://example.com/file.pdf`}),setOpenInAppUrl:async e=>{t(`setOpenInAppUrl`,e),i(e.href)}}}function zue(e,t){let n=[`theme`,`userAgent`,`locale`,`maxHeight`,`displayMode`,`safeArea`,`toolInput`,`toolOutput`,`toolResponseMetadata`,`view`,`widgetState`];return new Proxy(e||{},{set(e,r,i,a){let o=Reflect.set(e,r,i,a);if(n.includes(r)){let e=new Lue(fz,{detail:{globals:{[r]:i}}});t.dispatchEvent(e)}return o}})}function Bue(e,t,n,r,i,a){let o=zue(iE(t),e);Vne(o,Rue(o,n,r,i,a)),e.openai=o}var pz=`__host-fonts`,Vue=({iframeRef:e,theme:t,previewClient:n,documentKey:r})=>{(0,b.useEffect)(()=>{let i=e.current,a=i?.contentDocument,o=a?.documentElement;if(!i||!a||!o||!r||n===null)return;i.style.colorScheme=t,o.style.colorScheme=t;let s=n===`chatgpt`?oz(t):sz,c=Object.entries(s);for(let[e,t]of c)o.style.setProperty(e,t);if(n===`claude`&&!a.getElementById(pz)){let e=a.createElement(`style`);e.id=pz,e.textContent=cz,a.head?.appendChild(e)}return()=>{i.style.removeProperty(`color-scheme`),o.style.removeProperty(`color-scheme`);for(let[e]of c)o.style.removeProperty(e)}},[e,t,n,r])},mz=({iframeRef:e,toolName:t,globalKey:n,value:r,updateOpenaiObject:i})=>{(0,b.useEffect)(()=>{let a=e.current?.contentWindow?.openai;!a||a[n]===r||(a[n]=r,i(t,n,r))},[e,n,r,t,i])},Hue=345,Uue=770,hz=420,gz=()=>{let e=roe(),{openaiObject:t}=xD(e.name)??{},{data:n}=ioe(e._meta?.ui?.resourceUri),{setToolData:r,pushOpenAiLog:i,updateOpenaiObject:a,setOpenInAppUrl:o}=bD(),s=(0,b.useRef)(null),c=(0,b.useRef)(null),l=(0,b.useRef)(t);l.current=t;let[u,d]=(0,b.useState)(null),f=ds(e=>e.previewClient),p=f!==null,m=ms()&&!p,h=(0,b.useRef)(m);(0,b.useEffect)(()=>{h.current!==m&&(h.current=m,d(null))},[m]);let g=ds(e=>e.displayMode),_=g===`fullscreen`,v=g===`pip`,y=_&&!m,x=y||p?`100%`:`${m?Hue:Uue}px`,S=ds(e=>e.theme),C=ds(e=>e.locale),w=ds(e=>e.userAgent),T=n.contents[0],E=T.text,D=dN(T._meta?.ui?.domain??T._meta?.[`openai/widgetDomain`]);(0,b.useEffect)(()=>{let t=s.current;if(!t?.contentWindow||!t.contentDocument)return;D&&o(e.name,D);let n=(t,n,r=`default`)=>{i(e.name,{timestamp:Date.now(),source:`view`,command:t,args:n,type:r})};Bue(t.contentWindow,l.current,n,(t,n)=>{a(e.name,t,n)},(e,t)=>RD.callTool(e,t),t=>{o(e.name,t)});let c=Pue(t,(e,t)=>RD.callTool(e,t),n,()=>({toolInput:l.current?.toolInput,toolOutput:l.current?.toolOutput,toolResponseMetadata:l.current?.toolResponseMetadata}));return t.contentDocument.open(),t.contentDocument.write(uN(E)),t.contentDocument.close(),r(e.name,{openaiRef:s}),c},[E,D,e.name,i,r,a,o]),wue({iframeRef:s,containerRef:c,enabled:!!E&&!y,onHeightChange:d,documentKey:E,clampToContainer:!p});let O=Tue({iframeRef:s,documentKey:E});return mz({iframeRef:s,toolName:e.name,globalKey:`theme`,value:S,updateOpenaiObject:a}),mz({iframeRef:s,toolName:e.name,globalKey:`locale`,value:C,updateOpenaiObject:a}),mz({iframeRef:s,toolName:e.name,globalKey:`displayMode`,value:g,updateOpenaiObject:a}),mz({iframeRef:s,toolName:e.name,globalKey:`userAgent`,value:w,updateOpenaiObject:a}),Vue({iframeRef:s,theme:S,previewClient:f,documentKey:E}),(0,b.useEffect)(()=>{let e=s.current;!e||!t||(t.toolInput!=null&&Fue(e,t.toolInput),(t.toolOutput!=null||t.toolResponseMetadata!=null)&&Iue(e,{content:[],structuredContent:t.toolOutput,isError:!1,_meta:t.toolResponseMetadata}))},[t]),(0,H.jsx)(`div`,{ref:c,className:lN(`relative transition-[width] duration-150 ease-out`,y?`h-full w-full`:`mx-auto`,y&&!p&&`bg-background`),style:{width:y?void 0:x,height:y?`100%`:u==null?`auto`:`${v&&!p?Math.min(u,hz):u}px`,opacity:+!!O},children:(0,H.jsx)(`iframe`,{ref:s,src:`about:blank`,style:{width:`100%`,height:y||u==null?`100%`:`${v&&!p?Math.min(u,hz):u}px`,border:`none`,display:`block`},sandbox:`allow-scripts allow-same-origin allow-forms`,title:`html-preview`})})};function _z(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsxs)(`g`,{children:[(0,H.jsx)(`path`,{d:`M8.167 2.501a.665.665 0 0 1 0 1.33H5.834a2 2 0 0 0-2.002 2.002v8.333c0 1.106.896 2.002 2.002 2.002h8.333a2 2 0 0 0 2.002-2.002v-2.333a.665.665 0 0 1 1.33 0v2.333a3.33 3.33 0 0 1-3.332 3.332H5.834a3.33 3.33 0 0 1-3.332-3.332V5.833a3.333 3.333 0 0 1 3.332-3.332z`}),(0,H.jsx)(`path`,{fillRule:`evenodd`,d:`M13.427 3.104a2.451 2.451 0 0 1 3.46 3.472l-5.163 5.203a3.13 3.13 0 0 1-1.55.853l-2.386.524a.815.815 0 0 1-.97-.971l.525-2.38c.13-.59.429-1.131.86-1.556zm2.512.953a1.12 1.12 0 0 0-1.579-.006L9.136 9.197c-.247.244-.42.554-.495.894l-.351 1.594 1.598-.352c.338-.074.648-.245.892-.49l5.162-5.204a1.12 1.12 0 0 0-.003-1.582`,clipRule:`evenodd`})]})})}function Wue(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,...e,children:(0,H.jsx)(`path`,{d:`M6.95 2.668a3 3 0 0 1 1.763.574l1.064.774c.286.207.63.32.982.32h4.408a3 3 0 0 1 2.998 2.997v7a3 3 0 0 1-2.998 2.998H4.833a3 3 0 0 1-2.998-2.997V5.667a3 3 0 0 1 2.998-2.999zM3.164 9.831v4.503c0 .92.747 1.667 1.668 1.668h10.334c.921 0 1.668-.747 1.668-1.668V9.83zm1.668-5.832c-.921 0-1.668.746-1.668 1.668V8.5h13.67V7.334c0-.922-.747-1.668-1.668-1.668h-4.408a3 3 0 0 1-1.764-.575l-1.064-.773a1.67 1.67 0 0 0-.982-.32z`})})}function Gue(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsx)(`path`,{d:`M6.001 14.167a1.002 1.002 0 1 0-2.003-.001 1.002 1.002 0 0 0 2.003 0m10.665-.665.135.013a.665.665 0 0 1 0 1.303l-.135.014h-5.833a.665.665 0 0 1 0-1.33zM6.643 3.669a.666.666 0 0 1 1.042.78l-.07.117-2.5 3.333a.666.666 0 0 1-.958.111l-1.25-1.04-.094-.097a.665.665 0 0 1 .835-1.001l.111.076.712.593 2.08-2.774zm10.023 1.5.135.013a.665.665 0 0 1 0 1.303l-.135.014h-5.833a.665.665 0 0 1 0-1.33zm-9.335 8.998a2.332 2.332 0 1 1-4.663 0 2.332 2.332 0 0 1 4.663 0`})})}function vz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`none`,stroke:`currentColor`,...e,children:(0,H.jsx)(`path`,{strokeWidth:`1.33`,d:`M6.804 15.133V4.867m0 10.266c0 .847-.687 1.534-1.534 1.534H3.754a1.533 1.533 0 0 1-1.534-1.534V4.867c0-.847.687-1.534 1.534-1.534H5.27c.847 0 1.534.687 1.534 1.534m0 10.266c0 .847.686 1.534 1.533 1.534h1.517c.847 0 1.533-.687 1.533-1.534V4.867c0-.847-.686-1.534-1.533-1.534H8.337c-.847 0-1.533.687-1.533 1.534m8.536 11.83 1.493-.263a1.533 1.533 0 0 0 1.244-1.777l-1.783-10.11a1.533 1.533 0 0 0-1.776-1.244l-1.494.263a1.533 1.533 0 0 0-1.243 1.777l1.782 10.11c.147.834.943 1.391 1.777 1.244Z`})})}function Kue(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`none`,stroke:`currentColor`,...e,children:(0,H.jsxs)(`g`,{strokeLinecap:`round`,strokeWidth:`1.33`,children:[(0,H.jsx)(`path`,{d:`M12.524 12.192c1.803 1.946 4.692.822 4.893-2.058.286-4.087-2.553-7.613-7.104-7.613-3.98 0-7.46 3.038-7.731 6.934-.3 4.3 2.766 7.974 7.416 7.974 1.57 0 3.184-.37 4.381-1.218M6.374 8.96l1.098 1.141M9.124 6.313l1.099 1.14`}),(0,H.jsx)(`path`,{d:`m11.028 6.89-4.142 3.987a.21.21 0 0 0-.006.295c.534.557 1.303 1.37 1.303 1.37 1.185 1.23 2.815.978 4.064-.224 1.25-1.203 1.606-2.795.38-4.053l-1.304-1.368a.21.21 0 0 0-.295-.007Z`})]})})}function que(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsxs)(`g`,{children:[(0,H.jsx)(`path`,{d:`M8.195 10.381c.423 0 .767.344.767.767v1.038a.768.768 0 0 1-1.534 0v-1.038c0-.423.344-.766.767-.767M11.715 10.381c.424 0 .767.344.767.767v1.038a.767.767 0 0 1-1.533 0v-1.038c0-.423.343-.766.766-.767`}),(0,H.jsx)(`path`,{fillRule:`evenodd`,d:`M10 1.667a1.694 1.694 0 0 1 .665 3.252v.884c1.425.028 2.833.145 4.24.368 1.299.207 2.394 1.182 2.623 2.529q.08.477.125.93a2.053 2.053 0 0 1 .03 4.068 15 15 0 0 1-.155 1.248c-.229 1.347-1.324 2.322-2.622 2.528A31 31 0 0 1 10 17.85c-1.653 0-3.28-.116-4.906-.375-1.298-.206-2.393-1.181-2.622-2.528a15 15 0 0 1-.155-1.248 2.052 2.052 0 0 1 .03-4.068q.045-.453.125-.93c.229-1.347 1.324-2.322 2.622-2.529a31 31 0 0 1 4.241-.368V4.92A1.693 1.693 0 0 1 10 1.667m0 5.46c-1.59 0-3.147.111-4.698.358-.786.125-1.394.702-1.518 1.436-.173 1.018-.202 1.945-.202 2.902l.006.714a15 15 0 0 0 .196 2.187c.124.734.732 1.311 1.518 1.437 1.551.246 3.108.358 4.698.358 1.589 0 3.146-.112 4.697-.358.786-.125 1.395-.703 1.52-1.437.172-1.018.201-1.944.202-2.901l-.008-.714a15 15 0 0 0-.195-2.188c-.124-.734-.733-1.311-1.52-1.436A30 30 0 0 0 10 7.126`,clipRule:`evenodd`})]})})}function Jue(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsxs)(`g`,{children:[(0,H.jsx)(`path`,{d:`M13.334 11.417a.666.666 0 0 1 0 1.33h-2.5a.665.665 0 0 1 0-1.33zM6.742 7.346a.665.665 0 0 1 .912.228l1.121 1.868c.206.343.206.771 0 1.114l-1.12 1.869a.666.666 0 0 1-1.141-.685L7.558 10 6.514 8.258a.665.665 0 0 1 .228-.912`}),(0,H.jsx)(`path`,{fillRule:`evenodd`,d:`M7.798 1.78a4.49 4.49 0 0 1 4.14.979 4.488 4.488 0 0 1 5.301 5.3 4.487 4.487 0 0 1-1.94 7.239 4.485 4.485 0 0 1-7.238 1.94 4.486 4.486 0 0 1-5.301-5.3A4.487 4.487 0 0 1 4.7 4.7 4.49 4.49 0 0 1 7.798 1.78m3.311 2.02a3.16 3.16 0 0 0-5.17 1.385c-.111.359-.393.642-.752.753A3.16 3.16 0 0 0 3.8 11.11c.255.277.358.662.275 1.029a3.16 3.16 0 0 0 3.785 3.785L8 15.9c.323-.032.649.075.89.298a3.16 3.16 0 0 0 5.17-1.385l.05-.13c.133-.297.389-.526.704-.623a3.16 3.16 0 0 0 1.385-5.17 1.15 1.15 0 0 1-.275-1.03 3.16 3.16 0 0 0-3.785-3.785 1.15 1.15 0 0 1-1.03-.275`,clipRule:`evenodd`})]})})}function Yue(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsx)(`path`,{d:`M9.79 18.51a1.8 1.8 0 0 1-.99.27 1.74 1.74 0 0 1-.97-.32l-3.48-2.38a2 2 0 0 1-.64-.71 1.9 1.9 0 0 1-.23-.91V6.53q0-.49.22-.89.23-.399.66-.66l5.72-3.52q.49-.3 1.06-.29.57 0 1.05.32l3.52 2.4q.39.28.6.67.21.381.21.84v7.89q0 .5-.25.95t-.69.71zm4.59-13.85-2.96-2.02a.52.52 0 0 0-.31-.1.5.5 0 0 0-.3.08L5.5 5.89l3.27 2.22zM8.14 9.33 4.86 7.11v3.1l3.28 2.24zm0 4.71L4.86 11.8v2.66q0 .15.06.28.06.12.19.21l3.03 2.07zm7-5.15V5.81L9.52 9.26v3.09zm-.28 4.9a.6.6 0 0 0 .21-.21.6.6 0 0 0 .07-.29v-2.81l-5.62 3.46v3.13z`})})}function yz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,...e,children:(0,H.jsx)(`path`,{d:`M9.162 2.38a6.707 6.707 0 0 1 5.155 10.993l3.243 3.243a.665.665 0 1 1-.94.94l-3.25-3.249A6.707 6.707 0 1 1 9.162 2.38m0 1.33a5.377 5.377 0 1 0 0 10.754 5.377 5.377 0 0 0 0-10.754`})})}function Xue(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsx)(`path`,{d:`M6.835 4c-.451.004-.82.012-1.137.038-.386.032-.659.085-.876.162l-.2.086c-.44.224-.807.564-1.063.982l-.103.184c-.126.247-.206.562-.248 1.076-.043.523-.043 1.19-.043 2.135v2.664c0 .944 0 1.612.043 2.135.042.515.122.829.248 1.076l.103.184c.256.418.624.758 1.063.982l.2.086c.217.077.49.13.876.162.316.026.685.034 1.136.038zm11.33 7.327c0 .922 0 1.654-.048 2.243-.043.522-.125.977-.305 1.395l-.082.177a4 4 0 0 1-1.473 1.593l-.276.155c-.465.237-.974.338-1.57.387-.59.048-1.322.048-2.244.048H7.833c-.922 0-1.654 0-2.243-.048-.522-.042-.977-.126-1.395-.305l-.176-.082a4 4 0 0 1-1.594-1.473l-.154-.275c-.238-.466-.34-.975-.388-1.572-.048-.589-.048-1.32-.048-2.243V8.663c0-.922 0-1.654.048-2.243.049-.597.15-1.106.388-1.571l.154-.276a4 4 0 0 1 1.594-1.472l.176-.083c.418-.18.873-.263 1.395-.305.589-.048 1.32-.048 2.243-.048h4.334c.922 0 1.654 0 2.243.048.597.049 1.106.15 1.571.388l.276.154a4 4 0 0 1 1.473 1.594l.082.176c.18.418.262.873.305 1.395.048.589.048 1.32.048 2.243zm-10 4.668h4.002c.944 0 1.612 0 2.135-.043.514-.042.829-.122 1.076-.248l.184-.103c.418-.256.758-.624.982-1.063l.086-.2c.077-.217.13-.49.162-.876.043-.523.043-1.19.043-2.135V8.663c0-.944 0-1.612-.043-2.135-.032-.386-.085-.659-.162-.876l-.086-.2a2.67 2.67 0 0 0-.982-1.063l-.184-.103c-.247-.126-.562-.206-1.076-.248-.523-.043-1.19-.043-2.135-.043H8.164L8.165 4z`})})}function bz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsx)(`path`,{d:`M10 2.533a.8.8 0 0 1 .8.8V9.2h5.866a.8.8 0 1 1 0 1.6H10.8v5.866a.8.8 0 1 1-1.6 0V10.8H3.333a.8.8 0 0 1 0-1.6H9.2V3.333a.8.8 0 0 1 .8-.8`})})}function xz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsxs)(`g`,{children:[(0,H.jsx)(`path`,{d:`M18.585 13.412a.9.9 0 0 1 1.668.676 8.91 8.91 0 0 1-7.353 5.516V22a.9.9 0 0 1-1.8 0v-2.396a8.91 8.91 0 0 1-7.352-5.516.9.9 0 0 1 1.668-.676 7.104 7.104 0 0 0 13.169 0`}),(0,H.jsx)(`path`,{fillRule:`evenodd`,d:`M12 1.35a4.9 4.9 0 0 1 4.9 4.9v4.483a4.9 4.9 0 0 1-9.8 0V6.25a4.9 4.9 0 0 1 4.9-4.9m0 1.8a3.1 3.1 0 0 0-3.1 3.1v4.483a3.1 3.1 0 1 0 6.2 0V6.25a3.1 3.1 0 0 0-3.1-3.1`,clipRule:`evenodd`})]})})}function Sz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsx)(`path`,{d:`M7.167 15.416V4.583a.75.75 0 0 1 1.5 0v10.833a.75.75 0 0 1-1.5 0m4.166-2.5V7.083a.75.75 0 0 1 1.5 0v5.833a.75.75 0 0 1-1.5 0M3 11.25v-2.5a.75.75 0 0 1 1.5 0v2.5a.75.75 0 0 1-1.5 0m12.5 0v-2.5a.75.75 0 0 1 1.5 0v2.5a.75.75 0 0 1-1.5 0`})})}function Cz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsx)(`path`,{d:`M14.255 4.755a.7.7 0 0 1 .99.99L10.99 10l4.255 4.255.09.11a.7.7 0 0 1-.97.97l-.11-.09L10 10.99l-4.255 4.255a.7.7 0 0 1-.99-.99L9.01 10 4.755 5.745l-.09-.11a.7.7 0 0 1 .97-.97l.11.09L10 9.01z`})})}function Zue(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsx)(`path`,{d:`M11.248 18.25q-.825 0-1.568-.314a4.3 4.3 0 0 1-1.32-.874 4 4 0 0 1-1.303.214 4 4 0 0 1-2.046-.544 4.27 4.27 0 0 1-1.518-1.485 4 4 0 0 1-.561-2.095q0-.48.132-1.04A4.4 4.4 0 0 1 2.04 10.71a4.07 4.07 0 0 1 .016-3.4 4.2 4.2 0 0 1 1.056-1.418 3.8 3.8 0 0 1 1.6-.842 3.9 3.9 0 0 1 .76-1.683q.594-.759 1.452-1.188a4.04 4.04 0 0 1 1.831-.429q.825 0 1.568.313.742.314 1.32.875a4 4 0 0 1 1.303-.215q1.106 0 2.046.545a4.14 4.14 0 0 1 1.502 1.485q.577.941.577 2.095 0 .48-.132 1.04.66.61 1.023 1.419.363.792.363 1.666 0 .892-.38 1.717a4.3 4.3 0 0 1-1.072 1.435 3.8 3.8 0 0 1-1.584.825 3.8 3.8 0 0 1-.775 1.683 4.06 4.06 0 0 1-1.436 1.188 4.04 4.04 0 0 1-1.831.429m-4.076-2.062q.825 0 1.436-.347l3.102-1.782a.36.36 0 0 0 .165-.313v-1.42L7.882 14.62a.67.67 0 0 1-.726 0l-3.119-1.798a.5.5 0 0 1-.016.115v.198q0 .841.396 1.551.412.693 1.138 1.089a3.2 3.2 0 0 0 1.617.412m.165-2.69a.4.4 0 0 0 .182.05q.082 0 .165-.05l1.237-.71-3.976-2.31a.7.7 0 0 1-.363-.643v-3.58q-.825.362-1.32 1.122a2.9 2.9 0 0 0-.495 1.65q0 .809.412 1.55.413.743 1.073 1.123zm3.91 3.663q.876 0 1.585-.396a2.96 2.96 0 0 0 1.534-2.64v-3.564a.32.32 0 0 0-.165-.297l-1.254-.726v4.604a.7.7 0 0 1-.363.643l-3.118 1.799a3 3 0 0 0 1.782.577m.628-6.039V8.878L10.01 7.822 8.13 8.878v2.244l1.88 1.056zM7.057 5.859a.7.7 0 0 1 .363-.644l3.118-1.798a3 3 0 0 0-1.782-.578q-.874 0-1.584.396A2.96 2.96 0 0 0 6.05 4.324a3.07 3.07 0 0 0-.396 1.551v3.547q0 .199.165.314l1.238.726zm8.382 7.887q.825-.364 1.303-1.123.495-.758.495-1.65a3.15 3.15 0 0 0-.412-1.55q-.413-.743-1.073-1.123l-3.085-1.782q-.1-.065-.182-.049a.3.3 0 0 0-.165.05l-1.237.692 3.993 2.327a.6.6 0 0 1 .264.264.64.64 0 0 1 .099.363zm-3.317-8.382a.63.63 0 0 1 .726 0l3.135 1.831v-.297q0-.792-.396-1.501a2.86 2.86 0 0 0-1.105-1.155q-.71-.43-1.65-.43-.825 0-1.436.347L8.294 5.941a.36.36 0 0 0-.165.314v1.418z`})})}function Que(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsx)(`path`,{d:`M16.835 10c0-3.51-3.024-6.418-6.835-6.418S3.165 6.49 3.165 10c0 1.414.567 2.35 1.282 3.765.087.171.111.367.07.555l-.327 1.469 1.59-.412.145-.024a.8.8 0 0 1 .287.028l.136.051.459.212c1.062.472 2.06.775 3.193.775 3.811 0 6.835-2.91 6.835-6.42m1.33 0c0 4.314-3.692 7.749-8.165 7.749-1.52 0-2.804-.453-4.06-1.04l-2.204.572a.832.832 0 0 1-1.02-.986l.463-2.089C2.537 12.954 1.835 11.73 1.835 10 1.835 5.685 5.527 2.25 10 2.25S18.165 5.685 18.165 10`})})}function $ue(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsx)(`path`,{d:`M2.5 6.25h15a.75.75 0 0 1 0 1.5h-15a.75.75 0 0 1 0-1.5m0 5.25h10a.75.75 0 0 1 0 1.5h-10a.75.75 0 0 1 0-1.5`})})}function ede(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsx)(`path`,{d:`M5.5 10a1.6 1.6 0 1 1-3.2 0 1.6 1.6 0 0 1 3.2 0m6.1 0a1.6 1.6 0 1 1-3.2 0 1.6 1.6 0 0 1 3.2 0m6.1 0a1.6 1.6 0 1 1-3.2 0 1.6 1.6 0 0 1 3.2 0`})})}var tde=`ui-sans-serif, -apple-system, system-ui, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif`,nde={light:{"--main-surface-primary":`#fcfcfc`,"--sidebar-surface":`#fcfcfc`,"--message-surface":`#e9e9e980`,"--composer-surface-primary":`#fff`,"--text-primary":`#0d0d0d`,"--text-secondary":`#5d5d5d`,"--text-tertiary":`#8f8f8f`,"--border-default":`#0000001a`,"--bg-elevated-primary":`#fff`,"--sidebar-surface-secondary":`#ececec`},dark:{"--main-surface-primary":`#000`,"--sidebar-surface":`#000`,"--message-surface":`#323232d9`,"--composer-surface-primary":`#212121`,"--text-primary":`#fff`,"--text-secondary":`#cdcdcd`,"--text-tertiary":`#afafaf`,"--border-default":`#ffffff26`,"--bg-elevated-primary":`#1b1b1b`,"--sidebar-surface-secondary":`#303030`}};function wz({className:e}){return(0,H.jsx)(`div`,{className:lN(`rounded-md bg-[color-mix(in_oklab,var(--text-primary)_10%,transparent)] motion-safe:animate-pulse`,e)})}var rde=[{icon:_z,label:`New chat`},{icon:Wue,label:`Projects`},{icon:Gue,label:`Tasks`},{icon:vz,label:`Library`},{icon:Kue,label:`Plugins`},{icon:que,label:`Agents`},{icon:Jue,label:`Codex`},{icon:Yue,label:`GPTs`}],ide=[`w-[85%]`,`w-[70%]`,`w-[78%]`,`w-[62%]`,`w-[82%]`,`w-[68%]`,`w-[75%]`,`w-[60%]`];function Tz(){return(0,H.jsxs)(`div`,{"aria-hidden":!0,className:`absolute inset-x-0 top-0 z-10 flex h-[52px] cursor-not-allowed items-center justify-between px-3`,children:[(0,H.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-xl bg-[color-mix(in_oklab,var(--text-primary)_4%,transparent)] backdrop-blur-sm`,children:(0,H.jsx)($ue,{className:`size-6`})}),(0,H.jsxs)(`div`,{className:`flex h-10 items-center gap-5 rounded-xl bg-[color-mix(in_oklab,var(--text-primary)_4%,transparent)] px-4 backdrop-blur-sm`,children:[(0,H.jsx)(_z,{className:`size-6`}),(0,H.jsx)(ede,{className:`size-6`})]})]})}function Ez(){return(0,H.jsxs)(`div`,{className:`rounded-[28px] bg-(--composer-surface-primary) p-2 shadow-[0_2px_12px_rgba(0,0,0,0.08)]`,children:[(0,H.jsx)(`div`,{className:`px-2.5 pt-1.5 pb-3 text-(--text-tertiary)`,children:`Ask ChatGPT`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-3 px-1.5 pb-0.5`,children:[(0,H.jsx)(bz,{className:`size-5 shrink-0`}),(0,H.jsx)(wz,{className:`h-4 w-16`}),(0,H.jsx)(`div`,{className:`flex-1`}),(0,H.jsx)(wz,{className:`h-4 w-14`}),(0,H.jsx)(xz,{className:`size-6 shrink-0`}),(0,H.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-full bg-(--text-primary) text-(--main-surface-primary)`,children:(0,H.jsx)(Sz,{className:`size-5`})})]})]})}function Dz(){return(0,H.jsxs)(`div`,{className:`flex h-[52px] items-center gap-3 rounded-full border border-(--border-default) bg-(--composer-surface-primary) px-4 shadow-[0_4px_16px_rgba(0,0,0,0.06)]`,children:[(0,H.jsx)(bz,{className:`size-5 shrink-0`}),(0,H.jsx)(`span`,{className:`flex-1 text-(--text-tertiary)`,children:`Ask ChatGPT`}),(0,H.jsx)(xz,{className:`size-6 shrink-0`}),(0,H.jsx)(`div`,{className:`flex size-9.5 shrink-0 items-center justify-center rounded-full bg-(--text-primary) text-(--main-surface-primary)`,children:(0,H.jsx)(Sz,{className:`size-5.5`})})]})}function Oz({className:e}){return(0,H.jsx)(`div`,{className:lN(`h-11 w-2/5 self-end rounded-3xl bg-(--message-surface) motion-safe:animate-pulse`,e)})}function kz({children:e}){let t=ds(e=>e.theme),n=ds(e=>e.displayMode),r=ds(e=>e.setPreference),i=ms(),a=n===`pip`,o=n===`fullscreen`,s=(0,b.useRef)(null),c=(0,b.useRef)(null);return(0,b.useEffect)(()=>{let e=s.current,t=c.current;if(!e||!t)return;let n=()=>{e.scrollTop=e.scrollHeight};n();let r=new ResizeObserver(n);r.observe(t);let i=()=>r.disconnect(),a=[`wheel`,`touchstart`,`pointerdown`];for(let t of a)e.addEventListener(t,i,{once:!0,passive:!0});return()=>{r.disconnect();for(let t of a)e.removeEventListener(t,i)}},[]),(0,H.jsxs)(`div`,{className:`@container/shell relative isolate flex h-full w-full overflow-hidden bg-(--main-surface-primary) text-(--text-primary)`,style:{fontFamily:tde,...nde[t]},children:[(0,H.jsxs)(`aside`,{"aria-hidden":!0,className:lN(`h-full shrink-0 cursor-not-allowed border-(--border-default) border-r bg-(--sidebar-surface) @max-[640px]/shell:hidden`,o?`w-[52px]`:`w-[260px]`,i&&`hidden`),children:[(0,H.jsxs)(`div`,{className:lN(`h-full flex-col px-1.5 pb-2`,o?`hidden`:`flex`),children:[(0,H.jsxs)(`div`,{className:`flex h-[52px] shrink-0 items-center justify-between pr-2.5 pl-3`,children:[(0,H.jsx)(`span`,{className:`font-semibold text-base`,children:`ChatGPT`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-4 text-(--text-secondary)`,children:[(0,H.jsx)(yz,{className:`size-5`}),(0,H.jsx)(Xue,{className:`size-5`})]})]}),rde.map(({icon:e,label:t})=>(0,H.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-1.5 rounded-[10px] px-2.5 text-sm leading-5`,children:[(0,H.jsx)(e,{className:`size-5 shrink-0`}),(0,H.jsx)(`span`,{children:t})]},t)),(0,H.jsx)(wz,{className:`mt-6 mb-2 ml-2 h-3 w-14`}),ide.map(e=>(0,H.jsx)(`div`,{className:`px-2 py-2`,children:(0,H.jsx)(wz,{className:lN(`h-3.5`,e)})},e)),(0,H.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 px-2 py-2`,children:[(0,H.jsx)(wz,{className:`size-8 rounded-full`}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(wz,{className:`h-3 w-24`}),(0,H.jsx)(wz,{className:`h-2.5 w-16`})]})]})]}),(0,H.jsxs)(`div`,{className:lN(`h-full flex-col items-center gap-5 py-4`,o?`flex`:`hidden`),children:[(0,H.jsx)(Zue,{className:`size-6`}),(0,H.jsx)(_z,{className:`mt-4 size-5`}),(0,H.jsx)(yz,{className:`size-5`}),(0,H.jsx)(Que,{className:`size-5`}),(0,H.jsx)(vz,{className:`size-5`}),(0,H.jsx)(wz,{className:`mt-auto size-8 rounded-full`})]})]}),(0,H.jsxs)(`div`,{className:`relative flex h-full min-w-0 flex-1 flex-col`,children:[i&&!o&&(0,H.jsx)(Tz,{}),(0,H.jsxs)(`div`,{className:lN(`h-[52px] shrink-0 items-center px-4`,o?`flex`:`hidden`),children:[(0,H.jsx)(`button`,{type:`button`,"aria-label":`Exit fullscreen`,onClick:()=>r(`displayMode`,`inline`),className:`-ml-2 flex size-9 cursor-pointer items-center justify-center rounded-lg text-(--text-primary) transition-colors hover:bg-[color-mix(in_oklab,var(--text-primary)_5%,transparent)]`,children:(0,H.jsx)(Cz,{className:`size-5`})}),(0,H.jsxs)(`div`,{"aria-hidden":!0,className:`flex flex-1 items-center justify-center gap-2`,children:[(0,H.jsx)(wz,{className:`size-5 rounded-md`}),(0,H.jsx)(wz,{className:`h-4 w-28`})]}),(0,H.jsx)(`div`,{className:`w-5`})]}),(0,H.jsx)(`div`,{ref:s,className:`min-h-0 flex-1 overflow-y-auto [container-type:size]`,children:(0,H.jsxs)(`div`,{ref:c,className:lN(`mx-auto flex w-full max-w-[768px] flex-col px-4 py-6`,i&&!o&&`pt-16`,o&&`h-full max-w-none p-0`),children:[[[`w-[92%]`,`w-[80%]`,`w-[55%]`],[`w-[88%]`,`w-[76%]`,`w-[50%]`],[`w-[95%]`,`w-[70%]`,`w-[62%]`]].map((e,t)=>(0,H.jsxs)(`div`,{className:lN(`flex flex-col`,o&&`hidden`,t>0&&`mt-10`),children:[(0,H.jsx)(Oz,{}),(0,H.jsx)(`div`,{className:`mt-6 flex flex-col gap-3`,children:e.map(e=>(0,H.jsx)(wz,{className:lN(`h-4`,e)},e))})]},e[0])),(0,H.jsx)(Oz,{className:lN(`mt-10`,o&&`hidden`)}),(0,H.jsx)(wz,{className:lN(`mt-6 h-4 w-40`,o&&`hidden`)}),(0,H.jsxs)(`div`,{className:lN(`mt-6 flex items-center gap-2`,o&&`hidden`),children:[(0,H.jsx)(wz,{className:`size-5 rounded-md`}),(0,H.jsx)(wz,{className:`h-4 w-[110px]`})]}),(0,H.jsxs)(`div`,{className:lN(`relative mt-3 w-full`,!a&&!o&&!i&&`-mx-4 w-[calc(100%+2rem)]`,a&&`absolute top-4 left-1/2 z-30 mt-0 w-[min(768px,calc(100%-32px))] translate-x-[calc(-50%-8px)] rounded-3xl border border-(--border-default) bg-(--main-surface-primary) shadow-[0_8px_32px_rgba(0,0,0,0.12)]`,o&&`mt-0 min-h-0 flex-1`),children:[a?(0,H.jsx)(`button`,{type:`button`,"aria-label":`Exit picture-in-picture`,onClick:()=>r(`displayMode`,`inline`),className:`-top-2.5 -left-2.5 absolute z-10 flex size-8 cursor-pointer items-center justify-center rounded-full bg-[#414141] text-white`,children:(0,H.jsx)(Cz,{className:`size-4.5`})}):null,(0,H.jsx)(`div`,{className:lN(`w-full`,a&&`max-h-[80cqh] overflow-y-auto rounded-3xl`,o&&`h-full min-h-0`,i&&!a&&!o&&`overflow-hidden rounded-xl border border-(--border-default)`),children:e??(0,H.jsx)(wz,{className:`h-96 w-full rounded-2xl`})})]}),(0,H.jsx)(`div`,{className:lN(`mt-6 border-(--border-default) border-t`,o&&`hidden`)}),(0,H.jsxs)(`div`,{className:lN(`mt-6 flex flex-col gap-3`,o&&`hidden`),children:[(0,H.jsx)(wz,{className:`h-4 w-[95%]`}),(0,H.jsx)(wz,{className:`h-4 w-[88%]`}),(0,H.jsx)(wz,{className:`h-4 w-[60%]`})]}),(0,H.jsxs)(`div`,{className:lN(`mt-4 flex items-center gap-3 pb-4`,o&&`hidden`),children:[(0,H.jsx)(wz,{className:`size-4 rounded-full`}),(0,H.jsx)(wz,{className:`size-4 rounded-full`}),(0,H.jsx)(wz,{className:`size-4 rounded-full`}),(0,H.jsx)(wz,{className:`size-4 rounded-full`})]})]})}),(0,H.jsx)(`div`,{"aria-hidden":!0,className:lN(`w-full shrink-0 cursor-not-allowed px-4`,i?`pb-4`:`pb-6`,o&&`hidden`),children:(0,H.jsx)(`div`,{className:`mx-auto w-full max-w-[768px]`,children:i?(0,H.jsx)(Ez,{}):(0,H.jsx)(Dz,{})})})]})]})}function Az(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M471.88739013671875 665.9563838413783Q471.88739013671875 704.3330688476562 457.7486114501953 738.6877461887846Q443.6098327636719 773.042423529913 417.35210091727123 799.3136473790112Q390.08445630754744 826.5953029146131 355.74742235456193 840.7413465256659Q321.4103884015764 854.8873901367188 284.04361615862166 854.8873901367188Q245.66693115234375 854.8873901367188 211.31225381121538 840.7486114501953Q176.95757647008705 826.6098327636719 150.68635262098888 799.3421881539481Q123.40469708538696 773.0844563075475 109.2586534743341 738.747422354562Q95.11260986328125 704.4103884015765 95.11260986328125 666.0337033952985Q95.11260986328125 628.6669311523438 109.25138854980469 594.3122538112154Q123.39016723632812 559.957576470087 150.65781184605189 532.6759209344851Q176.91554369245256 506.40469708538694 211.25257764543807 492.2586534743341Q245.58961159842355 478.11260986328125 283.9662966047014 478.11260986328125Q321.33306884765625 478.11260986328125 355.6877461887846 492.2513885498047Q390.042423529913 506.3901672363281 417.32407906551487 532.6478990827288Q443.59530291461306 559.9155436924525 457.7413465256659 594.252577645438Q471.88739013671875 628.5896115984235 471.88739013671875 665.9563838413783ZM412.11260986328125 666.0401287768261Q412.11260986328125 631.5551147460938 394.3774597903332 602.4688213147615Q376.64230971738516 573.3825278834292 347.5763693200537 555.634959010074Q318.51042892272216 537.8873901367188 284.02541489198984 537.8873901367188Q248.55511474609375 537.8873901367188 219.4688213147615 555.6225402096668Q190.38252788342928 573.3576902826148 172.634959010074 602.4236306799463Q154.88739013671875 631.4895710772778 154.88739013671875 665.9745851080102Q154.88739013671875 701.4448852539062 172.6225402096668 730.5311786852385Q190.35769028261484 759.6174721165708 219.42363067994637 777.365040989926Q248.48957107727787 795.1126098632812 283.95987122317393 795.1126098632812Q318.44488525390625 795.1126098632812 347.5311786852385 777.3774597903332Q376.6174721165707 759.6423097173852 394.365040989926 730.5763693200537Q412.11260986328125 701.5104289227222 412.11260986328125 666.0401287768261ZM601.0 395.11260986328125H849.0Q871.7689367223669 395.11260986328125 888.3281634295429 411.6718365704572Q904.8873901367188 428.2310632776331 904.8873901367188 451.0V799.0Q904.8873901367188 821.7689367223669 888.3281634295429 838.3281634295429Q871.7689367223669 854.8873901367188 849.0 854.8873901367188H601.0Q578.2310632776331 854.8873901367188 561.6718365704571 838.3281634295429Q545.1126098632812 821.7689367223669 545.1126098632812 799.0V451.0Q545.1126098632812 428.2310632776331 561.6718365704571 411.6718365704572Q578.2310632776331 395.11260986328125 601.0 395.11260986328125ZM601.0 454.88739013671875 604.8873901367188 451.0V799.0L601.0 795.1126098632812H849.0L845.1126098632812 799.0V451.0L849.0 454.88739013671875ZM325.33465576171875 511.77716064453125V512.7771606445312Q303.1718221028646 461.44838945942536 299.1422159830729 409.11317178049393Q295.11260986328125 356.7779541015625 308.202328408731 307.9240358737713Q321.29204695418076 259.0701176459801 350.995639038086 218.77822632409038Q380.69923112199115 178.4863350022007 425.00289389120564 153.30390292601965Q470.31345808699325 127.2236328125 519.6516279890731 121.7236328125Q568.9897978911529 116.2236328125 618.3279677932327 129.2236328125Q667.6661376953125 142.2236328125 710.9897978184587 171.91258533184345Q754.3134579416048 201.6015378511869 786.5543212890625 246.8897705078125Q801.8873901367188 268.6151204427083 794.8873901367188 293.444091796875Q788.6568040114182 317.24662911551343 767.88818359375 329.66534423828125L406.88818359375 537.6653442382812Q393.4617545387962 545.8873901367188 377.4533198963512 545.8873901367188Q361.44488525390625 545.8873901367188 348.0325142996652 537.6098327636719L334.6201433454241 527.2628860473633ZM380.66534423828125 488.22283935546875 378.88818359375 486.33465576171875 377.00079345703125 485.4456787109375 738.0007934570312 277.4456787109375 737.1126098632812 278.555908203125 737.5567016601562 282.1102294921875Q703.8421892438616 234.41767765925476 655.2536272321429 208.08741466815655Q606.6650652204241 181.75715167705835 554.110089983259 180.26675943227917Q501.55511474609375 178.7763671875 455.0165774806016 205.55561225358827Q409.46822185905614 231.34303342834005 384.2185899384168 277.9587563211604Q358.9689580177774 324.5744792139808 357.48368555185743 379.6207051831623Q355.9984130859375 434.66693115234375 380.66534423828125 487.2310632776331Z`})})}function jz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M500.045285676655 120.11260986328125Q578.444091796875 120.11260986328125 647.273644917806 149.76344038310805Q716.103198038737 179.41427090293485 768.3533697509765 231.68014164974818Q820.6035414632162 283.9460123965615 850.2454657999674 352.79624597649826Q879.8873901367188 421.646479556435 879.8873901367188 500.045285676655Q879.8873901367188 578.444091796875 850.2400938165251 643.7852350408381Q820.5927974963314 709.1263782848011 768.8356530729425 756.3730510919745Q717.0785086495536 803.6197238991477 647.7339850531685 829.2535570179332Q578.3894614567832 854.8873901367188 500.0 854.8873901367188H150.0Q136.15392855940195 854.8873901367188 128.16581042059536 846.340815617488Q120.1776922817888 837.7942410982572 119.64515107253501 825.508540226863Q119.11260986328125 813.2228393554688 128.667724609375 803.667724609375L228.667724609375 703.667724609375Q220.11260986328125 712.1950836181641 220.11260986328125 724.9861221313477Q220.11260986328125 737.7771606445312 228.667724609375 746.332275390625Q178.410727041739 696.0572959498355 149.26166845251012 638.2410695929277Q120.11260986328125 580.4248432360198 120.11260986328125 499.98487613075656Q120.11260986328125 421.555908203125 149.76344038310805 352.726355082194Q179.41427090293482 283.896801961263 231.68014164974812 231.64663024902342Q283.94601239656146 179.39645853678383 352.79624597649826 149.75453420003254Q421.64647955643505 120.11260986328125 500.045285676655 120.11260986328125ZM500.0425254998293 179.88739013671875Q433.444091796875 179.88739013671875 375.7723714192708 204.7367776087088Q318.10065104166665 229.58616508069883 273.85252075195314 273.8180747808412Q229.6043904622396 318.04998448098354 204.74589029947919 375.7005634160005Q179.88739013671875 433.3511423510174 179.88739013671875 499.9475007759508Q179.88739013671875 564.555908203125 203.2455945222274 611.7545601981027Q226.60379890773606 658.9532121930804 271.332275390625 703.667724609375Q279.88739013671875 712.1950836181641 279.88739013671875 724.9861221313477Q279.88739013671875 737.7771606445312 271.332275390625 746.332275390625L171.332275390625 846.332275390625Q180.7763671875 836.7702217102051 180.2763671875 824.5520420074463Q179.7763671875 812.3338623046875 171.80055454799106 803.7232360839844Q163.82474190848214 795.1126098632812 150.0 795.1126098632812H500.0Q565.6131436365732 795.1126098632812 623.7702482235359 774.2471184363732Q681.9273528104984 753.3816270094651 726.1665178381879 714.1346312302809Q770.4056828658773 674.8876354510967 795.2591463645792 620.7367172241211Q820.1126098632812 566.5857989971455 820.1126098632812 500.0149453970102Q820.1126098632812 433.444091796875 795.2624480338206 375.7723714192708Q770.4122862043602 318.10065104166665 726.1789981479203 273.85252075195314Q681.9457100914806 229.60439046223962 624.293334647132 204.74589029947919Q566.6409592027836 179.88739013671875 500.0425254998293 179.88739013671875Z`})})}function Mz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M399.9508586946081 95.11260986328125Q463.33306884765625 95.11260986328125 518.6892674763997 118.75518031719605Q574.0454661051432 142.39775077111085 615.8142341613769 184.1495241258965Q657.5830022176107 225.90129748068216 681.2351961771647 281.23497301112104Q704.8873901367188 336.5686485415599 704.8873901367188 399.9508586946081Q704.8873901367188 463.33306884765625 681.2410083934419 518.6892674763998Q657.594626650165 574.0454661051433 615.8361227205485 615.814234161377Q574.0776187909319 657.5830022176107 518.7350232215605 681.2351961771647Q463.39242765218904 704.8873901367188 400.0 704.8873901367188H125.0Q111.15392855940193 704.8873901367188 103.16581042059536 696.340815617488Q95.1776922817888 687.7942410982572 94.64515107253501 675.508540226863Q94.11260986328125 663.2228393554688 103.667724609375 653.667724609375L184.667724609375 573.667724609375Q175.2236328125 582.2120951990928 175.2236328125 594.494627921812Q175.2236328125 606.7771606445312 184.667724609375 615.332275390625Q142.40576034717344 574.0857803950671 118.75918510522735 518.7551163766359Q95.11260986328125 463.4244523582046 95.11260986328125 400.0456917552741Q95.11260986328125 336.66693115234375 118.75518031719604 281.3107325236003Q142.39775077111082 225.9545338948568 184.1495241258965 184.18576583862307Q225.90129748068222 142.41699778238933 281.23497301112104 118.76480382283529Q336.5686485415599 95.11260986328125 399.9508586946081 95.11260986328125ZM399.95305741073304 154.88739013671875Q349.33306884765625 154.88739013671875 304.68992832728793 173.74581724845325Q260.04678780691967 192.60424436018775 226.31641496930803 226.35090340223888Q192.58604213169642 260.09756244429 173.7367161342076 304.7622582352401Q154.88739013671875 349.4269540261902 154.88739013671875 400.046942589267Q154.88739013671875 450.66693115234375 174.23704655965167 495.30431587465347Q193.58670298258463 539.9417005969632 226.332275390625 573.667724609375Q235.88739013671875 582.2120951990928 235.88739013671875 594.494627921812Q235.88739013671875 606.7771606445312 226.332275390625 615.332275390625L146.332275390625 696.332275390625Q155.7763671875 686.7702217102051 155.2763671875 674.5520420074463Q154.7763671875 662.3338623046875 146.80055454799106 653.7232360839844Q138.82474190848214 645.1126098632812 125.0 645.1126098632812H400.0Q450.6102959636735 645.1126098632812 495.2664394610324 626.2541827515468Q539.9225829583913 607.3957556398123 573.662780267507 573.6490965977611Q607.4029775766226 539.9024375557099 626.2577937199519 495.23774176475985Q645.1126098632812 450.5730459738098 645.1126098632812 399.953057410733Q645.1126098632812 349.33306884765625 626.2541827515468 304.68992832728793Q607.3957556398123 260.0467878069196 573.6490965977612 226.31641496930803Q539.90243755571 192.58604213169644 495.2377417647599 173.7367161342076Q450.57304597380977 154.88739013671875 399.95305741073304 154.88739013671875ZM364.55670166015625 794.2212524414062Q357.0015869140625 784.5551147460938 358.07375183105466 772.2823365864001Q359.1459167480469 760.0095584267065 368.79540100097654 751.471973619963Q378.44488525390625 744.0015869140625 390.6862320438508 745.0722378817471Q402.92757883379534 746.1428888494318 411.44329833984375 755.7787475585938Q444.19262020713404 796.4752848307292 493.3166030080695 820.7939473470052Q542.4405858090049 845.1126098632812 600.0 845.1126098632812H802.4480590820312L773.667724609375 815.332275390625Q764.1126098632812 806.7879048009072 764.1126098632812 794.505372078188Q764.1126098632812 782.2228393554688 773.667724609375 773.667724609375Q806.4132970174154 739.9269369886669 825.7629534403484 695.2700121965531Q845.1126098632812 650.6130874044394 845.1126098632812 600.0019059733771Q845.1126098632812 542.444091796875 820.7939473470052 493.3187942504883Q796.4752848307292 444.19349670410156 755.7787475585938 411.44329833984375Q746.1428888494319 402.92757883379534 745.0722378817472 390.6862320438508Q744.0015869140625 378.44488525390625 751.471973619963 368.79540100097654Q760.0095584267065 359.14591674804683 772.2823365864001 358.07375183105466Q784.5551147460938 357.0015869140625 794.2212524414062 364.55670166015625Q845.530098100142 406.81575520833337 875.2087441184303 468.1919996473525Q904.8873901367188 529.5682440863716 904.8873901367188 600.0Q904.8873901367188 654.9370488432264 886.5634408133371 704.3803928021302Q868.2394914899554 753.8237367610342 835.5535278320312 793.7779541015625L896.332275390625 853.667724609375Q905.7763671875 863.2297782897949 905.2763671875 875.4479579925537Q904.7763671875 887.6661376953125 896.800554547991 896.2767639160156Q888.8247419084821 904.8873901367188 875.0 904.8873901367188H600.0Q529.5682440863716 904.8873901367188 468.1919996473524 875.2087441184303Q406.8157552083333 845.530098100142 364.55670166015625 794.2212524414062Z`})})}function Nz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M803.667724609375 328.667724609375Q812.1950836181641 320.11260986328125 824.9861221313477 320.11260986328125Q837.7771606445312 320.11260986328125 846.332275390625 328.6455200195312Q854.8873901367188 337.1784301757813 854.8873901367188 349.97779541015626Q854.8873901367188 362.77716064453125 846.332275390625 371.332275390625L521.332275390625 696.332275390625Q512.8049163818359 704.8873901367188 500.01387786865234 704.8873901367188Q487.22283935546875 704.8873901367188 478.667724609375 696.332275390625L153.667724609375 371.332275390625Q145.11260986328125 362.80491638183594 145.11260986328125 350.01387786865234Q145.11260986328125 337.22283935546875 153.64552001953126 328.667724609375Q162.17843017578124 320.11260986328125 174.97779541015626 320.11260986328125Q187.77716064453125 320.11260986328125 196.332275390625 328.667724609375L500.0 632.33544921875Z`})})}function Pz(e){return(0,H.jsxs)(`svg`,{viewBox:`0 0 21.2 21.2`,fill:`none`,"aria-hidden":`true`,...e,children:[(0,H.jsx)(`rect`,{x:`0`,y:`7.6`,height:`6`,width:`1.2`,rx:`0.6`,fill:`currentColor`}),(0,H.jsx)(`rect`,{x:`4`,y:`5.6`,height:`10`,width:`1.2`,rx:`0.6`,fill:`currentColor`}),(0,H.jsx)(`rect`,{x:`8`,y:`2.6`,height:`16`,width:`1.2`,rx:`0.6`,fill:`currentColor`}),(0,H.jsx)(`rect`,{x:`12`,y:`5.6`,height:`10`,width:`1.2`,rx:`0.6`,fill:`currentColor`}),(0,H.jsx)(`rect`,{x:`16`,y:`2.6`,height:`16`,width:`1.2`,rx:`0.6`,fill:`currentColor`}),(0,H.jsx)(`rect`,{x:`20`,y:`7.6`,height:`6`,width:`1.2`,rx:`0.6`,fill:`currentColor`})]})}function Fz(e){return(0,H.jsx)(`svg`,{viewBox:`30 0 82 24`,height:`20`,fill:`currentColor`,"aria-hidden":`true`,shapeRendering:`geometricPrecision`,...e,children:(0,H.jsx)(`path`,{d:`M39.504 21.2643C37.688 21.2643 36.06 20.9003 34.62 20.1723C33.18 19.4443 32.048 18.4163 31.224 17.0883C30.408 15.7603 30 14.2243 30 12.4803C30 10.6563 30.412 9.03233 31.236 7.60833C32.06 6.17633 33.196 5.06833 34.644 4.28433C36.1 3.49233 37.74 3.09633 39.564 3.09633C40.692 3.09633 41.82 3.22033 42.948 3.46833C44.084 3.71633 45.072 4.09633 45.912 4.60833V8.56833H44.832C44.536 7.16833 43.96 6.12433 43.104 5.43633C42.256 4.74833 41.076 4.40433 39.564 4.40433C38.164 4.40433 36.996 4.73233 36.06 5.38833C35.132 6.03633 34.444 6.93633 33.996 8.08833C33.548 9.24033 33.324 10.5643 33.324 12.0603C33.324 13.5483 33.576 14.8883 34.08 16.0803C34.584 17.2723 35.328 18.2163 36.312 18.9123C37.296 19.6003 38.476 19.9443 39.852 19.9443C40.796 19.9443 41.608 19.7483 42.288 19.3563C42.968 18.9643 43.54 18.4363 44.004 17.7723C44.468 17.1003 44.908 16.2803 45.324 15.3123H46.464L45.684 19.6803C44.892 20.2003 43.936 20.5963 42.816 20.8683C41.704 21.1323 40.6 21.2643 39.504 21.2643ZM47.964 21.0003V19.9563C48.356 19.9003 48.668 19.8403 48.9 19.7763C49.14 19.7043 49.332 19.5883 49.476 19.4283C49.628 19.2683 49.704 19.0443 49.704 18.7563V5.83233L47.964 5.08833V4.28433L51.612 2.73633H52.56V18.7563C52.56 19.0523 52.632 19.2803 52.776 19.4403C52.928 19.6003 53.12 19.7123 53.352 19.7763C53.592 19.8403 53.912 19.9003 54.312 19.9563V21.0003H47.964ZM59.028 21.2643C58.38 21.2643 57.792 21.1363 57.264 20.8803C56.736 20.6243 56.32 20.2563 56.016 19.7763C55.712 19.2963 55.56 18.7363 55.56 18.0963C55.56 17.1203 55.86 16.3443 56.46 15.7683C57.068 15.1843 57.916 14.7403 59.004 14.4363L63.24 13.2363V11.7123C63.24 10.8883 63.048 10.2523 62.664 9.80433C62.288 9.34833 61.708 9.12033 60.924 9.12033C60.228 9.12033 59.704 9.33233 59.352 9.75633C59.008 10.1723 58.836 10.7483 58.836 11.4843V12.6123H56.988C56.764 12.4683 56.588 12.2763 56.46 12.0363C56.34 11.7883 56.28 11.5163 56.28 11.2203C56.28 10.5563 56.516 9.98833 56.988 9.51633C57.46 9.03633 58.06 8.67633 58.788 8.43633C59.516 8.19633 60.256 8.07633 61.008 8.07633C62.592 8.07633 63.836 8.44033 64.74 9.16833C65.644 9.89633 66.096 11.0003 66.096 12.4803V18.5403C66.096 18.8603 66.168 19.1043 66.312 19.2723C66.456 19.4403 66.644 19.5603 66.876 19.6323C67.116 19.6963 67.44 19.7563 67.848 19.8123V20.8563C67.536 20.9683 67.208 21.0563 66.864 21.1203C66.528 21.1843 66.204 21.2163 65.892 21.2163C65.148 21.2163 64.548 21.0483 64.092 20.7123C63.644 20.3683 63.372 19.8643 63.276 19.2003C62.716 19.8643 62.08 20.3763 61.368 20.7363C60.664 21.0883 59.884 21.2643 59.028 21.2643ZM60.444 19.3443C60.948 19.3443 61.44 19.2283 61.92 18.9963C62.408 18.7563 62.848 18.4403 63.24 18.0483V14.3403L60.168 15.2523C59.592 15.4283 59.152 15.7003 58.848 16.0683C58.544 16.4363 58.392 16.9003 58.392 17.4603C58.392 17.8203 58.48 18.1443 58.656 18.4323C58.832 18.7203 59.076 18.9443 59.388 19.1043C59.7 19.2643 60.052 19.3443 60.444 19.3443ZM73.608 21.2643C72.32 21.2643 71.356 20.9283 70.716 20.2563C70.084 19.5843 69.768 18.6363 69.768 17.4123V10.9083L68.016 10.2603L68.112 9.45633L71.664 8.07633H72.624V16.9323C72.624 17.6923 72.812 18.2563 73.188 18.6243C73.564 18.9923 74.14 19.1763 74.916 19.1763C75.428 19.1763 75.964 19.0603 76.524 18.8283C77.084 18.5883 77.6 18.2803 78.072 17.9043V10.9083L76.32 10.2603V9.45633L79.98 8.07633H80.928V17.8323C80.928 18.1523 81 18.4003 81.144 18.5763C81.288 18.7443 81.476 18.8643 81.708 18.9363C81.948 19.0083 82.272 19.0723 82.68 19.1283V20.1603L79.02 21.1803H78.072V19.0803C77.44 19.7363 76.728 20.2643 75.936 20.6643C75.144 21.0643 74.368 21.2643 73.608 21.2643ZM89.328 21.2643C88.264 21.2643 87.312 21.0083 86.472 20.4963C85.632 19.9763 84.976 19.2683 84.504 18.3723C84.032 17.4763 83.796 16.4843 83.796 15.3963C83.796 13.9643 84.08 12.6963 84.648 11.5923C85.224 10.4883 86.032 9.62833 87.072 9.01233C88.112 8.38833 89.32 8.07633 90.696 8.07633C91.12 8.07633 91.556 8.12433 92.004 8.22033C92.46 8.30833 92.896 8.43633 93.312 8.60433V5.82033L91.56 5.08833V4.28433L95.22 2.73633H96.168V17.8323C96.168 18.1523 96.24 18.4003 96.384 18.5763C96.536 18.7443 96.728 18.8643 96.96 18.9363C97.2 19.0083 97.52 19.0723 97.92 19.1283V20.1603L94.26 21.1803H93.312V19.5843C92.752 20.1123 92.132 20.5243 91.452 20.8203C90.78 21.1163 90.072 21.2643 89.328 21.2643ZM90.504 19.3323C90.976 19.3323 91.456 19.2363 91.944 19.0443C92.432 18.8523 92.888 18.5883 93.312 18.2523V10.3563C92.584 9.76433 91.776 9.46833 90.888 9.46833C89.992 9.46833 89.236 9.69633 88.62 10.1523C88.004 10.6083 87.54 11.2283 87.228 12.0123C86.924 12.7883 86.772 13.6563 86.772 14.6163C86.772 15.5283 86.908 16.3403 87.18 17.0523C87.452 17.7563 87.868 18.3123 88.428 18.7203C88.988 19.1283 89.68 19.3323 90.504 19.3323ZM105.252 21.2643C104.068 21.2643 103.004 20.9883 102.06 20.4363C101.116 19.8843 100.376 19.1163 99.84 18.1323C99.304 17.1483 99.036 16.0443 99.036 14.8203C99.036 13.5563 99.308 12.4123 99.852 11.3883C100.404 10.3563 101.156 9.54833 102.108 8.96433C103.068 8.37233 104.136 8.07633 105.312 8.07633C106.216 8.07633 107.048 8.26433 107.808 8.64033C108.568 9.01633 109.2 9.54433 109.704 10.2243C110.216 10.9043 110.552 11.6883 110.712 12.5763L101.928 15.2883C102.168 16.4003 102.644 17.2763 103.356 17.9163C104.076 18.5563 104.968 18.8763 106.032 18.8763C106.92 18.8763 107.716 18.6523 108.42 18.2043C109.124 17.7483 109.748 17.0603 110.292 16.1403L111.228 16.4403C111.012 17.4003 110.62 18.2443 110.052 18.9723C109.484 19.7003 108.784 20.2643 107.952 20.6643C107.128 21.0643 106.228 21.2643 105.252 21.2643ZM107.628 12.2043C107.516 11.6523 107.324 11.1683 107.052 10.7523C106.788 10.3283 106.46 10.0003 106.068 9.76833C105.676 9.53633 105.244 9.42033 104.772 9.42033C104.18 9.42033 103.656 9.60033 103.2 9.96033C102.752 10.3123 102.4 10.8163 102.144 11.4723C101.896 12.1203 101.772 12.8723 101.772 13.7283C101.772 13.8803 101.776 13.9963 101.784 14.0763L107.628 12.2043Z`})})}function Iz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M708.332275390625 696.332275390625Q699.7879048009073 704.8873901367188 687.505372078188 704.8873901367188Q675.2228393554688 704.8873901367188 666.7003784179688 696.3544799804688Q657.1126098632812 687.8215698242187 657.1126098632812 675.0222045898438Q657.1126098632812 662.2228393554688 666.667724609375 653.667724609375L820.33544921875 500.0L666.667724609375 346.332275390625Q657.1126098632812 337.80491638183594 657.1126098632812 325.01387786865234Q657.1126098632812 312.22283935546875 666.7121337890625 303.667724609375Q675.2450439453125 295.11260986328125 687.5111022949219 295.11260986328125Q699.7771606445312 295.11260986328125 708.332275390625 303.667724609375L883.332275390625 478.667724609375Q892.8873901367188 487.19508361816406 892.8873901367188 499.98612213134766Q892.8873901367188 512.7771606445312 883.332275390625 521.332275390625ZM479.7763671875 805.2220458984375Q477.65525124289775 816.9654169497283 467.57995050603694 824.3708920686141Q457.5046497691761 831.7763671875 444.7779541015625 829.7763671875Q433.03458305027175 827.6552512428977 425.6291079313859 817.579950506037Q418.2236328125 807.5046497691761 420.2236328125 794.7779541015625L520.2236328125 194.7779541015625Q522.3447487571023 183.03458305027175 532.420049493963 175.62910793138587Q542.4953502308239 168.2236328125 555.2220458984375 170.2236328125Q566.9654169497283 172.34474875710225 574.3708920686141 182.42004949396306Q581.7763671875 192.49535023082387 579.7763671875 205.2220458984375ZM333.332275390625 653.667724609375Q342.88739013671875 662.1950836181641 342.88739013671875 674.9861221313477Q342.88739013671875 687.7771606445312 333.2878662109375 696.332275390625Q324.7549560546875 704.8873901367188 312.4888977050781 704.8873901367188Q300.22283935546875 704.8873901367188 291.667724609375 696.332275390625L116.667724609375 521.332275390625Q107.11260986328125 512.8049163818359 107.11260986328125 500.01387786865234Q107.11260986328125 487.22283935546875 116.667724609375 478.667724609375L291.667724609375 303.667724609375Q300.21209519909274 295.11260986328125 312.494627921812 295.11260986328125Q324.77716064453125 295.11260986328125 333.29962158203125 303.6455200195312Q342.88739013671875 312.1784301757813 342.88739013671875 324.97779541015626Q342.88739013671875 337.77716064453125 333.332275390625 346.332275390625L179.66455078125 500.0Z`})})}function Lz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M225.0 295.11260986328125H775.0Q810.516083240509 295.11260986328125 840.4510676860809 312.3632788658142Q870.3860521316528 329.61394786834717 887.6367211341858 359.54893231391907Q904.8873901367188 389.48391675949097 904.8873901367188 425.0V775.0Q904.8873901367188 797.5323408077925 894.133318387545 815.4557937230819Q883.3792466383713 833.3792466383713 865.4557937230819 844.133318387545Q847.5323408077925 854.8873901367188 825.0 854.8873901367188H175.0Q152.46765919220752 854.8873901367188 134.54420627691806 844.133318387545Q116.6207533616286 833.3792466383713 105.86668161245493 815.4557937230819Q95.11260986328125 797.5323408077925 95.11260986328125 775.0V425.0Q95.11260986328125 389.48391675949097 112.36327886581421 359.54893231391907Q129.61394786834717 329.61394786834717 159.54893231391907 312.3632788658142Q189.48391675949097 295.11260986328125 225.0 295.11260986328125ZM225.0 354.88739013671875Q195.78641255696616 354.88739013671875 175.33690134684247 375.33690134684247Q154.88739013671875 395.7864125569662 154.88739013671875 425.0V775.0Q154.88739013671875 783.2278858531605 160.82975214177912 789.1702478582208Q166.7721141468395 795.1126098632812 175.0 795.1126098632812H825.0Q833.2278858531605 795.1126098632812 839.1702478582208 789.1702478582208Q845.1126098632812 783.2278858531605 845.1126098632812 775.0V425.0Q845.1126098632812 395.7864125569662 824.6630986531575 375.33690134684247Q804.2135874430338 354.88739013671875 775.0 354.88739013671875ZM125.0 604.8873901367188V545.1126098632812H275.0Q287.77716064453125 545.1126098632812 296.332275390625 553.6455200195312Q304.88739013671875 562.1784301757813 304.88739013671875 574.9777954101562Q304.88739013671875 587.7771606445312 296.348135811942 596.332275390625Q287.8088814871652 604.8873901367188 275.0 604.8873901367188ZM375.0 604.8873901367188Q362.1911185128348 604.8873901367188 353.651864188058 596.3544799804688Q345.11260986328125 587.8215698242187 345.11260986328125 575.0222045898438Q345.11260986328125 562.2228393554688 353.651864188058 553.667724609375Q362.1911185128348 545.1126098632812 375.0 545.1126098632812H625.0Q637.8088814871652 545.1126098632812 646.348135811942 553.6455200195312Q654.8873901367188 562.1784301757813 654.8873901367188 574.9777954101562Q654.8873901367188 587.7771606445312 646.348135811942 596.332275390625Q637.8088814871652 604.8873901367188 625.0 604.8873901367188ZM354.88739013671875 325.0H295.11260986328125V225.0Q295.11260986328125 202.555908203125 305.86668161245495 184.60487747192383Q316.6207533616286 166.65384674072266 334.5442062769181 155.88322830200195Q352.4676591922075 145.11260986328125 375.0 145.11260986328125H625.0Q647.5323408077925 145.11260986328125 665.4557937230819 155.86668161245495Q683.3792466383713 166.62075336162866 694.133318387545 184.5442062769181Q704.8873901367188 202.46765919220752 704.8873901367188 225.0V325.0H645.1126098632812V225.0Q645.1126098632812 216.77716064453125 639.1702478582208 210.832275390625Q633.2278858531605 204.88739013671875 625.0 204.88739013671875H375.0Q366.7721141468395 204.88739013671875 360.8297521417791 210.82975214177912Q354.88739013671875 216.7721141468395 354.88739013671875 225.0ZM725.0 604.8873901367188Q712.2228393554688 604.8873901367188 703.667724609375 596.3544799804688Q695.1126098632812 587.8215698242187 695.1126098632812 575.0222045898438Q695.1126098632812 562.2228393554688 703.651864188058 553.667724609375Q712.1911185128348 545.1126098632812 725.0 545.1126098632812H875.0V604.8873901367188Z`})})}function Rz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M120.11260986328125 500.0Q120.11260986328125 421.61053854321676 149.76344038310805 352.76851149463147Q179.41427090293482 283.9264844460462 231.68014164974812 231.6668434748574Q283.94601239656146 179.4072025036686 352.79624597649826 149.75990618347493Q421.64647955643505 120.11260986328125 500.045285676655 120.11260986328125Q578.444091796875 120.11260986328125 647.2545028997927 149.77072185647899Q716.0649140027105 179.42883384967672 768.300554547991 231.70753973599136Q820.5361950932717 283.986245622306 850.1562811403858 352.85338703023973Q879.7763671875 421.72052843817346 879.7763671875 500.13858726764545L876.7763671875 539.3476166823814Q873.7763671875 557.444091796875 867.6836138375198 572.67919921875Q861.5908604875395 587.914306640625 852.4517304625692 600.6102294921875Q843.3126004375989 613.30615234375 831.1270937376385 622.447216796875H832.1425526293018Q819.9570459293413 631.58828125 806.7560803377175 637.68232421875Q793.5551147460938 643.7763671875 781.4743707830256 646.8066461736505Q768.3868981563684 650.8470181551847 754.7960611979167 652.36215764826Q741.205224239465 653.8772971413352 727.1110229492188 654.8873901367188L605.1110229492188 652.8873901367188L580.444091796875 655.8873901367188L568.0791430664062 661.5701817103795Q560.4699438476563 667.2529732840402 556.6653442382812 675.7771606445312L549.7763671875 701.3330688476562L543.7763671875 794.4244417173672L539.7763671875 814.444091796875L531.6067141415028 833.9011362711589L518.3310279417574 852.334125773112Q501.991721849763 869.7430603027344 475.4403494502721 874.863335164388L448.88897705078125 875.8873901367188L418.72600758403814 870.8621576482599Q390.57390274841123 864.8318786621094 364.4326625439005 854.7814136851918Q293.0469681392751 827.6451582475142 237.7481907835794 774.8802171186967Q182.44941342788368 722.1152759898793 151.28101164558245 651.2594979026101Q120.11260986328125 580.403719815341 120.11260986328125 500.0ZM179.88739013671875 499.96734619140625Q179.88739013671875 568.555908203125 206.2155882007014 627.7110236600699Q232.5437862646841 686.8661391170149 279.2390809442005 731.6053020676455Q325.9343756237169 776.3444650182762 385.545390108206 799.2111483041541L431.2471678796476 812.1357953787808L452.11102294921875 816.1126098632812L465.51890055338544 815.1866251627604L472.22283935546875 813.3346557617188L478.33465576171875 806.2228393554688L484.11260986328125 785.7779541015625L487.11260986328125 733.7779541015625L490.11260986328125 692.7779541015625L494.1894719050481 671.4213745117188L502.3431959885817 651.0817749023438Q506.42005803034857 641.928955078125 513.5545666034405 631.7591552734375Q520.6890751765325 621.58935546875 531.9004457913912 613.453515625L543.11181640625 606.3346557617188L566.4200007997711 598.1980121319111L601.8889770507812 593.1126098632812L724.7870679257521 595.1126098632812Q735.7779541015625 594.1126098632812 746.1268395317925 592.6459167480468Q756.4757249620226 591.1792236328125 765.3461981879341 589.2236328125Q775.2022795500578 586.2902465820313 782.1015365035446 582.8679626464843Q789.0007934570312 579.4456787109375 793.8527628580729 575.5396212064303Q799.675126139323 570.6570493257963 804.0418986002604 564.7979630690354Q808.4086710611979 558.9388768122747 812.2902465820313 550.1502474271334L818.1126098632812 528.6669311523438L820.1126098632812 499.85038787754854Q820.1126098632812 433.2742361737113 795.2571978901708 375.6411496241208Q770.4017859170604 318.00806307453036 726.169876216918 273.7895742563101Q681.9379665167756 229.57108543808988 624.2873875817587 204.72923778740432Q566.6368086467418 179.88739013671875 500.0404502218084 179.88739013671875Q433.444091796875 179.88739013671875 375.7723714192708 204.73831840183425Q318.10065104166665 229.58924666694975 273.85252075195314 273.8238989788553Q229.6043904622396 318.0585512907609 204.74589029947919 375.7127048658288Q179.88739013671875 433.36685844089675 179.88739013671875 499.96734619140625ZM546.7779541015625 245.11260986328125Q558.5921223958334 244.11260986328125 568.2582600911459 252.61659561960323Q577.9243977864584 261.1205813759252 577.9243977864584 272.8597604851974Q578.9984130859375 285.6661376953125 570.9741380479601 294.74284023708765Q562.9498630099827 303.8195427788628 550.1110229492188 304.88739013671875L554.8873901367188 300.0L550.0 295.11260986328125L545.1126098632812 300.0L549.8889770507812 304.88739013671875Q537.0691152719351 303.8207763671875 529.0908625676082 294.7545593261719Q521.1126098632812 285.6883422851563 522.1126098632812 272.88897705078125Q522.1126098632812 261.137437086839 531.767262425916 252.62502347506012Q541.4219149885506 244.11260986328125 553.2220458984375 245.11260986328125Q574.9214904785156 246.14813720703125 589.9044403076172 262.19881103515627Q604.8873901367188 278.2494848632813 604.8873901367188 299.99555908203126Q604.8873901367188 322.77716064453125 588.8367163085937 338.832275390625Q572.7860424804687 354.88739013671875 550.0044409179687 354.88739013671875Q527.2228393554688 354.88739013671875 511.167724609375 338.82927477037583Q495.11260986328125 322.7711594040329 495.11260986328125 299.97899565825594Q495.11260986328125 278.22283935546875 510.09555969238284 262.18507194519043Q525.0785095214844 246.1473045349121 546.7779541015625 245.11260986328125ZM696.7779541015625 395.11260986328125Q708.5921223958334 394.11260986328125 718.2582600911459 402.61659561960323Q727.9243977864584 411.1205813759252 727.9243977864584 422.8597604851974Q728.9984130859375 435.6661376953125 720.9741380479601 444.74284023708765Q712.9498630099827 453.8195427788628 700.1110229492188 454.88739013671875L704.8873901367188 450.0L700.0 445.11260986328125L695.1126098632812 450.0L699.8889770507812 454.88739013671875Q687.0691152719351 453.8207763671875 679.0908625676082 444.7545593261719Q671.1126098632812 435.6883422851563 672.1126098632812 422.88897705078125Q672.1126098632812 411.137437086839 681.767262425916 402.6250234750601Q691.4219149885506 394.11260986328125 703.2220458984375 395.11260986328125Q724.9214904785156 396.14813720703125 739.9044403076172 412.19881103515627Q754.8873901367188 428.2494848632813 754.8873901367188 449.99555908203126Q754.8873901367188 472.77716064453125 738.8367163085937 488.832275390625Q722.7860424804687 504.88739013671875 700.0044409179687 504.88739013671875Q677.2228393554688 504.88739013671875 661.167724609375 488.82927477037583Q645.1126098632812 472.7711594040329 645.1126098632812 449.97899565825594Q645.1126098632812 428.22283935546875 660.0955596923828 412.18507194519043Q675.0785095214844 396.1473045349121 696.7779541015625 395.11260986328125ZM346.7779541015625 295.11260986328125Q358.5921223958333 294.11260986328125 368.2582600911458 302.61659561960323Q377.9243977864583 311.1205813759252 377.9243977864583 322.8597604851974Q378.9984130859375 335.6661376953125 370.9741380479601 344.74284023708765Q362.94986300998266 353.8195427788628 350.11102294921875 354.88739013671875L354.88739013671875 350.0L350.0 345.11260986328125L345.11260986328125 350.0L349.88897705078125 354.88739013671875Q337.0691152719351 353.8207763671875 329.09086256760816 344.7545593261719Q321.11260986328125 335.6883422851563 322.11260986328125 322.88897705078125Q322.11260986328125 311.137437086839 331.767262425916 302.6250234750601Q341.42191498855067 294.11260986328125 353.2220458984375 295.11260986328125Q374.92149047851564 296.14813720703125 389.90444030761716 312.19881103515627Q404.88739013671875 328.2494848632813 404.88739013671875 349.99555908203126Q404.88739013671875 372.77716064453125 388.83671630859374 388.832275390625Q372.7860424804687 404.88739013671875 350.00444091796874 404.88739013671875Q327.22283935546875 404.88739013671875 311.167724609375 388.82927477037583Q295.11260986328125 372.7711594040329 295.11260986328125 349.97899565825594Q295.11260986328125 328.22283935546875 310.09555969238284 312.18507194519043Q325.07850952148436 296.1473045349121 346.7779541015625 295.11260986328125ZM296.7779541015625 495.11260986328125Q308.5921223958333 494.11260986328125 318.2582600911458 502.61659561960323Q327.9243977864583 511.12058137592516 327.9243977864583 522.8597604851973Q328.9984130859375 535.6661376953125 320.9741380479601 544.7428402370876Q312.94986300998266 553.8195427788628 300.11102294921875 554.8873901367188L304.88739013671875 550.0L300.0 545.1126098632812L295.11260986328125 550.0L299.88897705078125 554.8873901367188Q287.0691152719351 553.8207763671875 279.09086256760816 544.7545593261718Q271.11260986328125 535.6883422851563 272.11260986328125 522.8889770507812Q272.11260986328125 511.13743708683893 281.767262425916 502.62502347506006Q291.42191498855067 494.11260986328125 303.2220458984375 495.11260986328125Q324.92149047851564 496.14813720703125 339.90444030761716 512.1988110351563Q354.88739013671875 528.2494848632812 354.88739013671875 549.9955590820313Q354.88739013671875 572.7771606445312 338.83671630859374 588.832275390625Q322.7860424804687 604.8873901367188 300.00444091796874 604.8873901367188Q277.22283935546875 604.8873901367188 261.167724609375 588.8292747703758Q245.11260986328125 572.7711594040329 245.11260986328125 549.9789956582559Q245.11260986328125 528.2228393554688 260.09555969238284 512.1850719451904Q275.07850952148436 496.1473045349121 296.7779541015625 495.11260986328125Z`})})}function zz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M444.667724609375 124.55670166015625Q460.0378011067708 109.29024658203127 480.0189005533854 104.20142822265626Q500.0 99.11260986328125 519.9810994466145 104.20142822265626Q539.9621988932291 109.29024658203127 555.332275390625 124.55670166015625L830.332275390625 388.667724609375Q854.8873901367188 412.21490914481024 854.8873901367188 446.0V775.0Q854.8873901367188 796.5081434983474 844.133318387545 814.9436950683594Q833.3792466383713 833.3792466383713 815.4557937230819 844.133318387545Q797.5323408077925 854.8873901367188 775.0 854.8873901367188H600.0Q587.1911185128348 854.8873901367188 578.651864188058 846.348135811942Q570.1126098632812 837.8088814871652 570.1126098632812 825.0V600.0Q570.1126098632812 591.7721141468395 564.1702478582208 585.8297521417792Q558.2278858531605 579.8873901367188 550.0 579.8873901367188H450.0Q441.7721141468395 579.8873901367188 435.8297521417791 585.8297521417792Q429.88739013671875 591.7721141468395 429.88739013671875 600.0V825.0Q429.88739013671875 837.8088814871652 421.348135811942 846.348135811942Q412.8088814871652 854.8873901367188 400.0 854.8873901367188H225.0Q202.46765919220752 854.8873901367188 184.54420627691806 844.133318387545Q166.6207533616286 833.3792466383713 155.86668161245493 814.9436950683594Q145.11260986328125 796.5081434983474 145.11260986328125 775.0V446.0Q145.11260986328125 412.21490914481024 169.667724609375 388.667724609375ZM486.332275390625 167.332275390625 211.332275390625 432.332275390625Q204.88739013671875 437.79936523437505 204.88739013671875 446.0V775.0Q204.88739013671875 783.2278858531605 210.82975214177912 789.1702478582208Q216.7721141468395 795.1126098632812 225.0 795.1126098632812H400.0Q387.1911185128348 795.1126098632812 378.651864188058 803.651864188058Q370.11260986328125 812.1911185128348 370.11260986328125 825.0V600.0Q370.11260986328125 577.4676591922075 380.86668161245495 559.5442062769181Q391.6207533616286 541.6207533616287 409.5442062769181 530.866681612455Q427.4676591922075 520.1126098632812 450.0 520.1126098632812H550.0Q572.5323408077925 520.1126098632812 590.4557937230819 530.866681612455Q608.3792466383713 541.6207533616287 619.133318387545 559.5442062769181Q629.8873901367188 577.4676591922075 629.8873901367188 600.0V825.0Q629.8873901367188 812.1911185128348 621.348135811942 803.651864188058Q612.8088814871652 795.1126098632812 600.0 795.1126098632812H775.0Q783.2278858531605 795.1126098632812 789.1702478582208 789.1702478582208Q795.1126098632812 783.2278858531605 795.1126098632812 775.0V446.0Q795.1126098632812 437.79936523437505 788.7787475585938 432.332275390625L513.667724609375 167.332275390625Q508.19508361816406 161.88739013671875 499.98612213134766 161.88739013671875Q491.77716064453125 161.88739013671875 486.332275390625 167.332275390625Z`})})}function Bz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M470.11260986328125 725.0H529.8873901367188V875.0Q529.8873901367188 887.8088814871652 521.348135811942 896.348135811942Q512.8088814871652 904.8873901367188 500.0 904.8873901367188H325.0Q312.1911185128348 904.8873901367188 303.651864188058 896.3544799804688Q295.11260986328125 887.8215698242187 295.11260986328125 875.0222045898438Q295.11260986328125 862.2228393554688 303.651864188058 853.667724609375Q312.1911185128348 845.1126098632812 325.0 845.1126098632812H470.11260986328125ZM675.0 845.1126098632812Q687.7771606445312 845.1126098632812 696.332275390625 853.6455200195312Q704.8873901367188 862.1784301757813 704.8873901367188 874.9777954101562Q704.8873901367188 887.7771606445312 696.348135811942 896.332275390625Q687.8088814871652 904.8873901367188 675.0 904.8873901367188H500.0V845.1126098632812ZM654.8873901367188 225.0V450.0Q654.8873901367188 492.5181070963542 634.1306139823719 527.9498630099827Q613.3738378280249 563.3816189236111 577.9354395157252 584.1345045301649Q542.4970412034255 604.8873901367188 499.9709632286659 604.8873901367188Q457.44488525390625 604.8873901367188 422.0247984190245 584.1345045301649Q386.60471158414276 563.3816189236111 365.858660723712 527.9498630099827Q345.11260986328125 492.5181070963542 345.11260986328125 450.0V225.0Q345.11260986328125 182.48189290364587 365.86938601762824 147.0501369900174Q386.6261621719752 111.61838107638891 422.06456048427486 90.86549546983508Q457.50295879657455 70.11260986328125 500.0290367713341 70.11260986328125Q542.5551147460938 70.11260986328125 577.9752015809755 90.86549546983508Q613.3952884158573 111.61838107638891 634.141339276288 147.0501369900174Q654.8873901367188 182.48189290364587 654.8873901367188 225.0ZM595.1126098632812 225.0Q595.1126098632812 198.52535601743716 582.3686789235761 176.95342388349707Q569.624747983871 155.38149174955697 548.05809562437 142.63444094313786Q526.491443264869 129.88739013671875 500.02327900548136 129.88739013671875Q473.55511474609375 129.88739013671875 451.97382986886157 142.63444094313786Q430.39254499162945 155.38149174955697 417.63996756417407 176.95342388349707Q404.88739013671875 198.52535601743716 404.88739013671875 225.0V450.0Q404.88739013671875 476.47464398256284 417.6313210764239 498.04657611650293Q430.375252016129 519.618508250443 451.94190437563003 532.3655590568621Q473.50855673513104 545.1126098632812 499.97672099451864 545.1126098632812Q526.4448852539062 545.1126098632812 548.0261701311383 532.3655590568621Q569.6074550083705 519.618508250443 582.3600324358258 498.04657611650293Q595.1126098632812 476.47464398256284 595.1126098632812 450.0ZM195.11260986328125 425.0Q195.11260986328125 412.1911185128348 203.64552001953126 403.651864188058Q212.17843017578124 395.11260986328125 224.97779541015626 395.11260986328125Q237.77716064453125 395.11260986328125 246.332275390625 403.651864188058Q254.88739013671875 412.1911185128348 254.88739013671875 425.0V449.8265266418457Q254.88739013671875 500.47264099121094 273.74581724845325 545.1603889465332Q292.6042443601877 589.8481369018555 326.3509034022389 623.6122131347656Q360.0975624442901 657.3762893676758 404.76225823524015 676.2444496154785Q449.42695402619023 695.1126098632812 500.04694258926696 695.1126098632812Q550.6669311523438 695.1126098632812 595.3100716727121 676.2444496154785Q639.9532121930804 657.3762893676758 673.683585030692 623.6122131347656Q707.4139578683036 589.8481369018555 726.2632838657923 545.1603889465332Q745.1126098632812 500.47264099121094 745.1126098632812 449.8265266418457V425.0Q745.1126098632812 412.1911185128348 753.6455200195312 403.651864188058Q762.1784301757813 395.11260986328125 774.9777954101562 395.11260986328125Q787.7771606445312 395.11260986328125 796.332275390625 403.651864188058Q804.8873901367188 412.1911185128348 804.8873901367188 425.0V450.14385595554256Q804.8873901367188 513.5063729635099 781.244819682804 568.8228560657036Q757.6022492288891 624.1393391678973 715.8504758741035 665.878140054098Q674.0987025193178 707.6169409402987 618.765026988879 731.2521655385087Q563.4313514584401 754.8873901367188 500.0491413053919 754.8873901367188Q436.66693115234375 754.8873901367188 381.3107325236002 731.2521655385087Q325.95453389485675 707.6169409402987 284.18576583862307 665.878140054098Q242.41699778238933 624.1393391678973 218.7648038228353 568.8228560657036Q195.11260986328125 513.5063729635099 195.11260986328125 450.14385595554256Z`})})}function Vz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M470.11260986328125 225.0Q470.11260986328125 212.1911185128348 478.64552001953126 203.65186418805803Q487.1784301757813 195.11260986328125 499.97779541015626 195.11260986328125Q512.7771606445312 195.11260986328125 521.332275390625 203.65186418805803Q529.8873901367188 212.1911185128348 529.8873901367188 225.0V775.0Q529.8873901367188 787.8088814871652 521.3544799804688 796.348135811942Q512.8215698242187 804.8873901367188 500.02220458984374 804.8873901367188Q487.22283935546875 804.8873901367188 478.667724609375 796.348135811942Q470.11260986328125 787.8088814871652 470.11260986328125 775.0ZM775.0 470.11260986328125Q787.8088814871652 470.11260986328125 796.348135811942 478.64552001953126Q804.8873901367188 487.1784301757813 804.8873901367188 499.97779541015626Q804.8873901367188 512.7771606445312 796.348135811942 521.332275390625Q787.8088814871652 529.8873901367188 775.0 529.8873901367188H225.0Q212.19111851283483 529.8873901367188 203.65186418805803 521.3544799804688Q195.11260986328125 512.8215698242187 195.11260986328125 500.02220458984374Q195.11260986328125 487.22283935546875 203.65186418805803 478.667724609375Q212.19111851283483 470.11260986328125 225.0 470.11260986328125Z`})})}function Hz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M225.0 304.88739013671875Q212.19111851283483 304.88739013671875 203.65186418805803 296.35447998046874Q195.11260986328125 287.8215698242187 195.11260986328125 275.0222045898438Q195.11260986328125 262.22283935546875 203.65186418805803 253.667724609375Q212.19111851283483 245.11260986328125 225.0 245.11260986328125H775.0Q787.8088814871652 245.11260986328125 796.348135811942 253.64552001953126Q804.8873901367188 262.1784301757813 804.8873901367188 274.9777954101562Q804.8873901367188 287.77716064453125 796.348135811942 296.332275390625Q787.8088814871652 304.88739013671875 775.0 304.88739013671875ZM300.0 154.88739013671875Q287.1911185128348 154.88739013671875 278.651864188058 146.35447998046874Q270.11260986328125 137.82156982421873 270.11260986328125 125.0222045898438Q270.11260986328125 112.22283935546875 278.651864188058 103.667724609375Q287.1911185128348 95.11260986328125 300.0 95.11260986328125H700.0Q712.8088814871652 95.11260986328125 721.348135811942 103.64552001953126Q729.8873901367188 112.17843017578127 729.8873901367188 124.9777954101562Q729.8873901367188 137.77716064453125 721.348135811942 146.332275390625Q712.8088814871652 154.88739013671875 700.0 154.88739013671875ZM209.0 395.11260986328125H791.0Q815.588277445211 395.11260986328125 835.0539970893365 408.4298182896205Q854.5197167334619 421.7470267159598 864.2035534350903 442.7472400036487Q873.8873901367188 463.7474532913376 869.8873901367188 488.33306884765625L811.7763671875 838.3330688476562Q806.6610186688312 867.0026226337139 784.1534851866884 885.9450063852164Q761.6459517045455 904.8873901367188 733.0 904.8873901367188H267.0Q238.35404829545453 904.8873901367188 215.84651481331167 885.9450063852164Q193.33898133116884 867.0026226337139 188.2236328125 838.3330688476562L130.11260986328125 488.33306884765625Q126.11260986328125 463.7474532913376 135.7964465649097 442.7472400036487Q145.48028326653815 421.7470267159598 164.94600291066354 408.4298182896205Q184.41172255478895 395.11260986328125 209.0 395.11260986328125ZM209.0 454.88739013671875Q199.85790460759944 454.88739013671875 193.8726473721591 462.2041719876803Q187.88739013671875 469.52095383864184 188.88739013671875 478.66693115234375L247.7763671875 828.6669311523438Q248.69177827380952 835.9761216905382 254.18424479166666 840.5443657769097Q259.6767113095238 845.1126098632812 267.0 845.1126098632812H733.0Q740.3232886904761 845.1126098632812 745.8157552083333 840.5443657769097Q751.3082217261905 835.9761216905382 752.2236328125 828.6669311523438L811.1126098632812 478.66693115234375Q812.1126098632812 469.52095383864184 806.127352627841 462.2041719876803Q800.1420953924006 454.88739013671875 791.0 454.88739013671875Z`})})}function Uz(e){return(0,H.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...e,children:[(0,H.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`}),(0,H.jsx)(`line`,{x1:`8`,y1:`8`,x2:`10`,y2:`9`}),(0,H.jsx)(`line`,{x1:`8`,y1:`8`,x2:`8`,y2:`5.5`})]})}function Wz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M754.8873901367188 425.0584777366114Q754.8873901367188 490.444091796875 729.7390770366173 551.276105293303Q704.5907639365159 612.108118789731 658.3178678323294 658.3605588035439Q612.0449717281429 704.6129988173568 551.1860540258975 729.7501944770378Q490.3271363236522 754.8873901367188 424.9415222633886 754.8873901367188Q359.555908203125 754.8873901367188 298.7238947066971 729.7390770366173Q237.89188121026913 704.5907639365159 191.63944119645615 658.3178678323295Q145.3870011826432 612.0449717281429 120.24980552296222 551.1860540258975Q95.11260986328125 490.3271363236522 95.11260986328125 424.9415222633886Q95.11260986328125 359.555908203125 120.26092296338264 298.7238947066971Q145.40923606348403 237.89188121026916 191.68213216767057 191.63944119645612Q237.95502827185712 145.3870011826432 298.81394597410247 120.24980552296222Q359.6728636763478 95.11260986328125 425.0584777366114 95.11260986328125Q490.444091796875 95.11260986328125 551.2761052933029 120.26092296338265Q612.1081187897308 145.40923606348406 658.3605588035439 191.6821321676706Q704.6129988173568 237.95502827185715 729.7501944770378 298.81394597410247Q754.8873901367188 359.6728636763478 754.8873901367188 425.0584777366114ZM695.1126098632812 424.96526275821986Q695.1126098632812 371.33306884765625 674.2556455647286 321.6895645561568Q653.3986812661761 272.0460602646574 615.6575077735573 234.31699700311788Q577.9163342809385 196.58793374157824 528.256895474861 175.7376619391485Q478.59745666878354 154.88739013671875 424.9652627582199 154.88739013671875Q371.33306884765625 154.88739013671875 321.6895645561568 175.7443544352713Q272.0460602646574 196.60131873382386 234.31699700311782 234.3424922264427Q196.58793374157827 272.0836657190615 175.7376619391485 321.74310452513896Q154.88739013671875 371.4025433312164 154.88739013671875 425.03473724178014Q154.88739013671875 478.66693115234375 175.74435443527128 528.3104354438432Q196.6013187338238 577.9539397353426 234.3424922264427 615.6830029968821Q272.0836657190615 653.4120662584218 321.74310452513896 674.2623380608516Q371.40254333121646 695.1126098632812 425.0347372417801 695.1126098632812Q478.66693115234375 695.1126098632812 528.3104354438432 674.2556455647288Q577.9539397353426 653.3986812661763 615.6830029968821 615.6575077735573Q653.4120662584218 577.9163342809385 674.2623380608516 528.256895474861Q695.1126098632812 478.5974566687836 695.1126098632812 424.96526275821986ZM616.667724609375 658.332275390625 658.332275390625 616.667724609375 896.332275390625 853.667724609375Q904.8873901367188 862.1950836181641 904.8873901367188 874.9861221313477Q904.8873901367188 887.7771606445312 896.3544799804688 896.332275390625Q887.8215698242187 904.8873901367188 875.0222045898438 904.8873901367188Q862.2228393554688 904.8873901367188 853.667724609375 896.332275390625Z`})})}function Gz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M295.11260986328125 175.0H354.88739013671875V825.0H295.11260986328125ZM175.0 145.11260986328125H825.0Q847.5323408077925 145.11260986328125 865.4557937230819 155.86668161245495Q883.3792466383713 166.62075336162866 894.133318387545 184.5442062769181Q904.8873901367188 202.46765919220752 904.8873901367188 225.0V775.0Q904.8873901367188 797.5323408077925 894.133318387545 815.4557937230819Q883.3792466383713 833.3792466383713 865.4557937230819 844.133318387545Q847.5323408077925 854.8873901367188 825.0 854.8873901367188H175.0Q152.46765919220752 854.8873901367188 134.54420627691806 844.133318387545Q116.6207533616286 833.3792466383713 105.86668161245493 815.4557937230819Q95.11260986328125 797.5323408077925 95.11260986328125 775.0V225.0Q95.11260986328125 202.46765919220752 105.86668161245493 184.5442062769181Q116.6207533616286 166.62075336162866 134.54420627691806 155.86668161245495Q152.46765919220752 145.11260986328125 175.0 145.11260986328125ZM175.0 204.88739013671875Q166.7721141468395 204.88739013671875 160.82975214177912 210.82975214177912Q154.88739013671875 216.7721141468395 154.88739013671875 225.0V775.0Q154.88739013671875 783.2278858531605 160.82975214177912 789.1702478582208Q166.7721141468395 795.1126098632812 175.0 795.1126098632812H825.0Q833.2278858531605 795.1126098632812 839.1702478582208 789.1702478582208Q845.1126098632812 783.2278858531605 845.1126098632812 775.0V225.0Q845.1126098632812 216.7721141468395 839.1702478582208 210.82975214177912Q833.2278858531605 204.88739013671875 825.0 204.88739013671875Z`})})}var Kz=`"Anthropic Sans", ui-sans-serif, system-ui, sans-serif`,qz={light:{"--shell-surface":`#faf9f5`,"--shell-sidebar":`#fbfbf9`,"--shell-card":`#ffffff`,"--shell-panel":`#ffffff`,"--shell-text":`#141413`,"--shell-text-secondary":`#3d3d3a`,"--shell-text-tertiary":`#73726c`,"--shell-nav-text":`#52514e`,"--shell-icon-muted":`#898781`,"--shell-segment-bg":`#edece8`,"--shell-segment-active":`#f9f9f7`,"--shell-btn-bg":`#f3f3f3`,"--shell-border":`rgba(31, 30, 29, 0.08)`,"--shell-composer-border":`rgba(31, 30, 29, 0.08)`,"--shell-accent":`#d97757`},dark:{"--shell-surface":`#1a1a19`,"--shell-sidebar":`#1a1a19`,"--shell-card":`#383835`,"--shell-panel":`#383835`,"--shell-text":`#faf9f5`,"--shell-text-secondary":`#c2c0b6`,"--shell-text-tertiary":`#9c9a92`,"--shell-nav-text":`#c2c0b6`,"--shell-icon-muted":`#9c9a92`,"--shell-segment-bg":`#3a3a38`,"--shell-segment-active":`#4a4a47`,"--shell-btn-bg":`#3a3a38`,"--shell-border":`rgba(222, 220, 209, 0.1)`,"--shell-composer-border":`transparent`,"--shell-accent":`#d97757`}};function Jz({className:e}){return(0,H.jsx)(`div`,{className:lN(`rounded-md bg-[color-mix(in_oklab,var(--shell-text)_10%,transparent)] motion-safe:animate-pulse`,e)})}function Yz(){return(0,H.jsxs)(`div`,{"aria-hidden":!0,className:`flex h-12 shrink-0 cursor-not-allowed items-center gap-2.5 px-3`,children:[(0,H.jsx)(Gz,{className:`size-4.5 text-[#7b7974]`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(Jz,{className:`h-3.5 w-24`}),(0,H.jsx)(Nz,{className:`size-2.5 text-(--shell-text-tertiary)`})]}),(0,H.jsx)(`div`,{className:`ml-auto flex h-7 items-center rounded-[7px] bg-(--shell-btn-bg) px-3 text-(--shell-text) text-sm`,children:`Share`})]})}function Xz(){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex min-h-[100px] flex-col justify-between rounded-[20px] bg-(--shell-card) p-3 shadow-[0_4px_20px_rgba(0,0,0,0.05)]`,children:[(0,H.jsx)(`span`,{className:`px-1.5 pt-1 text-[15px] text-(--shell-text-tertiary)`,children:`Write a message...`}),(0,H.jsxs)(`div`,{className:`flex items-center px-1 pb-0.5 text-(--shell-text-secondary)`,children:[(0,H.jsx)(Vz,{className:`size-5`}),(0,H.jsx)(`div`,{className:`flex-1`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(Jz,{className:`h-3.5 w-14`}),(0,H.jsx)(Jz,{className:`h-3.5 w-9`}),(0,H.jsx)(Nz,{className:`size-3`})]}),(0,H.jsx)(`div`,{className:`flex-1`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Bz,{className:`size-5`}),(0,H.jsx)(`div`,{className:`flex size-8 items-center justify-center rounded-lg bg-(--shell-accent) text-white`,children:(0,H.jsx)(Wr,{className:`size-4.5`})})]})]})]}),(0,H.jsx)(`div`,{className:`pt-1.5 pb-1 text-center text-(--shell-text-tertiary) text-xs`,children:`Claude can make mistakes. Please double-check responses.`})]})}function Zz(){return(0,H.jsxs)(`div`,{className:`flex min-h-[100px] flex-col justify-between rounded-[20px] border border-(--shell-composer-border) bg-(--shell-card) p-4 shadow-[0_4px_16px_rgba(0,0,0,0.04)]`,children:[(0,H.jsx)(`span`,{className:`text-(--shell-text-tertiary)`,children:`Reply to Claude...`}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(Vz,{className:`size-5 text-(--shell-text-secondary)`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-4 text-(--shell-text-secondary)`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(Jz,{className:`h-3.5 w-14`}),(0,H.jsx)(Jz,{className:`h-3.5 w-9`}),(0,H.jsx)(Nz,{className:`size-3`})]}),(0,H.jsx)(Bz,{className:`size-5`}),(0,H.jsx)(Pz,{className:`size-5`})]})]})]})}var Qz=[`w-[80%]`,`w-[65%]`,`w-[74%]`,`w-[58%]`,`w-[70%]`,`w-[62%]`];function $z({children:e}){let t=ds(e=>e.theme),n=ds(e=>e.displayMode),r=ds(e=>e.setPreference),i=ms(),a=n===`fullscreen`,[o,s]=(0,b.useState)(!1),c=(0,b.useRef)(null),l=(0,b.useRef)(null);return(0,b.useEffect)(()=>{let e=c.current,t=l.current;if(!e||!t)return;let n=()=>{e.scrollTop=e.scrollHeight};n();let r=new ResizeObserver(n);r.observe(t);let i=()=>r.disconnect(),a=[`wheel`,`touchstart`,`pointerdown`];for(let t of a)e.addEventListener(t,i,{once:!0,passive:!0});return()=>{r.disconnect();for(let t of a)e.removeEventListener(t,i)}},[]),(0,H.jsxs)(`div`,{className:`@container/shell relative isolate flex h-full w-full overflow-hidden bg-(--shell-surface) text-(--shell-text)`,style:{fontFamily:Kz,...qz[t]},children:[(0,H.jsx)(`style`,{children:cz}),(0,H.jsx)(`aside`,{"aria-hidden":!0,className:lN(`h-full w-[288px] shrink-0 cursor-not-allowed border-(--shell-border) border-r bg-(--shell-sidebar) @max-[640px]/shell:hidden`,(o||i)&&`hidden`),children:(0,H.jsxs)(`div`,{className:`flex h-full flex-col px-2 pb-2`,children:[(0,H.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center justify-between px-2`,children:[(0,H.jsx)(Fz,{className:`h-5`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1 text-[#7b7974]`,children:[(0,H.jsx)(`button`,{type:`button`,"aria-label":`Collapse sidebar`,onClick:()=>s(!0),className:`flex size-7 cursor-pointer items-center justify-center rounded-md transition-colors hover:bg-[color-mix(in_oklab,var(--shell-text)_5%,transparent)]`,children:(0,H.jsx)(Gz,{className:`size-4`})}),(0,H.jsx)(`div`,{className:`flex size-7 items-center justify-center`,children:(0,H.jsx)(Wz,{className:`size-4`})})]})]}),(0,H.jsxs)(`div`,{className:`mb-2 flex h-8 shrink-0 rounded-lg bg-(--shell-segment-bg) p-px`,children:[(0,H.jsxs)(`div`,{className:`flex flex-[1.1] items-center justify-center gap-1.5 rounded-[7px] bg-(--shell-segment-active) text-(--shell-text) text-sm shadow-[inset_0_0_0_0.5px_rgba(11,11,11,0.1),0_1px_2px_rgba(0,0,0,0.06),0_2px_6px_-1px_rgba(0,0,0,0.05)]`,children:[(0,H.jsx)(zz,{className:`size-4`}),(0,H.jsx)(`span`,{children:`Home`})]}),(0,H.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-1.5 text-(--shell-text-tertiary) text-sm`,children:[(0,H.jsx)(Iz,{className:`size-4`}),(0,H.jsx)(`span`,{children:`Code`})]})]}),(0,H.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 rounded-lg px-1.5 text-(--shell-nav-text) text-sm`,children:[(0,H.jsx)(Vz,{className:`size-4`}),(0,H.jsx)(`span`,{children:`New`})]}),[{icon:Mz,label:`Chats and tasks`},{icon:Hz,label:`Projects`},{icon:Az,label:`Artifacts`},{icon:Uz,label:`Scheduled`},{icon:Lz,label:`Customize`}].map(({icon:e,label:t})=>(0,H.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 px-1.5 text-(--shell-nav-text) text-sm`,children:[(0,H.jsx)(e,{className:`size-5`}),(0,H.jsx)(`span`,{children:t})]},t)),(0,H.jsx)(`div`,{className:`mt-5 mb-1 px-1.5 text-(--shell-text-tertiary) text-xs`,children:`Pinned`}),(0,H.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 px-1.5`,children:[(0,H.jsx)(jz,{className:`size-5 shrink-0 text-(--shell-icon-muted)`}),(0,H.jsx)(Jz,{className:`h-3.5 w-32`})]}),(0,H.jsxs)(`div`,{className:`mt-5 mb-1 flex items-center justify-between px-1.5`,children:[(0,H.jsx)(`span`,{className:`text-(--shell-text-tertiary) text-xs`,children:`Recents`}),(0,H.jsx)(Ci,{className:`size-3.5 text-(--shell-text-tertiary)`})]}),Qz.map(e=>(0,H.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 px-1.5`,children:[(0,H.jsx)(jz,{className:`size-5 shrink-0 text-(--shell-icon-muted)`}),(0,H.jsx)(Jz,{className:lN(`h-3.5`,e)})]},e)),(0,H.jsxs)(`div`,{className:`mt-auto flex shrink-0 flex-col`,children:[(0,H.jsxs)(`div`,{className:`flex h-10 items-center gap-2.5 border-(--shell-border) border-t px-1.5 text-(--shell-nav-text) text-sm`,children:[(0,H.jsx)(Rz,{className:`size-5`}),(0,H.jsx)(`span`,{children:`Design`})]}),(0,H.jsxs)(`div`,{className:`flex h-11 items-center gap-2.5 border-(--shell-border) border-t px-1.5`,children:[(0,H.jsx)(Jz,{className:`size-7 rounded-full`}),(0,H.jsx)(Jz,{className:`h-3.5 w-24`})]})]})]})}),(0,H.jsxs)(`div`,{className:`relative flex h-full min-w-0 flex-1 flex-col`,children:[i&&!a&&(0,H.jsx)(Yz,{}),o&&!i&&(0,H.jsx)(`button`,{type:`button`,"aria-label":`Expand sidebar`,onClick:()=>s(!1),className:`absolute top-2 left-2 z-40 flex size-8 cursor-pointer items-center justify-center rounded-md text-[#7b7974] transition-colors hover:bg-[color-mix(in_oklab,var(--shell-text)_5%,transparent)]`,children:(0,H.jsx)(Gz,{className:`size-4`})}),(0,H.jsx)(`div`,{ref:c,className:`min-h-0 flex-1 overflow-y-auto [container-type:size]`,children:(0,H.jsxs)(`div`,{ref:l,className:lN(`mx-auto flex w-full max-w-[720px] flex-col px-4 pt-6 pb-24`,a&&`h-full max-w-none px-5 pt-2 pb-4`,a&&o&&!i&&`pl-12`),children:[[[`w-[92%]`,`w-[80%]`,`w-[55%]`],[`w-[88%]`,`w-[76%]`,`w-[50%]`]].map((e,t)=>(0,H.jsxs)(`div`,{className:lN(`flex flex-col`,a&&`hidden`,t>0&&`mt-10`),children:[(0,H.jsx)(`div`,{className:`h-16 w-[55%] self-end rounded-xl bg-[color-mix(in_oklab,var(--shell-text)_5%,transparent)] motion-safe:animate-pulse`}),(0,H.jsx)(`div`,{className:`mt-6 flex flex-col gap-3`,children:e.map(e=>(0,H.jsx)(Jz,{className:lN(`h-4`,e)},e))})]},e[0])),(0,H.jsx)(`div`,{className:lN(`mt-10 h-12 w-[45%] self-end rounded-xl bg-[color-mix(in_oklab,var(--shell-text)_5%,transparent)] motion-safe:animate-pulse`,a&&`hidden`)}),(0,H.jsx)(Jz,{className:lN(`mt-6 h-4 w-40`,a&&`hidden`)}),(0,H.jsxs)(`div`,{className:lN(`relative mt-3 w-full`,!a&&!i&&`-mx-4 w-[calc(100%+2rem)]`,a&&`mt-0 flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border border-(--shell-border) bg-(--shell-panel)`),children:[a?(0,H.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-2.5 border-(--shell-border) border-b px-4`,children:[(0,H.jsx)(`div`,{className:`flex size-7 items-center justify-center rounded-lg border border-(--shell-border) bg-(--shell-segment-active)`,children:(0,H.jsx)(Jz,{className:`size-3.5 rounded`})}),(0,H.jsx)(Jz,{className:`h-4 w-44`}),(0,H.jsx)(`button`,{type:`button`,"aria-label":`Exit fullscreen`,onClick:()=>r(`displayMode`,`inline`),className:`ml-auto flex size-8 cursor-pointer items-center justify-center rounded-lg bg-(--shell-btn-bg) text-(--shell-text) transition-colors hover:bg-[color-mix(in_oklab,var(--shell-text)_10%,transparent)]`,children:(0,H.jsx)(Cz,{className:`size-4.5`})})]}):null,(0,H.jsx)(`div`,{className:lN(`w-full`,a&&`min-h-0 flex-1`),children:e??(0,H.jsx)(Jz,{className:`h-96 w-full rounded-2xl`})}),a&&!i?(0,H.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-4 mx-auto w-[min(680px,85%)]`,children:(0,H.jsxs)(`div`,{className:`flex min-h-[100px] flex-col justify-between rounded-[20px] border border-(--shell-composer-border) bg-(--shell-card) p-4 shadow-[0_4px_16px_rgba(0,0,0,0.08)]`,children:[(0,H.jsx)(`span`,{className:`text-(--shell-text-tertiary)`,children:`Write a message...`}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(Vz,{className:`size-5 text-(--shell-text-secondary)`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-4 text-(--shell-text-secondary)`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(Jz,{className:`h-3.5 w-14`}),(0,H.jsx)(Jz,{className:`h-3.5 w-9`}),(0,H.jsx)(Nz,{className:`size-3`})]}),(0,H.jsx)(Bz,{className:`size-5`}),(0,H.jsx)(Pz,{className:`size-5`})]})]})]})}):null]}),(0,H.jsxs)(`div`,{className:lN(`mt-6 flex flex-col gap-3`,a&&`hidden`),children:[(0,H.jsx)(Jz,{className:`h-4 w-[95%]`}),(0,H.jsx)(Jz,{className:`h-4 w-[60%]`})]})]})}),(0,H.jsx)(`div`,{className:lN(`w-full shrink-0 cursor-not-allowed`,i?`px-2 pb-1`:`px-4 pb-5`,a&&`hidden`),children:(0,H.jsx)(`div`,{className:`mx-auto w-full max-w-[768px]`,children:i?(0,H.jsx)(Xz,{}):(0,H.jsx)(Zz,{})})})]})]})}var eB=24,tB=44,nB={light:{backdrop:`#e8e8e6`,label:`#6f6f6f`},dark:{backdrop:`#111110`,label:`#8f8f8f`}},rB=({theme:e,children:t})=>{let n=(0,b.useRef)(null),[r,i]=(0,b.useState)(1);return(0,b.useLayoutEffect)(()=>{let e=n.current;if(!e)return;let t=()=>{let{width:t,height:n}=e.getBoundingClientRect();i(Math.min(1,(t-eB)/mN.width,(n-tB)/mN.height))};t();let r=new ResizeObserver(t);return r.observe(e),()=>r.disconnect()},[]),(0,H.jsxs)(`div`,{ref:n,className:`flex h-full min-h-0 w-full flex-col items-center justify-center overflow-hidden`,style:{backgroundColor:nB[e].backdrop},children:[(0,H.jsxs)(`div`,{className:`pb-1.5 font-mono text-xs`,style:{color:nB[e].label},children:[mN.width,` × `,mN.height]}),(0,H.jsx)(`div`,{style:{width:mN.width*r,height:mN.height*r},children:(0,H.jsx)(`div`,{className:`overflow-hidden shadow-[0_2px_16px_rgba(0,0,0,0.2)]`,style:{width:mN.width,height:mN.height,transform:`scale(${r})`,transformOrigin:`top left`},children:t})})]})},iB=()=>{let e=ZD(),t=xD(e?.name??``),n=ds(e=>e.previewClient),r=ds(e=>e.theme),i=ms(),a=e?._meta?.ui?.resourceUri,o=!!(e&&t?.response&&a),s=(0,H.jsx)(n===`claude`?$z:kz,{children:o?(0,H.jsx)(b.Suspense,{fallback:null,children:(0,H.jsx)(gz,{})}):null});return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 w-full flex-col`,children:[(0,H.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center gap-3 bg-primary px-3 text-primary-foreground`,children:[(0,H.jsx)(`span`,{className:`font-medium text-xs`,children:`Preview mode`}),(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,H.jsx)(iz,{variant:`preview`})})]}),(0,H.jsx)(`div`,{className:`min-h-0 flex-1`,children:i?(0,H.jsx)(rB,{theme:r,children:s}):s})]})},aB=function(e){return function(t,n){var r=(0,b.useRef)(!1);e(function(){return function(){r.current=!1}},[]),e(function(){if(!r.current)r.current=!0;else return t()},n)}},oB=function(e){return typeof e==`function`},sB=function(e){return typeof e==`string`},cB=function(e){return typeof e==`number`},lB=function(e){return e===void 0},uB=function(e){var t=(0,b.useRef)(e);t.current=(0,b.useMemo)(function(){return e},[e]);var n=(0,b.useRef)(void 0);return n.current||=function(){var e=[...arguments];return t.current.apply(this,e)},n.current},dB=aB(b.useEffect);function fB(e,t){if(e===t)return!0;for(var n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function pB(e){var t=(0,b.useRef)(e);return t.current=e,t}var mB=function(e){var t=pB(e);(0,b.useEffect)(function(){return function(){t.current()}},[])},hB=!!(typeof window<`u`&&window.document&&window.document.createElement);function gB(e,t){if(hB)return e?oB(e)?e():`current`in e?e.current:e:t}var _B=function(e){return function(t,n,r){var i=(0,b.useRef)(!1),a=(0,b.useRef)([]),o=(0,b.useRef)([]),s=(0,b.useRef)(void 0);e(function(){var e,c=(Array.isArray(r)?r:[r]).map(function(e){return gB(e)});if(!i.current){i.current=!0,a.current=c,o.current=n,s.current=t();return}(c.length!==a.current.length||!fB(a.current,c)||!fB(o.current,n))&&((e=s.current)==null||e.call(s),a.current=c,o.current=n,s.current=t())}),mB(function(){var e;(e=s.current)==null||e.call(s),i.current=!1})}}(b.useEffect),vB=u(s(((e,t)=>{var n=typeof Element<`u`,r=typeof Map==`function`,i=typeof Set==`function`,a=typeof ArrayBuffer==`function`&&!!ArrayBuffer.isView;function o(e,t){if(e===t)return!0;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(e.constructor!==t.constructor)return!1;var s,c,l;if(Array.isArray(e)){if(s=e.length,s!=t.length)return!1;for(c=s;c--!==0;)if(!o(e[c],t[c]))return!1;return!0}var u;if(r&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!t.has(c.value[0]))return!1;for(u=e.entries();!(c=u.next()).done;)if(!o(c.value[1],t.get(c.value[0])))return!1;return!0}if(i&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!t.has(c.value[0]))return!1;return!0}if(a&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(s=e.length,s!=t.length)return!1;for(c=s;c--!==0;)if(e[c]!==t[c])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf==`function`&&typeof t.valueOf==`function`)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString==`function`&&typeof t.toString==`function`)return e.toString()===t.toString();if(l=Object.keys(e),s=l.length,s!==Object.keys(t).length)return!1;for(c=s;c--!==0;)if(!Object.prototype.hasOwnProperty.call(t,l[c]))return!1;if(n&&e instanceof Element)return!1;for(c=s;c--!==0;)if(!((l[c]===`_owner`||l[c]===`__v`||l[c]===`__o`)&&e.$$typeof)&&!o(e[l[c]],t[l[c]]))return!1;return!0}return e!==e&&t!==t}t.exports=function(e,t){try{return o(e,t)}catch(e){if((e.message||``).match(/stack|recursion/i))return console.warn(`react-fast-compare cannot handle circular refs`),!1;throw e}}}))()),yB=function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=[]),(0,vB.default)(e,t)};function bB(e,t,n){n===void 0&&(n={});var r=n.enable,i=r===void 0||r,a=pB(t);_B(function(){if(i){var t=gB(n.target,window);if(t?.addEventListener){var r=function(e){return a.current(e)},o=Array.isArray(e)?e:[e];return o.forEach(function(e){t.addEventListener(e,r,{capture:n.capture,once:n.once,passive:n.passive})}),function(){o.forEach(function(e){t.removeEventListener(e,r,{capture:n.capture})})}}}},[e,n.capture,n.once,n.passive,i],n.target)}var xB=function(e,t,n){var r=(0,b.useRef)(void 0),i=(0,b.useRef)(0);yB(t,r.current)||(i.current+=1),r.current=t,_B(e,[i.current],n)},SB={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,backspace:8,tab:9,enter:13,shift:16,ctrl:17,control:17,alt:18,pausebreak:19,pause:19,capslock:20,esc:27,escape:27,space:32,spacebar:32,pageup:33,pagedown:34,end:35,home:36,leftarrow:37,arrowleft:37,uparrow:38,arrowup:38,rightarrow:39,arrowright:39,downarrow:40,arrowdown:40,insert:45,delete:46,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftwindowkey:91,rightwindowkey:92,meta:/(mac|iphone|ipod|ipad)/i.test(typeof navigator<`u`?navigator==null?void 0:navigator.platform:``)?[91,93]:[91,92],selectkey:93,contextmenu:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,multiply:106,add:107,subtract:109,decimalpoint:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,semicolon:186,equalsign:187,comma:188,dash:189,period:190,forwardslash:191,graveaccent:192,openbracket:219,backslash:220,closebracket:221,singlequote:222},CB={ctrl:function(e){return e.ctrlKey},shift:function(e){return e.shiftKey},alt:function(e){return e.altKey},meta:function(e){return e.type===`keyup`?SB.meta.includes(e.keyCode):e.metaKey}};function wB(e){return sB(e)||cB(e)}function TB(e){var t=Object.keys(CB).reduce(function(t,n){return CB[n](e)?t+1:t},0);return[16,17,18,91,92].includes(e.keyCode)?t:t+1}function EB(e,t,n){var r,i;if(!e.key)return!1;if(cB(t))return e.keyCode===t&&t;var a=t.split(`.`),o=0;try{for(var s=vj(a),c=s.next();!c.done;c=s.next()){var l=c.value,u=CB[l],d=SB[l.toLowerCase()];(u&&u(e)||d&&d===e.keyCode)&&o++}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return n?o===a.length&&TB(e)===a.length&&t:o===a.length&&t}function DB(e,t){return oB(e)?e:wB(e)?function(n){return EB(n,e,t)}:Array.isArray(e)?function(n){return e.find(function(e){return EB(n,e,t)})}:function(){return!!e}}var OB=[`keydown`];function kB(e,t,n){var r=n||{},i=r.events,a=i===void 0?OB:i,o=r.target,s=r.exactMatch,c=s!==void 0&&s,l=r.useCapture,u=l!==void 0&&l,d=pB(t),f=pB(e);xB(function(){var e,t,n,r=gB(o,window);if(r){var i=function(e){var t=e,n=DB(f.current,c)(t),r=wB(n)?n:t.key;if(n)return d.current?.call(d,t,r)};try{for(var s=vj(a),l=s.next();!l.done;l=s.next()){var p=l.value;(n=r?.addEventListener)==null||n.call(r,p,i,u)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return function(){var e,t,n;try{for(var o=vj(a),s=o.next();!s.done;s=o.next()){var c=s.value;(n=r?.removeEventListener)==null||n.call(r,c,i,u)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}}},[a],o)}var AB=`AHOOKS_SYNC_STORAGE_EVENT_NAME`,jB=function(e){return function(t,n){n===void 0&&(n={});var r,i=n.listenStorageChange,a=i!==void 0&&i,o=oB(n.serializer)?n.serializer:JSON.stringify,s=oB(n.deserializer)?n.deserializer:JSON.parse,c=oB(n.onError)?n.onError:console.error;try{r=e()}catch(e){c(e)}var l=function(){try{var e=r?.getItem(t);if(e)return s(e)}catch(e){c(e)}return oB(n.defaultValue)?n.defaultValue():n.defaultValue},u=yj((0,b.useState)(l),2),d=u[0],f=u[1],p=(0,b.useRef)(d);p.current=d,dB(function(){var e=l();Object.is(e,p.current)||(p.current=e,f(e))},[t]);var m=function(e){var n=p.current,i=oB(e)?e(n):e;if(!Object.is(i,n)){a||(p.current=i,f(i));try{var s=void 0,l=r?.getItem(t);lB(i)?(s=null,r?.removeItem(t)):(s=o(i),r?.setItem(t,s)),dispatchEvent(new CustomEvent(AB,{detail:{key:t,newValue:s,oldValue:l,storageArea:r}}))}catch(e){c(e)}}},h=function(e){if(!(e.key!==t||e.storageArea!==r)){var n=l();Object.is(n,p.current)||(p.current=n,f(n))}};return bB(`storage`,h,{enable:a}),bB(AB,function(e){h(e.detail)},{enable:a}),[d,uB(m)]}}(function(){return hB?localStorage:void 0}),MB=function(e,t){var n=uB(e),r=(0,b.useRef)(null),i=(0,b.useCallback)(function(){r.current&&clearTimeout(r.current)},[]);return(0,b.useEffect)(function(){if(!(!cB(t)||t<0))return r.current=setTimeout(n,t),i},[t]),i},NB=Ni(`inline-flex items-center justify-center rounded-full border font-medium whitespace-nowrap shrink-0 [&>svg]:shrink-0 [&>svg]:pointer-events-none`,{variants:{variant:{secondary:`border-border bg-background text-muted-foreground`,primary:`border-transparent bg-primary text-primary-foreground`,success:`border-badge-success/30 bg-badge-success/10 text-badge-success`,warning:`border-badge-warning/30 bg-badge-warning/10 text-badge-warning`,error:`border-badge-error/30 bg-badge-error/10 text-badge-error`},size:{sm:`px-1.5 py-px gap-0.5 type-text-xs [&>svg]:size-2.5`,md:`px-[9px] py-0.5 gap-1 type-text-sm [&>svg]:size-3`}},defaultVariants:{variant:`secondary`,size:`md`}});function PB({className:e,variant:t,size:n,children:r,...i}){return(0,H.jsx)(`span`,{className:Mr(NB({variant:t,size:n}),e),...i,children:r})}var FB=new Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:1}),IB=e=>`skybridge-devtools-dismissed-${e}-warning`,LB={"tool-output":{badge:`Large response`,title:`Large model-visible output`,description:`Content and structured content count toward this estimate. Large responses can consume significant context or exceed limits in some clients and models.`},"view-state":{badge:`Large context`,title:`Large model-visible view state`,description:`Persisted view state and data-llm context count toward this estimate. Keep only content the model needs.`}};function RB({kind:e}){return(0,H.jsx)(PB,{size:`sm`,variant:`warning`,children:LB[e].badge})}function zB({kind:e,tokenCount:t}){let n=LB[e],[r,i]=(0,b.useState)(()=>sessionStorage.getItem(IB(e))===`true`);return r?null:(0,H.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,H.jsx)(iO,{className:`rounded-none border-x-0 border-t-0 py-2 pl-3 pr-10`,title:`${n.title} (~${FB.format(t)} tokens)`,description:n.description}),(0,H.jsx)(`button`,{type:`button`,"aria-label":`Dismiss ${n.badge.toLowerCase()} warning for this session`,onClick:()=>{sessionStorage.setItem(IB(e),`true`),i(!0)},className:`absolute right-2 top-2 inline-flex size-6 cursor-pointer items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-badge-warning/10 hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,children:(0,H.jsx)(Ai,{className:`size-3.5`})})]})}function BB(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function VB(e,t){if(e==null)return{};var n,r,i=BB(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function HB(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function UB(e){if(Array.isArray(e))return HB(e)}function WB(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function GB(e,t){if(e){if(typeof e==`string`)return HB(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?HB(e,t):void 0}}function KB(){throw TypeError(`Invalid attempt to spread non-iterable instance.
202
+ `;function jue(e){return{styles:{variables:sz,css:{fonts:cz}},containerDimensions:{width:e?mN.width-Aue:720,maxHeight:5e3},availableDisplayModes:[`inline`,`fullscreen`],userAgent:navigator.userAgent,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone}}function Mue(e,t){e.contentWindow?.postMessage(t,`*`)}function lz(e,t,n){e({jsonrpc:`2.0`,id:t,result:n})}function uz(e,t,n,r){e({jsonrpc:`2.0`,id:t,error:{code:n,message:r}})}function dz(e,t,n){switch(e){case`chatgpt`:return kue(t,n);case`claude`:return jue(n);case null:return{}}}function Nue(){let e=ds.getState(),t=ps(e.userAgent);return{...dz(e.previewClient,e.theme,t),theme:e.theme,locale:e.locale,displayMode:e.displayMode,safeAreaInsets:e.safeArea?.insets??{top:0,right:0,bottom:0,left:0},platform:t?`mobile`:`web`,deviceCapabilities:e.userAgent?.capabilities}}function Pue(e,t,n,r){let i=t=>Mue(e,t),a=async a=>{if(a.source!==e.contentWindow)return;let o=a.data;if(o?.jsonrpc!==`2.0`)return;let{id:s,method:c,params:l}=o;if(c!==`ui/notifications/size-changed`&&c!==`ui/notifications/request-teardown`&&s!==void 0)switch(c){case`ui/initialize`:{lz(i,s,{protocolVersion:`2025-06-18`,hostInfo:{name:`skybridge-devtools`,version:`0.0.1`},hostCapabilities:{openLinks:{},serverTools:{}},hostContext:Nue()});let e=r();e.toolInput!=null&&i({jsonrpc:`2.0`,method:`ui/notifications/tool-input`,params:{arguments:e.toolInput}}),(e.toolOutput!=null||e.toolResponseMetadata!=null)&&i({jsonrpc:`2.0`,method:`ui/notifications/tool-result`,params:{content:[],structuredContent:e.toolOutput??{},isError:!1,_meta:e.toolResponseMetadata??{}}});break}case`ui/update-model-context`:n(`mcp:updateModelContext`,l??{}),lz(i,s,{});break;case`ui/request-display-mode`:{let e=l?.mode??`inline`,t=ds.getState(),n=hs(e,t);t.setPreference(`displayMode`,n),lz(i,s,{mode:n});break}case`ui/open-link`:{let e=l?.url;e&&window.open(e,`_blank`,`noopener,noreferrer`),lz(i,s,{});break}case`ui/download-file`:uz(i,s,-32603,`downloadFile capability disabled in devtools`);break;case`tools/call`:{let e=l?.name??``,r=l?.arguments??{};n(`mcp:tools/call`,{name:e,args:r});try{let a=await t(e,r);n(`mcp:tools/call response`,a,`response`),lz(i,s,a)}catch(e){let t=e instanceof Error?e.message:String(e);uz(i,s,-32603,t)}break}default:s!==void 0&&uz(i,s,-32601,`Method not found: ${c}`)}};window.addEventListener(`message`,a);let o=ds.subscribe((e,t)=>{let n={};e.theme!==t.theme&&(n.theme=e.theme,e.previewClient===`chatgpt`&&(n.styles={variables:oz(e.theme)})),(e.previewClient!==t.previewClient||e.previewClient!==null&&e.userAgent!==t.userAgent)&&Object.assign(n,dz(e.previewClient,e.theme,ps(e.userAgent))),e.locale!==t.locale&&(n.locale=e.locale),e.displayMode!==t.displayMode&&(n.displayMode=e.displayMode),e.safeArea!==t.safeArea&&(n.safeAreaInsets=e.safeArea?.insets),e.userAgent!==t.userAgent&&(n.platform=e.userAgent?.device?.type===`mobile`?`mobile`:`web`,n.deviceCapabilities=e.userAgent?.capabilities),Object.keys(n).length>0&&i({jsonrpc:`2.0`,method:`ui/notifications/host-context-changed`,params:n})});return()=>{window.removeEventListener(`message`,a),o()}}function Fue(e,t){e.contentWindow?.postMessage({jsonrpc:`2.0`,method:`ui/notifications/tool-input`,params:{arguments:t}},`*`)}function Iue(e,t){e.contentWindow?.postMessage({jsonrpc:`2.0`,method:`ui/notifications/tool-result`,params:{content:t.content??[],structuredContent:t.structuredContent??{},isError:t.isError??!1,_meta:t._meta??{}}},`*`)}var fz=`openai:set_globals`,Lue=class extends CustomEvent{type=fz};function Rue(e,t,n,r,i){return{callTool:async(e,n)=>{t(`callTool`,{name:e,args:n});let i=await r(e,n??{});return t(`← callTool response`,i,`response`),i},sendFollowUpMessage:async e=>{t(`sendFollowUpMessage`,e)},requestClose:async()=>{t(`requestClose`,{})},openExternal:e=>{window.open(e.href,`_blank`,`noopener,noreferrer`),t(`openExternal`,e)},requestDisplayMode:async r=>{t(`requestDisplayMode`,r);let i=ds.getState(),a=hs(r.mode,i);return e.displayMode=a,n(`displayMode`,a),i.setPreference(`displayMode`,a),{mode:a}},setWidgetState:async r=>{_C(r.modelContent,`setWidgetState`),t(`setWidgetState`,r),e.widgetState=r,n(`widgetState`,r)},requestModal:async r=>{t(`requestModal`,r),e.view={mode:`modal`,params:r.params},n(`displayMode`,`modal`)},uploadFile:async e=>(t(`uploadFile`,{name:e.name,size:e.size}),{fileId:`123`}),getFileDownloadUrl:async e=>(t(`getFileDownloadUrl`,e),{downloadUrl:`https://example.com/file.pdf`}),setOpenInAppUrl:async e=>{t(`setOpenInAppUrl`,e),i(e.href)}}}function zue(e,t){let n=[`theme`,`userAgent`,`locale`,`maxHeight`,`displayMode`,`safeArea`,`toolInput`,`toolOutput`,`toolResponseMetadata`,`view`,`widgetState`];return new Proxy(e||{},{set(e,r,i,a){let o=Reflect.set(e,r,i,a);if(n.includes(r)){let e=new Lue(fz,{detail:{globals:{[r]:i}}});t.dispatchEvent(e)}return o}})}function Bue(e,t,n,r,i,a){let o=zue(iE(t),e);Vne(o,Rue(o,n,r,i,a)),e.openai=o}var pz=`__host-fonts`,Vue=({iframeRef:e,theme:t,previewClient:n,documentKey:r})=>{(0,b.useEffect)(()=>{let i=e.current,a=i?.contentDocument,o=a?.documentElement;if(!i||!a||!o||!r||n===null)return;i.style.colorScheme=t,o.style.colorScheme=t;let s=n===`chatgpt`?oz(t):sz,c=Object.entries(s);for(let[e,t]of c)o.style.setProperty(e,t);if(n===`claude`&&!a.getElementById(pz)){let e=a.createElement(`style`);e.id=pz,e.textContent=cz,a.head?.appendChild(e)}return()=>{i.style.removeProperty(`color-scheme`),o.style.removeProperty(`color-scheme`);for(let[e]of c)o.style.removeProperty(e)}},[e,t,n,r])},mz=({iframeRef:e,toolName:t,globalKey:n,value:r,updateOpenaiObject:i})=>{(0,b.useEffect)(()=>{let a=e.current?.contentWindow?.openai;!a||a[n]===r||(a[n]=r,i(t,n,r))},[e,n,r,t,i])},Hue=345,Uue=770,hz=420,gz=()=>{let e=roe(),{openaiObject:t}=xD(e.name)??{},{data:n}=ioe(e._meta?.ui?.resourceUri),{setToolData:r,pushOpenAiLog:i,updateOpenaiObject:a,setOpenInAppUrl:o}=bD(),s=(0,b.useRef)(null),c=(0,b.useRef)(null),l=(0,b.useRef)(t);l.current=t;let[u,d]=(0,b.useState)(null),f=ds(e=>e.previewClient),p=f!==null,m=ms()&&!p,h=(0,b.useRef)(m);(0,b.useEffect)(()=>{h.current!==m&&(h.current=m,d(null))},[m]);let g=ds(e=>e.displayMode),_=g===`fullscreen`,v=g===`pip`,y=_&&!m,x=y||p?`100%`:`${m?Hue:Uue}px`,S=ds(e=>e.theme),C=ds(e=>e.locale),w=ds(e=>e.userAgent),T=n.contents[0],E=T.text,D=dN(T._meta?.ui?.domain??T._meta?.[`openai/widgetDomain`]);(0,b.useEffect)(()=>{let t=s.current;if(!t?.contentWindow||!t.contentDocument)return;D&&o(e.name,D);let n=(t,n,r=`default`)=>{i(e.name,{timestamp:Date.now(),source:`view`,command:t,args:n,type:r})};Bue(t.contentWindow,l.current,n,(t,n)=>{a(e.name,t,n)},(e,t)=>RD.callTool(e,t),t=>{o(e.name,t)});let c=Pue(t,(e,t)=>RD.callTool(e,t),n,()=>({toolInput:l.current?.toolInput,toolOutput:l.current?.toolOutput,toolResponseMetadata:l.current?.toolResponseMetadata}));return t.contentDocument.open(),t.contentDocument.write(uN(E)),t.contentDocument.close(),r(e.name,{openaiRef:s}),c},[E,D,e.name,i,r,a,o]),wue({iframeRef:s,containerRef:c,enabled:!!E&&!y,onHeightChange:d,documentKey:E,clampToContainer:!p});let O=Tue({iframeRef:s,documentKey:E});return mz({iframeRef:s,toolName:e.name,globalKey:`theme`,value:S,updateOpenaiObject:a}),mz({iframeRef:s,toolName:e.name,globalKey:`locale`,value:C,updateOpenaiObject:a}),mz({iframeRef:s,toolName:e.name,globalKey:`displayMode`,value:g,updateOpenaiObject:a}),mz({iframeRef:s,toolName:e.name,globalKey:`userAgent`,value:w,updateOpenaiObject:a}),Vue({iframeRef:s,theme:S,previewClient:f,documentKey:E}),(0,b.useEffect)(()=>{let e=s.current;!e||!t||(t.toolInput!=null&&Fue(e,t.toolInput),(t.toolOutput!=null||t.toolResponseMetadata!=null)&&Iue(e,{content:[],structuredContent:t.toolOutput,isError:!1,_meta:t.toolResponseMetadata}))},[t]),(0,H.jsx)(`div`,{ref:c,className:lN(`relative transition-[width] duration-150 ease-out`,y?`h-full w-full`:`mx-auto`,y&&!p&&`bg-background`),style:{width:y?void 0:x,height:y?`100%`:u==null?`auto`:`${v&&!p?Math.min(u,hz):u}px`,opacity:+!!O},children:(0,H.jsx)(`iframe`,{ref:s,src:`about:blank`,style:{width:`100%`,height:y||u==null?`100%`:`${v&&!p?Math.min(u,hz):u}px`,border:`none`,display:`block`},sandbox:`allow-scripts allow-same-origin allow-forms`,title:`html-preview`})})};function _z(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsxs)(`g`,{children:[(0,H.jsx)(`path`,{d:`M8.167 2.501a.665.665 0 0 1 0 1.33H5.834a2 2 0 0 0-2.002 2.002v8.333c0 1.106.896 2.002 2.002 2.002h8.333a2 2 0 0 0 2.002-2.002v-2.333a.665.665 0 0 1 1.33 0v2.333a3.33 3.33 0 0 1-3.332 3.332H5.834a3.33 3.33 0 0 1-3.332-3.332V5.833a3.333 3.333 0 0 1 3.332-3.332z`}),(0,H.jsx)(`path`,{fillRule:`evenodd`,d:`M13.427 3.104a2.451 2.451 0 0 1 3.46 3.472l-5.163 5.203a3.13 3.13 0 0 1-1.55.853l-2.386.524a.815.815 0 0 1-.97-.971l.525-2.38c.13-.59.429-1.131.86-1.556zm2.512.953a1.12 1.12 0 0 0-1.579-.006L9.136 9.197c-.247.244-.42.554-.495.894l-.351 1.594 1.598-.352c.338-.074.648-.245.892-.49l5.162-5.204a1.12 1.12 0 0 0-.003-1.582`,clipRule:`evenodd`})]})})}function Wue(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,...e,children:(0,H.jsx)(`path`,{d:`M6.95 2.668a3 3 0 0 1 1.763.574l1.064.774c.286.207.63.32.982.32h4.408a3 3 0 0 1 2.998 2.997v7a3 3 0 0 1-2.998 2.998H4.833a3 3 0 0 1-2.998-2.997V5.667a3 3 0 0 1 2.998-2.999zM3.164 9.831v4.503c0 .92.747 1.667 1.668 1.668h10.334c.921 0 1.668-.747 1.668-1.668V9.83zm1.668-5.832c-.921 0-1.668.746-1.668 1.668V8.5h13.67V7.334c0-.922-.747-1.668-1.668-1.668h-4.408a3 3 0 0 1-1.764-.575l-1.064-.773a1.67 1.67 0 0 0-.982-.32z`})})}function Gue(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsx)(`path`,{d:`M6.001 14.167a1.002 1.002 0 1 0-2.003-.001 1.002 1.002 0 0 0 2.003 0m10.665-.665.135.013a.665.665 0 0 1 0 1.303l-.135.014h-5.833a.665.665 0 0 1 0-1.33zM6.643 3.669a.666.666 0 0 1 1.042.78l-.07.117-2.5 3.333a.666.666 0 0 1-.958.111l-1.25-1.04-.094-.097a.665.665 0 0 1 .835-1.001l.111.076.712.593 2.08-2.774zm10.023 1.5.135.013a.665.665 0 0 1 0 1.303l-.135.014h-5.833a.665.665 0 0 1 0-1.33zm-9.335 8.998a2.332 2.332 0 1 1-4.663 0 2.332 2.332 0 0 1 4.663 0`})})}function vz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`none`,stroke:`currentColor`,...e,children:(0,H.jsx)(`path`,{strokeWidth:`1.33`,d:`M6.804 15.133V4.867m0 10.266c0 .847-.687 1.534-1.534 1.534H3.754a1.533 1.533 0 0 1-1.534-1.534V4.867c0-.847.687-1.534 1.534-1.534H5.27c.847 0 1.534.687 1.534 1.534m0 10.266c0 .847.686 1.534 1.533 1.534h1.517c.847 0 1.533-.687 1.533-1.534V4.867c0-.847-.686-1.534-1.533-1.534H8.337c-.847 0-1.533.687-1.533 1.534m8.536 11.83 1.493-.263a1.533 1.533 0 0 0 1.244-1.777l-1.783-10.11a1.533 1.533 0 0 0-1.776-1.244l-1.494.263a1.533 1.533 0 0 0-1.243 1.777l1.782 10.11c.147.834.943 1.391 1.777 1.244Z`})})}function Kue(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`none`,stroke:`currentColor`,...e,children:(0,H.jsxs)(`g`,{strokeLinecap:`round`,strokeWidth:`1.33`,children:[(0,H.jsx)(`path`,{d:`M12.524 12.192c1.803 1.946 4.692.822 4.893-2.058.286-4.087-2.553-7.613-7.104-7.613-3.98 0-7.46 3.038-7.731 6.934-.3 4.3 2.766 7.974 7.416 7.974 1.57 0 3.184-.37 4.381-1.218M6.374 8.96l1.098 1.141M9.124 6.313l1.099 1.14`}),(0,H.jsx)(`path`,{d:`m11.028 6.89-4.142 3.987a.21.21 0 0 0-.006.295c.534.557 1.303 1.37 1.303 1.37 1.185 1.23 2.815.978 4.064-.224 1.25-1.203 1.606-2.795.38-4.053l-1.304-1.368a.21.21 0 0 0-.295-.007Z`})]})})}function que(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsxs)(`g`,{children:[(0,H.jsx)(`path`,{d:`M8.195 10.381c.423 0 .767.344.767.767v1.038a.768.768 0 0 1-1.534 0v-1.038c0-.423.344-.766.767-.767M11.715 10.381c.424 0 .767.344.767.767v1.038a.767.767 0 0 1-1.533 0v-1.038c0-.423.343-.766.766-.767`}),(0,H.jsx)(`path`,{fillRule:`evenodd`,d:`M10 1.667a1.694 1.694 0 0 1 .665 3.252v.884c1.425.028 2.833.145 4.24.368 1.299.207 2.394 1.182 2.623 2.529q.08.477.125.93a2.053 2.053 0 0 1 .03 4.068 15 15 0 0 1-.155 1.248c-.229 1.347-1.324 2.322-2.622 2.528A31 31 0 0 1 10 17.85c-1.653 0-3.28-.116-4.906-.375-1.298-.206-2.393-1.181-2.622-2.528a15 15 0 0 1-.155-1.248 2.052 2.052 0 0 1 .03-4.068q.045-.453.125-.93c.229-1.347 1.324-2.322 2.622-2.529a31 31 0 0 1 4.241-.368V4.92A1.693 1.693 0 0 1 10 1.667m0 5.46c-1.59 0-3.147.111-4.698.358-.786.125-1.394.702-1.518 1.436-.173 1.018-.202 1.945-.202 2.902l.006.714a15 15 0 0 0 .196 2.187c.124.734.732 1.311 1.518 1.437 1.551.246 3.108.358 4.698.358 1.589 0 3.146-.112 4.697-.358.786-.125 1.395-.703 1.52-1.437.172-1.018.201-1.944.202-2.901l-.008-.714a15 15 0 0 0-.195-2.188c-.124-.734-.733-1.311-1.52-1.436A30 30 0 0 0 10 7.126`,clipRule:`evenodd`})]})})}function Jue(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsxs)(`g`,{children:[(0,H.jsx)(`path`,{d:`M13.334 11.417a.666.666 0 0 1 0 1.33h-2.5a.665.665 0 0 1 0-1.33zM6.742 7.346a.665.665 0 0 1 .912.228l1.121 1.868c.206.343.206.771 0 1.114l-1.12 1.869a.666.666 0 0 1-1.141-.685L7.558 10 6.514 8.258a.665.665 0 0 1 .228-.912`}),(0,H.jsx)(`path`,{fillRule:`evenodd`,d:`M7.798 1.78a4.49 4.49 0 0 1 4.14.979 4.488 4.488 0 0 1 5.301 5.3 4.487 4.487 0 0 1-1.94 7.239 4.485 4.485 0 0 1-7.238 1.94 4.486 4.486 0 0 1-5.301-5.3A4.487 4.487 0 0 1 4.7 4.7 4.49 4.49 0 0 1 7.798 1.78m3.311 2.02a3.16 3.16 0 0 0-5.17 1.385c-.111.359-.393.642-.752.753A3.16 3.16 0 0 0 3.8 11.11c.255.277.358.662.275 1.029a3.16 3.16 0 0 0 3.785 3.785L8 15.9c.323-.032.649.075.89.298a3.16 3.16 0 0 0 5.17-1.385l.05-.13c.133-.297.389-.526.704-.623a3.16 3.16 0 0 0 1.385-5.17 1.15 1.15 0 0 1-.275-1.03 3.16 3.16 0 0 0-3.785-3.785 1.15 1.15 0 0 1-1.03-.275`,clipRule:`evenodd`})]})})}function Yue(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsx)(`path`,{d:`M9.79 18.51a1.8 1.8 0 0 1-.99.27 1.74 1.74 0 0 1-.97-.32l-3.48-2.38a2 2 0 0 1-.64-.71 1.9 1.9 0 0 1-.23-.91V6.53q0-.49.22-.89.23-.399.66-.66l5.72-3.52q.49-.3 1.06-.29.57 0 1.05.32l3.52 2.4q.39.28.6.67.21.381.21.84v7.89q0 .5-.25.95t-.69.71zm4.59-13.85-2.96-2.02a.52.52 0 0 0-.31-.1.5.5 0 0 0-.3.08L5.5 5.89l3.27 2.22zM8.14 9.33 4.86 7.11v3.1l3.28 2.24zm0 4.71L4.86 11.8v2.66q0 .15.06.28.06.12.19.21l3.03 2.07zm7-5.15V5.81L9.52 9.26v3.09zm-.28 4.9a.6.6 0 0 0 .21-.21.6.6 0 0 0 .07-.29v-2.81l-5.62 3.46v3.13z`})})}function yz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,...e,children:(0,H.jsx)(`path`,{d:`M9.162 2.38a6.707 6.707 0 0 1 5.155 10.993l3.243 3.243a.665.665 0 1 1-.94.94l-3.25-3.249A6.707 6.707 0 1 1 9.162 2.38m0 1.33a5.377 5.377 0 1 0 0 10.754 5.377 5.377 0 0 0 0-10.754`})})}function Xue(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsx)(`path`,{d:`M6.835 4c-.451.004-.82.012-1.137.038-.386.032-.659.085-.876.162l-.2.086c-.44.224-.807.564-1.063.982l-.103.184c-.126.247-.206.562-.248 1.076-.043.523-.043 1.19-.043 2.135v2.664c0 .944 0 1.612.043 2.135.042.515.122.829.248 1.076l.103.184c.256.418.624.758 1.063.982l.2.086c.217.077.49.13.876.162.316.026.685.034 1.136.038zm11.33 7.327c0 .922 0 1.654-.048 2.243-.043.522-.125.977-.305 1.395l-.082.177a4 4 0 0 1-1.473 1.593l-.276.155c-.465.237-.974.338-1.57.387-.59.048-1.322.048-2.244.048H7.833c-.922 0-1.654 0-2.243-.048-.522-.042-.977-.126-1.395-.305l-.176-.082a4 4 0 0 1-1.594-1.473l-.154-.275c-.238-.466-.34-.975-.388-1.572-.048-.589-.048-1.32-.048-2.243V8.663c0-.922 0-1.654.048-2.243.049-.597.15-1.106.388-1.571l.154-.276a4 4 0 0 1 1.594-1.472l.176-.083c.418-.18.873-.263 1.395-.305.589-.048 1.32-.048 2.243-.048h4.334c.922 0 1.654 0 2.243.048.597.049 1.106.15 1.571.388l.276.154a4 4 0 0 1 1.473 1.594l.082.176c.18.418.262.873.305 1.395.048.589.048 1.32.048 2.243zm-10 4.668h4.002c.944 0 1.612 0 2.135-.043.514-.042.829-.122 1.076-.248l.184-.103c.418-.256.758-.624.982-1.063l.086-.2c.077-.217.13-.49.162-.876.043-.523.043-1.19.043-2.135V8.663c0-.944 0-1.612-.043-2.135-.032-.386-.085-.659-.162-.876l-.086-.2a2.67 2.67 0 0 0-.982-1.063l-.184-.103c-.247-.126-.562-.206-1.076-.248-.523-.043-1.19-.043-2.135-.043H8.164L8.165 4z`})})}function bz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsx)(`path`,{d:`M10 2.533a.8.8 0 0 1 .8.8V9.2h5.866a.8.8 0 1 1 0 1.6H10.8v5.866a.8.8 0 1 1-1.6 0V10.8H3.333a.8.8 0 0 1 0-1.6H9.2V3.333a.8.8 0 0 1 .8-.8`})})}function xz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsxs)(`g`,{children:[(0,H.jsx)(`path`,{d:`M18.585 13.412a.9.9 0 0 1 1.668.676 8.91 8.91 0 0 1-7.353 5.516V22a.9.9 0 0 1-1.8 0v-2.396a8.91 8.91 0 0 1-7.352-5.516.9.9 0 0 1 1.668-.676 7.104 7.104 0 0 0 13.169 0`}),(0,H.jsx)(`path`,{fillRule:`evenodd`,d:`M12 1.35a4.9 4.9 0 0 1 4.9 4.9v4.483a4.9 4.9 0 0 1-9.8 0V6.25a4.9 4.9 0 0 1 4.9-4.9m0 1.8a3.1 3.1 0 0 0-3.1 3.1v4.483a3.1 3.1 0 1 0 6.2 0V6.25a3.1 3.1 0 0 0-3.1-3.1`,clipRule:`evenodd`})]})})}function Sz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsx)(`path`,{d:`M7.167 15.416V4.583a.75.75 0 0 1 1.5 0v10.833a.75.75 0 0 1-1.5 0m4.166-2.5V7.083a.75.75 0 0 1 1.5 0v5.833a.75.75 0 0 1-1.5 0M3 11.25v-2.5a.75.75 0 0 1 1.5 0v2.5a.75.75 0 0 1-1.5 0m12.5 0v-2.5a.75.75 0 0 1 1.5 0v2.5a.75.75 0 0 1-1.5 0`})})}function Cz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsx)(`path`,{d:`M14.255 4.755a.7.7 0 0 1 .99.99L10.99 10l4.255 4.255.09.11a.7.7 0 0 1-.97.97l-.11-.09L10 10.99l-4.255 4.255a.7.7 0 0 1-.99-.99L9.01 10 4.755 5.745l-.09-.11a.7.7 0 0 1 .97-.97l.11.09L10 9.01z`})})}function Zue(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsx)(`path`,{d:`M11.248 18.25q-.825 0-1.568-.314a4.3 4.3 0 0 1-1.32-.874 4 4 0 0 1-1.303.214 4 4 0 0 1-2.046-.544 4.27 4.27 0 0 1-1.518-1.485 4 4 0 0 1-.561-2.095q0-.48.132-1.04A4.4 4.4 0 0 1 2.04 10.71a4.07 4.07 0 0 1 .016-3.4 4.2 4.2 0 0 1 1.056-1.418 3.8 3.8 0 0 1 1.6-.842 3.9 3.9 0 0 1 .76-1.683q.594-.759 1.452-1.188a4.04 4.04 0 0 1 1.831-.429q.825 0 1.568.313.742.314 1.32.875a4 4 0 0 1 1.303-.215q1.106 0 2.046.545a4.14 4.14 0 0 1 1.502 1.485q.577.941.577 2.095 0 .48-.132 1.04.66.61 1.023 1.419.363.792.363 1.666 0 .892-.38 1.717a4.3 4.3 0 0 1-1.072 1.435 3.8 3.8 0 0 1-1.584.825 3.8 3.8 0 0 1-.775 1.683 4.06 4.06 0 0 1-1.436 1.188 4.04 4.04 0 0 1-1.831.429m-4.076-2.062q.825 0 1.436-.347l3.102-1.782a.36.36 0 0 0 .165-.313v-1.42L7.882 14.62a.67.67 0 0 1-.726 0l-3.119-1.798a.5.5 0 0 1-.016.115v.198q0 .841.396 1.551.412.693 1.138 1.089a3.2 3.2 0 0 0 1.617.412m.165-2.69a.4.4 0 0 0 .182.05q.082 0 .165-.05l1.237-.71-3.976-2.31a.7.7 0 0 1-.363-.643v-3.58q-.825.362-1.32 1.122a2.9 2.9 0 0 0-.495 1.65q0 .809.412 1.55.413.743 1.073 1.123zm3.91 3.663q.876 0 1.585-.396a2.96 2.96 0 0 0 1.534-2.64v-3.564a.32.32 0 0 0-.165-.297l-1.254-.726v4.604a.7.7 0 0 1-.363.643l-3.118 1.799a3 3 0 0 0 1.782.577m.628-6.039V8.878L10.01 7.822 8.13 8.878v2.244l1.88 1.056zM7.057 5.859a.7.7 0 0 1 .363-.644l3.118-1.798a3 3 0 0 0-1.782-.578q-.874 0-1.584.396A2.96 2.96 0 0 0 6.05 4.324a3.07 3.07 0 0 0-.396 1.551v3.547q0 .199.165.314l1.238.726zm8.382 7.887q.825-.364 1.303-1.123.495-.758.495-1.65a3.15 3.15 0 0 0-.412-1.55q-.413-.743-1.073-1.123l-3.085-1.782q-.1-.065-.182-.049a.3.3 0 0 0-.165.05l-1.237.692 3.993 2.327a.6.6 0 0 1 .264.264.64.64 0 0 1 .099.363zm-3.317-8.382a.63.63 0 0 1 .726 0l3.135 1.831v-.297q0-.792-.396-1.501a2.86 2.86 0 0 0-1.105-1.155q-.71-.43-1.65-.43-.825 0-1.436.347L8.294 5.941a.36.36 0 0 0-.165.314v1.418z`})})}function Que(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsx)(`path`,{d:`M16.835 10c0-3.51-3.024-6.418-6.835-6.418S3.165 6.49 3.165 10c0 1.414.567 2.35 1.282 3.765.087.171.111.367.07.555l-.327 1.469 1.59-.412.145-.024a.8.8 0 0 1 .287.028l.136.051.459.212c1.062.472 2.06.775 3.193.775 3.811 0 6.835-2.91 6.835-6.42m1.33 0c0 4.314-3.692 7.749-8.165 7.749-1.52 0-2.804-.453-4.06-1.04l-2.204.572a.832.832 0 0 1-1.02-.986l.463-2.089C2.537 12.954 1.835 11.73 1.835 10 1.835 5.685 5.527 2.25 10 2.25S18.165 5.685 18.165 10`})})}function $ue(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsx)(`path`,{d:`M2.5 6.25h15a.75.75 0 0 1 0 1.5h-15a.75.75 0 0 1 0-1.5m0 5.25h10a.75.75 0 0 1 0 1.5h-10a.75.75 0 0 1 0-1.5`})})}function ede(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,fill:`currentColor`,...e,children:(0,H.jsx)(`path`,{d:`M5.5 10a1.6 1.6 0 1 1-3.2 0 1.6 1.6 0 0 1 3.2 0m6.1 0a1.6 1.6 0 1 1-3.2 0 1.6 1.6 0 0 1 3.2 0m6.1 0a1.6 1.6 0 1 1-3.2 0 1.6 1.6 0 0 1 3.2 0`})})}var tde=`ui-sans-serif, -apple-system, system-ui, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif`,nde={light:{"--main-surface-primary":`#fcfcfc`,"--sidebar-surface":`#fcfcfc`,"--message-surface":`#e9e9e980`,"--composer-surface-primary":`#fff`,"--text-primary":`#0d0d0d`,"--text-secondary":`#5d5d5d`,"--text-tertiary":`#8f8f8f`,"--border-default":`#0000001a`,"--bg-elevated-primary":`#fff`,"--sidebar-surface-secondary":`#ececec`},dark:{"--main-surface-primary":`#000`,"--sidebar-surface":`#000`,"--message-surface":`#323232d9`,"--composer-surface-primary":`#212121`,"--text-primary":`#fff`,"--text-secondary":`#cdcdcd`,"--text-tertiary":`#afafaf`,"--border-default":`#ffffff26`,"--bg-elevated-primary":`#1b1b1b`,"--sidebar-surface-secondary":`#303030`}};function wz({className:e}){return(0,H.jsx)(`div`,{className:lN(`rounded-md bg-[color-mix(in_oklab,var(--text-primary)_10%,transparent)] motion-safe:animate-pulse`,e)})}var rde=[{icon:_z,label:`New chat`},{icon:Wue,label:`Projects`},{icon:Gue,label:`Tasks`},{icon:vz,label:`Library`},{icon:Kue,label:`Plugins`},{icon:que,label:`Agents`},{icon:Jue,label:`Codex`},{icon:Yue,label:`GPTs`}],ide=[`w-[85%]`,`w-[70%]`,`w-[78%]`,`w-[62%]`,`w-[82%]`,`w-[68%]`,`w-[75%]`,`w-[60%]`];function Tz(){return(0,H.jsxs)(`div`,{"aria-hidden":!0,className:`absolute inset-x-0 top-0 z-10 flex h-[52px] cursor-not-allowed items-center justify-between px-3`,children:[(0,H.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-xl bg-[color-mix(in_oklab,var(--text-primary)_4%,transparent)] backdrop-blur-sm`,children:(0,H.jsx)($ue,{className:`size-6`})}),(0,H.jsxs)(`div`,{className:`flex h-10 items-center gap-5 rounded-xl bg-[color-mix(in_oklab,var(--text-primary)_4%,transparent)] px-4 backdrop-blur-sm`,children:[(0,H.jsx)(_z,{className:`size-6`}),(0,H.jsx)(ede,{className:`size-6`})]})]})}function Ez(){return(0,H.jsxs)(`div`,{className:`rounded-[28px] bg-(--composer-surface-primary) p-2 shadow-[0_2px_12px_rgba(0,0,0,0.08)]`,children:[(0,H.jsx)(`div`,{className:`px-2.5 pt-1.5 pb-3 text-(--text-tertiary)`,children:`Ask ChatGPT`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-3 px-1.5 pb-0.5`,children:[(0,H.jsx)(bz,{className:`size-5 shrink-0`}),(0,H.jsx)(wz,{className:`h-4 w-16`}),(0,H.jsx)(`div`,{className:`flex-1`}),(0,H.jsx)(wz,{className:`h-4 w-14`}),(0,H.jsx)(xz,{className:`size-6 shrink-0`}),(0,H.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-full bg-(--text-primary) text-(--main-surface-primary)`,children:(0,H.jsx)(Sz,{className:`size-5`})})]})]})}function Dz(){return(0,H.jsxs)(`div`,{className:`flex h-[52px] items-center gap-3 rounded-full border border-(--border-default) bg-(--composer-surface-primary) px-4 shadow-[0_4px_16px_rgba(0,0,0,0.06)]`,children:[(0,H.jsx)(bz,{className:`size-5 shrink-0`}),(0,H.jsx)(`span`,{className:`flex-1 text-(--text-tertiary)`,children:`Ask ChatGPT`}),(0,H.jsx)(xz,{className:`size-6 shrink-0`}),(0,H.jsx)(`div`,{className:`flex size-9.5 shrink-0 items-center justify-center rounded-full bg-(--text-primary) text-(--main-surface-primary)`,children:(0,H.jsx)(Sz,{className:`size-5.5`})})]})}function Oz({className:e}){return(0,H.jsx)(`div`,{className:lN(`h-11 w-2/5 self-end rounded-3xl bg-(--message-surface) motion-safe:animate-pulse`,e)})}function kz({children:e}){let t=ds(e=>e.theme),n=ds(e=>e.displayMode),r=ds(e=>e.setPreference),i=ms(),a=n===`pip`,o=n===`fullscreen`,s=(0,b.useRef)(null),c=(0,b.useRef)(null);return(0,b.useEffect)(()=>{let e=s.current,t=c.current;if(!e||!t)return;let n=()=>{e.scrollTop=e.scrollHeight};n();let r=new ResizeObserver(n);r.observe(t);let i=()=>r.disconnect(),a=[`wheel`,`touchstart`,`pointerdown`];for(let t of a)e.addEventListener(t,i,{once:!0,passive:!0});return()=>{r.disconnect();for(let t of a)e.removeEventListener(t,i)}},[]),(0,H.jsxs)(`div`,{className:`@container/shell relative isolate flex h-full w-full overflow-hidden bg-(--main-surface-primary) text-(--text-primary)`,style:{fontFamily:tde,...nde[t]},children:[(0,H.jsxs)(`aside`,{"aria-hidden":!0,className:lN(`h-full shrink-0 cursor-not-allowed border-(--border-default) border-r bg-(--sidebar-surface) @max-[640px]/shell:hidden`,o?`w-[52px]`:`w-[260px]`,i&&`hidden`),children:[(0,H.jsxs)(`div`,{className:lN(`h-full flex-col px-1.5 pb-2`,o?`hidden`:`flex`),children:[(0,H.jsxs)(`div`,{className:`flex h-[52px] shrink-0 items-center justify-between pr-2.5 pl-3`,children:[(0,H.jsx)(`span`,{className:`font-semibold text-base`,children:`ChatGPT`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-4 text-(--text-secondary)`,children:[(0,H.jsx)(yz,{className:`size-5`}),(0,H.jsx)(Xue,{className:`size-5`})]})]}),rde.map(({icon:e,label:t})=>(0,H.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-1.5 rounded-[10px] px-2.5 text-sm leading-5`,children:[(0,H.jsx)(e,{className:`size-5 shrink-0`}),(0,H.jsx)(`span`,{children:t})]},t)),(0,H.jsx)(wz,{className:`mt-6 mb-2 ml-2 h-3 w-14`}),ide.map(e=>(0,H.jsx)(`div`,{className:`px-2 py-2`,children:(0,H.jsx)(wz,{className:lN(`h-3.5`,e)})},e)),(0,H.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 px-2 py-2`,children:[(0,H.jsx)(wz,{className:`size-8 rounded-full`}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(wz,{className:`h-3 w-24`}),(0,H.jsx)(wz,{className:`h-2.5 w-16`})]})]})]}),(0,H.jsxs)(`div`,{className:lN(`h-full flex-col items-center gap-5 py-4`,o?`flex`:`hidden`),children:[(0,H.jsx)(Zue,{className:`size-6`}),(0,H.jsx)(_z,{className:`mt-4 size-5`}),(0,H.jsx)(yz,{className:`size-5`}),(0,H.jsx)(Que,{className:`size-5`}),(0,H.jsx)(vz,{className:`size-5`}),(0,H.jsx)(wz,{className:`mt-auto size-8 rounded-full`})]})]}),(0,H.jsxs)(`div`,{className:`relative flex h-full min-w-0 flex-1 flex-col`,children:[i&&!o&&(0,H.jsx)(Tz,{}),(0,H.jsxs)(`div`,{className:lN(`h-[52px] shrink-0 items-center px-4`,o?`flex`:`hidden`),children:[(0,H.jsx)(`button`,{type:`button`,"aria-label":`Exit fullscreen`,onClick:()=>r(`displayMode`,`inline`),className:`-ml-2 flex size-9 cursor-pointer items-center justify-center rounded-lg text-(--text-primary) transition-colors hover:bg-[color-mix(in_oklab,var(--text-primary)_5%,transparent)]`,children:(0,H.jsx)(Cz,{className:`size-5`})}),(0,H.jsxs)(`div`,{"aria-hidden":!0,className:`flex flex-1 items-center justify-center gap-2`,children:[(0,H.jsx)(wz,{className:`size-5 rounded-md`}),(0,H.jsx)(wz,{className:`h-4 w-28`})]}),(0,H.jsx)(`div`,{className:`w-5`})]}),(0,H.jsx)(`div`,{ref:s,className:`min-h-0 flex-1 overflow-y-auto [container-type:size]`,children:(0,H.jsxs)(`div`,{ref:c,className:lN(`mx-auto flex w-full max-w-[768px] flex-col px-4 py-6`,i&&!o&&`pt-16`,o&&`h-full max-w-none p-0`),children:[[[`w-[92%]`,`w-[80%]`,`w-[55%]`],[`w-[88%]`,`w-[76%]`,`w-[50%]`],[`w-[95%]`,`w-[70%]`,`w-[62%]`]].map((e,t)=>(0,H.jsxs)(`div`,{className:lN(`flex flex-col`,o&&`hidden`,t>0&&`mt-10`),children:[(0,H.jsx)(Oz,{}),(0,H.jsx)(`div`,{className:`mt-6 flex flex-col gap-3`,children:e.map(e=>(0,H.jsx)(wz,{className:lN(`h-4`,e)},e))})]},e[0])),(0,H.jsx)(Oz,{className:lN(`mt-10`,o&&`hidden`)}),(0,H.jsx)(wz,{className:lN(`mt-6 h-4 w-40`,o&&`hidden`)}),(0,H.jsxs)(`div`,{className:lN(`mt-6 flex items-center gap-2`,o&&`hidden`),children:[(0,H.jsx)(wz,{className:`size-5 rounded-md`}),(0,H.jsx)(wz,{className:`h-4 w-[110px]`})]}),(0,H.jsxs)(`div`,{className:lN(`relative mt-3 w-full`,!a&&!o&&!i&&`-mx-4 w-[calc(100%+2rem)]`,a&&`absolute top-4 left-1/2 z-30 mt-0 w-[min(768px,calc(100%-32px))] translate-x-[calc(-50%-8px)] rounded-3xl border border-(--border-default) bg-(--main-surface-primary) shadow-[0_8px_32px_rgba(0,0,0,0.12)]`,o&&`mt-0 min-h-0 flex-1`),children:[a?(0,H.jsx)(`button`,{type:`button`,"aria-label":`Exit picture-in-picture`,onClick:()=>r(`displayMode`,`inline`),className:`-top-2.5 -left-2.5 absolute z-10 flex size-8 cursor-pointer items-center justify-center rounded-full bg-[#414141] text-white`,children:(0,H.jsx)(Cz,{className:`size-4.5`})}):null,(0,H.jsx)(`div`,{className:lN(`w-full`,a&&`max-h-[80cqh] overflow-y-auto rounded-3xl`,o&&`h-full min-h-0`,i&&!a&&!o&&`overflow-hidden rounded-xl border border-(--border-default)`),children:e??(0,H.jsx)(wz,{className:`h-96 w-full rounded-2xl`})})]}),(0,H.jsx)(`div`,{className:lN(`mt-6 border-(--border-default) border-t`,o&&`hidden`)}),(0,H.jsxs)(`div`,{className:lN(`mt-6 flex flex-col gap-3`,o&&`hidden`),children:[(0,H.jsx)(wz,{className:`h-4 w-[95%]`}),(0,H.jsx)(wz,{className:`h-4 w-[88%]`}),(0,H.jsx)(wz,{className:`h-4 w-[60%]`})]}),(0,H.jsxs)(`div`,{className:lN(`mt-4 flex items-center gap-3 pb-4`,o&&`hidden`),children:[(0,H.jsx)(wz,{className:`size-4 rounded-full`}),(0,H.jsx)(wz,{className:`size-4 rounded-full`}),(0,H.jsx)(wz,{className:`size-4 rounded-full`}),(0,H.jsx)(wz,{className:`size-4 rounded-full`})]})]})}),(0,H.jsx)(`div`,{"aria-hidden":!0,className:lN(`w-full shrink-0 cursor-not-allowed px-4`,i?`pb-4`:`pb-6`,o&&`hidden`),children:(0,H.jsx)(`div`,{className:`mx-auto w-full max-w-[768px]`,children:i?(0,H.jsx)(Ez,{}):(0,H.jsx)(Dz,{})})})]})]})}function Az(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M471.88739013671875 665.9563838413783Q471.88739013671875 704.3330688476562 457.7486114501953 738.6877461887846Q443.6098327636719 773.042423529913 417.35210091727123 799.3136473790112Q390.08445630754744 826.5953029146131 355.74742235456193 840.7413465256659Q321.4103884015764 854.8873901367188 284.04361615862166 854.8873901367188Q245.66693115234375 854.8873901367188 211.31225381121538 840.7486114501953Q176.95757647008705 826.6098327636719 150.68635262098888 799.3421881539481Q123.40469708538696 773.0844563075475 109.2586534743341 738.747422354562Q95.11260986328125 704.4103884015765 95.11260986328125 666.0337033952985Q95.11260986328125 628.6669311523438 109.25138854980469 594.3122538112154Q123.39016723632812 559.957576470087 150.65781184605189 532.6759209344851Q176.91554369245256 506.40469708538694 211.25257764543807 492.2586534743341Q245.58961159842355 478.11260986328125 283.9662966047014 478.11260986328125Q321.33306884765625 478.11260986328125 355.6877461887846 492.2513885498047Q390.042423529913 506.3901672363281 417.32407906551487 532.6478990827288Q443.59530291461306 559.9155436924525 457.7413465256659 594.252577645438Q471.88739013671875 628.5896115984235 471.88739013671875 665.9563838413783ZM412.11260986328125 666.0401287768261Q412.11260986328125 631.5551147460938 394.3774597903332 602.4688213147615Q376.64230971738516 573.3825278834292 347.5763693200537 555.634959010074Q318.51042892272216 537.8873901367188 284.02541489198984 537.8873901367188Q248.55511474609375 537.8873901367188 219.4688213147615 555.6225402096668Q190.38252788342928 573.3576902826148 172.634959010074 602.4236306799463Q154.88739013671875 631.4895710772778 154.88739013671875 665.9745851080102Q154.88739013671875 701.4448852539062 172.6225402096668 730.5311786852385Q190.35769028261484 759.6174721165708 219.42363067994637 777.365040989926Q248.48957107727787 795.1126098632812 283.95987122317393 795.1126098632812Q318.44488525390625 795.1126098632812 347.5311786852385 777.3774597903332Q376.6174721165707 759.6423097173852 394.365040989926 730.5763693200537Q412.11260986328125 701.5104289227222 412.11260986328125 666.0401287768261ZM601.0 395.11260986328125H849.0Q871.7689367223669 395.11260986328125 888.3281634295429 411.6718365704572Q904.8873901367188 428.2310632776331 904.8873901367188 451.0V799.0Q904.8873901367188 821.7689367223669 888.3281634295429 838.3281634295429Q871.7689367223669 854.8873901367188 849.0 854.8873901367188H601.0Q578.2310632776331 854.8873901367188 561.6718365704571 838.3281634295429Q545.1126098632812 821.7689367223669 545.1126098632812 799.0V451.0Q545.1126098632812 428.2310632776331 561.6718365704571 411.6718365704572Q578.2310632776331 395.11260986328125 601.0 395.11260986328125ZM601.0 454.88739013671875 604.8873901367188 451.0V799.0L601.0 795.1126098632812H849.0L845.1126098632812 799.0V451.0L849.0 454.88739013671875ZM325.33465576171875 511.77716064453125V512.7771606445312Q303.1718221028646 461.44838945942536 299.1422159830729 409.11317178049393Q295.11260986328125 356.7779541015625 308.202328408731 307.9240358737713Q321.29204695418076 259.0701176459801 350.995639038086 218.77822632409038Q380.69923112199115 178.4863350022007 425.00289389120564 153.30390292601965Q470.31345808699325 127.2236328125 519.6516279890731 121.7236328125Q568.9897978911529 116.2236328125 618.3279677932327 129.2236328125Q667.6661376953125 142.2236328125 710.9897978184587 171.91258533184345Q754.3134579416048 201.6015378511869 786.5543212890625 246.8897705078125Q801.8873901367188 268.6151204427083 794.8873901367188 293.444091796875Q788.6568040114182 317.24662911551343 767.88818359375 329.66534423828125L406.88818359375 537.6653442382812Q393.4617545387962 545.8873901367188 377.4533198963512 545.8873901367188Q361.44488525390625 545.8873901367188 348.0325142996652 537.6098327636719L334.6201433454241 527.2628860473633ZM380.66534423828125 488.22283935546875 378.88818359375 486.33465576171875 377.00079345703125 485.4456787109375 738.0007934570312 277.4456787109375 737.1126098632812 278.555908203125 737.5567016601562 282.1102294921875Q703.8421892438616 234.41767765925476 655.2536272321429 208.08741466815655Q606.6650652204241 181.75715167705835 554.110089983259 180.26675943227917Q501.55511474609375 178.7763671875 455.0165774806016 205.55561225358827Q409.46822185905614 231.34303342834005 384.2185899384168 277.9587563211604Q358.9689580177774 324.5744792139808 357.48368555185743 379.6207051831623Q355.9984130859375 434.66693115234375 380.66534423828125 487.2310632776331Z`})})}function jz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M500.045285676655 120.11260986328125Q578.444091796875 120.11260986328125 647.273644917806 149.76344038310805Q716.103198038737 179.41427090293485 768.3533697509765 231.68014164974818Q820.6035414632162 283.9460123965615 850.2454657999674 352.79624597649826Q879.8873901367188 421.646479556435 879.8873901367188 500.045285676655Q879.8873901367188 578.444091796875 850.2400938165251 643.7852350408381Q820.5927974963314 709.1263782848011 768.8356530729425 756.3730510919745Q717.0785086495536 803.6197238991477 647.7339850531685 829.2535570179332Q578.3894614567832 854.8873901367188 500.0 854.8873901367188H150.0Q136.15392855940195 854.8873901367188 128.16581042059536 846.340815617488Q120.1776922817888 837.7942410982572 119.64515107253501 825.508540226863Q119.11260986328125 813.2228393554688 128.667724609375 803.667724609375L228.667724609375 703.667724609375Q220.11260986328125 712.1950836181641 220.11260986328125 724.9861221313477Q220.11260986328125 737.7771606445312 228.667724609375 746.332275390625Q178.410727041739 696.0572959498355 149.26166845251012 638.2410695929277Q120.11260986328125 580.4248432360198 120.11260986328125 499.98487613075656Q120.11260986328125 421.555908203125 149.76344038310805 352.726355082194Q179.41427090293482 283.896801961263 231.68014164974812 231.64663024902342Q283.94601239656146 179.39645853678383 352.79624597649826 149.75453420003254Q421.64647955643505 120.11260986328125 500.045285676655 120.11260986328125ZM500.0425254998293 179.88739013671875Q433.444091796875 179.88739013671875 375.7723714192708 204.7367776087088Q318.10065104166665 229.58616508069883 273.85252075195314 273.8180747808412Q229.6043904622396 318.04998448098354 204.74589029947919 375.7005634160005Q179.88739013671875 433.3511423510174 179.88739013671875 499.9475007759508Q179.88739013671875 564.555908203125 203.2455945222274 611.7545601981027Q226.60379890773606 658.9532121930804 271.332275390625 703.667724609375Q279.88739013671875 712.1950836181641 279.88739013671875 724.9861221313477Q279.88739013671875 737.7771606445312 271.332275390625 746.332275390625L171.332275390625 846.332275390625Q180.7763671875 836.7702217102051 180.2763671875 824.5520420074463Q179.7763671875 812.3338623046875 171.80055454799106 803.7232360839844Q163.82474190848214 795.1126098632812 150.0 795.1126098632812H500.0Q565.6131436365732 795.1126098632812 623.7702482235359 774.2471184363732Q681.9273528104984 753.3816270094651 726.1665178381879 714.1346312302809Q770.4056828658773 674.8876354510967 795.2591463645792 620.7367172241211Q820.1126098632812 566.5857989971455 820.1126098632812 500.0149453970102Q820.1126098632812 433.444091796875 795.2624480338206 375.7723714192708Q770.4122862043602 318.10065104166665 726.1789981479203 273.85252075195314Q681.9457100914806 229.60439046223962 624.293334647132 204.74589029947919Q566.6409592027836 179.88739013671875 500.0425254998293 179.88739013671875Z`})})}function Mz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M399.9508586946081 95.11260986328125Q463.33306884765625 95.11260986328125 518.6892674763997 118.75518031719605Q574.0454661051432 142.39775077111085 615.8142341613769 184.1495241258965Q657.5830022176107 225.90129748068216 681.2351961771647 281.23497301112104Q704.8873901367188 336.5686485415599 704.8873901367188 399.9508586946081Q704.8873901367188 463.33306884765625 681.2410083934419 518.6892674763998Q657.594626650165 574.0454661051433 615.8361227205485 615.814234161377Q574.0776187909319 657.5830022176107 518.7350232215605 681.2351961771647Q463.39242765218904 704.8873901367188 400.0 704.8873901367188H125.0Q111.15392855940193 704.8873901367188 103.16581042059536 696.340815617488Q95.1776922817888 687.7942410982572 94.64515107253501 675.508540226863Q94.11260986328125 663.2228393554688 103.667724609375 653.667724609375L184.667724609375 573.667724609375Q175.2236328125 582.2120951990928 175.2236328125 594.494627921812Q175.2236328125 606.7771606445312 184.667724609375 615.332275390625Q142.40576034717344 574.0857803950671 118.75918510522735 518.7551163766359Q95.11260986328125 463.4244523582046 95.11260986328125 400.0456917552741Q95.11260986328125 336.66693115234375 118.75518031719604 281.3107325236003Q142.39775077111082 225.9545338948568 184.1495241258965 184.18576583862307Q225.90129748068222 142.41699778238933 281.23497301112104 118.76480382283529Q336.5686485415599 95.11260986328125 399.9508586946081 95.11260986328125ZM399.95305741073304 154.88739013671875Q349.33306884765625 154.88739013671875 304.68992832728793 173.74581724845325Q260.04678780691967 192.60424436018775 226.31641496930803 226.35090340223888Q192.58604213169642 260.09756244429 173.7367161342076 304.7622582352401Q154.88739013671875 349.4269540261902 154.88739013671875 400.046942589267Q154.88739013671875 450.66693115234375 174.23704655965167 495.30431587465347Q193.58670298258463 539.9417005969632 226.332275390625 573.667724609375Q235.88739013671875 582.2120951990928 235.88739013671875 594.494627921812Q235.88739013671875 606.7771606445312 226.332275390625 615.332275390625L146.332275390625 696.332275390625Q155.7763671875 686.7702217102051 155.2763671875 674.5520420074463Q154.7763671875 662.3338623046875 146.80055454799106 653.7232360839844Q138.82474190848214 645.1126098632812 125.0 645.1126098632812H400.0Q450.6102959636735 645.1126098632812 495.2664394610324 626.2541827515468Q539.9225829583913 607.3957556398123 573.662780267507 573.6490965977611Q607.4029775766226 539.9024375557099 626.2577937199519 495.23774176475985Q645.1126098632812 450.5730459738098 645.1126098632812 399.953057410733Q645.1126098632812 349.33306884765625 626.2541827515468 304.68992832728793Q607.3957556398123 260.0467878069196 573.6490965977612 226.31641496930803Q539.90243755571 192.58604213169644 495.2377417647599 173.7367161342076Q450.57304597380977 154.88739013671875 399.95305741073304 154.88739013671875ZM364.55670166015625 794.2212524414062Q357.0015869140625 784.5551147460938 358.07375183105466 772.2823365864001Q359.1459167480469 760.0095584267065 368.79540100097654 751.471973619963Q378.44488525390625 744.0015869140625 390.6862320438508 745.0722378817471Q402.92757883379534 746.1428888494318 411.44329833984375 755.7787475585938Q444.19262020713404 796.4752848307292 493.3166030080695 820.7939473470052Q542.4405858090049 845.1126098632812 600.0 845.1126098632812H802.4480590820312L773.667724609375 815.332275390625Q764.1126098632812 806.7879048009072 764.1126098632812 794.505372078188Q764.1126098632812 782.2228393554688 773.667724609375 773.667724609375Q806.4132970174154 739.9269369886669 825.7629534403484 695.2700121965531Q845.1126098632812 650.6130874044394 845.1126098632812 600.0019059733771Q845.1126098632812 542.444091796875 820.7939473470052 493.3187942504883Q796.4752848307292 444.19349670410156 755.7787475585938 411.44329833984375Q746.1428888494319 402.92757883379534 745.0722378817472 390.6862320438508Q744.0015869140625 378.44488525390625 751.471973619963 368.79540100097654Q760.0095584267065 359.14591674804683 772.2823365864001 358.07375183105466Q784.5551147460938 357.0015869140625 794.2212524414062 364.55670166015625Q845.530098100142 406.81575520833337 875.2087441184303 468.1919996473525Q904.8873901367188 529.5682440863716 904.8873901367188 600.0Q904.8873901367188 654.9370488432264 886.5634408133371 704.3803928021302Q868.2394914899554 753.8237367610342 835.5535278320312 793.7779541015625L896.332275390625 853.667724609375Q905.7763671875 863.2297782897949 905.2763671875 875.4479579925537Q904.7763671875 887.6661376953125 896.800554547991 896.2767639160156Q888.8247419084821 904.8873901367188 875.0 904.8873901367188H600.0Q529.5682440863716 904.8873901367188 468.1919996473524 875.2087441184303Q406.8157552083333 845.530098100142 364.55670166015625 794.2212524414062Z`})})}function Nz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M803.667724609375 328.667724609375Q812.1950836181641 320.11260986328125 824.9861221313477 320.11260986328125Q837.7771606445312 320.11260986328125 846.332275390625 328.6455200195312Q854.8873901367188 337.1784301757813 854.8873901367188 349.97779541015626Q854.8873901367188 362.77716064453125 846.332275390625 371.332275390625L521.332275390625 696.332275390625Q512.8049163818359 704.8873901367188 500.01387786865234 704.8873901367188Q487.22283935546875 704.8873901367188 478.667724609375 696.332275390625L153.667724609375 371.332275390625Q145.11260986328125 362.80491638183594 145.11260986328125 350.01387786865234Q145.11260986328125 337.22283935546875 153.64552001953126 328.667724609375Q162.17843017578124 320.11260986328125 174.97779541015626 320.11260986328125Q187.77716064453125 320.11260986328125 196.332275390625 328.667724609375L500.0 632.33544921875Z`})})}function Pz(e){return(0,H.jsxs)(`svg`,{viewBox:`0 0 21.2 21.2`,fill:`none`,"aria-hidden":`true`,...e,children:[(0,H.jsx)(`rect`,{x:`0`,y:`7.6`,height:`6`,width:`1.2`,rx:`0.6`,fill:`currentColor`}),(0,H.jsx)(`rect`,{x:`4`,y:`5.6`,height:`10`,width:`1.2`,rx:`0.6`,fill:`currentColor`}),(0,H.jsx)(`rect`,{x:`8`,y:`2.6`,height:`16`,width:`1.2`,rx:`0.6`,fill:`currentColor`}),(0,H.jsx)(`rect`,{x:`12`,y:`5.6`,height:`10`,width:`1.2`,rx:`0.6`,fill:`currentColor`}),(0,H.jsx)(`rect`,{x:`16`,y:`2.6`,height:`16`,width:`1.2`,rx:`0.6`,fill:`currentColor`}),(0,H.jsx)(`rect`,{x:`20`,y:`7.6`,height:`6`,width:`1.2`,rx:`0.6`,fill:`currentColor`})]})}function Fz(e){return(0,H.jsx)(`svg`,{viewBox:`30 0 82 24`,height:`20`,fill:`currentColor`,"aria-hidden":`true`,shapeRendering:`geometricPrecision`,...e,children:(0,H.jsx)(`path`,{d:`M39.504 21.2643C37.688 21.2643 36.06 20.9003 34.62 20.1723C33.18 19.4443 32.048 18.4163 31.224 17.0883C30.408 15.7603 30 14.2243 30 12.4803C30 10.6563 30.412 9.03233 31.236 7.60833C32.06 6.17633 33.196 5.06833 34.644 4.28433C36.1 3.49233 37.74 3.09633 39.564 3.09633C40.692 3.09633 41.82 3.22033 42.948 3.46833C44.084 3.71633 45.072 4.09633 45.912 4.60833V8.56833H44.832C44.536 7.16833 43.96 6.12433 43.104 5.43633C42.256 4.74833 41.076 4.40433 39.564 4.40433C38.164 4.40433 36.996 4.73233 36.06 5.38833C35.132 6.03633 34.444 6.93633 33.996 8.08833C33.548 9.24033 33.324 10.5643 33.324 12.0603C33.324 13.5483 33.576 14.8883 34.08 16.0803C34.584 17.2723 35.328 18.2163 36.312 18.9123C37.296 19.6003 38.476 19.9443 39.852 19.9443C40.796 19.9443 41.608 19.7483 42.288 19.3563C42.968 18.9643 43.54 18.4363 44.004 17.7723C44.468 17.1003 44.908 16.2803 45.324 15.3123H46.464L45.684 19.6803C44.892 20.2003 43.936 20.5963 42.816 20.8683C41.704 21.1323 40.6 21.2643 39.504 21.2643ZM47.964 21.0003V19.9563C48.356 19.9003 48.668 19.8403 48.9 19.7763C49.14 19.7043 49.332 19.5883 49.476 19.4283C49.628 19.2683 49.704 19.0443 49.704 18.7563V5.83233L47.964 5.08833V4.28433L51.612 2.73633H52.56V18.7563C52.56 19.0523 52.632 19.2803 52.776 19.4403C52.928 19.6003 53.12 19.7123 53.352 19.7763C53.592 19.8403 53.912 19.9003 54.312 19.9563V21.0003H47.964ZM59.028 21.2643C58.38 21.2643 57.792 21.1363 57.264 20.8803C56.736 20.6243 56.32 20.2563 56.016 19.7763C55.712 19.2963 55.56 18.7363 55.56 18.0963C55.56 17.1203 55.86 16.3443 56.46 15.7683C57.068 15.1843 57.916 14.7403 59.004 14.4363L63.24 13.2363V11.7123C63.24 10.8883 63.048 10.2523 62.664 9.80433C62.288 9.34833 61.708 9.12033 60.924 9.12033C60.228 9.12033 59.704 9.33233 59.352 9.75633C59.008 10.1723 58.836 10.7483 58.836 11.4843V12.6123H56.988C56.764 12.4683 56.588 12.2763 56.46 12.0363C56.34 11.7883 56.28 11.5163 56.28 11.2203C56.28 10.5563 56.516 9.98833 56.988 9.51633C57.46 9.03633 58.06 8.67633 58.788 8.43633C59.516 8.19633 60.256 8.07633 61.008 8.07633C62.592 8.07633 63.836 8.44033 64.74 9.16833C65.644 9.89633 66.096 11.0003 66.096 12.4803V18.5403C66.096 18.8603 66.168 19.1043 66.312 19.2723C66.456 19.4403 66.644 19.5603 66.876 19.6323C67.116 19.6963 67.44 19.7563 67.848 19.8123V20.8563C67.536 20.9683 67.208 21.0563 66.864 21.1203C66.528 21.1843 66.204 21.2163 65.892 21.2163C65.148 21.2163 64.548 21.0483 64.092 20.7123C63.644 20.3683 63.372 19.8643 63.276 19.2003C62.716 19.8643 62.08 20.3763 61.368 20.7363C60.664 21.0883 59.884 21.2643 59.028 21.2643ZM60.444 19.3443C60.948 19.3443 61.44 19.2283 61.92 18.9963C62.408 18.7563 62.848 18.4403 63.24 18.0483V14.3403L60.168 15.2523C59.592 15.4283 59.152 15.7003 58.848 16.0683C58.544 16.4363 58.392 16.9003 58.392 17.4603C58.392 17.8203 58.48 18.1443 58.656 18.4323C58.832 18.7203 59.076 18.9443 59.388 19.1043C59.7 19.2643 60.052 19.3443 60.444 19.3443ZM73.608 21.2643C72.32 21.2643 71.356 20.9283 70.716 20.2563C70.084 19.5843 69.768 18.6363 69.768 17.4123V10.9083L68.016 10.2603L68.112 9.45633L71.664 8.07633H72.624V16.9323C72.624 17.6923 72.812 18.2563 73.188 18.6243C73.564 18.9923 74.14 19.1763 74.916 19.1763C75.428 19.1763 75.964 19.0603 76.524 18.8283C77.084 18.5883 77.6 18.2803 78.072 17.9043V10.9083L76.32 10.2603V9.45633L79.98 8.07633H80.928V17.8323C80.928 18.1523 81 18.4003 81.144 18.5763C81.288 18.7443 81.476 18.8643 81.708 18.9363C81.948 19.0083 82.272 19.0723 82.68 19.1283V20.1603L79.02 21.1803H78.072V19.0803C77.44 19.7363 76.728 20.2643 75.936 20.6643C75.144 21.0643 74.368 21.2643 73.608 21.2643ZM89.328 21.2643C88.264 21.2643 87.312 21.0083 86.472 20.4963C85.632 19.9763 84.976 19.2683 84.504 18.3723C84.032 17.4763 83.796 16.4843 83.796 15.3963C83.796 13.9643 84.08 12.6963 84.648 11.5923C85.224 10.4883 86.032 9.62833 87.072 9.01233C88.112 8.38833 89.32 8.07633 90.696 8.07633C91.12 8.07633 91.556 8.12433 92.004 8.22033C92.46 8.30833 92.896 8.43633 93.312 8.60433V5.82033L91.56 5.08833V4.28433L95.22 2.73633H96.168V17.8323C96.168 18.1523 96.24 18.4003 96.384 18.5763C96.536 18.7443 96.728 18.8643 96.96 18.9363C97.2 19.0083 97.52 19.0723 97.92 19.1283V20.1603L94.26 21.1803H93.312V19.5843C92.752 20.1123 92.132 20.5243 91.452 20.8203C90.78 21.1163 90.072 21.2643 89.328 21.2643ZM90.504 19.3323C90.976 19.3323 91.456 19.2363 91.944 19.0443C92.432 18.8523 92.888 18.5883 93.312 18.2523V10.3563C92.584 9.76433 91.776 9.46833 90.888 9.46833C89.992 9.46833 89.236 9.69633 88.62 10.1523C88.004 10.6083 87.54 11.2283 87.228 12.0123C86.924 12.7883 86.772 13.6563 86.772 14.6163C86.772 15.5283 86.908 16.3403 87.18 17.0523C87.452 17.7563 87.868 18.3123 88.428 18.7203C88.988 19.1283 89.68 19.3323 90.504 19.3323ZM105.252 21.2643C104.068 21.2643 103.004 20.9883 102.06 20.4363C101.116 19.8843 100.376 19.1163 99.84 18.1323C99.304 17.1483 99.036 16.0443 99.036 14.8203C99.036 13.5563 99.308 12.4123 99.852 11.3883C100.404 10.3563 101.156 9.54833 102.108 8.96433C103.068 8.37233 104.136 8.07633 105.312 8.07633C106.216 8.07633 107.048 8.26433 107.808 8.64033C108.568 9.01633 109.2 9.54433 109.704 10.2243C110.216 10.9043 110.552 11.6883 110.712 12.5763L101.928 15.2883C102.168 16.4003 102.644 17.2763 103.356 17.9163C104.076 18.5563 104.968 18.8763 106.032 18.8763C106.92 18.8763 107.716 18.6523 108.42 18.2043C109.124 17.7483 109.748 17.0603 110.292 16.1403L111.228 16.4403C111.012 17.4003 110.62 18.2443 110.052 18.9723C109.484 19.7003 108.784 20.2643 107.952 20.6643C107.128 21.0643 106.228 21.2643 105.252 21.2643ZM107.628 12.2043C107.516 11.6523 107.324 11.1683 107.052 10.7523C106.788 10.3283 106.46 10.0003 106.068 9.76833C105.676 9.53633 105.244 9.42033 104.772 9.42033C104.18 9.42033 103.656 9.60033 103.2 9.96033C102.752 10.3123 102.4 10.8163 102.144 11.4723C101.896 12.1203 101.772 12.8723 101.772 13.7283C101.772 13.8803 101.776 13.9963 101.784 14.0763L107.628 12.2043Z`})})}function Iz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M708.332275390625 696.332275390625Q699.7879048009073 704.8873901367188 687.505372078188 704.8873901367188Q675.2228393554688 704.8873901367188 666.7003784179688 696.3544799804688Q657.1126098632812 687.8215698242187 657.1126098632812 675.0222045898438Q657.1126098632812 662.2228393554688 666.667724609375 653.667724609375L820.33544921875 500.0L666.667724609375 346.332275390625Q657.1126098632812 337.80491638183594 657.1126098632812 325.01387786865234Q657.1126098632812 312.22283935546875 666.7121337890625 303.667724609375Q675.2450439453125 295.11260986328125 687.5111022949219 295.11260986328125Q699.7771606445312 295.11260986328125 708.332275390625 303.667724609375L883.332275390625 478.667724609375Q892.8873901367188 487.19508361816406 892.8873901367188 499.98612213134766Q892.8873901367188 512.7771606445312 883.332275390625 521.332275390625ZM479.7763671875 805.2220458984375Q477.65525124289775 816.9654169497283 467.57995050603694 824.3708920686141Q457.5046497691761 831.7763671875 444.7779541015625 829.7763671875Q433.03458305027175 827.6552512428977 425.6291079313859 817.579950506037Q418.2236328125 807.5046497691761 420.2236328125 794.7779541015625L520.2236328125 194.7779541015625Q522.3447487571023 183.03458305027175 532.420049493963 175.62910793138587Q542.4953502308239 168.2236328125 555.2220458984375 170.2236328125Q566.9654169497283 172.34474875710225 574.3708920686141 182.42004949396306Q581.7763671875 192.49535023082387 579.7763671875 205.2220458984375ZM333.332275390625 653.667724609375Q342.88739013671875 662.1950836181641 342.88739013671875 674.9861221313477Q342.88739013671875 687.7771606445312 333.2878662109375 696.332275390625Q324.7549560546875 704.8873901367188 312.4888977050781 704.8873901367188Q300.22283935546875 704.8873901367188 291.667724609375 696.332275390625L116.667724609375 521.332275390625Q107.11260986328125 512.8049163818359 107.11260986328125 500.01387786865234Q107.11260986328125 487.22283935546875 116.667724609375 478.667724609375L291.667724609375 303.667724609375Q300.21209519909274 295.11260986328125 312.494627921812 295.11260986328125Q324.77716064453125 295.11260986328125 333.29962158203125 303.6455200195312Q342.88739013671875 312.1784301757813 342.88739013671875 324.97779541015626Q342.88739013671875 337.77716064453125 333.332275390625 346.332275390625L179.66455078125 500.0Z`})})}function Lz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M225.0 295.11260986328125H775.0Q810.516083240509 295.11260986328125 840.4510676860809 312.3632788658142Q870.3860521316528 329.61394786834717 887.6367211341858 359.54893231391907Q904.8873901367188 389.48391675949097 904.8873901367188 425.0V775.0Q904.8873901367188 797.5323408077925 894.133318387545 815.4557937230819Q883.3792466383713 833.3792466383713 865.4557937230819 844.133318387545Q847.5323408077925 854.8873901367188 825.0 854.8873901367188H175.0Q152.46765919220752 854.8873901367188 134.54420627691806 844.133318387545Q116.6207533616286 833.3792466383713 105.86668161245493 815.4557937230819Q95.11260986328125 797.5323408077925 95.11260986328125 775.0V425.0Q95.11260986328125 389.48391675949097 112.36327886581421 359.54893231391907Q129.61394786834717 329.61394786834717 159.54893231391907 312.3632788658142Q189.48391675949097 295.11260986328125 225.0 295.11260986328125ZM225.0 354.88739013671875Q195.78641255696616 354.88739013671875 175.33690134684247 375.33690134684247Q154.88739013671875 395.7864125569662 154.88739013671875 425.0V775.0Q154.88739013671875 783.2278858531605 160.82975214177912 789.1702478582208Q166.7721141468395 795.1126098632812 175.0 795.1126098632812H825.0Q833.2278858531605 795.1126098632812 839.1702478582208 789.1702478582208Q845.1126098632812 783.2278858531605 845.1126098632812 775.0V425.0Q845.1126098632812 395.7864125569662 824.6630986531575 375.33690134684247Q804.2135874430338 354.88739013671875 775.0 354.88739013671875ZM125.0 604.8873901367188V545.1126098632812H275.0Q287.77716064453125 545.1126098632812 296.332275390625 553.6455200195312Q304.88739013671875 562.1784301757813 304.88739013671875 574.9777954101562Q304.88739013671875 587.7771606445312 296.348135811942 596.332275390625Q287.8088814871652 604.8873901367188 275.0 604.8873901367188ZM375.0 604.8873901367188Q362.1911185128348 604.8873901367188 353.651864188058 596.3544799804688Q345.11260986328125 587.8215698242187 345.11260986328125 575.0222045898438Q345.11260986328125 562.2228393554688 353.651864188058 553.667724609375Q362.1911185128348 545.1126098632812 375.0 545.1126098632812H625.0Q637.8088814871652 545.1126098632812 646.348135811942 553.6455200195312Q654.8873901367188 562.1784301757813 654.8873901367188 574.9777954101562Q654.8873901367188 587.7771606445312 646.348135811942 596.332275390625Q637.8088814871652 604.8873901367188 625.0 604.8873901367188ZM354.88739013671875 325.0H295.11260986328125V225.0Q295.11260986328125 202.555908203125 305.86668161245495 184.60487747192383Q316.6207533616286 166.65384674072266 334.5442062769181 155.88322830200195Q352.4676591922075 145.11260986328125 375.0 145.11260986328125H625.0Q647.5323408077925 145.11260986328125 665.4557937230819 155.86668161245495Q683.3792466383713 166.62075336162866 694.133318387545 184.5442062769181Q704.8873901367188 202.46765919220752 704.8873901367188 225.0V325.0H645.1126098632812V225.0Q645.1126098632812 216.77716064453125 639.1702478582208 210.832275390625Q633.2278858531605 204.88739013671875 625.0 204.88739013671875H375.0Q366.7721141468395 204.88739013671875 360.8297521417791 210.82975214177912Q354.88739013671875 216.7721141468395 354.88739013671875 225.0ZM725.0 604.8873901367188Q712.2228393554688 604.8873901367188 703.667724609375 596.3544799804688Q695.1126098632812 587.8215698242187 695.1126098632812 575.0222045898438Q695.1126098632812 562.2228393554688 703.651864188058 553.667724609375Q712.1911185128348 545.1126098632812 725.0 545.1126098632812H875.0V604.8873901367188Z`})})}function Rz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M120.11260986328125 500.0Q120.11260986328125 421.61053854321676 149.76344038310805 352.76851149463147Q179.41427090293482 283.9264844460462 231.68014164974812 231.6668434748574Q283.94601239656146 179.4072025036686 352.79624597649826 149.75990618347493Q421.64647955643505 120.11260986328125 500.045285676655 120.11260986328125Q578.444091796875 120.11260986328125 647.2545028997927 149.77072185647899Q716.0649140027105 179.42883384967672 768.300554547991 231.70753973599136Q820.5361950932717 283.986245622306 850.1562811403858 352.85338703023973Q879.7763671875 421.72052843817346 879.7763671875 500.13858726764545L876.7763671875 539.3476166823814Q873.7763671875 557.444091796875 867.6836138375198 572.67919921875Q861.5908604875395 587.914306640625 852.4517304625692 600.6102294921875Q843.3126004375989 613.30615234375 831.1270937376385 622.447216796875H832.1425526293018Q819.9570459293413 631.58828125 806.7560803377175 637.68232421875Q793.5551147460938 643.7763671875 781.4743707830256 646.8066461736505Q768.3868981563684 650.8470181551847 754.7960611979167 652.36215764826Q741.205224239465 653.8772971413352 727.1110229492188 654.8873901367188L605.1110229492188 652.8873901367188L580.444091796875 655.8873901367188L568.0791430664062 661.5701817103795Q560.4699438476563 667.2529732840402 556.6653442382812 675.7771606445312L549.7763671875 701.3330688476562L543.7763671875 794.4244417173672L539.7763671875 814.444091796875L531.6067141415028 833.9011362711589L518.3310279417574 852.334125773112Q501.991721849763 869.7430603027344 475.4403494502721 874.863335164388L448.88897705078125 875.8873901367188L418.72600758403814 870.8621576482599Q390.57390274841123 864.8318786621094 364.4326625439005 854.7814136851918Q293.0469681392751 827.6451582475142 237.7481907835794 774.8802171186967Q182.44941342788368 722.1152759898793 151.28101164558245 651.2594979026101Q120.11260986328125 580.403719815341 120.11260986328125 500.0ZM179.88739013671875 499.96734619140625Q179.88739013671875 568.555908203125 206.2155882007014 627.7110236600699Q232.5437862646841 686.8661391170149 279.2390809442005 731.6053020676455Q325.9343756237169 776.3444650182762 385.545390108206 799.2111483041541L431.2471678796476 812.1357953787808L452.11102294921875 816.1126098632812L465.51890055338544 815.1866251627604L472.22283935546875 813.3346557617188L478.33465576171875 806.2228393554688L484.11260986328125 785.7779541015625L487.11260986328125 733.7779541015625L490.11260986328125 692.7779541015625L494.1894719050481 671.4213745117188L502.3431959885817 651.0817749023438Q506.42005803034857 641.928955078125 513.5545666034405 631.7591552734375Q520.6890751765325 621.58935546875 531.9004457913912 613.453515625L543.11181640625 606.3346557617188L566.4200007997711 598.1980121319111L601.8889770507812 593.1126098632812L724.7870679257521 595.1126098632812Q735.7779541015625 594.1126098632812 746.1268395317925 592.6459167480468Q756.4757249620226 591.1792236328125 765.3461981879341 589.2236328125Q775.2022795500578 586.2902465820313 782.1015365035446 582.8679626464843Q789.0007934570312 579.4456787109375 793.8527628580729 575.5396212064303Q799.675126139323 570.6570493257963 804.0418986002604 564.7979630690354Q808.4086710611979 558.9388768122747 812.2902465820313 550.1502474271334L818.1126098632812 528.6669311523438L820.1126098632812 499.85038787754854Q820.1126098632812 433.2742361737113 795.2571978901708 375.6411496241208Q770.4017859170604 318.00806307453036 726.169876216918 273.7895742563101Q681.9379665167756 229.57108543808988 624.2873875817587 204.72923778740432Q566.6368086467418 179.88739013671875 500.0404502218084 179.88739013671875Q433.444091796875 179.88739013671875 375.7723714192708 204.73831840183425Q318.10065104166665 229.58924666694975 273.85252075195314 273.8238989788553Q229.6043904622396 318.0585512907609 204.74589029947919 375.7127048658288Q179.88739013671875 433.36685844089675 179.88739013671875 499.96734619140625ZM546.7779541015625 245.11260986328125Q558.5921223958334 244.11260986328125 568.2582600911459 252.61659561960323Q577.9243977864584 261.1205813759252 577.9243977864584 272.8597604851974Q578.9984130859375 285.6661376953125 570.9741380479601 294.74284023708765Q562.9498630099827 303.8195427788628 550.1110229492188 304.88739013671875L554.8873901367188 300.0L550.0 295.11260986328125L545.1126098632812 300.0L549.8889770507812 304.88739013671875Q537.0691152719351 303.8207763671875 529.0908625676082 294.7545593261719Q521.1126098632812 285.6883422851563 522.1126098632812 272.88897705078125Q522.1126098632812 261.137437086839 531.767262425916 252.62502347506012Q541.4219149885506 244.11260986328125 553.2220458984375 245.11260986328125Q574.9214904785156 246.14813720703125 589.9044403076172 262.19881103515627Q604.8873901367188 278.2494848632813 604.8873901367188 299.99555908203126Q604.8873901367188 322.77716064453125 588.8367163085937 338.832275390625Q572.7860424804687 354.88739013671875 550.0044409179687 354.88739013671875Q527.2228393554688 354.88739013671875 511.167724609375 338.82927477037583Q495.11260986328125 322.7711594040329 495.11260986328125 299.97899565825594Q495.11260986328125 278.22283935546875 510.09555969238284 262.18507194519043Q525.0785095214844 246.1473045349121 546.7779541015625 245.11260986328125ZM696.7779541015625 395.11260986328125Q708.5921223958334 394.11260986328125 718.2582600911459 402.61659561960323Q727.9243977864584 411.1205813759252 727.9243977864584 422.8597604851974Q728.9984130859375 435.6661376953125 720.9741380479601 444.74284023708765Q712.9498630099827 453.8195427788628 700.1110229492188 454.88739013671875L704.8873901367188 450.0L700.0 445.11260986328125L695.1126098632812 450.0L699.8889770507812 454.88739013671875Q687.0691152719351 453.8207763671875 679.0908625676082 444.7545593261719Q671.1126098632812 435.6883422851563 672.1126098632812 422.88897705078125Q672.1126098632812 411.137437086839 681.767262425916 402.6250234750601Q691.4219149885506 394.11260986328125 703.2220458984375 395.11260986328125Q724.9214904785156 396.14813720703125 739.9044403076172 412.19881103515627Q754.8873901367188 428.2494848632813 754.8873901367188 449.99555908203126Q754.8873901367188 472.77716064453125 738.8367163085937 488.832275390625Q722.7860424804687 504.88739013671875 700.0044409179687 504.88739013671875Q677.2228393554688 504.88739013671875 661.167724609375 488.82927477037583Q645.1126098632812 472.7711594040329 645.1126098632812 449.97899565825594Q645.1126098632812 428.22283935546875 660.0955596923828 412.18507194519043Q675.0785095214844 396.1473045349121 696.7779541015625 395.11260986328125ZM346.7779541015625 295.11260986328125Q358.5921223958333 294.11260986328125 368.2582600911458 302.61659561960323Q377.9243977864583 311.1205813759252 377.9243977864583 322.8597604851974Q378.9984130859375 335.6661376953125 370.9741380479601 344.74284023708765Q362.94986300998266 353.8195427788628 350.11102294921875 354.88739013671875L354.88739013671875 350.0L350.0 345.11260986328125L345.11260986328125 350.0L349.88897705078125 354.88739013671875Q337.0691152719351 353.8207763671875 329.09086256760816 344.7545593261719Q321.11260986328125 335.6883422851563 322.11260986328125 322.88897705078125Q322.11260986328125 311.137437086839 331.767262425916 302.6250234750601Q341.42191498855067 294.11260986328125 353.2220458984375 295.11260986328125Q374.92149047851564 296.14813720703125 389.90444030761716 312.19881103515627Q404.88739013671875 328.2494848632813 404.88739013671875 349.99555908203126Q404.88739013671875 372.77716064453125 388.83671630859374 388.832275390625Q372.7860424804687 404.88739013671875 350.00444091796874 404.88739013671875Q327.22283935546875 404.88739013671875 311.167724609375 388.82927477037583Q295.11260986328125 372.7711594040329 295.11260986328125 349.97899565825594Q295.11260986328125 328.22283935546875 310.09555969238284 312.18507194519043Q325.07850952148436 296.1473045349121 346.7779541015625 295.11260986328125ZM296.7779541015625 495.11260986328125Q308.5921223958333 494.11260986328125 318.2582600911458 502.61659561960323Q327.9243977864583 511.12058137592516 327.9243977864583 522.8597604851973Q328.9984130859375 535.6661376953125 320.9741380479601 544.7428402370876Q312.94986300998266 553.8195427788628 300.11102294921875 554.8873901367188L304.88739013671875 550.0L300.0 545.1126098632812L295.11260986328125 550.0L299.88897705078125 554.8873901367188Q287.0691152719351 553.8207763671875 279.09086256760816 544.7545593261718Q271.11260986328125 535.6883422851563 272.11260986328125 522.8889770507812Q272.11260986328125 511.13743708683893 281.767262425916 502.62502347506006Q291.42191498855067 494.11260986328125 303.2220458984375 495.11260986328125Q324.92149047851564 496.14813720703125 339.90444030761716 512.1988110351563Q354.88739013671875 528.2494848632812 354.88739013671875 549.9955590820313Q354.88739013671875 572.7771606445312 338.83671630859374 588.832275390625Q322.7860424804687 604.8873901367188 300.00444091796874 604.8873901367188Q277.22283935546875 604.8873901367188 261.167724609375 588.8292747703758Q245.11260986328125 572.7711594040329 245.11260986328125 549.9789956582559Q245.11260986328125 528.2228393554688 260.09555969238284 512.1850719451904Q275.07850952148436 496.1473045349121 296.7779541015625 495.11260986328125Z`})})}function zz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M444.667724609375 124.55670166015625Q460.0378011067708 109.29024658203127 480.0189005533854 104.20142822265626Q500.0 99.11260986328125 519.9810994466145 104.20142822265626Q539.9621988932291 109.29024658203127 555.332275390625 124.55670166015625L830.332275390625 388.667724609375Q854.8873901367188 412.21490914481024 854.8873901367188 446.0V775.0Q854.8873901367188 796.5081434983474 844.133318387545 814.9436950683594Q833.3792466383713 833.3792466383713 815.4557937230819 844.133318387545Q797.5323408077925 854.8873901367188 775.0 854.8873901367188H600.0Q587.1911185128348 854.8873901367188 578.651864188058 846.348135811942Q570.1126098632812 837.8088814871652 570.1126098632812 825.0V600.0Q570.1126098632812 591.7721141468395 564.1702478582208 585.8297521417792Q558.2278858531605 579.8873901367188 550.0 579.8873901367188H450.0Q441.7721141468395 579.8873901367188 435.8297521417791 585.8297521417792Q429.88739013671875 591.7721141468395 429.88739013671875 600.0V825.0Q429.88739013671875 837.8088814871652 421.348135811942 846.348135811942Q412.8088814871652 854.8873901367188 400.0 854.8873901367188H225.0Q202.46765919220752 854.8873901367188 184.54420627691806 844.133318387545Q166.6207533616286 833.3792466383713 155.86668161245493 814.9436950683594Q145.11260986328125 796.5081434983474 145.11260986328125 775.0V446.0Q145.11260986328125 412.21490914481024 169.667724609375 388.667724609375ZM486.332275390625 167.332275390625 211.332275390625 432.332275390625Q204.88739013671875 437.79936523437505 204.88739013671875 446.0V775.0Q204.88739013671875 783.2278858531605 210.82975214177912 789.1702478582208Q216.7721141468395 795.1126098632812 225.0 795.1126098632812H400.0Q387.1911185128348 795.1126098632812 378.651864188058 803.651864188058Q370.11260986328125 812.1911185128348 370.11260986328125 825.0V600.0Q370.11260986328125 577.4676591922075 380.86668161245495 559.5442062769181Q391.6207533616286 541.6207533616287 409.5442062769181 530.866681612455Q427.4676591922075 520.1126098632812 450.0 520.1126098632812H550.0Q572.5323408077925 520.1126098632812 590.4557937230819 530.866681612455Q608.3792466383713 541.6207533616287 619.133318387545 559.5442062769181Q629.8873901367188 577.4676591922075 629.8873901367188 600.0V825.0Q629.8873901367188 812.1911185128348 621.348135811942 803.651864188058Q612.8088814871652 795.1126098632812 600.0 795.1126098632812H775.0Q783.2278858531605 795.1126098632812 789.1702478582208 789.1702478582208Q795.1126098632812 783.2278858531605 795.1126098632812 775.0V446.0Q795.1126098632812 437.79936523437505 788.7787475585938 432.332275390625L513.667724609375 167.332275390625Q508.19508361816406 161.88739013671875 499.98612213134766 161.88739013671875Q491.77716064453125 161.88739013671875 486.332275390625 167.332275390625Z`})})}function Bz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M470.11260986328125 725.0H529.8873901367188V875.0Q529.8873901367188 887.8088814871652 521.348135811942 896.348135811942Q512.8088814871652 904.8873901367188 500.0 904.8873901367188H325.0Q312.1911185128348 904.8873901367188 303.651864188058 896.3544799804688Q295.11260986328125 887.8215698242187 295.11260986328125 875.0222045898438Q295.11260986328125 862.2228393554688 303.651864188058 853.667724609375Q312.1911185128348 845.1126098632812 325.0 845.1126098632812H470.11260986328125ZM675.0 845.1126098632812Q687.7771606445312 845.1126098632812 696.332275390625 853.6455200195312Q704.8873901367188 862.1784301757813 704.8873901367188 874.9777954101562Q704.8873901367188 887.7771606445312 696.348135811942 896.332275390625Q687.8088814871652 904.8873901367188 675.0 904.8873901367188H500.0V845.1126098632812ZM654.8873901367188 225.0V450.0Q654.8873901367188 492.5181070963542 634.1306139823719 527.9498630099827Q613.3738378280249 563.3816189236111 577.9354395157252 584.1345045301649Q542.4970412034255 604.8873901367188 499.9709632286659 604.8873901367188Q457.44488525390625 604.8873901367188 422.0247984190245 584.1345045301649Q386.60471158414276 563.3816189236111 365.858660723712 527.9498630099827Q345.11260986328125 492.5181070963542 345.11260986328125 450.0V225.0Q345.11260986328125 182.48189290364587 365.86938601762824 147.0501369900174Q386.6261621719752 111.61838107638891 422.06456048427486 90.86549546983508Q457.50295879657455 70.11260986328125 500.0290367713341 70.11260986328125Q542.5551147460938 70.11260986328125 577.9752015809755 90.86549546983508Q613.3952884158573 111.61838107638891 634.141339276288 147.0501369900174Q654.8873901367188 182.48189290364587 654.8873901367188 225.0ZM595.1126098632812 225.0Q595.1126098632812 198.52535601743716 582.3686789235761 176.95342388349707Q569.624747983871 155.38149174955697 548.05809562437 142.63444094313786Q526.491443264869 129.88739013671875 500.02327900548136 129.88739013671875Q473.55511474609375 129.88739013671875 451.97382986886157 142.63444094313786Q430.39254499162945 155.38149174955697 417.63996756417407 176.95342388349707Q404.88739013671875 198.52535601743716 404.88739013671875 225.0V450.0Q404.88739013671875 476.47464398256284 417.6313210764239 498.04657611650293Q430.375252016129 519.618508250443 451.94190437563003 532.3655590568621Q473.50855673513104 545.1126098632812 499.97672099451864 545.1126098632812Q526.4448852539062 545.1126098632812 548.0261701311383 532.3655590568621Q569.6074550083705 519.618508250443 582.3600324358258 498.04657611650293Q595.1126098632812 476.47464398256284 595.1126098632812 450.0ZM195.11260986328125 425.0Q195.11260986328125 412.1911185128348 203.64552001953126 403.651864188058Q212.17843017578124 395.11260986328125 224.97779541015626 395.11260986328125Q237.77716064453125 395.11260986328125 246.332275390625 403.651864188058Q254.88739013671875 412.1911185128348 254.88739013671875 425.0V449.8265266418457Q254.88739013671875 500.47264099121094 273.74581724845325 545.1603889465332Q292.6042443601877 589.8481369018555 326.3509034022389 623.6122131347656Q360.0975624442901 657.3762893676758 404.76225823524015 676.2444496154785Q449.42695402619023 695.1126098632812 500.04694258926696 695.1126098632812Q550.6669311523438 695.1126098632812 595.3100716727121 676.2444496154785Q639.9532121930804 657.3762893676758 673.683585030692 623.6122131347656Q707.4139578683036 589.8481369018555 726.2632838657923 545.1603889465332Q745.1126098632812 500.47264099121094 745.1126098632812 449.8265266418457V425.0Q745.1126098632812 412.1911185128348 753.6455200195312 403.651864188058Q762.1784301757813 395.11260986328125 774.9777954101562 395.11260986328125Q787.7771606445312 395.11260986328125 796.332275390625 403.651864188058Q804.8873901367188 412.1911185128348 804.8873901367188 425.0V450.14385595554256Q804.8873901367188 513.5063729635099 781.244819682804 568.8228560657036Q757.6022492288891 624.1393391678973 715.8504758741035 665.878140054098Q674.0987025193178 707.6169409402987 618.765026988879 731.2521655385087Q563.4313514584401 754.8873901367188 500.0491413053919 754.8873901367188Q436.66693115234375 754.8873901367188 381.3107325236002 731.2521655385087Q325.95453389485675 707.6169409402987 284.18576583862307 665.878140054098Q242.41699778238933 624.1393391678973 218.7648038228353 568.8228560657036Q195.11260986328125 513.5063729635099 195.11260986328125 450.14385595554256Z`})})}function Vz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M470.11260986328125 225.0Q470.11260986328125 212.1911185128348 478.64552001953126 203.65186418805803Q487.1784301757813 195.11260986328125 499.97779541015626 195.11260986328125Q512.7771606445312 195.11260986328125 521.332275390625 203.65186418805803Q529.8873901367188 212.1911185128348 529.8873901367188 225.0V775.0Q529.8873901367188 787.8088814871652 521.3544799804688 796.348135811942Q512.8215698242187 804.8873901367188 500.02220458984374 804.8873901367188Q487.22283935546875 804.8873901367188 478.667724609375 796.348135811942Q470.11260986328125 787.8088814871652 470.11260986328125 775.0ZM775.0 470.11260986328125Q787.8088814871652 470.11260986328125 796.348135811942 478.64552001953126Q804.8873901367188 487.1784301757813 804.8873901367188 499.97779541015626Q804.8873901367188 512.7771606445312 796.348135811942 521.332275390625Q787.8088814871652 529.8873901367188 775.0 529.8873901367188H225.0Q212.19111851283483 529.8873901367188 203.65186418805803 521.3544799804688Q195.11260986328125 512.8215698242187 195.11260986328125 500.02220458984374Q195.11260986328125 487.22283935546875 203.65186418805803 478.667724609375Q212.19111851283483 470.11260986328125 225.0 470.11260986328125Z`})})}function Hz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M225.0 304.88739013671875Q212.19111851283483 304.88739013671875 203.65186418805803 296.35447998046874Q195.11260986328125 287.8215698242187 195.11260986328125 275.0222045898438Q195.11260986328125 262.22283935546875 203.65186418805803 253.667724609375Q212.19111851283483 245.11260986328125 225.0 245.11260986328125H775.0Q787.8088814871652 245.11260986328125 796.348135811942 253.64552001953126Q804.8873901367188 262.1784301757813 804.8873901367188 274.9777954101562Q804.8873901367188 287.77716064453125 796.348135811942 296.332275390625Q787.8088814871652 304.88739013671875 775.0 304.88739013671875ZM300.0 154.88739013671875Q287.1911185128348 154.88739013671875 278.651864188058 146.35447998046874Q270.11260986328125 137.82156982421873 270.11260986328125 125.0222045898438Q270.11260986328125 112.22283935546875 278.651864188058 103.667724609375Q287.1911185128348 95.11260986328125 300.0 95.11260986328125H700.0Q712.8088814871652 95.11260986328125 721.348135811942 103.64552001953126Q729.8873901367188 112.17843017578127 729.8873901367188 124.9777954101562Q729.8873901367188 137.77716064453125 721.348135811942 146.332275390625Q712.8088814871652 154.88739013671875 700.0 154.88739013671875ZM209.0 395.11260986328125H791.0Q815.588277445211 395.11260986328125 835.0539970893365 408.4298182896205Q854.5197167334619 421.7470267159598 864.2035534350903 442.7472400036487Q873.8873901367188 463.7474532913376 869.8873901367188 488.33306884765625L811.7763671875 838.3330688476562Q806.6610186688312 867.0026226337139 784.1534851866884 885.9450063852164Q761.6459517045455 904.8873901367188 733.0 904.8873901367188H267.0Q238.35404829545453 904.8873901367188 215.84651481331167 885.9450063852164Q193.33898133116884 867.0026226337139 188.2236328125 838.3330688476562L130.11260986328125 488.33306884765625Q126.11260986328125 463.7474532913376 135.7964465649097 442.7472400036487Q145.48028326653815 421.7470267159598 164.94600291066354 408.4298182896205Q184.41172255478895 395.11260986328125 209.0 395.11260986328125ZM209.0 454.88739013671875Q199.85790460759944 454.88739013671875 193.8726473721591 462.2041719876803Q187.88739013671875 469.52095383864184 188.88739013671875 478.66693115234375L247.7763671875 828.6669311523438Q248.69177827380952 835.9761216905382 254.18424479166666 840.5443657769097Q259.6767113095238 845.1126098632812 267.0 845.1126098632812H733.0Q740.3232886904761 845.1126098632812 745.8157552083333 840.5443657769097Q751.3082217261905 835.9761216905382 752.2236328125 828.6669311523438L811.1126098632812 478.66693115234375Q812.1126098632812 469.52095383864184 806.127352627841 462.2041719876803Q800.1420953924006 454.88739013671875 791.0 454.88739013671875Z`})})}function Uz(e){return(0,H.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...e,children:[(0,H.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`}),(0,H.jsx)(`line`,{x1:`8`,y1:`8`,x2:`10`,y2:`9`}),(0,H.jsx)(`line`,{x1:`8`,y1:`8`,x2:`8`,y2:`5.5`})]})}function Wz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M754.8873901367188 425.0584777366114Q754.8873901367188 490.444091796875 729.7390770366173 551.276105293303Q704.5907639365159 612.108118789731 658.3178678323294 658.3605588035439Q612.0449717281429 704.6129988173568 551.1860540258975 729.7501944770378Q490.3271363236522 754.8873901367188 424.9415222633886 754.8873901367188Q359.555908203125 754.8873901367188 298.7238947066971 729.7390770366173Q237.89188121026913 704.5907639365159 191.63944119645615 658.3178678323295Q145.3870011826432 612.0449717281429 120.24980552296222 551.1860540258975Q95.11260986328125 490.3271363236522 95.11260986328125 424.9415222633886Q95.11260986328125 359.555908203125 120.26092296338264 298.7238947066971Q145.40923606348403 237.89188121026916 191.68213216767057 191.63944119645612Q237.95502827185712 145.3870011826432 298.81394597410247 120.24980552296222Q359.6728636763478 95.11260986328125 425.0584777366114 95.11260986328125Q490.444091796875 95.11260986328125 551.2761052933029 120.26092296338265Q612.1081187897308 145.40923606348406 658.3605588035439 191.6821321676706Q704.6129988173568 237.95502827185715 729.7501944770378 298.81394597410247Q754.8873901367188 359.6728636763478 754.8873901367188 425.0584777366114ZM695.1126098632812 424.96526275821986Q695.1126098632812 371.33306884765625 674.2556455647286 321.6895645561568Q653.3986812661761 272.0460602646574 615.6575077735573 234.31699700311788Q577.9163342809385 196.58793374157824 528.256895474861 175.7376619391485Q478.59745666878354 154.88739013671875 424.9652627582199 154.88739013671875Q371.33306884765625 154.88739013671875 321.6895645561568 175.7443544352713Q272.0460602646574 196.60131873382386 234.31699700311782 234.3424922264427Q196.58793374157827 272.0836657190615 175.7376619391485 321.74310452513896Q154.88739013671875 371.4025433312164 154.88739013671875 425.03473724178014Q154.88739013671875 478.66693115234375 175.74435443527128 528.3104354438432Q196.6013187338238 577.9539397353426 234.3424922264427 615.6830029968821Q272.0836657190615 653.4120662584218 321.74310452513896 674.2623380608516Q371.40254333121646 695.1126098632812 425.0347372417801 695.1126098632812Q478.66693115234375 695.1126098632812 528.3104354438432 674.2556455647288Q577.9539397353426 653.3986812661763 615.6830029968821 615.6575077735573Q653.4120662584218 577.9163342809385 674.2623380608516 528.256895474861Q695.1126098632812 478.5974566687836 695.1126098632812 424.96526275821986ZM616.667724609375 658.332275390625 658.332275390625 616.667724609375 896.332275390625 853.667724609375Q904.8873901367188 862.1950836181641 904.8873901367188 874.9861221313477Q904.8873901367188 887.7771606445312 896.3544799804688 896.332275390625Q887.8215698242187 904.8873901367188 875.0222045898438 904.8873901367188Q862.2228393554688 904.8873901367188 853.667724609375 896.332275390625Z`})})}function Gz(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 1000 1000`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,H.jsx)(`path`,{d:`M295.11260986328125 175.0H354.88739013671875V825.0H295.11260986328125ZM175.0 145.11260986328125H825.0Q847.5323408077925 145.11260986328125 865.4557937230819 155.86668161245495Q883.3792466383713 166.62075336162866 894.133318387545 184.5442062769181Q904.8873901367188 202.46765919220752 904.8873901367188 225.0V775.0Q904.8873901367188 797.5323408077925 894.133318387545 815.4557937230819Q883.3792466383713 833.3792466383713 865.4557937230819 844.133318387545Q847.5323408077925 854.8873901367188 825.0 854.8873901367188H175.0Q152.46765919220752 854.8873901367188 134.54420627691806 844.133318387545Q116.6207533616286 833.3792466383713 105.86668161245493 815.4557937230819Q95.11260986328125 797.5323408077925 95.11260986328125 775.0V225.0Q95.11260986328125 202.46765919220752 105.86668161245493 184.5442062769181Q116.6207533616286 166.62075336162866 134.54420627691806 155.86668161245495Q152.46765919220752 145.11260986328125 175.0 145.11260986328125ZM175.0 204.88739013671875Q166.7721141468395 204.88739013671875 160.82975214177912 210.82975214177912Q154.88739013671875 216.7721141468395 154.88739013671875 225.0V775.0Q154.88739013671875 783.2278858531605 160.82975214177912 789.1702478582208Q166.7721141468395 795.1126098632812 175.0 795.1126098632812H825.0Q833.2278858531605 795.1126098632812 839.1702478582208 789.1702478582208Q845.1126098632812 783.2278858531605 845.1126098632812 775.0V225.0Q845.1126098632812 216.7721141468395 839.1702478582208 210.82975214177912Q833.2278858531605 204.88739013671875 825.0 204.88739013671875Z`})})}var Kz=`"Anthropic Sans", ui-sans-serif, system-ui, sans-serif`,qz={light:{"--shell-surface":`#faf9f5`,"--shell-sidebar":`#fbfbf9`,"--shell-card":`#ffffff`,"--shell-panel":`#ffffff`,"--shell-text":`#141413`,"--shell-text-secondary":`#3d3d3a`,"--shell-text-tertiary":`#73726c`,"--shell-nav-text":`#52514e`,"--shell-icon-muted":`#898781`,"--shell-segment-bg":`#edece8`,"--shell-segment-active":`#f9f9f7`,"--shell-btn-bg":`#f3f3f3`,"--shell-border":`rgba(31, 30, 29, 0.08)`,"--shell-composer-border":`rgba(31, 30, 29, 0.08)`,"--shell-accent":`#d97757`},dark:{"--shell-surface":`#1a1a19`,"--shell-sidebar":`#1a1a19`,"--shell-card":`#383835`,"--shell-panel":`#383835`,"--shell-text":`#faf9f5`,"--shell-text-secondary":`#c2c0b6`,"--shell-text-tertiary":`#9c9a92`,"--shell-nav-text":`#c2c0b6`,"--shell-icon-muted":`#9c9a92`,"--shell-segment-bg":`#3a3a38`,"--shell-segment-active":`#4a4a47`,"--shell-btn-bg":`#3a3a38`,"--shell-border":`rgba(222, 220, 209, 0.1)`,"--shell-composer-border":`transparent`,"--shell-accent":`#d97757`}};function Jz({className:e}){return(0,H.jsx)(`div`,{className:lN(`rounded-md bg-[color-mix(in_oklab,var(--shell-text)_10%,transparent)] motion-safe:animate-pulse`,e)})}function Yz(){return(0,H.jsxs)(`div`,{"aria-hidden":!0,className:`flex h-12 shrink-0 cursor-not-allowed items-center gap-2.5 px-3`,children:[(0,H.jsx)(Gz,{className:`size-4.5 text-[#7b7974]`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(Jz,{className:`h-3.5 w-24`}),(0,H.jsx)(Nz,{className:`size-2.5 text-(--shell-text-tertiary)`})]}),(0,H.jsx)(`div`,{className:`ml-auto flex h-7 items-center rounded-[7px] bg-(--shell-btn-bg) px-3 text-(--shell-text) text-sm`,children:`Share`})]})}function Xz(){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex min-h-[100px] flex-col justify-between rounded-[20px] bg-(--shell-card) p-3 shadow-[0_4px_20px_rgba(0,0,0,0.05)]`,children:[(0,H.jsx)(`span`,{className:`px-1.5 pt-1 text-[15px] text-(--shell-text-tertiary)`,children:`Write a message...`}),(0,H.jsxs)(`div`,{className:`flex items-center px-1 pb-0.5 text-(--shell-text-secondary)`,children:[(0,H.jsx)(Vz,{className:`size-5`}),(0,H.jsx)(`div`,{className:`flex-1`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(Jz,{className:`h-3.5 w-14`}),(0,H.jsx)(Jz,{className:`h-3.5 w-9`}),(0,H.jsx)(Nz,{className:`size-3`})]}),(0,H.jsx)(`div`,{className:`flex-1`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Bz,{className:`size-5`}),(0,H.jsx)(`div`,{className:`flex size-8 items-center justify-center rounded-lg bg-(--shell-accent) text-white`,children:(0,H.jsx)(Wr,{className:`size-4.5`})})]})]})]}),(0,H.jsx)(`div`,{className:`pt-1.5 pb-1 text-center text-(--shell-text-tertiary) text-xs`,children:`Claude can make mistakes. Please double-check responses.`})]})}function Zz(){return(0,H.jsxs)(`div`,{className:`flex min-h-[100px] flex-col justify-between rounded-[20px] border border-(--shell-composer-border) bg-(--shell-card) p-4 shadow-[0_4px_16px_rgba(0,0,0,0.04)]`,children:[(0,H.jsx)(`span`,{className:`text-(--shell-text-tertiary)`,children:`Reply to Claude...`}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(Vz,{className:`size-5 text-(--shell-text-secondary)`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-4 text-(--shell-text-secondary)`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(Jz,{className:`h-3.5 w-14`}),(0,H.jsx)(Jz,{className:`h-3.5 w-9`}),(0,H.jsx)(Nz,{className:`size-3`})]}),(0,H.jsx)(Bz,{className:`size-5`}),(0,H.jsx)(Pz,{className:`size-5`})]})]})]})}var Qz=[`w-[80%]`,`w-[65%]`,`w-[74%]`,`w-[58%]`,`w-[70%]`,`w-[62%]`];function $z({children:e}){let t=ds(e=>e.theme),n=ds(e=>e.displayMode),r=ds(e=>e.setPreference),i=ms(),a=n===`fullscreen`,[o,s]=(0,b.useState)(!1),c=(0,b.useRef)(null),l=(0,b.useRef)(null);return(0,b.useEffect)(()=>{let e=c.current,t=l.current;if(!e||!t)return;let n=()=>{e.scrollTop=e.scrollHeight};n();let r=new ResizeObserver(n);r.observe(t);let i=()=>r.disconnect(),a=[`wheel`,`touchstart`,`pointerdown`];for(let t of a)e.addEventListener(t,i,{once:!0,passive:!0});return()=>{r.disconnect();for(let t of a)e.removeEventListener(t,i)}},[]),(0,H.jsxs)(`div`,{className:`@container/shell relative isolate flex h-full w-full overflow-hidden bg-(--shell-surface) text-(--shell-text)`,style:{fontFamily:Kz,...qz[t]},children:[(0,H.jsx)(`style`,{children:cz}),(0,H.jsx)(`aside`,{"aria-hidden":!0,className:lN(`h-full w-[288px] shrink-0 cursor-not-allowed border-(--shell-border) border-r bg-(--shell-sidebar) @max-[640px]/shell:hidden`,(o||i)&&`hidden`),children:(0,H.jsxs)(`div`,{className:`flex h-full flex-col px-2 pb-2`,children:[(0,H.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center justify-between px-2`,children:[(0,H.jsx)(Fz,{className:`h-5`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1 text-[#7b7974]`,children:[(0,H.jsx)(`button`,{type:`button`,"aria-label":`Collapse sidebar`,onClick:()=>s(!0),className:`flex size-7 cursor-pointer items-center justify-center rounded-md transition-colors hover:bg-[color-mix(in_oklab,var(--shell-text)_5%,transparent)]`,children:(0,H.jsx)(Gz,{className:`size-4`})}),(0,H.jsx)(`div`,{className:`flex size-7 items-center justify-center`,children:(0,H.jsx)(Wz,{className:`size-4`})})]})]}),(0,H.jsxs)(`div`,{className:`mb-2 flex h-8 shrink-0 rounded-lg bg-(--shell-segment-bg) p-px`,children:[(0,H.jsxs)(`div`,{className:`flex flex-[1.1] items-center justify-center gap-1.5 rounded-[7px] bg-(--shell-segment-active) text-(--shell-text) text-sm shadow-[inset_0_0_0_0.5px_rgba(11,11,11,0.1),0_1px_2px_rgba(0,0,0,0.06),0_2px_6px_-1px_rgba(0,0,0,0.05)]`,children:[(0,H.jsx)(zz,{className:`size-4`}),(0,H.jsx)(`span`,{children:`Home`})]}),(0,H.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-1.5 text-(--shell-text-tertiary) text-sm`,children:[(0,H.jsx)(Iz,{className:`size-4`}),(0,H.jsx)(`span`,{children:`Code`})]})]}),(0,H.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 rounded-lg px-1.5 text-(--shell-nav-text) text-sm`,children:[(0,H.jsx)(Vz,{className:`size-4`}),(0,H.jsx)(`span`,{children:`New`})]}),[{icon:Mz,label:`Chats and tasks`},{icon:Hz,label:`Projects`},{icon:Az,label:`Artifacts`},{icon:Uz,label:`Scheduled`},{icon:Lz,label:`Customize`}].map(({icon:e,label:t})=>(0,H.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 px-1.5 text-(--shell-nav-text) text-sm`,children:[(0,H.jsx)(e,{className:`size-5`}),(0,H.jsx)(`span`,{children:t})]},t)),(0,H.jsx)(`div`,{className:`mt-5 mb-1 px-1.5 text-(--shell-text-tertiary) text-xs`,children:`Pinned`}),(0,H.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 px-1.5`,children:[(0,H.jsx)(jz,{className:`size-5 shrink-0 text-(--shell-icon-muted)`}),(0,H.jsx)(Jz,{className:`h-3.5 w-32`})]}),(0,H.jsxs)(`div`,{className:`mt-5 mb-1 flex items-center justify-between px-1.5`,children:[(0,H.jsx)(`span`,{className:`text-(--shell-text-tertiary) text-xs`,children:`Recents`}),(0,H.jsx)(Ci,{className:`size-3.5 text-(--shell-text-tertiary)`})]}),Qz.map(e=>(0,H.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 px-1.5`,children:[(0,H.jsx)(jz,{className:`size-5 shrink-0 text-(--shell-icon-muted)`}),(0,H.jsx)(Jz,{className:lN(`h-3.5`,e)})]},e)),(0,H.jsxs)(`div`,{className:`mt-auto flex shrink-0 flex-col`,children:[(0,H.jsxs)(`div`,{className:`flex h-10 items-center gap-2.5 border-(--shell-border) border-t px-1.5 text-(--shell-nav-text) text-sm`,children:[(0,H.jsx)(Rz,{className:`size-5`}),(0,H.jsx)(`span`,{children:`Design`})]}),(0,H.jsxs)(`div`,{className:`flex h-11 items-center gap-2.5 border-(--shell-border) border-t px-1.5`,children:[(0,H.jsx)(Jz,{className:`size-7 rounded-full`}),(0,H.jsx)(Jz,{className:`h-3.5 w-24`})]})]})]})}),(0,H.jsxs)(`div`,{className:`relative flex h-full min-w-0 flex-1 flex-col`,children:[i&&!a&&(0,H.jsx)(Yz,{}),o&&!i&&(0,H.jsx)(`button`,{type:`button`,"aria-label":`Expand sidebar`,onClick:()=>s(!1),className:`absolute top-2 left-2 z-40 flex size-8 cursor-pointer items-center justify-center rounded-md text-[#7b7974] transition-colors hover:bg-[color-mix(in_oklab,var(--shell-text)_5%,transparent)]`,children:(0,H.jsx)(Gz,{className:`size-4`})}),(0,H.jsx)(`div`,{ref:c,className:`min-h-0 flex-1 overflow-y-auto [container-type:size]`,children:(0,H.jsxs)(`div`,{ref:l,className:lN(`mx-auto flex w-full max-w-[720px] flex-col px-4 pt-6 pb-24`,a&&`h-full max-w-none px-5 pt-2 pb-4`,a&&o&&!i&&`pl-12`),children:[[[`w-[92%]`,`w-[80%]`,`w-[55%]`],[`w-[88%]`,`w-[76%]`,`w-[50%]`]].map((e,t)=>(0,H.jsxs)(`div`,{className:lN(`flex flex-col`,a&&`hidden`,t>0&&`mt-10`),children:[(0,H.jsx)(`div`,{className:`h-16 w-[55%] self-end rounded-xl bg-[color-mix(in_oklab,var(--shell-text)_5%,transparent)] motion-safe:animate-pulse`}),(0,H.jsx)(`div`,{className:`mt-6 flex flex-col gap-3`,children:e.map(e=>(0,H.jsx)(Jz,{className:lN(`h-4`,e)},e))})]},e[0])),(0,H.jsx)(`div`,{className:lN(`mt-10 h-12 w-[45%] self-end rounded-xl bg-[color-mix(in_oklab,var(--shell-text)_5%,transparent)] motion-safe:animate-pulse`,a&&`hidden`)}),(0,H.jsx)(Jz,{className:lN(`mt-6 h-4 w-40`,a&&`hidden`)}),(0,H.jsxs)(`div`,{className:lN(`relative mt-3 w-full`,!a&&!i&&`-mx-4 w-[calc(100%+2rem)]`,a&&`mt-0 flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border border-(--shell-border) bg-(--shell-panel)`),children:[a?(0,H.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-2.5 border-(--shell-border) border-b px-4`,children:[(0,H.jsx)(`div`,{className:`flex size-7 items-center justify-center rounded-lg border border-(--shell-border) bg-(--shell-segment-active)`,children:(0,H.jsx)(Jz,{className:`size-3.5 rounded`})}),(0,H.jsx)(Jz,{className:`h-4 w-44`}),(0,H.jsx)(`button`,{type:`button`,"aria-label":`Exit fullscreen`,onClick:()=>r(`displayMode`,`inline`),className:`ml-auto flex size-8 cursor-pointer items-center justify-center rounded-lg bg-(--shell-btn-bg) text-(--shell-text) transition-colors hover:bg-[color-mix(in_oklab,var(--shell-text)_10%,transparent)]`,children:(0,H.jsx)(Cz,{className:`size-4.5`})})]}):null,(0,H.jsx)(`div`,{className:lN(`w-full`,a&&`min-h-0 flex-1`),children:e??(0,H.jsx)(Jz,{className:`h-96 w-full rounded-2xl`})}),a&&!i?(0,H.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-4 mx-auto w-[min(680px,85%)]`,children:(0,H.jsxs)(`div`,{className:`flex min-h-[100px] flex-col justify-between rounded-[20px] border border-(--shell-composer-border) bg-(--shell-card) p-4 shadow-[0_4px_16px_rgba(0,0,0,0.08)]`,children:[(0,H.jsx)(`span`,{className:`text-(--shell-text-tertiary)`,children:`Write a message...`}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(Vz,{className:`size-5 text-(--shell-text-secondary)`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-4 text-(--shell-text-secondary)`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(Jz,{className:`h-3.5 w-14`}),(0,H.jsx)(Jz,{className:`h-3.5 w-9`}),(0,H.jsx)(Nz,{className:`size-3`})]}),(0,H.jsx)(Bz,{className:`size-5`}),(0,H.jsx)(Pz,{className:`size-5`})]})]})]})}):null]}),(0,H.jsxs)(`div`,{className:lN(`mt-6 flex flex-col gap-3`,a&&`hidden`),children:[(0,H.jsx)(Jz,{className:`h-4 w-[95%]`}),(0,H.jsx)(Jz,{className:`h-4 w-[60%]`})]})]})}),(0,H.jsx)(`div`,{className:lN(`w-full shrink-0 cursor-not-allowed`,i?`px-2 pb-1`:`px-4 pb-5`,a&&`hidden`),children:(0,H.jsx)(`div`,{className:`mx-auto w-full max-w-[768px]`,children:i?(0,H.jsx)(Xz,{}):(0,H.jsx)(Zz,{})})})]})]})}var eB=24,tB=44,nB={light:{backdrop:`#e8e8e6`,label:`#6f6f6f`},dark:{backdrop:`#111110`,label:`#8f8f8f`}},rB=({theme:e,children:t})=>{let n=(0,b.useRef)(null),[r,i]=(0,b.useState)(1);return(0,b.useLayoutEffect)(()=>{let e=n.current;if(!e)return;let t=()=>{let{width:t,height:n}=e.getBoundingClientRect();i(Math.min(1,(t-eB)/mN.width,(n-tB)/mN.height))};t();let r=new ResizeObserver(t);return r.observe(e),()=>r.disconnect()},[]),(0,H.jsxs)(`div`,{ref:n,className:`flex h-full min-h-0 w-full flex-col items-center justify-center overflow-hidden`,style:{backgroundColor:nB[e].backdrop},children:[(0,H.jsxs)(`div`,{className:`pb-1.5 font-mono text-xs`,style:{color:nB[e].label},children:[mN.width,` × `,mN.height]}),(0,H.jsx)(`div`,{style:{width:mN.width*r,height:mN.height*r},children:(0,H.jsx)(`div`,{className:`overflow-hidden shadow-[0_2px_16px_rgba(0,0,0,0.2)]`,style:{width:mN.width,height:mN.height,transform:`scale(${r})`,transformOrigin:`top left`},children:t})})]})},iB=()=>{let e=ZD(),t=xD(e?.name??``),n=ds(e=>e.previewClient),r=ds(e=>e.theme),i=ms(),a=e?._meta?.ui?.resourceUri,o=!!(e&&t?.response&&a),s=(0,H.jsx)(n===`claude`?$z:kz,{children:o?(0,H.jsx)(b.Suspense,{fallback:null,children:(0,H.jsx)(gz,{})}):null});return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 w-full flex-col`,children:[(0,H.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center gap-3 bg-primary px-3 text-primary-foreground`,children:[(0,H.jsx)(`span`,{className:`font-medium text-xs`,children:`Preview mode`}),(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,H.jsx)(iz,{variant:`preview`})})]}),(0,H.jsx)(`div`,{className:`min-h-0 flex-1`,children:i?(0,H.jsx)(rB,{theme:r,children:s}):s})]})},aB=function(e){return function(t,n){var r=(0,b.useRef)(!1);e(function(){return function(){r.current=!1}},[]),e(function(){if(!r.current)r.current=!0;else return t()},n)}},oB=function(e){return typeof e==`function`},sB=function(e){return typeof e==`string`},cB=function(e){return typeof e==`number`},lB=function(e){return e===void 0},uB=function(e){var t=(0,b.useRef)(e);t.current=(0,b.useMemo)(function(){return e},[e]);var n=(0,b.useRef)(void 0);return n.current||=function(){var e=[...arguments];return t.current.apply(this,e)},n.current},dB=aB(b.useEffect);function fB(e,t){if(e===t)return!0;for(var n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function pB(e){var t=(0,b.useRef)(e);return t.current=e,t}var mB=function(e){var t=pB(e);(0,b.useEffect)(function(){return function(){t.current()}},[])},hB=!!(typeof window<`u`&&window.document&&window.document.createElement);function gB(e,t){if(hB)return e?oB(e)?e():`current`in e?e.current:e:t}var _B=function(e){return function(t,n,r){var i=(0,b.useRef)(!1),a=(0,b.useRef)([]),o=(0,b.useRef)([]),s=(0,b.useRef)(void 0);e(function(){var e,c=(Array.isArray(r)?r:[r]).map(function(e){return gB(e)});if(!i.current){i.current=!0,a.current=c,o.current=n,s.current=t();return}(c.length!==a.current.length||!fB(a.current,c)||!fB(o.current,n))&&((e=s.current)==null||e.call(s),a.current=c,o.current=n,s.current=t())}),mB(function(){var e;(e=s.current)==null||e.call(s),i.current=!1})}}(b.useEffect),vB=u(s(((e,t)=>{var n=typeof Element<`u`,r=typeof Map==`function`,i=typeof Set==`function`,a=typeof ArrayBuffer==`function`&&!!ArrayBuffer.isView;function o(e,t){if(e===t)return!0;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(e.constructor!==t.constructor)return!1;var s,c,l;if(Array.isArray(e)){if(s=e.length,s!=t.length)return!1;for(c=s;c--!==0;)if(!o(e[c],t[c]))return!1;return!0}var u;if(r&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!t.has(c.value[0]))return!1;for(u=e.entries();!(c=u.next()).done;)if(!o(c.value[1],t.get(c.value[0])))return!1;return!0}if(i&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!t.has(c.value[0]))return!1;return!0}if(a&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(s=e.length,s!=t.length)return!1;for(c=s;c--!==0;)if(e[c]!==t[c])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf==`function`&&typeof t.valueOf==`function`)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString==`function`&&typeof t.toString==`function`)return e.toString()===t.toString();if(l=Object.keys(e),s=l.length,s!==Object.keys(t).length)return!1;for(c=s;c--!==0;)if(!Object.prototype.hasOwnProperty.call(t,l[c]))return!1;if(n&&e instanceof Element)return!1;for(c=s;c--!==0;)if(!((l[c]===`_owner`||l[c]===`__v`||l[c]===`__o`)&&e.$$typeof)&&!o(e[l[c]],t[l[c]]))return!1;return!0}return e!==e&&t!==t}t.exports=function(e,t){try{return o(e,t)}catch(e){if((e.message||``).match(/stack|recursion/i))return console.warn(`react-fast-compare cannot handle circular refs`),!1;throw e}}}))()),yB=function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=[]),(0,vB.default)(e,t)};function bB(e,t,n){n===void 0&&(n={});var r=n.enable,i=r===void 0||r,a=pB(t);_B(function(){if(i){var t=gB(n.target,window);if(t?.addEventListener){var r=function(e){return a.current(e)},o=Array.isArray(e)?e:[e];return o.forEach(function(e){t.addEventListener(e,r,{capture:n.capture,once:n.once,passive:n.passive})}),function(){o.forEach(function(e){t.removeEventListener(e,r,{capture:n.capture})})}}}},[e,n.capture,n.once,n.passive,i],n.target)}var xB=function(e,t,n){var r=(0,b.useRef)(void 0),i=(0,b.useRef)(0);yB(t,r.current)||(i.current+=1),r.current=t,_B(e,[i.current],n)},SB={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,backspace:8,tab:9,enter:13,shift:16,ctrl:17,control:17,alt:18,pausebreak:19,pause:19,capslock:20,esc:27,escape:27,space:32,spacebar:32,pageup:33,pagedown:34,end:35,home:36,leftarrow:37,arrowleft:37,uparrow:38,arrowup:38,rightarrow:39,arrowright:39,downarrow:40,arrowdown:40,insert:45,delete:46,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftwindowkey:91,rightwindowkey:92,meta:/(mac|iphone|ipod|ipad)/i.test(typeof navigator<`u`?navigator==null?void 0:navigator.platform:``)?[91,93]:[91,92],selectkey:93,contextmenu:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,multiply:106,add:107,subtract:109,decimalpoint:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,semicolon:186,equalsign:187,comma:188,dash:189,period:190,forwardslash:191,graveaccent:192,openbracket:219,backslash:220,closebracket:221,singlequote:222},CB={ctrl:function(e){return e.ctrlKey},shift:function(e){return e.shiftKey},alt:function(e){return e.altKey},meta:function(e){return e.type===`keyup`?SB.meta.includes(e.keyCode):e.metaKey}};function wB(e){return sB(e)||cB(e)}function TB(e){var t=Object.keys(CB).reduce(function(t,n){return CB[n](e)?t+1:t},0);return[16,17,18,91,92].includes(e.keyCode)?t:t+1}function EB(e,t,n){var r,i;if(!e.key)return!1;if(cB(t))return e.keyCode===t&&t;var a=t.split(`.`),o=0;try{for(var s=vj(a),c=s.next();!c.done;c=s.next()){var l=c.value,u=CB[l],d=SB[l.toLowerCase()];(u&&u(e)||d&&d===e.keyCode)&&o++}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return n?o===a.length&&TB(e)===a.length&&t:o===a.length&&t}function DB(e,t){return oB(e)?e:wB(e)?function(n){return EB(n,e,t)}:Array.isArray(e)?function(n){return e.find(function(e){return EB(n,e,t)})}:function(){return!!e}}var OB=[`keydown`];function kB(e,t,n){var r=n||{},i=r.events,a=i===void 0?OB:i,o=r.target,s=r.exactMatch,c=s!==void 0&&s,l=r.useCapture,u=l!==void 0&&l,d=pB(t),f=pB(e);xB(function(){var e,t,n,r=gB(o,window);if(r){var i=function(e){var t=e,n=DB(f.current,c)(t),r=wB(n)?n:t.key;if(n)return d.current?.call(d,t,r)};try{for(var s=vj(a),l=s.next();!l.done;l=s.next()){var p=l.value;(n=r?.addEventListener)==null||n.call(r,p,i,u)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return function(){var e,t,n;try{for(var o=vj(a),s=o.next();!s.done;s=o.next()){var c=s.value;(n=r?.removeEventListener)==null||n.call(r,c,i,u)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}}},[a],o)}var AB=`AHOOKS_SYNC_STORAGE_EVENT_NAME`,jB=function(e){return function(t,n){n===void 0&&(n={});var r,i=n.listenStorageChange,a=i!==void 0&&i,o=oB(n.serializer)?n.serializer:JSON.stringify,s=oB(n.deserializer)?n.deserializer:JSON.parse,c=oB(n.onError)?n.onError:console.error;try{r=e()}catch(e){c(e)}var l=function(){try{var e=r?.getItem(t);if(e)return s(e)}catch(e){c(e)}return oB(n.defaultValue)?n.defaultValue():n.defaultValue},u=yj((0,b.useState)(l),2),d=u[0],f=u[1],p=(0,b.useRef)(d);p.current=d,dB(function(){var e=l();Object.is(e,p.current)||(p.current=e,f(e))},[t]);var m=function(e){var n=p.current,i=oB(e)?e(n):e;if(!Object.is(i,n)){a||(p.current=i,f(i));try{var s=void 0,l=r?.getItem(t);lB(i)?(s=null,r?.removeItem(t)):(s=o(i),r?.setItem(t,s)),dispatchEvent(new CustomEvent(AB,{detail:{key:t,newValue:s,oldValue:l,storageArea:r}}))}catch(e){c(e)}}},h=function(e){if(!(e.key!==t||e.storageArea!==r)){var n=l();Object.is(n,p.current)||(p.current=n,f(n))}};return bB(`storage`,h,{enable:a}),bB(AB,function(e){h(e.detail)},{enable:a}),[d,uB(m)]}}(function(){return hB?localStorage:void 0}),MB=function(e,t){var n=uB(e),r=(0,b.useRef)(null),i=(0,b.useCallback)(function(){r.current&&clearTimeout(r.current)},[]);return(0,b.useEffect)(function(){if(!(!cB(t)||t<0))return r.current=setTimeout(n,t),i},[t]),i},NB=Ni(`inline-flex items-center justify-center rounded-full border font-medium whitespace-nowrap shrink-0 [&>svg]:shrink-0 [&>svg]:pointer-events-none`,{variants:{variant:{secondary:`border-border bg-background text-muted-foreground`,primary:`border-transparent bg-primary text-primary-foreground`,success:`border-badge-success/30 bg-badge-success/10 text-badge-success`,warning:`border-badge-warning/30 bg-badge-warning/10 text-badge-warning`,error:`border-badge-error/30 bg-badge-error/10 text-badge-error`},size:{sm:`px-1.5 py-px gap-0.5 type-text-xs [&>svg]:size-2.5`,md:`px-[9px] py-0.5 gap-1 type-text-sm [&>svg]:size-3`}},defaultVariants:{variant:`secondary`,size:`md`}});function PB({className:e,variant:t,size:n,children:r,...i}){return(0,H.jsx)(`span`,{className:Mr(NB({variant:t,size:n}),e),...i,children:r})}var FB=new Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:1}),IB=e=>`skybridge-devtools-dismissed-${e}-warning`,LB={"tool-output":{badge:`Large response`,title:`Large model-visible output`,description:`Content and structured content count toward this estimate. Large responses can consume significant context or exceed limits in some clients and models.`},"view-state":{badge:`Large context`,title:`Large model-visible view state`,description:`Persisted view state and data-llm context count toward this estimate. Keep only content the model needs.`}};function RB({kind:e}){return(0,H.jsx)(PB,{size:`sm`,variant:`warning`,children:LB[e].badge})}function zB({kind:e,tokenCount:t}){let n=LB[e],[r,i]=(0,b.useState)(()=>sessionStorage.getItem(IB(e))===`true`);return r?null:(0,H.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,H.jsx)(iO,{className:`rounded-none border-x-0 border-t-0 py-2 pl-3 pr-10`,title:`${n.title} (~${FB.format(t)} tokens)`,description:n.description}),(0,H.jsx)(`button`,{type:`button`,"aria-label":`Dismiss ${n.badge.toLowerCase()} warning for this session`,onClick:()=>{sessionStorage.setItem(IB(e),`true`),i(!0)},className:`absolute right-2 top-2 inline-flex size-6 cursor-pointer items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-badge-warning/10 hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,children:(0,H.jsx)(Ai,{className:`size-3.5`})})]})}function BB(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function VB(e,t){if(e==null)return{};var n,r,i=BB(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function HB(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function UB(e){if(Array.isArray(e))return HB(e)}function WB(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function GB(e,t){if(e){if(typeof e==`string`)return HB(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?HB(e,t):void 0}}function KB(){throw TypeError(`Invalid attempt to spread non-iterable instance.
203
203
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qB(e){return UB(e)||WB(e)||GB(e)||KB()}function JB(e){"@babel/helpers - typeof";return JB=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},JB(e)}function YB(e,t){if(JB(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(JB(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function XB(e){var t=YB(e,`string`);return JB(t)==`symbol`?t:t+``}function ZB(e,t,n){return(t=XB(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QB(){return QB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},QB.apply(null,arguments)}function $B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?$B(Object(n),!0).forEach(function(t){ZB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$B(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tV(e){var t=e.length;if(t===0||t===1)return e;if(t===2)return[e[0],e[1],`${e[0]}.${e[1]}`,`${e[1]}.${e[0]}`];if(t===3)return[e[0],e[1],e[2],`${e[0]}.${e[1]}`,`${e[0]}.${e[2]}`,`${e[1]}.${e[0]}`,`${e[1]}.${e[2]}`,`${e[2]}.${e[0]}`,`${e[2]}.${e[1]}`,`${e[0]}.${e[1]}.${e[2]}`,`${e[0]}.${e[2]}.${e[1]}`,`${e[1]}.${e[0]}.${e[2]}`,`${e[1]}.${e[2]}.${e[0]}`,`${e[2]}.${e[0]}.${e[1]}`,`${e[2]}.${e[1]}.${e[0]}`];if(t>=4)return[e[0],e[1],e[2],e[3],`${e[0]}.${e[1]}`,`${e[0]}.${e[2]}`,`${e[0]}.${e[3]}`,`${e[1]}.${e[0]}`,`${e[1]}.${e[2]}`,`${e[1]}.${e[3]}`,`${e[2]}.${e[0]}`,`${e[2]}.${e[1]}`,`${e[2]}.${e[3]}`,`${e[3]}.${e[0]}`,`${e[3]}.${e[1]}`,`${e[3]}.${e[2]}`,`${e[0]}.${e[1]}.${e[2]}`,`${e[0]}.${e[1]}.${e[3]}`,`${e[0]}.${e[2]}.${e[1]}`,`${e[0]}.${e[2]}.${e[3]}`,`${e[0]}.${e[3]}.${e[1]}`,`${e[0]}.${e[3]}.${e[2]}`,`${e[1]}.${e[0]}.${e[2]}`,`${e[1]}.${e[0]}.${e[3]}`,`${e[1]}.${e[2]}.${e[0]}`,`${e[1]}.${e[2]}.${e[3]}`,`${e[1]}.${e[3]}.${e[0]}`,`${e[1]}.${e[3]}.${e[2]}`,`${e[2]}.${e[0]}.${e[1]}`,`${e[2]}.${e[0]}.${e[3]}`,`${e[2]}.${e[1]}.${e[0]}`,`${e[2]}.${e[1]}.${e[3]}`,`${e[2]}.${e[3]}.${e[0]}`,`${e[2]}.${e[3]}.${e[1]}`,`${e[3]}.${e[0]}.${e[1]}`,`${e[3]}.${e[0]}.${e[2]}`,`${e[3]}.${e[1]}.${e[0]}`,`${e[3]}.${e[1]}.${e[2]}`,`${e[3]}.${e[2]}.${e[0]}`,`${e[3]}.${e[2]}.${e[1]}`,`${e[0]}.${e[1]}.${e[2]}.${e[3]}`,`${e[0]}.${e[1]}.${e[3]}.${e[2]}`,`${e[0]}.${e[2]}.${e[1]}.${e[3]}`,`${e[0]}.${e[2]}.${e[3]}.${e[1]}`,`${e[0]}.${e[3]}.${e[1]}.${e[2]}`,`${e[0]}.${e[3]}.${e[2]}.${e[1]}`,`${e[1]}.${e[0]}.${e[2]}.${e[3]}`,`${e[1]}.${e[0]}.${e[3]}.${e[2]}`,`${e[1]}.${e[2]}.${e[0]}.${e[3]}`,`${e[1]}.${e[2]}.${e[3]}.${e[0]}`,`${e[1]}.${e[3]}.${e[0]}.${e[2]}`,`${e[1]}.${e[3]}.${e[2]}.${e[0]}`,`${e[2]}.${e[0]}.${e[1]}.${e[3]}`,`${e[2]}.${e[0]}.${e[3]}.${e[1]}`,`${e[2]}.${e[1]}.${e[0]}.${e[3]}`,`${e[2]}.${e[1]}.${e[3]}.${e[0]}`,`${e[2]}.${e[3]}.${e[0]}.${e[1]}`,`${e[2]}.${e[3]}.${e[1]}.${e[0]}`,`${e[3]}.${e[0]}.${e[1]}.${e[2]}`,`${e[3]}.${e[0]}.${e[2]}.${e[1]}`,`${e[3]}.${e[1]}.${e[0]}.${e[2]}`,`${e[3]}.${e[1]}.${e[2]}.${e[0]}`,`${e[3]}.${e[2]}.${e[0]}.${e[1]}`,`${e[3]}.${e[2]}.${e[1]}.${e[0]}`]}var nV={};function rV(e){if(e.length===0||e.length===1)return e;var t=e.join(`.`);return nV[t]||(nV[t]=tV(e)),nV[t]}function iV(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return rV(e.filter(function(e){return e!==`token`})).reduce(function(e,t){return eV(eV({},e),n[t])},t)}function aV(e){return e.join(` `)}function oV(e,t){var n=0;return function(r){return n+=1,r.map(function(r,i){return sV({node:r,stylesheet:e,useInlineStyles:t,key:`code-segment-${n}-${i}`})})}}function sV(e){var t=e.node,n=e.stylesheet,r=e.style,i=r===void 0?{}:r,a=e.useInlineStyles,o=e.key,s=t.properties,c=t.type,l=t.tagName,u=t.value;if(c===`text`)return u;if(l){var d=oV(n,a),f;if(!a)f=eV(eV({},s),{},{className:aV(s.className)});else{var p=Object.keys(n).reduce(function(e,t){return t.split(`.`).forEach(function(t){e.includes(t)||e.push(t)}),e},[]),m=s.className&&s.className.includes(`token`)?[`token`]:[],h=s.className&&m.concat(s.className.filter(function(e){return!p.includes(e)}));f=eV(eV({},s),{},{className:aV(h)||void 0,style:iV(s.className,Object.assign({},s.style,i),n)})}var g=d(t.children);return b.createElement(l,QB({key:o},f),g)}}var cV=(function(e,t){return e.listLanguages().indexOf(t)!==-1}),lV=[`language`,`children`,`style`,`customStyle`,`codeTagProps`,`useInlineStyles`,`showLineNumbers`,`showInlineLineNumbers`,`startingLineNumber`,`lineNumberContainerStyle`,`lineNumberStyle`,`wrapLines`,`wrapLongLines`,`lineProps`,`renderer`,`PreTag`,`CodeTag`,`code`,`astGenerator`];function uV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?uV(Object(n),!0).forEach(function(t){ZB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var fV=/\n/g;function pV(e){return e.match(fV)}function mV(e){var t=e.lines,n=e.startingLineNumber,r=e.style;return t.map(function(e,t){var i=t+n;return b.createElement(`span`,{key:`line-${t}`,className:`react-syntax-highlighter-line-number`,style:typeof r==`function`?r(i):r},`${i}
204
204
  `)})}function hV(e){var t=e.codeString,n=e.codeStyle,r=e.containerStyle,i=r===void 0?{float:`left`,paddingRight:`10px`}:r,a=e.numberStyle,o=a===void 0?{}:a,s=e.startingLineNumber;return b.createElement(`code`,{style:Object.assign({},n,i)},mV({lines:t.replace(/\n$/,``).split(`
205
205
  `),style:o,startingLineNumber:s}))}function gV(e){return`${e.toString().length}.25em`}function _V(e,t){return{type:`element`,tagName:`span`,properties:{key:`line-number--${e}`,className:[`comment`,`linenumber`,`react-syntax-highlighter-line-number`],style:t},children:[{type:`text`,value:e}]}}function vV(e,t,n){var r={display:`inline-block`,minWidth:gV(n),paddingRight:`1em`,textAlign:`right`,userSelect:`none`},i=typeof e==`function`?e(t):e;return dV(dV({},r),i)}function yV(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,a=e.showInlineLineNumbers,o=e.lineProps,s=o===void 0?{}:o,c=e.className,l=c===void 0?[]:c,u=e.showLineNumbers,d=e.wrapLongLines,f=e.wrapLines,p=f!==void 0&&f?dV({},typeof s==`function`?s(n):s):{};if(p.className=p.className?[].concat(qB(p.className.trim().split(/\s+/)),qB(l)):l,n&&a){var m=vV(r,n,i);t.unshift(_V(n,m))}return d&u&&(p.style=dV({display:`flex`},p.style)),{type:`element`,tagName:`span`,properties:p,children:t}}function bV(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];e.length===void 0&&(e=[e]);for(var r=0;r<e.length;r++){var i=e[r];if(i.type===`text`)n.push(yV({children:[i],className:qB(new Set(t))}));else if(i.children){var a=t.concat(i.properties?.className||[]);bV(i.children,a).forEach(function(e){return n.push(e)})}}return n}function xV(e,t,n,r,i,a,o,s,c){var l,u=bV(e.value),d=[],f=-1,p=0;function m(e,a){return yV({children:e,lineNumber:a,lineNumberStyle:s,largestLineNumber:o,showInlineLineNumbers:i,lineProps:n,className:arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],showLineNumbers:r,wrapLongLines:c,wrapLines:t})}function h(e,t){if(r&&t&&i){var n=vV(s,t,o);e.unshift(_V(t,n))}return e}function g(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return t||r.length>0?m(e,n,r):h(e,n)}for(var _=function(){var e=u[p],t=e.children[0].value;if(pV(t)){var n=t.split(`