PageSourceSearch

https://docs.thena.ai/mintlify-assets/_next/static/chunks/7ba8d954…?dpl=dpl_24gswQDJmKRRvzjLBnaXasvskWww

js thena.ai collected 2026-09-28 06:44:07 UTC 169,155 bytes, 13 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,915476,e=>{"use strict";e.s(["ASSISTANT_OPEN_KEY",()=>t,"ASSISTANT_WIDTH_CSS_VAR",()=>n,"ASSISTANT_WIDTH_KEY",()=>r,"getAssistantScript",()=>o]);let t="chat-assistant-sheet-open",r="chat-assistant-sheet-width",n="--assistant-sheet-width";function a(e,t,r,n,a){try{let o=window.matchMedia("(max-width: 1024px)").matches;if(a){document.documentElement.style.setProperty(r,"0px"),document.documentElement.setAttribute("data-assistant-state","closed");return}if(o||!n){document.documentElement.style.setProperty(r,"0px"),document.documentElement.setAttribute("data-assistant-state","closed"),n||localStorage.setItem(e,"false");return}let s=localStorage.getItem(e);if(null===s){document.documentElement.style.setProperty(r,"0px"),document.documentElement.setAttribute("data-assistant-state","closed");return}let i=JSON.parse(s),l=localStorage.getItem(t),u=null!==l?JSON.parse(l):368;document.documentElement.style.setProperty(r,i?u+"px":"0px"),document.documentElement.setAttribute("data-assistant-state",i?"open":"closed")}catch(e){document.documentElement.style.setProperty(r,"0px"),document.documentElement.setAttribute("data-assistant-state","closed")}}function o(e,s=!1){return`(${a.toString()})(
2    "${t}",
3    "${r}",
4    "${n}",
5    ${e},
6    ${s}
7  )`}},742977,e=>{"use strict";e.s(["PrefetchProvider",()=>d,"usePrefetch",()=>p],742977);var t=e.i(247167),r=e.i(843476),n=e.i(590280),a=e.i(637054);async function o(e){(0,a.isCli)()}var s=e.i(618566),i=e.i(271645);let l="true"===t.default.env.STORYBOOK||"1"===t.default.env.STORYBOOK,u=(0,i.createContext)(null),c={prefetch:()=>{}},d=({children:e,disabled:t=!1})=>{let{isLivePreview:a}=(0,i.useContext)(n.LivePreviewContext),d=(0,i.useRef)([]),p=(0,i.useRef)(0),f=(0,i.useRef)(new Set),m=(0,s.useRouter)(),g=l?c:m,h=(0,i.useMemo)(()=>{let e=async t=>{p.current++;try{g.prefetch(t.href)}catch(e){o({message:`Prefetch failed for route: ${t.href}`,service:t.context?.source?`client-${t.context.source}`:"client-navigation",tags:["prefetch-failure","queued-prefetch"],metadata:{href:t.href,error:e instanceof Error?e.message:String(e),...t.context}})}finally{p.current--,(()=>{if(d.current.length>0&&p.current<8){let t=d.current.shift();t&&e(t)}})()}};return{prefetch:(r,n)=>{if(t||a||f.current.has(r))return;f.current.add(r);let o={href:r,context:n};p.current<8?e(o):d.current.push(o)},getStats:()=>({activeCount:p.current,queuedCount:d.current.length,prefetchedCount:f.current.size})}},[g,t,a]);return(0,r.jsx)(u.Provider,{value:h,children:e})},p=()=>{let e=(0,i.useContext)(u);if(!e)throw Error("usePrefetch must be used within a PrefetchProvider");return e}},182579,(e,t,r)=>{"use strict";var n=e.i(467034);let a=void 0!==n.Buffer,o=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,s=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function i(e,t,r){null==r&&null!==t&&"object"==typeof t&&(r=t,t=void 0),a&&n.Buffer.isBuffer(e)&&(e=e.toString()),e&&65279===e.charCodeAt(0)&&(e=e.slice(1));let i=JSON.parse(e,t);if(null===i||"object"!=typeof i)return i;let u=r&&r.protoAction||"error",c=r&&r.constructorAction||"error";if("ignore"===u&&"ignore"===c)return i;if("ignore"!==u&&"ignore"!==c){if(!1===o.test(e)&&!1===s.test(e))return i}else if("ignore"!==u&&"ignore"===c){if(!1===o.test(e))return i}else if(!1===s.test(e))return i;return l(i,{protoAction:u,constructorAction:c,safe:r&&r.safe})}function l(e,{protoAction:t="error",constructorAction:r="error",safe:n}={}){let a=[e];for(;a.length;){let e=a;for(let o of(a=[],e)){if("ignore"!==t&&Object.prototype.hasOwnProperty.call(o,"__proto__")){if(!0===n)return null;if("error"===t)throw SyntaxError("Object contains forbidden prototype property");delete o.__proto__}if("ignore"!==r&&Object.prototype.hasOwnProperty.call(o,"constructor")&&Object.prototype.hasOwnProperty.call(o.constructor,"prototype")){if(!0===n)return null;if("error"===r)throw SyntaxError("Object contains forbidden prototype property");delete o.constructor}
7for(let e in o){let t=o[e];t&&"object"==typeof t&&a.push(t)}}}return e}function u(e,t,r){let n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return i(e,t,r)}finally{Error.stackTraceLimit=n}}t.exports=u,t.exports.default=u,t.exports.parse=u,t.exports.safeParse=function(e,t){let r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return i(e,t,{safe:!0})}catch(e){return null}finally{Error.stackTraceLimit=r}},t.exports.scan=l},5695,634292,e=>{"use strict";let t;e.s(["AssistantTransportContext",()=>eJ,"AssistantTransportProvider",()=>eY,"useAssistant",()=>eW],5695);var r,n,a,o,s,i,l=e.i(846726),u=e.i(859465),c=e.i(91557),d=e.i(343590),p=e.i(803333),f=e.i(920028);e.i(247167);var m="vercel.ai.error",g=Symbol.for(m),h=class e extends Error{constructor({name:e,message:t,cause:n}){super(t),this[r]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,m)}static hasMarker(e,t){let r=Symbol.for(t);return null!=e&&"object"==typeof e&&r in e&&"boolean"==typeof e[r]&&!0===e[r]}};r=g;var y=h,v=(Symbol.for("vercel.ai.error.AI_APICallError"),Symbol.for("vercel.ai.error.AI_EmptyResponseBodyError"),"AI_InvalidArgumentError"),x=`vercel.ai.error.${v}`,b=Symbol.for(x),C=class extends y{constructor({message:e,cause:t,argument:r}){super({name:v,message:e,cause:t}),this[n]=!0,this.argument=r}static isInstance(e){return y.hasMarker(e,x)}};n=b,Symbol.for("vercel.ai.error.AI_InvalidPromptError"),Symbol.for("vercel.ai.error.AI_InvalidResponseDataError"),Symbol.for("vercel.ai.error.AI_JSONParseError"),Symbol.for("vercel.ai.error.AI_LoadAPIKeyError"),Symbol.for("vercel.ai.error.AI_LoadSettingError"),Symbol.for("vercel.ai.error.AI_NoContentGeneratedError"),Symbol.for("vercel.ai.error.AI_NoSuchModelError"),Symbol.for("vercel.ai.error.AI_TooManyEmbeddingValuesForCallError"),Symbol.for("vercel.ai.error.AI_TypeValidationError"),Symbol.for("vercel.ai.error.AI_UnsupportedFunctionalityError");var S=e.i(182579);(({prefix:e,size:t=16,alphabet:r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:n="-"}={})=>{let a=((e,t=21)=>(r=t)=>{let n="",a=0|r;for(;a--;)n+=e[Math.random()*e.length|0];return n})(r,t);if(null!=e){if(r.includes(n))throw new C({argument:"separator",message:`The separator "${n}" must not be part of the alphabet "${r}".`});return t=>`${e}${n}${a(t)}`}})(),Symbol.for("vercel.ai.validator");var{btoa:I,atob:E}=globalThis,k="vercel.ai.error",A=Symbol.for(k),w=class e extends Error{constructor({name:e,message:t,cause:r}){super(t),this[a]=!0,this.name=e,this.cause=r}static isInstance(t){return e.hasMarker(t,k)}static hasMarker(e,t){let r=Symbol.for(t);return null!=e&&"object"==typeof e&&r in e&&"boolean"==typeof e[r]&&!0===e[r]}};a=A;var T=w;function R(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}Symbol.for("vercel.ai.error.AI_APICallError"),Symbol.for("vercel.ai.error.AI_EmptyResponseBodyError");var _="AI_InvalidArgumentError",P=`vercel.ai.error.${_}`,N=Symbol.for(P),O=class extends T{constructor({message:e,cause:t,argument:r}){super({name:_,message:e,cause:t}),this[o]=!0,this.argument=r}static isInstance(e){return T.hasMarker(e,P)}};o=N,Symbol.for("vercel.ai.error.AI_InvalidPromptError"),Symbol.for("vercel.ai.error.AI_InvalidResponseDataError");var M="AI_JSONParseError",j=`vercel.ai.error.${M}`,L=Symbol.for(j),D=class extends T{constructor({text:e,cause:t}){super({name:M,message:`JSON parsing failed: Text: ${e}.
8Error message: ${R(t)}`,cause:t}),this[s]=!0,this.text=e}static isInstance(e){return T.hasMarker(e,j)}};s=L,Symbol.for("vercel.ai.error.AI_LoadAPIKeyError"),Symbol.for("vercel.ai.error.AI_LoadSettingError"),Symbol.for("vercel.ai.error.AI_NoContentGeneratedError"),Symbol.for("vercel.ai.error.AI_NoSuchModelError"),Symbol.for("vercel.ai.error.AI_TooManyEmbeddingValuesForCallError");var F="AI_TypeValidationError",V=`vercel.ai.error.${F}`,H=Symbol.for(V),Z=class e extends T{constructor({value:e,cause:t}){super({name:F,message:`Type validation failed: Value: ${JSON.stringify(e)}.
9Error message: ${R(t)}`,cause:t}),this[i]=!0,this.value=e}static isInstance(e){return T.hasMarker(e,V)}static wrap({value:t,cause:r}){return e.isInstance(r)&&r.value===t?r:new e({value:t,cause:r})}};i=H,Symbol.for("vercel.ai.error.AI_UnsupportedFunctionalityError");var K=(({prefix:e,size:t=16,alphabet:r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:n="-"}={})=>{let a=((e,t=21)=>(r=t)=>{let n="",a=0|r;for(;a--;)n+=e[Math.random()*e.length|0];return n})(r,t);if(null==e)return a;
9if(r.includes(n))throw new O({argument:"separator",message:`The separator "${n}" must not be part of the alphabet "${r}".`});return t=>`${e}${n}${a(t)}`})(),B=Symbol.for("vercel.ai.validator");function $({text:e,schema:t}){try{let r=S.default.parse(e);if(null==t)return{success:!0,value:r,rawValue:r};let n=function({value:e,schema:t}){var r;let n="object"==typeof t&&null!==t&&B in t&&!0===t[B]&&"validate"in t?t:(r=t,{[B]:!0,validate:e=>{let t=r.safeParse(e);return t.success?{success:!0,value:t.data}:{success:!1,error:t.error}}});try{if(null==n.validate)return{success:!0,value:e};let t=n.validate(e);if(t.success)return t;return{success:!1,error:Z.wrap({value:e,cause:t.error})}}catch(t){return{success:!1,error:Z.wrap({value:e,cause:t})}}}({value:r,schema:t});return n.success?{...n,rawValue:r}:n}catch(t){return{success:!1,error:D.isInstance(t)?t:new D({text:e,cause:t})}}}var{btoa:U,atob:q}=globalThis;let z=Symbol("Let zodToJsonSchema decide on which parser to use");function J(e,t,r,n){n?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function Y(e,t,r,n,a){e[t]=r,J(e,t,n,a)}var W=e.i(965638);function G(e,t){return el(e.type._def,t)}let X={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(void 0===t&&(t=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),t),ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Q(e,t){let r={type:"string"};if(e.checks)for(let n of e.checks)switch(n.kind){case"min":Y(r,"minLength","number"==typeof r.minLength?Math.max(r.minLength,n.value):n.value,n.message,t);break;case"max":Y(r,"maxLength","number"==typeof r.maxLength?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":er(r,"email",n.message,t);break;case"format:idn-email":er(r,"idn-email",n.message,t);break;case"pattern:zod":en(r,X.email,n.message,t)}break;case"url":er(r,"uri",n.message,t);break;case"uuid":er(r,"uuid",n.message,t);break;case"regex":en(r,n.regex,n.message,t);break;case"cuid":en(r,X.cuid,n.message,t);break;case"cuid2":en(r,X.cuid2,n.message,t);break;case"startsWith":en(r,RegExp(`^${ee(n.value,t)}`),n.message,t);break;case"endsWith":en(r,RegExp(`${ee(n.value,t)}$`),n.message,t);break;case"datetime":er(r,"date-time",n.message,t);break;case"date":er(r,"date",n.message,t);break;case"time":er(r,"time",n.message,t);break;case"duration":er(r,"duration",n.message,t);break;case"length":Y(r,"minLength","number"==typeof r.minLength?Math.max(r.minLength,n.value):n.value,n.message,t),Y(r,"maxLength","number"==typeof r.maxLength?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"includes":en(r,RegExp(ee(n.value,t)),n.message,t);break;case"ip":"v6"!==n.version&&er(r,"ipv4",n.message,t),"v4"!==n.version&&er(r,"ipv6",n.message,t);break;case"base64url":en(r,X.base64url,n.message,t);break;case"jwt":en(r,X.jwt,n.message,t);break;case"cidr":"v6"!==n.version&&en(r,X.ipv4Cidr,n.message,t),"v4"!==n.version&&en(r,X.ipv6Cidr,n.message,t);break;case"emoji":en(r,X.emoji(),n.message,t);break;case"ulid":en(r,X.ulid,n.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":er(r,"binary",n.message,t);break;case"contentEncoding:base64":Y(r,"contentEncoding","base64",n.message,t);break;case"pattern:zod":en(r,X.base64,n.message,t)}break;case"nanoid":en(r,X.nanoid,n.message,t)}return r}function ee(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let r=0;r<e.length;r++)et.has(e[r])||(t+="\\"),t+=e[r];return t}(e):e}let et=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function er(e,t,r,n){e.format||e.anyOf?.some(e=>e.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&n.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&n.errorMessages&&{errorMessage:{format:r}}})):Y(e,"format",t,r,n)}function en(e,t,r,n){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&n.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.allOf.push({pattern:ea(t,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):Y(e,"pattern",ea(t,n),r,n)}
9function ea(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},n=r.i?e.source.toLowerCase():e.source,a="",o=!1,s=!1,i=!1;for(let e=0;e<n.length;e++){if(o){a+=n[e],o=!1;continue}if(r.i){if(s){if(n[e].match(/[a-z]/)){i?(a+=n[e],a+=`${n[e-2]}-${n[e]}`.toUpperCase(),i=!1):"-"===n[e+1]&&n[e+2]?.match(/[a-z]/)?(a+=n[e],i=!0):a+=`${n[e]}${n[e].toUpperCase()}`;continue}}else if(n[e].match(/[a-z]/)){a+=`[${n[e]}${n[e].toUpperCase()}]`;continue}}if(r.m){if("^"===n[e]){a+=`(^|(?<=[\r
10]))`;continue}else if("$"===n[e]){a+=`($|(?=[\r
11]))`;continue}}if(r.s&&"."===n[e]){a+=s?`${n[e]}\r
12`:`[${n[e]}\r
13]`;continue}a+=n[e],"\\"===n[e]?o=!0:s&&"]"===n[e]?s=!1:s||"["!==n[e]||(s=!0)}try{new RegExp(a)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return a}function eo(e,t){if("openAi"===t.target&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),"openApi3"===t.target&&e.keyType?._def.typeName===W.ZodFirstPartyTypeKind.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((r,n)=>({...r,[n]:el(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",n]})??{}}),{}),additionalProperties:!1};let r={type:"object",additionalProperties:el(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??{}};if("openApi3"===t.target)return r;if(e.keyType?._def.typeName===W.ZodFirstPartyTypeKind.ZodString&&e.keyType._def.checks?.length){let{type:n,...a}=Q(e.keyType._def,t);return{...r,propertyNames:a}}if(e.keyType?._def.typeName===W.ZodFirstPartyTypeKind.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===W.ZodFirstPartyTypeKind.ZodBranded&&e.keyType._def.type._def.typeName===W.ZodFirstPartyTypeKind.ZodString&&e.keyType._def.type._def.checks?.length){let{type:n,...a}=G(e.keyType._def,t);return{...r,propertyNames:a}}return r}let es={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"},ei=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,r)=>el(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0));return r.length?{anyOf:r}:void 0};function el(e,t,r=!1){let n=t.seen.get(e);if(t.override){let a=t.override?.(e,t,n,r);if(a!==z)return a}if(n&&!r){let e=eu(n,t);if(void 0!==e)return e}let a={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,a);let o=ed(e,e.typeName,t);return o&&ep(e,t,o),a.jsonSchema=o,o}let eu=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:ec(t.currentPath,e.path)};case"none":case"seen":if(e.path.length<t.currentPath.length&&e.path.every((e,r)=>t.currentPath[r]===e))return console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{};return"seen"===t.$refStrategy?{}:void 0}},ec=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")},ed=(e,t,r)=>{switch(t){case W.ZodFirstPartyTypeKind.ZodString:return Q(e,r);case W.ZodFirstPartyTypeKind.ZodNumber:return function(e,t){let r={type:"number"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"int":r.type="integer",J(r,"type",n.message,t);break;case"min":"jsonSchema7"===t.target?n.inclusive?Y(r,"minimum",n.value,n.message,t):Y(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),Y(r,"minimum",n.value,n.message,t));break;case"max":"jsonSchema7"===t.target?n.inclusive?Y(r,"maximum",n.value,n.message,t):Y(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),Y(r,"maximum",n.value,n.message,t));break;case"multipleOf":Y(r,"multipleOf",n.value,n.message,t)}return r}(e,r);case W.ZodFirstPartyTypeKind.ZodObject:return function(e,t){let r="openAi"===t.target,n={type:"object",...Object.entries(e.shape()).reduce((e,[n,a])=>{if(void 0===a||void 0===a._def)return e;let o=a.isOptional();o&&r&&(a instanceof W.ZodOptional&&(a=a._def.innerType),a.isNullable()||(a=a.nullable()),o=!1);let s=el(a._def,{...t,currentPath:[...t.currentPath,"properties",n],propertyPath:[...t.currentPath,"properties",n]});return void 0===s?e:{properties:{...e.properties,[n]:s},required:o?e.required:[...e.required,n]}},{properties:{},required:[]}),additionalProperties:"strict"===t.removeAdditionalStrategy?"ZodNever"===e.catchall._def.typeName?"strict"!==e.unknownKeys:el(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??!0:"ZodNever"===e.catchall._def.typeName?"passthrough"===e.unknownKeys:el(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??!0};return n.required.length||delete n.required,n}(e,r);case W.ZodFirstPartyTypeKind.ZodBigInt:return function(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"min":"jsonSchema7"===t.target?n.inclusive?Y(r,"minimum",n.value,n.message,t):Y(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),Y(r,"minimum",n.value,n.message,t));break;case"max":"jsonSchema7"===t.target?n.inclusive?Y(r,"maximum",n.value,n.message,t):Y(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),Y(r,"maximum",n.value,n.message,t));break;case"multipleOf":Y(r,"multipleOf",n.value,n.message,t)}return r}(e,r);case W.ZodFirstPartyTypeKind.ZodBoolean:return{type:"boolean"};case W.ZodFirstPartyTypeKind.ZodDate:return function e(t,r,n){let a=n??r.dateStrategy;if(Array.isArray(a))return{anyOf:a.map((n,a)=>e(t,r,n))};switch(a){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":var o=t,s=r;let i={type:"integer",format:"unix-time"};if("openApi3"===s.target)return i;for(let e of o.checks)switch(e.kind){case"min":Y(i,"minimum",e.value,e.message,s);break;case"max":Y(i,"maximum",e.value,e.message,s)}return i}}(e,r);case W.ZodFirstPartyTypeKind.ZodUndefined:return{not:{}};case W.ZodFirstPartyTypeKind.ZodNull:return"openApi3"===r.target?{enum:["null"],nullable:!0}:{type:"null"};case W.ZodFirstPartyTypeKind.ZodArray:return function(e,t){let r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==W.ZodFirstPartyTypeKind.ZodAny&&(r.items=el(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&Y(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&Y(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(Y(r,"minItems",e.exactLength.value,e.exactLength.message,t),Y(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}(e,r);case W.ZodFirstPartyTypeKind.ZodUnion:case W.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return function(e,t){if("openApi3"===t.target)return ei(e,t);let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(e=>e._def.typeName in es&&(!e._def.checks||!e._def.checks.length))){let e=r.reduce((e,t)=>
13{let r=es[t._def.typeName];return r&&!e.includes(r)?[...e,r]:e},[]);return{type:e.length>1?e:e[0]}}if(r.every(e=>"ZodLiteral"===e._def.typeName&&!e.description)){let e=r.reduce((e,t)=>{let r=typeof t._def.value;switch(r){case"string":case"number":case"boolean":return[...e,r];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}},[]);if(e.length===r.length){let t=e.filter((e,t,r)=>r.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:r.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(r.every(e=>"ZodEnum"===e._def.typeName))return{type:"string",enum:r.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return ei(e,t)}(e,r);case W.ZodFirstPartyTypeKind.ZodIntersection:return function(e,t){let r=[el(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),el(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(e=>!!e),n="jsonSchema2019-09"===t.target?{unevaluatedProperties:!1}:void 0,a=[];return r.forEach(e=>{if((!("type"in e)||"string"!==e.type)&&"allOf"in e)a.push(...e.allOf),void 0===e.unevaluatedProperties&&(n=void 0);else{let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){let{additionalProperties:r,...n}=e;t=n}else n=void 0;a.push(t)}}),a.length?{allOf:a,...n}:void 0}(e,r);case W.ZodFirstPartyTypeKind.ZodTuple:return function(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((e,r)=>el(e._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:el(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,r)=>el(e._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])}}(e,r);case W.ZodFirstPartyTypeKind.ZodRecord:return eo(e,r);case W.ZodFirstPartyTypeKind.ZodLiteral:return function(e,t){let r=typeof e.value;return"bigint"!==r&&"number"!==r&&"boolean"!==r&&"string"!==r?{type:Array.isArray(e.value)?"array":"object"}:"openApi3"===t.target?{type:"bigint"===r?"integer":r,enum:[e.value]}:{type:"bigint"===r?"integer":r,const:e.value}}(e,r);case W.ZodFirstPartyTypeKind.ZodEnum:return{type:"string",enum:Array.from(e.values)};case W.ZodFirstPartyTypeKind.ZodNativeEnum:return function(e){let t=e.values,r=Object.keys(e.values).filter(e=>"number"!=typeof t[t[e]]).map(e=>t[e]),n=Array.from(new Set(r.map(e=>typeof e)));return{type:1===n.length?"string"===n[0]?"string":"number":["string","number"],enum:r}}(e);case W.ZodFirstPartyTypeKind.ZodNullable:return function(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return"openApi3"===t.target?{type:es[e.innerType._def.typeName],nullable:!0}:{type:[es[e.innerType._def.typeName],"null"]};if("openApi3"===t.target){let r=el(e.innerType._def,{...t,currentPath:[...t.currentPath]});return r&&"$ref"in r?{allOf:[r],nullable:!0}:r&&{...r,nullable:!0}}let r=el(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}(e,r);case W.ZodFirstPartyTypeKind.ZodOptional:return((e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return el(e.innerType._def,t);let r=el(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:{}},r]}:{}})(e,r);case W.ZodFirstPartyTypeKind.ZodMap:return function(e,t){return"record"===t.mapStrategy?eo(e,t):{type:"array",maxItems:125,items:{type:"array",items:[el(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},el(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{}],minItems:2,maxItems:2}}}(e,r);case W.ZodFirstPartyTypeKind.ZodSet:return function(e,t){let r={type:"array",uniqueItems:!0,items:el(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&Y(r,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&Y(r,"maxItems",e.maxSize.value,e.maxSize.message,t),r}(e,r);case W.ZodFirstPartyTypeKind.ZodLazy:return el(e.getter()._def,r);case W.ZodFirstPartyTypeKind.ZodPromise:return el(e.type._def,r);case W.ZodFirstPartyTypeKind.ZodNaN:case W.ZodFirstPartyTypeKind.ZodNever:return{not:{}};case W.ZodFirstPartyTypeKind.ZodEffects:return function(e,t){return"input"===t.effectStrategy?el(e.schema._def,t):{}}(e,r);case W.ZodFirstPartyTypeKind.ZodAny:case W.ZodFirstPartyTypeKind.ZodUnknown:return{};case W.ZodFirstPartyTypeKind.ZodDefault:return function(e,t){return{...el(e.innerType._def,t),default:e.defaultValue()}}(e,r);case W.ZodFirstPartyTypeKind.ZodBranded:return G(e,r);case W.ZodFirstPartyTypeKind.ZodReadonly:case W.ZodFirstPartyTypeKind.ZodCatch:return el(e.innerType._def,r);case W.ZodFirstPartyTypeKind.ZodPipeline:return((e,t)=>{if("input"===t.pipeStrategy)return el(e.in._def,t);if("output"===t.pipeStrategy)return el(e.out._def,t);let r=el(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=el(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(e=>void 0!==e)}})(e,r);case W.ZodFirstPartyTypeKind.ZodFunction:case W.ZodFirstPartyTypeKind.ZodVoid:case W.ZodFirstPartyTypeKind.ZodSymbol:default:return}},ep=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r);var ef={code:"0",name:"text",parse:e=>{if("string"!=typeof e)throw Error('"text" parts expect a string value.');return{type:"text",value:e}}},em={code:"3",name:"error",parse:e=>{if("string"!=typeof e)throw Error('"error" parts expect a string value.');return{type:"error",value:e}}},eg={code:"4",name:"assistant_message",parse:e=>{if(null==e||"object"!=typeof e||!("id"in e)||!("role"in e)||!("content"in e)||"string"!=typeof e.id||"string"!=typeof e.role||"assistant"!==e.role||!Array.isArray(e.content)||!e.content.every(e=>null!=e&&"object"==typeof e&&"type"in e&&"text"===e.type&&"text"in e&&null!=e.text&&"object"==typeof e.text&&"value"in e.text&&"string"==typeof e.text.value))throw Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},eh={code:"5",name:"assistant_control_data",parse:e=>{if(null==e||"object"!=typeof e||!("threadId"in e)||!("messageId"in e)||"string"!=typeof e.threadId||"string"!=typeof e.messageId)throw Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},ey={code:"6",name:"data_message",parse:e=>{if(null==e||"object"!=typeof e||!("role"in e)||!("data"in e)||"string"!=typeof e.role||"data"!==e.role)throw Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}},ev=[ef,em,eg,eh,ey];ef.code,em.code,eg.code,eh.code,ey.code,ef.name,ef.code,em.name,em.code,eg.name,eg.code,eh.name,eh.code,ey.name,ey.code,ev.map(e=>e.code);var ex=[{code:"0",name:"text",parse:e=>{if("string"!=typeof e)throw Error('"text" parts expect a string value.');return{type:"text",value:e}}},{code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw Error('"data" parts expect an array value.');return{type:"data",value:e}}},{code:"3",name:"error",parse:e=>{if("string"!=typeof e)throw Error('"error" parts expect a string value.');return{type:"error",value:e}}},{code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},{code:"9",name:"tool_call",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("toolName"in e)||"string"!=typeof e.toolName||!("args"in e)||"object"!=typeof e.args)throw Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},{code:"a",name:"tool_result",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("result"in e))throw Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:e}}},{code:"b",name:"tool_call_streaming_start",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("toolName"in e)||"string"!=typeof e.toolName)throw Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:e}}},{code:"c",name:"tool_call_delta",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("argsTextDelta"in e)||"string"!=typeof e.argsTextDelta)throw Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:e}}},{code:"d",name:"finish_message",parse:e=>{if(null==e||"object"!=typeof e||!("finishReason"in e)||"string"!=typeof e.finishReason)throw Error('"finish_message" parts expect an object with a "finishReason" property.');let t={finishReason:e.finishReason};return"usage"in e&&null!=e.usage&&"object"==typeof e.usage&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:"number"==typeof e.usage.promptTokens?e.usage.promptTokens:NaN,completionTokens:"number"==typeof e.usage.completionTokens?e.usage.completionTokens:NaN}),{type:"finish_message",value:t}}}
13,{code:"e",name:"finish_step",parse:e=>{if(null==e||"object"!=typeof e||!("finishReason"in e)||"string"!=typeof e.finishReason)throw Error('"finish_step" parts expect an object with a "finishReason" property.');let t={finishReason:e.finishReason,isContinued:!1};return"usage"in e&&null!=e.usage&&"object"==typeof e.usage&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:"number"==typeof e.usage.promptTokens?e.usage.promptTokens:NaN,completionTokens:"number"==typeof e.usage.completionTokens?e.usage.completionTokens:NaN}),"isContinued"in e&&"boolean"==typeof e.isContinued&&(t.isContinued=e.isContinued),{type:"finish_step",value:t}}},{code:"f",name:"start_step",parse:e=>{if(null==e||"object"!=typeof e||!("messageId"in e)||"string"!=typeof e.messageId)throw Error('"start_step" parts expect an object with an "id" property.');return{type:"start_step",value:{messageId:e.messageId}}}},{code:"g",name:"reasoning",parse:e=>{if("string"!=typeof e)throw Error('"reasoning" parts expect a string value.');return{type:"reasoning",value:e}}},{code:"h",name:"source",parse:e=>{if(null==e||"object"!=typeof e)throw Error('"source" parts expect a Source object.');return{type:"source",value:e}}},{code:"i",name:"redacted_reasoning",parse:e=>{if(null==e||"object"!=typeof e||!("data"in e)||"string"!=typeof e.data)throw Error('"redacted_reasoning" parts expect an object with a "data" property.');return{type:"redacted_reasoning",value:{data:e.data}}}},{code:"j",name:"reasoning_signature",parse:e=>{if(null==e||"object"!=typeof e||!("signature"in e)||"string"!=typeof e.signature)throw Error('"reasoning_signature" parts expect an object with a "signature" property.');return{type:"reasoning_signature",value:{signature:e.signature}}}},{code:"k",name:"file",parse:e=>{if(null==e||"object"!=typeof e||!("data"in e)||"string"!=typeof e.data||!("mimeType"in e)||"string"!=typeof e.mimeType)throw Error('"file" parts expect an object with a "data" and "mimeType" property.');return{type:"file",value:e}}}],eb=Object.fromEntries(ex.map(e=>[e.code,e]));Object.fromEntries(ex.map(e=>[e.name,e.code]));var eC=ex.map(e=>e.code),eS=e=>{let t=e.indexOf(":");if(-1===t)throw Error("Failed to parse stream string. No separator found.");let r=e.slice(0,t);if(!eC.includes(r))throw Error(`Failed to parse stream string. Invalid code ${r}.`);let n=JSON.parse(e.slice(t+1));return eb[r].parse(n)};async function eI({stream:e,onTextPart:t,onReasoningPart:r,onReasoningSignaturePart:n,onRedactedReasoningPart:a,onSourcePart:o,onFilePart:s,onDataPart:i,onErrorPart:l,onToolCallStreamingStartPart:u,onToolCallDeltaPart:c,onToolCallPart:d,onToolResultPart:p,onMessageAnnotationsPart:f,onFinishMessagePart:m,onFinishStepPart:g,onStartStepPart:h}){let y=e.getReader(),v=new TextDecoder,x=[],b=0;for(;;){let{value:e}=await y.read();if(e&&(x.push(e),b+=e.length,10!==e[e.length-1]))continue;if(0===x.length)break;let C=function(e,t){let r=new Uint8Array(t),n=0;for(let t of e)r.set(t,n),n+=t.length;return e.length=0,r}(x,b);for(let{type:e,value:y}of(b=0,v.decode(C,{stream:!0}).split("\n").filter(e=>""!==e).map(eS)))switch(e){case"text":await (null==t?void 0:t(y));break;case"reasoning":await (null==r?void 0:r(y));break;case"reasoning_signature":await (null==n?void 0:n(y));break;case"redacted_reasoning":await (null==a?void 0:a(y));break;case"file":await (null==s?void 0:s(y));break;case"source":await (null==o?void 0:o(y));break;case"data":await (null==i?void 0:i(y));break;case"error":await (null==l?void 0:l(y));break;case"message_annotations":await (null==f?void 0:f(y));break;case"tool_call_streaming_start":await (null==u?void 0:u(y));break;case"tool_call_delta":await (null==c?void 0:c(y));break;case"tool_call":await (null==d?void 0:d(y));break;case"tool_result":await (null==p?void 0:p(y));break;case"finish_message":await (null==m?void 0:m(y));break;case"finish_step":await (null==g?void 0:g(y));break;case"start_step":await (null==h?void 0:h(y));break;default:throw Error(`Unknown stream part type: ${e}`)}}}async function eE({stream:e,update:t,onToolCall:r,onFinish:n,generateId:a=K,getCurrentDate:o=()=>new Date,lastMessage:s}){var i,l;let u,c,d,p=(null==s?void 0:s.role)==="assistant",f=p?1+(null!=(l=null==(i=s.toolInvocations)?void 0:i.reduce((e,t)=>
13{var r;return Math.max(e,null!=(r=t.step)?r:0)},0))?l:0):0,m=p?structuredClone(s):{id:a(),createdAt:o(),role:"assistant",content:"",parts:[]};function g(e,t){let r=m.parts.find(t=>"tool-invocation"===t.type&&t.toolInvocation.toolCallId===e);null!=r?r.toolInvocation=t:m.parts.push({type:"tool-invocation",toolInvocation:t})}let h=[],y=p?null==s?void 0:s.annotations:void 0,v={},x={completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},b="unknown";function C(){let e=[...h];(null==y?void 0:y.length)&&(m.annotations=y),t({message:{...structuredClone(m),revisionId:a()},data:e,replaceLastMessage:p})}await eI({stream:e,onTextPart(e){null==u?(u={type:"text",text:e},m.parts.push(u)):u.text+=e,m.content+=e,C()},onReasoningPart(e){var t;null==d?(d={type:"text",text:e},null!=c&&c.details.push(d)):d.text+=e,null==c?(c={type:"reasoning",reasoning:e,details:[d]},m.parts.push(c)):c.reasoning+=e,m.reasoning=(null!=(t=m.reasoning)?t:"")+e,C()},onReasoningSignaturePart(e){null!=d&&(d.signature=e.signature)},onRedactedReasoningPart(e){null==c&&(c={type:"reasoning",reasoning:"",details:[]},m.parts.push(c)),c.details.push({type:"redacted",data:e.data}),d=void 0,C()},onFilePart(e){m.parts.push({type:"file",mimeType:e.mimeType,data:e.data}),C()},onSourcePart(e){m.parts.push({type:"source",source:e}),C()},onToolCallStreamingStartPart(e){null==m.toolInvocations&&(m.toolInvocations=[]),v[e.toolCallId]={text:"",step:f,toolName:e.toolName,index:m.toolInvocations.length};let t={state:"partial-call",step:f,toolCallId:e.toolCallId,toolName:e.toolName,args:void 0};m.toolInvocations.push(t),g(e.toolCallId,t),C()},onToolCallDeltaPart(e){let t=v[e.toolCallId];t.text+=e.argsTextDelta;let{value:r}=function(e){if(void 0===e)return{value:void 0,state:"undefined-input"};let t=$({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=$({text:function(e){let t=["ROOT"],r=-1,n=null;function a(e,a,o){switch(e){case'"':r=a,t.pop(),t.push(o),t.push("INSIDE_STRING");break;case"f":case"t":case"n":r=a,n=a,t.pop(),t.push(o),t.push("INSIDE_LITERAL");break;case"-":t.pop(),t.push(o),t.push("INSIDE_NUMBER");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r=a,t.pop(),t.push(o),t.push("INSIDE_NUMBER");break;case"{":r=a,t.pop(),t.push(o),t.push("INSIDE_OBJECT_START");break;case"[":r=a,t.pop(),t.push(o),t.push("INSIDE_ARRAY_START")}}function o(e,n){switch(e){case",":t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":r=n,t.pop()}}function s(e,n){switch(e){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":r=n,t.pop()}}for(let i=0;i<e.length;i++){let l=e[i];switch(t[t.length-1]){case"ROOT":a(l,i,"FINISH");break;case"INSIDE_OBJECT_START":switch(l){case'"':t.pop(),t.push("INSIDE_OBJECT_KEY");break;case"}":r=i,t.pop()}break;case"INSIDE_OBJECT_AFTER_COMMA":'"'===l&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break;case"INSIDE_OBJECT_KEY":'"'===l&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break;case"INSIDE_OBJECT_AFTER_KEY":":"===l&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break;case"INSIDE_OBJECT_BEFORE_VALUE":a(l,i,"INSIDE_OBJECT_AFTER_VALUE");break;case"INSIDE_OBJECT_AFTER_VALUE":o(l,i);break;case"INSIDE_STRING":switch(l){case'"':t.pop(),r=i;break;case"\\":t.push("INSIDE_STRING_ESCAPE");break;default:r=i}break;case"INSIDE_ARRAY_START":"]"===l?(r=i,t.pop()):(r=i,a(l,i,"INSIDE_ARRAY_AFTER_VALUE"));break;case"INSIDE_ARRAY_AFTER_VALUE":switch(l){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":r=i,t.pop();break;default:r=i}break;case"INSIDE_ARRAY_AFTER_COMMA":a(l,i,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_STRING_ESCAPE":t.pop(),r=i;break;case"INSIDE_NUMBER":switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r=i;break;case"e":case"E":case"-":case".":break;case",":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&s(l,i),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&o(l,i);break;case"}":t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&o(l,i);break;case"]":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&s(l,i);break;default:t.pop()}break;case"INSIDE_LITERAL":{let a=e.substring(n,i+1);"false".startsWith(a)||"true".startsWith(a)||"null".startsWith(a)?r=i:(t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]?o(l,i):"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&s(l,i))}}}let i=e.slice(0,r+1);for(let r=t.length-1;r>=0;r--)switch(t[r]){case"INSIDE_STRING":i+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":i+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":i+="]";break;case"INSIDE_LITERAL":{let t=e.substring(n,e.length);"true".startsWith(t)?i+="true".slice(t.length):"false".startsWith(t)?i+="false".slice(t.length):"null".startsWith(t)&&(i+="null".slice(t.length))}}return i}(e)})).success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"}}(t.text),n={state:"partial-call",step:t.step,toolCallId:e.toolCallId,toolName:t.toolName,args:r};m.toolInvocations[t.index]=n,g(e.toolCallId,n),C()},async onToolCallPart(e){let t={state:"call",step:f,...e};if(null!=v[e.toolCallId]?m.toolInvocations[v[e.toolCallId].index]=t:(null==m.toolInvocations&&(m.toolInvocations=[]),m.toolInvocations.push(t)),g(e.toolCallId,t),C(),r){let t=await r({toolCall:e});if(null!=t){let r={state:"result",step:f,...e,result:t};m.toolInvocations[m.toolInvocations.length-1]=r,g(e.toolCallId,r),C()}}},onToolResultPart(e){let t=m.toolInvocations;if(null==t)throw Error("tool_result must be preceded by a tool_call");let r=t.findIndex(t=>t.toolCallId===e.toolCallId);if(-1===r)throw Error("tool_result must be preceded by a tool_call with the same toolCallId");let n={...t[r],state:"result",...e};t[r]=n,g(e.toolCallId,n),C()},onDataPart(e){h.push(...e),C()},onMessageAnnotationsPart(e){null==y?y=[...e]:y.push(...e),C()},onFinishStepPart(e){f+=1,u=e.isContinued?u:void 0,c=void 0,d=void 0},onStartStepPart(e){p||(m.id=e.messageId),m.parts.push({type:"step-start"}),C()},onFinishMessagePart(e){b=e.finishReason,null!=e.usage&&(x=function({promptTokens:e,completionTokens:t}){return{promptTokens:e,completionTokens:t,totalTokens:e+t}}(e.usage))},onErrorPart(e){throw Error(e)}}),null==n||n({message:m,finishReason:b,usage:x})}async function ek({stream:e,onTextPart:t}){let r=e.pipeThrough(new TextDecoderStream).getReader();for(;;){let{done:e,value:n}=await r.read();if(e)break;await t(n)}}
13async function eA({stream:e,update:t,onFinish:r,getCurrentDate:n=()=>new Date,generateId:a=K}){let o={type:"text",text:""},s={id:a(),createdAt:n(),role:"assistant",content:"",parts:[o]};await ek({stream:e,onTextPart:e=>{s.content+=e,o.text+=e,t({message:{...s},data:[],replaceLastMessage:!1})}}),null==r||r(s,{usage:{completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},finishReason:"unknown"})}async function ew({api:e,body:t,streamProtocol:r="data",credentials:n,headers:a,abortController:o,restoreMessagesOnFailure:s,onResponse:i,onUpdate:l,onFinish:u,onToolCall:c,generateId:d,fetch:p=fetch,lastMessage:f,requestType:m="generate"}){var g,h,y;let v="resume"===m?p(`${e}?chatId=${t.id}`,{method:"GET",headers:{"Content-Type":"application/json",...a},signal:null==(g=null==o?void 0:o())?void 0:g.signal,credentials:n}):p(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",...a},signal:null==(h=null==o?void 0:o())?void 0:h.signal,credentials:n}),x=await v.catch(e=>{throw s(),e});if(i)try{await i(x)}catch(e){throw e}if(!x.ok)throw s(),Error(null!=(y=await x.text())?y:"Failed to fetch the chat response.");if(!x.body)throw Error("The response body is empty.");switch(r){case"text":return void await eA({stream:x.body,update:l,onFinish:u,generateId:d});case"data":return void await eE({stream:x.body,update:l,lastMessage:f,onToolCall:c,onFinish({message:e,finishReason:t,usage:r}){u&&null!=e&&u(e,{usage:r,finishReason:t})},generateId:d});default:throw Error(`Unknown stream protocol: ${r}`)}}function eT(e){return null==e?void 0:e.reduce((e,t)=>{var r;return Math.max(e,null!=(r=t.step)?r:0)},0)}function eR(e){var t;return null!=(t=e.parts)?t:[...e.toolInvocations?e.toolInvocations.map(e=>({type:"tool-invocation",toolInvocation:e})):[],...e.reasoning?[{type:"reasoning",reasoning:e.reasoning,details:[{type:"text",text:e.reasoning}]}]:[],...e.content?[{type:"text",text:e.content}]:[]]}function e_(e){return e.map(e=>({...e,parts:eR(e)}))}async function eP(e){if(!e)return[];if(globalThis.FileList&&e instanceof globalThis.FileList)return Promise.all(Array.from(e).map(async e=>{let{name:t,type:r}=e;return{name:t,contentType:r,url:await new Promise((t,r)=>{let n=new FileReader;n.onload=e=>{var r;t(null==(r=e.target)?void 0:r.result)},n.onerror=e=>r(e),n.readAsDataURL(e)})}}));if(Array.isArray(e))return e;throw Error("Invalid attachments type")}function eN(e){if("assistant"!==e.role)return!1;let t=e.parts.reduce((e,t,r)=>"step-start"===t.type?r:e,-1),r=e.parts.slice(t+1).filter(e=>"tool-invocation"===e.type);return r.length>0&&r.every(e=>"result"in e.toolInvocation)}Symbol.for("vercel.ai.schema");var eO=e.i(271645),eM=e.i(283599),ej=e.i(561866);function eL(e,t){return null!=t?(0,ej.default)(e,t):e}var eD=e.i(50270),eF=e.i(346944),eV=e.i(865420),eH=e.i(604780),eZ=e.i(279183),eK=e.i(16731);let eB=[402,403,404,413,418,420,429,503],e$=eD.z.object({message:eD.z.string().optional()}),eU={402:{type:"payment",message:"Usage of this feature is temporarily limited. Please try again later or contact the site owner to restore access."},403:{type:"rate_limited",message:"You're sending too many messages. Please wait a moment and try again."},404:{type:"not_found",message:"There was an error sending your message. Please refresh and try again."},413:{type:"thread_limit",message:"You have reached the maximum number of messages in a thread. Please start a new thread to continue."},418:{type:"blocked",message:"The assistant is unavailable from your network. If you are using a VPN, please turn it off and try again."},420:{type:"heuristic_blocked",message:"Your request could not be verified. Please refresh and try again."},429:{type:"rate_limited",message:"You're sending too many messages. Please wait a moment and try again."}},eq={type:"unknown",message:"This feature is temporarily unavailable. Please try again later or contact the site owner to restore access."},ez=e=>e?eU[e]??eq:eq,eJ=(0,eO.createContext)(void 0);function eY({children:e}){let t=(()=>{let e=(0,eO.useContext)(u.AssistantUiContext),[t,r]=(0,eO.useState)(!1),{subdomain:n}=(0,eO.useContext)(c.DeploymentMetadataContext),a=(0,eH.useCaptcha)(),o=(0,eO.useRef)(a);o.current=a;let s=(0,eO.useRef)(null),i=(0,eO.useRef)(null),m=(0,eO.useRef)(null),{userInfo:g}=(0,eO.useContext)(c.AuthContext),{currentPathVersion:h,selectedLocale:y,locales:v}=(0,eO.useContext)(d.NavigationContext),x=(0,p.useCurrentPath)(),b=y??v?.[0],C=(0,eK.useUserGroups)(),S=(0,eZ.default)(e=>e.conversationVersion),I=(0,eZ.default)(e=>e.messages.length>0)?S:h,E=(0,eV.useAnalyticsContext)("docs.assistant.completed"),k=(0,eV.useAnalyticsContext)("docs.assistant.errored"),A=(0,eO.useRef)(""),w=(0,eZ.default)(e=>e.featureUnavailable),T=(0,eZ.default)(e=>e.setFeatureUnavailable),R=(0,eO.useRef)(null),_=(0,eO.useRef)(!1),P=(0,eO.useRef)(!1),N=(0,eO.useRef)(!1),O=(0,eO.useRef)(void 0),[M,j]=(0,eO.useState)(),{threadId:L,setThreadId:D,threadKey:F,setThreadKey:V,setMessageUlid:H,payloadInput:Z,setPayloadInput:B}=(0,eZ.default)((0,eF.useShallow)(e=>({threadId:e.threadId,setThreadId:e.setThreadId,threadKey:e.threadKey,setThreadKey:e.setThreadKey,setMessageUlid:e.setMessageUlid,payloadInput:e.payloadInput,setPayloadInput:e.setPayloadInput})));(0,eO.useEffect)(()=>{let e=sessionStorage.getItem("threadKey");e&&!F&&V(e)},[F,V]);let $=t=>{if(P.current=!0,"AbortError"===t.name)return;if(null!==s.current){j(void 0);let e=s.current;s.current=null,J(e);let t=[...eZ.default.getState().messages],r=t.findLastIndex(e=>"user"===e.role);-1!==r&&(t.splice(r),W(t)),T({unavailable:!0,type:"captcha_required",message:i.current??"Unable to verify your browser. Please try again. If this issue persists, refresh your browser."}),i.current=null;return}if(null!==m.current){m.current=null;return}let r=eB.find(e=>t.message.includes(String(e)))??(t.message.includes("Payment Required")?402:void 0);if(r){let e=ez(r);T({unavailable:!0,type:e.type,message:e.message});return}console.error("Assistant message stream failed",t),k({assistantUi:e,errorName:t.name,errorMessage:t.message,threadId:L,subdomain:n}),T({unavailable:!0,type:"stream_error",message:"There was an error generating a response. Please check your connection and try again."})},{input:U,status:q,handleSubmit:z,setInput:J,messages:Y,setMessages:W,append:G,data:X,setData:Q,reload:ee,stop:et,error:er}=function({api:e="/api/chat",id:t,initialMessages:r,initialInput:n="",sendExtraMessageFields:a,onToolCall:o,experimental_prepareRequestBody:s,maxSteps:i=1,streamProtocol:l="data",onResponse:u,onFinish:c,onError:d,credentials:p,headers:f,body:m,generateId:g=K,fetch:h,keepLastMessageOnError:y=!0,experimental_throttle:v}={}){let[x]=(0,eO.useState)(g),b=null!=t?t:x,C="string"==typeof e?[e,b]:b,S=function(e){let[t,r]=(0,eO.useState)(e);return(0,eO.useEffect)(()=>{!function e(t,r){if(t===r)return!0;
13if(null==t||null==r)return!1;if("object"!=typeof t&&"object"!=typeof r)return t===r;if(t.constructor!==r.constructor)return!1;if(t instanceof Date&&r instanceof Date)return t.getTime()===r.getTime();if(Array.isArray(t)){if(t.length!==r.length)return!1;for(let n=0;n<t.length;n++)if(!e(t[n],r[n]))return!1;return!0}let n=Object.keys(t),a=Object.keys(r);if(n.length!==a.length)return!1;for(let o of n)if(!a.includes(o)||!e(t[o],r[o]))return!1;return!0}(e,t)&&r(e)},[e,t]),t}(null!=r?r:[]),I=(0,eO.useMemo)(()=>e_(S),[S]),{data:E,mutate:k}=(0,eM.default)([C,"messages"],null,{fallbackData:I}),A=(0,eO.useRef)(E||[]);(0,eO.useEffect)(()=>{A.current=E||[]},[E]);let{data:w,mutate:T}=(0,eM.default)([C,"streamData"],null),R=(0,eO.useRef)(w);(0,eO.useEffect)(()=>{R.current=w},[w]);let{data:_="ready",mutate:P}=(0,eM.default)([C,"status"],null),{data:N,mutate:O}=(0,eM.default)([C,"error"],null),M=(0,eO.useRef)(null),j=(0,eO.useRef)({credentials:p,headers:f,body:m});(0,eO.useEffect)(()=>{j.current={credentials:p,headers:f,body:m}},[p,f,m]);let L=(0,eO.useCallback)(async(t,r="generate")=>{var n,p;P("submitted"),O(void 0);let f=e_(t.messages),m=f.length,x=eT(null==(n=f[f.length-1])?void 0:n.toolInvocations);try{M.current=new AbortController;let n=eL(k,v),i=eL(T,v),d=A.current;n(f,!1);let m=a?f:f.map(({role:e,content:t,experimental_attachments:r,data:n,annotations:a,toolInvocations:o,parts:s})=>({role:e,content:t,...void 0!==r&&{experimental_attachments:r},...void 0!==n&&{data:n},...void 0!==a&&{annotations:a},...void 0!==o&&{toolInvocations:o},...void 0!==s&&{parts:s}})),x=R.current;await ew({api:e,body:null!=(p=null==s?void 0:s({id:b,messages:f,requestData:t.data,requestBody:t.body}))?p:{id:b,messages:m,data:t.data,...j.current.body,...t.body},streamProtocol:l,credentials:j.current.credentials,headers:{...j.current.headers,...t.headers},abortController:()=>M.current,restoreMessagesOnFailure(){y||n(d,!1)},onResponse:u,onUpdate({message:e,data:t,replaceLastMessage:r}){P("streaming"),n([...r?f.slice(0,f.length-1):f,e],!1),(null==t?void 0:t.length)&&i([...null!=x?x:[],...t],!1)},onToolCall:o,onFinish:c,generateId:g,fetch:h,lastMessage:f[f.length-1],requestType:r}),M.current=null,P("ready")}catch(e){if("AbortError"===e.name)return M.current=null,P("ready"),null;d&&e instanceof Error&&d(e),O(e),P("error")}let C=A.current;(function({originalMaxToolInvocationStep:e,originalMessageCount:t,maxSteps:r,messages:n}){var a;let o=n[n.length-1];return r>1&&null!=o&&(n.length>t||eT(o.toolInvocations)!==e)&&eN(o)&&(null!=(a=eT(o.toolInvocations))?a:0)<r})({originalMaxToolInvocationStep:x,originalMessageCount:m,maxSteps:i,messages:C})&&await L({messages:C})},[k,P,e,j,u,c,d,O,T,R,l,a,s,o,i,A,M,g,h,y,v,b]),D=(0,eO.useCallback)(async(e,{data:t,headers:r,body:n,experimental_attachments:a=e.experimental_attachments}={})=>{var o,s;let i=await eP(a);return L({messages:A.current.concat({...e,id:null!=(o=e.id)?o:g(),createdAt:null!=(s=e.createdAt)?s:new Date,experimental_attachments:i.length>0?i:void 0,parts:eR(e)}),headers:r,body:n,data:t})},[L,g]),F=(0,eO.useCallback)(async({data:e,headers:t,body:r}={})=>{let n=A.current;return 0===n.length?null:L({messages:"assistant"===n[n.length-1].role?n.slice(0,-1):n,headers:t,body:r,data:e})},[L]),V=(0,eO.useCallback)(()=>{M.current&&(M.current.abort(),M.current=null)},[]),H=(0,eO.useCallback)(async()=>{L({messages:A.current},"resume")},[L]),Z=(0,eO.useCallback)(e=>{"function"==typeof e&&(e=e(A.current));let t=e_(e);k(t,!1),A.current=t},[k]),B=(0,eO.useCallback)(e=>{"function"==typeof e&&(e=e(R.current)),T(e,!1),R.current=e},[T]),[$,U]=(0,eO.useState)(n),q=(0,eO.useCallback)(async(e,t={},r)=>{var n;if(null==(n=null==e?void 0:e.preventDefault)||n.call(e),!$&&!t.allowEmptySubmit)return;r&&(j.current={...j.current,...r});let a=await eP(t.experimental_attachments);L({messages:A.current.concat({id:g(),createdAt:new Date,role:"user",content:$,experimental_attachments:a.length>0?a:void 0,parts:[{type:"text",text:$}]}),headers:t.headers,body:t.body,data:t.data}),U("")},[$,g,L]),z=(0,eO.useCallback)(({toolCallId:e,result:t})=>{let r=A.current;!function({messages:e,toolCallId:t,toolResult:r}){var n;let a=e[e.length-1],o=a.parts.find(e=>"tool-invocation"===e.type&&e.toolInvocation.toolCallId===t);if(null==o)return;let s={...o.toolInvocation,state:"result",result:r};o.toolInvocation=s,a.toolInvocations=null==(n=a.toolInvocations)?void 0:n.map(e=>e.toolCallId===t?s:e)}({messages:r,toolCallId:e,toolResult:t}),k([...r.slice(0,r.length-1),{...r[r.length-1]}],!1),"submitted"!==_&&"streaming"!==_&&eN(r[r.length-1])&&L({messages:r})},[k,_,L]);
13return{messages:null!=E?E:[],id:b,setMessages:Z,data:w,setData:B,error:N,append:D,reload:F,stop:V,experimental_resume:H,input:$,setInput:U,handleInputChange:e=>{U(e.target.value)},handleSubmit:q,isLoading:"submitted"===_||"streaming"===_,status:_,addToolResult:z}}({api:(0,l.getAiMessageUrl)({subdomain:n??"",isAuthenticated:!!g}),id:n,body:{fp:n,threadId:L,threadKey:F,...(0,f.getFilterClause)({userGroups:C,version:I,language:b}),context:Z.context,currentPath:x},fetch:async(e,t)=>{let r,n=!1;if(i.current=null,m.current=null,t?.body&&"string"==typeof t.body){let e=await o.current.prepareForSend().catch(()=>({trustToken:o.current.getTrustToken(),captchaToken:null,captchaError:"captcha_init_failed"})),r=JSON.parse(t.body),a=sessionStorage.getItem("threadKey");a&&(r.threadKey=a),N.current&&(N.current=!1,r.regenerate=!0),e.trustToken&&(r._=e.trustToken),e.captchaToken&&(r.captchaToken=e.captchaToken),e.captchaError&&(r.captchaError=e.captchaError,n=!0),t={...t,body:JSON.stringify(r)}}try{r=await fetch(e,t)}catch(t){let e=t instanceof Error&&"AbortError"===t.name;if(n&&!e){let e=[...eZ.default.getState().messages].reverse().find(e=>"user"===e.role);e&&(s.current=e.content)}throw t}let a=r.headers.get("x-thread-id"),l=r.headers.get("x-thread-key");a&&!_.current&&D(a),l&&!_.current&&(V(l),sessionStorage.setItem("threadKey",l));let u=r.headers.get("x-message-id");if(u&&(R.current=u),o.current.resetWidget(),400===r.status||419===r.status||450===r.status){(400===r.status||419===r.status)&&await o.current.refetchConfig();let e=e$.safeParse(await r.clone().json().catch(()=>void 0));i.current=e.success?e.data.message??null:null;let t=[...eZ.default.getState().messages].reverse().find(e=>"user"===e.role);throw t&&(s.current=t.content),Error(`Request failed with status ${r.status}`)}if(eB.includes(r.status)){let e=ez(r.status),t=418===r.status||420===r.status?r.headers.get("cf-ray")??void 0:void 0;m.current=r.status,T({unavailable:!0,type:e.type,message:e.message,rayId:t})}else r.ok&&w.unavailable&&T({unavailable:!1,type:null,message:""});return r},sendExtraMessageFields:!0,initialMessages:[],streamProtocol:"data",experimental_throttle:100,onError:$,onFinish:(t,{finishReason:r})=>{_.current||(eZ.default.getState().setMessageComplete(t.id,!P.current&&("stop"===r||"tool-calls"===r||"unknown"===r)&&!t.parts?.some(e=>"tool-invocation"===e.type&&"result"!==e.toolInvocation.state)),R.current&&(H(t.id,R.current),R.current=null),E({assistantUi:e,query:A.current,content:t.content,citations:(e=>{let t=[];return e?.forEach(e=>{"tool-invocation"===e.type&&"result"===e.toolInvocation.state&&"search"===e.toolInvocation.toolName&&e.toolInvocation.result.results?.forEach(e=>{t.push({title:e.metadata.title,url:e.path})})}),t})(t.parts),sessionId:t.id,subdomain:n}))}}),en=(0,eO.useCallback)(()=>{P.current=!0,r(!0),et()},[et]);(0,eO.useEffect)(()=>{eZ.default.getState().messages!==Y&&eZ.default.setState({messages:Y});let{pendingContext:e,setPendingContext:t,setMessageContext:r,stagedAttachments:n,setStagedAttachments:a,setMessageAttachments:o}=eZ.default.getState(),s=Y.filter(e=>"user"===e.role).pop();s&&(e&&e.length>0&&(r(s.id,e),t(void 0)),n&&n.length>0&&(o(s.id,n),a(void 0)))},[Y]),(0,eO.useEffect)(()=>{eZ.default.getState().status!==q&&eZ.default.setState({status:q})},[q]);let ea="submitted"===q||"streaming"===q&&X&&0===X.length,eo="submitted"===q||"streaming"===q,es=(0,eO.useCallback)(()=>{j(void 0),_.current=!0,eZ.default.getState().activeStop?.(),en(),r(!1),W([]),Q([]),D(void 0),V(void 0),sessionStorage.removeItem("threadKey"),eZ.default.setState({messages:[],activeStop:void 0,pendingAttachments:[],stagedAttachments:void 0,messageIdToAttachments:{},messageIdToComplete:{},toolCallIdToSelectedOption:{},conversationVersion:void 0}),T({unavailable:!1,type:null,message:""})},[en,W,Q,D,V,T]);return{acceptedSubmissionId:M,input:U,status:q,handleSubmit:t=>{if(eo)return t?.preventDefault(),!1;let a=eZ.default.getState();if("assistant-ui-v2"===e&&(t?.preventDefault(),void 0!==O.current||!U.trim()&&!a.pendingAttachments.length&&!Z.context?.length))return!1;P.current=!1,r(!1),_.current=!1,N.current=!1,("captcha_required"===w.type||"stream_error"===w.type)&&T({unavailable:!1,type:null,message:""}),0===eZ.default.getState().messages.length&&eZ.default.setState({conversationVersion:h}),eZ.default.setState({activeStop:en});let{pendingAttachments:o}=a,s=o.length>0?o.map(e=>({name:e.name,contentType:e.type,url:e.url})):void 0,i=void 0!==s||"assistant-ui-v2"===e&&!!Z.context?.length;(""!==U||i)&&(A.current=U);let l={experimental_attachments:s,body:{fp:n,threadId:L,threadKey:F,...(0,f.getFilterClause)({userGroups:C,version:I,language:b}),context:Z.context,currentPath:x}};if("assistant-ui-v2"===e){let e=crypto.randomUUID();O.current=e,a.setMessageContext(e,Z.context??[]),a.setMessageAttachments(e,[...o]),j(e),G({id:e,role:"user",content:U,parts:[{type:"text",text:U}]},l).catch(t=>{O.current===e&&$(t instanceof Error?t:Error("Unable to submit the message"))}).finally(()=>{O.current===e&&(O.current=void 0)}),J("")}else z(t,{...l,allowEmptySubmit:i});return!0},setInput:J,messages:Y,setMessages:W,append:(0,eO.useCallback)((...t)=>{if(P.current=!1,r(!1),_.current=!1,N.current=!1,("captcha_required"===w.type||"stream_error"===w.type)&&T({unavailable:!1,type:null,message:""}),0===eZ.default.getState().messages.length&&eZ.default.setState({conversationVersion:h}),eZ.default.setState({activeStop:en}),"user"===t[0].role&&(A.current=t[0].content),"assistant-ui-v2"===e&&"user"===t[0].role){let e=t[0].id??crypto.randomUUID();return j(e),G({...t[0],id:e},t[1])}return G(...t)},[e,G,en,w.type,T,h]),isLoading:ea,onClear:es,onReload:()=>{P.current=!1,r(!1);let t=Y.at(-1);t?.role==="assistant"&&eZ.default.getState().setMessageComplete(t.id,!1),eZ.default.setState({activeStop:en}),N.current=!0;let n=Y.findLast(e=>"user"===e.role);n&&(A.current=n.content),ee("assistant-ui-v2"===e&&n?{body:{context:eZ.default.getState().messageIdToContext[n.id]??[]}}:void 0)},stop:en,isStopped:t,threadId:L,isInProgress:eo,error:er,isFeatureUnavailable:w,payloadInput:Z,setPayloadInput:B,ensureCaptchaScriptLoaded:a.ensureCaptchaScriptLoaded}})();return(0,eO.createElement)(eJ.Provider,{value:t},e)}function eW(){let e=(0,eO.useContext)(eJ);if(void 0===e)throw Error("Assistant requires AssistantTransportProvider.");return e}e.s(["AssistantTransportV5Context",()=>eX,"loadAssistantV5",()=>eG,"useAssistantV5",()=>eQ],634292);let eG=()=>e.A(93985),eX=(0,eO.createContext)(void 0);function eQ(){let e=(0,eO.useContext)(eX);if(void 0===e)throw Error("Assistant requires AssistantTransportProviderV5.");return e}},647908,732610,535345,994947,e=>{"use strict";e.s(["useIOSScrollLock",()=>i],647908);let t=0,r=null;e.s(["isIOS",()=>o,"isLinux",()=>a,"isSafari",()=>n],732610);let n=()=>{let e=window.navigator.userAgent;return/Safari/.test(e)&&!/Chrome/.test(e)&&!/Chromium/.test(e)},a=()=>{let e=window.navigator.userAgent;return/Linux/i.test(e)&&!/Android/i.test(e)},o=()=>{let e=window.navigator;return/iP(hone|ad|od)/.test(e.userAgent)||/Macintosh/.test(e.userAgent)&&e.maxTouchPoints>1};var s=e.i(271645);let i=e=>{(0,s.useEffect)(()=>
13{if(e&&o())return(()=>{if(1===(t+=1)){let{body:e}=document,t=window.scrollY,n={overflow:e.style.overflow,position:e.style.position,top:e.style.top,width:e.style.width,height:e.style.height};e.style.overflow="hidden",e.style.position="fixed",e.style.top=`-${t}px`,e.style.width="100%",e.style.height="100%",r=()=>{e.style.overflow=n.overflow,e.style.position=n.position,e.style.top=n.top,e.style.width=n.width,e.style.height=n.height,window.scrollTo(0,t)}}let e=!1;return()=>{!e&&(e=!0,0==(t-=1)&&r&&(r(),r=null))}})()},[e])};e.s(["useActionKey",()=>c],535345);let l=["Ctrl ","Control"],u=["⌘","Command"];function c(){let[e,t]=(0,s.useState)(u);return(0,s.useEffect)(()=>{"undefined"!=typeof navigator&&(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?t(u):t(l))},[]),e}e.s(["useAssistantNavigation",()=>x],994947);var d=e.i(859465),p=e.i(803333),f=e.i(279183),m=e.i(135799),g=e.i(674987),h=e.i(12358);e.i(914140);var y=e.i(773626),v=e.i(618566);function x(e){let t=(0,v.useRouter)(),r=(0,p.useCurrentPath)(),n=(0,d.useAssistantV5Enabled)(),a=(0,f.default)(e=>e.messages),o=(0,m.default)(e=>e.messages),i=(0,s.useMemo)(()=>n?function(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(r?.role==="assistant")for(let e=r.parts.length-1;e>=0;e--){let t=r.parts[e];if(!t)continue;let n=(0,h.readToolPart)(t);if(n?.toolName==="navigateToPage"&&n.isResult)return{id:n.toolCallId,result:n.output}}}}(o):function(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(r?.role!=="assistant")continue;let n=r.parts??[];for(let e=n.length-1;e>=0;e--){let t=n[e];if(t?.type==="tool-invocation"&&"navigateToPage"===t.toolInvocation.toolName&&"result"===t.toolInvocation.state){let e=t.toolInvocation.result;return{id:t.toolInvocation.toolCallId,result:e}}}}}(a),[n,a,o]),l=(0,s.useRef)(i?.id);(0,s.useEffect)(()=>{if(!i||i.id===l.current)return;l.current=i.id;let{path:n}=i.result;if(!n)return;let a=`/${n.replace(/^[/\\]+/,"")}`;(0,y.isEqualIgnoringLeadingSlash)(a,r)||(t.push((0,g.navHref)(a)),e?.())},[i,r,t,e])}},395671,e=>{"use strict";e.s(["useAssistantShared",()=>a]);var t=e.i(5695),r=e.i(634292),n=e.i(271645);function a(){let e=(0,n.useContext)(t.AssistantTransportContext),a=(0,n.useContext)(r.AssistantTransportV5Context)??e;if(void 0===a)throw Error("Assistant requires an assistant transport provider.");return a}},28760,268532,e=>{"use strict";e.s(["SEARCH_ABORTED",()=>p,"useSearch",()=>f],28760);var t=e.i(91557),r=e.i(343590),n=e.i(206558);e.s(["useResolvedNav",()=>s],268532);var a=e.i(669979),o=e.i(271645);function s(){let{navWithMetadata:e,divisions:t,versionsDict:n}=(0,o.useContext)(r.NavigationContext),s=(0,a.usePageNavStore)(e=>e.pageNav);return e||!s?{navWithMetadata:e,divisions:t,versionsDict:n}:s}var i=e.i(637054),l=e.i(194838),u=e.i(866285);class c extends Error{status;constructor(e){super(`Search request failed with status ${e}`),this.status=e}}let d=async({subdomain:e,query:t,filters:r,signal:a,authMode:o="none"})=>{let s;s="authenticated"===o?`${n.NEXT_PUBLIC.BASE_PATH}/_mintlify/api/search`:"public"===o?`${n.NEXT_PUBLIC.BASE_PATH}/_mintlify/api-public/search/${e}`:`${n.NEXT_PUBLIC.AI_MESSAGE_HOST}/api/search/${e}`;let i=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},signal:a,body:JSON.stringify({query:t,...r?{filters:r}:{}})});if(!i.ok)throw new c(i.status);let d=(await i.json()).results.map(e=>{let t=(0,l.optionallyAddLeadingSlash)(e.page),r=e.metadata.hash,n=e.metadata.title,a=t;if(r)a=`${t}#${r}`;else n&&(a=`${t}#${(0,u.default)(n,{decamelize:!1,preserveCharacters:["_"]})}`);let o={title:e.metadata.title,breadcrumbs:e.metadata.breadcrumbs,icon:e.metadata.icon,hash:e.metadata.hash,openapi:e.metadata.openapi,version:e.metadata.version};return{id:`${e.page}${r??""}`,header:e.header,content:e.content,page:e.page,link:a,metadata:o,score:e.score}});return{id:crypto.randomUUID(),results:(e=>{let t=new Map;for(let r of e)r&&(t.has(r.page)||t.set(r.page,r));return[...t.values()]})(d)}},p="SEARCH_ABORTED",f=()=>{let{subdomain:e,searchSettings:a}=(0,o.useContext)(t.DeploymentMetadataContext),{userInfo:u}=(0,o.useContext)(t.AuthContext),{selectedLocale:f,currentPathVersion:m,selectedVersion:g}=(0,o.useContext)(r.NavigationContext),{versionsDict:h}=s(),y=(0,o.useRef)(null),v=a?.unversioned?void 0:m??g,x=(0,o.useMemo)(()=>{let e=new Map;if(h)for(let t of h.values())t&&!e.has(t)&&e.set(t,e.size);return e},[h]);return(0,o.useEffect)(()=>()=>{y.current&&y.current.abort()},[]),{search:(0,o.useCallback)(async(t,r)=>{if(!e)return{id:crypto.randomUUID(),results:[]};y.current&&y.current.abort();let a=new AbortController;y.current=a;try{let o,s=(0,i.isCli)()?"public":n.NEXT_PUBLIC.AUTH_ENABLED?u?"authenticated":"public":"none",p=void 0===r?{version:v||void 0,language:f}:{version:r.version||void 0,product:r.product||void 0,language:f};try{o=await d({subdomain:e,query:t,filters:p,signal:a.signal,authMode:s})}
13catch(r){if(!(r instanceof c&&(401===r.status||403===r.status))||"authenticated"!==s)throw r;o=await d({subdomain:e,query:t,filters:p,signal:a.signal,authMode:"public"})}if(void 0===r?v:r.version)return o;return{...o,results:function(e,t,r){let n=new Map,a=[],o=e=>{let r=t(e);if(!r)return`u:${e}`;let n=e.split("/"),a=n.indexOf(r);return -1===a?`u:${e}`:(n.splice(a,1),`v:${n.join("/")}`)};for(let t of e){let e=o(t.page),r=n.get(e);r?r.push(t):(n.set(e,[t]),a.push(e))}let s=e=>{let n=t(e);return n?r(n):Number.MAX_SAFE_INTEGER};return a.flatMap(e=>[...n.get(e)??[]].sort((e,t)=>s(e.page)-s(t.page)))}(o.results,e=>h?.get((0,l.optionallyRemoveLeadingSlash)(e)),e=>x.get(e)??Number.MAX_SAFE_INTEGER)}}catch(e){if(e instanceof Error&&"AbortError"===e.name)return p;throw e}},[e,v,h,x,f,u])}}},308735,727677,810595,202225,690236,148099,713203,464132,202672,484325,e=>{"use strict";e.s(["useChatPayloadHighlight",()=>u],308735),e.s(["consumeScheduledPayloadHighlight",()=>s,"highlightPayloadContext",()=>a,"schedulePayloadHighlight",()=>o],727677);var t=e.i(111048),r=e.i(476781);let n="chat-payload-highlight",a=e=>{if(e.elementId){let t=e.elementId.replace(/[^a-zA-Z0-9_-]/g,"_"),n=document.querySelector(`[data-chat-payload-element-id="${t}"]`),a=n?.closest(`.${r.Classes.CodeBlock}`)||n?.closest(`.${r.Classes.CodeGroup}`);if(a)return a.scrollIntoView({behavior:"auto",block:"center"}),a.classList.add("ring-2","ring-offset-[-1px]","ring-primary","dark:ring-primary-light"),setTimeout(()=>{let e=a.getBoundingClientRect(),t=window.innerHeight;Math.abs(e.top+e.height/2-t/2)>100&&a.scrollIntoView({behavior:"auto",block:"center"})},200),setTimeout(()=>{a.classList.remove("ring-2","ring-offset-[-1px]","ring-primary","dark:ring-primary-light")},3e3),!0}if("textSelection"===e.type&&e.value)try{let r=((e,t)=>{let r=document.getElementById(t);if(!r)return!1;let n=e=>e.replace(/\s+/g," ").trim(),a=n(e);for(let e of r.querySelectorAll("p, span, li, h1, h2, h3, h4, h5, h6, td, th, a, code, pre, blockquote, dd, dt, label, figcaption, caption, summary, div"))if(n(e.textContent||"").includes(a)){let t;e.scrollIntoView({behavior:"auto",block:"center"});let r=document.createRange(),o=window.getSelection(),s=[],i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;t=i.nextNode();)s.push(t);let l="",u=[];for(let e of s){let t=e.textContent;if(t)for(let r=0;r<t.length;r++)l+=t[r],u.push({node:e,offset:r})}let c=n(l),d=c.indexOf(a);if(-1!==d){let t=d+a.length,n=0,o=-1,s=-1;for(let e=0;e<l.length;e++){let r=l[e];if(!r)continue;let a=/\s/.test(r);if(n===d&&-1===o&&(o=e),a?n<c.length&&" "===c[n]&&n++:n<c.length&&c[n]===r&&n++,n===t&&-1===s){s=e+1;break}}let i=-1!==o?u[o]:void 0,p=-1!==s?u[s-1]:void 0;i&&p?(r.setStart(i.node,i.offset),r.setEnd(p.node,p.offset+1)):r.selectNodeContents(e)}else r.selectNodeContents(e);return o?.removeAllRanges(),o?.addRange(r),!0}return!1})(e.value.trim(),t.Ids.Content);return r&&setTimeout(()=>{let e=window.getSelection();if(e&&e.rangeCount>0){let t=e.getRangeAt(0),r=t.getBoundingClientRect(),n=window.innerHeight;if(r.top<100||r.bottom>n-100){let e=t.startContainer.parentElement;e?.scrollIntoView({behavior:"auto",block:"center"})}}},200),!!r}catch(e){console.error("Error finding and selecting text:",e)}return!1},o=e=>{try{sessionStorage.setItem(n,JSON.stringify(e))}catch(e){console.error("Unable to schedule payload highlight:",e)}},s=()=>{let e=null;try{e=sessionStorage.getItem(n)}catch{return null}if(!e)return null;try{sessionStorage.removeItem(n)}catch{}try{return JSON.parse(e)}catch(e){return console.error("Unable to parse scheduled payload highlight:",e),null}};var i=e.i(271645),l=e.i(803333);let u=()=>{let e=(0,l.useCurrentPath)();(0,i.useEffect)(()=>{let t=s();if(!t||t.path&&t.path!==e)return;let r=null,n=null,o=()=>{r&&(r.disconnect(),r=null),n&&(window.clearTimeout(n),n=null)},i=()=>{a(t)&&o()};return i(),(r=new MutationObserver(()=>{i()})).observe(document.body,{childList:!0,subtree:!0}),n=window.setTimeout(()=>{o()},5e3),o},[e])};function c(e){let t=(0,i.useRef)(e);return(0,i.useInsertionEffect)(()=>{t.current=e}),(0,i.useCallback)((...e)=>t.current(...e),[])}e.s(["useEffectEvent",()=>c],810595),e.s(["useLocalStorage",()=>p],202225);var d=e.i(39839);let p=(e,t)=>{let[r,n]=(0,d.useLocalStorage)(e,t),[a,o]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{o(!0)},[]),[(0,i.useMemo)(()=>a?r:t,[a,r,t]),n,a]};e.s(["useRecentSearches",()=>m],690236);let f="mintlify-recent-searches";function m(){let[e,t]=(0,i.useState)([]);(0,i.useEffect)(()=>{try{let e=localStorage.getItem(f);if(e){let r=JSON.parse(e);if(Array.isArray(r)){let e=r.filter(e=>e&&"object"==typeof e&&"string"==typeof e.id&&"string"==typeof e.query&&"number"==typeof e.timestamp&&e.searchHit&&"object"==typeof e.searchHit&&"string"==typeof e.searchHit.id);t(e)}}}catch(e){console.error("Failed to load recent searches from localStorage:",e),t([])}},[]);let r=(0,i.useCallback)(e=>{try{localStorage.setItem(f,JSON.stringify(e))}catch(e){console.error("Failed to save recent searches to localStorage:",e)}},[]),n=(0,i.useCallback)((e,n)=>{e.trim()&&n.id&&t(t=>{let a=t.filter(e=>
13e.searchHit.id!==n.id),o=[{id:`${n.id}-${Date.now()}`,query:e.trim(),searchHit:n,timestamp:Date.now()},...a].slice(0,8);return r(o),o})},[r]);return{recentSearches:e,addRecentSearch:n,removeRecentSearch:(0,i.useCallback)(e=>{t(t=>{let n=t.filter(t=>t.id!==e);return r(n),n})},[r]),clearRecentSearches:(0,i.useCallback)(()=>{t([]),r([])},[r])}}function g(e){let t=i.useRef(!0);t.current&&(t.current=!1,e())}e.s([],148099),e.s(["useOnFirstRender",()=>g],713203),e.s(["gridNavigation",()=>y],464132);var h=e.i(621082);function y(e,t,r,n,a,o,s,i,l,u=2){let c=(0,h.getGridNavigatedIndex)(r.current,{event:e,orientation:n,loopFocus:a,rtl:o,cols:u,disabledIndices:s,minIndex:i,maxIndex:l,prevIndex:t>l?i:t,stopEvent:!0});return(0,h.isIndexOutOfListBounds)(r.current,c)?void 0:c}e.s(["ComboboxDerivedItemsContext",()=>C,"ComboboxFloatingContext",()=>b,"ComboboxHasItemsContext",()=>S,"ComboboxInputValueContext",()=>I,"ComboboxRootContext",()=>x,"useComboboxDerivedItemsContext",()=>A,"useComboboxFloatingContext",()=>k,"useComboboxHasItemsContext",()=>T,"useComboboxInputValueContext",()=>w,"useComboboxRootContext",()=>E],202672),e.i(247167);var v=e.i(733332);let x=i.createContext(void 0),b=i.createContext(void 0),C=i.createContext(void 0),S=i.createContext(!1),I=i.createContext("");function E(){let e=i.useContext(x);if(!e)throw Error((0,v.default)(22));return e}function k(){let e=i.useContext(b);if(!e)throw Error((0,v.default)(23));return e}function A(){let e=i.useContext(C);if(!e)throw Error((0,v.default)(24));return e}function w(){return i.useContext(I)}function T(){return i.useContext(S)}e.s(["compareItemEquality",()=>_,"defaultItemEquality",()=>R,"findItemIndex",()=>O,"findSelectionIndex",()=>M,"isSelectedValueDirty",()=>P,"removeItem",()=>L,"resolveSelectedIndex",()=>j,"selectedValueIncludes",()=>N],484325);let R=(e,t)=>Object.is(e,t);function _(e,t,r){return null==e||null==t?Object.is(e,t):r(e,t)}function P(e,t,r){return Array.isArray(e)&&Array.isArray(t)?!function(e,t,r=Object.is){let{length:n}=e;if(n!==t.length)return!1;for(let a=0;a<n;a+=1)if(!r(e[a],t[a]))return!1;return!0}(e,t,(e,t)=>_(e,t,r)):e!==t}function N(e,t,r){return!!e&&e.some(e=>void 0!==e&&_(t,e,r))}function O(e,t,r){return e?e.findIndex(e=>void 0!==e&&_(e,t,r)):-1}function M(e,t,r,n){let a=n&&Array.isArray(t)?e.findIndex(function(e,t){if(t!==R)return r=>N(e,r,t);let r=new Set(e);return r.delete(void 0),t=>r.has(t)&&(0!==t||e.some(e=>Object.is(t,e)))}(t,r)):O(e,t,r);return -1===a?null:a}function j(e,t,r,n,a,o){return N(n,t,a)?null!=o&&e>o&&N(n,r[o],a)?o:e:e===o?M(r,n,a,!0):o}function L(e,t,r){return e.filter(e=>!_(t,e,r))}},186698,e=>{"use strict";function t(e){if(null==e)return"";if("string"==typeof e)return e;try{return JSON.stringify(e)}catch{return String(e)}}e.s(["serializeValue",()=>t])},988713,42191,e=>{"use strict";e.s(["selectors",()=>l],988713);var t=e.i(484325);e.s(["flattenLeafItems",()=>a,"hasNullItemLabel",()=>o,"isGroupedItems",()=>n,"stringifyAsLabel",()=>s,"stringifyAsValue",()=>i],42191),e.i(271645);var r=e.i(186698);function n(e){var t;return"object"==typeof(t=e?.[0])&&null!=t&&Array.isArray(t.items)}function a(e){return n(e)?e.flatMap(e=>e.items):e}function o(e){if(!Array.isArray(e))return null!=e&&"null"in e;if(n(e)){for(let t of e)for(let e of t.items)if(e&&null==e.value&&null!=e.label)return!0;return!1}for(let t of e)if(t&&null==t.value&&null!=t.label)return!0;return!1}function s(e,t){if(t&&null!=e)return t(e)??"";if(e&&"object"==typeof e){if("label"in e&&null!=e.label)return String(e.label);if("value"in e)return String(e.value)}return(0,r.serializeValue)(e)}function i(e,t){return t&&null!=e?t(e)??"":e&&"object"==typeof e&&"value"in e&&"label"in e?(0,r.serializeValue)(e.value):(0,r.serializeValue)(e)}e.i(843476);let l={id:e=>e.id,labelId:e=>e.labelId,items:e=>e.items,selectedValue:e=>e.selectedValue,hasSelectionChips:e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0},hasSelectedValue:e=>{let{selectedValue:t,selectionMode:r}=e;return null!=t&&(!("multiple"===r&&Array.isArray(t))||t.length>0)},hasNullItemLabel:(e,t)=>!!t&&o(e.items),open:e=>e.open,mounted:e=>e.mounted,forceMounted:e=>e.forceMounted,inline:e=>e.inline,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>
13e.activeIndex===t,isSelected:(e,r)=>{let n=e.isItemEqualToValue,a=e.selectedValue;return Array.isArray(a)?a.some(e=>(0,t.compareItemEquality)(r,e,n)):(0,t.compareItemEquality)(r,a,n)},transitionStatus:e=>e.transitionStatus,popupProps:e=>e.popupProps,listProps:e=>e.listProps,inputProps:e=>e.inputProps,triggerProps:e=>e.triggerProps,itemProps:e=>e.itemProps,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupId:e=>e.popupId,triggerElement:e=>e.triggerElement,inputElement:e=>e.inputElement,inputGroupElement:e=>e.inputGroupElement,popupSide:e=>e.popupSide,openMethod:e=>e.openMethod,inputInsidePopup:e=>e.inputInsidePopup,inputOwnsFormValue:e=>e.inputOwnsFormValue,selectionMode:e=>e.selectionMode,name:e=>e.name,form:e=>e.form,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,grid:e=>e.grid,virtualized:e=>e.virtualized,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,modal:e=>e.modal,autoHighlight:e=>e.autoHighlight}},469690,875812,e=>{"use strict";e.s(["DEFAULT_FIELD_ROOT_CONTEXT",()=>l,"FieldRootContext",()=>u,"useFieldRootContext",()=>c],469690),e.i(247167);var t=e.i(733332),r=e.i(271645),n=e.i(956789);e.s(["DEFAULT_FIELD_ROOT_STATE",()=>s,"DEFAULT_FIELD_STATE_ATTRIBUTES",()=>o,"DEFAULT_VALIDITY_STATE",()=>a,"fieldValidityMapping",()=>i],875812);let a={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},o={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},s={disabled:!1,...o},i={valid:e=>null===e?null:e?{"data-valid":""}:{"data-invalid":""}},l={invalid:void 0,name:void 0,validityData:{state:a,errors:[],error:"",value:"",initialValue:null},setValidityData:n.NOOP,disabled:void 0,setTouched:n.NOOP,setDirty:n.NOOP,setFilled:n.NOOP,setFocused:n.NOOP,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:s,registerFieldControl:n.NOOP,validation:{getValidationProps:(e,t=n.EMPTY_OBJECT)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:n.NOOP,getInputControl:()=>null,commit:async()=>{},change:n.NOOP}},u=r.createContext(l);function c(e=!0){let a=r.useContext(u);if(a.setValidityData===n.NOOP&&!e)throw Error((0,t.default)(28));return a}},381104,e=>{"use strict";e.s(["useRegisterFieldControl",()=>a]);var t=e.i(146376),r=e.i(388940),n=e.i(469690);function a(e,o,s,i,l=!0,u){let{registerFieldControl:c}=(0,n.useFieldRootContext)(),d=(0,r.useRefWithInit)(()=>Symbol());(0,t.useIsoLayoutEffect)(()=>{let t=d.current;if(!l)return void c(t,void 0);c(t,{controlRef:e,getValue:i,id:o,name:u,value:s})},[e,l,i,o,u,c,d,s]),(0,t.useIsoLayoutEffect)(()=>{let e=d.current;return()=>{c(e,void 0)}},[c,d])}},884708,247778,e=>{"use strict";e.s(["useFormContext",()=>a],884708),e.i(247167);var t=e.i(271645),r=e.i(956789);let n=t.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:r.NOOP,validationMode:"onSubmit",submitCountRef:{current:0}});function a(){return t.useContext(n)}e.s(["LabelableContext",()=>o,"useLabelableContext",()=>s],247778);let o=t.createContext({controlId:void 0,registerControlId:r.NOOP,resetControlId:r.NOOP,labelId:void 0,setLabelId:r.NOOP,messageIds:[],setMessageIds:r.NOOP,getDescriptionProps:e=>e});function s(){return t.useContext(o)}},538489,e=>{"use strict";e.s(["useLabelableId",()=>l]);var t=e.i(271645),r=e.i(146376),n=e.i(667865),a=e.i(388940),o=e.i(956789),s=e.i(788015),i=e.i(247778);function l(e={}){let{id:u,enabled:c=!0}=e,{controlId:d,registerControlId:p,resetControlId:f}=(0,i.useLabelableContext)(),m=(0,s.useBaseUiId)(),g=(0,a.useRefWithInit)(()=>Symbol()),h=t.useRef(!1),y=t.useRef(!1),v=(0,n.useStableCallback)(()=>{h.current&&p!==o.NOOP&&(h.current=!1,p(g.current,void 0))});return(0,r.useIsoLayoutEffect)(()=>{let e;if(!c||p===o.NOOP)return void v();if(void 0!==u)y.current=!0,e=u;else{if(!y.current)return void f();e=m}if(void 0===e)return void v();h.current=!0,p(g.current,e)},[u,c,p,f,m,g,v]),(0,r.useIsoLayoutEffect)(()=>v,[v]),(c?d:void 0)??u??m}},730275,496545,e=>{"use strict";e.s(["Autocomplete",()=>te,"AutocompleteCollection",()=>tt,"AutocompleteGroup",()=>to,"AutocompleteGroupLabel",()=>ts,"AutocompleteInput",()=>tr,"AutocompleteItem",()=>ta,"AutocompleteList",()=>tn,"AutocompleteStatus",()=>ti],730275),e.s(["Arrow",()=>eJ,"Backdrop",()=>eL,"Clear",()=>eE,"Collection",()=>ew,"Empty",()=>e4,"Group",()=>eW,"GroupLabel",()=>eG,"Icon",()=>eC,"Input",()=>ev,"InputGroup",()=>eb,"Item",()=>e9,"List",()=>eR,"Popup",()=>ez,"Portal",()=>eM,"Positioner",()=>eB,"Root",()=>J,"Row",()=>e7,"Separator",()=>e3,"Status",()=>eP,"Trigger",()=>ed,"Value",()=>Y,"useFilter",()=>N,"useFilteredItems",()=>e6],196799),e.i(148099);var t=e.i(271645);e.i(247167);var r=e.i(733332),n=e.i(951437),a=e.i(146376),o=e.i(713203),s=e.i(667865),i=e.i(828918),l=e.i(446265),u=e.i(502077),c=e.i(388940),d=e.i(301252),p=e.i(956789),f=e.i(229315),m=e.i(17989),g=e.i(265858),h=e.i(260891),y=e.i(385689),v=e.i(464132),x=e.i(584446),b=e.i(675606),C=e.i(56434),S=e.i(202672),I=e.i(988713),E=e.i(137584),k=e.i(469690),A=e.i(381104),w=e.i(884708),T=e.i(538489),R=e.i(42191);function _(e){return null==e?void 0:`${e}-popup`}let P=new Map,N=function(e={}){let t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},r=`${function e(t){return Array.isArray(t)?t.map(t=>e(t)).join(","):null==t?"":String(t)}(e.locale)}|${JSON.stringify(t)}`,n=P.get(r);if(n)return n;let a=new Intl.Collator(e.locale,t),o={contains(e,t,r){if(!t)return!0;let n=(0,R.stringifyAsLabel)(e,r);for(let e=0;e<=n.length-t.length;e+=1)if(0===a.compare(n.slice(e,e+t.length),t))return!0;return!1},startsWith(e,t,r){if(!t)return!0;let n=(0,R.stringifyAsLabel)(e,r);return 0===a.compare(n.slice(0,t.length),t)},endsWith(e,t,r){if(!t)return!0;let n=(0,R.stringifyAsLabel)(e,r),o=t.length;return n.length>=o&&0===a.compare(n.slice(n.length-o),t)}};return P.set(r,o),o};var O=e.i(223910),M=e.i(32199);function j(e,t=!1){let{overflowY:r}=(0,f.getComputedStyle)(e);return("auto"===r||"scroll"===r)&&(t?e.clientHeight>0:e.scrollHeight>e.clientHeight)}function L(e,t,r=!1){return"vertical"===t?j(e,r):function(e,t=!1){let{overflowX:r}=(0,f.getComputedStyle)(e);return("auto"===r||"scroll"===r)&&(t?e.clientWidth>0:e.scrollWidth>e.clientWidth)}(e,r)}function D(e,t,r){let n=e;for(;(0,f.isHTMLElement)(n)&&n!==t&&!(0,f.isLastTraversableNode)(n);){for(let e of r)if(L(n,e))return!0;n=(0,f.getParentNode)(n)}return!1}function F(e,t,r="vertical",n=!1){let a=(0,f.isHTMLElement)(e)?e:null;for(;(0,f.isHTMLElement)(a)&&a!==t&&!(0,f.isLastTraversableNode)(a);){if(L(a,r,n))return a;a=(0,f.getParentNode)(a)}return L(t,r,n)?t:null}e.s(["findScrollableTouchTarget",()=>F,"hasScrollableAncestor",()=>D,"isScrollableY",()=>j],496545);var V=e.i(606039),H=e.i(264111),Z=e.i(176782),K=e.i(484325);
13let B=Symbol("none"),$={value:B,index:-1};var U=e.i(872855),q=e.i(843476);function z(e){let _,{id:P,onOpenChangeComplete:L,defaultSelectedValue:D=null,selectedValue:F,onSelectedValueChange:z,defaultInputValue:J,inputValue:Y,open:W,defaultOpen:G=!1,selectionMode:X,onItemHighlighted:Q,name:ee,form:et,disabled:er=!1,readOnly:en=!1,required:ea=!1,inputRef:eo,grid:es=!1,items:ei,filteredItems:el,filter:eu,filterQuery:ec,openOnInputClick:ed=!0,autoHighlight:ep=!1,keepHighlight:ef=!1,highlightItemOnHover:em=!0,loopFocus:eg=!0,itemToStringLabel:eh,itemToStringValue:ey,isItemEqualToValue:ev=K.defaultItemEquality,virtualized:ex=!1,inline:eb=!1,fillInputOnItemPress:eC=!0,modal:eS=!1,limit:eI=-1,autoComplete:eE="list",formAutoComplete:ek,locale:eA,submitOnItemClick:ew=!1}=e,{clearErrors:eT}=(0,w.useFormContext)(),{setDirty:eR,validityData:e_,setFilled:eP,name:eN,disabled:eO,setTouched:eM,setFocused:ej,validationMode:eL,validation:eD}=(0,k.useFieldRootContext)(),eF=(0,U.useDirection)(),eV=(0,T.useLabelableId)({id:P}),eH=N({locale:eA}),eZ=Array.isArray(ei)?null:ei;if(eZ&&"function"!=typeof eZ.label)throw Error((0,r.default)(100));let eK=eZ?eZ.data:ei,eB=eZ?.value,e$=eB?void 0:eK,eU=t.useMemo(()=>{let e;if(!el||!eB)return;let t=(0,R.flattenLeafItems)(el),r=t.map(eB);return{values:r,findItem(n,a){if(!e){e=new Map;for(let n=0;n<r.length;n+=1)e.has(r[n])||e.set(r[n],t[n])}var o=e;let s=o.get(n);if(void 0!==s||a===K.defaultItemEquality)return s;for(let[e,t]of o)if((0,K.compareItemEquality)(e,n,a))return t}}},[el,eB]),eq=t.useMemo(()=>eZ?e=>eZ.label(e,ev,e=>{let t=eU?.findItem(e,ev);return null!=t?eZ.itemLabel(t):(0,R.stringifyAsLabel)(e,eh)}):eh,[eZ,eh,eU,ev]),ez=t.useMemo(()=>eZ?Object.assign(e=>eZ.itemLabel(e),{selected:e=>(0,R.stringifyAsLabel)(e,eq)}):eh,[eZ,eq,eh]);function eJ(e){return(0,R.stringifyAsLabel)(e,eq)}let[eY,eW]=t.useState(!1),[eG,eX]=t.useState(null),eQ=t.useRef(eG),e0=t.useRef([]),e1=t.useRef([]),e5=t.useRef(null),e2=t.useRef(null),e9=t.useRef(null),e7=t.useRef(null),e4=t.useRef(null),e3=t.useRef(!0),e6=t.useRef(!1),e8=t.useRef(null),te=t.useRef(null),tt=t.useRef(null),tr=t.useRef($),tn=t.useRef(null),ta=t.useRef([]),to=t.useRef(null),ts=eO||er,ti=eN??ee,tl="multiple"===X,tu="single"===X,tc=void 0!==Y||void 0!==J,td=void 0!==eK,tp=void 0!==el;_="always"===ep?"always":!!ep&&"input-change";let[tf,tm]=(0,n.useControlled)({controlled:F,default:tl?D??p.EMPTY_ARRAY:D,name:"Combobox",state:"selectedValue"}),tg=t.useMemo(()=>null===eu?()=>!0:void 0!==eu?eu:(e,t)=>null!=e&&eH.contains(e,t,ez),[eu,eH,ez]),th=(0,c.useRefWithInit)(()=>tc?J??"":tu?eJ(tf):"").current,[ty,tv]=(0,n.useControlled)({controlled:Y,default:th,name:"Combobox",state:"inputValue"}),[tx,tb]=(0,n.useControlled)({controlled:W,default:G,name:"Combobox",state:"open"}),tC=(0,R.isGroupedItems)(eK),tS=tx||null===eG?String(ty).trim():eG,tI=tu?eJ(tf):"",tE=tu&&!eY&&""!==tS&&tI.length===tS.length&&eH.contains(tI,tS),tk=tE?"":ec??tS,tA=td&&tp&&tE&&(!eZ||eZ.hasValue(tf,ev)),tw=t.useMemo(()=>eK?(0,R.flattenLeafItems)(eK):p.EMPTY_ARRAY,[eK]),tT=t.useMemo(()=>{if(el&&!tA)return el;if(!eK)return p.EMPTY_ARRAY;if(tC){let e=[],t=0;for(let r of eK){if(eI>-1&&t>=eI)break;let n=eI>-1?eI-t:1/0,a=""===tk?r.items.slice(0,n):[];if(""!==tk)for(let e of r.items){if(a.length>=n)break;tg(e,tk,ez)&&a.push(e)}if(a.length>0){let n={...r,items:a};e.push(n),t+=a.length}}return e}if(""===tk)return eI>-1?tw.slice(0,eI):tw;let e=[];for(let t of tw){if(eI>-1&&e.length>=eI)break;tg(t,tk,ez)&&e.push(t)}return e},[el,tA,eK,tC,tk,eI,tg,ez,tw]),tR=t.useMemo(()=>{if(eU&&tT===el)return eU.values;let e=(0,R.flattenLeafItems)(tT);return eB?e.map(e=>eB(e)):e},[tT,el,eU,eB]),t_=(0,c.useRefWithInit)(()=>{let e=null;return eb&&tx&&td&&"none"!==X&&(e=(0,K.findSelectionIndex)(tR,tf,ev,tl)),new d.ReactStore({id:eV,labelId:void 0,selectedValue:tf,open:tx,items:e$,selectionMode:X,name:ti,form:et,disabled:ts,readOnly:en,required:ea,grid:es,virtualized:ex,openOnInputClick:ed,itemToStringLabel:eq,isItemEqualToValue:ev,modal:eS,autoHighlight:_,submitOnItemClick:ew,hasInputValue:tc,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:eb,activeIndex:null,selectedIndex:e,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemProps:p.EMPTY_OBJECT,positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:"none"===X},{onOpenChangeComplete:p.NOOP,setOpen:p.NOOP,setInputValue:p.NOOP,setSelectedValue:p.NOOP,setIndices:p.NOOP,handleSelection:p.NOOP,forceMount:p.NOOP,requestSubmit:p.NOOP,listRef:e0,labelsRef:e1,popupRef:e5,emptyRef:e4,inputRef:e2,startDismissRef:e9,endDismissRef:e7,keyboardActiveRef:e3,chipsContainerRef:e8,clearRef:te,valuesRef:ta,pointerDownItemRef:to,selectionEventRef:tt},I.selectors)}).current,tP="none"===X?ty:tf,tN=t.useMemo(()=>"none"===X?tP:Array.isArray(tf)?tf.map(e=>(0,R.stringifyAsValue)(e,ey)):(0,R.stringifyAsValue)(tf,ey),[tP,ey,X,tf]),tO=(0,s.use
13StableCallback)(Q),tM=(0,s.useStableCallback)(L),tj=t_.useState("activeIndex"),tL=t_.useState("selectedIndex"),tD=t_.useState("positionerElement"),tF=t_.useState("listElement"),tV=t_.useState("triggerElement"),tH=t_.useState("inputElement"),tZ=t_.useState("inputGroupElement"),tK=t_.useState("inline"),tB=t_.useState("inputInsidePopup"),t$=t_.useState("inputOwnsFormValue"),tU=tu&&!tB&&ty===tI,tq=(0,l.useValueAsRef)(tV),{mounted:tz,setMounted:tJ,transitionStatus:tY}=(0,O.useTransitionStatus)(tx),{openMethod:tW,triggerProps:tG}=(0,M.useOpenInteractionType)(tx),tX=(0,s.useStableCallback)(()=>tN);(0,A.useRegisterFieldControl)(tB?tq:e2,eV,tP,tX,!ts,ee);let tQ=(0,s.useStableCallback)(()=>{eK?e1.current=tR.map(eJ):t_.set("forceMounted",!0)}),t0=(0,s.useStableCallback)((e,t,r)=>{if(-1===t){if(tr.current===$)return;tr.current=$}else tr.current={value:e,index:t};tO(e,(0,b.createGenericEventDetails)(r,void 0,{index:t}))}),t1=(0,s.useStableCallback)(e=>{let t={};void 0!==e.activeIndex&&(t.activeIndex=e.activeIndex),void 0!==e.selectedIndex&&(t.selectedIndex=e.selectedIndex),t_.update(t);let r=e.activeIndex;if(void 0===r)return;let n=e.type||C.REASONS.none;null===r?t0(void 0,-1,n):t0(ta.current[r],r,n)}),t5=(0,s.useStableCallback)((t,r)=>{if(e.onInputValueChange?.(t,r),!r.isCanceled){if(e6.current=r.reason===C.REASONS.inputClear,r.reason===C.REASONS.inputChange){tx&&null!==eG&&eX(null);let e=r.event,n=e.inputType;if("compositionend"===e.type||null!=n&&""!==n&&"insertReplacementText"!==n){let e=""!==t.trim();e&&eW(!0),tn.current={hasQuery:e};let r=t_.state.listElement;if(!t_.state.virtualized&&r){let e=e5.current;for(let t of(0,f.getOverflowAncestors)(r.firstElementChild??r)){if(!(0,f.isHTMLElement)(t)||(e?!(0,x.contains)(e,t):"dialog"===t.getAttribute("role")))break;if(j(t)){t.scrollTop=0;break}}}e&&_&&null==t_.state.activeIndex&&(tx||tK)&&t_.set("activeIndex",0)}}else r.reason===C.REASONS.inputClear&&""===t&&t_.state.inputInsidePopup&&(tn.current={hasQuery:!1,selection:!0}
13);tv(t)}}),t2=(0,s.useStableCallback)(e=>{let t=!e&&tB&&!tK&&""!==ty&&(String(ty).trim()===eG||ty===tI);!e&&(t||""===ty||tU)&&eW(!1),eX(null),t&&t5("",(0,b.createChangeEventDetails)(C.REASONS.inputClear))}),t9=(0,s.useStableCallback)((t,r)=>{if(tx!==t&&(r.reason===C.REASONS.escapeKey&&td&&0===tR.length&&!e4.current&&r.allowPropagation(),e.onOpenChange?.(t,r),!r.isCanceled&&(t&&null!==eG&&t2(r.reason===C.REASONS.inputChange),!t&&eY&&(tu?(tK||eX(tS),""===tS&&eW(!1)):tl&&(tK||eX(tS),tB&&t1({activeIndex:null}),(!tB||tK)&&t5("",(0,b.createChangeEventDetails)(C.REASONS.inputClear,r.event,void 0,{isItemPress:r.reason===C.REASONS.itemPress})))),tb(t),!t&&tB&&(r.reason===C.REASONS.focusOut||r.reason===C.REASONS.outsidePress))&&(eM(!0),ej(!1),"onBlur"===eL))){let e="none"===X?ty:tf;eD.commit(e)}}),t7=(0,s.useStableCallback)((e,t)=>{z?.(e,t),!t.isCanceled&&(tm(e),("none"===X&&e5.current&&eC||tu&&!t_.state.inputInsidePopup)&&t5(eJ(e),(0,b.createChangeEventDetails)(t.reason,t.event)))}),t4=(0,s.useStableCallback)((e,t)=>{let r=(0,x.getTarget)(e),n=tt.current??e;tt.current=null;let a=(0,b.createChangeEventDetails)(C.REASONS.itemPress,n),o=r?.closest("a")?.getAttribute("href");if(o){o.startsWith("#")&&t9(!1,a);return}if(tl){let e=Array.isArray(tf)?tf:[],r=(0,K.selectedValueIncludes)(e,t,ev);if(t7(r?(0,K.removeItem)(e,t,ev):[...e,t],a),a.isCanceled||!(e2.current&&""!==e2.current.value.trim()))return;if(t_.state.inputInsidePopup){t5("",(0,b.createChangeEventDetails)(C.REASONS.inputClear,a.event,void 0,{isItemPress:!0}));let e=tn.current;e&&!r&&(e.toggledValue=t)}else t9(!1,a)}else{if(t7(t,a),a.isCanceled)return;t9(!1,a)}}),t3=(0,s.useStableCallback)(()=>{let e=eD.inputRef.current?.form??t_.state.inputElement?.form;e&&"function"==typeof e.requestSubmit&&e.requestSubmit()}),t6=(0,s.useStableCallback)(()=>{if(tJ(!1),tM?.(!1),eW(!1),eX(null),"none"===X?t1({activeIndex:null,selectedIndex:null}):t1({activeIndex:null}),tl&&e2.current&&""!==e2.current.value&&!e6.current&&t5("",(0,b.createChangeEventDetails)(C.REASONS.inputClear)),tu)if(t_.state.inputInsidePopup)e2.current&&""!==e2.current.value&&t5("",(0,b.createChangeEventDetails)(C.REASONS.inputClear));else{let e=eJ(tf);if(e2.current&&e2.current.value!==e){let t=""===e?C.REASONS.inputClear:C.REASONS.none;t5(e,(0,b.createChangeEventDetails)(t))}}}),t8=t.useMemo(()=>tK&&tD?{current:tD.closest('[role="dialog"]')}:e5,[tK,tD]);(0,E.useOpenChangeComplete)({enabled:!e.actionsRef,open:tx,ref:t8,onComplete(){tx||t6()}}),t.useImperativeHandle(e.actionsRef,()=>({unmount:t6}),[t6]),(0,a.useIsoLayoutEffect)(function(){let e=null!==eQ.current&&null===eG;if(eQ.current=eG,tx&&(!e||!td)||(tx||(to.current=null),"none"===X))return;let t=td?tR:ta.current;t1({selectedIndex:(0,K.findSelectionIndex)(t,tf,ev,tl)})},[tx,eG,tf,X,tl,td,tR,ev,t1]),(0,a.useIsoLayoutEffect)(()=>{eK&&(ta.current=tR,e0.current.length=tR.length)},[eK,tR]),(0,a.useIsoLayoutEffect)(()=>{let e=tn.current;if(e){let t=tx||tK||t_.state.positionerElement?.hidden===!1;if(e.hasQuery)_&&t&&t_.set("activeIndex",0),tn.current=null;else if(""===String(ty).trim()&&(tn.current=null,t)){let t=e.selection;"always"!==_||t||"none"!==t_.state.selectionMode||t_.set("activeIndex",0),queueMicrotask(()=>{if(!t_.state.open&&!t_.state.inline||e2.current&&""!==e2.current.value.trim())return;let r=t_.state.selectedValue,n="multiple"===t_.state.selectionMode;if(n&&Array.isArray(r)?r.length>0:"none"!==t_.state.selectionMode&&null!=r){let t=td||tp?tR:ta.current,a=(0,K.findItemIndex)(t,e.toggledValue,t_.state.isItemEqualToValue);t_.set("activeIndex",-1!==a?a:(0,K.findSelectionIndex)(t,r,t_.state.isItemEqualToValue,n))}else t?t_.set("activeIndex",null):"always"===_&&t_.set("activeIndex",0)})}}if(!tx&&!tK)return;let t=td||tp?tR:ta.current,r=t_.state.activeIndex;if(null==r)return"always"===_&&t.length>0?void t_.set("activeIndex",0):void t0(void 0,-1,C.REASONS.none);if(r>=t.length){t0(void 0,-1,C.REASONS.none),t_.set("activeIndex",null);return}let n=t[r],a=tr.current.value,o=a!==B&&(0,K.compareItemEquality)(n,a,t_.state.isItemEqualToValue);tr.current.index===r&&o||t0(n,r,C.REASONS.none)},[tj,_,t0,tp,td,tR,tK,tx,t_,ty]),(0,a.useIsoLayoutEffect)(()=>
13{if("none"===X)return void eP(""!==String(ty));eP(tl?Array.isArray(tf)&&tf.length>0:null!=tf)},[eP,X,ty,tf,tl]),t.useEffect(()=>{td&&_&&0===tR.length&&t1({activeIndex:null})},[td,_,tR.length,t1]);let re=!1;function rt(){re||ty===tI||(re=!0,t5(tI,(0,b.createChangeEventDetails)(C.REASONS.none)))}function rr(){!tu||tc||tB||eY||rt()}(0,V.useValueChanged)(tS,function(){tx&&""!==tS&&tS!==String(th)&&!tU&&eW(!0)}),(0,V.useValueChanged)(tx,function(){tx&&null!==eG&&t2(!1)}),(0,V.useValueChanged)(tf,function(){"none"!==X&&(eT(ti),eR((0,K.isSelectedValueDirty)(tf,e_.initialValue,ev)),eD.change(tf),!tu||tc||tB||rt())}),(0,V.useValueChanged)(tI,rr),(0,V.useValueChanged)(eK,rr),(0,V.useValueChanged)(ty,function(){"none"===X&&(eT(ti),eR(ty!==e_.initialValue),eD.change(ty))});let rn=(0,g.useFloatingRootContext)({open:!!tK||tx,onOpenChange:t9,elements:{reference:tB?tV:tH,floating:tD}}),ra=es?"grid":"listbox",ro=tx||tK,rs=ro?"true":"false",ri=t.useMemo(()=>{let e=tH?.tagName==="INPUT",t=null==tH||e,r=t||ro,n=t?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return r&&(n.role="combobox",n["aria-expanded"]=rs,n["aria-haspopup"]=ra,n["aria-controls"]=ro?tF?.id:void 0,n["aria-autocomplete"]=en?"none":eE),{reference:n,floating:{role:"presentation"}}},[tH,ro,rs,ra,tF?.id,eE,en]),rl=(0,y.useClick)(rn,{enabled:!ts&&ed,event:"mousedown-only",toggle:!1,touchOpenDelay:100*!tB,reason:C.REASONS.inputPress}),ru=(0,m.useDismiss)(rn,{enabled:!ts&&!tK,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:!!tK||void 0,outsidePress(e){let t=(0,x.getTarget)(e);return!(0,x.contains)(tV,t)&&!(0,x.contains)(te.current,t)&&!(0,x.contains)(e8.current,t)&&!(0,x.contains)(tZ,t)}}),rc=(0,h.useListNavigation)(rn,{enabled:!ts,id:eV,listRef:e0,activeIndex:tj,selectedIndex:tL,virtual:!0,loopFocus:eg,allowEscape:eg&&!_,focusItemOnOpen:!eY&&("none"!==X||!!_)&&"auto",focusItemOnHover:em,resetOnPointerLeave:!ef,orientation:es?"horizontal":void 0,rtl:"rtl"===eF,disabledIndices:p.EMPTY_ARRAY,grid:es?v.gridNavigation:void 0,onNavigate(e,t){(t||tx)&&"ending"!==tY&&(t?t1({activeIndex:e,type:e3.current?C.REASONS.keyboard:C.REASONS.pointer}):t1({activeIndex:e}))}}),rd=t.useMemo(()=>(0,Z.mergeProps)(rc.reference,{onKeyDown(e){es&&null==t_.state.activeIndex&&("ArrowLeft"===e.key||"ArrowRight"===e.key)&&e.preventBaseUIHandler()}},ru.reference,rl.reference,ri.reference),[rc.reference,ru.reference,rl.reference,ri.reference,es,t_]),rp=t.useMemo(()=>(0,Z.mergeProps)(H.FOCUSABLE_POPUP_PROPS,ru.floating),[ru.floating]),rf=t.useMemo(()=>(0,Z.mergeProps)(rc.floating,ri.floating),[rc.floating,ri.floating]),rm=t.useMemo(()=>{let e=rc.item;return e?{...e,onFocus:void 0}:p.EMPTY_OBJECT},[rc.item]);t_.useContextCallback("setOpen",t9),t_.useContextCallback("setInputValue",t5),t_.useContextCallback("setSelectedValue",t7),t_.useContextCallback("setIndices",t1),t_.useContextCallback("handleSelection",t4),t_.useContextCallback("forceMount",tQ),t_.useContextCallback("requestSubmit",t3),t_.useContextCallback("onOpenChangeComplete",L),(0,o.useOnFirstRender)(()=>{t_.update({inline:eb,popupProps:rp,listProps:rf,inputProps:rd,triggerProps:tG,itemProps:rm})});let rg={id:eV,selectedValue:tf,open:tx,mounted:tz,transitionStatus:tY,items:e$,inline:eb,popupProps:rp,listProps:rf,inputProps:rd,triggerProps:tG,itemProps:rm,openMethod:tW,selectionMode:X,name:ti,form:et,disabled:ts,readOnly:en,required:ea,grid:es,virtualized:ex,openOnInputClick:ed,itemToStringLabel:eq,modal:eS,autoHighlight:_,isItemEqualToValue:ev,submitOnItemClick:ew,hasInputValue:tc};(0,a.useIsoLayoutEffect)(()=>{t_.update({...rg,inputOwnsFormValue:"none"===X&&(eb||!t_.state.inputInsidePopup)})},[t_,...Object.values(rg)]);let rh=(0,i.useMergedRefs)(eo,eD.inputRef),ry=t.useMemo(()=>({query:tS,hasItems:td,filteredItems:tT,flatFilteredValues:tR}),[tS,td,tT,tR]),rv=t.useMemo(()=>Array.isArray(tP)?"":(0,R.stringifyAsValue)(tP,ey),[tP,ey]),rx=tl&&Array.isArray(tf)&&tf.length>0,rb=tl||"none"===X&&t$?void 0:ti,rC=t.useMemo(()=>tl&&Array.isArray(tf)&&ti?tf.map(e=>{let t=(0,R.stringifyAsValue)(e,ey);return(0,q.jsx)("input",{type:"hidden",form:et,name:ti,value:t,disabled:ts},t)}):null,[tl,tf,et,ti,ey,ts]),rS=(0,q.jsxs)(t.Fragment,{children:[e.children,(0,q.jsx)("input",{...eD.getValidationProps(ts,{onFocus(){if(tB)return void tV?.focu
13s();(e2.current||tV)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||ts||en)return;let t=e.currentTarget.value,r=t.toLowerCase(),n=(0,b.createChangeEventDetails)(C.REASONS.none,e.nativeEvent),a=()=>ta.current.findIndex(e=>(0,R.stringifyAsValue)(e,ey).toLowerCase()===r||eJ(e).toLowerCase()===r);tu&&(tQ(),eK&&-1===a()&&t_.set("forceMounted",!0)),queueMicrotask(function(){if(tl)return;if("none"===X)return void t5(t,n);let e=a();-1===e&&(e=ta.current.findIndex((e,t)=>{let n=e1.current[t];return null!=n&&n.toLowerCase()===r}));let o=-1===e?void 0:ta.current[e];null!=o&&t7?.(o,n)})}}),id:eV&&null==rb?`${eV}-hidden-input`:void 0,form:et,name:rb,autoComplete:ek,disabled:ts,required:ea&&!rx,readOnly:en,value:rv,ref:rh,style:rb?u.visuallyHiddenInput:u.visuallyHidden,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),rC]});return(0,q.jsx)(S.ComboboxRootContext.Provider,{value:t_,children:(0,q.jsx)(S.ComboboxFloatingContext.Provider,{value:rn,children:(0,q.jsx)(S.ComboboxHasItemsContext.Provider,{value:td,children:(0,q.jsx)(S.ComboboxDerivedItemsContext.Provider,{value:ry,children:(0,q.jsx)(S.ComboboxInputValueContext.Provider,{value:ty,children:rS})})})})})}function J(e){let r,{openOnInputClick:n=!1,value:a,defaultValue:o,onValueChange:s,mode:i="list",itemToStringValue:l,...u}=e,c=("inline"===i||"both"===i)&&!e.readOnly,d=void 0!==a,[p,f]=t.useState(o??""),[m,g]=t.useState("");t.useEffect(()=>{(d||!c)&&g("")},[a,d,c]),r=c&&""!==m?m:d?a??"":p;let h=N({locale:u.locale}),y=String((d?a:p)??"").trim(),v="inline"===i||"none"===i||null===u.filter?null:u.filter??h.contains;return(0,q.jsx)(z,{...u,itemToStringLabel:l,openOnInputClick:n,selectionMode:"none",fillInputOnItemPress:!0,filter:v,filterQuery:"both"===i?y:void 0,autoComplete:i,inputValue:r,defaultInputValue:o,onInputValueChange:function(e,t){g(""),d||f(e),s?.(e,t)},onItemHighlighted:function(t,r){e.onItemHighlighted?.(t,r),r.reason!==C.REASONS.pointer&&g(c&&null!=t?(0,R.stringifyAsLabel)(t,l):"")}})}function Y(e){let{children:r}=e,n=(0,S.useComboboxInputValueContext)(),a=null;return a="function"==typeof r?r(String(n)):null!=r?r:n,(0,q.jsx)(t.Fragment,{children:a})}var W=e.i(439957),G=e.i(108868),X=e.i(552245),Q=e.i(540886),ee=e.i(879938),et=e.i(875812),er=e.i(145147);er.CommonTriggerDataAttributes.popupOpen,er.CommonTriggerDataAttributes.pressed;let en={...ee.pressableTriggerOpenStateMapping,...et.fieldValidityMapping,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null};var ea=e.i(247778),eo=e.i(157940),es=e.i(264042),ei=e.i(736760);function el(e){let t=e.useState("mounted"),r=e.useState("popupSide"),n=e.useState("positionerElement");return t&&n?r:null}function eu(){return 0===(0,S.useComboboxDerivedItemsContext)().filteredItems.length}function ec(e,t,r){let n=e.context.listRef.current[t];n&&(e.context.selectionEventRef.current=r,n.click(),e.context.selectionEventRef.current=null)}let ed=t.forwardRef(function(e,r){let n,{render:a,className:o,nativeButton:i=!0,disabled:l=!1,id:u,style:c,...d}=e,{state:p,disabled:f,setTouched:m,setFocused:g,validationMode:h,validation:v}=(0,k.useFieldRootContext)(),{labelId:I}=(0,ea.useLabelableContext)(),E=(0,S.useComboboxRootContext)(),A=E.useState("selectionMode"),w=E.useState("disabled"),R=E.useState("readOnly"),P=E.useState("required"),N=E.useState("positionerElement"),O=E.useState("listElement"),M=E.useState("popupId"),j=E.useState("triggerProps"),L=E.useState("inputInsidePopup"),D=E.useState("id"),F=E.useState("labelId"),V=E.useState("open"),H=E.useState("selectedValue"),Z=E.useState("activeIndex"),K=E.useState("selectedIndex"),B=E.useState("hasSelectedValue"),$=(0,S.useComboboxFloatingContext)(),U=(0,S.useComboboxInputValueContext)(),q=(0,W.useTimeout)(),z=f||w||l,J=eu(),Y=el(E);(0,T.useLabelableId)({id:L?u:void 0});let ee=L?u??D:u;V&&L?n=M??_(D):V&&(n=O?.id);let et=t.useRef("");function er(e){et.current=e.pointerType}let{reference:ec}=(0,ei.useTypeahead)($,{enabled:!V&&!R&&!w&&"single"===A,listRef:E.context.labelsRef,activeIndex:Z,selectedIndex:K,onMatch(e){let t=E.context.valuesRef.current[e];void 0!==t&&E.context.setSelectedValue(t,(0,b.createChangeEventDetails)(C.REASONS.none))}}),{reference:ed}
13=(0,y.useClick)($,{enabled:!w,event:"mousedown"}),{buttonRef:ep,getButtonProps:ef}=(0,Q.useButton)({native:i,disabled:z}),em={...p,readOnly:R,open:V,disabled:z,popupSide:Y,listEmpty:J,placeholder:"none"!==A&&!B},eg=(0,s.useStableCallback)(e=>{E.set("triggerElement",e)});return(0,X.useRenderElement)("button",e,{ref:[r,ep,eg],state:em,props:[j,ed,ec,{id:ee,tabIndex:L?0:-1,role:L?"combobox":void 0,"aria-expanded":V,"aria-haspopup":L?"dialog":"listbox","aria-controls":n,"aria-required":L&&P||void 0,"aria-readonly":L&&R||void 0,"aria-labelledby":I??F,onPointerDown:er,onPointerEnter:er,onFocus(){g(!0),z||q.start(0,E.context.forceMount)},onBlur(e){(0,x.contains)(N,e.relatedTarget)||(m(!0),g(!1),"onBlur"===h&&v.commit("none"===A?U:H))},onMouseDown(e){if(z||(L||$.set("domReferenceElement",e.currentTarget),E.context.forceMount(),"touch"!==et.current&&(E.context.inputRef.current?.focus(),L||e.preventDefault()),V))return;let t=(0,G.ownerDocument)(e.currentTarget);L&&t.addEventListener("mouseup",function(e){let t=E.state.triggerElement;if(!t)return;let r=(0,x.getTarget)(e),n=E.state.positionerElement,a=E.state.listElement;!((0,x.contains)(t,r)||(0,x.contains)(n,r)||(0,x.contains)(a,r))&&((0,es.isMouseWithinBounds)(e,t)||E.context.setOpen(!1,(0,b.createChangeEventDetails)(C.REASONS.cancelOpen,e)))},{once:!0})},onKeyDown(e){("ArrowDown"===e.key||"ArrowUp"===e.key)&&((0,eo.stopEvent)(e),E.context.setOpen(!0,(0,b.createChangeEventDetails)(C.REASONS.listNavigation,e.nativeEvent)),E.context.inputRef.current?.focus())}},v.getValidationProps(z,d),ef],stateAttributesMapping:en})});var ep=e.i(328744),ef=e.i(788015);let em=t.createContext(void 0),eg=t.createContext(void 0);function eh(e){let n=t.useContext(eg);if(void 0===n&&!e)throw Error((0,r.default)(21));return n}let ey=t.forwardRef(function(e,t){let r=(0,S.useComboboxRootContext)(),{buttonRef:n,getButtonProps:a}=(0,Q.useButton)({native:!1}),o=(0,i.useMergedRefs)(t,n),s=a({onClick:function(e){r.context.setOpen(!1,(0,b.createChangeEventDetails)(C.REASONS.closePress,e.nativeEvent,e.currentTarget))}});return(0,q.jsx)("span",{ref:o,...s,"aria-label":"Dismiss",tabIndex:void 0,style:u.visuallyHiddenInput})}),ev=t.forwardRef(function(e,r){let{render:n,className:a,disabled:o=!1,id:i,style:l,...u}=e,{state:c,disabled:d,setTouched:p,setFocused:f,validationMode:m,validation:g}=(0,k.useFieldRootContext)(),{labelId:h}=(0,ea.useLabelableContext)(),y=t.useContext(em),v=!!eh(!0),x=(0,S.useComboboxRootContext)(),I=(0,S.useComboboxInputValueContext)(),E=(0,U.useDirection)(),A=x.useState("required"),w=x.useState("disabled"),T=x.useState("readOnly"),R=x.useState("name"),_=x.useState("form"),P=x.useState("selectionMode"),N=x.useState("autoHighlight"),O=x.useState("inputProps"),M=x.useState("triggerProps"),j=x.useState("open"),L=x.useState("mounted"),D=x.useState("selectedValue"),F=x.useState("id"),V=x.useState("inline"),H=x.useState("modal"),Z=!!N,K=el(x),B=d||w||o,$=eu(),z=v||V,J=(0,ef.useBaseUiId)(i??(z?void 0:F)),Y=v?et.DEFAULT_FIELD_STATE_ATTRIBUTES:c,[W,G]=t.useState(null),Q=t.useRef(!1),ee=t.useRef(null),er=t.useRef(!1),es="none"===P&&!v,ei=(0,s.useStableCallback)(e=>{let t=v||x.state.inline;t&&!x.state.hasInputValue&&x.context.setInputValue("",(0,b.createChangeEventDetails)(C.REASONS.none)),x.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:es})}),ed=v?u:g.getValidationProps(B,u);function eg(){x.context.setIndices({activeIndex:null,selectedIndex:null,type:x.context.keyboardActiveRef.current?C.REASONS.keyboard:C.REASONS.pointer})}function ev(){x.context.keyboardActiveRef.current=!1}let ex={...Y,open:j,disabled:B,readOnly:T,popupSide:K,listEmpty:$},eb=(0,X.useRenderElement)("input",e,{state:ex,ref:[r,x.context.inputRef,ei],props:[O,M,{value:W??I,"aria-readonly":T||void 0,"aria-required":A||void 0,"aria-labelledby":h,disabled:B,readOnly:T,required:"none"===P?A:void 0,form:_,...es&&R&&{name:R},id:J,onFocus(){if(f(!0),!V||!er.current)return;er.current=!1;let e=ee.current;null!=e&&Object.hasOwn(x.context.valuesRef.current,e)&&x.context.setIndices({activeIndex:e})},onBlur(){p(!0),f(!1);let e=x.state.activeIndex;if(V&&null!==e&&"always"!==N&&(ee.current=e,er.current=!0,x.context.setIndices({activeIndex:null})),"onBlur"===m){let e="none"===P?I:D;g.commit(e)}},onCompositionStart(e){ep.platform.os.android||(Q.current=!0,G(e.currentTarget.value))},onCompositionEnd(e){Q.current=!1;let t=e.currentTarget.value;G(null),x.context.setInputValue(t,(0,b.createChangeEventDetails)(C.REASONS.inputChange,e.
13nativeEvent))},onChange(e){let t=e.nativeEvent,r=t.inputType,n=Q.current||!(!r||"insertReplacementText"===r);function a(e){!T&&!B&&e&&n&&(x.context.setOpen(!0,(0,b.createChangeEventDetails)(C.REASONS.inputChange,t)),Z||eg())}if(Q.current){let r=e.currentTarget.value;G(r),""!==r||x.state.openOnInputClick||x.state.inputInsidePopup||x.context.setOpen(!1,(0,b.createChangeEventDetails)(C.REASONS.inputClear,t));let n=r.trim(),o=Z&&""!==n;a(n),j&&null!==x.state.activeIndex&&!o&&eg();return}let o=(0,b.createChangeEventDetails)(C.REASONS.inputChange,t);if(x.context.setInputValue(e.currentTarget.value,o),o.isCanceled)return;let s=""===e.currentTarget.value,i=(0,b.createChangeEventDetails)(C.REASONS.inputClear,t);s&&!x.state.inputInsidePopup&&("single"===P&&x.context.setSelectedValue(null,i),x.state.openOnInputClick||x.context.setOpen(!1,i)),a(e.currentTarget.value.trim()),j&&null!==x.state.activeIndex&&!Z&&eg()},onKeyDown(e){if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;if(x.context.keyboardActiveRef.current=!0,B||T){T&&"Enter"===e.key&&j&&null!==x.state.activeIndex&&(0,eo.stopEvent)(e);return}let t=e.currentTarget,r=t.scrollWidth-t.clientWidth,n="rtl"===E;if("Home"===e.key){(0,eo.stopEvent)(e);let r=ep.platform.engine.gecko&&n?t.value.length:0;t.setSelectionRange(r,r),t.scrollLeft=0;return}if("End"===e.key){(0,eo.stopEvent)(e);let a=ep.platform.engine.gecko&&n?0:t.value.length;t.setSelectionRange(a,a),t.scrollLeft=n?-r:r;return}if(!L&&"Escape"===e.key){let t="multiple"===P&&Array.isArray(D)?0===D.length:null===D,r=(0,b.createChangeEventDetails)(C.REASONS.escapeKey,e.nativeEvent);x.context.setInputValue("",r),x.context.setSelectedValue("multiple"===P?[]:null,r),t||x.state.inline||r.isPropagationAllowed||e.stopPropagation();return}if(y&&"Backspace"===e.key&&""===t.value&&void 0===y.highlightedChipIndex&&Array.isArray(D)&&D.length>0){let t=y.chipsRef.current.length,r=t>0?t-1:D.length-1,n=D.filter((e,t)=>t!==r);eg(),x.context.setSelectedValue(n,(0,b.createChangeEventDetails)(C.REASONS.none,e.nativeEvent));return}let a=y?.highlightedChipIndex!==void 0,o=function(e){let t;if(!y)return;let{highlightedChipIndex:r}=y,n=y.chipsRef.current.length,[a,o]="rtl"===E?["ArrowRight","ArrowLeft"]:["ArrowLeft","ArrowRight"];return void 0!==r?e.key===a?(e.preventDefault(),t=r>0?r-1:void 0):e.key===o?(e.preventDefault(),t=r<n-1?r+1:void 0):("Backspace"===e.key||"Delete"===e.key)&&(e.preventDefault(),t=function(e,t){let r=e>=t-1?t-2:e;return r>=0?r:void 0}(r,D.length),eg()):e.key===a&&(e.currentTarget.selectionStart??0)===0&&D.length>0&&(e.preventDefault(),t=n>0?n-1:void 0),t}(e);if(y?.setHighlightedChipIndex(o),void 0!==o?y?.chipsRef.current[o]?.focus():a&&x.context.inputRef.current?.focus(),229!==e.which&&"Enter"===e.key&&j){let t=x.state.activeIndex,r=e.nativeEvent;if(null===t){if(V)return;x.context.setOpen(!1,(0,b.createChangeEventDetails)(C.REASONS.none,r));return}(0,eo.stopEvent)(e),ec(x,t,r)}},onPointerMove:ev,onPointerDown:ev},ed],stateAttributesMapping:en}),eC=v?(0,q.jsx)(k.FieldRootContext.Provider,{value:k.DEFAULT_FIELD_ROOT_CONTEXT,children:eb}):eb;return(0,q.jsxs)(t.Fragment,{children:[j&&(!z||H)&&(0,q.jsx)(ey,{ref:x.context.startDismissRef}),eC]})});var ex=e.i(596296);let eb=t.forwardRef(function(e,t){let{render:r,className:n,style:a,...o}=e,{state:i}=(0,k.useFieldRootContext)(),l=(0,S.useComboboxRootContext)(),u=l.useState("open"),c=l.useState("disabled"),d=l.useState("readOnly"),p=l.useState("hasSelectedValue"),m=l.useState("selectionMode"),g=el(l),h=eu(),y={...i,open:u,disabled:c,readOnly:d,popupSide:g,listEmpty:h,placeholder:"none"!==m&&!p},v=(0,s.useStableCallback)(e=>{l.set("inputGroupElement",e)});return(0,X.useRenderElement)("div",e,{ref:[t,v],props:[{role:"group",onMouseDown(e){!function(e,t,r,n){if(e.baseUIHandlerPrevented)return;let a=(0,x.getTarget)(e.nativeEvent),o=(0,f.isElement)(a)?a:null;o!==e.currentTarget&&(n?.(o)||(0,ex.isInteractiveElement)(o))||(e.preventDefault(),!r&&(t.context.inputRef.current?.focus(),t.state.openOnInputClick&&t.context.setOpen(!0,(0,b.createChangeEventDetails)(C.REASONS.inputPress,e.nativeEvent))))}(e,l,c,e=>(0,x.contains)(l.context.chipsContainerRef.current,e))}},o],state:y,stateAttributesMapping:en})}),eC=t.forwardRef(function(e,t){let{render:r,className:n,style:a,...o}=e;return(0,X.useRenderElement)("span",e,{ref:t,props:[{"aria-hidden":!0,
13children:"▼"},o]})});var eS=e.i(474354);let eI={...eS.transitionStatusMapping,...ee.triggerOpenStateMapping},eE=t.forwardRef(function(e,t){let{render:r,className:n,disabled:a=!1,nativeButton:o=!0,keepMounted:s=!1,style:i,...l}=e,{disabled:u}=(0,k.useFieldRootContext)(),c=(0,S.useComboboxRootContext)(),d=c.useState("selectionMode"),p=c.useState("disabled"),f=c.useState("readOnly"),m=c.useState("open"),g=c.useState("selectedValue"),h=c.useState("hasSelectionChips"),y=(0,S.useComboboxInputValueContext)(),v=!1;v="none"===d?""!==y:"single"===d?null!=g:h;let x=u||p||a,{buttonRef:I,getButtonProps:A}=(0,Q.useButton)({native:o,disabled:x}),{mounted:w,transitionStatus:T,setMounted:R}=(0,O.useTransitionStatus)(v),_={disabled:x,visible:v,open:m,transitionStatus:T};(0,E.useOpenChangeComplete)({open:v,ref:c.context.clearRef,onComplete(){v||R(!1)}});let P=(0,X.useRenderElement)("button",e,{state:_,ref:[t,I,c.context.clearRef],props:[{tabIndex:-1,children:"x",onMouseDown(e){e.preventDefault()},onClick(e){if(x||f)return;let t=c.context.keyboardActiveRef.current?C.REASONS.keyboard:C.REASONS.pointer;c.context.setInputValue("",(0,b.createChangeEventDetails)(C.REASONS.clearPress,e.nativeEvent)),"none"!==d?(c.context.setSelectedValue(Array.isArray(g)?[]:null,(0,b.createChangeEventDetails)(C.REASONS.clearPress,e.nativeEvent)),c.context.setIndices({activeIndex:null,selectedIndex:null,type:t})):c.context.setIndices({activeIndex:null,type:t}),c.context.inputRef.current?.focus()}},l,A],stateAttributesMapping:eI});return s||w?P:null}),ek=t.createContext(null);function eA(e){let{children:r,items:n}=e,a=t.useMemo(()=>({items:n}),[n]);return(0,q.jsx)(ek.Provider,{value:a,children:r})}function ew(e){let{children:r}=e,{filteredItems:n}=(0,S.useComboboxDerivedItemsContext)(),a=t.useContext(ek),o=a?a.items:n;return(0,q.jsx)(t.Fragment,{children:o.map(r)})}var eT=e.i(53687);let eR=t.forwardRef(function(e,r){var n;let{render:a,className:o,style:i,children:l,...u}=e,c=(0,S.useComboboxRootContext)(),d=(0,S.useComboboxFloatingContext)(),p=!!eh(!0),{filteredItems:f,hasItems:m}=(0,S.useComboboxDerivedItemsContext)(),g=c.useState("selectionMode"),h=c.useState("grid"),y=c.useState("readOnly"),v=c.useState("listProps"),x=c.useState("virtualized"),b=c.useState("forceMounted"),C=0===f.length,I=(0,s.useStableCallback)(e=>{c.set("positionerElement",e)}),E=(0,s.useStableCallback)(e=>{c.set("listElement",e)}),k=t.useMemo(()=>"function"==typeof l?n||(n=(0,q.jsx)(ew,{children:l})):l,[l]),A=d.useState("floatingId"),w=(0,X.useRenderElement)("div",e,{state:{empty:C},ref:[r,E,p?null:I],props:[v,{children:k,tabIndex:-1,id:A,role:h?"grid":"listbox","aria-multiselectable":"multiple"===g?"true":void 0,"aria-readonly":!h&&!!y||void 0,onKeyDown(e){if(!c.state.disabled&&!c.state.readOnly&&"Enter"===e.key){let t=c.state.activeIndex;null!=t&&((0,eo.stopEvent)(e),ec(c,t,e.nativeEvent))}},onKeyDownCapture(){c.context.keyboardActiveRef.current=!0},onPointerMoveCapture(){c.context.keyboardActiveRef.current=!1}},u]});if(x)return w;let T=m&&!b?void 0:c.context.labelsRef;return(0,q.jsx)(eT.CompositeList,{elementsRef:c.context.listRef,labelsRef:T,children:w})});function e_(){let e=(0,W.useTimeout)(),r=t.useRef(null);return t.useEffect(()=>{if(ep.platform.os.ios)return;let t=r.current;if(null==t)return;let n=function(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),r=null;for(;t.nextNode();){let e=t.currentNode;""!==e.nodeValue&&(r=e)}return r}(t);
13if(null==n)return;let a=n.data,o=`${a}\u2060`;return n.nodeValue=o,e.start(200,()=>{n.nodeValue===o&&(n.nodeValue=a)}),()=>{e.clear(),n.nodeValue===o&&(n.nodeValue=a)}},[r,e]),r}let eP=t.forwardRef(function(e,t){let{render:r,className:n,style:a,children:o,...s}=e,i=e_();return(0,X.useRenderElement)("div",e,{ref:[t,i],props:[{children:o,role:"status","aria-live":"polite","aria-atomic":!0},s]})});var eN=e.i(726674);let eO=t.createContext(void 0),eM=t.forwardRef(function(e,t){let{keepMounted:r=!1,...n}=e,a=(0,S.useComboboxRootContext)(),o=a.useState("mounted"),s=a.useState("forceMounted");return o||r||s?(0,q.jsx)(eO.Provider,{value:r,children:(0,q.jsx)(eN.FloatingPortal,{ref:t,...n})}):null}),ej={...ee.popupStateMapping,...eS.transitionStatusMapping},eL=t.forwardRef(function(e,t){let{render:r,className:n,style:a,...o}=e,s=(0,S.useComboboxRootContext)(),i=s.useState("open"),l=s.useState("mounted"),u=s.useState("transitionStatus");return(0,X.useRenderElement)("div",e,{state:{open:i,transitionStatus:u},ref:t,stateAttributesMapping:ej,props:[{role:"presentation",hidden:!l,style:{userSelect:"none",WebkitUserSelect:"none"}},o]})});var eD=e.i(144394),eF=e.i(923706),eV=e.i(638396),eH=e.i(426),eZ=e.i(789579),eK=e.i(33383);let eB=t.forwardRef(function(e,n){let{render:o,className:i,anchor:l,positionMethod:u,side:c,align:d,sideOffset:p,alignOffset:f,collisionBoundary:m="clipping-ancestors",collisionPadding:g,arrowPadding:h,sticky:y,disableAnchorTracking:v=!1,collisionAvoidance:x=eV.DROPDOWN_COLLISION_AVOIDANCE,style:b,...C}=e,I=(0,S.useComboboxRootContext)(),E=(0,S.useComboboxFloatingContext)(),k=function(){let e=t.useContext(eO);if(void 0===e)throw Error((0,r.default)(20));return e}(),A=I.useState("modal"),w=I.useState("open"),T=I.useState("mounted"),R=I.useState("openMethod"),_=I.useState("positionerElement"),P=I.useState("triggerElement"),N=I.useState("inputElement"),O=I.useState("inputGroupElement"),M=I.useState("inputInsidePopup"),j=I.useState("transitionStatus"),L=eu(),D=(0,eF.useAnchorPositioning)({anchor:l??(M?P:O??N),floatingRootContext:E,positionMethod:u,mounted:T,side:c,sideOffset:p,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:y,disableAnchorTracking:v,keepMounted:k,collisionAvoidance:x,lazyFlip:!0});(0,eK.useAnchoredPopupScrollLock)(w&&A,"touch"===R,_,P);let F={open:w,side:D.side,align:D.align,anchorHidden:D.anchorHidden,empty:L};(0,a.useIsoLayoutEffect)(()=>{I.set("popupSide",D.side)},[I,D.side]);
13let V=(0,s.useStableCallback)(e=>{I.set("positionerElement",e)}),H=(0,eZ.usePositioner)(e,F,{styles:D.positionerStyles,transitionStatus:j,props:C,refs:[n,V],hidden:!T,inert:!w});return(0,q.jsxs)(eg.Provider,{value:D,children:[T&&A&&(0,q.jsx)(eH.InternalBackdrop,{inert:(0,eD.inertValue)(!w),cutout:O??N??P}),H]})});var e$=e.i(61487),eU=e.i(253984);let eq={...ee.popupStateMapping,...eS.transitionStatusMapping},ez=t.forwardRef(function(e,r){let{render:n,className:o,style:s,initialFocus:i,finalFocus:l,...u}=e,c=(0,S.useComboboxRootContext)(),d=eh(),p=(0,S.useComboboxFloatingContext)(),f=c.useState("mounted"),m=c.useState("open"),g=c.useState("openMethod"),h=c.useState("popupProps"),y=c.useState("transitionStatus"),v=c.useState("inputInsidePopup"),b=c.useState("inputElement"),C=c.useState("modal"),I=c.useState("id"),k=eu(),A=u.id??(v?_(I):void 0);(0,a.useIsoLayoutEffect)(()=>(c.set("popupId",c.context.popupRef.current?.id||A),()=>{c.set("popupId",void 0)}),[c,A]),(0,E.useOpenChangeComplete)({open:m,ref:c.context.popupRef,onComplete(){m&&c.context.onOpenChangeComplete(!0)}});let w={open:m,side:d.side,align:d.align,anchorHidden:d.anchorHidden,transitionStatus:y,empty:k},T=(0,X.useRenderElement)("div",e,{state:w,ref:[r,c.context.popupRef],props:[h,{id:A,role:v?"dialog":"presentation",onFocus(e){let t=(0,x.getTarget)(e.nativeEvent);"touch"!==g&&((0,x.contains)(c.state.listElement,t)||t===e.currentTarget)&&c.context.inputRef.current?.focus()}},(0,eU.getDisabledMountTransitionStyles)(y),u],stateAttributesMapping:eq}),R=!!v&&(e=>"touch"===e?c.context.popupRef.current:b),P=!v||C;return(0,q.jsx)(e$.FloatingFocusManager,{context:p,disabled:!f,modal:P,openInteractionType:g,initialFocus:void 0===i?R:i,returnFocus:null!=l?l:!!v&&void 0,getInsideElements:()=>[c.context.startDismissRef.current,c.context.endDismissRef.current],children:(0,q.jsxs)(t.Fragment,{children:[T,P&&(0,q.jsx)(ey,{ref:c.context.endDismissRef})]})})}),eJ=t.forwardRef(function(e,t){let{render:r,className:n,style:a,...o}=e,s=(0,S.useComboboxRootContext)(),{arrowRef:i,side:l,align:u,arrowUncentered:c,arrowStyles:d}=eh(),p=s.useState("open");return(0,X.useRenderElement)("div",e,{ref:[i,t],stateAttributesMapping:ee.popupStateMapping,state:{open:p,side:l,align:u,uncentered:c},props:{style:d,"aria-hidden":!0,...o}})}),eY=t.createContext(void 0),eW=t.forwardRef(function(e,r){let{render:n,className:a,style:o,items:s,...i}=e,l=(0,S.useComboboxRootContext)().useState("grid"),[u,c]=t.useState(),d=t.useMemo(()=>({labelId:u,setLabelId:c,items:s}),[u,c,s]),p=(0,X.useRenderElement)("div",e,{ref:r,props:[{role:l?"rowgroup":"group","aria-labelledby":u},i]}),f=(0,q.jsx)(eY.Provider,{value:d,children:p});return s?(0,q.jsx)(eA,{items:s,children:f}):f}),eG=t.forwardRef(function(e,n){let{render:o,className:s,style:i,id:l,...u}=e,{setLabelId:c}=function(){let e=t.useContext(eY);if(void 0===e)throw Error((0,r.default)(18));return e}(),d=(0,ef.useBaseUiId)(l);return(0,a.useIsoLayoutEffect)(()=>(c(d),()=>{c(e=>e===d?void 0:e)}),[d,c]),(0,X.useRenderElement)("div",e,{ref:n,props:[{id:d,"aria-hidden":!0},u]})});var eX=e.i(174080),eQ=e.i(673553);let e0=t.createContext(void 0),e1=t.createContext(!1);function e5(e){let{componentProps:r,forwardedRef:n,virtualized:o,indexFromFilter:s}=e,{render:i,className:l,style:u,value:c=null,index:d,disabled:p=!1,nativeButton:f=!1,...m}=r,g=t.useRef(null),h=(0,eQ.useCompositeListItem)({guess:!0,index:d,textRef:g}),y=(0,S.useComboboxRootContext)(),v=t.useContext(e1),x=(0,S.useComboboxHasItemsContext)(),b=y.useState("selectionMode"),C=y.useState("disabled"),I=y.useState("readOnly"),E=y.useState("isItemEqualToValue"),k=C||p,A="none"!==b,w=d??s??h.index,T=-1!==w,R=y.useState("id"),_=y.useState("isActive",w),P=y.useState("isSelected",c),N=y.useState("itemProps"),O=t.useRef(null),M=null!=R&&T?`${R}-${w}`:void 0,j=P&&A;(0,a.useIsoLayoutEffect)(()=>{if(!(T&&(o||null!=d)))return;let e=y.context.listRef.current;return e[w]=O.current,()=>{delete e[w]}},[T,o,w,d,y]),(0,a.useIsoLayoutEffect)(()=>{if(!T||x)return;let e=y.context.valuesRef.current;return e[w]=c,()=>{delete e[w]}},[T,x,w,c,y]),(0,a.useIsoLayoutEffect)(()=>
13{if(!T||x)return;let e=y.state.selectedValue,t=y.state.selectedIndex;"multiple"===y.state.selectionMode&&Array.isArray(e)?t=(0,K.resolveSelectedIndex)(w,c,y.context.valuesRef.current,e,E,t):(0,K.compareItemEquality)(c,e,E)&&(t=w),y.set("selectedIndex",t)},[T,x,y,w,c,E]);let{getButtonProps:L,buttonRef:D}=(0,Q.useButton)({disabled:k,focusableWhenDisabled:!0,native:f,composite:!0});function F(e){function t(){y.context.handleSelection(e,c)}y.state.submitOnItemClick?(eX.flushSync(t),y.context.requestSubmit()):t()}let V=(0,X.useRenderElement)("div",r,{ref:[D,n,h.ref,O],state:{disabled:k,selected:j,highlighted:_},props:[N,{id:M,role:v?"gridcell":"option","aria-selected":A?j:void 0,tabIndex:void 0,onPointerDownCapture(e){e.isPrimary&&(y.context.pointerDownItemRef.current=e.currentTarget),e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){k||I||F(e.nativeEvent)},onMouseUp(e){let t=y.context.pointerDownItemRef.current===e.currentTarget;y.context.pointerDownItemRef.current=null,k||I||0!==e.button||t||!_||F(e.nativeEvent)}},m,L]}),H=t.useMemo(()=>({selected:j,textRef:g}),[j,g]);return(0,q.jsx)(e0.Provider,{value:H,children:V})}function e2(e){let{componentProps:t,forwardedRef:r}=e,n=(0,S.useComboboxRootContext)().useState("isItemEqualToValue"),{flatFilteredValues:a}=(0,S.useComboboxDerivedItemsContext)(),o=t.value??null,s=(0,K.findItemIndex)(a,o,n);return(0,q.jsx)(e5,{componentProps:t,forwardedRef:r,virtualized:!0,indexFromFilter:s})}let e9=t.memo(t.forwardRef(function(e,t){let r=(0,S.useComboboxRootContext)().useState("virtualized");return r&&null==e.index?(0,q.jsx)(e2,{componentProps:e,forwardedRef:t}):(0,q.jsx)(e5,{componentProps:e,forwardedRef:t,virtualized:r,indexFromFilter:void 0})})),e7=t.forwardRef(function(e,t){let{render:r,className:n,style:a,...o}=e,s=(0,X.useRenderElement)("div",e,{ref:t,props:[{role:"row"},o]});return(0,q.jsx)(e1.Provider,{value:!0,children:s})}),e4=t.forwardRef(function(e,t){let{render:r,className:n,style:a,children:o,...s}=e,{filteredItems:i}=(0,S.useComboboxDerivedItemsContext)(),l=(0,S.useComboboxRootContext)(),u=e_(),c=0===i.length?o:null;return(0,X.useRenderElement)("div",e,{ref:[t,l.context.emptyRef,u],props:[{children:c,role:"status","aria-live":"polite","aria-atomic":!0},s]})}),e3=t.forwardRef(function(e,t){let{className:r,render:n,orientation:a="horizontal",style:o,...s}=e;return(0,X.useRenderElement)("div",e,{state:{orientation:a},ref:t,props:[{role:"presentation"},s]})});function e6(){return(0,S.useComboboxDerivedItemsContext)().filteredItems}var e8=e.i(196799),e8=e8;let te=e8.Root,tt=e8.Collection,tr=e8.Input,tn=e8.List,ta=e8.Item,to=e8.Group,ts=e8.GroupLabel;e8.Empty;let ti=e8.Status},445991,e=>{"use strict";e.s(["DropdownMenu",()=>o,"DropdownMenuContent",()=>i,"DropdownMenuItem",()=>l,"DropdownMenuTrigger",()=>s]);var t=e.i(843476),r=e.i(451512),n=e.i(628083),a=e.i(296548);let o=e=>(0,t.jsx)(r.Menu.Root,{modal:!1,...e}),s=({className:e,...n})=>(0,t.jsx)(r.Menu.Trigger,{className:(0,a.cn)("group disabled:pointer-events-none rounded-lg overflow-hidden","flex items-center py-0.5 gap-1 text-sm text-gray-950/50 dark:text-white/50 group-hover:text-gray-950/70 dark:group-hover:text-white/70",e),...n}),i=({align:e="start",className:n,side:o="bottom",sideOffset:s=4,_container:i,...l})=>(0,t.jsx)(r.Menu.Portal,{container:i,children:(0,t.jsx)(r.Menu.Positioner,{className:"z-[999] data-anchor-hidden:invisible",align:e,collisionPadding:16,side:o,sideOffset:s,children:(0,t.jsx)(r.Menu.Popup,{style:{textRendering:"geometricPrecision"},className:(0,a.cn)("origin-(--transform-origin) outline-none shadow-xl dark:shadow-none shadow-gray-500/5 dark:shadow-gray-500/5 bg-white dark:bg-gray-950 p-1 relative z-[999] max-h-96 min-w-(--anchor-width) overflow-y-auto rounded-2xl border border-gray-200 dark:border-white/10 text-gray-950/70 dark:text-white/70","data-starting-style:opacity-0 data-starting-style:scale-95 data-ending-style:opacity-0 data-ending-style:scale-95","transition-[scale,opacity] duration-100 ease-out motion-reduce:transition-none",n),...l})})}),l=({className:e,isSelected:o,...s})=>(0,t.jsxs)(r.Menu.Item,{"data-active":o||void 0,className:(0,a.cn)("flex items-center justify-between p-2 gap-2 text-sm rounded-xl group hover:bg-background-dark/[0.03] dark:hover:bg-background-light/[0.03] data-highlighted:bg-background-dark/5 dark:data-highlighted:bg-background-light/5 relative w-full cursor-pointer select-none outline-0 data-disabled:pointer-events-none data-disabled:cursor-default data-disabled:opacity-50",o?"text-primary dark:text-primary-light font-medium":"text-gray-800 dark:text-gray-300 hover:text-gray-950/75 dark:hover:text-white/75 data-highlighted:text-gray-950/75 dark:data-highlighted:text-white/75",e),...s,children:[s.children,(0,t.jsx)(n.Check2Icon,{"aria-hidden":"true",className:(0,a.cn)("size-3.5 shrink-0",o?"text-primary dark:text-primary-light":"text-primary/0 dark:text-primary-light/0"),strokeWidth:2.5})]})},631926,(e,t,r)=>{var n=e.r(139088);t.exports=function(){return n.Date.now()}},748891,(e,t,r)=>{var n=/\s/;t.exports=function(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}},830364,(e,t,r)=>{var n=e.r(748891),a=/^\s+/;t.exports=function(e){return e?e.slice(0,n(e)+1).replace(a,""):e}},773759,(e,t,r)=>{var n=e.r(830364),a=e.r(12447),o=e.r(361884),s=0/0,i=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;t.exports=function(e){if("number"==typeof e)return e;if(o(e))return s;if(a(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=a(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=l.test(e);return r||u.test(e)?c(e.slice(2),r?2:8):i.test(e)?s:+e}},374009,(e,t,r)=>{var n=e.r(12447),a=e.r(631926),o=e.r(773759),s=Math.max,i=Math.min;t.exports=function(e,t,r){var l,u,c,d,p,f,m=0,g=!1,h=!1,y=!0;if("function"!=typeof e)throw TypeError("Expected a function");function v(t){var r=l,n=u;return l=u=void 0,m=t,d=e.apply(n,r)}function x(e){var r=e-f,n=e-m;return void 0===f||r>=t||r<0||h&&n>=c}function b(){var e,r,n,o=a();if(x(o))return C(o);
13p=setTimeout(b,(e=o-f,r=o-m,n=t-e,h?i(n,c-r):n))}function C(e){return(p=void 0,y&&l)?v(e):(l=u=void 0,d)}function S(){var e,r=a(),n=x(r);if(l=arguments,u=this,f=r,n){if(void 0===p)return m=e=f,p=setTimeout(b,t),g?v(e):d;if(h)return clearTimeout(p),p=setTimeout(b,t),v(f)}return void 0===p&&(p=setTimeout(b,t)),d}return t=o(t)||0,n(r)&&(g=!!r.leading,c=(h="maxWait"in r)?s(o(r.maxWait)||0,t):c,y="trailing"in r?!!r.trailing:y),S.cancel=function(){void 0!==p&&clearTimeout(p),m=0,l=f=u=p=void 0},S.flush=function(){return void 0===p?d:C(a())},S}},385658,(e,t,r)=>{var n=e.r(702922),a=0;t.exports=function(e){var t=++a;return n(e)+t}},594480,579804,585009,700810,334459,992511,238983,414130,66445,260333,433972,835963,22441,35242,767436,133922,685791,584542,e=>{"use strict";e.s(["getDuplicates",()=>t,"getDuplicatesWith2DArrayInOrder",()=>r],594480);let t=e=>{let t=new Set,r=new Set;for(let n of e)t.has(n)?r.add(n):t.add(n);return r},r=(e,t=!1)=>{if(e.length<=1)return new Set;for(let t of e)if(0===t.length)return new Set;let r=new Set,n=Math.min(...e.map(e=>e.length)),a=t?n-1:n;for(let t=0;t<a;t++){let n=e[0]?.[t];if(void 0===n)continue;let a=!0;for(let r=1;r<e.length;r++)if(e[r]?.[t]!==n){a=!1;break}a&&r.add(n)}return r};e.s(["EMPTY_SEARCH_VERSION_SCOPE",()=>o,"getSearchVersionOptions",()=>u,"getSearchVersionScope",()=>l],579804);var n=e.i(427751),a=e.i(752473);let o={kind:"none"},s=["groups",...a.divisions],i=(e,t,r)=>{for(let a of s){let o=(0,n.readObjectArrayProperty)(e,a);if(o)for(let e of o){let n=r;if("products"===a){if("string"!=typeof e.product||!0===e.hidden)continue;n=e.product}if("versions"===a){if("string"!=typeof e.version||!0===e.hidden)continue;if(n){let r=t.versionsByProduct.get(n)??[],a="string"==typeof e.name&&e.name?e.name:e.version;r.some(t=>t.value===e.version)||r.push({value:e.version,label:a}),t.versionsByProduct.set(n,r)}else t.globalVersions.add(e.version)}i(e,t,n)}}},l=e=>{if(!e)return o;let t={globalVersions:new Set(e.global?.versions?.filter(e=>!0!==e.hidden).map(e=>e.version)??[]),versionsByProduct:new Map};return(i(e,t),t.globalVersions.size>0)?{kind:"global",versionValues:t.globalVersions}:t.versionsByProduct.size>0?{kind:"product",versionsByProduct:t.versionsByProduct}:o},u=({scope:e,selectedProduct:t,globalVersions:r})=>"global"===e.kind?r.filter(t=>e.versionValues.has(t.value)):"product"===e.kind?t?e.versionsByProduct.get(t)??[]:[]:r;e.s(["getVersionCrumb",()=>d],585009);var c=e.i(194838);function d(e,t,r){if(!t)return e.metadata?.version||r?.get((0,c.optionallyRemoveLeadingSlash)(e.page))||void 0}e.s(["AltKeyFilledIcon",()=>f],700810);var p=e.i(930733);let f=(0,p.default)("AltKeyFilledIcon",[["path",{d:"M14.209 1.99902C15.8658 1.99902 17.209 3.34217 17.209 4.99902V13.001C17.209 14.6578 15.8658 16.001 14.209 16.001H3.79199C2.13514 16.001 0.791992 14.6578 0.791992 13.001V4.99902C0.791992 3.34217 2.13514 1.99902 3.79199 1.99902H14.209ZM3.28 11.5547H4.351L4.596 10.3997H5.814L6.059 11.5547H7.13L5.863 6.4447H4.533L3.28 11.5547ZM4.771 9.5597L5.03 8.3207C5.06733 8.14337 5.1 7.96837 5.128 7.7957C5.16067 7.62303 5.18633 7.4877 5.205 7.3897C5.22367 7.4877 5.24933 7.62537 5.282 7.8027C5.31933 7.97537 5.35433 8.15037 5.387 8.3277L5.632 9.5597H4.771ZM7.61789 11.5547H10.73289V10.5747H8.66789V6.4447H7.61789ZM12.3748 11.5547H13.4248V7.4247H14.7198V6.4447H11.0798V7.4247H12.3748Z",fill:"currentColor"}]],"filled");e.s(["EscKeyFilledIcon",()=>m],334459);let m=(0,p.default)("EscKeyFilledIcon",[["path",{d:"M14.209 1.99902C15.8658 1.99902 17.209 3.34217 17.209 4.99902V13.001C17.209 14.6578 15.8658 16.001 14.209 16.001H3.79199C2.13514 16.001 0.791992 14.6578 0.791992 13.001V4.99902C0.791992 3.34217 2.13514 1.99902 3.79199 1.99902H14.209ZM8.88867 6.375C8.54334 6.375 8.24419 6.43531 7.99219 6.55664C7.7402 6.67797 7.54429 6.85121 7.4043 7.0752C7.26911 7.29438 7.20124 7.55317 7.20117 7.85156C7.20117 8.2529 7.32059 8.59402 7.55859 8.87402C7.80124 9.14929 8.13933 9.33875 8.57324 9.44141L9.0918 9.55957C9.25966 9.59692 9.39012 9.67007 9.4834 9.77734C9.57662 9.88464 9.62305 10.0129 9.62305 10.1621C9.62302 10.3347 9.56054 10.4704 9.43457 10.5684C9.31332 10.6663 9.14291 10.7148 8.92383 10.7148C8.69516 10.7148 8.51229 10.6664 8.37695 10.5684C8.24642 10.4658 8.18171 10.3278 8.18164 10.1553H7.13184C7.13188 10.4538 7.20407 10.7124 7.34863 10.9316C7.4933 11.151 7.69884 11.322 7.96484 11.4434C8.23072 11.5645 8.54326 11.625 8.90234 11.625C9.26161 11.625 9.5717 11.5615 9.83301 11.4355C10.0989 11.3096 10.3046 11.1328 10.4492 10.9043C10.5985 10.6757 10.6738 10.4118 10.6738 10.1133C10.6738 9.69795 10.5566 9.35682 10.3232 9.09082C10.0899 8.82025 9.74651 8.63389 9.29395 8.53125L8.74805 8.40527C8.58951 8.36792 8.46557 8.29792 8.37695 8.19531C8.29297 8.08798 8.25098 7.95889 8.25098 7.80957C8.25107 7.64182 8.30492 7.51339 8.41211 7.4248C8.51938 7.33153 8.67354 7.28521 8.87402 7.28516C9.08857 7.28516 9.25226 7.33157 9.36426 7.4248C9.48082 7.51806 9.53896 7.64644 9.53906 7.80957H10.5898C10.5897 7.37111 10.4349 7.02318 10.127 6.7666C9.82371 6.50557 9.41095 6.37504 8.88867 6.375ZM12.7773 6.375C12.4368 6.37504 12.1384 6.44067 11.8818 6.57129C11.6252 6.69726 11.424 6.87395 11.2793 7.10254C11.1393 7.33121 11.0693 7.60237 11.0693 7.91504V10.085C11.0693 10.393 11.1393 10.6641 11.2793 10.8975C11.4239 11.126 11.6253 11.3049 11.8818 11.4355C12.1384 11.5615 12.4368 11.625 12.7773 11.625C13.1227 11.625 13.4218 11.5615 13.6738 11.4355C13.9302 11.305 14.1286 11.1259 14.2686 10.8975C14.4132 10.6641 14.4854 10.393 14.4854 10.085H13.4355C13.4355 10.2855 13.3773 10.4417 13.2607 10.5537C13.1487 10.661 12.9873 10.7148 12.7773 10.7148C12.5675 10.7148 12.4047 10.6609 12.2881 10.5537C12.1761 10.4417 12.1201 10.2856 12.1201 10.085V7.91504C12.1201 7.70971 12.1761 7.55362 12.2881 7.44629C12.4047 7.33906 12.5675 7.28521 12.7773 7.28516C12.9873 7.28516 13.1487 7.33896 13.2607 7.44629C13.3773 7.55362 13.4355 7.70981 13.4355 7.91504H14.4854C14.4854 7.60237 14.4132 7.33121 14.2686 7.10254C14.1286 6.87413 13.9302 6.69721 13.6738 6.57129C13.4218 6.44062 13.1227 6.375 12.7773 6.375ZM3.51562 11.5547H6.66504V10.6592H4.54395V9.38477H6.41992V8.48926H4.54395V7.34082H6.66504V6.44531H3.51562V11.5547Z",fill:"currentColor"}]],"filled");
13e.s(["OptionKeyFilledIcon",()=>g],992511);let g=(0,p.default)("OptionKeyFilledIcon",[["path",{d:"M13.1768 2.00293C14.7387 2.00319 16.0059 3.27002 16.0059 4.83203V13.1758C16.0057 14.7377 14.7386 16.0046 13.1768 16.0049H4.83301C3.27092 16.0049 2.00308 14.7378 2.00293 13.1758V4.83203C2.00293 3.26985 3.27083 2.00293 4.83301 2.00293H13.1768ZM5.57715 5.15918C5.10771 5.15918 4.72754 5.53935 4.72754 6.00879C4.72763 6.47816 5.10776 6.8584 5.57715 6.8584H6.02344C6.45227 6.8584 6.70715 6.86042 6.89648 6.88086C7.06428 6.89901 7.10069 6.92555 7.1084 6.93066C7.11607 6.9357 7.15529 6.95893 7.23828 7.10645C7.33158 7.27236 7.43283 7.50571 7.60156 7.89941L8.83594 10.7773C8.9904 11.1377 9.1316 11.4711 9.28027 11.7354C9.43899 12.0174 9.64147 12.2892 9.95508 12.4961C10.2689 12.703 10.599 12.7826 10.9209 12.8174C11.2224 12.8499 11.5844 12.8486 11.9766 12.8486H12.4229C12.8922 12.8486 13.2722 12.4683 13.2725 11.999C13.2725 11.5296 12.8923 11.1484 12.4229 11.1484H11.9766C11.5477 11.1484 11.2928 11.1474 11.1035 11.127C10.9369 11.1089 10.8997 11.0825 10.8916 11.0771C10.8841 11.0722 10.8449 11.0493 10.7617 10.9014C10.6684 10.7355 10.5672 10.5021 10.3984 10.1084L9.16406 7.22949C9.00969 6.86928 8.86834 6.53665 8.71973 6.27246C8.56095 5.99025 8.35879 5.71774 8.04492 5.51074C7.73106 5.30378 7.40101 5.22522 7.0791 5.19043C6.77757 5.15787 6.41559 5.15918 6.02344 5.15918H5.57715ZM10.4238 5.15918C9.95439 5.15918 9.57324 5.53935 9.57324 6.00879C9.57333 6.47816 9.95444 6.8584 10.4238 6.8584H12.4229C12.8922 6.8584 13.2724 6.47816 13.2725 6.00879C13.2725 5.53935 12.8923 5.15918 12.4229 5.15918H10.4238Z",fill:"currentColor"}]],"filled");e.s(["ReturnKeyFilledIcon",()=>h],238983);let h=(0,p.default)("ReturnKeyFilledIcon",[["path",{d:"M14.25 2H3.75C2.233 2 1 3.233 1 4.75V13.25C1 14.767 2.233 16 3.75 16H14.25C15.767 16 17 14.767 17 13.25V4.75C17 3.233 15.767 2 14.25 2ZM14 9.25C14 10.215 13.215 11 12.25 11H6.561L7.281 11.72C7.574 12.013 7.574 12.488 7.281 12.781C7.135 12.927 6.943 13.001 6.751 13.001C6.559 13.001 6.367 12.928 6.221 12.781L4.221 10.781C3.928 10.488 3.928 10.013 4.221 9.72L6.221 7.72C6.514 7.427 6.989 7.427 7.282 7.72C7.575 8.013 7.575 8.488 7.282 8.781L6.562 9.501H12.251C12.389 9.501 12.501 9.389 12.501 9.251V7.251C12.501 7.113 12.389 7.001 12.251 7.001H10.751C10.337 7.001 10.001 6.665 10.001 6.251C10.001 5.837 10.337 5.501 10.751 5.501H12.251C13.216 5.501 14.001 6.286 14.001 7.251V9.251L14 9.25Z",fill:"currentColor"}]],"filled");e.s(["Sparkle2FilledIcon",()=>y],414130);let y=(0,p.default)("Sparkle2FilledIcon",[["path",{d:"M16.525 6.05302L13.245 4.75602L11.947 1.47502C11.72 0.903021 10.779 0.903021 10.552 1.47502L9.25402 4.75602L5.97402 6.05302C5.68802 6.16602 5.49902 6.44302 5.49902 6.75002C5.49902 7.05702 5.68702 7.33402 5.97402 7.44702L9.25402 8.74402L10.552 12.025C10.665 12.311 10.942 12.499 11.249 12.499C11.556 12.499 11.833 12.311 11.946 12.025L13.244 8.74402L16.524 7.44702C16.81 7.33402 16.999 7.05702 16.999 6.75002C16.999 6.44302 16.812 6.16602 16.525 6.05302Z",fill:"currentColor"}],["path",{rule:"evenodd",d:"M4.75 9.5C5.09415 9.5 5.39414 9.73422 5.47761 10.0681L5.96847 12.0315L7.9319 12.5224C8.26578 12.6059 8.5 12.9058 8.5 13.25C8.5 13.5942 8.26578 13.8941 7.9319 13.9776L5.96847 14.4685L5.47761 16.4319C5.39414 16.7658 5.09415 17 4.75 17C4.40585 17 4.10586 16.7658 4.02239 16.4319L3.53153 14.4685L1.5681 13.9776C1.23422 13.8941 1 13.5942 1 13.25C1 12.9058 1.23422 12.6059 1.5681 12.5224L3.53153 12.0315L4.02239 10.0681C4.10586 9.73422 4.40585 9.5 4.75 9.5Z",fill:"currentColor"}]],"filled");e.s(["SquareArrowDownFilledIcon",()=>v],66445);let v=(0,p.default)("SquareArrowDownFilledIcon",[["path",{d:"M13.25 2H4.75C3.233 2 2 3.233 2 4.75V13.25C2 14.767 3.233 16 4.75 16H13.25C14.767 16 16 14.767 16 13.25V4.75C16 3.233 14.767 2 13.25 2ZM12.03 10.28L9.53 12.78C9.384 12.926 9.192 13 9 13C8.808 13 8.616 12.927 8.47 12.78L5.97 10.28C5.677 9.987 5.677 9.512 5.97 9.219C6.263 8.926 6.738 8.926 7.031 9.219L8.251 10.439V5.75C8.251 5.336 8.587 5 9.001 5C9.415 5 9.751 5.336 9.751 5.75V10.439L10.971 9.219C11.264 8.926 11.739 8.926 12.032 9.219C12.325 9.512 12.325 9.987 12.032 10.28H12.03Z",fill:"currentColor"}]],"filled");
13e.s(["SquareArrowUpFilledIcon",()=>x],260333);let x=(0,p.default)("SquareArrowUpFilledIcon",[["path",{d:"M13.25 2H4.75C3.233 2 2 3.233 2 4.75V13.25C2 14.767 3.233 16 4.75 16H13.25C14.767 16 16 14.767 16 13.25V4.75C16 3.233 14.767 2 13.25 2ZM12.03 8.78C11.884 8.926 11.692 9 11.5 9C11.308 9 11.116 8.927 10.97 8.78L9.75 7.56V12.249C9.75 12.663 9.414 12.999 9 12.999C8.586 12.999 8.25 12.663 8.25 12.249V7.561L7.03 8.781C6.737 9.074 6.262 9.074 5.969 8.781C5.676 8.488 5.676 8.013 5.969 7.72L8.469 5.22C8.762 4.927 9.237 4.927 9.53 5.22L12.03 7.72C12.323 8.013 12.323 8.488 12.03 8.781V8.78Z",fill:"currentColor"}]],"filled");e.s(["VShapedArrowRightIcon",()=>b],433972);let b=(0,p.default)("VShapedArrowRightIcon",[["path",{d:"M7.5 2.75L11.75 9L7.5 15.25",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}]],"outlined");e.s(["useAssistantEnterAnalytics",()=>k],835963);var C=e.i(859465),S=e.i(91557),I=e.i(865420),E=e.i(271645);let k=()=>{let e=(0,E.useContext)(C.AssistantUiContext),{subdomain:t}=(0,E.useContext)(S.DeploymentMetadataContext),r=(0,I.useAnalyticsContext)("docs.assistant.enter");return(0,E.useCallback)((n,a)=>{r({subdomain:t,assistantUi:e,query:n,entryPoint:a})},[t,e,r])};e.s(["generateBreadcrumbs",()=>A],22441);let A=(e,t,r,n)=>{let a="title"in e&&"string"==typeof e.title?e.title:void 0,o="breadcrumbs"in e&&Array.isArray(e.breadcrumbs)?e.breadcrumbs:void 0;if(!o)return[t];if(r)return(o.at(-1)===a?o.slice(0,-1):o).concat([t]);if(o.at(-1)!==a)return o.concat([t]).slice(-2);{let e=o.slice(0,-1),t=e.filter(e=>!n?.has(e));return t.length>0?t:e}};e.s(["focusAssistantPageInput",()=>T],35242);var w=e.i(111048);function T(){let e=document.querySelector("[data-assistant-page]"),t=e?.querySelector(`#${w.Ids.ChatAssistantTextArea}`);return t instanceof HTMLTextAreaElement&&(t.focus(),t.setSelectionRange(t.value.length,t.value.length),!0)}e.s(["SearchResultIcon",()=>j],685791);var R=e.i(843476);let _=(0,p.default)("HashtagIcon",[["path",{d:"M3.75 6.25H15.25",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M2.75 11.75H14.25",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M7.633 2.75L5.289 15.25",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M12.711 2.75L10.367 15.25",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}]],"outlined");e.s(["FileContentIcon",()=>P],767436);let P=(0,p.default)("FileContentIcon",[["path",{d:"M5.75 6.75H7.75",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M5.75 9.75H12.25",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M5.75 12.75H12.25",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M2.75 14.25V3.75C2.75 2.645 3.645 1.75 4.75 1.75H10.336C10.601 1.75 10.856 1.855 11.043 2.043L14.957 5.957C15.145 6.145 15.25 6.399 15.25 6.664V14.25C15.25 15.355 14.355 16.25 13.25 16.25H4.75C3.645 16.25 2.75 15.355 2.75 14.25Z",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M15.16 6.24999H11.75C11.198 6.24999 10.75 5.80199 10.75 5.24999V1.85199",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}]],"outlined");e.s(["SquareTerminalIcon",()=>N],133922);let N=(0,p.default)("SquareTerminalIcon",[["path",{d:"M13.25 2.75H4.75C3.64543 2.75 2.75 3.64543 2.75 4.75V13.25C2.75 14.3546 3.64543 15.25 4.75 15.25H13.25C14.3546 15.25 15.25 14.3546 15.25 13.25V4.75C15.25 3.64543 14.3546 2.75 13.25 2.75Z",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M9.75 12.25H12.25",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M5.75 12.25L8.25 9.75L5.75 7.25",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}]],"outlined");var O=e.i(296548),M=e.i(568258);let j=({type:e,icon:t})=>{let r="text-gray-500 dark:text-gray-400 h-4 w-4 shrink-0";return"api-playground"===e?(0,R.jsx)(N,{className:r}):"section"===e?(0,R.jsx)(_,{className:r}):t?(0,R.jsx)(M.ComponentIcon,{icon:t,iconType:"regular",className:(0,O.cn)(r,"bg-gray-500 dark:bg-gray-400"),overrideColor:!0}):(0,R.jsx)(P,{className:r})};e.s(["SearchButton",()=>H],584542);var L=e.i(343590),D=e.i(206558),F=e.i(535345),V=e.i(477222);let H=(0,E.forwardRef)(function({className:e,children:t,id:r,...n}
13,a){let o=(0,L.useSelectedLocale)(),s=(0,F.useActionKey)(),{onSearchModalOpen:i}=(0,E.useContext)(V.SearchContext);return D.SEARCH_REMOVED?null:(0,R.jsx)("button",{type:"button",...n,onClick:i,className:e,id:r,"aria-label":o["aria.openSearch"],ref:a,children:"function"==typeof t?t({actionKey:s}):t})})},346089,e=>{"use strict";e.s(["Sparkle3Icon",()=>t]);let t=(0,e.i(930733).default)("Sparkle3Icon",[["path",{d:"M5.65799 2.99L4.39499 2.569L3.97399 1.306C3.83699 0.898 3.16199 0.898 3.02499 1.306L2.60399 2.569L1.34099 2.99C1.13699 3.058 0.998993 3.249 0.998993 3.464C0.998993 3.679 1.13699 3.87 1.34099 3.938L2.60399 4.359L3.02499 5.622C3.09299 5.826 3.28499 5.964 3.49999 5.964C3.71499 5.964 3.90599 5.826 3.97499 5.622L4.39599 4.359L5.65899 3.938C5.86299 3.87 6.00099 3.679 6.00099 3.464C6.00099 3.249 5.86199 3.058 5.65799 2.99Z",fill:"currentColor",stroke:"none"}],["path",{d:"M9.5 2.75L11.412 7.587L16.25 9.5L11.412 11.413L9.5 16.25L7.587 11.413L2.75 9.5L7.587 7.587L9.5 2.75Z",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}]],"outlined")},477222,311844,e=>{"use strict";e.s(["ChatAssistantContext",()=>ec,"DEBOUNCE_TIME_IN_MS",()=>ei,"SearchContext",()=>ed,"SearchProvider",()=>ep],477222);var t=e.i(843476),r=e.i(915476),n=e.i(721999),a=e.i(859465),o=e.i(91557),s=e.i(343590),i=e.i(206558),l=e.i(647908),u=e.i(535345),c=e.i(865420),d=e.i(994947),p=e.i(395671),f=e.i(308735),m=e.i(810595),g=e.i(888076),h=e.i(202225),y=e.i(690236),v=e.i(268532),x=e.i(28760),b=e.i(111048),C=e.i(674987),S=e.i(730275),I=e.i(174716),E=e.i(445991),k=e.i(152537),A=e.i(594480),w=e.i(637054),T=e.i(579804),R=e.i(585009),_=e.i(882890),P=e.i(521518),N=e.i(289264),O=e.i(700810),M=e.i(448205),j=e.i(334459),L=e.i(872866),D=e.i(992511),F=e.i(238983),V=e.i(414130),H=e.i(66445),Z=e.i(260333),K=e.i(433972),B=e.i(137829),$=e.i(296548),U=e.i(374009),q=e.i(385658),z=e.i(618566),J=e.i(271645),Y=e.i(39839),W=e.i(742977),G=e.i(835963),X=e.i(22441),Q=e.i(35242),ee=e.i(685791),et=e.i(584542);e.s(["DesktopSearchEntry",()=>eo,"hasSearchEntry",()=>ea],311844);var er=e.i(772803),en=e.i(346089);function ea(e){return!i.SEARCH_REMOVED||e}function eo({className:e,searchButtonClassName:r,includeAskAssistantText:n,inlineAskAssistantKbd:a,searchPromptOverride:o,kbdClassName:i,askAssistantTextClassName:l,promptClassName:c,aiButtonClassName:d,compact:p}){let f=(0,s.useSelectedLocale)(),{searchPrompt:m,hasChatPermissions:g}=(0,J.useContext)(ed),{onChatSheetToggle:h}=(0,J.useContext)(ec),y=o??m,v=(0,u.useActionKey)(),x=(0,J.useMemo)(()=>v[0]?.toUpperCase().trim()??"⌘",[v]);if(!ea(g))return null;let C=(0,t.jsx)(L.MagnifierIcon,{"aria-hidden":"true",focusable:"false",className:"size-4 min-w-4 flex-none text-gray-700 group-hover/search:text-gray-800 dark:text-gray-400 dark:group-hover/search:text-gray-200"}),S=(0,t.jsx)(en.Sparkle3Icon,{"aria-hidden":"true",focusable:"false",className:(0,$.cn)("size-4","shrink-0 text-gray-700 group-hover/ai:text-gray-800 dark:text-gray-400 dark:group-hover/ai:text-gray-200")}),I=(e,r)=>(0,t.jsxs)(er.TooltipContent,{size:"md",side:"bottom",sideOffset:8,className:"flex gap-2 items-center bg-white opacity-100 dark:bg-background-dark font-normal shadow-xl shadow-gray-500/5 dark:shadow-gray-500/5 rounded-xl",children:[(0,t.jsx)("p",{className:"text-sm text-gray-500 dark:text-white/70 whitespace-nowrap",children:e}),(0,t.jsxs)("span",{className:"flex items-center gap-1 text-sm text-gray-500 dark:text-white/50 whitespace-nowrap",children:[(0,t.jsx)("span",{className:"text-gray-500 dark:text-white/70 min-w-5 h-5 px-1 bg-gray-100 dark:bg-white/15 flex items-center justify-center rounded-md font-mono",children:x}),(0,t.jsx)("span",{className:"text-gray-500 dark:text-white/70 size-5 bg-gray-100 dark:bg-white/15 flex items-center justify-center rounded-md font-mono text-xs",children:r})]})]});return(0,t.jsxs)("div",{className:(0,$.cn)("relative hidden lg:flex items-center flex-1 z-20",g?p?"gap-1.5":"gap-2.5":"justify-center",e),children:[p?(0,t.jsx)(er.TooltipProvider,{children:(0,t.jsxs)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:(0,t.jsx)("div",{className:"inline-flex",children:(0,t.jsx)(et.SearchButton,{className:(0,$.cn)("group/search flex pointer-events-auto items-center justify-center h-9 text-gray-500 dark:text-white/50 bg-background-light dark:bg-background-dark dark:brightness-[1.1] dark:ring-1 dark:hover:brightness-[1.25] ring-1 ring-gray-400/30 hover:ring-gray-600/30 dark:ring-gray-600/30 dark:hover:ring-gray-500/30 rounded-xl",r,"w-9 p-0 min-w-9"),id:b.Ids.SearchBarEntry,children:C})})}),I(y,"K")]})}):(0,t.jsx)(et.SearchButton,{className:(0,$.cn)("group/search flex dark:bg-gray-900 pointer-events-auto rounded-xl w-full items-center text-sm leading-6 h-9 pl-3.5 pr-3 text-gray-500 dark:text-white/50 bg-background-light dark:bg-background-dark dark:brightness-[1.1] dark:ring-1 dark:hover:brightness-[1.25] ring-1 ring-gray-400/30 hover:ring-gray-600/30 dark:ring-gray-600/30 dark:hover:ring-gray-500/30 justify-between truncate gap-2",r),id:b.Ids.SearchBarEntry,children:({actionKey:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[C,(0,t.jsx)("div",{className:(0,$.cn)("truncate min-w-0",c),children:y})]}),e&&(0,t.jsxs)("span",{className:(0,$.cn)("flex-none text-xs font-semibold",i),children:[e[0],"K"]})]})}),g&&(()=>{if(p)return(0,t.jsx)(er.TooltipProvider,{children:(0,t.jsxs)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",className:(0,$.cn)("group/ai flex-none hidden lg:flex items-center justify-center h-9 rounded-xl bg-background-light dark:bg-background-dark dark:brightness-[1.1] dark:ring-1 dark:hover:brightness-[1.25] ring-1 ring-gray-400/30 hover:ring-gray-600/30 dark:ring-gray-600/30 dark:hover:ring-gray-500/30",r,d,"w-9 p-0 min-w-9"),onClick:()=>h({entryPoint:"topbar"}),id:b.Ids.AssistantEntry,"aria-label":f["aria.toggleAssistantPanel"],children:S})}),I(f.askAssistant,"I")]})});let e=(0,t.jsxs)("button",{type:"button",className:(0,$.cn)("group/ai flex-none hidden lg:flex items-center justify-center gap-1.5 pl-3 pr-3.5 h-9 rounded-xl bg-background-light dark:bg-background-dark dark:brightness-[1.1] dark:ring-1 dark:hover:brightness-[1.25] ring-1 ring-gray-400/30 hover:ring-gray-600/30 dark:ring-gray-600/30 dark:hover:ring-gray-500/30",!n&&!a&&"w-9 p-0",r,d),onClick:()=>h({entryPoint:"topbar"}),id:b.Ids.AssistantEntry,"aria-label":f["aria.toggleAssistantPanel"],children:[S,n&&(0,t.jsx)("span",{className:(0,$.cn)("text-sm text-gray-500 dark:text-white/50 whitespace-nowrap",l),children:f.askAssistant}),a&&(0,t.jsxs)("span",{className:(0,$.cn)("flex-none text-xs font-semibold",i),children:[x,"I"]})]});return a?e:(0,t.jsx)(er.TooltipProvider,{children:(0,t.jsxs)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:e}),(0,t.jsxs)(er.TooltipContent,{size:"md",side:n?"bottom":"right",sideOffset:8,className:"flex gap-2 items-center bg-white opacity-100 dark:bg-background-dark font-normal shadow-xl shadow-gray-500/5 dark:shadow-gray-500/5 rounded-xl",children:[(0,t.jsx)("p",{className:"text-sm text-gray-500 dark:text-white/70 whitespace-nowrap",children:"Toggle assistant panel"}),(0,t.jsxs)("span",{className:"flex items-center gap-1 text-sm text-gray-500 dark:text-white/50 whitespace-nowrap",children:[(0,t.jsx)("p",{className:"text-gray-500 dark:text-white/70 min-w-5 h-5 px-1 bg-gray-100 dark:bg-white/15 flex items-center justify-center rounded-md font-mono",children:x}),(0,t.jsx)("p",{children:"+"}),(0,t.jsx)("span",{className:"text-gray-500 dark:text-white/70 size-5 bg-gray-100 dark:bg-white/15 flex items-center justify-center rounded-md font-mono text-xs",children:"I"})]})]})]})})})()]})}let es=({value:e,href:r,titleHtml:n,crumbsHtml:a,contentHtml:o,iconType:s,icon:i,method:l,onLinkClick:u})=>(0,t.jsxs)(S.AutocompleteItem,{value:e,"data-component-part":"search-item",onClick:u,render:(0,t.jsx)("a",{href:r,tabIndex:-1}),className:"flex items-start gap-2 px-2 py-1.5 rounded-[calc(var(--rounded-search,1.25rem)-0.375rem)] cursor-pointer outline-hidden focu
13s:outline-hidden! focus-visible:outline-hidden! last:mb-2 data-highlighted:bg-black/[0.03] dark:data-highlighted:bg-white/5 forced-colors:data-highlighted:outline forced-colors:data-highlighted:outline-1",children:[(0,t.jsx)("span",{"data-component-part":"search-item-icon",className:"flex h-5 items-center shrink-0","aria-hidden":"true",children:(0,t.jsx)(ee.SearchResultIcon,{type:s,icon:i})}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[l&&(0,t.jsx)(_.MethodPill,{method:l,className:"text-xs font-mono rounded px-1 py-0"}),(0,t.jsx)("span",{"data-component-part":"search-item-title",className:"truncate text-sm font-medium leading-5 tracking-[-0.1px] text-gray-950 dark:text-white [&_mark]:bg-transparent [&_mark]:text-primary dark:[&_mark]:text-primary-light [&_b]:font-medium",dangerouslySetInnerHTML:{__html:n}})]}),a.length>0&&(0,t.jsx)("span",{"data-component-part":"search-item-breadcrumbs",className:"flex items-center gap-1 min-w-0 text-xs font-normal leading-4 text-gray-500 dark:text-gray-400 [&_mark]:bg-transparent [&_mark]:text-primary dark:[&_mark]:text-primary-light [&_b]:font-normal",children:a.map((e,r)=>(0,t.jsxs)("span",{className:"flex items-center gap-1 min-w-0",children:[r>0&&(0,t.jsx)(K.VShapedArrowRightIcon,{className:"size-2.5 shrink-0",strokeWidth:2,"aria-hidden":"true"}),(0,t.jsx)("span",{className:"truncate",dangerouslySetInnerHTML:{__html:e}})]},r))}),o&&(0,t.jsx)("span",{"data-component-part":"search-item-content",className:"truncate text-xs font-normal leading-4 text-gray-500 dark:text-gray-400 [&_mark]:bg-transparent [&_mark]:text-primary dark:[&_mark]:text-primary-light [&_b]:font-normal",dangerouslySetInnerHTML:{__html:o}})]})]}),ei=20,el="_mintlify-ask-ai-assistant",eu=({label:e,allLabel:r,options:n,selectedValue:a,onValueChange:o})=>{let[s,i]=(0,J.useState)(!1),l=n.find(e=>e.value===a),u=void 0!==l;return(0,t.jsxs)(E.DropdownMenu,{open:s,onOpenChange:i,children:[(0,t.jsxs)(E.DropdownMenuTrigger,{"data-component-part":"search-filter-trigger","aria-label":`${e} search filter`,className:(0,$.cn)("h-8 shrink-0 rounded-[10px] border border-gray-200 bg-background-light px-2.5 py-1.5 text-sm font-medium leading-5 tracking-[-0.1px] text-gray-950! transition-colors hover:bg-gray-950/[0.03] dark:border-white/10 dark:bg-background-dark dark:text-white! dark:hover:bg-white/[0.03]",s&&"bg-gray-950/[0.05] dark:bg-white/[0.05]",u&&"border-gray-950 bg-gray-950/[0.03] dark:border-white dark:bg-white/[0.05]"),children:[(0,t.jsx)("span",{className:"max-w-40 truncate",children:l?.label??e}),u?(0,t.jsx)("span",{"aria-hidden":"true",className:(0,$.cn)("relative ml-0.5 flex size-4 shrink-0 items-center justify-center rounded-full text-gray-500 hover:bg-gray-950/10 hover:text-gray-950 dark:text-gray-400 dark:hover:bg-white/10 dark:hover:text-white","after:absolute after:-inset-1 after:rounded-full after:content-[''] after:select-none"),onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),o(void 0),i(!1)},children:(0,t.jsx)(B.XmarkIcon,{className:"size-3"})}):(0,t.jsx)(M.ChevronDownIcon,{"aria-hidden":"true",className:(0,$.cn)("ml-0.5 text-gray-600 dark:text-gray-400 size-3.5 shrink-0 transition-transform",s&&"rotate-180 duration-75")})]}),(0,t.jsxs)(E.DropdownMenuContent,{"data-component-part":"search-filter-content",sideOffset:8,className:"w-60 p-1.5 outline-hidden focus:outline-hidden focus-visible:outline-hidden ring-1 ring-gray-950/[0.06] dark:ring-white/[0.08]",children:[(0,t.jsx)(E.DropdownMenuItem,{isSelected:!u,onClick:()=>o(void 0),className:(0,$.cn)("h-9 px-2",!u&&"text-gray-800 dark:text-gray-300 [&_svg]:text-gray-500 dark:[&_svg]:text-gray-400"),children:(0,t.jsx)("span",{className:"truncate",children:r})}),n.map(e=>(0,t.jsx)(E.DropdownMenuItem,{isSelected:e.value===a,onClick:()=>o(e.value),className:(0,$.cn)("h-9 px-2",e.value===a&&"text-gray-800 dark:text-gray-300 [&_svg]:text-gray-500 dark:[&_svg]:text-gray-400"),children:(0,t.jsx)("span",{className:"truncate",children:e.label})},e.value))]})]})},ec=(0,J.createContext)({isChatSheetOpen:!1,shouldFocusChatSheet:!1,entryPoint:void 0,onChatSheetToggle:()=>{},setShouldFocusChatSheet:e=>{}}),ed=(0,J.createContext)({onSearchModalOpen:()=>{},hasChatPermissions:!1,isLoggedInCli:!1,assistantConfig:void 0,searchPrompt:"Search...",starterQuestions:void 0});function ep({subdomain:e,hasChatPermissions:E=!1,isLoggedInCli:_=!1,assistantConfig:M,starterQuestions:K,children:B}){let ee=(0,z.useRouter)(),{prefetch:et}=(0,W.usePrefetch)(),{docsConfig:er}=(0,J.useContext)(o.DocsConfigContext),en="assistant-ui-v2"===(0,J.useContext)(a.AssistantUiContext),{searchSettings:ea}=(0,J.useContext)(o.DeploymentMetadataContext),{currentPathVersion:eo,selectedVersion:ep}=(0,J.useContext)(s.NavigationContext),{navWithMetadata:ef,divisions:em,versionsDict:eg}=(0,v.useResolvedNav)(),eh=ea?.unversioned?void 0:eo??ep,ey=ea?.isFiltersEnabled===!0,ev=ea?.showContentSnippets===!0,{search:ex,searchOrAskQuestion:eb,askAssistant:eC,loginToCliToEnableSearch:eS,searchResultsCount:eI,canYouTellMeAbout:eE,recentSearches:ek,searchFooterSelect:eA,searchFooterOpen:ew,searchFooterClose:eT,"aria.searchKeyboardHints":eR}
13=(0,s.useSelectedLocale)(),e_="⌘"===(0,u.useActionKey)()[0],eP=er?.search?.prompt??ex,eN=er?.search?.prompt??(E?eb:ex),[eO,eM]=(0,J.useState)(!1),[ej,eL]=(0,h.useLocalStorage)(r.ASSISTANT_OPEN_KEY,!1),[eD,eF]=(0,J.useState)(!1),eV=en?"(max-width: 639px)":"(max-width: 1024px)",eH=(0,Y.useMediaQuery)(eV),eZ=(0,Y.useMediaQuery)("(max-width: 1024px)"),[eK,eB]=(0,J.useState)(!1),e$=eK?2:4;(0,J.useEffect)(()=>{eB(eZ)},[eZ]),(0,J.useEffect)(()=>{E||eL(!1)},[E,eL]);let eU=!!E&&(eH?eD:ej),eq=(0,J.useCallback)(e=>{window.matchMedia(eV).matches?eF(e):eL(e)},[eL,eV]),[ez,eJ]=(0,J.useState)(!1),[eY,eW]=(0,J.useState)(void 0),[eG,eX]=(0,J.useState)(""),[eQ,e0]=(0,J.useState)([]),[e1,e5]=(0,J.useState)(""),[e2,e9]=(0,J.useState)(!1),[e7,e4]=(0,J.useState)(),[e3,e6]=(0,J.useState)(),e8=(0,c.useAnalyticsContext)("docs.search.open"),te=(0,c.useAnalyticsContext)("docs.search.query"),tt=(0,c.useAnalyticsContext)("docs.search.result_click"),tr=(0,c.useAnalyticsContext)("docs.search.close"),tn=(0,G.useAssistantEnterAnalytics)(),{append:ta,ensureCaptchaScriptLoaded:to}=(0,p.useAssistantShared)(),{recentSearches:ts,addRecentSearch:ti}=(0,y.useRecentSearches)(),{search:tl}=(0,x.useSearch)(),tu=(0,w.isCli)()&&!_,tc=em.products,td=em.versions,tp=ey&&tc.length>0,tf=(0,J.useMemo)(()=>tc.map(e=>({value:e.product,label:e.name??e.product})),[tc]),[tm,tg]=(0,J.useState)(),[th,ty]=(0,J.useState)(),tv=(0,J.useMemo)(()=>ey?(0,T.getSearchVersionScope)(ef):T.EMPTY_SEARCH_VERSION_SCOPE,[ey,ef]),tx=(0,J.useMemo)(()=>td.map(e=>({value:e.version,label:e.name??e.version})),[td]),tb=(0,T.getSearchVersionOptions)({scope:tv,selectedProduct:tm,globalVersions:tx}),tC=ey&&tb.length>0&&("product"===tv.kind||!ea?.unversioned),tS=!tu&&(tp||tC),tI=eG.trim(),tE=!tI&&ts.length>0,tk=eQ.length>0,tA=(0,J.useMemo)(()=>{if(ey)return{product:tp&&tm||void 0,version:tC&&th||void 0}},[ey,tp,tC,tm,th]),tw=(0,J.useCallback)(e=>(0,R.getVersionCrumb)(e,ey?th:eh,eg),[ey,eh,th,eg]),tT=(0,J.useRef)(null),tR=(0,J.useMemo)(()=>(0,U.default)(()=>{let e=tT.current;e?.searchId&&e.query&&te({searchId:e.searchId,query:e.query,numHits:e.numHits,results:e.results,filtersApplied:e.filtersApplied,product:e.product,version:e.version})},500),[te]);(0,f.useChatPayloadHighlight)(),(0,d.useAssistantNavigation)((0,J.useCallback)(()=>{eH&&eq(!1)},[eH,eq]));let t_=(0,J.useCallback)((e,t)=>{let r=new URLSearchParams(window.location.search);t?r.set(e,t):r.delete(e);let n=r.toString(),a=`${window.location.pathname}${n?`?${n}`:""}`;return a!==`${window.location.pathname}${window.location.search}`&&window.history.replaceState(window.history.state,"",a),n},[]),tP=(0,J.useMemo)(()=>(0,U.default)(e=>{t_("search",e||"")},500),[t_]),tN=(0,J.useCallback)(()=>{"algolia"!==e&&(eM(!0),t_("search",""))},[e,t_]),tO=(0,J.useCallback)(()=>{"algolia"!==e&&eM(e=>(e?(t_("search",null),tP.cancel()):t_("search",""),!e))},[e,t_,tP]),tM=(0,J.useCallback)(()=>{eM(!1),t_("search",null),tR.cancel(),tP.cancel(),tr({searchId:tT.current?.searchId,query:eG,numHits:eQ.length}).catch(console.error),tT.current=null},[t_,tR,tP,tr,eG,eQ.length]),tj=(0,J.useCallback)(e=>{if(E){if((0,Q.focusAssistantPageInput)()){e?.entryPoint&&eW(e.entryPoint);return}eq(t=>{let r=!t;return eJ(r),t&&t_("assistant",null),r&&eW(e?.entryPoint),r})}},[E,eq,t_]);(0,g.useKeyboardShortcut)({key:"k",callback:tO,isDisabled:i.SEARCH_REMOVED}),(0,g.useKeyboardShortcut)({key:"i",callback:()=>tj({entryPoint:"keyboard"}),isDisabled:!E}),(0,J.useEffect)(()=>{eO&&e8({}).catch(console.error)},[eO,e8]),(0,l.useIOSScrollLock)(eO);let tL=(0,J.useMemo)(()=>(0,U.default)(async(t,r)=>{eX(t);let n=t.trim();if(!n||null==e){e0([]),e5(""),tT.current=null;return}if(e)try{e9(!0);let e=await tl(n,r);if(e===x.SEARCH_ABORTED)return;e0(e.results),e5(n),tT.current={searchId:e.id,query:n,numHits:e.results.length,results:e.results.slice(0,25).map((e,t)=>({path:e.link,rank:t,score:e.score})),filtersApplied:!!(r?.product||r?.version),product:r?.product,version:r?.version},e.id&&tR(),e6((0,A.getDuplicatesWith2DArrayInOrder)(e.results.map(e=>Array.isArray(e.metadata?.breadcrumbs)?e.metadata.breadcrumbs:[]),!0)),e4((0,A.getDuplicates)(e.results.map(e=>e.header)))}catch(e){console.error("Search request failed:",e)}finally{e9(!1)}},ei),[e,tl,tR]),tD=(0,J.useCallback)(e=>{tg(e),ty(void 0),tI&&tL(tI,{product:tp&&e||void 0,version:void 0})},[tp,tL,tI]),tF=(0,J.useCallback)(e=>{ty(e),tI&&tL(tI,{product:tp&&tm||void 0,version:tC&&e||void 0})},[tp,tC,tL,tm,tI]),tV=(0,m.useEffectEvent)(e=>{eq(!0),eJ(!0),eW("deep-link"),e&&(tn(e,"deep-link"),ta({id:(0,q.default)(),role:"user",content:e}))}),tH=(0,m.useEffectEvent)(e=>{eM(!0),e&&(eX(e),tL(e,tA))});(0,J.useEffect)(()=>{let t=new URLSearchParams(window.location.search),r=t.get("assistant");null!==r&&E&&(to(),requestAnimationFrame(()=>tV(r)));let n=t.get("search");null===n||"algolia"===e||i.SEARCH_REMOVED||requestAnimationFrame(()=>tH(n))},[]);let tZ=(0,J.useCallback)(e=>{et(e.link,{source:"search",header:e.header,searchId:e.id})},[et]),tK=(0,J.useCallback)(()=>{tR.cancel(),tP.cancel(),tT.current=null,eM(!1),t_("search",null),eq(!0),eJ(!0),eW("search-modal");let e=eG.trim();e&&(tn(e,"search-modal"),ta({id:(0,q.default)(),role:"user",content:e}))},[ta,tR,tP,eG,eq,tn,t_]),tB=(0,J.useRef)([]),t$=(0,J.useCallback)(e=>t=>{tR.cancel();let r=tT.current?.searchId,n=eG.trim()||ts.find(t=>t.searchHit.id===e.id)?.query.trim()||"";n&&e.id&&tB.current.push({query:n,hit:e});let a=eQ.findIndex(t=>t.id===e.id);tt({query:n,searchId:r,path:e.link,section:e.header,rank:a>=0?a:void 0,score:e.score,source:a>=0?"results":"recent",inputMethod:0===t.detail?"keyboard":"mouse"}),t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||0!==t.button||(t.preventDefault(),tM(),ee.push((0,C.navHref)(e.link)))},[tM,tR,eQ,eG,ts,ee,tt]),tU=(0,J.useMemo)(()=>({isChatSheetOpen:eU,shouldFocusChatSheet:ez,entryPoint:eY,onChatSheetToggle:tj,setShouldFocusChatSheet:eJ}),[eU,ez,eY,tj,eJ]),[tq,tz]=(0,J.useMemo)(()=>{let e=eE.indexOf("{query}");return e>=0?[eE.slice(0,e),eE.slice(e+7)]:[`${eE} `,"?"]},[eE]),tJ=(0,J.useMemo)(()=>
13{if(!tI)return 0===ts.length?[]:[{key:"recent",label:ek,isRecent:!0,items:ts.map(e=>e.searchHit)}];let e=[];return eQ.length>0&&e.push({key:"results",label:null,isRecent:!1,items:eQ}),E&&e.push({key:"ask-ai",label:eC,isRecent:!1,items:[el]}),e},[tI,ts,ek,eQ,E,eC]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ec.Provider,{value:tU,children:(0,t.jsx)(ed.Provider,{value:(0,J.useMemo)(()=>({onSearchModalOpen:tN,hasChatPermissions:E,isLoggedInCli:_,searchPrompt:eP,assistantConfig:M,starterQuestions:K}),[tN,E,_,eP,M,K]),children:B})}),!i.SEARCH_REMOVED&&(0,t.jsx)(I.Dialog,{open:eO,onOpenChange:e=>{e||tM()},onOpenChangeComplete:e=>{if(!e&&!eO){for(let e of(eX(""),e0([]),e5(""),tR.cancel(),tP.cancel(),tT.current=null,tB.current))ti(e.query,e.hit);tB.current=[]}},children:(0,t.jsxs)(I.DialogPortal,{children:[(0,t.jsx)(I.DialogBackdrop,{"data-component-part":"search-backdrop"}),(0,t.jsx)(I.DialogViewport,{className:(0,$.cn)(n.zIndex.Popup,"overflow-y-auto p-4 sm:p-6 md:p-12"),children:(0,t.jsxs)(I.DialogPopup,{initialFocus:e=>"keyboard"===e,"data-component-part":"search-modal","aria-label":eN,onMouseDown:e=>{e.target instanceof HTMLElement&&e.target.closest("input")||e.preventDefault()},className:"flex flex-col mx-auto mt-1.5 max-w-[640px] overflow-hidden bg-background-light dark:bg-background-dark rounded-search ring-1 ring-gray-950/[0.06] dark:ring-white/[0.06] shadow-[0_57px_34px_0_rgba(0,0,0,0.01),0_25px_25px_0_rgba(0,0,0,0.02),0_6px_14px_0_rgba(0,0,0,0.02)]",children:[(0,t.jsxs)(S.Autocomplete,{inline:!0,open:!0,items:tJ,filter:null,autoHighlight:!0,keepHighlight:!0,itemToStringValue:e=>"string"==typeof e?e:e.header,value:eG,onValueChange:e=>{to(),eX(e),tL(e,tA),tP(e)},onItemHighlighted:e=>{e&&e!==el&&tZ(e)},children:[(0,t.jsx)("div",{"data-component-part":"search-header",className:"pt-1.5 px-1.5 relative z-10 h-14",children:tu?(0,t.jsxs)("div",{"data-component-part":"search-cli-state",className:"relative h-full w-full flex items-center pt-1.5 pr-2 pb-1.5 pl-1.5 rounded-2xl border border-gray-200 dark:border-white/10 bg-background-light dark:bg-background-dark",children:[(0,t.jsx)(L.MagnifierIcon,{"aria-hidden":"true",className:"absolute left-3 top-1/2 -translate-y-1/2 size-4 text-gray-500 dark:text-gray-400"}),(0,t.jsx)("span",{className:"pl-[30px] select-none text-base font-medium leading-6 tracking-[-0.2px] text-gray-400 dark:text-gray-700",children:eS})]}):(0,t.jsxs)("div",{"data-component-part":"search-input-container",className:"relative h-full flex items-center pt-1.5 pr-2 pb-1.5 pl-1.5 rounded-2xl border border-gray-200 dark:border-white/10 bg-background-light dark:bg-background-dark",children:[(0,t.jsx)(L.MagnifierIcon,{"aria-hidden":"true",className:"absolute left-3 top-1/2 -translate-y-1/2 size-4 text-gray-500 dark:text-gray-400"}),(0,t.jsx)(S.AutocompleteInput,{"data-component-part":"search-input",id:b.Ids.SearchInput,"aria-label":eN,"aria-describedby":b.Ids.SearchKeyboardHints,className:"flex-1 min-w-0 h-full pl-[30px] bg-transparent border-0 outline-hidden outline-0 focus:ring-0 text-base font-medium leading-6 tracking-[-0.2px] text-gray-950 dark:text-white caret-gray-950 dark:caret-white placeholder:select-none placeholder:text-gray-400 dark:placeholder:text-gray-700",autoFocus:!0,placeholder:eN,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,enterKeyHint:"search",onKeyDown:e=>{if(!e.nativeEvent.isComposing){if("Enter"===e.key&&e.altKey&&E){e.preventDefault(),e.preventBaseUIHandler(),tK();return}if("Enter"===e.key&&(e.metaKey||e.ctrlKey||e.shiftKey)){let t=e.currentTarget.getAttribute("aria-activedescendant"),r=t?document.getElementById(t):null,n=r instanceof HTMLAnchorElement?r:r?.querySelector("a")??null;if(n){e.preventDefault(),e.preventBaseUIHandler();let t=e.currentTarget;n.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey})),t.focus()}}}}}),E&&(0,t.jsxs)("button",{type:"button","data-component-part":"search-ask-ai-button","aria-keyshortcuts":"Alt+Enter",className:"shrink-0 self-stretch my-0.5 ml-2 flex items-center justify-center gap-1.5 px-2.5 rounded-[10px] bg-gray-950/5 dark:bg-white/5 text-sm font-medium leading-5 tracking-[-0.1px] text-gray-500 dark:text-gray-400 hover:bg-gray-950/10 dark:hover:bg-white/10 hover:text-gray-700 dark:hover:text-gray-300 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary dark:focus-visible:outline-primary-light",onClick:tK,children:[eC,(0,t.jsxs)("span",{className:"hidden sm:flex items-center","aria-hidden":"true",children:[e_?(0,t.jsx)(D.OptionKeyFilledIcon,{className:"size-3.5"}
13):(0,t.jsx)(O.AltKeyFilledIcon,{className:"size-3.5"}),(0,t.jsx)(F.ReturnKeyFilledIcon,{className:"size-3.5"})]})]})]})}),tS&&(0,t.jsx)("div",{"data-component-part":"search-filters",className:"px-2",children:(0,t.jsxs)("div",{className:(0,$.cn)("flex items-center gap-2 overflow-x-auto pt-2.5",(tE||tk)&&"pb-2.5 border-b border-gray-200 dark:border-white/10"),children:[tp&&(0,t.jsx)(eu,{label:"Product",allLabel:"All products",options:tf,selectedValue:tm,onValueChange:tD}),tC&&(0,t.jsx)(eu,{label:"Versions",allLabel:"All versions",options:tb,selectedValue:th,onValueChange:tF})]})}),(0,t.jsxs)(k.ScrollArea,{children:[(0,t.jsx)(k.ScrollAreaViewport,{className:(0,$.cn)(tS?"max-h-[calc(100vh-13.25rem)]":"max-h-[calc(100vh-10rem)]"),children:(0,t.jsx)(k.ScrollAreaContent,{className:"min-w-0! w-full",children:(0,t.jsx)(S.AutocompleteList,{"data-component-part":"search-list",className:"px-1.5 pt-1.5 select-none",children:e=>(0,t.jsxs)(S.AutocompleteGroup,{items:e.items,children:[e.label&&(0,t.jsx)(S.AutocompleteGroupLabel,{"data-component-part":"search-group-label",className:"px-3 py-1.5 text-xs font-normal leading-4 text-gray-500 dark:text-gray-400",children:e.label}),(0,t.jsx)(S.AutocompleteCollection,{children:r=>r===el?(0,t.jsxs)(S.AutocompleteItem,{value:el,"data-component-part":"search-ask-ai-item",onClick:tK,className:"flex items-center gap-2 p-2 rounded-[calc(var(--rounded-search,1.25rem)-0.375rem)] cursor-pointer focus:outline-hidden! focus-visible:outline-hidden! last:mb-1.5 sm:last:mb-2 data-highlighted:bg-black/[0.03] dark:data-highlighted:bg-white/5 forced-colors:data-highlighted:outline forced-colors:data-highlighted:outline-1",children:[(0,t.jsx)(V.Sparkle2FilledIcon,{className:"size-4 shrink-0 text-primary dark:text-primary-light","aria-hidden":"true"}),(0,t.jsxs)("span",{className:"truncate text-sm font-medium leading-5 tracking-[-0.1px] text-gray-950 dark:text-white",children:[tq,(0,t.jsx)("span",{className:"text-primary dark:text-primary-light",children:tI}),tz]})]},el):((e,{isRecent:r=!1}={})=>{let n=e.metadata&&"openapi"in e.metadata?String(e.metadata.openapi):void 0,a=n?(0,N.potentiallyParseOpenApiString)(n):void 0,o=a?"api-playground":e.metadata?.hash?"section":"page",s=e.metadata?(0,X.generateBreadcrumbs)(e.metadata,e.header,!!e7?.has(e.header),r?void 0:e3):[e.header],l=tw(e),u=r?"":eG.trim(),c=s.length>e$?s.slice(-e$):s,d=[...l?[(0,P.getHighlightedText)(l.trim(),u)]:[],...c.length<s.length?["…"]:[],...c.map(e=>(0,P.getHighlightedText)(e.trim(),u))],p=ev?(0,P.getHighlightedSnippet)((0,P.stripDuplicatedTitleLine)(e.content,e.header).replace(/\s+/g," ").trim(),r?"":e1,{maxLength:160}):"";return(0,t.jsx)(es,{value:e,href:`${i.NEXT_PUBLIC.BASE_PATH}${e.link}`,titleHtml:(0,P.getHighlightedText)(e.header.trim(),u),crumbsHtml:d,contentHtml:p,iconType:o,icon:e.metadata?.icon,method:a?.method,onLinkClick:t$(e)},e.id)})(r,{isRecent:e.isRecent})})]},e.key)})})}),(0,t.jsx)(k.ScrollAreaScrollbar,{orientation:"vertical"})]}),(0,t.jsx)(S.AutocompleteStatus,{className:"sr-only",children:tI&&!e2?eI.replace("{count}",String(eQ.length)):null})]}),tJ.length>0&&(0,t.jsxs)("div",{"aria-hidden":"true","data-component-part":"search-footer",className:"hidden sm:flex items-center justify-between mx-1.5 mb-1.5 pt-2.5 pr-2 pb-1.5 pl-1.5 border-t border-gray-200 dark:border-white/10 text-xs font-medium leading-4 text-gray-500 dark:text-gray-400 select-none",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("span",{className:"flex items-center",children:[(0,t.jsx)(Z.SquareArrowUpFilledIcon,{className:"size-3.5"}),(0,t.jsx)(H.SquareArrowDownFilledIcon,{className:"size-3.5"})]}),eA]}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(F.ReturnKeyFilledIcon,{className:"size-3.5"}),ew]})]}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(j.EscKeyFilledIcon,{className:"size-3.5"}),eT]})]}),(0,t.jsx)("p",{id:b.Ids.SearchKeyboardHints,className:"sr-only",children:eR})]})})]})})]})}ed.displayName="SearchContext"}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.