birdclaw 0.9.2 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cli/birdclaw.js +1296 -1082
- package/dist/client/assets/AvatarChip-C8zELEVt.js +1 -0
- package/dist/client/assets/ProfilePreview-CsiLpFrb.js +1 -0
- package/dist/client/assets/SavedTimelineView-BSnwnujP.js +1 -0
- package/dist/client/assets/SmartTimestamp-BypN4KPq.js +1 -0
- package/dist/client/assets/TimelineRouteFrame-H3D4R0Xu.js +1 -0
- package/dist/client/assets/blocks-WsAOmHsv.js +1 -0
- package/dist/client/assets/{bookmarks-DZIMTKEp.js → bookmarks-B2I0kAWY.js} +1 -1
- package/dist/client/assets/circle-check-BCK_qvXt.js +1 -0
- package/dist/client/assets/{client-stream-contracts-DcKcyZhg.js → client-stream-contracts-D1QUdWfh.js} +1 -1
- package/dist/client/assets/createLucideIcon-CMLcIxOz.js +1 -0
- package/dist/client/assets/data-sources-DI5W9oVq.js +1 -0
- package/dist/client/assets/discuss-t2QxXK0h.js +1 -0
- package/dist/client/assets/dms-DjyXURaJ.js +1 -0
- package/dist/client/assets/inbox-CkHVoykL.js +1 -0
- package/dist/client/assets/index-BR860w88.js +31 -0
- package/dist/client/assets/likes-CenHqxQG.js +1 -0
- package/dist/client/assets/links-lDqy93u8.js +1 -0
- package/dist/client/assets/mapbox-CVPXIYUZ.js +2 -0
- package/dist/client/assets/{mapbox-gl-CPemBIlO.js → mapbox-gl-DRRiLKWb.js} +1 -1
- package/dist/client/assets/{mentions-DBrY-UPg.js → mentions-B6BXntri.js} +1 -1
- package/dist/client/assets/network-map-BCUtBk8G.js +2 -0
- package/dist/client/assets/profile-analyze-YExKd6Lx.js +1 -0
- package/dist/client/assets/{profile-hydration-client-BNe0sUmK.js → profile-hydration-client-BQyC5--e.js} +1 -1
- package/dist/client/assets/profiles._handle-idhd3kYo.js +1 -0
- package/dist/client/assets/query-client-DZ5C7UNo.js +17 -0
- package/dist/client/assets/rate-limits-jGxIfvUD.js +1 -0
- package/dist/client/assets/react-BwGzW7mM.js +1 -0
- package/dist/client/assets/react-dom-DEMAB80t.js +1 -0
- package/dist/client/assets/{repeat-2-xCwHM9hD.js → repeat-2-CQ0lek01.js} +1 -1
- package/dist/client/assets/rolldown-runtime-B-9mzPXz.js +1 -0
- package/dist/client/assets/{routes-Bl-Lw2hN.js → routes-6U4Cc79j.js} +1 -1
- package/dist/client/assets/schemas-CntsNLmN.js +64 -0
- package/dist/client/assets/search-C_LqodNa.js +1 -0
- package/dist/client/assets/{sparkles-CQVlvHsZ.js → sparkles-Gx_BHkDX.js} +1 -1
- package/dist/client/assets/{styles-zihNNCGg.css → styles-DT4Pxoi-.css} +1 -1
- package/dist/client/assets/today-COmNSYaE.js +1 -0
- package/dist/client/assets/{triangle-alert-CBL7s2pf.js → triangle-alert-DJPCW6jQ.js} +1 -1
- package/dist/client/assets/useTimelineRouteData-BpQzU16P.js +1 -0
- package/dist/client/assets/{users-CHbKlqUr.js → users-DI3w8Mol.js} +1 -1
- package/dist/server/assets/{_tanstack-start-manifest_v-CVfs07C8.js → _tanstack-start-manifest_v-mm-2VYBo.js} +35 -35
- package/dist/server/assets/{empty-plugin-adapters-DzrEkdBF.js → empty-plugin-adapters-D9UWiqvJ.js} +1 -1
- package/dist/server/assets/{router-D8AUR_Gz.js → router-DVQ3M870.js} +767 -710
- package/dist/server/assets/start-5Z2QO8AU.js +4 -0
- package/dist/server/server.js +50 -3413
- package/package.json +1 -1
- package/dist/client/assets/AvatarChip-BN3b4MhM.js +0 -1
- package/dist/client/assets/ProfilePreview-CHbT0U9a.js +0 -1
- package/dist/client/assets/SavedTimelineView-mGXE9EYJ.js +0 -1
- package/dist/client/assets/SmartTimestamp-DG8XJKUz.js +0 -1
- package/dist/client/assets/TimelineRouteFrame-BmMC7qLj.js +0 -1
- package/dist/client/assets/blocks-CawnB0mN.js +0 -1
- package/dist/client/assets/chunk-C0phanGV.js +0 -1
- package/dist/client/assets/circle-check-C_Vq3ElD.js +0 -1
- package/dist/client/assets/createLucideIcon-JV8isFFR.js +0 -1
- package/dist/client/assets/data-sources-BJUT2qaO.js +0 -1
- package/dist/client/assets/discuss-DMPJVaRk.js +0 -1
- package/dist/client/assets/dms-BfPFG4Qr.js +0 -1
- package/dist/client/assets/inbox-DmeYJ7tt.js +0 -1
- package/dist/client/assets/index-Bqmo4MbK.js +0 -31
- package/dist/client/assets/likes-BxVL-j_C.js +0 -1
- package/dist/client/assets/links-BeA1Wt8F.js +0 -1
- package/dist/client/assets/mapbox-BTSMNSry.js +0 -2
- package/dist/client/assets/network-map-MqbE164r.js +0 -2
- package/dist/client/assets/profile-analyze-DEA75Reh.js +0 -1
- package/dist/client/assets/profiles._handle-K34ofz9U.js +0 -1
- package/dist/client/assets/query-client-DUP1ZzP7.js +0 -17
- package/dist/client/assets/rate-limits-B8Wmpt9r.js +0 -1
- package/dist/client/assets/react-dom-DHl6Ug7F.js +0 -1
- package/dist/client/assets/react-nBylq1U5.js +0 -1
- package/dist/client/assets/schemas-CaALBBpc.js +0 -64
- package/dist/client/assets/search-Dq5kYsxA.js +0 -1
- package/dist/client/assets/today-DFvZ0Ys5.js +0 -1
- package/dist/client/assets/useTimelineRouteData-Cpf-Jqsx.js +0 -1
- package/dist/server/assets/start-FaDOTmto.js +0 -4
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./chunk-C0phanGV.js";var t=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),n=e(((e,n)=>{n.exports=t()}));export{n as t};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./chunk-C0phanGV.js";var t=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),n=e(((e,n)=>{n.exports=t()}));function r(...e){return e.filter(Boolean).join(` `)}var i=`min-h-screen bg-[var(--bg)] font-sans text-[var(--ink)] antialiased text-[15px] leading-[1.4]`,a=`mx-auto flex min-h-screen w-full max-w-[1280px] gap-0`,o=`sticky top-0 z-30 flex h-screen w-[72px] shrink-0 flex-col justify-between border-r border-[var(--line)] bg-[var(--bg)] px-2 py-3 min-[1100px]:w-[260px] min-[1100px]:px-3`,s=`sticky top-0 z-30 flex h-screen w-[72px] shrink-0 flex-col justify-between border-r border-[var(--line)] bg-[var(--bg)] px-2 py-3`,c=`flex items-center gap-2.5 px-2 py-2 text-[var(--ink)] min-[1100px]:px-3`,l=`grid size-10 place-items-center`,u=`hidden flex-col leading-tight min-[1100px]:flex`,d=`sr-only`,f=`text-[15px] font-bold tracking-tight`,p=`text-[12px] text-[var(--ink-soft)]`,ee=`mt-2 flex flex-col gap-0.5`,te=`flex flex-col gap-2 pb-1`,ne=`nav-link group flex items-center justify-center gap-4 rounded-full px-3 py-2.5 text-[15px] text-[var(--ink)] transition-colors duration-150 hover:bg-[var(--bg-hover)] min-[1100px]:justify-start`,re=`nav-link group flex items-center justify-center rounded-full px-3 py-2.5 text-[15px] text-[var(--ink)] transition-colors duration-150 hover:bg-[var(--bg-hover)]`,ie=`nav-link-active font-bold`,ae=`shrink-0`,oe=`sr-only min-[1100px]:not-sr-only`,se=`sr-only`,ce=`flex w-full min-w-0 max-w-[680px] flex-1 flex-col border-x border-[var(--line)] bg-[var(--bg)]`,le=`flex w-full min-w-0 flex-1 flex-col border-x border-[var(--line)] bg-[var(--bg)]`,ue=`sticky top-0 z-20 flex flex-col gap-0 border-b border-[var(--line)] bg-[color:color-mix(in_srgb,var(--bg)_85%,transparent)] backdrop-blur`,de=`flex items-center justify-between gap-3 px-4 pt-3 pb-2`,fe=`m-0 text-[20px] font-bold tracking-tight`,pe=`text-[13px] text-[var(--ink-soft)]`,me=`flex items-center gap-2`,he=`flex w-full items-stretch border-b border-[var(--line)] overflow-x-auto`,ge=`relative flex flex-1 min-w-[88px] items-center justify-center px-3 py-3.5 text-[14px] font-medium text-[var(--ink-soft)] transition-colors duration-150 hover:bg-[var(--bg-hover)]`,_e=`text-[var(--ink)] font-bold`,ve=`pointer-events-none absolute bottom-0 left-1/2 h-[3px] w-12 -translate-x-1/2 rounded-full bg-[var(--accent)]`,ye=`flex flex-col`,be=`flex w-full gap-3 border-b border-[var(--line)] px-4 py-3 transition-colors duration-150 hover:bg-[var(--bg-hover)]`,xe=`flex min-w-0 flex-1 flex-col gap-1`,Se=`flex min-w-0 items-center gap-1.5 text-[15px]`,Ce=`truncate font-bold text-[var(--ink)] hover:underline`,we=`truncate text-[var(--ink-soft)]`,Te=`text-[var(--ink-soft)]`,Ee=`shrink-0 text-[var(--ink-soft)] hover:underline`,De=`mt-2 flex max-w-md items-center justify-between text-[var(--ink-soft)]`,Oe=`action-button group/action inline-flex items-center gap-1 rounded-full border-0 bg-transparent px-2 py-1 text-[13px] text-[var(--ink-soft)] transition-colors duration-150 hover:text-[var(--accent)] disabled:cursor-default disabled:opacity-55`,ke=`grid size-[34px] place-items-center rounded-full transition-colors duration-150 group-hover/action:bg-[var(--accent-soft)]`,Ae=`size-[18px]`,je=`whitespace-pre-wrap break-words text-[15px] leading-[1.45] text-[var(--ink)] [overflow-wrap:anywhere]`,Me=`inline-flex shrink-0 items-center gap-1 rounded-full border border-[var(--line)] bg-[var(--bg-active)] px-2 py-0.5 text-[12px] font-semibold text-[var(--ink-soft)]`,Ne=`border-[color:color-mix(in_srgb,var(--accent)_35%,var(--line))] bg-[var(--accent-soft)] text-[var(--accent)]`,Pe=`border-[color:color-mix(in_srgb,var(--ink-soft)_34%,var(--line))] bg-transparent text-[var(--ink-soft)]`,Fe=`flex items-center gap-2 rounded-full border border-transparent bg-[var(--bg-active)] px-4 py-2 transition-colors focus-within:border-[var(--accent)] focus-within:bg-[var(--bg)] focus-within:shadow-[0_0_0_1px_var(--accent)]`,Ie=`size-[18px] text-[var(--ink-soft)] shrink-0`,Le=`min-w-0 flex-1 border-0 bg-transparent text-[14px] text-[var(--ink)] outline-none placeholder:text-[var(--ink-soft)]`,Re=`w-full rounded-md border border-[var(--line)] bg-[var(--bg)] px-3 py-2 text-[14px] text-[var(--ink)] outline-none transition-colors duration-150 placeholder:text-[var(--ink-soft)] focus:border-[var(--accent)] focus:shadow-[0_0_0_1px_var(--accent)] disabled:cursor-default disabled:opacity-55`,ze=`w-[120px]`,Be=r(Re,`appearance-none pr-8`),Ve=`inline-flex items-center justify-center gap-1.5 rounded-full border-0 bg-[var(--accent)] px-4 py-1.5 text-[14px] font-bold text-white shadow-none transition-colors duration-150 hover:bg-[var(--accent-hover)] active:bg-[var(--accent-press)] disabled:cursor-default disabled:opacity-55`,He=`inline-flex items-center justify-center gap-1.5 rounded-full border border-[var(--line-strong)] bg-transparent px-4 py-1.5 text-[14px] font-bold text-[var(--ink)] transition-colors duration-150 hover:bg-[var(--bg-hover)] disabled:cursor-default disabled:opacity-55`,Ue=`inline-flex items-center justify-center gap-1.5 rounded-full border border-[var(--alert)] bg-transparent px-4 py-1.5 text-[14px] font-bold text-[var(--alert)] transition-colors duration-150 hover:bg-[var(--alert-soft)] disabled:cursor-default disabled:opacity-55`,We=`inline-flex shrink-0 items-center gap-1 rounded-full border border-[var(--line)] bg-[var(--bg)] p-1`,Ge=`rounded-full border-0 bg-transparent px-3 py-1 text-[13px] font-medium text-[var(--ink-soft)] capitalize transition-colors duration-150`,Ke=`bg-[var(--bg-active)] text-[var(--ink)]`,qe=`bg-[var(--accent-soft)]! text-[var(--accent)]! shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--accent)_36%,transparent)]`,Je=`mt-2 flex flex-col gap-2 border-t border-[var(--line)] pt-3`,Ye=`min-h-[88px] w-full resize-y rounded-md border border-[var(--line)] bg-[var(--bg)] px-3 py-2.5 text-[15px] text-[var(--ink)] outline-none transition-colors duration-150 placeholder:text-[var(--ink-soft)] focus:border-[var(--accent)] focus:shadow-[0_0_0_1px_var(--accent)]`,Xe=`flex items-center justify-between gap-3`,Ze=`px-6 py-10 text-center text-[var(--ink-soft)]`,Qe=`mx-4 my-3 whitespace-pre-wrap break-words rounded-md border border-[var(--alert)] bg-[var(--alert-soft)] px-3 py-2 text-[14px] text-[var(--alert)]`,$e=`mx-4 my-3 rounded-md border border-[var(--line)] bg-[var(--bg-elevated)] px-3 py-2 text-[13px] text-[var(--ink-soft)]`,et=`avatar-chip inline-grid size-10 shrink-0 place-items-center overflow-hidden rounded-full text-[14px] font-bold text-white`,tt=`avatar-chip-large size-16 text-[18px]`,nt=`avatar-chip-small size-8 text-[12px]`,rt=`mt-2 overflow-hidden rounded-2xl border border-[var(--line)] transition-colors duration-150 hover:bg-[var(--bg-hover)]`,it=`flex flex-col gap-2 px-3 py-2.5`,at=`flex items-center gap-1.5 text-[14px]`,ot=`font-bold text-[var(--ink)] truncate`,st=`text-[var(--ink-soft)] truncate`,ct=`text-[12px] uppercase tracking-wide text-[var(--ink-soft)]`,lt=`whitespace-pre-wrap text-[14px] leading-[1.4] text-[var(--ink)] [overflow-wrap:anywhere]`,ut=`group/link-preview mt-2 flex min-w-0 overflow-hidden rounded-2xl border border-[var(--line)] bg-[var(--bg-card)] transition-colors duration-150 hover:bg-[var(--bg-hover)]`,dt=`line-clamp-2 font-bold leading-tight text-[var(--ink)]`,ft=`line-clamp-2 text-[14px] leading-snug text-[var(--ink-soft)]`,pt=`text-[13px] text-[var(--ink-soft)] truncate`,mt=`grid h-[calc(100vh-56px)] min-h-[520px] grid-cols-1 min-[960px]:grid-cols-[360px_minmax(0,1fr)] min-[1360px]:grid-cols-[400px_minmax(0,1fr)]`,ht=`flex flex-col overflow-y-auto border-r border-[var(--line)]`,gt=`flex w-full items-start gap-3 border-b border-[var(--line)] border-0 bg-transparent px-3 py-3 text-left transition-colors duration-150 hover:bg-[var(--bg-hover)]`,_t=`bg-[var(--bg-active)]`,vt=`flex min-w-0 flex-1 flex-col gap-1`,yt=`flex items-center justify-between gap-2`,bt=`truncate text-[14px] font-bold text-[var(--ink)]`,xt=`truncate text-[13px] text-[var(--ink-soft)]`,St=`truncate text-[13px] text-[var(--ink-soft)]`,Ct=`shrink-0 text-[12px] text-[var(--ink-soft)]`,wt=`flex min-w-0 flex-col`,Tt=`sticky top-0 z-10 flex items-center justify-between gap-3 border-b border-[var(--line)] bg-[color:color-mix(in_srgb,var(--bg)_85%,transparent)] px-4 py-3 backdrop-blur`,Et=`flex items-center gap-3 min-w-0`,Dt=`truncate text-[16px] font-bold`,Ot=`truncate text-[13px] text-[var(--ink-soft)]`,kt=`flex flex-1 flex-col gap-2 overflow-y-auto px-4 py-4`,At=`flex max-w-[78%] flex-col gap-1`,jt=`self-end items-end`,Mt=`rounded-2xl rounded-bl-md px-3.5 py-2 text-[15px] leading-[1.4]`,Nt=`bg-[var(--bg-active)] text-[var(--ink)]`,Pt=`rounded-bl-2xl rounded-br-md bg-[var(--accent)] text-[var(--accent-text)]`,Ft=`flex items-center gap-2 text-[12px] text-[var(--ink-soft)]`,It=`flex flex-col gap-2 border-t border-[var(--line)] px-4 py-3`,Lt=`relative inline-flex`,Rt=`profile-preview-trigger inline-flex text-inherit`,zt=`fixed z-40 w-[280px] overflow-y-auto rounded-2xl border border-[var(--line)] bg-[var(--bg-elevated)] p-3 shadow-[0_8px_28px_var(--shadow-strong)]`,Bt=`flex items-center gap-3`,Vt=`block text-[15px] font-bold text-[var(--ink)]`,Ht=`block text-[14px] text-[var(--ink-soft)]`,Ut=`block text-[14px] leading-[1.4] text-[var(--ink)]`,Wt=`block text-[13px] text-[var(--ink-soft)]`,Gt=`text-[var(--accent)] hover:underline`,Kt=`text-[var(--accent)] hover:underline`,qt=Kt;function Jt(e){let t=Math.min(e,4),n=e===1?`grid-cols-1`:e===3?`grid-cols-[1.3fr_1fr]`:e===4?`grid-cols-2 grid-rows-2`:`grid-cols-2`;return r(`tweet-media-grid tweet-media-grid-${String(t)}`,`mt-2 grid gap-0.5 overflow-hidden rounded-2xl border border-[var(--line)]`,n)}function Yt(e,t){return r(`tweet-media-tile relative block overflow-hidden border-0 bg-[var(--bg-active)] p-0 text-left`,t===1&&`aspect-[16/10]`,t===2&&`aspect-square`,t===3&&e===0&&`row-span-2 aspect-[3/4]`,t===3&&e!==0&&`aspect-square`,t===4&&`aspect-square`)}var Xt=`mt-2 rounded-xl border border-[var(--line)] bg-[var(--bg-hover)] px-3 py-2.5 text-[14px] text-[var(--ink-soft)] [&_p]:mt-1 [&_p]:mb-0`,Zt=`flex items-start gap-3 border-b border-[var(--line)] px-4 py-3 transition-colors duration-150 hover:bg-[var(--bg-hover)]`,Qt=`flex min-w-0 flex-1 flex-col gap-1`,$t=`inline-block size-1 shrink-0 rounded-full bg-[var(--ink-soft)]`,en=`inline-flex items-center rounded-full px-2 py-0.5 text-[12px] font-semibold`,tn=`bg-[var(--accent-soft)] text-[var(--accent)]`,nn=`bg-[var(--alert-soft)] text-[var(--alert)]`,rn=`text-[13px] text-[var(--ink-soft)]`,an=je,on=`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3 border-t border-[var(--line)] py-2 first:border-t-0 first:pt-0`,sn=`min-w-0 text-[13px] text-[var(--ink-soft)]`,cn=`shrink-0 whitespace-nowrap text-right text-[14px] font-bold text-[var(--ink)]`,ln;function m(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var h=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},un=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ln=globalThis).__zod_globalConfig??(ln.__zod_globalConfig={});var g=globalThis.__zod_globalConfig;function _(e){return e&&Object.assign(g,e),g}function dn(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function v(e,t){return typeof t==`bigint`?t.toString():t}function y(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function fn(e){return e==null}function pn(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function mn(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var hn=Symbol(`evaluating`);function b(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==hn)return r===void 0&&(r=hn,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function x(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function S(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function gn(e){return JSON.stringify(e)}function _n(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var vn=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var yn=y(()=>{if(g.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function w(e){if(C(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(C(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function bn(e){return w(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var xn=new Set([`string`,`number`,`symbol`]);function T(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function E(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function D(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Sn(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var Cn={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function wn(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return E(e,S(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return x(this,`shape`,e),e},checks:[]}))}function Tn(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return E(e,S(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return x(this,`shape`,r),r},checks:[]}))}function En(e,t){if(!w(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return E(e,S(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return x(this,`shape`,n),n}}))}function Dn(e,t){if(!w(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return E(e,S(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return x(this,`shape`,n),n}}))}function On(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return E(e,S(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return x(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function kn(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return E(t,S(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return x(this,`shape`,i),i},checks:[]}))}function An(e,t,n){return E(t,S(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return x(this,`shape`,i),i}}))}function O(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function jn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function k(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function A(e){return typeof e==`string`?e:e?.message}function j(e,t,n){let r=e.message?e.message:A(e.inst?._zod.def?.error?.(e))??A(t?.error?.(e))??A(n.customError?.(e))??A(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function Mn(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function M(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Nn=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,v,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Pn=m(`$ZodError`,Nn),Fn=m(`$ZodError`,Nn,{Parent:Error});function In(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ln(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var Rn=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new h;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>j(e,a,_())));throw vn(t,i?.callee),t}return o.value},N=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>j(e,a,_())));throw vn(t,i?.callee),t}return o.value},P=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new h;return a.issues.length?{success:!1,error:new(e??Pn)(a.issues.map(e=>j(e,i,_())))}:{success:!0,data:a.value}},zn=P(Fn),F=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>j(e,i,_())))}:{success:!0,data:a.value}},Bn=F(Fn),Vn=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Rn(e)(t,n,i)},Hn=e=>(t,n,r)=>Rn(e)(t,n,r),Un=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return N(e)(t,n,i)},Wn=e=>async(t,n,r)=>N(e)(t,n,r),Gn=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return P(e)(t,n,i)},Kn=e=>(t,n,r)=>P(e)(t,n,r),qn=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return F(e)(t,n,i)},Jn=e=>async(t,n,r)=>F(e)(t,n,r),Yn=/^[cC][0-9a-z]{6,}$/,Xn=/^[0-9a-z]+$/,Zn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Qn=/^[0-9a-vA-V]{20}$/,$n=/^[A-Za-z0-9]{27}$/,er=/^[a-zA-Z0-9_-]{21}$/,tr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,nr=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,rr=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ir=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ar=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function or(){return new RegExp(ar,`u`)}var sr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,cr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,lr=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ur=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,dr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fr=/^[A-Za-z0-9_-]*$/,pr=/^https?$/,mr=/^\+[1-9]\d{6,14}$/,hr=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,gr=RegExp(`^${hr}$`);function _r(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function vr(e){return RegExp(`^${_r(e)}$`)}function yr(e){let t=_r({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${hr}T(?:${r})$`)}var br=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},xr=/^-?\d+$/,Sr=/^-?\d+(?:\.\d+)?$/,Cr=/^(?:true|false)$/i,wr=/^undefined$/i,Tr=/^[^A-Z]*$/,Er=/^[^a-z]*$/,I=m(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Dr={number:`number`,bigint:`bigint`,object:`date`},Or=m(`$ZodCheckLessThan`,(e,t)=>{I.init(e,t);let n=Dr[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),kr=m(`$ZodCheckGreaterThan`,(e,t)=>{I.init(e,t);let n=Dr[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ar=m(`$ZodCheckMultipleOf`,(e,t)=>{I.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):mn(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),jr=m(`$ZodCheckNumberFormat`,(e,t)=>{I.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Cn[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=xr)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Mr=m(`$ZodCheckMaxLength`,(e,t)=>{var n;I.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!fn(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Mn(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Nr=m(`$ZodCheckMinLength`,(e,t)=>{var n;I.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!fn(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Mn(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Pr=m(`$ZodCheckLengthEquals`,(e,t)=>{var n;I.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!fn(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Mn(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),L=m(`$ZodCheckStringFormat`,(e,t)=>{var n,r;I.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Fr=m(`$ZodCheckRegex`,(e,t)=>{L.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ir=m(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Tr,L.init(e,t)}),Lr=m(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Er,L.init(e,t)}),Rr=m(`$ZodCheckIncludes`,(e,t)=>{I.init(e,t);let n=T(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),zr=m(`$ZodCheckStartsWith`,(e,t)=>{I.init(e,t);let n=RegExp(`^${T(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Br=m(`$ZodCheckEndsWith`,(e,t)=>{I.init(e,t);let n=RegExp(`.*${T(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Vr=m(`$ZodCheckOverwrite`,(e,t)=>{I.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Hr=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
2
|
-
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
3
|
-
`))}},Ur={major:4,minor:4,patch:3},R=m(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ur;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=O(e),i;for(let a of t){if(a._zod.def.when){if(jn(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new h;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=O(e,t))});else{if(e.issues.length===t)continue;r||=O(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(O(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new h;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new h;return o.then(e=>t(e,r,a))}return t(o,r,a)}}b(e,`~standard`,()=>({validate:t=>{try{let n=zn(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Bn(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Wr=m(`$ZodString`,(e,t)=>{R.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??br(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),z=m(`$ZodStringFormat`,(e,t)=>{L.init(e,t),Wr.init(e,t)}),Gr=m(`$ZodGUID`,(e,t)=>{t.pattern??=nr,z.init(e,t)}),Kr=m(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=rr(e)}else t.pattern??=rr();z.init(e,t)}),qr=m(`$ZodEmail`,(e,t)=>{t.pattern??=ir,z.init(e,t)}),Jr=m(`$ZodURL`,(e,t)=>{z.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===pr.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Yr=m(`$ZodEmoji`,(e,t)=>{t.pattern??=or(),z.init(e,t)}),Xr=m(`$ZodNanoID`,(e,t)=>{t.pattern??=er,z.init(e,t)}),Zr=m(`$ZodCUID`,(e,t)=>{t.pattern??=Yn,z.init(e,t)}),Qr=m(`$ZodCUID2`,(e,t)=>{t.pattern??=Xn,z.init(e,t)}),$r=m(`$ZodULID`,(e,t)=>{t.pattern??=Zn,z.init(e,t)}),ei=m(`$ZodXID`,(e,t)=>{t.pattern??=Qn,z.init(e,t)}),ti=m(`$ZodKSUID`,(e,t)=>{t.pattern??=$n,z.init(e,t)}),ni=m(`$ZodISODateTime`,(e,t)=>{t.pattern??=yr(t),z.init(e,t)}),ri=m(`$ZodISODate`,(e,t)=>{t.pattern??=gr,z.init(e,t)}),ii=m(`$ZodISOTime`,(e,t)=>{t.pattern??=vr(t),z.init(e,t)}),ai=m(`$ZodISODuration`,(e,t)=>{t.pattern??=tr,z.init(e,t)}),oi=m(`$ZodIPv4`,(e,t)=>{t.pattern??=sr,z.init(e,t),e._zod.bag.format=`ipv4`}),si=m(`$ZodIPv6`,(e,t)=>{t.pattern??=cr,z.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),ci=m(`$ZodCIDRv4`,(e,t)=>{t.pattern??=lr,z.init(e,t)}),li=m(`$ZodCIDRv6`,(e,t)=>{t.pattern??=ur,z.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function ui(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var di=m(`$ZodBase64`,(e,t)=>{t.pattern??=dr,z.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{ui(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function fi(e){if(!fr.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return ui(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var pi=m(`$ZodBase64URL`,(e,t)=>{t.pattern??=fr,z.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{fi(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),mi=m(`$ZodE164`,(e,t)=>{t.pattern??=mr,z.init(e,t)});function hi(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var gi=m(`$ZodJWT`,(e,t)=>{z.init(e,t),e._zod.check=n=>{hi(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),_i=m(`$ZodNumber`,(e,t)=>{R.init(e,t),e._zod.pattern=e._zod.bag.pattern??Sr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),vi=m(`$ZodNumberFormat`,(e,t)=>{jr.init(e,t),_i.init(e,t)}),yi=m(`$ZodBoolean`,(e,t)=>{R.init(e,t),e._zod.pattern=Cr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),bi=m(`$ZodUndefined`,(e,t)=>{R.init(e,t),e._zod.pattern=wr,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),xi=m(`$ZodUnknown`,(e,t)=>{R.init(e,t),e._zod.parse=e=>e}),Si=m(`$ZodNever`,(e,t)=>{R.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Ci(e,t,n){e.issues.length&&t.issues.push(...k(n,e.issues)),t.value[n]=e.value}var wi=m(`$ZodArray`,(e,t)=>{R.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Ci(t,n,e))):Ci(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function B(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...k(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Ti(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Sn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Ei(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>B(e,n,i,t,u,d))):B(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Di=m(`$ZodObject`,(e,t)=>{if(R.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=y(()=>Ti(t));b(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=C,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>B(n,t,e,s,r,i))):B(a,t,e,s,r,i)}return i?Ei(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Oi=m(`$ZodObjectJIT`,(e,t)=>{Di.init(e,t);let n=e._zod.parse,r=y(()=>Ti(t)),i=e=>{let t=new Hr([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=gn(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=gn(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
4
|
-
if (${n}.issues.length) {
|
|
5
|
-
if (${o} in input) {
|
|
6
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
7
|
-
...iss,
|
|
8
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
9
|
-
})));
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (${n}.value === undefined) {
|
|
14
|
-
if (${o} in input) {
|
|
15
|
-
newResult[${o}] = undefined;
|
|
16
|
-
}
|
|
17
|
-
} else {
|
|
18
|
-
newResult[${o}] = ${n}.value;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
`):c?t.write(`
|
|
22
|
-
if (${n}.issues.length) {
|
|
23
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
24
|
-
...iss,
|
|
25
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
26
|
-
})));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (${n}.value === undefined) {
|
|
30
|
-
if (${o} in input) {
|
|
31
|
-
newResult[${o}] = undefined;
|
|
32
|
-
}
|
|
33
|
-
} else {
|
|
34
|
-
newResult[${o}] = ${n}.value;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
`):t.write(`
|
|
38
|
-
const ${n}_present = ${o} in input;
|
|
39
|
-
if (${n}.issues.length) {
|
|
40
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
41
|
-
...iss,
|
|
42
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
43
|
-
})));
|
|
44
|
-
}
|
|
45
|
-
if (!${n}_present && !${n}.issues.length) {
|
|
46
|
-
payload.issues.push({
|
|
47
|
-
code: "invalid_type",
|
|
48
|
-
expected: "nonoptional",
|
|
49
|
-
input: undefined,
|
|
50
|
-
path: [${o}]
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (${n}_present) {
|
|
55
|
-
if (${n}.value === undefined) {
|
|
56
|
-
newResult[${o}] = undefined;
|
|
57
|
-
} else {
|
|
58
|
-
newResult[${o}] = ${n}.value;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=C,s=!g.jitless,c=s&&yn.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Ei([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function ki(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!O(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>j(e,r,_())))}),t)}var Ai=m(`$ZodUnion`,(e,t)=>{R.init(e,t),b(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),b(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),b(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),b(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>pn(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>ki(t,r,e,i)):ki(o,r,e,i)}}),ji=m(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Ai.init(e,t);let n=e._zod.parse;b(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=y(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!C(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),Mi=m(`$ZodIntersection`,(e,t)=>{R.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Pi(e,t,n)):Pi(e,i,a)}});function Ni(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(w(e)&&w(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Ni(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Ni(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Pi(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),O(e))return e;let o=Ni(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Fi=m(`$ZodTuple`,(e,t)=>{R.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=Ii(n,`optin`),c=Ii(n,`optout`);if(!t.rest){if(a.length<s)return r.issues.push({code:`too_small`,minimum:s,inclusive:!0,input:a,inst:e,origin:`array`}),r;a.length>n.length&&r.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:a,inst:e,origin:`array`})}let l=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:a[e],issues:[]},i);t instanceof Promise?o.push(t.then(t=>{l[e]=t})):l[e]=t}if(t.rest){let e=n.length-1,s=a.slice(n.length);for(let n of s){e++;let a=t.rest._zod.run({value:n,issues:[]},i);a instanceof Promise?o.push(a.then(t=>Li(t,r,e))):Li(a,r,e)}}return o.length?Promise.all(o).then(()=>Ri(l,r,n,a,c)):Ri(l,r,n,a,c)}});function Ii(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!==`optional`)return n+1;return 0}function Li(e,t,n){e.issues.length&&t.issues.push(...k(n,e.issues)),t.value[n]=e.value}function Ri(e,t,n,r,i){for(let a=0;a<n.length;a++){let n=e[a],o=a<r.length;if(n.issues.length){if(!o&&a>=i){t.value.length=a;break}t.issues.push(...k(a,n.issues))}t.value[a]=n.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}var zi=m(`$ZodRecord`,(e,t)=>{R.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!w(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>j(e,r,_())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...k(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...k(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&Sr.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>j(e,r,_())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...k(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...k(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Bi=m(`$ZodEnum`,(e,t)=>{R.init(e,t);let n=dn(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>xn.has(typeof e)).map(e=>typeof e==`string`?T(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Vi=m(`$ZodLiteral`,(e,t)=>{if(R.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?T(e):e?T(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Hi=m(`$ZodTransform`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new un(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new h;return n.value=i,n.fallback=!0,n}});function Ui(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Wi=m(`$ZodOptional`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,b(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),b(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${pn(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Ui(e,r)):Ui(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Gi=m(`$ZodExactOptional`,(e,t)=>{Wi.init(e,t),b(e._zod,`values`,()=>t.innerType._zod.values),b(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Ki=m(`$ZodNullable`,(e,t)=>{R.init(e,t),b(e._zod,`optin`,()=>t.innerType._zod.optin),b(e._zod,`optout`,()=>t.innerType._zod.optout),b(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${pn(e.source)}|null)$`):void 0}),b(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),qi=m(`$ZodDefault`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,b(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ji(e,t)):Ji(r,t)}});function Ji(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Yi=m(`$ZodPrefault`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,b(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Xi=m(`$ZodNonOptional`,(e,t)=>{R.init(e,t),b(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Zi(t,e)):Zi(i,e)}});function Zi(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Qi=m(`$ZodCatch`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,b(e._zod,`optout`,()=>t.innerType._zod.optout),b(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>j(e,n,_()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>j(e,n,_()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),$i=m(`$ZodPipe`,(e,t)=>{R.init(e,t),b(e._zod,`values`,()=>t.in._zod.values),b(e._zod,`optin`,()=>t.in._zod.optin),b(e._zod,`optout`,()=>t.out._zod.optout),b(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>V(e,t.in,n)):V(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>V(e,t.out,n)):V(r,t.out,n)}});function V(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var ea=m(`$ZodPreprocess`,(e,t)=>{$i.init(e,t)}),ta=m(`$ZodReadonly`,(e,t)=>{R.init(e,t),b(e._zod,`propValues`,()=>t.innerType._zod.propValues),b(e._zod,`values`,()=>t.innerType._zod.values),b(e._zod,`optin`,()=>t.innerType?._zod?.optin),b(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(na):na(r)}});function na(e){return e.value=Object.freeze(e.value),e}var ra=m(`$ZodCustom`,(e,t)=>{I.init(e,t),R.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>ia(t,n,r,e));ia(i,n,r,e)}});function ia(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(M(e))}}var aa,oa=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function sa(){return new oa}(aa=globalThis).__zod_globalRegistry??(aa.__zod_globalRegistry=sa());var H=globalThis.__zod_globalRegistry;function ca(e,t){return new e({type:`string`,...D(t)})}function la(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...D(t)})}function ua(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...D(t)})}function da(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...D(t)})}function fa(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...D(t)})}function pa(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...D(t)})}function ma(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...D(t)})}function ha(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...D(t)})}function ga(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...D(t)})}function _a(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...D(t)})}function va(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...D(t)})}function ya(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...D(t)})}function ba(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...D(t)})}function xa(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...D(t)})}function Sa(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...D(t)})}function Ca(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...D(t)})}function wa(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...D(t)})}function Ta(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...D(t)})}function Ea(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...D(t)})}function Da(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...D(t)})}function Oa(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...D(t)})}function ka(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...D(t)})}function Aa(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...D(t)})}function ja(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...D(t)})}function Ma(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...D(t)})}function Na(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...D(t)})}function Pa(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...D(t)})}function Fa(e,t){return new e({type:`number`,checks:[],...D(t)})}function Ia(e,t){return new e({type:`number`,coerce:!0,checks:[],...D(t)})}function La(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...D(t)})}function Ra(e,t){return new e({type:`boolean`,...D(t)})}function za(e,t){return new e({type:`undefined`,...D(t)})}function Ba(e){return new e({type:`unknown`})}function Va(e,t){return new e({type:`never`,...D(t)})}function Ha(e,t){return new Or({check:`less_than`,...D(t),value:e,inclusive:!1})}function Ua(e,t){return new Or({check:`less_than`,...D(t),value:e,inclusive:!0})}function Wa(e,t){return new kr({check:`greater_than`,...D(t),value:e,inclusive:!1})}function Ga(e,t){return new kr({check:`greater_than`,...D(t),value:e,inclusive:!0})}function Ka(e,t){return new Ar({check:`multiple_of`,...D(t),value:e})}function qa(e,t){return new Mr({check:`max_length`,...D(t),maximum:e})}function U(e,t){return new Nr({check:`min_length`,...D(t),minimum:e})}function Ja(e,t){return new Pr({check:`length_equals`,...D(t),length:e})}function Ya(e,t){return new Fr({check:`string_format`,format:`regex`,...D(t),pattern:e})}function Xa(e){return new Ir({check:`string_format`,format:`lowercase`,...D(e)})}function Za(e){return new Lr({check:`string_format`,format:`uppercase`,...D(e)})}function Qa(e,t){return new Rr({check:`string_format`,format:`includes`,...D(t),includes:e})}function $a(e,t){return new zr({check:`string_format`,format:`starts_with`,...D(t),prefix:e})}function eo(e,t){return new Br({check:`string_format`,format:`ends_with`,...D(t),suffix:e})}function W(e){return new Vr({check:`overwrite`,tx:e})}function to(e){return W(t=>t.normalize(e))}function no(){return W(e=>e.trim())}function ro(){return W(e=>e.toLowerCase())}function io(){return W(e=>e.toUpperCase())}function ao(){return W(e=>_n(e))}function oo(e,t,n){return new e({type:`array`,element:t,...D(n)})}function so(e,t,n){let r=D(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function co(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...D(n)})}function lo(e,t){let n=uo(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(M(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(M(r))}},e(t.value,t)),t);return n}function uo(e,t){let n=new I({check:`custom`,...D(t)});return n._zod.check=e,n}function fo(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??H,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function G(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,G(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&K(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function po(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
63
|
-
|
|
64
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function mo(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:q(t,`input`,e.processors),output:q(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function K(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return K(r.element,n);if(r.type===`set`)return K(r.valueType,n);if(r.type===`lazy`)return K(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return K(r.innerType,n);if(r.type===`intersection`)return K(r.left,n)||K(r.right,n);if(r.type===`record`||r.type===`map`)return K(r.keyType,n)||K(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:K(r.in,n)||K(r.out,n);if(r.type===`object`){for(let e in r.shape)if(K(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(K(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(K(e,n))return!0;return!!(r.rest&&K(r.rest,n))}return!1}var ho=(e,t={})=>n=>{let r=fo({...n,processors:t});return G(e,r),po(r,e),mo(r,e)},q=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=fo({...i??{},target:a,io:t,processors:n});return G(e,o),po(o,e),mo(o,e)},go={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},_o=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=go[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},vo=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},yo=(e,t,n,r)=>{n.type=`boolean`},bo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},xo=(e,t,n,r)=>{n.not={}},So=(e,t,n,r)=>{let i=e._zod.def,a=dn(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Co=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},wo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},To=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Eo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=G(a.element,t,{...r,path:[...r.path,`items`]})},Do=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=G(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=G(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Oo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>G(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},ko=(e,t,n,r)=>{let i=e._zod.def,a=G(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=G(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Ao=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>G(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?G(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},jo=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=G(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=G(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=G(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Mo=(e,t,n,r)=>{let i=e._zod.def,a=G(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},No=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Po=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Fo=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Io=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Lo=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;G(o,t,r);let s=t.seen.get(e);s.ref=o},Ro=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},zo=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Bo=m(`ZodISODateTime`,(e,t)=>{ni.init(e,t),Z.init(e,t)});function Vo(e){return ja(Bo,e)}var Ho=m(`ZodISODate`,(e,t)=>{ri.init(e,t),Z.init(e,t)});function Uo(e){return Ma(Ho,e)}var Wo=m(`ZodISOTime`,(e,t)=>{ii.init(e,t),Z.init(e,t)});function Go(e){return Na(Wo,e)}var Ko=m(`ZodISODuration`,(e,t)=>{ai.init(e,t),Z.init(e,t)});function qo(e){return Pa(Ko,e)}var J=m(`ZodError`,(e,t)=>{Pn.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ln(e,t)},flatten:{value:t=>In(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,v,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,v,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Jo=Rn(J),Yo=N(J),Xo=P(J),Zo=F(J),Qo=Vn(J),$o=Hn(J),es=Un(J),ts=Wn(J),ns=Gn(J),rs=Kn(J),is=qn(J),as=Jn(J),os=new WeakMap;function Y(e,t,n){let r=Object.getPrototypeOf(e),i=os.get(r);if(i||(i=new Set,os.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var X=m(`ZodType`,(e,t)=>(R.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:q(e,`input`),output:q(e,`output`)}}),e.toJSONSchema=ho(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Jo(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Xo(e,t,n),e.parseAsync=async(t,n)=>Yo(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Zo(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Qo(e,t,n),e.decode=(t,n)=>$o(e,t,n),e.encodeAsync=async(t,n)=>es(e,t,n),e.decodeAsync=async(t,n)=>ts(e,t,n),e.safeEncode=(t,n)=>ns(e,t,n),e.safeDecode=(t,n)=>rs(e,t,n),e.safeEncodeAsync=async(t,n)=>is(e,t,n),e.safeDecodeAsync=async(t,n)=>as(e,t,n),Y(e,`ZodType`,{check(...e){let t=this.def;return this.clone(S(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return E(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Dc(e,t))},superRefine(e,t){return this.check(Oc(e,t))},overwrite(e){return this.check(W(e))},optional(){return sc(this)},exactOptional(){return lc(this)},nullable(){return dc(this)},nullish(){return sc(dc(this))},nonoptional(e){return _c(this,e)},array(){return Bs(this)},or(e){return Gs([this,e])},and(e){return Ys(this,e)},transform(e){return xc(this,ac(e))},default(e){return pc(this,e)},prefault(e){return hc(this,e)},catch(e){return yc(this,e)},pipe(e){return xc(this,e)},readonly(){return wc(this)},describe(e){let t=this.clone();return H.add(t,{description:e}),t},meta(...e){if(e.length===0)return H.get(this);let t=this.clone();return H.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return H.get(e)?.description},configurable:!0}),e)),ss=m(`_ZodString`,(e,t)=>{Wr.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_o(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Y(e,`_ZodString`,{regex(...e){return this.check(Ya(...e))},includes(...e){return this.check(Qa(...e))},startsWith(...e){return this.check($a(...e))},endsWith(...e){return this.check(eo(...e))},min(...e){return this.check(U(...e))},max(...e){return this.check(qa(...e))},length(...e){return this.check(Ja(...e))},nonempty(...e){return this.check(U(1,...e))},lowercase(e){return this.check(Xa(e))},uppercase(e){return this.check(Za(e))},trim(){return this.check(no())},normalize(...e){return this.check(to(...e))},toLowerCase(){return this.check(ro())},toUpperCase(){return this.check(io())},slugify(){return this.check(ao())}})}),cs=m(`ZodString`,(e,t)=>{Wr.init(e,t),ss.init(e,t),e.email=t=>e.check(la(us,t)),e.url=t=>e.check(ha(fs,t)),e.jwt=t=>e.check(Aa(Ds,t)),e.emoji=t=>e.check(ga(ps,t)),e.guid=t=>e.check(ua(ds,t)),e.uuid=t=>e.check(da(Q,t)),e.uuidv4=t=>e.check(fa(Q,t)),e.uuidv6=t=>e.check(pa(Q,t)),e.uuidv7=t=>e.check(ma(Q,t)),e.nanoid=t=>e.check(_a(ms,t)),e.guid=t=>e.check(ua(ds,t)),e.cuid=t=>e.check(va(hs,t)),e.cuid2=t=>e.check(ya(gs,t)),e.ulid=t=>e.check(ba(_s,t)),e.base64=t=>e.check(Da(ws,t)),e.base64url=t=>e.check(Oa(Ts,t)),e.xid=t=>e.check(xa(vs,t)),e.ksuid=t=>e.check(Sa(ys,t)),e.ipv4=t=>e.check(Ca(bs,t)),e.ipv6=t=>e.check(wa(xs,t)),e.cidrv4=t=>e.check(Ta(Ss,t)),e.cidrv6=t=>e.check(Ea(Cs,t)),e.e164=t=>e.check(ka(Es,t)),e.datetime=t=>e.check(Vo(t)),e.date=t=>e.check(Uo(t)),e.time=t=>e.check(Go(t)),e.duration=t=>e.check(qo(t))});function ls(e){return ca(cs,e)}var Z=m(`ZodStringFormat`,(e,t)=>{z.init(e,t),ss.init(e,t)}),us=m(`ZodEmail`,(e,t)=>{qr.init(e,t),Z.init(e,t)}),ds=m(`ZodGUID`,(e,t)=>{Gr.init(e,t),Z.init(e,t)}),Q=m(`ZodUUID`,(e,t)=>{Kr.init(e,t),Z.init(e,t)}),fs=m(`ZodURL`,(e,t)=>{Jr.init(e,t),Z.init(e,t)}),ps=m(`ZodEmoji`,(e,t)=>{Yr.init(e,t),Z.init(e,t)}),ms=m(`ZodNanoID`,(e,t)=>{Xr.init(e,t),Z.init(e,t)}),hs=m(`ZodCUID`,(e,t)=>{Zr.init(e,t),Z.init(e,t)}),gs=m(`ZodCUID2`,(e,t)=>{Qr.init(e,t),Z.init(e,t)}),_s=m(`ZodULID`,(e,t)=>{$r.init(e,t),Z.init(e,t)}),vs=m(`ZodXID`,(e,t)=>{ei.init(e,t),Z.init(e,t)}),ys=m(`ZodKSUID`,(e,t)=>{ti.init(e,t),Z.init(e,t)}),bs=m(`ZodIPv4`,(e,t)=>{oi.init(e,t),Z.init(e,t)}),xs=m(`ZodIPv6`,(e,t)=>{si.init(e,t),Z.init(e,t)}),Ss=m(`ZodCIDRv4`,(e,t)=>{ci.init(e,t),Z.init(e,t)}),Cs=m(`ZodCIDRv6`,(e,t)=>{li.init(e,t),Z.init(e,t)}),ws=m(`ZodBase64`,(e,t)=>{di.init(e,t),Z.init(e,t)}),Ts=m(`ZodBase64URL`,(e,t)=>{pi.init(e,t),Z.init(e,t)}),Es=m(`ZodE164`,(e,t)=>{mi.init(e,t),Z.init(e,t)}),Ds=m(`ZodJWT`,(e,t)=>{gi.init(e,t),Z.init(e,t)}),Os=m(`ZodNumber`,(e,t)=>{_i.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r),Y(e,`ZodNumber`,{gt(e,t){return this.check(Wa(e,t))},gte(e,t){return this.check(Ga(e,t))},min(e,t){return this.check(Ga(e,t))},lt(e,t){return this.check(Ha(e,t))},lte(e,t){return this.check(Ua(e,t))},max(e,t){return this.check(Ua(e,t))},int(e){return this.check(js(e))},safe(e){return this.check(js(e))},positive(e){return this.check(Wa(0,e))},nonnegative(e){return this.check(Ga(0,e))},negative(e){return this.check(Ha(0,e))},nonpositive(e){return this.check(Ua(0,e))},multipleOf(e,t){return this.check(Ka(e,t))},step(e,t){return this.check(Ka(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function ks(e){return Fa(Os,e)}var As=m(`ZodNumberFormat`,(e,t)=>{vi.init(e,t),Os.init(e,t)});function js(e){return La(As,e)}var Ms=m(`ZodBoolean`,(e,t)=>{yi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r)});function Ns(e){return Ra(Ms,e)}var Ps=m(`ZodUndefined`,(e,t)=>{bi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bo(e,t,n,r)});function Fs(e){return za(Ps,e)}var Is=m(`ZodUnknown`,(e,t)=>{xi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function $(){return Ba(Is)}var Ls=m(`ZodNever`,(e,t)=>{Si.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xo(e,t,n,r)});function Rs(e){return Va(Ls,e)}var zs=m(`ZodArray`,(e,t)=>{wi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eo(e,t,n,r),e.element=t.element,Y(e,`ZodArray`,{min(e,t){return this.check(U(e,t))},nonempty(e){return this.check(U(1,e))},max(e,t){return this.check(qa(e,t))},length(e,t){return this.check(Ja(e,t))},unwrap(){return this.element}})});function Bs(e,t){return oo(zs,e,t)}var Vs=m(`ZodObject`,(e,t)=>{Oi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Do(e,t,n,r),b(e,`shape`,()=>t.shape),Y(e,`ZodObject`,{keyof(){return tc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:$()})},loose(){return this.clone({...this._zod.def,catchall:$()})},strict(){return this.clone({...this._zod.def,catchall:Rs()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return En(this,e)},safeExtend(e){return Dn(this,e)},merge(e){return On(this,e)},pick(e){return wn(this,e)},omit(e){return Tn(this,e)},partial(...e){return kn(oc,this,e[0])},required(...e){return An(gc,this,e[0])}})});function Hs(e,t){return new Vs({type:`object`,shape:e??{},...D(t)})}function Us(e,t){return new Vs({type:`object`,shape:e,catchall:$(),...D(t)})}var Ws=m(`ZodUnion`,(e,t)=>{Ai.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oo(e,t,n,r),e.options=t.options});function Gs(e,t){return new Ws({type:`union`,options:e,...D(t)})}var Ks=m(`ZodDiscriminatedUnion`,(e,t)=>{Ws.init(e,t),ji.init(e,t)});function qs(e,t,n){return new Ks({type:`union`,options:t,discriminator:e,...D(n)})}var Js=m(`ZodIntersection`,(e,t)=>{Mi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(e,t,n,r)});function Ys(e,t){return new Js({type:`intersection`,left:e,right:t})}var Xs=m(`ZodTuple`,(e,t)=>{Fi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ao(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function Zs(e,t,n){let r=t instanceof R;return new Xs({type:`tuple`,items:e,rest:r?t:null,...D(r?n:t)})}var Qs=m(`ZodRecord`,(e,t)=>{zi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jo(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function $s(e,t,n){return!t||!t._zod?new Qs({type:`record`,keyType:ls(),valueType:e,...D(t)}):new Qs({type:`record`,keyType:e,valueType:t,...D(n)})}var ec=m(`ZodEnum`,(e,t)=>{Bi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>So(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new ec({...t,checks:[],...D(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new ec({...t,checks:[],...D(r),entries:i})}});function tc(e,t){return new ec({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...D(t)})}var nc=m(`ZodLiteral`,(e,t)=>{Vi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Co(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function rc(e,t){return new nc({type:`literal`,values:Array.isArray(e)?e:[e],...D(t)})}var ic=m(`ZodTransform`,(e,t)=>{Hi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>To(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new un(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(M(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(M(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function ac(e){return new ic({type:`transform`,transform:e})}var oc=m(`ZodOptional`,(e,t)=>{Wi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sc(e){return new oc({type:`optional`,innerType:e})}var cc=m(`ZodExactOptional`,(e,t)=>{Gi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lc(e){return new cc({type:`optional`,innerType:e})}var uc=m(`ZodNullable`,(e,t)=>{Ki.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function dc(e){return new uc({type:`nullable`,innerType:e})}var fc=m(`ZodDefault`,(e,t)=>{qi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Po(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function pc(e,t){return new fc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():bn(t)}})}var mc=m(`ZodPrefault`,(e,t)=>{Yi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hc(e,t){return new mc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():bn(t)}})}var gc=m(`ZodNonOptional`,(e,t)=>{Xi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>No(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _c(e,t){return new gc({type:`nonoptional`,innerType:e,...D(t)})}var vc=m(`ZodCatch`,(e,t)=>{Qi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Io(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function yc(e,t){return new vc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var bc=m(`ZodPipe`,(e,t)=>{$i.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lo(e,t,n,r),e.in=t.in,e.out=t.out});function xc(e,t){return new bc({type:`pipe`,in:e,out:t})}var Sc=m(`ZodPreprocess`,(e,t)=>{bc.init(e,t),ea.init(e,t)}),Cc=m(`ZodReadonly`,(e,t)=>{ta.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wc(e){return new Cc({type:`readonly`,innerType:e})}var Tc=m(`ZodCustom`,(e,t)=>{ra.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wo(e,t,n,r)});function Ec(e,t){return so(Tc,e??(()=>!0),t)}function Dc(e,t={}){return co(Tc,e,t)}function Oc(e,t){return lo(e,t)}function kc(e,t){return new Sc({type:`pipe`,in:ac(e),out:t})}export{Tt as $,Lt as $t,sn as A,Re as An,ft as At,gt as B,oe as Bt,Zt as C,s as Cn,Ne as Ct,Ye as D,ge as Dn,Ee as Dt,Xe as E,_e as En,je as Et,vt as F,Jt as Fn,$t as Ft,Nt as G,pe as Gt,St as H,me as Ht,ht as I,Yt as In,ie as It,At as J,en as Jt,Pt as K,fe as Kt,xt as L,Kt as Ln,ne as Lt,r as M,rn as Mn,dt as Mt,Ue as N,qt as Nn,ce as Nt,Je as O,ve as On,Xt as Ot,It as P,Gt as Pn,le as Pt,wt as Q,zt as Qt,yt as R,n as Rn,re as Rt,Qt as S,o as Sn,Ce as St,an as T,$e as Tn,Pe as Tt,Ct as U,ue as Ut,bt as V,se as Vt,Mt as W,de as Wt,kt as X,Ve as Xt,jt as Y,tn as Yt,mt as Z,Ut as Zt,$ as _,l as _n,xe as _t,Ns as a,Ie as an,lt as at,tt as b,te as bn,we as bt,rc as c,He as cn,ct,Hs as d,Ge as dn,Qe as dt,Ht as en,Dt as et,kc as f,We as fn,Oe as ft,Gs as g,d as gn,De as gt,Zs as h,u as hn,ye as ht,Bs as i,Rt as in,rt as it,cn as j,ze as jn,pt as jt,on as k,he as kn,ut as kt,Us as l,qe as ln,ot as lt,ls as m,c as mn,ke as mt,tc as n,Wt as nn,Et as nt,Ec as o,Le as on,st as ot,$s as p,Be as pn,Ae as pt,Ft as q,nn as qt,Fs as r,Vt as rn,it as rt,qs as s,Fe as sn,at as st,Os as t,Bt as tn,Ot as tt,ks as u,Ke as un,Ze as ut,Ia as v,p as vn,be as vt,i as w,a as wn,Me as wt,nt as x,ee as xn,Se as xt,et as y,f as yn,Te as yt,_t as z,ae as zt};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-JV8isFFR.js";var t=e(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-C0phanGV.js";import{t}from"./react-nBylq1U5.js";import{Gt as n,Ht as r,Kt as i,M as a,Rn as o,Ut as s,Wt as c,cn as l,dn as u,dt as d,fn as f}from"./schemas-CaALBBpc.js";import{t as p}from"./createLucideIcon-JV8isFFR.js";import{t as m}from"./circle-check-C_Vq3ElD.js";import{a as h,n as g,o as _,s as v,t as y}from"./client-stream-contracts-DcKcyZhg.js";import{t as b}from"./sparkles-CQVlvHsZ.js";import{b as x}from"./query-client-DUP1ZzP7.js";import{n as S,t as C}from"./profile-hydration-client-BNe0sUmK.js";import{J as w,ft as T,rt as E}from"./index-Bqmo4MbK.js";var D=p(`file-down`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}],[`path`,{d:`m9 15 3 3 3-3`,key:`1npd3o`}]]),O=e(t()),k=o(),A=12,j=300,M={524:`Digest startup timed out at Cloudflare (524). Retry to open a new stream.`},N=[{value:`today`,label:`Today`},{value:`24h`,label:`24h`},{value:`yesterday`,label:`Yesterday`},{value:`week`,label:`Week`}];function P(e){return N.find(t=>t.value===e)?.label??`Digest`}function F(e){let t=document.title,n=!1,r=()=>{n||(n=!0,document.title=t,window.removeEventListener(`afterprint`,r))};document.title=e,window.addEventListener(`afterprint`,r,{once:!0}),window.setTimeout(r,3e3),window.print()}function I(e,t,n){let r=new URL(`/api/period-digest`,window.location.origin);return r.searchParams.set(`period`,e),r.searchParams.set(`includeDms`,String(t)),r.searchParams.set(`maxTweets`,`5000`),r.searchParams.set(`maxLinks`,`20`),r.searchParams.set(`liveSync`,`false`),n&&r.searchParams.set(`refresh`,`true`),r}function L(e,t){let n=e instanceof Error?e.message:String(e);return e instanceof TypeError&&/network error|failed to fetch|load failed/i.test(n)?`Digest connection was interrupted while ${t.toLowerCase()}. Retry to continue.`:e instanceof SyntaxError?`Digest stream returned invalid data while ${t.toLowerCase()}. Retry to continue.`:n||`Digest failed`}function R(e){if(!e)return`Local Twitter memory, summarized as it streams.`;let t=e.counts;return[`${String(t.home)} home`,`${String(t.mentions)} mentions`,`${String(t.links)} links`,e.includeDms?`${String(t.dms)} DMs`:null].filter(Boolean).join(` · `)}function z(e){let t=new Set,n=new Set;for(let t of e.digest.sourceTweetIds)n.add(t);for(let t of e.digest.keyTopics)for(let e of t.tweetIds)n.add(e);for(let t of e.digest.notableLinks)for(let e of t.sourceTweetIds)n.add(e);for(let t of e.digest.actionItems)t.tweetId&&n.add(t.tweetId);let r=new Map(e.context.tweets.flatMap(e=>[[e.id,e],[`tweet_${e.id}`,e]]));for(let e of n){let n=r.get(e);if(!n)continue;let i=S(n.author);i&&t.add(i)}for(let n of e.context.tweets){let e=S(n.author);e&&t.add(e)}return[...t]}function B(e,t){let n=!1,r=e.tweets.map(e=>{let r=t.get(S(e.author));return!r||r===e.authorProfile?e:(n=!0,{...e,author:r.handle,name:r.displayName,authorProfile:r})});return n?{...e,tweets:r}:e}function V(e,t){let n=new Map(t.map(e=>[S(e.handle),e]));if(n.size===0)return e;let r=B(e.context,n);return r===e.context?e:{...e,context:r}}function H(e,t){let n=x(),[r,i]=(0,O.useState)(``),[a,o]=(0,O.useState)(null),[s,c]=(0,O.useState)(null),[l,u]=(0,O.useState)(`Starting digest`),d=(0,O.useRef)(`Starting digest`),f=(0,O.useCallback)(()=>{i(``),o(null),c(null),u(`Starting digest`),d.current=`Starting digest`},[]),{error:p,loading:m,run:_}=h({schema:g,request:(0,O.useCallback)((n,r)=>fetch(I(e,t,r),{cache:`no-store`,signal:n}),[t,e]),onStart:f,onEvent:(0,O.useCallback)(e=>{if(e.type===`status`)d.current=e.detail?`${e.label} · ${e.detail}`:e.label,u(d.current);else if(e.type===`start`)o(e.context);else if(e.type===`delta`)d.current=`Streaming AI summary`,u(d.current),i(t=>t+e.delta);else if(e.type===`done`)c(e.result),o(e.result.context),i(e.result.markdown),u(e.result.cached?`Loaded cached report`:`Ready`);else if(e.type===`error`)throw Error(e.error)},[]),onError:(0,O.useCallback)(()=>u(`Digest failed`),[]),isTerminal:y,errorLabel:`Digest request failed`,emptyBodyMessage:`Digest request failed: empty response body`,prematureEofError:(0,O.useCallback)(()=>Error(`Digest connection closed while ${d.current.toLowerCase()}. Retry to continue.`),[]),formatError:(0,O.useCallback)(e=>L(e,d.current),[]),statusMessages:M});return(0,O.useEffect)(()=>{_(!1)},[_]),(0,O.useEffect)(()=>{if(!s)return;let e=z(s);if(e.length===0)return;let t=!0,r=null,i=()=>{C(n,e,{limit:A}).then(e=>{if(!t)return;let{profiles:n}=e;if(n.length===0)return;c(e=>e&&V(e,n));let r=new Map(n.map(e=>[S(e.handle),e]));o(e=>e&&B(e,r))}).catch(e=>{t&&console.warn(`Profile hydration failed`,e)})},a=window.setTimeout(()=>{`requestIdleCallback`in window?r=window.requestIdleCallback(i,{timeout:2500}):i()},j);return()=>{t=!1,window.clearTimeout(a),r!==null&&`cancelIdleCallback`in window&&window.cancelIdleCallback(r)}},[n,s]),{context:a,error:p,loading:m,markdown:r,result:s,run:_,status:l}}function U(){let e=w.useSearch(),t=w.useNavigate();return(0,k.jsx)(W,{searchState:e,onSearchChange:(e,n)=>void t({search:e,replace:n?.replace})})}function W({searchState:e,onSearchChange:t}={}){let[o,p]=(0,O.useState)(()=>E({})),h=e??o,g=(e,n)=>t?t(e,n):p(e),{period:y,includeDms:x}=h,{context:S,error:C,loading:w,markdown:A,result:j,run:M,status:I}=H(y,x);(0,O.useEffect)(()=>{let e=document.documentElement;return e.classList.add(`today-pdf-route`),()=>e.classList.remove(`today-pdf-route`)},[]);let L=(0,O.useMemo)(()=>R(j?.context??S),[S,j]),z=j?.context.window.label??S?.window.label??P(y),B=!!j?.markdown.trim()&&!w,V=`BirdClaw ${z} digest`,U=j?new Date(j.updatedAt).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null,W=(0,O.useCallback)(()=>{B&&F(V)},[B,V]);return(0,k.jsxs)(`div`,{className:`today-pdf-root flex min-h-screen flex-col`,children:[(0,k.jsxs)(`header`,{className:a(`today-pdf-header`,s),children:[(0,k.jsxs)(`div`,{className:c,children:[(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsx)(`h1`,{className:i,children:`What happened`}),(0,k.jsx)(`p`,{className:n,children:L})]}),(0,k.jsxs)(`div`,{className:a(`today-screen-only`,r),children:[B?(0,k.jsxs)(`button`,{type:`button`,className:l,onClick:W,children:[(0,k.jsx)(D,{className:`size-4`,"aria-hidden":`true`}),`Export PDF`]}):null,(0,k.jsxs)(`button`,{type:`button`,className:l,onClick:()=>M(!0),disabled:w,children:[(0,k.jsx)(T,{className:a(`size-4`,w&&`animate-spin`),"aria-hidden":`true`}),`Refresh`]})]})]}),(0,k.jsxs)(`div`,{className:`today-pdf-meta`,"aria-hidden":`true`,children:[(0,k.jsx)(`span`,{children:z}),(0,k.jsx)(`span`,{children:`·`}),(0,k.jsxs)(`span`,{children:[`Sources: `,L]}),U?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`span`,{children:`·`}),(0,k.jsxs)(`span`,{children:[`Generated `,U]})]}):null]}),(0,k.jsxs)(`div`,{className:`today-screen-only flex flex-wrap items-center gap-2 px-4 pb-3`,children:[(0,k.jsx)(`div`,{className:f,"aria-label":`Digest period`,children:N.map(e=>(0,k.jsx)(`button`,{type:`button`,"aria-pressed":y===e.value,className:a(u,y===e.value&&`bg-[var(--accent-soft)]! text-[var(--accent)]! shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--accent)_36%,transparent)]`),onClick:()=>g({...h,period:e.value}),children:e.label},e.value))}),(0,k.jsxs)(`label`,{className:`inline-flex items-center gap-2 rounded-full border border-[var(--line)] px-3 py-1 text-[13px] font-medium text-[var(--ink-soft)]`,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:x,onChange:e=>g({...h,includeDms:e.currentTarget.checked})}),`DMs`]})]})]}),C?(0,k.jsxs)(`div`,{className:a(d,`flex items-center justify-between gap-3`),role:`alert`,children:[(0,k.jsx)(`span`,{children:C}),(0,k.jsx)(`button`,{className:`shrink-0 font-semibold underline underline-offset-2`,onClick:()=>M(!0),type:`button`,children:`Retry`})]}):null,(0,k.jsx)(`div`,{className:`today-screen-only border-b border-[var(--line)] px-4 py-2 text-[13px] text-[var(--ink-soft)]`,children:(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[w?(0,k.jsx)(v,{className:`size-4 animate-spin`,"aria-hidden":`true`}):A?(0,k.jsx)(m,{className:`size-4`,"aria-hidden":`true`}):(0,k.jsx)(b,{className:`size-4`,"aria-hidden":`true`}),w?I:j?`${j.cached?`Cached`:`Ready`} · ${j.context.window.label}`:C?`Digest failed`:`Ready`]})}),A?(0,k.jsx)(_,{context:j?.context??S,markdown:A}):(0,k.jsx)(`div`,{className:`px-4 py-5 text-[14px] text-[var(--ink-soft)]`,children:w?I:C?`No digest was generated. Retry to start a new run.`:`Waiting for the first tokens...`})]})}export{W as TodayRouteView,U as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-C0phanGV.js";import{t}from"./react-nBylq1U5.js";import{At as n,Ct as r,Dt as i,Et as a,Fn as o,Gt as s,In as c,Kt as l,M as u,Mt as d,Rn as f,St as p,Tt as m,Ut as h,Wt as g,_t as _,an as v,at as y,bt as b,ct as x,ft as S,gt as C,ht as w,it as T,jt as E,kt as D,lt as O,mt as k,on as ee,ot as te,pt as A,rt as ne,sn as re,st as ie,vt as ae,wt as j,xt as oe,yt as se}from"./schemas-CaALBBpc.js";import{t as M}from"./createLucideIcon-JV8isFFR.js";import{t as ce}from"./circle-check-C_Vq3ElD.js";import{t as le}from"./repeat-2-xCwHM9hD.js";import{t as ue}from"./search-Dq5kYsxA.js";import{C as de,a as fe,b as N,i as pe,l as me,m as he,n as P,o as ge,r as _e,s as ve,v as ye,w as be}from"./query-client-DUP1ZzP7.js";import{r as F,t as xe}from"./AvatarChip-BN3b4MhM.js";import{c as Se,i as I,s as Ce,t as L}from"./ProfilePreview-CHbT0U9a.js";import{t as R}from"./SmartTimestamp-DG8XJKUz.js";import{A as we,M as Te,O as Ee,at as De,ct as z,d as Oe,dt as ke,gt as B,it as Ae,k as je,lt as Me,mt as Ne,ot as Pe,pt as V,s as H,st as Fe,ut as Ie,yt as Le}from"./index-Bqmo4MbK.js";var Re=M(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),ze=M(`bookmark-check`,[[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}],[`path`,{d:`m9 10 2 2 4-4`,key:`1gnqz4`}]]),Be=M(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Ve=M(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),He=class extends Ie{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:de(t,n.data),hasPreviousPage:be(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}};function Ue(e){return e}function We(e,t){return Me(e,He,t)}var U=e(t(),1),Ge=(0,U.createContext)(null);function Ke(e){return Ue({queryKey:[...P.conversations,e],queryFn:()=>me(pe(`/api/conversation?tweetId=${encodeURIComponent(e)}`,void 0,ye,`Conversation unavailable`)).then(e=>e.items),staleTime:1/0})}function qe({children:e}){let[t,n]=(0,U.useState)(null),r=(0,U.useMemo)(()=>({expandedSurfaceId:t,setExpandedSurfaceId:n}),[t]);return(0,U.createElement)(Ge.Provider,{value:r},e)}function Je(e,t=e){let n=(0,U.useContext)(Ge),[r,i]=(0,U.useState)(null),a=n?.expandedSurfaceId??r,o=n?.setExpandedSurfaceId??i,s=a===e,c=N(),l=z({...Ke(t),enabled:s}),u=(0,U.useCallback)(()=>{o(s?null:e)},[s,o,e]),d=(0,U.useCallback)(()=>{c.prefetchQuery(Ke(t))},[c,t]),f=l.isError?`error`:l.isFetching?`loading`:l.data?`ready`:`idle`;return{error:l.error instanceof Error?l.error.message:null,isOpen:s,items:l.data??[],loading:l.isFetching,prefetch:d,status:f,toggle:u}}var W=f();function Ye(e){let t=I(e);if(!t)return null;try{return new URL(t).hostname===`pbs.twimg.com`?t:null}catch{return null}}function G({article:e}){let t=I(e.url);if(!t)return null;let r=Ye(e.coverImageUrl);return(0,W.jsxs)(`a`,{"aria-label":`Read article: ${e.title}`,className:D,"data-perf":`tweet-article-card`,href:t,rel:`noreferrer`,target:`_blank`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col justify-center gap-1 px-3.5 py-3`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,W.jsx)(Re,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-[var(--ink-soft)]`,strokeWidth:1.8}),(0,W.jsx)(`span`,{className:E,children:`Article on X`}),(0,W.jsx)(B,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-[var(--ink-soft)] opacity-0 transition-opacity group-hover/link-preview:opacity-100`,strokeWidth:1.8})]}),(0,W.jsx)(`span`,{className:d,children:e.title}),e.previewText?(0,W.jsx)(`span`,{className:n,children:e.previewText}):null]}),r?(0,W.jsx)(`div`,{className:`flex aspect-[1.45] w-40 shrink-0 overflow-hidden border-l border-[var(--line)] bg-[var(--bg-soft)] max-[720px]:w-28`,children:(0,W.jsx)(`img`,{alt:``,className:`size-full object-cover transition-transform duration-200 group-hover/link-preview:scale-[1.03]`,loading:`lazy`,src:r})}):null]})}function K({items:e}){let[t,n]=(0,U.useState)(null);if(e.length===0)return null;let r=e.slice(0,4),i=t===null?null:r[t]??null,a=i?.type===`video`||i?.type===`gif`?i.variants?.[0]?.url??Ze(i.url):null,s=r.length===1&&r[0]?.type===`image`?r[0]:null;return(0,W.jsxs)(W.Fragment,{children:[s?(0,W.jsx)(`button`,{"aria-label":`Open tweet media 1`,className:u(`tweet-media-single mt-2 max-w-full overflow-hidden rounded-2xl border border-[var(--line)] bg-[var(--bg-active)] p-0 text-left`,s.width&&s.height?`block`:`inline-block align-top`),onClick:e=>{e.stopPropagation(),n(0)},style:Xe(s),type:`button`,children:(0,W.jsx)(`img`,{alt:s.altText??`Tweet media 1`,className:u(`tweet-media-image block max-h-[720px] max-w-full`,s.width&&s.height?`size-full object-cover`:`h-auto w-auto object-contain`),height:s.height,loading:`lazy`,src:s.thumbnailUrl??s.url,width:s.width})}):(0,W.jsx)(`div`,{className:o(Math.min(e.length,4)),children:r.map((t,i)=>(0,W.jsx)(`button`,{"aria-label":`Open tweet media ${String(i+1)}`,className:c(i,Math.min(e.length,4)),onClick:e=>{e.stopPropagation(),n(i)},style:r.length===1&&t.width&&t.height?{aspectRatio:`${String(t.width)} / ${String(t.height)}`}:void 0,type:`button`,children:t.type===`image`?(0,W.jsx)(`img`,{alt:t.altText??`Tweet media ${String(i+1)}`,className:`tweet-media-image block size-full object-contain`,loading:`lazy`,src:t.thumbnailUrl??t.url}):(0,W.jsx)(`span`,{className:`tweet-media-fallback grid min-h-40 place-items-center font-semibold text-[var(--ink-soft)]`,children:t.type===`video`?`Video`:t.type===`gif`?`GIF`:`Media`})},t.url+String(i)))}),i?(0,W.jsxs)(`div`,{"aria-modal":`true`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/85 p-4`,onClick:e=>{e.stopPropagation(),n(null)},role:`dialog`,children:[(0,W.jsx)(`button`,{"aria-label":`Close media viewer`,className:`absolute right-4 top-4 grid size-10 place-items-center rounded-full bg-white/10 text-white transition-colors hover:bg-white/20`,onClick:e=>{e.stopPropagation(),n(null)},type:`button`,children:(0,W.jsx)(Ve,{className:`size-5`,strokeWidth:1.8})}),i.type===`image`?(0,W.jsx)(`img`,{alt:i.altText??`Tweet media`,className:`max-h-[92vh] max-w-[92vw] object-contain`,onClick:e=>e.stopPropagation(),src:i.url}):a?(0,W.jsx)(`video`,{autoPlay:i.type===`gif`,className:`max-h-[92vh] max-w-[92vw]`,controls:!0,loop:i.type===`gif`,muted:i.type===`gif`,onClick:e=>e.stopPropagation(),playsInline:!0,poster:i.thumbnailUrl,src:a}):(0,W.jsxs)(`div`,{className:`grid min-h-64 min-w-80 place-items-center gap-3 rounded-2xl border border-white/20 bg-black p-6 text-white`,onClick:e=>e.stopPropagation(),children:[(0,W.jsx)(`span`,{children:i.type===`video`?`Video`:i.type===`gif`?`GIF`:`Media`}),(0,W.jsx)(`a`,{className:`rounded-full bg-white/10 px-4 py-2 text-sm font-semibold text-white transition-colors hover:bg-white/20`,href:i.url,rel:`noreferrer`,target:`_blank`,children:`Open media`})]})]}):null]})}function Xe(e){if(!e.width||!e.height)return;let t=Math.min(e.width,Math.round(e.width/e.height*720));return{aspectRatio:`${String(e.width)} / ${String(e.height)}`,width:`${String(t)}px`}}function Ze(e){try{let t=new URL(e);return t.hostname===`video.twimg.com`||/\.(?:mp4|m3u8)(?:$|[?#])/i.test(t.pathname)?e:void 0}catch{return/\.(?:mp4|m3u8)(?:$|[?#])/i.test(e)?e:void 0}}function Qe({anchorId:e,error:t,items:n,loading:r}){return r?(0,W.jsx)(`section`,{className:`mt-3 rounded-2xl border border-[var(--line)] bg-[var(--bg-card)]`,children:(0,W.jsx)(De,{detail:`Finding archived replies around this post`,label:`Loading conversation`})}):t?(0,W.jsx)(`section`,{className:`mt-3 rounded-2xl border border-[var(--alert)] bg-[var(--alert-soft)] px-4 py-3 text-[14px] text-[var(--alert)]`,children:t}):n.length<=1?(0,W.jsx)(`section`,{className:`mt-3 rounded-2xl border border-[var(--line)]`,children:(0,W.jsx)(Ae,{detail:`This post has no other archived replies locally.`,label:`No thread context yet`})}):(0,W.jsxs)(`section`,{"aria-label":`Conversation`,className:`mt-3 overflow-hidden rounded-2xl border border-[var(--line)] bg-[var(--bg-card)]`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--line)] px-4 py-2.5 text-[13px] font-bold text-[var(--ink)]`,children:[(0,W.jsx)(V,{className:A,strokeWidth:1.8}),(0,W.jsxs)(`span`,{children:[n.length,` tweets in conversation`]})]}),(0,W.jsx)(`div`,{className:`flex flex-col`,children:n.map((t,r)=>{let a=t.id===e;return(0,W.jsxs)(`div`,{className:u(`flex gap-3 px-4 py-3`,r>0&&`border-t border-[var(--line)]`,a&&`bg-[var(--accent-soft)]`),children:[(0,W.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,W.jsx)(xe,{avatarUrl:t.author.avatarUrl,hue:t.author.avatarHue,name:t.author.displayName,profileId:t.author.id,size:`small`}),r<n.length-1?(0,W.jsx)(`span`,{className:`mt-2 w-px flex-1 bg-[var(--line)]`}):null]}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`header`,{className:`flex min-w-0 items-center gap-1.5 text-[14px]`,children:[(0,W.jsx)(L,{profile:t.author,children:(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:p,children:t.author.displayName}),(0,W.jsxs)(`span`,{className:b,children:[`@`,t.author.handle]})]})}),(0,W.jsx)(`span`,{className:`text-[var(--ink-soft)]`,children:`·`}),(0,W.jsx)(R,{className:i,value:t.createdAt}),a?(0,W.jsx)(`span`,{className:`ml-auto rounded-full bg-[var(--accent)] px-2 py-0.5 text-[11px] font-bold text-white`,children:`selected`}):null]}),(0,W.jsx)(H,{className:`mt-1 whitespace-pre-wrap break-words text-[14px] leading-[1.45] text-[var(--ink)] [overflow-wrap:anywhere]`,entities:t.entities,text:t.text}),(0,W.jsx)(K,{items:t.media}),t.entities.article?(0,W.jsx)(G,{article:t.entities.article}):null]})]},t.id)})})]})}function q({item:e,label:t}){return(0,W.jsxs)(`section`,{className:ne,children:[(0,W.jsx)(`p`,{className:x,children:t}),(0,W.jsxs)(`header`,{className:ie,children:[(0,W.jsx)(L,{profile:e.author,children:(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:O,children:e.author.displayName}),(0,W.jsxs)(`span`,{className:te,children:[`@`,e.author.handle]})]})}),(0,W.jsx)(`span`,{className:`text-[var(--ink-soft)]`,children:`·`}),(0,W.jsx)(R,{className:i,value:e.createdAt})]}),(0,W.jsx)(H,{className:y,entities:e.entities,text:e.text}),(0,W.jsx)(K,{items:e.media}),e.entities.article?(0,W.jsx)(G,{article:e.entities.article}):null]})}var $e=2,J=0,Y=[];function et(e){let t=e.expandedUrl||``;return e.imageUrl&&e.siteName&&e.title&&it(t)?!1:!e.imageUrl||!e.title||!e.description||e.title===e.displayUrl||e.description===e.displayUrl}function tt(){for(;J<$e&&Y.length>0;)Y.shift()?.()}function nt(e){return new Promise((t,n)=>{Y.push(()=>{J+=1,e().then(t).catch(n).finally(()=>{J=Math.max(0,J-1),tt()})}),tt()})}function rt(e){let t=new URLSearchParams({url:e});return Ue({queryKey:[...P.linkPreviews,e],queryFn:()=>nt(()=>_e(`/api/link-preview?${t.toString()}`,void 0,he,`Link preview unavailable`).then(e=>e.preview)),staleTime:30*6e4})}function X(e,t){try{return new URL(e).hostname.replace(/^www\./,``)}catch{return t}}function it(e){try{let t=new URL(e);return t.protocol===`https:`&&t.hostname===`pbs.twimg.com`&&(t.pathname.startsWith(`/media/`)||t.pathname.startsWith(`/amplify_video_thumb/`))}catch{return!1}}function at(e){if(!e)return null;try{let t=new URL(e);return t.protocol===`https:`&&t.hostname===`pbs.twimg.com`&&(t.pathname.startsWith(`/media/`)||t.pathname.startsWith(`/amplify_video_thumb/`))?t.toString():null}catch{return null}}function ot({entry:e,index:t}){let r=I(e.expandedUrl||e.url),i=r??``,a=e.displayUrl||(r?X(r,r):``),o=r&&it(r)?r:null,s=(0,U.useMemo)(()=>({expandedUrl:i,displayUrl:a,title:e.title??(o?X(i,a):void 0),description:e.description??(o?a:void 0),imageUrl:e.imageUrl??o,siteName:e.siteName??(o?X(i,a):void 0)}),[o,a,e.description,e.imageUrl,e.siteName,e.title,i]),[c,l]=(0,U.useState)(!1),[f,p]=(0,U.useState)(!1),[m,h]=(0,U.useState)(!1),g=(0,U.useRef)(null),_=!!(r&&et(s)),v=z({...rt(r??``),enabled:_&&f&&m}),y=(0,U.useMemo)(()=>{let e=v.data;return e?{expandedUrl:I(e.url)??s.expandedUrl,displayUrl:s.displayUrl,title:e.title??s.title,description:e.description??s.description,imageUrl:e.imageUrl??s.imageUrl,siteName:e.siteName??s.siteName}:s},[s,v.data]);if((0,U.useEffect)(()=>{l(!1),p(!1),h(!1)},[s]),(0,U.useEffect)(()=>{if(!r||!_)return;let e=g.current;if(!e||typeof IntersectionObserver>`u`){p(!0);return}let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(p(!0),t.disconnect())},{rootMargin:`320px 0px`});return t.observe(e),()=>t.disconnect()},[_,r]),(0,U.useEffect)(()=>{if(!r||!f||!_)return;let e=window.setTimeout(()=>{h(!0)},100);return()=>window.clearTimeout(e)},[f,_,r]),!r)return null;let b=y.title||e.displayUrl,x=y.description&&y.description!==b?y.description:y.siteName||X(y.expandedUrl,e.displayUrl),S=y.siteName||X(y.expandedUrl,e.displayUrl),C=at(y.imageUrl),w=!!(C&&!c);return(0,W.jsxs)(`a`,{className:D,"data-perf":`link-preview-card`,href:I(y.expandedUrl)??r,ref:g,rel:`noreferrer`,target:`_blank`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col justify-center gap-1 px-3.5 py-3`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,W.jsx)(`span`,{className:E,children:S}),(0,W.jsx)(B,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-[var(--ink-soft)] opacity-0 transition-opacity group-hover/link-preview:opacity-100`,strokeWidth:1.8})]}),(0,W.jsx)(`span`,{className:d,children:b}),(0,W.jsx)(`span`,{className:n,children:x}),(0,W.jsx)(`span`,{className:u(E,`text-[12px]`),children:e.displayUrl})]}),(0,W.jsx)(`div`,{className:`flex aspect-[1.45] w-40 shrink-0 items-center justify-center overflow-hidden border-l border-[var(--line)] bg-[var(--bg-soft)] max-[720px]:w-28`,children:w?(0,W.jsx)(`img`,{alt:b,className:`size-full object-cover transition-transform duration-200 group-hover/link-preview:scale-[1.03]`,loading:`lazy`,onError:()=>l(!0),src:C??``}):(0,W.jsx)(Be,{"aria-hidden":`true`,className:`size-8 text-[var(--ink-soft)]`,strokeWidth:1.7})})]},`${e.expandedUrl}-${String(t)}`)}function st(e){if(!e)return null;try{let t=new URL(e);return`${t.protocol}//${t.hostname}${t.pathname}`}catch{return e.split(`?`)[0]??e}}function ct(e){let t=new Set;for(let n of e)for(let e of[n.url,n.thumbnailUrl]){let n=st(e);n&&t.add(n)}return t}function lt(e,t,n){if(t.size>0&&ft(e.expandedUrl,n))return!0;for(let n of[e.url,e.expandedUrl,e.displayUrl]){let e=st(n);if(e&&t.has(e))return!0}return!1}function Z(e){if(!e)return!1;try{let t=e.includes(`://`)?e:`https://${e}`;return new URL(t).hostname.replace(/^www\./,``)===`t.co`}catch{return!1}}function Q(e){return Z(e.expandedUrl)?!0:e.expandedUrl?!1:Z(e.displayUrl)?!0:!e.displayUrl&&Z(e.url)}function ut(e,t){return(t.urls??[]).filter(Q).map(t=>Se(e,t))}function dt(e,t){let n=0,r=``;for(let i of[...t].sort((e,t)=>e.start-t.start))i.start<n||i.end<=i.start||i.end>e.length||(r+=e.slice(n,i.start),n=i.end);return r+=e.slice(n),r}function $(e,t,n){if(n.size===0)return!1;let r=ut(e,t);return r.length===0?!1:dt(e,r).trim().length===0}function ft(e,t){if(!e)return!1;try{let n=new URL(e),r=n.hostname.replace(/^www\./,``);if(r!==`x.com`&&r!==`twitter.com`)return!1;let i=n.pathname.split(`/`).filter(Boolean),a=i.indexOf(`status`);if(a<0||i[a+1]!==t)return!1;let o=i[a+2];return o===`photo`||o===`video`}catch{return!1}}function pt(e,t,n,r){let i=ct(t);if(i.size===0)return e;let a=$(r,e,i);return{...e,urls:(e.urls??[]).filter(e=>!lt(e,i,n)&&!(a&&Q(e)))}}function mt(e,t,n,r){let i=ct(t);if(i.size===0)return[];let a=$(r,e,i);return(e.urls??[]).filter(e=>lt(e,i,n)||a&&Q(e)).map(e=>Se(r,e))}function ht(e,t){return(e.urls??[]).filter(n=>Q(n)||e.article&&Ce(n,e.article)?!1:t?!n.expandedUrl.includes(t):!0)}function gt(e){return e instanceof Element&&!!e.closest(`a,button,input,textarea,select,[role='button']`)}function _t({tweet:e,hiddenUrlRanges:t,visibleUrlCards:n,replyToTweet:r,quotedTweet:i}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(H,{className:a,entities:e.entities,hiddenUrlRanges:t,text:e.text}),(0,W.jsx)(K,{items:e.media}),e.entities.article?(0,W.jsx)(G,{article:e.entities.article}):null,r?(0,W.jsx)(`div`,{className:T,children:(0,W.jsx)(q,{item:r,label:`In reply to`})}):null,i?(0,W.jsx)(`div`,{className:T,children:(0,W.jsx)(q,{item:i,label:`Quoted tweet`})}):null,n.map((e,t)=>(0,W.jsx)(ot,{entry:e,index:t},`${e.expandedUrl}-${String(t)}`))]})}function vt({item:e,onReply:t,showReplyControls:n=!0}){let a=n&&e.kind!==`like`&&e.kind!==`bookmark`,o=e.retweetedTweet??e,s=o.id,c=e.retweetedTweet&&s===`${e.id}:retweeted`?e.id:s,l=o.author,d=Je(e.id,c),f=pt(o.entities,o.media,o.id,o.text),h=mt(o.entities,o.media,o.id,o.text),g=ht(f,e.retweetedTweet?null:e.quotedTweet?.id??null),v=e.retweetedTweet?o.mediaCount??o.media.length:e.mediaCount,y=o.isReplied??e.isReplied,x=o.likeCount??e.likeCount,w=o.bookmarked??e.bookmarked,T=o.liked??e.liked,E=T||x>0,D=v>0,O=!!(e.retweetedTweet?o.replyToId:e.replyToTweet||e.replyToId);return(0,W.jsxs)(`article`,{className:u(ae,`cursor-pointer [content-visibility:auto] [contain-intrinsic-size:auto_280px]`),"data-perf":`timeline-card`,onFocus:d.prefetch,onMouseEnter:d.prefetch,onClick:e=>{gt(e.target)||d.toggle()},children:[(0,W.jsx)(xe,{avatarUrl:l.avatarUrl,hue:l.avatarHue,name:l.displayName,profileId:l.id}),(0,W.jsxs)(`div`,{className:_,children:[e.retweetedTweet?(0,W.jsxs)(`div`,{className:`inline-flex items-center gap-2 text-[13px] font-medium text-[var(--ink-soft)]`,children:[(0,W.jsx)(le,{className:`size-4`,strokeWidth:1.8}),(0,W.jsx)(L,{profile:e.author,children:(0,W.jsxs)(`span`,{children:[e.author.displayName,` reposted`]})})]}):null,(0,W.jsxs)(`header`,{className:oe,children:[(0,W.jsx)(L,{profile:l,children:(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:p,children:l.displayName}),(0,W.jsxs)(`span`,{className:b,children:[`@`,l.handle]})]})}),(0,W.jsx)(`span`,{className:se,children:`·`}),(0,W.jsx)(R,{className:i,value:o.createdAt}),a||O?(0,W.jsxs)(`span`,{className:`ml-auto inline-flex items-center gap-1`,children:[O?(0,W.jsxs)(`span`,{"aria-label":`Part of a conversation`,className:u(j,r),title:`Part of a conversation`,children:[(0,W.jsx)(V,{className:`size-3.5`,strokeWidth:2}),`thread`]}):null,a?(0,W.jsxs)(`span`,{"aria-label":y?`We replied`:`Reply open`,className:u(j,y?r:m),title:y?`We replied`:`Reply open`,children:[y?(0,W.jsx)(ce,{className:`size-3.5`,strokeWidth:2}):(0,W.jsx)(Le,{className:`size-3`,strokeWidth:2.2}),y?`replied`:`open`]}):null]}):null]}),(0,W.jsx)(_t,{hiddenUrlRanges:h,quotedTweet:e.retweetedTweet?null:e.quotedTweet,replyToTweet:e.retweetedTweet?null:e.replyToTweet,tweet:o,visibleUrlCards:g}),(0,W.jsx)(`footer`,{className:C,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-3 text-[13px] text-[var(--ink-soft)]`,children:[(0,W.jsxs)(`button`,{"aria-expanded":d.isOpen,"aria-label":d.isOpen?`Hide conversation`:`Show conversation`,className:S,onClick:e=>{e.stopPropagation(),d.toggle()},type:`button`,children:[(0,W.jsx)(`span`,{className:k,children:(0,W.jsx)(V,{className:A,strokeWidth:1.7})}),(0,W.jsx)(`span`,{className:`text-[13px]`,children:d.isOpen?`Hide thread`:`Thread`})]}),a?(0,W.jsxs)(`button`,{className:S,onClick:e=>{e.stopPropagation(),t(c)},type:`button`,"aria-label":`Reply`,children:[(0,W.jsx)(`span`,{className:k,children:(0,W.jsx)(V,{className:A,strokeWidth:1.7})}),(0,W.jsx)(`span`,{className:`text-[13px]`,children:`Reply`})]}):null,(0,W.jsxs)(`a`,{"aria-label":`Analyse @${l.handle}`,className:S,href:`/profiles/${encodeURIComponent(l.handle)}`,onClick:e=>{e.stopPropagation()},title:`Analyse @${l.handle}`,children:[(0,W.jsx)(`span`,{className:k,children:(0,W.jsx)(ke,{className:A,strokeWidth:1.7})}),(0,W.jsx)(`span`,{className:`text-[13px]`,children:`Analyse`})]}),E?(0,W.jsxs)(`span`,{"aria-label":`${F(x)} likes`,className:u(`inline-flex items-center gap-1 px-2 py-1 text-[13px]`,T&&`text-[var(--like)]`),title:`${F(x)} likes`,children:[(0,W.jsx)(Ne,{className:A,strokeWidth:1.7,fill:T?`currentColor`:`none`}),(0,W.jsx)(`span`,{children:F(x)})]}):null,w?(0,W.jsx)(`span`,{"aria-label":`Bookmarked`,className:`inline-flex items-center px-2 py-1`,title:`Bookmarked`,children:(0,W.jsx)(ze,{className:A,strokeWidth:1.7})}):null,D?(0,W.jsxs)(`span`,{"aria-label":`${String(v)} media attachments`,className:`inline-flex items-center gap-1 px-2 py-1 text-[13px]`,title:`${String(v)} media attachments`,children:[(0,W.jsx)(Be,{className:A,strokeWidth:1.7}),(0,W.jsx)(`span`,{children:v})]}):null]})}),d.isOpen?(0,W.jsx)(Qe,{anchorId:c,error:d.error,items:d.items,loading:d.loading}):null]})]})}function yt({title:e,subtitles:t,action:n,controls:r}){return(0,W.jsxs)(`header`,{className:h,children:[(0,W.jsxs)(`div`,{className:`${g} flex-wrap`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,W.jsx)(`h1`,{className:l,children:e}),t]}),n]}),r]})}function bt({children:e}){return(0,W.jsx)(`p`,{className:s,children:e})}function xt({value:e,onChange:t,placeholder:n}){return(0,W.jsx)(`div`,{className:`px-4 pb-3`,children:(0,W.jsxs)(`label`,{className:re,children:[(0,W.jsx)(ue,{className:v,strokeWidth:2}),(0,W.jsx)(`input`,{className:ee,onChange:e=>t(e.target.value),placeholder:n,value:e})]})})}function St({header:e,notice:t,loading:n,loadingLabel:r,loadingDetail:i,error:a,errorTitle:o,onRetry:s,empty:c,emptyLabel:l,emptyDetail:u,children:d,hasMore:f,loadingMore:p,onLoadMore:m}){return(0,W.jsxs)(W.Fragment,{children:[e,t,(0,W.jsx)(qe,{children:(0,W.jsxs)(`section`,{className:w,children:[n?(0,W.jsx)(we,{detail:i,label:r,children:(0,W.jsx)(Te,{})}):a?(0,W.jsx)(je,{action:(0,W.jsx)(`button`,{className:`rounded-full bg-[var(--accent)] px-4 py-1.5 text-[14px] font-bold text-white`,onClick:s,type:`button`,children:`Retry`}),message:a,title:o}):c?(0,W.jsx)(Ee,{detail:u,label:l}):null,d,!n&&!a&&f?(0,W.jsx)(`div`,{className:`flex justify-center py-4`,children:(0,W.jsx)(`button`,{className:`rounded-full bg-[var(--accent)] px-5 py-1.5 text-[14px] font-bold text-white disabled:opacity-60`,disabled:p,onClick:m,type:`button`,children:p?`Loading…`:`Load more`})}):null]})})]})}var Ct=50,wt=5*6e4;function Tt({resource:e,search:t,replyFilter:n,likedOnly:r,bookmarkedOnly:i,selectedAccountId:a,pageParam:o}){let s=new URLSearchParams({resource:e,limit:String(Ct)});a&&s.set(`account`,a),n&&s.set(`replyFilter`,n),r&&s.set(`liked`,`true`),i&&s.set(`bookmarked`,`true`),t.trim()&&s.set(`search`,t.trim()),o&&(s.set(`until`,o.until),s.set(`untilId`,o.untilId)),s.sort();let c=typeof window>`u`?`http://birdclaw.local`:window.location.origin;return new URL(`/api/query?${s.toString()}`,c).toString()}function Et({resource:e,search:t,errorFallback:n,replyFilter:r,likedOnly:i=!1,bookmarkedOnly:a=!1}){let o=N(),s=z({queryKey:P.status,queryFn:({signal:e})=>fe({signal:e})}).data??null,c=Pe(s?.accounts),l=Oe(t,180),u=[...P.timelines,{resource:e,search:l,replyFilter:r??`all`,likedOnly:i,bookmarkedOnly:a,selectedAccountId:c??null}],d=We({queryKey:u,initialPageParam:void 0,queryFn:({pageParam:t,signal:n})=>ge(Tt({resource:e,search:l,replyFilter:r,likedOnly:i,bookmarkedOnly:a,selectedAccountId:c,pageParam:t}),{signal:n}),getNextPageParam:e=>{if(e.resource===`dms`)return;let t=e.items,n=t.at(-1);return t.length>=Ct&&n?{until:n.createdAt,untilId:n.id}:void 0},staleTime:wt}),f=(0,U.useMemo)(()=>{let e=new Set,t=[];for(let n of d.data?.pages??[])if(n.resource!==`dms`)for(let r of n.items)e.has(r.id)||(e.add(r.id),t.push(r));return t},[d.data]),p=Fe({mutationFn:({tweetId:e,text:t})=>ve({kind:`replyTweet`,accountId:c??`acct_primary`,tweetId:e,text:t}),onSuccess:()=>o.invalidateQueries({queryKey:u})});function m(){d.refetch()}function h(){Promise.all([o.invalidateQueries({queryKey:P.timelines}),o.invalidateQueries({queryKey:P.status})])}async function g(e){let t=window.prompt(`Reply text`);t?.trim()&&await p.mutateAsync({tweetId:e,text:t.trim()}).catch(()=>{})}let _=d.error;return{meta:s,items:f,loading:d.isPending,error:_?_ instanceof Error?_.message:n:null,replyError:p.error?p.error instanceof Error?p.error.message:`Reply failed`:null,retry:m,refreshLocalView:h,replyToTweet:g,selectedAccountId:c,hasMore:d.hasNextPage,loadingMore:d.isFetchingNextPage,loadMore:()=>d.fetchNextPage().then(()=>void 0)}}export{xt as a,bt as i,yt as n,vt as o,St as r,Et as t};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
//#region node_modules/.pnpm/@tanstack+react-start@1.168.26_react-dom@19.2.7_react@19.2.7__react@19.2.7_vite@8.0.16__465b94eb4096202468ea7bb8157eb6f6/node_modules/@tanstack/react-start/dist/plugin/default-entry/start.ts
|
|
2
|
-
var startInstance = void 0;
|
|
3
|
-
//#endregion
|
|
4
|
-
export { startInstance };
|