1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1334],{1334:function(e,t,n){n.d(t,{Sh:function(){return tN},MarketPrices:function(){return nF},Pj:function(){return t_},O5:function(){return tb},vn:function(){return tS},Wi:function(){return te.W}});var i,s=n(33188),r=n(27573),a=n(50294),o=n(88146),l=n(7653),c=n(3458),d=n(93497),u=n(31574),m=n(56240),x=n(73305),p=n(62049),h=n(74229),f=n(32316),v=n(69130),g=n(20775),b=n(17804),j=n(19661),k=n(10767),y=n(81698),w=n(84287),N=n(99612);function _(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")}function C(){return(0,r.jsxs)("svg",{className:"h-5 w-5 shrink-0 text-ink-muted",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M3 5h18"}),(0,r.jsx)("path",{d:"M6 12h12"}),(0,r.jsx)("path",{d:"M10 19h4"})]})}function M(e){let{className:t="h-4 w-4 shrink-0 text-ink-faint"}=e;return(0,r.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"m6 9 6 6 6-6"})})}function S(e){let{className:t="h-4 w-4"}=e;return(0,r.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,r.jsx)("path",{d:"m20 20-3.2-3.2"})]})}function L(e){let{className:t="h-3.5 w-3.5"}=e;return(0,r.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M20 6 9 17l-5-5"})})}function A(e){var t,n;let{options:i,selected:s,onToggle:a,onClear:o,ariaLabel:c,label:d="Provider",className:u="",triggerClassName:m="",contentClassName:x="",align:p="end",searchPlaceholder:h="Search providers"}=e,[f,v]=(0,l.useState)(!1),[g,b]=(0,l.useState)(""),[j,k]=(0,l.useState)(0),y=(0,l.useRef)(null),w=(0,l.useRef)(null),A=(0,l.useId)(),q="".concat(A,"-listbox"),F="".concat(A,"-opt"),E=s.length,P=0===E?"All providers":1===E?null!==(n=null===(t=i.find(e=>e.key===s[0]))||void 0===t?void 0:t.label)&&void 0!==n?n:s[0]:"".concat(E," providers"),I=g.trim().toLowerCase(),R=(0,l.useMemo)(()=>I?i.filter(e=>e.label.toLowerCase().includes(I)||e.key.toLowerCase().includes(I)):i,[i,I]),B=(0,l.useMemo)(()=>{let e=[];return i.length>0&&!I&&e.push({kind:"all"}),R.forEach(t=>e.push({kind:"provider",option:t})),e},[i.length,I,R]);(0,l.useEffect)(()=>{f&&k(0)},[B,f]),(0,l.useEffect)(()=>{var e;if(!f)return;let t=null===(e=w.current)||void 0===e?void 0:e.querySelector('[data-active="true"]');null==t||t.scrollIntoView({block:"nearest"})},[j,f]);let z=e=>{e&&("all"===e.kind?o():a(e.option.key))},T=e=>{0!==B.length&&k(t=>(t+e+B.length)%B.length)},Z=f&&B[j]?"".concat(F,"-").concat(j):void 0;return(0,r.jsxs)(N.J2,{open:f,onOpenChange:e=>{v(e),b("")},modal:!1,children:[(0,r.jsx)(N.xo,{asChild:!0,children:(0,r.jsxs)("button",{type:"button","aria-label":E>0?"".concat(c,", ").concat(P):c,"aria-haspopup":"listbox",className:_("group relative h-12 w-full rounded-md bg-surface-snippet-btn shadow focus-visible:shadow-md data-[state=open]:shadow-md dark:shadow-none dark:focus-visible:shadow-none dark:data-[state=open]:shadow-none pb-1 pl-11 pr-10 pt-5 text-left text-[13px] font-semibold text-ink outline-none transition hover:bg-surface-snippet-btn-hover focus-visible:bg-surface-snippet-btn-hover data-[state=open]:bg-surface-snippet-btn-hover",u,m),children:[(0,r.jsx)("span",{className:"pointer-events-none absolute left-4 top-1/2 -translate-y-1/2",children:(0,r.jsx)(C,{})}),(0,r.jsx)("span",{className:"pointer-events-none absolute left-11 top-2 text-[10px] font-medium text-ink-faint",children:d}),(0,r.jsx)("span",{className:"block truncate",children:P}),(0,r.jsx)("span",{className:"pointer-events-none absolute right-4 top-1/2 -translate-y-1/2",children:(0,r.jsx)(M,{className:"h-4 w-4 shrink-0 text-ink-faint transition-transform group-data-[state=open]:rotate-180"})})]})}),(0,r.jsxs)(N.yk,{align:p,onOpenAutoFocus:e=>{var t;e.preventDefault(),null===(t=y.current)||void 0===t||t.focus()},className:_("flex max-h-[min(420px,var(--radix-popover-content-available-height))] w-[min(calc(100vw-2rem),320px)] flex-col p-0 sm:w-[320px]",x),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 pb-1.5 pt-3",children:[(0,r.jsx)("span",{className:"text-[11px] font-medium text-ink-faint",children:"Filter by provider"}),E>0?(0,r.jsx)("button",{type:"button",onClick:o,className:"rounded text-[11px] font-medium text-ink-muted transition-colors hover:text-ink",children:"Clear"}):null]}),0===i.length?(0,r.jsx)("p",{className:"px-4 pb-4 pt-1 text-[13px] text-ink-faint",children:"No providers available"}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"relative px-3 pb-2",children:[(0,r.jsx)(S,{className:"pointer-events-none absolute left-5 top-1/2 h-4 w-4 -translate-y-1/2 text-ink-faint"}),(0,r.jsx)("input",{ref:y,type:"text",value:g,onChange:e=>b(e.target.value),onKeyDown:e=>{switch(e.key){case"ArrowDown":e.preventDefault(),T(1);break;case"ArrowUp":e.preventDefault(),T(-1);break;case"Home":e.preventDefault(),k(0);break;case"End":e.preventDefault(),k(Math.max(0,B.length-1));break;case"Enter":e.preventDefault(),z(B[j])}},placeholder:h,role:"combobox","aria-label":"Search providers","aria-expanded":f,"aria-controls":q,"aria-autocomplete":"list","aria-activedescendant":Z,autoComplete:"off",spellCheck:!1,className:"h-9 w-full rounded-md bg-surface-sunken pl-8 pr-8 text-[13px] text-ink outline-none placeholder:text-ink-faint focus-visible:ring-1 focus-visible:ring-overlay/20"}),g?(0,r.jsx)("button",{type:"button","aria-label":"Clear search",onClick:()=>{var e;b(""),null===(e=y.current)||void 0===e||e.focus()},className:"absolute right-5 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded text-ink-muted transition-colors hover:text-ink",children:(0,r.jsx)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})}):null]}),(0,r.jsx)("div",{ref:w,id:q,role:"listbox","aria-label":c,"aria-multiselectable":"true",className:"interaction-scrollbar min-h-0 flex-1 overflow-y-auto pb-1",children:0===B.length?(0,r.jsxs)("p",{role:"status",className:"px-4 py-6 text-center text-[13px] text-ink-faint",children:["No providers match â",g.trim(),"â"]}
1):B.map((e,t)=>{let n=t===j;if("all"===e.kind){let e=0===E;return(0,r.jsxs)("button",{type:"button",tabIndex:-1,id:"".concat(F,"-").concat(t),role:"option","aria-selected":e,"data-active":n||void 0,onClick:()=>o(),onPointerMove:()=>k(t),className:_("relative flex w-full items-center py-2.5 pl-9 pr-4 text-left text-[14px] outline-none transition-colors",n&&!e&&"bg-surface-menu-active",e?"bg-select-active text-bright":"text-ink"),children:[e?(0,r.jsx)("span",{className:"absolute left-3 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(L,{})}):null,(0,r.jsx)("span",{className:"truncate",children:"All providers"})]},"__all__")}let i=e.option,l=s.includes(i.key);return(0,r.jsxs)("button",{type:"button",tabIndex:-1,id:"".concat(F,"-").concat(t),role:"option","aria-selected":l,"aria-label":"".concat(i.label,", ").concat(i.count," ").concat(1===i.count?"model":"models"),"data-active":n||void 0,onClick:()=>a(i.key),onPointerMove:()=>k(t),className:_("group/row relative flex w-full items-center justify-between gap-3 py-2.5 pl-9 pr-4 text-left text-[14px] outline-none transition-colors",n&&!l&&"bg-surface-menu-active",l?"bg-select-active text-bright":"text-ink"),children:[l?(0,r.jsx)("span",{className:"absolute left-3 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(L,{})}):null,(0,r.jsx)("span",{className:"truncate",children:i.label}),(0,r.jsx)("span",{className:_("shrink-0 text-[11px]",l?"text-bright":"text-ink-faint"),"aria-hidden":"true",children:i.count})]},i.key)})})]})]})]})}var q=n(74765),F=n(1742),E=n(79362),P=n(34124),I=n(20423),R=n(27650),B=n(85696),z=n(18521),T=n(50781),Z=n(32272),W=n(91958),D=n(11973),O=n(94744),U=n(24123),H=n(82763),V=n(45385);let $=e=>"function"==typeof e,K=e=>"function"==typeof e&&e.prototype&&(!!e.prototype.isReactComponent||!!e.prototype.render),Y=e=>{var t;return"object"==typeof e&&null!==e&&(null===(t=e.$$typeof)||void 0===t?void 0:t.toString())==="Symbol(react.forward_ref)"},J=e=>$(e)||Y(e)||K(e),G=(0,V.L)({common:{root:"group/button-group inline-flex h-max cursor-pointer items-center justify-center whitespace-nowrap rounded-control bg-transparent font-medium text-ink-muted outline-primary transition duration-100 ease-linear",hover:"bg-surface-seg-hover text-ink",focus:"z-10 outline outline-2 outline-offset-2",disabled:"cursor-not-allowed text-ink-disabled",selected:"bg-surface-seg-thumb font-semibold text-ink shadow-sm",icon:"pointer-events-none text-ink-dim transition-[inherit] group-hover/button-group:text-ink-muted"},sizes:{sm:{root:"gap-1.5 px-3 py-1.5 text-sm",icon:"size-5"},md:{root:"gap-1.5 px-4 py-2 text-sm",icon:"size-5"},lg:{root:"gap-2 px-4 py-2.5 text-base",icon:"size-5"}}}),Q=(0,l.createContext)(null),X=e=>{let{iconLeading:t,iconTrailing:n,children:i,className:s,...a}=e,o=(0,l.useContext)(Q);if(!o)throw Error("ButtonGroupItem must be used within a ButtonGroup component");let{size:c}=o,d=(t||n)&&!i;return(0,r.jsxs)(U.C,{...a,"data-icon-only":!!d||void 0,"data-icon-leading":!!t||void 0,className:e=>{let{isHovered:t,isFocusVisible:n,isDisabled:i,isSelected:r}=e;return(0,V.cx)(G.common.root,G.sizes[c].root,d&&"px-2.5",t&&G.common.hover,n&&G.common.focus,r&&G.common.selected,i&&G.common.disabled,s)},children:[J(t)&&(0,r.jsx)(t,{className:(0,V.cx)(G.common.icon,G.sizes[c].icon)}),(0,l.isValidElement)(t)&&t,i,J(n)&&(0,r.jsx)(n,{className:(0,V.cx)(G.common.icon,G.sizes[c].icon)}),(0,l.isValidElement)(n)&&n]})};X.displayName="ButtonGroupItem";let ee=e=>{let{children:t,size:n="md",className:i,...s}=e;return(0,r.jsx)(Q.Provider,{value:{size:n},children:(0,r.jsx)(H.th,{selectionMode:"single",className:(0,V.cx)("relative z-0 inline-flex w-max gap-0.5 rounded-control bg-surface-seg p-0.5",i),...s,children:t})})};ee.displayName="ButtonGroup";var et=n(35576),en=n(985);let ei=(0,V.L)({default:"hidden",bottom:"absolute left-1/2 top-2 -translate-x-1/2 translate-y-full text-sm font-medium text-ink","top-floating":"absolute -top-2 left-1/2 -translate-x-1/2 -translate-y-full rounded-lg bg-surface-popover px-2 py-1.5 text-xs font-semibold text-ink-secondary shadow-lg ring-1 ring-divider"}),es=e=>{let{labelPosition:t="default",minValue:n=0,maxValue:i=100,labelFormatter:s,formatOptions:a,...o}=e;return(0,r.jsxs)(et.iR,{...o,minValue:n,maxValue:i,formatOptions:null!=a?a:{style:"percent",maximumFractionDigits:0},children:[(0,r.jsx)(en._,{}),(0,r.jsx)(et.Uj,{className:"relative h-6 w-full",children:e=>{let{state:{values:n,getThumbValue:i,getThumbPercent:a,getFormattedValue:o}}=e,l=1===n.length?0:a(0),c=1===n.length?a(0):a(1)-l;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"absolute top-1/2 h-2 w-full -translate-y-1/2 roun
1ded-control bg-overlay/10"}),(0,r.jsx)("span",{className:"absolute top-1/2 h-2 -translate-y-1/2 rounded-control bg-action",style:{left:"".concat(100*l,"%"),width:"".concat(100*c,"%")}}),n.map((e,n)=>(0,r.jsx)(et.gs,{index:n,className:e=>{let{isFocusVisible:t,isDragging:n}=e;return(0,V.cx)("top-1/2 box-border size-5 cursor-grab rounded-indicator bg-surface-page shadow-md ring-2 ring-inset ring-action",t&&"outline outline-2 outline-offset-2 outline-primary",n&&"cursor-grabbing")},children:(0,r.jsx)(et.Iz,{className:(0,V.cx)("whitespace-nowrap",ei[t]),children:s?s(i(n)):o(i(n)/100)})},n))]})}})]})};es.displayName="Slider";var er=n(10529);let ea=e=>{let{className:t,isFocused:n,isSelected:i,isDisabled:s,size:a="sm"}=e;return(0,r.jsx)("div",{className:(0,V.cx)("relative flex cursor-pointer appearance-none items-center justify-center rounded bg-surface-page ring-1 ring-inset ring-overlay/10","sm"===a&&"size-3.5","md"===a&&"size-4","lg"===a&&"size-4",i&&"bg-action ring-action",s&&"cursor-not-allowed opacity-50",n&&"outline outline-2 outline-offset-2 outline-primary",t),children:(0,r.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 14 14",fill:"none",className:(0,V.cx)("pointer-events-none absolute text-action-fg opacity-0 transition-opacity","sm"===a&&"size-2.5","md"===a&&"size-3","lg"===a&&"size-3.5",i&&"opacity-100"),children:(0,r.jsx)("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})};ea.displayName="TagCheckbox";let eo=(0,l.createContext)({selectionMode:"none",size:"sm"}),el=e=>{let{label:t,selectionMode:n="none",size:i="sm",children:s,...a}=e;return(0,r.jsx)(eo.Provider,{value:{selectionMode:n,size:i},children:(0,r.jsx)(er.QS,{"aria-label":t,selectionMode:n,disallowEmptySelection:"single"===n,...a,children:s})})};el.displayName="TagGroup";let ec=er.PS,ed={sm:{root:{base:"px-2 py-1 text-xs font-medium",withCheckbox:"pl-1.5",withCount:"pr-1"},content:"gap-1.5",count:"px-1 text-xs font-medium"},md:{root:{base:"px-2.5 py-1.5 text-sm font-medium",withCheckbox:"pl-2",withCount:"pr-1"},content:"gap-1.5",count:"px-1 text-xs font-medium"},lg:{root:{base:"px-3 py-1.5 text-sm font-medium",withCheckbox:"pl-2",withCount:"pr-1"},content:"gap-2",count:"px-1.5 text-sm font-medium"}},eu=e=>{let{id:t,isDisabled:n,count:i,icon:s,className:a,children:o,textValue:c,...d}=e,u=(0,l.useContext)(eo);return(0,r.jsx)(er.Vp,{...d,id:t,isDisabled:n,textValue:null!=c?c:"string"==typeof o?o:void 0,className:e=>(0,V.cx)("flex cursor-default items-center gap-0.5 rounded-control bg-surface-chip text-ink-muted outline-primary transition duration-100 ease-linear",ed[u.size].root.base,"number"==typeof i&&ed[u.size].root.withCount,"none"!==u.selectionMode&&(0,V.cx)("cursor-pointer",ed[u.size].root.withCheckbox),e.isHovered&&"none"!==u.selectionMode&&"bg-surface-chip-hover text-ink",e.isSelected&&"bg-surface-seg-thumb text-ink",e.isFocusVisible&&"outline outline-2 outline-offset-2",n&&"cursor-not-allowed opacity-50","function"==typeof a?a(e):a),children:e=>{let{isSelected:t,isDisabled:n}=e;return(0,r.jsxs)("div",{className:(0,V.cx)("flex items-center",ed[u.size].content),children:["none"!==u.selectionMode?(0,r.jsx)(ea,{size:u.size,isSelected:t,isDisabled:n}):null,s?(0,r.jsx)(s,{className:(0,V.cx)("size-3.5 shrink-0",t?"text-ink":"text-ink-dim"),"aria-hidden":"true"}):null,o,"number"==typeof i?(0,r.jsx)("span",{className:(0,V.cx)("flex items-center justify-center rounded bg-surface-sunken text-center text-ink-muted",ed[u.size].count),children:i}):null]})}})};eu.displayName="Tag";var em=n(99488);let ex=e=>{let{className:t,isHovered:n,isDisabled:i,isFocusVisible:s,isSelected:a,slim:o,size:l="sm"}=e,c={default:{sm:{root:"h-5 w-9 p-0.5",switch:(0,V.cx)("size-4",a&&"translate-x-4")},md:{root:"h-6 w-11 p-0.5",switch:(0,V.cx)("size-5",a&&"translate-x-5")}},slim:{sm:{root:"h-4 w-8",switch:(0,V.cx)("size-4",a&&"translate-x-4")},md:{root:"h-5 w-10",switch:(0,V.cx)("size-5",a&&"translate-x-5")}}},d=o?c.slim[l]:c.default[l];return(0,r.jsx)("div",{className:(0,V.cx)("cursor-pointer rounded-control bg-surface-switch-off outline-primary transition duration-150 ease-linear",!a&&n&&"bg-surface-switch-off-hover",a&&"bg-action",a&&n&&"bg-action-hover",i&&"cursor-not-allowed opacity-50",s&&"outline outline-2 outline-offset-2",d.root,t),children:(0,r.jsx)("div",{style:{transition:"transform 0.15s ease-in-out, background-color 0.1s linear"},className:(0,V.cx)("rounded-indicator bg-action-fg shadow-sm",d.switch)})})},ep={sm:{root:"gap-2",textWrapper:"",label:"text-sm font-medium",hint:"text-sm"},md:{root:"gap-3",textWrapper:"gap-0.5",label:"text-base font-medium",hint:"text-base"}},eh=e=>{let{label:t,hint:n,className:i,size:s="sm",slim:a,...o}=e;return(0,r.jsx)(em.rs,{...o,className:e=>(0,V.cx)("relative flex w-max items-start",e.isDisabled&&"cursor-not-allowed",ep[s].root,"function"==typeof i?i(e):i),children:e=>{let{isSelected:i,isDisabled:o,isFocusVisible:l,isHovered:c}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ex,{slim:a,size:s,isHovered:c,isDisabled:o,isFocusVisible:l,isSelected:i,className:a?"mt-0.5":""}),t||n?(0,r.jsxs)("div",{className:(0,V.cx)("flex flex-col",ep[s].textWrapper),children:[t?(0,r.jsx)("p",{className:(0,V.cx)("select-none text-ink-secondary",ep[s].label),children:t}):null,n?(0,r.jsx)("span",{className:(0,V.cx)("text-ink-muted",ep[s].hint),children:n}):null]}):null]})}})};eh.displayName="Toggle";var ef=n(45236);let ev={min:0,max:null},eg=[0,32e3,128e3,2e5,1e6],eb=[0,.5,2,10,30],ej=[0,100,1e3,1e4,1e5],ek=[{key:"text",label:"Text",icon:z.Z},{key:"image",label:"Image",icon:T.Z},{key:"audio",label:"Audio",icon:Z.Z},{key:"video",label:"Video",icon:W.Z},{key:"file",label:"Files",icon:D.Z}],ey=[{value:"all",label:"All"},{value:"trusted",label:"Trusted"},{value:"untrusted",label:"Untrusted"}],ew=(0,ef.my)(eg),eN=(0,ef.my)(eb),e_=(0,ef.my)(ej),eC=null!==(i=eb[eb.length-1])&&void 0!==i?i:30,eM=e=>e<=0?"Any":"".concat((0,ef.hw)(e),"+"),eS=e=>e<=0?"Any":"".concat((0,ef.lb)(e)," / day"),eL=e=>e<=0?"Any":"".concat(e,"+"),eA=e=>{if(e.min<=0&&null===e.max)return"Any";let t=e.min<=0?"Free":(0,ef.lb)(e.min),n=null===e.max?"".concat((0,ef.lb)(eC),"+"):(0,ef.lb)(e.max);return null!==e.max&&e.max===e.min?t:"".concat(t," â ").concat(n)},eq="si-rail-collapsed";function eF(e){let{id:t,title:n,trailing:i,collapsed:s,onToggle:a,children:o}=e,l="rail-section-".concat(t);return(0,r.jsxs)("div",{className:"border-t border-divider pt-3",children:[(0,r.jsxs)("div",{className:(0,V.cx)("relative flex h-8 items-center",!s&&"mb-1.5"),children:[(0,r.jsxs)("button",{type:"button","aria-expanded":!s,"aria-controls":l,onClick:a,className:"group/section absolute -inset-x-1.5 inset-y-0 flex items-center justify-between rounded-control px-1.5 text-[11px] font-medium uppercase tracking-wider text-ink-dim transition-colors hover:bg-surface-hover hover:text-ink-muted",children:[(0,r.jsx)("span",{className:"whitespace-nowrap",children:n}),(0,r.jsx)(O.Z,{className:(0,V.cx)("size-3.5 shrink-0 transition-transform",s&&"-rotate-90"),"aria-hidden":"true"})]}),i?(0,r.jsx)("div",{className:"relative z-10 ml-auto mr-5 flex min-w-0 items-center",children:i}):null]}),s?null:(0,r.jsx)("div",{id:l,children:o})]})}function eE(e){let{value:t,label:n,parse:i,onCommit:s,width:a="w-20"}=e,[o,c]=(0,l.useState)(!1),[d,u]=(0,l.useState)(t),m=(0,l.useRef)(null);(0,l.useEffect)(()=>{var e;o&&(null===(e=m.current)||void 0===e||e.select())}
1,[o]);let x=()=>{c(!1),d.trim()!==t&&i(d)&&(null==s||s())};return o?(0,r.jsx)("input",{ref:m,type:"text",inputMode:"decimal","aria-label":n,value:d,onChange:e=>u(e.target.value),onBlur:x,onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),x()):"Escape"===e.key&&(e.preventDefault(),c(!1))},className:(0,V.cx)("h-6 rounded-control bg-surface-field px-1.5 text-right text-[13px] font-medium tabular-nums text-ink outline-none ring-1 ring-inset ring-action",a)}):(0,r.jsx)("button",{type:"button","aria-label":n,title:"Click to type a value",onClick:()=>{u(t),c(!0)},className:"-mr-1.5 min-w-0 truncate rounded-control px-1.5 py-0.5 text-[13px] font-medium tabular-nums text-ink transition-colors hover:bg-surface-hover",children:t})}function eP(e){let{labels:t}=e,n=t.length-1,i=new Set([0,Math.floor(n/2),n]);return(0,r.jsx)("div",{className:"relative mt-1 h-7","aria-hidden":"true",children:t.map((e,t)=>(0,r.jsxs)("div",{className:"absolute top-0 -translate-x-1/2",style:{left:"".concat(t/n*100,"%")},children:[(0,r.jsx)("div",{className:"mx-auto h-2 w-px bg-overlay/25"}),i.has(t)?(0,r.jsx)("div",{className:(0,V.cx)("absolute top-3 whitespace-nowrap text-[11px] font-medium tabular-nums text-ink-dim",0===t?"left-1/2":t===n?"right-1/2":"left-1/2 -translate-x-1/2"),children:e}):null]},"".concat(t,"-").concat(e)))})}let eI=eg.map((e,t)=>0===t?"Any":t===eg.length-1?"".concat((0,ef.hw)(e),"+"):(0,ef.hw)(e)),eR=eb.map((e,t)=>0===t?"Free":t===eb.length-1?"".concat((0,ef.lb)(e),"+"):(0,ef.lb)(e)),eB=["Any",String(5),"".concat(10,"+")],ez=ej.map((e,t)=>0===t?"Any":t===ej.length-1?"".concat((0,ef.lb)(e),"+"):(0,ef.lb)(e));function eT(e){let{className:t,provider:n,trust:i,onTrustChange:s,minContext:a,onMinContextChange:o,minDiscount:c,onMinDiscountChange:d,priceRange:u,onPriceRangeChange:m,selectedInputs:x,onSelectedInputsChange:p,capabilities:h,capabilitiesLabel:f="Capabilities",selectedCaps:v,onSelectedCapsChange:g,minSellers:b,onMinSellersChange:j,minLiquidity:k,onMinLiquidityChange:y,uncappedOnly:w,onUncappedOnlyChange:N,isDirty:_,onReset:C,shownCount:M,totalCount:S,scrollContainer:L=!0,showFooter:A=!0}=e,q=e=>{var t;return Array.isArray(e)?null!==(t=e[0])&&void 0!==t?t:0:e},[F,E]=(0,l.useState)(()=>new Set);(0,l.useEffect)(()=>{E(function(){try{let e=window.localStorage.getItem(eq),t=e?JSON.parse(e):[];return new Set(Array.isArray(t)?t.filter(e=>"string"==typeof e):[])}catch(e){return new Set}}())},[]);let P=e=>({id:e,collapsed:F.has(e),onToggle:()=>E(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),!function(e){try{window.localStorage.setItem(eq,JSON.stringify([...e]))}catch(e){}}(n),n})});return(0,r.jsx)("aside",{className:t,"aria-label":"Marketplace filters",children:(0,r.jsxs)("div",{className:(0,V.cx)(L?"interaction-scrollbar lg:sticky lg:top-20 lg:-mx-3 lg:max-h-[calc(100vh-5rem)] lg:overflow-y-auto lg:px-3 lg:pb-4 lg:pt-3.5":"pt-0.5"),children:[(0,r.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-2 text-[11px] font-medium uppercase tracking-wider text-ink-dim",children:[(0,r.jsx)(I.Z,{className:"size-3.5"})," Filters"]}),_?(0,r.jsx)("button",{type:"button",onClick:C,className:"text-[11px] font-medium text-ink-muted transition-colors hover:text-ink",children:"Reset"}):null]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("div",{className:"mb-1.5 text-[11px] font-medium uppercase tracking-wider text-ink-dim",children:"Provider"}),n]}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)(eF,{title:"Seller trust",...P("trust"),children:(0,r.jsx)(ee,{size:"sm","aria-label":"Seller trust",className:"w-full",disallowEmptySelection:!0,selectedKeys:[i],onSelectionChange:e=>{let t=ey.find(t=>e.has(t.value));t&&t.value!==i&&s(t.value)},children:ey.map(e=>(0,r.jsx)(X,{id:e.value,className:"flex-1 px-2",children:e.label},e.value))})}),(0,r.jsxs)(eF,{title:"Context window",...P("context"),trailing:(0,r.jsx)(eE,{value:eM(a),label:"Minimum context window, editable",parse:e=>{let t=(0,ef.Vm)(e);return null!==t&&(o(Math.round(t)),!0)}}),children:[(0,r.jsx)(es,{"aria-label":"Minimum context window",minValue:0,maxValue:ew.max,step:.02,formatOptions:{maximumFractionDigits:2},value:ew.toPosition(a),onChange:e=>o(Math.round(ew.fromPosition(q(e))))}),(0,r.jsx)(eP,{labels:eI})]}),(0,r.jsx)(eF,{title:"Minimum discount",...P("discount"),trailing:(0,r.jsx)(eE,{value:"".concat(c,"%+"),label:"Minimum discount, editable",parse:e=>{let t=(0,ef.GM)(e);return null!==t&&(d(t),!0)}}),children:(0,r.jsx)(es,{"aria-label":"Minimum discount",minValue:0,maxValue:100,step:1,value:c,onChange:e=>d(q(e))})}),(0,r.jsxs)(eF,{title:"Output price / 1M",...P("price"),trailing:(0,r.jsx)(eE,{value:eA(u),label:"Output price range, editable",width:"w-28",parse:e=>{let t=(0,ef.Xj)(e);return null!==t&&(m(t),!0)}}),children:[(0,r.jsx)(es,{"aria-label":"Output price per 1M tokens",minValue:0,maxValue:eN.max,step:.02,formatOptions:{maximumFractionDigits:2},value:[eN.toPosition(u.min),null===u.max?eN.max:eN.toPosition(u.max)],onChange:e=>{var t,n;if(!Array.isArray(e))return;let i=eN.fromPosition(null!==(t=e[0])&&void 0!==t?t:0),s=null!==(n=e[1])&&void 0!==n?n:eN.max;m({min:i,max:s>=eN.max?null:eN.fromPosition(s)})}}),(0,r.jsx)(eP,{labels:eR})]}),(0,r.jsx)(eF,{title:"Input",...P("input"),children:(0,r.jsx)(el,{label:"Input modalities",size:"md",selectionMode:"multiple",selectedKeys:x,onSelectionChange:e=>{p("all"===e?ek.map(e=>e.key):ek.map(e=>e.key).filter(t=>e.has(t)))},children:(0,r.jsx)(ec,{className:"flex flex-wrap gap-1.5",children:ek.map(e=>(0,r.jsx)(eu,{id:e.key,icon:e.icon,textValue:e.label,children:e.label},e.key))})})}),(0,r.jsx)(eF,{title:"Capabilities",...P("capabilities"),children:(0,r.jsx)(el,{label:f,size:"md",selectionMode:"multiple",selectedKeys:v,onSelectionChange:e=>{g("all"===e?h.map(e=>e.key):h.map(e=>e.key).filter(t=>e.has(t)))},children:(0,r.jsx)(ec,{className:"flex flex-wrap gap-1.5",children:h.map(e=>(0,r.jsx)(eu,{id:e.key,icon:e.icon,textValue:e.label,children:e.label},e.key))})})}),(0,r.jsxs)(eF,{title:"Healthy sellers",...P("sellers"),trailing:(0,r.jsx)(eE,{value:eL(b),label:"Minimum healthy sellers, editable",parse:e=>{let t=(0,ef.Vm)(e);return null!==t&&(j(Math.round(t)),!0)}}),children:[(0,r.jsx)(es,{"aria-label":"Minimum healthy sellers",minValue:0,maxValue:10,step:1,formatOptions:{maximumFractionDigits:0},value:Math.min(b,10),onChange:e=>j(q(e))}),(0,r.jsx)(eP,{labels:eB})]}),(0,r.jsxs)(eF,{title:"Capacity / day",...P("capacity"),trailing:(0,r.jsx)(eE,{value:eS(k),label:"Minimum daily capacity, editable",width:"w-24",parse:e=>{let t=(0,ef.Vm)(e.replace(/\/\s*day$/i,""));return null!==t&&(y(t),!0)}}),children:[(0,r.jsx)(es,{"aria-label":"Minimum daily capacity",minValue:0,maxValue:e_.max,step:.02,formatOptions:{maximumFractionDigits:2},value:e_.toPosition(k),onChange:e=>y(e_.fromPosition(q(e)))}),(0,r.jsx)(eP,{labels:ez}),(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)(eh,{size:"sm",label:"Uncapped only",isSelected:w,onChange:N,className:(0,V.cx)("w-full justify-between","flex-row-reverse")})})]})]}),A?(0,r.jsxs)("p",{className:"mt-4 border-t border-divider pt-3 text-[12px] text-ink-dim",children:["Showing ",(0,r.jsx)("span",{className:"font-medium text-ink-muted",children:M})," of ",S]}):null]})})}var eZ=n(96173);function eW(e){let{className:t,children:n,chips:i,shownCount:s,totalCount:a,onReset:o}=e,[d,u]=(0,l.useState)(!1),m=1===s?"model":"models",[x,p]=(0,l.useState)(!1);return(0,l.useEffect)(()=>p(!0),[]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{"data-testid":"marketplace-filter-dock",className:(0,V.cx)("fixed inset-x-0 bottom-0 z-40 border-t border-divider bg-surface-page/95 pb-[env(safe-area-inset-bottom)] backdrop-blur",t),children:(0,r.jsxs)("div",{className:"flex h-14 items-center gap-2 px-3",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>u(!0),"aria-haspopup":"dialog","aria-expanded":d,className:"inline-flex h-9 shrink-0 items-center gap-1.5 rounded-control bg-surface-btn px-3 text-[13px] font-semibold text-ink transition-colors hover:bg-surface-btn-hover",children:[(0,r.jsx)(I.Z,{className:"size-3.5"}),"Filters",i.length>0?(0,r.jsx)("span",{className:"ml-0.5 inline-flex min-w-5 items-center justify-center rounded-indicator bg-action px-1.5 text-[11px] font-semibold tabular-nums text-action-fg",children:i.length}):null]}),(0,r.jsx)("div",{className:"interaction-scrollbar flex min-w-0 flex-1 items-center gap-1.5 overflow-x-auto","aria-label":"Active filters",children:0===i.length?(0,r.jsx)("span",{className:"truncate text-[12px] text-ink-dim",children:"No filters"}):i.map(e=>(0,r.jsxs)("button",{type:"button",onClick:e.onRemove,"aria-label":"Remove ".concat(e.label," filter"),className:"inline-flex h-7 shrink-0 items-center gap-1 whitespace-nowrap rounded-control bg-surface-chip pl-2.5 pr-1.5 text-[12px] font-medium text-ink-secondary transition-colors hover:bg-surface-chip-hover hover:text-ink",children:[e.label,(0,r.jsx)(B.Z,{className:"size-3 text-ink-dim","aria-hidden":"true"})]},e.key))}),(0,r.jsxs)("span",{className:"shrink-0 text-[12px] tabular-nums text-ink-muted","aria-live":"polite",children:[(0,r.jsx)("span",{className:"font-semibold text-ink",children:s})," of ",a]})]})}),x?(0,c.createPortal)((0,r.jsx)("div",{"data-testid":"marketplace-filter-dock-spacer","aria-hidden":"true",className:"h-14 md:hidden"}),document.body):null,(0,r.jsx)(eZ.c,{open:d,onClose:()=>u(!1),title:"Filters",surfaceClassName:"bg-surface-page",children:(0,r.jsxs)("div",{className:"-mx-5 -mb-5 -mt-2 flex max-h-[calc(90vh-7.5rem)] flex-col sm:-mx-6 sm:-mb-6",children:[(0,r.jsxs)("div",{className:"interaction-scrollbar min-h-0 flex-1 overflow-y-auto px-5 sm:px-6",children:[i.length>0?(0,r.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,r.jsxs)("span",{className:"text-[12px] text-ink-muted",children:[i.length," active ",1===i.length?"filter":"filters"]}),(0,r.jsx)("button",{type:"button",onClick:o,className:"text-[12px] font-medium text-ink-muted transition-colors hover:text-ink",children:"Reset all"})]}):null,n]}),(0,r.jsx)("div",{className:"shrink-0 border-t border-divider bg-surface-page px-5 pb-[calc(0.75rem+env(safe-area-inset-bottom))] pt-3 sm:px-6",children:(0,r.jsxs)("button",{type:"button",onClick:()=>u(!1),className:"flex h-11 w-full items-center justify-center rounded-control bg-action text-[14px] font-semibold text-action-fg transition-colors hover:bg-action-hover",children:["Show ",s," ",m]})})]})})]})}var eD=n(15175),eO=n(11455),eU=n(88403);let eH="rgb(var(--success-vivid))";function eV(e){let{className:t="h-4 w-4"}=e;return(0,r.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),(0,r.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,r.jsx)("path",{d:"M19 8v6M22 11h-6"})]})}function e$(e){let{className:t="h-4 w-4"}=e;return(0,r.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("rect",{x:"2",y:"5",width:"20",height:"14",rx:"2"}),(0,r.jsx)("path",{d:"M2 10h20"})]})}function eK(e){let{className:t="h-4 w-4"}=e;return(0,r.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"7.5",cy:"15.5",r:"4.5"}),(0,r.jsx)("path",{d:"m10.5 12.5 8-8M16 7l2 2M19 4l2 2"})]})}function eY(e){let{className:t="h-4 w-4"}=e;return(0,r.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("rect",{x:"8",y:"2",width:"8",he
1ight:"4",rx:"1"}),(0,r.jsx)("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"})]})}function eJ(e){let{className:t="h-3.5 w-3.5"}=e;return(0,r.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"m9 6 6 6-6 6"})})}function eG(e){let{className:t="h-4 w-4"}=e;return(0,r.jsxs)("svg",{className:t,viewBox:"0 0 48 48","aria-hidden":"true",children:[(0,r.jsx)("path",{fill:"#FFC107",d:"M43.611 20.083H42V20H24v8h11.303c-1.649 4.657-6.08 8-11.303 8-6.627 0-12-5.373-12-12s5.373-12 12-12c3.059 0 5.842 1.154 7.961 3.039l5.657-5.657C34.046 6.053 29.268 4 24 4 12.955 4 4 12.955 4 24s8.955 20 20 20 20-8.955 20-20c0-1.341-.138-2.65-.389-3.917z"}),(0,r.jsx)("path",{fill:"#FF3D00",d:"M6.306 14.691l6.571 4.819C14.655 15.108 18.961 12 24 12c3.059 0 5.842 1.154 7.961 3.039l5.657-5.657C34.046 6.053 29.268 4 24 4 16.318 4 9.656 8.337 6.306 14.691z"}),(0,r.jsx)("path",{fill:"#4CAF50",d:"M24 44c5.166 0 9.86-1.977 13.409-5.192l-6.19-5.238C29.211 35.091 26.715 36 24 36c-5.202 0-9.619-3.317-11.283-7.946l-6.522 5.025C9.505 39.556 16.227 44 24 44z"}),(0,r.jsx)("path",{fill:"#1976D2",d:"M43.611 20.083H42V20H24v8h11.303c-.792 2.237-2.231 4.166-4.087 5.571l6.19 5.238C36.971 39.205 44 34 44 24c0-1.341-.138-2.65-.389-3.917z"})]})}function eQ(e){let{className:t="h-4 w-4"}=e;return(0,r.jsxs)("svg",{className:t,viewBox:"0 0 32 32",fill:"#855DCD","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M7.5 6.5h17l-1.1 3.3H8.6L7.5 6.5Z"}),(0,r.jsx)("rect",{x:"8.6",y:"9.8",width:"3.4",height:"15.7",rx:"0.4"}),(0,r.jsx)("rect",{x:"20",y:"9.8",width:"3.4",height:"15.7",rx:"0.4"}),(0,r.jsx)("rect",{x:"12",y:"9.8",width:"8",height:"2.7"})]})}function eX(e){let{className:t="h-4 w-4"}=e;return(0,r.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M3 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2H5a1 1 0 0 0 0 2h14a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6Z"}),(0,r.jsx)("path",{d:"M16 13h.01"})]})}function e0(e){let{className:t="h-4 w-4"}=e;return(0,r.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),(0,r.jsx)("path",{d:"m3 7 9 6 9-6"})]})}function e1(e){let{n:t,icon:n,desc:i,children:s}=e;return(0,r.jsxs)("div",{className:"mb-2.5",children:[(0,r.jsxs)("div",{className:"flex h-[18px] items-center justify-between",children:[null!=n?n:(0,r.jsx)("span",{}),(0,r.jsx)("span",{className:"font-mono text-[11px] leading-none text-ink-dim",children:t})]}),(0,r.jsx)("div",{className:"mt-2.5 text-[15px] font-semibold leading-snug text-ink",children:s}),i?(0,r.jsx)("p",{className:"mt-1.5 text-[12px] leading-relaxed text-ink-dim",children:i}):null]})}let e2="flex min-w-0 flex-1 flex-col rounded-tile bg-overlay/[0.02] p-4 ring-1 ring-inset ring-overlay/[0.08] max-md:min-h-[196px]",e5="flex flex-col items-stretch gap-1.5 md:flex-row";function e4(e){let{children:t}=e;return(0,r.jsx)("span",{className:"flex h-[30px] w-[30px] items-center justify-center rounded-lg bg-overlay/[0.05] text-ink-soft ring-1 ring-inset ring-overlay/[0.06]",children:t})}function e3(){return(0,r.jsx)("div",{className:"mx-auto w-full max-w-[760px] text-left",children:(0,r.jsxs)("div",{className:"flex flex-col items-stretch gap-3 md:flex-row",children:[(0,r.jsxs)("div",{className:"flex w-full shrink-0 flex-col gap-3 self-center rounded-card border border-overlay/[0.09] bg-overlay/[0.02] p-4 md:w-[156px]",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(eV,{className:"h-4 w-4 text-ink-soft"}),(0,r.jsx)("span",{className:"text-[14px] font-medium text-ink",children:"Sign up"})]}),(0,r.jsx)("div",{className:"h-[7px] w-[78%] rounded-control bg-overlay/10"}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,r.jsx)(e4,{children:(0,r.jsx)(eG,{className:"h-4 w-4"})}),(0,r.jsx)(e4,{children:(0,r.jsx)("span",{className:"text-overlay",children:(0,r.jsx)(eO.nv,{className:"h-[13px] w-[13px]"})})}),(0,r.jsx)(e4,{children:(0,r.jsx)(eQ,{className:"h-4 w-4"})}),(0,r.jsx)(e4,{children:(0,r.jsx)("span",{style:{color:"#5865F2"},children:(0,r.jsx)(eO.D7,{className:"h-4 w-[17px]"})})}),(0,r.jsx)(e4,{children:(0,r.jsx)(eX,{className:"h-4 w-4"})}),(0,r.jsx)(e4,{children:(0,r.jsx)(e0,{className:"h-4 w-4"})})]})]}),(0,r.jsxs)("svg",{viewBox:"0 0 34 220",preserveAspectRatio:"none",className:"hidden w-[34px] self-stretch md:block","aria-hidden":"true",children:[(0,r.jsx)("path",{className:"stroke-overlay",d:"M0 110 L12 110 Q22 110 22 96 L22 76 Q22 62 34 62",fill:"none",strokeOpacity:.2,strokeWidth:1.5}),(0,r.jsx)("path",{className:"stroke-overlay",d:"M0 110 L12 110 Q22 110 22 124 L22 144 Q22 158 34 158",fill:"none",strokeOpacity:.2,strokeWidth:1.5}),(0,r.jsx)("circle",{className:"fill-overlay",cx:"1.5",cy:"110",r:"2.5",fillOpacity:.35})]}),(0,r.jsxs)("svg",{viewBox:"0 0 72 30",className:"mx-auto h-[26px] w-[72px] md:hidden","aria-hidden":"true",children:[(0,r.jsx)("path",{className:"stroke-overlay",d:"M36 0 V8",fill:"none",strokeOpacity:.2,strokeWidth:1.5}),(0,r.jsx)("circle",{className:"fill-overlay",cx:"36",cy:"8",r:"2.5",fillOpacity:.35}),(0,r.jsx)("path",{className:"stroke-primary",d:"M36 8 Q36 20 22 20 L22 30",fill:"none",strokeWidth:1.5,strokeLinecap:"round"}),(0,r.jsx)("path",{className:"stroke-success",d:"M36 8 Q36 20 50 20 L50 30",fill:"none",strokeWidth:1.5,strokeLinecap:"round"})]}),(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 flex-row gap-3 max-md:items-start md:flex-col",children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2.5",children:[(0,r.jsx)("span",{className:"text-[12px] font-semibold uppercase tracking-[0.1em]",style:{color:"rgb(var(--primary))"},children:"Buyers"}),(0,r.jsxs)("div",{className:e5,children:[(0,r.jsxs)("div",{className:e2,children:[(0,r.jsx)(e1,{n:1,icon:(0,r.jsx)(e$,{className:"h-[18px] w-[18px] text-ink-soft"}),desc:"Add funds to spend on calls.",children:"Buy credits"}),(0,r.jsxs)("div",{className:"mt-auto flex flex-col gap-1",children:[(0,r.jsxs)("span",{className:"flex items-center justify-between rounded-chip bg-overlay/[0.05] px-2 py-1",children:[(0,r.jsx)("span",{className:"h-1 w-[34px] rounded-control bg-overlay/15"}),(0,r.jsx)("span",{className:"font-mono text-[11.5px] font-medium text-ink-emph",children:"$99"})]}),(0,r.jsxs)("span",{className:"flex items-center justify-between rounded-chip bg-overlay/[0.05] px-2 py-1",children:[(0,r.jsx)("span",{className:"h-1 w-[24px] rounded-control bg-overlay/15"}),(0,r.jsx)("span",{className:"font-mono text-[11.5px] font-medium text-ink-emph",children:"$10"})]})]})]}),(0,r.jsx)(eJ,{className:"h-4 w-4 shrink-0 self-center text-ink-ghost max-md:rotate-90"}),(0,r.jsxs)("div",{className:e2,children:[(0,r.jsx)(e1,{n:2,icon:(0,r.jsx)(eK,{className:"h-[18px] w-[18px] text-ink-soft"}),desc:"Create a key and start calling.",children:"Get API key"}),(0,r.jsx)("div",{className:"mt-auto rounded-md bg-overlay/[0.05] px-2.5 py-2 font-mono text-[11.5px] tracking-[1px] text-ink-soft",children:"sk-â¢â¢â¢â¢â¢â¢â¢â¢"})]}),(0,r.jsx)(eJ,{className:"h-4 w-4 shrink-0 self-center text-ink-ghost max-md:rotate-90"}),(0,r.jsxs)("div",{className:e2,children:[(0,r.jsx)(e1,{n:3,icon:(0,r.jsx)(eU.C,{provider:"anthropic",modelId:"claude-opus-4-8",label:"Claude Opus 4.8",size:"xs"}),children:"Save on API calls"}),(0,r.jsxs)("div",{className:"mt-auto",children:[(0,r.jsx)("div",{className:"truncate text-[12px] font-medium leading-tight text-ink-soft",children:"Claude Opus 4.8"}),(0,r.jsxs)("div",{className:"mb-1.5 mt-1.5 flex items-end gap-1.5",children:[(0,r.jsx)("span",{className:"text-[26px] font-bold leading-none tracking-tight",style:{color:eH},children:"42%"}),(0,r.jsx)("span",{className:"pb-[3px] text-[10px] uppercase tracking-wide text-ink-dim",children:"cheaper"})]}),(0,r.jsxs)("div",{className:"grid grid-cols-[auto_1fr] gap-x-2 gap-y-0.5 font-mono text-[10px] leading-tight text-ink-dim",children:[(0,r.jsx)("span",{className:"text-ink-ghost",children:"in"}),(0,r.jsx)("span",{children:"$2.35/M"}),(0,r.jsx)("span",{className:"text-ink-ghost",children:"out"}),(0,r.jsx)("span",{children:"$11.76/M"})]})]})]})]})]}),(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2.5",children:[(0,r.jsxs)("div",{className:e5,children:[(0,r.jsxs)("div",{className:e2,children:[(0,r.jsx)(e1,{n:1,icon:(0,r.jsx)(eY,{className:"h-[18px] w-[18px] text-ink-soft"}),desc:"Connect the provider you resell.",children:"Paste provider key"}),(0,r.jsx)("div",{className:"mt-auto rounded-md border border-dashed border-overlay/20 bg-overlay/[0.03] px-2.5 py-2 font-mono text-[11.5px] tracking-[0.5px] text-ink-soft",children:"sk-prov-â¢â¢â¢â¢"})]}),(0,r.jsx)(eJ,{className:"h-4 w-4 shrink-0 self-center text-ink-ghost max-md:rotate-90"}),(0,r.jsxs)("div",{className:e2,children:[(0,r.jsx)(e1,{n:2,icon:(0,r.jsx)(eU.C,{provider:"openai",modelId:"gpt-5.5",label:"GPT-5.5",size:"xs"}),children:"List model offers"}),(0,r.jsxs)("div",{className:"mt-auto",children:[(0,r.jsx)("div",{className:"truncate text-[12px] font-medium leading-tight text-ink-soft",children:"GPT-5.5"}),(0,r.jsxs)("div",{className:"mb-1.5 mt-1.5 flex items-end gap-1.5",children:[(0,r.jsx)("span",{className:"text-[26px] font-bold leading-none tracking-tight",style:{color:eH},children:"37%"}),(0,r.jsx)("span",{className:"pb-[3px] text-[10px] uppercase tracking-wide text-ink-dim",children:"cheaper"})]}),(0,r.jsxs)("div",{className:"grid grid-cols-[auto_1fr] gap-x-2 gap-y-0.5 font-mono text-[10px] leading-tight text-ink-dim",children:[(0,r.jsx)("span",{className:"text-ink-ghost",children:"in"}),(0,r.jsx)("span",{children:"$1.85/M"}),(0,r.jsx)("span",{className:"text-ink-ghost",children:"out"}),(0,r.jsx)("span",{children:"$9.20/M"})]})]})]}),(0,r.jsx)(eJ,{className:"h-4 w-4 shrink-0 self-center text-ink-ghost max-md:rotate-90"}),(0,r.jsxs)("div",{className:e2,children:[(0,r.jsx)(e1,{n:3,icon:(0,r.jsx)(eD.Z,{className:"h-[18px] w-[18px] text-ink-soft",strokeWidth:1.8,"aria-hidden":"true"}),desc:"Earn on every served request.",children:"Earn USDC"}),(0,r.jsxs)("div",{className:"mt-auto flex flex-col gap-1",children:[(0,r.jsxs)("span",{className:"flex items-center justify-between rounded-chip bg-overlay/[0.05] px-2 py-1",children:[(0,r.jsx)("span",{className:"text-[10.5px] text-ink-dim",children:"USDC"}),(0,r.jsx)("span",{className:"font-mono text-[11.5px] font-medium",style:{color:eH},children:"+$0.62"})]}),(0,r.jsxs)("span",{className:"flex items-center justify-between rounded-chip bg-overlay/[0.05] px-2 py-1",children:[(0,r.jsx)("span",{className:"text-[10.5px] text-ink-dim",children:"USDC"}),(0,r.jsx)("span",{className:"font-mono text-[11.5px] font-medium",style:{color:eH},children:"+$1.40"})]})]})]})]}),(0,r.jsx)("span",{className:"text-[12px] font-semibold uppercase tracking-[0.1em] max-md:order-first max-md:text-right",style:{color:"rgb(var(--success))"},children:"Sellers"})]})]})]})})}function e6(e){let{open:t,onClose:n}=e,i=(0,l.useRef)(null);
1return(0,r.jsx)(eZ.c,{open:t,onClose:n,title:"How it works",maxWidthClassName:"sm:max-w-4xl",surfaceClassName:"bg-surface-page",initialFocusRef:i,inertBackground:!0,children:(0,r.jsxs)("div",{ref:i,tabIndex:-1,className:"outline-none",children:[(0,r.jsxs)("p",{className:"text-[13.5px] leading-relaxed text-ink-soft",children:[(0,r.jsx)("span",{className:"font-medium",style:{color:"rgb(var(--primary-500))"},children:"Buyers"})," pay less for calling AI models."," ",(0,r.jsx)("br",{className:"sm:hidden"}),(0,r.jsx)("span",{className:"font-medium",style:{color:"rgb(var(--success-vivid))"},children:"Sellers"})," turn your API credits into $."]}),(0,r.jsx)("div",{className:"mt-6",children:(0,r.jsx)(e3,{})})]})})}var e8=n(64070),e7=n(53429),e9=n(49611),te=n(36190),tt=n(68571);function tn(){let e=(0,s._)(["export SURPLUS_API_KEY=","\n\ncurl ",'/chat/completions -H "Authorization: Bearer $SURPLUS_API_KEY" -H "Content-Type: application/json" -d \'{\n "model": "','",\n "messages": [{"role": "user", "content": "hello"}],\n "stream": true\n }\''],["export SURPLUS_API_KEY=","\n\ncurl ",'/chat/completions \\\n -H "Authorization: Bearer $SURPLUS_API_KEY" \\\n -H "Content-Type: application/json" \\\n -d \'{\n "model": "','",\n "messages": [{"role": "user", "content": "hello"}],\n "stream": true\n }\'']);return tn=function(){return e},e}function ti(){let e=(0,s._)(["export SURPLUS_API_KEY=","\n\ncurl ",'/decisions -H "Authorization: Bearer $SURPLUS_API_KEY" -H "Content-Type: application/json" -d \'{\n "model": "','",\n "state": {"request": "Review this request"},\n "questions": {\n "approve": {"type": "noul", "instructions": "Should this request be approved?"}\n }\n }\''],["export SURPLUS_API_KEY=","\n\ncurl ",'/decisions \\\n -H "Authorization: Bearer $SURPLUS_API_KEY" \\\n -H "Content-Type: application/json" \\\n -d \'{\n "model": "','",\n "state": {"request": "Review this request"},\n "questions": {\n "approve": {"type": "noul", "instructions": "Should this request be approved?"}\n }\n }\'']);return ti=function(){return e},e}let ts=(0,e8.default)(()=>Promise.all([n.e(4793),n.e(3349)]).then(n.bind(n,84793)).then(e=>e.ModelOrderbook),{loadableGenerated:{webpack:()=>[84793]},ssr:!1,loading:()=>(0,r.jsx)("div",{className:"px-8 py-6 text-[12px] text-ink-dim",children:"Loading order bookâ¦"})}),tr=(0,e8.default)(()=>Promise.all([n.e(4793),n.e(3349)]).then(n.bind(n,84793)).then(e=>e.ModelOrderbookSummary),{loadableGenerated:{webpack:()=>[84793]},ssr:!1});function ta(){return(0,r.jsxs)("svg",{className:"h-5 w-5 shrink-0 text-ink-muted",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,r.jsx)("path",{d:"m20 20-4-4"})]})}function to(e){let{className:t="h-4 w-4 shrink-0 text-ink-faint"}=e;return(0,r.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"m6 9 6 6 6-6"})})}let tl="".concat(e9.O.apiBaseUrl,"/v1"),tc="https://api.surplusintelligence.ai/v1",td=["claude-opus-5","gpt-5.5-pro"],tu=[{value:"curl",label:"curl"},{value:"javascript",label:"javascript"},{value:"python",label:"python"},{value:"csharp",label:"csharp"},{value:"java",label:"java"},{value:"go",label:"go"},{value:"ruby",label:"ruby"},{value:"cli",label:"cli"}];function tm(e){let{className:t="h-3.5 w-3.5"}=e;return(0,r.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"m16 18 6-6-6-6"}),(0,r.jsx)("path",{d:"m8 6-6 6 6 6"})]})}function tx(e){let{className:t="h-3.5 w-3.5"}=e;return(0,r.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M20 6 9 17l-5-5"})})}function tp(e){let{className:t="h-5 w-5"}=e;return(0,r.jsxs)("svg",{className:t,viewBox:"0 0 34 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M3 12h28"}),(0,r.jsx)("path",{d:"m25 6 6 6-6 6"})]})}function th(e){let{className:t="h-5 w-5"}=e;return(0,r.jsxs)("svg",{className:t,viewBox:"0 0 34 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M31 12H3"}),(0,r.jsx)("path",{d:"m9 6-6 6 6 6"})]})}function tf(e){return(null==e?void 0:e.trim())||null}function tv(e){return'"'.concat(e.replace(/(["\\$`])/g,"\\$1"),'"')}function tg(e,t){let n=tf(t),i=n?tv(n):'"inf_..."';return String.raw(tn(),i,tl,e)}function tb(e,t,n){let i=tf(n),s=i?JSON.stringify(i):'Environment.GetEnvironmentVariable("SURPLUS_API_KEY")',r=i?tv(i):'"inf_..."',a=i?JSON.stringify(i):'os.Getenv("SURPLUS_API_KEY")',o=i?JSON.stringify(i):'System.getenv("SURPLUS_API_KEY")',l=i?JSON.stringify(i):"process.env.SURPLUS_API_KEY",c=i?JSON.stringify(i):'os.environ["SURPLUS_API_KEY"]',d=i?JSON.stringify(i):'ENV.fetch("SURPLUS_API_KEY")';switch(e){case"curl":return tg(t,i);case"python":return"from openai import OpenAI\nimport os\n\nclient = OpenAI(\n api_key=".concat(c,',\n base_url="').
1concat(tl,'",\n)\n\nresponse = client.chat.completions.create(\n model="').concat(t,'",\n messages=[{"role": "user", "content": "').concat("hey",'"}],\n)\n\nprint(response.choices[0].message.content)');case"csharp":return'using System.Net.Http.Headers;\nusing System.Text;\n\nusing var client = new HttpClient();\nclient.DefaultRequestHeaders.Authorization =\n new AuthenticationHeaderValue("Bearer", '.concat(s,');\n\nvar body = """\n{"model":"').concat(t,'","messages":[{"role":"user","content":"').concat("hey",'"}]}\n""";\n\nvar response = await client.PostAsync(\n "').concat(tl,'/chat/completions",\n new StringContent(body, Encoding.UTF8, "application/json"));\n\nConsole.WriteLine(await response.Content.ReadAsStringAsync());');case"java":return'var client = HttpClient.newHttpClient();\nvar body = """\n{"model":"'.concat(t,'","messages":[{"role":"user","content":"').concat("hey",'"}]}\n""";\n\nvar request = HttpRequest.newBuilder()\n .uri(URI.create("').concat(tl,'/chat/completions"))\n .header("Authorization", "Bearer " + ').concat(o,')\n .header("Content-Type", "application/json")\n .POST(HttpRequest.BodyPublishers.ofString(body))\n .build();
1\n\nvar response = client.send(request, HttpResponse.BodyHandlers.ofString());\nSystem.out.println(response.body());');case"go":return'package main\n\nimport (\n "bytes"\n "fmt"\n "net/http"\n "os"\n)\n\nfunc main() {\n body := []byte(`{"model":"'.concat(t,'","messages":[{"role":"user","content":"').concat("hey",'"}]}`)\n req, _ := http.NewRequest("POST", "').concat(tl,'/chat/completions", bytes.NewBuffer(body))\n req.Header.Set("Authorization", "Bearer "+').concat(a,')\n req.Header.Set("Content-Type", "application/json")\n\n res, _ := http.DefaultClient.Do(req)\n fmt.Println(res.Status)\n}');case"ruby":return'require "net/http"\nrequire "json"\n\nuri = URI("'.concat(tl,'/chat/completions")\nrequest = Net::HTTP::Post.new(uri)\nrequest["Authorization"] = "Bearer " + ').concat(d,'\nrequest["Content-Type"] = "application/json"\nrequest.body = {\n model: "').concat(t,'",\n messages: [{ role: "user", content: "').concat("hey",'" }]\n}.to_json\n\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }\nputs response.body');case"cli":return"export OPENAI_API_KEY=".concat(r,'\nexport OPENAI_BASE_URL="').concat(tl,'"\n\nopenai api chat.completions.create \\\n -m "').concat(t,'" \\\n -g user "').concat("hey",'"');default:return'import OpenAI from "openai";\n\nconst client = new OpenAI({\n apiKey: '.concat(l,',\n baseURL: "').concat(tl,'",\n});\n\nconst response = await client.chat.completions.create({\n model: "').concat(t,'",\n messages: [{ role: "user", content: "').concat("hey",'" }],\n});\n\nconsole.log(response.choices[0].message.content);')}}let tj=new Set(["import","from","const","let","await","new","async","def","return","using","var","package","func","public","class","static","void","string","true","false","null","nil"]),tk=new Set(["curl","export","console","print","fmt","puts","System"]),ty=/("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|`(?:\\.|[^`\\])*`|--[A-Za-z-]+|\b[A-Za-z_][A-Za-z0-9_]*\b|\d+)/g;function tw(e){return e.split(ty).map((e,t)=>{if(!e)return null;let n=ty.test(e);return(ty.lastIndex=0,n)?(0,r.jsx)("span",{className:/^["'`]/.test(e)?"text-code-string":tj.has(e)?"text-ink-emph":tk.has(e)||e.startsWith("--")?"text-code-command":/^\d+$/.test(e)?"text-ink-dim":"text-ink-code",children:e},t):(0,r.jsx)("span",{children:e},t)})}function tN(e){let{code:t,language:n,copied:i,onCopy:s,onSelectLanguage:a,leading:o,highlightBaseUrl:l,baseUrl:c=tl}=e,d=t.split("\n");return(0,r.jsxs)("div",{className:"overflow-hidden rounded-md",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 ".concat(o?"justify-between":"justify-end"),children:[o?(0,r.jsx)("div",{className:"min-w-0 flex-1",children:o}):null,(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,r.jsxs)(g.h_,{modal:!1,children:[(0,r.jsx)(g.$F,{asChild:!0,children:(0,r.jsxs)("button",{type:"button","aria-label":"Select code language",className:"inline-flex h-9 w-auto items-center justify-center gap-2 rounded-md border-0 bg-surface-snippet-btn px-2.5 font-mono text-[11px] leading-none text-ink-emph outline-none ring-0 transition-colors hover:bg-surface-snippet-btn-hover focus-visible:ring-1 focus-visible:ring-ink-muted",children:[(0,r.jsx)("span",{children:n}),(0,r.jsx)(to,{className:"h-3.5 w-3.5 shrink-0 text-ink-soft-raised"})]})}),(0,r.jsx)(g.AW,{align:"end",className:"max-h-[min(360px,var(--radix-dropdown-menu-content-available-height))] min-w-[8rem] overflow-y-auto border-divider-strong bg-surface-menu ring-0",children:(0,r.jsx)(g._x,{value:n,onValueChange:e=>a(e),children:tu.map(e=>(0,r.jsx)(g.qB,{value:e.value,className:"py-2 pl-8 pr-2 font-mono text-[12px] data-[state=checked]:bg-surface-snippet-btn-hover",children:e.label},e.value))})})]}),(0,r.jsx)("button",{type:"button",onClick:s,"aria-label":i?"Copied code":"Copy code",className:"inline-flex h-9 w-9 items-center justify-center rounded-md text-ink-soft-raised transition-colors hover:bg-surface-snippet-btn-hover hover:text-ink focus:outline-none focus:ring-2 focus:ring-ink-muted/35",children:(0,r.jsx)(h.K,{className:"h-3.5 w-3.5"})})]})]}),(0,r.jsx)("pre",{className:"code-scrollbar h-[270px] overflow-y-auto overflow-x-hidden px-4 pb-4 pt-3 font-mono text-[12px] leading-5 text-ink-code",children:(0,r.jsx)("code",{className:"grid min-w-0 grid-cols-[2ch_minmax(0,1fr)] content-start",children:d.map((e,t)=>{let n=l&&e.includes(c),i=l&&/(?:#|\/\/)\s*was:/.test(e);return(0,r.jsxs)("span",{className:"contents",children:[(0,r.jsx)("span",{className:"select-none self-start text-right ".concat(n?"bg-diff-add text-diff-add-ink":"text-ink-disabled"),children:t+1}
1),(0,r.jsx)("span",{className:"min-w-0 whitespace-pre-wrap break-all pl-4 ".concat(n?"bg-diff-add":""),children:i?(0,r.jsx)("span",{className:"text-ink-ghost-4",children:e}):e?tw(e):" "})]},t)})})})]})}function t_(e){let{code:t,label:n,language:i}=e,[s,a]=(0,l.useState)(!1),o=t.split("\n");return(0,r.jsxs)("div",{className:"overflow-hidden rounded-lg bg-surface-snippet",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 pt-3",children:[n?(0,r.jsx)("span",{className:"truncate font-mono text-[12px] text-ink-soft-raised",children:n}):(0,r.jsx)("span",{}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[i?(0,r.jsx)("span",{className:"inline-flex h-7 items-center rounded-md bg-surface-snippet-chip px-2.5 font-mono text-[12px] leading-none text-ink-soft-raised",children:i}):null,(0,r.jsx)("button",{type:"button",onClick:()=>{a(!0),window.setTimeout(()=>a(!1),1400),(0,te.W)(t).catch(e=>console.error("Failed to copy code sample:",e))},"aria-label":s?"Copied code":"Copy code",className:"inline-flex h-7 w-7 items-center justify-center rounded-md transition-colors hover:bg-overlay/10 hover:text-overlay focus:outline-none focus:ring-2 focus:ring-select-focus/55 ".concat(s?"text-success-flash":"text-ink-code"),children:(0,r.jsx)(h.K,{className:"h-3.5 w-3.5"})})]})]}),(0,r.jsx)("pre",{className:"code-scrollbar max-h-[320px] overflow-auto px-4 pb-4 pt-3 font-mono text-[13px] leading-5 text-ink-code",children:(0,r.jsx)("code",{className:"grid min-w-max grid-cols-[2ch_minmax(0,1fr)] gap-x-4",children:o.map((e,t)=>(0,r.jsxs)("span",{className:"contents",children:[(0,r.jsx)("span",{className:"select-none text-right text-ink-disabled",children:t+1}),(0,r.jsx)("span",{className:"whitespace-pre",children:e?tw(e):" "})]},t))})})]})}function tC(e,t){return"text"!==t&&"decisions"!==t&&!(Number(e.best_input_per_1m)>0)}function tM(e){let t=na(e);return tC(e,t)?nl(e,t)||0:Number(e.best_input_per_1m||0)+Number(e.best_output_per_1m||0)}function tS(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,n=new Set;return(Array.isArray(e)?e:[]).filter(e=>(null==e?void 0:e.model)&&!e.catalog_only&&"text"===na(e)&&tM(e)>0&&ng(e)>0).sort((e,t)=>{let n=tR(Number(t.requests_24h||0))-tR(Number(e.requests_24h||0));if(0!==n)return n;let i=tR(Number(t.input_tokens_24h||0)+Number(t.output_tokens_24h||0))-tR(Number(e.input_tokens_24h||0)+Number(e.output_tokens_24h||0));if(0!==i)return i;let s=ng(t)-ng(e);if(0!==s)return s;let r=tM(e)-tM(t);return 0!==r?r:String(e.model).localeCompare(String(t.model))}).filter(e=>!n.has(e.model)&&(n.add(e.model),!0)).slice(0,t)}function tL(e){var t;let{markets:n=[],stats:i,showHowItWorks:s=!1,onToggleHowItWorks:c}=e,{buyerApiKey:d}=(0,y.S)(),[u,m]=(0,l.useState)(td[0]),[x,p]=(0,l.useState)("curl"),[h,f]=(0,l.useState)(!1),v=(0,l.useMemo)(()=>tS(n),[n]),g=(0,l.useMemo)(()=>{if(i&&i.avgSavings>0)return Math.round(i.avgSavings);let e=v.slice(0,8).map(e=>tF(e)).filter(e=>e>0);return e.length?Math.round(e.reduce((e,t)=>e+t,0)/e.length):38},[i,v]),j=v.some(e=>e.model===u)?u:(null===(t=v[0])||void 0===t?void 0:t.model)||u,k=(0,l.useMemo)(()=>tb(x,j,d).split(tl).join(tc),[d,x,j]),w=(0,l.useMemo)(()=>(function(e,t){var n,i,s;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:tl,a=e.split("\n"),o=a.findIndex(e=>e.includes(r));if(-1===o)return e;let l=null!==(s=null===(i=a[o])||void 0===i?void 0:null===(n=i.match(/^\s*/))||void 0===n?void 0:n[0])&&void 0!==s?s:"";return a.splice(o+1,0,"".concat(l).concat(function(e){switch(e){case"python":case"ruby":case"curl":case"cli":return"#";default:return"//"}}(t)," was: ").concat("openrouter.ai/api/v1")),a.join("\n")})(k,x,tc),[k,x]),N=v.length>0?v.map(e=>({value:e.model,label:function(e){var t;let n=ni[e.model];return e.display_name||(null===(t=e.catalogModel)||void 0===t?void 0:t.name)||(null==n?void 0:n.name)||e.model}(e)})):td.map(e=>({value:e,label:e}));return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("section",{className:"mx-auto mb-7 grid w-full max-w-[1520px] gap-8 px-6 pt-8 sm:px-8 md:pt-10 lg:pt-12 xl:grid-cols-[minmax(0,1fr)_minmax(390px,540px)] xl:items-center xl:gap-10","aria-labelledby":"marketplace-title",children:[(0,r.jsxs)("div",{className:"flex min-h-[250px] min-w-0 flex-col items-center justify-center text-center lg:min-h-[320px]",children:[(0,r.jsxs)("div",{className:"mb-4 flex items-center justify-center gap-2 lg:hidden",children:[(0,r.jsx)("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center overflow-hidden rounded-md",children:(0,r.jsx)(a.default,{src:"/surplus-logo.png",alt:"",width:32,height:32,sizes:"32px",className:"h-full w-full object-contain",priority:!0})}),(0,r.jsx)("span",{className:"text-[17px] font-semibold leading-none text-ink",children:"Surplus Intelligence"})]}),(0,r.jsx)("h1",{id:"marketplace-title",className:"max-w-[880px] text-[40px] font-normal leading-[1.04] tracking-normal text-ink sm:text-[48px] lg:text-[52px] xl:text-[56px]",children:"Open Market for Models"}),(0,r.jsxs)("p",{className:"mt-3 max-w-[34rem] text-[14px] font-normal leading-6 tracking-normal text-ink-soft sm:text-[15px] xl:text-[16
1px]",children:["Your API calls, routed to the cheapest offer.",(0,r.jsx)("br",{}),"Your surplus capacity, sold to the highest bidder."]}),i&&(0,r.jsx)("div",{className:"mt-8 w-full max-w-[680px]",children:(0,r.jsx)(nt,{stats:i})}),(0,r.jsxs)("nav",{className:"mt-7 grid w-full max-w-[360px] grid-cols-1 gap-3 max-sm:max-w-none sm:grid-cols-2 lg:max-w-[600px]","aria-label":"Inference marketplace actions",children:[(0,r.jsxs)(o.default,{href:"/buy",className:"inline-flex min-h-[3.25rem] items-center justify-center gap-2.5 whitespace-nowrap rounded-control bg-action px-4 py-2 text-action-fg transition-colors hover:bg-action-hover",children:[(0,r.jsx)(th,{className:"h-3.5 w-6 shrink-0"}),(0,r.jsxs)("span",{className:"flex flex-col items-start leading-tight",children:[(0,r.jsx)("span",{className:"text-[13px] font-semibold",children:"Start saving"}),(0,r.jsx)("span",{className:"text-[11px] font-medium text-action-fg",children:"Call discounted models"})]})]}),(0,r.jsxs)(o.default,{href:"/sell",className:"inline-flex min-h-[3.25rem] items-center justify-center gap-2.5 whitespace-nowrap rounded-control bg-surface-chip px-4 py-2 text-ink-emph transition-colors hover:bg-surface-chip-hover hover:text-ink",children:[(0,r.jsxs)("span",{className:"flex flex-col items-end leading-tight",children:[(0,r.jsx)("span",{className:"text-[13px] font-semibold",children:"Start earning"}),(0,r.jsx)("span",{className:"text-[11px] font-medium text-ink-muted",children:"List your API credits"})]}),(0,r.jsx)(tp,{className:"h-3.5 w-6 shrink-0"})]})]})]}),(0,r.jsx)("div",{className:"hidden min-w-0 overflow-hidden rounded-md xl:block xl:w-full xl:self-center xl:justify-self-end",children:(0,r.jsxs)("div",{className:"space-y-3 px-4 py-4",children:[(0,r.jsxs)("div",{className:"space-y-2 text-center",children:[(0,r.jsx)("div",{className:"text-[20px] font-medium leading-none text-ink",children:"One API, OpenAI-compatible"}),(0,r.jsxs)("p",{className:"text-[13px] leading-relaxed text-ink-soft",children:["Already on OpenAI or OpenRouter? Just change your base URL and cut your inference bill"," ",(0,r.jsxs)("span",{className:"font-semibold",style:{color:"rgb(var(--success-vivid))"},children:[g,"%"]}),"."]})]}),(0,r.jsx)(tN,{code:w,language:x,copied:h,onCopy:()=>{f(!0),window.setTimeout(()=>f(!1),1400),(0,te.W)(k).catch(e=>{console.error("Failed to copy code sample:",e)})},onSelectLanguage:p,highlightBaseUrl:!0,baseUrl:tc,leading:(0,r.jsx)(b.T,{ariaLabel:"",modal:!1,value:j,onValueChange:m,options:N,triggerClassName:"h-9 w-full rounded-md border-0 bg-surface-sunken px-3 text-[14px] text-ink ring-1 ring-transparent hover:bg-surface-raised focus-visible:ring-divider-strong"})}),(0,r.jsxs)("p",{className:"text-center text-[11.5px] leading-snug text-ink-dim",children:["Same request. Same SDK. Same models. New base URL."," ",(0,r.jsx)("span",{className:"text-ink-soft",children:"One router. Lower costs."})]})]})})]}),(0,r.jsxs)("section",{className:"mx-auto mb-9 mt-14 flex w-full max-w-[1520px] flex-col items-center px-6 text-center sm:px-8 md:mt-20","aria-labelledby":"how-it-works-title",children:[(0,r.jsx)("button",{type:"button",id:"how-it-works-title",onClick:c,"aria-haspopup":"dialog","aria-expanded":s,className:"group inline-flex items-center rounded-control bg-surface-chip px-6 py-2.5 text-[15px] font-medium text-ink-emph shadow-sm transition-all hover:-translate-y-px hover:bg-surface-chip-hover hover:text-ink hover:shadow-md focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/60 dark:shadow-none",children:"See how it works"}),(0,r.jsx)(e6,{open:s,onClose:c})]})]})}function tA(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return .985*e+.015*t}function tq(e){var t;return(Number(null!==(t=e.direct_media_unit_price)&&void 0!==t?t:e.direct_image_per_image)||0)>0||tA(e.direct_input_per_1m||0,e.direct_output_per_1m||0)>0}function tF(e){if((null!=e.best_media_unit_price||null!=e.best_image_per_image)&&(null!=e.direct_media_unit_price||null!=e.direct_image_per_image)){var t,n;let i=Number(null!==(t=e.direct_media_unit_price)&&void 0!==t?t:e.direct_image_per_image)||0,s=Number(null!==(n=e.best_media_unit_price)&&void 0!==n?n:e.best_image_per_image)||0;return i<=0?0:Math.max(0,(i-s)/i*100)}let i=tA(e.direct_input_per_1m||0,e.direct_output_per_1m||0),s=tA(e.best_input_per_1m||0,e.best_output_per_1m||0);return i<=0?0:Math.max(0,(i-s)/i*100)}
1function tE(e){return Math.max(0,Math.round(e)).toLocaleString()}function tP(e){return"".concat(Math.max(0,Math.round(e)),"%")}function tI(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"k"):e>=100?e.toFixed(0):e>=1?e.toFixed(2):e>0?e.toFixed(4):"0"}function tR(e){return Number.isFinite(e)?Math.max(0,e):0}function tB(e){let t=Math.round(tR(e));return"".concat(t.toLocaleString()," ").concat(1===t?"message":"messages")}function tz(e){let t=tR(e);return t<=0?"0 credits":"$".concat(tI(t)," ").concat(1===t?"credit":"credits")}function tT(e){let{requests:t,creditsSold:n}=e,i=tR(t),s=tR(n),a=i<=0||s<=0,o="".concat(tB(i)," and ").concat(tz(s));return a?(0,r.jsxs)(j.u,{children:[(0,r.jsx)(j.aJ,{asChild:!0,children:(0,r.jsx)("span",{tabIndex:0,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"inline-flex h-6 min-w-6 items-center justify-center font-mono text-sm font-semibold text-ink-dim transition-colors hover:text-ink-secondary focus:outline-none focus:ring-1 focus:ring-primary/50","aria-label":o,children:"-"})}),(0,r.jsxs)(j._v,{side:"top",align:"end",children:[(0,r.jsx)("div",{className:"font-mono text-xs text-ink",children:tB(i)}),(0,r.jsx)("div",{className:"mt-1 font-mono text-xs text-ink-secondary",children:tz(s)})]})]}):(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"text-sm font-medium text-ink-secondary",children:[i>=1e6?"".concat((i/1e6).toFixed(1),"M"):i>=1e3?"".concat((i/1e3).toFixed(1),"k"):String(i||0)," msgs"]}),(0,r.jsxs)("div",{className:"mt-1 text-xs text-ink-dim",children:[(0,r.jsxs)("span",{children:["$",tI(s)]})," credits"]})]})}function tZ(e){return null==e||Number.isNaN(e)||0===e?"$0 / M":"$".concat(e.toLocaleString(void 0,{minimumFractionDigits:Math.abs(e%1)>0?2:0,maximumFractionDigits:e<1e-4?6:e<.001?5:e<.01?4:e<.1?3:2})," / M")}function tW(e){let t=Number(e||0);return!Number.isFinite(t)||t<=0?"$0":t>=1e6?"$".concat((t/1e6).toLocaleString(void 0,{minimumFractionDigits:t>=1e7?0:1,maximumFractionDigits:1}),"M"):t>=1e3?"$".concat((t/1e3).toLocaleString(void 0,{minimumFractionDigits:1,maximumFractionDigits:1}),"K"):t>=100?"$".concat(t.toFixed(0)):"$".concat(t.toFixed(2))}let tD=Date.UTC(2026,4,30,19,16,0);function tO(e,t,n){return Math.max(t,Math.min(n,e))}function tU(e,t,n){let i=function(e,t){let n=Math.abs(e-t)%24;return Math.min(n,24-n)}(e,t);return Math.exp(-(i*i)/(2*n*n))}function tH(e){let t=tU(e,16,4.2);return tO(.2+.6*t+.34*tU(e,1,2.9)-.34*tU(e,9,3.6)-.16*tU(e,12,2.2),0,1)}function tV(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<=0?"text-ink-dim":"tightening"===e?"text-ink":"deepening"===e?"text-success":"text-ink-secondary"}function t$(e){var t;return!!(null==e?void 0:null===(t=e.buckets)||void 0===t?void 0:t.some(e=>{let t=e.discount_pct;return null!=t&&Number.isFinite(t)}))}function tK(e){let{direction:t,requestCount:n}=e,i="h-4 w-4 shrink-0 ".concat(tV(t,n));return n<=0||"stable"===t?(0,r.jsx)("svg",{className:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M5 12h14"})}):"tightening"===t?(0,r.jsxs)("svg",{className:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M7 7h10v10"}),(0,r.jsx)("path",{d:"M17 7 7 17"})]}):(0,r.jsxs)("svg",{className:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M7 17 17 7"}),(0,r.jsx)("path",{d:"M9 7h8v8"})]})}function tY(e){let{values:t,muted:n=!1}=e,i=t.filter(e=>null!=e&&Number.isFinite(e)),s=i.length>0;if(!s)return null;let a=t.length>20?2:3,o=Math.max(2,(104-a*(t.length-1))/t.length),l=Math.max(...i,1),c=Math.min(...i,l),d=Math.max(l-c,8),u=t.map((e,i)=>{let r=null!=e&&Number.isFinite(e),l=r?tO((Math.max(c,e)-c)/d,0,1):0,u=r?7+17*l:4,m=.44+i/Math.max(1,t.length-1)*.48;return{x:i*(o+a),y:30-u,width:o,height:u,rx:2.2,fill:r?l>=.72?"var(--ramp-blue-1)":l>=.44?"var(--ramp-blue-2)":l>=.22?"var(--ramp-blue-3)":"var(--ramp-blue-4)":"var(--ramp-blue-4)",opacity:n||!s?.22:r?m:.14,tooltip:r?"".concat("".concat(Number.isInteger(e)?e.toFixed(0):e.toFixed(1),"%")," discount"):"No discount data"}});return(0,r.jsx)(e7.u,{bars:u,viewBoxWidth:104,viewBoxHeight:30,className:"h-7 w-24",ariaLabel:"Discount trend, most recent on the right"})}function tJ(e){var t,n;let{discount:i,trend:s,listPrice:a=!0}=e,o=a?s:null,l=(null==o?void 0:null===(t=o.buckets)||void 0===t?void 0:t.map(e=>e.discount_pct))||[],c=t$(o),d=(null==o?void 0:o.request_count)||0,u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<=0?"warming up":"deepening"===e?"deepening":"tightening"===e?"compressing":"stable"}(null==o?void 0:o.direction,d),m=tV(null==o?void 0:o.direction,d),x=i>0?i:Number((null==o?void 0:o.current_discount_pct)||0),p=null==o?void 0:o.previous_discount_pct,h=null!==(n=null==o?void 0:o.current_discount_pct)&&void 0!==n?n:x,f=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return t<=0?"text-ink-faint":"text-success-vivid"}(null==o?void 0:o.direction,d,x);return(0,r.jsxs)("div",{className:"flex min-w-0 flex-col items-center ".concat(c?"gap-1.5":"justify-center md:min-h-[3.5rem]"),children:[(0,r.jsxs)(j.u,{children:[(0,r.jsx)(j.aJ,{asChild:!0,children:(0,r.jsx)("span",{tabIndex:0,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"whitespace-nowrap text-center font-mono text-lg font-semibold leading-none ".concat(f," cursor-help focus:outline-none focus:ring-1 focus:ring-primary/50"),children:x>0?"".concat(x.toFixed(0),"%"):"-"})}),(0,r.jsx)(j._v,{side:"top",align:"end",className:"w-[230px]",children:c?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-xs font-semibold ".concat(m),children:[(0,r.jsx)(tK,{direction:null==o?void 0:o.direction,requestCount:d}),(0,r.jsx)("span",{children:u})]}),(0,r.jsx)("div",{className:"mt-1.5 text-[11px] text-ink-secondary",children:"Recent request discount by time bucket."}),d>0&&null!=p&&null!=h&&(0,r.jsxs)("div",{className:"mt-2 font-mono text-[11px] text-ink-dim",children:[p.toFixed(1),"% -> ",h.toFixed(1),"%"]})]}):(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs font-semibold text-ink",children:a?"Current discount":"No public list price"}),(0,r.jsx)("div",{className:"mt-1.5 text-[11px] text-ink-secondary",children:a?"No 48h or 24h discount trend data yet.":"There is no public list price for this model to measure a discount against."})]})})]}),c&&(0,r.jsx)(tY,{values:l,muted:d<=0})]})}function tG(e){let{market:t}=e,n=Number(t.discounted_liquidity_usd||0),i=Number(t.discounted_liquidity_offer_count||0),s=Number(t.uncapped_discounted_offer_count||0),a=n>0,o=s>
10,l="".concat(i.toLocaleString()," capped ").concat(1===i?"offer":"offers"),c="".concat(s.toLocaleString()," ").concat(1===s?"offer":"offers"," with no daily volume limit"),d=o?"Uncapped":a?tW(n):"-",u=o&&a?"+".concat(tW(n)," capped"):o?"discounted supply":a?l:"no discount depth",m=o||!a?"font-mono":"",x=o&&a?"".concat(c,". ").concat(i.toLocaleString()," discounted/finite ").concat(1===i?"offer adds":"offers add"," up to ").concat(tW(n),"/day more."):o?"".concat(c,". No discounted/finite offers reported."):a?"".concat(i.toLocaleString()," discounted/finite ").concat(1===i?"offer provides":"offers provide"," ").concat(tW(n),"/day of liquidity."):tq(t)?"No discounted liquidity is currently available.":"There is no public list price for this model, so no offer counts as discounted.";return(0,r.jsxs)(j.u,{children:[(0,r.jsx)(j.aJ,{asChild:!0,children:(0,r.jsxs)("span",{tabIndex:0,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"block cursor-help text-right focus:outline-none focus:ring-1 focus:ring-primary/50","aria-label":"".concat(d,", ").concat(u),children:[(0,r.jsx)("span",{className:"block whitespace-nowrap text-sm font-semibold ".concat(m," ").concat(a||o?"text-ink":"text-ink-faint"),children:d}),(0,r.jsx)("span",{className:"mt-1 block whitespace-nowrap text-xs text-ink-faint",children:u})]})}),(0,r.jsx)(j._v,{side:"top",align:"end",className:"w-[260px]",children:(0,r.jsx)("div",{className:"text-[11px] text-ink-secondary",children:x})})]})}let tQ=[{key:"all",label:"All models"},{key:"text",label:"Text"},{key:"tools",label:"Tools"},{key:"vision",label:"Vision"},{key:"reasoning",label:"Reasoning"},{key:"json",label:"JSON"},{key:"streaming",label:"Streaming"},{key:"image",label:"Image"},{key:"audio",label:"Audio"},{key:"video",label:"Video"},{key:"decisions",label:"Decisions"},{key:"async",label:"Async"},{key:"artifact",label:"Artifacts"},{key:"voices",label:"Voices"},{key:"transcription",label:"Transcription"},{key:"music",label:"Music"},{key:"image_edit",label:"Image-to-image"},{key:"aspect_ratio",label:"Aspect ratio"},{key:"resolution",label:"Resolution"},{key:"text_to_video",label:"Text-to-video"},{key:"image_to_video",label:"Image-to-video"},{key:"with_audio",label:"With audio"},{key:"multi_image",label:"Multi-image"}],tX=[{label:"Price",options:[{key:"best_price",label:"Best price"},{key:"discount",label:"Highest discount"},{key:"discount_asc",label:"Lowest discount"}]},{label:"Market",options:[{key:"liquidity",label:"Most liquidity"},{key:"liquidity_asc",label:"Least liquidity"},{key:"active",label:"Most requests in 24h"},{key:"active_asc",label:"Fewest requests in 24h"},{key:"credits",label:"Most $ volume in 24h"},{key:"sellers",label:"Most offers"},{key:"sellers_asc",label:"Fewest offers"},{key:"recently_added",label:"Recently added"}]},{label:"Order",options:[{key:"price_asc",label:"Price: low to high"},{key:"price_desc",label:"Price: high to low"},{key:"name_asc",label:"Name: A-Z"}]}],t0={tools:"Tools",vision:"Vision",reasoning:"Reasoning",json:"JSON",streaming:"Streaming",async:"Async",artifact:"Artifacts",voices:"Voices",transcription:"Transcription",music:"Music",image_edit:"Image-to-image",aspect_ratio:"Aspect ratio",resolution:"Resolution",text_to_video:"Text-to-video",image_to_video:"Image-to-video",with_audio:"With audio",multi_image:"Multi-image"},t1={tools:q.Z,vision:F.Z,reasoning:E.Z,json:P.Z},t2=["tools","vision","reasoning","json"];function t5(e){var t;let n=null!==(t=null==e?void 0:e.subFilters)&&void 0!==t?t:t2,i=n.map(e=>({key:e,label:t0[e],icon:t1[e]}));return{keys:n,options:i,label:e&&"all"!==e.key?"Refine ".concat(e.label.toLowerCase()," models"):"Capabilities"}}let t4={tools:"Supports tool and function calling for agent workflows.",vision:"Accepts image input for multimodal prompts.",reasoning:"Supports reasoning controls or reasoning-token outputs for complex tasks.",json:"Can return JSON mode or structured output responses.",streaming:"Can stream partial responses while generation is in progress.",async:"Supports long-running asynchronous jobs.",artifact:"Can return generated files or media artifacts.",voices:"Supports selectable voices for audio generation.",transcription:"Transcribes speech to text (speech-to-text).",music:"Generates music or instrumental audio.",image_edit:"Edits or transforms an input image (image-to-image).",aspect_ratio:"Exposes an aspect-ratio control for the generated image.",resolution:"Exposes a resolution / size control for the generated image.",text_to_video:"Generates video from a text prompt.",image_to_video:"Animates an input image into video.",with_audio:"Produces video with a synchronized audio track.",multi_image:"Accepts multiple / reference input images."},t3=["all","text","image","audio","video"],t6=[{key:"all",label:"All models"},{key:"text",label:"Text",subFilters:["tools","vision","reasoning","json","streaming"]},{key:"image",label:"Image",subFilters:["image_edit","aspect_ratio","resolution"]},{key:"audio",label:"Audio",subFilters:["voices","transcription","music"]},{key:"video",label:"Video",subFilters:["text_to_video","image_to_video","with_audio","multi_image"]},{key:"decisions",label:"Decisions",subFilters:[]}],t8=["off","onboarded","listing","earning"],t7=function(){let e=(tt.env.NEXT_PUBLIC_MARKETPLACE_TEST_STATE||tt.env.NEXT_PUBLIC_SELLER_TEST_STATE||"").toLowerCase().trim();return t8.includes(e)?e:"off"}(),t9="off"!==t7;function ne(e){let{target:t,start:n,formatter:i}=e,s=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1200,[i,s]=(0,l.useState)(t);return(0,l.useEffect)(()=>{let i=Number.isFinite(e)?e:0,r=Math.min(Number.isFinite(t)?t:0,i),a=0,o=performance.now();s(r);let l=e=>{let t=Math.min(1,(e-o)/n);s(r+(i-r)*(1-Math.pow(1-t,3))),t<1&&(a=requestAnimationFrame(l))};return a=requestAnimationFrame(l),()=>cancelAnimationFrame(a)},[n,t,e]),i}(t,n);return(0,r.jsx)(r.Fragment,{children:i(s)})}function nt(e){var t;let{stats:n}=e,i=[{target:n.modelCount,start:n.modelCount>10?10:0,formatter:tE,label:"models",valueClassName:"text-ink"},{target:n.avgSavings,start:n.avgSavings>8?8:0,formatter:tP,label:"avg savings",valueClassName:"text-success-vivid"},{target:null!==(t=n.saved24hUsd)&&void 0!==t?t:0,start:null!=n.saved24hUsd&&n.saved24hUsd>0?Math.max(1,.12*n.saved24hUsd):0,formatter:null==n.saved24hUsd?()=>"â":tW,label:"saved in 24h",valueClassName:"text-success-vivid"},{target:n.activeOffers,start:n.activeOffers>10?10:0,formatter:tE,label:"active offers",valueClassName:"text-ink"}];return(0,r.jsx)("section",{"aria-label":"Live market stats",className:"w-full overflow-hidden bg-transparent",children:(0,r.jsx)("div",{className:"mx-auto grid max-w-[340px] grid-cols-2 gap-x-4 gap-y-4 sm:max-w-none sm:grid-cols-4 sm:gap-x-0",children:i.map((e,t)=>(0,r.jsxs)("div",{className:"min-w-0 border-divider py-2 text-center sm:px-4 sm:py-3 ".concat(0===t?"":2===t?"sm:border-l":"border-l"),children:[(0,r.jsx)("div",{className:"max-w-full whitespace-nowrap text-[24px] font-medium leading-none tracking-normal sm:text-[26px] md:text-[28px] ".concat(e.valueClassName),children:(0,r.jsx)(ne,{target:e.target,start:e.start,formatter:e.formatter})}),(0,r.jsx)("div",{className:"mt-2 whitespace-nowrap text-[12px] font-medium leading-[1.25] text-ink-muted sm:text-[13px]",children:e.label})]},e.label))})})}function nn(e){let{type:t}=e,n="h-4 w-4 shrink-0";return"all"===t?(0,r.jsx)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M4 6h16 M4 12h16 M4 18h16"})}):"text"===t?(0,r.jsx)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M5 6h14 M12 6v12 M9 18h6"})}):"vision"===t?(0,r.jsxs)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6z"}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"2.5"})]}):"reasoning"===t?(0,r.jsx)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M9 3h6 M12 3v3 M8 8a4 4 0 0 1 8 0c0 1.6-.8 2.7-2 3.6-.9.7-1.4 1.5-1.4 2.4H11.4c0-.9-.5-1.7-1.4-2.4C8.8 10.7 8 9.6 8 8z M10 18h4 M10.5 21h3"})}):"tools"===t?(0,r.jsx)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M14.7 6.3a4 4 0 0 0-5 5L4 17v3h3l5.7-5.7a4 4 0 0 0 5-5l-2.5 2.5-3-3 2.5-2.5z"})}):"json"===t?(0,r.jsx)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M8 8 4 12l4 4 M16 8l4 4-4 4 M14 5l-4 14"})}):"streaming"===t?(0,r.jsx)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M4 12h4 M12 12h.01 M16 12h4 M7 8a7 7 0 0 1 10 0 M7 16a7 7 0 0 0 10 0"})}):"image"===t?(0,r.jsxs)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("rect",{x:"4",y:"5",width:"16",height:"14",rx:"2"}),(0,r.jsx)("path",{d:"M8 14l3-3 2.5 2.5L16 10l4 5"}),(0,r.jsx)("circle",{cx:"8.5",cy:"9",r:"1"})]}):"audio"===t?(0,r.jsx)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M4 10v4 M8 7v10 M12 4v16 M16 8v8 M20 11v2"})}):"decisions"===t?(0,r.jsxs)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"6",cy:"12",r:"2"}),(0,r.jsx)("circle",{cx:"18",cy:"6",r:"2"}),(0,r.jsx)("circle",{cx:"18",cy:"18",r:"2"}),(0,r.jsx)("path",{d:"M8 12h3a3 3 0 0 0 3-3V8 M14 15v-3a3 3 0 0 1 3-3"})]}):"async"===t?(0,r.jsx)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M4 12a8 8 0 0 1 13.7-5.7 M20 12a8 8 0 0 1-13.7 5.7 M17 3v4h-4 M7 21v-4h4"})}):"artifact"===t?(0,r.jsx)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M5 7l7-4 7 4v10l-7 4-7-4V7z M5 7l7 4 7-4 M12 11v10"})}):"voices"===t?(0,r.jsx)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M12 3a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3z M5 10v1a7 7 0 0 0 14 0v-1 M12 18v3 M9 21h6"})}):"transcription"===t?(0,r.jsxs)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("rect",{x:"5",y:"3",width:"14",height:"18",rx:"2"}
1),(0,r.jsx)("path",{d:"M9 8h6 M9 12h6 M9 16h4"})]}):"music"===t?(0,r.jsxs)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M8.5 18V6l11-2v12"}),(0,r.jsx)("circle",{cx:"6",cy:"18",r:"2.5"}),(0,r.jsx)("circle",{cx:"17",cy:"16",r:"2.5"})]}):"image_edit"===t?(0,r.jsxs)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M11 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5"}),(0,r.jsx)("path",{d:"M18.5 2.5a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4z"})]}):"aspect_ratio"===t?(0,r.jsxs)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M6 2v14a2 2 0 0 0 2 2h14"}),(0,r.jsx)("path",{d:"M18 22V8a2 2 0 0 0-2-2H2"})]}):"resolution"===t?(0,r.jsx)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M8 3H5a2 2 0 0 0-2 2v3 M21 8V5a2 2 0 0 0-2-2h-3 M3 16v3a2 2 0 0 0 2 2h3 M16 21h3a2 2 0 0 0 2-2v-3"})}):"text_to_video"===t?(0,r.jsxs)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"m22 8-6 4 6 4V8Z"}),(0,r.jsx)("rect",{x:"2",y:"6",width:"14",height:"12",rx:"2"})]}):"image_to_video"===t?(0,r.jsxs)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),(0,r.jsx)("path",{d:"M10 9l5 3-5 3z"})]}):"with_audio"===t?(0,r.jsxs)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M11 5 6 9H2v6h4l5 4z"}),(0,r.jsx)("path",{d:"M15.5 8.5a5 5 0 0 1 0 7 M19 5a9 9 0 0 1 0 14"})]}):"multi_image"===t?(0,r.jsxs)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"}),(0,r.jsx)("path",{d:"M16 4H6a2 2 0 0 0-2 2v10"})]}):(0,r.jsxs)("svg",{className:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("rect",{x:"4",y:"7",width:"13",height:"10",rx:"2"}),(0,r.jsx)("path",{d:"M17 11l4-2.5v7L17 13"})]})}let ni=Object.fromEntries(m.yU.map(e=>[e.id,e]));function ns(e){if(null==e)return null;let t=Number(e);return Number.isFinite(t)?t:null}function nr(e){let t=String((null==e?void 0:e.id)||"").toLowerCase(),n=String((null==e?void 0:e.name)||"").toLowerCase(),i=null==e?void 0:e.architecture,s=String((null==i?void 0:i.modality)||"").toLowerCase(),r=((null==i?void 0:i.input_modalities)||[]).map(e=>e.toLowerCase()),a=((null==i?void 0:i.output_modalities)||[]).map(e=>e.toLowerCase()),o=((null==e?void 0:e.supported_parameters)||[]).map(e=>e.toLowerCase());if("decisions"===s||a.includes("decisions")||o.includes("decisions"))return"decisions";let l=s.includes("->")?s.split("->").at(-1)||"":s,c=a.length>0?a:l?l.split("+"):[],d=c.length>0;return c.includes("video")?"video":c.includes("image")?"image":!d&&(t.includes("video")||n.includes("video"))?"video":!d&&(t.includes("image")||t.includes("flux")||t.includes("sdxl"))?"image":"text->audio"===s||r.includes("text")&&a.includes("audio")&&(o.includes("voice")||o.includes("voices"))||o.includes("voice")||o.includes("voices")||t.includes("tts")||n.includes("text to speech")?"tts":s.includes("music")||a.includes("music")||o.includes("music")||t.includes("music")||n.includes("music")||t.includes("ace-step")?"music":"audio->text"===s||r.includes("audio")&&a.includes("text")||t.includes("whisper")||t.includes("stt")||n.includes("speech-to-text")||n.includes("transcription")?"stt":"text"}function na(e){var t,n;let i=String(e.model||"").toLowerCase(),s=e.catalogModel,r=ni[e.model],a=(null==r?void 0:null===(n=r.modality)||void 0===n?void 0:null===(t=n.split("->")[1])||void 0===t?void 0:t.toLowerCase())||"";return s?nr(s):a.includes("video")||i.includes("video")?"video":a.includes("image")||i.includes("image")||i.includes("flux")||i.includes("sdxl")?"image":i.includes("tts")||i.includes("text-to-speech")?"tts":i.includes("music")||i.includes("song")||i.includes("ace-step")?"music":i.includes("whisper")||i.includes("transcribe")||i.includes("transcription")||i.includes("stt")?"
1stt":a.includes("audio")||a.includes("speech")||i.includes("audio")?"tts":"text"}function no(e){var t;return ns(null==e?void 0:null===(t=e.pricing)||void 0===t?void 0:t.image)}function nl(e,t){var n,i,s;return"text"===t?null:"image"===t?null!==(n=ns(e.best_image_per_image))&&void 0!==n?n:no(e.catalogModel):null!==(s=null!==(i=ns(e.best_media_unit_price))&&void 0!==i?i:ns(e.best_image_per_image))&&void 0!==s?s:no(e.catalogModel)}function nc(e){let{byResolution:t,durations:n,floor:i}=e;return(0,r.jsxs)(j.u,{children:[(0,r.jsx)(j.aJ,{asChild:!0,children:(0,r.jsxs)("span",{tabIndex:0,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"inline-flex cursor-help items-center gap-1 whitespace-nowrap text-xs text-ink-bright focus:outline-none focus:ring-1 focus:ring-primary/50 md:text-sm","aria-label":"Variable pricing from $".concat(i.toFixed(2)," per second by resolution"),children:[(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"text-ink-faint",children:"from "}),"$",i.toFixed(2),(0,r.jsx)("span",{className:"text-ink-faint",children:" / sec"})]}),(0,r.jsxs)("svg",{className:"h-3 w-3 shrink-0 text-ink-faint",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,r.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,r.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})]})}),(0,r.jsx)(j._v,{side:"top",align:"end",className:"max-w-none",children:(0,r.jsxs)("div",{className:"text-[11px]",children:[(0,r.jsx)("div",{className:"mb-1.5 font-medium text-ink-muted",children:"Variable pricing \xb7 billed per second by resolution"}),(0,r.jsxs)("table",{className:"border-collapse",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"text-ink-faint",children:[(0,r.jsx)("th",{className:"pr-3 text-left font-normal",children:"res"}),(0,r.jsx)("th",{className:"px-2 text-right font-normal",children:"$/sec"}),n.map(e=>(0,r.jsxs)("th",{className:"px-2 text-right font-normal",children:[e,"s"]},e))]})}),(0,r.jsx)("tbody",{className:"font-mono text-ink-bright",children:Object.keys(t).map(e=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:"pr-3 text-left text-ink-secondary",children:e}),(0,r.jsxs)("td",{className:"px-2 text-right text-ink-muted",children:["$",t[e].toFixed(2)]}),n.map(n=>(0,r.jsxs)("td",{className:"px-2 text-right",children:["$",(t[e]*n).toFixed(2)]},n))]},e))})]}),(0,r.jsx)("div",{className:"mt-1.5 text-ink-faint",children:"Provider reference \xb7 buyers pay the sellerâs rate against this."})]})})]})}let nd=new WeakMap;function nu(e){if(!e||"object"!=typeof e)return nm(e);let t=nd.get(e);if(t)return t;let n=nm(e);return nd.set(e,n),n}function nm(e){var t;let n=ni[e.model],i=e.catalogModel,s=new Set(i?[...(i.supported_features||[]).map(e=>e.toLowerCase()),...(i.supported_parameters||[]).map(e=>e.toLowerCase())]:((null==n?void 0:n.features)||[]).map(e=>e.toLowerCase())),r=i?((null===(t=i.architecture)||void 0===t?void 0:t.input_modalities)||[]).map(e=>e.toLowerCase()):String((null==n?void 0:n.modality)||"").split("->")[0].split("+").map(e=>e.toLowerCase()),a=[];return(s.has("tools")||s.has("tool_choice")||s.has("parallel_tool_calls"))&&a.push("tools"),(s.has("vision")||r.includes("image"))&&a.push("vision"),(s.has("reasoning")||s.has("include_reasoning")||s.has("reasoning_effort")||s.has("internal_reasoning"))&&a.push("reasoning"),(s.has("json_mode")||s.has("structured_outputs")||s.has("response_format"))&&a.push("json"),(s.has("streaming")||s.has("stream")||s.has("stream_options"))&&a.push("streaming"),s.has("async")&&a.push("async"),s.has("artifact")&&a.push("artifact"),(s.has("voice")||s.has("voices"))&&a.push("voices"),s.has("transcription")&&a.push("transcription"),s.has("music")&&a.push("music"),(s.has("image-to-image")||s.has("image_edit"))&&a.push("image_edit"),s.has("aspect_ratio")&&a.push("aspect_ratio"),s.has("resolution")&&a.push("resolution"),s.has("text-to-video")&&a.push("text_to_video"),s.has("image-to-video")&&a.push("image_to_video"),s.has("audio")&&s.has("video")&&a.push("with_audio"),(s.has("multi-image")||s.has("reference_images"))&&s.has("video")&&a.push("multi_image"),a}function nx(e,t){if("all"===t)return!0;let n=na(e);return"audio"===t?"music"===n||"tts"===n||"stt"===n:"text"===t||"image"===t||"video"===t||"decisions"===t?n===t:nu(e).includes(t)}function np(e){let t=ni[e.model];return String((e.catalogModel?e.provider:e.provider||(null==t?void 0:t.provider))||"").trim()}function nh(e){return np(e).toLowerCase()}function nf(e){let t=function(e){let t=na(e);return tC(e,t)?nl(e,t)||0:tA(e.best_input_per_1m||0,e.best_output_per_1m||0)}(e);return t>0?t:Number.POSITIVE_INFINITY}function nv(e){let t=Number(e.discounted_liquidity_usd||0);return Number(e.uncapped_discounted_offer_count||0)>0?Number.MAX_SAFE_INTEGER:t>0?t:0}function ng(e){var t,n;return Number(null!==(n=null!==(t=e.healthy_seller_count)&&void 0!==t?t:e.seller_count)&&void 0!==n?n:0)}function nb(e,t){var n,i,s,r;return"best_price"===t?nf(e):"discount"===t||"discount_asc"===t?tF(e):"liquidity"===t||"liquidity_asc"===t?nv(e):"active"===t||"active_asc"===t?nw(e):"credits"===t?tR(Number(null!==(r=null!==(s=e.credits_sold_24h)&&void 0!==s?s:e.credits_sold_total)&&void 0!==r?r:0)):"sellers"===t||"sellers_asc"===t?ng(e):"price_asc"===t||"price_desc"===t?nf(e):"recently_added"===t?Number(null!==(i=null===(n=e.catalogModel)||void 0===n?void 0:n.added_at)&&void 0!==i?i:NaN):0}let nj={best_price:{asc:"best_price",desc:"price_desc"},discount:{asc:"discount_asc",desc:"discount"},liquidity:{asc:"liquidity_asc",desc:"liquidity"},active:{asc:"active_asc",desc:"active"},sellers:{asc:"sellers_asc",desc:"sellers"}};function nk(e,t){return nj[t].asc===e?"asc":nj[t].desc===e?"desc":"best_price"===t&&"price_asc"===e?"asc":null}function ny(e){return"best_price"===e?"asc":"desc"}function nw(e){return tR(Number(e.requests_24h||0))}function nN(e){var t;let n=ni[e.model];
1return String(e.display_name||(null===(t=e.catalogModel)||void 0===t?void 0:t.name)||(null==n?void 0:n.name)||e.model||"")}function n_(e){let{direction:t}=e;return(0,r.jsx)("span",{className:"inline-flex h-3.5 w-3.5 items-center justify-center transition-opacity ".concat(t?"opacity-100":"opacity-0"),children:(0,r.jsx)("svg",{className:"h-3.5 w-3.5 text-ink",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:"asc"===t?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("path",{d:"M12 19V5"}),(0,r.jsx)("path",{d:"m6 11 6-6 6 6"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("path",{d:"M12 5v14"}),(0,r.jsx)("path",{d:"m6 13 6 6 6-6"})]})})})}function nC(e){let{label:t,column:n,selectedSort:i,onSort:s,align:a="right"}=e,o=nk(i,n),l=o?"asc"===o?"desc":"asc":ny(n);return(0,r.jsx)("div",{className:"flex ".concat("center"===a?"justify-center":"justify-end"),children:(0,r.jsxs)("button",{type:"button",onClick:()=>s(n),"aria-label":"".concat(t,", ").concat("asc"===o?"ascending":"desc"===o?"descending":"not sorted",". Sort ").concat("asc"===l?"ascending":"descending","."),className:"group inline-flex items-center gap-1 rounded px-0.5 py-1 text-[11px] font-medium outline-none transition-colors hover:text-ink focus-visible:ring-1 focus-visible:ring-primary/50 ".concat(o?"text-ink":"text-ink-dim"),children:[(0,r.jsx)("span",{className:"whitespace-nowrap",children:t}),(0,r.jsx)(n_,{direction:o})]})})}function nM(e){var t,n;let{market:i,onClose:s}=e,a=ni[i.model],o=(i.catalogModel?i.provider:i.provider||(null==a?void 0:a.provider))||i.display_name||(null===(t=i.catalogModel)||void 0===t?void 0:t.name),c=i.display_name||(null===(n=i.catalogModel)||void 0===n?void 0:n.name)||(null==a?void 0:a.name)||i.model,d=(0,l.useRef)(null),u=(0,l.useRef)(null),m=(0,l.useRef)(0),x=(0,l.useRef)(null),[p,h]=(0,l.useState)("current-offers"),[f,v]=(0,l.useState)(0),g=String(i.model).replace(/[^a-zA-Z0-9_-]/g,"-"),b="mobile-current-offers-".concat(g),j="mobile-simulate-order-fill-".concat(g),k=e=>{m.current=e,v(e)},y=(e,t)=>{h(t);let n=d.current,i=document.getElementById(e);if(!n||!i)return;let s=n.getBoundingClientRect(),r=i.getBoundingClientRect(),a=n.scrollTop+r.top-s.top-8;n.scrollTo({top:Math.max(0,a),behavior:"smooth"})},w=()=>{let e=m.current>=56;if(u.current=null,x.current=null,e){s();return}k(0)},N=e=>!!e.target.closest('button, a, input, [role="tab"]'),_=e=>{x.current===e.pointerId&&(e.currentTarget.releasePointerCapture(e.pointerId),w())};return(0,r.jsxs)("div",{className:"fixed inset-0 z-50 md:hidden",children:[(0,r.jsx)("button",{type:"button",className:"absolute inset-0 cursor-default bg-shade/70","aria-label":"Close order book",onClick:s}),(0,r.jsxs)("section",{role:"dialog","aria-modal":"true","aria-labelledby":"mobile-orderbook-title",className:"absolute inset-x-0 bottom-0 flex max-h-[88dvh] flex-col overflow-hidden rounded-t-2xl border-t border-divider bg-surface-page shadow-2xl shadow-shade/70",style:{transform:f>0?"translateY(".concat(f,"px)"):void 0,transition:f>0?"none":"transform 160ms ease-out"},children:[(0,r.jsxs)("div",{className:"shrink-0 border-b border-divider-subtle",children:[(0,r.jsxs)("div",{role:"button",tabIndex:0,"aria-label":"Swipe down to dismiss order book",onPointerDown:e=>{"mouse"!==e.pointerType&&(N(e)||(u.current=e.clientY,x.current=e.pointerId,k(0),e.currentTarget.setPointerCapture(e.pointerId)))},onPointerMove:e=>{x.current===e.pointerId&&null!=u.current&&k(Math.min(Math.max(0,e.clientY-u.current),160))},onPointerUp:_,onPointerCancel:_,onMouseDown:e=>{if(0!==e.button||N(e))return;e.preventDefault(),u.current=e.clientY,x.current=null,k(0);let t=e=>{null!=u.current&&k(Math.min(Math.max(0,e.clientY-u.current),160))},n=()=>{window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n),w()};window.addEventListener("mousemove",t),window.addEventListener("mouseup",n)},className:"cursor-grab touch-none select-none outline-none active:cursor-grabbing",children:[(0,r.jsx)("div",{className:"flex justify-center pt-2.5 pb-1",children:(0,r.jsx)("span",{className:"h-1.5 w-12 rounded-control bg-overlay/70","aria-hidden":"true"})}),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 px-4 pb-3 pt-1",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)(eU.C,{label:c,modelId:i.model,provider:o,size:"lg"}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h2",{id:"mobile-orderbook-title",className:"truncate text-[15px] font-semibold leading-5 text-ink",children:c}),(0,r.jsx)("div",{className:"mt-0.5 truncate font-mono text-[10px] text-ink-dim",children:i.model})]})]}),(0,r.jsx)("button",{type:"button",onClick:s,className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md text-ink-muted transition-colors hover:bg-surface-hover hover:text-ink focus:outline-none focus:ring-2 focus:ring-primary/35","aria-label":"Close order book",children:"x"})]})]}),(0,r.jsxs)("div",{role:"tablist","aria-label":"Order book drawer sections",className:"grid grid-cols-2 gap-1 rounded-lg px-4 pb-3",children:[(0,r.jsx)("button",{type:"button",role:"tab","aria-selected":"current-offers"===p,"aria-controls":b,onClick:()=>y(b,"current-offers"),className:"rounded-md px-3 py-2 text-center text-[12px] font-medium transition-colors focus:outline-none focus:ring-1 focus:ring-primary/50 ".concat("current-offers"===p?"bg-surface-route-active text-ink ring-1 ring-primary/35":"bg-transparent text-ink-muted hover:bg-surface-chip-hover hover:text-ink-emph"),children:"Current Offers"}),(0,r.jsx)("button",{type:"button",role:"tab","aria-selected":"simulate-order-fill"===p,"aria-controls":j,onClick:()=>y(j,"simulate-order-fill"),className:"rounded-md px-3 py-2 text-center text-[12px] font-medium transition-colors focus:outline-none focus:ring-1 focus:ring-primary/50 ".concat("simulate-order-fill"===p?"bg-surface-route-active text-ink ring-1 ring-primary/35":"bg-transparent text-ink-muted hover:bg-surface-chip-hover hover:text-ink-emph"),children:"Simulate order fill"})]})]}),(0,r.jsx)("div",{ref:d,className:"min-h-0 flex-1 overflow-y-auto overscroll-contain px-3 pb-[calc(1rem+env(safe-area-inset-bottom))] pt-3",children:(0,r.jsxs)("div",{className:"grid gap-2",children:[(0,r.jsx)("div",{id:b,children:(0,r.jsx)(tr,{model:i.model})}),(0,r.jsx)("div",{id:j,children:(0,r.jsx)(ts,{model:i.model})})]})})]})]})}let nS=null;function nL(){null!==nS&&(window.cancelAnimationFrame(nS),nS=null)}function nA(e){nL();let t="function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?1:.2,n=0,i=0,s=()=>{let r=Math.max(0,document.documentElement.scrollHeight-window.innerHeight),a=Math.max(0,Math.min(e(),r)),o=window.scrollY,l=a-o;if(1>Math.abs(l)||i>=600){window.scrollTo(0,a),n+=1,nS=n<4&&i<600?window.requestAnimationFrame(s):null;return}n=0,i+=1,window.scrollTo(0,o+Math.sign(l)*Math.min(Math.abs(l),Math.max(1,Math.abs(l)*t))),nS=window.requestAnimationFrame(s)};nS=window.requestAnimationFrame(s)}function nq(){let[e,t]=(0,l.useState)(!0),[n,i]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=()=>{let e=window.scrollY,n=document.documentElement.scrollHeight;t(e<240),i(e+window.innerHeight>=n-240)};return e(),window.addEventListener("scroll",e,{passive:!0}),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e),nL()}},[]);let s="flex h-11 w-11 items-center justify-center rounded-indicator bg-surface-float dark:bg-surface-float/95 text-ink-secondary shadow-lg shadow-shade/40 ring-1 ring-divider backdrop-blur transition-all duration-200 hover:bg-surface-tag hover:text-ink focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/45";return(0,r.jsxs)("div",{className:"fixed bottom-6 right-4 z-30 flex flex-col gap-2 sm:right-6",children:[(0,r.jsx)("button",{type:"button",onClick:()=>nA(()=>0),"aria-label":"Jump to top",title:"Jump to top",className:"".concat(s," ").concat(e?"pointer-events-none translate-y-1 opacity-0":"opacity-100"),children:(0,r.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"m6 15 6-6 6 6"})})}),(0,r.jsx)("button",{type:"button",onClick:()=>nA(()=>document.documentElement.scrollHeight),"aria-label":"Jump to bottom",title:"Jump to bottom",className:"".concat(s," ").concat(n?"pointer-events-none translate-y-1 opacity-0":"opacity-100"),children:(0,r.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"m6 9 6 6 6-6"})})})]})}function nF(){var e;let{data:t,isLoading:n,error:i}=(0,u.t4)(),s=null==t?void 0:t.saved24hMicro,a=null==s?null:s/1e6,o=null==t?void 0:t.markets,m=null==t?void 0:t.models,{searchQuery:g,setSearchQuery:b}=(0,v.U)(),{buyerApiKey:N}=(0,y.S)(),[_,C]=(0,l.useState)(!1),[M,S]=(0,l.useState)(null),[L,q]=(0,l.useState)(x.wq.tab),[F,E]=(0,l.useState)(x.wq.sort),[P,z]=(0,l.useState)(x.wq.providers),[T,Z]=(0,l.useState)(!1),[W,D]=(0,l.useState)(x.wq.trust),[O,U]=(0,l.useState)(x.wq.minDiscount),[H,V]=(0,l.useState)(x.wq.priceRange),[$,K]=(0,l.useState)(x.wq.inputs),[Y,J]=(0,l.useState)(x.wq.caps),[G,Q]=(0,l.useState)(x.wq.minContext),[X,ee]=(0,l.useState)(x.wq.minSellers),[et,en]=(0,l.useState)(x.wq.minLiquidity),[ei,es]=(0,l.useState)(x.wq.uncappedOnly),[er,ea]=(0,l.useState)(!1),eo="all"!==W||G>0||O>0||H.min>0||null!==H.max||$.length>0||Y.length>0||X>0||et>0||ei,el=()=>
1{z(x.wq.providers),D(x.wq.trust),Q(x.wq.minContext),U(x.wq.minDiscount),V(x.wq.priceRange),K(x.wq.inputs),J(x.wq.caps),ee(x.wq.minSellers),en(x.wq.minLiquidity),es(x.wq.uncappedOnly),S(null)},ec={onTrustChange:e=>{D(e),S(null)},onMinContextChange:Q,onMinDiscountChange:U,onPriceRangeChange:V,onSelectedInputsChange:K,onSelectedCapsChange:J,onMinSellersChange:ee,onMinLiquidityChange:en,onUncappedOnlyChange:es},ed={trust:W,minContext:G,minDiscount:O,priceRange:H,selectedInputs:$,selectedCaps:Y,minSellers:X,minLiquidity:et,uncappedOnly:ei},[eu,em]=(0,l.useState)(!1),[ex,ep]=(0,l.useState)(null),[eh,ef]=(0,l.useState)(null),eg=(0,l.useMemo)(()=>(function(e){if("off"===e)return[];let t="earning"===e?1:"listing"===e?.36:.14,n="onboarded"===e?0:1;return["aion-labs.aion-2-0","claude-opus-4.5","claude-opus-4.8","claude-opus-4.7","claude-opus-4.6","claude-sonnet-4.5","claude-sonnet-4.6","deepseek-v3.2","gpt-5.4","gpt-5.4-mini","gemini-3-flash-preview","grok-4.1-fast","venice-z-image-turbo","venice-flux-2-pro","venice-kokoro-tts","venice-whisper-large-v3","venice-runway-gen4-5-text","venice-ace-step-15"].flatMap((i,s)=>{let r=ni[i];if(!r)return[];let a=na({model:i}),o="text"===a,l="image"===a,c=.48+s%6*.06,d=n?Math.max(1,8-s%5):0,u=n?Math.max(0,d-(s%4==0?1:0)):0,m=Math.round((1800-71*s)*t),x=o?Math.round(m*(2200+90*s)):0,p=o?Math.round(m*(420+28*s)):0,h=Number(((2200-83*s)*t).toFixed(2)),f=Number((h*(.62+.025*s)).toFixed(2)),v=Number(r.inputPrice||0),g=Number(r.outputPrice||0),b=l?"image":"tts"===a?"1K characters":"stt"===a?"minute":"job",j=n?Number(Math.max(0,5200-210*s).toFixed(2)):0,k=n&&s%5==0?1:0,y=["venice","openai","together","fireworks","groq","deepseek","anthropic","google"],w=y[s%y.length],N=n>0&&u>0&&s%7==0,_=N||n>0&&u>1&&s%3==0,C=Number((.82*c).toFixed(4)),M=(e,t,n,i,s)=>{let r=o?null:Number((v*n).toFixed(5));return{provider:e,trusted:t,best_input_per_1m:o?Number((v*n).toFixed(2)):0,best_output_per_1m:o?Number((g*n).toFixed(2)):0,best_media_unit_price:r,best_image_per_image:l?r:null,discounted_liquidity_usd:s,discounted_liquidity_offer_count:i,uncapped_discounted_offer_count:k,healthy_seller_count:i}},S=u>0?N?[M("jatevo",!1,C,u,j)]:_?[M(w,!0,c,Math.max(1,u-1),Number((.6*j).toFixed(2))),M("jatevo",!1,C,1,Number((.4*j).toFixed(2)))]:[M(w,!0,c,u,j)]:null,L=u>0&&(N||_)?C:c,A=o?null:Number((v*L).toFixed(5)),q=function(e,t,n){var i;let s=tD-1728e5,r=Array.from({length:24},(n,i)=>{let r=s+(i+.5)*72e5;return e+(.48-tH(new Date(r).getUTCHours()+new Date(r).getUTCMinutes()/60))*22+(1.5*Math.sin((i+1)*1.45+.72*t)+.9*Math.cos((i+t)*.58))+(i<12?-.8:.6)}),a=null!==(i=r[r.length-1])&&void 0!==i?i:e,o=e-a,l=Math.min(85,Math.max(e+18,24)),c=r.map(e=>Number(tO(e+o,2,l).toFixed(1)));return c[c.length-1]=Number(e.toFixed(1)),{buckets:c.map((e,i)=>{let r=s+(i+.5)*72e5;return{bucket:i,requests:Math.max(1,Math.round((18+2.4*t+.6*i)*n*(.58+1.12*tH(new Date(r).getUTCHours()+new Date(r).getUTCMinutes()/60)))),discount_pct:e}}),direction:function(e){if(e.length<2)return"stable";let t=e[0],n=e[e.length-1];return n>=t+1?"deepening":n<=t-1?"tightening":"stable"}(c),current_discount_pct:c[c.length-1],previous_discount_pct:c[0],request_count:Math.round(c.reduce((e,i,r)=>{let a=s+(r+.5)*72e5;return e+(18+2.4*t+.6*r)*n*(.58+1.12*tH(new Date(a).getUTCHours()+new Date(a).getUTCMinutes()/60))},0))}}(Math.max(0,(1-L)*100),s,t);return[{model:i,provider:r.provider,display_name:r.name,best_input_per_1m:o?Number((v*L).toFixed(2)):0,best_output_per_1m:o?Number((g*L).toFixed(2)):0,best_image_per_image:l?A:null,best_media_unit_price:o||l?null:A,media_unit:o?null:b,direct_input_per_1m:v,direct_output_per_1m:g,direct_image_per_image:l?v:null,direct_media_unit_price:o?null:v,direct_media_unit:o?null:b,seller_count:d,healthy_seller_count:u,requests_24h:m,input_tokens_24h:x,output_tokens_24h:p,volume_24h_usd:f,requests_total:Math.round(m*("earning"===e?38:7)),input_tokens_total:x*("earning"===e?38:7),output_tokens_total:p*("earning"===e?38:7),credits_sold_24h:h,credits_sold_total:Number((h*("earning"===e?42:8)).toFixed(2)),discount_trend_48h:q,discount_trend_24h:q,discounted_liquidity_usd:j,discounted_liquidity_offer_count:u,uncapped_discounted_offer_count:k,providerBreakdown:S}]})})(t7),[]),eb=(0,l.useMemo)(()=>t9?eg:Array.isArray(o)?o:[],[o,eg]),ej=async e=>{try{await (0,te.W)(e),ep(e),window.setTimeout(()=>ep(t=>t===e?null:t),1200),(0,k.A)({title:"Model name copied",description:e})}catch(e){console.error("Failed to copy model name:",e),(0,k.A)({title:"Copy failed",description:"Could not copy to the clipboard.",variant:"destructive"})}},ew=async e=>{let t=String(e.model);try{await (0,te.W)(function(e,t,n){if(!t)return tg(e,n);let i=tf(n),s=i?tv(i):'"inf_..."';return String.raw(ti(),s,tl,e)}(t,"decisions"===na(e),N)),ef(t),window.setTimeout(()=>ef(e=>e===t?null:e),1200),(0,k.A)({title:"curl command copied",description:t})}catch(e){console.error("Failed to copy curl command:",e),(0,k.A)({title:"Copy failed",description:"Could not copy to the clipboard.",variant:"destructive"})}},eN=e=>{E(t=>(function(e,t){let n=nk(e,t),i=n?"asc"===n?"desc":"asc":ny(t);return nj[t][i]})(t,e)),S(null)},e_=e=>{z(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),S(null)},eC=(0,l.useMemo)(()=>new Map((m||[]).map(e=>[e.id,e])),[m]),eq=(0,l.useMemo)(()=>{var e,t,n,i;let s=new Map;for(let t of eb){let n=eC.get(t.model);s.set(t.model,{...t,catalogModel:n,provider:n?n.provider:t.provider,display_name:n?n.name:t.display_name,pricing:n?n.pricing:t.pricing,media_unit:n?null===(e=n.pricing)||void 0===e?void 0:e.media_unit:t.media_unit})}for(let e of m||[]){if(s.has(e.id))continue;let r=ns(null===(t=e.pricing)||void 0===t?void 0:t.prompt),a=ns(null===(n=e.pricing)||void 0===n?void 0:n.completion),o=no(e),l=nr(e);s.set(e.id,{model:e.id,display_name:e.name,provider:e.provider,catalog_only:!0,catalogModel:e,pricing:e.pricing,media_unit:null===(i=e.pricing)||void 0===i?void 0:i.media_unit,best_input_per_1m:null!=r?1e6*r:0,best_output_per_1m:null!=a?1e6*a:0,best_image_per_image:"image"===l?o:null,best_media_unit_price:"image"!==l?o:null,seller_count:0,healthy_seller_count:0,requests_total:0,requests_24h:0,input_tokens_24h:0,output_tokens_24h:0,input_tokens_total:0,output_tokens_total:0,volume_24h_usd:0,credits_sold_total:0,credits_sold_24h:0})}return Array.from(s.values())},[eb,m,eC]),eF=(0,l.useMemo)(()=>tQ.reduce((e,t)=>
1(e[t.key]=eq.filter(e=>nx(e,t.key)).length,e),{}),[eq]);(0,l.useEffect)(()=>{eq.length>0&&"decisions"===L&&0===(eF.decisions||0)&&q("all")},[eq.length,eF.decisions,L]);let eE=(0,l.useMemo)(()=>tQ.filter(e=>t3.includes(e.key)||(eF[e.key]||0)>0),[eF]),eP=(0,l.useMemo)(()=>t6.find(e=>e.key===L),[L]),eI=(0,l.useMemo)(()=>t5(eP),[eP]),eR=(0,l.useMemo)(()=>{let e=0,t=0,n=0;for(let i of eq){let s=tF(i);s>0&&(e+=s,t+=1),n+=ng(i)}return{modelCount:eq.length,avgSavings:t>0?e/t:0,saved24hUsd:a,activeOffers:n}},[eq,a]),eB=(0,l.useMemo)(()=>g.toLowerCase().split(",").map(e=>e.split(/\s+/).filter(Boolean)).filter(e=>e.length>0),[g]),ez=(0,l.useMemo)(()=>new Set(P),[P]),eZ="all"!==W,eD=(0,l.useMemo)(()=>{if(!eZ)return eq;let e=[];for(let t of eq){let n=function(e,t){let n=e.providerBreakdown;if(!n||0===n.length)return null;let i=n.filter(e=>"trusted"===t?!0===e.trusted:"untrusted"!==t||!1===e.trusted);if(0===i.length)return null;let s=null,r=Number.POSITIVE_INFINITY,a=0,o=0,l=0,c=0;for(let t of i){let n=nf({...e,best_input_per_1m:t.best_input_per_1m,best_output_per_1m:t.best_output_per_1m,best_media_unit_price:t.best_media_unit_price,best_image_per_image:t.best_image_per_image});n<r&&(r=n,s=t),a+=Number(t.discounted_liquidity_usd||0),o+=Number(t.discounted_liquidity_offer_count||0),l+=Number(t.uncapped_discounted_offer_count||0),c+=Number(t.healthy_seller_count||0)}let d=null!=s?s:i[0];return{...e,best_input_per_1m:d.best_input_per_1m,best_output_per_1m:d.best_output_per_1m,best_media_unit_price:d.best_media_unit_price,best_image_per_image:d.best_image_per_image,discounted_liquidity_usd:a,discounted_liquidity_offer_count:o,uncapped_discounted_offer_count:l,healthy_seller_count:c,seller_count:c}}(t,W);n&&e.push(n)}return e},[eq,W,eZ]),eO=(0,l.useMemo)(()=>eD.filter(e=>{var t;return nx(e,L)&&(t=function(e){var t;let n=ni[e.model];return{model:String(e.model||"").toLowerCase(),provider:np(e).toLowerCase(),displayName:String(e.display_name||(null===(t=e.catalogModel)||void 0===t?void 0:t.name)||(null==n?void 0:n.name)||"").toLowerCase(),capabilityTags:nu(e).map(e=>e.toLowerCase())}}(e),0===eB.length||eB.some(e=>e.every(e=>t.model.includes(e)||t.provider.includes(e)||t.displayName.includes(e)||t.capabilityTags.some(t=>t.includes(e)))))}),[eD,L,eB]),eH=(0,l.useMemo)(()=>{let e=new Map;for(let t of eq){let n=np(t);n&&!e.has(n.toLowerCase())&&e.set(n.toLowerCase(),n)}let t=new Map;for(let e of eO){let n=nh(e);n&&t.set(n,(t.get(n)||0)+1)}return Array.from(new Set([...t.keys(),...P])).map(n=>({key:n,label:e.get(n)||n,count:t.get(n)||0})).sort((e,t)=>t.count-e.count||e.label.localeCompare(t.label))},[eq,eO,P]),eV=(0,l.useMemo)(()=>[...eO.filter(e=>{var t;if(t=nh(e),!(0===ez.size||""!==t&&ez.has(t))||G>0&&function(e){var t,n;let i=Number((e.catalogModel?e.catalogModel.context_length||(null===(t=e.catalogModel.top_provider)||void 0===t?void 0:t.context_length):null===(n=ni[e.model])||void 0===n?void 0:n.contextLength)||0);return Number.isFinite(i)&&i>0?i:0}(e)<G||O>0&&tF(e)<O)return!1;if(H.min>0||null!==H.max){if(!(null==e.best_media_unit_price&&null==e.best_image_per_image))return!1;let t=Number(e.best_output_per_1m||0);if(t<H.min||null!==H.max&&t>H.max)return!1}if($.length>0){let t=function(e){var t,n;let i=null===(n=e.catalogModel)||void 0===n?void 0:null===(t=n.architecture)||void 0===t?void 0:t.input_modalities;if(Array.isArray(i)&&i.length>0)return i.map(e=>String(e).toLowerCase()).filter(e=>["text","image","audio","video","file"].includes(e));let s=nu(e);return s.includes("vision")||s.includes("image_edit")?["text","image"]:["text"]}(e);if(!$.every(e=>t.includes(e)))return!1}return!(Y.length>0&&!Y.every(t=>nu(e).includes(t))||X>0&&ng(e)<X)&&!(et>0&&!(Number(e.uncapped_discounted_offer_count||0)>0||Number(e.discounted_liquidity_usd||0)>=et)||ei&&0>=Number(e.uncapped_discounted_offer_count||0))})].sort((e,t)=>{let n="best_price"===F||"price_asc"===F||"discount_asc"===F||"liquidity_asc"===F||"active_asc"===F||"sellers_asc"===F||"name_asc"===F?"asc":"desc";if("name_asc"===F){let n=nN(e).localeCompare(nN(t));if(0!==n)return n}else{let i=function(e,t,n){let i=!Number.isFinite(e),s=!Number.isFinite(t);return i||s?i&&s?0:i?1:-1:"asc"===n?e-t:t-e}(nb(e,F),nb(t,F),n);if(0!==i)return i}if("best_price"===F){let n=tF(t)-tF(e);if(0!==n)return n;let i=nv(t)-nv(e);if(0!==i)return i}if("discount"===F||"discount_asc"===F){let n=nf(e)-nf(t);if(0!==n)return n}let i=nw(t)-nw(e);return 0!==i?i:nN(e).localeCompare(nN(t))}),[eO,ez,F,G,O,H,$,Y,X,et,ei]),e$={provider:(0,r.jsx)(A,{options:eH,selected:P,onToggle:e_,onClear:()=>{z([]),S(null)},ariaLabel:"Filter marketplace models by provider",triggerClassName:"w-full"}),...ed,...ec,capabilities:eI.options,capabilitiesLabel:eI.label,isDirty:eo||P.length>0,onReset:el,shownCount:eV.length,totalCount:eD.length},eK=[...P.map(e=>{var t,n;return{key:"provider:".concat(e),label:null!==(n=null===(t=eH.find(t=>t.key===e))||void 0===t?void 0:t.label)&&void 0!==n?n:e,onRemove:()=>e_(e)}}),...function(e,t,n){var i,s,r,a;let o=[];for(let n of("all"!==e.trust&&o.push({key:"trust",label:null!==(s=null===(i=ey.find(t=>t.value===e.trust))||void 0===i?void 0:i.label)&&void 0!==s?s:e.trust,onRemove:()=>t.onTrustChange("all")}),e.minContext>0&&o.push({key:"context",label:"".concat(eM(e.minContext)," context"),onRemove:()=>t.onMinContextChange(0)}),e.minDiscount>0&&o.push({key:"discount",label:"".concat(e.minDiscount,"%+ off"),onRemove:()=>t.onMinDiscountChange(0)}),(e.priceRange.min>0||null!==e.priceRange.max)&&o.push({key:"price",label:"".concat(eA(e.priceRange)," / 1M"),onRemove:()=>t.onPriceRangeChange(ev)}),e.selectedInputs)){let i=null!==(a=null===(r=ek.find(e=>e.key===n))||void 0===r?void 0:r.label)&&void 0!==a?a:n;
1o.push({key:"input:".concat(n),label:"".concat(i," input"),onRemove:()=>t.onSelectedInputsChange(e.selectedInputs.filter(e=>e!==n))})}for(let i of e.selectedCaps)o.push({key:"cap:".concat(i),label:n(i),onRemove:()=>t.onSelectedCapsChange(e.selectedCaps.filter(e=>e!==i))});return e.minSellers>0&&o.push({key:"sellers",label:"".concat(eL(e.minSellers)," sellers"),onRemove:()=>t.onMinSellersChange(0)}),e.minLiquidity>0&&o.push({key:"liquidity",label:eS(e.minLiquidity),onRemove:()=>t.onMinLiquidityChange(0)}),e.uncappedOnly&&o.push({key:"uncapped",label:"Uncapped only",onRemove:()=>t.onUncappedOnlyChange(!1)}),o}(ed,ec,e=>t0[e])],eY=(0,l.useMemo)(()=>eV.find(e=>e.model===M)||null,[M,eV]),eJ=(0,l.useRef)(null),eG=(0,l.useRef)(0);(0,l.useLayoutEffect)(()=>{var e,t;eG.current=null!==(t=null===(e=eJ.current)||void 0===e?void 0:e.offsetTop)&&void 0!==t?t:0});let eQ=(0,d.hO)({count:eV.length,estimateSize:()=>92,overscan:6,getItemKey:e=>{var t,n;return null!==(n=null===(t=eV[e])||void 0===t?void 0:t.model)&&void 0!==n?n:e},scrollMargin:eG.current});(0,l.useEffect)(()=>{C(!0)},[]);let eX=(0,l.useMemo)(()=>({tab:L,sort:F,providers:P,trust:W,minDiscount:O,priceRange:H,minContext:G,inputs:$,caps:Y,minSellers:X,minLiquidity:et,uncappedOnly:ei}),[L,F,P,W,O,H,G,$,Y,X,et,ei]),e0=(0,l.useRef)("");(0,l.useEffect)(()=>{e0.current=window.location.pathname;let e=()=>{if(window.location.pathname!==e0.current)return;let e=(0,x.c$)(new URLSearchParams(window.location.search)),t=t5(t6.find(t=>t.key===e.tab)).keys;q(e.tab),E(e.sort),z(e.providers),D(e.trust),U(e.minDiscount),V(e.priceRange),Q(e.minContext),K(e.inputs),J(e.caps.filter(e=>t.includes(e))),ee(e.minSellers),en(e.minLiquidity),es(e.uncappedOnly),Z(!0)};return e(),window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[]),(0,l.useEffect)(()=>{if(!T)return;let e=window.setTimeout(()=>{if(window.location.pathname!==e0.current)return;let e=(0,x.pw)((0,x.so)(new URLSearchParams(window.location.search),eX));if(e!==window.location.search)try{window.history.replaceState(window.history.state,"","".concat(window.location.pathname).concat(e).concat(window.location.hash))}catch(e){}},250);return()=>window.clearTimeout(e)},[T,eX]);let e1=(0,l.useMemo)(()=>{let e=(0,x.e0)(eX,g);return e?"".concat(window.location.origin,"/markets").concat(e):""},[eX,g]);(0,l.useEffect)(()=>{if(!eY||!window.matchMedia("(max-width: 767px)").matches)return;let e=document.body.style.overflow,t=e=>{"Escape"===e.key&&S(null)};return document.body.style.overflow="hidden",window.addEventListener("keydown",t),()=>{document.body.style.overflow=e,window.removeEventListener("keydown",t)}},[eY]);let e2=eF[L],e5=(null===(e=eE.find(e=>e.key===L))||void 0===e?void 0:e.label)||"Selected";return t9||_&&!n&&(!n||m)?!t9&&i?(0,r.jsxs)("div",{className:"mx-auto w-full max-w-[1520px]",children:[(0,r.jsx)(tL,{showHowItWorks:eu,onToggleHowItWorks:()=>em(e=>!e)}),(0,r.jsx)("div",{className:"rounded-lg bg-risk-500/10 p-6 text-center",children:(0,r.jsx)("p",{className:"text-risk-400",children:"Failed to load market prices"})})]}):0===eq.length?(0,r.jsxs)("div",{className:"mx-auto w-full max-w-[1520px]",children:[(0,r.jsx)(tL,{showHowItWorks:eu,onToggleHowItWorks:()=>em(e=>!e)}),(0,r.jsx)("div",{className:"rounded-lg bg-surface-row p-12 text-center",children:(0,r.jsx)("p",{className:"text-ink-muted",children:"No models available yet"})})]}):(0,r.jsxs)(j.pn,{delayDuration:0,children:[(0,r.jsxs)("div",{className:"mx-auto w-full max-w-[1520px]",children:[(0,r.jsx)(tL,{markets:eD,stats:eR,showHowItWorks:eu,onToggleHowItWorks:()=>em(e=>!e)}),(0,r.jsx)("div",{className:"mb-5 px-6 sm:px-8",children:(0,r.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row",children:[(0,r.jsxs)("label",{className:"relative block min-w-0 flex-1","aria-label":"Search marketplace models",children:[(0,r.jsx)("input",{type:"text",role:"searchbox",value:g,onChange:e=>b(e.target.value),placeholder:"Search ".concat(eD.length," models"),className:"h-12 w-full rounded-md bg-surface-snippet-btn shadow focus:shadow-md dark:shadow-none dark:focus:shadow-none pl-11 pr-16 text-[14px] font-medium text-ink outline-none transition placeholder:text-ink-dim hover:bg-surface-snippet-btn-hover focus:bg-surface-snippet-btn-hover"}),(0,r.jsx)("span",{className:"pointer-events-none absolute left-4 top-1/2 -translate-y-1/2",children:(0,r.jsx)(ta,{})}),g?(0,r.jsx)("button",{type:"button",onClick:()=>b(""),className:"absolute right-4 top-1/2 flex h-7 -translate-y-1/2 items-center rounded-md bg-overlay/10 px-2 text-xs font-medium text-ink-muted transition-colors hover:bg-overlay/20 hover:text-ink",children:"Clear"}):(0,r.jsx)("kbd",{className:"pointer-events-none absolute right-4 top-1/2 flex h-7 -translate-y-1/2 items-center rounded-md bg-overlay/10 px-2 font-mono text-[11px] text-ink-faint",children:"/"})]}),(0,r.jsxs)("button",{type:"button",onClick:()=>ea(e=>!e),"aria-expanded":er,className:"hidden h-12 shrink-0 items-center gap-2 rounded-md px-4 text-[14px] font-semibold text-ink shadow transition-colors dark:shadow-none md:inline-flex ".concat(er?"bg-surface-snippet-btn-hover":"bg-surface-snippet-btn hover:bg-surface-snippet-btn-hover"),children:[(0,r.jsx)(I.Z,{className:"size-4"}),"Filters",eK.length>0?(0,r.jsx)("span",{className:"ml-0.5 inline-flex min-w-5 items-center justify-center rounded-indicator bg-action px-1.5 text-[11px] font-semibold tabular-nums text-action-fg",children:eK.length}):null]}),(0,r.jsxs)("div",{className:"flex gap-3 md:shrink-0",children:[(0,r.jsx)("div",{className:"min-w-0 flex-1",children:(0,r.jsx)(w.M,{value:F,groups:tX,onValueChange:e=>{E(e),S(null)},ariaLabel:"Sort marketplace models",triggerClassName:"w-full md:w-[280px]"})}),e1?(0,r.jsx)(f.q,{value:e1,label:"Copy link to this view",icon:R.Z,className:"h-12 w-12 bg-surface-snippet-btn text-ink-muted shadow hover:bg-surface-snippet-btn-hover hover:text-ink dark:shadow-none",iconClassName:"size-4",onCopied:()=>(0,k.A)({title:"Link copied",description:"Opening it brings back these filters."}),onError:()=>(0,k.A)({title:"Copy failed",description:"Could not copy to the clipboard.",variant:"destructive"})}):null]})]})}),(0,r.jsxs)("div",{className:"flex flex-col gap-6 pb-24 md:pb-8",children:[(0,r.jsx)(eW,{className:"md:hidden",chips:eK,shownCount:eV.length,totalCount:eD.length,onReset:el,children:(0,r.jsx)(eT,{...e$,className:"pb-2"})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"interaction-scrollbar -mb-px flex flex-nowrap items-center gap-6 overflow-x-auto border-b border-divider px-6 sm:px-8",role:"group","aria-label":"Filter markets by modality",children:t6.filter(e=>"decisions"!==e.key||(eF.decisions||0)>0).map(e=>{let t=(null==eP?void 0:eP.key)===e.key;return(0,r.jsxs)("button",{type:"button",onClick:()=>{q(e.key),S(null);let t=t5(e).keys;J(e=>e.filter(e=>t.includes(e)))},className:"inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap border-b-2 px-1 pb-3 pt-1 text-[13px] font-medium transition-colors lg:flex-1 ".concat(t?"border-ink text-ink":"border-transparent text-ink-soft-dim hover:text-ink"),children:[(0,r.jsx)(nn,{type:e.key}),(0,r.jsx)("span",{children:e.label}),(0,r.jsx)("span",{className:t?"text-ink-muted":"text-ink-faint",children:eF[e.key]||0})]},e.key)})}),0===eV.length?(0,r.jsx)("div",{className:"rounded-lg bg-surface-row p-12 text-center",children:0===e2?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:"text-ink-secondary",children:[e5," markets are coming soon."]}),(0,r.jsxs)("p",{className:"mt-2 text-sm text-ink-faint",children:["Weâll show ",e5.toLowerCase()," order books here once listings are available."]})]}):g.trim()?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:"text-ink-muted",children:["No models match â",g,"â",P.length>0?" with the selected providers":""]}),g.trim().split(/\s+/).length>1&&!g.includes(",")&&(0,r.jsxs)("p",{className:"mt-2 text-sm text-ink-faint",children:["Spaces require ",(0,r.jsx)("em",{children:"every"})," word to match. Looking for ",(0,r.jsx)("em",{children:"any"}
1)," of them? Separate with commas â e.g. âanthropic, openaiâ."]})]}):(0,r.jsx)("p",{className:"text-ink-muted",children:"No models match the selected providers"})}):(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"sticky top-16 z-20 hidden grid-cols-[minmax(220px,1fr)_170px_145px_115px_120px_84px_18px] gap-3 border-b border-divider bg-surface-page px-8 py-3 text-[11px] font-medium text-ink-dim md:grid",children:[(0,r.jsx)("div",{className:"pl-[60px]",children:"Model"}),(0,r.jsx)(nC,{label:"Best price",column:"best_price",selectedSort:F,onSort:eN}),(0,r.jsx)(nC,{label:"Discount",column:"discount",selectedSort:F,onSort:eN,align:"center"}),(0,r.jsx)(nC,{label:"Liquidity",column:"liquidity",selectedSort:F,onSort:eN}),(0,r.jsx)(nC,{label:"24h activity",column:"active",selectedSort:F,onSort:eN,align:"center"}),(0,r.jsx)(nC,{label:"Offers",column:"sellers",selectedSort:F,onSort:eN}),(0,r.jsx)("div",{})]}),(0,r.jsx)("div",{ref:eJ,style:{height:"".concat(eQ.getTotalSize(),"px"),position:"relative",width:"100%"},children:eQ.getVirtualItems().map(e=>{var t,n,i,s,a,o,l,c,d,u,m,x;let f=eV[e.index],v=tF(f),g=null!==(a=null!==(s=f.requests_24h)&&void 0!==s?s:f.requests_total)&&void 0!==a?a:0,b=null!==(l=null!==(o=f.credits_sold_24h)&&void 0!==o?o:f.credits_sold_total)&&void 0!==l?l:0,k=ni[f.model],y=na(f),w=(c=f,d=y,c.media_unit||(null===(u=c.pricing)||void 0===u?void 0:u.media_unit)||(null===(x=c.catalogModel)||void 0===x?void 0:null===(m=x.pricing)||void 0===m?void 0:m.media_unit)||("image"===d?"image":"tts"===d?"1K characters":"stt"===d?"minute":"job")),N=nl(f,y),_=tC(f,y),C=function(e){var t,n,i,s,r,a,o;let l=null!==(r=e.priceByResolution)&&void 0!==r?r:null===(n=p.MEDIA_MODEL_REGISTRY[e.model])||void 0===n?void 0:null===(t=n.pricing)||void 0===t?void 0:t.perSecondByResolutionUsd;if(!l||0===Object.keys(l).length)return null;let c=Object.values(l);return{byResolution:l,durations:null!==(o=null!==(a=e.durationsSec)&&void 0!==a?a:null===(s=p.MEDIA_MODEL_REGISTRY[e.model])||void 0===s?void 0:null===(i=s.pricing)||void 0===i?void 0:i.durationsSec)&&void 0!==o?o:[5,10,15],floor:Math.min(...c)}}(f),L=ng(f),A=!f.catalog_only&&L>0,q=M===f.model,F=nu(f),E=nu(f).slice(0,4),P=f.catalogModel?f.provider:f.provider||(null==k?void 0:k.provider),I=P||f.display_name||(null===(t=f.catalogModel)||void 0===t?void 0:t.name),R=f.display_name||(null===(n=f.catalogModel)||void 0===n?void 0:n.name)||(null==k?void 0:k.name)||f.model,B=function(e){let t=e.discount_trend_48h;if(t&&t$(t))return t;let n=e.discount_trend_24h;return n&&t$(n)?n:null}(f),z=function(e){let t=Number(e||0);return!Number.isFinite(t)||t<=0?null:t>=1e6?"".concat((t/1e6).toFixed(t%1e6==0?0:1),"M context"):t>=1e3?"".concat(Math.round(t/1e3),"K context"):"".concat(t.toLocaleString()," context")}(f.catalogModel?f.catalogModel.context_length||(null===(i=f.catalogModel.top_provider)||void 0===i?void 0:i.context_length):null==k?void 0:k.contextLength);return(0,r.jsxs)("div",{"data-index":e.index,ref:eQ.measureElement,className:"transition-colors border-b border-divider",style:{position:"absolute",top:0,left:0,width:"100%",transform:"translateY(".concat(e.start-eQ.options.scrollMargin,"px)")},children:[(0,r.jsx)("div",{role:"button",tabIndex:0,onClick:()=>{A&&S(e=>e===f.model?null:f.model)},onKeyDown:e=>{A&&("Enter"===e.key||" "===e.key)&&(e.preventDefault(),S(e=>e===f.model?null:f.model))},"aria-expanded":A?q:void 0,className:"w-full px-8 pt-5 text-left transition-colors hover:bg-surface-hover focus:outline-none ".concat(q?"pb-3":"pb-5"," ").concat(A?"cursor-pointer":"cursor-default"),children:(0,r.jsxs)("div",{className:"grid gap-3 md:grid-cols-[minmax(220px,1fr)_170px_145px_115px_120px_84px_18px] md:items-center",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-4",children:[(0,r.jsxs)(j.u,{children:[(0,r.jsx)(j.aJ,{asChild:!0,children:(0,r.jsxs)("span",{className:"inline-flex shrink-0 flex-col items-center gap-1",onClick:e=>e.stopPropagation(),children:[(0,r.jsx)(eU.C,{label:R,modelId:f.model,provider:I,size:"lg"}),P&&(0,r.jsx)("span",{className:"mt-3 max-w-[68px] truncate text-center text-[10px] leading-tight text-ink-muted md:hidden",children:P})]})}),(0,r.jsxs)(j._v,{side:"right",align:"start",className:"w-[260px]",children:[(0,r.jsx)("div",{className:"font-semibold text-ink",children:R}),P&&(0,r.jsx)("div",{className:"mt-0.5 text-[11px] text-ink-muted",children:P}),(0,r.jsx)("div",{className:"mt-3 text-[11px] font-medium text-ink-faint",children:"Capabilities"}),(0,r.jsx)("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:F.length>0?F.map(e=>(0,r.jsx)("span",{className:"rounded bg-surface-tag px-2 py-1 text-[11px] font-medium text-ink-emph",children:t0[e]},e)):(0,r.jsx)("span",{className:"rounded bg-surface-tag px-2 py-1 text-[11px] font-medium text-ink-emph",children:"Standard generation"})}),z&&(0,r.jsx)("div",{className:"mt-2 text-[11px] text-ink-dim",children:z})]})]}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"flex min-w-0 items-center gap-2",children:(0,r.jsx)("h3",{className:"truncate text-base font-semibold text-ink",children:R})}),(0,r.jsxs)("div",{className:"mt-1 flex min-w-0 items-center gap-1",children:[(0,r.jsx)("span",{className:"truncate rounded bg-surface-chip-mono px-1.5 py-0.5 font-mono text-[10px] leading-4 text-ink-dim",children:f.model}),(0,r.jsxs)(j.u,{children:[(0,r.jsx)(j.aJ,{asChild:!0,children:(0,r.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),ej(f.model)},className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm transition-colors hover:text-ink focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 ".concat(ex===f.model?"text-success":"text-ink-faint"),"aria-label":ex===f.model?"Copied ".concat(f.model," model name"):"Copy ".concat(f.model," model name"),children:ex===f.model?(0,r.jsx)(tx,{className:"h-3.5 w-3.5"}):(0,r.jsx)(h.K,{className:"h-3.5 w-3.5"})})}),(0,r.jsx)(j._v,{side:"top",align:"center",children:ex===f.model?"Copied!":"Copy model name"})]}),(0,r.jsxs)(j.u,{children:[(0,r.jsx)(j.aJ,{asChild:!0,children:(0,r.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),ew(f)},className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm transition-colors hover:text-ink focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 ".concat(eh===f.model?"text-success":"text-ink-faint"),"aria-label":eh===f.model?"Copied ".concat(f.model," curl command"):"Copy ".concat(f.model," curl command"),children:eh===f.model?(0,r.jsx)(tx,{className:"h-3.5 w-3.5"}):(0,r.jsx)(tm,{className:"h-3.5 w-3.5"})})}),(0,r.jsx)(j._v,{side:"top",align:"center",children:eh===f.model?"Copied!":"Copy curl command"})]})]}),(0,r.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[P&&(0,r.jsx)("span",{className:"hidden truncate text-xs text-ink-muted md:inline",children:P}),z&&(0,r.jsx)("span",{className:"text-xs text-ink-faint",children:z}),E.map(e=>(0,r.jsxs)(j.u,{children:[(0,r.jsx)(j.aJ,{asChild:!0,children:(0,r.jsx)("span",{role:"img",tabIndex:0,"aria-label":"".concat(t0[e]," capability"),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"inline-flex h-5 w-5 items-center justify-center text-ink-muted transition-colors hover:text-ink focus:outline-none focus:ring-1 focus:ring-primary/50",children:(0,r.jsx)(nn,{type:e})})}),(0,r.jsxs)(j._v,{side:"top",align:"center",className:"w-[230px]",children:[(0,r.jsx)("div",{className:"font-semibold text-ink",children:t0[e]}),(0,r.jsx)("div",{className:"mt-1 text-[11px] text-ink-secondary",children:t4[e]})]})]},e))]})]})]}),(0,r.jsxs)("div",{className:"flex items-baseline justify-between gap-3 md:block md:text-right",children:[(0,r.jsx)("span",{className:"text-xs text-ink-faint md:hidden",children:"Best price"}),_?C?(0,r.jsx)(nc,{...C}):(0,r.jsx)("div",{className:"whitespace-nowrap text-xs text-ink-bright md:text-sm",children:function(e,t){if(null==e||Number.isNaN(e))return"$0 / ".concat(t||"unit");let n=e<.01?5:e<.1?4:2;
1return"$".concat(e.toLocaleString(void 0,{minimumFractionDigits:n,maximumFractionDigits:n})," / ").concat(t||"unit")}(N,w)}):(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"whitespace-nowrap text-xs text-ink-bright md:text-sm",children:[tZ(f.best_input_per_1m),(0,r.jsx)("span",{className:"text-ink-faint",children:" input"})]}),(0,r.jsxs)("div",{className:"whitespace-nowrap text-xs text-ink-bright md:text-sm",children:[tZ(f.best_output_per_1m),(0,r.jsx)("span",{className:"text-ink-faint",children:" output"})]})]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 md:block md:text-right",children:[(0,r.jsx)("span",{className:"whitespace-nowrap text-xs text-ink-faint md:hidden",children:"Discount"}),(0,r.jsx)(tJ,{discount:v,trend:B,listPrice:tq(f)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 md:block md:text-right",children:[(0,r.jsx)("span",{className:"text-xs text-ink-faint md:hidden",children:"Liquidity"}),(0,r.jsx)(tG,{market:f})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 md:block md:text-center",children:[(0,r.jsx)("span",{className:"whitespace-nowrap text-xs text-ink-faint md:hidden",children:"24h Activity"}),(0,r.jsx)(tT,{requests:g,creditsSold:b})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 md:block md:text-right",children:[(0,r.jsx)("span",{className:"text-xs text-ink-faint md:hidden",children:"Offers"}),(0,r.jsxs)("span",{className:"text-sm font-semibold text-ink-bright",children:[L," ",(0,r.jsx)("span",{className:"text-xs font-medium text-ink-faint",children:"active"})]})]}),(0,r.jsx)("div",{className:"hidden md:flex justify-end",children:A&&(0,r.jsx)("span",{className:"h-2 w-2 border-b border-r border-ink-muted transition-transform ".concat(q?"rotate-45":"-rotate-45"),"aria-hidden":"true"})})]})}),q&&A&&(0,r.jsx)("div",{className:"hidden px-8 pb-6 md:block",onClick:e=>e.stopPropagation(),children:(0,r.jsxs)("div",{className:"grid gap-4 lg:grid-cols-1 xl:grid-cols-[minmax(360px,0.95fr)_minmax(500px,1.05fr)]",children:[(0,r.jsx)(tr,{model:f.model}),(0,r.jsx)(ts,{model:f.model})]})})]},f.model)})})]})]})]}),eY&&(0,r.jsx)(nM,{market:eY,onClose:()=>S(null)}),eV.length>0&&(0,r.jsx)(nq,{})]}),"undefined"!=typeof document&&(0,c.createPortal)((0,r.jsx)("div",{className:"pointer-events-none fixed inset-x-0 bottom-0 top-16 z-30 hidden md:block lg:pl-[224px]",children:(0,r.jsx)("div",{className:"mx-auto flex h-full max-w-[1520px] justify-end overflow-hidden",children:(0,r.jsxs)("div",{"aria-label":"Marketplace filters","aria-hidden":!er,className:"pointer-events-auto flex w-[min(92vw,300px)] flex-col border-l border-divider bg-surface-page shadow-2xl shadow-shade/15 transition-transform duration-200 ease-linear will-change-transform dark:shadow-shade/60 ".concat(er?"translate-x-0":"translate-x-full"),children:[(0,r.jsxs)("div",{className:"flex h-12 shrink-0 items-center justify-between border-b border-divider-subtle pl-5 pr-3",children:[(0,r.jsx)("span",{className:"text-sm font-semibold text-ink",children:"Filters"}),(0,r.jsx)("button",{type:"button",onClick:()=>ea(!1),"aria-label":"Close filters",tabIndex:er?0:-1,className:"flex size-8 items-center justify-center rounded-md text-ink-muted transition-colors hover:bg-surface-hover hover:text-ink focus:outline-none focus:ring-2 focus:ring-primary/35",children:(0,r.jsx)(B.Z,{className:"size-4"})})]}),(0,r.jsx)("div",{className:"interaction-scrollbar min-h-0 flex-1 overflow-y-auto px-5 py-3",children:(0,r.jsx)(eT,{...e$,scrollContainer:!1,showFooter:!1})}),(0,r.jsx)("div",{className:"shrink-0 border-t border-divider px-4 py-3",children:(0,r.jsxs)("div",{className:"flex items-center gap-2.5 rounded-lg bg-surface-row px-3 py-2.5",children:[(0,r.jsx)("span",{className:"size-2 shrink-0 rounded-indicator bg-success","aria-hidden":"true"}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("div",{className:"text-[13px] font-semibold text-ink","aria-live":"polite",children:[eV.length," ",1===eV.length?"model":"models"]}),(0,r.jsx)("div",{className:"text-[11px] text-ink-dim",children:"Filters update results in real time"})]})]})})]})})}),document.body)]}):(0,r.jsxs)("div",{className:"mx-auto w-full max-w-[1520px]",children:[(0,r.jsx)(tL,{showHowItWorks:eu,onToggleHowItWorks:()=>em(e=>!e)}),(0,r.jsx)("div",{className:"space-y-3",children:[1,2,3,4,5,6].map(e=>(0,r.jsx)("div",{className:"animate-pulse rounded-lg bg-surface-row p-5",children:(0,r.jsxs)("div",{className:"grid gap-4 md:grid-cols-[minmax(0,1fr)_170px_145px_115px_120px_84px] md:items-center",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"mb-2 h-5 w-2/3 rounded bg-overlay/10"}),(0,r.jsx)("div",{className:"h-3 w-1/3 rounded bg-overlay/10"})]}),(0,r.jsx)("div",{className:"h-5 rounded bg-overlay/10"}),(0,r.jsx)("div",{className:"h-5 rounded bg-overlay/10"}),(0,r.jsx)("div",{className:"h-5 rounded bg-overlay/10"}),(0,r.jsx)("div",{className:"h-5 rounded bg-overlay/10"}),(0,r.jsx)("div",{className:"h-5 rounded bg-overlay/10"})]})},e))})]})}},84287:function(e,t,n){n.d(t,{M:function(){return c}});var i=n(27573),s=n(7653),r=n(20775);function a(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")}function o(){return(0,i.jsxs)("svg",{className:"h-5 w-5 shrink-0 text-ink-muted",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,i.jsx)("path",{d:"M7 5v14"}),(0,i.jsx)("path",{d:"m4 16 3 3 3-3"}),(0,i.jsx)("path",{d:"M13 6h7"}),(0,i.jsx)("path",{d:"M13 11h5"}),(0,i.jsx)("path",{d:"M13 16h3"})]})}function l(e){let{className:t="h-4 w-4 shrink-0 text-ink-faint"}=e;return(0,i.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,i.jsx)("path",{d:"m6 9 6 6 6-6"})})}function c(e){var t;let{value:n,groups:c,onValueChange:d,ariaLabel:u,label:m="Sort by",className:x="",triggerClassName:p="",contentClassName:h="",align:f="end",surface:v="field"}
1=e,[g,b]=(0,s.useState)(!1),j=(0,s.useRef)("mouse"),k=c.flatMap(e=>e.options).find(e=>e.key===n);return(0,i.jsxs)(r.h_,{modal:!1,open:g,onOpenChange:b,children:[(0,i.jsx)(r.$F,{asChild:!0,children:(0,i.jsxs)("button",{type:"button","aria-label":u,onPointerDown:e=>{j.current=e.pointerType,"touch"===e.pointerType&&e.preventDefault()},onClick:()=>{"touch"===j.current&&b(e=>!e)},className:a("group relative h-12 w-full rounded-md pb-1 pl-11 pr-10 pt-5 text-left text-[13px] font-semibold text-ink outline-none transition","seg"===v?"bg-surface-seg hover:bg-surface-seg-thumb focus-visible:bg-surface-seg-thumb data-[state=open]:bg-surface-seg-thumb":"bg-surface-snippet-btn shadow focus-visible:shadow-md data-[state=open]:shadow-md dark:shadow-none dark:focus-visible:shadow-none dark:data-[state=open]:shadow-none hover:bg-surface-snippet-btn-hover focus-visible:bg-surface-snippet-btn-hover data-[state=open]:bg-surface-snippet-btn-hover",x,p),children:[(0,i.jsx)("span",{className:"pointer-events-none absolute left-4 top-1/2 -translate-y-1/2",children:(0,i.jsx)(o,{})}),(0,i.jsx)("span",{className:"pointer-events-none absolute left-11 top-2 text-[10px] font-medium text-ink-faint",children:m}),(0,i.jsx)("span",{className:"block truncate",children:null!==(t=null==k?void 0:k.label)&&void 0!==t?t:"Select"}),(0,i.jsx)("span",{className:"pointer-events-none absolute right-4 top-1/2 -translate-y-1/2",children:(0,i.jsx)(l,{className:"h-4 w-4 shrink-0 text-ink-faint transition-transform group-data-[state=open]:rotate-180"})})]})}),(0,i.jsx)(r.AW,{align:f,className:a("interaction-scrollbar max-h-[min(420px,var(--radix-dropdown-menu-content-available-height))] w-[min(calc(100vw-2rem),340px)] overflow-y-auto p-0 sm:w-[340px]",h),children:(0,i.jsx)(r._x,{value:n,onValueChange:e=>d(e),children:c.map((e,t)=>(0,i.jsxs)("div",{children:[t>0?(0,i.jsx)(r.VD,{className:"mx-0 my-2 bg-divider-frame"}):null,(0,i.jsx)(r.Ju,{className:"px-4 pb-1.5 pt-4 text-[11px] font-medium text-ink-faint",children:e.label}),(0,i.jsx)("div",{className:"pb-1",children:e.options.map(e=>(0,i.jsx)(r.qB,{value:e.key,className:"rounded-none py-2.5 pl-11 pr-4 text-[14px]",children:e.label},e.key))})]},e.label))})})]})}},88403:function(e,t,n){n.d(t,{C:function(){return et}});var i=n(27573),s=n(66927),r=n(47578),a=n(89958),o=n(95034),l=n(58244),c=n(11619),d=n(2872),u=n(98990),m=n(84721),x=n(71414),p=n(63949),h=n(33059),f=n(23365),v=n(46852),g=n(76661),b=n(85036),j=n(16289),k=n(89208),y=n(84455),w=n(14365),N=n(48617),_=n(97064),C=n(14621),M=n(20550),S=n(31820),L=n(89027),A=n(15973),q=n(53204),F=n(49181),E=n(46165),P=n(84025),I=n(93735),R=n(90370),B=n(50294);let z={xs:{avatar:20,box:"h-5 w-5 rounded-md",text:"text-[8px]"},sm:{avatar:28,box:"h-7 w-7 rounded-lg",text:"text-[10px]"},md:{avatar:36,box:"h-9 w-9 rounded-mark",text:"text-xs"},lg:{avatar:44,box:"h-11 w-11 rounded-xl",text:"text-sm"}},T={src:"/icons/venice-color.svg"},Z={src:"/icons/mordiem-color.svg"},W={src:"/icons/uncensored-ai-logo.c4cf9dbd.svg"},D={src:"/icons/akashml-color.svg"},O={src:"/icons/bankr-color.svg"},U={src:"/icons/capminal-color.png"},H={src:"/icons/cheaperinference-color.svg"},V={src:"/icons/concentrate-color.svg"},$={src:"/icons/engy-color.svg"},K={src:"/icons/inferhub-color.svg"},Y={src:"/icons/jatevo-color.svg"},J={src:"/icons/morpheus-color.png"},G={src:"/icons/sakana-color.png"},Q={src:"/icons/typesafe.png"},X={akashml:D,alibaba:{Avatar:r.Z},"amazon bedrock":{Avatar:o.Z},anthropic:{Avatar:a.Z},bankr:O,bedrock:{Avatar:o.Z},"black forest labs":{Avatar:x.Z},bytedance:{Avatar:l.Z},capminal:U,"capminal gateway":U,cheaperinference:H,concentrate:V,"concentrate.ai":V,deepseek:{Avatar:d.Z},engy:$,"engy.ai":$,"fal.ai":{Avatar:u.Z},fireworks:{Avatar:m.Z},"fireworks ai":{Avatar:m.Z},google:{Avatar:f.Z},groq:{Avatar:g.Z},inferhub:K,jatevo:Y,"jatevo api gateway":Y,kuaishou:{Avatar:j.Z},lightricks:{Avatar:k.Z},meta:{Avatar:y.Z},minimax:{Avatar:w.Z},mistral:{Avatar:N.Z},"mistral ai":{Avatar:N.Z},mordiem:Z,morpheus:J,openai:{Avatar:M.Z},openrouter:{Avatar:S.Z},pixverse:{Avatar:L.Z},runway:{Avatar:q.Z},sakana:G,"sakana ai":G,together:{Avatar:F.Z},"together ai":{Avatar:F.Z},"topaz labs":{Avatar:E.Z},typesafe:Q,uncensored:W,"uncensored ai":W,venice:T,"venice ai":T,vidu:{Avatar:P.Z},wan:{Avatar:r.Z},xai:{Avatar:I.Z},"z.ai":{Avatar:R.Z},"z.ai coding":{Avatar:R.Z}},ee=[{...T,match:["venice"]},{...Z,match:["mordiem","api.mordiem.com"]},{...W,match:["uncensored","chatuncensored","api.uncensored.com"]},{Avatar:j.Z,match:["kling"]},{Avatar:f.Z,match:["veo"]},{Avatar:x.Z,match:["flux"]},{Avatar:P.Z,match:["vidu"]},{Avatar:L.Z,match:["pixverse"]},{Avatar:q.Z,match:["runway","gen-3","gen-4"]},{Avatar:w.Z,match:["minimax","hailuo"]},{Avatar:r.Z,match:["wan2","wanx","alibaba","aliyun"]},{Avatar:l.Z,match:["seedance","seedream","doubao"]},{Avatar:p.Z,match:["gemini"]},{Avatar:h.Z,match:["gemma"]},{Avatar:f.Z,match:["google"]},{Avatar:c.Z,match:["claude"]},{Avatar:a.Z,match:["anthropic"]},{Avatar:d.Z,match:["deepseek"]},{Avatar:s.Z,match:["aion"]},{Avatar:A.Z,match:["qwen"]},{Avatar:R.Z,match:["z.ai","chatglm","glm"]},{Avatar:v.Z,match:["grok"]},{Avatar:I.Z,match:["xai","x.ai"]},{Avatar:y.Z,match:["meta","llama"]},{Avatar:b.Z,match:["kimi"]},{Avatar:_.Z,match:["moonshot"]},{Avatar:N.Z,match:["mistral"]},{Avatar:C.Z,match:["nvidia","nemotron"]},{Avatar:S.Z,match:["openrouter"]},{Avatar:F.Z,match:["together"]},{Avatar:m.Z,match:["fireworks"]},{Avatar:g.Z,match:["groq"]},{Avatar:o.Z,match:["bedrock"]},{...D,match:["akashml"]},{...O,match:["bankr"]},{...U,match:["capminal"]},{...H,match:["cheaperinference"]},{...V,match:["concentrate"]},{...$,match:["engy"]},{...K,match:["inferhub"]},{...Y,match:["jatevo"]},{...J,match:["morpheus","api.mor.org"]},{...G,match:["sakana","fugu"]},{...Q,match:["typesafe","jev-"]},{Avatar:M.Z,match:["openai","gpt-","gpt ","o1","o3","o4"]}];function et(e){let{className:t="",label:n,modelId:s,provider:r,size:a="md"}=e,o=z[a],l=function(e,t,n){let i=null==t?void 0:t.trim().toLowerCase();if(i&&X[i])return X[i];
1let s=[e,n].filter(Boolean).join(" ").toLowerCase();return s&&ee.find(e=>e.match.some(e=>(function(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp("(?:^|[^a-z0-9])".concat(n)).test(e)})(s,e)))||null}(s,r,n),c=n||r||s||"AI provider",d=function(e){let t=e.replace(/https?:\/\/|api\.|www\.|\.com|\.ai|\/v\d+/gi," ").replace(/[^a-z0-9]+/gi," ").trim().split(/\s+/).filter(Boolean);return 0===t.length?"AI":1===t.length?t[0].slice(0,2).toUpperCase():t.slice(0,2).map(e=>e[0]).join("").toUpperCase()}(c);return l?(0,i.jsx)("span",{"aria-label":c,className:"inline-flex shrink-0 items-center justify-center overflow-hidden border border-overlay/10 bg-overlay/[0.04] shadow-sm shadow-shade/20 ".concat(o.box," ").concat(t),title:c,children:"string"==typeof l.src?(0,i.jsx)(B.default,{alt:"",className:"block",decoding:"async",height:o.avatar,loading:"lazy",src:l.src,style:{height:o.avatar,width:o.avatar},unoptimized:!0,width:o.avatar}):(0,i.jsx)(l.Avatar,{shape:"square",size:o.avatar,style:{borderRadius:"inherit",boxShadow:"none"}})}):(0,i.jsx)("span",{"aria-label":c,className:"inline-flex shrink-0 items-center justify-center overflow-hidden border border-overlay/10 bg-overlay/[0.06] text-ink-secondary shadow-sm shadow-shade/20 ".concat(o.box," ").concat(t),title:c,children:(0,i.jsx)("span",{className:"font-semibold leading-none ".concat(o.text),children:d})})}},53429:function(e,t,n){n.d(t,{u:function(){return r}});var i=n(27573),s=n(7653);function r(e){let{bars:t,viewBoxWidth:n,viewBoxHeight:r,className:a="",ariaLabel:o}=e,[l,c]=(0,s.useState)(null),d=null!=l?t[l]:null,u=d?(d.x+d.width/2)/n*100:0;return(0,i.jsxs)("div",{className:"relative inline-block ".concat(a),children:[(0,i.jsx)("svg",{viewBox:"0 0 ".concat(n," ").concat(r),className:"block h-full w-full",role:"img","aria-label":o,children:t.map((e,t)=>{var n;return(0,i.jsx)("rect",{x:e.x,y:e.y,width:e.width,height:e.height,rx:null!==(n=e.rx)&&void 0!==n?n:2.2,fill:e.fill,opacity:l===t?1:e.opacity,className:"transition-opacity duration-150",onPointerEnter:()=>c(t),onPointerLeave:()=>c(e=>e===t?null:e)},t)})}),d&&(0,i.jsx)("div",{className:"pointer-events-none absolute z-50 whitespace-nowrap rounded-md border border-divider-strong bg-surface-tooltip px-2 py-1 text-[11px] leading-relaxed text-ink shadow-lg shadow-shade/12 dark:shadow-shade/40 animate-in fade-in-0",style:{left:"".concat(u,"%"),top:0,transform:"translate(".concat(u<=22?"0%":u>=78?"-100%":"-50%",", calc(-100% - 4px))")},children:d.tooltip})]})}},74229:function(e,t,n){n.d(t,{K:function(){return s}});var i=n(27573);function s(e){let{className:t="h-4 w-4",...n}=e;return(0,i.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",...n,children:[(0,i.jsx)("path",{d:"M8 16H6.75A2.75 2.75 0 0 1 4 13.25v-7.5A2.75 2.75 0 0 1 6.75 3h7.5A2.75 2.75 0 0 1 17 5.75V7"}),(0,i.jsx)("rect",{x:"9",y:"8",width:"11",height:"13",rx:"2.75"})]})}},69130:function(e,t,n){n.d(t,{K:function(){return r},U:function(){return a}});var i=n(7653);let s=(0,i.createContext)({searchQuery:"",setSearchQuery:()=>void 0}),r=s.Provider;function a(){return(0,i.useContext)(s)}},11455:function(e,t,n){n.d(t,{D7:function(){return r},fy:function(){return a},nv:function(){return s}});var i=n(27573);function s(e){let{className:t="h-3.5 w-3.5"}=e;return(0,i.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 1200 1227",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:(0,i.jsx)("path",{d:"M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z",fill:"currentColor"})})}function r(e){let{className:t="h-[15px] w-[17.5px]"}=e;return(0,i.jsx)("svg",{width:"12.5",height:"10",viewBox:"0 0 71 55",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:(0,i.jsx)("path",{fill:"currentColor",d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4201 0.525289C44.7963 1.6353 44.105 3.0832 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5618 0.525289C25.514 -0.0125078 25.4216 0.39851 25.3293 0.41542C20.2555 1.2916 15.4028 2.8214 10.8775 4.8978C10.8384 4.9147 10.8048 4.942 10.7825 4.9795C1.57886 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0171 12.3413 52.7249 18.1147 54.5195C18.2071 54.547 18.3043 54.5141 18.3672 54.4411C19.7295 52.5922 20.9469 50.6064 21.9907 48.5258C22.0526 48.4026 21.9935 48.2541 21.8676 48.202C19.9366 47.4195 18.0979 46.4939 16.3292 45.4486C16.1892 45.3686 16.1781 45.1624 16.3093 45.0712C16.679 44.8194 17.0489 44.5539 17.4027 44.2842C17.4711 44.231 17.5656 44.2202 17.6441 44.2616C29.2558 49.9285 41.8354 49.9285 53.3167 44.2616C53.3952 44.2166 53.4897 44.2274 53.5621 44.2806C53.9161 44.5502 54.2858 44.8199 54.6553 45.0712C54.7865 45.1624 54.7785 45.3686 54.6384 45.4486C52.8699 46.5091 51.0311 47.4195 49.0989 48.1995C48.973 48.2516 48.917 48.4026 48.9789 48.5258C50.0475 50.6069 51.2648 52.5927 52.6028 54.4411C52.6621 54.5141 52.762 54.547 52.8545 54.5195C58.6469 52.7249 64.5295 50.0171 70.6024 45.5576C70.6553 45.5182 70.6889 45.4591 70.6945 45.3943C72.1747 30.0791 68.2147 16.7757 60.
11968 4.98652C60.1775 4.942 60.144 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.0461 17.3451 30.017C17.3451 25.9879 20.1591 22.7086 23.7259 22.7086C27.3105 22.7086 30.1752 25.9879 30.1066 30.017C30.1066 34.0461 27.3105 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.0461 40.9371 30.017C40.9371 25.9879 43.7511 22.7086 47.3178 22.7086C50.9025 22.7086 53.7671 25.9879 53.6985 30.017C53.6985 34.0461 50.9025 37.3253 47.3178 37.3253Z"})})}function a(e){let{className:t="h-3.5 w-3.5"}=e;return(0,i.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:(0,i.jsx)("path",{fill:"currentColor",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}},32316:function(e,t,n){n.d(t,{q:function(){return d}});var i=n(27573),s=n(7653),r=n(92411),a=n(9998),o=n(19661),l=n(36190),c=n(45385);function d(e){let{value:t,label:n="Copy",className:d="",icon:u=r.Z,iconClassName:m="h-3.5 w-3.5",onCopied:x,onError:p}=e,[h,f]=(0,s.useState)(!1);(0,s.useEffect)(()=>f(!1),[t]);let v=async()=>{try{await (0,l.W)(t),f(!0),window.setTimeout(()=>f(!1),1600),null==x||x()}catch(e){p?p(e):console.error("Failed to copy:",e)}},g=h?"Copied":n;return(0,i.jsx)(o.pn,{delayDuration:150,children:(0,i.jsxs)(o.u,{children:[(0,i.jsx)(o.aJ,{asChild:!0,children:(0,i.jsx)("button",{type:"button",onClick:()=>void v(),"aria-label":g,className:(0,c.cx)("inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-overlay/[0.06] text-overlay/45 transition-colors hover:bg-overlay/10 hover:text-overlay/70",d,h&&"text-success hover:text-success"),children:h?(0,i.jsx)(a.Z,{className:m}):(0,i.jsx)(u,{className:m})})}),(0,i.jsx)(o._v,{side:"top",children:g})]})})}},96173:function(e,t,n){n.d(t,{c:function(){return o}});var i=n(27573),s=n(7653),r=n(3458),a=n(85696);function o(e){let{open:t,onClose:n,title:o,ariaLabel:l,maxWidthClassName:c="sm:max-w-md",surfaceClassName:d="bg-surface-row",initialFocusRef:u,inertBackground:m=!1,children:x}
1=e,[p,h]=(0,s.useState)(!1);(0,s.useEffect)(()=>h(!0),[]);let f=(0,s.useRef)(null),v=(0,s.useRef)(null);return((0,s.useEffect)(()=>{if(!t||!p)return;let e=e=>{"Escape"===e.key&&n()};document.addEventListener("keydown",e);let i=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",e),document.body.style.overflow=i}},[t,p,n]),(0,s.useEffect)(()=>{if(!t||!p)return;let e=document.activeElement;return(null==u?void 0:u.current)&&u.current.focus(),()=>{e&&e.isConnected&&"function"==typeof e.focus&&e.focus()}},[t,p,u]),(0,s.useEffect)(()=>{if(!t||!p)return;let e=e=>{if("Tab"!==e.key)return;let t=f.current;if(!t)return;let n=document.activeElement;if(n instanceof Element&&n.closest('[data-radix-popper-content-wrapper],[role="menu"],[role="listbox"]'))return;let i=Array.from(t.querySelectorAll('a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])')).filter(e=>!e.hasAttribute("hidden")),s=i[0],r=i[i.length-1];if(!s||!r){e.preventDefault(),t.focus();return}let a=t.contains(n);e.shiftKey?a&&n!==s||(e.preventDefault(),r.focus()):a&&n!==r||(e.preventDefault(),s.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,p]),(0,s.useEffect)(()=>{if(!t||!p||!m)return;let e=v.current,n=Array.from(document.body.children).filter(t=>t!==e&&null===t.getAttribute("inert"));return n.forEach(e=>e.setAttribute("inert","")),()=>n.forEach(e=>e.removeAttribute("inert"))},[t,p,m]),t&&p)?(0,r.createPortal)((0,i.jsx)("div",{ref:v,className:"fixed inset-0 z-50 flex items-end justify-center bg-shade/40 dark:bg-shade/60 backdrop-blur-sm sm:items-center",onClick:e=>{e.target===e.currentTarget&&n()},role:"dialog","aria-modal":"true","aria-label":null!=l?l:"string"==typeof o?o:void 0,children:(0,i.jsxs)("div",{ref:f,tabIndex:-1,className:"max-h-[90vh] w-full overflow-y-auto rounded-t-2xl border border-overlay/10 ".concat(d," p-5 outline-none sm:w-full ").concat(c," sm:rounded-2xl sm:p-6"),children:[(0,i.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[o?(0,i.jsx)("h3",{className:"text-base font-semibold text-ink",children:o}):(0,i.jsx)("span",{}),(0,i.jsx)("button",{type:"button",onClick:n,"aria-label":"Close",className:"text-overlay/40 transition-colors hover:text-overlay/70",children:(0,i.jsx)(a.Z,{className:"h-5 w-5"})})]}),x]})}),document.body):null}},10767:function(e,t,n){n.d(t,{A:function(){return u},p:function(){return m}});var i=n(7653);let s=[],r=new Map,a={toasts:[]},o=0;function l(e){a=e,s.forEach(e=>e(a))}function c(e){if(r.has(e))return;let t=setTimeout(()=>{r.delete(e),l({toasts:e?a.toasts.filter(t=>t.id!==e):[]})},1e3);r.set(e,t)}function d(e){e?c(e):a.toasts.forEach(e=>c(e.id)),l({toasts:a.toasts.map(t=>void 0===e||t.id===e?{...t,open:!1}:t)})}function u(e){let t=(o=(o+1)%Number.MAX_SAFE_INTEGER).toString(),n=()=>d(t);return l({toasts:[{...e,id:t,open:!0,onOpenChange:e=>{e||n()}},...a.toasts].slice(0,3)}),{id:t,dismiss:n,update:e=>{var n;return n={...e,id:t},void l({toasts:a.toasts.map(e=>e.id===n.id?{...e,...n}:e)})}}}function m(){let[e,t]=i.useState(a);return i.useEffect(()=>(s.push(t),()=>{let e=s.indexOf(t);e>-1&&s.splice(e,1)}),[]),{...e,toast:u,dismiss:d}}},81698:function(e,t,n){n.d(t,{S:function(){return l},g:function(){return o}});var i=n(27573),s=n(7653),r=n(65277);let a=(0,s.createContext)(null);function o(e){let{children:t}=e,n=(0,r.u)(),[o,l]=(0,s.useState)(null),c={hasSession:n.hasSession,sessionWallet:n.wallet,buyerApiKey:null!=o?o:n.apiKey,setBuyerApiKey:l,isCreating:"loading"===n.status,error:null,ensureSession:n.ensureSession};return(0,i.jsx)(a.Provider,{value:c,children:t})}function l(){let e=(0,s.useContext)(a);if(!e)throw Error("useInferenceSessionContext must be used within an InferenceSessionProvider");return e}},36190:function(e,t,n){n.d(t,{W:function(){return i}});async function i(e){var t;let n;if(null===(t=navigator.clipboard)||void 0===t?void 0:t.writeText)try{await Promise.race([navigator.clipboard.writeText(e),new Promise((e,t)=>
1window.setTimeout(()=>t(Error("Clipboard write timed out")),650))]);return}catch(e){n=e}let i=document.createElement("textarea");i.value=e,i.setAttribute("readonly",""),i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.width="1px",i.style.height="1px",i.style.padding="0",i.style.border="none",i.style.opacity="0",document.body.appendChild(i);let s=window.getSelection(),r=document.createRange();r.selectNodeContents(i),null==s||s.removeAllRanges(),null==s||s.addRange(r),i.setSelectionRange(0,e.length);let a=!1;try{a=document.execCommand("copy")}finally{null==s||s.removeAllRanges(),document.body.removeChild(i)}if(!a)throw n instanceof Error?n:Error("Clipboard copy failed")}},45385:function(e,t,n){n.d(t,{L:function(){return s},cx:function(){return i}});let i=(0,n(25579).q7)({extend:{classGroups:{rounded:[{rounded:["control","indicator","card","tile","mark","chip"]}]}}});function s(e){return e}},45236:function(e,t,n){function i(e){var t,n;if(e.length<2)throw Error("a stop scale needs at least two stops");let i=e.length-1,s=null!==(t=e[0])&&void 0!==t?t:0,r=null!==(n=e[i])&&void 0!==n?n:0;return{max:i,toPosition(t){if(!Number.isFinite(t)||t<=s)return 0;if(t>=r)return i;for(let s=0;s<i;s++){var n,a;let i=null!==(n=e[s])&&void 0!==n?n:0,r=null!==(a=e[s+1])&&void 0!==a?a:0;if(t<=r)return s+(t-i)/(r-i)}return i},fromPosition(t){var n,s,r;let a=Math.min(Math.max(t,0),i),o=Math.min(Math.floor(a),i-1),l=null!==(n=e[o])&&void 0!==n?n:0,c=null!==(s=e[o+1])&&void 0!==s?s:0,d=l+(a-o)*(c-l);return 1e-9>Math.abs(a-Math.round(a))?null!==(r=e[Math.round(a)])&&void 0!==r?r:d:function(e,t){if(0===e||!Number.isFinite(e))return 0;let n=10**(1-Math.floor(Math.log10(Math.abs(e))));return Math.round(e*n)/n}(d,0)}}}n.d(t,{GM:function(){return l},NC:function(){return r},Vm:function(){return c},Xj:function(){return d},hw:function(){return u},lb:function(){return m},my:function(){return i}});let s={k:1e3,m:1e6,b:1e9};function r(e){var t;let n=e.trim().toLowerCase().replace(/[$,\s]/g,"").replace(/^\+|\+$/g,""),i=/^(\d+(?:\.\d+)?)([kmb])?$/.exec(n);if(!i)return null;let r=Number(i[1]),a=i[2],o=r*(a&&null!==(t=s[a])&&void 0!==t?t:1);return Number.isFinite(o)&&o>=0?o:null}let a=new Set(["","any","all","none","no limit","unlimited","-","â","â"]);function o(e){return a.has(e.trim().toLowerCase())}function l(e){if(o(e))return 0;let t=r(e.replace(/%/g,""));return null===t?null:Math.min(Math.max(Math.round(t),0),100)}function c(e){return o(e)?0:r(e)}function d(e){var t,n,i,s,a;let l=e.trim().toLowerCase().replace(/\$/g,"");if(o(l))return{min:0,max:null};if("free"===l)return{min:0,max:0};let c=/^(.+?)\s*(?:-|â|â|to)\s*(.+)$/.exec(l);if(c){let e=r(null!==(t=c[1])&&void 0!==t?t:""),i=(null!==(n=c[2])&&void 0!==n?n:"").trim(),s=/^(any|\+|â|max)$/.test(i)||i.endsWith("+")?null:r(i);return null!==e&&(null!==s||/^(any|\+|â|max)$/.test(i)||i.endsWith("+"))?null!==s&&s<e?{min:s,max:e}:{min:e,max:s}:null}let d=/^(?:>=?|â¥|over|from|min)\s*(.+)$|^(.+?)\s*\+$/.exec(l);if(d){let e=r(null!==(s=null!==(i=d[1])&&void 0!==i?i:d[2])&&void 0!==s?s:"");return null===e?null:{min:e,max:null}}let u=/^(?:<=?|â¤|under|below|up to|max)\s*(.+)$/.exec(l),m=r(null!==(a=u?u[1]:l)&&void 0!==a?a:"");return null===m?null:{min:0,max:m}}function u(e){return e>=1e6?"".concat(x(e/1e6),"M"):e>=1e3?"".concat(x(e/1e3),"K"):String(Math.round(e))}function m(e){return e>=1e6?"$".concat(x(e/1e6),"M"):e>=1e3?"$".concat(x(e/1e3),"K"):e>=1||0===e?"$".concat(x(e)):"$".concat(e.toFixed(2))}function x(e){return Number(e.toFixed(2)).toString()}},73305:function(e,t,n){n.d(t,{c$:function(){return f},e0:function(){return b},pw:function(){return g},so:function(){return v},wq:function(){return c}});var i=n(45236);let s=["all","text","image","audio","video","decisions"],r=["tools","vision","reasoning","json","streaming","async","artifact","voices","transcription","music","image_edit","aspect_ratio","resolution","text_to_video","image_to_video","with_audio","multi_image"],a=["best_price","discount","discount_asc","liquidity","liquidity_asc","active","active_asc","credits","sellers","sellers_asc","price_asc","price_desc","name_asc","recently_added"],o=["all","trusted","untrusted"],l=["text","image","audio","video","file"],c={tab:"all",sort:"credits",providers:[],trust:"all",minDiscount:0,priceRange:{min:0,max:null},minContext:0,inputs:[],caps:[],minSellers:0,minLiquidity:0,uncappedOnly:!1},d=["type","providers","provider","trust","discount","price","ctx","inputs","caps","sellers","capacity","uncapped","sort"],u=e=>Array.from(new Set((null!=e?e:"").split(",").map(e=>
1e.trim().toLowerCase()).filter(Boolean))),m=(e,t)=>{let n=null==t?void 0:t.trim().toLowerCase();return e.find(e=>e===n)},x=(e,t)=>{let n=new Set(u(t));return e.filter(e=>n.has(e))},p=e=>["1","true"].includes((null!=e?e:"").trim().toLowerCase()),h=e=>e.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20});function f(e){var t,n,d,h,f,v,g,b,j,k,y;return{tab:null!==(t=m(s,e.get("type")))&&void 0!==t?t:c.tab,sort:null!==(n=m(a,e.get("sort")))&&void 0!==n?n:c.sort,providers:u(e.get("providers")||e.get("provider")),trust:null!==(d=m(o,e.get("trust")))&&void 0!==d?d:c.trust,minDiscount:null!==(f=(0,i.GM)(null!==(h=e.get("discount"))&&void 0!==h?h:""))&&void 0!==f?f:0,priceRange:function(e){let[t,n,...s]=(null!=e?e:"").split("-").map(e=>e.trim());if(void 0===t||void 0===n||s.length>0)return c.priceRange;let r=""===t?0:(0,i.NC)(t);if(null===r)return c.priceRange;if(""===n)return{min:r,max:null};let a=(0,i.NC)(n);return null===a||a<r?c.priceRange:{min:r,max:a}}(e.get("price")),minContext:Math.round(null!==(g=(0,i.Vm)(null!==(v=e.get("ctx"))&&void 0!==v?v:""))&&void 0!==g?g:0),inputs:x(l,e.get("inputs")),caps:x(r,e.get("caps")),minSellers:Math.round(null!==(j=(0,i.Vm)(null!==(b=e.get("sellers"))&&void 0!==b?b:""))&&void 0!==j?j:0),minLiquidity:null!==(y=(0,i.Vm)(null!==(k=e.get("capacity"))&&void 0!==k?k:""))&&void 0!==y?y:0,uncappedOnly:p(e.get("uncapped"))}}function v(e,t){var n;let i=new URLSearchParams(e);for(let e of d)i.delete(e);let s=(e,t)=>{t&&i.append(e,t)};return s("type",t.tab===c.tab?null:t.tab),s("providers",t.providers.join(",")),s("trust",t.trust===c.trust?null:t.trust),s("discount",t.minDiscount>0?h(t.minDiscount):null),s("price",(n=t.priceRange).min<=0&&null===n.max?null:"".concat(h(n.min),"-").concat(null===n.max?"":h(n.max))),s("ctx",t.minContext>0?h(t.minContext):null),s("inputs",t.inputs.join(",")),s("caps",t.caps.join(",")),s("sellers",t.minSellers>0?h(t.minSellers):null),s("capacity",t.minLiquidity>0?h(t.minLiquidity):null),s("uncapped",t.uncappedOnly?"1":null),s("sort",t.sort===c.sort?null:t.sort),i}function g(e){let t=e.toString().replace(/%2C/gi,",");return t?"?".concat(t):""}function b(e,t){let n=new URLSearchParams;return t.trim()&&n.set("q",t.trim()),g(v(n,e))}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.