thursday-agent 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  5. package/.next/server/app/_global-error.html +1 -1
  6. package/.next/server/app/_global-error.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  10. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  11. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/_not-found.html +1 -1
  13. package/.next/server/app/_not-found.rsc +2 -2
  14. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  15. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  16. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  17. package/.next/server/app/api/artifact/route.js.nft.json +1 -1
  18. package/.next/server/app/api/bot/keep-working/route.js.nft.json +1 -1
  19. package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
  20. package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
  21. package/.next/server/app/api/bot/route.js.nft.json +1 -1
  22. package/.next/server/app/api/bot/thread/[id]/route.js.nft.json +1 -1
  23. package/.next/server/app/api/bot/thread/route.js.nft.json +1 -1
  24. package/.next/server/app/api/config/route.js.nft.json +1 -1
  25. package/.next/server/app/api/events/route.js.nft.json +1 -1
  26. package/.next/server/app/api/favicon/[host]/route.js.nft.json +1 -1
  27. package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
  28. package/.next/server/app/api/llm-model/catalog/route.js.nft.json +1 -1
  29. package/.next/server/app/api/llm-model/credits/route.js.nft.json +1 -1
  30. package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
  31. package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -1
  32. package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
  33. package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
  34. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  35. package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
  36. package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
  37. package/.next/server/app/api/memory/route.js.nft.json +1 -1
  38. package/.next/server/app/api/probe/route.js.nft.json +1 -1
  39. package/.next/server/app/api/reach/route.js.nft.json +1 -1
  40. package/.next/server/app/api/routine/route.js.nft.json +1 -1
  41. package/.next/server/app/api/signins/route.js.nft.json +1 -1
  42. package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
  43. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  44. package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
  45. package/.next/server/app/api/thursday/skills/route.js.nft.json +1 -1
  46. package/.next/server/app/api/thursday/text/route.js.nft.json +1 -1
  47. package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
  48. package/.next/server/app/api/workspace/files/route.js.nft.json +1 -1
  49. package/.next/server/app/api/workspace/route.js.nft.json +1 -1
  50. package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +1 -1
  51. package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
  52. package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
  53. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  54. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  55. package/.next/server/app/page/server-reference-manifest.json +56 -56
  56. package/.next/server/app/page.js.nft.json +1 -1
  57. package/.next/server/app/page_client-reference-manifest.js +1 -1
  58. package/.next/server/chunks/ssr/{[root-of-the-server]__0oo-wlv._.js → [root-of-the-server]__0cxqzfc._.js} +2 -2
  59. package/.next/server/chunks/ssr/[root-of-the-server]__0tzekbl._.js +1 -1
  60. package/.next/server/chunks/ssr/{[root-of-the-server]__0zuns7e._.js → [root-of-the-server]__1-d2tgh._.js} +2 -2
  61. package/.next/server/chunks/ssr/[root-of-the-server]__1se25x0._.js +1 -1
  62. package/.next/server/chunks/ssr/{_0scf7xy._.js → _05rxyf9._.js} +2 -2
  63. package/.next/server/chunks/ssr/_070nv1_._.js +1 -1
  64. package/.next/server/chunks/ssr/_097-ljd._.js +1 -1
  65. package/.next/server/chunks/ssr/{_1uy0xom._.js → _0bp-_fi._.js} +3 -3
  66. package/.next/server/chunks/ssr/_0fqhhwi._.js +1 -1
  67. package/.next/server/chunks/ssr/{_0ltz2q5._.js → _0hlxij-._.js} +2 -2
  68. package/.next/server/chunks/ssr/{_1a-nuxx._.js → _0p9pmxe._.js} +2 -2
  69. package/.next/server/chunks/ssr/{_0ital-2._.js → _0s41irp._.js} +2 -2
  70. package/.next/server/chunks/ssr/{_1z74dmq._.js → _0tg0vf8._.js} +4 -4
  71. package/.next/server/chunks/ssr/{_1tmu8z-._.js → _173siic._.js} +2 -2
  72. package/.next/server/chunks/ssr/{_1x-kojb._.js → _17v-33v._.js} +3 -3
  73. package/.next/server/chunks/ssr/{_0l_mcfz._.js → _19n08g5._.js} +2 -2
  74. package/.next/server/chunks/ssr/{_0urj3mc._.js → _1doidrw._.js} +2 -2
  75. package/.next/server/chunks/ssr/{_1-zyvdb._.js → _1flsjeo._.js} +2 -2
  76. package/.next/server/chunks/ssr/_1mqn9mc._.js +1 -1
  77. package/.next/server/chunks/ssr/_1neoj22._.js +1 -1
  78. package/.next/server/chunks/ssr/_1ng831c._.js +3 -0
  79. package/.next/server/chunks/ssr/{_0kjj5ts._.js → _1u2jw0i._.js} +3 -3
  80. package/.next/server/chunks/ssr/_1xoch6f._.js +1 -1
  81. package/.next/server/chunks/ssr/{_1flbs77._.js → _1yk6yak._.js} +2 -2
  82. package/.next/server/chunks/ssr/features_bot_1yr-_pm._.js +3 -0
  83. package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
  84. package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +1 -1
  85. package/.next/server/chunks/ssr/features_routine_components_routine-setting_tsx_055fknz._.js +1 -1
  86. package/.next/server/chunks/ssr/{node_modules_1ogczzz._.js → node_modules_048wmmj._.js} +1 -1
  87. package/.next/server/chunks/ssr/{node_modules_1af3w91._.js → node_modules_04t200t._.js} +1 -1
  88. package/.next/server/chunks/ssr/{node_modules_1wbkzl9._.js → node_modules_0511ha-._.js} +1 -1
  89. package/.next/server/chunks/ssr/{node_modules_0wnlddw._.js → node_modules_08g12f-._.js} +1 -1
  90. package/.next/server/chunks/ssr/{node_modules_0uyh_vb._.js → node_modules_0cdu6jq._.js} +1 -1
  91. package/.next/server/chunks/ssr/{node_modules_03d0rfz._.js → node_modules_0eb4rx7._.js} +1 -1
  92. package/.next/server/chunks/ssr/{node_modules_05ybmta._.js → node_modules_0f2k5l0._.js} +1 -1
  93. package/.next/server/chunks/ssr/{node_modules_0sgy-dc._.js → node_modules_0piws2a._.js} +1 -1
  94. package/.next/server/chunks/ssr/{node_modules_12et8d5._.js → node_modules_0pk6i-e._.js} +1 -1
  95. package/.next/server/chunks/ssr/{node_modules_04_sbbc._.js → node_modules_0s1lwc9._.js} +1 -1
  96. package/.next/server/chunks/ssr/{node_modules_068ws5v._.js → node_modules_0wq4-ts._.js} +1 -1
  97. package/.next/server/chunks/ssr/{node_modules_13kwejm._.js → node_modules_0zjqwz7._.js} +1 -1
  98. package/.next/server/chunks/ssr/{node_modules_07rs_p2._.js → node_modules_11hbkuj._.js} +1 -1
  99. package/.next/server/chunks/ssr/{node_modules_1z1lrbk._.js → node_modules_18woe20._.js} +1 -1
  100. package/.next/server/chunks/ssr/{node_modules_0yvz9e0._.js → node_modules_1_afpz7._.js} +1 -1
  101. package/.next/server/chunks/ssr/{node_modules_0t_ez6-._.js → node_modules_1_ban4u._.js} +1 -1
  102. package/.next/server/chunks/ssr/{node_modules_1uwg-gz._.js → node_modules_1cxc8kn._.js} +1 -1
  103. package/.next/server/chunks/ssr/{node_modules_0th357h._.js → node_modules_1dcbvfw._.js} +1 -1
  104. package/.next/server/chunks/ssr/{node_modules_06bb4q8._.js → node_modules_1expacw._.js} +1 -1
  105. package/.next/server/chunks/ssr/{node_modules_1s-gb-1._.js → node_modules_1ksh9gy._.js} +1 -1
  106. package/.next/server/chunks/ssr/{node_modules_0ubdtk-._.js → node_modules_1m2ho33._.js} +1 -1
  107. package/.next/server/chunks/ssr/{node_modules_1bucjlk._.js → node_modules_1n0h9sf._.js} +1 -1
  108. package/.next/server/chunks/ssr/{node_modules_1lkix61._.js → node_modules_1qehmwm._.js} +1 -1
  109. package/.next/server/chunks/ssr/{node_modules_0x630an._.js → node_modules_1xzo2wn._.js} +1 -1
  110. package/.next/server/chunks/ssr/{node_modules_0jljel9._.js → node_modules_1zf46lp._.js} +1 -1
  111. package/.next/server/chunks/ssr/{node_modules_0dzm4um._.js → node_modules_1zkpek5._.js} +1 -1
  112. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0r443fh._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0avl8-1._.js} +1 -1
  113. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_10wnlbk._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_14oslro._.js} +1 -1
  114. package/.next/server/middleware-build-manifest.js +3 -3
  115. package/.next/server/pages/404.html +1 -1
  116. package/.next/server/pages/500.html +1 -1
  117. package/.next/server/server-reference-manifest.js +1 -1
  118. package/.next/server/server-reference-manifest.json +57 -57
  119. package/.next/static/chunks/03kgfyrli_0gz.js +1 -0
  120. package/.next/static/chunks/{245hb85nsy6j4.js → 09120tms63y21.js} +1 -1
  121. package/.next/static/chunks/{2c64drdevdla3.js → 0o980477kfqez.js} +1 -1
  122. package/.next/static/chunks/{13ixzheqw7o-w.js → 0oz3rs47yy3p8.js} +2 -2
  123. package/.next/static/chunks/0w20wnnfrscq7.js +1 -0
  124. package/.next/static/chunks/{3bbzsitgiltnt.js → 19ojn4lomsk0r.js} +1 -1
  125. package/.next/static/chunks/{38301ji-85i30.js → 1mwee7xvitlp9.js} +1 -1
  126. package/.next/static/chunks/1p764d75_0lhv.js +18 -0
  127. package/.next/static/chunks/{27tvv1i-smrck.js → 1pjygp7hqib6j.js} +1 -1
  128. package/.next/static/chunks/{0_awn8tucznxc.js → 22shnca_6zfzs.js} +1 -1
  129. package/.next/static/chunks/{0ge-hx0ed83a1.js → 24dst4mgurbsh.js} +1 -1
  130. package/.next/static/chunks/{06nt9tatr-dug.js → 25zq8gzhbdsr7.js} +1 -1
  131. package/.next/static/chunks/{37j27b3e1gt7r.js → 2d4z3er53ng8r.js} +1 -1
  132. package/.next/static/chunks/2ky81z-jgvasc.js +1 -0
  133. package/.next/static/chunks/2m6jd3586ijb-.js +1 -0
  134. package/.next/static/chunks/{1grkt5gr8pbg1.js → 2qod5tqlpz8b7.js} +7 -7
  135. package/.next/static/chunks/{1yugpvvi8qrbu.js → 30skcjexa57zn.js} +2 -2
  136. package/.next/static/chunks/{427qsc6kahxyo.js → 35kwn237o4wdn.js} +1 -1
  137. package/.next/static/chunks/{0qmd8n52hp-6v.js → 3exjsi8pfdvzj.js} +1 -1
  138. package/.next/static/chunks/3qq4o8w2rv_e9.css +1 -0
  139. package/.next/static/chunks/{3h2e-xv1zxh_f.js → 3vynnr71ghvom.js} +2 -2
  140. package/.next/static/chunks/42890jqk049q1.js +1 -0
  141. package/README.md +4 -0
  142. package/components/ui/radio-group.tsx +2 -2
  143. package/features/bot/components/bot-setting.tsx +4 -4
  144. package/features/routine/components/routine-setting.tsx +1 -1
  145. package/features/thursday/components/thursday-setting.tsx +5 -5
  146. package/guide/bots.md +1 -1
  147. package/knip.json +1 -0
  148. package/package.json +1 -1
  149. package/seed-skills/analyst/README.md +19 -0
  150. package/seed-skills/analyst/data-report/SKILL.md +59 -0
  151. package/seed-skills/analyst/data-report/references/brief.md +31 -0
  152. package/seed-skills/analyst/data-report/references/company.md +41 -0
  153. package/seed-skills/analyst/data-report/references/comparison.md +42 -0
  154. package/seed-skills/analyst/data-report/references/decision.md +28 -0
  155. package/seed-skills/analyst/data-report/references/market-size.md +49 -0
  156. package/seed-skills/analyst/data-report/references/price-check.md +33 -0
  157. package/seed-skills/analyst/data-report/references/sources.md +51 -0
  158. package/seed-skills/analyst/data-report/references/trend.md +39 -0
  159. package/seed-skills/analyst/data-report/scripts/chart.mjs +679 -0
  160. package/seed-skills/analyst/data-report/scripts/fetch.mjs +521 -0
  161. package/seed-skills/insta/instagram/SKILL.md +33 -0
  162. package/seed-skills/insta/instagram/references/dm.md +49 -0
  163. package/seed-skills/insta/instagram/references/post.md +74 -0
  164. package/seed-skills/insta/instagram/scripts/compose.mjs +329 -0
  165. package/seed-skills/insta/instagram/scripts/image-size.mjs +30 -0
  166. package/seed-skills/insta/instagram/scripts/inbox.mjs +159 -0
  167. package/seed-skills/insta/instagram/scripts/lib.mjs +91 -0
  168. package/seed-skills/insta/instagram/scripts/media.mjs +104 -0
  169. package/seed-skills/insta/instagram/scripts/profile.mjs +139 -0
  170. package/seed-skills/insta/instagram/scripts/read.mjs +240 -0
  171. package/seed-skills/insta/instagram/scripts/render.mjs +126 -0
  172. package/seed-skills/insta/instagram/scripts/search.mjs +133 -0
  173. package/seed-skills/insta/instagram/scripts/selectors.mjs +56 -0
  174. package/seed-skills/insta/instagram/scripts/sheet.mjs +100 -0
  175. package/seed-skills/insta/instagram/scripts/webimage.mjs +105 -0
  176. package/seed-skills/insta/instagram/templates/carousel.html +62 -0
  177. package/seed-skills/mail/mail/SKILL.md +37 -0
  178. package/seed-skills/mail/mail/recipes/gmail.mjs +448 -0
  179. package/seed-skills/mail/mail/references/recipes.md +55 -0
  180. package/seed-skills/mail/mail/scripts/mail.mjs +202 -0
  181. package/seed-skills/marketer/README.md +6 -4
  182. package/seed-skills/marketer/copywriting/SKILL.md +1 -1
  183. package/seed-skills/marketer/emails/SKILL.md +1 -1
  184. package/seed-skills/marketer/launch/SKILL.md +1 -1
  185. package/seed-skills/marketer/product-marketing/SKILL.md +5 -5
  186. package/seed-skills/marketer/seo-audit/SKILL.md +1 -1
  187. package/seed-skills/marketer/social/SKILL.md +1 -1
  188. package/.next/server/chunks/ssr/_0dshsh4._.js +0 -3
  189. package/.next/server/chunks/ssr/features_bot_1nr94ks._.js +0 -3
  190. package/.next/static/chunks/0pda_vf-abwvx.js +0 -1
  191. package/.next/static/chunks/0rowp9rx3qbxu.js +0 -18
  192. package/.next/static/chunks/27lkanxvtdn09.js +0 -1
  193. package/.next/static/chunks/3fec-aeteddr-.js +0 -1
  194. package/.next/static/chunks/3go3hwp1z2_h2.css +0 -1
  195. package/.next/static/chunks/3h2bun3hcggg8.js +0 -1
  196. package/.next/static/chunks/3j1y335o95mj7.js +0 -1
  197. /package/.next/static/{u8kJqShUAa49vY7BxAWsw → Ar5V4kMdL4CE1trx8anrH}/_buildManifest.js +0 -0
  198. /package/.next/static/{u8kJqShUAa49vY7BxAWsw → Ar5V4kMdL4CE1trx8anrH}/_clientMiddlewareManifest.js +0 -0
  199. /package/.next/static/{u8kJqShUAa49vY7BxAWsw → Ar5V4kMdL4CE1trx8anrH}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,59377,e=>{"use strict";var t=e.i(843476);e.s([],158421),e.i(158421);var n=e.i(271645),a=e.i(896499),i=e.i(17989),s=e.i(46420),o=e.i(733332);let r=n.createContext(void 0);function l(e){let t=n.useContext(r);if(void 0===t&&!e)throw Error((0,o.default)(47));return t}var c=e.i(174080),d=e.i(301252),u=e.i(439957),p=e.i(956789),m=e.i(56434),h=e.i(18478),g=e.i(264111),f=e.i(116786),x=e.i(990627),v=e.i(638396);let S={...f.popupStoreSelectors,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class b extends d.ReactStore{constructor(e,t,n){const a=new x.PopupTriggerMap;super(C(e,a,t,n),j(a),S)}setOpen=(e,t)=>{let n,a=t.reason===m.REASONS.triggerHover,i=t.reason===m.REASONS.triggerPress&&0===t.event.detail,s=!e&&(t.reason===m.REASONS.escapeKey||null==t.reason),o=(0,g.attachPreventUnmountOnClose)(t),r=this.select("activeTriggerId");if(e||t.reason!==m.REASONS.closePress||null!=t.trigger||null==r||(t.trigger=this.context.triggerElements.getById(r)??this.select("activeTriggerElement")??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let l=()=>{let n=(0,g.createPopupOpenState)(this.state,e,t.trigger,o());n.openChangeReason=t.reason,this.update(n)};a?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(v.PATIENT_CLICK_THRESHOLD,()=>{this.set("stickIfOpen",!1)}),c.flushSync(l)):l(),i?n="click":s?n="dismiss":t.reason===m.REASONS.focusOut&&(n="focus"),this.set("instantType",n)}}function C(e,t,n,a=!1){let i={...(0,f.createInitialPopupStoreState)(t,n,a),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function j(e){return{popupRef:n.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:n.createRef(),beforeContentFocusGuardRef:n.createRef(),stickIfOpenTimeout:new u.Timeout,triggerElements:e}}var y=e.i(675606);let N=(0,a.fastComponent)(function({props:e}){var a;let i,{children:s,open:o,defaultOpen:l=!1,onOpenChange:c,onOpenChangeComplete:d,modal:u=!1,handle:p,triggerId:h,defaultTriggerId:f=null}=e,x=(a={modal:u,open:l,openProp:o,activeTriggerId:f,triggerIdProp:h},i=(0,g.usePopupRootStore)((e,t)=>new b(a,e,t)),n.useEffect(()=>i.context.stickIfOpenTimeout.disposeEffect(),[i]),i);x.useControlledProp("openProp",o),x.useControlledProp("triggerIdProp",h);let v=x.useState("open"),S=x.useState("mounted"),C=x.useState("payload");x.useContextCallback("onOpenChange",c),x.useContextCallback("onOpenChangeComplete",d),(0,g.usePopupRootSync)(x,v),(0,g.useImplicitActiveTrigger)(x);let{forceUnmount:j}=(0,g.useOpenStateTransitions)(v,x,()=>{x.update({stickIfOpen:!0,openChangeReason:null})});x.useSyncedValues({modal:u}),n.useEffect(()=>{v||x.context.stickIfOpenTimeout.clear()},[x,v]),n.useImperativeHandle(e.actionsRef,()=>({unmount:j,close:()=>x.setOpen(!1,(0,y.createChangeEventDetails)(m.REASONS.imperativeAction))}),[j,x]);let N=v||S;return(0,t.jsxs)(r.Provider,{value:x,children:[p&&(0,t.jsx)(g.PopupHandleAttachment,{handle:p,store:x}),N&&(0,t.jsx)(M,{store:x,modal:u}),"function"==typeof s?s({payload:C}):s]})});function M({store:e,modal:t}){let n=e.useState("floatingRootContext"),a=(0,i.useDismiss)(n,{outsidePressEvent:{mouse:"trap-focus"===t?"sloppy":"intentional",touch:"sloppy"}}),s=a.reference,o=a.floating;return(0,g.usePopupInteractionProps)(e,{activeTriggerProps:s,inactiveTriggerProps:s,popupProps:o}),null}var k=e.i(540886),z=e.i(879938),w=e.i(552245),R=e.i(650316),O=e.i(385689),P=e.i(872135),V=e.i(788015),E=e.i(152535),I=e.i(459636),T=e.i(346570),L=e.i(32199);let A=(0,a.fastComponentRef)(function(e,a){let{render:i,className:s,style:r,disabled:c=!1,nativeButton:d=!0,handle:u,payload:p,openOnHover:h=!1,delay:f=300,closeDelay:x=0,id:S,...b}=e,C=l(!0),j=(0,I.usePopupHandleStore)(u)??C;if(!j)throw Error((0,o.default)(74));let y=(0,V.useBaseUiId)(S),N=j.useState("isTriggerActive",y),M=j.useState("floatingRootContext"),A=j.useState("isOpenedByTrigger",y),H=j.useState("triggerPopupId",y),F=n.useRef(null),{registerTrigger:D,isMountedByThisTrigger:q}=(0,g.useTriggerDataForwarding)(y,F,j,{payload:p,disabled:c,openOnHover:h,closeDelay:x}),B=j.useState("openChangeReason"),K=j.useState("stickIfOpen"),U=j.useState("openMethod"),G=j.useState("focusManagerModal"),_=(0,P.useHoverReferenceInteraction)(M,{enabled:!c&&h&&("touch"!==U||B!==m.REASONS.triggerPress),mouseOnly:!0,move:!1,handleClose:(0,R.safePolygon)(),restMs:f,delay:{close:x},triggerElementRef:F,isActiveTrigger:N,isClosing:()=>"ending"===j.select("transitionStatus")}),$=(0,O.useClick)(M,{stickIfOpen:K}),W=(0,L.useOpenMethodTriggerProps)(()=>j.select("open"),e=>{j.set("openMethod",e)}),Y=j.useState("triggerProps",q),{getButtonProps:X,buttonRef:Z}=(0,k.useButton)({disabled:c,native:d}),{preFocusGuardRef:J,handlePreFocusGuardFocus:Q,handleFocusTargetFocus:ee}=(0,T.useTriggerFocusGuards)(j,F),et=(0,w.useRenderElement)("button",e,{state:{disabled:c,open:A},ref:[Z,a,D,F],props:[$.reference,_,Y,W,{[v.CLICK_TRIGGER_IDENTIFIER]:"",id:y,"aria-haspopup":"dialog","aria-expanded":A,"aria-controls":H},b,X],stateAttributesMapping:{open:e=>e&&B===m.REASONS.triggerPress?z.pressableTriggerOpenStateMapping.open(e):z.triggerOpenStateMapping.open(e)}}),en=(0,t.jsx)(n.Fragment,{children:et},y);return q&&!G?(0,t.jsxs)(n.Fragment,{children:[(0,t.jsx)(E.FocusGuard,{ref:J,onFocus:Q}),en,(0,t.jsx)(E.FocusGuard,{ref:j.context.triggerFocusTargetRef,onFocus:ee})]}):en});var H=e.i(726674);let F=n.createContext(void 0),D=n.forwardRef(function(e,n){let{keepMounted:a=!1,...i}=e;return l().useState("mounted")||a?(0,t.jsx)(F.Provider,{value:a,children:(0,t.jsx)(H.FloatingPortal,{ref:n,...i})}):null});var q=e.i(144394),B=e.i(146376);let K=n.createContext(void 0);function U(){let e=n.useContext(K);if(!e)throw Error((0,o.default)(46));return e}var G=e.i(923706),_=e.i(426),$=e.i(222640),W=e.i(789579),Y=e.i(33383);let X=n.forwardRef(function(e,a){let{render:i,className:r,style:c,anchor:d,positionMethod:u,side:p,align:h,sideOffset:g,alignOffset:f,collisionBoundary:x="clipping-ancestors",collisionPadding:S,arrowPadding:b,sticky:C,disableAnchorTracking:j=!1,collisionAvoidance:y=v.POPUP_COLLISION_AVOIDANCE,...N}=e,M=l(),k=function(){let e=n.useContext(F);if(void 0===e)throw Error((0,o.default)(45));return e}(),z=(0,s.useFloatingNodeId)(),w=M.useState("floatingRootContext"),R=M.useState("mounted"),O=M.useState("open"),P=M.useState("openChangeReason"),V=M.useState("activeTriggerElement"),E=M.useState("modal"),I=M.useState("openMethod"),T=M.useState("positionerElement"),L=M.useState("instantType"),A=M.useState("transitionStatus"),H=M.useState("adaptiveOrigin"),D=n.useRef(null),U=(0,$.useAnimationsFinished)(T),X=(0,G.useAnchorPositioning)({anchor:d,floatingRootContext:w,positionMethod:u,mounted:R,side:p,sideOffset:g,align:h,alignOffset:f,arrowPadding:b,collisionBoundary:x,collisionPadding:S,sticky:C,disableAnchorTracking:j,keepMounted:k,nodeId:z,collisionAvoidance:y,adaptiveOrigin:H}),Z=w.useState("domReferenceElement");(0,B.useIsoLayoutEffect)(()=>{let e=D.current;if(Z&&(D.current=Z),e&&Z&&Z!==e){M.set("instantType",void 0);let e=new AbortController;return U(()=>{M.set("instantType","trigger-change")},e.signal),()=>{e.abort()}}},[Z,U,M]);let J=!0===E&&P!==m.REASONS.triggerHover;(0,Y.useAnchoredPopupScrollLock)(O&&J,"touch"===I,T,V);let Q=M.useStateSetter("positionerElement"),ee={open:O,side:X.side,align:X.align,anchorHidden:X.anchorHidden,instant:L},et=(0,W.usePositioner)(e,ee,{styles:X.positionerStyles,transitionStatus:A,props:N,refs:[a,Q],hidden:!R,inert:!O});return(0,t.jsxs)(K.Provider,{value:X,children:[R&&J&&(0,t.jsx)(_.InternalBackdrop,{inert:(0,q.inertValue)(!O),cutout:V}),(0,t.jsx)(s.FloatingNode,{id:z,children:et})]})});var Z=e.i(229315),J=e.i(61487),Q=e.i(431157),ee=e.i(137584),et=e.i(673327),en=e.i(96533),ea=e.i(253984),ei=e.i(667865);let es=n.createContext(void 0),eo=n.forwardRef(function(e,a){let{render:i,className:s,style:o,initialFocus:r,finalFocus:c,...d}=e,u=l(),p=U(),h=null!=(0,en.useToolbarRootContext)(!0),{context:f,hasClosePart:x}=function(){let[e,t]=n.useState(0),a=(0,ei.useStableCallback)(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:n.useMemo(()=>({register:a}),[a]),hasClosePart:e>0}}(),v=u.useState("open"),S=u.useState("openMethod"),b=u.useState("instantType"),C=u.useState("transitionStatus"),j=u.useState("popupProps"),y=u.useState("titleElementId"),N=u.useState("descriptionElementId"),M=u.useState("modal"),k=u.useState("mounted"),R=u.useState("openChangeReason"),O=u.useState("activeTriggerElement"),P=u.useState("floatingRootContext"),V=P.useState("floatingId"),E=u.useState("disabled"),I=u.useState("openOnHover"),T=u.useState("closeDelay");(0,ee.useOpenChangeComplete)({open:v,ref:u.context.popupRef,onComplete(){v&&u.context.onOpenChangeComplete?.(!0)}}),(0,Q.useHoverFloatingInteraction)(P,{enabled:I&&!E,closeDelay:T});let L=void 0===r?(0,g.createDefaultInitialFocus)(u.context.popupRef):r,A=!1!==M&&x;u.useSyncedValue("focusManagerModal",A);let H=u.useStateSetter("popupElement"),F={open:v,side:p.side,align:p.align,instant:b,transitionStatus:C},D=(0,w.useRenderElement)("div",e,{state:F,ref:[a,u.context.popupRef,H],props:[j,{id:V,role:"dialog",...g.FOCUSABLE_POPUP_PROPS,"aria-labelledby":y,"aria-describedby":N,onKeyDown(e){h&&et.COMPOSITE_KEYS.has(e.key)&&e.stopPropagation()}},(0,ea.getDisabledMountTransitionStyles)(C),d],stateAttributesMapping:z.popupTransitionStateMapping});return(0,t.jsx)(J.FloatingFocusManager,{context:P,openInteractionType:S,modal:A,disabled:!k||R===m.REASONS.triggerHover,initialFocus:L,returnFocus:c,restoreFocus:"popup",previousFocusableElement:(0,Z.isHTMLElement)(O)?O:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:(0,t.jsx)(es.Provider,{value:f,children:D})})}),er=n.forwardRef(function(e,t){let{render:n,className:a,style:i,...s}=e,o=l().useState("open"),{arrowRef:r,side:c,align:d,arrowUncentered:u,arrowStyles:p}=U();return(0,w.useRenderElement)("div",e,{state:{open:o,side:c,align:d,uncentered:u},ref:[t,r],props:[{style:p,"aria-hidden":!0},s],stateAttributesMapping:z.popupStateMapping})}),el=n.forwardRef(function(e,t){let{render:n,className:a,style:i,...s}=e,o=l(),r=o.useState("open"),c=o.useState("mounted"),d=o.useState("transitionStatus"),u=o.useState("openChangeReason");return(0,w.useRenderElement)("div",e,{state:{open:r,transitionStatus:d},ref:t,props:[{role:"presentation",hidden:!c,style:{pointerEvents:u===m.REASONS.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},s],stateAttributesMapping:z.popupTransitionStateMapping})}),ec=n.forwardRef(function(e,t){let{render:n,className:a,style:i,...s}=e,o=l(),r=(0,V.useBaseUiId)(s.id);return o.useSyncedValueWithCleanup("titleElementId",r),(0,w.useRenderElement)("h2",e,{ref:t,props:[{id:r},s]})}),ed=n.forwardRef(function(e,t){let{render:n,className:a,style:i,...s}=e,o=l(),r=(0,V.useBaseUiId)(s.id);return o.useSyncedValueWithCleanup("descriptionElementId",r),(0,w.useRenderElement)("p",e,{ref:t,props:[{id:r},s]})}),eu=n.forwardRef(function(e,t){let a,{render:i,className:s,style:o,disabled:r=!1,nativeButton:c=!0,...d}=e,{buttonRef:u,getButtonProps:p}=(0,k.useButton)({disabled:r,focusableWhenDisabled:!1,native:c}),h=l();return a=n.useContext(es),(0,B.useIsoLayoutEffect)(()=>a?.register(),[a]),(0,w.useRenderElement)("button",e,{ref:[t,u],props:[{onClick(e){h.setOpen(!1,(0,y.createChangeEventDetails)(m.REASONS.closePress,e.nativeEvent))}},d,p]})});var ep=e.i(818390);let em=n.forwardRef(function(e,t){let{render:n,className:a,style:i,children:s,...o}=e,r=l(),{side:c}=U(),d=r.useState("instantType"),{children:u,state:p}=(0,ep.usePopupViewport)({store:r,side:c,children:s}),m={activationDirection:p.activationDirection,transitioning:p.transitioning,instant:d};return(0,w.useRenderElement)("div",e,{state:m,ref:t,props:[o,{children:u}],stateAttributesMapping:ep.popupViewportStateMapping})});var eh=e.i(564170);class eg extends eh.BasePopupHandle{constructor(){super(function(){let e=new x.PopupTriggerMap;return Object.assign(new h.NullStore(Object.freeze(C(void 0,e)),Object.freeze(j(e)),S),{setOpen:p.NOOP})}(),"Popover")}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}e.s(["Arrow",0,er,"Backdrop",0,el,"Close",0,eu,"Description",0,ed,"Handle",0,eg,"Popup",0,eo,"Portal",0,D,"Positioner",0,X,"Root",0,function(e){return l(!0)?(0,t.jsx)(N,{props:e}):(0,t.jsx)(s.FloatingTree,{children:(0,t.jsx)(N,{props:e})})},"Title",0,ec,"Trigger",0,A,"Viewport",0,em,"createHandle",0,function(){return new eg}],466914);var ef=e.i(466914),ef=ef,ex=e.i(647163);e.s(["Popover",0,function({...e}){return(0,t.jsx)(ef.Root,{"data-slot":"popover",...e})},"PopoverContent",0,function({className:e,align:n="center",alignOffset:a=0,side:i="bottom",sideOffset:s=4,...o}){return(0,t.jsx)(ef.Portal,{children:(0,t.jsx)(ef.Positioner,{align:n,alignOffset:a,side:i,sideOffset:s,className:"isolate z-50",children:(0,t.jsx)(ef.Popup,{"data-slot":"popover-content",className:(0,ex.cn)("z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...o})})})},"PopoverTrigger",0,function({...e}){return(0,t.jsx)(ef.Trigger,{"data-slot":"popover-trigger",...e})}],59377)},412294,e=>{"use strict";var t=e.i(843476),n=e.i(271645),a=e.i(167881),i=e.i(6799),s=e.i(95187);let o=(0,s.createServerReference)("7f3cf6b1793082312db7b2fd7c85ff203efbeb9ed4",s.callServer,void 0,s.findSourceMapURL,"startChatGptSignInAction");var r=e.i(609856);e.s(["ChatGptSignIn",0,function({variant:e}){let[s,l]=(0,n.useState)(!1),c=(0,n.useRef)(null),d=()=>{c.current&&clearInterval(c.current),c.current=null};(0,n.useEffect)(()=>d,[]);let[u,p]=(0,r.useServerAction)(o,{onOk:e=>{let t=window.open(e,"thursday-chatgpt","popup,width=520,height=720");if(!t)return void i.toast.add({type:"error",title:"The sign-in window was blocked",description:"Allow pop-ups for this page, then try again"});l(!0),d();let n=Date.now()+6e5;c.current=setInterval(()=>{!t.closed&&Date.now()<n||(d(),l(!1))},700)}});return(0,t.jsx)(a.Button,{variant:e,loading:p||s,onClick:()=>u(),children:"Sign in with ChatGPT"})}],412294)},146538,e=>{"use strict";var t=e.i(843476),n=e.i(689664),a=e.i(563707),i=e.i(152886),s=e.i(758925),o=e.i(271645),r=e.i(798120),l=e.i(167881),c=e.i(23750),d=e.i(59377),u=e.i(799623),p=e.i(609856),m=e.i(283653),h=e.i(647163),g=e.i(265402),f=e.i(412294),x=e.i(611568),v=e.i(566595),S=e.i(7227),b=e.i(630374),C=e.i(421429),j=e.i(968978);let y={anthropic:"anthropic",openai:"openai",google:"google",spacexai:"xai",mistral:"mistral",deepseek:"deepseek",cohere:"cohere"},N={alibaba:[{d:"M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z"}],amazon:[{d:"M13.05 15.513h3.08c.214 0 .389.177.389.394v1.82a1.704 1.704 0 011.296 1.661c0 .943-.755 1.708-1.685 1.708-.931 0-1.686-.765-1.686-1.708 0-.807.554-1.484 1.297-1.662v-1.425h-2.69v4.663a.395.395 0 01-.188.338l-2.69 1.641a.385.385 0 01-.405-.002l-4.926-3.086a.395.395 0 01-.185-.336V16.3L2.196 14.87A.395.395 0 012 14.555L2 14.528V9.406c0-.14.073-.27.192-.34l2.465-1.462V4.448c0-.129.062-.249.165-.322l.021-.014L9.77 1.058a.385.385 0 01.407 0l2.69 1.675a.395.395 0 01.185.336V7.6h3.856V5.683a1.704 1.704 0 01-1.296-1.662c0-.943.755-1.708 1.685-1.708.931 0 1.685.765 1.685 1.708 0 .807-.553 1.484-1.296 1.662v2.311a.391.391 0 01-.389.394h-4.245v1.806h6.624a1.69 1.69 0 011.64-1.313c.93 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708a1.69 1.69 0 01-1.64-1.314H13.05v1.937h4.953l.915 1.18a1.66 1.66 0 01.84-.227c.931 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708-.93 0-1.685-.765-1.685-1.708 0-.346.102-.668.276-.937l-.724-.935H13.05v1.806zM9.973 1.856L7.93 3.122V6.09h-.778V3.604L5.435 4.669v2.945l2.11 1.36L9.712 7.61V5.334h.778V7.83c0 .136-.07.263-.184.335L7.963 9.638v2.081l1.422 1.009-.446.646-1.406-.998-1.53 1.005-.423-.66 1.605-1.055v-1.99L5.038 8.29l-2.26 1.34v1.676l1.972-1.189.398.677-2.37 1.429V14.3l2.166 1.258 2.27-1.368.397.677-2.176 1.311V19.3l1.876 1.175 2.365-1.426.398.678-2.017 1.216 1.918 1.201 2.298-1.403v-5.78l-4.758 2.893-.4-.675 5.158-3.136V3.289L9.972 1.856zM16.13 18.47a.913.913 0 00-.908.92c0 .507.406.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zm3.63-3.81a.913.913 0 00-.908.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92zm1.555-4.99a.913.913 0 00-.908.92c0 .507.407.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zM17.296 3.1a.913.913 0 00-.907.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92z"}],"arcee-ai":[{d:"M13.236 2.377L2.751 20.493H0L11.863 0l1.373 2.377zm3.554 6.156l-9.606 11.96H4.13L15.511 6.32l1.279 2.212zm6.908 11.96H14.05l8.406-2.151 1.242 2.15zm-3.42-5.922l-7.843 5.92H8.482l10.597-7.997 1.2 2.077z"}],bfl:[{d:"M0 20.683L12.01 2.5 24 20.683h-2.233L12.009 5.878 3.471 18.806h12.122l1.239 1.877H0z"},{d:"M8.069 16.724l2.073-3.115 2.074 3.115H8.069zM18.24 20.683l-5.668-8.707h2.177l5.686 8.707h-2.196zM19.74 11.676l2.13-3.19 2.13 3.19h-4.26z"}],bytedance:[{d:"M14.944 18.587l-1.704-.445V10.01l1.824-.462c1-.254 1.84-.461 1.88-.453.032 0 .056 2.235.056 4.972v4.973l-.176-.008c-.104 0-.952-.207-1.88-.446z"},{d:"M7 16.542c0-2.736.024-4.98.064-4.98.032-.008.872.2 1.88.454l1.816.461-.016 4.05-.024 4.049-1.632.422c-.896.23-1.736.445-1.856.469L7 21.523v-4.98z"},{d:"M19.24 12.477c0-9.03.008-9.515.144-9.475.072.024.784.207 1.576.406.792.207 1.576.405 1.744.445l.296.08-.016 8.56-.024 8.568-1.624.414c-.888.23-1.728.437-1.856.47l-.24.055v-9.523z"},{d:"M1 12.509c0-4.678.024-8.505.064-8.505.032 0 .872.207 1.872.454l1.824.461v7.582c0 4.16-.016 7.574-.032 7.574-.024 0-.872.215-1.88.47L1 21.013v-8.505z"}],"fish-audio":[{d:"M23.12 12.13v.62c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-.62c0-.24-.2-.44-.44-.44-.25 0-.44.2-.44.44m-1.77.37v1.74c0 .24.2.44.44.44.25 0 .44-.2.44-.44V12.5c0-.24-.19-.44-.44-.44-.24 0-.44.2-.44.44m-1.76.43v1.99q0 .09.03.17.04.08.1.14.07.07.15.1t.17.03c.24 0 .44-.19.44-.44v-1.99c0-.25-.2-.44-.44-.44q-.09 0-.17.03t-.15.1q-.06.06-.1.14-.03.08-.03.17m-1.76.35v1.97c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-1.97c0-.24-.2-.44-.44-.44-.25 0-.44.2-.44.44m-1.77.32v1.65c0 .25.2.45.44.45s.44-.2.44-.45V13.6c0-.25-.2-.45-.44-.45s-.44.2-.44.45m-1.76 1.26v.3q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3v-.3q-.01-.17-.14-.3-.13-.11-.31-.12-.17.01-.3.12-.13.13-.14.3M0 9.38v.19c0 .24.2.44.44.44.25 0 .44-.2.44-.44v-.19c0-.25-.19-.44-.44-.44-.24 0-.44.19-.44.44m1.82.15v.81c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-.81q0-.18-.13-.31t-.31-.13-.31.13-.13.31m1.81-.24v3.39q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3V9.29q-.01-.17-.14-.3-.13-.11-.31-.12-.17.01-.3.12-.13.13-.14.3m1.83-.35v.22c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-.22q0-.18-.13-.31T5.9 8.5t-.31.13-.13.31m0 2.94v2.34c0 .25.19.44.44.44.24 0 .44-.19.44-.44v-2.34c0-.24-.2-.44-.44-.44-.25 0-.44.2-.44.44m15.89-3.32V11c0 .25.2.44.44.44.25 0 .44-.19.44-.44V8.56c0-.24-.19-.44-.44-.44-.24 0-.44.2-.44.44m-1.76-.39v3.28q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3V8.17c0-.25-.2-.44-.44-.44q-.09 0-.17.03t-.15.1q-.06.06-.1.14-.03.08-.03.17M17.83 8v3.9c0 .24.19.44.44.44.24 0 .44-.2.44-.44V8c0-.25-.2-.44-.44-.44-.25 0-.44.19-.44.44m-1.77.11v3.96c0 .25.2.44.44.44s.44-.19.44-.44V8.11c0-.25-.2-.44-.44-.44s-.44.19-.44.44m-1.76.27v5.03q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3V8.38c0-.25-.2-.44-.45-.44-.24 0-.44.19-.44.44m-1.8.46v5.75q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3V8.84c0-.25-.2-.44-.45-.44-.24 0-.44.19-.44.44m-1.76.76v5.52c0 .24.2.44.44.44.25 0 .44-.2.44-.44V9.6c0-.24-.19-.44-.44-.44-.24 0-.44.2-.44.44m-1.77 1.01v4.77q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3v-4.77q-.01-.17-.14-.3-.13-.11-.31-.12-.17.01-.3.12-.13.13-.14.3M23.12 9.6v1.22c0 .24.19.44.44.44.24 0 .44-.2.44-.44V9.6c0-.24-.2-.44-.44-.44-.25 0-.44.2-.44.44M7.21 11.32V16c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-4.68q0-.18-.13-.31t-.31-.13-.31.13-.13.31"}],inception:[{d:"M14.767 1H7.884L1 7.883v6.884h6.884V7.883h6.883V1zM9.234 23h6.882L23 16.116V9.233h-6.884v6.883H9.234V23z"}],klingai:[{d:"M5.493 21.234c-1.112-1.451-1.109-4.263-.081-7.459l-4.557-2.63a1.683 1.683 0 01-.85-1.304 1.505 1.505 0 01.08-.622 13.18 13.18 0 011.037-2.255c3.476-6.02 10.916-8.23 16.619-4.938.46.266.82.67 1.081 1.184.785 1.545.685 4.096-.234 6.954l4.557 2.631c.339.196.596.492.736.832a1.53 1.53 0 01.034 1.093 13.146 13.146 0 01-1.037 2.255c-3.476 6.02-10.916 8.23-16.619 4.938a2.6 2.6 0 01-.766-.68zm11.096-6.615c-2.073 3.591-5.808 5.316-8.343 3.852-1.267-.731-1.994-2.122-2.145-3.778-.095-1.035.036-2.173.4-3.32.217-.684.517-1.37.902-2.039l.008-.014c2.073-3.59 5.808-5.315 8.343-3.852.633.366 1.13.895 1.49 1.54.986 1.772.922 4.415-.285 6.914-.111.23-.232.457-.362.683l-.008.014z"}],kwaipilot:[{d:"M11.765.03C5.327.03.108 5.25.108 11.686c0 3.514 1.556 6.665 4.015 8.804L9.89 8.665h6.451L9.31 23.083c.807.173 1.63.26 2.455.26 6.438 0 11.657-5.22 11.657-11.658S18.202.028 11.765.028V.03z"}],meta:[{d:"M6.897 4c1.915 0 3.516.932 5.43 3.376l.282-.373c.19-.246.383-.484.58-.71l.313-.35C14.588 4.788 15.792 4 17.225 4c1.273 0 2.469.557 3.491 1.516l.218.213c1.73 1.765 2.917 4.71 3.053 8.026l.011.392.002.25c0 1.501-.28 2.759-.818 3.7l-.14.23-.108.153c-.301.42-.664.758-1.086 1.009l-.265.142-.087.04a3.493 3.493 0 01-.302.118 4.117 4.117 0 01-1.33.208c-.524 0-.996-.067-1.438-.215-.614-.204-1.163-.56-1.726-1.116l-.227-.235c-.753-.812-1.534-1.976-2.493-3.586l-1.43-2.41-.544-.895-1.766 3.13-.343.592C7.597 19.156 6.227 20 4.356 20c-1.21 0-2.205-.42-2.936-1.182l-.168-.184c-.484-.573-.837-1.311-1.043-2.189l-.067-.32a8.69 8.69 0 01-.136-1.288L0 14.468c.002-.745.06-1.49.174-2.23l.1-.573c.298-1.53.828-2.958 1.536-4.157l.209-.34c1.177-1.83 2.789-3.053 4.615-3.16L6.897 4zm-.033 2.615l-.201.01c-.83.083-1.606.673-2.252 1.577l-.138.199-.01.018c-.67 1.017-1.185 2.378-1.456 3.845l-.004.022a12.591 12.591 0 00-.207 2.254l.002.188c.004.18.017.36.04.54l.043.291c.092.503.257.908.486 1.208l.117.137c.303.323.698.492 1.17.492 1.1 0 1.796-.676 3.696-3.641l2.175-3.4.454-.701-.139-.198C9.11 7.3 8.084 6.616 6.864 6.616zm10.196-.552l-.176.007c-.635.048-1.223.359-1.82.933l-.196.198c-.439.462-.887 1.064-1.367 1.807l.266.398c.18.274.362.56.55.858l.293.475 1.396 2.335.695 1.114c.583.926 1.03 1.6 1.408 2.082l.213.262c.282.326.529.54.777.673l.102.05c.227.1.457.138.718.138.176.002.35-.023.518-.073.338-.104.61-.32.813-.637l.095-.163.077-.162c.194-.459.29-1.06.29-1.785l-.006-.449c-.08-2.871-.938-5.372-2.2-6.798l-.176-.189c-.67-.683-1.444-1.074-2.27-1.074z"}],minimax:[{d:"M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z"}],moonshotai:[{d:"M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"}],morph:[{d:"M7.941 2c.23 0 .452.073.638.21.186.136.325.328.397.55l.593 1.814c.073.221.212.413.397.55.186.136.409.21.638.21h2.791c.23 0 .452-.074.638-.21a1.11 1.11 0 00.397-.55l.594-1.815a1.11 1.11 0 01.397-.55c.185-.136.408-.209.637-.209h1.7c.23 0 .453.073.639.21.185.136.324.328.397.55l.652 1.994c.118.361.41.635.77.728l2.957.752c.236.06.446.199.596.394.15.195.23.436.231.684v9.376c0 .248-.081.488-.231.684a1.09 1.09 0 01-.595.394l-2.957.752a1.086 1.086 0 00-.477.263 1.114 1.114 0 00-.293.465l-.653 1.994a1.11 1.11 0 01-.396.55c-.186.136-.41.21-.638.21h-1.702c-.229 0-.452-.073-.637-.21a1.11 1.11 0 01-.397-.55l-.364-1.11a1.131 1.131 0 01.15-1.002 1.074 1.074 0 01.885-.462h2.85c.29 0 .567-.116.772-.325.204-.208.32-.49.32-.785V6.444c0-.294-.116-.577-.32-.785a1.08 1.08 0 00-.771-.326h-3.273c-.29 0-.567.117-.772.326-.204.208-.32.49-.32.785v7.778c0 .295-.114.578-.319.786a1.08 1.08 0 01-.771.325h-2.182a1.08 1.08 0 01-.771-.325 1.122 1.122 0 01-.32-.786V6.444c0-.294-.115-.577-.32-.785a1.081 1.081 0 00-.77-.326H5.454c-.29 0-.567.117-.772.326-.204.208-.32.49-.32.785v11.112c0 .294.116.577.32.785.205.209.482.326.772.326h2.85a1.075 1.075 0 01.885.461 1.122 1.122 0 01.15 1.001l-.364 1.112a1.11 1.11 0 01-.397.55c-.185.136-.408.209-.637.209H6.24c-.229 0-.452-.073-.638-.21a1.11 1.11 0 01-.397-.55l-.652-1.994a1.114 1.114 0 00-.294-.465 1.086 1.086 0 00-.477-.263l-2.956-.752a1.09 1.09 0 01-.595-.394A1.124 1.124 0 010 16.688V7.312c0-.248.081-.489.231-.684.15-.195.36-.334.595-.394l2.957-.753c.178-.045.342-.136.477-.263.134-.127.235-.287.293-.464l.653-1.995a1.11 1.11 0 01.397-.55C5.788 2.075 6.01 2 6.24 2h1.701z"}],nvidia:[{d:"M10.212 8.976V7.62c.127-.01.256-.017.388-.021 3.596-.117 5.957 3.184 5.957 3.184s-2.548 3.647-5.282 3.647a3.227 3.227 0 01-1.063-.175v-4.109c1.4.174 1.681.812 2.523 2.258l1.873-1.627a4.905 4.905 0 00-3.67-1.846 6.594 6.594 0 00-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024 5.002-.174 8.261 4.226 8.261 4.226s-3.743 4.69-7.643 4.69c-.338 0-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057 3.629 0 6.253-1.91 8.794-4.169.421.347 2.146 1.193 2.501 1.564-2.416 2.083-8.048 3.763-11.24 3.763-.308 0-.603-.02-.894-.048V19.5H24v-15H10.21zm0 9.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173 7.173 0 014.287-2.138v1.172h-.005a3.182 3.182 0 00-2.502 1.178s.615 2.276 2.507 2.931m-5.961-3.3c1.436-1.935 3.604-3.148 5.961-3.336V6.523C5.81 6.887 2 10.723 2 10.723s2.158 6.427 8.21 7.015v-1.166C5.77 16 4.25 10.958 4.25 10.958h-.002z"}],perplexity:[{d:"M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z"}],recraft:[{d:"M19.667 8.275c0-4.57-4.15-8.275-9.27-8.275-1.774 0-3.213 3.705-3.213 8.275 0 1.143.09 2.233.253 3.224H4.29L1 23h9.4v-6.447c5.117 0 9.266-3.707 9.266-8.275l.001-.002zm-9.27-6.76c.93 0 1.682 3.028 1.682 6.76 0 3.733-.752 6.76-1.681 6.76-.93 0-1.681-3.027-1.681-6.76 0-3.732.752-6.76 1.68-6.76z"},{d:"M19.848 16.552h-9.44L14.028 23h9.438l-3.618-6.448z"}],stepfun:[{d:"M12 0C5.372 0 0 5.372 0 12s5.372 12 12 12 12-5.372 12-12S18.628 0 12 0zM8.762 19.614H4.376v-4.386h4.386v4.386zm5.423 0H9.798v-4.386h4.387v4.386zm0-5.42H9.798V9.81h4.387v4.386zm0-5.418H9.798V4.39h4.387v4.386zm5.422-.004h-4.386V4.386h4.386v4.386z"}],tencent:[{d:"M12 0c6.627 0 12 5.373 12 12s-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0zm1.652 1.123l-.01-.001c.533.097 1.023.233 1.41.404 6.084 2.683 7.396 9.214 1.601 14.338a3.781 3.781 0 01-5.337-.328 3.654 3.654 0 01-.884-3.044c-1.934.6-3.295 2.305-3.524 4.45-.204 1.912.324 4.044 2.056 5.634l.245.067C10.1 22.876 11.036 23 12 23c6.075 0 11-4.925 11-11 0-5.513-4.056-10.08-9.348-10.877zM2.748 6.21c-.178.269-.348.536-.51.803l-.235.394.078-.167A10.957 10.957 0 001 12c0 4.919 3.228 9.083 7.682 10.49l.214.065C3.523 18.528 2.84 14.149 6.47 8.68A2.234 2.234 0 102.748 6.21zm10.157-5.172c4.408 1.33 3.61 5.41 2.447 6.924-.86 1.117-2.922 1.46-3.708 2.238-.666.657-1.077 1.462-1.212 2.291A5.303 5.303 0 0112 12.258a5.672 5.672 0 001.404-11.169 10.51 10.51 0 00-.5-.052z"}],voyage:[{d:"M5.407 0v.066a.974.974 0 00-.048.245c-.011.11-.016.208-.016.295 0 .339.043.715.128 1.13.097.405.274.912.531 1.524l7.125 16.366L20.011 3.39c.161-.404.333-.846.515-1.327.182-.48.273-.966.273-1.458a1.406 1.406 0 00-.096-.54V0H24v.066c-.204.207-.45.578-.74 1.114-.29.535-.606 1.195-.949 1.982L13.095 24h-1.287L3.075 3.965c-.204-.47-.418-.923-.644-1.36-.214-.437-.418-.83-.61-1.18-.194-.36-.365-.66-.515-.9A5.666 5.666 0 001 .064V0h4.407z"}],xiaomi:[{d:"M12 0C8.016 0 4.756.255 2.493 2.516.23 4.776 0 8.033 0 12.012c0 3.98.23 7.235 2.494 9.497C4.757 23.77 8.017 24 12 24c3.983 0 7.243-.23 9.506-2.491C23.77 19.247 24 15.99 24 12.012c0-3.984-.233-7.243-2.502-9.504C19.234.252 15.978 0 12 0zM4.906 7.405h5.624c1.47 0 3.007.068 3.764.827.746.746.827 2.233.83 3.676v4.54a.15.15 0 0 1-.152.147h-1.947a.15.15 0 0 1-.152-.148V11.83c-.002-.806-.048-1.634-.464-2.051-.358-.36-1.026-.441-1.72-.458H7.158a.15.15 0 0 0-.151.147v6.98a.15.15 0 0 1-.152.148H4.906a.15.15 0 0 1-.15-.148V7.554a.15.15 0 0 1 .15-.149zm12.131 0h1.949a.15.15 0 0 1 .15.15v8.892a.15.15 0 0 1-.15.148h-1.949a.15.15 0 0 1-.151-.148V7.554a.15.15 0 0 1 .151-.149zM8.92 10.948h2.046c.083 0 .15.066.15.147v5.352a.15.15 0 0 1-.15.148H8.92a.15.15 0 0 1-.152-.148v-5.352a.15.15 0 0 1 .152-.147Z"}],zai:[{d:"M12.105 2L9.927 4.953H.653L2.83 2h9.276zM23.254 19.048L21.078 22h-9.242l2.174-2.952h9.244zM24 2L9.264 22H0L14.736 2H24z"}]};function M({owner:e,className:n}){let a=y[e];if(a)return(0,t.jsx)(j.ProviderIcon,{provider:a,className:n});let i=N[e];return i?(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:n,"aria-hidden":"true",children:i.map(e=>(0,t.jsx)("path",{d:e.d,opacity:e.opacity},e.d))}):null}function k({models:e,kind:n,value:a,loading:i,onPick:s}){let[r,d]=(0,o.useState)(!1),[u,p]=(0,o.useState)(""),[m,f]=(0,o.useState)("cheap"),[j,y]=(0,o.useState)(a),N=e.filter(e=>e.type===(n??g.GATEWAY_TEXT)),M=n?N:N.filter(e=>e.tags.includes(g.GATEWAY_TOOL_USE)),O=u.trim().toLowerCase(),V=(O?M.filter(e=>`${e.id} ${e.label}`.toLowerCase().includes(O)):M).slice().sort(w[m].compare);return(0,t.jsxs)(b.Dialog,{open:r,onOpenChange:e=>{d(e),e?y(a):p("")},children:[(0,t.jsxs)(b.DialogTrigger,{render:(0,t.jsx)("button",{type:"button","aria-label":"Model",className:(0,h.cn)(c.inputClassName,"relative flex items-center pr-8 text-left font-mono text-sm")}),children:[(0,t.jsx)("span",{className:(0,h.cn)("min-w-0 flex-1 truncate",!a&&"font-sans text-muted-foreground"),children:a||"Pick a model"}),(0,t.jsx)("span",{className:"absolute inset-y-0 right-0 flex w-8 items-center justify-center text-muted-foreground",children:i&&0===M.length?(0,t.jsx)(x.LoaderCircle,{className:"size-3.5 animate-spin"}):(0,t.jsx)(v.Search,{className:"size-3.5"})})]}),(0,t.jsx)(b.DialogContent,{className:"h-[min(40rem,calc(100vh-3rem))] gap-0 overflow-hidden p-0 sm:max-w-2xl",children:(0,t.jsxs)("div",{className:"flex h-full min-h-0 min-w-0 flex-col",children:[(0,t.jsxs)("div",{className:"shrink-0 space-y-1 px-6 pt-5 pb-4",children:[(0,t.jsxs)(b.DialogTitle,{className:"flex items-center gap-2.5 text-xl font-semibold",children:[(0,t.jsx)(S.VercelIcon,{className:"size-3.5"}),n?z[n]:"Text"," models"]}),(0,t.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:O?`${V.length} matching “${u.trim()}”`:n?`${M.length} on the gateway`:`${M.length} of ${N.length} on the gateway can call tools`})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-3 border-t border-border/60 px-6 py-3",children:[(0,t.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,t.jsx)(v.Search,{className:"pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(c.Input,{autoFocus:!0,"aria-label":"Search models",placeholder:"name, id or provider",spellCheck:!1,value:u,onChange:e=>p(e.target.value),className:"h-8 pl-8 font-mono text-xs"})]}),(0,t.jsx)(C.Segmented,{"aria-label":"Sort",options:R,value:m,onChange:f})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-4 px-6 pb-1.5 font-mono text-[10px] tracking-wide text-muted-foreground/60",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1",children:"model"}),(0,t.jsx)("span",{className:"w-28 text-right",children:"per 1M in / out"})]}),(0,t.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border/60",children:[V.map(e=>(0,t.jsx)(P,{model:e,picked:e.id===j,onPick:()=>y(e.id)},e.id)),0===V.length&&(0,t.jsxs)("div",{className:"flex flex-col items-start gap-2.5 p-10",children:[(0,t.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:O?`Nothing matches “${u.trim()}”.`:"Nothing on the shelf — search for an id."}),O&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)(l.Button,{size:"sm",onClick:()=>y(u.trim()),children:["Use “",u.trim(),"” as the id"]}),(0,t.jsx)(l.Button,{variant:"outline",size:"sm",onClick:()=>p(""),children:"Clear search"})]})]})]}),(0,t.jsxs)("div",{className:"flex h-14 shrink-0 items-center gap-3 border-t border-border/60 px-6",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:j||"Nothing picked — the field keeps what it has"}),(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>d(!1),children:"Cancel"}),(0,t.jsx)(l.Button,{disabled:!j,onClick:()=>{s(j),d(!1)},children:"Use this model"})]})]})})]})}let z={image:"Image",video:"Video",speech:"Speech",transcription:"Transcription"},w={cheap:{label:"$↑",title:"Cheapest first",compare:(e,t)=>(e.price.in??1/0)-(t.price.in??1/0)},dear:{label:"$↓",title:"Dearest first",compare:(e,t)=>(t.price.in??-1)-(e.price.in??-1)},name:{label:"a–z",title:"By name",compare:(e,t)=>e.label.localeCompare(t.label)}},R=Object.keys(w).map(e=>({value:e,label:w[e].label,title:w[e].title})),O=e=>e>=1?e.toFixed(2):String(Number(e.toFixed(4)));function P({model:e,picked:a,onPick:i}){let{price:s}=e,o=null!==s.in||null!==s.out;return(0,t.jsxs)("button",{type:"button",onClick:i,className:(0,h.cn)("flex w-full items-center gap-4 border-b border-border/60 px-6 py-2.5 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",a?"bg-muted/40":"hover:bg-muted/50"),children:[(0,t.jsx)("span",{className:"grid size-[18px] shrink-0 place-items-center",children:(0,t.jsx)(M,{owner:e.owner,className:"size-[15px]"})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{className:(0,h.cn)("truncate text-[13px]",a&&"font-medium"),children:e.label}),a&&(0,t.jsx)(n.Check,{className:"size-3.5 shrink-0"}),e.retiring&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:"retiring"})]}),(0,t.jsx)("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:e.id})]}),(0,t.jsxs)("span",{className:"flex w-28 shrink-0 flex-col items-end",children:[(0,t.jsx)("span",{className:(0,h.cn)("font-mono text-xs",o||s.free?"text-foreground":"text-muted-foreground"),children:s.free?"free":null===s.in&&null===s.out?s.note??"—":`${null===s.in?"—":O(s.in)} / ${null===s.out?"—":O(s.out)}`}),o&&s.note&&(0,t.jsx)("span",{className:"font-mono text-[9px] text-muted-foreground/70",children:s.note})]})]})}function V({tier:e}){return(0,t.jsx)("span",{className:"shrink-0 rounded-full px-1.5 font-mono text-[9.5px] leading-4 font-normal text-muted-foreground ring-1 ring-border ring-inset",children:e})}function E({provider:e,onSaved:n}){let[a,i]=(0,o.useState)(""),[s,d]=(0,p.useServerAction)(u.setConfigAction,{okMessage:`${e.label} key saved`,onOk:()=>{(0,m.revalidate)(r.queryKey.llmModel),(0,m.revalidate)(r.queryKey.config),n()}});return e.signIn?(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("p",{className:"px-1 font-mono text-[11px] text-muted-foreground",children:"Runs on your plan once you sign in"}),(0,t.jsx)(f.ChatGptSignIn,{variant:"outline"})]}):(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(c.Input,{value:a,onChange:e=>i(e.target.value),placeholder:e.apiKeyName,spellCheck:!1,type:"password"}),(0,t.jsx)(l.Button,{variant:"outline",loading:d,disabled:a.trim().length<8,onClick:()=>s(e.apiKeyName,a),children:"Save key"})]})}e.s(["ModelPicker",0,function({provider:e,model:u,kind:p,unset:f,onChange:x,onUnset:v,compact:S=!1}){let{data:b=[],mutate:C}=(0,m.useServerRoute)(r.queryKey.llmModel),y=p?b.filter(e=>(0,g.canMakeKind)(e.id,p)):b,N=y.find(t=>t.id===e),[M,z]=(0,o.useState)(!1),[w,R]=(0,o.useState)(null),[O,P]=(0,o.useState)(""),I=y.find(t=>t.id===(w??e))??y[0],T=I?.id==="vercel-ai-gateway",L=(0,m.useServerRoute)(M&&T&&r.queryKey.modelCatalog),A=e=>p&&e?g.MEDIA_MODEL_PROVIDERS[e.id]?.models[p]??[]:e?.suggestModels??[],H=A(N).find(e=>e.id===u),F=e=>{I&&e.trim()&&(x({provider:I.id,model:e.trim()}),P(""),z(!1))};return(0,t.jsxs)(d.Popover,{open:M,onOpenChange:e=>{z(e),e||R(null)},children:[(0,t.jsxs)(d.PopoverTrigger,{render:S?(0,t.jsx)("button",{type:"button",className:"inline-flex h-5 max-w-64 items-center gap-1.5 rounded-full px-2 text-foreground/80 ring-1 ring-border outline-none ring-inset transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50"}):(0,t.jsx)(l.Button,{variant:"outline",className:"w-full min-w-0 justify-start gap-2 font-normal"}),children:[N?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.ProviderIcon,{provider:N.id,className:(0,h.cn)("shrink-0",S?"size-3":"size-4")}),!S&&(0,t.jsxs)("span",{className:"min-w-0 max-w-fit grow basis-0 truncate text-muted-foreground",children:[N.label,(0,t.jsx)("span",{className:"ml-2 text-muted-foreground/40",children:"·"})]}),(0,t.jsx)("span",{className:(0,h.cn)("truncate",!S&&"font-medium"),children:H?.label??(u||"Pick a model")})]}):(0,t.jsx)("span",{className:"truncate text-muted-foreground",children:f??(p?"Not picked":"App default")}),(0,t.jsx)(a.ChevronsUpDown,{className:(0,h.cn)("ml-auto shrink-0 text-muted-foreground",S?"size-2.5":"size-3.5")})]}),(0,t.jsxs)(d.PopoverContent,{align:"start",className:"flex w-[min(34rem,calc(100vw-2rem))] flex-row gap-0 overflow-hidden rounded-2xl p-0",children:[(0,t.jsxs)("div",{className:"flex max-h-80 w-48 shrink-0 flex-col gap-px overflow-y-auto border-r border-border/60 bg-muted/40 p-1.5",children:[v&&(0,t.jsxs)("button",{type:"button",onClick:()=>{v(),z(!1)},className:(0,h.cn)("mb-1 flex h-8.5 shrink-0 items-center gap-2 rounded-lg px-2 text-left text-[13px] outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",N?"hover:bg-muted/60":"bg-muted font-medium"),children:[(0,t.jsx)(i.CircleDashed,{className:"size-4 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:f??(p?"Not picked":"App default")}),!N&&(0,t.jsx)(n.Check,{className:"size-3.5 shrink-0"})]}),y.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>R(e.id),className:(0,h.cn)("flex h-8.5 shrink-0 items-center gap-2 rounded-lg px-2 text-left text-[13px] outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",e.id===I?.id?"bg-muted font-medium":"hover:bg-muted/60",!e.hasKey&&"text-muted-foreground"),children:[(0,t.jsx)(j.ProviderIcon,{provider:e.id,className:"size-4 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.label}),!e.hasKey&&(0,t.jsx)(s.KeyRound,{className:"size-3 shrink-0"})]},e.id))]}),(0,t.jsx)("div",{className:"flex max-h-80 min-w-0 flex-1 flex-col gap-px overflow-y-auto p-1.5",children:I?I.hasKey?T&&!L.error?(0,t.jsxs)("div",{className:"space-y-2 p-2",children:[(0,t.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"Every model the gateway carries, with what each costs."}),(0,t.jsx)(k,{models:L.data??[],kind:p,value:I.id===e?u:"",loading:L.isLoading,onPick:F})]}):(0,t.jsxs)(t.Fragment,{children:[A(I).map(a=>{let i=I.id===e&&a.id===u;return(0,t.jsxs)("button",{type:"button",onClick:()=>F(a.id),className:(0,h.cn)("flex shrink-0 items-center gap-2 rounded-lg px-2.5 py-1.5 text-left outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",i?"bg-muted":"hover:bg-muted/60"),children:[(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-[13px] font-medium",children:[(0,t.jsx)("span",{className:"truncate",children:a.label}),(0,t.jsx)(V,{tier:a.tier})]}),(0,t.jsx)("span",{className:"block truncate font-mono text-[10.5px] text-muted-foreground",children:a.id})]}),i&&(0,t.jsx)(n.Check,{className:"size-3.5 shrink-0"})]},a.id)}),(0,t.jsx)("form",{onSubmit:e=>{e.preventDefault(),F(O)},className:"mt-1 px-1 pb-1",children:(0,t.jsx)(c.Input,{value:O,onChange:e=>P(e.target.value),spellCheck:!1,"aria-label":"Model id",placeholder:L.error?"Could not read the catalog — type an id":"or type a model id",className:"h-8 font-mono text-xs"})})]}):(0,t.jsxs)("div",{className:"space-y-2 p-2",children:[(0,t.jsxs)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:[I.label," has no key yet."]}),(0,t.jsx)(E,{provider:I,onSaved:()=>C()})]}):null})]})]})}],146538)},563707,152886,e=>{"use strict";var t=e.i(456420);let n={name:"chevrons-up-down",size:24,node:[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]};n.node;let a=(0,t.default)(n);e.s(["ChevronsUpDown",0,a],563707);let i={name:"circle-dashed",size:24,node:[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]};i.node;let s=(0,t.default)(i);e.s(["CircleDashed",0,s],152886)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,59377,e=>{"use strict";var t=e.i(843476);e.s([],158421),e.i(158421);var n=e.i(271645),a=e.i(896499),i=e.i(17989),s=e.i(46420),o=e.i(733332);let r=n.createContext(void 0);function l(e){let t=n.useContext(r);if(void 0===t&&!e)throw Error((0,o.default)(47));return t}var c=e.i(174080),d=e.i(301252),u=e.i(439957),p=e.i(956789),m=e.i(56434),h=e.i(18478),g=e.i(264111),f=e.i(116786),x=e.i(990627),v=e.i(638396);let S={...f.popupStoreSelectors,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class b extends d.ReactStore{constructor(e,t,n){const a=new x.PopupTriggerMap;super(C(e,a,t,n),j(a),S)}setOpen=(e,t)=>{let n,a=t.reason===m.REASONS.triggerHover,i=t.reason===m.REASONS.triggerPress&&0===t.event.detail,s=!e&&(t.reason===m.REASONS.escapeKey||null==t.reason),o=(0,g.attachPreventUnmountOnClose)(t),r=this.select("activeTriggerId");if(e||t.reason!==m.REASONS.closePress||null!=t.trigger||null==r||(t.trigger=this.context.triggerElements.getById(r)??this.select("activeTriggerElement")??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let l=()=>{let n=(0,g.createPopupOpenState)(this.state,e,t.trigger,o());n.openChangeReason=t.reason,this.update(n)};a?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(v.PATIENT_CLICK_THRESHOLD,()=>{this.set("stickIfOpen",!1)}),c.flushSync(l)):l(),i?n="click":s?n="dismiss":t.reason===m.REASONS.focusOut&&(n="focus"),this.set("instantType",n)}}function C(e,t,n,a=!1){let i={...(0,f.createInitialPopupStoreState)(t,n,a),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function j(e){return{popupRef:n.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:n.createRef(),beforeContentFocusGuardRef:n.createRef(),stickIfOpenTimeout:new u.Timeout,triggerElements:e}}var y=e.i(675606);let N=(0,a.fastComponent)(function({props:e}){var a;let i,{children:s,open:o,defaultOpen:l=!1,onOpenChange:c,onOpenChangeComplete:d,modal:u=!1,handle:p,triggerId:h,defaultTriggerId:f=null}=e,x=(a={modal:u,open:l,openProp:o,activeTriggerId:f,triggerIdProp:h},i=(0,g.usePopupRootStore)((e,t)=>new b(a,e,t)),n.useEffect(()=>i.context.stickIfOpenTimeout.disposeEffect(),[i]),i);x.useControlledProp("openProp",o),x.useControlledProp("triggerIdProp",h);let v=x.useState("open"),S=x.useState("mounted"),C=x.useState("payload");x.useContextCallback("onOpenChange",c),x.useContextCallback("onOpenChangeComplete",d),(0,g.usePopupRootSync)(x,v),(0,g.useImplicitActiveTrigger)(x);let{forceUnmount:j}=(0,g.useOpenStateTransitions)(v,x,()=>{x.update({stickIfOpen:!0,openChangeReason:null})});x.useSyncedValues({modal:u}),n.useEffect(()=>{v||x.context.stickIfOpenTimeout.clear()},[x,v]),n.useImperativeHandle(e.actionsRef,()=>({unmount:j,close:()=>x.setOpen(!1,(0,y.createChangeEventDetails)(m.REASONS.imperativeAction))}),[j,x]);let N=v||S;return(0,t.jsxs)(r.Provider,{value:x,children:[p&&(0,t.jsx)(g.PopupHandleAttachment,{handle:p,store:x}),N&&(0,t.jsx)(M,{store:x,modal:u}),"function"==typeof s?s({payload:C}):s]})});function M({store:e,modal:t}){let n=e.useState("floatingRootContext"),a=(0,i.useDismiss)(n,{outsidePressEvent:{mouse:"trap-focus"===t?"sloppy":"intentional",touch:"sloppy"}}),s=a.reference,o=a.floating;return(0,g.usePopupInteractionProps)(e,{activeTriggerProps:s,inactiveTriggerProps:s,popupProps:o}),null}var k=e.i(540886),z=e.i(879938),w=e.i(552245),R=e.i(650316),O=e.i(385689),P=e.i(872135),V=e.i(788015),E=e.i(152535),I=e.i(459636),T=e.i(346570),L=e.i(32199);let A=(0,a.fastComponentRef)(function(e,a){let{render:i,className:s,style:r,disabled:c=!1,nativeButton:d=!0,handle:u,payload:p,openOnHover:h=!1,delay:f=300,closeDelay:x=0,id:S,...b}=e,C=l(!0),j=(0,I.usePopupHandleStore)(u)??C;if(!j)throw Error((0,o.default)(74));let y=(0,V.useBaseUiId)(S),N=j.useState("isTriggerActive",y),M=j.useState("floatingRootContext"),A=j.useState("isOpenedByTrigger",y),H=j.useState("triggerPopupId",y),F=n.useRef(null),{registerTrigger:D,isMountedByThisTrigger:q}=(0,g.useTriggerDataForwarding)(y,F,j,{payload:p,disabled:c,openOnHover:h,closeDelay:x}),B=j.useState("openChangeReason"),K=j.useState("stickIfOpen"),U=j.useState("openMethod"),G=j.useState("focusManagerModal"),_=(0,P.useHoverReferenceInteraction)(M,{enabled:!c&&h&&("touch"!==U||B!==m.REASONS.triggerPress),mouseOnly:!0,move:!1,handleClose:(0,R.safePolygon)(),restMs:f,delay:{close:x},triggerElementRef:F,isActiveTrigger:N,isClosing:()=>"ending"===j.select("transitionStatus")}),$=(0,O.useClick)(M,{stickIfOpen:K}),W=(0,L.useOpenMethodTriggerProps)(()=>j.select("open"),e=>{j.set("openMethod",e)}),Y=j.useState("triggerProps",q),{getButtonProps:X,buttonRef:Z}=(0,k.useButton)({disabled:c,native:d}),{preFocusGuardRef:J,handlePreFocusGuardFocus:Q,handleFocusTargetFocus:ee}=(0,T.useTriggerFocusGuards)(j,F),et=(0,w.useRenderElement)("button",e,{state:{disabled:c,open:A},ref:[Z,a,D,F],props:[$.reference,_,Y,W,{[v.CLICK_TRIGGER_IDENTIFIER]:"",id:y,"aria-haspopup":"dialog","aria-expanded":A,"aria-controls":H},b,X],stateAttributesMapping:{open:e=>e&&B===m.REASONS.triggerPress?z.pressableTriggerOpenStateMapping.open(e):z.triggerOpenStateMapping.open(e)}}),en=(0,t.jsx)(n.Fragment,{children:et},y);return q&&!G?(0,t.jsxs)(n.Fragment,{children:[(0,t.jsx)(E.FocusGuard,{ref:J,onFocus:Q}),en,(0,t.jsx)(E.FocusGuard,{ref:j.context.triggerFocusTargetRef,onFocus:ee})]}):en});var H=e.i(726674);let F=n.createContext(void 0),D=n.forwardRef(function(e,n){let{keepMounted:a=!1,...i}=e;return l().useState("mounted")||a?(0,t.jsx)(F.Provider,{value:a,children:(0,t.jsx)(H.FloatingPortal,{ref:n,...i})}):null});var q=e.i(144394),B=e.i(146376);let K=n.createContext(void 0);function U(){let e=n.useContext(K);if(!e)throw Error((0,o.default)(46));return e}var G=e.i(923706),_=e.i(426),$=e.i(222640),W=e.i(789579),Y=e.i(33383);let X=n.forwardRef(function(e,a){let{render:i,className:r,style:c,anchor:d,positionMethod:u,side:p,align:h,sideOffset:g,alignOffset:f,collisionBoundary:x="clipping-ancestors",collisionPadding:S,arrowPadding:b,sticky:C,disableAnchorTracking:j=!1,collisionAvoidance:y=v.POPUP_COLLISION_AVOIDANCE,...N}=e,M=l(),k=function(){let e=n.useContext(F);if(void 0===e)throw Error((0,o.default)(45));return e}(),z=(0,s.useFloatingNodeId)(),w=M.useState("floatingRootContext"),R=M.useState("mounted"),O=M.useState("open"),P=M.useState("openChangeReason"),V=M.useState("activeTriggerElement"),E=M.useState("modal"),I=M.useState("openMethod"),T=M.useState("positionerElement"),L=M.useState("instantType"),A=M.useState("transitionStatus"),H=M.useState("adaptiveOrigin"),D=n.useRef(null),U=(0,$.useAnimationsFinished)(T),X=(0,G.useAnchorPositioning)({anchor:d,floatingRootContext:w,positionMethod:u,mounted:R,side:p,sideOffset:g,align:h,alignOffset:f,arrowPadding:b,collisionBoundary:x,collisionPadding:S,sticky:C,disableAnchorTracking:j,keepMounted:k,nodeId:z,collisionAvoidance:y,adaptiveOrigin:H}),Z=w.useState("domReferenceElement");(0,B.useIsoLayoutEffect)(()=>{let e=D.current;if(Z&&(D.current=Z),e&&Z&&Z!==e){M.set("instantType",void 0);let e=new AbortController;return U(()=>{M.set("instantType","trigger-change")},e.signal),()=>{e.abort()}}},[Z,U,M]);let J=!0===E&&P!==m.REASONS.triggerHover;(0,Y.useAnchoredPopupScrollLock)(O&&J,"touch"===I,T,V);let Q=M.useStateSetter("positionerElement"),ee={open:O,side:X.side,align:X.align,anchorHidden:X.anchorHidden,instant:L},et=(0,W.usePositioner)(e,ee,{styles:X.positionerStyles,transitionStatus:A,props:N,refs:[a,Q],hidden:!R,inert:!O});return(0,t.jsxs)(K.Provider,{value:X,children:[R&&J&&(0,t.jsx)(_.InternalBackdrop,{inert:(0,q.inertValue)(!O),cutout:V}),(0,t.jsx)(s.FloatingNode,{id:z,children:et})]})});var Z=e.i(229315),J=e.i(61487),Q=e.i(431157),ee=e.i(137584),et=e.i(673327),en=e.i(96533),ea=e.i(253984),ei=e.i(667865);let es=n.createContext(void 0),eo=n.forwardRef(function(e,a){let{render:i,className:s,style:o,initialFocus:r,finalFocus:c,...d}=e,u=l(),p=U(),h=null!=(0,en.useToolbarRootContext)(!0),{context:f,hasClosePart:x}=function(){let[e,t]=n.useState(0),a=(0,ei.useStableCallback)(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:n.useMemo(()=>({register:a}),[a]),hasClosePart:e>0}}(),v=u.useState("open"),S=u.useState("openMethod"),b=u.useState("instantType"),C=u.useState("transitionStatus"),j=u.useState("popupProps"),y=u.useState("titleElementId"),N=u.useState("descriptionElementId"),M=u.useState("modal"),k=u.useState("mounted"),R=u.useState("openChangeReason"),O=u.useState("activeTriggerElement"),P=u.useState("floatingRootContext"),V=P.useState("floatingId"),E=u.useState("disabled"),I=u.useState("openOnHover"),T=u.useState("closeDelay");(0,ee.useOpenChangeComplete)({open:v,ref:u.context.popupRef,onComplete(){v&&u.context.onOpenChangeComplete?.(!0)}}),(0,Q.useHoverFloatingInteraction)(P,{enabled:I&&!E,closeDelay:T});let L=void 0===r?(0,g.createDefaultInitialFocus)(u.context.popupRef):r,A=!1!==M&&x;u.useSyncedValue("focusManagerModal",A);let H=u.useStateSetter("popupElement"),F={open:v,side:p.side,align:p.align,instant:b,transitionStatus:C},D=(0,w.useRenderElement)("div",e,{state:F,ref:[a,u.context.popupRef,H],props:[j,{id:V,role:"dialog",...g.FOCUSABLE_POPUP_PROPS,"aria-labelledby":y,"aria-describedby":N,onKeyDown(e){h&&et.COMPOSITE_KEYS.has(e.key)&&e.stopPropagation()}},(0,ea.getDisabledMountTransitionStyles)(C),d],stateAttributesMapping:z.popupTransitionStateMapping});return(0,t.jsx)(J.FloatingFocusManager,{context:P,openInteractionType:S,modal:A,disabled:!k||R===m.REASONS.triggerHover,initialFocus:L,returnFocus:c,restoreFocus:"popup",previousFocusableElement:(0,Z.isHTMLElement)(O)?O:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:(0,t.jsx)(es.Provider,{value:f,children:D})})}),er=n.forwardRef(function(e,t){let{render:n,className:a,style:i,...s}=e,o=l().useState("open"),{arrowRef:r,side:c,align:d,arrowUncentered:u,arrowStyles:p}=U();return(0,w.useRenderElement)("div",e,{state:{open:o,side:c,align:d,uncentered:u},ref:[t,r],props:[{style:p,"aria-hidden":!0},s],stateAttributesMapping:z.popupStateMapping})}),el=n.forwardRef(function(e,t){let{render:n,className:a,style:i,...s}=e,o=l(),r=o.useState("open"),c=o.useState("mounted"),d=o.useState("transitionStatus"),u=o.useState("openChangeReason");return(0,w.useRenderElement)("div",e,{state:{open:r,transitionStatus:d},ref:t,props:[{role:"presentation",hidden:!c,style:{pointerEvents:u===m.REASONS.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},s],stateAttributesMapping:z.popupTransitionStateMapping})}),ec=n.forwardRef(function(e,t){let{render:n,className:a,style:i,...s}=e,o=l(),r=(0,V.useBaseUiId)(s.id);return o.useSyncedValueWithCleanup("titleElementId",r),(0,w.useRenderElement)("h2",e,{ref:t,props:[{id:r},s]})}),ed=n.forwardRef(function(e,t){let{render:n,className:a,style:i,...s}=e,o=l(),r=(0,V.useBaseUiId)(s.id);return o.useSyncedValueWithCleanup("descriptionElementId",r),(0,w.useRenderElement)("p",e,{ref:t,props:[{id:r},s]})}),eu=n.forwardRef(function(e,t){let a,{render:i,className:s,style:o,disabled:r=!1,nativeButton:c=!0,...d}=e,{buttonRef:u,getButtonProps:p}=(0,k.useButton)({disabled:r,focusableWhenDisabled:!1,native:c}),h=l();return a=n.useContext(es),(0,B.useIsoLayoutEffect)(()=>a?.register(),[a]),(0,w.useRenderElement)("button",e,{ref:[t,u],props:[{onClick(e){h.setOpen(!1,(0,y.createChangeEventDetails)(m.REASONS.closePress,e.nativeEvent))}},d,p]})});var ep=e.i(818390);let em=n.forwardRef(function(e,t){let{render:n,className:a,style:i,children:s,...o}=e,r=l(),{side:c}=U(),d=r.useState("instantType"),{children:u,state:p}=(0,ep.usePopupViewport)({store:r,side:c,children:s}),m={activationDirection:p.activationDirection,transitioning:p.transitioning,instant:d};return(0,w.useRenderElement)("div",e,{state:m,ref:t,props:[o,{children:u}],stateAttributesMapping:ep.popupViewportStateMapping})});var eh=e.i(564170);class eg extends eh.BasePopupHandle{constructor(){super(function(){let e=new x.PopupTriggerMap;return Object.assign(new h.NullStore(Object.freeze(C(void 0,e)),Object.freeze(j(e)),S),{setOpen:p.NOOP})}(),"Popover")}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}e.s(["Arrow",0,er,"Backdrop",0,el,"Close",0,eu,"Description",0,ed,"Handle",0,eg,"Popup",0,eo,"Portal",0,D,"Positioner",0,X,"Root",0,function(e){return l(!0)?(0,t.jsx)(N,{props:e}):(0,t.jsx)(s.FloatingTree,{children:(0,t.jsx)(N,{props:e})})},"Title",0,ec,"Trigger",0,A,"Viewport",0,em,"createHandle",0,function(){return new eg}],466914);var ef=e.i(466914),ef=ef,ex=e.i(647163);e.s(["Popover",0,function({...e}){return(0,t.jsx)(ef.Root,{"data-slot":"popover",...e})},"PopoverContent",0,function({className:e,align:n="center",alignOffset:a=0,side:i="bottom",sideOffset:s=4,...o}){return(0,t.jsx)(ef.Portal,{children:(0,t.jsx)(ef.Positioner,{align:n,alignOffset:a,side:i,sideOffset:s,className:"isolate z-50",children:(0,t.jsx)(ef.Popup,{"data-slot":"popover-content",className:(0,ex.cn)("z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...o})})})},"PopoverTrigger",0,function({...e}){return(0,t.jsx)(ef.Trigger,{"data-slot":"popover-trigger",...e})}],59377)},412294,e=>{"use strict";var t=e.i(843476),n=e.i(271645),a=e.i(167881),i=e.i(6799),s=e.i(95187);let o=(0,s.createServerReference)("7fe40fd70948ac77766b67523adf9b7fb68465a297",s.callServer,void 0,s.findSourceMapURL,"startChatGptSignInAction");var r=e.i(609856);e.s(["ChatGptSignIn",0,function({variant:e}){let[s,l]=(0,n.useState)(!1),c=(0,n.useRef)(null),d=()=>{c.current&&clearInterval(c.current),c.current=null};(0,n.useEffect)(()=>d,[]);let[u,p]=(0,r.useServerAction)(o,{onOk:e=>{let t=window.open(e,"thursday-chatgpt","popup,width=520,height=720");if(!t)return void i.toast.add({type:"error",title:"The sign-in window was blocked",description:"Allow pop-ups for this page, then try again"});l(!0),d();let n=Date.now()+6e5;c.current=setInterval(()=>{!t.closed&&Date.now()<n||(d(),l(!1))},700)}});return(0,t.jsx)(a.Button,{variant:e,loading:p||s,onClick:()=>u(),children:"Sign in with ChatGPT"})}],412294)},146538,e=>{"use strict";var t=e.i(843476),n=e.i(689664),a=e.i(563707),i=e.i(152886),s=e.i(758925),o=e.i(271645),r=e.i(798120),l=e.i(167881),c=e.i(23750),d=e.i(59377),u=e.i(690191),p=e.i(609856),m=e.i(283653),h=e.i(647163),g=e.i(265402),f=e.i(412294),x=e.i(611568),v=e.i(566595),S=e.i(7227),b=e.i(630374),C=e.i(421429),j=e.i(968978);let y={anthropic:"anthropic",openai:"openai",google:"google",spacexai:"xai",mistral:"mistral",deepseek:"deepseek",cohere:"cohere"},N={alibaba:[{d:"M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z"}],amazon:[{d:"M13.05 15.513h3.08c.214 0 .389.177.389.394v1.82a1.704 1.704 0 011.296 1.661c0 .943-.755 1.708-1.685 1.708-.931 0-1.686-.765-1.686-1.708 0-.807.554-1.484 1.297-1.662v-1.425h-2.69v4.663a.395.395 0 01-.188.338l-2.69 1.641a.385.385 0 01-.405-.002l-4.926-3.086a.395.395 0 01-.185-.336V16.3L2.196 14.87A.395.395 0 012 14.555L2 14.528V9.406c0-.14.073-.27.192-.34l2.465-1.462V4.448c0-.129.062-.249.165-.322l.021-.014L9.77 1.058a.385.385 0 01.407 0l2.69 1.675a.395.395 0 01.185.336V7.6h3.856V5.683a1.704 1.704 0 01-1.296-1.662c0-.943.755-1.708 1.685-1.708.931 0 1.685.765 1.685 1.708 0 .807-.553 1.484-1.296 1.662v2.311a.391.391 0 01-.389.394h-4.245v1.806h6.624a1.69 1.69 0 011.64-1.313c.93 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708a1.69 1.69 0 01-1.64-1.314H13.05v1.937h4.953l.915 1.18a1.66 1.66 0 01.84-.227c.931 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708-.93 0-1.685-.765-1.685-1.708 0-.346.102-.668.276-.937l-.724-.935H13.05v1.806zM9.973 1.856L7.93 3.122V6.09h-.778V3.604L5.435 4.669v2.945l2.11 1.36L9.712 7.61V5.334h.778V7.83c0 .136-.07.263-.184.335L7.963 9.638v2.081l1.422 1.009-.446.646-1.406-.998-1.53 1.005-.423-.66 1.605-1.055v-1.99L5.038 8.29l-2.26 1.34v1.676l1.972-1.189.398.677-2.37 1.429V14.3l2.166 1.258 2.27-1.368.397.677-2.176 1.311V19.3l1.876 1.175 2.365-1.426.398.678-2.017 1.216 1.918 1.201 2.298-1.403v-5.78l-4.758 2.893-.4-.675 5.158-3.136V3.289L9.972 1.856zM16.13 18.47a.913.913 0 00-.908.92c0 .507.406.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zm3.63-3.81a.913.913 0 00-.908.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92zm1.555-4.99a.913.913 0 00-.908.92c0 .507.407.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zM17.296 3.1a.913.913 0 00-.907.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92z"}],"arcee-ai":[{d:"M13.236 2.377L2.751 20.493H0L11.863 0l1.373 2.377zm3.554 6.156l-9.606 11.96H4.13L15.511 6.32l1.279 2.212zm6.908 11.96H14.05l8.406-2.151 1.242 2.15zm-3.42-5.922l-7.843 5.92H8.482l10.597-7.997 1.2 2.077z"}],bfl:[{d:"M0 20.683L12.01 2.5 24 20.683h-2.233L12.009 5.878 3.471 18.806h12.122l1.239 1.877H0z"},{d:"M8.069 16.724l2.073-3.115 2.074 3.115H8.069zM18.24 20.683l-5.668-8.707h2.177l5.686 8.707h-2.196zM19.74 11.676l2.13-3.19 2.13 3.19h-4.26z"}],bytedance:[{d:"M14.944 18.587l-1.704-.445V10.01l1.824-.462c1-.254 1.84-.461 1.88-.453.032 0 .056 2.235.056 4.972v4.973l-.176-.008c-.104 0-.952-.207-1.88-.446z"},{d:"M7 16.542c0-2.736.024-4.98.064-4.98.032-.008.872.2 1.88.454l1.816.461-.016 4.05-.024 4.049-1.632.422c-.896.23-1.736.445-1.856.469L7 21.523v-4.98z"},{d:"M19.24 12.477c0-9.03.008-9.515.144-9.475.072.024.784.207 1.576.406.792.207 1.576.405 1.744.445l.296.08-.016 8.56-.024 8.568-1.624.414c-.888.23-1.728.437-1.856.47l-.24.055v-9.523z"},{d:"M1 12.509c0-4.678.024-8.505.064-8.505.032 0 .872.207 1.872.454l1.824.461v7.582c0 4.16-.016 7.574-.032 7.574-.024 0-.872.215-1.88.47L1 21.013v-8.505z"}],"fish-audio":[{d:"M23.12 12.13v.62c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-.62c0-.24-.2-.44-.44-.44-.25 0-.44.2-.44.44m-1.77.37v1.74c0 .24.2.44.44.44.25 0 .44-.2.44-.44V12.5c0-.24-.19-.44-.44-.44-.24 0-.44.2-.44.44m-1.76.43v1.99q0 .09.03.17.04.08.1.14.07.07.15.1t.17.03c.24 0 .44-.19.44-.44v-1.99c0-.25-.2-.44-.44-.44q-.09 0-.17.03t-.15.1q-.06.06-.1.14-.03.08-.03.17m-1.76.35v1.97c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-1.97c0-.24-.2-.44-.44-.44-.25 0-.44.2-.44.44m-1.77.32v1.65c0 .25.2.45.44.45s.44-.2.44-.45V13.6c0-.25-.2-.45-.44-.45s-.44.2-.44.45m-1.76 1.26v.3q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3v-.3q-.01-.17-.14-.3-.13-.11-.31-.12-.17.01-.3.12-.13.13-.14.3M0 9.38v.19c0 .24.2.44.44.44.25 0 .44-.2.44-.44v-.19c0-.25-.19-.44-.44-.44-.24 0-.44.19-.44.44m1.82.15v.81c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-.81q0-.18-.13-.31t-.31-.13-.31.13-.13.31m1.81-.24v3.39q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3V9.29q-.01-.17-.14-.3-.13-.11-.31-.12-.17.01-.3.12-.13.13-.14.3m1.83-.35v.22c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-.22q0-.18-.13-.31T5.9 8.5t-.31.13-.13.31m0 2.94v2.34c0 .25.19.44.44.44.24 0 .44-.19.44-.44v-2.34c0-.24-.2-.44-.44-.44-.25 0-.44.2-.44.44m15.89-3.32V11c0 .25.2.44.44.44.25 0 .44-.19.44-.44V8.56c0-.24-.19-.44-.44-.44-.24 0-.44.2-.44.44m-1.76-.39v3.28q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3V8.17c0-.25-.2-.44-.44-.44q-.09 0-.17.03t-.15.1q-.06.06-.1.14-.03.08-.03.17M17.83 8v3.9c0 .24.19.44.44.44.24 0 .44-.2.44-.44V8c0-.25-.2-.44-.44-.44-.25 0-.44.19-.44.44m-1.77.11v3.96c0 .25.2.44.44.44s.44-.19.44-.44V8.11c0-.25-.2-.44-.44-.44s-.44.19-.44.44m-1.76.27v5.03q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3V8.38c0-.25-.2-.44-.45-.44-.24 0-.44.19-.44.44m-1.8.46v5.75q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3V8.84c0-.25-.2-.44-.45-.44-.24 0-.44.19-.44.44m-1.76.76v5.52c0 .24.2.44.44.44.25 0 .44-.2.44-.44V9.6c0-.24-.19-.44-.44-.44-.24 0-.44.2-.44.44m-1.77 1.01v4.77q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3v-4.77q-.01-.17-.14-.3-.13-.11-.31-.12-.17.01-.3.12-.13.13-.14.3M23.12 9.6v1.22c0 .24.19.44.44.44.24 0 .44-.2.44-.44V9.6c0-.24-.2-.44-.44-.44-.25 0-.44.2-.44.44M7.21 11.32V16c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-4.68q0-.18-.13-.31t-.31-.13-.31.13-.13.31"}],inception:[{d:"M14.767 1H7.884L1 7.883v6.884h6.884V7.883h6.883V1zM9.234 23h6.882L23 16.116V9.233h-6.884v6.883H9.234V23z"}],klingai:[{d:"M5.493 21.234c-1.112-1.451-1.109-4.263-.081-7.459l-4.557-2.63a1.683 1.683 0 01-.85-1.304 1.505 1.505 0 01.08-.622 13.18 13.18 0 011.037-2.255c3.476-6.02 10.916-8.23 16.619-4.938.46.266.82.67 1.081 1.184.785 1.545.685 4.096-.234 6.954l4.557 2.631c.339.196.596.492.736.832a1.53 1.53 0 01.034 1.093 13.146 13.146 0 01-1.037 2.255c-3.476 6.02-10.916 8.23-16.619 4.938a2.6 2.6 0 01-.766-.68zm11.096-6.615c-2.073 3.591-5.808 5.316-8.343 3.852-1.267-.731-1.994-2.122-2.145-3.778-.095-1.035.036-2.173.4-3.32.217-.684.517-1.37.902-2.039l.008-.014c2.073-3.59 5.808-5.315 8.343-3.852.633.366 1.13.895 1.49 1.54.986 1.772.922 4.415-.285 6.914-.111.23-.232.457-.362.683l-.008.014z"}],kwaipilot:[{d:"M11.765.03C5.327.03.108 5.25.108 11.686c0 3.514 1.556 6.665 4.015 8.804L9.89 8.665h6.451L9.31 23.083c.807.173 1.63.26 2.455.26 6.438 0 11.657-5.22 11.657-11.658S18.202.028 11.765.028V.03z"}],meta:[{d:"M6.897 4c1.915 0 3.516.932 5.43 3.376l.282-.373c.19-.246.383-.484.58-.71l.313-.35C14.588 4.788 15.792 4 17.225 4c1.273 0 2.469.557 3.491 1.516l.218.213c1.73 1.765 2.917 4.71 3.053 8.026l.011.392.002.25c0 1.501-.28 2.759-.818 3.7l-.14.23-.108.153c-.301.42-.664.758-1.086 1.009l-.265.142-.087.04a3.493 3.493 0 01-.302.118 4.117 4.117 0 01-1.33.208c-.524 0-.996-.067-1.438-.215-.614-.204-1.163-.56-1.726-1.116l-.227-.235c-.753-.812-1.534-1.976-2.493-3.586l-1.43-2.41-.544-.895-1.766 3.13-.343.592C7.597 19.156 6.227 20 4.356 20c-1.21 0-2.205-.42-2.936-1.182l-.168-.184c-.484-.573-.837-1.311-1.043-2.189l-.067-.32a8.69 8.69 0 01-.136-1.288L0 14.468c.002-.745.06-1.49.174-2.23l.1-.573c.298-1.53.828-2.958 1.536-4.157l.209-.34c1.177-1.83 2.789-3.053 4.615-3.16L6.897 4zm-.033 2.615l-.201.01c-.83.083-1.606.673-2.252 1.577l-.138.199-.01.018c-.67 1.017-1.185 2.378-1.456 3.845l-.004.022a12.591 12.591 0 00-.207 2.254l.002.188c.004.18.017.36.04.54l.043.291c.092.503.257.908.486 1.208l.117.137c.303.323.698.492 1.17.492 1.1 0 1.796-.676 3.696-3.641l2.175-3.4.454-.701-.139-.198C9.11 7.3 8.084 6.616 6.864 6.616zm10.196-.552l-.176.007c-.635.048-1.223.359-1.82.933l-.196.198c-.439.462-.887 1.064-1.367 1.807l.266.398c.18.274.362.56.55.858l.293.475 1.396 2.335.695 1.114c.583.926 1.03 1.6 1.408 2.082l.213.262c.282.326.529.54.777.673l.102.05c.227.1.457.138.718.138.176.002.35-.023.518-.073.338-.104.61-.32.813-.637l.095-.163.077-.162c.194-.459.29-1.06.29-1.785l-.006-.449c-.08-2.871-.938-5.372-2.2-6.798l-.176-.189c-.67-.683-1.444-1.074-2.27-1.074z"}],minimax:[{d:"M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z"}],moonshotai:[{d:"M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"}],morph:[{d:"M7.941 2c.23 0 .452.073.638.21.186.136.325.328.397.55l.593 1.814c.073.221.212.413.397.55.186.136.409.21.638.21h2.791c.23 0 .452-.074.638-.21a1.11 1.11 0 00.397-.55l.594-1.815a1.11 1.11 0 01.397-.55c.185-.136.408-.209.637-.209h1.7c.23 0 .453.073.639.21.185.136.324.328.397.55l.652 1.994c.118.361.41.635.77.728l2.957.752c.236.06.446.199.596.394.15.195.23.436.231.684v9.376c0 .248-.081.488-.231.684a1.09 1.09 0 01-.595.394l-2.957.752a1.086 1.086 0 00-.477.263 1.114 1.114 0 00-.293.465l-.653 1.994a1.11 1.11 0 01-.396.55c-.186.136-.41.21-.638.21h-1.702c-.229 0-.452-.073-.637-.21a1.11 1.11 0 01-.397-.55l-.364-1.11a1.131 1.131 0 01.15-1.002 1.074 1.074 0 01.885-.462h2.85c.29 0 .567-.116.772-.325.204-.208.32-.49.32-.785V6.444c0-.294-.116-.577-.32-.785a1.08 1.08 0 00-.771-.326h-3.273c-.29 0-.567.117-.772.326-.204.208-.32.49-.32.785v7.778c0 .295-.114.578-.319.786a1.08 1.08 0 01-.771.325h-2.182a1.08 1.08 0 01-.771-.325 1.122 1.122 0 01-.32-.786V6.444c0-.294-.115-.577-.32-.785a1.081 1.081 0 00-.77-.326H5.454c-.29 0-.567.117-.772.326-.204.208-.32.49-.32.785v11.112c0 .294.116.577.32.785.205.209.482.326.772.326h2.85a1.075 1.075 0 01.885.461 1.122 1.122 0 01.15 1.001l-.364 1.112a1.11 1.11 0 01-.397.55c-.185.136-.408.209-.637.209H6.24c-.229 0-.452-.073-.638-.21a1.11 1.11 0 01-.397-.55l-.652-1.994a1.114 1.114 0 00-.294-.465 1.086 1.086 0 00-.477-.263l-2.956-.752a1.09 1.09 0 01-.595-.394A1.124 1.124 0 010 16.688V7.312c0-.248.081-.489.231-.684.15-.195.36-.334.595-.394l2.957-.753c.178-.045.342-.136.477-.263.134-.127.235-.287.293-.464l.653-1.995a1.11 1.11 0 01.397-.55C5.788 2.075 6.01 2 6.24 2h1.701z"}],nvidia:[{d:"M10.212 8.976V7.62c.127-.01.256-.017.388-.021 3.596-.117 5.957 3.184 5.957 3.184s-2.548 3.647-5.282 3.647a3.227 3.227 0 01-1.063-.175v-4.109c1.4.174 1.681.812 2.523 2.258l1.873-1.627a4.905 4.905 0 00-3.67-1.846 6.594 6.594 0 00-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024 5.002-.174 8.261 4.226 8.261 4.226s-3.743 4.69-7.643 4.69c-.338 0-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057 3.629 0 6.253-1.91 8.794-4.169.421.347 2.146 1.193 2.501 1.564-2.416 2.083-8.048 3.763-11.24 3.763-.308 0-.603-.02-.894-.048V19.5H24v-15H10.21zm0 9.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173 7.173 0 014.287-2.138v1.172h-.005a3.182 3.182 0 00-2.502 1.178s.615 2.276 2.507 2.931m-5.961-3.3c1.436-1.935 3.604-3.148 5.961-3.336V6.523C5.81 6.887 2 10.723 2 10.723s2.158 6.427 8.21 7.015v-1.166C5.77 16 4.25 10.958 4.25 10.958h-.002z"}],perplexity:[{d:"M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z"}],recraft:[{d:"M19.667 8.275c0-4.57-4.15-8.275-9.27-8.275-1.774 0-3.213 3.705-3.213 8.275 0 1.143.09 2.233.253 3.224H4.29L1 23h9.4v-6.447c5.117 0 9.266-3.707 9.266-8.275l.001-.002zm-9.27-6.76c.93 0 1.682 3.028 1.682 6.76 0 3.733-.752 6.76-1.681 6.76-.93 0-1.681-3.027-1.681-6.76 0-3.732.752-6.76 1.68-6.76z"},{d:"M19.848 16.552h-9.44L14.028 23h9.438l-3.618-6.448z"}],stepfun:[{d:"M12 0C5.372 0 0 5.372 0 12s5.372 12 12 12 12-5.372 12-12S18.628 0 12 0zM8.762 19.614H4.376v-4.386h4.386v4.386zm5.423 0H9.798v-4.386h4.387v4.386zm0-5.42H9.798V9.81h4.387v4.386zm0-5.418H9.798V4.39h4.387v4.386zm5.422-.004h-4.386V4.386h4.386v4.386z"}],tencent:[{d:"M12 0c6.627 0 12 5.373 12 12s-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0zm1.652 1.123l-.01-.001c.533.097 1.023.233 1.41.404 6.084 2.683 7.396 9.214 1.601 14.338a3.781 3.781 0 01-5.337-.328 3.654 3.654 0 01-.884-3.044c-1.934.6-3.295 2.305-3.524 4.45-.204 1.912.324 4.044 2.056 5.634l.245.067C10.1 22.876 11.036 23 12 23c6.075 0 11-4.925 11-11 0-5.513-4.056-10.08-9.348-10.877zM2.748 6.21c-.178.269-.348.536-.51.803l-.235.394.078-.167A10.957 10.957 0 001 12c0 4.919 3.228 9.083 7.682 10.49l.214.065C3.523 18.528 2.84 14.149 6.47 8.68A2.234 2.234 0 102.748 6.21zm10.157-5.172c4.408 1.33 3.61 5.41 2.447 6.924-.86 1.117-2.922 1.46-3.708 2.238-.666.657-1.077 1.462-1.212 2.291A5.303 5.303 0 0112 12.258a5.672 5.672 0 001.404-11.169 10.51 10.51 0 00-.5-.052z"}],voyage:[{d:"M5.407 0v.066a.974.974 0 00-.048.245c-.011.11-.016.208-.016.295 0 .339.043.715.128 1.13.097.405.274.912.531 1.524l7.125 16.366L20.011 3.39c.161-.404.333-.846.515-1.327.182-.48.273-.966.273-1.458a1.406 1.406 0 00-.096-.54V0H24v.066c-.204.207-.45.578-.74 1.114-.29.535-.606 1.195-.949 1.982L13.095 24h-1.287L3.075 3.965c-.204-.47-.418-.923-.644-1.36-.214-.437-.418-.83-.61-1.18-.194-.36-.365-.66-.515-.9A5.666 5.666 0 001 .064V0h4.407z"}],xiaomi:[{d:"M12 0C8.016 0 4.756.255 2.493 2.516.23 4.776 0 8.033 0 12.012c0 3.98.23 7.235 2.494 9.497C4.757 23.77 8.017 24 12 24c3.983 0 7.243-.23 9.506-2.491C23.77 19.247 24 15.99 24 12.012c0-3.984-.233-7.243-2.502-9.504C19.234.252 15.978 0 12 0zM4.906 7.405h5.624c1.47 0 3.007.068 3.764.827.746.746.827 2.233.83 3.676v4.54a.15.15 0 0 1-.152.147h-1.947a.15.15 0 0 1-.152-.148V11.83c-.002-.806-.048-1.634-.464-2.051-.358-.36-1.026-.441-1.72-.458H7.158a.15.15 0 0 0-.151.147v6.98a.15.15 0 0 1-.152.148H4.906a.15.15 0 0 1-.15-.148V7.554a.15.15 0 0 1 .15-.149zm12.131 0h1.949a.15.15 0 0 1 .15.15v8.892a.15.15 0 0 1-.15.148h-1.949a.15.15 0 0 1-.151-.148V7.554a.15.15 0 0 1 .151-.149zM8.92 10.948h2.046c.083 0 .15.066.15.147v5.352a.15.15 0 0 1-.15.148H8.92a.15.15 0 0 1-.152-.148v-5.352a.15.15 0 0 1 .152-.147Z"}],zai:[{d:"M12.105 2L9.927 4.953H.653L2.83 2h9.276zM23.254 19.048L21.078 22h-9.242l2.174-2.952h9.244zM24 2L9.264 22H0L14.736 2H24z"}]};function M({owner:e,className:n}){let a=y[e];if(a)return(0,t.jsx)(j.ProviderIcon,{provider:a,className:n});let i=N[e];return i?(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:n,"aria-hidden":"true",children:i.map(e=>(0,t.jsx)("path",{d:e.d,opacity:e.opacity},e.d))}):null}function k({models:e,kind:n,value:a,loading:i,onPick:s}){let[r,d]=(0,o.useState)(!1),[u,p]=(0,o.useState)(""),[m,f]=(0,o.useState)("cheap"),[j,y]=(0,o.useState)(a),N=e.filter(e=>e.type===(n??g.GATEWAY_TEXT)),M=n?N:N.filter(e=>e.tags.includes(g.GATEWAY_TOOL_USE)),O=u.trim().toLowerCase(),V=(O?M.filter(e=>`${e.id} ${e.label}`.toLowerCase().includes(O)):M).slice().sort(w[m].compare);return(0,t.jsxs)(b.Dialog,{open:r,onOpenChange:e=>{d(e),e?y(a):p("")},children:[(0,t.jsxs)(b.DialogTrigger,{render:(0,t.jsx)("button",{type:"button","aria-label":"Model",className:(0,h.cn)(c.inputClassName,"relative flex items-center pr-8 text-left font-mono text-sm")}),children:[(0,t.jsx)("span",{className:(0,h.cn)("min-w-0 flex-1 truncate",!a&&"font-sans text-muted-foreground"),children:a||"Pick a model"}),(0,t.jsx)("span",{className:"absolute inset-y-0 right-0 flex w-8 items-center justify-center text-muted-foreground",children:i&&0===M.length?(0,t.jsx)(x.LoaderCircle,{className:"size-3.5 animate-spin"}):(0,t.jsx)(v.Search,{className:"size-3.5"})})]}),(0,t.jsx)(b.DialogContent,{className:"h-[min(40rem,calc(100vh-3rem))] gap-0 overflow-hidden p-0 sm:max-w-2xl",children:(0,t.jsxs)("div",{className:"flex h-full min-h-0 min-w-0 flex-col",children:[(0,t.jsxs)("div",{className:"shrink-0 space-y-1 px-6 pt-5 pb-4",children:[(0,t.jsxs)(b.DialogTitle,{className:"flex items-center gap-2.5 text-xl font-semibold",children:[(0,t.jsx)(S.VercelIcon,{className:"size-3.5"}),n?z[n]:"Text"," models"]}),(0,t.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:O?`${V.length} matching “${u.trim()}”`:n?`${M.length} on the gateway`:`${M.length} of ${N.length} on the gateway can call tools`})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-3 border-t border-border/60 px-6 py-3",children:[(0,t.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,t.jsx)(v.Search,{className:"pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(c.Input,{autoFocus:!0,"aria-label":"Search models",placeholder:"name, id or provider",spellCheck:!1,value:u,onChange:e=>p(e.target.value),className:"h-8 pl-8 font-mono text-xs"})]}),(0,t.jsx)(C.Segmented,{"aria-label":"Sort",options:R,value:m,onChange:f})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-4 px-6 pb-1.5 font-mono text-[10px] tracking-wide text-muted-foreground/60",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1",children:"model"}),(0,t.jsx)("span",{className:"w-28 text-right",children:"per 1M in / out"})]}),(0,t.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border/60",children:[V.map(e=>(0,t.jsx)(P,{model:e,picked:e.id===j,onPick:()=>y(e.id)},e.id)),0===V.length&&(0,t.jsxs)("div",{className:"flex flex-col items-start gap-2.5 p-10",children:[(0,t.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:O?`Nothing matches “${u.trim()}”.`:"Nothing on the shelf — search for an id."}),O&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)(l.Button,{size:"sm",onClick:()=>y(u.trim()),children:["Use “",u.trim(),"” as the id"]}),(0,t.jsx)(l.Button,{variant:"outline",size:"sm",onClick:()=>p(""),children:"Clear search"})]})]})]}),(0,t.jsxs)("div",{className:"flex h-14 shrink-0 items-center gap-3 border-t border-border/60 px-6",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:j||"Nothing picked — the field keeps what it has"}),(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>d(!1),children:"Cancel"}),(0,t.jsx)(l.Button,{disabled:!j,onClick:()=>{s(j),d(!1)},children:"Use this model"})]})]})})]})}let z={image:"Image",video:"Video",speech:"Speech",transcription:"Transcription"},w={cheap:{label:"$↑",title:"Cheapest first",compare:(e,t)=>(e.price.in??1/0)-(t.price.in??1/0)},dear:{label:"$↓",title:"Dearest first",compare:(e,t)=>(t.price.in??-1)-(e.price.in??-1)},name:{label:"a–z",title:"By name",compare:(e,t)=>e.label.localeCompare(t.label)}},R=Object.keys(w).map(e=>({value:e,label:w[e].label,title:w[e].title})),O=e=>e>=1?e.toFixed(2):String(Number(e.toFixed(4)));function P({model:e,picked:a,onPick:i}){let{price:s}=e,o=null!==s.in||null!==s.out;return(0,t.jsxs)("button",{type:"button",onClick:i,className:(0,h.cn)("flex w-full items-center gap-4 border-b border-border/60 px-6 py-2.5 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",a?"bg-muted/40":"hover:bg-muted/50"),children:[(0,t.jsx)("span",{className:"grid size-[18px] shrink-0 place-items-center",children:(0,t.jsx)(M,{owner:e.owner,className:"size-[15px]"})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{className:(0,h.cn)("truncate text-[13px]",a&&"font-medium"),children:e.label}),a&&(0,t.jsx)(n.Check,{className:"size-3.5 shrink-0"}),e.retiring&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:"retiring"})]}),(0,t.jsx)("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:e.id})]}),(0,t.jsxs)("span",{className:"flex w-28 shrink-0 flex-col items-end",children:[(0,t.jsx)("span",{className:(0,h.cn)("font-mono text-xs",o||s.free?"text-foreground":"text-muted-foreground"),children:s.free?"free":null===s.in&&null===s.out?s.note??"—":`${null===s.in?"—":O(s.in)} / ${null===s.out?"—":O(s.out)}`}),o&&s.note&&(0,t.jsx)("span",{className:"font-mono text-[9px] text-muted-foreground/70",children:s.note})]})]})}function V({tier:e}){return(0,t.jsx)("span",{className:"shrink-0 rounded-full px-1.5 font-mono text-[9.5px] leading-4 font-normal text-muted-foreground ring-1 ring-border ring-inset",children:e})}function E({provider:e,onSaved:n}){let[a,i]=(0,o.useState)(""),[s,d]=(0,p.useServerAction)(u.setConfigAction,{okMessage:`${e.label} key saved`,onOk:()=>{(0,m.revalidate)(r.queryKey.llmModel),(0,m.revalidate)(r.queryKey.config),n()}});return e.signIn?(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("p",{className:"px-1 font-mono text-[11px] text-muted-foreground",children:"Runs on your plan once you sign in"}),(0,t.jsx)(f.ChatGptSignIn,{variant:"outline"})]}):(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(c.Input,{value:a,onChange:e=>i(e.target.value),placeholder:e.apiKeyName,spellCheck:!1,type:"password"}),(0,t.jsx)(l.Button,{variant:"outline",loading:d,disabled:a.trim().length<8,onClick:()=>s(e.apiKeyName,a),children:"Save key"})]})}e.s(["ModelPicker",0,function({provider:e,model:u,kind:p,unset:f,onChange:x,onUnset:v,compact:S=!1}){let{data:b=[],mutate:C}=(0,m.useServerRoute)(r.queryKey.llmModel),y=p?b.filter(e=>(0,g.canMakeKind)(e.id,p)):b,N=y.find(t=>t.id===e),[M,z]=(0,o.useState)(!1),[w,R]=(0,o.useState)(null),[O,P]=(0,o.useState)(""),I=y.find(t=>t.id===(w??e))??y[0],T=I?.id==="vercel-ai-gateway",L=(0,m.useServerRoute)(M&&T&&r.queryKey.modelCatalog),A=e=>p&&e?g.MEDIA_MODEL_PROVIDERS[e.id]?.models[p]??[]:e?.suggestModels??[],H=A(N).find(e=>e.id===u),F=e=>{I&&e.trim()&&(x({provider:I.id,model:e.trim()}),P(""),z(!1))};return(0,t.jsxs)(d.Popover,{open:M,onOpenChange:e=>{z(e),e||R(null)},children:[(0,t.jsxs)(d.PopoverTrigger,{render:S?(0,t.jsx)("button",{type:"button",className:"inline-flex h-5 max-w-64 items-center gap-1.5 rounded-full px-2 text-foreground/80 ring-1 ring-border outline-none ring-inset transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50"}):(0,t.jsx)(l.Button,{variant:"outline",className:"w-full min-w-0 justify-start gap-2 font-normal"}),children:[N?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.ProviderIcon,{provider:N.id,className:(0,h.cn)("shrink-0",S?"size-3":"size-4")}),!S&&(0,t.jsxs)("span",{className:"min-w-0 max-w-fit grow basis-0 truncate text-muted-foreground",children:[N.label,(0,t.jsx)("span",{className:"ml-2 text-muted-foreground/40",children:"·"})]}),(0,t.jsx)("span",{className:(0,h.cn)("truncate",!S&&"font-medium"),children:H?.label??(u||"Pick a model")})]}):(0,t.jsx)("span",{className:"truncate text-muted-foreground",children:f??(p?"Not picked":"App default")}),(0,t.jsx)(a.ChevronsUpDown,{className:(0,h.cn)("ml-auto shrink-0 text-muted-foreground",S?"size-2.5":"size-3.5")})]}),(0,t.jsxs)(d.PopoverContent,{align:"start",className:"flex w-[min(34rem,calc(100vw-2rem))] flex-row gap-0 overflow-hidden rounded-2xl p-0",children:[(0,t.jsxs)("div",{className:"flex max-h-80 w-48 shrink-0 flex-col gap-px overflow-y-auto border-r border-border/60 bg-muted/40 p-1.5",children:[v&&(0,t.jsxs)("button",{type:"button",onClick:()=>{v(),z(!1)},className:(0,h.cn)("mb-1 flex h-8.5 shrink-0 items-center gap-2 rounded-lg px-2 text-left text-[13px] outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",N?"hover:bg-muted/60":"bg-muted font-medium"),children:[(0,t.jsx)(i.CircleDashed,{className:"size-4 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:f??(p?"Not picked":"App default")}),!N&&(0,t.jsx)(n.Check,{className:"size-3.5 shrink-0"})]}),y.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>R(e.id),className:(0,h.cn)("flex h-8.5 shrink-0 items-center gap-2 rounded-lg px-2 text-left text-[13px] outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",e.id===I?.id?"bg-muted font-medium":"hover:bg-muted/60",!e.hasKey&&"text-muted-foreground"),children:[(0,t.jsx)(j.ProviderIcon,{provider:e.id,className:"size-4 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.label}),!e.hasKey&&(0,t.jsx)(s.KeyRound,{className:"size-3 shrink-0"})]},e.id))]}),(0,t.jsx)("div",{className:"flex max-h-80 min-w-0 flex-1 flex-col gap-px overflow-y-auto p-1.5",children:I?I.hasKey?T&&!L.error?(0,t.jsxs)("div",{className:"space-y-2 p-2",children:[(0,t.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"Every model the gateway carries, with what each costs."}),(0,t.jsx)(k,{models:L.data??[],kind:p,value:I.id===e?u:"",loading:L.isLoading,onPick:F})]}):(0,t.jsxs)(t.Fragment,{children:[A(I).map(a=>{let i=I.id===e&&a.id===u;return(0,t.jsxs)("button",{type:"button",onClick:()=>F(a.id),className:(0,h.cn)("flex shrink-0 items-center gap-2 rounded-lg px-2.5 py-1.5 text-left outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",i?"bg-muted":"hover:bg-muted/60"),children:[(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-[13px] font-medium",children:[(0,t.jsx)("span",{className:"truncate",children:a.label}),(0,t.jsx)(V,{tier:a.tier})]}),(0,t.jsx)("span",{className:"block truncate font-mono text-[10.5px] text-muted-foreground",children:a.id})]}),i&&(0,t.jsx)(n.Check,{className:"size-3.5 shrink-0"})]},a.id)}),(0,t.jsx)("form",{onSubmit:e=>{e.preventDefault(),F(O)},className:"mt-1 px-1 pb-1",children:(0,t.jsx)(c.Input,{value:O,onChange:e=>P(e.target.value),spellCheck:!1,"aria-label":"Model id",placeholder:L.error?"Could not read the catalog — type an id":"or type a model id",className:"h-8 font-mono text-xs"})})]}):(0,t.jsxs)("div",{className:"space-y-2 p-2",children:[(0,t.jsxs)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:[I.label," has no key yet."]}),(0,t.jsx)(E,{provider:I,onSaved:()=>C()})]}):null})]})]})}],146538)},563707,152886,e=>{"use strict";var t=e.i(456420);let n={name:"chevrons-up-down",size:24,node:[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]};n.node;let a=(0,t.default)(n);e.s(["ChevronsUpDown",0,a],563707);let i={name:"circle-dashed",size:24,node:[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]};i.node;let s=(0,t.default)(i);e.s(["CircleDashed",0,s],152886)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,616816,e=>{"use strict";var t=e.i(843476),r=e.i(689664),n=e.i(263676),a=e.i(271645),l=e.i(798120),i=e.i(167881),s=e.i(23750),o=e.i(968978),u=e.i(149666),c=e.i(609856),h=e.i(283653),f=e.i(647163),d=e.i(799623),m=e.i(992112);function g({provider:e,saved:r,autoFocus:n,dense:a,plain:l,value:i,ready:s,saving:u,onValue:c,onSubmit:h}){return(0,t.jsxs)("div",{className:"space-y-2",children:[!l&&(0,t.jsxs)("span",{className:"flex items-center gap-2 px-0.5 text-muted-foreground",children:[(0,t.jsx)(o.ProviderIcon,{provider:e.id,className:"size-4 shrink-0"}),(0,t.jsx)("span",{className:(0,f.cn)("font-mono",a?"text-[11px]":"text-[12.5px]"),children:e.label})]}),(0,t.jsx)(p,{provider:e,saved:r,autoFocus:n,dense:a,mark:l,value:i,ready:s,saving:u,onValue:c,onSubmit:h})]})}function p({provider:e,saved:n,autoFocus:a,dense:l,mark:u,value:c,ready:h,saving:d,onValue:m,onSubmit:g}){let y=c.trim().startsWith("xai-")||c.trim().startsWith("sk-ant-");return(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),g()},className:(0,f.cn)("flex items-center gap-3 rounded-2xl border bg-muted/40 px-4 transition-colors",l?"h-11 rounded-xl px-3":"h-14",n||h?"border-foreground bg-transparent":"border-border"),children:[u&&(0,t.jsx)(o.ProviderIcon,{provider:e.id,className:"size-4 shrink-0 text-muted-foreground"}),(0,t.jsx)(s.Input,{autoFocus:a,type:"password","aria-label":"OpenAI API key",autoComplete:"off",value:c,spellCheck:!1,placeholder:n?"Replace it":"sk-…",onChange:e=>m(e.target.value),className:(0,f.cn)("min-w-0 flex-1 border-0 bg-transparent px-0 font-mono shadow-none focus-visible:ring-0 dark:bg-transparent",l?"h-7 text-[13px]":"h-9 text-[15px]")}),c?(0,t.jsx)(i.Button,{type:"submit",size:"sm",variant:y?"outline":"default",loading:d,disabled:!h,className:(0,f.cn)("shrink-0",l?"h-7 px-3":"h-9 px-4"),children:y?`Not ${e.label}?`:"Save"}):n&&(0,t.jsx)("span",{className:(0,f.cn)("grid shrink-0 animate-in place-items-center rounded-full bg-foreground text-background zoom-in-50 duration-300",l?"size-5":"size-7"),children:(0,t.jsx)(r.Check,{className:l?"size-3":"size-4"})})]})}e.s(["KEY_MIN",0,8,"KeyInput",0,p,"VoiceKeys",0,function({ref:e,autoFocus:r,dense:s=!1,plain:o=!1,onCancel:p,onSaved:y,className:M}){let{data:O}=(0,h.useServerRoute)(l.queryKey.config),[x,A]=(0,a.useState)({}),[E,S]=(0,a.useState)(null),[b,_]=(0,a.useState)(null),[w]=(0,c.useServerAction)(d.setConfigAction,{errorMessage:!1,onError:e=>_(e??"That key was not saved."),onOk:()=>{(0,h.revalidate)(l.queryKey.config),(0,h.revalidate)(l.queryKey.llmModel)}}),N=e=>(x[e]?.trim().length??0)>=8,v=async e=>{let t=e.apiKeyName;if(!N(t)||E)return!1;_(null),S(t);try{return await w(t,x[t]),A(e=>({...e,[t]:""})),y?.(e.id),!0}catch{return!1}finally{S(null)}};return(0,a.useImperativeHandle)(e,()=>({pending:()=>N(u.LIVE_PROVIDER.apiKeyName),flush:async()=>!N(u.LIVE_PROVIDER.apiKeyName)||v(u.LIVE_PROVIDER)})),(0,t.jsxs)("div",{className:(0,f.cn)("w-full",s?"space-y-2":"space-y-4",M),children:[s&&!o&&(0,t.jsxs)("div",{className:"flex h-6 items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"px-0.5 font-mono text-[11px] text-muted-foreground",children:"Voice key"}),p&&(0,t.jsx)(i.Button,{type:"button",size:"icon",variant:"ghost","aria-label":"Not now",onClick:p,className:"-my-1 size-6",children:(0,t.jsx)(n.X,{className:"size-3.5"})})]}),(0,t.jsx)(g,{provider:u.LIVE_PROVIDER,saved:(0,m.isConfigSet)(O,u.LIVE_PROVIDER.apiKeyName),autoFocus:r,dense:s,plain:o,value:x[u.LIVE_PROVIDER.apiKeyName]??"",ready:N(u.LIVE_PROVIDER.apiKeyName),saving:E===u.LIVE_PROVIDER.apiKeyName,onValue:e=>{_(null),A(t=>({...t,[u.LIVE_PROVIDER.apiKeyName]:e}))},onSubmit:()=>void v(u.LIVE_PROVIDER)}),b&&(0,t.jsx)("p",{className:(0,f.cn)("px-0.5 leading-5 break-words",s?"text-xs":"text-center text-[13px]",f.WAITING_INK),children:b}),!o&&(0,t.jsx)("p",{className:(0,f.cn)("px-0.5 font-mono text-muted-foreground",s?"text-[11px]":"pt-1 text-center text-[12.5px]"),children:s?"Live voice and reasoning share this OpenAI API key.":"Live uses an OpenAI API key, billed separately from ChatGPT. Stored on this machine, in this app's database."})]})}])},333495,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(41533),a=e.i(218080),l=e.i(567334);let i=[235,235,235];function s(e){let t=[[],[],[],[],[]],r=0;for(let n of Array.from(e.toUpperCase())){let e=l.LETTERS[n];if(e){if(t[0].length)for(let e of t)e.push(-1);e.forEach((e,n)=>{for(let a of e)t[n].push("#"===a?r:-1)})," "!==n&&r++}}return t}let o=s("ERROR");function u(e,t,r,n,a){return e+(t-e)*Math.min(1,a/(t>e?r:n))}function c(e,t,r,n,a,l){let i=Math.floor(t/(n*l)+e[0].length/2),s=Math.floor(r/(a*l)+e.length/2);return s<0||s>=e.length?-1:e[s][i]??-1}function h(e,t,r,n){let a=e=>Math.max(1,Math.min(3,Math.floor(625.6/(e[0].length*t)),Math.floor(421.6/(e.length*r)))),l=s(n),i=3>a(l)?function(e){let t=Array.from(e.trim()),r=t.flatMap((e,t)=>" "===e?[t]:[]);if(!r.length)return null;let n=t.length/2,a=r.reduce((e,t)=>Math.abs(t-n)<Math.abs(e-n)?t:e),l=s(t.slice(0,a).join("")),i=s(t.slice(a+1).join(""));if(!l[0].length||!i[0].length)return null;let o=Math.max(-1,...l.flat())+1,u=Math.max(l[0].length,i[0].length),c=(e,t)=>{let r=Math.floor((u-e.length)/2);return[...Array(r).fill(-1),...e.map(e=>e<0?e:e+t),...Array(u-e.length-r).fill(-1)]},h=()=>Array(u).fill(-1);return[...l.map(e=>c(e,0)),h(),h(),...i.map(e=>c(e,o))]}(n):null,o=i&&a(i)>a(l)?i:l,u=a(o),h=0;for(let n of e)n.word=c(o,n.dx,n.dy,t,r,u),h=Math.max(h,n.word+1);return h}function f({className:e,mode:s="idle",charset:d=n.ASCII_FACE.charset,fontSize:m=n.ASCII_FACE.fontSize.default,density:g=n.ASCII_FACE.density.default,size:p=680,color:y=i,getSpectrum:M,word:O=null}){let x=(0,r.useRef)(null),A=(0,r.useRef)(null),E=(0,r.useRef)([]),S=(0,r.useRef)(null),b=(0,r.useRef)(d),_=(0,r.useRef)({cur:[...y],target:y}),w=(0,r.useRef)(0),N=(0,r.useRef)(M);N.current=M;let v=(0,r.useRef)({phrase:0,bob:0,bobVel:0,amp:[,,,,].fill(0),phase:Array.from({length:4},(e,t)=>2.1*t),spin:0,rings:[]}),L=(0,r.useRef)({mode:s,start:0}),R=(0,r.useRef)(performance.now()),I=(0,r.useRef)({scale:.3,lift:0,gather:0,comet:0,speech:0,err:0,word:0}),T=(0,r.useRef)(null),k=(0,r.useRef)({cw:1,ch:1});return(0,r.useEffect)(()=>{let e=x.current;if(!e)return;let t=.95*m/g,r=1.25*m/g,n=680/p,a=t*n,i=r*n,s=Math.max(1,Math.floor(625.6/(o[0].length*a)));w.current=p,k.current={cw:a,ch:i};let u=[],f=Math.ceil(p/t),d=Math.ceil(p/r);for(let e=0;e<d;e++)for(let h=0;h<f;h++){let f=h*t,d=e*r,m=(f-p/2)*n,g=(d-p/2)*n,y=Math.hypot(m,g),M=c(o,m,g,a,i,s);M<0&&y>328||u.push({x:f+t/2,y:d+r/2,dx:m,dy:g,dist:y,angle:Math.atan2(g,m),seed:(0,l.hash)(h,e),grain:(0,l.hash)(5.7*h+19,2.3*e+53),gap:.05+.3*(0,l.hash)(7.3*h+11,3.1*e+5),emoji:(0,l.hash)(2.7*h+31,5.9*e+17)<l.EMOJI_RATIO,speck:(0,l.hash)(4.1*h+23,6.3*e+41),letter:M,word:-1})}E.current=u,T.current&&h(u,a,i,T.current.text),S.current={ascii:Array.from({length:l.RAMP.length},()=>new Int32Array(u.length)),emoji:Array.from({length:l.RAMP.length},()=>new Int32Array(u.length)),asciiN:new Int32Array(l.RAMP.length),emojiN:new Int32Array(l.RAMP.length),glyph:Array(u.length)};let y=Math.min(2,window.devicePixelRatio||1);e.width=p*y,e.height=p*y,e.style.width=`${p}px`,e.style.height=`${p}px`;let M=e.getContext("2d");return M&&(M.setTransform(y,0,0,y,0,0),M.font=`700 ${m}px ui-monospace,SFMono-Regular,Menlo,monospace`,M.textAlign="center",M.textBaseline="middle",A.current=M),()=>{M?.clearRect(0,0,p,p),E.current=[],S.current=null}},[m,g,p]),(0,r.useEffect)(()=>{b.current=d},[d]),(0,r.useEffect)(()=>{_.current.target=y},[y]),(0,r.useEffect)(()=>{L.current.mode!==s&&(L.current={mode:s,start:.001*performance.now()})},[s]),(0,r.useEffect)(()=>{if(!O||Date.now()-O.at>(O.hold??3.4)*1e3)return;let{cw:e,ch:t}=k.current,r=performance.now(),n=r-R.current<600?.11*O.text.length+.3+.45:0;T.current={text:O.text,start:.001*r-n,letters:h(E.current,e,t,O.text),hold:O.hold??3.4}},[O]),(0,r.useEffect)(()=>{let e=0,t=(0,a.createVoiceFollower)(),r=Array(a.SPECTRUM_BANDS).fill(0),n=.001*performance.now(),i=0,s=0,o=a=>{let c=.001*a,h=Math.min(.05,Math.max(0,c-n));n=c;let f=A.current,d=S.current;if(!f||!d){e=requestAnimationFrame(o);return}let m=b.current,g=w.current;d.asciiN.fill(0),d.emojiN.fill(0);let p=N.current?.();if(!p||p.length<2){for(let e=0;e<r.length;e++){let t=.5*Math.sin(1.7*c+1.7*e)+.3*Math.sin(.8*c+.6*e)+.2*Math.sin(3*c+2.9*e);r[e]=.5*t+.5}p=r}let y=v.current,M=t.read(p,h);y.phrase=M.phrase,M.onset>0&&(y.bobVel+=.06*M.onset,y.rings.push({born:c,power:M.onset}),y.rings.length>5&&y.rings.shift()),y.bobVel+=-(.012*y.bob)-.09*y.bobVel,y.bob+=y.bobVel,i+=h;for(let e=0;e<4;e++){let t=Math.floor(e*M.bands.length/4),r=Math.max(t+1,Math.floor((e+1)*M.bands.length/4)),n=0;for(let e=t;e<r;e++)n+=M.bands[e];n/=r-t;let a=.7+.6*(0,l.hash)((.9*c|0)+31*e,e);y.amp[e]+=(n*a-y.amp[e])*(.05+.02*e),y.phase[e]+=h*(.9+.5*e)*(e%2?-1:1)}for(y.spin+=h*(1.1+.9*y.phrase);y.rings.length>0&&c-y.rings[0].born>.7;)y.rings.shift();let O=L.current,x=T.current,R=x?c-x.start:0,k=null!==x&&"error"!==O.mode&&R<x.hold+.08*x.letters+.45+.35+.9?{scale:0,lift:0,gather:0,comet:0,speech:0,err:0,word:1}:function(e,t){let r={scale:1,lift:0,gather:0,comet:0,speech:0,err:0,word:0};switch(e){case"idle":return r;case"connecting":{let e=1-Math.exp(-t/1.3);return{...r,scale:.45+.55*e,lift:.06*e,gather:1}}case"speaking":return{...r,speech:1};case"working":return{...r,scale:0,comet:1};case"ending":return{...r,scale:0};case"error":return{...r,scale:0,err:1}}}(O.mode,c-O.start),j=I.current;j.scale=u(j.scale,k.scale,.45,"ending"===O.mode?.4:.7,h),j.lift=u(j.lift,k.lift,.22,.4,h),j.gather=u(j.gather,k.gather,.3,.95,h),j.comet=u(j.comet,k.comet,.45,.9,h),j.speech=u(j.speech,k.speech,.5,.75,h),"error"===O.mode&&(j.err<=.01&&(s=0),s+=h),j.err=u(j.err,k.err,.5,.6,h),j.word=u(j.word,k.word,.35,.5,h);let C=j.err>.5,P=j.word>.5,V="emojiOnly"===m?l.EMOJI_CHAR_RATE:l.CHAR_RATE,$=E.current;for(let e=0;e<$.length;e++){let t=$[e],r=function(e,t,r,n,a,i,s){let o,u,c,h,f=i.scale>.02?function(e,t,r=0,n=1){let a=170*Math.max(.02,n),i=1-(0,l.smoothstep)(.55*a,a,e.dist);return(.58+r+.2*Math.sin(.05*e.dist-.4*t)+.07*Math.sin(.35*t))*i}(e,t,i.lift,i.scale)*(1-.6*i.speech):0;return i.gather>.01&&(f+=function(e,t,r){let n=170*r;if(e.speck>=.55||e.dist<.8*n)return 0;let a=Math.min(55,Math.floor((e.angle+Math.PI)/(2*Math.PI)*56)),i=(.7*t+(0,l.hash)(a,5.3))%1,s=e.dist-(n+(320-n)*(1-i)**1.25)-(e.grain-.5)*16;return Math.exp(-(s*s)/260)*(0,l.smoothstep)(0,.2,i)*(1-i)*1.1}(e,t,i.scale)*i.gather),i.comet>.01&&(f+=(u=Math.exp(-((o=e.dist-210)*o)/1100),u*Math.exp(-((h=Math.atan2(Math.sin(c=e.angle-3*t),Math.cos(c)))*h)/(h<0?2.8:.16))*i.comet)),i.speech>.01&&(f+=function(e,t,r,n){var a;let l=170+40*r.phrase+85*r.bob;for(let t=0;t<4;t++)l+=28*r.amp[t]*Math.sin((t+2)*(e.angle+r.spin)+r.phase[t]);let i=170+(((a=l)<=205?Math.max(110,a):205+30*Math.tanh((a-205)/30))-170)*n,s=(e.grain-.5)*20+20*Math.sin(5*e.angle+.9*t+6.283*e.seed)*.3,o=e.dist-(i+s),u=Math.exp(-(o*o)/800)+.5*Math.exp(-(e.dist*e.dist)/6e3);if(e.dist<i&&(u+=.22*(1-e.dist/i)**.6*(.75+.25*Math.sin(.05*e.dist-1.2*t))),e.speck<.22){let n=90*(.6+.9*e.grain);for(let a=0;a<r.rings.length;a++){let l=r.rings[a],s=t-l.born,o=e.dist-(i+6+s*n);u+=Math.exp(-(o*o)/500)*l.power*Math.max(0,1-s/.7)}}return u}(e,t,s,i.speech)*i.speech),i.err>.01&&(f+=function(e,t,r){if(e.letter<0)return 0;let n=r%9.2,a=.12*e.seed;return Math.max(0,(0,l.smoothstep)(0,1,(n-.65*e.letter-a)/.8)-(0,l.smoothstep)(0,1,(n-5.6-.5*e.letter-a)/.7))*(.86+.14*Math.sin(3.5*t+6*e.seed))}(e,t,r)*i.err),i.word>.01&&(f+=function(e,t,r,n){if(e.word<0)return 0;let a=.45*e.seed,i=(0,l.smoothstep)(0,1,(r-.11*e.word-a)/.3),s=r-n-.08*e.word-a,o=(0,l.smoothstep)(0,1,s/.35),u=.2*(1-(0,l.smoothstep)(0,1,(s-.35)/.9));return Math.max(i-o,i>.5?u*o:0)*((i>0&&i<1||o>0&&u>0)&&.35>(0,l.hash)(Math.floor(14*t)+97*e.seed,31*e.grain)?.25:1)*(.86+.14*Math.sin(3.5*t+6*e.seed))}(e,t,n,a)*i.word),f}(t,c,s,R,x?.hold??3.4,j,y);!(C&&t.letter>=0||P&&t.word>=0)&&((r*=(.66+.72*t.grain)*(.8+.4*(0,l.hash)(Math.floor(.05*t.dx+.5*c),Math.floor(.05*t.dy-.3*c))))>.3&&(0,l.hash)(31.7*Math.floor(1.6*c),613*t.seed)>.992&&(r=Math.max(r,.9)),r<t.gap+.05*Math.sin(.28*c+6.283*t.seed)&&(r=0));let n=(r=r<0?0:r>1?1:r)*(l.RAMP.length-1)|0;if(0===n)continue;let a=i*V+7*t.seed|0;if("emojiOnly"===m||"emoji"===m&&t.emoji&&n>=l.EMOJI_MIN_LEVEL){let r=((t.seed*l.EMOJI_POOL.length|0)+a)%l.EMOJI_POOL.length;d.glyph[e]=l.EMOJI_POOL[r],d.emoji[n][d.emojiN[n]++]=e}else{let r=l.RAMP[n],i=((t.seed*r.length|0)+a)%r.length;d.glyph[e]=r[i],d.ascii[n][d.asciiN[n]++]=e}}f.clearRect(0,0,g,g);let D=E.current,K=l.RAMP.length-1,F=_.current;for(let e=0;e<3;e++)F.cur[e]+=(F.target[e]-F.cur[e])*.05;f.fillStyle=`rgb(${0|F.cur[0]},${0|F.cur[1]},${0|F.cur[2]})`;for(let e=1;e<=K;e++){let t=d.asciiN[e];if(0===t)continue;f.globalAlpha=l.ALPHA_TOP*(e/K);let r=d.ascii[e];for(let e=0;e<t;e++){let t=D[r[e]];f.fillText(d.glyph[r[e]],t.x,t.y)}}for(let e=1;e<=K;e++){let t=d.emojiN[e];if(0===t)continue;f.globalAlpha=.35+e/K*.65;let r=d.emoji[e];for(let e=0;e<t;e++){let t=D[r[e]];f.fillText(d.glyph[r[e]],t.x,t.y)}}f.globalAlpha=1,e=requestAnimationFrame(o)};return e=requestAnimationFrame(o),()=>cancelAnimationFrame(e)},[]),(0,t.jsx)("canvas",{ref:x,className:e,"aria-hidden":!0,style:{display:"block",pointerEvents:"none"}})}var d=e.i(922521),m=e.i(647163);let g={ending:"ending",idle:"idle",connecting:"connecting",listening:"idle",speaking:"speaking",working:"working",delegating:"working"},p=[247,247,247],y=[10,10,10];function M({status:e,failed:r,word:n,size:a,getSpectrum:l,look:i,className:s}){let o="dark"===(0,d.useResolvedTheme)();return(0,t.jsx)(f,{mode:r?"error":g[e],word:n,size:a,color:o?p:y,getSpectrum:l,charset:i.charset,fontSize:i.fontSize,density:i.density,className:s})}let O=(0,r.memo)(function({look:e,status:n="idle",size:a=448,className:l,...i}){let s=(0,r.useRef)(null),[o,u]=(0,r.useState)(a),[c,h]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=s.current;if(!e)return;let t=new ResizeObserver(([e])=>{let t=Math.round(e.contentRect.width);t>0&&u(t)});return t.observe(e),()=>t.disconnect()},[]),(0,r.useEffect)(()=>{let e=requestAnimationFrame(()=>h(!0));return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)("div",{ref:s,className:(0,m.cn)("aspect-square transition-opacity duration-700 ease-out",c?"opacity-100":"opacity-0",l),children:(0,t.jsx)(M,{...i,look:e,status:n,size:o})})});e.s(["Face",0,O],333495)},67045,e=>{"use strict";let t,r;var n=e.i(768834);let a=e=>t=>{try{let r=e(t);if(r instanceof Promise)return r;return{then:e=>a(e)(r),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>a(t)(e)}}};var l=e.i(149666),i=e.i(265402),s=e.i(671228);let o=s.ThursdaySettingsSchema.extend({wake:s.WakeSchema.catch(s.WAKE_DEFAULT),hotkey:s.HotkeySchema.catch(s.HOTKEY_DEFAULT),callBack:s.CallBackSchema.catch(s.CALL_BACK_DEFAULT),captionView:s.CaptionViewSchema.catch("sides"),textModel:i.textModelRefSchema.nullable().catch(null)}),u={...l.LIVE_DEFAULTS,wake:s.WAKE_DEFAULT,hotkey:s.HOTKEY_DEFAULT,callBack:s.CALL_BACK_DEFAULT,captionView:"sides",textModel:null},c=(0,n.create)()((t=e=>({...u,patch:t=>e(t)}),r={name:"thursday.settings",version:1,migrate:(e,t)=>t<1&&e&&"object"==typeof e?{...e,webSearch:!0}:e,merge:(e,t)=>{let r=o.safeParse((0,l.migrateLiveSettings)(e)),n=r.success?r.data:u;return{...t,...n}}},(e,n,l)=>{let i,s={storage:function(e){let t;try{t=e()}catch(e){return}return{getItem:e=>{var r;let n=e=>null===e?null:JSON.parse(e,void 0),a=null!=(r=t.getItem(e))?r:null;return a instanceof Promise?a.then(n):n(a)},setItem:(e,r)=>t.setItem(e,JSON.stringify(r,void 0)),removeItem:e=>t.removeItem(e)}}(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...r},o=!1,u=0,c=new Set,h=new Set,f=s.storage;if(!f)return t((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),e(...t)});let d=()=>{let e=s.partialize({...n()});return f.setItem(s.name,{state:e,version:s.version})},m=l.setState;l.setState=(e,t)=>(m(e,t),d());let g=t((...t)=>(e(...t),d()));l.getInitialState=()=>g;let p=()=>{var t,r;if(!f)return;let l=++u;o=!1,c.forEach(e=>{var t;return e(null!=(t=n())?t:g)});let m=(null==(r=s.onRehydrateStorage)?void 0:r.call(s,null!=(t=n())?t:g))||void 0;return a(f.getItem.bind(f))(s.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===s.version)return[!1,e.state];else{if(s.migrate){let t=s.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(t=>{var r;if(l!==u)return;let[a,o]=t;if(e(i=s.merge(o,null!=(r=n())?r:g),!0),a)return d()}).then(()=>{l===u&&(null==m||m(n(),void 0),i=n(),o=!0,h.forEach(e=>e(i)))}).catch(e=>{l===u&&(null==m||m(void 0,e))})};return l.persist={setOptions:e=>{s={...s,...e},e.storage&&(f=e.storage)},clearStorage:()=>{++u,null==f||f.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>p(),hasHydrated:()=>o,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(h.add(e),()=>{h.delete(e)})},s.skipHydration||p(),i||g}));e.s(["thursdaySettings",0,()=>{let e="u"<typeof navigator?null:navigator.language??null;return s.ThursdaySettingsSchema.parse({...c.getState(),locale:e})},"useThursdayStore",0,c],67045)},561540,e=>{"use strict";var t=e.i(213377);let r={[t.TOOL_NAMES.memory_recall]:"Checking your notes",[t.TOOL_NAMES.memory_remember]:"Noting that down",[t.TOOL_NAMES.memory_forget]:"Forgetting that",[t.TOOL_NAMES.memory_conversation]:"Reading back an earlier call",[t.TOOL_NAMES.bash]:"Doing it on this computer",[t.TOOL_NAMES.web_search]:"Searching the web",[t.TOOL_NAMES.load_skill]:"Reading how to do this",[t.TOOL_NAMES.look_at]:"Looking at the picture",[t.TOOL_NAMES.end_call]:"Ending the call",[t.TOOL_NAMES.routine]:"Checking your routines"};function n(e){if(!e)return null;try{let t=JSON.parse(e);if(t&&"object"==typeof t&&!Array.isArray(t))return t}catch{}return null}let a=new Set([t.TOOL_NAMES.thread_tell,t.TOOL_NAMES.thread_answer,t.TOOL_NAMES.thread_status,t.TOOL_NAMES.thread_show,t.TOOL_NAMES.thread_cancel,t.TOOL_NAMES.thread_seen]);function l(e,r){if(e!==t.TOOL_NAMES.web_search)return null;try{let e=JSON.parse(r),t=Array.isArray(e.sources)?e.sources.flatMap(e=>e&&"object"==typeof e&&"string"==typeof e.url?[e]:[]):[];return{query:"string"==typeof e.query?e.query:null,sources:t}}catch{return null}}e.s(["searchOf",0,l,"searchQueryOf",0,function(e){let t=n(e)?.query;return"string"==typeof t&&t.trim()?t.trim():null},"searchSourcesOf",0,function(e){let r=n(e);return r?l(t.TOOL_NAMES.web_search,JSON.stringify(r))?.sources??[]:[]},"startedLabel",0,function(e,r){if(e!==t.TOOL_NAMES.thread_start)return null;try{let e=JSON.parse(r);return"string"==typeof e.label?e.label:null}catch{return null}},"toolBot",0,function(e,r,l){let i=n(r);if(!i)return null;if(e===t.TOOL_NAMES.thread_start)return"string"==typeof i.bot&&i.bot.trim()?i.bot.trim():null;if(!a.has(e)||!l)return null;let s="string"==typeof i.thread?i.thread.trim():"";if(!s||"all"===s.toLowerCase())return null;let o=s.toLowerCase(),u=l.find(e=>e.id===s)??l.find(e=>e.label.toLowerCase()===o);return u?e===t.TOOL_NAMES.thread_answer?u.room.questions[0]?.bot??u.bot:u.bot:null},"toolLine",0,function(e,a,l=null){let i;if(e===t.TOOL_NAMES.tool_search||e===t.TOOL_NAMES.tool_call)return"Reaching a connected service";let s=n(a);return(s&&function(e,r,n){if(e===t.TOOL_NAMES.memory_remember){let e="string"==typeof r.path?r.path.trim():"",t=function(e){if(!Array.isArray(e.facts))return null;let t=e.facts.map(e=>e&&"object"==typeof e&&"string"==typeof e.text?e.text.trim():"").filter(Boolean);return t.length?{text:t[0],more:t.length-1}:null}(r);if(!e)return null;if(!t)return`Noting that under ${e}`;let n=t.more>0?` (+${t.more})`:"";return`Noting under ${e}: ${function(e){let t=e.trim().replace(/\s+/g," ");if(t.length<=28)return t;let r=t.slice(0,28),n=r.lastIndexOf(" ");return`${(n>14?r.slice(0,n):r).trimEnd()}…`}(t.text)}${n}`}if(e===t.TOOL_NAMES.thread_start){let e="string"==typeof r.bot?r.bot.trim():"";return e?`Handing this to ${e}`:"Handing this over"}if(e===t.TOOL_NAMES.web_search){let e="string"==typeof r.query?r.query.trim():"";return e?`Searching \xb7 ${e}`:null}if(e===t.TOOL_NAMES.routine){if("create"===r.action){let e=["string"==typeof r.bot?r.bot.trim():"",function(e){if("string"==typeof e.at&&e.at.length>=16){let[t,r]=e.at.split(" "),[n,a,l]=t.split("-").map(Number),i=new Date(n,a-1,l);if(i.toDateString()===new Date().toDateString())return`once at ${r}`;let s=i.toLocaleDateString("en-US",{month:"short",day:"numeric"});return`once, ${s} ${r}`}return"string"==typeof e.time&&e.time?`daily at ${e.time}`:"number"==typeof e.everyHours?`every ${e.everyHours} hours`:null}(r)].filter(Boolean).join(", ");return e?`Setting a routine \xb7 ${e}`:"Setting a routine"}return"change"===r.action?"Changing a routine":"delete"===r.action?"Deleting a routine":null}let a="string"==typeof r.thread?r.thread.trim():"";return e===t.TOOL_NAMES.thread_tell?n?`Telling ${n}`:"Passing that on":e===t.TOOL_NAMES.thread_answer?n?`Answering ${n}`:"Answering that":e===t.TOOL_NAMES.thread_cancel?a?`Stopping ${a}`:"Stopping that":e===t.TOOL_NAMES.thread_seen?a?`Marking ${a} as read`:"Marking that as read":e===t.TOOL_NAMES.thread_show?a?`Opening ${a}`:"Opening that":e===t.TOOL_NAMES.thread_status?a&&"all"!==a.toLowerCase()?`Checking on ${a}`:"Checking on the work":null}(e,s,l))??r[e]??((i=e.indexOf("__"))<=0?null:`Reaching ${e.slice(0,i).replace(/[-_]/g," ")}`)}])},319841,e=>{"use strict";var t=e.i(271645);let r=["ctrl","alt","meta"],n=/^(Control|Alt|Shift|Meta|OS)/,a=/^(input|textarea|select)$/i,l=e=>!!e&&!!(a.test(e.tagName)||e.isContentEditable||e.closest?.("[data-hotkey-capture]"));function i(e){let{code:t,ctrlKey:r,altKey:a,shiftKey:l,metaKey:i}=e;if(!t||n.test(t)||!r&&!a&&!i)return null;let s=[];return r&&s.push("ctrl"),a&&s.push("alt"),l&&s.push("shift"),i&&s.push("meta"),[...s,t].join("+")}let s={ctrl:["Ctrl","⌃"],alt:["Alt","⌥"],shift:["Shift","⇧"],meta:["Meta","⌘"]};e.s(["HOTKEY_CAPTURE",0,{"data-hotkey-capture":""},"capturesKeys",0,l,"comboOf",0,i,"isCombo",0,e=>{let t=e.split("+"),a=t.at(-1);return!!(a&&!n.test(a)&&t.slice(0,-1).some(e=>r.includes(e)))},"useHotkey",0,function({enabled:e,combo:r,onPress:n}){let a=(0,t.useRef)(n);a.current=n,(0,t.useEffect)(()=>{if(!e||!r)return;let t=e=>{e.repeat||l(e.target)||i(e)===r&&(e.preventDefault(),a.current())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,r])},"useHotkeyLabel",0,function(e){let[r,n]=(0,t.useState)(!1);return(0,t.useEffect)(()=>n(/mac/i.test(navigator.userAgent)),[]),e?function(e,t=!1){let r=e.split("+"),n=r.at(-1)??"",a=r.slice(0,-1).map(e=>s[e]?.[+!!t]??e),l=n.replace(/^(Key|Digit|Numpad)/,"").replace(/([a-z])([A-Z])/g,"$1 $2")||n;return t?[...a,l].join(""):[...a,l].join(" + ")}(e,r):null}])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,616816,e=>{"use strict";var t=e.i(843476),r=e.i(689664),n=e.i(263676),a=e.i(271645),l=e.i(798120),i=e.i(167881),s=e.i(23750),o=e.i(968978),u=e.i(149666),c=e.i(609856),h=e.i(283653),f=e.i(647163),d=e.i(690191),m=e.i(992112);function g({provider:e,saved:r,autoFocus:n,dense:a,plain:l,value:i,ready:s,saving:u,onValue:c,onSubmit:h}){return(0,t.jsxs)("div",{className:"space-y-2",children:[!l&&(0,t.jsxs)("span",{className:"flex items-center gap-2 px-0.5 text-muted-foreground",children:[(0,t.jsx)(o.ProviderIcon,{provider:e.id,className:"size-4 shrink-0"}),(0,t.jsx)("span",{className:(0,f.cn)("font-mono",a?"text-[11px]":"text-[12.5px]"),children:e.label})]}),(0,t.jsx)(p,{provider:e,saved:r,autoFocus:n,dense:a,mark:l,value:i,ready:s,saving:u,onValue:c,onSubmit:h})]})}function p({provider:e,saved:n,autoFocus:a,dense:l,mark:u,value:c,ready:h,saving:d,onValue:m,onSubmit:g}){let y=c.trim().startsWith("xai-")||c.trim().startsWith("sk-ant-");return(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),g()},className:(0,f.cn)("flex items-center gap-3 rounded-2xl border bg-muted/40 px-4 transition-colors",l?"h-11 rounded-xl px-3":"h-14",n||h?"border-foreground bg-transparent":"border-border"),children:[u&&(0,t.jsx)(o.ProviderIcon,{provider:e.id,className:"size-4 shrink-0 text-muted-foreground"}),(0,t.jsx)(s.Input,{autoFocus:a,type:"password","aria-label":"OpenAI API key",autoComplete:"off",value:c,spellCheck:!1,placeholder:n?"Replace it":"sk-…",onChange:e=>m(e.target.value),className:(0,f.cn)("min-w-0 flex-1 border-0 bg-transparent px-0 font-mono shadow-none focus-visible:ring-0 dark:bg-transparent",l?"h-7 text-[13px]":"h-9 text-[15px]")}),c?(0,t.jsx)(i.Button,{type:"submit",size:"sm",variant:y?"outline":"default",loading:d,disabled:!h,className:(0,f.cn)("shrink-0",l?"h-7 px-3":"h-9 px-4"),children:y?`Not ${e.label}?`:"Save"}):n&&(0,t.jsx)("span",{className:(0,f.cn)("grid shrink-0 animate-in place-items-center rounded-full bg-foreground text-background zoom-in-50 duration-300",l?"size-5":"size-7"),children:(0,t.jsx)(r.Check,{className:l?"size-3":"size-4"})})]})}e.s(["KEY_MIN",0,8,"KeyInput",0,p,"VoiceKeys",0,function({ref:e,autoFocus:r,dense:s=!1,plain:o=!1,onCancel:p,onSaved:y,className:M}){let{data:O}=(0,h.useServerRoute)(l.queryKey.config),[x,A]=(0,a.useState)({}),[E,S]=(0,a.useState)(null),[b,_]=(0,a.useState)(null),[w]=(0,c.useServerAction)(d.setConfigAction,{errorMessage:!1,onError:e=>_(e??"That key was not saved."),onOk:()=>{(0,h.revalidate)(l.queryKey.config),(0,h.revalidate)(l.queryKey.llmModel)}}),N=e=>(x[e]?.trim().length??0)>=8,v=async e=>{let t=e.apiKeyName;if(!N(t)||E)return!1;_(null),S(t);try{return await w(t,x[t]),A(e=>({...e,[t]:""})),y?.(e.id),!0}catch{return!1}finally{S(null)}};return(0,a.useImperativeHandle)(e,()=>({pending:()=>N(u.LIVE_PROVIDER.apiKeyName),flush:async()=>!N(u.LIVE_PROVIDER.apiKeyName)||v(u.LIVE_PROVIDER)})),(0,t.jsxs)("div",{className:(0,f.cn)("w-full",s?"space-y-2":"space-y-4",M),children:[s&&!o&&(0,t.jsxs)("div",{className:"flex h-6 items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"px-0.5 font-mono text-[11px] text-muted-foreground",children:"Voice key"}),p&&(0,t.jsx)(i.Button,{type:"button",size:"icon",variant:"ghost","aria-label":"Not now",onClick:p,className:"-my-1 size-6",children:(0,t.jsx)(n.X,{className:"size-3.5"})})]}),(0,t.jsx)(g,{provider:u.LIVE_PROVIDER,saved:(0,m.isConfigSet)(O,u.LIVE_PROVIDER.apiKeyName),autoFocus:r,dense:s,plain:o,value:x[u.LIVE_PROVIDER.apiKeyName]??"",ready:N(u.LIVE_PROVIDER.apiKeyName),saving:E===u.LIVE_PROVIDER.apiKeyName,onValue:e=>{_(null),A(t=>({...t,[u.LIVE_PROVIDER.apiKeyName]:e}))},onSubmit:()=>void v(u.LIVE_PROVIDER)}),b&&(0,t.jsx)("p",{className:(0,f.cn)("px-0.5 leading-5 break-words",s?"text-xs":"text-center text-[13px]",f.WAITING_INK),children:b}),!o&&(0,t.jsx)("p",{className:(0,f.cn)("px-0.5 font-mono text-muted-foreground",s?"text-[11px]":"pt-1 text-center text-[12.5px]"),children:s?"Live voice and reasoning share this OpenAI API key.":"Live uses an OpenAI API key, billed separately from ChatGPT. Stored on this machine, in this app's database."})]})}])},333495,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(41533),a=e.i(218080),l=e.i(567334);let i=[235,235,235];function s(e){let t=[[],[],[],[],[]],r=0;for(let n of Array.from(e.toUpperCase())){let e=l.LETTERS[n];if(e){if(t[0].length)for(let e of t)e.push(-1);e.forEach((e,n)=>{for(let a of e)t[n].push("#"===a?r:-1)})," "!==n&&r++}}return t}let o=s("ERROR");function u(e,t,r,n,a){return e+(t-e)*Math.min(1,a/(t>e?r:n))}function c(e,t,r,n,a,l){let i=Math.floor(t/(n*l)+e[0].length/2),s=Math.floor(r/(a*l)+e.length/2);return s<0||s>=e.length?-1:e[s][i]??-1}function h(e,t,r,n){let a=e=>Math.max(1,Math.min(3,Math.floor(625.6/(e[0].length*t)),Math.floor(421.6/(e.length*r)))),l=s(n),i=3>a(l)?function(e){let t=Array.from(e.trim()),r=t.flatMap((e,t)=>" "===e?[t]:[]);if(!r.length)return null;let n=t.length/2,a=r.reduce((e,t)=>Math.abs(t-n)<Math.abs(e-n)?t:e),l=s(t.slice(0,a).join("")),i=s(t.slice(a+1).join(""));if(!l[0].length||!i[0].length)return null;let o=Math.max(-1,...l.flat())+1,u=Math.max(l[0].length,i[0].length),c=(e,t)=>{let r=Math.floor((u-e.length)/2);return[...Array(r).fill(-1),...e.map(e=>e<0?e:e+t),...Array(u-e.length-r).fill(-1)]},h=()=>Array(u).fill(-1);return[...l.map(e=>c(e,0)),h(),h(),...i.map(e=>c(e,o))]}(n):null,o=i&&a(i)>a(l)?i:l,u=a(o),h=0;for(let n of e)n.word=c(o,n.dx,n.dy,t,r,u),h=Math.max(h,n.word+1);return h}function f({className:e,mode:s="idle",charset:d=n.ASCII_FACE.charset,fontSize:m=n.ASCII_FACE.fontSize.default,density:g=n.ASCII_FACE.density.default,size:p=680,color:y=i,getSpectrum:M,word:O=null}){let x=(0,r.useRef)(null),A=(0,r.useRef)(null),E=(0,r.useRef)([]),S=(0,r.useRef)(null),b=(0,r.useRef)(d),_=(0,r.useRef)({cur:[...y],target:y}),w=(0,r.useRef)(0),N=(0,r.useRef)(M);N.current=M;let v=(0,r.useRef)({phrase:0,bob:0,bobVel:0,amp:[,,,,].fill(0),phase:Array.from({length:4},(e,t)=>2.1*t),spin:0,rings:[]}),L=(0,r.useRef)({mode:s,start:0}),R=(0,r.useRef)(performance.now()),I=(0,r.useRef)({scale:.3,lift:0,gather:0,comet:0,speech:0,err:0,word:0}),T=(0,r.useRef)(null),k=(0,r.useRef)({cw:1,ch:1});return(0,r.useEffect)(()=>{let e=x.current;if(!e)return;let t=.95*m/g,r=1.25*m/g,n=680/p,a=t*n,i=r*n,s=Math.max(1,Math.floor(625.6/(o[0].length*a)));w.current=p,k.current={cw:a,ch:i};let u=[],f=Math.ceil(p/t),d=Math.ceil(p/r);for(let e=0;e<d;e++)for(let h=0;h<f;h++){let f=h*t,d=e*r,m=(f-p/2)*n,g=(d-p/2)*n,y=Math.hypot(m,g),M=c(o,m,g,a,i,s);M<0&&y>328||u.push({x:f+t/2,y:d+r/2,dx:m,dy:g,dist:y,angle:Math.atan2(g,m),seed:(0,l.hash)(h,e),grain:(0,l.hash)(5.7*h+19,2.3*e+53),gap:.05+.3*(0,l.hash)(7.3*h+11,3.1*e+5),emoji:(0,l.hash)(2.7*h+31,5.9*e+17)<l.EMOJI_RATIO,speck:(0,l.hash)(4.1*h+23,6.3*e+41),letter:M,word:-1})}E.current=u,T.current&&h(u,a,i,T.current.text),S.current={ascii:Array.from({length:l.RAMP.length},()=>new Int32Array(u.length)),emoji:Array.from({length:l.RAMP.length},()=>new Int32Array(u.length)),asciiN:new Int32Array(l.RAMP.length),emojiN:new Int32Array(l.RAMP.length),glyph:Array(u.length)};let y=Math.min(2,window.devicePixelRatio||1);e.width=p*y,e.height=p*y,e.style.width=`${p}px`,e.style.height=`${p}px`;let M=e.getContext("2d");return M&&(M.setTransform(y,0,0,y,0,0),M.font=`700 ${m}px ui-monospace,SFMono-Regular,Menlo,monospace`,M.textAlign="center",M.textBaseline="middle",A.current=M),()=>{M?.clearRect(0,0,p,p),E.current=[],S.current=null}},[m,g,p]),(0,r.useEffect)(()=>{b.current=d},[d]),(0,r.useEffect)(()=>{_.current.target=y},[y]),(0,r.useEffect)(()=>{L.current.mode!==s&&(L.current={mode:s,start:.001*performance.now()})},[s]),(0,r.useEffect)(()=>{if(!O||Date.now()-O.at>(O.hold??3.4)*1e3)return;let{cw:e,ch:t}=k.current,r=performance.now(),n=r-R.current<600?.11*O.text.length+.3+.45:0;T.current={text:O.text,start:.001*r-n,letters:h(E.current,e,t,O.text),hold:O.hold??3.4}},[O]),(0,r.useEffect)(()=>{let e=0,t=(0,a.createVoiceFollower)(),r=Array(a.SPECTRUM_BANDS).fill(0),n=.001*performance.now(),i=0,s=0,o=a=>{let c=.001*a,h=Math.min(.05,Math.max(0,c-n));n=c;let f=A.current,d=S.current;if(!f||!d){e=requestAnimationFrame(o);return}let m=b.current,g=w.current;d.asciiN.fill(0),d.emojiN.fill(0);let p=N.current?.();if(!p||p.length<2){for(let e=0;e<r.length;e++){let t=.5*Math.sin(1.7*c+1.7*e)+.3*Math.sin(.8*c+.6*e)+.2*Math.sin(3*c+2.9*e);r[e]=.5*t+.5}p=r}let y=v.current,M=t.read(p,h);y.phrase=M.phrase,M.onset>0&&(y.bobVel+=.06*M.onset,y.rings.push({born:c,power:M.onset}),y.rings.length>5&&y.rings.shift()),y.bobVel+=-(.012*y.bob)-.09*y.bobVel,y.bob+=y.bobVel,i+=h;for(let e=0;e<4;e++){let t=Math.floor(e*M.bands.length/4),r=Math.max(t+1,Math.floor((e+1)*M.bands.length/4)),n=0;for(let e=t;e<r;e++)n+=M.bands[e];n/=r-t;let a=.7+.6*(0,l.hash)((.9*c|0)+31*e,e);y.amp[e]+=(n*a-y.amp[e])*(.05+.02*e),y.phase[e]+=h*(.9+.5*e)*(e%2?-1:1)}for(y.spin+=h*(1.1+.9*y.phrase);y.rings.length>0&&c-y.rings[0].born>.7;)y.rings.shift();let O=L.current,x=T.current,R=x?c-x.start:0,k=null!==x&&"error"!==O.mode&&R<x.hold+.08*x.letters+.45+.35+.9?{scale:0,lift:0,gather:0,comet:0,speech:0,err:0,word:1}:function(e,t){let r={scale:1,lift:0,gather:0,comet:0,speech:0,err:0,word:0};switch(e){case"idle":return r;case"connecting":{let e=1-Math.exp(-t/1.3);return{...r,scale:.45+.55*e,lift:.06*e,gather:1}}case"speaking":return{...r,speech:1};case"working":return{...r,scale:0,comet:1};case"ending":return{...r,scale:0};case"error":return{...r,scale:0,err:1}}}(O.mode,c-O.start),j=I.current;j.scale=u(j.scale,k.scale,.45,"ending"===O.mode?.4:.7,h),j.lift=u(j.lift,k.lift,.22,.4,h),j.gather=u(j.gather,k.gather,.3,.95,h),j.comet=u(j.comet,k.comet,.45,.9,h),j.speech=u(j.speech,k.speech,.5,.75,h),"error"===O.mode&&(j.err<=.01&&(s=0),s+=h),j.err=u(j.err,k.err,.5,.6,h),j.word=u(j.word,k.word,.35,.5,h);let C=j.err>.5,P=j.word>.5,V="emojiOnly"===m?l.EMOJI_CHAR_RATE:l.CHAR_RATE,$=E.current;for(let e=0;e<$.length;e++){let t=$[e],r=function(e,t,r,n,a,i,s){let o,u,c,h,f=i.scale>.02?function(e,t,r=0,n=1){let a=170*Math.max(.02,n),i=1-(0,l.smoothstep)(.55*a,a,e.dist);return(.58+r+.2*Math.sin(.05*e.dist-.4*t)+.07*Math.sin(.35*t))*i}(e,t,i.lift,i.scale)*(1-.6*i.speech):0;return i.gather>.01&&(f+=function(e,t,r){let n=170*r;if(e.speck>=.55||e.dist<.8*n)return 0;let a=Math.min(55,Math.floor((e.angle+Math.PI)/(2*Math.PI)*56)),i=(.7*t+(0,l.hash)(a,5.3))%1,s=e.dist-(n+(320-n)*(1-i)**1.25)-(e.grain-.5)*16;return Math.exp(-(s*s)/260)*(0,l.smoothstep)(0,.2,i)*(1-i)*1.1}(e,t,i.scale)*i.gather),i.comet>.01&&(f+=(u=Math.exp(-((o=e.dist-210)*o)/1100),u*Math.exp(-((h=Math.atan2(Math.sin(c=e.angle-3*t),Math.cos(c)))*h)/(h<0?2.8:.16))*i.comet)),i.speech>.01&&(f+=function(e,t,r,n){var a;let l=170+40*r.phrase+85*r.bob;for(let t=0;t<4;t++)l+=28*r.amp[t]*Math.sin((t+2)*(e.angle+r.spin)+r.phase[t]);let i=170+(((a=l)<=205?Math.max(110,a):205+30*Math.tanh((a-205)/30))-170)*n,s=(e.grain-.5)*20+20*Math.sin(5*e.angle+.9*t+6.283*e.seed)*.3,o=e.dist-(i+s),u=Math.exp(-(o*o)/800)+.5*Math.exp(-(e.dist*e.dist)/6e3);if(e.dist<i&&(u+=.22*(1-e.dist/i)**.6*(.75+.25*Math.sin(.05*e.dist-1.2*t))),e.speck<.22){let n=90*(.6+.9*e.grain);for(let a=0;a<r.rings.length;a++){let l=r.rings[a],s=t-l.born,o=e.dist-(i+6+s*n);u+=Math.exp(-(o*o)/500)*l.power*Math.max(0,1-s/.7)}}return u}(e,t,s,i.speech)*i.speech),i.err>.01&&(f+=function(e,t,r){if(e.letter<0)return 0;let n=r%9.2,a=.12*e.seed;return Math.max(0,(0,l.smoothstep)(0,1,(n-.65*e.letter-a)/.8)-(0,l.smoothstep)(0,1,(n-5.6-.5*e.letter-a)/.7))*(.86+.14*Math.sin(3.5*t+6*e.seed))}(e,t,r)*i.err),i.word>.01&&(f+=function(e,t,r,n){if(e.word<0)return 0;let a=.45*e.seed,i=(0,l.smoothstep)(0,1,(r-.11*e.word-a)/.3),s=r-n-.08*e.word-a,o=(0,l.smoothstep)(0,1,s/.35),u=.2*(1-(0,l.smoothstep)(0,1,(s-.35)/.9));return Math.max(i-o,i>.5?u*o:0)*((i>0&&i<1||o>0&&u>0)&&.35>(0,l.hash)(Math.floor(14*t)+97*e.seed,31*e.grain)?.25:1)*(.86+.14*Math.sin(3.5*t+6*e.seed))}(e,t,n,a)*i.word),f}(t,c,s,R,x?.hold??3.4,j,y);!(C&&t.letter>=0||P&&t.word>=0)&&((r*=(.66+.72*t.grain)*(.8+.4*(0,l.hash)(Math.floor(.05*t.dx+.5*c),Math.floor(.05*t.dy-.3*c))))>.3&&(0,l.hash)(31.7*Math.floor(1.6*c),613*t.seed)>.992&&(r=Math.max(r,.9)),r<t.gap+.05*Math.sin(.28*c+6.283*t.seed)&&(r=0));let n=(r=r<0?0:r>1?1:r)*(l.RAMP.length-1)|0;if(0===n)continue;let a=i*V+7*t.seed|0;if("emojiOnly"===m||"emoji"===m&&t.emoji&&n>=l.EMOJI_MIN_LEVEL){let r=((t.seed*l.EMOJI_POOL.length|0)+a)%l.EMOJI_POOL.length;d.glyph[e]=l.EMOJI_POOL[r],d.emoji[n][d.emojiN[n]++]=e}else{let r=l.RAMP[n],i=((t.seed*r.length|0)+a)%r.length;d.glyph[e]=r[i],d.ascii[n][d.asciiN[n]++]=e}}f.clearRect(0,0,g,g);let D=E.current,K=l.RAMP.length-1,F=_.current;for(let e=0;e<3;e++)F.cur[e]+=(F.target[e]-F.cur[e])*.05;f.fillStyle=`rgb(${0|F.cur[0]},${0|F.cur[1]},${0|F.cur[2]})`;for(let e=1;e<=K;e++){let t=d.asciiN[e];if(0===t)continue;f.globalAlpha=l.ALPHA_TOP*(e/K);let r=d.ascii[e];for(let e=0;e<t;e++){let t=D[r[e]];f.fillText(d.glyph[r[e]],t.x,t.y)}}for(let e=1;e<=K;e++){let t=d.emojiN[e];if(0===t)continue;f.globalAlpha=.35+e/K*.65;let r=d.emoji[e];for(let e=0;e<t;e++){let t=D[r[e]];f.fillText(d.glyph[r[e]],t.x,t.y)}}f.globalAlpha=1,e=requestAnimationFrame(o)};return e=requestAnimationFrame(o),()=>cancelAnimationFrame(e)},[]),(0,t.jsx)("canvas",{ref:x,className:e,"aria-hidden":!0,style:{display:"block",pointerEvents:"none"}})}var d=e.i(922521),m=e.i(647163);let g={ending:"ending",idle:"idle",connecting:"connecting",listening:"idle",speaking:"speaking",working:"working",delegating:"working"},p=[247,247,247],y=[10,10,10];function M({status:e,failed:r,word:n,size:a,getSpectrum:l,look:i,className:s}){let o="dark"===(0,d.useResolvedTheme)();return(0,t.jsx)(f,{mode:r?"error":g[e],word:n,size:a,color:o?p:y,getSpectrum:l,charset:i.charset,fontSize:i.fontSize,density:i.density,className:s})}let O=(0,r.memo)(function({look:e,status:n="idle",size:a=448,className:l,...i}){let s=(0,r.useRef)(null),[o,u]=(0,r.useState)(a),[c,h]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=s.current;if(!e)return;let t=new ResizeObserver(([e])=>{let t=Math.round(e.contentRect.width);t>0&&u(t)});return t.observe(e),()=>t.disconnect()},[]),(0,r.useEffect)(()=>{let e=requestAnimationFrame(()=>h(!0));return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)("div",{ref:s,className:(0,m.cn)("aspect-square transition-opacity duration-700 ease-out",c?"opacity-100":"opacity-0",l),children:(0,t.jsx)(M,{...i,look:e,status:n,size:o})})});e.s(["Face",0,O],333495)},67045,e=>{"use strict";let t,r;var n=e.i(768834);let a=e=>t=>{try{let r=e(t);if(r instanceof Promise)return r;return{then:e=>a(e)(r),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>a(t)(e)}}};var l=e.i(149666),i=e.i(265402),s=e.i(671228);let o=s.ThursdaySettingsSchema.extend({wake:s.WakeSchema.catch(s.WAKE_DEFAULT),hotkey:s.HotkeySchema.catch(s.HOTKEY_DEFAULT),callBack:s.CallBackSchema.catch(s.CALL_BACK_DEFAULT),captionView:s.CaptionViewSchema.catch("sides"),textModel:i.textModelRefSchema.nullable().catch(null)}),u={...l.LIVE_DEFAULTS,wake:s.WAKE_DEFAULT,hotkey:s.HOTKEY_DEFAULT,callBack:s.CALL_BACK_DEFAULT,captionView:"sides",textModel:null},c=(0,n.create)()((t=e=>({...u,patch:t=>e(t)}),r={name:"thursday.settings",version:1,migrate:(e,t)=>t<1&&e&&"object"==typeof e?{...e,webSearch:!0}:e,merge:(e,t)=>{let r=o.safeParse((0,l.migrateLiveSettings)(e)),n=r.success?r.data:u;return{...t,...n}}},(e,n,l)=>{let i,s={storage:function(e){let t;try{t=e()}catch(e){return}return{getItem:e=>{var r;let n=e=>null===e?null:JSON.parse(e,void 0),a=null!=(r=t.getItem(e))?r:null;return a instanceof Promise?a.then(n):n(a)},setItem:(e,r)=>t.setItem(e,JSON.stringify(r,void 0)),removeItem:e=>t.removeItem(e)}}(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...r},o=!1,u=0,c=new Set,h=new Set,f=s.storage;if(!f)return t((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),e(...t)});let d=()=>{let e=s.partialize({...n()});return f.setItem(s.name,{state:e,version:s.version})},m=l.setState;l.setState=(e,t)=>(m(e,t),d());let g=t((...t)=>(e(...t),d()));l.getInitialState=()=>g;let p=()=>{var t,r;if(!f)return;let l=++u;o=!1,c.forEach(e=>{var t;return e(null!=(t=n())?t:g)});let m=(null==(r=s.onRehydrateStorage)?void 0:r.call(s,null!=(t=n())?t:g))||void 0;return a(f.getItem.bind(f))(s.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===s.version)return[!1,e.state];else{if(s.migrate){let t=s.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(t=>{var r;if(l!==u)return;let[a,o]=t;if(e(i=s.merge(o,null!=(r=n())?r:g),!0),a)return d()}).then(()=>{l===u&&(null==m||m(n(),void 0),i=n(),o=!0,h.forEach(e=>e(i)))}).catch(e=>{l===u&&(null==m||m(void 0,e))})};return l.persist={setOptions:e=>{s={...s,...e},e.storage&&(f=e.storage)},clearStorage:()=>{++u,null==f||f.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>p(),hasHydrated:()=>o,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(h.add(e),()=>{h.delete(e)})},s.skipHydration||p(),i||g}));e.s(["thursdaySettings",0,()=>{let e="u"<typeof navigator?null:navigator.language??null;return s.ThursdaySettingsSchema.parse({...c.getState(),locale:e})},"useThursdayStore",0,c],67045)},561540,e=>{"use strict";var t=e.i(213377);let r={[t.TOOL_NAMES.memory_recall]:"Checking your notes",[t.TOOL_NAMES.memory_remember]:"Noting that down",[t.TOOL_NAMES.memory_forget]:"Forgetting that",[t.TOOL_NAMES.memory_conversation]:"Reading back an earlier call",[t.TOOL_NAMES.bash]:"Doing it on this computer",[t.TOOL_NAMES.web_search]:"Searching the web",[t.TOOL_NAMES.load_skill]:"Reading how to do this",[t.TOOL_NAMES.look_at]:"Looking at the picture",[t.TOOL_NAMES.end_call]:"Ending the call",[t.TOOL_NAMES.routine]:"Checking your routines"};function n(e){if(!e)return null;try{let t=JSON.parse(e);if(t&&"object"==typeof t&&!Array.isArray(t))return t}catch{}return null}let a=new Set([t.TOOL_NAMES.thread_tell,t.TOOL_NAMES.thread_answer,t.TOOL_NAMES.thread_status,t.TOOL_NAMES.thread_show,t.TOOL_NAMES.thread_cancel,t.TOOL_NAMES.thread_seen]);function l(e,r){if(e!==t.TOOL_NAMES.web_search)return null;try{let e=JSON.parse(r),t=Array.isArray(e.sources)?e.sources.flatMap(e=>e&&"object"==typeof e&&"string"==typeof e.url?[e]:[]):[];return{query:"string"==typeof e.query?e.query:null,sources:t}}catch{return null}}e.s(["searchOf",0,l,"searchQueryOf",0,function(e){let t=n(e)?.query;return"string"==typeof t&&t.trim()?t.trim():null},"searchSourcesOf",0,function(e){let r=n(e);return r?l(t.TOOL_NAMES.web_search,JSON.stringify(r))?.sources??[]:[]},"startedLabel",0,function(e,r){if(e!==t.TOOL_NAMES.thread_start)return null;try{let e=JSON.parse(r);return"string"==typeof e.label?e.label:null}catch{return null}},"toolBot",0,function(e,r,l){let i=n(r);if(!i)return null;if(e===t.TOOL_NAMES.thread_start)return"string"==typeof i.bot&&i.bot.trim()?i.bot.trim():null;if(!a.has(e)||!l)return null;let s="string"==typeof i.thread?i.thread.trim():"";if(!s||"all"===s.toLowerCase())return null;let o=s.toLowerCase(),u=l.find(e=>e.id===s)??l.find(e=>e.label.toLowerCase()===o);return u?e===t.TOOL_NAMES.thread_answer?u.room.questions[0]?.bot??u.bot:u.bot:null},"toolLine",0,function(e,a,l=null){let i;if(e===t.TOOL_NAMES.tool_search||e===t.TOOL_NAMES.tool_call)return"Reaching a connected service";let s=n(a);return(s&&function(e,r,n){if(e===t.TOOL_NAMES.memory_remember){let e="string"==typeof r.path?r.path.trim():"",t=function(e){if(!Array.isArray(e.facts))return null;let t=e.facts.map(e=>e&&"object"==typeof e&&"string"==typeof e.text?e.text.trim():"").filter(Boolean);return t.length?{text:t[0],more:t.length-1}:null}(r);if(!e)return null;if(!t)return`Noting that under ${e}`;let n=t.more>0?` (+${t.more})`:"";return`Noting under ${e}: ${function(e){let t=e.trim().replace(/\s+/g," ");if(t.length<=28)return t;let r=t.slice(0,28),n=r.lastIndexOf(" ");return`${(n>14?r.slice(0,n):r).trimEnd()}…`}(t.text)}${n}`}if(e===t.TOOL_NAMES.thread_start){let e="string"==typeof r.bot?r.bot.trim():"";return e?`Handing this to ${e}`:"Handing this over"}if(e===t.TOOL_NAMES.web_search){let e="string"==typeof r.query?r.query.trim():"";return e?`Searching \xb7 ${e}`:null}if(e===t.TOOL_NAMES.routine){if("create"===r.action){let e=["string"==typeof r.bot?r.bot.trim():"",function(e){if("string"==typeof e.at&&e.at.length>=16){let[t,r]=e.at.split(" "),[n,a,l]=t.split("-").map(Number),i=new Date(n,a-1,l);if(i.toDateString()===new Date().toDateString())return`once at ${r}`;let s=i.toLocaleDateString("en-US",{month:"short",day:"numeric"});return`once, ${s} ${r}`}return"string"==typeof e.time&&e.time?`daily at ${e.time}`:"number"==typeof e.everyHours?`every ${e.everyHours} hours`:null}(r)].filter(Boolean).join(", ");return e?`Setting a routine \xb7 ${e}`:"Setting a routine"}return"change"===r.action?"Changing a routine":"delete"===r.action?"Deleting a routine":null}let a="string"==typeof r.thread?r.thread.trim():"";return e===t.TOOL_NAMES.thread_tell?n?`Telling ${n}`:"Passing that on":e===t.TOOL_NAMES.thread_answer?n?`Answering ${n}`:"Answering that":e===t.TOOL_NAMES.thread_cancel?a?`Stopping ${a}`:"Stopping that":e===t.TOOL_NAMES.thread_seen?a?`Marking ${a} as read`:"Marking that as read":e===t.TOOL_NAMES.thread_show?a?`Opening ${a}`:"Opening that":e===t.TOOL_NAMES.thread_status?a&&"all"!==a.toLowerCase()?`Checking on ${a}`:"Checking on the work":null}(e,s,l))??r[e]??((i=e.indexOf("__"))<=0?null:`Reaching ${e.slice(0,i).replace(/[-_]/g," ")}`)}])},319841,e=>{"use strict";var t=e.i(271645);let r=["ctrl","alt","meta"],n=/^(Control|Alt|Shift|Meta|OS)/,a=/^(input|textarea|select)$/i,l=e=>!!e&&!!(a.test(e.tagName)||e.isContentEditable||e.closest?.("[data-hotkey-capture]"));function i(e){let{code:t,ctrlKey:r,altKey:a,shiftKey:l,metaKey:i}=e;if(!t||n.test(t)||!r&&!a&&!i)return null;let s=[];return r&&s.push("ctrl"),a&&s.push("alt"),l&&s.push("shift"),i&&s.push("meta"),[...s,t].join("+")}let s={ctrl:["Ctrl","⌃"],alt:["Alt","⌥"],shift:["Shift","⇧"],meta:["Meta","⌘"]};e.s(["HOTKEY_CAPTURE",0,{"data-hotkey-capture":""},"capturesKeys",0,l,"comboOf",0,i,"isCombo",0,e=>{let t=e.split("+"),a=t.at(-1);return!!(a&&!n.test(a)&&t.slice(0,-1).some(e=>r.includes(e)))},"useHotkey",0,function({enabled:e,combo:r,onPress:n}){let a=(0,t.useRef)(n);a.current=n,(0,t.useEffect)(()=>{if(!e||!r)return;let t=e=>{e.repeat||l(e.target)||i(e)===r&&(e.preventDefault(),a.current())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,r])},"useHotkeyLabel",0,function(e){let[r,n]=(0,t.useState)(!1);return(0,t.useEffect)(()=>n(/mac/i.test(navigator.userAgent)),[]),e?function(e,t=!1){let r=e.split("+"),n=r.at(-1)??"",a=r.slice(0,-1).map(e=>s[e]?.[+!!t]??e),l=n.replace(/^(Key|Digit|Numpad)/,"").replace(/([a-z])([A-Z])/g,"$1 $2")||n;return t?[...a,l].join(""):[...a,l].join(" + ")}(e,r):null}])}]);