lensmcp 1.24.2 → 1.24.3

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.
@@ -1,118 +1,120 @@
1
- "use strict";var h5=Object.defineProperty;var s=(e,t)=>h5(e,"name",{value:t,configurable:!0});var Wm=Object.defineProperty,o=s((e,t)=>Wm(e,"name",{value:t,configurable:!0}),"a"),ut=s((e,t)=>{for(var r in t)Wm(e,r,{get:t[r],enumerable:!0})},"mt");import"reflect-metadata";import{createHash as g5}from"node:crypto";import{existsSync as Gm,readFileSync as Km,statSync as Hm}from"node:fs";import{createServer as v5}from"node:http";import{basename as y5}from"node:path";var Xm="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function Ym(e,t){let r="",i=e;for(let u=t-1;u>=0;u--){let n=i%32;r=Xm[n]+r,i=(i-n)/32}return r}s(Ym,"OS"),o(Ym,"encodeTime");function Qm(e){let t=new Uint8Array(e);globalThis.crypto.getRandomValues(t);let r="";for(let i=0;i<e;i++)r+=Xm[(t[i]??0)&31];return r}s(Qm,"MS"),o(Qm,"encodeRandom");function lt(e=Date.now()){return Ym(e,10)+Qm(16)}s(lt,"Fe"),o(lt,"ulid");var e4=class{static{s(this,"gr")}static{o(this,"EventBus")}constructor(e={}){this.subs=new Set,this.dropped=0,this.capacity=e.capacity??1e4,this.onDrop=e.onDrop,this.transform=e.transform}publish(e){if(this.subs.size>this.capacity){this.dropped++,this.onDrop?.(1);return}let t=e;if(this.transform)try{t=this.transform(e)??e}catch{t=e}for(let r of this.subs)if(!(r.filter&&!r.filter(t)))try{let i=r.handler(t);i&&typeof i.then=="function"&&i.catch(()=>{})}catch{}}subscribe(e,t){let r={handler:e,filter:t};return this.subs.add(r),()=>{this.subs.delete(r)}}droppedCount(){return this.dropped}subscriberCount(){return this.subs.size}},uu="REDACTED",E5=["token","secret","password","passwd","apikey","credential","assertion","signature"],b5=new Set(["key","auth","authorization","jwt","code","sig","pwd","pass","session","sid","bearer","otp","cookie","set-cookie"]),w5=/^(?:(?:prompt|completion|total|input|output|cache|cached|cacheread|cachewrite|reasoning|thinking|max|min|remaining|used|billed)tokens|tokens?(?:count|used|limit|remaining))$/;function oa(e){let t=e.toLowerCase();if(w5.test(t.replace(/[-_.]+/g,"")))return!1;if(E5.some(r=>t.includes(r)))return!0;for(let r of t.split(/[-_.]+/))if(r&&b5.has(r))return!0;return!1}s(oa,"Wb"),o(oa,"isSecretParam");var D5=/^([a-z][a-z0-9+.-]*:\/\/)[^/?#@\s]*@/i,$5=/([?&#])([^=&#\s]+)=([^&#\s]*)/g;function t4(e){return e&&e.replace(D5,`$1${uu}@`).replace($5,(t,r,i)=>oa(i)?`${r}${i}=${uu}`:t)}s(t4,"LS"),o(t4,"redactUrlParams");var B5=/\beyJ[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{4,}\.[A-Za-z0-9_-]*/g,x5=/\b(bearer|basic)\s+[A-Za-z0-9._~+/=-]{8,}/gi,C5=/\b(authorization|x-api-key|api-key|cookie|set-cookie|proxy-authorization)\b(\s*[:=]\s*)(["']?)((?:(?:bearer|basic)\s+)?[^\s"',;]{4,})\3/gi;function dt(e){return t4(e).replace(C5,(t,r,i,u)=>`${r}${i}${u}${uu}${u}`).replace(B5,uu).replace(x5,(t,r)=>`${r} ${uu}`)}s(dt,"ht"),o(dt,"redactText");function la(e,t){return e.length<=t?e:`${e.slice(0,t)}\u2026[lensmcp truncated: ${e.length-t} more chars]`}s(la,"Xb"),o(la,"clip");function u4(e,t=4096){if(e!==void 0)return la(dt(e),t)}s(u4,"Hb"),o(u4,"safeText");function r4(e){return la(dt(e),300)}s(r4,"Yb"),o(r4,"safeTitle");var k5=6,A5=64,I5=/^TS\d{1,5}$/,_5=o((e,t)=>e==="code"&&typeof t=="string"&&I5.test(t),"isDiagnosticCode");function Vu(e,t=0,r=k5){if(typeof e=="string")return dt(e);if(e===null||typeof e!="object"||t>=r)return e;if(Array.isArray(e)){let n=!1,a=e.map((l,d)=>{if(d>=A5)return l;let c=Vu(l,t+1,r);return c!==l&&(n=!0),c});return n?a:e}let i=!1,u={};for(let[n,a]of Object.entries(e)){let l=oa(n)&&a!==void 0&&a!==null&&!_5(n,a)?uu:Vu(a,t+1,r);l!==a&&(i=!0),u[n]=l}return i?u:e}s(Vu,"yr"),o(Vu,"redactDeep");var S5=12;function da(e={}){let t=e.maxDepth??S5,r=0,i=0;return{redact(u){r+=1;let n=u.title===void 0?void 0:r4(dt(u.title)),a=u.message===void 0?void 0:u4(dt(u.message),4096),l=u.raw===void 0?void 0:Vu(u.raw,0,t),d=n!==u.title,c=a!==u.message,p=l!==u.raw;return!d&&!c&&!p?u:(i+=1,{...u,...n!==void 0?{title:n}:{},...a!==void 0?{message:a}:{},...l!==void 0?{raw:l}:{}})},stats:o(()=>({inspected:r,redacted:i}),"stats"),reset:o(()=>{r=0,i=0},"reset")}}s(da,"oi"),o(da,"createEventRedactor");var i4=class{static{s(this,"br")}static{o(this,"ResourceStore")}constructor(){this.entries=new Map,this.subs=new Map}register(e,t){if(this.entries.has(e))throw new Error(`Resource already registered: ${e}`);return this.entries.set(e,{uri:e,produce:t,revision:0}),()=>{this.entries.delete(e),this.subs.delete(e)}}async read(e){let t=this.entries.get(e);if(!t)throw new Error(`Unknown resource: ${e}`);return t.produce()}list(){return[...this.entries.keys()]}async markDirty(e){let t=this.entries.get(e);if(!t)return;let r=await t.produce(),i=JSON.stringify(r);if(i===t.lastJson)return;t.lastJson=i,t.revision+=1;let u=this.subs.get(e);if(u)for(let n of u)try{n(e,t.revision)}catch{}}revision(e){return this.entries.get(e)?.revision}subscribe(e,t){let r=this.subs.get(e);return r||(r=new Set,this.subs.set(e,r)),r.add(t),()=>{r?.delete(t)}}},n4=class{static{s(this,"wr")}static{o(this,"GraphStore")}constructor(){this.nodes=new Map,this.edges=new Map,this.byParent=new Map,this.byFlow=new Map,this.byLogical=new Map,this.byInstance=new Map,this.byRequest=new Map,this.outByAxis=new Map,this.inByAxis=new Map}addNode(e){this.nodes.set(e.id,e),e.parentTraceNodeId&&this.addToIndex(this.byParent,e.parentTraceNodeId,e.id),e.context.flowId&&this.addToIndex(this.byFlow,e.context.flowId,e.id),e.logicalId&&this.addToIndex(this.byLogical,e.logicalId,e.id),e.instanceId&&this.addToIndex(this.byInstance,e.instanceId,e.id),e.context.requestId&&this.addToIndex(this.byRequest,e.context.requestId,e.id)}updateNode(e,t){let r=this.nodes.get(e);if(!r)throw new Error(`Unknown node: ${e}`);let i={...r,...t,id:r.id};return this.nodes.set(e,i),i}getNode(e){return this.nodes.get(e)}addEdge(e){this.edges.set(e.id,e);let t=this.outByAxis.get(e.axis);t||(t=new Map,this.outByAxis.set(e.axis,t)),this.addToIndex(t,e.from,e.id);let r=this.inByAxis.get(e.axis);r||(r=new Map,this.inByAxis.set(e.axis,r)),this.addToIndex(r,e.to,e.id)}getEdge(e){return this.edges.get(e)}childrenOf(e){return this.materialiseNodes(this.byParent.get(e))}nodesInFlow(e){return this.materialiseNodes(this.byFlow.get(e))}nodesByLogical(e){return this.materialiseNodes(this.byLogical.get(e))}nodesByInstance(e){return this.materialiseNodes(this.byInstance.get(e))}nodesByRequest(e){return this.materialiseNodes(this.byRequest.get(e))}traverse(e){let t=this.nodes.get(e.from);if(!t)return{nodes:[],edges:[]};let r=Array.isArray(e.lens)?e.lens:[e.lens],i=e.direction??"both",u=e.depth??4,n=e.maxNodes??1e3,a=new Set,l=new Set,d=[{id:t.id,d:0}];for(;d.length&&!(a.size>=n);){let{id:c,d:p}=d.shift();if(!a.has(c)&&(a.add(c),!(p>=u)))for(let m of r){if(i==="out"||i==="both"){let f=this.outByAxis.get(m)?.get(c);if(f)for(let h of f){l.add(h);let g=this.edges.get(h);a.has(g.to)||d.push({id:g.to,d:p+1})}}if(i==="in"||i==="both"){let f=this.inByAxis.get(m)?.get(c);if(f)for(let h of f){l.add(h);let g=this.edges.get(h);a.has(g.from)||d.push({id:g.from,d:p+1})}}}}return{nodes:this.materialiseNodes(a),edges:[...l].map(c=>this.edges.get(c)).filter(c=>!!c)}}nodeCount(){return this.nodes.size}edgeCount(){return this.edges.size}addToIndex(e,t,r){let i=e.get(t);i||(i=new Set,e.set(t,i)),i.add(r)}materialiseNodes(e){if(!e)return[];let t=[];for(let r of e){let i=this.nodes.get(r);i&&t.push(i)}return t}};function s4(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")}s(s4,"XS"),o(s4,"fnv1a32");function a4(e){let t=[e.kind,e.identity,e.file??"",e.detail??""];return`${e.kind}:${s4(t.join("|"))}`}s(a4,"Qb"),o(a4,"fingerprint");var F5=class{static{s(this,"ii")}static{o(this,"ReducerRegistry")}constructor(){this.reducers=[]}register(e,t){if(this.reducers.some(r=>r.name===e))throw new Error(`Reducer already registered: ${e}`);this.reducers.push({name:e,reducer:t})}list(){return this.reducers}async dispatch(e){for(let{reducer:t}of this.reducers)try{let r=t(e);r&&typeof r.then=="function"&&await r}catch{}}};function ca(e,t={}){let r,i;if(t.flowId)i=t.flowId,r=e.filter(m=>m.context.flowId===i);else{let m=e.find(f=>f.context.flowId);if(!m)return;i=m.context.flowId,r=e.filter(f=>f.context.flowId===i)}if(r.length===0)return;r.sort((m,f)=>m.timestamp-f.timestamp);let u=1e3;r.length>u&&(r=[r[0],...r.slice(r.length-(u-1))]);let n=r[0],a=[],l,d;for(let m of r){let f=o4(m);if(f){if(a.push(f),f.kind==="render"||f.kind==="final-render"){let h=m.raw;h?.render&&(l={id:h.render.id,page:h.render.page,route:h.render.route,componentName:h.render.componentName})}else if(m.source==="visual"&&f.kind==="visual-violation"){let h=m.raw;h?.frame&&(d=h.frame.id)}}}for(let m=a.length-1;m>=0;m--)if(a[m].kind==="render"){a[m]={...a[m],kind:"final-render"};break}let c=r[0].timestamp,p=r[r.length-1].timestamp;return{flowId:i,origin:{type:n.context.originType,nodeId:n.context.originNodeId,at:n.timestamp},phases:a,finalState:l?{page:l.page,route:l.route,componentName:l.componentName,renderId:l.id,visualFrameId:d}:void 0,startedAt:c,endedAt:p,eventCount:r.length}}s(ca,"si"),o(ca,"compileStory");function o4(e){let t=(e.raw??null)?.kind;if(t==="flow-origin"||e.source==="client-runtime"&&t==="user-action"){let r=e.raw;return{kind:"user-action",at:e.timestamp,label:r?.origin?.label??e.title,eventIds:[e.id]}}if(e.source==="react"&&t==="render"){let r=e.raw;return{kind:"render",at:e.timestamp,label:`render ${r?.render?.componentName??"?"}`,eventIds:[e.id],details:r?.render?{componentName:r.render.componentName,durationMs:r.render.actualDurationMs}:void 0}}if(e.source==="react"&&t==="slot-content-changed"){let r=e.raw,i=r?.slot?.toComponent??"?";return{kind:/spinner|loader|loading/i.test(i)?"loading-ui":"idle-ui",at:e.timestamp,label:`slot ${r?.slot?.slotLogicalId??""} \u2192 ${i}`,eventIds:[e.id]}}if(e.source==="client-runtime"&&t==="route"){let r=e.raw;return{kind:"route-transition",at:e.timestamp,label:`route ${r?.from??""} \u2192 ${r?.url??""}`,eventIds:[e.id]}}if(e.source==="valtio"&&t==="state-update"){let r=e.raw;return{kind:"state-update",at:e.timestamp,label:`${r?.update?.storeId??"?"}.${r?.update?.path??"?"}`,eventIds:[e.id],details:r?.update}}if(e.source==="nestjs"&&t==="server-request"){let r=e.raw;return{kind:"backend-request",at:e.timestamp,label:`${r?.request?.method??"?"} ${r?.request?.route??"?"} \u2192 ${r?.request?.status??"?"}`,eventIds:[e.id],details:r?.request}}if(e.source==="chrome"&&e.category==="network")return{kind:"backend-request",at:e.timestamp,label:e.title,eventIds:[e.id]};if(e.source==="visual"&&t==="visual-violation"){let r=e.raw;return{kind:"visual-violation",at:e.timestamp,label:`${r?.violation?.ruleType??"rule"} ${r?.violation?.ruleId??""}`,eventIds:[e.id]}}}s(o4,"HS"),o(o4,"classifyEvent");var l4={phaseGapMs:1500,burstGapMs:250,attachWindowMs:400,maxSegmentEvents:400,occurrenceSlackMs:10},j5=new Set(["subscription-added","subscription-removed","hook-run","store-created","singleton-instance","visual-frame"]),pa="db-request-account",z5=new Set(["react","valtio","client-runtime","chrome","visual"]),ru=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isObj"),le=o(e=>typeof e=="string"&&e!==""?e:void 0,"str"),De=o(e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,"num");function d4(e){let t=ru(e.raw)?e.raw:{},r=ru(t.request)?t.request:{},i=ru(t.span)?t.span:{},u=e.context??{},n=le(t.kind)??"",a=n===pa,l=(a?De(t.lastEndedAt):void 0)??De(e.timestamp)??0,d=De(r.startedAt)??De(i.startTime)??De(t.startedAt)??(a?De(t.firstStartedAt):void 0),c=De(r.endedAt)??De(i.endTime)??(d!==void 0&&De(t.durationMs)!==void 0?d+t.durationMs:void 0),p=Math.min(l,d??l),m=Math.max(l,c??l),f=ru(t.render)?t.render:{},h=ru(t.update)?t.update:{},g=n==="render"?le(f.componentName):n==="state-update"?le(h.path)?.split(".").slice(0,2).join("."):void 0,E=le(t.queue),x=le(t.jobId),$=String(e.source),w=le(t.project)??le(u.projectName);return{event:e,id:e.id,ts:l,from:p,to:m,kind:n,source:$,...le(u.requestId)?{requestId:le(u.requestId)}:{},...le(u.parentRequestId)?{parentRequestId:le(u.parentRequestId)}:{},...E&&x?{queueKey:`${E}#${x}`}:{},browser:z5.has($)||$==="memory"&&w===void 0,bookkeeping:j5.has(n),...w?{project:w}:{},...g?{subject:g}:{},...n==="fetch-start"||n==="fetch-done"?{route:ma(le(t.url)),method:le(t.method)}:n==="server-request"?{route:le(r.route),method:le(r.method)}:n==="gateway-request"?{route:ma(le(t.url)),method:le(t.method)}:{}}}s(d4,"eI"),o(d4,"readItem");function ma(e){if(!e)return;let t=e.search(/[?#]/),r=t===-1?e:e.slice(0,t),i=/^[a-z][a-z0-9+.-]*:\/\/[^/]*(\/.*)?$/i.exec(r);return i?i[1]??"/":r}s(ma,"ew"),o(ma,"pathOnly");var N5=o(e=>e.split(".")[0],"rootOf"),c4=o((e,t)=>e.reduce((r,i)=>Math.min(r,t(i)),1/0),"minOf"),p4=o((e,t)=>e.reduce((r,i)=>Math.max(r,t(i)),-1/0),"maxOf"),fa=o((e,t)=>e.ts-t.ts||(e.id<t.id?-1:e.id>t.id?1:0),"compare"),ha=o(e=>e.requestId&&!e.requestId.startsWith("job:")?N5(e.requestId):void 0,"directFamilyOf");function m4(e){if(e.requestId?.startsWith("job:"))return e.requestId.slice(4);if(e.queueKey&&e.kind!=="queue-enqueued"&&!e.requestId)return e.queueKey}s(m4,"rI"),o(m4,"jobKeyOf");function f4(e,t){let r=e.filter(n=>!n.parentRequestId&&(n.kind==="server-request"||n.kind==="gateway-request"||n.kind==="fetch-start"||n.kind==="fetch-done")).sort((n,a)=>n.from-a.from||fa(n,a));if(r.length<2)return[e];let i=[];for(let n of r){let a=i[i.length-1];a&&n.from<=a.to+t?a.to=Math.max(a.to,n.to):i.push({from:n.from,to:n.to})}if(i.length<2)return[e];let u=i.map(()=>[]);for(let n of e){let a=i.findIndex(l=>n.ts>=l.from-t&&n.ts<=l.to+t);if(a===-1){a=0;for(let l=0;l<i.length;l+=1)i[l].from<=n.ts&&(a=l)}u[a].push(n)}return u.filter(n=>n.length>0)}s(f4,"nI"),o(f4,"occurrencesOf");var h4={debug:0,info:1,warning:2,error:3,fatal:4};function ga(e,t){let r=[],i=[];for(let u of e){let n=i[i.length-1];n&&u.ts-n.ts>=t&&(r.push(i),i=[]),i.push(u)}return i.length&&r.push(i),r}s(ga,"rw"),o(ga,"runs");function g4(e,t={}){let r={...l4};for(let[w,k]of Object.entries(t))typeof k=="number"&&Number.isFinite(k)&&(r[w]=k);let i=new Set,u=[];for(let w of e)i.has(w.id)||(i.add(w.id),u.push(d4(w)));u.sort(fa);let n=le(u[0]?.event.context?.flowId)??le(u[0]?.event.raw?.flowId)??"",a=new Map;for(let w of u)w.kind==="queue-enqueued"&&w.queueKey&&w.requestId&&!w.requestId.startsWith("job:")&&!a.has(w.queueKey)&&a.set(w.queueKey,w);let l=new Map,d=new Map,c=[];for(let w of u){let k=m4(w),C=ha(w);if(k!==void 0){let M=d.get(k);M?M.push(w):d.set(k,[w])}else if(C!==void 0){let M=l.get(C);M?M.push(w):l.set(C,[w])}else c.push(w)}let p=[],m=new Map;for(let[w,k]of l)f4(k,r.occurrenceSlackMs).forEach((C,M)=>{let y={id:`${n}~r:${w}${M===0?"":`@${M+1}`}`,kind:"request",items:C,requestId:w};p.push(y);for(let D of C)m.set(D,y)});for(let[w,k]of d){let C=a.get(w),M=C?m.get(C):void 0;M?M.items.push(...k):p.push({id:`${n}~r:job:${w}`,kind:"request",items:k,requestId:`job:${w}`})}let f=u.filter(w=>w.kind==="fetch-done"&&ha(w)!==void 0),h=new Map;for(let w of p)w.requestId&&h.set(w.requestId,[...h.get(w.requestId)??[],w]);let g=o((w,k)=>{let C=h.get(w);if(C)return C.find(M=>M.items.some(y=>y.kind==="fetch-done"&&y.ts===k))??C[C.length-1]},"owningUnit"),E=c.filter(w=>w.browser);for(let w of ga(E,r.burstGapMs)){let k=w[0].ts,C=f.filter(D=>D.ts<=k&&k-D.ts<=r.attachWindowMs),M=[...new Set(C.map(D=>ha(D)))];if(M.length===1){let D=g(M[0],C[C.length-1].ts);if(D){D.items.push(...w);continue}}let y=w.some(D=>D.kind==="flow-origin");p.push({id:`${n}~${y?"o":"u"}:${w[0].id}`,kind:y?"origin":"ui",items:w,...M.length>1?{after:M.sort()}:{}})}for(let w of ga(c.filter(k=>!k.browser),r.phaseGapMs))p.push({id:`${n}~a:${w[0].id}`,kind:"ambient",items:w});let x=v4(n,u.length,p,r),$=ki(u.map(w=>w.event));return $?{...x,sql:$}:x}s(g4,"sw"),o(g4,"segmentFlow");function v4(e,t,r,i){for(let f of r)f.items.sort(fa);let u=r.map(f=>({unit:f,from:c4(f.items,h=>h.from),to:p4(f.items,h=>h.to)}));u.sort((f,h)=>f.from-h.from||(f.unit.id<h.unit.id?-1:1));let n=new Map,a=0,l=-1/0;for(let f of u)(a===0||f.from-l>=i.phaseGapMs)&&(a+=1),l=Math.max(l,f.to),n.set(f.unit,a);let d=[];for(let f of u){let h=y4(f.unit.items,i.maxSegmentEvents),g=f.unit.kind==="request"?ki(f.unit.items.map(E=>E.event)):void 0;h.forEach((E,x)=>{let $=E4(e,f.unit,E,n.get(f.unit),h.length>1?{index:x+1,total:h.length}:void 0);d.push(g&&x===0?{...$,sql:g}:$)})}let c={};for(let f of d)for(let h of f.eventIds)c[h]=f.id;let p=[];for(let f of d){let h=p[f.phase-1];h||(h={index:f.phase,start:f.start,end:f.end,segmentIds:[]},p[f.phase-1]=h),h.start=Math.min(h.start,f.start),h.end=Math.max(h.end,f.end),h.segmentIds.push(f.id)}let m=d.reduce((f,h)=>f+h.counts.signal,0);return{flowId:e,segments:d,phases:p.filter(Boolean),assignment:c,stats:{events:t,signal:m,bookkeeping:t-m,segments:d.length,phases:p.filter(Boolean).length,largestSegment:d.reduce((f,h)=>Math.max(f,h.counts.total),0)}}}s(v4,"oI"),o(v4,"assemble");function y4(e,t){if(e.filter(n=>!n.bookkeeping).length<=t)return[e];let r=[],i=[],u=0;for(let n of e)!n.bookkeeping&&u===t&&(r.push(i),i=[],u=0),i.push(n),n.bookkeeping||(u+=1);return i.length&&r.push(i),r}s(y4,"iI"),o(y4,"chunk");function E4(e,t,r,i,u){let n={total:r.length,signal:0,bookkeeping:0,errors:0,warnings:0},a=new Set,l="debug";for(let h of r){h.bookkeeping?n.bookkeeping+=1:n.signal+=1;let g=String(h.event.severity);g==="error"||g==="fatal"?n.errors+=1:g==="warning"&&(n.warnings+=1),(h4[g]??1)>(h4[l]??0)&&(l=g),h.project&&a.add(h.project)}let d=t.kind==="ui"||t.kind==="origin"?w4(r):[],c=c4(r,h=>h.from),p=p4(r,h=>h.to),m=b4(t.items),f=t.id;return{id:u&&u.index>1?`${f}#${u.index}`:f,flowId:e,kind:t.kind,label:D4(t,r,m,u,d),phase:i,start:c,end:p,durationMs:p-c,eventIds:r.map(h=>h.id),counts:n,projects:[...a].sort(),...m.route?{route:m.route}:{},...m.method?{method:m.method}:{},...t.requestId?{requestId:t.requestId}:{},...t.after?{after:t.after}:{},...d.length?{hot:d}:{},...u?{part:u}:{},worstSeverity:l}}s(E4,"sI"),o(E4,"toSegment");function b4(e){let t=e.find(r=>r.kind==="fetch-start"&&r.route)??e.find(r=>r.kind==="server-request"&&!r.parentRequestId&&r.route)??e.find(r=>r.kind==="gateway-request"&&r.route)??e.find(r=>r.kind==="fetch-done"&&r.route);return{...t?.route?{route:t.route}:{},...t?.method?{method:t.method.toUpperCase()}:{}}}s(b4,"aI"),o(b4,"routeOf");function w4(e){let t=new Map;for(let r of e)r.subject&&!r.bookkeeping&&t.set(r.subject,(t.get(r.subject)??0)+1);return[...t.entries()].sort((r,i)=>i[1]-r[1]||(r[0]<i[0]?-1:1)).slice(0,3).map(([r,i])=>i>1?`${r} \xD7${i}`:r)}s(w4,"cI"),o(w4,"hotOf");function D4(e,t,r,i,u){let n=i?` (part ${i.index}/${i.total})`:"";if(e.kind==="request"){if(r.route)return`${r.method?`${r.method} `:""}${r.route}${n}`;let a=t.find(l=>l.queueKey);return a?`job ${a.queueKey}${n}`:`request ${e.requestId??""}${n}`}return e.kind==="origin"?`${t.find(a=>a.kind==="flow-origin")?.event.title||"start"}${u.length?` \xB7 ${u.join(", ")}`:""}${n}`:e.kind==="ui"?`UI update${u.length?` \xB7 ${u.join(", ")}`:""}${n}`:`background${n}`}s(D4,"uI"),o(D4,"labelOf");var $4=50;function ki(e){let t=new Map,r=new Map,i=new Set;for(let g of e){if(i.has(g.id))continue;i.add(g.id);let E=ru(g.raw)?g.raw:{},x=le(E.kind),$=le(g.context?.requestId);if(!$)continue;let w=le(E.project)??le(g.context?.projectName);if(x==="db-query"&&g.source==="db"){let k=r.get($)??{count:0,workMs:0,...w?{project:w}:{}};k.count+=1,k.workMs+=De(E.durationMs)??0,r.set($,k)}else if(x===pa){let k=le(E.accountId)??g.id,C=De(E.seq)??0,M=t.get(k);if(M&&M.seq>=C)continue;t.set(k,{requestId:$,...w?{project:w}:{},seq:C,basis:E.basis==="end"?"end":"settled",statements:De(E.statements)??0,failed:De(E.failed)??0,workMs:De(E.workMs)??0,recorded:De(E.recorded)??0,suppressed:De(E.suppressed)??0,unwritten:De(E.unwritten)??0})}}let u=new Map;for(let g of t.values()){let E=u.get(g.requestId);if(!E){u.set(g.requestId,{...g});continue}g.basis==="settled"&&(E.basis="settled"),E.statements+=g.statements,E.failed+=g.failed,E.workMs+=g.workMs,E.recorded+=g.recorded,E.suppressed+=g.suppressed,E.unwritten+=g.unwritten}let n=[...new Set([...r.keys(),...u.keys()])].sort();if(n.length===0)return;let a={statements:0,failed:0,workMs:0,recorded:0,suppressed:0,unwritten:0},l={statements:0,workMs:0},d=[];for(let g of n){let E=r.get(g),x=u.get(g),$=E?.count??0;l.statements+=$,l.workMs+=E?.workMs??0;let w=!x||$>x.statements?"unverified":$===x.statements?"complete":"incomplete";x&&w!=="unverified"&&(a.statements+=x.statements,a.failed+=x.failed,a.workMs+=x.workMs,a.recorded+=x.recorded,a.suppressed+=x.suppressed,a.unwritten+=x.unwritten);let k=E?.project??x?.project;d.push({requestId:g,...k?{project:k}:{},status:w,observed:$,observedWorkMs:E?.workMs??0,...x?{basis:x.basis,statements:x.statements,failed:x.failed,workMs:x.workMs,recorded:x.recorded,suppressed:x.suppressed,unwritten:x.unwritten}:{}})}let c=o(g=>d.filter(E=>E.status===g).length,"tally"),p=c("unverified"),m=c("incomplete"),f=o(g=>(g.statements??0)-g.observed,"missing"),h=d.filter(g=>g.status!=="complete").sort((g,E)=>(g.status==="incomplete"?0:1)-(E.status==="incomplete"?0:1)||f(E)-f(g)||(g.requestId<E.requestId?-1:g.requestId>E.requestId?1:0));return{status:p>0?"unverified":m>0?"incomplete":"complete",requests:d.length,complete:c("complete"),incomplete:m,unverified:p,settled:d.filter(g=>g.status!=="unverified"&&g.basis==="settled").length,observed:l,accounted:a,gaps:h.slice(0,$4),gapsTruncated:h.length>$4}}s(ki,"ci"),o(ki,"sqlAccountingOf");var v={};ut(v,{$brand:s(()=>k4,"$brand"),$input:s(()=>ov,"$input"),$output:s(()=>av,"$output"),NEVER:s(()=>C4,"NEVER"),TimePrecision:s(()=>dv,"TimePrecision"),ZodAny:s(()=>ml,"ZodAny"),ZodArray:s(()=>bl,"ZodArray"),ZodBase64:s(()=>$n,"ZodBase64"),ZodBase64URL:s(()=>Bn,"ZodBase64URL"),ZodBigInt:s(()=>_r,"ZodBigInt"),ZodBigIntFormat:s(()=>In,"ZodBigIntFormat"),ZodBoolean:s(()=>Ir,"ZodBoolean"),ZodCIDRv4:s(()=>wn,"ZodCIDRv4"),ZodCIDRv6:s(()=>Dn,"ZodCIDRv6"),ZodCUID:s(()=>fn,"ZodCUID"),ZodCUID2:s(()=>hn,"ZodCUID2"),ZodCatch:s(()=>Hl,"ZodCatch"),ZodCodec:s(()=>Tr,"ZodCodec"),ZodCustom:s(()=>Ur,"ZodCustom"),ZodCustomStringFormat:s(()=>hu,"ZodCustomStringFormat"),ZodDate:s(()=>Sn,"ZodDate"),ZodDefault:s(()=>Jl,"ZodDefault"),ZodDiscriminatedUnion:s(()=>kl,"ZodDiscriminatedUnion"),ZodE164:s(()=>xn,"ZodE164"),ZodEmail:s(()=>cn,"ZodEmail"),ZodEmoji:s(()=>pn,"ZodEmoji"),ZodEnum:s(()=>yu,"ZodEnum"),ZodError:s(()=>yD,"ZodError"),ZodExactOptional:s(()=>Zl,"ZodExactOptional"),ZodFile:s(()=>Pl,"ZodFile"),ZodFirstPartyTypeKind:s(()=>fd,"ZodFirstPartyTypeKind"),ZodFunction:s(()=>od,"ZodFunction"),ZodGUID:s(()=>xr,"ZodGUID"),ZodIPv4:s(()=>En,"ZodIPv4"),ZodIPv6:s(()=>bn,"ZodIPv6"),ZodISODate:s(()=>b0,"ZodISODate"),ZodISODateTime:s(()=>y0,"ZodISODateTime"),ZodISODuration:s(()=>B0,"ZodISODuration"),ZodISOTime:s(()=>D0,"ZodISOTime"),ZodIntersection:s(()=>Il,"ZodIntersection"),ZodIssueCode:s(()=>ED,"ZodIssueCode"),ZodJWT:s(()=>Cn,"ZodJWT"),ZodKSUID:s(()=>yn,"ZodKSUID"),ZodLazy:s(()=>nd,"ZodLazy"),ZodLiteral:s(()=>Rl,"ZodLiteral"),ZodMAC:s(()=>q0,"ZodMAC"),ZodMap:s(()=>jl,"ZodMap"),ZodNaN:s(()=>Xl,"ZodNaN"),ZodNanoID:s(()=>mn,"ZodNanoID"),ZodNever:s(()=>gl,"ZodNever"),ZodNonOptional:s(()=>Tn,"ZodNonOptional"),ZodNull:s(()=>pl,"ZodNull"),ZodNullable:s(()=>Ll,"ZodNullable"),ZodNumber:s(()=>kr,"ZodNumber"),ZodNumberFormat:s(()=>Ut,"ZodNumberFormat"),ZodObject:s(()=>Fr,"ZodObject"),ZodOptional:s(()=>Nn,"ZodOptional"),ZodPipe:s(()=>Or,"ZodPipe"),ZodPrefault:s(()=>Wl,"ZodPrefault"),ZodPreprocess:s(()=>td,"ZodPreprocess"),ZodPromise:s(()=>sd,"ZodPromise"),ZodReadonly:s(()=>ud,"ZodReadonly"),ZodRealError:s(()=>Ne,"ZodRealError"),ZodRecord:s(()=>vu,"ZodRecord"),ZodSet:s(()=>Nl,"ZodSet"),ZodString:s(()=>Br,"ZodString"),ZodStringFormat:s(()=>ae,"ZodStringFormat"),ZodSuccess:s(()=>Gl,"ZodSuccess"),ZodSymbol:s(()=>ol,"ZodSymbol"),ZodTemplateLiteral:s(()=>rd,"ZodTemplateLiteral"),ZodTransform:s(()=>ql,"ZodTransform"),ZodTuple:s(()=>_l,"ZodTuple"),ZodType:s(()=>Q,"ZodType"),ZodULID:s(()=>gn,"ZodULID"),ZodURL:s(()=>Cr,"ZodURL"),ZodUUID:s(()=>He,"ZodUUID"),ZodUndefined:s(()=>dl,"ZodUndefined"),ZodUnion:s(()=>jr,"ZodUnion"),ZodUnknown:s(()=>hl,"ZodUnknown"),ZodVoid:s(()=>vl,"ZodVoid"),ZodXID:s(()=>vn,"ZodXID"),ZodXor:s(()=>xl,"ZodXor"),_ZodString:s(()=>dn,"_ZodString"),_default:s(()=>On,"_default"),_function:s(()=>Pr,"_function"),any:s(()=>fl,"any"),array:s(()=>gu,"array"),base64:s(()=>W0,"base64"),base64url:s(()=>G0,"base64url"),bigint:s(()=>nl,"bigint"),boolean:s(()=>An,"boolean"),catch:s(()=>Un,"catch"),check:s(()=>ld,"check"),cidrv4:s(()=>V0,"cidrv4"),cidrv6:s(()=>J0,"cidrv6"),clone:s(()=>Se,"clone"),codec:s(()=>Ql,"codec"),coerce:s(()=>q1,"coerce"),config:s(()=>be,"config"),core:s(()=>B4,"core"),cuid:s(()=>M0,"cuid"),cuid2:s(()=>O0,"cuid2"),custom:s(()=>dd,"custom"),date:s(()=>El,"date"),decode:s(()=>C1,"decode"),decodeAsync:s(()=>A1,"decodeAsync"),describe:s(()=>z1,"describe"),discriminatedUnion:s(()=>Al,"discriminatedUnion"),e164:s(()=>K0,"e164"),email:s(()=>C0,"email"),emoji:s(()=>z0,"emoji"),encode:s(()=>x1,"encode"),encodeAsync:s(()=>k1,"encodeAsync"),endsWith:s(()=>gr,"endsWith"),enum:s(()=>Nr,"enum"),exactOptional:s(()=>Mn,"exactOptional"),file:s(()=>Ul,"file"),flattenError:s(()=>Fi,"flattenError"),float32:s(()=>tl,"float32"),float64:s(()=>ul,"float64"),formatError:s(()=>ji,"formatError"),fromJSONSchema:s(()=>U1,"fromJSONSchema"),function:s(()=>Pr,"function"),getErrorMap:s(()=>R1,"getErrorMap"),globalRegistry:s(()=>Re,"globalRegistry"),gt:s(()=>nt,"gt"),gte:s(()=>Ce,"gte"),guid:s(()=>k0,"guid"),hash:s(()=>el,"hash"),hex:s(()=>Q0,"hex"),hostname:s(()=>Y0,"hostname"),httpUrl:s(()=>j0,"httpUrl"),includes:s(()=>fr,"includes"),instanceof:s(()=>cd,"instanceof"),int:s(()=>Ar,"int"),int32:s(()=>rl,"int32"),int64:s(()=>sl,"int64"),intersection:s(()=>Fn,"intersection"),invertCodec:s(()=>ed,"invertCodec"),ipv4:s(()=>U0,"ipv4"),ipv6:s(()=>L0,"ipv6"),iso:s(()=>v0,"iso"),json:s(()=>pd,"json"),jwt:s(()=>H0,"jwt"),keyof:s(()=>wl,"keyof"),ksuid:s(()=>P0,"ksuid"),lazy:s(()=>Zn,"lazy"),length:s(()=>cu,"length"),literal:s(()=>Tl,"literal"),locales:s(()=>bo,"locales"),looseObject:s(()=>Bl,"looseObject"),looseRecord:s(()=>Fl,"looseRecord"),lowercase:s(()=>pr,"lowercase"),lt:s(()=>it,"lt"),lte:s(()=>ze,"lte"),mac:s(()=>Z0,"mac"),map:s(()=>zl,"map"),maxLength:s(()=>du,"maxLength"),maxSize:s(()=>Ot,"maxSize"),meta:s(()=>N1,"meta"),mime:s(()=>vr,"mime"),minLength:s(()=>ht,"minLength"),minSize:s(()=>st,"minSize"),multipleOf:s(()=>Mt,"multipleOf"),nan:s(()=>Yl,"nan"),nanoid:s(()=>N0,"nanoid"),nativeEnum:s(()=>Ol,"nativeEnum"),negative:s(()=>sn,"negative"),never:s(()=>Sr,"never"),nonnegative:s(()=>on,"nonnegative"),nonoptional:s(()=>Pn,"nonoptional"),nonpositive:s(()=>an,"nonpositive"),normalize:s(()=>yr,"normalize"),null:s(()=>_n,"null"),nullable:s(()=>bu,"nullable"),nullish:s(()=>Vl,"nullish"),number:s(()=>kn,"number"),object:s(()=>Dl,"object"),optional:s(()=>Eu,"optional"),overwrite:s(()=>Ke,"overwrite"),parse:s(()=>w1,"parse"),parseAsync:s(()=>D1,"parseAsync"),partialRecord:s(()=>Sl,"partialRecord"),pipe:s(()=>Rr,"pipe"),positive:s(()=>nn,"positive"),prefault:s(()=>Rn,"prefault"),preprocess:s(()=>md,"preprocess"),prettifyError:s(()=>Aa,"prettifyError"),promise:s(()=>ad,"promise"),property:s(()=>ln,"property"),readonly:s(()=>qn,"readonly"),record:s(()=>zn,"record"),refine:s(()=>Ln,"refine"),regex:s(()=>cr,"regex"),regexes:s(()=>ft,"regexes"),registry:s(()=>Oi,"registry"),safeDecode:s(()=>_1,"safeDecode"),safeDecodeAsync:s(()=>F1,"safeDecodeAsync"),safeEncode:s(()=>I1,"safeEncode"),safeEncodeAsync:s(()=>S1,"safeEncodeAsync"),safeParse:s(()=>$1,"safeParse"),safeParseAsync:s(()=>B1,"safeParseAsync"),set:s(()=>Ml,"set"),setErrorMap:s(()=>O1,"setErrorMap"),size:s(()=>lu,"size"),slugify:s(()=>Dr,"slugify"),startsWith:s(()=>hr,"startsWith"),strictObject:s(()=>$l,"strictObject"),string:s(()=>fu,"string"),stringFormat:s(()=>X0,"stringFormat"),stringbool:s(()=>M1,"stringbool"),success:s(()=>Kl,"success"),superRefine:s(()=>Vn,"superRefine"),symbol:s(()=>ll,"symbol"),templateLiteral:s(()=>id,"templateLiteral"),toJSONSchema:s(()=>g0,"toJSONSchema"),toLowerCase:s(()=>br,"toLowerCase"),toUpperCase:s(()=>wr,"toUpperCase"),transform:s(()=>Mr,"transform"),treeifyError:s(()=>Ca,"treeifyError"),trim:s(()=>Er,"trim"),tuple:s(()=>jn,"tuple"),uint32:s(()=>il,"uint32"),uint64:s(()=>al,"uint64"),ulid:s(()=>R0,"ulid"),undefined:s(()=>cl,"undefined"),union:s(()=>zr,"union"),unknown:s(()=>gt,"unknown"),uppercase:s(()=>mr,"uppercase"),url:s(()=>F0,"url"),util:s(()=>te,"util"),uuid:s(()=>A0,"uuid"),uuidv4:s(()=>I0,"uuidv4"),uuidv6:s(()=>_0,"uuidv6"),uuidv7:s(()=>S0,"uuidv7"),void:s(()=>yl,"void"),xid:s(()=>T0,"xid"),xor:s(()=>Cl,"xor")});var B4={};ut(B4,{$ZodAny:s(()=>Fh,"$ZodAny"),$ZodArray:s(()=>Oh,"$ZodArray"),$ZodAsyncError:s(()=>jt,"$ZodAsyncError"),$ZodBase64:s(()=>Dh,"$ZodBase64"),$ZodBase64URL:s(()=>$h,"$ZodBase64URL"),$ZodBigInt:s(()=>Ya,"$ZodBigInt"),$ZodBigIntFormat:s(()=>Ah,"$ZodBigIntFormat"),$ZodBoolean:s(()=>Xa,"$ZodBoolean"),$ZodCIDRv4:s(()=>bh,"$ZodCIDRv4"),$ZodCIDRv6:s(()=>wh,"$ZodCIDRv6"),$ZodCUID:s(()=>oh,"$ZodCUID"),$ZodCUID2:s(()=>lh,"$ZodCUID2"),$ZodCatch:s(()=>ug,"$ZodCatch"),$ZodCheck:s(()=>de,"$ZodCheck"),$ZodCheckBigIntFormat:s(()=>Rf,"$ZodCheckBigIntFormat"),$ZodCheckEndsWith:s(()=>Hf,"$ZodCheckEndsWith"),$ZodCheckGreaterThan:s(()=>Ja,"$ZodCheckGreaterThan"),$ZodCheckIncludes:s(()=>Gf,"$ZodCheckIncludes"),$ZodCheckLengthEquals:s(()=>Lf,"$ZodCheckLengthEquals"),$ZodCheckLessThan:s(()=>Va,"$ZodCheckLessThan"),$ZodCheckLowerCase:s(()=>Jf,"$ZodCheckLowerCase"),$ZodCheckMaxLength:s(()=>qf,"$ZodCheckMaxLength"),$ZodCheckMaxSize:s(()=>Tf,"$ZodCheckMaxSize"),$ZodCheckMimeType:s(()=>Yf,"$ZodCheckMimeType"),$ZodCheckMinLength:s(()=>Zf,"$ZodCheckMinLength"),$ZodCheckMinSize:s(()=>Pf,"$ZodCheckMinSize"),$ZodCheckMultipleOf:s(()=>Mf,"$ZodCheckMultipleOf"),$ZodCheckNumberFormat:s(()=>Of,"$ZodCheckNumberFormat"),$ZodCheckOverwrite:s(()=>Qf,"$ZodCheckOverwrite"),$ZodCheckProperty:s(()=>Xf,"$ZodCheckProperty"),$ZodCheckRegex:s(()=>Vf,"$ZodCheckRegex"),$ZodCheckSizeEquals:s(()=>Uf,"$ZodCheckSizeEquals"),$ZodCheckStartsWith:s(()=>Kf,"$ZodCheckStartsWith"),$ZodCheckStringFormat:s(()=>ur,"$ZodCheckStringFormat"),$ZodCheckUpperCase:s(()=>Wf,"$ZodCheckUpperCase"),$ZodCodec:s(()=>vo,"$ZodCodec"),$ZodCustom:s(()=>dg,"$ZodCustom"),$ZodCustomStringFormat:s(()=>Ch,"$ZodCustomStringFormat"),$ZodDate:s(()=>Mh,"$ZodDate"),$ZodDefault:s(()=>Yh,"$ZodDefault"),$ZodDiscriminatedUnion:s(()=>Uh,"$ZodDiscriminatedUnion"),$ZodE164:s(()=>Bh,"$ZodE164"),$ZodEmail:s(()=>ih,"$ZodEmail"),$ZodEmoji:s(()=>sh,"$ZodEmoji"),$ZodEncodeError:s(()=>Ai,"$ZodEncodeError"),$ZodEnum:s(()=>Jh,"$ZodEnum"),$ZodError:s(()=>xa,"$ZodError"),$ZodExactOptional:s(()=>Hh,"$ZodExactOptional"),$ZodFile:s(()=>Gh,"$ZodFile"),$ZodFunction:s(()=>ag,"$ZodFunction"),$ZodGUID:s(()=>uh,"$ZodGUID"),$ZodIPv4:s(()=>vh,"$ZodIPv4"),$ZodIPv6:s(()=>yh,"$ZodIPv6"),$ZodISODate:s(()=>fh,"$ZodISODate"),$ZodISODateTime:s(()=>mh,"$ZodISODateTime"),$ZodISODuration:s(()=>gh,"$ZodISODuration"),$ZodISOTime:s(()=>hh,"$ZodISOTime"),$ZodIntersection:s(()=>qh,"$ZodIntersection"),$ZodJWT:s(()=>xh,"$ZodJWT"),$ZodKSUID:s(()=>ph,"$ZodKSUID"),$ZodLazy:s(()=>lg,"$ZodLazy"),$ZodLiteral:s(()=>Wh,"$ZodLiteral"),$ZodMAC:s(()=>Eh,"$ZodMAC"),$ZodMap:s(()=>Lh,"$ZodMap"),$ZodNaN:s(()=>rg,"$ZodNaN"),$ZodNanoID:s(()=>ah,"$ZodNanoID"),$ZodNever:s(()=>zh,"$ZodNever"),$ZodNonOptional:s(()=>eg,"$ZodNonOptional"),$ZodNull:s(()=>Sh,"$ZodNull"),$ZodNullable:s(()=>Xh,"$ZodNullable"),$ZodNumber:s(()=>Ha,"$ZodNumber"),$ZodNumberFormat:s(()=>kh,"$ZodNumberFormat"),$ZodObject:s(()=>Rh,"$ZodObject"),$ZodObjectJIT:s(()=>Th,"$ZodObjectJIT"),$ZodOptional:s(()=>mo,"$ZodOptional"),$ZodPipe:s(()=>go,"$ZodPipe"),$ZodPrefault:s(()=>Qh,"$ZodPrefault"),$ZodPreprocess:s(()=>ig,"$ZodPreprocess"),$ZodPromise:s(()=>og,"$ZodPromise"),$ZodReadonly:s(()=>ng,"$ZodReadonly"),$ZodRealError:s(()=>je,"$ZodRealError"),$ZodRecord:s(()=>Zh,"$ZodRecord"),$ZodRegistry:s(()=>lv,"$ZodRegistry"),$ZodSet:s(()=>Vh,"$ZodSet"),$ZodString:s(()=>rr,"$ZodString"),$ZodStringFormat:s(()=>se,"$ZodStringFormat"),$ZodSuccess:s(()=>tg,"$ZodSuccess"),$ZodSymbol:s(()=>Ih,"$ZodSymbol"),$ZodTemplateLiteral:s(()=>sg,"$ZodTemplateLiteral"),$ZodTransform:s(()=>Kh,"$ZodTransform"),$ZodTuple:s(()=>no,"$ZodTuple"),$ZodType:s(()=>X,"$ZodType"),$ZodULID:s(()=>dh,"$ZodULID"),$ZodURL:s(()=>nh,"$ZodURL"),$ZodUUID:s(()=>rh,"$ZodUUID"),$ZodUndefined:s(()=>_h,"$ZodUndefined"),$ZodUnion:s(()=>Ni,"$ZodUnion"),$ZodUnknown:s(()=>jh,"$ZodUnknown"),$ZodVoid:s(()=>Nh,"$ZodVoid"),$ZodXID:s(()=>ch,"$ZodXID"),$ZodXor:s(()=>Ph,"$ZodXor"),$brand:s(()=>k4,"$brand"),$constructor:s(()=>B,"$constructor"),$input:s(()=>ov,"$input"),$output:s(()=>av,"$output"),Doc:s(()=>eh,"Doc"),JSONSchema:s(()=>vD,"JSONSchema"),JSONSchemaGenerator:s(()=>gD,"JSONSchemaGenerator"),NEVER:s(()=>C4,"NEVER"),TimePrecision:s(()=>dv,"TimePrecision"),_any:s(()=>Xo,"_any"),_array:s(()=>i0,"_array"),_base64:s(()=>en,"_base64"),_base64url:s(()=>tn,"_base64url"),_bigint:s(()=>Lo,"_bigint"),_boolean:s(()=>qo,"_boolean"),_catch:s(()=>Av,"_catch"),_check:s(()=>l0,"_check"),_cidrv4:s(()=>Yi,"_cidrv4"),_cidrv6:s(()=>Qi,"_cidrv6"),_coercedBigint:s(()=>Vo,"_coercedBigint"),_coercedBoolean:s(()=>Zo,"_coercedBoolean"),_coercedDate:s(()=>u0,"_coercedDate"),_coercedNumber:s(()=>Mo,"_coercedNumber"),_coercedString:s(()=>Io,"_coercedString"),_cuid:s(()=>Vi,"_cuid"),_cuid2:s(()=>Ji,"_cuid2"),_custom:s(()=>s0,"_custom"),_date:s(()=>t0,"_date"),_decode:s(()=>Fa,"_decode"),_decodeAsync:s(()=>za,"_decodeAsync"),_default:s(()=>xv,"_default"),_discriminatedUnion:s(()=>mv,"_discriminatedUnion"),_e164:s(()=>un,"_e164"),_email:s(()=>Ri,"_email"),_emoji:s(()=>Zi,"_emoji"),_encode:s(()=>Sa,"_encode"),_encodeAsync:s(()=>ja,"_encodeAsync"),_endsWith:s(()=>gr,"_endsWith"),_enum:s(()=>Ev,"_enum"),_file:s(()=>n0,"_file"),_float32:s(()=>Ro,"_float32"),_float64:s(()=>To,"_float64"),_gt:s(()=>nt,"_gt"),_gte:s(()=>Ce,"_gte"),_guid:s(()=>lr,"_guid"),_includes:s(()=>fr,"_includes"),_int:s(()=>Oo,"_int"),_int32:s(()=>Po,"_int32"),_int64:s(()=>Jo,"_int64"),_intersection:s(()=>fv,"_intersection"),_ipv4:s(()=>Hi,"_ipv4"),_ipv6:s(()=>Xi,"_ipv6"),_isoDate:s(()=>Fo,"_isoDate"),_isoDateTime:s(()=>So,"_isoDateTime"),_isoDuration:s(()=>zo,"_isoDuration"),_isoTime:s(()=>jo,"_isoTime"),_jwt:s(()=>rn,"_jwt"),_ksuid:s(()=>Ki,"_ksuid"),_lazy:s(()=>Fv,"_lazy"),_length:s(()=>cu,"_length"),_literal:s(()=>wv,"_literal"),_lowercase:s(()=>pr,"_lowercase"),_lt:s(()=>it,"_lt"),_lte:s(()=>ze,"_lte"),_mac:s(()=>_o,"_mac"),_map:s(()=>vv,"_map"),_max:s(()=>ze,"_max"),_maxLength:s(()=>du,"_maxLength"),_maxSize:s(()=>Ot,"_maxSize"),_mime:s(()=>vr,"_mime"),_min:s(()=>Ce,"_min"),_minLength:s(()=>ht,"_minLength"),_minSize:s(()=>st,"_minSize"),_multipleOf:s(()=>Mt,"_multipleOf"),_nan:s(()=>r0,"_nan"),_nanoid:s(()=>Li,"_nanoid"),_nativeEnum:s(()=>bv,"_nativeEnum"),_negative:s(()=>sn,"_negative"),_never:s(()=>Qo,"_never"),_nonnegative:s(()=>on,"_nonnegative"),_nonoptional:s(()=>Cv,"_nonoptional"),_nonpositive:s(()=>an,"_nonpositive"),_normalize:s(()=>yr,"_normalize"),_null:s(()=>Ho,"_null"),_nullable:s(()=>Bv,"_nullable"),_number:s(()=>No,"_number"),_optional:s(()=>$v,"_optional"),_overwrite:s(()=>Ke,"_overwrite"),_parse:s(()=>Yu,"_parse"),_parseAsync:s(()=>Qu,"_parseAsync"),_pipe:s(()=>Iv,"_pipe"),_positive:s(()=>nn,"_positive"),_promise:s(()=>jv,"_promise"),_property:s(()=>ln,"_property"),_readonly:s(()=>_v,"_readonly"),_record:s(()=>gv,"_record"),_refine:s(()=>a0,"_refine"),_regex:s(()=>cr,"_regex"),_safeDecode:s(()=>Ma,"_safeDecode"),_safeDecodeAsync:s(()=>Ra,"_safeDecodeAsync"),_safeEncode:s(()=>Na,"_safeEncode"),_safeEncodeAsync:s(()=>Oa,"_safeEncodeAsync"),_safeParse:s(()=>er,"_safeParse"),_safeParseAsync:s(()=>tr,"_safeParseAsync"),_set:s(()=>yv,"_set"),_size:s(()=>lu,"_size"),_slugify:s(()=>Dr,"_slugify"),_startsWith:s(()=>hr,"_startsWith"),_string:s(()=>Ao,"_string"),_stringFormat:s(()=>pu,"_stringFormat"),_stringbool:s(()=>p0,"_stringbool"),_success:s(()=>kv,"_success"),_superRefine:s(()=>o0,"_superRefine"),_symbol:s(()=>Go,"_symbol"),_templateLiteral:s(()=>Sv,"_templateLiteral"),_toLowerCase:s(()=>br,"_toLowerCase"),_toUpperCase:s(()=>wr,"_toUpperCase"),_transform:s(()=>Dv,"_transform"),_trim:s(()=>Er,"_trim"),_tuple:s(()=>hv,"_tuple"),_uint32:s(()=>Uo,"_uint32"),_uint64:s(()=>Wo,"_uint64"),_ulid:s(()=>Wi,"_ulid"),_undefined:s(()=>Ko,"_undefined"),_union:s(()=>cv,"_union"),_unknown:s(()=>Yo,"_unknown"),_uppercase:s(()=>mr,"_uppercase"),_url:s(()=>dr,"_url"),_uuid:s(()=>Ti,"_uuid"),_uuidv4:s(()=>Pi,"_uuidv4"),_uuidv6:s(()=>Ui,"_uuidv6"),_uuidv7:s(()=>qi,"_uuidv7"),_void:s(()=>e0,"_void"),_xid:s(()=>Gi,"_xid"),_xor:s(()=>pv,"_xor"),clone:s(()=>Se,"clone"),config:s(()=>be,"config"),createStandardJSONSchemaMethod:s(()=>$r,"createStandardJSONSchemaMethod"),createToJSONSchemaMethod:s(()=>zv,"createToJSONSchemaMethod"),decode:s(()=>T5,"decode"),decodeAsync:s(()=>U5,"decodeAsync"),describe:s(()=>d0,"describe"),encode:s(()=>R5,"encode"),encodeAsync:s(()=>P5,"encodeAsync"),extractDefs:s(()=>Tt,"extractDefs"),finalize:s(()=>Pt,"finalize"),flattenError:s(()=>Fi,"flattenError"),formatError:s(()=>ji,"formatError"),globalConfig:s(()=>Ju,"globalConfig"),globalRegistry:s(()=>Re,"globalRegistry"),initializeContext:s(()=>Rt,"initializeContext"),isValidBase64:s(()=>zi,"isValidBase64"),isValidBase64URL:s(()=>Ga,"isValidBase64URL"),isValidJWT:s(()=>Ka,"isValidJWT"),locales:s(()=>bo,"locales"),meta:s(()=>c0,"meta"),parse:s(()=>Ia,"parse"),parseAsync:s(()=>_a,"parseAsync"),prettifyError:s(()=>Aa,"prettifyError"),process:s(()=>ie,"process"),regexes:s(()=>ft,"regexes"),registry:s(()=>Oi,"registry"),safeDecode:s(()=>Z5,"safeDecode"),safeDecodeAsync:s(()=>V5,"safeDecodeAsync"),safeEncode:s(()=>q5,"safeEncode"),safeEncodeAsync:s(()=>L5,"safeEncodeAsync"),safeParse:s(()=>nf,"safeParse"),safeParseAsync:s(()=>sf,"safeParseAsync"),toDotPath:s(()=>ka,"toDotPath"),toJSONSchema:s(()=>g0,"toJSONSchema"),treeifyError:s(()=>Ca,"treeifyError"),util:s(()=>te,"util"),version:s(()=>th,"version")});var x4,C4=Object.freeze({status:"aborted"});function B(e,t,r){function i(l,d){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:d,constr:a,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,d);let c=a.prototype,p=Object.keys(c);for(let m=0;m<p.length;m++){let f=p[m];f in l||(l[f]=c[f].bind(l))}}s(i,"o"),o(i,"init");let u=r?.Parent??Object;class n extends u{static{s(this,"i")}static{o(this,"Definition")}}Object.defineProperty(n,"name",{value:e});function a(l){var d;let c=r?.Parent?new n:this;i(c,l),(d=c._zod).deferred??(d.deferred=[]);for(let p of c._zod.deferred)p();return c}return s(a,"s"),o(a,"_"),Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:o(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(a,"name",{value:e}),a}s(B,"k"),o(B,"$constructor");var k4=Symbol("zod_brand"),jt=class extends Error{static{s(this,"Qe")}static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ai=class extends Error{static{s(this,"St")}static{o(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(x4=globalThis).__zod_globalConfig??(x4.__zod_globalConfig={});var Ju=globalThis.__zod_globalConfig;function be(e){return e&&Object.assign(Ju,e),Ju}s(be,"fe"),o(be,"config");var te={};ut(te,{BIGINT_FORMAT_RANGES:s(()=>L4,"BIGINT_FORMAT_RANGES"),Class:s(()=>O5,"Class"),NUMBER_FORMAT_RANGES:s(()=>Z4,"NUMBER_FORMAT_RANGES"),aborted:s(()=>mt,"aborted"),allowsEval:s(()=>T4,"allowsEval"),assert:s(()=>F4,"assert"),assertEqual:s(()=>A4,"assertEqual"),assertIs:s(()=>_4,"assertIs"),assertNever:s(()=>S4,"assertNever"),assertNotEqual:s(()=>I4,"assertNotEqual"),assignProp:s(()=>rt,"assignProp"),base64ToUint8Array:s(()=>$a,"base64ToUint8Array"),base64urlToUint8Array:s(()=>Q4,"base64urlToUint8Array"),cached:s(()=>iu,"cached"),captureStackTrace:s(()=>Ea,"captureStackTrace"),cleanEnum:s(()=>Y4,"cleanEnum"),cleanRegex:s(()=>Gu,"cleanRegex"),clone:s(()=>Se,"clone"),cloneDef:s(()=>N4,"cloneDef"),createTransparentProxy:s(()=>q4,"createTransparentProxy"),defineLazy:s(()=>ee,"defineLazy"),esc:s(()=>_i,"esc"),escapeRegex:s(()=>Ge,"escapeRegex"),explicitlyAborted:s(()=>Da,"explicitlyAborted"),extend:s(()=>W4,"extend"),finalizeIssue:s(()=>Ae,"finalizeIssue"),floatSafeRemainder:s(()=>va,"floatSafeRemainder"),getElementAtPath:s(()=>M4,"getElementAtPath"),getEnumValues:s(()=>Ii,"getEnumValues"),getLengthableOrigin:s(()=>Hu,"getLengthableOrigin"),getParsedType:s(()=>M5,"getParsedType"),getSizableOrigin:s(()=>Ku,"getSizableOrigin"),hexToUint8Array:s(()=>tf,"hexToUint8Array"),isObject:s(()=>zt,"isObject"),isPlainObject:s(()=>pt,"isPlainObject"),issue:s(()=>Xu,"issue"),joinValues:s(()=>O,"joinValues"),jsonStringifyReplacer:s(()=>Wu,"jsonStringifyReplacer"),merge:s(()=>K4,"merge"),mergeDefs:s(()=>We,"mergeDefs"),normalizeParams:s(()=>T,"normalizeParams"),nullish:s(()=>ct,"nullish"),numKeys:s(()=>P4,"numKeys"),objectClone:s(()=>z4,"objectClone"),omit:s(()=>J4,"omit"),optionalKeys:s(()=>wa,"optionalKeys"),parsedType:s(()=>G,"parsedType"),partial:s(()=>H4,"partial"),pick:s(()=>V4,"pick"),prefixIssues:s(()=>Fe,"prefixIssues"),primitiveTypes:s(()=>U4,"primitiveTypes"),promiseAllObject:s(()=>O4,"promiseAllObject"),propertyKeyTypes:s(()=>Si,"propertyKeyTypes"),randomString:s(()=>R4,"randomString"),required:s(()=>X4,"required"),safeExtend:s(()=>G4,"safeExtend"),shallowClone:s(()=>ba,"shallowClone"),slugify:s(()=>ya,"slugify"),stringifyPrimitive:s(()=>J,"stringifyPrimitive"),uint8ArrayToBase64:s(()=>Ba,"uint8ArrayToBase64"),uint8ArrayToBase64url:s(()=>ef,"uint8ArrayToBase64url"),uint8ArrayToHex:s(()=>uf,"uint8ArrayToHex"),unwrapMessage:s(()=>nu,"unwrapMessage")});function A4(e){return e}s(A4,"lI"),o(A4,"assertEqual");function I4(e){return e}s(I4,"dI"),o(I4,"assertNotEqual");function _4(e){}s(_4,"pI"),o(_4,"assertIs");function S4(e){throw new Error("Unexpected value in exhaustive check")}s(S4,"fI"),o(S4,"assertNever");function F4(e){}s(F4,"mI"),o(F4,"assert");function Ii(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}s(Ii,"En"),o(Ii,"getEnumValues");function O(e,t="|"){return e.map(r=>J(r)).join(t)}s(O,"R"),o(O,"joinValues");function Wu(e,t){return typeof t=="bigint"?t.toString():t}s(Wu,"$r"),o(Wu,"jsonStringifyReplacer");function iu(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw new Error("cached value already set")}}}s(iu,"_r"),o(iu,"cached");function ct(e){return e==null}s(ct,"It"),o(ct,"nullish");function Gu(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}s(Gu,"Tn"),o(Gu,"cleanRegex");function va(e,t){let r=e/t,i=Math.round(r),u=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-i)<u?0:r-i}s(va,"Ic"),o(va,"floatSafeRemainder");var j4=Symbol("evaluating");function ee(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==j4)return i===void 0&&(i=j4,i=r()),i},set(u){Object.defineProperty(e,t,{value:u})},configurable:!0})}s(ee,"Q"),o(ee,"defineLazy");function z4(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}s(z4,"hI"),o(z4,"objectClone");function rt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}s(rt,"Rt"),o(rt,"assignProp");function We(...e){let t={};for(let r of e){let i=Object.getOwnPropertyDescriptors(r);Object.assign(t,i)}return Object.defineProperties({},t)}s(We,"gt"),o(We,"mergeDefs");function N4(e){return We(e._zod.def)}s(N4,"gI"),o(N4,"cloneDef");function M4(e,t){return t?t.reduce((r,i)=>r?.[i],e):e}s(M4,"vI"),o(M4,"getElementAtPath");function O4(e){let t=Object.keys(e),r=t.map(i=>e[i]);return Promise.all(r).then(i=>{let u={};for(let n=0;n<t.length;n++)u[t[n]]=i[n];return u})}s(O4,"yI"),o(O4,"promiseAllObject");function R4(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r}s(R4,"bI"),o(R4,"randomString");function _i(e){return JSON.stringify(e)}s(_i,"ui"),o(_i,"esc");function ya(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}s(ya,"Rc"),o(ya,"slugify");var Ea="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function zt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(zt,"Qt"),o(zt,"isObject");var T4=iu(()=>{if(Ju.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function pt(e){if(zt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(zt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}s(pt,"Et"),o(pt,"isPlainObject");function ba(e){return pt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}s(ba,"Tc"),o(ba,"shallowClone");function P4(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}s(P4,"wI"),o(P4,"numKeys");var M5=o(e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},"getParsedType"),Si=new Set(["string","number","symbol"]),U4=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ge(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}s(Ge,"Je"),o(Ge,"escapeRegex");function Se(e,t,r){let i=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(i._zod.parent=e),i}s(Se,"Te"),o(Se,"clone");function T(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}s(T,"B"),o(T,"normalizeParams");function q4(e){let t;return new Proxy({},{get(r,i,u){return t??(t=e()),Reflect.get(t,i,u)},set(r,i,u,n){return t??(t=e()),Reflect.set(t,i,u,n)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,u){return t??(t=e()),Reflect.defineProperty(t,i,u)}})}s(q4,"$I"),o(q4,"createTransparentProxy");function J(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}s(J,"D"),o(J,"stringifyPrimitive");function wa(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}s(wa,"jc"),o(wa,"optionalKeys");var Z4={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},L4={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function V4(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let u=We(e._zod.def,{get shape(){let n={};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(n[a]=r.shape[a])}return rt(this,"shape",n),n},checks:[]});return Se(e,u)}s(V4,"_I"),o(V4,"pick");function J4(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let u=We(e._zod.def,{get shape(){let n={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete n[a]}return rt(this,"shape",n),n},checks:[]});return Se(e,u)}s(J4,"kI"),o(J4,"omit");function W4(e,t){if(!pt(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let u=e._zod.def.shape;for(let n in t)if(Object.getOwnPropertyDescriptor(u,n)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=We(e._zod.def,{get shape(){let u={...e._zod.def.shape,...t};return rt(this,"shape",u),u}});return Se(e,i)}s(W4,"SI"),o(W4,"extend");function G4(e,t){if(!pt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=We(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return rt(this,"shape",i),i}});return Se(e,r)}s(G4,"II"),o(G4,"safeExtend");function K4(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=We(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t._zod.def.shape};return rt(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Se(e,r)}s(K4,"RI"),o(K4,"merge");function H4(e,t,r){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let u=We(t._zod.def,{get shape(){let n=t._zod.def.shape,a={...n};if(r)for(let l in r){if(!(l in n))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(a[l]=e?new e({type:"optional",innerType:n[l]}):n[l])}else for(let l in n)a[l]=e?new e({type:"optional",innerType:n[l]}):n[l];return rt(this,"shape",a),a},checks:[]});return Se(t,u)}s(H4,"EI"),o(H4,"partial");function X4(e,t,r){let i=We(t._zod.def,{get shape(){let u=t._zod.def.shape,n={...u};if(r)for(let a in r){if(!(a in n))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(n[a]=new e({type:"nonoptional",innerType:u[a]}))}else for(let a in u)n[a]=new e({type:"nonoptional",innerType:u[a]});return rt(this,"shape",n),n}});return Se(t,i)}s(X4,"TI"),o(X4,"required");function mt(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}s(mt,"Tt"),o(mt,"aborted");function Da(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}s(Da,"Mc"),o(Da,"explicitlyAborted");function Fe(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}s(Fe,"Oe"),o(Fe,"prefixIssues");function nu(e){return typeof e=="string"?e:e?.message}s(nu,"Rn"),o(nu,"unwrapMessage");function Ae(e,t,r){let i=e.message?e.message:nu(e.inst?._zod.def?.error?.(e))??nu(t?.error?.(e))??nu(r.customError?.(e))??nu(r.localeError?.(e))??"Invalid input",{inst:u,continue:n,input:a,...l}=e;return l.path??(l.path=[]),l.message=i,t?.reportInput&&(l.input=a),l}s(Ae,"Ae"),o(Ae,"finalizeIssue");function Ku(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}s(Ku,"jn"),o(Ku,"getSizableOrigin");function Hu(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}s(Hu,"zn"),o(Hu,"getLengthableOrigin");function G(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}s(G,"U"),o(G,"parsedType");function Xu(...e){let[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}s(Xu,"kr"),o(Xu,"issue");function Y4(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}s(Y4,"AI"),o(Y4,"cleanEnum");function $a(e){let t=atob(e),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r}s($a,"uw"),o($a,"base64ToUint8Array");function Ba(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}s(Ba,"lw"),o(Ba,"uint8ArrayToBase64");function Q4(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return $a(t+r)}s(Q4,"jI"),o(Q4,"base64urlToUint8Array");function ef(e){return Ba(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}s(ef,"zI"),o(ef,"uint8ArrayToBase64url");function tf(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)r[i/2]=Number.parseInt(t.slice(i,i+2),16);return r}s(tf,"OI"),o(tf,"hexToUint8Array");function uf(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}s(uf,"MI"),o(uf,"uint8ArrayToHex");var O5=class{static{s(this,"Sc")}static{o(this,"Class")}constructor(...e){}},rf=o((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,Wu,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),xa=B("$ZodError",rf),je=B("$ZodError",rf,{Parent:Error});function Fi(e,t=r=>r.message){let r={},i=[];for(let u of e.issues)u.path.length>0?(r[u.path[0]]=r[u.path[0]]||[],r[u.path[0]].push(t(u))):i.push(t(u));return{formErrors:i,fieldErrors:r}}s(Fi,"Mn"),o(Fi,"flattenError");function ji(e,t=r=>r.message){let r={_errors:[]},i=o((u,n=[])=>{for(let a of u.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(l=>i({issues:l},[...n,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...n,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...n,...a.path]);else{let l=[...n,...a.path];if(l.length===0)r._errors.push(t(a));else{let d=r,c=0;for(;c<l.length;){let p=l[c];c===l.length-1?(d[p]=d[p]||{_errors:[]},d[p]._errors.push(t(a))):d[p]=d[p]||{_errors:[]},d=d[p],c++}}}},"processError");return i(e),r}s(ji,"Nn"),o(ji,"formatError");function Ca(e,t=r=>r.message){let r={errors:[]},i=o((u,n=[])=>{var a,l;for(let d of u.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(c=>i({issues:c},[...n,...d.path]));else if(d.code==="invalid_key")i({issues:d.issues},[...n,...d.path]);else if(d.code==="invalid_element")i({issues:d.issues},[...n,...d.path]);else{let c=[...n,...d.path];if(c.length===0){r.errors.push(t(d));continue}let p=r,m=0;for(;m<c.length;){let f=c[m],h=m===c.length-1;typeof f=="string"?(p.properties??(p.properties={}),(a=p.properties)[f]??(a[f]={errors:[]}),p=p.properties[f]):(p.items??(p.items=[]),(l=p.items)[f]??(l[f]={errors:[]}),p=p.items[f]),h&&p.errors.push(t(d)),m++}}},"processError");return i(e),r}s(Ca,"Nc"),o(Ca,"treeifyError");function ka(e){let t=[],r=e.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}s(ka,"pw"),o(ka,"toDotPath");function Aa(e){let t=[],r=[...e.issues].sort((i,u)=>(i.path??[]).length-(u.path??[]).length);for(let i of r)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${ka(i.path)}`);return t.join(`
2
- `)}s(Aa,"Pc"),o(Aa,"prettifyError");var Yu=o(e=>(t,r,i,u)=>{let n=i?{...i,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},n);if(a instanceof Promise)throw new jt;if(a.issues.length){let l=new(u?.Err??e)(a.issues.map(d=>Ae(d,n,be())));throw Ea(l,u?.callee),l}return a.value},"_parse"),Ia=Yu(je),Qu=o(e=>async(t,r,i,u)=>{let n=i?{...i,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},n);if(a instanceof Promise&&(a=await a),a.issues.length){let l=new(u?.Err??e)(a.issues.map(d=>Ae(d,n,be())));throw Ea(l,u?.callee),l}return a.value},"_parseAsync"),_a=Qu(je),er=o(e=>(t,r,i)=>{let u=i?{...i,async:!1}:{async:!1},n=t._zod.run({value:r,issues:[]},u);if(n instanceof Promise)throw new jt;return n.issues.length?{success:!1,error:new(e??xa)(n.issues.map(a=>Ae(a,u,be())))}:{success:!0,data:n.value}},"_safeParse"),nf=er(je),tr=o(e=>async(t,r,i)=>{let u=i?{...i,async:!0}:{async:!0},n=t._zod.run({value:r,issues:[]},u);return n instanceof Promise&&(n=await n),n.issues.length?{success:!1,error:new e(n.issues.map(a=>Ae(a,u,be())))}:{success:!0,data:n.value}},"_safeParseAsync"),sf=tr(je),Sa=o(e=>(t,r,i)=>{let u=i?{...i,direction:"backward"}:{direction:"backward"};return Yu(e)(t,r,u)},"_encode"),R5=Sa(je),Fa=o(e=>(t,r,i)=>Yu(e)(t,r,i),"_decode"),T5=Fa(je),ja=o(e=>async(t,r,i)=>{let u=i?{...i,direction:"backward"}:{direction:"backward"};return Qu(e)(t,r,u)},"_encodeAsync"),P5=ja(je),za=o(e=>async(t,r,i)=>Qu(e)(t,r,i),"_decodeAsync"),U5=za(je),Na=o(e=>(t,r,i)=>{let u=i?{...i,direction:"backward"}:{direction:"backward"};return er(e)(t,r,u)},"_safeEncode"),q5=Na(je),Ma=o(e=>(t,r,i)=>er(e)(t,r,i),"_safeDecode"),Z5=Ma(je),Oa=o(e=>async(t,r,i)=>{let u=i?{...i,direction:"backward"}:{direction:"backward"};return tr(e)(t,r,u)},"_safeEncodeAsync"),L5=Oa(je),Ra=o(e=>async(t,r,i)=>tr(e)(t,r,i),"_safeDecodeAsync"),V5=Ra(je),ft={};ut(ft,{base64:s(()=>Df,"base64"),base64url:s(()=>Pa,"base64url"),bigint:s(()=>Af,"bigint"),boolean:s(()=>_f,"boolean"),browserEmail:s(()=>Q5,"browserEmail"),cidrv4:s(()=>bf,"cidrv4"),cidrv6:s(()=>wf,"cidrv6"),cuid:s(()=>af,"cuid"),cuid2:s(()=>of,"cuid2"),date:s(()=>Cf,"date"),datetime:s(()=>Za,"datetime"),domain:s(()=>uw,"domain"),duration:s(()=>mf,"duration"),e164:s(()=>Bf,"e164"),email:s(()=>hf,"email"),emoji:s(()=>Ta,"emoji"),extendedDuration:s(()=>J5,"extendedDuration"),guid:s(()=>ff,"guid"),hex:s(()=>rw,"hex"),hostname:s(()=>tw,"hostname"),html5Email:s(()=>H5,"html5Email"),httpProtocol:s(()=>$f,"httpProtocol"),idnEmail:s(()=>Y5,"idnEmail"),integer:s(()=>If,"integer"),ipv4:s(()=>vf,"ipv4"),ipv6:s(()=>yf,"ipv6"),ksuid:s(()=>cf,"ksuid"),lowercase:s(()=>jf,"lowercase"),mac:s(()=>Ef,"mac"),md5_base64:s(()=>nw,"md5_base64"),md5_base64url:s(()=>sw,"md5_base64url"),md5_hex:s(()=>iw,"md5_hex"),nanoid:s(()=>pf,"nanoid"),null:s(()=>Sf,"null"),number:s(()=>La,"number"),rfc5322Email:s(()=>X5,"rfc5322Email"),sha1_base64:s(()=>ow,"sha1_base64"),sha1_base64url:s(()=>lw,"sha1_base64url"),sha1_hex:s(()=>aw,"sha1_hex"),sha256_base64:s(()=>cw,"sha256_base64"),sha256_base64url:s(()=>pw,"sha256_base64url"),sha256_hex:s(()=>dw,"sha256_hex"),sha384_base64:s(()=>fw,"sha384_base64"),sha384_base64url:s(()=>hw,"sha384_base64url"),sha384_hex:s(()=>mw,"sha384_hex"),sha512_base64:s(()=>vw,"sha512_base64"),sha512_base64url:s(()=>yw,"sha512_base64url"),sha512_hex:s(()=>gw,"sha512_hex"),string:s(()=>kf,"string"),time:s(()=>qa,"time"),ulid:s(()=>lf,"ulid"),undefined:s(()=>Ff,"undefined"),unicodeEmail:s(()=>gf,"unicodeEmail"),uppercase:s(()=>zf,"uppercase"),uuid:s(()=>su,"uuid"),uuid4:s(()=>W5,"uuid4"),uuid6:s(()=>G5,"uuid6"),uuid7:s(()=>K5,"uuid7"),xid:s(()=>df,"xid")});var af=/^[cC][0-9a-z]{6,}$/,of=/^[0-9a-z]+$/,lf=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,df=/^[0-9a-vA-V]{20}$/,cf=/^[A-Za-z0-9]{27}$/,pf=/^[a-zA-Z0-9_-]{21}$/,mf=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,J5=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ff=/^([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})$/,su=o(e=>e?new 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)$/,"uuid"),W5=su(4),G5=su(6),K5=su(7),hf=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,H5=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,X5=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,gf=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Y5=gf,Q5=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ew="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ta(){return new RegExp(ew,"u")}s(Ta,"Kc"),o(Ta,"emoji");var vf=/^(?:(?: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])$/,yf=/^(([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}|:))$/,Ef=o(e=>{let t=Ge(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},"mac"),bf=/^((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])$/,wf=/^(([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])$/,Df=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Pa=/^[A-Za-z0-9_-]*$/,tw=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,uw=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,$f=/^https?$/,Bf=/^\+[1-9]\d{6,14}$/,xf="(?:(?:\\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])))",Cf=new RegExp(`^${xf}$`);function Ua(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+)?)?`}s(Ua,"hw"),o(Ua,"timeSource");function qa(e){return new RegExp(`^${Ua(e)}$`)}s(qa,"ou"),o(qa,"time");function Za(e){let t=Ua({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${t}(?:${r.join("|")})`;return new RegExp(`^${xf}T(?:${i})$`)}s(Za,"iu"),o(Za,"datetime");var kf=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Af=/^-?\d+n?$/,If=/^-?\d+$/,La=/^-?\d+(?:\.\d+)?$/,_f=/^(?:true|false)$/i,Sf=/^null$/i,Ff=/^undefined$/i,jf=/^[^A-Z]*$/,zf=/^[^a-z]*$/,rw=/^[0-9a-fA-F]*$/;function au(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}s(au,"Pn"),o(au,"fixedBase64");function ou(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}s(ou,"Dn"),o(ou,"fixedBase64url");var iw=/^[0-9a-fA-F]{32}$/,nw=au(22,"=="),sw=ou(22),aw=/^[0-9a-fA-F]{40}$/,ow=au(27,"="),lw=ou(27),dw=/^[0-9a-fA-F]{64}$/,cw=au(43,"="),pw=ou(43),mw=/^[0-9a-fA-F]{96}$/,fw=au(64,""),hw=ou(64),gw=/^[0-9a-fA-F]{128}$/,vw=au(86,"=="),yw=ou(86),de=B("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Nf={number:"number",bigint:"bigint",object:"date"},Va=B("$ZodCheckLessThan",(e,t)=>{de.init(e,t);let r=Nf[typeof t.value];e._zod.onattach.push(i=>{let u=i._zod.bag,n=(t.inclusive?u.maximum:u.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<n&&(t.inclusive?u.maximum=t.value:u.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ja=B("$ZodCheckGreaterThan",(e,t)=>{de.init(e,t);let r=Nf[typeof t.value];e._zod.onattach.push(i=>{let u=i._zod.bag,n=(t.inclusive?u.minimum:u.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>n&&(t.inclusive?u.minimum=t.value:u.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Mf=B("$ZodCheckMultipleOf",(e,t)=>{de.init(e,t),e._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):va(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Of=B("$ZodCheckNumberFormat",(e,t)=>{de.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),i=r?"int":"number",[u,n]=Z4[t.format];e._zod.onattach.push(a=>{let l=a._zod.bag;l.format=t.format,l.minimum=u,l.maximum=n,r&&(l.pattern=If)}),e._zod.check=a=>{let l=a.value;if(r){if(!Number.isInteger(l)){a.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}l<u&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:u,inclusive:!0,inst:e,continue:!t.abort}),l>n&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),Rf=B("$ZodCheckBigIntFormat",(e,t)=>{de.init(e,t);let[r,i]=L4[t.format];e._zod.onattach.push(u=>{let n=u._zod.bag;n.format=t.format,n.minimum=r,n.maximum=i}),e._zod.check=u=>{let n=u.value;n<r&&u.issues.push({origin:"bigint",input:n,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),n>i&&u.issues.push({origin:"bigint",input:n,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Tf=B("$ZodCheckMaxSize",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=i=>{let u=i.value;return!ct(u)&&u.size!==void 0}),e._zod.onattach.push(i=>{let u=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<u&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let u=i.value;u.size<=t.maximum||i.issues.push({origin:Ku(u),code:"too_big",maximum:t.maximum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),Pf=B("$ZodCheckMinSize",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=i=>{let u=i.value;return!ct(u)&&u.size!==void 0}),e._zod.onattach.push(i=>{let u=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>u&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let u=i.value;u.size>=t.minimum||i.issues.push({origin:Ku(u),code:"too_small",minimum:t.minimum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),Uf=B("$ZodCheckSizeEquals",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=i=>{let u=i.value;return!ct(u)&&u.size!==void 0}),e._zod.onattach.push(i=>{let u=i._zod.bag;u.minimum=t.size,u.maximum=t.size,u.size=t.size}),e._zod.check=i=>{let u=i.value,n=u.size;if(n===t.size)return;let a=n>t.size;i.issues.push({origin:Ku(u),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),qf=B("$ZodCheckMaxLength",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=i=>{let u=i.value;return!ct(u)&&u.length!==void 0}),e._zod.onattach.push(i=>{let u=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<u&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let u=i.value;if(u.length<=t.maximum)return;let n=Hu(u);i.issues.push({origin:n,code:"too_big",maximum:t.maximum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),Zf=B("$ZodCheckMinLength",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=i=>{let u=i.value;return!ct(u)&&u.length!==void 0}),e._zod.onattach.push(i=>{let u=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>u&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let u=i.value;if(u.length>=t.minimum)return;let n=Hu(u);i.issues.push({origin:n,code:"too_small",minimum:t.minimum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),Lf=B("$ZodCheckLengthEquals",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=i=>{let u=i.value;return!ct(u)&&u.length!==void 0}),e._zod.onattach.push(i=>{let u=i._zod.bag;u.minimum=t.length,u.maximum=t.length,u.length=t.length}),e._zod.check=i=>{let u=i.value,n=u.length;if(n===t.length)return;let a=Hu(u),l=n>t.length;i.issues.push({origin:a,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),ur=B("$ZodCheckStringFormat",(e,t)=>{var r,i;de.init(e,t),e._zod.onattach.push(u=>{let n=u._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=u=>{t.pattern.lastIndex=0,!t.pattern.test(u.value)&&u.issues.push({origin:"string",code:"invalid_format",format:t.format,input:u.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),Vf=B("$ZodCheckRegex",(e,t)=>{ur.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Jf=B("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=jf),ur.init(e,t)}),Wf=B("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=zf),ur.init(e,t)}),Gf=B("$ZodCheckIncludes",(e,t)=>{de.init(e,t);let r=Ge(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push(u=>{let n=u._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(i)}),e._zod.check=u=>{u.value.includes(t.includes,t.position)||u.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:u.value,inst:e,continue:!t.abort})}}),Kf=B("$ZodCheckStartsWith",(e,t)=>{de.init(e,t);let r=new RegExp(`^${Ge(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{let u=i._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Hf=B("$ZodCheckEndsWith",(e,t)=>{de.init(e,t);let r=new RegExp(`.*${Ge(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{let u=i._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function Wa(e,t,r){e.issues.length&&t.issues.push(...Fe(r,e.issues))}s(Wa,"gw"),o(Wa,"handleCheckPropertyResult");var Xf=B("$ZodCheckProperty",(e,t)=>{de.init(e,t),e._zod.check=r=>{let i=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(u=>Wa(u,r,t.property));Wa(i,r,t.property)}}),Yf=B("$ZodCheckMimeType",(e,t)=>{de.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(i=>{i._zod.bag.mime=t.mime}),e._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),Qf=B("$ZodCheckOverwrite",(e,t)=>{de.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}}),eh=class{static{s(this,"Cn")}static{o(this,"Doc")}constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split(`
3
- `).filter(u=>u),r=Math.min(...t.map(u=>u.length-u.trimStart().length)),i=t.map(u=>u.slice(r)).map(u=>" ".repeat(this.indent*2)+u);for(let u of i)this.content.push(u)}compile(){let e=Function,t=this?.args,r=[...(this?.content??[""]).map(i=>` ${i}`)];return new e(...t,r.join(`
4
- `))}},th={major:4,minor:4,patch:3},X=B("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=th;let i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(let u of i)for(let n of u._zod.onattach)n(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let u=o((a,l,d)=>{let c=mt(a),p;for(let m of l){if(m._zod.def.when){if(Da(a)||!m._zod.def.when(a))continue}else if(c)continue;let f=a.issues.length,h=m._zod.check(a);if(h instanceof Promise&&d?.async===!1)throw new jt;if(p||h instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await h,a.issues.length!==f&&(c||(c=mt(a,f)))});else{if(a.issues.length===f)continue;c||(c=mt(a,f))}}return p?p.then(()=>a):a},"runChecks"),n=o((a,l,d)=>{if(mt(a))return a.aborted=!0,a;let c=u(l,i,d);if(c instanceof Promise){if(d.async===!1)throw new jt;return c.then(p=>e._zod.parse(p,d))}return e._zod.parse(c,d)},"handleCanaryResult");e._zod.run=(a,l)=>{if(l.skipChecks)return e._zod.parse(a,l);if(l.direction==="backward"){let c=e._zod.parse({value:a.value,issues:[]},{...l,skipChecks:!0});return c instanceof Promise?c.then(p=>n(p,a,l)):n(c,a,l)}let d=e._zod.parse(a,l);if(d instanceof Promise){if(l.async===!1)throw new jt;return d.then(c=>u(c,i,l))}return u(d,i,l)}}ee(e,"~standard",()=>({validate:o(u=>{try{let n=nf(e,u);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return sf(e,u).then(n=>n.success?{value:n.data}:{issues:n.error?.issues})}},"validate"),vendor:"zod",version:1}))}),rr=B("$ZodString",(e,t)=>{X.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??kf(e._zod.bag),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),se=B("$ZodStringFormat",(e,t)=>{ur.init(e,t),rr.init(e,t)}),uh=B("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ff),se.init(e,t)}),rh=B("$ZodUUID",(e,t)=>{if(t.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=su(r))}else t.pattern??(t.pattern=su());se.init(e,t)}),ih=B("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=hf),se.init(e,t)}),nh=B("$ZodURL",(e,t)=>{se.init(e,t),e._zod.check=r=>{try{let i=r.value.trim();if(!t.normalize&&t.protocol?.source===$f.source&&!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let u=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(u.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(u.protocol.endsWith(":")?u.protocol.slice(0,-1):u.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=u.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),sh=B("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ta()),se.init(e,t)}),ah=B("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=pf),se.init(e,t)}),oh=B("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=af),se.init(e,t)}),lh=B("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=of),se.init(e,t)}),dh=B("$ZodULID",(e,t)=>{t.pattern??(t.pattern=lf),se.init(e,t)}),ch=B("$ZodXID",(e,t)=>{t.pattern??(t.pattern=df),se.init(e,t)}),ph=B("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=cf),se.init(e,t)}),mh=B("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Za(t)),se.init(e,t)}),fh=B("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Cf),se.init(e,t)}),hh=B("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=qa(t)),se.init(e,t)}),gh=B("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=mf),se.init(e,t)}),vh=B("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=vf),se.init(e,t),e._zod.bag.format="ipv4"}),yh=B("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=yf),se.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Eh=B("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Ef(t.delimiter)),se.init(e,t),e._zod.bag.format="mac"}),bh=B("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=bf),se.init(e,t)}),wh=B("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=wf),se.init(e,t),e._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw new Error;let[u,n]=i;if(!n)throw new Error;let a=Number(n);if(`${a}`!==n)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${u}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function zi(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}s(zi,"el"),o(zi,"isValidBase64");var Dh=B("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Df),se.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{zi(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Ga(e){if(!Pa.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return zi(r)}s(Ga,"Ow"),o(Ga,"isValidBase64URL");var $h=B("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Pa),se.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Ga(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Bh=B("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Bf),se.init(e,t)});function Ka(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let u=JSON.parse(atob(i));return!("typ"in u&&u?.typ!=="JWT"||!u.alg||t&&(!("alg"in u)||u.alg!==t))}catch{return!1}}s(Ka,"Mw"),o(Ka,"isValidJWT");var xh=B("$ZodJWT",(e,t)=>{se.init(e,t),e._zod.check=r=>{Ka(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Ch=B("$ZodCustomStringFormat",(e,t)=>{se.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Ha=B("$ZodNumber",(e,t)=>{X.init(e,t),e._zod.pattern=e._zod.bag.pattern??La,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let u=r.value;if(typeof u=="number"&&!Number.isNaN(u)&&Number.isFinite(u))return r;let n=typeof u=="number"?Number.isNaN(u)?"NaN":Number.isFinite(u)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:u,inst:e,...n?{received:n}:{}}),r}}),kh=B("$ZodNumberFormat",(e,t)=>{Of.init(e,t),Ha.init(e,t)}),Xa=B("$ZodBoolean",(e,t)=>{X.init(e,t),e._zod.pattern=_f,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=!!r.value}catch{}let u=r.value;return typeof u=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:u,inst:e}),r}}),Ya=B("$ZodBigInt",(e,t)=>{X.init(e,t),e._zod.pattern=Af,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Ah=B("$ZodBigIntFormat",(e,t)=>{Rf.init(e,t),Ya.init(e,t)}),Ih=B("$ZodSymbol",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;return typeof u=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:u,inst:e}),r}}),_h=B("$ZodUndefined",(e,t)=>{X.init(e,t),e._zod.pattern=Ff,e._zod.values=new Set([void 0]),e._zod.parse=(r,i)=>{let u=r.value;return typeof u>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:u,inst:e}),r}}),Sh=B("$ZodNull",(e,t)=>{X.init(e,t),e._zod.pattern=Sf,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{let u=r.value;return u===null||r.issues.push({expected:"null",code:"invalid_type",input:u,inst:e}),r}}),Fh=B("$ZodAny",(e,t)=>{X.init(e,t),e._zod.parse=r=>r}),jh=B("$ZodUnknown",(e,t)=>{X.init(e,t),e._zod.parse=r=>r}),zh=B("$ZodNever",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Nh=B("$ZodVoid",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;return typeof u>"u"||r.issues.push({expected:"void",code:"invalid_type",input:u,inst:e}),r}}),Mh=B("$ZodDate",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let u=r.value,n=u instanceof Date;return n&&!Number.isNaN(u.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:u,...n?{received:"Invalid Date"}:{},inst:e}),r}});function Qa(e,t,r){e.issues.length&&t.issues.push(...Fe(r,e.issues)),t.value[r]=e.value}s(Qa,"bw"),o(Qa,"handleArrayResult");var Oh=B("$ZodArray",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;if(!Array.isArray(u))return r.issues.push({expected:"array",code:"invalid_type",input:u,inst:e}),r;r.value=Array(u.length);let n=[];for(let a=0;a<u.length;a++){let l=u[a],d=t.element._zod.run({value:l,issues:[]},i);d instanceof Promise?n.push(d.then(c=>Qa(c,r,a))):Qa(d,r,a)}return n.length?Promise.all(n).then(()=>r):r}});function ir(e,t,r,i,u,n){let a=r in i;if(e.issues.length){if(u&&n&&!a)return;t.issues.push(...Fe(r,e.issues))}if(!a&&!u){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}s(ir,"Ei"),o(ir,"handlePropertyResult");function eo(e){let t=Object.keys(e.shape);for(let i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=wa(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}s(eo,"Nw"),o(eo,"normalizeDef");function to(e,t,r,i,u,n){let a=[],l=u.keySet,d=u.catchall._zod,c=d.def.type,p=d.optin==="optional",m=d.optout==="optional";for(let f in t){if(f==="__proto__"||l.has(f))continue;if(c==="never"){a.push(f);continue}let h=d.run({value:t[f],issues:[]},i);h instanceof Promise?e.push(h.then(g=>ir(g,r,f,t,p,m))):ir(h,r,f,t,p,m)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:n}),e.length?Promise.all(e).then(()=>r):r}s(to,"Pw"),o(to,"handleCatchall");var Rh=B("$ZodObject",(e,t)=>{if(X.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let l={...a};return Object.defineProperty(t,"shape",{value:l}),l},"get")})}let r=iu(()=>eo(t));ee(e._zod,"propValues",()=>{let a=t.shape,l={};for(let d in a){let c=a[d]._zod;if(c.values){l[d]??(l[d]=new Set);for(let p of c.values)l[d].add(p)}}return l});let i=zt,u=t.catchall,n;e._zod.parse=(a,l)=>{n??(n=r.value);let d=a.value;if(!i(d))return a.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),a;a.value={};let c=[],p=n.shape;for(let m of n.keys){let f=p[m],h=f._zod.optin==="optional",g=f._zod.optout==="optional",E=f._zod.run({value:d[m],issues:[]},l);E instanceof Promise?c.push(E.then(x=>ir(x,a,m,d,h,g))):ir(E,a,m,d,h,g)}return u?to(c,d,a,l,r.value,e):c.length?Promise.all(c).then(()=>a):a}}),Th=B("$ZodObjectJIT",(e,t)=>{Rh.init(e,t);let r=e._zod.parse,i=iu(()=>eo(t)),u=o(m=>{let f=new eh(["shape","payload","ctx"]),h=i.value,g=o(w=>{let k=_i(w);return`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`},"parseStr");f.write("const input = payload.value;");let E=Object.create(null),x=0;for(let w of h.keys)E[w]=`key_${x++}`;f.write("const newResult = {};");for(let w of h.keys){let k=E[w],C=_i(w),M=m[w],y=M?._zod?.optin==="optional",D=M?._zod?.optout==="optional";f.write(`const ${k} = ${g(w)};`),y&&D?f.write(`
5
- if (${k}.issues.length) {
6
- if (${C} in input) {
7
- payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
1
+ "use strict";var Gw=Object.defineProperty;var s=(e,t)=>Gw(e,"name",{value:t,configurable:!0});var o4=Object.defineProperty,o=s((e,t)=>o4(e,"name",{value:t,configurable:!0}),"a"),ut=s((e,t)=>{for(var r in t)o4(e,r,{get:t[r],enumerable:!0})},"mt");import"reflect-metadata";import{createHash as Kw}from"node:crypto";import{existsSync as l4,readFileSync as d4,statSync as c4}from"node:fs";import{createServer as Hw}from"node:http";import{basename as Xw}from"node:path";var p4="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function m4(e,t){let r="",n=e;for(let u=t-1;u>=0;u--){let i=n%32;r=p4[i]+r,n=(n-i)/32}return r}s(m4,"gI"),o(m4,"encodeTime");function f4(e){let t=new Uint8Array(e);globalThis.crypto.getRandomValues(t);let r="";for(let n=0;n<e;n++)r+=p4[(t[n]??0)&31];return r}s(f4,"vI"),o(f4,"encodeRandom");function lt(e=Date.now()){return m4(e,10)+f4(16)}s(lt,"Fe"),o(lt,"ulid");var h4=class{static{s(this,"yr")}static{o(this,"EventBus")}constructor(e={}){this.subs=new Set,this.dropped=0,this.capacity=e.capacity??1e4,this.onDrop=e.onDrop,this.transform=e.transform}publish(e){if(this.subs.size>this.capacity){this.dropped++,this.onDrop?.(1);return}let t=e;if(this.transform)try{t=this.transform(e)??e}catch{t=e}for(let r of this.subs)if(!(r.filter&&!r.filter(t)))try{let n=r.handler(t);n&&typeof n.then=="function"&&n.catch(()=>{})}catch{}}subscribe(e,t){let r={handler:e,filter:t};return this.subs.add(r),()=>{this.subs.delete(r)}}droppedCount(){return this.dropped}subscriberCount(){return this.subs.size}},nu="REDACTED",Yw=["token","secret","password","passwd","apikey","credential","assertion","signature"],Qw=new Set(["key","auth","authorization","jwt","code","sig","pwd","pass","session","sid","bearer","otp","cookie","set-cookie"]),e5=/^(?:(?:prompt|completion|total|input|output|cache|cached|cacheread|cachewrite|reasoning|thinking|max|min|remaining|used|billed)tokens|tokens?(?:count|used|limit|remaining))$/;function fa(e){let t=e.toLowerCase();if(e5.test(t.replace(/[-_.]+/g,"")))return!1;if(Yw.some(r=>t.includes(r)))return!0;for(let r of t.split(/[-_.]+/))if(r&&Qw.has(r))return!0;return!1}s(fa,"hw"),o(fa,"isSecretParam");var t5=/^([a-z][a-z0-9+.-]*:\/\/)[^/?#@\s]*@/i,u5=/([?&#])([^=&#\s]+)=([^&#\s]*)/g;function g4(e){return e&&e.replace(t5,`$1${nu}@`).replace(u5,(t,r,n)=>fa(n)?`${r}${n}=${nu}`:t)}s(g4,"_I"),o(g4,"redactUrlParams");var r5=/\beyJ[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{4,}\.[A-Za-z0-9_-]*/g,n5=/\b(bearer|basic)\s+[A-Za-z0-9._~+/=-]{8,}/gi,i5=/\b(authorization|x-api-key|api-key|cookie|set-cookie|proxy-authorization)\b(\s*[:=]\s*)(["']?)((?:(?:bearer|basic)\s+)?[^\s"',;]{4,})\3/gi;function dt(e){return g4(e).replace(i5,(t,r,n,u)=>`${r}${n}${u}${nu}${u}`).replace(r5,nu).replace(n5,(t,r)=>`${r} ${nu}`)}s(dt,"ht"),o(dt,"redactText");function ha(e,t){return e.length<=t?e:`${e.slice(0,t)}\u2026[lensmcp truncated: ${e.length-t} more chars]`}s(ha,"gw"),o(ha,"clip");function v4(e,t=4096){if(e!==void 0)return ha(dt(e),t)}s(v4,"vw"),o(v4,"safeText");function y4(e){return ha(dt(e),300)}s(y4,"yw"),o(y4,"safeTitle");var s5=6,a5=64,o5=/^TS\d{1,5}$/,l5=o((e,t)=>e==="code"&&typeof t=="string"&&o5.test(t),"isDiagnosticCode");function Gu(e,t=0,r=s5){if(typeof e=="string")return dt(e);if(e===null||typeof e!="object"||t>=r)return e;if(Array.isArray(e)){let i=!1,a=e.map((l,d)=>{if(d>=a5)return l;let c=Gu(l,t+1,r);return c!==l&&(i=!0),c});return i?a:e}let n=!1,u={};for(let[i,a]of Object.entries(e)){let l=fa(i)&&a!==void 0&&a!==null&&!l5(i,a)?nu:Gu(a,t+1,r);l!==a&&(n=!0),u[i]=l}return n?u:e}s(Gu,"wr"),o(Gu,"redactDeep");var d5=12;function ga(e={}){let t=e.maxDepth??d5,r=0,n=0;return{redact(u){r+=1;let i=u.title===void 0?void 0:y4(dt(u.title)),a=u.message===void 0?void 0:v4(dt(u.message),4096),l=u.raw===void 0?void 0:Gu(u.raw,0,t),d=i!==u.title,c=a!==u.message,p=l!==u.raw;return!d&&!c&&!p?u:(n+=1,{...u,...i!==void 0?{title:i}:{},...a!==void 0?{message:a}:{},...l!==void 0?{raw:l}:{}})},stats:o(()=>({inspected:r,redacted:n}),"stats"),reset:o(()=>{r=0,n=0},"reset")}}s(ga,"ci"),o(ga,"createEventRedactor");var b4=class{static{s(this,"xr")}static{o(this,"ResourceStore")}constructor(){this.entries=new Map,this.subs=new Map}register(e,t){if(this.entries.has(e))throw new Error(`Resource already registered: ${e}`);return this.entries.set(e,{uri:e,produce:t,revision:0}),()=>{this.entries.delete(e),this.subs.delete(e)}}async read(e){let t=this.entries.get(e);if(!t)throw new Error(`Unknown resource: ${e}`);return t.produce()}list(){return[...this.entries.keys()]}async markDirty(e){let t=this.entries.get(e);if(!t)return;let r=await t.produce(),n=JSON.stringify(r);if(n===t.lastJson)return;t.lastJson=n,t.revision+=1;let u=this.subs.get(e);if(u)for(let i of u)try{i(e,t.revision)}catch{}}revision(e){return this.entries.get(e)?.revision}subscribe(e,t){let r=this.subs.get(e);return r||(r=new Set,this.subs.set(e,r)),r.add(t),()=>{r?.delete(t)}}},E4=class{static{s(this,"$r")}static{o(this,"GraphStore")}constructor(){this.nodes=new Map,this.edges=new Map,this.byParent=new Map,this.byFlow=new Map,this.byLogical=new Map,this.byInstance=new Map,this.byRequest=new Map,this.outByAxis=new Map,this.inByAxis=new Map}addNode(e){this.nodes.set(e.id,e),e.parentTraceNodeId&&this.addToIndex(this.byParent,e.parentTraceNodeId,e.id),e.context.flowId&&this.addToIndex(this.byFlow,e.context.flowId,e.id),e.logicalId&&this.addToIndex(this.byLogical,e.logicalId,e.id),e.instanceId&&this.addToIndex(this.byInstance,e.instanceId,e.id),e.context.requestId&&this.addToIndex(this.byRequest,e.context.requestId,e.id)}updateNode(e,t){let r=this.nodes.get(e);if(!r)throw new Error(`Unknown node: ${e}`);let n={...r,...t,id:r.id};return this.nodes.set(e,n),n}getNode(e){return this.nodes.get(e)}addEdge(e){this.edges.set(e.id,e);let t=this.outByAxis.get(e.axis);t||(t=new Map,this.outByAxis.set(e.axis,t)),this.addToIndex(t,e.from,e.id);let r=this.inByAxis.get(e.axis);r||(r=new Map,this.inByAxis.set(e.axis,r)),this.addToIndex(r,e.to,e.id)}getEdge(e){return this.edges.get(e)}childrenOf(e){return this.materialiseNodes(this.byParent.get(e))}nodesInFlow(e){return this.materialiseNodes(this.byFlow.get(e))}nodesByLogical(e){return this.materialiseNodes(this.byLogical.get(e))}nodesByInstance(e){return this.materialiseNodes(this.byInstance.get(e))}nodesByRequest(e){return this.materialiseNodes(this.byRequest.get(e))}traverse(e){let t=this.nodes.get(e.from);if(!t)return{nodes:[],edges:[]};let r=Array.isArray(e.lens)?e.lens:[e.lens],n=e.direction??"both",u=e.depth??4,i=e.maxNodes??1e3,a=new Set,l=new Set,d=[{id:t.id,d:0}];for(;d.length&&!(a.size>=i);){let{id:c,d:p}=d.shift();if(!a.has(c)&&(a.add(c),!(p>=u)))for(let m of r){if(n==="out"||n==="both"){let f=this.outByAxis.get(m)?.get(c);if(f)for(let h of f){l.add(h);let g=this.edges.get(h);a.has(g.to)||d.push({id:g.to,d:p+1})}}if(n==="in"||n==="both"){let f=this.inByAxis.get(m)?.get(c);if(f)for(let h of f){l.add(h);let g=this.edges.get(h);a.has(g.from)||d.push({id:g.from,d:p+1})}}}}return{nodes:this.materialiseNodes(a),edges:[...l].map(c=>this.edges.get(c)).filter(c=>!!c)}}nodeCount(){return this.nodes.size}edgeCount(){return this.edges.size}addToIndex(e,t,r){let n=e.get(t);n||(n=new Set,e.set(t,n)),n.add(r)}materialiseNodes(e){if(!e)return[];let t=[];for(let r of e){let n=this.nodes.get(r);n&&t.push(n)}return t}};function w4(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")}s(w4,"zI"),o(w4,"fnv1a32");function D4(e){let t=[e.kind,e.identity,e.file??"",e.detail??""];return`${e.kind}:${w4(t.join("|"))}`}s(D4,"bw"),o(D4,"fingerprint");var c5=class{static{s(this,"ui")}static{o(this,"ReducerRegistry")}constructor(){this.reducers=[]}register(e,t){if(this.reducers.some(r=>r.name===e))throw new Error(`Reducer already registered: ${e}`);this.reducers.push({name:e,reducer:t})}list(){return this.reducers}async dispatch(e){for(let{reducer:t}of this.reducers)try{let r=t(e);r&&typeof r.then=="function"&&await r}catch{}}};function va(e,t={}){let r,n;if(t.flowId)n=t.flowId,r=e.filter(m=>m.context.flowId===n);else{let m=e.find(f=>f.context.flowId);if(!m)return;n=m.context.flowId,r=e.filter(f=>f.context.flowId===n)}if(r.length===0)return;r.sort((m,f)=>m.timestamp-f.timestamp);let u=1e3;r.length>u&&(r=[r[0],...r.slice(r.length-(u-1))]);let i=r[0],a=[],l,d;for(let m of r){let f=$4(m);if(f){if(a.push(f),f.kind==="render"||f.kind==="final-render"){let h=m.raw;h?.render&&(l={id:h.render.id,page:h.render.page,route:h.render.route,componentName:h.render.componentName})}else if(m.source==="visual"&&f.kind==="visual-violation"){let h=m.raw;h?.frame&&(d=h.frame.id)}}}for(let m=a.length-1;m>=0;m--)if(a[m].kind==="render"){a[m]={...a[m],kind:"final-render"};break}let c=r[0].timestamp,p=r[r.length-1].timestamp;return{flowId:n,origin:{type:i.context.originType,nodeId:i.context.originNodeId,at:i.timestamp},phases:a,finalState:l?{page:l.page,route:l.route,componentName:l.componentName,renderId:l.id,visualFrameId:d}:void 0,startedAt:c,endedAt:p,eventCount:r.length}}s(va,"li"),o(va,"compileStory");function $4(e){let t=(e.raw??null)?.kind;if(t==="flow-origin"||e.source==="client-runtime"&&t==="user-action"){let r=e.raw;return{kind:"user-action",at:e.timestamp,label:r?.origin?.label??e.title,eventIds:[e.id]}}if(e.source==="react"&&t==="render"){let r=e.raw;return{kind:"render",at:e.timestamp,label:`render ${r?.render?.componentName??"?"}`,eventIds:[e.id],details:r?.render?{componentName:r.render.componentName,durationMs:r.render.actualDurationMs}:void 0}}if(e.source==="react"&&t==="slot-content-changed"){let r=e.raw,n=r?.slot?.toComponent??"?";return{kind:/spinner|loader|loading/i.test(n)?"loading-ui":"idle-ui",at:e.timestamp,label:`slot ${r?.slot?.slotLogicalId??""} \u2192 ${n}`,eventIds:[e.id]}}if(e.source==="client-runtime"&&t==="route"){let r=e.raw;return{kind:"route-transition",at:e.timestamp,label:`route ${r?.from??""} \u2192 ${r?.url??""}`,eventIds:[e.id]}}if(e.source==="valtio"&&t==="state-update"){let r=e.raw;return{kind:"state-update",at:e.timestamp,label:`${r?.update?.storeId??"?"}.${r?.update?.path??"?"}`,eventIds:[e.id],details:r?.update}}if(e.source==="nestjs"&&t==="server-request"){let r=e.raw;return{kind:"backend-request",at:e.timestamp,label:`${r?.request?.method??"?"} ${r?.request?.route??"?"} \u2192 ${r?.request?.status??"?"}`,eventIds:[e.id],details:r?.request}}if(e.source==="chrome"&&e.category==="network")return{kind:"backend-request",at:e.timestamp,label:e.title,eventIds:[e.id]};if(e.source==="visual"&&t==="visual-violation"){let r=e.raw;return{kind:"visual-violation",at:e.timestamp,label:`${r?.violation?.ruleType??"rule"} ${r?.violation?.ruleId??""}`,eventIds:[e.id]}}}s($4,"MI"),o($4,"classifyEvent");var B4={phaseGapMs:1500,burstGapMs:250,attachWindowMs:400,maxSegmentEvents:400,occurrenceSlackMs:10},p5=new Set(["subscription-added","subscription-removed","hook-run","store-created","singleton-instance","visual-frame"]),ya="db-request-account",m5=new Set(["react","valtio","client-runtime","chrome","visual"]),iu=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isObj"),le=o(e=>typeof e=="string"&&e!==""?e:void 0,"str"),De=o(e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,"num");function x4(e){let t=iu(e.raw)?e.raw:{},r=iu(t.request)?t.request:{},n=iu(t.span)?t.span:{},u=e.context??{},i=le(t.kind)??"",a=i===ya,l=(a?De(t.lastEndedAt):void 0)??De(e.timestamp)??0,d=De(r.startedAt)??De(n.startTime)??De(t.startedAt)??(a?De(t.firstStartedAt):void 0),c=De(r.endedAt)??De(n.endTime)??(d!==void 0&&De(t.durationMs)!==void 0?d+t.durationMs:void 0),p=Math.min(l,d??l),m=Math.max(l,c??l),f=iu(t.render)?t.render:{},h=iu(t.update)?t.update:{},g=i==="render"?le(f.componentName):i==="state-update"?le(h.path)?.split(".").slice(0,2).join("."):void 0,b=le(t.queue),x=le(t.jobId),$=String(e.source),w=le(t.project)??le(u.projectName);return{event:e,id:e.id,ts:l,from:p,to:m,kind:i,source:$,...le(u.requestId)?{requestId:le(u.requestId)}:{},...le(u.parentRequestId)?{parentRequestId:le(u.parentRequestId)}:{},...b&&x?{queueKey:`${b}#${x}`}:{},browser:m5.has($)||$==="memory"&&w===void 0,bookkeeping:p5.has(i),...w?{project:w}:{},...g?{subject:g}:{},...i==="fetch-start"||i==="fetch-done"?{route:ba(le(t.url)),method:le(t.method)}:i==="server-request"?{route:le(r.route),method:le(r.method)}:i==="gateway-request"?{route:ba(le(t.url)),method:le(t.method)}:{}}}s(x4,"DI"),o(x4,"readItem");function ba(e){if(!e)return;let t=e.search(/[?#]/),r=t===-1?e:e.slice(0,t),n=/^[a-z][a-z0-9+.-]*:\/\/[^/]*(\/.*)?$/i.exec(r);return n?n[1]??"/":r}s(ba,"ww"),o(ba,"pathOnly");var f5=o(e=>e.split(".")[0],"rootOf"),k4=o((e,t)=>e.reduce((r,n)=>Math.min(r,t(n)),1/0),"minOf"),C4=o((e,t)=>e.reduce((r,n)=>Math.max(r,t(n)),-1/0),"maxOf"),Ea=o((e,t)=>e.ts-t.ts||(e.id<t.id?-1:e.id>t.id?1:0),"compare"),wa=o(e=>e.requestId&&!e.requestId.startsWith("job:")?f5(e.requestId):void 0,"directFamilyOf");function A4(e){if(e.requestId?.startsWith("job:"))return e.requestId.slice(4);if(e.queueKey&&e.kind!=="queue-enqueued"&&!e.requestId)return e.queueKey}s(A4,"UI"),o(A4,"jobKeyOf");function _4(e,t){let r=e.filter(i=>!i.parentRequestId&&(i.kind==="server-request"||i.kind==="gateway-request"||i.kind==="fetch-start"||i.kind==="fetch-done")).sort((i,a)=>i.from-a.from||Ea(i,a));if(r.length<2)return[e];let n=[];for(let i of r){let a=n[n.length-1];a&&i.from<=a.to+t?a.to=Math.max(a.to,i.to):n.push({from:i.from,to:i.to})}if(n.length<2)return[e];let u=n.map(()=>[]);for(let i of e){let a=n.findIndex(l=>i.ts>=l.from-t&&i.ts<=l.to+t);if(a===-1){a=0;for(let l=0;l<n.length;l+=1)n[l].from<=i.ts&&(a=l)}u[a].push(i)}return u.filter(i=>i.length>0)}s(_4,"LI"),o(_4,"occurrencesOf");var I4={debug:0,info:1,warning:2,error:3,fatal:4};function Da(e,t){let r=[],n=[];for(let u of e){let i=n[n.length-1];i&&u.ts-i.ts>=t&&(r.push(n),n=[]),n.push(u)}return n.length&&r.push(n),r}s(Da,"$w"),o(Da,"runs");function S4(e,t={}){let r={...B4};for(let[w,C]of Object.entries(t))typeof C=="number"&&Number.isFinite(C)&&(r[w]=C);let n=new Set,u=[];for(let w of e)n.has(w.id)||(n.add(w.id),u.push(x4(w)));u.sort(Ea);let i=le(u[0]?.event.context?.flowId)??le(u[0]?.event.raw?.flowId)??"",a=new Map;for(let w of u)w.kind==="queue-enqueued"&&w.queueKey&&w.requestId&&!w.requestId.startsWith("job:")&&!a.has(w.queueKey)&&a.set(w.queueKey,w);let l=new Map,d=new Map,c=[];for(let w of u){let C=A4(w),k=wa(w);if(C!==void 0){let M=d.get(C);M?M.push(w):d.set(C,[w])}else if(k!==void 0){let M=l.get(k);M?M.push(w):l.set(k,[w])}else c.push(w)}let p=[],m=new Map;for(let[w,C]of l)_4(C,r.occurrenceSlackMs).forEach((k,M)=>{let y={id:`${i}~r:${w}${M===0?"":`@${M+1}`}`,kind:"request",items:k,requestId:w};p.push(y);for(let D of k)m.set(D,y)});for(let[w,C]of d){let k=a.get(w),M=k?m.get(k):void 0;M?M.items.push(...C):p.push({id:`${i}~r:job:${w}`,kind:"request",items:C,requestId:`job:${w}`})}let f=u.filter(w=>w.kind==="fetch-done"&&wa(w)!==void 0),h=new Map;for(let w of p)w.requestId&&h.set(w.requestId,[...h.get(w.requestId)??[],w]);let g=o((w,C)=>{let k=h.get(w);if(k)return k.find(M=>M.items.some(y=>y.kind==="fetch-done"&&y.ts===C))??k[k.length-1]},"owningUnit"),b=c.filter(w=>w.browser);for(let w of Da(b,r.burstGapMs)){let C=w[0].ts,k=f.filter(D=>D.ts<=C&&C-D.ts<=r.attachWindowMs),M=[...new Set(k.map(D=>wa(D)))];if(M.length===1){let D=g(M[0],k[k.length-1].ts);if(D){D.items.push(...w);continue}}let y=w.some(D=>D.kind==="flow-origin");p.push({id:`${i}~${y?"o":"u"}:${w[0].id}`,kind:y?"origin":"ui",items:w,...M.length>1?{after:M.sort()}:{}})}for(let w of Da(c.filter(C=>!C.browser),r.phaseGapMs))p.push({id:`${i}~a:${w[0].id}`,kind:"ambient",items:w});let x=F4(i,u.length,p,r),$=Fn(u.map(w=>w.event));return $?{...x,sql:$}:x}s(S4,"Iw"),o(S4,"segmentFlow");function F4(e,t,r,n){for(let f of r)f.items.sort(Ea);let u=r.map(f=>({unit:f,from:k4(f.items,h=>h.from),to:C4(f.items,h=>h.to)}));u.sort((f,h)=>f.from-h.from||(f.unit.id<h.unit.id?-1:1));let i=new Map,a=0,l=-1/0;for(let f of u)(a===0||f.from-l>=n.phaseGapMs)&&(a+=1),l=Math.max(l,f.to),i.set(f.unit,a);let d=[];for(let f of u){let h=j4(f.unit.items,n.maxSegmentEvents),g=f.unit.kind==="request"?Fn(f.unit.items.map(b=>b.event)):void 0;h.forEach((b,x)=>{let $=z4(e,f.unit,b,i.get(f.unit),h.length>1?{index:x+1,total:h.length}:void 0);d.push(g&&x===0?{...$,sql:g}:$)})}let c={};for(let f of d)for(let h of f.eventIds)c[h]=f.id;let p=[];for(let f of d){let h=p[f.phase-1];h||(h={index:f.phase,start:f.start,end:f.end,segmentIds:[]},p[f.phase-1]=h),h.start=Math.min(h.start,f.start),h.end=Math.max(h.end,f.end),h.segmentIds.push(f.id)}let m=d.reduce((f,h)=>f+h.counts.signal,0);return{flowId:e,segments:d,phases:p.filter(Boolean),assignment:c,stats:{events:t,signal:m,bookkeeping:t-m,segments:d.length,phases:p.filter(Boolean).length,largestSegment:d.reduce((f,h)=>Math.max(f,h.counts.total),0)}}}s(F4,"FI"),o(F4,"assemble");function j4(e,t){if(e.filter(i=>!i.bookkeeping).length<=t)return[e];let r=[],n=[],u=0;for(let i of e)!i.bookkeeping&&u===t&&(r.push(n),n=[],u=0),n.push(i),i.bookkeeping||(u+=1);return n.length&&r.push(n),r}s(j4,"BI"),o(j4,"chunk");function z4(e,t,r,n,u){let i={total:r.length,signal:0,bookkeeping:0,errors:0,warnings:0},a=new Set,l="debug";for(let h of r){h.bookkeeping?i.bookkeeping+=1:i.signal+=1;let g=String(h.event.severity);g==="error"||g==="fatal"?i.errors+=1:g==="warning"&&(i.warnings+=1),(I4[g]??1)>(I4[l]??0)&&(l=g),h.project&&a.add(h.project)}let d=t.kind==="ui"||t.kind==="origin"?M4(r):[],c=k4(r,h=>h.from),p=C4(r,h=>h.to),m=N4(t.items),f=t.id;return{id:u&&u.index>1?`${f}#${u.index}`:f,flowId:e,kind:t.kind,label:O4(t,r,m,u,d),phase:n,start:c,end:p,durationMs:p-c,eventIds:r.map(h=>h.id),counts:i,projects:[...a].sort(),...m.route?{route:m.route}:{},...m.method?{method:m.method}:{},...t.requestId?{requestId:t.requestId}:{},...t.after?{after:t.after}:{},...d.length?{hot:d}:{},...u?{part:u}:{},worstSeverity:l}}s(z4,"qI"),o(z4,"toSegment");function N4(e){let t=e.find(r=>r.kind==="fetch-start"&&r.route)??e.find(r=>r.kind==="server-request"&&!r.parentRequestId&&r.route)??e.find(r=>r.kind==="gateway-request"&&r.route)??e.find(r=>r.kind==="fetch-done"&&r.route);return{...t?.route?{route:t.route}:{},...t?.method?{method:t.method.toUpperCase()}:{}}}s(N4,"ZI"),o(N4,"routeOf");function M4(e){let t=new Map;for(let r of e)r.subject&&!r.bookkeeping&&t.set(r.subject,(t.get(r.subject)??0)+1);return[...t.entries()].sort((r,n)=>n[1]-r[1]||(r[0]<n[0]?-1:1)).slice(0,3).map(([r,n])=>n>1?`${r} \xD7${n}`:r)}s(M4,"VI"),o(M4,"hotOf");function O4(e,t,r,n,u){let i=n?` (part ${n.index}/${n.total})`:"";if(e.kind==="request"){if(r.route)return`${r.method?`${r.method} `:""}${r.route}${i}`;let a=t.find(l=>l.queueKey);return a?`job ${a.queueKey}${i}`:`request ${e.requestId??""}${i}`}return e.kind==="origin"?`${t.find(a=>a.kind==="flow-origin")?.event.title||"start"}${u.length?` \xB7 ${u.join(", ")}`:""}${i}`:e.kind==="ui"?`UI update${u.length?` \xB7 ${u.join(", ")}`:""}${i}`:`background${i}`}s(O4,"GI"),o(O4,"labelOf");var R4=50;function Fn(e){let t=new Map,r=new Map,n=new Set;for(let g of e){if(n.has(g.id))continue;n.add(g.id);let b=iu(g.raw)?g.raw:{},x=le(b.kind),$=le(g.context?.requestId);if(!$)continue;let w=le(b.project)??le(g.context?.projectName);if(x==="db-query"&&g.source==="db"){let C=r.get($)??{count:0,workMs:0,...w?{project:w}:{}};C.count+=1,C.workMs+=De(b.durationMs)??0,r.set($,C)}else if(x===ya){let C=le(b.accountId)??g.id,k=De(b.seq)??0,M=t.get(C);if(M&&M.seq>=k)continue;t.set(C,{requestId:$,...w?{project:w}:{},seq:k,basis:b.basis==="end"?"end":"settled",statements:De(b.statements)??0,failed:De(b.failed)??0,workMs:De(b.workMs)??0,recorded:De(b.recorded)??0,suppressed:De(b.suppressed)??0,unwritten:De(b.unwritten)??0})}}let u=new Map;for(let g of t.values()){let b=u.get(g.requestId);if(!b){u.set(g.requestId,{...g});continue}g.basis==="settled"&&(b.basis="settled"),b.statements+=g.statements,b.failed+=g.failed,b.workMs+=g.workMs,b.recorded+=g.recorded,b.suppressed+=g.suppressed,b.unwritten+=g.unwritten}let i=[...new Set([...r.keys(),...u.keys()])].sort();if(i.length===0)return;let a={statements:0,failed:0,workMs:0,recorded:0,suppressed:0,unwritten:0},l={statements:0,workMs:0},d=[];for(let g of i){let b=r.get(g),x=u.get(g),$=b?.count??0;l.statements+=$,l.workMs+=b?.workMs??0;let w=!x||$>x.statements?"unverified":$===x.statements?"complete":"incomplete";x&&w!=="unverified"&&(a.statements+=x.statements,a.failed+=x.failed,a.workMs+=x.workMs,a.recorded+=x.recorded,a.suppressed+=x.suppressed,a.unwritten+=x.unwritten);let C=b?.project??x?.project;d.push({requestId:g,...C?{project:C}:{},status:w,observed:$,observedWorkMs:b?.workMs??0,...x?{basis:x.basis,statements:x.statements,failed:x.failed,workMs:x.workMs,recorded:x.recorded,suppressed:x.suppressed,unwritten:x.unwritten}:{}})}let c=o(g=>d.filter(b=>b.status===g).length,"tally"),p=c("unverified"),m=c("incomplete"),f=o(g=>(g.statements??0)-g.observed,"missing"),h=d.filter(g=>g.status!=="complete").sort((g,b)=>(g.status==="incomplete"?0:1)-(b.status==="incomplete"?0:1)||f(b)-f(g)||(g.requestId<b.requestId?-1:g.requestId>b.requestId?1:0));return{status:p>0?"unverified":m>0?"incomplete":"complete",requests:d.length,complete:c("complete"),incomplete:m,unverified:p,settled:d.filter(g=>g.status!=="unverified"&&g.basis==="settled").length,observed:l,accounted:a,gaps:h.slice(0,R4),gapsTruncated:h.length>R4}}s(Fn,"pi"),o(Fn,"sqlAccountingOf");var v={};ut(v,{$brand:s(()=>q4,"$brand"),$input:s(()=>$v,"$input"),$output:s(()=>Dv,"$output"),NEVER:s(()=>U4,"NEVER"),TimePrecision:s(()=>xv,"TimePrecision"),ZodAny:s(()=>bl,"ZodAny"),ZodArray:s(()=>kl,"ZodArray"),ZodBase64:s(()=>Ci,"ZodBase64"),ZodBase64URL:s(()=>Ai,"ZodBase64URL"),ZodBigInt:s(()=>jr,"ZodBigInt"),ZodBigIntFormat:s(()=>ji,"ZodBigIntFormat"),ZodBoolean:s(()=>Fr,"ZodBoolean"),ZodCIDRv4:s(()=>xi,"ZodCIDRv4"),ZodCIDRv6:s(()=>ki,"ZodCIDRv6"),ZodCUID:s(()=>yi,"ZodCUID"),ZodCUID2:s(()=>bi,"ZodCUID2"),ZodCatch:s(()=>ud,"ZodCatch"),ZodCodec:s(()=>qr,"ZodCodec"),ZodCustom:s(()=>Lr,"ZodCustom"),ZodCustomStringFormat:s(()=>vu,"ZodCustomStringFormat"),ZodDate:s(()=>Ni,"ZodDate"),ZodDefault:s(()=>Yl,"ZodDefault"),ZodDiscriminatedUnion:s(()=>jl,"ZodDiscriminatedUnion"),ZodE164:s(()=>_i,"ZodE164"),ZodEmail:s(()=>hi,"ZodEmail"),ZodEmoji:s(()=>gi,"ZodEmoji"),ZodEnum:s(()=>Eu,"ZodEnum"),ZodError:s(()=>XD,"ZodError"),ZodExactOptional:s(()=>Kl,"ZodExactOptional"),ZodFile:s(()=>Vl,"ZodFile"),ZodFirstPartyTypeKind:s(()=>Ed,"ZodFirstPartyTypeKind"),ZodFunction:s(()=>fd,"ZodFunction"),ZodGUID:s(()=>Ar,"ZodGUID"),ZodIPv4:s(()=>$i,"ZodIPv4"),ZodIPv6:s(()=>Bi,"ZodIPv6"),ZodISODate:s(()=>k0,"ZodISODate"),ZodISODateTime:s(()=>B0,"ZodISODateTime"),ZodISODuration:s(()=>I0,"ZodISODuration"),ZodISOTime:s(()=>A0,"ZodISOTime"),ZodIntersection:s(()=>Nl,"ZodIntersection"),ZodIssueCode:s(()=>YD,"ZodIssueCode"),ZodJWT:s(()=>Ii,"ZodJWT"),ZodKSUID:s(()=>Di,"ZodKSUID"),ZodLazy:s(()=>cd,"ZodLazy"),ZodLiteral:s(()=>Ll,"ZodLiteral"),ZodMAC:s(()=>G0,"ZodMAC"),ZodMap:s(()=>Tl,"ZodMap"),ZodNaN:s(()=>rd,"ZodNaN"),ZodNanoID:s(()=>vi,"ZodNanoID"),ZodNever:s(()=>Dl,"ZodNever"),ZodNonOptional:s(()=>Zi,"ZodNonOptional"),ZodNull:s(()=>yl,"ZodNull"),ZodNullable:s(()=>Hl,"ZodNullable"),ZodNumber:s(()=>Ir,"ZodNumber"),ZodNumberFormat:s(()=>Ut,"ZodNumberFormat"),ZodObject:s(()=>Nr,"ZodObject"),ZodOptional:s(()=>Ti,"ZodOptional"),ZodPipe:s(()=>Pr,"ZodPipe"),ZodPrefault:s(()=>Ql,"ZodPrefault"),ZodPreprocess:s(()=>ad,"ZodPreprocess"),ZodPromise:s(()=>pd,"ZodPromise"),ZodReadonly:s(()=>od,"ZodReadonly"),ZodRealError:s(()=>Ne,"ZodRealError"),ZodRecord:s(()=>bu,"ZodRecord"),ZodSet:s(()=>Ul,"ZodSet"),ZodString:s(()=>Cr,"ZodString"),ZodStringFormat:s(()=>ae,"ZodStringFormat"),ZodSuccess:s(()=>ed,"ZodSuccess"),ZodSymbol:s(()=>fl,"ZodSymbol"),ZodTemplateLiteral:s(()=>ld,"ZodTemplateLiteral"),ZodTransform:s(()=>Gl,"ZodTransform"),ZodTuple:s(()=>Ml,"ZodTuple"),ZodType:s(()=>Q,"ZodType"),ZodULID:s(()=>Ei,"ZodULID"),ZodURL:s(()=>_r,"ZodURL"),ZodUUID:s(()=>He,"ZodUUID"),ZodUndefined:s(()=>gl,"ZodUndefined"),ZodUnion:s(()=>Mr,"ZodUnion"),ZodUnknown:s(()=>wl,"ZodUnknown"),ZodVoid:s(()=>$l,"ZodVoid"),ZodXID:s(()=>wi,"ZodXID"),ZodXor:s(()=>Sl,"ZodXor"),_ZodString:s(()=>fi,"_ZodString"),_default:s(()=>Ui,"_default"),_function:s(()=>Zr,"_function"),any:s(()=>El,"any"),array:s(()=>yu,"array"),base64:s(()=>Q0,"base64"),base64url:s(()=>el,"base64url"),bigint:s(()=>cl,"bigint"),boolean:s(()=>Fi,"boolean"),catch:s(()=>Ji,"catch"),check:s(()=>hd,"check"),cidrv4:s(()=>X0,"cidrv4"),cidrv6:s(()=>Y0,"cidrv6"),clone:s(()=>Se,"clone"),codec:s(()=>id,"codec"),coerce:s(()=>r3,"coerce"),config:s(()=>Ee,"config"),core:s(()=>T4,"core"),cuid:s(()=>q0,"cuid"),cuid2:s(()=>Z0,"cuid2"),custom:s(()=>gd,"custom"),date:s(()=>xl,"date"),decode:s(()=>U1,"decode"),decodeAsync:s(()=>Z1,"decodeAsync"),describe:s(()=>K1,"describe"),discriminatedUnion:s(()=>zl,"discriminatedUnion"),e164:s(()=>tl,"e164"),email:s(()=>F0,"email"),emoji:s(()=>P0,"emoji"),encode:s(()=>P1,"encode"),encodeAsync:s(()=>q1,"encodeAsync"),endsWith:s(()=>br,"endsWith"),enum:s(()=>Rr,"enum"),exactOptional:s(()=>Pi,"exactOptional"),file:s(()=>Wl,"file"),flattenError:s(()=>On,"flattenError"),float32:s(()=>al,"float32"),float64:s(()=>ol,"float64"),formatError:s(()=>Rn,"formatError"),fromJSONSchema:s(()=>u3,"fromJSONSchema"),function:s(()=>Zr,"function"),getErrorMap:s(()=>Q1,"getErrorMap"),globalRegistry:s(()=>Re,"globalRegistry"),gt:s(()=>it,"gt"),gte:s(()=>ke,"gte"),guid:s(()=>j0,"guid"),hash:s(()=>sl,"hash"),hex:s(()=>il,"hex"),hostname:s(()=>nl,"hostname"),httpUrl:s(()=>T0,"httpUrl"),includes:s(()=>vr,"includes"),instanceof:s(()=>vd,"instanceof"),int:s(()=>Sr,"int"),int32:s(()=>ll,"int32"),int64:s(()=>pl,"int64"),intersection:s(()=>Mi,"intersection"),invertCodec:s(()=>sd,"invertCodec"),ipv4:s(()=>W0,"ipv4"),ipv6:s(()=>H0,"ipv6"),iso:s(()=>$0,"iso"),json:s(()=>yd,"json"),jwt:s(()=>ul,"jwt"),keyof:s(()=>Cl,"keyof"),ksuid:s(()=>V0,"ksuid"),lazy:s(()=>Wi,"lazy"),length:s(()=>mu,"length"),literal:s(()=>Jl,"literal"),locales:s(()=>ko,"locales"),looseObject:s(()=>Il,"looseObject"),looseRecord:s(()=>Rl,"looseRecord"),lowercase:s(()=>hr,"lowercase"),lt:s(()=>nt,"lt"),lte:s(()=>ze,"lte"),mac:s(()=>K0,"mac"),map:s(()=>Pl,"map"),maxLength:s(()=>pu,"maxLength"),maxSize:s(()=>Ot,"maxSize"),meta:s(()=>H1,"meta"),mime:s(()=>Er,"mime"),minLength:s(()=>ht,"minLength"),minSize:s(()=>st,"minSize"),multipleOf:s(()=>Mt,"multipleOf"),nan:s(()=>nd,"nan"),nanoid:s(()=>U0,"nanoid"),nativeEnum:s(()=>Zl,"nativeEnum"),negative:s(()=>di,"negative"),never:s(()=>zr,"never"),nonnegative:s(()=>pi,"nonnegative"),nonoptional:s(()=>Li,"nonoptional"),nonpositive:s(()=>ci,"nonpositive"),normalize:s(()=>wr,"normalize"),null:s(()=>zi,"null"),nullable:s(()=>Du,"nullable"),nullish:s(()=>Xl,"nullish"),number:s(()=>Si,"number"),object:s(()=>Al,"object"),optional:s(()=>wu,"optional"),overwrite:s(()=>Ke,"overwrite"),parse:s(()=>M1,"parse"),parseAsync:s(()=>O1,"parseAsync"),partialRecord:s(()=>Ol,"partialRecord"),pipe:s(()=>Ur,"pipe"),positive:s(()=>li,"positive"),prefault:s(()=>qi,"prefault"),preprocess:s(()=>bd,"preprocess"),prettifyError:s(()=>za,"prettifyError"),promise:s(()=>md,"promise"),property:s(()=>mi,"property"),readonly:s(()=>Vi,"readonly"),record:s(()=>Ri,"record"),refine:s(()=>Gi,"refine"),regex:s(()=>fr,"regex"),regexes:s(()=>ft,"regexes"),registry:s(()=>qn,"registry"),safeDecode:s(()=>J1,"safeDecode"),safeDecodeAsync:s(()=>W1,"safeDecodeAsync"),safeEncode:s(()=>L1,"safeEncode"),safeEncodeAsync:s(()=>V1,"safeEncodeAsync"),safeParse:s(()=>R1,"safeParse"),safeParseAsync:s(()=>T1,"safeParseAsync"),set:s(()=>ql,"set"),setErrorMap:s(()=>Y1,"setErrorMap"),size:s(()=>cu,"size"),slugify:s(()=>xr,"slugify"),startsWith:s(()=>yr,"startsWith"),strictObject:s(()=>_l,"strictObject"),string:s(()=>gu,"string"),stringFormat:s(()=>rl,"stringFormat"),stringbool:s(()=>X1,"stringbool"),success:s(()=>td,"success"),superRefine:s(()=>Ki,"superRefine"),symbol:s(()=>hl,"symbol"),templateLiteral:s(()=>dd,"templateLiteral"),toJSONSchema:s(()=>D0,"toJSONSchema"),toLowerCase:s(()=>$r,"toLowerCase"),toUpperCase:s(()=>Br,"toUpperCase"),transform:s(()=>Tr,"transform"),treeifyError:s(()=>Fa,"treeifyError"),trim:s(()=>Dr,"trim"),tuple:s(()=>Oi,"tuple"),uint32:s(()=>dl,"uint32"),uint64:s(()=>ml,"uint64"),ulid:s(()=>L0,"ulid"),undefined:s(()=>vl,"undefined"),union:s(()=>Or,"union"),unknown:s(()=>gt,"unknown"),uppercase:s(()=>gr,"uppercase"),url:s(()=>R0,"url"),util:s(()=>te,"util"),uuid:s(()=>z0,"uuid"),uuidv4:s(()=>N0,"uuidv4"),uuidv6:s(()=>M0,"uuidv6"),uuidv7:s(()=>O0,"uuidv7"),void:s(()=>Bl,"void"),xid:s(()=>J0,"xid"),xor:s(()=>Fl,"xor")});var T4={};ut(T4,{$ZodAny:s(()=>Wh,"$ZodAny"),$ZodArray:s(()=>Yh,"$ZodArray"),$ZodAsyncError:s(()=>jt,"$ZodAsyncError"),$ZodBase64:s(()=>Oh,"$ZodBase64"),$ZodBase64URL:s(()=>Rh,"$ZodBase64URL"),$ZodBigInt:s(()=>no,"$ZodBigInt"),$ZodBigIntFormat:s(()=>Zh,"$ZodBigIntFormat"),$ZodBoolean:s(()=>ro,"$ZodBoolean"),$ZodCIDRv4:s(()=>Nh,"$ZodCIDRv4"),$ZodCIDRv6:s(()=>Mh,"$ZodCIDRv6"),$ZodCUID:s(()=>$h,"$ZodCUID"),$ZodCUID2:s(()=>Bh,"$ZodCUID2"),$ZodCatch:s(()=>vg,"$ZodCatch"),$ZodCheck:s(()=>de,"$ZodCheck"),$ZodCheckBigIntFormat:s(()=>Qf,"$ZodCheckBigIntFormat"),$ZodCheckEndsWith:s(()=>ch,"$ZodCheckEndsWith"),$ZodCheckGreaterThan:s(()=>Ya,"$ZodCheckGreaterThan"),$ZodCheckIncludes:s(()=>lh,"$ZodCheckIncludes"),$ZodCheckLengthEquals:s(()=>ih,"$ZodCheckLengthEquals"),$ZodCheckLessThan:s(()=>Xa,"$ZodCheckLessThan"),$ZodCheckLowerCase:s(()=>ah,"$ZodCheckLowerCase"),$ZodCheckMaxLength:s(()=>rh,"$ZodCheckMaxLength"),$ZodCheckMaxSize:s(()=>eh,"$ZodCheckMaxSize"),$ZodCheckMimeType:s(()=>mh,"$ZodCheckMimeType"),$ZodCheckMinLength:s(()=>nh,"$ZodCheckMinLength"),$ZodCheckMinSize:s(()=>th,"$ZodCheckMinSize"),$ZodCheckMultipleOf:s(()=>Xf,"$ZodCheckMultipleOf"),$ZodCheckNumberFormat:s(()=>Yf,"$ZodCheckNumberFormat"),$ZodCheckOverwrite:s(()=>fh,"$ZodCheckOverwrite"),$ZodCheckProperty:s(()=>ph,"$ZodCheckProperty"),$ZodCheckRegex:s(()=>sh,"$ZodCheckRegex"),$ZodCheckSizeEquals:s(()=>uh,"$ZodCheckSizeEquals"),$ZodCheckStartsWith:s(()=>dh,"$ZodCheckStartsWith"),$ZodCheckStringFormat:s(()=>ir,"$ZodCheckStringFormat"),$ZodCheckUpperCase:s(()=>oh,"$ZodCheckUpperCase"),$ZodCodec:s(()=>$o,"$ZodCodec"),$ZodCustom:s(()=>xg,"$ZodCustom"),$ZodCustomStringFormat:s(()=>Uh,"$ZodCustomStringFormat"),$ZodDate:s(()=>Xh,"$ZodDate"),$ZodDefault:s(()=>mg,"$ZodDefault"),$ZodDiscriminatedUnion:s(()=>ug,"$ZodDiscriminatedUnion"),$ZodE164:s(()=>Th,"$ZodE164"),$ZodEmail:s(()=>bh,"$ZodEmail"),$ZodEmoji:s(()=>wh,"$ZodEmoji"),$ZodEncodeError:s(()=>jn,"$ZodEncodeError"),$ZodEnum:s(()=>ag,"$ZodEnum"),$ZodError:s(()=>Sa,"$ZodError"),$ZodExactOptional:s(()=>cg,"$ZodExactOptional"),$ZodFile:s(()=>lg,"$ZodFile"),$ZodFunction:s(()=>Dg,"$ZodFunction"),$ZodGUID:s(()=>vh,"$ZodGUID"),$ZodIPv4:s(()=>Fh,"$ZodIPv4"),$ZodIPv6:s(()=>jh,"$ZodIPv6"),$ZodISODate:s(()=>_h,"$ZodISODate"),$ZodISODateTime:s(()=>Ah,"$ZodISODateTime"),$ZodISODuration:s(()=>Sh,"$ZodISODuration"),$ZodISOTime:s(()=>Ih,"$ZodISOTime"),$ZodIntersection:s(()=>rg,"$ZodIntersection"),$ZodJWT:s(()=>Ph,"$ZodJWT"),$ZodKSUID:s(()=>Ch,"$ZodKSUID"),$ZodLazy:s(()=>Bg,"$ZodLazy"),$ZodLiteral:s(()=>og,"$ZodLiteral"),$ZodMAC:s(()=>zh,"$ZodMAC"),$ZodMap:s(()=>ig,"$ZodMap"),$ZodNaN:s(()=>yg,"$ZodNaN"),$ZodNanoID:s(()=>Dh,"$ZodNanoID"),$ZodNever:s(()=>Kh,"$ZodNever"),$ZodNonOptional:s(()=>hg,"$ZodNonOptional"),$ZodNull:s(()=>Vh,"$ZodNull"),$ZodNullable:s(()=>pg,"$ZodNullable"),$ZodNumber:s(()=>uo,"$ZodNumber"),$ZodNumberFormat:s(()=>qh,"$ZodNumberFormat"),$ZodObject:s(()=>Qh,"$ZodObject"),$ZodObjectJIT:s(()=>eg,"$ZodObjectJIT"),$ZodOptional:s(()=>bo,"$ZodOptional"),$ZodPipe:s(()=>Do,"$ZodPipe"),$ZodPrefault:s(()=>fg,"$ZodPrefault"),$ZodPreprocess:s(()=>bg,"$ZodPreprocess"),$ZodPromise:s(()=>$g,"$ZodPromise"),$ZodReadonly:s(()=>Eg,"$ZodReadonly"),$ZodRealError:s(()=>je,"$ZodRealError"),$ZodRecord:s(()=>ng,"$ZodRecord"),$ZodRegistry:s(()=>Bv,"$ZodRegistry"),$ZodSet:s(()=>sg,"$ZodSet"),$ZodString:s(()=>sr,"$ZodString"),$ZodStringFormat:s(()=>se,"$ZodStringFormat"),$ZodSuccess:s(()=>gg,"$ZodSuccess"),$ZodSymbol:s(()=>Lh,"$ZodSymbol"),$ZodTemplateLiteral:s(()=>wg,"$ZodTemplateLiteral"),$ZodTransform:s(()=>dg,"$ZodTransform"),$ZodTuple:s(()=>po,"$ZodTuple"),$ZodType:s(()=>X,"$ZodType"),$ZodULID:s(()=>xh,"$ZodULID"),$ZodURL:s(()=>Eh,"$ZodURL"),$ZodUUID:s(()=>yh,"$ZodUUID"),$ZodUndefined:s(()=>Jh,"$ZodUndefined"),$ZodUnion:s(()=>Pn,"$ZodUnion"),$ZodUnknown:s(()=>Gh,"$ZodUnknown"),$ZodVoid:s(()=>Hh,"$ZodVoid"),$ZodXID:s(()=>kh,"$ZodXID"),$ZodXor:s(()=>tg,"$ZodXor"),$brand:s(()=>q4,"$brand"),$constructor:s(()=>B,"$constructor"),$input:s(()=>$v,"$input"),$output:s(()=>Dv,"$output"),Doc:s(()=>hh,"Doc"),JSONSchema:s(()=>HD,"JSONSchema"),JSONSchemaGenerator:s(()=>KD,"JSONSchemaGenerator"),NEVER:s(()=>U4,"NEVER"),TimePrecision:s(()=>xv,"TimePrecision"),_any:s(()=>r0,"_any"),_array:s(()=>d0,"_array"),_base64:s(()=>ii,"_base64"),_base64url:s(()=>si,"_base64url"),_bigint:s(()=>Ho,"_bigint"),_boolean:s(()=>Go,"_boolean"),_catch:s(()=>Zv,"_catch"),_check:s(()=>h0,"_check"),_cidrv4:s(()=>ri,"_cidrv4"),_cidrv6:s(()=>ni,"_cidrv6"),_coercedBigint:s(()=>Xo,"_coercedBigint"),_coercedBoolean:s(()=>Ko,"_coercedBoolean"),_coercedDate:s(()=>o0,"_coercedDate"),_coercedNumber:s(()=>qo,"_coercedNumber"),_coercedString:s(()=>No,"_coercedString"),_cuid:s(()=>Hn,"_cuid"),_cuid2:s(()=>Xn,"_cuid2"),_custom:s(()=>p0,"_custom"),_date:s(()=>a0,"_date"),_decode:s(()=>Ra,"_decode"),_decodeAsync:s(()=>Pa,"_decodeAsync"),_default:s(()=>Pv,"_default"),_discriminatedUnion:s(()=>Av,"_discriminatedUnion"),_e164:s(()=>ai,"_e164"),_email:s(()=>Zn,"_email"),_emoji:s(()=>Gn,"_emoji"),_encode:s(()=>Oa,"_encode"),_encodeAsync:s(()=>Ta,"_encodeAsync"),_endsWith:s(()=>br,"_endsWith"),_enum:s(()=>zv,"_enum"),_file:s(()=>c0,"_file"),_float32:s(()=>Lo,"_float32"),_float64:s(()=>Jo,"_float64"),_gt:s(()=>it,"_gt"),_gte:s(()=>ke,"_gte"),_guid:s(()=>pr,"_guid"),_includes:s(()=>vr,"_includes"),_int:s(()=>Zo,"_int"),_int32:s(()=>Vo,"_int32"),_int64:s(()=>Yo,"_int64"),_intersection:s(()=>_v,"_intersection"),_ipv4:s(()=>ti,"_ipv4"),_ipv6:s(()=>ui,"_ipv6"),_isoDate:s(()=>Ro,"_isoDate"),_isoDateTime:s(()=>Oo,"_isoDateTime"),_isoDuration:s(()=>Po,"_isoDuration"),_isoTime:s(()=>To,"_isoTime"),_jwt:s(()=>oi,"_jwt"),_ksuid:s(()=>ei,"_ksuid"),_lazy:s(()=>Wv,"_lazy"),_length:s(()=>mu,"_length"),_literal:s(()=>Mv,"_literal"),_lowercase:s(()=>hr,"_lowercase"),_lt:s(()=>nt,"_lt"),_lte:s(()=>ze,"_lte"),_mac:s(()=>Mo,"_mac"),_map:s(()=>Fv,"_map"),_max:s(()=>ze,"_max"),_maxLength:s(()=>pu,"_maxLength"),_maxSize:s(()=>Ot,"_maxSize"),_mime:s(()=>Er,"_mime"),_min:s(()=>ke,"_min"),_minLength:s(()=>ht,"_minLength"),_minSize:s(()=>st,"_minSize"),_multipleOf:s(()=>Mt,"_multipleOf"),_nan:s(()=>l0,"_nan"),_nanoid:s(()=>Kn,"_nanoid"),_nativeEnum:s(()=>Nv,"_nativeEnum"),_negative:s(()=>di,"_negative"),_never:s(()=>i0,"_never"),_nonnegative:s(()=>pi,"_nonnegative"),_nonoptional:s(()=>Uv,"_nonoptional"),_nonpositive:s(()=>ci,"_nonpositive"),_normalize:s(()=>wr,"_normalize"),_null:s(()=>u0,"_null"),_nullable:s(()=>Tv,"_nullable"),_number:s(()=>Uo,"_number"),_optional:s(()=>Rv,"_optional"),_overwrite:s(()=>Ke,"_overwrite"),_parse:s(()=>tr,"_parse"),_parseAsync:s(()=>ur,"_parseAsync"),_pipe:s(()=>Lv,"_pipe"),_positive:s(()=>li,"_positive"),_promise:s(()=>Gv,"_promise"),_property:s(()=>mi,"_property"),_readonly:s(()=>Jv,"_readonly"),_record:s(()=>Sv,"_record"),_refine:s(()=>m0,"_refine"),_regex:s(()=>fr,"_regex"),_safeDecode:s(()=>qa,"_safeDecode"),_safeDecodeAsync:s(()=>La,"_safeDecodeAsync"),_safeEncode:s(()=>Ua,"_safeEncode"),_safeEncodeAsync:s(()=>Za,"_safeEncodeAsync"),_safeParse:s(()=>rr,"_safeParse"),_safeParseAsync:s(()=>nr,"_safeParseAsync"),_set:s(()=>jv,"_set"),_size:s(()=>cu,"_size"),_slugify:s(()=>xr,"_slugify"),_startsWith:s(()=>yr,"_startsWith"),_string:s(()=>zo,"_string"),_stringFormat:s(()=>fu,"_stringFormat"),_stringbool:s(()=>y0,"_stringbool"),_success:s(()=>qv,"_success"),_superRefine:s(()=>f0,"_superRefine"),_symbol:s(()=>e0,"_symbol"),_templateLiteral:s(()=>Vv,"_templateLiteral"),_toLowerCase:s(()=>$r,"_toLowerCase"),_toUpperCase:s(()=>Br,"_toUpperCase"),_transform:s(()=>Ov,"_transform"),_trim:s(()=>Dr,"_trim"),_tuple:s(()=>Iv,"_tuple"),_uint32:s(()=>Wo,"_uint32"),_uint64:s(()=>Qo,"_uint64"),_ulid:s(()=>Yn,"_ulid"),_undefined:s(()=>t0,"_undefined"),_union:s(()=>kv,"_union"),_unknown:s(()=>n0,"_unknown"),_uppercase:s(()=>gr,"_uppercase"),_url:s(()=>mr,"_url"),_uuid:s(()=>Ln,"_uuid"),_uuidv4:s(()=>Jn,"_uuidv4"),_uuidv6:s(()=>Vn,"_uuidv6"),_uuidv7:s(()=>Wn,"_uuidv7"),_void:s(()=>s0,"_void"),_xid:s(()=>Qn,"_xid"),_xor:s(()=>Cv,"_xor"),clone:s(()=>Se,"clone"),config:s(()=>Ee,"config"),createStandardJSONSchemaMethod:s(()=>kr,"createStandardJSONSchemaMethod"),createToJSONSchemaMethod:s(()=>Kv,"createToJSONSchemaMethod"),decode:s(()=>y5,"decode"),decodeAsync:s(()=>E5,"decodeAsync"),describe:s(()=>g0,"describe"),encode:s(()=>v5,"encode"),encodeAsync:s(()=>b5,"encodeAsync"),extractDefs:s(()=>Tt,"extractDefs"),finalize:s(()=>Pt,"finalize"),flattenError:s(()=>On,"flattenError"),formatError:s(()=>Rn,"formatError"),globalConfig:s(()=>Ku,"globalConfig"),globalRegistry:s(()=>Re,"globalRegistry"),initializeContext:s(()=>Rt,"initializeContext"),isValidBase64:s(()=>Tn,"isValidBase64"),isValidBase64URL:s(()=>eo,"isValidBase64URL"),isValidJWT:s(()=>to,"isValidJWT"),locales:s(()=>ko,"locales"),meta:s(()=>v0,"meta"),parse:s(()=>Na,"parse"),parseAsync:s(()=>Ma,"parseAsync"),prettifyError:s(()=>za,"prettifyError"),process:s(()=>ne,"process"),regexes:s(()=>ft,"regexes"),registry:s(()=>qn,"registry"),safeDecode:s(()=>D5,"safeDecode"),safeDecodeAsync:s(()=>B5,"safeDecodeAsync"),safeEncode:s(()=>w5,"safeEncode"),safeEncodeAsync:s(()=>$5,"safeEncodeAsync"),safeParse:s(()=>Ef,"safeParse"),safeParseAsync:s(()=>wf,"safeParseAsync"),toDotPath:s(()=>ja,"toDotPath"),toJSONSchema:s(()=>D0,"toJSONSchema"),treeifyError:s(()=>Fa,"treeifyError"),util:s(()=>te,"util"),version:s(()=>gh,"version")});var P4,U4=Object.freeze({status:"aborted"});function B(e,t,r){function n(l,d){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:d,constr:a,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,d);let c=a.prototype,p=Object.keys(c);for(let m=0;m<p.length;m++){let f=p[m];f in l||(l[f]=c[f].bind(l))}}s(n,"o"),o(n,"init");let u=r?.Parent??Object;class i extends u{static{s(this,"i")}static{o(this,"Definition")}}Object.defineProperty(i,"name",{value:e});function a(l){var d;let c=r?.Parent?new i:this;n(c,l),(d=c._zod).deferred??(d.deferred=[]);for(let p of c._zod.deferred)p();return c}return s(a,"s"),o(a,"_"),Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:o(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(a,"name",{value:e}),a}s(B,"k"),o(B,"$constructor");var q4=Symbol("zod_brand"),jt=class extends Error{static{s(this,"Qe")}static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},jn=class extends Error{static{s(this,"St")}static{o(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(P4=globalThis).__zod_globalConfig??(P4.__zod_globalConfig={});var Ku=globalThis.__zod_globalConfig;function Ee(e){return e&&Object.assign(Ku,e),Ku}s(Ee,"me"),o(Ee,"config");var te={};ut(te,{BIGINT_FORMAT_RANGES:s(()=>sf,"BIGINT_FORMAT_RANGES"),Class:s(()=>g5,"Class"),NUMBER_FORMAT_RANGES:s(()=>nf,"NUMBER_FORMAT_RANGES"),aborted:s(()=>mt,"aborted"),allowsEval:s(()=>ef,"allowsEval"),assert:s(()=>W4,"assert"),assertEqual:s(()=>Z4,"assertEqual"),assertIs:s(()=>J4,"assertIs"),assertNever:s(()=>V4,"assertNever"),assertNotEqual:s(()=>L4,"assertNotEqual"),assignProp:s(()=>rt,"assignProp"),base64ToUint8Array:s(()=>_a,"base64ToUint8Array"),base64urlToUint8Array:s(()=>hf,"base64urlToUint8Array"),cached:s(()=>su,"cached"),captureStackTrace:s(()=>xa,"captureStackTrace"),cleanEnum:s(()=>ff,"cleanEnum"),cleanRegex:s(()=>Xu,"cleanRegex"),clone:s(()=>Se,"clone"),cloneDef:s(()=>H4,"cloneDef"),createTransparentProxy:s(()=>rf,"createTransparentProxy"),defineLazy:s(()=>ee,"defineLazy"),esc:s(()=>Nn,"esc"),escapeRegex:s(()=>Ge,"escapeRegex"),explicitlyAborted:s(()=>Aa,"explicitlyAborted"),extend:s(()=>lf,"extend"),finalizeIssue:s(()=>Ae,"finalizeIssue"),floatSafeRemainder:s(()=>$a,"floatSafeRemainder"),getElementAtPath:s(()=>X4,"getElementAtPath"),getEnumValues:s(()=>zn,"getEnumValues"),getLengthableOrigin:s(()=>Qu,"getLengthableOrigin"),getParsedType:s(()=>h5,"getParsedType"),getSizableOrigin:s(()=>Yu,"getSizableOrigin"),hexToUint8Array:s(()=>vf,"hexToUint8Array"),isObject:s(()=>zt,"isObject"),isPlainObject:s(()=>pt,"isPlainObject"),issue:s(()=>er,"issue"),joinValues:s(()=>O,"joinValues"),jsonStringifyReplacer:s(()=>Hu,"jsonStringifyReplacer"),merge:s(()=>cf,"merge"),mergeDefs:s(()=>We,"mergeDefs"),normalizeParams:s(()=>T,"normalizeParams"),nullish:s(()=>ct,"nullish"),numKeys:s(()=>tf,"numKeys"),objectClone:s(()=>K4,"objectClone"),omit:s(()=>of,"omit"),optionalKeys:s(()=>Ca,"optionalKeys"),parsedType:s(()=>G,"parsedType"),partial:s(()=>pf,"partial"),pick:s(()=>af,"pick"),prefixIssues:s(()=>Fe,"prefixIssues"),primitiveTypes:s(()=>uf,"primitiveTypes"),promiseAllObject:s(()=>Y4,"promiseAllObject"),propertyKeyTypes:s(()=>Mn,"propertyKeyTypes"),randomString:s(()=>Q4,"randomString"),required:s(()=>mf,"required"),safeExtend:s(()=>df,"safeExtend"),shallowClone:s(()=>ka,"shallowClone"),slugify:s(()=>Ba,"slugify"),stringifyPrimitive:s(()=>V,"stringifyPrimitive"),uint8ArrayToBase64:s(()=>Ia,"uint8ArrayToBase64"),uint8ArrayToBase64url:s(()=>gf,"uint8ArrayToBase64url"),uint8ArrayToHex:s(()=>yf,"uint8ArrayToHex"),unwrapMessage:s(()=>au,"unwrapMessage")});function Z4(e){return e}s(Z4,"WI"),o(Z4,"assertEqual");function L4(e){return e}s(L4,"JI"),o(L4,"assertNotEqual");function J4(e){}s(J4,"KI"),o(J4,"assertIs");function V4(e){throw new Error("Unexpected value in exhaustive check")}s(V4,"HI"),o(V4,"assertNever");function W4(e){}s(W4,"XI"),o(W4,"assert");function zn(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,n])=>t.indexOf(+r)===-1).map(([r,n])=>n)}s(zn,"On"),o(zn,"getEnumValues");function O(e,t="|"){return e.map(r=>V(r)).join(t)}s(O,"E"),o(O,"joinValues");function Hu(e,t){return typeof t=="bigint"?t.toString():t}s(Hu,"kr"),o(Hu,"jsonStringifyReplacer");function su(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw new Error("cached value already set")}}}s(su,"Sr"),o(su,"cached");function ct(e){return e==null}s(ct,"It"),o(ct,"nullish");function Xu(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}s(Xu,"zn"),o(Xu,"cleanRegex");function $a(e,t){let r=e/t,n=Math.round(r),u=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<u?0:r-n}s($a,"Oc"),o($a,"floatSafeRemainder");var G4=Symbol("evaluating");function ee(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==G4)return n===void 0&&(n=G4,n=r()),n},set(u){Object.defineProperty(e,t,{value:u})},configurable:!0})}s(ee,"Q"),o(ee,"defineLazy");function K4(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}s(K4,"YI"),o(K4,"objectClone");function rt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}s(rt,"Rt"),o(rt,"assignProp");function We(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}s(We,"gt"),o(We,"mergeDefs");function H4(e){return We(e._zod.def)}s(H4,"QI"),o(H4,"cloneDef");function X4(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}s(X4,"e0"),o(X4,"getElementAtPath");function Y4(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let u={};for(let i=0;i<t.length;i++)u[t[i]]=n[i];return u})}s(Y4,"t0"),o(Y4,"promiseAllObject");function Q4(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}s(Q4,"r0"),o(Q4,"randomString");function Nn(e){return JSON.stringify(e)}s(Nn,"fi"),o(Nn,"esc");function Ba(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}s(Ba,"zc"),o(Ba,"slugify");var xa="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function zt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(zt,"er"),o(zt,"isObject");var ef=su(()=>{if(Ku.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function pt(e){if(zt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(zt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}s(pt,"Et"),o(pt,"isPlainObject");function ka(e){return pt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}s(ka,"Nc"),o(ka,"shallowClone");function tf(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}s(tf,"n0"),o(tf,"numKeys");var h5=o(e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},"getParsedType"),Mn=new Set(["string","number","symbol"]),uf=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ge(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}s(Ge,"We"),o(Ge,"escapeRegex");function Se(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}s(Se,"Te"),o(Se,"clone");function T(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}s(T,"B"),o(T,"normalizeParams");function rf(e){let t;return new Proxy({},{get(r,n,u){return t??(t=e()),Reflect.get(t,n,u)},set(r,n,u,i){return t??(t=e()),Reflect.set(t,n,u,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,u){return t??(t=e()),Reflect.defineProperty(t,n,u)}})}s(rf,"i0"),o(rf,"createTransparentProxy");function V(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}s(V,"D"),o(V,"stringifyPrimitive");function Ca(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}s(Ca,"Dc"),o(Ca,"optionalKeys");var nf={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},sf={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function af(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let u=We(e._zod.def,{get shape(){let i={};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=r.shape[a])}return rt(this,"shape",i),i},checks:[]});return Se(e,u)}s(af,"s0"),o(af,"pick");function of(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let u=We(e._zod.def,{get shape(){let i={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return rt(this,"shape",i),i},checks:[]});return Se(e,u)}s(of,"a0"),o(of,"omit");function lf(e,t){if(!pt(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let u=e._zod.def.shape;for(let i in t)if(Object.getOwnPropertyDescriptor(u,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=We(e._zod.def,{get shape(){let u={...e._zod.def.shape,...t};return rt(this,"shape",u),u}});return Se(e,n)}s(lf,"c0"),o(lf,"extend");function df(e,t){if(!pt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=We(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return rt(this,"shape",n),n}});return Se(e,r)}s(df,"u0"),o(df,"safeExtend");function cf(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=We(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return rt(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Se(e,r)}s(cf,"l0"),o(cf,"merge");function pf(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let u=We(t._zod.def,{get shape(){let i=t._zod.def.shape,a={...i};if(r)for(let l in r){if(!(l in i))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(a[l]=e?new e({type:"optional",innerType:i[l]}):i[l])}else for(let l in i)a[l]=e?new e({type:"optional",innerType:i[l]}):i[l];return rt(this,"shape",a),a},checks:[]});return Se(t,u)}s(pf,"d0"),o(pf,"partial");function mf(e,t,r){let n=We(t._zod.def,{get shape(){let u=t._zod.def.shape,i={...u};if(r)for(let a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:u[a]}))}else for(let a in u)i[a]=new e({type:"nonoptional",innerType:u[a]});return rt(this,"shape",i),i}});return Se(t,n)}s(mf,"p0"),o(mf,"required");function mt(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}s(mt,"Tt"),o(mt,"aborted");function Aa(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}s(Aa,"Lc"),o(Aa,"explicitlyAborted");function Fe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}s(Fe,"ze"),o(Fe,"prefixIssues");function au(e){return typeof e=="string"?e:e?.message}s(au,"jn"),o(au,"unwrapMessage");function Ae(e,t,r){let n=e.message?e.message:au(e.inst?._zod.def?.error?.(e))??au(t?.error?.(e))??au(r.customError?.(e))??au(r.localeError?.(e))??"Invalid input",{inst:u,continue:i,input:a,...l}=e;return l.path??(l.path=[]),l.message=n,t?.reportInput&&(l.input=a),l}s(Ae,"Ae"),o(Ae,"finalizeIssue");function Yu(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}s(Yu,"Nn"),o(Yu,"getSizableOrigin");function Qu(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}s(Qu,"Pn"),o(Qu,"getLengthableOrigin");function G(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}s(G,"U"),o(G,"parsedType");function er(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}s(er,"Ir"),o(er,"issue");function ff(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}s(ff,"f0"),o(ff,"cleanEnum");function _a(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}s(_a,"Tw"),o(_a,"base64ToUint8Array");function Ia(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}s(Ia,"Aw"),o(Ia,"uint8ArrayToBase64");function hf(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return _a(t+r)}s(hf,"m0"),o(hf,"base64urlToUint8Array");function gf(e){return Ia(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}s(gf,"h0"),o(gf,"uint8ArrayToBase64url");function vf(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}s(vf,"g0"),o(vf,"hexToUint8Array");function yf(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}s(yf,"v0"),o(yf,"uint8ArrayToHex");var g5=class{static{s(this,"jc")}static{o(this,"Class")}constructor(...e){}},bf=o((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,Hu,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),Sa=B("$ZodError",bf),je=B("$ZodError",bf,{Parent:Error});function On(e,t=r=>r.message){let r={},n=[];for(let u of e.issues)u.path.length>0?(r[u.path[0]]=r[u.path[0]]||[],r[u.path[0]].push(t(u))):n.push(t(u));return{formErrors:n,fieldErrors:r}}s(On,"Cn"),o(On,"flattenError");function Rn(e,t=r=>r.message){let r={_errors:[]},n=o((u,i=[])=>{for(let a of u.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(l=>n({issues:l},[...i,...a.path]));else if(a.code==="invalid_key")n({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")n({issues:a.issues},[...i,...a.path]);else{let l=[...i,...a.path];if(l.length===0)r._errors.push(t(a));else{let d=r,c=0;for(;c<l.length;){let p=l[c];c===l.length-1?(d[p]=d[p]||{_errors:[]},d[p]._errors.push(t(a))):d[p]=d[p]||{_errors:[]},d=d[p],c++}}}},"processError");return n(e),r}s(Rn,"Un"),o(Rn,"formatError");function Fa(e,t=r=>r.message){let r={errors:[]},n=o((u,i=[])=>{var a,l;for(let d of u.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(c=>n({issues:c},[...i,...d.path]));else if(d.code==="invalid_key")n({issues:d.issues},[...i,...d.path]);else if(d.code==="invalid_element")n({issues:d.issues},[...i,...d.path]);else{let c=[...i,...d.path];if(c.length===0){r.errors.push(t(d));continue}let p=r,m=0;for(;m<c.length;){let f=c[m],h=m===c.length-1;typeof f=="string"?(p.properties??(p.properties={}),(a=p.properties)[f]??(a[f]={errors:[]}),p=p.properties[f]):(p.items??(p.items=[]),(l=p.items)[f]??(l[f]={errors:[]}),p=p.items[f]),h&&p.errors.push(t(d)),m++}}},"processError");return n(e),r}s(Fa,"Fc"),o(Fa,"treeifyError");function ja(e){let t=[],r=e.map(n=>typeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?t.push(`[${n}]`):typeof n=="symbol"?t.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?t.push(`[${JSON.stringify(n)}]`):(t.length&&t.push("."),t.push(n));return t.join("")}s(ja,"Ow"),o(ja,"toDotPath");function za(e){let t=[],r=[...e.issues].sort((n,u)=>(n.path??[]).length-(u.path??[]).length);for(let n of r)t.push(`\u2716 ${n.message}`),n.path?.length&&t.push(` \u2192 at ${ja(n.path)}`);return t.join(`
2
+ `)}s(za,"Bc"),o(za,"prettifyError");var tr=o(e=>(t,r,n,u)=>{let i=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new jt;if(a.issues.length){let l=new(u?.Err??e)(a.issues.map(d=>Ae(d,i,Ee())));throw xa(l,u?.callee),l}return a.value},"_parse"),Na=tr(je),ur=o(e=>async(t,r,n,u)=>{let i=n?{...n,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let l=new(u?.Err??e)(a.issues.map(d=>Ae(d,i,Ee())));throw xa(l,u?.callee),l}return a.value},"_parseAsync"),Ma=ur(je),rr=o(e=>(t,r,n)=>{let u=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},u);if(i instanceof Promise)throw new jt;return i.issues.length?{success:!1,error:new(e??Sa)(i.issues.map(a=>Ae(a,u,Ee())))}:{success:!0,data:i.value}},"_safeParse"),Ef=rr(je),nr=o(e=>async(t,r,n)=>{let u=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},u);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>Ae(a,u,Ee())))}:{success:!0,data:i.value}},"_safeParseAsync"),wf=nr(je),Oa=o(e=>(t,r,n)=>{let u=n?{...n,direction:"backward"}:{direction:"backward"};return tr(e)(t,r,u)},"_encode"),v5=Oa(je),Ra=o(e=>(t,r,n)=>tr(e)(t,r,n),"_decode"),y5=Ra(je),Ta=o(e=>async(t,r,n)=>{let u=n?{...n,direction:"backward"}:{direction:"backward"};return ur(e)(t,r,u)},"_encodeAsync"),b5=Ta(je),Pa=o(e=>async(t,r,n)=>ur(e)(t,r,n),"_decodeAsync"),E5=Pa(je),Ua=o(e=>(t,r,n)=>{let u=n?{...n,direction:"backward"}:{direction:"backward"};return rr(e)(t,r,u)},"_safeEncode"),w5=Ua(je),qa=o(e=>(t,r,n)=>rr(e)(t,r,n),"_safeDecode"),D5=qa(je),Za=o(e=>async(t,r,n)=>{let u=n?{...n,direction:"backward"}:{direction:"backward"};return nr(e)(t,r,u)},"_safeEncodeAsync"),$5=Za(je),La=o(e=>async(t,r,n)=>nr(e)(t,r,n),"_safeDecodeAsync"),B5=La(je),ft={};ut(ft,{base64:s(()=>Of,"base64"),base64url:s(()=>Va,"base64url"),bigint:s(()=>Zf,"bigint"),boolean:s(()=>Jf,"boolean"),browserEmail:s(()=>F5,"browserEmail"),cidrv4:s(()=>Nf,"cidrv4"),cidrv6:s(()=>Mf,"cidrv6"),cuid:s(()=>Df,"cuid"),cuid2:s(()=>$f,"cuid2"),date:s(()=>Uf,"date"),datetime:s(()=>Ka,"datetime"),domain:s(()=>N5,"domain"),duration:s(()=>Af,"duration"),e164:s(()=>Tf,"e164"),email:s(()=>If,"email"),emoji:s(()=>Ja,"emoji"),extendedDuration:s(()=>x5,"extendedDuration"),guid:s(()=>_f,"guid"),hex:s(()=>M5,"hex"),hostname:s(()=>z5,"hostname"),html5Email:s(()=>_5,"html5Email"),httpProtocol:s(()=>Rf,"httpProtocol"),idnEmail:s(()=>S5,"idnEmail"),integer:s(()=>Lf,"integer"),ipv4:s(()=>Ff,"ipv4"),ipv6:s(()=>jf,"ipv6"),ksuid:s(()=>kf,"ksuid"),lowercase:s(()=>Gf,"lowercase"),mac:s(()=>zf,"mac"),md5_base64:s(()=>R5,"md5_base64"),md5_base64url:s(()=>T5,"md5_base64url"),md5_hex:s(()=>O5,"md5_hex"),nanoid:s(()=>Cf,"nanoid"),null:s(()=>Vf,"null"),number:s(()=>Ha,"number"),rfc5322Email:s(()=>I5,"rfc5322Email"),sha1_base64:s(()=>U5,"sha1_base64"),sha1_base64url:s(()=>q5,"sha1_base64url"),sha1_hex:s(()=>P5,"sha1_hex"),sha256_base64:s(()=>L5,"sha256_base64"),sha256_base64url:s(()=>J5,"sha256_base64url"),sha256_hex:s(()=>Z5,"sha256_hex"),sha384_base64:s(()=>W5,"sha384_base64"),sha384_base64url:s(()=>G5,"sha384_base64url"),sha384_hex:s(()=>V5,"sha384_hex"),sha512_base64:s(()=>H5,"sha512_base64"),sha512_base64url:s(()=>X5,"sha512_base64url"),sha512_hex:s(()=>K5,"sha512_hex"),string:s(()=>qf,"string"),time:s(()=>Ga,"time"),ulid:s(()=>Bf,"ulid"),undefined:s(()=>Wf,"undefined"),unicodeEmail:s(()=>Sf,"unicodeEmail"),uppercase:s(()=>Kf,"uppercase"),uuid:s(()=>ou,"uuid"),uuid4:s(()=>k5,"uuid4"),uuid6:s(()=>C5,"uuid6"),uuid7:s(()=>A5,"uuid7"),xid:s(()=>xf,"xid")});var Df=/^[cC][0-9a-z]{6,}$/,$f=/^[0-9a-z]+$/,Bf=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,xf=/^[0-9a-vA-V]{20}$/,kf=/^[A-Za-z0-9]{27}$/,Cf=/^[a-zA-Z0-9_-]{21}$/,Af=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,x5=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_f=/^([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})$/,ou=o(e=>e?new 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)$/,"uuid"),k5=ou(4),C5=ou(6),A5=ou(7),If=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_5=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,I5=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Sf=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,S5=Sf,F5=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,j5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ja(){return new RegExp(j5,"u")}s(Ja,"eu"),o(Ja,"emoji");var Ff=/^(?:(?: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])$/,jf=/^(([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}|:))$/,zf=o(e=>{let t=Ge(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},"mac"),Nf=/^((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])$/,Mf=/^(([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])$/,Of=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Va=/^[A-Za-z0-9_-]*$/,z5=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,N5=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Rf=/^https?$/,Tf=/^\+[1-9]\d{6,14}$/,Pf="(?:(?:\\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])))",Uf=new RegExp(`^${Pf}$`);function Wa(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+)?)?`}s(Wa,"Nw"),o(Wa,"timeSource");function Ga(e){return new RegExp(`^${Wa(e)}$`)}s(Ga,"lu"),o(Ga,"time");function Ka(e){let t=Wa({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${Pf}T(?:${n})$`)}s(Ka,"du"),o(Ka,"datetime");var qf=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Zf=/^-?\d+n?$/,Lf=/^-?\d+$/,Ha=/^-?\d+(?:\.\d+)?$/,Jf=/^(?:true|false)$/i,Vf=/^null$/i,Wf=/^undefined$/i,Gf=/^[^A-Z]*$/,Kf=/^[^a-z]*$/,M5=/^[0-9a-fA-F]*$/;function lu(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}s(lu,"Ln"),o(lu,"fixedBase64");function du(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}s(du,"Fn"),o(du,"fixedBase64url");var O5=/^[0-9a-fA-F]{32}$/,R5=lu(22,"=="),T5=du(22),P5=/^[0-9a-fA-F]{40}$/,U5=lu(27,"="),q5=du(27),Z5=/^[0-9a-fA-F]{64}$/,L5=lu(43,"="),J5=du(43),V5=/^[0-9a-fA-F]{96}$/,W5=lu(64,""),G5=du(64),K5=/^[0-9a-fA-F]{128}$/,H5=lu(86,"=="),X5=du(86),de=B("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Hf={number:"number",bigint:"bigint",object:"date"},Xa=B("$ZodCheckLessThan",(e,t)=>{de.init(e,t);let r=Hf[typeof t.value];e._zod.onattach.push(n=>{let u=n._zod.bag,i=(t.inclusive?u.maximum:u.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?u.maximum=t.value:u.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ya=B("$ZodCheckGreaterThan",(e,t)=>{de.init(e,t);let r=Hf[typeof t.value];e._zod.onattach.push(n=>{let u=n._zod.bag,i=(t.inclusive?u.minimum:u.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?u.minimum=t.value:u.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Xf=B("$ZodCheckMultipleOf",(e,t)=>{de.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):$a(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Yf=B("$ZodCheckNumberFormat",(e,t)=>{de.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[u,i]=nf[t.format];e._zod.onattach.push(a=>{let l=a._zod.bag;l.format=t.format,l.minimum=u,l.maximum=i,r&&(l.pattern=Lf)}),e._zod.check=a=>{let l=a.value;if(r){if(!Number.isInteger(l)){a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<u&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:u,inclusive:!0,inst:e,continue:!t.abort}),l>i&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Qf=B("$ZodCheckBigIntFormat",(e,t)=>{de.init(e,t);let[r,n]=sf[t.format];e._zod.onattach.push(u=>{let i=u._zod.bag;i.format=t.format,i.minimum=r,i.maximum=n}),e._zod.check=u=>{let i=u.value;i<r&&u.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>n&&u.issues.push({origin:"bigint",input:i,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),eh=B("$ZodCheckMaxSize",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=n=>{let u=n.value;return!ct(u)&&u.size!==void 0}),e._zod.onattach.push(n=>{let u=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<u&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let u=n.value;u.size<=t.maximum||n.issues.push({origin:Yu(u),code:"too_big",maximum:t.maximum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),th=B("$ZodCheckMinSize",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=n=>{let u=n.value;return!ct(u)&&u.size!==void 0}),e._zod.onattach.push(n=>{let u=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>u&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let u=n.value;u.size>=t.minimum||n.issues.push({origin:Yu(u),code:"too_small",minimum:t.minimum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),uh=B("$ZodCheckSizeEquals",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=n=>{let u=n.value;return!ct(u)&&u.size!==void 0}),e._zod.onattach.push(n=>{let u=n._zod.bag;u.minimum=t.size,u.maximum=t.size,u.size=t.size}),e._zod.check=n=>{let u=n.value,i=u.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:Yu(u),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),rh=B("$ZodCheckMaxLength",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=n=>{let u=n.value;return!ct(u)&&u.length!==void 0}),e._zod.onattach.push(n=>{let u=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<u&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let u=n.value;if(u.length<=t.maximum)return;let i=Qu(u);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),nh=B("$ZodCheckMinLength",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=n=>{let u=n.value;return!ct(u)&&u.length!==void 0}),e._zod.onattach.push(n=>{let u=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>u&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let u=n.value;if(u.length>=t.minimum)return;let i=Qu(u);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),ih=B("$ZodCheckLengthEquals",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=n=>{let u=n.value;return!ct(u)&&u.length!==void 0}),e._zod.onattach.push(n=>{let u=n._zod.bag;u.minimum=t.length,u.maximum=t.length,u.length=t.length}),e._zod.check=n=>{let u=n.value,i=u.length;if(i===t.length)return;let a=Qu(u),l=i>t.length;n.issues.push({origin:a,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ir=B("$ZodCheckStringFormat",(e,t)=>{var r,n;de.init(e,t),e._zod.onattach.push(u=>{let i=u._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=u=>{t.pattern.lastIndex=0,!t.pattern.test(u.value)&&u.issues.push({origin:"string",code:"invalid_format",format:t.format,input:u.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),sh=B("$ZodCheckRegex",(e,t)=>{ir.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ah=B("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Gf),ir.init(e,t)}),oh=B("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Kf),ir.init(e,t)}),lh=B("$ZodCheckIncludes",(e,t)=>{de.init(e,t);let r=Ge(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(u=>{let i=u._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=u=>{u.value.includes(t.includes,t.position)||u.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:u.value,inst:e,continue:!t.abort})}}),dh=B("$ZodCheckStartsWith",(e,t)=>{de.init(e,t);let r=new RegExp(`^${Ge(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let u=n._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(r)}),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})}}),ch=B("$ZodCheckEndsWith",(e,t)=>{de.init(e,t);let r=new RegExp(`.*${Ge(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let u=n._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(r)}),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})}});function Qa(e,t,r){e.issues.length&&t.issues.push(...Fe(r,e.issues))}s(Qa,"Pw"),o(Qa,"handleCheckPropertyResult");var ph=B("$ZodCheckProperty",(e,t)=>{de.init(e,t),e._zod.check=r=>{let n=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(u=>Qa(u,r,t.property));Qa(n,r,t.property)}}),mh=B("$ZodCheckMimeType",(e,t)=>{de.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(n=>{n._zod.bag.mime=t.mime}),e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}}),fh=B("$ZodCheckOverwrite",(e,t)=>{de.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}}),hh=class{static{s(this,"Bn")}static{o(this,"Doc")}constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split(`
3
+ `).filter(u=>u),r=Math.min(...t.map(u=>u.length-u.trimStart().length)),n=t.map(u=>u.slice(r)).map(u=>" ".repeat(this.indent*2)+u);for(let u of n)this.content.push(u)}compile(){let e=Function,t=this?.args,r=[...(this?.content??[""]).map(n=>` ${n}`)];return new e(...t,r.join(`
4
+ `))}},gh={major:4,minor:4,patch:3},X=B("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gh;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let u of n)for(let i of u._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let u=o((a,l,d)=>{let c=mt(a),p;for(let m of l){if(m._zod.def.when){if(Aa(a)||!m._zod.def.when(a))continue}else if(c)continue;let f=a.issues.length,h=m._zod.check(a);if(h instanceof Promise&&d?.async===!1)throw new jt;if(p||h instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await h,a.issues.length!==f&&(c||(c=mt(a,f)))});else{if(a.issues.length===f)continue;c||(c=mt(a,f))}}return p?p.then(()=>a):a},"runChecks"),i=o((a,l,d)=>{if(mt(a))return a.aborted=!0,a;let c=u(l,n,d);if(c instanceof Promise){if(d.async===!1)throw new jt;return c.then(p=>e._zod.parse(p,d))}return e._zod.parse(c,d)},"handleCanaryResult");e._zod.run=(a,l)=>{if(l.skipChecks)return e._zod.parse(a,l);if(l.direction==="backward"){let c=e._zod.parse({value:a.value,issues:[]},{...l,skipChecks:!0});return c instanceof Promise?c.then(p=>i(p,a,l)):i(c,a,l)}let d=e._zod.parse(a,l);if(d instanceof Promise){if(l.async===!1)throw new jt;return d.then(c=>u(c,n,l))}return u(d,n,l)}}ee(e,"~standard",()=>({validate:o(u=>{try{let i=Ef(e,u);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return wf(e,u).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},"validate"),vendor:"zod",version:1}))}),sr=B("$ZodString",(e,t)=>{X.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??qf(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),se=B("$ZodStringFormat",(e,t)=>{ir.init(e,t),sr.init(e,t)}),vh=B("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=_f),se.init(e,t)}),yh=B("$ZodUUID",(e,t)=>{if(t.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ou(r))}else t.pattern??(t.pattern=ou());se.init(e,t)}),bh=B("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=If),se.init(e,t)}),Eh=B("$ZodURL",(e,t)=>{se.init(e,t),e._zod.check=r=>{try{let n=r.value.trim();if(!t.normalize&&t.protocol?.source===Rf.source&&!/^https?:\/\//i.test(n)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let u=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(u.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(u.protocol.endsWith(":")?u.protocol.slice(0,-1):u.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=u.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),wh=B("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ja()),se.init(e,t)}),Dh=B("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Cf),se.init(e,t)}),$h=B("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Df),se.init(e,t)}),Bh=B("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=$f),se.init(e,t)}),xh=B("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Bf),se.init(e,t)}),kh=B("$ZodXID",(e,t)=>{t.pattern??(t.pattern=xf),se.init(e,t)}),Ch=B("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=kf),se.init(e,t)}),Ah=B("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ka(t)),se.init(e,t)}),_h=B("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Uf),se.init(e,t)}),Ih=B("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Ga(t)),se.init(e,t)}),Sh=B("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Af),se.init(e,t)}),Fh=B("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ff),se.init(e,t),e._zod.bag.format="ipv4"}),jh=B("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=jf),se.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),zh=B("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=zf(t.delimiter)),se.init(e,t),e._zod.bag.format="mac"}),Nh=B("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Nf),se.init(e,t)}),Mh=B("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Mf),se.init(e,t),e._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[u,i]=n;if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${u}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Tn(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}s(Tn,"sl"),o(Tn,"isValidBase64");var Oh=B("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Of),se.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Tn(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function eo(e){if(!Va.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Tn(r)}s(eo,"Qw"),o(eo,"isValidBase64URL");var Rh=B("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Va),se.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{eo(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Th=B("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Tf),se.init(e,t)});function to(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let u=JSON.parse(atob(n));return!("typ"in u&&u?.typ!=="JWT"||!u.alg||t&&(!("alg"in u)||u.alg!==t))}catch{return!1}}s(to,"ex"),o(to,"isValidJWT");var Ph=B("$ZodJWT",(e,t)=>{se.init(e,t),e._zod.check=r=>{to(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Uh=B("$ZodCustomStringFormat",(e,t)=>{se.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),uo=B("$ZodNumber",(e,t)=>{X.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ha,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let u=r.value;if(typeof u=="number"&&!Number.isNaN(u)&&Number.isFinite(u))return r;let i=typeof u=="number"?Number.isNaN(u)?"NaN":Number.isFinite(u)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:u,inst:e,...i?{received:i}:{}}),r}}),qh=B("$ZodNumberFormat",(e,t)=>{Yf.init(e,t),uo.init(e,t)}),ro=B("$ZodBoolean",(e,t)=>{X.init(e,t),e._zod.pattern=Jf,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let u=r.value;return typeof u=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:u,inst:e}),r}}),no=B("$ZodBigInt",(e,t)=>{X.init(e,t),e._zod.pattern=Zf,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Zh=B("$ZodBigIntFormat",(e,t)=>{Qf.init(e,t),no.init(e,t)}),Lh=B("$ZodSymbol",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{let u=r.value;return typeof u=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:u,inst:e}),r}}),Jh=B("$ZodUndefined",(e,t)=>{X.init(e,t),e._zod.pattern=Wf,e._zod.values=new Set([void 0]),e._zod.parse=(r,n)=>{let u=r.value;return typeof u>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:u,inst:e}),r}}),Vh=B("$ZodNull",(e,t)=>{X.init(e,t),e._zod.pattern=Vf,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let u=r.value;return u===null||r.issues.push({expected:"null",code:"invalid_type",input:u,inst:e}),r}}),Wh=B("$ZodAny",(e,t)=>{X.init(e,t),e._zod.parse=r=>r}),Gh=B("$ZodUnknown",(e,t)=>{X.init(e,t),e._zod.parse=r=>r}),Kh=B("$ZodNever",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Hh=B("$ZodVoid",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{let u=r.value;return typeof u>"u"||r.issues.push({expected:"void",code:"invalid_type",input:u,inst:e}),r}}),Xh=B("$ZodDate",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let u=r.value,i=u instanceof Date;return i&&!Number.isNaN(u.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:u,...i?{received:"Invalid Date"}:{},inst:e}),r}});function io(e,t,r){e.issues.length&&t.issues.push(...Fe(r,e.issues)),t.value[r]=e.value}s(io,"Uw"),o(io,"handleArrayResult");var Yh=B("$ZodArray",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{let u=r.value;if(!Array.isArray(u))return r.issues.push({expected:"array",code:"invalid_type",input:u,inst:e}),r;r.value=Array(u.length);let i=[];for(let a=0;a<u.length;a++){let l=u[a],d=t.element._zod.run({value:l,issues:[]},n);d instanceof Promise?i.push(d.then(c=>io(c,r,a))):io(d,r,a)}return i.length?Promise.all(i).then(()=>r):r}});function ar(e,t,r,n,u,i){let a=r in n;if(e.issues.length){if(u&&i&&!a)return;t.issues.push(...Fe(r,e.issues))}if(!a&&!u){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}s(ar,"Oi"),o(ar,"handlePropertyResult");function so(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Ca(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}s(so,"tx"),o(so,"normalizeDef");function ao(e,t,r,n,u,i){let a=[],l=u.keySet,d=u.catchall._zod,c=d.def.type,p=d.optin==="optional",m=d.optout==="optional";for(let f in t){if(f==="__proto__"||l.has(f))continue;if(c==="never"){a.push(f);continue}let h=d.run({value:t[f],issues:[]},n);h instanceof Promise?e.push(h.then(g=>ar(g,r,f,t,p,m))):ar(h,r,f,t,p,m)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}s(ao,"rx"),o(ao,"handleCatchall");var Qh=B("$ZodObject",(e,t)=>{if(X.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let l={...a};return Object.defineProperty(t,"shape",{value:l}),l},"get")})}let r=su(()=>so(t));ee(e._zod,"propValues",()=>{let a=t.shape,l={};for(let d in a){let c=a[d]._zod;if(c.values){l[d]??(l[d]=new Set);for(let p of c.values)l[d].add(p)}}return l});let n=zt,u=t.catchall,i;e._zod.parse=(a,l)=>{i??(i=r.value);let d=a.value;if(!n(d))return a.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),a;a.value={};let c=[],p=i.shape;for(let m of i.keys){let f=p[m],h=f._zod.optin==="optional",g=f._zod.optout==="optional",b=f._zod.run({value:d[m],issues:[]},l);b instanceof Promise?c.push(b.then(x=>ar(x,a,m,d,h,g))):ar(b,a,m,d,h,g)}return u?ao(c,d,a,l,r.value,e):c.length?Promise.all(c).then(()=>a):a}}),eg=B("$ZodObjectJIT",(e,t)=>{Qh.init(e,t);let r=e._zod.parse,n=su(()=>so(t)),u=o(m=>{let f=new hh(["shape","payload","ctx"]),h=n.value,g=o(w=>{let C=Nn(w);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`},"parseStr");f.write("const input = payload.value;");let b=Object.create(null),x=0;for(let w of h.keys)b[w]=`key_${x++}`;f.write("const newResult = {};");for(let w of h.keys){let C=b[w],k=Nn(w),M=m[w],y=M?._zod?.optin==="optional",D=M?._zod?.optout==="optional";f.write(`const ${C} = ${g(w)};`),y&&D?f.write(`
5
+ if (${C}.issues.length) {
6
+ if (${k} in input) {
7
+ payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
8
8
  ...iss,
9
- path: iss.path ? [${C}, ...iss.path] : [${C}]
9
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
10
10
  })));
11
11
  }
12
12
  }
13
13
 
14
- if (${k}.value === undefined) {
15
- if (${C} in input) {
16
- newResult[${C}] = undefined;
14
+ if (${C}.value === undefined) {
15
+ if (${k} in input) {
16
+ newResult[${k}] = undefined;
17
17
  }
18
18
  } else {
19
- newResult[${C}] = ${k}.value;
19
+ newResult[${k}] = ${C}.value;
20
20
  }
21
21
 
22
22
  `):y?f.write(`
23
- if (${k}.issues.length) {
24
- payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
23
+ if (${C}.issues.length) {
24
+ payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
25
25
  ...iss,
26
- path: iss.path ? [${C}, ...iss.path] : [${C}]
26
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
27
27
  })));
28
28
  }
29
29
 
30
- if (${k}.value === undefined) {
31
- if (${C} in input) {
32
- newResult[${C}] = undefined;
30
+ if (${C}.value === undefined) {
31
+ if (${k} in input) {
32
+ newResult[${k}] = undefined;
33
33
  }
34
34
  } else {
35
- newResult[${C}] = ${k}.value;
35
+ newResult[${k}] = ${C}.value;
36
36
  }
37
37
 
38
38
  `):f.write(`
39
- const ${k}_present = ${C} in input;
40
- if (${k}.issues.length) {
41
- payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
39
+ const ${C}_present = ${k} in input;
40
+ if (${C}.issues.length) {
41
+ payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
42
42
  ...iss,
43
- path: iss.path ? [${C}, ...iss.path] : [${C}]
43
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
44
44
  })));
45
45
  }
46
- if (!${k}_present && !${k}.issues.length) {
46
+ if (!${C}_present && !${C}.issues.length) {
47
47
  payload.issues.push({
48
48
  code: "invalid_type",
49
49
  expected: "nonoptional",
50
50
  input: undefined,
51
- path: [${C}]
51
+ path: [${k}]
52
52
  });
53
53
  }
54
54
 
55
- if (${k}_present) {
56
- if (${k}.value === undefined) {
57
- newResult[${C}] = undefined;
55
+ if (${C}_present) {
56
+ if (${C}.value === undefined) {
57
+ newResult[${k}] = undefined;
58
58
  } else {
59
- newResult[${C}] = ${k}.value;
59
+ newResult[${k}] = ${C}.value;
60
60
  }
61
61
  }
62
62
 
63
- `)}f.write("payload.value = newResult;"),f.write("return payload;");let $=f.compile();return(w,k)=>$(m,w,k)},"generateFastpass"),n,a=zt,l=!Ju.jitless,d=l&&T4.value,c=t.catchall,p;e._zod.parse=(m,f)=>{p??(p=i.value);let h=m.value;return a(h)?l&&d&&f?.async===!1&&f.jitless!==!0?(n||(n=u(t.shape)),m=n(m,f),c?to([],h,m,f,p,e):m):r(m,f):(m.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),m)}});function uo(e,t,r,i){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let u=e.filter(n=>!mt(n));return u.length===1?(t.value=u[0].value,u[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(n=>n.issues.map(a=>Ae(a,i,be())))}),t)}s(uo,"ww"),o(uo,"handleUnionResults");var Ni=B("$ZodUnion",(e,t)=>{X.init(e,t),ee(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ee(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ee(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),ee(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>Gu(u.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,u)=>{if(r)return r(i,u);let n=!1,a=[];for(let l of t.options){let d=l._zod.run({value:i.value,issues:[]},u);if(d instanceof Promise)a.push(d),n=!0;else{if(d.issues.length===0)return d;a.push(d)}}return n?Promise.all(a).then(l=>uo(l,i,e,u)):uo(a,i,e,u)}});function ro(e,t,r,i){let u=e.filter(n=>n.issues.length===0);return u.length===1?(t.value=u[0].value,t):(u.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(n=>n.issues.map(a=>Ae(a,i,be())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}s(ro,"xw"),o(ro,"handleExclusiveUnionResults");var Ph=B("$ZodXor",(e,t)=>{Ni.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,u)=>{if(r)return r(i,u);let n=!1,a=[];for(let l of t.options){let d=l._zod.run({value:i.value,issues:[]},u);d instanceof Promise?(a.push(d),n=!0):a.push(d)}return n?Promise.all(a).then(l=>ro(l,i,e,u)):ro(a,i,e,u)}}),Uh=B("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ni.init(e,t);let r=e._zod.parse;ee(e._zod,"propValues",()=>{let u={};for(let n of t.options){let a=n._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[l,d]of Object.entries(a)){u[l]||(u[l]=new Set);for(let c of d)u[l].add(c)}}return u});let i=iu(()=>{let u=t.options,n=new Map;for(let a of u){let l=a._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let d of l){if(n.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);n.set(d,a)}}return n});e._zod.parse=(u,n)=>{let a=u.value;if(!zt(a))return u.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),u;let l=i.value.get(a?.[t.discriminator]);return l?l._zod.run(u,n):t.unionFallback||n.direction==="backward"?r(u,n):(u.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(i.value.keys()),input:a,path:[t.discriminator],inst:e}),u)}}),qh=B("$ZodIntersection",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value,n=t.left._zod.run({value:u,issues:[]},i),a=t.right._zod.run({value:u,issues:[]},i);return n instanceof Promise||a instanceof Promise?Promise.all([n,a]).then(([l,d])=>io(r,l,d)):io(r,n,a)}});function Mi(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(pt(e)&&pt(t)){let r=Object.keys(t),i=Object.keys(e).filter(n=>r.indexOf(n)!==-1),u={...e,...t};for(let n of i){let a=Mi(e[n],t[n]);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};u[n]=a.data}return{valid:!0,data:u}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<e.length;i++){let u=e[i],n=t[i],a=Mi(u,n);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}s(Mi,"Ou"),o(Mi,"mergeValues");function io(e,t,r){let i=new Map,u;for(let l of t.issues)if(l.code==="unrecognized_keys"){u??(u=l);for(let d of l.keys)i.has(d)||i.set(d,{}),i.get(d).l=!0}else e.issues.push(l);for(let l of r.issues)if(l.code==="unrecognized_keys")for(let d of l.keys)i.has(d)||i.set(d,{}),i.get(d).r=!0;else e.issues.push(l);let n=[...i].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(n.length&&u&&e.issues.push({...u,keys:n}),mt(e))return e;let a=Mi(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}s(io,"$w"),o(io,"handleIntersectionResults");var no=B("$ZodTuple",(e,t)=>{X.init(e,t);let r=t.items;e._zod.parse=(i,u)=>{let n=i.value;if(!Array.isArray(n))return i.issues.push({input:n,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=[];let a=[],l=so(r,"optin"),d=so(r,"optout");if(!t.rest){if(n.length<l)return i.issues.push({code:"too_small",minimum:l,inclusive:!0,input:n,inst:e,origin:"array"}),i;n.length>r.length&&i.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:n,inst:e,origin:"array"})}let c=new Array(r.length);for(let p=0;p<r.length;p++){let m=r[p]._zod.run({value:n[p],issues:[]},u);m instanceof Promise?a.push(m.then(f=>{c[p]=f})):c[p]=m}if(t.rest){let p=r.length-1,m=n.slice(r.length);for(let f of m){p++;let h=t.rest._zod.run({value:f,issues:[]},u);h instanceof Promise?a.push(h.then(g=>ao(g,i,p))):ao(h,i,p)}}return a.length?Promise.all(a).then(()=>oo(c,i,r,n,d)):oo(c,i,r,n,d)}});function so(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}s(so,"_w"),o(so,"getTupleOptStart");function ao(e,t,r){e.issues.length&&t.issues.push(...Fe(r,e.issues)),t.value[r]=e.value}s(ao,"kw"),o(ao,"handleTupleResult");function oo(e,t,r,i,u){for(let n=0;n<r.length;n++){let a=e[n],l=n<i.length;if(a.issues.length){if(!l&&n>=u){t.value.length=n;break}t.issues.push(...Fe(n,a.issues))}t.value[n]=a.value}for(let n=t.value.length-1;n>=i.length&&r[n]._zod.optout==="optional"&&t.value[n]===void 0;n--)t.value.length=n;return t}s(oo,"Sw"),o(oo,"handleTupleResults");var Zh=B("$ZodRecord",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;if(!pt(u))return r.issues.push({expected:"record",code:"invalid_type",input:u,inst:e}),r;let n=[],a=t.keyType._zod.values;if(a){r.value={};let l=new Set;for(let c of a)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){l.add(typeof c=="number"?c.toString():c);let p=t.keyType._zod.run({value:c,issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(h=>Ae(h,i,be())),input:c,path:[c],inst:e});continue}let m=p.value,f=t.valueType._zod.run({value:u[c],issues:[]},i);f instanceof Promise?n.push(f.then(h=>{h.issues.length&&r.issues.push(...Fe(c,h.issues)),r.value[m]=h.value})):(f.issues.length&&r.issues.push(...Fe(c,f.issues)),r.value[m]=f.value)}let d;for(let c in u)l.has(c)||(d=d??[],d.push(c));d&&d.length>0&&r.issues.push({code:"unrecognized_keys",input:u,inst:e,keys:d})}else{r.value={};for(let l of Reflect.ownKeys(u)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(u,l))continue;let d=t.keyType._zod.run({value:l,issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&La.test(l)&&d.issues.length){let p=t.keyType._zod.run({value:Number(l),issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(d=p)}if(d.issues.length){t.mode==="loose"?r.value[l]=u[l]:r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(p=>Ae(p,i,be())),input:l,path:[l],inst:e});continue}let c=t.valueType._zod.run({value:u[l],issues:[]},i);c instanceof Promise?n.push(c.then(p=>{p.issues.length&&r.issues.push(...Fe(l,p.issues)),r.value[d.value]=p.value})):(c.issues.length&&r.issues.push(...Fe(l,c.issues)),r.value[d.value]=c.value)}}return n.length?Promise.all(n).then(()=>r):r}}),Lh=B("$ZodMap",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;if(!(u instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:u,inst:e}),r;let n=[];r.value=new Map;for(let[a,l]of u){let d=t.keyType._zod.run({value:a,issues:[]},i),c=t.valueType._zod.run({value:l,issues:[]},i);d instanceof Promise||c instanceof Promise?n.push(Promise.all([d,c]).then(([p,m])=>{lo(p,m,r,a,u,e,i)})):lo(d,c,r,a,u,e,i)}return n.length?Promise.all(n).then(()=>r):r}});function lo(e,t,r,i,u,n,a){e.issues.length&&(Si.has(typeof i)?r.issues.push(...Fe(i,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:u,inst:n,issues:e.issues.map(l=>Ae(l,a,be()))})),t.issues.length&&(Si.has(typeof i)?r.issues.push(...Fe(i,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:u,inst:n,key:i,issues:t.issues.map(l=>Ae(l,a,be()))})),r.value.set(e.value,t.value)}s(lo,"Iw"),o(lo,"handleMapResult");var Vh=B("$ZodSet",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;if(!(u instanceof Set))return r.issues.push({input:u,inst:e,expected:"set",code:"invalid_type"}),r;let n=[];r.value=new Set;for(let a of u){let l=t.valueType._zod.run({value:a,issues:[]},i);l instanceof Promise?n.push(l.then(d=>co(d,r))):co(l,r)}return n.length?Promise.all(n).then(()=>r):r}});function co(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}s(co,"Rw"),o(co,"handleSetResult");var Jh=B("$ZodEnum",(e,t)=>{X.init(e,t);let r=Ii(t.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(u=>Si.has(typeof u)).map(u=>typeof u=="string"?Ge(u):u.toString()).join("|")})$`),e._zod.parse=(u,n)=>{let a=u.value;return i.has(a)||u.issues.push({code:"invalid_value",values:r,input:a,inst:e}),u}}),Wh=B("$ZodLiteral",(e,t)=>{if(X.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?Ge(i):i?Ge(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,u)=>{let n=i.value;return r.has(n)||i.issues.push({code:"invalid_value",values:t.values,input:n,inst:e}),i}}),Gh=B("$ZodFile",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;return u instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:u,inst:e}),r}}),Kh=B("$ZodTransform",(e,t)=>{X.init(e,t),e._zod.optin="optional",e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ai(e.constructor.name);let u=t.transform(r.value,r);if(i.async)return(u instanceof Promise?u:Promise.resolve(u)).then(n=>(r.value=n,r.fallback=!0,r));if(u instanceof Promise)throw new jt;return r.value=u,r.fallback=!0,r}});function po(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}s(po,"Ew"),o(po,"handleOptionalResult");var mo=B("$ZodOptional",(e,t)=>{X.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ee(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Gu(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional"){let u=r.value,n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(a=>po(a,u)):po(n,u)}return r.value===void 0?r:t.innerType._zod.run(r,i)}}),Hh=B("$ZodExactOptional",(e,t)=>{mo.init(e,t),ee(e._zod,"values",()=>t.innerType._zod.values),ee(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,i)=>t.innerType._zod.run(r,i)}),Xh=B("$ZodNullable",(e,t)=>{X.init(e,t),ee(e._zod,"optin",()=>t.innerType._zod.optin),ee(e._zod,"optout",()=>t.innerType._zod.optout),ee(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Gu(r.source)}|null)$`):void 0}),ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),Yh=B("$ZodDefault",(e,t)=>{X.init(e,t),e._zod.optin="optional",ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);if(r.value===void 0)return r.value=t.defaultValue,r;let u=t.innerType._zod.run(r,i);return u instanceof Promise?u.then(n=>fo(n,t)):fo(u,t)}});function fo(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}s(fo,"Tw"),o(fo,"handleDefaultResult");var Qh=B("$ZodPrefault",(e,t)=>{X.init(e,t),e._zod.optin="optional",ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),eg=B("$ZodNonOptional",(e,t)=>{X.init(e,t),ee(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{let u=t.innerType._zod.run(r,i);return u instanceof Promise?u.then(n=>ho(n,e)):ho(u,e)}});function ho(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}s(ho,"Aw"),o(ho,"handleNonOptionalResult");var tg=B("$ZodSuccess",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ai("ZodSuccess");let u=t.innerType._zod.run(r,i);return u instanceof Promise?u.then(n=>(r.value=n.issues.length===0,r)):(r.value=u.issues.length===0,r)}}),ug=B("$ZodCatch",(e,t)=>{X.init(e,t),e._zod.optin="optional",ee(e._zod,"optout",()=>t.innerType._zod.optout),ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);let u=t.innerType._zod.run(r,i);return u instanceof Promise?u.then(n=>(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(a=>Ae(a,i,be()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=u.value,u.issues.length&&(r.value=t.catchValue({...r,error:{issues:u.issues.map(n=>Ae(n,i,be()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),rg=B("$ZodNaN",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),go=B("$ZodPipe",(e,t)=>{X.init(e,t),ee(e._zod,"values",()=>t.in._zod.values),ee(e._zod,"optin",()=>t.in._zod.optin),ee(e._zod,"optout",()=>t.out._zod.optout),ee(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){let n=t.out._zod.run(r,i);return n instanceof Promise?n.then(a=>nr(a,t.in,i)):nr(n,t.in,i)}let u=t.in._zod.run(r,i);return u instanceof Promise?u.then(n=>nr(n,t.out,i)):nr(u,t.out,i)}});function nr(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}s(nr,"Si"),o(nr,"handlePipeResult");var vo=B("$ZodCodec",(e,t)=>{X.init(e,t),ee(e._zod,"values",()=>t.in._zod.values),ee(e._zod,"optin",()=>t.in._zod.optin),ee(e._zod,"optout",()=>t.out._zod.optout),ee(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let u=t.in._zod.run(r,i);return u instanceof Promise?u.then(n=>sr(n,t,i)):sr(u,t,i)}else{let u=t.out._zod.run(r,i);return u instanceof Promise?u.then(n=>sr(n,t,i)):sr(u,t,i)}}});function sr(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let i=t.transform(e.value,e);return i instanceof Promise?i.then(u=>ar(e,u,t.out,r)):ar(e,i,t.out,r)}else{let i=t.reverseTransform(e.value,e);return i instanceof Promise?i.then(u=>ar(e,u,t.in,r)):ar(e,i,t.in,r)}}s(sr,"Ii"),o(sr,"handleCodecAResult");function ar(e,t,r,i){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},i)}s(ar,"Ri"),o(ar,"handleCodecTxResult");var ig=B("$ZodPreprocess",(e,t)=>{go.init(e,t)}),ng=B("$ZodReadonly",(e,t)=>{X.init(e,t),ee(e._zod,"propValues",()=>t.innerType._zod.propValues),ee(e._zod,"values",()=>t.innerType._zod.values),ee(e._zod,"optin",()=>t.innerType?._zod?.optin),ee(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);let u=t.innerType._zod.run(r,i);return u instanceof Promise?u.then(yo):yo(u)}});function yo(e){return e.value=Object.freeze(e.value),e}s(yo,"jw"),o(yo,"handleReadonlyResult");var sg=B("$ZodTemplateLiteral",(e,t)=>{X.init(e,t);let r=[];for(let i of t.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let u=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!u)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let n=u.startsWith("^")?1:0,a=u.endsWith("$")?u.length-1:u.length;r.push(u.slice(n,a))}else if(i===null||U4.has(typeof i))r.push(Ge(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(i,u)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"string",code:"invalid_type"}),i):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),i)}),ag=B("$ZodFunction",(e,t)=>(X.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){let u=e._def.input?Ia(e._def.input,i):i,n=Reflect.apply(r,this,u);return e._def.output?Ia(e._def.output,n):n}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let u=e._def.input?await _a(e._def.input,i):i,n=await Reflect.apply(r,this,u);return e._def.output?await _a(e._def.output,n):n}},e._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let i=e.constructor;return Array.isArray(r[0])?new i({type:"function",input:new no({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new i({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let i=e.constructor;return new i({type:"function",input:e._def.input,output:r})},e)),og=B("$ZodPromise",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>Promise.resolve(r.value).then(u=>t.innerType._zod.run({value:u,issues:[]},i))}),lg=B("$ZodLazy",(e,t)=>{X.init(e,t),ee(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),ee(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),ee(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),ee(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),ee(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,i)=>e._zod.innerType._zod.run(r,i)}),dg=B("$ZodCustom",(e,t)=>{de.init(e,t),X.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{let i=r.value,u=t.fn(i);if(u instanceof Promise)return u.then(n=>Eo(n,r,i,e));Eo(u,r,i,e)}});function Eo(e,t,r,i){if(!e){let u={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(u.params=i._zod.def.params),t.issues.push(Xu(u))}}s(Eo,"zw"),o(Eo,"handleRefineResult");var bo={};ut(bo,{ar:s(()=>cg,"ar"),az:s(()=>pg,"az"),be:s(()=>mg,"be"),bg:s(()=>fg,"bg"),ca:s(()=>hg,"ca"),cs:s(()=>gg,"cs"),da:s(()=>vg,"da"),de:s(()=>yg,"de"),el:s(()=>Eg,"el"),en:s(()=>Do,"en"),eo:s(()=>bg,"eo"),es:s(()=>wg,"es"),fa:s(()=>Dg,"fa"),fi:s(()=>$g,"fi"),fr:s(()=>Bg,"fr"),frCA:s(()=>xg,"frCA"),he:s(()=>Cg,"he"),hr:s(()=>kg,"hr"),hu:s(()=>Ag,"hu"),hy:s(()=>Ig,"hy"),id:s(()=>_g,"id"),is:s(()=>Sg,"is"),it:s(()=>Fg,"it"),ja:s(()=>jg,"ja"),ka:s(()=>zg,"ka"),kh:s(()=>Ng,"kh"),km:s(()=>Bo,"km"),ko:s(()=>Mg,"ko"),lt:s(()=>Og,"lt"),mk:s(()=>Rg,"mk"),ms:s(()=>Tg,"ms"),nl:s(()=>Pg,"nl"),no:s(()=>Ug,"no"),ota:s(()=>qg,"ota"),pl:s(()=>Lg,"pl"),ps:s(()=>Zg,"ps"),pt:s(()=>Vg,"pt"),ro:s(()=>Jg,"ro"),ru:s(()=>Wg,"ru"),sl:s(()=>Gg,"sl"),sv:s(()=>Kg,"sv"),ta:s(()=>Hg,"ta"),th:s(()=>Xg,"th"),tr:s(()=>Yg,"tr"),ua:s(()=>Qg,"ua"),uk:s(()=>ko,"uk"),ur:s(()=>ev,"ur"),uz:s(()=>tv,"uz"),vi:s(()=>uv,"vi"),yo:s(()=>nv,"yo"),zhCN:s(()=>rv,"zhCN"),zhTW:s(()=>iv,"zhTW")});var Ew=o(()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${u.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${l}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${n}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${l}`}case"invalid_value":return u.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${J(u.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${u.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${n} ${u.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${u.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${n} ${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${u.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${n} ${u.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${u.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${n} ${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${u.prefix}"`:n.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${n.suffix}"`:n.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${n.includes}"`:n.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${n.pattern}`:`${r[n.format]??u.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${u.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${u.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${u.keys.length>1?"\u0629":""}: ${O(u.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${u.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${u.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"error");function cg(){return{localeError:Ew()}}s(cg,"Zl"),o(cg,"default");var bw=o(()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${u.expected}, daxil olan ${l}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${n}, daxil olan ${l}`}case"invalid_value":return u.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${J(u.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${u.origin??"d\u0259y\u0259r"} ${n}${u.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${u.origin??"d\u0259y\u0259r"} ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${u.origin} ${n}${u.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${u.origin} ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${n.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:n.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${n.suffix}" il\u0259 bitm\u0259lidir`:n.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${n.includes}" daxil olmal\u0131d\u0131r`:n.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${n.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[n.format]??u.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${u.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${u.keys.length>1?"lar":""}: ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${u.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"error");function pg(){return{localeError:bw()}}s(pg,"ql"),o(pg,"default");function wo(e,t,r,i){let u=Math.abs(e),n=u%10,a=u%100;return a>=11&&a<=19?i:n===1?t:n>=2&&n<=4?r:i}s(wo,"Cw"),o(wo,"getBelarusianPlural");var ww=o(()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${u.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${l}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${n}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${l}`}case"invalid_value":return u.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${J(u.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);if(a){let l=Number(u.maximum),d=wo(l,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${u.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${n}${u.maximum.toString()} ${d}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${u.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);if(a){let l=Number(u.minimum),d=wo(l,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${u.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${n}${u.minimum.toString()} ${d}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${u.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${n.prefix}"`:n.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${n.suffix}"`:n.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${n.includes}"`:n.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${n.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[n.format]??u.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${u.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${u.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${O(u.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${u.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${u.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"error");function mg(){return{localeError:ww()}}s(mg,"Vl"),o(mg,"default");var Dw=o(()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${u.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${l}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${n}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${l}`}case"invalid_value":return u.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${J(u.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${u.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${n}${u.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${u.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${u.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${n}${u.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${u.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;if(n.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${n.prefix}"`;if(n.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${n.suffix}"`;if(n.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${n.includes}"`;if(n.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${n.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return n.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),n.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[n.format]??u.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${u.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${u.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${u.keys.length>1?"\u043E\u0432\u0435":""}: ${O(u.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${u.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${u.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}},"error");function fg(){return{localeError:Dw()}}s(fg,"Gl"),o(fg,"default");var $w=o(()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${u.expected}, s'ha rebut ${l}`:`Tipus inv\xE0lid: s'esperava ${n}, s'ha rebut ${l}`}case"invalid_value":return u.values.length===1?`Valor inv\xE0lid: s'esperava ${J(u.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${O(u.values," o ")}`;case"too_big":{let n=u.inclusive?"com a m\xE0xim":"menys de",a=t(u.origin);return a?`Massa gran: s'esperava que ${u.origin??"el valor"} contingu\xE9s ${n} ${u.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${u.origin??"el valor"} fos ${n} ${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(u.origin);return a?`Massa petit: s'esperava que ${u.origin} contingu\xE9s ${n} ${u.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${u.origin} fos ${n} ${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${n.prefix}"`:n.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${n.suffix}"`:n.format==="includes"?`Format inv\xE0lid: ha d'incloure "${n.includes}"`:n.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${n.pattern}`:`Format inv\xE0lid per a ${r[n.format]??u.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${u.divisor}`;case"unrecognized_keys":return`Clau${u.keys.length>1?"s":""} no reconeguda${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${u.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${u.origin}`;default:return"Entrada inv\xE0lida"}}},"error");function hg(){return{localeError:$w()}}s(hg,"Jl"),o(hg,"default");var Bw=o(()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${u.expected}, obdr\u017Eeno ${l}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${n}, obdr\u017Eeno ${l}`}case"invalid_value":return u.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${J(u.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${u.origin??"hodnota"} mus\xED m\xEDt ${n}${u.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${u.origin??"hodnota"} mus\xED b\xFDt ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${u.origin??"hodnota"} mus\xED m\xEDt ${n}${u.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${u.origin??"hodnota"} mus\xED b\xFDt ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${n.prefix}"`:n.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${n.suffix}"`:n.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${n.includes}"`:n.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${n.pattern}`:`Neplatn\xFD form\xE1t ${r[n.format]??u.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${u.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${O(u.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${u.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${u.origin}`;default:return"Neplatn\xFD vstup"}}},"error");function gg(){return{localeError:Bw()}}s(gg,"Kl"),o(gg,"default");var xw=o(()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Ugyldigt input: forventede instanceof ${u.expected}, fik ${l}`:`Ugyldigt input: forventede ${n}, fik ${l}`}case"invalid_value":return u.values.length===1?`Ugyldig v\xE6rdi: forventede ${J(u.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin),l=i[u.origin]??u.origin;return a?`For stor: forventede ${l??"value"} ${a.verb} ${n} ${u.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${l??"value"} havde ${n} ${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin),l=i[u.origin]??u.origin;return a?`For lille: forventede ${l} ${a.verb} ${n} ${u.minimum.toString()} ${a.unit}`:`For lille: forventede ${l} havde ${n} ${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Ugyldig streng: skal starte med "${n.prefix}"`:n.format==="ends_with"?`Ugyldig streng: skal ende med "${n.suffix}"`:n.format==="includes"?`Ugyldig streng: skal indeholde "${n.includes}"`:n.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${n.pattern}`:`Ugyldig ${r[n.format]??u.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${u.divisor}`;case"unrecognized_keys":return`${u.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${O(u.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${u.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${u.origin}`;default:return"Ugyldigt input"}}},"error");function vg(){return{localeError:xw()}}s(vg,"Wl"),o(vg,"default");var Cw=o(()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${u.expected}, erhalten ${l}`:`Ung\xFCltige Eingabe: erwartet ${n}, erhalten ${l}`}case"invalid_value":return u.values.length===1?`Ung\xFCltige Eingabe: erwartet ${J(u.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Zu gro\xDF: erwartet, dass ${u.origin??"Wert"} ${n}${u.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${u.origin??"Wert"} ${n}${u.maximum.toString()} ist`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Zu klein: erwartet, dass ${u.origin} ${n}${u.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${u.origin} ${n}${u.minimum.toString()} ist`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Ung\xFCltiger String: muss mit "${n.prefix}" beginnen`:n.format==="ends_with"?`Ung\xFCltiger String: muss mit "${n.suffix}" enden`:n.format==="includes"?`Ung\xFCltiger String: muss "${n.includes}" enthalten`:n.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${n.pattern} entsprechen`:`Ung\xFCltig: ${r[n.format]??u.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${u.divisor} sein`;case"unrecognized_keys":return`${u.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${O(u.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${u.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${u.origin}`;default:return"Ung\xFCltige Eingabe"}}},"error");function yg(){return{localeError:Cw()}}s(yg,"Xl"),o(yg,"default");var kw=o(()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return typeof u.expected=="string"&&/^[A-Z]/.test(u.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${u.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${l}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${l}`}case"invalid_value":return u.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${J(u.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${u.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${n}${u.maximum.toString()} ${a.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${u.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${u.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${n}${u.minimum.toString()} ${a.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${u.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${n.prefix}"`:n.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${n.suffix}"`:n.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${n.includes}"`:n.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${n.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[n.format]??u.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${u.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${u.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${u.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${O(u.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${u.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${u.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}},"error");function Eg(){return{localeError:kw()}}s(Eg,"Hl"),o(Eg,"default");var Aw=o(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return`Invalid input: expected ${n}, received ${l}`}case"invalid_value":return u.values.length===1?`Invalid input: expected ${J(u.values[0])}`:`Invalid option: expected one of ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Too big: expected ${u.origin??"value"} to have ${n}${u.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${u.origin??"value"} to be ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Too small: expected ${u.origin} to have ${n}${u.minimum.toString()} ${a.unit}`:`Too small: expected ${u.origin} to be ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Invalid string: must start with "${n.prefix}"`:n.format==="ends_with"?`Invalid string: must end with "${n.suffix}"`:n.format==="includes"?`Invalid string: must include "${n.includes}"`:n.format==="regex"?`Invalid string: must match pattern ${n.pattern}`:`Invalid ${r[n.format]??u.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${u.divisor}`;case"unrecognized_keys":return`Unrecognized key${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Invalid key in ${u.origin}`;case"invalid_union":return u.options&&Array.isArray(u.options)&&u.options.length>0?`Invalid discriminator value. Expected ${u.options.map(n=>`'${n}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${u.origin}`;default:return"Invalid input"}}},"error");function Do(){return{localeError:Aw()}}s(Do,"Bn"),o(Do,"default");var Iw=o(()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${u.expected}, ricevi\u011Dis ${l}`:`Nevalida enigo: atendi\u011Dis ${n}, ricevi\u011Dis ${l}`}case"invalid_value":return u.values.length===1?`Nevalida enigo: atendi\u011Dis ${J(u.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Tro granda: atendi\u011Dis ke ${u.origin??"valoro"} havu ${n}${u.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${u.origin??"valoro"} havu ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Tro malgranda: atendi\u011Dis ke ${u.origin} havu ${n}${u.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${u.origin} estu ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${n.prefix}"`:n.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${n.suffix}"`:n.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${n.includes}"`:n.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${n.pattern}`:`Nevalida ${r[n.format]??u.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${u.divisor}`;case"unrecognized_keys":return`Nekonata${u.keys.length>1?"j":""} \u015Dlosilo${u.keys.length>1?"j":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${u.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${u.origin}`;default:return"Nevalida enigo"}}},"error");function bg(){return{localeError:Iw()}}s(bg,"Yl"),o(bg,"default");var _w=o(()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${u.expected}, recibido ${l}`:`Entrada inv\xE1lida: se esperaba ${n}, recibido ${l}`}case"invalid_value":return u.values.length===1?`Entrada inv\xE1lida: se esperaba ${J(u.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin),l=i[u.origin]??u.origin;return a?`Demasiado grande: se esperaba que ${l??"valor"} tuviera ${n}${u.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${l??"valor"} fuera ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin),l=i[u.origin]??u.origin;return a?`Demasiado peque\xF1o: se esperaba que ${l} tuviera ${n}${u.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${l} fuera ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${n.prefix}"`:n.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${n.suffix}"`:n.format==="includes"?`Cadena inv\xE1lida: debe incluir "${n.includes}"`:n.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${n.pattern}`:`Inv\xE1lido ${r[n.format]??u.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${u.divisor}`;case"unrecognized_keys":return`Llave${u.keys.length>1?"s":""} desconocida${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[u.origin]??u.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[u.origin]??u.origin}`;default:return"Entrada inv\xE1lida"}}},"error");function wg(){return{localeError:_w()}}s(wg,"Ql"),o(wg,"default");var Sw=o(()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${u.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${l} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${n} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${l} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return u.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${J(u.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${O(u.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${u.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${n}${u.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${u.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${n}${u.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${u.origin} \u0628\u0627\u06CC\u062F ${n}${u.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${u.origin} \u0628\u0627\u06CC\u062F ${n}${u.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${n.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:n.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${n.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:n.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${n.includes}" \u0628\u0627\u0634\u062F`:n.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${n.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[n.format]??u.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${u.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${u.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${O(u.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${u.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${u.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"error");function Dg(){return{localeError:Sw()}}s(Dg,"ed"),o(Dg,"default");var Fw=o(()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Virheellinen tyyppi: odotettiin instanceof ${u.expected}, oli ${l}`:`Virheellinen tyyppi: odotettiin ${n}, oli ${l}`}case"invalid_value":return u.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${J(u.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${n}${u.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${n}${u.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${n.prefix}"`:n.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${n.suffix}"`:n.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${n.includes}"`:n.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${n.pattern}`:`Virheellinen ${r[n.format]??u.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${u.divisor} monikerta`;case"unrecognized_keys":return`${u.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${O(u.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}},"error");function $g(){return{localeError:Fw()}}s($g,"td"),o($g,"default");var jw=o(()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Entr\xE9e invalide : instanceof ${u.expected} attendu, ${l} re\xE7u`:`Entr\xE9e invalide : ${n} attendu, ${l} re\xE7u`}case"invalid_value":return u.values.length===1?`Entr\xE9e invalide : ${J(u.values[0])} attendu`:`Option invalide : une valeur parmi ${O(u.values,"|")} attendue`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Trop grand : ${i[u.origin]??"valeur"} doit ${a.verb} ${n}${u.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[u.origin]??"valeur"} doit \xEAtre ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Trop petit : ${i[u.origin]??"valeur"} doit ${a.verb} ${n}${u.minimum.toString()} ${a.unit}`:`Trop petit : ${i[u.origin]??"valeur"} doit \xEAtre ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${n.prefix}"`:n.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${n.suffix}"`:n.format==="includes"?`Cha\xEEne invalide : doit inclure "${n.includes}"`:n.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${n.pattern}`:`${r[n.format]??u.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${u.divisor}`;case"unrecognized_keys":return`Cl\xE9${u.keys.length>1?"s":""} non reconnue${u.keys.length>1?"s":""} : ${O(u.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${u.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${u.origin}`;default:return"Entr\xE9e invalide"}}},"error");function Bg(){return{localeError:jw()}}s(Bg,"rd"),o(Bg,"default");var zw=o(()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Entr\xE9e invalide : attendu instanceof ${u.expected}, re\xE7u ${l}`:`Entr\xE9e invalide : attendu ${n}, re\xE7u ${l}`}case"invalid_value":return u.values.length===1?`Entr\xE9e invalide : attendu ${J(u.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"\u2264":"<",a=t(u.origin);return a?`Trop grand : attendu que ${u.origin??"la valeur"} ait ${n}${u.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${u.origin??"la valeur"} soit ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?"\u2265":">",a=t(u.origin);return a?`Trop petit : attendu que ${u.origin} ait ${n}${u.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${u.origin} soit ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${n.prefix}"`:n.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${n.suffix}"`:n.format==="includes"?`Cha\xEEne invalide : doit inclure "${n.includes}"`:n.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${n.pattern}`:`${r[n.format]??u.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${u.divisor}`;case"unrecognized_keys":return`Cl\xE9${u.keys.length>1?"s":""} non reconnue${u.keys.length>1?"s":""} : ${O(u.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${u.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${u.origin}`;default:return"Entr\xE9e invalide"}}},"error");function xg(){return{localeError:zw()}}s(xg,"nd"),o(xg,"default");var Nw=o(()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=o(c=>c?e[c]:void 0,"typeEntry"),i=o(c=>{let p=r(c);return p?p.label:c??e.unknown.label},"typeLabel"),u=o(c=>`\u05D4${i(c)}`,"withDefinite"),n=o(c=>(r(c)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA","verbFor"),a=o(c=>c?t[c]??null:null,"getSizing"),l={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},d={nan:"NaN"};return c=>{switch(c.code){case"invalid_type":{let p=c.expected,m=d[p??""]??i(p),f=G(c.input),h=d[f]??e[f]?.label??f;return/^[A-Z]/.test(c.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${c.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`}case"invalid_value":{if(c.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${J(c.values[0])}`;let p=c.values.map(f=>J(f));if(c.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p[0]} \u05D0\u05D5 ${p[1]}`;let m=p[p.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p.slice(0,-1).join(", ")} \u05D0\u05D5 ${m}`}case"too_big":{let p=a(c.origin),m=u(c.origin??"value");if(c.origin==="string")return`${p?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.maximum.toString()} ${p?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(c.origin==="number"){let g=c.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${c.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(c.origin==="array"||c.origin==="set"){let g=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",E=c.inclusive?`${c.maximum} ${p?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${c.maximum} ${p?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${m} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${E}`.trim()}let f=c.inclusive?"<=":"<",h=n(c.origin??"value");return p?.unit?`${p.longLabel} \u05DE\u05D3\u05D9: ${m} ${h} ${f}${c.maximum.toString()} ${p.unit}`:`${p?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${m} ${h} ${f}${c.maximum.toString()}`}case"too_small":{let p=a(c.origin),m=u(c.origin??"value");if(c.origin==="string")return`${p?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.minimum.toString()} ${p?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(c.origin==="number"){let g=c.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${c.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(c.origin==="array"||c.origin==="set"){let g=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(c.minimum===1&&c.inclusive){let x=(c.origin,"\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${m} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${x}`}let E=c.inclusive?`${c.minimum} ${p?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${c.minimum} ${p?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${m} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${E}`.trim()}let f=c.inclusive?">=":">",h=n(c.origin??"value");return p?.unit?`${p.shortLabel} \u05DE\u05D3\u05D9: ${m} ${h} ${f}${c.minimum.toString()} ${p.unit}`:`${p?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${m} ${h} ${f}${c.minimum.toString()}`}case"invalid_format":{let p=c;if(p.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${p.prefix}"`;if(p.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${p.suffix}"`;if(p.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${p.includes}"`;if(p.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${p.pattern}`;let m=l[p.format],f=m?.label??p.format,h=(m?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${h}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${c.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${c.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${c.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${O(c.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${u(c.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"error");function Cg(){return{localeError:Nw()}}s(Cg,"od"),o(Cg,"default");var Mw=o(()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},i={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${u.expected}, a primljeno je ${l}`:`Neispravan unos: o\u010Dekuje se ${n}, a primljeno je ${l}`}case"invalid_value":return u.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${J(u.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin),l=i[u.origin]??u.origin;return a?`Preveliko: o\u010Dekivano da ${l??"vrijednost"} ima ${n}${u.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${l??"vrijednost"} bude ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin),l=i[u.origin]??u.origin;return a?`Premalo: o\u010Dekivano da ${l} ima ${n}${u.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${l} bude ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${n.prefix}"`:n.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${n.suffix}"`:n.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${n.includes}"`:n.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${n.pattern}`:`Neispravna ${r[n.format]??u.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${u.divisor}`;case"unrecognized_keys":return`Neprepoznat${u.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${O(u.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${i[u.origin]??u.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[u.origin]??u.origin}`;default:return"Neispravan unos"}}},"error");function kg(){return{localeError:Mw()}}s(kg,"id"),o(kg,"default");var Ow=o(()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${u.expected}, a kapott \xE9rt\xE9k ${l}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${n}, a kapott \xE9rt\xE9k ${l}`}case"invalid_value":return u.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${J(u.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`T\xFAl nagy: ${u.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${n}${u.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${u.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${u.origin} m\xE9rete t\xFAl kicsi ${n}${u.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${u.origin} t\xFAl kicsi ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\xC9rv\xE9nytelen string: "${n.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:n.format==="ends_with"?`\xC9rv\xE9nytelen string: "${n.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:n.format==="includes"?`\xC9rv\xE9nytelen string: "${n.includes}" \xE9rt\xE9ket kell tartalmaznia`:n.format==="regex"?`\xC9rv\xE9nytelen string: ${n.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[n.format]??u.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${u.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${u.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${u.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"error");function Ag(){return{localeError:Ow()}}s(Ag,"sd"),o(Ag,"default");function $o(e,t,r){return Math.abs(e)===1?t:r}s($o,"Uw"),o($o,"getArmenianPlural");function Nt(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}s(Nt,"Ar"),o(Nt,"withDefiniteArticle");var Rw=o(()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${u.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${l}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${n}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${l}`}case"invalid_value":return u.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${J(u.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);if(a){let l=Number(u.maximum),d=$o(l,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Nt(u.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${n}${u.maximum.toString()} ${d}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Nt(u.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);if(a){let l=Number(u.minimum),d=$o(l,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Nt(u.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${n}${u.minimum.toString()} ${d}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Nt(u.origin)} \u056C\u056B\u0576\u056B ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${n.prefix}"-\u0578\u057E`:n.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${n.suffix}"-\u0578\u057E`:n.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${n.includes}"`:n.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${n.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[n.format]??u.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${u.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${u.keys.length>1?"\u0576\u0565\u0580":""}. ${O(u.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Nt(u.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Nt(u.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}},"error");function Ig(){return{localeError:Rw()}}s(Ig,"ad"),o(Ig,"default");var Tw=o(()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Input tidak valid: diharapkan instanceof ${u.expected}, diterima ${l}`:`Input tidak valid: diharapkan ${n}, diterima ${l}`}case"invalid_value":return u.values.length===1?`Input tidak valid: diharapkan ${J(u.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Terlalu besar: diharapkan ${u.origin??"value"} memiliki ${n}${u.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${u.origin??"value"} menjadi ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Terlalu kecil: diharapkan ${u.origin} memiliki ${n}${u.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${u.origin} menjadi ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`String tidak valid: harus dimulai dengan "${n.prefix}"`:n.format==="ends_with"?`String tidak valid: harus berakhir dengan "${n.suffix}"`:n.format==="includes"?`String tidak valid: harus menyertakan "${n.includes}"`:n.format==="regex"?`String tidak valid: harus sesuai pola ${n.pattern}`:`${r[n.format]??u.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${u.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${u.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${u.origin}`;default:return"Input tidak valid"}}},"error");function _g(){return{localeError:Tw()}}s(_g,"cd"),o(_g,"default");var Pw=o(()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${l} \xFEar sem \xE1 a\xF0 vera instanceof ${u.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${l} \xFEar sem \xE1 a\xF0 vera ${n}`}case"invalid_value":return u.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${J(u.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${u.origin??"gildi"} hafi ${n}${u.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${u.origin??"gildi"} s\xE9 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${u.origin} hafi ${n}${u.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${u.origin} s\xE9 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${n.prefix}"`:n.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${n.suffix}"`:n.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${n.includes}"`:n.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${n.pattern}`:`Rangt ${r[n.format]??u.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${u.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${u.keys.length>1?"ir lyklar":"ur lykill"}: ${O(u.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${u.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${u.origin}`;default:return"Rangt gildi"}}},"error");function Sg(){return{localeError:Pw()}}s(Sg,"ud"),o(Sg,"default");var Uw=o(()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Input non valido: atteso instanceof ${u.expected}, ricevuto ${l}`:`Input non valido: atteso ${n}, ricevuto ${l}`}case"invalid_value":return u.values.length===1?`Input non valido: atteso ${J(u.values[0])}`:`Opzione non valida: atteso uno tra ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Troppo grande: ${u.origin??"valore"} deve avere ${n}${u.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${u.origin??"valore"} deve essere ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Troppo piccolo: ${u.origin} deve avere ${n}${u.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${u.origin} deve essere ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Stringa non valida: deve iniziare con "${n.prefix}"`:n.format==="ends_with"?`Stringa non valida: deve terminare con "${n.suffix}"`:n.format==="includes"?`Stringa non valida: deve includere "${n.includes}"`:n.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${n.pattern}`:`Input non valido: ${r[n.format]??u.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${u.divisor}`;case"unrecognized_keys":return`Chiav${u.keys.length>1?"i":"e"} non riconosciut${u.keys.length>1?"e":"a"}: ${O(u.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${u.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${u.origin}`;default:return"Input non valido"}}},"error");function Fg(){return{localeError:Uw()}}s(Fg,"ld"),o(Fg,"default");var qw=o(()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${u.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${l}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${n}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${l}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return u.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${J(u.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${O(u.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let n=u.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(u.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${u.origin??"\u5024"}\u306F${u.maximum.toString()}${a.unit??"\u8981\u7D20"}${n}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${u.origin??"\u5024"}\u306F${u.maximum.toString()}${n}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let n=u.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(u.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${u.origin}\u306F${u.minimum.toString()}${a.unit}${n}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${u.origin}\u306F${u.minimum.toString()}${n}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${n.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:n.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${n.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:n.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${n.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:n.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${n.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[n.format]??u.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${u.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${u.keys.length>1?"\u7FA4":""}: ${O(u.keys,"\u3001")}`;case"invalid_key":return`${u.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${u.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"error");function jg(){return{localeError:qw()}}s(jg,"dd"),o(jg,"default");var Zw=o(()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${u.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${l}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${l}`}case"invalid_value":return u.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${J(u.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${O(u.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${u.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${n}${u.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${u.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${u.origin} ${a.verb} ${n}${u.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${u.origin} \u10D8\u10E7\u10DD\u10E1 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${n.prefix}"-\u10D8\u10D7`:n.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${n.suffix}"-\u10D8\u10D7`:n.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${n.includes}"-\u10E1`:n.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${n.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[n.format]??u.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${u.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${u.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${O(u.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${u.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${u.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}},"error");function zg(){return{localeError:Zw()}}s(zg,"pd"),o(zg,"default");var Lw=o(()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${u.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${l}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${l}`}case"invalid_value":return u.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${J(u.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${u.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${n} ${u.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${u.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${n} ${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${u.origin} ${n} ${u.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${u.origin} ${n} ${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${n.prefix}"`:n.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${n.suffix}"`:n.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${n.includes}"`:n.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${n.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[n.format]??u.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${u.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${O(u.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${u.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${u.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"error");function Bo(){return{localeError:Lw()}}s(Bo,"Zn"),o(Bo,"default");function Ng(){return Bo()}s(Ng,"fd"),o(Ng,"default");var Vw=o(()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${u.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${l}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${n}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${l}\uC785\uB2C8\uB2E4`}case"invalid_value":return u.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${J(u.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${O(u.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let n=u.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=n==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=t(u.origin),d=l?.unit??"\uC694\uC18C";return l?`${u.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${u.maximum.toString()}${d} ${n}${a}`:`${u.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${u.maximum.toString()} ${n}${a}`}case"too_small":{let n=u.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=n==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=t(u.origin),d=l?.unit??"\uC694\uC18C";return l?`${u.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${u.minimum.toString()}${d} ${n}${a}`:`${u.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${u.minimum.toString()} ${n}${a}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${n.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:n.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${n.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:n.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${n.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:n.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${n.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[n.format]??u.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${u.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${O(u.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${u.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${u.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"error");function Mg(){return{localeError:Vw()}}s(Mg,"md"),o(Mg,"default");var or=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalizeFirstCharacter");function xo(e){let t=Math.abs(e),r=t%10,i=t%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}s(xo,"Lw"),o(xo,"getUnitTypeFromNumber");var Jw=o(()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(u,n,a,l){let d=e[u]??null;return d===null?d:{unit:d.unit[n],verb:d.verb[l][a?"inclusive":"notInclusive"]}}s(t,"t"),o(t,"getSizing");let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},i={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Gautas tipas ${l}, o tik\u0117tasi - instanceof ${u.expected}`:`Gautas tipas ${l}, o tik\u0117tasi - ${n}`}case"invalid_value":return u.values.length===1?`Privalo b\u016Bti ${J(u.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${O(u.values,"|")} pasirinkim\u0173`;case"too_big":{let n=i[u.origin]??u.origin,a=t(u.origin,xo(Number(u.maximum)),u.inclusive??!1,"smaller");if(a?.verb)return`${or(n??u.origin??"reik\u0161m\u0117")} ${a.verb} ${u.maximum.toString()} ${a.unit??"element\u0173"}`;let l=u.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${or(n??u.origin??"reik\u0161m\u0117")} turi b\u016Bti ${l} ${u.maximum.toString()} ${a?.unit}`}case"too_small":{let n=i[u.origin]??u.origin,a=t(u.origin,xo(Number(u.minimum)),u.inclusive??!1,"bigger");if(a?.verb)return`${or(n??u.origin??"reik\u0161m\u0117")} ${a.verb} ${u.minimum.toString()} ${a.unit??"element\u0173"}`;let l=u.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${or(n??u.origin??"reik\u0161m\u0117")} turi b\u016Bti ${l} ${u.minimum.toString()} ${a?.unit}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${n.prefix}"`:n.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${n.suffix}"`:n.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${n.includes}"`:n.format==="regex"?`Eilut\u0117 privalo atitikti ${n.pattern}`:`Neteisingas ${r[n.format]??u.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${u.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${u.keys.length>1?"i":"as"} rakt${u.keys.length>1?"ai":"as"}: ${O(u.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let n=i[u.origin]??u.origin;return`${or(n??u.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}},"error");function Og(){return{localeError:Jw()}}s(Og,"hd"),o(Og,"default");var Ww=o(()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${u.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${l}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${l}`}case"invalid_value":return u.values.length===1?`Invalid input: expected ${J(u.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${u.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${n}${u.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${u.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${u.origin} \u0434\u0430 \u0438\u043C\u0430 ${n}${u.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${u.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${n.prefix}"`:n.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${n.suffix}"`:n.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${n.includes}"`:n.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${n.pattern}`:`Invalid ${r[n.format]??u.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${u.divisor}`;case"unrecognized_keys":return`${u.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${O(u.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${u.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${u.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"error");function Rg(){return{localeError:Ww()}}s(Rg,"gd"),o(Rg,"default");var Gw=o(()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Input tidak sah: dijangka instanceof ${u.expected}, diterima ${l}`:`Input tidak sah: dijangka ${n}, diterima ${l}`}case"invalid_value":return u.values.length===1?`Input tidak sah: dijangka ${J(u.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Terlalu besar: dijangka ${u.origin??"nilai"} ${a.verb} ${n}${u.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${u.origin??"nilai"} adalah ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Terlalu kecil: dijangka ${u.origin} ${a.verb} ${n}${u.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${u.origin} adalah ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`String tidak sah: mesti bermula dengan "${n.prefix}"`:n.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${n.suffix}"`:n.format==="includes"?`String tidak sah: mesti mengandungi "${n.includes}"`:n.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${n.pattern}`:`${r[n.format]??u.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${u.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${O(u.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${u.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${u.origin}`;default:return"Input tidak sah"}}},"error");function Tg(){return{localeError:Gw()}}s(Tg,"vd"),o(Tg,"default");var Kw=o(()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Ongeldige invoer: verwacht instanceof ${u.expected}, ontving ${l}`:`Ongeldige invoer: verwacht ${n}, ontving ${l}`}case"invalid_value":return u.values.length===1?`Ongeldige invoer: verwacht ${J(u.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin),l=u.origin==="date"?"laat":u.origin==="string"?"lang":"groot";return a?`Te ${l}: verwacht dat ${u.origin??"waarde"} ${n}${u.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${l}: verwacht dat ${u.origin??"waarde"} ${n}${u.maximum.toString()} is`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin),l=u.origin==="date"?"vroeg":u.origin==="string"?"kort":"klein";return a?`Te ${l}: verwacht dat ${u.origin} ${n}${u.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${l}: verwacht dat ${u.origin} ${n}${u.minimum.toString()} is`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Ongeldige tekst: moet met "${n.prefix}" beginnen`:n.format==="ends_with"?`Ongeldige tekst: moet op "${n.suffix}" eindigen`:n.format==="includes"?`Ongeldige tekst: moet "${n.includes}" bevatten`:n.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${n.pattern}`:`Ongeldig: ${r[n.format]??u.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${u.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${u.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${u.origin}`;default:return"Ongeldige invoer"}}},"error");function Pg(){return{localeError:Kw()}}s(Pg,"yd"),o(Pg,"default");var Hw=o(()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Ugyldig input: forventet instanceof ${u.expected}, fikk ${l}`:`Ugyldig input: forventet ${n}, fikk ${l}`}case"invalid_value":return u.values.length===1?`Ugyldig verdi: forventet ${J(u.values[0])}`:`Ugyldig valg: forventet en av ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`For stor(t): forventet ${u.origin??"value"} til \xE5 ha ${n}${u.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${u.origin??"value"} til \xE5 ha ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`For lite(n): forventet ${u.origin} til \xE5 ha ${n}${u.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${u.origin} til \xE5 ha ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${n.prefix}"`:n.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${n.suffix}"`:n.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${n.includes}"`:n.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${n.pattern}`:`Ugyldig ${r[n.format]??u.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${u.divisor}`;case"unrecognized_keys":return`${u.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${O(u.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${u.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${u.origin}`;default:return"Ugyldig input"}}},"error");function Ug(){return{localeError:Hw()}}s(Ug,"bd"),o(Ug,"default");var Xw=o(()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`F\xE2sit giren: umulan instanceof ${u.expected}, al\u0131nan ${l}`:`F\xE2sit giren: umulan ${n}, al\u0131nan ${l}`}case"invalid_value":return u.values.length===1?`F\xE2sit giren: umulan ${J(u.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Fazla b\xFCy\xFCk: ${u.origin??"value"}, ${n}${u.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${u.origin??"value"}, ${n}${u.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Fazla k\xFC\xE7\xFCk: ${u.origin}, ${n}${u.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${u.origin}, ${n}${u.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let n=u;return n.format==="starts_with"?`F\xE2sit metin: "${n.prefix}" ile ba\u015Flamal\u0131.`:n.format==="ends_with"?`F\xE2sit metin: "${n.suffix}" ile bitmeli.`:n.format==="includes"?`F\xE2sit metin: "${n.includes}" ihtiv\xE2 etmeli.`:n.format==="regex"?`F\xE2sit metin: ${n.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[n.format]??u.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${u.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${u.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"error");function qg(){return{localeError:Xw()}}s(qg,"wd"),o(qg,"default");var Yw=o(()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${u.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${l} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${n} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${l} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return u.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${J(u.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${O(u.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${u.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${n}${u.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${u.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${n}${u.maximum.toString()} \u0648\u064A`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${u.origin} \u0628\u0627\u06CC\u062F ${n}${u.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${u.origin} \u0628\u0627\u06CC\u062F ${n}${u.minimum.toString()} \u0648\u064A`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${n.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:n.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${n.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:n.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${n.includes}" \u0648\u0644\u0631\u064A`:n.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${n.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[n.format]??u.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${u.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${u.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${O(u.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${u.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${u.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"error");function Zg(){return{localeError:Yw()}}s(Zg,"xd"),o(Zg,"default");var Qw=o(()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${u.expected}, otrzymano ${l}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${n}, otrzymano ${l}`}case"invalid_value":return u.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${J(u.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${u.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${n}${u.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${u.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${u.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${n}${u.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${u.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${n.prefix}"`:n.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${n.suffix}"`:n.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${n.includes}"`:n.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${n.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[n.format]??u.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${u.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${u.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${u.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"error");function Lg(){return{localeError:Qw()}}s(Lg,"$d"),o(Lg,"default");var eD=o(()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",number:"n\xFAmero",null:"nulo"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Tipo inv\xE1lido: esperado instanceof ${u.expected}, recebido ${l}`:`Tipo inv\xE1lido: esperado ${n}, recebido ${l}`}case"invalid_value":return u.values.length===1?`Entrada inv\xE1lida: esperado ${J(u.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Muito grande: esperado que ${u.origin??"valor"} tivesse ${n}${u.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${u.origin??"valor"} fosse ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Muito pequeno: esperado que ${u.origin} tivesse ${n}${u.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${u.origin} fosse ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${n.prefix}"`:n.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${n.suffix}"`:n.format==="includes"?`Texto inv\xE1lido: deve incluir "${n.includes}"`:n.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${n.pattern}`:`${r[n.format]??u.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${u.divisor}`;case"unrecognized_keys":return`Chave${u.keys.length>1?"s":""} desconhecida${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${u.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${u.origin}`;default:return"Campo inv\xE1lido"}}},"error");function Vg(){return{localeError:eD()}}s(Vg,"_d"),o(Vg,"default");var tD=o(()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},i={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${n}, primit ${l}`}case"invalid_value":return u.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${J(u.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Prea mare: a\u0219teptat ca ${u.origin??"valoarea"} ${a.verb} ${n}${u.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${u.origin??"valoarea"} s\u0103 fie ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Prea mic: a\u0219teptat ca ${u.origin} ${a.verb} ${n}${u.minimum.toString()} ${a.unit}`:`Prea mic: a\u0219teptat ca ${u.origin} s\u0103 fie ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${n.prefix}"`:n.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${n.suffix}"`:n.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${n.includes}"`:n.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${n.pattern}`:`Format invalid: ${r[n.format]??u.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${u.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${O(u.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${u.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${u.origin}`;default:return"Intrare invalid\u0103"}}},"error");function Jg(){return{localeError:tD()}}s(Jg,"kd"),o(Jg,"default");function Co(e,t,r,i){let u=Math.abs(e),n=u%10,a=u%100;return a>=11&&a<=19?i:n===1?t:n>=2&&n<=4?r:i}s(Co,"Fw"),o(Co,"getRussianPlural");var uD=o(()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${u.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${l}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${n}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${l}`}case"invalid_value":return u.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${J(u.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);if(a){let l=Number(u.maximum),d=Co(l,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${u.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${n}${u.maximum.toString()} ${d}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${u.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);if(a){let l=Number(u.minimum),d=Co(l,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${u.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${n}${u.minimum.toString()} ${d}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${u.origin} \u0431\u0443\u0434\u0435\u0442 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${n.prefix}"`:n.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${n.suffix}"`:n.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${n.includes}"`:n.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${n.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[n.format]??u.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${u.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${u.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${u.keys.length>1?"\u0438":""}: ${O(u.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${u.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${u.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"error");function Wg(){return{localeError:uD()}}s(Wg,"Sd"),o(Wg,"default");var rD=o(()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${u.expected}, prejeto ${l}`:`Neveljaven vnos: pri\u010Dakovano ${n}, prejeto ${l}`}case"invalid_value":return u.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${J(u.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${u.origin??"vrednost"} imelo ${n}${u.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${u.origin??"vrednost"} ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${u.origin} imelo ${n}${u.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${u.origin} ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${n.prefix}"`:n.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${n.suffix}"`:n.format==="includes"?`Neveljaven niz: mora vsebovati "${n.includes}"`:n.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${n.pattern}`:`Neveljaven ${r[n.format]??u.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${u.divisor}`;case"unrecognized_keys":return`Neprepoznan${u.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${O(u.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${u.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${u.origin}`;default:return"Neveljaven vnos"}}},"error");function Gg(){return{localeError:rD()}}s(Gg,"Id"),o(Gg,"default");var iD=o(()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${u.expected}, fick ${l}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${n}, fick ${l}`}case"invalid_value":return u.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${J(u.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${u.origin??"v\xE4rdet"} att ha ${n}${u.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${u.origin??"v\xE4rdet"} att ha ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${u.origin??"v\xE4rdet"} att ha ${n}${u.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${u.origin??"v\xE4rdet"} att ha ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${n.prefix}"`:n.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${n.suffix}"`:n.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${n.includes}"`:n.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${n.pattern}"`:`Ogiltig(t) ${r[n.format]??u.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${u.divisor}`;case"unrecognized_keys":return`${u.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${O(u.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${u.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${u.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"error");function Kg(){return{localeError:iD()}}s(Kg,"Rd"),o(Kg,"default");var nD=o(()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${u.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${l}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${l}`}case"invalid_value":return u.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${J(u.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${O(u.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${u.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${n}${u.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${u.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${n}${u.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${u.origin} ${n}${u.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${u.origin} ${n}${u.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${n.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:n.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${n.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:n.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${n.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:n.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${n.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[n.format]??u.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${u.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${u.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${u.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},"error");function Hg(){return{localeError:nD()}}s(Hg,"Ed"),o(Hg,"default");var sD=o(()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${u.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${l}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${n} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${l}`}case"invalid_value":return u.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${J(u.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(u.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${u.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${n} ${u.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${u.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${n} ${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(u.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${u.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${n} ${u.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${u.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${n} ${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${n.prefix}"`:n.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${n.suffix}"`:n.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${n.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:n.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${n.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[n.format]??u.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${u.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${O(u.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${u.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${u.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"error");function Xg(){return{localeError:sD()}}s(Xg,"Td"),o(Xg,"default");var aD=o(()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${u.expected}, al\u0131nan ${l}`:`Ge\xE7ersiz de\u011Fer: beklenen ${n}, al\u0131nan ${l}`}case"invalid_value":return u.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${J(u.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${u.origin??"de\u011Fer"} ${n}${u.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${u.origin??"de\u011Fer"} ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${u.origin} ${n}${u.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${u.origin} ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Ge\xE7ersiz metin: "${n.prefix}" ile ba\u015Flamal\u0131`:n.format==="ends_with"?`Ge\xE7ersiz metin: "${n.suffix}" ile bitmeli`:n.format==="includes"?`Ge\xE7ersiz metin: "${n.includes}" i\xE7ermeli`:n.format==="regex"?`Ge\xE7ersiz metin: ${n.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[n.format]??u.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${u.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${u.keys.length>1?"lar":""}: ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${u.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"error");function Yg(){return{localeError:aD()}}s(Yg,"Ad"),o(Yg,"default");var oD=o(()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${u.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${l}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${n}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${l}`}case"invalid_value":return u.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${J(u.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${u.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${n}${u.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${u.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${u.origin} ${a.verb} ${n}${u.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${u.origin} \u0431\u0443\u0434\u0435 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${n.prefix}"`:n.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${n.suffix}"`:n.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${n.includes}"`:n.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${n.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[n.format]??u.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${u.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${u.keys.length>1?"\u0456":""}: ${O(u.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${u.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${u.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"error");function ko(){return{localeError:oD()}}s(ko,"Vn"),o(ko,"default");function Qg(){return ko()}s(Qg,"jd"),o(Qg,"default");var lD=o(()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${u.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${l} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${n} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${l} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return u.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${J(u.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${O(u.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${u.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${n}${u.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${u.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${n}${u.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${u.origin} \u06A9\u06D2 ${n}${u.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${u.origin} \u06A9\u0627 ${n}${u.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${n.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:n.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${n.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:n.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${n.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:n.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${n.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[n.format]??u.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${u.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${u.keys.length>1?"\u0632":""}: ${O(u.keys,"\u060C ")}`;case"invalid_key":return`${u.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${u.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"error");function ev(){return{localeError:lD()}}s(ev,"zd"),o(ev,"default");var dD=o(()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${u.expected}, qabul qilingan ${l}`:`Noto\u2018g\u2018ri kirish: kutilgan ${n}, qabul qilingan ${l}`}case"invalid_value":return u.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${J(u.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Juda katta: kutilgan ${u.origin??"qiymat"} ${n}${u.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${u.origin??"qiymat"} ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Juda kichik: kutilgan ${u.origin} ${n}${u.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${u.origin} ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${n.prefix}" bilan boshlanishi kerak`:n.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${n.suffix}" bilan tugashi kerak`:n.format==="includes"?`Noto\u2018g\u2018ri satr: "${n.includes}" ni o\u2018z ichiga olishi kerak`:n.format==="regex"?`Noto\u2018g\u2018ri satr: ${n.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[n.format]??u.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${u.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${u.keys.length>1?"lar":""}: ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${u.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}},"error");function tv(){return{localeError:dD()}}s(tv,"Od"),o(tv,"default");var cD=o(()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${u.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${l}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${n}, nh\u1EADn \u0111\u01B0\u1EE3c ${l}`}case"invalid_value":return u.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${J(u.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${u.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${n}${u.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${u.origin??"gi\xE1 tr\u1ECB"} ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${u.origin} ${a.verb} ${n}${u.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${u.origin} ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${n.prefix}"`:n.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${n.suffix}"`:n.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${n.includes}"`:n.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${n.pattern}`:`${r[n.format]??u.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${u.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${O(u.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${u.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${u.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"error");function uv(){return{localeError:cD()}}s(uv,"Md"),o(uv,"default");var pD=o(()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${u.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${l}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${n}\uFF0C\u5B9E\u9645\u63A5\u6536 ${l}`}case"invalid_value":return u.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${J(u.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${u.origin??"\u503C"} ${n}${u.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${u.origin??"\u503C"} ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${u.origin} ${n}${u.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${u.origin} ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${n.prefix}" \u5F00\u5934`:n.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${n.suffix}" \u7ED3\u5C3E`:n.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${n.includes}"`:n.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${n.pattern}`:`\u65E0\u6548${r[n.format]??u.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${u.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${u.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"error");function rv(){return{localeError:pD()}}s(rv,"Nd"),o(rv,"default");var mD=o(()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${u.expected}\uFF0C\u4F46\u6536\u5230 ${l}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${n}\uFF0C\u4F46\u6536\u5230 ${l}`}case"invalid_value":return u.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${J(u.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${u.origin??"\u503C"} \u61C9\u70BA ${n}${u.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${u.origin??"\u503C"} \u61C9\u70BA ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${u.origin} \u61C9\u70BA ${n}${u.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${u.origin} \u61C9\u70BA ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${n.prefix}" \u958B\u982D`:n.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${n.suffix}" \u7D50\u5C3E`:n.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${n.includes}"`:n.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${n.pattern}`:`\u7121\u6548\u7684 ${r[n.format]??u.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${u.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${u.keys.length>1?"\u5011":""}\uFF1A${O(u.keys,"\u3001")}`;case"invalid_key":return`${u.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${u.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"error");function iv(){return{localeError:mD()}}s(iv,"Pd"),o(iv,"default");var fD=o(()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${u.expected}, \xE0m\u1ECD\u0300 a r\xED ${l}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${n}, \xE0m\u1ECD\u0300 a r\xED ${l}`}case"invalid_value":return u.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${J(u.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${u.origin??"iye"} ${a.verb} ${n}${u.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${n}${u.maximum}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${u.origin} ${a.verb} ${n}${u.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${n}${u.minimum}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${n.prefix}"`:n.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${n.suffix}"`:n.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${n.includes}"`:n.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${n.pattern}`:`A\u1E63\xEC\u1E63e: ${r[n.format]??u.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${u.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${O(u.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${u.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${u.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}},"error");function nv(){return{localeError:fD()}}s(nv,"Dd"),o(nv,"default");var sv,av=Symbol("ZodOutput"),ov=Symbol("ZodInput"),lv=class{static{s(this,"Mi")}static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.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 r={...this.get(t)??{}};delete r.id;let i={...r,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Oi(){return new lv}s(Oi,"Ni"),o(Oi,"registry"),(sv=globalThis).__zod_globalRegistry??(sv.__zod_globalRegistry=Oi());var Re=globalThis.__zod_globalRegistry;function Ao(e,t){return new e({type:"string",...T(t)})}s(Ao,"Ld"),o(Ao,"_string");function Io(e,t){return new e({type:"string",coerce:!0,...T(t)})}s(Io,"Fd"),o(Io,"_coercedString");function Ri(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...T(t)})}s(Ri,"Pi"),o(Ri,"_email");function lr(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...T(t)})}s(lr,"Jn"),o(lr,"_guid");function Ti(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...T(t)})}s(Ti,"Di"),o(Ti,"_uuid");function Pi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...T(t)})}s(Pi,"Ci"),o(Pi,"_uuidv4");function Ui(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...T(t)})}s(Ui,"Ui"),o(Ui,"_uuidv6");function qi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...T(t)})}s(qi,"Li"),o(qi,"_uuidv7");function dr(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...T(t)})}s(dr,"Kn"),o(dr,"_url");function Zi(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...T(t)})}s(Zi,"Fi"),o(Zi,"_emoji");function Li(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...T(t)})}s(Li,"Bi"),o(Li,"_nanoid");function Vi(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...T(t)})}s(Vi,"Zi"),o(Vi,"_cuid");function Ji(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...T(t)})}s(Ji,"qi"),o(Ji,"_cuid2");function Wi(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...T(t)})}s(Wi,"Vi"),o(Wi,"_ulid");function Gi(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...T(t)})}s(Gi,"Gi"),o(Gi,"_xid");function Ki(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...T(t)})}s(Ki,"Ji"),o(Ki,"_ksuid");function Hi(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...T(t)})}s(Hi,"Ki"),o(Hi,"_ipv4");function Xi(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...T(t)})}s(Xi,"Wi"),o(Xi,"_ipv6");function _o(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...T(t)})}s(_o,"Bd"),o(_o,"_mac");function Yi(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...T(t)})}s(Yi,"Xi"),o(Yi,"_cidrv4");function Qi(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...T(t)})}s(Qi,"Hi"),o(Qi,"_cidrv6");function en(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...T(t)})}s(en,"Yi"),o(en,"_base64");function tn(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...T(t)})}s(tn,"Qi"),o(tn,"_base64url");function un(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...T(t)})}s(un,"es"),o(un,"_e164");function rn(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...T(t)})}s(rn,"ts"),o(rn,"_jwt");var dv={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function So(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...T(t)})}s(So,"qd"),o(So,"_isoDateTime");function Fo(e,t){return new e({type:"string",format:"date",check:"string_format",...T(t)})}s(Fo,"Vd"),o(Fo,"_isoDate");function jo(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...T(t)})}s(jo,"Gd"),o(jo,"_isoTime");function zo(e,t){return new e({type:"string",format:"duration",check:"string_format",...T(t)})}s(zo,"Jd"),o(zo,"_isoDuration");function No(e,t){return new e({type:"number",checks:[],...T(t)})}s(No,"Kd"),o(No,"_number");function Mo(e,t){return new e({type:"number",coerce:!0,checks:[],...T(t)})}s(Mo,"Wd"),o(Mo,"_coercedNumber");function Oo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...T(t)})}s(Oo,"Xd"),o(Oo,"_int");function Ro(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...T(t)})}s(Ro,"Hd"),o(Ro,"_float32");function To(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...T(t)})}s(To,"Yd"),o(To,"_float64");function Po(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...T(t)})}s(Po,"Qd"),o(Po,"_int32");function Uo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...T(t)})}s(Uo,"ep"),o(Uo,"_uint32");function qo(e,t){return new e({type:"boolean",...T(t)})}s(qo,"tp"),o(qo,"_boolean");function Zo(e,t){return new e({type:"boolean",coerce:!0,...T(t)})}s(Zo,"rp"),o(Zo,"_coercedBoolean");function Lo(e,t){return new e({type:"bigint",...T(t)})}s(Lo,"np"),o(Lo,"_bigint");function Vo(e,t){return new e({type:"bigint",coerce:!0,...T(t)})}s(Vo,"op"),o(Vo,"_coercedBigint");function Jo(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...T(t)})}s(Jo,"ip"),o(Jo,"_int64");function Wo(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...T(t)})}s(Wo,"sp"),o(Wo,"_uint64");function Go(e,t){return new e({type:"symbol",...T(t)})}s(Go,"ap"),o(Go,"_symbol");function Ko(e,t){return new e({type:"undefined",...T(t)})}s(Ko,"cp"),o(Ko,"_undefined");function Ho(e,t){return new e({type:"null",...T(t)})}s(Ho,"up"),o(Ho,"_null");function Xo(e){return new e({type:"any"})}s(Xo,"lp"),o(Xo,"_any");function Yo(e){return new e({type:"unknown"})}s(Yo,"dp"),o(Yo,"_unknown");function Qo(e,t){return new e({type:"never",...T(t)})}s(Qo,"pp"),o(Qo,"_never");function e0(e,t){return new e({type:"void",...T(t)})}s(e0,"fp"),o(e0,"_void");function t0(e,t){return new e({type:"date",...T(t)})}s(t0,"mp"),o(t0,"_date");function u0(e,t){return new e({type:"date",coerce:!0,...T(t)})}s(u0,"hp"),o(u0,"_coercedDate");function r0(e,t){return new e({type:"nan",...T(t)})}s(r0,"gp"),o(r0,"_nan");function it(e,t){return new Va({check:"less_than",...T(t),value:e,inclusive:!1})}s(it,"st"),o(it,"_lt");function ze(e,t){return new Va({check:"less_than",...T(t),value:e,inclusive:!0})}s(ze,"Ze"),o(ze,"_lte");function nt(e,t){return new Ja({check:"greater_than",...T(t),value:e,inclusive:!1})}s(nt,"at"),o(nt,"_gt");function Ce(e,t){return new Ja({check:"greater_than",...T(t),value:e,inclusive:!0})}s(Ce,"je"),o(Ce,"_gte");function nn(e){return nt(0,e)}s(nn,"rs"),o(nn,"_positive");function sn(e){return it(0,e)}s(sn,"ns"),o(sn,"_negative");function an(e){return ze(0,e)}s(an,"os"),o(an,"_nonpositive");function on(e){return Ce(0,e)}s(on,"is"),o(on,"_nonnegative");function Mt(e,t){return new Mf({check:"multiple_of",...T(t),value:e})}s(Mt,"At"),o(Mt,"_multipleOf");function Ot(e,t){return new Tf({check:"max_size",...T(t),maximum:e})}s(Ot,"jt"),o(Ot,"_maxSize");function st(e,t){return new Pf({check:"min_size",...T(t),minimum:e})}s(st,"ct"),o(st,"_minSize");function lu(e,t){return new Uf({check:"size_equals",...T(t),size:e})}s(lu,"rr"),o(lu,"_size");function du(e,t){return new qf({check:"max_length",...T(t),maximum:e})}s(du,"nr"),o(du,"_maxLength");function ht(e,t){return new Zf({check:"min_length",...T(t),minimum:e})}s(ht,"vt"),o(ht,"_minLength");function cu(e,t){return new Lf({check:"length_equals",...T(t),length:e})}s(cu,"or"),o(cu,"_length");function cr(e,t){return new Vf({check:"string_format",format:"regex",...T(t),pattern:e})}s(cr,"jr"),o(cr,"_regex");function pr(e){return new Jf({check:"string_format",format:"lowercase",...T(e)})}s(pr,"zr"),o(pr,"_lowercase");function mr(e){return new Wf({check:"string_format",format:"uppercase",...T(e)})}s(mr,"Or"),o(mr,"_uppercase");function fr(e,t){return new Gf({check:"string_format",format:"includes",...T(t),includes:e})}s(fr,"Mr"),o(fr,"_includes");function hr(e,t){return new Kf({check:"string_format",format:"starts_with",...T(t),prefix:e})}s(hr,"Nr"),o(hr,"_startsWith");function gr(e,t){return new Hf({check:"string_format",format:"ends_with",...T(t),suffix:e})}s(gr,"Pr"),o(gr,"_endsWith");function ln(e,t,r){return new Xf({check:"property",property:e,schema:t,...T(r)})}s(ln,"ss"),o(ln,"_property");function vr(e,t){return new Yf({check:"mime_type",mime:e,...T(t)})}s(vr,"Dr"),o(vr,"_mime");function Ke(e){return new Qf({check:"overwrite",tx:e})}s(Ke,"et"),o(Ke,"_overwrite");function yr(e){return Ke(t=>t.normalize(e))}s(yr,"Cr"),o(yr,"_normalize");function Er(){return Ke(e=>e.trim())}s(Er,"Ur"),o(Er,"_trim");function br(){return Ke(e=>e.toLowerCase())}s(br,"Lr"),o(br,"_toLowerCase");function wr(){return Ke(e=>e.toUpperCase())}s(wr,"Fr"),o(wr,"_toUpperCase");function Dr(){return Ke(e=>ya(e))}s(Dr,"Br"),o(Dr,"_slugify");function i0(e,t,r){return new e({type:"array",element:t,...T(r)})}s(i0,"vp"),o(i0,"_array");function cv(e,t,r){return new e({type:"union",options:t,...T(r)})}s(cv,"hR"),o(cv,"_union");function pv(e,t,r){return new e({type:"union",options:t,inclusive:!1,...T(r)})}s(pv,"gR"),o(pv,"_xor");function mv(e,t,r,i){return new e({type:"union",options:r,discriminator:t,...T(i)})}s(mv,"vR"),o(mv,"_discriminatedUnion");function fv(e,t,r){return new e({type:"intersection",left:t,right:r})}s(fv,"yR"),o(fv,"_intersection");function hv(e,t,r,i){let u=r instanceof X,n=u?i:r,a=u?r:null;return new e({type:"tuple",items:t,rest:a,...T(n)})}s(hv,"bR"),o(hv,"_tuple");function gv(e,t,r,i){return new e({type:"record",keyType:t,valueType:r,...T(i)})}s(gv,"wR"),o(gv,"_record");function vv(e,t,r,i){return new e({type:"map",keyType:t,valueType:r,...T(i)})}s(vv,"xR"),o(vv,"_map");function yv(e,t,r){return new e({type:"set",valueType:t,...T(r)})}s(yv,"$R"),o(yv,"_set");function Ev(e,t,r){let i=Array.isArray(t)?Object.fromEntries(t.map(u=>[u,u])):t;return new e({type:"enum",entries:i,...T(r)})}s(Ev,"_R"),o(Ev,"_enum");function bv(e,t,r){return new e({type:"enum",entries:t,...T(r)})}s(bv,"kR"),o(bv,"_nativeEnum");function wv(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...T(r)})}s(wv,"SR"),o(wv,"_literal");function n0(e,t){return new e({type:"file",...T(t)})}s(n0,"yp"),o(n0,"_file");function Dv(e,t){return new e({type:"transform",transform:t})}s(Dv,"IR"),o(Dv,"_transform");function $v(e,t){return new e({type:"optional",innerType:t})}s($v,"RR"),o($v,"_optional");function Bv(e,t){return new e({type:"nullable",innerType:t})}s(Bv,"ER"),o(Bv,"_nullable");function xv(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():ba(r)}})}s(xv,"TR"),o(xv,"_default");function Cv(e,t,r){return new e({type:"nonoptional",innerType:t,...T(r)})}s(Cv,"AR"),o(Cv,"_nonoptional");function kv(e,t){return new e({type:"success",innerType:t})}s(kv,"jR"),o(kv,"_success");function Av(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}s(Av,"zR"),o(Av,"_catch");function Iv(e,t,r){return new e({type:"pipe",in:t,out:r})}s(Iv,"OR"),o(Iv,"_pipe");function _v(e,t){return new e({type:"readonly",innerType:t})}s(_v,"MR"),o(_v,"_readonly");function Sv(e,t,r){return new e({type:"template_literal",parts:t,...T(r)})}s(Sv,"NR"),o(Sv,"_templateLiteral");function Fv(e,t){return new e({type:"lazy",getter:t})}s(Fv,"PR"),o(Fv,"_lazy");function jv(e,t){return new e({type:"promise",innerType:t})}s(jv,"DR"),o(jv,"_promise");function s0(e,t,r){let i=T(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}s(s0,"bp"),o(s0,"_custom");function a0(e,t,r){return new e({type:"custom",check:"custom",fn:t,...T(r)})}s(a0,"wp"),o(a0,"_refine");function o0(e,t){let r=l0(i=>(i.addIssue=u=>{if(typeof u=="string")i.issues.push(Xu(u,i.value,r._zod.def));else{let n=u;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=i.value),n.inst??(n.inst=r),n.continue??(n.continue=!r._zod.def.abort),i.issues.push(Xu(n))}},e(i.value,i)),t);return r}s(o0,"xp"),o(o0,"_superRefine");function l0(e,t){let r=new de({check:"custom",...T(t)});return r._zod.check=e,r}s(l0,"Zw"),o(l0,"_check");function d0(e){let t=new de({check:"describe"});return t._zod.onattach=[r=>{let i=Re.get(r)??{};Re.add(r,{...i,description:e})}],t._zod.check=()=>{},t}s(d0,"$p"),o(d0,"describe");function c0(e){let t=new de({check:"meta"});return t._zod.onattach=[r=>{let i=Re.get(r)??{};Re.add(r,{...i,...e})}],t._zod.check=()=>{},t}s(c0,"_p"),o(c0,"meta");function p0(e,t){let r=T(t),i=r.truthy??["true","1","yes","on","y","enabled"],u=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(h=>typeof h=="string"?h.toLowerCase():h),u=u.map(h=>typeof h=="string"?h.toLowerCase():h));let n=new Set(i),a=new Set(u),l=e.Codec??vo,d=e.Boolean??Xa,c=e.String??rr,p=new c({type:"string",error:r.error}),m=new d({type:"boolean",error:r.error}),f=new l({type:"pipe",in:p,out:m,transform:o(((h,g)=>{let E=h;return r.case!=="sensitive"&&(E=E.toLowerCase()),n.has(E)?!0:a.has(E)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...n,...a],input:g.value,inst:f,continue:!1}),{})}),"transform"),reverseTransform:o(((h,g)=>h===!0?i[0]||"true":u[0]||"false"),"reverseTransform"),error:r.error});return f}s(p0,"kp"),o(p0,"_stringbool");function pu(e,t,r,i={}){let u=T(i),n={...T(i),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:a=>r.test(a),...u};return r instanceof RegExp&&(n.pattern=r),new e(n)}s(pu,"Zr"),o(pu,"_stringFormat");function Rt(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??Re,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}}s(Rt,"zt"),o(Rt,"initializeContext");function ie(e,t,r={path:[],schemaPath:[]}){var i;let u=e._zod.def,n=t.seen.get(e);if(n)return n.count++,r.schemaPath.includes(e)&&(n.cycle=r.path),n.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let l=e._zod.toJSONSchema?.();if(l)a.schema=l;else{let c={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,c);else{let m=a.schema,f=t.processors[u.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${u.type}`);f(e,t,m,c)}let p=e._zod.parent;p&&(a.ref||(a.ref=p),ie(p,t,c),t.seen.get(p).isParent=!0)}let d=t.metadataRegistry.get(e);return d&&Object.assign(a.schema,d),t.io==="input"&&xe(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((i=a.schema).default??(i.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}s(ie,"te"),o(ie,"process");function Tt(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let a of e.seen.entries()){let l=e.metadataRegistry.get(a[0])?.id;if(l){let d=i.get(l);if(d&&d!==a[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(l,a[0])}}let u=o(a=>{let l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(a[0])?.id,m=e.external.uri??(h=>h);if(p)return{ref:m(p)};let f=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=f,{defId:f,ref:`${m("__shared")}#/${l}/${f}`}}if(a[1]===r)return{ref:"#"};let d=`#/${l}/`,c=a[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:d+c}},"makeURI"),n=o(a=>{if(a[1].schema.$ref)return;let l=a[1],{ref:d,defId:c}=u(a);l.def={...l.schema},c&&(l.defId=c);let p=l.schema;for(let m in p)delete p[m];p.$ref=d},"extractToDef");if(e.cycles==="throw")for(let a of e.seen.entries()){let l=a[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>
63
+ `)}f.write("payload.value = newResult;"),f.write("return payload;");let $=f.compile();return(w,C)=>$(m,w,C)},"generateFastpass"),i,a=zt,l=!Ku.jitless,d=l&&ef.value,c=t.catchall,p;e._zod.parse=(m,f)=>{p??(p=n.value);let h=m.value;return a(h)?l&&d&&f?.async===!1&&f.jitless!==!0?(i||(i=u(t.shape)),m=i(m,f),c?ao([],h,m,f,p,e):m):r(m,f):(m.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),m)}});function oo(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let u=e.filter(i=>!mt(i));return u.length===1?(t.value=u[0].value,u[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>Ae(a,n,Ee())))}),t)}s(oo,"Lw"),o(oo,"handleUnionResults");var Pn=B("$ZodUnion",(e,t)=>{X.init(e,t),ee(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),ee(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),ee(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),ee(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){let n=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${n.map(u=>Xu(u.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,u)=>{if(r)return r(n,u);let i=!1,a=[];for(let l of t.options){let d=l._zod.run({value:n.value,issues:[]},u);if(d instanceof Promise)a.push(d),i=!0;else{if(d.issues.length===0)return d;a.push(d)}}return i?Promise.all(a).then(l=>oo(l,n,e,u)):oo(a,n,e,u)}});function lo(e,t,r,n){let u=e.filter(i=>i.issues.length===0);return u.length===1?(t.value=u[0].value,t):(u.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>Ae(a,n,Ee())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}s(lo,"Fw"),o(lo,"handleExclusiveUnionResults");var tg=B("$ZodXor",(e,t)=>{Pn.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,u)=>{if(r)return r(n,u);let i=!1,a=[];for(let l of t.options){let d=l._zod.run({value:n.value,issues:[]},u);d instanceof Promise?(a.push(d),i=!0):a.push(d)}return i?Promise.all(a).then(l=>lo(l,n,e,u)):lo(a,n,e,u)}}),ug=B("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Pn.init(e,t);let r=e._zod.parse;ee(e._zod,"propValues",()=>{let u={};for(let i of t.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[l,d]of Object.entries(a)){u[l]||(u[l]=new Set);for(let c of d)u[l].add(c)}}return u});let n=su(()=>{let u=t.options,i=new Map;for(let a of u){let l=a._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let d of l){if(i.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);i.set(d,a)}}return i});e._zod.parse=(u,i)=>{let a=u.value;if(!zt(a))return u.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),u;let l=n.value.get(a?.[t.discriminator]);return l?l._zod.run(u,i):t.unionFallback||i.direction==="backward"?r(u,i):(u.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()),input:a,path:[t.discriminator],inst:e}),u)}}),rg=B("$ZodIntersection",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{let u=r.value,i=t.left._zod.run({value:u,issues:[]},n),a=t.right._zod.run({value:u,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,d])=>co(r,l,d)):co(r,i,a)}});function Un(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(pt(e)&&pt(t)){let r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),u={...e,...t};for(let i of n){let a=Un(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};u[i]=a.data}return{valid:!0,data:u}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let u=e[n],i=t[n],a=Un(u,i);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}s(Un,"Uu"),o(Un,"mergeValues");function co(e,t,r){let n=new Map,u;for(let l of t.issues)if(l.code==="unrecognized_keys"){u??(u=l);for(let d of l.keys)n.has(d)||n.set(d,{}),n.get(d).l=!0}else e.issues.push(l);for(let l of r.issues)if(l.code==="unrecognized_keys")for(let d of l.keys)n.has(d)||n.set(d,{}),n.get(d).r=!0;else e.issues.push(l);let i=[...n].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(i.length&&u&&e.issues.push({...u,keys:i}),mt(e))return e;let a=Un(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}s(co,"Bw"),o(co,"handleIntersectionResults");var po=B("$ZodTuple",(e,t)=>{X.init(e,t);let r=t.items;e._zod.parse=(n,u)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];let a=[],l=mo(r,"optin"),d=mo(r,"optout");if(!t.rest){if(i.length<l)return n.issues.push({code:"too_small",minimum:l,inclusive:!0,input:i,inst:e,origin:"array"}),n;i.length>r.length&&n.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:i,inst:e,origin:"array"})}let c=new Array(r.length);for(let p=0;p<r.length;p++){let m=r[p]._zod.run({value:i[p],issues:[]},u);m instanceof Promise?a.push(m.then(f=>{c[p]=f})):c[p]=m}if(t.rest){let p=r.length-1,m=i.slice(r.length);for(let f of m){p++;let h=t.rest._zod.run({value:f,issues:[]},u);h instanceof Promise?a.push(h.then(g=>fo(g,n,p))):fo(h,n,p)}}return a.length?Promise.all(a).then(()=>ho(c,n,r,i,d)):ho(c,n,r,i,d)}});function mo(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}s(mo,"qw"),o(mo,"getTupleOptStart");function fo(e,t,r){e.issues.length&&t.issues.push(...Fe(r,e.issues)),t.value[r]=e.value}s(fo,"Zw"),o(fo,"handleTupleResult");function ho(e,t,r,n,u){for(let i=0;i<r.length;i++){let a=e[i],l=i<n.length;if(a.issues.length){if(!l&&i>=u){t.value.length=i;break}t.issues.push(...Fe(i,a.issues))}t.value[i]=a.value}for(let i=t.value.length-1;i>=n.length&&r[i]._zod.optout==="optional"&&t.value[i]===void 0;i--)t.value.length=i;return t}s(ho,"Vw"),o(ho,"handleTupleResults");var ng=B("$ZodRecord",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{let u=r.value;if(!pt(u))return r.issues.push({expected:"record",code:"invalid_type",input:u,inst:e}),r;let i=[],a=t.keyType._zod.values;if(a){r.value={};let l=new Set;for(let c of a)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){l.add(typeof c=="number"?c.toString():c);let p=t.keyType._zod.run({value:c,issues:[]},n);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(h=>Ae(h,n,Ee())),input:c,path:[c],inst:e});continue}let m=p.value,f=t.valueType._zod.run({value:u[c],issues:[]},n);f instanceof Promise?i.push(f.then(h=>{h.issues.length&&r.issues.push(...Fe(c,h.issues)),r.value[m]=h.value})):(f.issues.length&&r.issues.push(...Fe(c,f.issues)),r.value[m]=f.value)}let d;for(let c in u)l.has(c)||(d=d??[],d.push(c));d&&d.length>0&&r.issues.push({code:"unrecognized_keys",input:u,inst:e,keys:d})}else{r.value={};for(let l of Reflect.ownKeys(u)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(u,l))continue;let d=t.keyType._zod.run({value:l,issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Ha.test(l)&&d.issues.length){let p=t.keyType._zod.run({value:Number(l),issues:[]},n);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(d=p)}if(d.issues.length){t.mode==="loose"?r.value[l]=u[l]:r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(p=>Ae(p,n,Ee())),input:l,path:[l],inst:e});continue}let c=t.valueType._zod.run({value:u[l],issues:[]},n);c instanceof Promise?i.push(c.then(p=>{p.issues.length&&r.issues.push(...Fe(l,p.issues)),r.value[d.value]=p.value})):(c.issues.length&&r.issues.push(...Fe(l,c.issues)),r.value[d.value]=c.value)}}return i.length?Promise.all(i).then(()=>r):r}}),ig=B("$ZodMap",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{let u=r.value;if(!(u instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:u,inst:e}),r;let i=[];r.value=new Map;for(let[a,l]of u){let d=t.keyType._zod.run({value:a,issues:[]},n),c=t.valueType._zod.run({value:l,issues:[]},n);d instanceof Promise||c instanceof Promise?i.push(Promise.all([d,c]).then(([p,m])=>{go(p,m,r,a,u,e,n)})):go(d,c,r,a,u,e,n)}return i.length?Promise.all(i).then(()=>r):r}});function go(e,t,r,n,u,i,a){e.issues.length&&(Mn.has(typeof n)?r.issues.push(...Fe(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:u,inst:i,issues:e.issues.map(l=>Ae(l,a,Ee()))})),t.issues.length&&(Mn.has(typeof n)?r.issues.push(...Fe(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:u,inst:i,key:n,issues:t.issues.map(l=>Ae(l,a,Ee()))})),r.value.set(e.value,t.value)}s(go,"Gw"),o(go,"handleMapResult");var sg=B("$ZodSet",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{let u=r.value;if(!(u instanceof Set))return r.issues.push({input:u,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let a of u){let l=t.valueType._zod.run({value:a,issues:[]},n);l instanceof Promise?i.push(l.then(d=>vo(d,r))):vo(l,r)}return i.length?Promise.all(i).then(()=>r):r}});function vo(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}s(vo,"Ww"),o(vo,"handleSetResult");var ag=B("$ZodEnum",(e,t)=>{X.init(e,t);let r=zn(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(u=>Mn.has(typeof u)).map(u=>typeof u=="string"?Ge(u):u.toString()).join("|")})$`),e._zod.parse=(u,i)=>{let a=u.value;return n.has(a)||u.issues.push({code:"invalid_value",values:r,input:a,inst:e}),u}}),og=B("$ZodLiteral",(e,t)=>{if(X.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Ge(n):n?Ge(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,u)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),lg=B("$ZodFile",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{let u=r.value;return u instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:u,inst:e}),r}}),dg=B("$ZodTransform",(e,t)=>{X.init(e,t),e._zod.optin="optional",e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new jn(e.constructor.name);let u=t.transform(r.value,r);if(n.async)return(u instanceof Promise?u:Promise.resolve(u)).then(i=>(r.value=i,r.fallback=!0,r));if(u instanceof Promise)throw new jt;return r.value=u,r.fallback=!0,r}});function yo(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}s(yo,"Jw"),o(yo,"handleOptionalResult");var bo=B("$ZodOptional",(e,t)=>{X.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ee(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Xu(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let u=r.value,i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>yo(a,u)):yo(i,u)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),cg=B("$ZodExactOptional",(e,t)=>{bo.init(e,t),ee(e._zod,"values",()=>t.innerType._zod.values),ee(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),pg=B("$ZodNullable",(e,t)=>{X.init(e,t),ee(e._zod,"optin",()=>t.innerType._zod.optin),ee(e._zod,"optout",()=>t.innerType._zod.optout),ee(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Xu(r.source)}|null)$`):void 0}),ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),mg=B("$ZodDefault",(e,t)=>{X.init(e,t),e._zod.optin="optional",ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let u=t.innerType._zod.run(r,n);return u instanceof Promise?u.then(i=>Eo(i,t)):Eo(u,t)}});function Eo(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}s(Eo,"Kw"),o(Eo,"handleDefaultResult");var fg=B("$ZodPrefault",(e,t)=>{X.init(e,t),e._zod.optin="optional",ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),hg=B("$ZodNonOptional",(e,t)=>{X.init(e,t),ee(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let u=t.innerType._zod.run(r,n);return u instanceof Promise?u.then(i=>wo(i,e)):wo(u,e)}});function wo(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}s(wo,"Hw"),o(wo,"handleNonOptionalResult");var gg=B("$ZodSuccess",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new jn("ZodSuccess");let u=t.innerType._zod.run(r,n);return u instanceof Promise?u.then(i=>(r.value=i.issues.length===0,r)):(r.value=u.issues.length===0,r)}}),vg=B("$ZodCatch",(e,t)=>{X.init(e,t),e._zod.optin="optional",ee(e._zod,"optout",()=>t.innerType._zod.optout),ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let u=t.innerType._zod.run(r,n);return u instanceof Promise?u.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>Ae(a,n,Ee()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=u.value,u.issues.length&&(r.value=t.catchValue({...r,error:{issues:u.issues.map(i=>Ae(i,n,Ee()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),yg=B("$ZodNaN",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Do=B("$ZodPipe",(e,t)=>{X.init(e,t),ee(e._zod,"values",()=>t.in._zod.values),ee(e._zod,"optin",()=>t.in._zod.optin),ee(e._zod,"optout",()=>t.out._zod.optout),ee(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(a=>or(a,t.in,n)):or(i,t.in,n)}let u=t.in._zod.run(r,n);return u instanceof Promise?u.then(i=>or(i,t.out,n)):or(u,t.out,n)}});function or(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}s(or,"Ti"),o(or,"handlePipeResult");var $o=B("$ZodCodec",(e,t)=>{X.init(e,t),ee(e._zod,"values",()=>t.in._zod.values),ee(e._zod,"optin",()=>t.in._zod.optin),ee(e._zod,"optout",()=>t.out._zod.optout),ee(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let u=t.in._zod.run(r,n);return u instanceof Promise?u.then(i=>lr(i,t,n)):lr(u,t,n)}else{let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(i=>lr(i,t,n)):lr(u,t,n)}}});function lr(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(u=>dr(e,u,t.out,r)):dr(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(u=>dr(e,u,t.in,r)):dr(e,n,t.in,r)}}s(lr,"Ai"),o(lr,"handleCodecAResult");function dr(e,t,r,n){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},n)}s(dr,"ji"),o(dr,"handleCodecTxResult");var bg=B("$ZodPreprocess",(e,t)=>{Do.init(e,t)}),Eg=B("$ZodReadonly",(e,t)=>{X.init(e,t),ee(e._zod,"propValues",()=>t.innerType._zod.propValues),ee(e._zod,"values",()=>t.innerType._zod.values),ee(e._zod,"optin",()=>t.innerType?._zod?.optin),ee(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let u=t.innerType._zod.run(r,n);return u instanceof Promise?u.then(Bo):Bo(u)}});function Bo(e){return e.value=Object.freeze(e.value),e}s(Bo,"Xw"),o(Bo,"handleReadonlyResult");var wg=B("$ZodTemplateLiteral",(e,t)=>{X.init(e,t);let r=[];for(let n of t.parts)if(typeof n=="object"&&n!==null){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let u=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!u)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let i=u.startsWith("^")?1:0,a=u.endsWith("$")?u.length-1:u.length;r.push(u.slice(i,a))}else if(n===null||uf.has(typeof n))r.push(Ge(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(n,u)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n)}),Dg=B("$ZodFunction",(e,t)=>(X.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...n){let u=e._def.input?Na(e._def.input,n):n,i=Reflect.apply(r,this,u);return e._def.output?Na(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...n){let u=e._def.input?await Ma(e._def.input,n):n,i=await Reflect.apply(r,this,u);return e._def.output?await Ma(e._def.output,i):i}},e._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let n=e.constructor;return Array.isArray(r[0])?new n({type:"function",input:new po({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new n({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let n=e.constructor;return new n({type:"function",input:e._def.input,output:r})},e)),$g=B("$ZodPromise",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>Promise.resolve(r.value).then(u=>t.innerType._zod.run({value:u,issues:[]},n))}),Bg=B("$ZodLazy",(e,t)=>{X.init(e,t),ee(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),ee(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),ee(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),ee(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),ee(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),xg=B("$ZodCustom",(e,t)=>{de.init(e,t),X.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,u=t.fn(n);if(u instanceof Promise)return u.then(i=>xo(i,r,n,e));xo(u,r,n,e)}});function xo(e,t,r,n){if(!e){let u={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(u.params=n._zod.def.params),t.issues.push(er(u))}}s(xo,"Yw"),o(xo,"handleRefineResult");var ko={};ut(ko,{ar:s(()=>kg,"ar"),az:s(()=>Cg,"az"),be:s(()=>Ag,"be"),bg:s(()=>_g,"bg"),ca:s(()=>Ig,"ca"),cs:s(()=>Sg,"cs"),da:s(()=>Fg,"da"),de:s(()=>jg,"de"),el:s(()=>zg,"el"),en:s(()=>Ao,"en"),eo:s(()=>Ng,"eo"),es:s(()=>Mg,"es"),fa:s(()=>Og,"fa"),fi:s(()=>Rg,"fi"),fr:s(()=>Tg,"fr"),frCA:s(()=>Pg,"frCA"),he:s(()=>Ug,"he"),hr:s(()=>qg,"hr"),hu:s(()=>Zg,"hu"),hy:s(()=>Lg,"hy"),id:s(()=>Jg,"id"),is:s(()=>Vg,"is"),it:s(()=>Wg,"it"),ja:s(()=>Gg,"ja"),ka:s(()=>Kg,"ka"),kh:s(()=>Hg,"kh"),km:s(()=>Io,"km"),ko:s(()=>Xg,"ko"),lt:s(()=>Yg,"lt"),mk:s(()=>Qg,"mk"),ms:s(()=>ev,"ms"),nl:s(()=>tv,"nl"),no:s(()=>uv,"no"),ota:s(()=>rv,"ota"),pl:s(()=>iv,"pl"),ps:s(()=>nv,"ps"),pt:s(()=>sv,"pt"),ro:s(()=>av,"ro"),ru:s(()=>ov,"ru"),sl:s(()=>lv,"sl"),sv:s(()=>dv,"sv"),ta:s(()=>cv,"ta"),th:s(()=>pv,"th"),tr:s(()=>mv,"tr"),ua:s(()=>fv,"ua"),uk:s(()=>jo,"uk"),ur:s(()=>hv,"ur"),uz:s(()=>gv,"uz"),vi:s(()=>vv,"vi"),yo:s(()=>Ev,"yo"),zhCN:s(()=>yv,"zhCN"),zhTW:s(()=>bv,"zhTW")});var Y5=o(()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},n={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${u.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${l}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${l}`}case"invalid_value":return u.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${V(u.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${u.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${u.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${u.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${u.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${u.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${u.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${u.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${r[i.format]??u.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${u.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${u.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${u.keys.length>1?"\u0629":""}: ${O(u.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${u.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${u.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"error");function kg(){return{localeError:Y5()}}s(kg,"Kl"),o(kg,"default");var Q5=o(()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${u.expected}, daxil olan ${l}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${l}`}case"invalid_value":return u.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${V(u.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${u.origin??"d\u0259y\u0259r"} ${i}${u.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${u.origin??"d\u0259y\u0259r"} ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${u.origin} ${i}${u.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${u.origin} ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??u.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${u.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${u.keys.length>1?"lar":""}: ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${u.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"error");function Cg(){return{localeError:Q5()}}s(Cg,"Hl"),o(Cg,"default");function Co(e,t,r,n){let u=Math.abs(e),i=u%10,a=u%100;return a>=11&&a<=19?n:i===1?t:i>=2&&i<=4?r:n}s(Co,"ox"),o(Co,"getBelarusianPlural");var eD=o(()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},n={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${u.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${l}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${l}`}case"invalid_value":return u.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${V(u.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);if(a){let l=Number(u.maximum),d=Co(l,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${u.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${u.maximum.toString()} ${d}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${u.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);if(a){let l=Number(u.minimum),d=Co(l,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${u.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${u.minimum.toString()} ${d}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${u.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??u.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${u.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${u.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${O(u.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${u.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${u.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"error");function Ag(){return{localeError:eD()}}s(Ag,"Xl"),o(Ag,"default");var tD=o(()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${u.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${l}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${l}`}case"invalid_value":return u.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${V(u.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${u.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${u.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${u.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${u.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${u.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${u.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[i.format]??u.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${u.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${u.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${u.keys.length>1?"\u043E\u0432\u0435":""}: ${O(u.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${u.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${u.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}},"error");function _g(){return{localeError:tD()}}s(_g,"Yl"),o(_g,"default");var uD=o(()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${u.expected}, s'ha rebut ${l}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${l}`}case"invalid_value":return u.values.length===1?`Valor inv\xE0lid: s'esperava ${V(u.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${O(u.values," o ")}`;case"too_big":{let i=u.inclusive?"com a m\xE0xim":"menys de",a=t(u.origin);return a?`Massa gran: s'esperava que ${u.origin??"el valor"} contingu\xE9s ${i} ${u.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${u.origin??"el valor"} fos ${i} ${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(u.origin);return a?`Massa petit: s'esperava que ${u.origin} contingu\xE9s ${i} ${u.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${u.origin} fos ${i} ${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??u.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${u.divisor}`;case"unrecognized_keys":return`Clau${u.keys.length>1?"s":""} no reconeguda${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${u.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${u.origin}`;default:return"Entrada inv\xE0lida"}}},"error");function Ig(){return{localeError:uD()}}s(Ig,"Ql"),o(Ig,"default");var rD=o(()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},n={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${u.expected}, obdr\u017Eeno ${l}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${l}`}case"invalid_value":return u.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${V(u.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${u.origin??"hodnota"} mus\xED m\xEDt ${i}${u.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${u.origin??"hodnota"} mus\xED b\xFDt ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${u.origin??"hodnota"} mus\xED m\xEDt ${i}${u.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${u.origin??"hodnota"} mus\xED b\xFDt ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??u.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${u.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${O(u.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${u.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${u.origin}`;default:return"Neplatn\xFD vstup"}}},"error");function Sg(){return{localeError:rD()}}s(Sg,"ed"),o(Sg,"default");var nD=o(()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Ugyldigt input: forventede instanceof ${u.expected}, fik ${l}`:`Ugyldigt input: forventede ${i}, fik ${l}`}case"invalid_value":return u.values.length===1?`Ugyldig v\xE6rdi: forventede ${V(u.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin),l=n[u.origin]??u.origin;return a?`For stor: forventede ${l??"value"} ${a.verb} ${i} ${u.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${l??"value"} havde ${i} ${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin),l=n[u.origin]??u.origin;return a?`For lille: forventede ${l} ${a.verb} ${i} ${u.minimum.toString()} ${a.unit}`:`For lille: forventede ${l} havde ${i} ${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??u.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${u.divisor}`;case"unrecognized_keys":return`${u.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${O(u.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${u.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${u.origin}`;default:return"Ugyldigt input"}}},"error");function Fg(){return{localeError:nD()}}s(Fg,"td"),o(Fg,"default");var iD=o(()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},n={nan:"NaN",number:"Zahl",array:"Array"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${u.expected}, erhalten ${l}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${l}`}case"invalid_value":return u.values.length===1?`Ung\xFCltige Eingabe: erwartet ${V(u.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`Zu gro\xDF: erwartet, dass ${u.origin??"Wert"} ${i}${u.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${u.origin??"Wert"} ${i}${u.maximum.toString()} ist`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`Zu klein: erwartet, dass ${u.origin} ${i}${u.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${u.origin} ${i}${u.minimum.toString()} ist`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??u.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${u.divisor} sein`;case"unrecognized_keys":return`${u.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${O(u.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${u.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${u.origin}`;default:return"Ung\xFCltige Eingabe"}}},"error");function jg(){return{localeError:iD()}}s(jg,"rd"),o(jg,"default");var sD=o(()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},n={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return typeof u.expected=="string"&&/^[A-Z]/.test(u.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${u.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${l}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${l}`}case"invalid_value":return u.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${V(u.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${u.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${u.maximum.toString()} ${a.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${u.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${u.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${u.minimum.toString()} ${a.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${u.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${i.prefix}"`:i.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${i.suffix}"`:i.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${i.includes}"`:i.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${i.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[i.format]??u.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${u.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${u.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${u.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${O(u.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${u.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${u.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}},"error");function zg(){return{localeError:sD()}}s(zg,"nd"),o(zg,"default");var aD=o(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return`Invalid input: expected ${i}, received ${l}`}case"invalid_value":return u.values.length===1?`Invalid input: expected ${V(u.values[0])}`:`Invalid option: expected one of ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`Too big: expected ${u.origin??"value"} to have ${i}${u.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${u.origin??"value"} to be ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`Too small: expected ${u.origin} to have ${i}${u.minimum.toString()} ${a.unit}`:`Too small: expected ${u.origin} to be ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??u.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${u.divisor}`;case"unrecognized_keys":return`Unrecognized key${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Invalid key in ${u.origin}`;case"invalid_union":return u.options&&Array.isArray(u.options)&&u.options.length>0?`Invalid discriminator value. Expected ${u.options.map(i=>`'${i}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${u.origin}`;default:return"Invalid input"}}},"error");function Ao(){return{localeError:aD()}}s(Ao,"Gn"),o(Ao,"default");var oD=o(()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},n={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${u.expected}, ricevi\u011Dis ${l}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${l}`}case"invalid_value":return u.values.length===1?`Nevalida enigo: atendi\u011Dis ${V(u.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`Tro granda: atendi\u011Dis ke ${u.origin??"valoro"} havu ${i}${u.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${u.origin??"valoro"} havu ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`Tro malgranda: atendi\u011Dis ke ${u.origin} havu ${i}${u.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${u.origin} estu ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??u.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${u.divisor}`;case"unrecognized_keys":return`Nekonata${u.keys.length>1?"j":""} \u015Dlosilo${u.keys.length>1?"j":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${u.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${u.origin}`;default:return"Nevalida enigo"}}},"error");function Ng(){return{localeError:oD()}}s(Ng,"od"),o(Ng,"default");var lD=o(()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${u.expected}, recibido ${l}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${l}`}case"invalid_value":return u.values.length===1?`Entrada inv\xE1lida: se esperaba ${V(u.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin),l=n[u.origin]??u.origin;return a?`Demasiado grande: se esperaba que ${l??"valor"} tuviera ${i}${u.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${l??"valor"} fuera ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin),l=n[u.origin]??u.origin;return a?`Demasiado peque\xF1o: se esperaba que ${l} tuviera ${i}${u.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${l} fuera ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??u.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${u.divisor}`;case"unrecognized_keys":return`Llave${u.keys.length>1?"s":""} desconocida${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${n[u.origin]??u.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${n[u.origin]??u.origin}`;default:return"Entrada inv\xE1lida"}}},"error");function Mg(){return{localeError:lD()}}s(Mg,"id"),o(Mg,"default");var dD=o(()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${u.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${l} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${l} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return u.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${V(u.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${O(u.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${u.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${u.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${u.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${u.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${u.origin} \u0628\u0627\u06CC\u062F ${i}${u.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${u.origin} \u0628\u0627\u06CC\u062F ${i}${u.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??u.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${u.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${u.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${O(u.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${u.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${u.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"error");function Og(){return{localeError:dD()}}s(Og,"sd"),o(Og,"default");var cD=o(()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},n={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Virheellinen tyyppi: odotettiin instanceof ${u.expected}, oli ${l}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${l}`}case"invalid_value":return u.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${V(u.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${i}${u.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${i}${u.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??u.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${u.divisor} monikerta`;case"unrecognized_keys":return`${u.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${O(u.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}},"error");function Rg(){return{localeError:cD()}}s(Rg,"ad"),o(Rg,"default");var pD=o(()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Entr\xE9e invalide : instanceof ${u.expected} attendu, ${l} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${l} re\xE7u`}case"invalid_value":return u.values.length===1?`Entr\xE9e invalide : ${V(u.values[0])} attendu`:`Option invalide : une valeur parmi ${O(u.values,"|")} attendue`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`Trop grand : ${n[u.origin]??"valeur"} doit ${a.verb} ${i}${u.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n[u.origin]??"valeur"} doit \xEAtre ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`Trop petit : ${n[u.origin]??"valeur"} doit ${a.verb} ${i}${u.minimum.toString()} ${a.unit}`:`Trop petit : ${n[u.origin]??"valeur"} doit \xEAtre ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??u.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${u.divisor}`;case"unrecognized_keys":return`Cl\xE9${u.keys.length>1?"s":""} non reconnue${u.keys.length>1?"s":""} : ${O(u.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${u.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${u.origin}`;default:return"Entr\xE9e invalide"}}},"error");function Tg(){return{localeError:pD()}}s(Tg,"cd"),o(Tg,"default");var mD=o(()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Entr\xE9e invalide : attendu instanceof ${u.expected}, re\xE7u ${l}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${l}`}case"invalid_value":return u.values.length===1?`Entr\xE9e invalide : attendu ${V(u.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"\u2264":"<",a=t(u.origin);return a?`Trop grand : attendu que ${u.origin??"la valeur"} ait ${i}${u.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${u.origin??"la valeur"} soit ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?"\u2265":">",a=t(u.origin);return a?`Trop petit : attendu que ${u.origin} ait ${i}${u.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${u.origin} soit ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??u.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${u.divisor}`;case"unrecognized_keys":return`Cl\xE9${u.keys.length>1?"s":""} non reconnue${u.keys.length>1?"s":""} : ${O(u.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${u.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${u.origin}`;default:return"Entr\xE9e invalide"}}},"error");function Pg(){return{localeError:mD()}}s(Pg,"ud"),o(Pg,"default");var fD=o(()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=o(c=>c?e[c]:void 0,"typeEntry"),n=o(c=>{let p=r(c);return p?p.label:c??e.unknown.label},"typeLabel"),u=o(c=>`\u05D4${n(c)}`,"withDefinite"),i=o(c=>(r(c)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA","verbFor"),a=o(c=>c?t[c]??null:null,"getSizing"),l={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},d={nan:"NaN"};return c=>{switch(c.code){case"invalid_type":{let p=c.expected,m=d[p??""]??n(p),f=G(c.input),h=d[f]??e[f]?.label??f;return/^[A-Z]/.test(c.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${c.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`}case"invalid_value":{if(c.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${V(c.values[0])}`;let p=c.values.map(f=>V(f));if(c.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p[0]} \u05D0\u05D5 ${p[1]}`;let m=p[p.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p.slice(0,-1).join(", ")} \u05D0\u05D5 ${m}`}case"too_big":{let p=a(c.origin),m=u(c.origin??"value");if(c.origin==="string")return`${p?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.maximum.toString()} ${p?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(c.origin==="number"){let g=c.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${c.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(c.origin==="array"||c.origin==="set"){let g=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",b=c.inclusive?`${c.maximum} ${p?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${c.maximum} ${p?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${m} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${b}`.trim()}let f=c.inclusive?"<=":"<",h=i(c.origin??"value");return p?.unit?`${p.longLabel} \u05DE\u05D3\u05D9: ${m} ${h} ${f}${c.maximum.toString()} ${p.unit}`:`${p?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${m} ${h} ${f}${c.maximum.toString()}`}case"too_small":{let p=a(c.origin),m=u(c.origin??"value");if(c.origin==="string")return`${p?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.minimum.toString()} ${p?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(c.origin==="number"){let g=c.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${c.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(c.origin==="array"||c.origin==="set"){let g=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(c.minimum===1&&c.inclusive){let x=(c.origin,"\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${m} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${x}`}let b=c.inclusive?`${c.minimum} ${p?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${c.minimum} ${p?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${m} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${b}`.trim()}let f=c.inclusive?">=":">",h=i(c.origin??"value");return p?.unit?`${p.shortLabel} \u05DE\u05D3\u05D9: ${m} ${h} ${f}${c.minimum.toString()} ${p.unit}`:`${p?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${m} ${h} ${f}${c.minimum.toString()}`}case"invalid_format":{let p=c;if(p.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${p.prefix}"`;if(p.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${p.suffix}"`;if(p.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${p.includes}"`;if(p.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${p.pattern}`;let m=l[p.format],f=m?.label??p.format,h=(m?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${h}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${c.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${c.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${c.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${O(c.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${u(c.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"error");function Ug(){return{localeError:fD()}}s(Ug,"ld"),o(Ug,"default");var hD=o(()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},n={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${u.expected}, a primljeno je ${l}`:`Neispravan unos: o\u010Dekuje se ${i}, a primljeno je ${l}`}case"invalid_value":return u.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${V(u.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin),l=n[u.origin]??u.origin;return a?`Preveliko: o\u010Dekivano da ${l??"vrijednost"} ima ${i}${u.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${l??"vrijednost"} bude ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin),l=n[u.origin]??u.origin;return a?`Premalo: o\u010Dekivano da ${l} ima ${i}${u.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${l} bude ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${i.prefix}"`:i.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${i.suffix}"`:i.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${i.includes}"`:i.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`:`Neispravna ${r[i.format]??u.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${u.divisor}`;case"unrecognized_keys":return`Neprepoznat${u.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${O(u.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${n[u.origin]??u.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${n[u.origin]??u.origin}`;default:return"Neispravan unos"}}},"error");function qg(){return{localeError:hD()}}s(qg,"dd"),o(qg,"default");var gD=o(()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},n={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${u.expected}, a kapott \xE9rt\xE9k ${l}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${l}`}case"invalid_value":return u.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${V(u.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`T\xFAl nagy: ${u.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${u.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${u.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${u.origin} m\xE9rete t\xFAl kicsi ${i}${u.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${u.origin} t\xFAl kicsi ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??u.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${u.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${u.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${u.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"error");function Zg(){return{localeError:gD()}}s(Zg,"pd"),o(Zg,"default");function _o(e,t,r){return Math.abs(e)===1?t:r}s(_o,"ix"),o(_o,"getArmenianPlural");function Nt(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}s(Nt,"Or"),o(Nt,"withDefiniteArticle");var vD=o(()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},n={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${u.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${l}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${l}`}case"invalid_value":return u.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${V(u.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);if(a){let l=Number(u.maximum),d=_o(l,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Nt(u.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${u.maximum.toString()} ${d}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Nt(u.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);if(a){let l=Number(u.minimum),d=_o(l,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Nt(u.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${u.minimum.toString()} ${d}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Nt(u.origin)} \u056C\u056B\u0576\u056B ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??u.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${u.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${u.keys.length>1?"\u0576\u0565\u0580":""}. ${O(u.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Nt(u.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Nt(u.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}},"error");function Lg(){return{localeError:vD()}}s(Lg,"fd"),o(Lg,"default");var yD=o(()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Input tidak valid: diharapkan instanceof ${u.expected}, diterima ${l}`:`Input tidak valid: diharapkan ${i}, diterima ${l}`}case"invalid_value":return u.values.length===1?`Input tidak valid: diharapkan ${V(u.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`Terlalu besar: diharapkan ${u.origin??"value"} memiliki ${i}${u.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${u.origin??"value"} menjadi ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`Terlalu kecil: diharapkan ${u.origin} memiliki ${i}${u.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${u.origin} menjadi ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??u.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${u.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${u.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${u.origin}`;default:return"Input tidak valid"}}},"error");function Jg(){return{localeError:yD()}}s(Jg,"md"),o(Jg,"default");var bD=o(()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},n={nan:"NaN",number:"n\xFAmer",array:"fylki"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${l} \xFEar sem \xE1 a\xF0 vera instanceof ${u.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${l} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return u.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${V(u.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${u.origin??"gildi"} hafi ${i}${u.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${u.origin??"gildi"} s\xE9 ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${u.origin} hafi ${i}${u.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${u.origin} s\xE9 ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??u.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${u.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${u.keys.length>1?"ir lyklar":"ur lykill"}: ${O(u.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${u.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${u.origin}`;default:return"Rangt gildi"}}},"error");function Vg(){return{localeError:bD()}}s(Vg,"hd"),o(Vg,"default");var ED=o(()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"numero",array:"vettore"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Input non valido: atteso instanceof ${u.expected}, ricevuto ${l}`:`Input non valido: atteso ${i}, ricevuto ${l}`}case"invalid_value":return u.values.length===1?`Input non valido: atteso ${V(u.values[0])}`:`Opzione non valida: atteso uno tra ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`Troppo grande: ${u.origin??"valore"} deve avere ${i}${u.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${u.origin??"valore"} deve essere ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`Troppo piccolo: ${u.origin} deve avere ${i}${u.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${u.origin} deve essere ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Input non valido: ${r[i.format]??u.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${u.divisor}`;case"unrecognized_keys":return`Chiav${u.keys.length>1?"i":"e"} non riconosciut${u.keys.length>1?"e":"a"}: ${O(u.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${u.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${u.origin}`;default:return"Input non valido"}}},"error");function Wg(){return{localeError:ED()}}s(Wg,"gd"),o(Wg,"default");var wD=o(()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},n={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${u.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${l}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${l}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return u.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${V(u.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${O(u.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=u.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(u.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${u.origin??"\u5024"}\u306F${u.maximum.toString()}${a.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${u.origin??"\u5024"}\u306F${u.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=u.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(u.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${u.origin}\u306F${u.minimum.toString()}${a.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${u.origin}\u306F${u.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??u.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${u.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${u.keys.length>1?"\u7FA4":""}: ${O(u.keys,"\u3001")}`;case"invalid_key":return`${u.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${u.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"error");function Gg(){return{localeError:wD()}}s(Gg,"vd"),o(Gg,"default");var DD=o(()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},n={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${u.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${l}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${l}`}case"invalid_value":return u.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${V(u.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${O(u.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${u.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${i}${u.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${u.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${u.origin} ${a.verb} ${i}${u.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${u.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??u.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${u.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${u.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${O(u.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${u.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${u.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}},"error");function Kg(){return{localeError:DD()}}s(Kg,"yd"),o(Kg,"default");var $D=o(()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},n={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${u.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${l}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${l}`}case"invalid_value":return u.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${V(u.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${u.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${u.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${u.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${u.origin} ${i} ${u.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${u.origin} ${i} ${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??u.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${u.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${O(u.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${u.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${u.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"error");function Io(){return{localeError:$D()}}s(Io,"Wn"),o(Io,"default");function Hg(){return Io()}s(Hg,"bd"),o(Hg,"default");var BD=o(()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},n={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${u.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${l}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${l}\uC785\uB2C8\uB2E4`}case"invalid_value":return u.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${V(u.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${O(u.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=u.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=t(u.origin),d=l?.unit??"\uC694\uC18C";return l?`${u.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${u.maximum.toString()}${d} ${i}${a}`:`${u.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${u.maximum.toString()} ${i}${a}`}case"too_small":{let i=u.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=t(u.origin),d=l?.unit??"\uC694\uC18C";return l?`${u.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${u.minimum.toString()}${d} ${i}${a}`:`${u.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${u.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??u.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${u.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${O(u.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${u.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${u.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"error");function Xg(){return{localeError:BD()}}s(Xg,"wd"),o(Xg,"default");var cr=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalizeFirstCharacter");function So(e){let t=Math.abs(e),r=t%10,n=t%100;return n>=11&&n<=19||r===0?"many":r===1?"one":"few"}s(So,"sx"),o(So,"getUnitTypeFromNumber");var xD=o(()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(u,i,a,l){let d=e[u]??null;return d===null?d:{unit:d.unit[i],verb:d.verb[l][a?"inclusive":"notInclusive"]}}s(t,"t"),o(t,"getSizing");let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},n={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Gautas tipas ${l}, o tik\u0117tasi - instanceof ${u.expected}`:`Gautas tipas ${l}, o tik\u0117tasi - ${i}`}case"invalid_value":return u.values.length===1?`Privalo b\u016Bti ${V(u.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${O(u.values,"|")} pasirinkim\u0173`;case"too_big":{let i=n[u.origin]??u.origin,a=t(u.origin,So(Number(u.maximum)),u.inclusive??!1,"smaller");if(a?.verb)return`${cr(i??u.origin??"reik\u0161m\u0117")} ${a.verb} ${u.maximum.toString()} ${a.unit??"element\u0173"}`;let l=u.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${cr(i??u.origin??"reik\u0161m\u0117")} turi b\u016Bti ${l} ${u.maximum.toString()} ${a?.unit}`}case"too_small":{let i=n[u.origin]??u.origin,a=t(u.origin,So(Number(u.minimum)),u.inclusive??!1,"bigger");if(a?.verb)return`${cr(i??u.origin??"reik\u0161m\u0117")} ${a.verb} ${u.minimum.toString()} ${a.unit??"element\u0173"}`;let l=u.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${cr(i??u.origin??"reik\u0161m\u0117")} turi b\u016Bti ${l} ${u.minimum.toString()} ${a?.unit}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??u.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${u.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${u.keys.length>1?"i":"as"} rakt${u.keys.length>1?"ai":"as"}: ${O(u.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=n[u.origin]??u.origin;return`${cr(i??u.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}},"error");function Yg(){return{localeError:xD()}}s(Yg,"xd"),o(Yg,"default");var kD=o(()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},n={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${u.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${l}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${l}`}case"invalid_value":return u.values.length===1?`Invalid input: expected ${V(u.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${u.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${u.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${u.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${u.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${u.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${u.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${r[i.format]??u.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${u.divisor}`;case"unrecognized_keys":return`${u.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${O(u.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${u.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${u.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"error");function Qg(){return{localeError:kD()}}s(Qg,"$d"),o(Qg,"default");var CD=o(()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"nombor"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Input tidak sah: dijangka instanceof ${u.expected}, diterima ${l}`:`Input tidak sah: dijangka ${i}, diterima ${l}`}case"invalid_value":return u.values.length===1?`Input tidak sah: dijangka ${V(u.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`Terlalu besar: dijangka ${u.origin??"nilai"} ${a.verb} ${i}${u.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${u.origin??"nilai"} adalah ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`Terlalu kecil: dijangka ${u.origin} ${a.verb} ${i}${u.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${u.origin} adalah ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??u.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${u.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${O(u.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${u.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${u.origin}`;default:return"Input tidak sah"}}},"error");function ev(){return{localeError:CD()}}s(ev,"_d"),o(ev,"default");var AD=o(()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},n={nan:"NaN",number:"getal"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Ongeldige invoer: verwacht instanceof ${u.expected}, ontving ${l}`:`Ongeldige invoer: verwacht ${i}, ontving ${l}`}case"invalid_value":return u.values.length===1?`Ongeldige invoer: verwacht ${V(u.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin),l=u.origin==="date"?"laat":u.origin==="string"?"lang":"groot";return a?`Te ${l}: verwacht dat ${u.origin??"waarde"} ${i}${u.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${l}: verwacht dat ${u.origin??"waarde"} ${i}${u.maximum.toString()} is`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin),l=u.origin==="date"?"vroeg":u.origin==="string"?"kort":"klein";return a?`Te ${l}: verwacht dat ${u.origin} ${i}${u.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${l}: verwacht dat ${u.origin} ${i}${u.minimum.toString()} is`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??u.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${u.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${u.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${u.origin}`;default:return"Ongeldige invoer"}}},"error");function tv(){return{localeError:AD()}}s(tv,"kd"),o(tv,"default");var _D=o(()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"tall",array:"liste"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Ugyldig input: forventet instanceof ${u.expected}, fikk ${l}`:`Ugyldig input: forventet ${i}, fikk ${l}`}case"invalid_value":return u.values.length===1?`Ugyldig verdi: forventet ${V(u.values[0])}`:`Ugyldig valg: forventet en av ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`For stor(t): forventet ${u.origin??"value"} til \xE5 ha ${i}${u.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${u.origin??"value"} til \xE5 ha ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`For lite(n): forventet ${u.origin} til \xE5 ha ${i}${u.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${u.origin} til \xE5 ha ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??u.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${u.divisor}`;case"unrecognized_keys":return`${u.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${O(u.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${u.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${u.origin}`;default:return"Ugyldig input"}}},"error");function uv(){return{localeError:_D()}}s(uv,"Sd"),o(uv,"default");var ID=o(()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},n={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`F\xE2sit giren: umulan instanceof ${u.expected}, al\u0131nan ${l}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${l}`}case"invalid_value":return u.values.length===1?`F\xE2sit giren: umulan ${V(u.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`Fazla b\xFCy\xFCk: ${u.origin??"value"}, ${i}${u.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${u.origin??"value"}, ${i}${u.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`Fazla k\xFC\xE7\xFCk: ${u.origin}, ${i}${u.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${u.origin}, ${i}${u.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=u;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??u.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${u.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${u.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"error");function rv(){return{localeError:ID()}}s(rv,"Id"),o(rv,"default");var SD=o(()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${u.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${l} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${l} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return u.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${V(u.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${O(u.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${u.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${u.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${u.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${u.maximum.toString()} \u0648\u064A`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${u.origin} \u0628\u0627\u06CC\u062F ${i}${u.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${u.origin} \u0628\u0627\u06CC\u062F ${i}${u.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??u.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${u.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${u.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${O(u.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${u.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${u.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"error");function nv(){return{localeError:SD()}}s(nv,"Rd"),o(nv,"default");var FD=o(()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},n={nan:"NaN",number:"liczba",array:"tablica"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${u.expected}, otrzymano ${l}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${l}`}case"invalid_value":return u.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${V(u.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${u.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${u.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${u.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${u.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${u.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${u.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??u.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${u.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${u.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${u.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"error");function iv(){return{localeError:FD()}}s(iv,"Ed"),o(iv,"default");var jD=o(()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",number:"n\xFAmero",null:"nulo"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Tipo inv\xE1lido: esperado instanceof ${u.expected}, recebido ${l}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${l}`}case"invalid_value":return u.values.length===1?`Entrada inv\xE1lida: esperado ${V(u.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`Muito grande: esperado que ${u.origin??"valor"} tivesse ${i}${u.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${u.origin??"valor"} fosse ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`Muito pequeno: esperado que ${u.origin} tivesse ${i}${u.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${u.origin} fosse ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??u.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${u.divisor}`;case"unrecognized_keys":return`Chave${u.keys.length>1?"s":""} desconhecida${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${u.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${u.origin}`;default:return"Campo inv\xE1lido"}}},"error");function sv(){return{localeError:jD()}}s(sv,"Td"),o(sv,"default");var zD=o(()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},n={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${i}, primit ${l}`}case"invalid_value":return u.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${V(u.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`Prea mare: a\u0219teptat ca ${u.origin??"valoarea"} ${a.verb} ${i}${u.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${u.origin??"valoarea"} s\u0103 fie ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`Prea mic: a\u0219teptat ca ${u.origin} ${a.verb} ${i}${u.minimum.toString()} ${a.unit}`:`Prea mic: a\u0219teptat ca ${u.origin} s\u0103 fie ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${i.prefix}"`:i.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${i.suffix}"`:i.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${i.includes}"`:i.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${i.pattern}`:`Format invalid: ${r[i.format]??u.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${u.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${O(u.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${u.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${u.origin}`;default:return"Intrare invalid\u0103"}}},"error");function av(){return{localeError:zD()}}s(av,"Ad"),o(av,"default");function Fo(e,t,r,n){let u=Math.abs(e),i=u%10,a=u%100;return a>=11&&a<=19?n:i===1?t:i>=2&&i<=4?r:n}s(Fo,"ax"),o(Fo,"getRussianPlural");var ND=o(()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${u.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${l}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${l}`}case"invalid_value":return u.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${V(u.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);if(a){let l=Number(u.maximum),d=Fo(l,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${u.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${u.maximum.toString()} ${d}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${u.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);if(a){let l=Number(u.minimum),d=Fo(l,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${u.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${u.minimum.toString()} ${d}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${u.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??u.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${u.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${u.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${u.keys.length>1?"\u0438":""}: ${O(u.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${u.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${u.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"error");function ov(){return{localeError:ND()}}s(ov,"jd"),o(ov,"default");var MD=o(()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},n={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${u.expected}, prejeto ${l}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${l}`}case"invalid_value":return u.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${V(u.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${u.origin??"vrednost"} imelo ${i}${u.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${u.origin??"vrednost"} ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${u.origin} imelo ${i}${u.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${u.origin} ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??u.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${u.divisor}`;case"unrecognized_keys":return`Neprepoznan${u.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${O(u.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${u.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${u.origin}`;default:return"Neveljaven vnos"}}},"error");function lv(){return{localeError:MD()}}s(lv,"Od"),o(lv,"default");var OD=o(()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},n={nan:"NaN",number:"antal",array:"lista"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${u.expected}, fick ${l}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${l}`}case"invalid_value":return u.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${V(u.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${u.origin??"v\xE4rdet"} att ha ${i}${u.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${u.origin??"v\xE4rdet"} att ha ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${u.origin??"v\xE4rdet"} att ha ${i}${u.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${u.origin??"v\xE4rdet"} att ha ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??u.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${u.divisor}`;case"unrecognized_keys":return`${u.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${O(u.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${u.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${u.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"error");function dv(){return{localeError:OD()}}s(dv,"zd"),o(dv,"default");var RD=o(()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${u.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${l}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${l}`}case"invalid_value":return u.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${V(u.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${O(u.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${u.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${u.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${u.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${u.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${u.origin} ${i}${u.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${u.origin} ${i}${u.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??u.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${u.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${u.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${u.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},"error");function cv(){return{localeError:RD()}}s(cv,"Md"),o(cv,"default");var TD=o(()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},n={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${u.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${l}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${l}`}case"invalid_value":return u.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${V(u.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(u.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${u.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${u.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${u.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(u.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${u.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${u.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${u.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??u.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${u.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${O(u.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${u.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${u.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"error");function pv(){return{localeError:TD()}}s(pv,"Nd"),o(pv,"default");var PD=o(()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},n={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${u.expected}, al\u0131nan ${l}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${l}`}case"invalid_value":return u.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${V(u.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${u.origin??"de\u011Fer"} ${i}${u.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${u.origin??"de\u011Fer"} ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${u.origin} ${i}${u.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${u.origin} ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??u.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${u.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${u.keys.length>1?"lar":""}: ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${u.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"error");function mv(){return{localeError:PD()}}s(mv,"Pd"),o(mv,"default");var UD=o(()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${u.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${l}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${l}`}case"invalid_value":return u.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${V(u.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${u.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${i}${u.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${u.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${u.origin} ${a.verb} ${i}${u.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${u.origin} \u0431\u0443\u0434\u0435 ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??u.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${u.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${u.keys.length>1?"\u0456":""}: ${O(u.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${u.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${u.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"error");function jo(){return{localeError:UD()}}s(jo,"Kn"),o(jo,"default");function fv(){return jo()}s(fv,"Dd"),o(fv,"default");var qD=o(()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},n={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${u.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${l} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${l} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return u.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${V(u.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${O(u.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${u.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${u.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${u.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${u.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${u.origin} \u06A9\u06D2 ${i}${u.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${u.origin} \u06A9\u0627 ${i}${u.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??u.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${u.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${u.keys.length>1?"\u0632":""}: ${O(u.keys,"\u060C ")}`;case"invalid_key":return`${u.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${u.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"error");function hv(){return{localeError:qD()}}s(hv,"Cd"),o(hv,"default");var ZD=o(()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},n={nan:"NaN",number:"raqam",array:"massiv"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${u.expected}, qabul qilingan ${l}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${l}`}case"invalid_value":return u.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${V(u.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`Juda katta: kutilgan ${u.origin??"qiymat"} ${i}${u.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${u.origin??"qiymat"} ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`Juda kichik: kutilgan ${u.origin} ${i}${u.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${u.origin} ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??u.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${u.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${u.keys.length>1?"lar":""}: ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${u.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}},"error");function gv(){return{localeError:ZD()}}s(gv,"Ud"),o(gv,"default");var LD=o(()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},n={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${u.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${l}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${l}`}case"invalid_value":return u.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${V(u.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${u.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${i}${u.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${u.origin??"gi\xE1 tr\u1ECB"} ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${u.origin} ${a.verb} ${i}${u.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${u.origin} ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??u.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${u.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${O(u.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${u.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${u.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"error");function vv(){return{localeError:LD()}}s(vv,"Ld"),o(vv,"default");var JD=o(()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},n={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${u.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${l}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${l}`}case"invalid_value":return u.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${V(u.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${u.origin??"\u503C"} ${i}${u.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${u.origin??"\u503C"} ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${u.origin} ${i}${u.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${u.origin} ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??u.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${u.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${u.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"error");function yv(){return{localeError:JD()}}s(yv,"Fd"),o(yv,"default");var VD=o(()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},n={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${u.expected}\uFF0C\u4F46\u6536\u5230 ${l}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${l}`}case"invalid_value":return u.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${V(u.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${u.origin??"\u503C"} \u61C9\u70BA ${i}${u.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${u.origin??"\u503C"} \u61C9\u70BA ${i}${u.maximum.toString()}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${u.origin} \u61C9\u70BA ${i}${u.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${u.origin} \u61C9\u70BA ${i}${u.minimum.toString()}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??u.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${u.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${u.keys.length>1?"\u5011":""}\uFF1A${O(u.keys,"\u3001")}`;case"invalid_key":return`${u.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${u.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"error");function bv(){return{localeError:VD()}}s(bv,"Bd"),o(bv,"default");var WD=o(()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},n={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return u=>{switch(u.code){case"invalid_type":{let i=n[u.expected]??u.expected,a=G(u.input),l=n[a]??a;return/^[A-Z]/.test(u.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${u.expected}, \xE0m\u1ECD\u0300 a r\xED ${l}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${l}`}case"invalid_value":return u.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${V(u.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${O(u.values,"|")}`;case"too_big":{let i=u.inclusive?"<=":"<",a=t(u.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${u.origin??"iye"} ${a.verb} ${i}${u.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${u.maximum}`}case"too_small":{let i=u.inclusive?">=":">",a=t(u.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${u.origin} ${a.verb} ${i}${u.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${u.minimum}`}case"invalid_format":{let i=u;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??u.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${u.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${O(u.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${u.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${u.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}},"error");function Ev(){return{localeError:WD()}}s(Ev,"qd"),o(Ev,"default");var wv,Dv=Symbol("ZodOutput"),$v=Symbol("ZodInput"),Bv=class{static{s(this,"Ci")}static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.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 r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function qn(){return new Bv}s(qn,"Ui"),o(qn,"registry"),(wv=globalThis).__zod_globalRegistry??(wv.__zod_globalRegistry=qn());var Re=globalThis.__zod_globalRegistry;function zo(e,t){return new e({type:"string",...T(t)})}s(zo,"Gd"),o(zo,"_string");function No(e,t){return new e({type:"string",coerce:!0,...T(t)})}s(No,"Wd"),o(No,"_coercedString");function Zn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...T(t)})}s(Zn,"Li"),o(Zn,"_email");function pr(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...T(t)})}s(pr,"Xn"),o(pr,"_guid");function Ln(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...T(t)})}s(Ln,"Fi"),o(Ln,"_uuid");function Jn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...T(t)})}s(Jn,"Bi"),o(Jn,"_uuidv4");function Vn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...T(t)})}s(Vn,"qi"),o(Vn,"_uuidv6");function Wn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...T(t)})}s(Wn,"Zi"),o(Wn,"_uuidv7");function mr(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...T(t)})}s(mr,"Yn"),o(mr,"_url");function Gn(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...T(t)})}s(Gn,"Vi"),o(Gn,"_emoji");function Kn(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...T(t)})}s(Kn,"Gi"),o(Kn,"_nanoid");function Hn(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...T(t)})}s(Hn,"Wi"),o(Hn,"_cuid");function Xn(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...T(t)})}s(Xn,"Ji"),o(Xn,"_cuid2");function Yn(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...T(t)})}s(Yn,"Ki"),o(Yn,"_ulid");function Qn(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...T(t)})}s(Qn,"Hi"),o(Qn,"_xid");function ei(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...T(t)})}s(ei,"Xi"),o(ei,"_ksuid");function ti(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...T(t)})}s(ti,"Yi"),o(ti,"_ipv4");function ui(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...T(t)})}s(ui,"Qi"),o(ui,"_ipv6");function Mo(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...T(t)})}s(Mo,"Jd"),o(Mo,"_mac");function ri(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...T(t)})}s(ri,"es"),o(ri,"_cidrv4");function ni(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...T(t)})}s(ni,"ts"),o(ni,"_cidrv6");function ii(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...T(t)})}s(ii,"rs"),o(ii,"_base64");function si(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...T(t)})}s(si,"ns"),o(si,"_base64url");function ai(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...T(t)})}s(ai,"os"),o(ai,"_e164");function oi(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...T(t)})}s(oi,"is"),o(oi,"_jwt");var xv={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Oo(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...T(t)})}s(Oo,"Hd"),o(Oo,"_isoDateTime");function Ro(e,t){return new e({type:"string",format:"date",check:"string_format",...T(t)})}s(Ro,"Xd"),o(Ro,"_isoDate");function To(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...T(t)})}s(To,"Yd"),o(To,"_isoTime");function Po(e,t){return new e({type:"string",format:"duration",check:"string_format",...T(t)})}s(Po,"Qd"),o(Po,"_isoDuration");function Uo(e,t){return new e({type:"number",checks:[],...T(t)})}s(Uo,"ep"),o(Uo,"_number");function qo(e,t){return new e({type:"number",coerce:!0,checks:[],...T(t)})}s(qo,"tp"),o(qo,"_coercedNumber");function Zo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...T(t)})}s(Zo,"rp"),o(Zo,"_int");function Lo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...T(t)})}s(Lo,"np"),o(Lo,"_float32");function Jo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...T(t)})}s(Jo,"op"),o(Jo,"_float64");function Vo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...T(t)})}s(Vo,"ip"),o(Vo,"_int32");function Wo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...T(t)})}s(Wo,"sp"),o(Wo,"_uint32");function Go(e,t){return new e({type:"boolean",...T(t)})}s(Go,"ap"),o(Go,"_boolean");function Ko(e,t){return new e({type:"boolean",coerce:!0,...T(t)})}s(Ko,"cp"),o(Ko,"_coercedBoolean");function Ho(e,t){return new e({type:"bigint",...T(t)})}s(Ho,"up"),o(Ho,"_bigint");function Xo(e,t){return new e({type:"bigint",coerce:!0,...T(t)})}s(Xo,"lp"),o(Xo,"_coercedBigint");function Yo(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...T(t)})}s(Yo,"dp"),o(Yo,"_int64");function Qo(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...T(t)})}s(Qo,"pp"),o(Qo,"_uint64");function e0(e,t){return new e({type:"symbol",...T(t)})}s(e0,"fp"),o(e0,"_symbol");function t0(e,t){return new e({type:"undefined",...T(t)})}s(t0,"mp"),o(t0,"_undefined");function u0(e,t){return new e({type:"null",...T(t)})}s(u0,"hp"),o(u0,"_null");function r0(e){return new e({type:"any"})}s(r0,"gp"),o(r0,"_any");function n0(e){return new e({type:"unknown"})}s(n0,"vp"),o(n0,"_unknown");function i0(e,t){return new e({type:"never",...T(t)})}s(i0,"yp"),o(i0,"_never");function s0(e,t){return new e({type:"void",...T(t)})}s(s0,"bp"),o(s0,"_void");function a0(e,t){return new e({type:"date",...T(t)})}s(a0,"wp"),o(a0,"_date");function o0(e,t){return new e({type:"date",coerce:!0,...T(t)})}s(o0,"xp"),o(o0,"_coercedDate");function l0(e,t){return new e({type:"nan",...T(t)})}s(l0,"$p"),o(l0,"_nan");function nt(e,t){return new Xa({check:"less_than",...T(t),value:e,inclusive:!1})}s(nt,"st"),o(nt,"_lt");function ze(e,t){return new Xa({check:"less_than",...T(t),value:e,inclusive:!0})}s(ze,"qe"),o(ze,"_lte");function it(e,t){return new Ya({check:"greater_than",...T(t),value:e,inclusive:!1})}s(it,"at"),o(it,"_gt");function ke(e,t){return new Ya({check:"greater_than",...T(t),value:e,inclusive:!0})}s(ke,"je"),o(ke,"_gte");function li(e){return it(0,e)}s(li,"ss"),o(li,"_positive");function di(e){return nt(0,e)}s(di,"as"),o(di,"_negative");function ci(e){return ze(0,e)}s(ci,"cs"),o(ci,"_nonpositive");function pi(e){return ke(0,e)}s(pi,"us"),o(pi,"_nonnegative");function Mt(e,t){return new Xf({check:"multiple_of",...T(t),value:e})}s(Mt,"At"),o(Mt,"_multipleOf");function Ot(e,t){return new eh({check:"max_size",...T(t),maximum:e})}s(Ot,"jt"),o(Ot,"_maxSize");function st(e,t){return new th({check:"min_size",...T(t),minimum:e})}s(st,"ct"),o(st,"_minSize");function cu(e,t){return new uh({check:"size_equals",...T(t),size:e})}s(cu,"nr"),o(cu,"_size");function pu(e,t){return new rh({check:"max_length",...T(t),maximum:e})}s(pu,"or"),o(pu,"_maxLength");function ht(e,t){return new nh({check:"min_length",...T(t),minimum:e})}s(ht,"vt"),o(ht,"_minLength");function mu(e,t){return new ih({check:"length_equals",...T(t),length:e})}s(mu,"ir"),o(mu,"_length");function fr(e,t){return new sh({check:"string_format",format:"regex",...T(t),pattern:e})}s(fr,"zr"),o(fr,"_regex");function hr(e){return new ah({check:"string_format",format:"lowercase",...T(e)})}s(hr,"Mr"),o(hr,"_lowercase");function gr(e){return new oh({check:"string_format",format:"uppercase",...T(e)})}s(gr,"Nr"),o(gr,"_uppercase");function vr(e,t){return new lh({check:"string_format",format:"includes",...T(t),includes:e})}s(vr,"Pr"),o(vr,"_includes");function yr(e,t){return new dh({check:"string_format",format:"starts_with",...T(t),prefix:e})}s(yr,"Dr"),o(yr,"_startsWith");function br(e,t){return new ch({check:"string_format",format:"ends_with",...T(t),suffix:e})}s(br,"Cr"),o(br,"_endsWith");function mi(e,t,r){return new ph({check:"property",property:e,schema:t,...T(r)})}s(mi,"ls"),o(mi,"_property");function Er(e,t){return new mh({check:"mime_type",mime:e,...T(t)})}s(Er,"Ur"),o(Er,"_mime");function Ke(e){return new fh({check:"overwrite",tx:e})}s(Ke,"et"),o(Ke,"_overwrite");function wr(e){return Ke(t=>t.normalize(e))}s(wr,"Lr"),o(wr,"_normalize");function Dr(){return Ke(e=>e.trim())}s(Dr,"Fr"),o(Dr,"_trim");function $r(){return Ke(e=>e.toLowerCase())}s($r,"Br"),o($r,"_toLowerCase");function Br(){return Ke(e=>e.toUpperCase())}s(Br,"qr"),o(Br,"_toUpperCase");function xr(){return Ke(e=>Ba(e))}s(xr,"Zr"),o(xr,"_slugify");function d0(e,t,r){return new e({type:"array",element:t,...T(r)})}s(d0,"_p"),o(d0,"_array");function kv(e,t,r){return new e({type:"union",options:t,...T(r)})}s(kv,"YR"),o(kv,"_union");function Cv(e,t,r){return new e({type:"union",options:t,inclusive:!1,...T(r)})}s(Cv,"QR"),o(Cv,"_xor");function Av(e,t,r,n){return new e({type:"union",options:r,discriminator:t,...T(n)})}s(Av,"eE"),o(Av,"_discriminatedUnion");function _v(e,t,r){return new e({type:"intersection",left:t,right:r})}s(_v,"tE"),o(_v,"_intersection");function Iv(e,t,r,n){let u=r instanceof X,i=u?n:r,a=u?r:null;return new e({type:"tuple",items:t,rest:a,...T(i)})}s(Iv,"rE"),o(Iv,"_tuple");function Sv(e,t,r,n){return new e({type:"record",keyType:t,valueType:r,...T(n)})}s(Sv,"nE"),o(Sv,"_record");function Fv(e,t,r,n){return new e({type:"map",keyType:t,valueType:r,...T(n)})}s(Fv,"oE"),o(Fv,"_map");function jv(e,t,r){return new e({type:"set",valueType:t,...T(r)})}s(jv,"iE"),o(jv,"_set");function zv(e,t,r){let n=Array.isArray(t)?Object.fromEntries(t.map(u=>[u,u])):t;return new e({type:"enum",entries:n,...T(r)})}s(zv,"sE"),o(zv,"_enum");function Nv(e,t,r){return new e({type:"enum",entries:t,...T(r)})}s(Nv,"aE"),o(Nv,"_nativeEnum");function Mv(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...T(r)})}s(Mv,"cE"),o(Mv,"_literal");function c0(e,t){return new e({type:"file",...T(t)})}s(c0,"kp"),o(c0,"_file");function Ov(e,t){return new e({type:"transform",transform:t})}s(Ov,"uE"),o(Ov,"_transform");function Rv(e,t){return new e({type:"optional",innerType:t})}s(Rv,"lE"),o(Rv,"_optional");function Tv(e,t){return new e({type:"nullable",innerType:t})}s(Tv,"dE"),o(Tv,"_nullable");function Pv(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():ka(r)}})}s(Pv,"pE"),o(Pv,"_default");function Uv(e,t,r){return new e({type:"nonoptional",innerType:t,...T(r)})}s(Uv,"fE"),o(Uv,"_nonoptional");function qv(e,t){return new e({type:"success",innerType:t})}s(qv,"mE"),o(qv,"_success");function Zv(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}s(Zv,"hE"),o(Zv,"_catch");function Lv(e,t,r){return new e({type:"pipe",in:t,out:r})}s(Lv,"gE"),o(Lv,"_pipe");function Jv(e,t){return new e({type:"readonly",innerType:t})}s(Jv,"vE"),o(Jv,"_readonly");function Vv(e,t,r){return new e({type:"template_literal",parts:t,...T(r)})}s(Vv,"yE"),o(Vv,"_templateLiteral");function Wv(e,t){return new e({type:"lazy",getter:t})}s(Wv,"bE"),o(Wv,"_lazy");function Gv(e,t){return new e({type:"promise",innerType:t})}s(Gv,"wE"),o(Gv,"_promise");function p0(e,t,r){let n=T(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}s(p0,"Sp"),o(p0,"_custom");function m0(e,t,r){return new e({type:"custom",check:"custom",fn:t,...T(r)})}s(m0,"Ip"),o(m0,"_refine");function f0(e,t){let r=h0(n=>(n.addIssue=u=>{if(typeof u=="string")n.issues.push(er(u,n.value,r._zod.def));else{let i=u;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(er(i))}},e(n.value,n)),t);return r}s(f0,"Rp"),o(f0,"_superRefine");function h0(e,t){let r=new de({check:"custom",...T(t)});return r._zod.check=e,r}s(h0,"ux"),o(h0,"_check");function g0(e){let t=new de({check:"describe"});return t._zod.onattach=[r=>{let n=Re.get(r)??{};Re.add(r,{...n,description:e})}],t._zod.check=()=>{},t}s(g0,"Ep"),o(g0,"describe");function v0(e){let t=new de({check:"meta"});return t._zod.onattach=[r=>{let n=Re.get(r)??{};Re.add(r,{...n,...e})}],t._zod.check=()=>{},t}s(v0,"Tp"),o(v0,"meta");function y0(e,t){let r=T(t),n=r.truthy??["true","1","yes","on","y","enabled"],u=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(h=>typeof h=="string"?h.toLowerCase():h),u=u.map(h=>typeof h=="string"?h.toLowerCase():h));let i=new Set(n),a=new Set(u),l=e.Codec??$o,d=e.Boolean??ro,c=e.String??sr,p=new c({type:"string",error:r.error}),m=new d({type:"boolean",error:r.error}),f=new l({type:"pipe",in:p,out:m,transform:o(((h,g)=>{let b=h;return r.case!=="sensitive"&&(b=b.toLowerCase()),i.has(b)?!0:a.has(b)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:g.value,inst:f,continue:!1}),{})}),"transform"),reverseTransform:o(((h,g)=>h===!0?n[0]||"true":u[0]||"false"),"reverseTransform"),error:r.error});return f}s(y0,"Ap"),o(y0,"_stringbool");function fu(e,t,r,n={}){let u=T(n),i={...T(n),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:a=>r.test(a),...u};return r instanceof RegExp&&(i.pattern=r),new e(i)}s(fu,"Vr"),o(fu,"_stringFormat");function Rt(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??Re,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}}s(Rt,"Ot"),o(Rt,"initializeContext");function ne(e,t,r={path:[],schemaPath:[]}){var n;let u=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let l=e._zod.toJSONSchema?.();if(l)a.schema=l;else{let c={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,c);else{let m=a.schema,f=t.processors[u.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${u.type}`);f(e,t,m,c)}let p=e._zod.parent;p&&(a.ref||(a.ref=p),ne(p,t,c),t.seen.get(p).isParent=!0)}let d=t.metadataRegistry.get(e);return d&&Object.assign(a.schema,d),t.io==="input"&&xe(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}s(ne,"te"),o(ne,"process");function Tt(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let a of e.seen.entries()){let l=e.metadataRegistry.get(a[0])?.id;if(l){let d=n.get(l);if(d&&d!==a[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(l,a[0])}}let u=o(a=>{let l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(a[0])?.id,m=e.external.uri??(h=>h);if(p)return{ref:m(p)};let f=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=f,{defId:f,ref:`${m("__shared")}#/${l}/${f}`}}if(a[1]===r)return{ref:"#"};let d=`#/${l}/`,c=a[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:d+c}},"makeURI"),i=o(a=>{if(a[1].schema.$ref)return;let l=a[1],{ref:d,defId:c}=u(a);l.def={...l.schema},c&&(l.defId=c);let p=l.schema;for(let m in p)delete p[m];p.$ref=d},"extractToDef");if(e.cycles==="throw")for(let a of e.seen.entries()){let l=a[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>
64
64
 
65
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let l=a[1];if(t===a[0]){n(a);continue}if(e.external){let d=e.external.registry.get(a[0])?.id;if(t!==a[0]&&d){n(a);continue}}if(e.metadataRegistry.get(a[0])?.id){n(a);continue}if(l.cycle){n(a);continue}if(l.count>1&&e.reused==="ref"){n(a);continue}}}s(Tt,"Ot"),o(Tt,"extractDefs");function Pt(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=o(l=>{let d=e.seen.get(l);if(d.ref===null)return;let c=d.def??d.schema,p={...c},m=d.ref;if(d.ref=null,m){i(m);let h=e.seen.get(m),g=h.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(g)):Object.assign(c,g),Object.assign(c,p),l._zod.parent===m)for(let E in c)E==="$ref"||E==="allOf"||E in p||delete c[E];if(g.$ref&&h.def)for(let E in c)E==="$ref"||E==="allOf"||E in h.def&&JSON.stringify(c[E])===JSON.stringify(h.def[E])&&delete c[E]}let f=l._zod.parent;if(f&&f!==m){i(f);let h=e.seen.get(f);if(h?.schema.$ref&&(c.$ref=h.schema.$ref,h.def))for(let g in c)g==="$ref"||g==="allOf"||g in h.def&&JSON.stringify(c[g])===JSON.stringify(h.def[g])&&delete c[g]}e.override({zodSchema:l,jsonSchema:c,path:d.path??[]})},"flattenRef");for(let l of[...e.seen.entries()].reverse())i(l[0]);let u={};if(e.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?u.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?u.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");u.$id=e.external.uri(l)}Object.assign(u,r.def??r.schema);let n=e.metadataRegistry.get(t)?.id;n!==void 0&&u.id===n&&delete u.id;let a=e.external?.defs??{};for(let l of e.seen.entries()){let d=l[1];d.def&&d.defId&&(d.def.id===d.defId&&delete d.def.id,a[d.defId]=d.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?u.$defs=a:u.definitions=a);try{let l=JSON.parse(JSON.stringify(u));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:$r(t,"input",e.processors),output:$r(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}s(Pt,"Mt"),o(Pt,"finalize");function xe(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return xe(i.element,r);if(i.type==="set")return xe(i.valueType,r);if(i.type==="lazy")return xe(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return xe(i.innerType,r);if(i.type==="intersection")return xe(i.left,r)||xe(i.right,r);if(i.type==="record"||i.type==="map")return xe(i.keyType,r)||xe(i.valueType,r);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:xe(i.in,r)||xe(i.out,r);if(i.type==="object"){for(let u in i.shape)if(xe(i.shape[u],r))return!0;return!1}if(i.type==="union"){for(let u of i.options)if(xe(u,r))return!0;return!1}if(i.type==="tuple"){for(let u of i.items)if(xe(u,r))return!0;return!!(i.rest&&xe(i.rest,r))}return!1}s(xe,"ze"),o(xe,"isTransforming");var zv=o((e,t={})=>r=>{let i=Rt({...r,processors:t});return ie(e,i),Tt(i,e),Pt(i,e)},"createToJSONSchemaMethod"),$r=o((e,t,r={})=>i=>{let{libraryOptions:u,target:n}=i??{},a=Rt({...u??{},target:n,io:t,processors:r});return ie(e,a),Tt(a,e),Pt(a,e)},"createStandardJSONSchemaMethod"),hD={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Nv=o((e,t,r,i)=>{let u=r;u.type="string";let{minimum:n,maximum:a,format:l,patterns:d,contentEncoding:c}=e._zod.bag;if(typeof n=="number"&&(u.minLength=n),typeof a=="number"&&(u.maxLength=a),l&&(u.format=hD[l]??l,u.format===""&&delete u.format,l==="time"&&delete u.format),c&&(u.contentEncoding=c),d&&d.size>0){let p=[...d];p.length===1?u.pattern=p[0].source:p.length>1&&(u.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},"stringProcessor"),Mv=o((e,t,r,i)=>{let u=r,{minimum:n,maximum:a,format:l,multipleOf:d,exclusiveMaximum:c,exclusiveMinimum:p}=e._zod.bag;typeof l=="string"&&l.includes("int")?u.type="integer":u.type="number";let m=typeof p=="number"&&p>=(n??Number.NEGATIVE_INFINITY),f=typeof c=="number"&&c<=(a??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";m?h?(u.minimum=p,u.exclusiveMinimum=!0):u.exclusiveMinimum=p:typeof n=="number"&&(u.minimum=n),f?h?(u.maximum=c,u.exclusiveMaximum=!0):u.exclusiveMaximum=c:typeof a=="number"&&(u.maximum=a),typeof d=="number"&&(u.multipleOf=d)},"numberProcessor"),Ov=o((e,t,r,i)=>{r.type="boolean"},"booleanProcessor"),Rv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},"bigintProcessor"),Tv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},"symbolProcessor"),Pv=o((e,t,r,i)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},"nullProcessor"),Uv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},"undefinedProcessor"),qv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},"voidProcessor"),Zv=o((e,t,r,i)=>{r.not={}},"neverProcessor"),Lv=o((e,t,r,i)=>{},"anyProcessor"),Vv=o((e,t,r,i)=>{},"unknownProcessor"),Jv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},"dateProcessor"),Wv=o((e,t,r,i)=>{let u=e._zod.def,n=Ii(u.entries);n.every(a=>typeof a=="number")&&(r.type="number"),n.every(a=>typeof a=="string")&&(r.type="string"),r.enum=n},"enumProcessor"),Gv=o((e,t,r,i)=>{let u=e._zod.def,n=[];for(let a of u.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");n.push(Number(a))}else n.push(a);if(n.length!==0)if(n.length===1){let a=n[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else n.every(a=>typeof a=="number")&&(r.type="number"),n.every(a=>typeof a=="string")&&(r.type="string"),n.every(a=>typeof a=="boolean")&&(r.type="boolean"),n.every(a=>a===null)&&(r.type="null"),r.enum=n},"literalProcessor"),Kv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},"nanProcessor"),Hv=o((e,t,r,i)=>{let u=r,n=e._zod.pattern;if(!n)throw new Error("Pattern not found in template literal");u.type="string",u.pattern=n.source},"templateLiteralProcessor"),Xv=o((e,t,r,i)=>{let u=r,n={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:l,mime:d}=e._zod.bag;a!==void 0&&(n.minLength=a),l!==void 0&&(n.maxLength=l),d?d.length===1?(n.contentMediaType=d[0],Object.assign(u,n)):(Object.assign(u,n),u.anyOf=d.map(c=>({contentMediaType:c}))):Object.assign(u,n)},"fileProcessor"),Yv=o((e,t,r,i)=>{r.type="boolean"},"successProcessor"),Qv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},"customProcessor"),e1=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},"functionProcessor"),t1=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},"transformProcessor"),u1=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},"mapProcessor"),r1=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},"setProcessor"),i1=o((e,t,r,i)=>{let u=r,n=e._zod.def,{minimum:a,maximum:l}=e._zod.bag;typeof a=="number"&&(u.minItems=a),typeof l=="number"&&(u.maxItems=l),u.type="array",u.items=ie(n.element,t,{...i,path:[...i.path,"items"]})},"arrayProcessor"),n1=o((e,t,r,i)=>{let u=r,n=e._zod.def;u.type="object",u.properties={};let a=n.shape;for(let c in a)u.properties[c]=ie(a[c],t,{...i,path:[...i.path,"properties",c]});let l=new Set(Object.keys(a)),d=new Set([...l].filter(c=>{let p=n.shape[c]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));d.size>0&&(u.required=Array.from(d)),n.catchall?._zod.def.type==="never"?u.additionalProperties=!1:n.catchall?n.catchall&&(u.additionalProperties=ie(n.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(u.additionalProperties=!1)},"objectProcessor"),m0=o((e,t,r,i)=>{let u=e._zod.def,n=u.inclusive===!1,a=u.options.map((l,d)=>ie(l,t,{...i,path:[...i.path,n?"oneOf":"anyOf",d]}));n?r.oneOf=a:r.anyOf=a},"unionProcessor"),s1=o((e,t,r,i)=>{let u=e._zod.def,n=ie(u.left,t,{...i,path:[...i.path,"allOf",0]}),a=ie(u.right,t,{...i,path:[...i.path,"allOf",1]}),l=o(c=>"allOf"in c&&Object.keys(c).length===1,"isSimpleIntersection"),d=[...l(n)?n.allOf:[n],...l(a)?a.allOf:[a]];r.allOf=d},"intersectionProcessor"),a1=o((e,t,r,i)=>{let u=r,n=e._zod.def;u.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",l=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",d=n.items.map((f,h)=>ie(f,t,{...i,path:[...i.path,a,h]})),c=n.rest?ie(n.rest,t,{...i,path:[...i.path,l,...t.target==="openapi-3.0"?[n.items.length]:[]]}):null;t.target==="draft-2020-12"?(u.prefixItems=d,c&&(u.items=c)):t.target==="openapi-3.0"?(u.items={anyOf:d},c&&u.items.anyOf.push(c),u.minItems=d.length,c||(u.maxItems=d.length)):(u.items=d,c&&(u.additionalItems=c));let{minimum:p,maximum:m}=e._zod.bag;typeof p=="number"&&(u.minItems=p),typeof m=="number"&&(u.maxItems=m)},"tupleProcessor"),o1=o((e,t,r,i)=>{let u=r,n=e._zod.def;u.type="object";let a=n.keyType,l=a._zod.bag?.patterns;if(n.mode==="loose"&&l&&l.size>0){let c=ie(n.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});u.patternProperties={};for(let p of l)u.patternProperties[p.source]=c}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(u.propertyNames=ie(n.keyType,t,{...i,path:[...i.path,"propertyNames"]})),u.additionalProperties=ie(n.valueType,t,{...i,path:[...i.path,"additionalProperties"]});let d=a._zod.values;if(d){let c=[...d].filter(p=>typeof p=="string"||typeof p=="number");c.length>0&&(u.required=c)}},"recordProcessor"),l1=o((e,t,r,i)=>{let u=e._zod.def,n=ie(u.innerType,t,i),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=u.innerType,r.nullable=!0):r.anyOf=[n,{type:"null"}]},"nullableProcessor"),d1=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType},"nonoptionalProcessor"),c1=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType,r.default=JSON.parse(JSON.stringify(u.defaultValue))},"defaultProcessor"),p1=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(u.defaultValue)))},"prefaultProcessor"),m1=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType;let a;try{a=u.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},"catchProcessor"),f1=o((e,t,r,i)=>{let u=e._zod.def,n=u.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?n?u.out:u.in:u.out;ie(a,t,i);let l=t.seen.get(e);l.ref=a},"pipeProcessor"),h1=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType,r.readOnly=!0},"readonlyProcessor"),g1=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType},"promiseProcessor"),f0=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType},"optionalProcessor"),v1=o((e,t,r,i)=>{let u=e._zod.innerType;ie(u,t,i);let n=t.seen.get(e);n.ref=u},"lazyProcessor"),h0={string:Nv,number:Mv,boolean:Ov,bigint:Rv,symbol:Tv,null:Pv,undefined:Uv,void:qv,never:Zv,any:Lv,unknown:Vv,date:Jv,enum:Wv,literal:Gv,nan:Kv,template_literal:Hv,file:Xv,success:Yv,custom:Qv,function:e1,transform:t1,map:u1,set:r1,array:i1,object:n1,union:m0,intersection:s1,tuple:a1,record:o1,nullable:l1,nonoptional:d1,default:c1,prefault:p1,catch:m1,pipe:f1,readonly:h1,promise:g1,optional:f0,lazy:v1};function g0(e,t){if("_idmap"in e){let i=e,u=Rt({...t,processors:h0}),n={};for(let d of i._idmap.entries()){let[c,p]=d;ie(p,u)}let a={},l={registry:i,uri:t?.uri,defs:n};u.external=l;for(let d of i._idmap.entries()){let[c,p]=d;Tt(u,p),a[c]=Pt(u,p)}if(Object.keys(n).length>0){let d=u.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[d]:n}}return{schemas:a}}let r=Rt({...t,processors:h0});return ie(e,r),Tt(r,e),Pt(r,e)}s(g0,"ls"),o(g0,"toJSONSchema");var gD=class{static{s(this,"ds")}static{o(this,"JSONSchemaGenerator")}get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),this.ctx=Rt({processors:h0,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return ie(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),Tt(this.ctx,e);let r=Pt(this.ctx,e),{"~standard":i,...u}=r;return u}},vD={},y1={};ut(y1,{ZodAny:s(()=>ml,"ZodAny"),ZodArray:s(()=>bl,"ZodArray"),ZodBase64:s(()=>$n,"ZodBase64"),ZodBase64URL:s(()=>Bn,"ZodBase64URL"),ZodBigInt:s(()=>_r,"ZodBigInt"),ZodBigIntFormat:s(()=>In,"ZodBigIntFormat"),ZodBoolean:s(()=>Ir,"ZodBoolean"),ZodCIDRv4:s(()=>wn,"ZodCIDRv4"),ZodCIDRv6:s(()=>Dn,"ZodCIDRv6"),ZodCUID:s(()=>fn,"ZodCUID"),ZodCUID2:s(()=>hn,"ZodCUID2"),ZodCatch:s(()=>Hl,"ZodCatch"),ZodCodec:s(()=>Tr,"ZodCodec"),ZodCustom:s(()=>Ur,"ZodCustom"),ZodCustomStringFormat:s(()=>hu,"ZodCustomStringFormat"),ZodDate:s(()=>Sn,"ZodDate"),ZodDefault:s(()=>Jl,"ZodDefault"),ZodDiscriminatedUnion:s(()=>kl,"ZodDiscriminatedUnion"),ZodE164:s(()=>xn,"ZodE164"),ZodEmail:s(()=>cn,"ZodEmail"),ZodEmoji:s(()=>pn,"ZodEmoji"),ZodEnum:s(()=>yu,"ZodEnum"),ZodExactOptional:s(()=>Zl,"ZodExactOptional"),ZodFile:s(()=>Pl,"ZodFile"),ZodFunction:s(()=>od,"ZodFunction"),ZodGUID:s(()=>xr,"ZodGUID"),ZodIPv4:s(()=>En,"ZodIPv4"),ZodIPv6:s(()=>bn,"ZodIPv6"),ZodIntersection:s(()=>Il,"ZodIntersection"),ZodJWT:s(()=>Cn,"ZodJWT"),ZodKSUID:s(()=>yn,"ZodKSUID"),ZodLazy:s(()=>nd,"ZodLazy"),ZodLiteral:s(()=>Rl,"ZodLiteral"),ZodMAC:s(()=>q0,"ZodMAC"),ZodMap:s(()=>jl,"ZodMap"),ZodNaN:s(()=>Xl,"ZodNaN"),ZodNanoID:s(()=>mn,"ZodNanoID"),ZodNever:s(()=>gl,"ZodNever"),ZodNonOptional:s(()=>Tn,"ZodNonOptional"),ZodNull:s(()=>pl,"ZodNull"),ZodNullable:s(()=>Ll,"ZodNullable"),ZodNumber:s(()=>kr,"ZodNumber"),ZodNumberFormat:s(()=>Ut,"ZodNumberFormat"),ZodObject:s(()=>Fr,"ZodObject"),ZodOptional:s(()=>Nn,"ZodOptional"),ZodPipe:s(()=>Or,"ZodPipe"),ZodPrefault:s(()=>Wl,"ZodPrefault"),ZodPreprocess:s(()=>td,"ZodPreprocess"),ZodPromise:s(()=>sd,"ZodPromise"),ZodReadonly:s(()=>ud,"ZodReadonly"),ZodRecord:s(()=>vu,"ZodRecord"),ZodSet:s(()=>Nl,"ZodSet"),ZodString:s(()=>Br,"ZodString"),ZodStringFormat:s(()=>ae,"ZodStringFormat"),ZodSuccess:s(()=>Gl,"ZodSuccess"),ZodSymbol:s(()=>ol,"ZodSymbol"),ZodTemplateLiteral:s(()=>rd,"ZodTemplateLiteral"),ZodTransform:s(()=>ql,"ZodTransform"),ZodTuple:s(()=>_l,"ZodTuple"),ZodType:s(()=>Q,"ZodType"),ZodULID:s(()=>gn,"ZodULID"),ZodURL:s(()=>Cr,"ZodURL"),ZodUUID:s(()=>He,"ZodUUID"),ZodUndefined:s(()=>dl,"ZodUndefined"),ZodUnion:s(()=>jr,"ZodUnion"),ZodUnknown:s(()=>hl,"ZodUnknown"),ZodVoid:s(()=>vl,"ZodVoid"),ZodXID:s(()=>vn,"ZodXID"),ZodXor:s(()=>xl,"ZodXor"),_ZodString:s(()=>dn,"_ZodString"),_default:s(()=>On,"_default"),_function:s(()=>Pr,"_function"),any:s(()=>fl,"any"),array:s(()=>gu,"array"),base64:s(()=>W0,"base64"),base64url:s(()=>G0,"base64url"),bigint:s(()=>nl,"bigint"),boolean:s(()=>An,"boolean"),catch:s(()=>Un,"catch"),check:s(()=>ld,"check"),cidrv4:s(()=>V0,"cidrv4"),cidrv6:s(()=>J0,"cidrv6"),codec:s(()=>Ql,"codec"),cuid:s(()=>M0,"cuid"),cuid2:s(()=>O0,"cuid2"),custom:s(()=>dd,"custom"),date:s(()=>El,"date"),describe:s(()=>z1,"describe"),discriminatedUnion:s(()=>Al,"discriminatedUnion"),e164:s(()=>K0,"e164"),email:s(()=>C0,"email"),emoji:s(()=>z0,"emoji"),enum:s(()=>Nr,"enum"),exactOptional:s(()=>Mn,"exactOptional"),file:s(()=>Ul,"file"),float32:s(()=>tl,"float32"),float64:s(()=>ul,"float64"),function:s(()=>Pr,"function"),guid:s(()=>k0,"guid"),hash:s(()=>el,"hash"),hex:s(()=>Q0,"hex"),hostname:s(()=>Y0,"hostname"),httpUrl:s(()=>j0,"httpUrl"),instanceof:s(()=>cd,"instanceof"),int:s(()=>Ar,"int"),int32:s(()=>rl,"int32"),int64:s(()=>sl,"int64"),intersection:s(()=>Fn,"intersection"),invertCodec:s(()=>ed,"invertCodec"),ipv4:s(()=>U0,"ipv4"),ipv6:s(()=>L0,"ipv6"),json:s(()=>pd,"json"),jwt:s(()=>H0,"jwt"),keyof:s(()=>wl,"keyof"),ksuid:s(()=>P0,"ksuid"),lazy:s(()=>Zn,"lazy"),literal:s(()=>Tl,"literal"),looseObject:s(()=>Bl,"looseObject"),looseRecord:s(()=>Fl,"looseRecord"),mac:s(()=>Z0,"mac"),map:s(()=>zl,"map"),meta:s(()=>N1,"meta"),nan:s(()=>Yl,"nan"),nanoid:s(()=>N0,"nanoid"),nativeEnum:s(()=>Ol,"nativeEnum"),never:s(()=>Sr,"never"),nonoptional:s(()=>Pn,"nonoptional"),null:s(()=>_n,"null"),nullable:s(()=>bu,"nullable"),nullish:s(()=>Vl,"nullish"),number:s(()=>kn,"number"),object:s(()=>Dl,"object"),optional:s(()=>Eu,"optional"),partialRecord:s(()=>Sl,"partialRecord"),pipe:s(()=>Rr,"pipe"),prefault:s(()=>Rn,"prefault"),preprocess:s(()=>md,"preprocess"),promise:s(()=>ad,"promise"),readonly:s(()=>qn,"readonly"),record:s(()=>zn,"record"),refine:s(()=>Ln,"refine"),set:s(()=>Ml,"set"),strictObject:s(()=>$l,"strictObject"),string:s(()=>fu,"string"),stringFormat:s(()=>X0,"stringFormat"),stringbool:s(()=>M1,"stringbool"),success:s(()=>Kl,"success"),superRefine:s(()=>Vn,"superRefine"),symbol:s(()=>ll,"symbol"),templateLiteral:s(()=>id,"templateLiteral"),transform:s(()=>Mr,"transform"),tuple:s(()=>jn,"tuple"),uint32:s(()=>il,"uint32"),uint64:s(()=>al,"uint64"),ulid:s(()=>R0,"ulid"),undefined:s(()=>cl,"undefined"),union:s(()=>zr,"union"),unknown:s(()=>gt,"unknown"),url:s(()=>F0,"url"),uuid:s(()=>A0,"uuid"),uuidv4:s(()=>I0,"uuidv4"),uuidv6:s(()=>_0,"uuidv6"),uuidv7:s(()=>S0,"uuidv7"),void:s(()=>yl,"void"),xid:s(()=>T0,"xid"),xor:s(()=>Cl,"xor")});var E1={};ut(E1,{endsWith:s(()=>gr,"endsWith"),gt:s(()=>nt,"gt"),gte:s(()=>Ce,"gte"),includes:s(()=>fr,"includes"),length:s(()=>cu,"length"),lowercase:s(()=>pr,"lowercase"),lt:s(()=>it,"lt"),lte:s(()=>ze,"lte"),maxLength:s(()=>du,"maxLength"),maxSize:s(()=>Ot,"maxSize"),mime:s(()=>vr,"mime"),minLength:s(()=>ht,"minLength"),minSize:s(()=>st,"minSize"),multipleOf:s(()=>Mt,"multipleOf"),negative:s(()=>sn,"negative"),nonnegative:s(()=>on,"nonnegative"),nonpositive:s(()=>an,"nonpositive"),normalize:s(()=>yr,"normalize"),overwrite:s(()=>Ke,"overwrite"),positive:s(()=>nn,"positive"),property:s(()=>ln,"property"),regex:s(()=>cr,"regex"),size:s(()=>lu,"size"),slugify:s(()=>Dr,"slugify"),startsWith:s(()=>hr,"startsWith"),toLowerCase:s(()=>br,"toLowerCase"),toUpperCase:s(()=>wr,"toUpperCase"),trim:s(()=>Er,"trim"),uppercase:s(()=>mr,"uppercase")});var v0={};ut(v0,{ZodISODate:s(()=>b0,"ZodISODate"),ZodISODateTime:s(()=>y0,"ZodISODateTime"),ZodISODuration:s(()=>B0,"ZodISODuration"),ZodISOTime:s(()=>D0,"ZodISOTime"),date:s(()=>w0,"date"),datetime:s(()=>E0,"datetime"),duration:s(()=>x0,"duration"),time:s(()=>$0,"time")});var y0=B("ZodISODateTime",(e,t)=>{mh.init(e,t),ae.init(e,t)});function E0(e){return So(y0,e)}s(E0,"lf"),o(E0,"datetime");var b0=B("ZodISODate",(e,t)=>{fh.init(e,t),ae.init(e,t)});function w0(e){return Fo(b0,e)}s(w0,"df"),o(w0,"date");var D0=B("ZodISOTime",(e,t)=>{hh.init(e,t),ae.init(e,t)});function $0(e){return jo(D0,e)}s($0,"pf"),o($0,"time");var B0=B("ZodISODuration",(e,t)=>{gh.init(e,t),ae.init(e,t)});function x0(e){return zo(B0,e)}s(x0,"ff"),o(x0,"duration");var b1=o((e,t)=>{xa.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o(r=>ji(e,r),"value")},flatten:{value:o(r=>Fi(e,r),"value")},addIssue:{value:o(r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Wu,2)},"value")},addIssues:{value:o(r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Wu,2)},"value")},isEmpty:{get(){return e.issues.length===0}}})},"initializer"),yD=B("ZodError",b1),Ne=B("ZodError",b1,{Parent:Error}),w1=Yu(Ne),D1=Qu(Ne),$1=er(Ne),B1=tr(Ne),x1=Sa(Ne),C1=Fa(Ne),k1=ja(Ne),A1=za(Ne),I1=Na(Ne),_1=Ma(Ne),S1=Oa(Ne),F1=Ra(Ne),j1=new WeakMap;function mu(e,t,r){let i=Object.getPrototypeOf(e),u=j1.get(i);if(u||(u=new Set,j1.set(i,u)),!u.has(t)){u.add(t);for(let n in r){let a=r[n];Object.defineProperty(i,n,{configurable:!0,enumerable:!1,get(){let l=a.bind(this);return Object.defineProperty(this,n,{configurable:!0,writable:!0,enumerable:!0,value:l}),l},set(l){Object.defineProperty(this,n,{configurable:!0,writable:!0,enumerable:!0,value:l})}})}}}s(mu,"eo"),o(mu,"_installLazyMethods");var Q=B("ZodType",(e,t)=>(X.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:$r(e,"input"),output:$r(e,"output")}}),e.toJSONSchema=zv(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,i)=>w1(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>$1(e,r,i),e.parseAsync=async(r,i)=>D1(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>B1(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>x1(e,r,i),e.decode=(r,i)=>C1(e,r,i),e.encodeAsync=async(r,i)=>k1(e,r,i),e.decodeAsync=async(r,i)=>A1(e,r,i),e.safeEncode=(r,i)=>I1(e,r,i),e.safeDecode=(r,i)=>_1(e,r,i),e.safeEncodeAsync=async(r,i)=>S1(e,r,i),e.safeDecodeAsync=async(r,i)=>F1(e,r,i),mu(e,"ZodType",{check(...r){let i=this.def;return this.clone(te.mergeDefs(i,{checks:[...i.checks??[],...r.map(u=>typeof u=="function"?{_zod:{check:u,def:{check:"custom"},onattach:[]}}:u)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,i){return Se(this,r,i)},brand(){return this},register(r,i){return r.add(this,i),this},refine(r,i){return this.check(Ln(r,i))},superRefine(r,i){return this.check(Vn(r,i))},overwrite(r){return this.check(Ke(r))},optional(){return Eu(this)},exactOptional(){return Mn(this)},nullable(){return bu(this)},nullish(){return Eu(bu(this))},nonoptional(r){return Pn(this,r)},array(){return gu(this)},or(r){return zr([this,r])},and(r){return Fn(this,r)},transform(r){return Rr(this,Mr(r))},default(r){return On(this,r)},prefault(r){return Rn(this,r)},catch(r){return Un(this,r)},pipe(r){return Rr(this,r)},readonly(){return qn(this)},describe(r){let i=this.clone();return Re.add(i,{description:r}),i},meta(...r){if(r.length===0)return Re.get(this);let i=this.clone();return Re.add(i,r[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Re.get(e)?.description},configurable:!0}),e)),dn=B("_ZodString",(e,t)=>{rr.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(i,u,n)=>Nv(e,i,u,n);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,mu(e,"_ZodString",{regex(...i){return this.check(cr(...i))},includes(...i){return this.check(fr(...i))},startsWith(...i){return this.check(hr(...i))},endsWith(...i){return this.check(gr(...i))},min(...i){return this.check(ht(...i))},max(...i){return this.check(du(...i))},length(...i){return this.check(cu(...i))},nonempty(...i){return this.check(ht(1,...i))},lowercase(i){return this.check(pr(i))},uppercase(i){return this.check(mr(i))},trim(){return this.check(Er())},normalize(...i){return this.check(yr(...i))},toLowerCase(){return this.check(br())},toUpperCase(){return this.check(wr())},slugify(){return this.check(Dr())}})}),Br=B("ZodString",(e,t)=>{rr.init(e,t),dn.init(e,t),e.email=r=>e.check(Ri(cn,r)),e.url=r=>e.check(dr(Cr,r)),e.jwt=r=>e.check(rn(Cn,r)),e.emoji=r=>e.check(Zi(pn,r)),e.guid=r=>e.check(lr(xr,r)),e.uuid=r=>e.check(Ti(He,r)),e.uuidv4=r=>e.check(Pi(He,r)),e.uuidv6=r=>e.check(Ui(He,r)),e.uuidv7=r=>e.check(qi(He,r)),e.nanoid=r=>e.check(Li(mn,r)),e.guid=r=>e.check(lr(xr,r)),e.cuid=r=>e.check(Vi(fn,r)),e.cuid2=r=>e.check(Ji(hn,r)),e.ulid=r=>e.check(Wi(gn,r)),e.base64=r=>e.check(en($n,r)),e.base64url=r=>e.check(tn(Bn,r)),e.xid=r=>e.check(Gi(vn,r)),e.ksuid=r=>e.check(Ki(yn,r)),e.ipv4=r=>e.check(Hi(En,r)),e.ipv6=r=>e.check(Xi(bn,r)),e.cidrv4=r=>e.check(Yi(wn,r)),e.cidrv6=r=>e.check(Qi(Dn,r)),e.e164=r=>e.check(un(xn,r)),e.datetime=r=>e.check(E0(r)),e.date=r=>e.check(w0(r)),e.time=r=>e.check($0(r)),e.duration=r=>e.check(x0(r))});function fu(e){return Ao(Br,e)}s(fu,"Xn"),o(fu,"string");var ae=B("ZodStringFormat",(e,t)=>{se.init(e,t),dn.init(e,t)}),cn=B("ZodEmail",(e,t)=>{ih.init(e,t),ae.init(e,t)});function C0(e){return Ri(cn,e)}s(C0,"Jw"),o(C0,"email");var xr=B("ZodGUID",(e,t)=>{uh.init(e,t),ae.init(e,t)});function k0(e){return lr(xr,e)}s(k0,"Kw"),o(k0,"guid");var He=B("ZodUUID",(e,t)=>{rh.init(e,t),ae.init(e,t)});function A0(e){return Ti(He,e)}s(A0,"Ww"),o(A0,"uuid");function I0(e){return Pi(He,e)}s(I0,"Xw"),o(I0,"uuidv4");function _0(e){return Ui(He,e)}s(_0,"Hw"),o(_0,"uuidv6");function S0(e){return qi(He,e)}s(S0,"Yw"),o(S0,"uuidv7");var Cr=B("ZodURL",(e,t)=>{nh.init(e,t),ae.init(e,t)});function F0(e){return dr(Cr,e)}s(F0,"Qw"),o(F0,"url");function j0(e){return dr(Cr,{protocol:ft.httpProtocol,hostname:ft.domain,...te.normalizeParams(e)})}s(j0,"ex"),o(j0,"httpUrl");var pn=B("ZodEmoji",(e,t)=>{sh.init(e,t),ae.init(e,t)});function z0(e){return Zi(pn,e)}s(z0,"tx"),o(z0,"emoji");var mn=B("ZodNanoID",(e,t)=>{ah.init(e,t),ae.init(e,t)});function N0(e){return Li(mn,e)}s(N0,"rx"),o(N0,"nanoid");var fn=B("ZodCUID",(e,t)=>{oh.init(e,t),ae.init(e,t)});function M0(e){return Vi(fn,e)}s(M0,"nx"),o(M0,"cuid");var hn=B("ZodCUID2",(e,t)=>{lh.init(e,t),ae.init(e,t)});function O0(e){return Ji(hn,e)}s(O0,"ox"),o(O0,"cuid2");var gn=B("ZodULID",(e,t)=>{dh.init(e,t),ae.init(e,t)});function R0(e){return Wi(gn,e)}s(R0,"ix"),o(R0,"ulid");var vn=B("ZodXID",(e,t)=>{ch.init(e,t),ae.init(e,t)});function T0(e){return Gi(vn,e)}s(T0,"sx"),o(T0,"xid");var yn=B("ZodKSUID",(e,t)=>{ph.init(e,t),ae.init(e,t)});function P0(e){return Ki(yn,e)}s(P0,"ax"),o(P0,"ksuid");var En=B("ZodIPv4",(e,t)=>{vh.init(e,t),ae.init(e,t)});function U0(e){return Hi(En,e)}s(U0,"cx"),o(U0,"ipv4");var q0=B("ZodMAC",(e,t)=>{Eh.init(e,t),ae.init(e,t)});function Z0(e){return _o(q0,e)}s(Z0,"ux"),o(Z0,"mac");var bn=B("ZodIPv6",(e,t)=>{yh.init(e,t),ae.init(e,t)});function L0(e){return Xi(bn,e)}s(L0,"lx"),o(L0,"ipv6");var wn=B("ZodCIDRv4",(e,t)=>{bh.init(e,t),ae.init(e,t)});function V0(e){return Yi(wn,e)}s(V0,"dx"),o(V0,"cidrv4");var Dn=B("ZodCIDRv6",(e,t)=>{wh.init(e,t),ae.init(e,t)});function J0(e){return Qi(Dn,e)}s(J0,"px"),o(J0,"cidrv6");var $n=B("ZodBase64",(e,t)=>{Dh.init(e,t),ae.init(e,t)});function W0(e){return en($n,e)}s(W0,"fx"),o(W0,"base64");var Bn=B("ZodBase64URL",(e,t)=>{$h.init(e,t),ae.init(e,t)});function G0(e){return tn(Bn,e)}s(G0,"mx"),o(G0,"base64url");var xn=B("ZodE164",(e,t)=>{Bh.init(e,t),ae.init(e,t)});function K0(e){return un(xn,e)}s(K0,"hx"),o(K0,"e164");var Cn=B("ZodJWT",(e,t)=>{xh.init(e,t),ae.init(e,t)});function H0(e){return rn(Cn,e)}s(H0,"gx"),o(H0,"jwt");var hu=B("ZodCustomStringFormat",(e,t)=>{Ch.init(e,t),ae.init(e,t)});function X0(e,t,r={}){return pu(hu,e,t,r)}s(X0,"vx"),o(X0,"stringFormat");function Y0(e){return pu(hu,"hostname",ft.hostname,e)}s(Y0,"yx"),o(Y0,"hostname");function Q0(e){return pu(hu,"hex",ft.hex,e)}s(Q0,"bx"),o(Q0,"hex");function el(e,t){let r=t?.enc??"hex",i=`${e}_${r}`,u=ft[i];if(!u)throw new Error(`Unrecognized hash format: ${i}`);return pu(hu,i,u,t)}s(el,"wx"),o(el,"hash");var kr=B("ZodNumber",(e,t)=>{Ha.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(i,u,n)=>Mv(e,i,u,n),mu(e,"ZodNumber",{gt(i,u){return this.check(nt(i,u))},gte(i,u){return this.check(Ce(i,u))},min(i,u){return this.check(Ce(i,u))},lt(i,u){return this.check(it(i,u))},lte(i,u){return this.check(ze(i,u))},max(i,u){return this.check(ze(i,u))},int(i){return this.check(Ar(i))},safe(i){return this.check(Ar(i))},positive(i){return this.check(nt(0,i))},nonnegative(i){return this.check(Ce(0,i))},negative(i){return this.check(it(0,i))},nonpositive(i){return this.check(ze(0,i))},multipleOf(i,u){return this.check(Mt(i,u))},step(i,u){return this.check(Mt(i,u))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function kn(e){return No(kr,e)}s(kn,"Rf"),o(kn,"number");var Ut=B("ZodNumberFormat",(e,t)=>{kh.init(e,t),kr.init(e,t)});function Ar(e){return Oo(Ut,e)}s(Ar,"vs"),o(Ar,"int");function tl(e){return Ro(Ut,e)}s(tl,"xx"),o(tl,"float32");function ul(e){return To(Ut,e)}s(ul,"$x"),o(ul,"float64");function rl(e){return Po(Ut,e)}s(rl,"_x"),o(rl,"int32");function il(e){return Uo(Ut,e)}s(il,"kx"),o(il,"uint32");var Ir=B("ZodBoolean",(e,t)=>{Xa.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Ov(e,r,i,u)});function An(e){return qo(Ir,e)}s(An,"Ef"),o(An,"boolean");var _r=B("ZodBigInt",(e,t)=>{Ya.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(i,u,n)=>Rv(e,i,u,n),e.gte=(i,u)=>e.check(Ce(i,u)),e.min=(i,u)=>e.check(Ce(i,u)),e.gt=(i,u)=>e.check(nt(i,u)),e.gte=(i,u)=>e.check(Ce(i,u)),e.min=(i,u)=>e.check(Ce(i,u)),e.lt=(i,u)=>e.check(it(i,u)),e.lte=(i,u)=>e.check(ze(i,u)),e.max=(i,u)=>e.check(ze(i,u)),e.positive=i=>e.check(nt(BigInt(0),i)),e.negative=i=>e.check(it(BigInt(0),i)),e.nonpositive=i=>e.check(ze(BigInt(0),i)),e.nonnegative=i=>e.check(Ce(BigInt(0),i)),e.multipleOf=(i,u)=>e.check(Mt(i,u));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function nl(e){return Lo(_r,e)}s(nl,"Sx"),o(nl,"bigint");var In=B("ZodBigIntFormat",(e,t)=>{Ah.init(e,t),_r.init(e,t)});function sl(e){return Jo(In,e)}s(sl,"Ix"),o(sl,"int64");function al(e){return Wo(In,e)}s(al,"Rx"),o(al,"uint64");var ol=B("ZodSymbol",(e,t)=>{Ih.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Tv(e,r,i,u)});function ll(e){return Go(ol,e)}s(ll,"Ex"),o(ll,"symbol");var dl=B("ZodUndefined",(e,t)=>{_h.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Uv(e,r,i,u)});function cl(e){return Ko(dl,e)}s(cl,"Tx"),o(cl,"_undefined");var pl=B("ZodNull",(e,t)=>{Sh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Pv(e,r,i,u)});function _n(e){return Ho(pl,e)}s(_n,"zf"),o(_n,"_null");var ml=B("ZodAny",(e,t)=>{Fh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Lv(e,r,i,u)});function fl(){return Xo(ml)}s(fl,"Ax"),o(fl,"any");var hl=B("ZodUnknown",(e,t)=>{jh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Vv(e,r,i,u)});function gt(){return Yo(hl)}s(gt,"ir"),o(gt,"unknown");var gl=B("ZodNever",(e,t)=>{zh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Zv(e,r,i,u)});function Sr(e){return Qo(gl,e)}s(Sr,"Ds"),o(Sr,"never");var vl=B("ZodVoid",(e,t)=>{Nh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>qv(e,r,i,u)});function yl(e){return e0(vl,e)}s(yl,"jx"),o(yl,"_void");var Sn=B("ZodDate",(e,t)=>{Mh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(i,u,n)=>Jv(e,i,u,n),e.min=(i,u)=>e.check(Ce(i,u)),e.max=(i,u)=>e.check(ze(i,u));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function El(e){return t0(Sn,e)}s(El,"zx"),o(El,"date");var bl=B("ZodArray",(e,t)=>{Oh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>i1(e,r,i,u),e.element=t.element,mu(e,"ZodArray",{min(r,i){return this.check(ht(r,i))},nonempty(r){return this.check(ht(1,r))},max(r,i){return this.check(du(r,i))},length(r,i){return this.check(cu(r,i))},unwrap(){return this.element}})});function gu(e,t){return i0(bl,e,t)}s(gu,"no"),o(gu,"array");function wl(e){let t=e._zod.def.shape;return Nr(Object.keys(t))}s(wl,"Ox"),o(wl,"keyof");var Fr=B("ZodObject",(e,t)=>{Th.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>n1(e,r,i,u),te.defineLazy(e,"shape",()=>t.shape),mu(e,"ZodObject",{keyof(){return Nr(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:gt()})},loose(){return this.clone({...this._zod.def,catchall:gt()})},strict(){return this.clone({...this._zod.def,catchall:Sr()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return te.extend(this,r)},safeExtend(r){return te.safeExtend(this,r)},merge(r){return te.merge(this,r)},pick(r){return te.pick(this,r)},omit(r){return te.omit(this,r)},partial(...r){return te.partial(Nn,this,r[0])},required(...r){return te.required(Tn,this,r[0])}})});function Dl(e,t){let r={type:"object",shape:e??{},...te.normalizeParams(t)};return new Fr(r)}s(Dl,"Mx"),o(Dl,"object");function $l(e,t){return new Fr({type:"object",shape:e,catchall:Sr(),...te.normalizeParams(t)})}s($l,"Nx"),o($l,"strictObject");function Bl(e,t){return new Fr({type:"object",shape:e,catchall:gt(),...te.normalizeParams(t)})}s(Bl,"Px"),o(Bl,"looseObject");var jr=B("ZodUnion",(e,t)=>{Ni.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>m0(e,r,i,u),e.options=t.options});function zr(e,t){return new jr({type:"union",options:e,...te.normalizeParams(t)})}s(zr,"Cs"),o(zr,"union");var xl=B("ZodXor",(e,t)=>{jr.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(r,i,u)=>m0(e,r,i,u),e.options=t.options});function Cl(e,t){return new xl({type:"union",options:e,inclusive:!1,...te.normalizeParams(t)})}s(Cl,"Dx"),o(Cl,"xor");var kl=B("ZodDiscriminatedUnion",(e,t)=>{jr.init(e,t),Uh.init(e,t)});function Al(e,t,r){return new kl({type:"union",options:t,discriminator:e,...te.normalizeParams(r)})}s(Al,"Cx"),o(Al,"discriminatedUnion");var Il=B("ZodIntersection",(e,t)=>{qh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>s1(e,r,i,u)});function Fn(e,t){return new Il({type:"intersection",left:e,right:t})}s(Fn,"Ff"),o(Fn,"intersection");var _l=B("ZodTuple",(e,t)=>{no.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>a1(e,r,i,u),e.rest=r=>e.clone({...e._zod.def,rest:r})});function jn(e,t,r){let i=t instanceof X,u=i?r:t,n=i?t:null;return new _l({type:"tuple",items:e,rest:n,...te.normalizeParams(u)})}s(jn,"Zf"),o(jn,"tuple");var vu=B("ZodRecord",(e,t)=>{Zh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>o1(e,r,i,u),e.keyType=t.keyType,e.valueType=t.valueType});function zn(e,t,r){return!t||!t._zod?new vu({type:"record",keyType:fu(),valueType:e,...te.normalizeParams(t)}):new vu({type:"record",keyType:e,valueType:t,...te.normalizeParams(r)})}s(zn,"qf"),o(zn,"record");function Sl(e,t,r){let i=Se(e);return i._zod.values=void 0,new vu({type:"record",keyType:i,valueType:t,...te.normalizeParams(r)})}s(Sl,"Ux"),o(Sl,"partialRecord");function Fl(e,t,r){return new vu({type:"record",keyType:e,valueType:t,mode:"loose",...te.normalizeParams(r)})}s(Fl,"Lx"),o(Fl,"looseRecord");var jl=B("ZodMap",(e,t)=>{Lh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>u1(e,r,i,u),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(st(...r)),e.nonempty=r=>e.check(st(1,r)),e.max=(...r)=>e.check(Ot(...r)),e.size=(...r)=>e.check(lu(...r))});function zl(e,t,r){return new jl({type:"map",keyType:e,valueType:t,...te.normalizeParams(r)})}s(zl,"Fx"),o(zl,"map");var Nl=B("ZodSet",(e,t)=>{Vh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>r1(e,r,i,u),e.min=(...r)=>e.check(st(...r)),e.nonempty=r=>e.check(st(1,r)),e.max=(...r)=>e.check(Ot(...r)),e.size=(...r)=>e.check(lu(...r))});function Ml(e,t){return new Nl({type:"set",valueType:e,...te.normalizeParams(t)})}s(Ml,"Bx"),o(Ml,"set");var yu=B("ZodEnum",(e,t)=>{Jh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(i,u,n)=>Wv(e,i,u,n),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(i,u)=>{let n={};for(let a of i)if(r.has(a))n[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new yu({...t,checks:[],...te.normalizeParams(u),entries:n})},e.exclude=(i,u)=>{let n={...t.entries};for(let a of i)if(r.has(a))delete n[a];else throw new Error(`Key ${a} not found in enum`);return new yu({...t,checks:[],...te.normalizeParams(u),entries:n})}});function Nr(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new yu({type:"enum",entries:r,...te.normalizeParams(t)})}s(Nr,"Us"),o(Nr,"_enum");function Ol(e,t){return new yu({type:"enum",entries:e,...te.normalizeParams(t)})}s(Ol,"Zx"),o(Ol,"nativeEnum");var Rl=B("ZodLiteral",(e,t)=>{Wh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Gv(e,r,i,u),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Tl(e,t){return new Rl({type:"literal",values:Array.isArray(e)?e:[e],...te.normalizeParams(t)})}s(Tl,"qx"),o(Tl,"literal");var Pl=B("ZodFile",(e,t)=>{Gh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Xv(e,r,i,u),e.min=(r,i)=>e.check(st(r,i)),e.max=(r,i)=>e.check(Ot(r,i)),e.mime=(r,i)=>e.check(vr(Array.isArray(r)?r:[r],i))});function Ul(e){return n0(Pl,e)}s(Ul,"Vx"),o(Ul,"file");var ql=B("ZodTransform",(e,t)=>{Kh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>t1(e,r,i,u),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ai(e.constructor.name);r.addIssue=n=>{if(typeof n=="string")r.issues.push(te.issue(n,r.value,t));else{let a=n;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(te.issue(a))}};let u=t.transform(r.value,r);return u instanceof Promise?u.then(n=>(r.value=n,r.fallback=!0,r)):(r.value=u,r.fallback=!0,r)}});function Mr(e){return new ql({type:"transform",transform:e})}s(Mr,"Ls"),o(Mr,"transform");var Nn=B("ZodOptional",(e,t)=>{mo.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>f0(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function Eu(e){return new Nn({type:"optional",innerType:e})}s(Eu,"Yn"),o(Eu,"optional");var Zl=B("ZodExactOptional",(e,t)=>{Hh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>f0(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function Mn(e){return new Zl({type:"optional",innerType:e})}s(Mn,"Hf"),o(Mn,"exactOptional");var Ll=B("ZodNullable",(e,t)=>{Xh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>l1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function bu(e){return new Ll({type:"nullable",innerType:e})}s(bu,"Qn"),o(bu,"nullable");function Vl(e){return Eu(bu(e))}s(Vl,"Gx"),o(Vl,"nullish");var Jl=B("ZodDefault",(e,t)=>{Yh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>c1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function On(e,t){return new Jl({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():te.shallowClone(t)}})}s(On,"em"),o(On,"_default");var Wl=B("ZodPrefault",(e,t)=>{Qh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>p1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function Rn(e,t){return new Wl({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():te.shallowClone(t)}})}s(Rn,"rm"),o(Rn,"prefault");var Tn=B("ZodNonOptional",(e,t)=>{eg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>d1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function Pn(e,t){return new Tn({type:"nonoptional",innerType:e,...te.normalizeParams(t)})}s(Pn,"nm"),o(Pn,"nonoptional");var Gl=B("ZodSuccess",(e,t)=>{tg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Yv(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function Kl(e){return new Gl({type:"success",innerType:e})}s(Kl,"Jx"),o(Kl,"success");var Hl=B("ZodCatch",(e,t)=>{ug.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>m1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Un(e,t){return new Hl({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}s(Un,"sm"),o(Un,"_catch");var Xl=B("ZodNaN",(e,t)=>{rg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Kv(e,r,i,u)});function Yl(e){return r0(Xl,e)}s(Yl,"Kx"),o(Yl,"nan");var Or=B("ZodPipe",(e,t)=>{go.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>f1(e,r,i,u),e.in=t.in,e.out=t.out});function Rr(e,t){return new Or({type:"pipe",in:e,out:t})}s(Rr,"ys"),o(Rr,"pipe");var Tr=B("ZodCodec",(e,t)=>{Or.init(e,t),vo.init(e,t)});function Ql(e,t,r){return new Tr({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}s(Ql,"Wx"),o(Ql,"codec");function ed(e){let t=e._zod.def;return new Tr({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}s(ed,"Xx"),o(ed,"invertCodec");var td=B("ZodPreprocess",(e,t)=>{Or.init(e,t),ig.init(e,t)}),ud=B("ZodReadonly",(e,t)=>{ng.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>h1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function qn(e){return new ud({type:"readonly",innerType:e})}s(qn,"lm"),o(qn,"readonly");var rd=B("ZodTemplateLiteral",(e,t)=>{sg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Hv(e,r,i,u)});function id(e,t){return new rd({type:"template_literal",parts:e,...te.normalizeParams(t)})}s(id,"Hx"),o(id,"templateLiteral");var nd=B("ZodLazy",(e,t)=>{lg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>v1(e,r,i,u),e.unwrap=()=>e._zod.def.getter()});function Zn(e){return new nd({type:"lazy",getter:e})}s(Zn,"fm"),o(Zn,"lazy");var sd=B("ZodPromise",(e,t)=>{og.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>g1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function ad(e){return new sd({type:"promise",innerType:e})}s(ad,"Yx"),o(ad,"promise");var od=B("ZodFunction",(e,t)=>{ag.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>e1(e,r,i,u)});function Pr(e){return new od({type:"function",input:Array.isArray(e?.input)?jn(e?.input):e?.input??gu(gt()),output:e?.output??gt()})}s(Pr,"Qx"),o(Pr,"_function");var Ur=B("ZodCustom",(e,t)=>{dg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Qv(e,r,i,u)});function ld(e){let t=new de({check:"custom"});return t._zod.check=e,t}s(ld,"e$"),o(ld,"check");function dd(e,t){return s0(Ur,e??(()=>!0),t)}s(dd,"t$"),o(dd,"custom");function Ln(e,t={}){return a0(Ur,e,t)}s(Ln,"gm"),o(Ln,"refine");function Vn(e,t){return o0(e,t)}s(Vn,"vm"),o(Vn,"superRefine");var z1=d0,N1=c0;function cd(e,t={}){let r=new Ur({type:"custom",check:"custom",fn:o(i=>i instanceof e,"fn"),abort:!0,...te.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=i=>{i.value instanceof e||i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}s(cd,"o$"),o(cd,"_instanceof");var M1=o((...e)=>p0({Codec:Tr,Boolean:Ir,String:Br},...e),"stringbool");function pd(e){let t=Zn(()=>zr([fu(e),kn(),An(),_n(),gu(t),zn(fu(),t)]));return t}s(pd,"s$"),o(pd,"json");function md(e,t){return new td({type:"pipe",in:Mr(e),out:t})}s(md,"a$"),o(md,"preprocess");var ED={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function O1(e){be({customError:e})}s(O1,"ZR"),o(O1,"setErrorMap");function R1(){return be().customError}s(R1,"qR"),o(R1,"getErrorMap");var fd;fd||(fd={});var q={...y1,...E1,iso:v0},bD=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function T1(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}s(T1,"GR"),o(T1,"detectVersion");function P1(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let i=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let u=r[1];if(!u||!t.defs[u])throw new Error(`Reference not found: ${e}`);return t.defs[u]}throw new Error(`Reference not found: ${e}`)}s(P1,"JR"),o(P1,"resolveRef");function hd(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return q.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let u=e.$ref;if(t.refs.has(u))return t.refs.get(u);if(t.processing.has(u))return q.lazy(()=>{if(!t.refs.has(u))throw new Error(`Circular reference not resolved: ${u}`);return t.refs.get(u)});t.processing.add(u);let n=P1(u,t),a=$e(n,t);return t.refs.set(u,a),t.processing.delete(u),a}if(e.enum!==void 0){let u=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&u.length===1&&u[0]===null)return q.null();if(u.length===0)return q.never();if(u.length===1)return q.literal(u[0]);if(u.every(a=>typeof a=="string"))return q.enum(u);let n=u.map(a=>q.literal(a));return n.length<2?n[0]:q.union([n[0],n[1],...n.slice(2)])}if(e.const!==void 0)return q.literal(e.const);let r=e.type;if(Array.isArray(r)){let u=r.map(n=>{let a={...e,type:n};return hd(a,t)});return u.length===0?q.never():u.length===1?u[0]:q.union(u)}if(!r)return q.any();let i;switch(r){case"string":{let u=q.string();if(e.format){let n=e.format;n==="email"?u=u.check(q.email()):n==="uri"||n==="uri-reference"?u=u.check(q.url()):n==="uuid"||n==="guid"?u=u.check(q.uuid()):n==="date-time"?u=u.check(q.iso.datetime()):n==="date"?u=u.check(q.iso.date()):n==="time"?u=u.check(q.iso.time()):n==="duration"?u=u.check(q.iso.duration()):n==="ipv4"?u=u.check(q.ipv4()):n==="ipv6"?u=u.check(q.ipv6()):n==="mac"?u=u.check(q.mac()):n==="cidr"?u=u.check(q.cidrv4()):n==="cidr-v6"?u=u.check(q.cidrv6()):n==="base64"?u=u.check(q.base64()):n==="base64url"?u=u.check(q.base64url()):n==="e164"?u=u.check(q.e164()):n==="jwt"?u=u.check(q.jwt()):n==="emoji"?u=u.check(q.emoji()):n==="nanoid"?u=u.check(q.nanoid()):n==="cuid"?u=u.check(q.cuid()):n==="cuid2"?u=u.check(q.cuid2()):n==="ulid"?u=u.check(q.ulid()):n==="xid"?u=u.check(q.xid()):n==="ksuid"&&(u=u.check(q.ksuid()))}typeof e.minLength=="number"&&(u=u.min(e.minLength)),typeof e.maxLength=="number"&&(u=u.max(e.maxLength)),e.pattern&&(u=u.regex(new RegExp(e.pattern))),i=u;break}case"number":case"integer":{let u=r==="integer"?q.number().int():q.number();typeof e.minimum=="number"&&(u=u.min(e.minimum)),typeof e.maximum=="number"&&(u=u.max(e.maximum)),typeof e.exclusiveMinimum=="number"?u=u.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(u=u.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?u=u.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(u=u.lt(e.maximum)),typeof e.multipleOf=="number"&&(u=u.multipleOf(e.multipleOf)),i=u;break}case"boolean":{i=q.boolean();break}case"null":{i=q.null();break}case"object":{let u={},n=e.properties||{},a=new Set(e.required||[]);for(let[d,c]of Object.entries(n)){let p=$e(c,t);u[d]=a.has(d)?p:p.optional()}if(e.propertyNames){let d=$e(e.propertyNames,t),c=e.additionalProperties&&typeof e.additionalProperties=="object"?$e(e.additionalProperties,t):q.any();if(Object.keys(u).length===0){i=q.record(d,c);break}let p=q.object(u).passthrough(),m=q.looseRecord(d,c);i=q.intersection(p,m);break}if(e.patternProperties){let d=e.patternProperties,c=Object.keys(d),p=[];for(let f of c){let h=$e(d[f],t),g=q.string().regex(new RegExp(f));p.push(q.looseRecord(g,h))}let m=[];if(Object.keys(u).length>0&&m.push(q.object(u).passthrough()),m.push(...p),m.length===0)i=q.object({}).passthrough();else if(m.length===1)i=m[0];else{let f=q.intersection(m[0],m[1]);for(let h=2;h<m.length;h++)f=q.intersection(f,m[h]);i=f}break}let l=q.object(u);e.additionalProperties===!1?i=l.strict():typeof e.additionalProperties=="object"?i=l.catchall($e(e.additionalProperties,t)):i=l.passthrough();break}case"array":{let u=e.prefixItems,n=e.items;if(u&&Array.isArray(u)){let a=u.map(d=>$e(d,t)),l=n&&typeof n=="object"&&!Array.isArray(n)?$e(n,t):void 0;l?i=q.tuple(a).rest(l):i=q.tuple(a),typeof e.minItems=="number"&&(i=i.check(q.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(q.maxLength(e.maxItems)))}else if(Array.isArray(n)){let a=n.map(d=>$e(d,t)),l=e.additionalItems&&typeof e.additionalItems=="object"?$e(e.additionalItems,t):void 0;l?i=q.tuple(a).rest(l):i=q.tuple(a),typeof e.minItems=="number"&&(i=i.check(q.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(q.maxLength(e.maxItems)))}else if(n!==void 0){let a=$e(n,t),l=q.array(a);typeof e.minItems=="number"&&(l=l.min(e.minItems)),typeof e.maxItems=="number"&&(l=l.max(e.maxItems)),i=l}else i=q.array(q.any());break}default:throw new Error(`Unsupported type: ${r}`)}return i}s(hd,"c$"),o(hd,"convertBaseSchema");function $e(e,t){if(typeof e=="boolean")return e?q.any():q.never();let r=hd(e,t),i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let l=e.anyOf.map(c=>$e(c,t)),d=q.union(l);r=i?q.intersection(r,d):d}if(e.oneOf&&Array.isArray(e.oneOf)){let l=e.oneOf.map(c=>$e(c,t)),d=q.xor(l);r=i?q.intersection(r,d):d}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=i?r:q.any();else{let l=i?r:$e(e.allOf[0],t),d=i?0:1;for(let c=d;c<e.allOf.length;c++)l=q.intersection(l,$e(e.allOf[c],t));r=l}e.nullable===!0&&t.version==="openapi-3.0"&&(r=q.nullable(r)),e.readOnly===!0&&(r=q.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let u={},n=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let l of n)l in e&&(u[l]=e[l]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let l of a)l in e&&(u[l]=e[l]);for(let l of Object.keys(e))bD.has(l)||(u[l]=e[l]);return Object.keys(u).length>0&&t.registry.add(r,u),e.description&&(r=r.describe(e.description)),r}s($e,"Re"),o($e,"convertSchema");function U1(e,t){if(typeof e=="boolean")return e?q.any():q.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=T1(r,t?.defaultTarget),u=r.$defs||r.definitions||{},n={version:i,defs:u,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??Re};return $e(r,n)}s(U1,"u$"),o(U1,"fromJSONSchema");var q1={};ut(q1,{bigint:s(()=>J1,"bigint"),boolean:s(()=>V1,"boolean"),date:s(()=>W1,"date"),number:s(()=>L1,"number"),string:s(()=>Z1,"string")});function Z1(e){return Io(Br,e)}s(Z1,"KR"),o(Z1,"string");function L1(e){return Mo(kr,e)}s(L1,"WR"),o(L1,"number");function V1(e){return Zo(Ir,e)}s(V1,"XR"),o(V1,"boolean");function J1(e){return Vo(_r,e)}s(J1,"HR"),o(J1,"bigint");function W1(e){return u0(Sn,e)}s(W1,"YR"),o(W1,"date"),be(Do());var gd=v.object({file:v.string(),line:v.number().int().nonnegative().optional(),column:v.number().int().nonnegative().optional(),symbol:v.string().optional(),componentName:v.string().optional(),hookName:v.string().optional()}),wD=v.enum(["user-click","user-input","keyboard","route-load","effect","memo-recompute","timer","raf","idle-callback","websocket-message","broadcast-channel","post-message","storage-event","service-worker-message","media-query-change","visibility-change","resize","intersection-observer","mutation-observer","backend-response","hmr-update","ai-turn","page-load","form-submit","input-change"]),G1=v.object({sessionId:v.string(),browserContextId:v.string().optional(),tabId:v.string().optional(),frameId:v.string().optional(),route:v.string().optional(),url:v.string().optional(),flowId:v.string().optional(),originType:wD.optional(),originNodeId:v.string().optional(),causedByNodeId:v.string().optional(),requestId:v.string().optional(),parentRequestId:v.string().optional(),traceparent:v.string().optional(),projectName:v.string().optional(),userActionId:v.string().optional(),userIdHash:v.string().optional(),tenantIdHash:v.string().optional()}),DD=v.enum(["nx","vite","typescript","eslint","rollup","client-runtime","chrome","react","valtio","nestjs","nextjs","db","redis","queue","memory","visual","perf","security","gateway","external","ai","lens"]),$D=v.enum(["build","lint","typecheck","test","runtime","render","visual","trace","state","network","backend","db","memory","performance","security","deps","cluster","ai"]),vd=v.enum(["debug","info","warning","error","fatal"]),l_=v.object({id:v.string(),sessionId:v.string(),timestamp:v.number().int().nonnegative(),source:DD,category:$D,severity:vd,context:G1,fingerprint:v.string(),title:v.string(),message:v.string().optional(),location:gd.optional(),relatedFiles:v.array(v.string()).optional(),relatedUrls:v.array(v.string()).optional(),raw:v.unknown().optional()}),BD=v.enum(["session","browser-context","tab","renderer","router","route","page","component","element","slot","render","react-mount","react-unmount","hook","effect","effect-run","memo","memo-compute","ui-event","handler","animation","animation-frame","transition","timer","api-client-call","http-request","http-response","server-process","nest-app","nest-module","nest-provider","singleton-instance","server-request","guard","controller","service-method","loop","loop-iteration","queue-job","db-query","redis-op","promise","promise-continuation","state-store","state-update","selector","selector-update","visual-frame","visual-violation","style-change","layout-change","memory-owner","memory-mutation","memory-retention","heap-snapshot","build-event","lint-event","typecheck-event","test-event","bundle-report","hmr-update"]),xD=v.enum(["created","active","completed","disposed","errored"]),d_=v.object({id:v.string(),parentTraceNodeId:v.string().optional(),type:BD,logicalId:v.string().optional(),instanceId:v.string().optional(),generation:v.number().int().nonnegative().optional(),lifecycle:xD,context:G1,name:v.string(),startTime:v.number().int().nonnegative(),endTime:v.number().int().nonnegative().optional(),durationMs:v.number().nonnegative().optional(),location:gd.optional(),attributes:v.record(v.string(),v.unknown())}),CD=v.enum(["ownership","caused","async","data","render","state","network","backend","db","visual","performance","memory","lifecycle"]),c_=v.object({id:v.string(),from:v.string(),to:v.string(),axis:CD,type:v.string(),timestamp:v.number().int().nonnegative(),attributes:v.record(v.string(),v.unknown()).optional()}),kD=v.enum(["mount","update"]),AD=v.discriminatedUnion("type",[v.object({type:v.literal("props"),changedKeys:v.array(v.string())}),v.object({type:v.literal("react-state"),hookIndex:v.number().int()}),v.object({type:v.literal("context"),contextName:v.string()}),v.object({type:v.literal("valtio-path"),path:v.string(),changedKeys:v.array(v.string())}),v.object({type:v.literal("parent-render"),parentRenderId:v.string()}),v.object({type:v.literal("hook-dep-changed"),hookInstanceId:v.string(),depsHashBefore:v.string(),depsHashAfter:v.string()}),v.object({type:v.literal("force"),reason:v.string()})]),p_=v.object({phase:kD,actualDurationMs:v.number().nonnegative(),baseDurationMs:v.number().nonnegative(),startTime:v.number().nonnegative(),commitTime:v.number().nonnegative(),why:v.array(AD)}),m_=v.object({hookInstanceId:v.string(),depsHash:v.string(),prevDepsHash:v.string().optional(),durationMs:v.number().nonnegative(),cleanupRan:v.boolean().optional()}),f_=v.object({storeId:v.string(),path:v.string(),changedKeys:v.array(v.string()),beforeHash:v.string(),afterHash:v.string(),preview:v.unknown().optional()}),h_=v.object({method:v.string(),route:v.string(),status:v.number().int().optional(),durationMs:v.number().nonnegative().optional(),traceparent:v.string().optional()}),ID=v.enum(["N+1","sequential-await","growing-allocation"]),g_=v.object({iterations:v.number().int().nonnegative(),durationMs:v.number().nonnegative(),dbCallsInsideLoop:v.number().int().nonnegative(),redisCallsInsideLoop:v.number().int().nonnegative(),awaitedOperationsInsideLoop:v.number().int().nonnegative(),slowestIterations:v.array(v.object({index:v.number().int().nonnegative(),durationMs:v.number().nonnegative(),childNodeIds:v.array(v.string())})).optional(),patterns:v.array(ID).optional()}),_D=v.enum(["Map","Set","Array","EventEmitter","Queue","RxSubject","Timer","Interval","Custom"]),v_=v.object({ownerInstanceId:v.string(),containerKind:_D,fieldName:v.string(),itemCount:v.number().int().nonnegative(),estimatedBytes:v.number().nonnegative(),retainedBytes:v.number().nonnegative().optional(),growthSinceStart:v.number()}),SD=v.enum(["set","push","add","delete","clear","subscribe","listen","schedule"]),y_=v.object({ownerNodeId:v.string(),operation:SD,beforeCount:v.number().int().nonnegative(),afterCount:v.number().int().nonnegative(),estimatedDeltaBytes:v.number(),keyPreview:v.string().optional(),valueType:v.string().optional()}),K1=v.object({x:v.number(),y:v.number(),width:v.number().nonnegative(),height:v.number().nonnegative()}),FD=v.enum(["page-load","route-change","user-action","react-commit","state-update","api-response","hmr-update","animation-tick"]),jD=v.enum(["computed-style","layout","paint-order"]),E_=v.object({causedBy:FD,viewport:K1,layoutSnapshotId:v.string(),styleSnapshotId:v.string(),screenshotId:v.string().optional(),changedNodes:v.array(v.object({uid:v.string(),component:v.string().optional(),change:jD,property:v.string().optional(),before:v.unknown().optional(),after:v.unknown().optional()}))}),zD=v.enum(["grid-spacing","alignment","overflow","text-clipping","color-contrast","token-usage","z-index","responsive","custom"]),ND=v.enum(["always","after-animation","stable-only","during-animation"]),MD=v.enum(["info","warning","error"]),b_=v.object({ruleId:v.string(),ruleType:zD,severity:MD,timing:ND,element:v.object({uid:v.string(),component:v.string().optional(),rect:K1}),expected:v.record(v.string(),v.unknown()),actual:v.record(v.string(),v.unknown()),evidence:v.object({computedStyle:v.string().optional(),screenshotCrop:v.string().optional(),trace:v.string().optional(),cssCause:v.object({selector:v.string(),file:v.string().optional(),line:v.number().int().optional(),declaration:v.string().optional()}).optional()})}),OD=v.enum(["none","connected"]),RD=v.enum(["running","clean","failing","error"]),TD=v.object({id:v.string(),tool:v.string(),project:v.string().optional(),firstReportedAt:v.number().int().nonnegative(),lastReportedAt:v.number().int().nonnegative(),lastRunStatus:RD,lastRunDurationMs:v.number().int().nonnegative().optional(),errorCount:v.number().int().nonnegative(),warningCount:v.number().int().nonnegative().optional(),error:v.string().optional()}),Jn=v.object({producer:OD,producers:v.array(TD),lastReportedAt:v.number().int().nonnegative().optional(),ageMs:v.number().int().nonnegative().optional(),stale:v.boolean(),detail:v.string()}),H1=10*6e4;function Wn(e){let t=e.now??Date.now(),r=[...e.producers].sort((c,p)=>p.lastReportedAt-c.lastReportedAt);if(r.length===0)return{producer:"none",producers:[],stale:!1,detail:`No ${e.domain} producer has ever reported into this session \u2014 this is NOT a clean result, nothing is watching. ${e.noProducerHint}`};let i=r[0].lastReportedAt,u=Math.max(0,t-i),n=u>H1,a=r.filter(c=>c.lastRunStatus==="failing"),l=r.filter(c=>c.lastRunStatus==="error"),d=[`${r.length} ${e.domain} producer${r.length===1?"":"s"} reporting (${r.map(c=>c.id).join(", ")}); newest report ${X1(u)}.`];return l.length>0&&d.push(`${l.length} produced NO verdict (the tool itself failed): ${l.map(c=>`${c.id} \u2014 ${c.error??"unknown error"}`).join("; ")}.`),a.length>0&&d.push(`${a.length} reporting errors.`),n&&d.push(`Older than ${Math.round(H1/6e4)}m \u2014 the verdict may predate the current source.`),{producer:"connected",producers:r,lastReportedAt:i,ageMs:u,stale:n,detail:d.join(" ")}}s(Wn,"en"),o(Wn,"summariseProducers");function X1(e){return e<1e3?"just now":e<6e4?`${Math.round(e/1e3)}s ago`:e<36e5?`${Math.round(e/6e4)}m ago`:`${Math.round(e/36e5)}h ago`}s(X1,"yE"),o(X1,"describeAge");var wu=v.object({$schema:v.string().optional(),schemaVersion:v.literal(1),revision:v.number().int().nonnegative(),updatedAt:v.string().datetime().optional()}),PD=v.enum(["starting","clean","warning","failing"]),Y1=v.object({source:v.string(),severity:vd,title:v.string(),fingerprint:v.string(),resource:v.string(),pageId:v.string().optional(),flowId:v.string().optional(),location:gd.optional(),rule:v.string().optional(),fix:v.string().optional(),verify:v.string().optional(),docs:v.string().optional()}),UD=v.object({typecheck:v.enum(["passed","failed","unknown"]).optional(),lint:v.enum(["passed","failed","unknown"]).optional(),build:v.enum(["passed","failed","unknown"]).optional(),runtime:v.enum(["passed","failed","warning","unknown"]).optional(),visual:v.enum(["passed","failed","warning","unknown"]).optional(),memory:v.enum(["passed","failed","warning","unknown"]).optional()}),qD=v.enum(["embedded","shared"]),ZD=v.object({mode:qD,pid:v.number(),startedAt:v.string(),url:v.string().optional()}),w_=wu.extend({sessionId:v.string(),status:PD,activeTab:v.string().optional(),tabsWithIssues:v.array(v.string()).optional(),blocking:v.array(Y1),warnings:v.array(Y1).default([]),suggestedReads:v.array(v.string()),checks:UD.optional(),server:ZD.optional()}),LD=v.object({eventsResident:v.number().int().nonnegative(),eventsResidentBytes:v.number().int().nonnegative(),eventsIngested:v.number().int().nonnegative(),eventsDropped:v.number().int().nonnegative(),eventsDroppedForBytes:v.number().int().nonnegative().optional(),eventCap:v.number().int().nonnegative().optional(),eventByteCap:v.number().int().nonnegative().optional(),artifactsResident:v.number().int().nonnegative().optional(),artifactsResidentBytes:v.number().int().nonnegative().optional(),artifactsDropped:v.number().int().nonnegative().optional(),artifactByteCap:v.number().int().nonnegative().optional(),truncatedEvents:v.number().int().nonnegative().optional(),truncatedBytesReclaimed:v.number().int().nonnegative().optional(),rawByteLimit:v.number().int().nonnegative().optional(),reducers:v.record(v.string(),v.object({residentEvents:v.number().int().nonnegative(),residentBytes:v.number().int().nonnegative(),evictedEvents:v.number().int().nonnegative(),evictedForBytes:v.number().int().nonnegative(),eventCap:v.number().int().nonnegative(),byteCap:v.number().int().nonnegative()})).optional()}),D_=wu.extend({sessionId:v.string(),supportedResources:v.array(v.string()),supportedTools:v.array(v.string()),supportedJobs:v.array(v.string()),supportedChannels:v.array(v.string()),subscribedByDefault:v.array(v.string()),transports:v.array(v.enum(["stdio","http","socket"])),host:v.object({platform:v.string(),node:v.string()}),project:v.object({name:v.string(),nxVersion:v.string().optional()}),storage:LD.optional()}),VD=v.object({id:v.string(),timestamp:v.number().int().nonnegative(),message:v.string(),fingerprint:v.string(),code:v.string().optional(),rule:v.string().optional(),severity:vd.optional(),file:v.string().optional(),line:v.number().int().nonnegative().optional(),column:v.number().int().nonnegative().optional(),project:v.string().optional()}),$_=wu.merge(Jn).extend({status:v.enum(["unknown","clean","failing"]),errorCount:v.number().int().nonnegative(),lastRunAt:v.number().int().nonnegative().optional()}),B_=wu.merge(Jn).extend({errors:v.array(VD)}),x_=wu.merge(Jn).extend({status:v.enum(["unknown","clean","warning","failing"]),errorCount:v.number().int().nonnegative(),warningCount:v.number().int().nonnegative(),lastRunAt:v.number().int().nonnegative().optional()}),C_=wu.merge(Jn).extend({status:v.enum(["unknown","clean","warning","failing"]),hmrUpdates:v.number().int().nonnegative(),lastRunAt:v.number().int().nonnegative().optional()}),qr=Symbol.for("@lensmcp/session/Session"),Zr=Symbol.for("@lensmcp/core/EventBus"),JD=Symbol.for("@lensmcp/core/GraphStore"),Z=Symbol.for("@lensmcp/core/ResourceStore"),WD=Symbol.for("@lensmcp/storage/Storage"),GD="capture-request.json",KD="capture-runner.json",HD="capture-rules.json",yd="__lensmcpTruncation",XD="__lensmcpTruncated";function Xe(e,t=Number.POSITIVE_INFINITY,r=12){return qt(e,t,r,32)}s(Xe,"Ke"),o(Xe,"estimateJsonBytes");function Ed(e,t,r=12){return qt(e,t,r,Number.POSITIVE_INFINITY)>t}s(Ed,"Vs"),o(Ed,"exceedsJsonByteBudget");function qt(e,t,r,i){switch(typeof e){case"undefined":case"function":case"symbol":return 0;case"boolean":return 5;case"number":return Number.isFinite(e)?8:4;case"bigint":return 20;case"string":return e.length+2;default:break}if(e===null)return 4;if(r<=0)return i;if(e instanceof Date)return 26;if(Array.isArray(e)){let a=2;for(let l=0;l<e.length;l++)if(a+=qt(e[l],t-a,r-1,i)+1,a>t)return a;return a}let u=2,n=e;for(let a in n){if(!Object.prototype.hasOwnProperty.call(n,a))continue;let l=qt(n[a],t-u,r-1,i);if(l!==0&&(u+=a.length+4+l,u>t))return u}return u}s(qt,"rn"),o(qt,"walk");function Gn(e,t){e.truncatedAnything=!0,e.paths.length<20&&e.paths.push(t||"<root>")}s(Gn,"wm"),o(Gn,"record");function Q1(e,t,r){return Gn(e,r),{[XD]:!0,originalBytes:Xe(t,Number.POSITIVE_INFINITY,64)}}s(Q1,"SE"),o(Q1,"stub");function e3(e){if(e===null)return!0;let t=typeof e;return t==="number"||t==="boolean"||t==="string"||t==="bigint"}s(e3,"IE"),o(e3,"isScalar");function Du(e,t,r,i){if(typeof e=="string"){let u=t.budget<=0?256:t.maxStringBytes;if(e.length+2<=u)return t.budget-=e.length+2,e;let n=Math.max(0,u-64);return Gn(t,i),t.budget-=n,`${e.slice(0,n)}\u2026[lensmcp truncated: ${e.length-n} more chars]`}return e===null||typeof e!="object"?(t.budget-=qt(e,Number.POSITIVE_INFINITY,1,32),e):r<=0?Q1(t,e,i):e instanceof Date?(t.budget-=26,e):Array.isArray(e)?t3(e,t,r,i):u3(e,t,r,i)}s(Du,"nn"),o(Du,"clampValue");function t3(e,t,r,i){let u=[],n=Math.min(e.length,t.maxArrayItems);for(let a=0;a<n&&!(t.budget<=0);a++)u.push(Du(e[a],t,r-1,`${i}[${a}]`));return u.length<e.length&&Gn(t,`${i}[] (+${e.length-u.length} items dropped)`),u}s(t3,"RE"),o(t3,"clampArray");function u3(e,t,r,i){let u={},n,a=t.budget<=0;for(let l in e){if(!Object.prototype.hasOwnProperty.call(e,l))continue;let d=e[l],c=qt(d,512,r-1,Number.POSITIVE_INFINITY);if(c<=512&&(!a||e3(d))){u[l]=d,t.budget-=l.length+4+c;continue}(n??=[]).push({key:l,bytes:c})}if(!n)return u;n.sort((l,d)=>l.bytes===d.bytes?0:l.bytes<d.bytes?-1:1);for(let{key:l}of n){let d=i?`${i}.${l}`:l;u[l]=Du(e[l],t,r-1,d)}return u}s(u3,"EE"),o(u3,"clampObject");function r3(e,t={}){let r=t.rawByteLimit??32768,i=t.maxDepth??12;if(r<=0)return{value:void 0,truncated:!1,originalBytes:0,keptBytes:0,paths:[]};if(e==null)return{value:e,truncated:!1,originalBytes:0,keptBytes:0,paths:[]};if(!Ed(e,r,i)){let d=Xe(e,r,i),c={budget:r,maxStringBytes:t.maxStringBytes??4096,maxArrayItems:t.maxArrayItems??64,paths:[],truncatedAnything:!1};return{value:Du(e,c,i,""),truncated:!1,originalBytes:d,keptBytes:d,paths:[]}}let u=Xe(e,Number.POSITIVE_INFINITY,64),n={budget:r,maxStringBytes:t.maxStringBytes??4096,maxArrayItems:t.maxArrayItems??64,paths:[],truncatedAnything:!1},a=Du(e,n,i,""),l=Xe(a,Number.POSITIVE_INFINITY,i);if(n.truncatedAnything&&a!==null&&typeof a=="object"&&!Array.isArray(a)){let d={truncated:!0,originalBytes:u,keptBytes:l,paths:n.paths};a[yd]=d}return{value:a,truncated:n.truncatedAnything,originalBytes:u,keptBytes:l,paths:n.paths}}s(r3,"xm"),o(r3,"boundedClone");function Zt(e,t){if(e.size<=t)return 0;let r=0,i=e.keys();for(;e.size>t;){let u=i.next();if(u.done)break;e.delete(u.value)&&(r+=1)}return r}s(Zt,"tt"),o(Zt,"capMap");var Lr=256,$u="error-dismissed",Kn="error-restored",i3="lens",YD=new Set(["dashboard","cli","agent"]);function bd(e){if(e.source!==i3||!e.raw||typeof e.raw!="object")return;let t=e.raw,r=t.groupId;if(typeof r!="string"||r.length===0||r.length>2048)return;if(t.kind===Kn)return{kind:Kn,groupId:r};if(t.kind!==$u)return;let i=t.until;if(typeof i!="number"||!Number.isFinite(i))return;let u=Array.isArray(t.eventIds)?t.eventIds.filter(c=>typeof c=="string"&&c.length>0).slice(0,200):[],n=YD.has(t.by)?t.by:void 0,a=o((c,p)=>typeof c=="string"&&c.trim()?c.trim().slice(0,p):void 0,"text"),l=a(t.reason,500),d=a(t.title,300);return{kind:$u,groupId:r,until:Math.min(i,e.timestamp),eventIds:u,...n?{by:n}:{},...l?{reason:l}:{},...d?{title:d}:{}}}s(bd,"Gs"),o(bd,"readErrorDismissal");var QD=["pod-memory","pod-memory-retained","pod-memory-released","pod-memory-exited"];function Hn(e){if(!e||typeof e!="object")return;let t=e;if(QD.includes(t.kind)&&!(typeof t.project!="string"||!t.project)&&!(typeof t.pod!="number"||typeof t.pid!="number")&&!(t.kind==="pod-memory"&&(typeof t.live!="number"||!Number.isFinite(t.live)))&&!((t.kind==="pod-memory-retained"||t.kind==="pod-memory-released")&&typeof t.gen!="number"))return e}s(Hn,"sn"),o(Hn,"asPodMemoryRaw");var e$=["perf-rule-finding","perf-rule-retracted","perf-rule-scan"],wd="https://github.com/kiwiapps-ltd/lensmcp/blob/main/docs/lensmcp/concepts/memory-and-build-cost.mdx",n3={"bundle/heavy-barrel-import":`${wd}#bundleheavy-barrel-import`,"pod/heap-budget":`${wd}#podheap-budget`,"pod/retained-generation":`${wd}#podretained-generation`};function s3(e,t,r){return`perf-rule:${e}:${t}:${r}`}s(s3,"b$"),o(s3,"perfRuleFingerprint");var t$=/^[a-z][a-z0-9-]*\/[a-z0-9][a-z0-9-]*$/,u$=12,r$=4e3,vt=o((e,t=r$)=>typeof e=="string"&&e.length>0&&e.length<=t,"isText");function a3(e){if(!e||typeof e!="object")return;let t=e;if(!e$.includes(t.kind)||typeof t.rule!="string"||!t$.test(t.rule)||!vt(t.project,512))return;if(t.kind==="perf-rule-scan"){let i=t.open;return!Array.isArray(i)||i.length>256||!i.every(u=>vt(u,512))?void 0:e}if(!vt(t.subject,512))return;if(t.kind==="perf-rule-retracted")return e;if(t.severity!=="warning"&&t.severity!=="error"||!vt(t.title)||!vt(t.summary)||!vt(t.verify)||!vt(t.docs,1024))return;let r=t.fix;if(!(!Array.isArray(r)||r.length===0||r.length>u$||!r.every(i=>vt(i)))&&!(!t.evidence||typeof t.evidence!="object"||Array.isArray(t.evidence))&&!(!t.cost||typeof t.cost!="object"||Array.isArray(t.cost)))return e}s(a3,"w$"),o(a3,"asPerfRuleRaw");function Dd(e){let{source:t,category:r,title:i,kind:u}=e;return t==="ai"?"ai":u?.startsWith("memory")||u==="db-query"?"data":t==="gateway"||u==="gateway-request"?"gateway":u==="queue-process"||u==="queue-active"||u==="queue-completed"||u==="queue-failed"?"services":t==="db"||t==="redis"||t==="queue"||u==="redis-op"||u?.startsWith("queue-")?"data":t==="external"||u==="egress"?"network":t==="nestjs"||t==="nest"?/(?:Repository|Repo|Dao|Store)\./.test(i)?"data":"services":t==="valtio"?"state":r==="network"?"network":"browser"}s(Dd,"Im"),o(Dd,"areaOf");var o3=240,i$=new Set(["systemPrompt","prompt","prompts","messages","completion","completions","input","output","draft","text","content","result","arguments","params"]),n$=new Set(["tenantId","caller","userId","accountId","email","subject"]),s$=8;function l3(e){let t=Xn(e,0);return r3(Vu({redacted:!0,...t}),{rawByteLimit:16*1024}).value}s(l3,"CE"),o(l3,"aiProjection");function Xn(e,t){if(typeof e=="string")return d3(e);if(e===null||typeof e!="object")return e;if(t>=s$)return;if(Array.isArray(e))return e.slice(0,32).map(i=>Xn(i,t+1));let r={};for(let[i,u]of Object.entries(e))if(!n$.has(i)){if(i$.has(i)){typeof u=="string"?r[`${i}Chars`]=u.length:Array.isArray(u)?r[`${i}Count`]=u.length:u!=null&&(r[`${i}Present`]=!0);continue}r[i]=Xn(u,t+1)}return r}s(Xn,"Sm"),o(Xn,"projectAi");function d3(e){return e.length<=o3?dt(e):`${dt(e.slice(0,o3))}\u2026`}s(d3,"UE"),o(d3,"clipText");function c3(e,t={}){let r=e.raw??{},i=r.render??{},u=r.span??{},n=r.request??{},a=o(y=>typeof y=="number"?y:void 0,"num"),l=r.loop??{},d=r.effect??{},c=a(r.durationMs)??a(u.durationMs)??a(n.durationMs)??a(l.durationMs)??a(i.actualDurationMs)??a(d.durationMs),p=typeof r.kind=="string"?r.kind:void 0,m=p==="fetch-done"||p==="fetch-error",f=a(i.commitTime),h=p==="render"&&f!==void 0&&Math.abs(f-e.timestamp)<6e4,g=m?e.timestamp:h?f:a(r.startedAt)??a(u.startTime)??a(n.startedAt)??a(l.startedAt)??(c!==void 0?e.timestamp-c:e.timestamp),E;if(typeof r.query=="string"){let y=Array.isArray(r.params)?` [${r.params.join(", ")}]`:"",D=typeof r.result=="string"?` \u2192 ${r.result}`:"";E=r.query+y+D}else if(typeof r.command=="string"){let y=typeof r.value=="string"?` \u2192 ${r.value}`:r.hit===!1?" \u2192 (miss)":"";E=r.command+y}else if(p==="state-update"){let y=r.update??{},D="";try{D=JSON.stringify(y.preview)}catch{}E=`${y.storeId??""}.${y.path??""} = ${D}`}else p==="queue-completed"&&typeof r.returned=="string"?E=`returned ${r.returned}`:p==="queue-enqueued"&&(E=`${r.job??"job"}#${r.jobId??"?"} \u2192 ${r.queue??""}${typeof r.data=="string"?" "+r.data:""}`);let x;if(p==="gateway-request")x=`${r.host??""}${String(r.url??"").split("?")[0]}`;else if(p==="fetch-start"||p==="fetch-done"||p==="fetch-error")try{let y=new URL(String(r.href??r.url??""));x=`${y.hostname}${y.pathname}`}catch{}let $;if(p==="gateway-request"&&Array.isArray(r.steps))$=r.steps.map(y=>{let D=[String(y.step)];return y.project&&D.push(String(y.project)),y.prefix&&D.push(String(y.prefix)),y.mode&&D.push(String(y.mode)+(y.ok===!1?" \u2717":y.ok===!0?" \u2713":"")),y.caller&&D.push("by "+String(y.caller)),y.pod&&D.push(String(y.pod)),typeof y.atMs=="number"&&D.push(`@${y.atMs}ms`),D.join(" ")}),E=$.map(y=>y.replace(/ @\d+ms$/,"")).join(" \u2192 ");else if(p==="egress")E=`${r.method??"GET"} ${r.host??""} \u2192 ${r.status??"?"}`;else if(e.source==="ai"){if(p==="ai-call"){let y=r.usage??{},D=y.promptTokens!==void 0||y.completionTokens!==void 0?` \xB7 ${a(y.promptTokens)??"?"}\u2192${a(y.completionTokens)??"?"} tok`:"",A=r.status!==void 0?` \xB7 ${String(r.status)}`:r.error?" \xB7 failed":"",j=a(r.toolCallCount)?` \xB7 ${a(r.toolCallCount)} tool call${a(r.toolCallCount)===1?"":"s"}`:"",N=a(r.durationMs)!==void 0?` \xB7 ${(a(r.durationMs)/1e3).toFixed(1)}s`:"";E=`${r.provider??""}/${r.model??"?"}${D}${A}${j}${N}${r.stream===!0?" \xB7 stream":""}`}else if(p==="ai-round"){let y=r.model??{},D=r.usage??{},A=Array.isArray(r.toolCalls)?r.toolCalls:[],j=`${a(D.promptTokens)??"?"}\u2192${a(D.completionTokens)??"?"} tok`,N=A.length?` \xB7 ${A.length} tool call${A.length===1?"":"s"}`:"",K=a(r.durationMs)!==void 0?` \xB7 ${(a(r.durationMs)/1e3).toFixed(1)}s`:"";E=`${y.provider??""}/${y.model??""} \xB7 ${j}${N}${K}`}else if(p==="ai-turn-start"){let y=Array.isArray(r.tools)?r.tools:[];E=`skill ${r.skill??""} \xB7 ${r.output??""}${y.length?" \xB7 tools: "+y.join(", "):""}`}else if(p==="ai-tool-call"){let y=r.call??{},D=r.result??{},A=a(r.durationMs)!==void 0?` \xB7 ${(a(r.durationMs)/1e3).toFixed(1)}s`:"";E=`${y.name??"tool"} ${D.error!=null?"\u2717 "+String(D.error):"\u2713"}${A}`}else if(p==="ai-turn-end"){let y=r.usage??{},D=a(r.rounds)!==void 0?` \xB7 ${a(r.rounds)} round${a(r.rounds)===1?"":"s"}`:"",A=a(r.durationMs)!==void 0?` \xB7 ${(a(r.durationMs)/1e3).toFixed(1)}s`:"";E=`${r.ok===!1?"FAILED":"ok"} \xB7 ${a(y.promptTokens)??"?"}+${a(y.completionTokens)??"?"} tok${D}${A}`}}let w;p==="db-query"&&typeof r.query=="string"?w=r.query:p==="redis-op"?w=`${r.op??""} ${String(r.key??"").replace(/\d+/g,"#")}`:p==="egress"?w=`${r.method??"GET"} ${r.host??""}`:p==="ai-call"?w=`ai ${r.provider??""} ${r.model??""} ${r.api??""}`:p==="queue-enqueued"?w=`enqueue ${r.queue??""}`:p==="span"&&typeof u.name=="string"?w=u.name:p==="memory-mutation"&&(w=e.title);let k=e.context??{},C=i.commitId??d.commitId??r.commitId,M=Array.isArray(i.why)?i.why.map(y=>typeof y?.type=="string"?y.type:void 0).filter(y=>!!y):[];return{id:e.id,t:e.timestamp,start:g,...w?{sig:w}:{},...x?{urlKey:x}:{},...typeof r.queue=="string"?{queue:r.queue}:{},...r.jobId!=null?{jobId:String(r.jobId)}:{},source:e.source,category:e.category,severity:e.severity,title:e.title,kind:p,area:Dd({source:e.source,category:e.category,title:e.title,kind:p}),...typeof u.role=="string"?{role:u.role}:{},...typeof k.requestId=="string"?{requestId:k.requestId}:{},...typeof k.parentRequestId=="string"?{parentRequestId:k.parentRequestId}:{},...typeof C=="string"?{commitId:C}:{},...typeof i.componentName=="string"?{component:i.componentName}:{},...typeof i.phase=="string"?{phase:i.phase}:{},...M.length?{why:M}:{},...p==="effect-run"&&typeof d.hookLogicalId=="string"?{hook:d.hookLogicalId}:{},...p==="effect-run"&&d.cleanupRan===!0?{cleanup:!0}:{},...p==="render-commit-truncated"?{renderTotal:a(r.total),renderPublished:a(r.published)}:{},...typeof k.projectName=="string"?{project:k.projectName}:typeof r.project=="string"?{project:r.project}:{},...c!==void 0?{durationMs:c}:{},...m&&a(r.startedAt)!==void 0?{fetchStartedAt:a(r.startedAt)}:{},...e.source==="ai"?{ai:t.includeRaw?r:l3(r)}:{},...E?{detail:E}:{},...$?{steps:$}:{}}}s(c3,"LE"),o(c3,"trimFlowEvent");var p3=1;function m3(e){return e==="flow-origin"?0:e?.endsWith("-start")?1:e==="gateway-request"?2:e==="server-request"?3:e==="span"?4:e==="render"||e==="render-commit-truncated"?6:e==="effect-run"?7:5}s(m3,"FE"),o(m3,"kindRank");function Bu(e){return e.kind==="span"&&e.role==="controller"?3.5:e.kind==="queue-process"?3:m3(e.kind)}s(Bu,"po"),o(Bu,"causalRank");function Yn(e,t={}){let r=ki(e),i=e.slice().filter(b=>{let _=b.raw??{},I=typeof _.kind=="string"?_.kind:"";if(I==="subscription-added"||I==="subscription-removed"||I==="hook-run"||I==="store-created"||I==="singleton-instance"||I===pa)return!1;let S=_.span;return!(typeof S?.name=="string"&&S.name.startsWith("nest.request "))}).map(b=>c3(b,t)),u=new Set;for(let b=i.length-1;b>=0;b--)u.has(i[b].id)?i.splice(b,1):u.add(i[b].id);let n=new Map;for(let b of i)(b.kind==="gateway-request"||b.kind==="queue-process")&&b.requestId&&!n.has(b.requestId)&&n.set(b.requestId,b.start);let a=o(b=>b.source!=="react"&&b.source!=="valtio"&&b.requestId&&n.has(b.requestId)?n.get(b.requestId):b.start,"anchorOf");i.sort((b,_)=>a(b)-a(_)||b.start-_.start||Bu(b)-Bu(_)||(_.durationMs??0)-(b.durationMs??0)||b.t-_.t);let l=o(b=>(b.kind==="span"||b.kind==="server-request"||b.kind==="gateway-request"||b.kind==="queue-process")&&(b.durationMs??0)>0,"spanLike"),d=i;for(let b of d)b.group=b.source==="react"||b.source==="valtio"||b.source==="client-runtime"||b.source==="visual"?"browser":"server";let c=new Map;for(let b of d)if((b.kind==="gateway-request"||b.kind==="queue-process")&&b.requestId&&b.project){let _=c.get(b.requestId)??[];_.push({project:b.project,start:b.start,end:b.start+(b.durationMs??0)}),c.set(b.requestId,_)}let p=o((b,_)=>{let I=c.get(b);if(I?.length)return I.every(S=>S.project===I[0].project)?I[0].project:I.filter(S=>S.start<=_+1&&S.end>=_-1).sort((S,U)=>U.start-S.start)[0]?.project},"projectOf");for(let b of d)if(!b.project&&b.source==="nestjs"&&b.requestId){let _=p(b.requestId,b.start);_&&(b.project=_)}for(let b of d){let _,I=b.requestId;for(let S of d){if(S===b||!l(S)||S.group!==b.group||S.requestId!==I)continue;let U=S.project,W=b.project;if(S.kind!=="gateway-request"&&b.kind!=="gateway-request"&&U!==void 0&&W!==void 0&&U!==W)continue;let ue=S.durationMs??0,re=b.durationMs??0,L=Math.abs(S.start-b.start)<=p3,V=Bu(S),Y=Bu(b),ne=S.start<=b.start;if(!(S.start+ue>b.start&&(ne||L&&V<Y)&&(!L||(V!==Y?V<Y:ne&&ue>re))))continue;let Ee=_?Bu(_):-1,me=_?Math.abs(S.start-_.start)<=p3:!1;(!_||!me&&S.start>_.start||me&&V>Ee||me&&V===Ee&&(S.durationMs??0)<(_.durationMs??0))&&(_=S)}_&&(b.parent=_.id)}let m=new Map;for(let b of d){if(!b.requestId)continue;let _=m.get(b.requestId);_?_.push(b):m.set(b.requestId,[b])}let f=new Map(d.map(b=>[b.id,b])),h=o((b,_)=>{let I=(m.get(b)??[]).filter(S=>l(S)&&S.start<=_&&S.start+(S.durationMs??0)>=_);if(I.length!==0)return I.sort((S,U)=>U.start-S.start||(S.durationMs??0)-(U.durationMs??0)),I[0]},"callerNodeFor");for(let b of d){if(!b.parentRequestId||b.kind!=="server-request"&&b.kind!=="gateway-request")continue;let _=b.parent?f.get(b.parent):void 0;if(_&&_.requestId===b.requestId)continue;let I=h(b.parentRequestId,b.start);I&&I!==b&&I.start<=b.start&&(b.parent=I.id)}let g=d,E=new Map;for(let b of g)b.kind==="gateway-request"&&b.requestId&&!E.has(b.requestId)&&E.set(b.requestId,b);for(let b of g)if(b.group==="server"&&!b.parent&&b.requestId&&b.kind!=="gateway-request"){let _=E.get(b.requestId);_&&_!==b&&_.start<=b.start&&(b.parent=_.id)}let x=new Set,$=new Set,w=[];for(let b of g){if(b.kind!=="gateway-request")continue;if(!b.requestId){w.push(b);continue}let _=m.get(b.requestId)??[];if(_.filter(U=>U.kind==="gateway-request").sort((U,W)=>U.start-W.start)[0]!==b)continue;let I=_.find(U=>U.kind==="fetch-start"),S=_.find(U=>U.kind==="fetch-done"||U.kind==="fetch-error");if(!I&&!S){w.push(b);continue}I&&(b.fetchStartId=I.id,x.add(I.id)),S&&(b.fetchDoneId=S.id,$.add(S.id))}let k=new Map;for(let b of g){if(!b.urlKey)continue;let _=k.get(b.urlKey)??{gws:[],starts:[],dones:[]};b.kind==="gateway-request"?w.includes(b)&&_.gws.push(b):b.kind==="fetch-start"?x.has(b.id)||_.starts.push(b):(b.kind==="fetch-done"||b.kind==="fetch-error")&&($.has(b.id)||_.dones.push(b)),k.set(b.urlKey,_)}for(let{gws:b,starts:_,dones:I}of k.values()){b.sort((U,W)=>U.start-W.start),_.sort((U,W)=>U.start-W.start);let S=new Set;b.forEach((U,W)=>{let ue=_[W];ue&&(U.fetchStartId=ue.id);let re=ue?ue.t:U.start,L,V=1/0;for(let Y of I){if(S.has(Y.id))continue;let ne=Y.fetchStartedAt??Y.start-(Y.durationMs??0),Ee=Math.abs(ne-re);Ee<V&&(V=Ee,L=Y)}L&&(U.fetchDoneId=L.id,S.add(L.id))})}let C=new Map,M=new Map;for(let b of g)!b.queue||!b.jobId||(b.kind==="queue-enqueued"&&C.set(`${b.queue}#${b.jobId}`,b),b.kind==="queue-process"&&M.set(`${b.queue}#${b.jobId}`,b));for(let b of g){if(!b.queue||!b.jobId)continue;let _=`${b.queue}#${b.jobId}`;if(b.kind==="queue-process"&&!b.parent){let I=C.get(_);I&&I!==b&&I.start<=b.start&&(b.parent=I.id)}else if(b.kind==="queue-active"||b.kind==="queue-completed"||b.kind==="queue-failed"){let I=M.get(_);I&&I!==b&&I.start<=b.start&&(b.parent=I.id)}}let y=d;{let b=new Map;for(let I of y)I.kind==="fetch-start"&&b.set(I.id,I);let _=new Map;for(let I of y){if(I.kind!=="fetch-done"&&I.kind!=="fetch-error")continue;let S=[...b.values()].find(ue=>ue.requestId&&ue.requestId===I.requestId)?.id,U=S?b.get(S):void 0;if(!U)continue;let W=I.fetchStartedAt??U.start;U.title=I.title,U.severity=I.severity,U.durationMs=I.durationMs??Math.max(0,I.t-W),U.kind="fetch",I.detail&&!U.detail&&(U.detail=I.detail),_.set(I.id,U.id)}if(_.size>0){y=y.filter(I=>!_.has(I.id));for(let I of y)for(I.fetchDoneId&&_.has(I.fetchDoneId)&&(I.fetchDoneId=_.get(I.fetchDoneId));I.parent&&_.has(I.parent);)I.parent=_.get(I.parent)}}let D=o(b=>!!b.commitId&&(b.kind==="render"||b.kind==="effect-run"||b.kind==="render-commit-truncated"),"commitMember"),A=o(b=>[...new Set(b)],"uniq"),j=o(b=>A(b.map(_=>_.component).filter(_=>!!_)),"named"),N=o(b=>b.length<=2?b.join(" + "):`${b[0]} + ${b.length-1} more`,"nameList"),K=o(b=>{let _=new Map;for(let I of b)I.component&&_.set(I.component,(_.get(I.component)??0)+1);return[..._].map(([I,S])=>S>1?`${I} \xD7${S}`:I).join(", ")},"tally"),H=o(b=>{if(!b)return"effect";let _=/([^/\\]+?):(\d+)(?::\d+)?$/.exec(b);return _?`${_[1]}:${_[2]}`:b},"shortHook"),ye=o(b=>`${H(b.hook)}${b.cleanup?" (cleanup)":""}`,"hookLabel"),Ze=o(b=>{let _=Math.min(...b.map(S=>S.start)),I=Math.max(...b.map(S=>S.start+(S.durationMs??0)));return{start:_,durationMs:I-_}},"extent"),Je=o(b=>(delete b.component,delete b.why,delete b.phase,delete b.hook,delete b.cleanup,delete b.renderTotal,delete b.renderPublished,b),"asGroup");function _t(b){let _=b[0],I=b.filter(he=>he.kind==="render"),S=b.filter(he=>he.kind==="effect-run"),U=b.find(he=>he.kind==="render-commit-truncated"),W=[...I].sort((he,Lu)=>(Lu.durationMs??0)-(he.durationMs??0)),ue=W.filter(he=>(he.why??[]).some(Lu=>Lu!=="parent-render")),re=A(ue.flatMap(he=>(he.why??[]).filter(Lu=>Lu!=="parent-render"))),L=j(ue),V=I.filter(he=>he.phase==="mount"),Y=I.filter(he=>he.phase!=="mount"&&!ue.includes(he)),ne=W[0]?.component??"view",Ee=I.length>0&&V.length===I.length,me=re.length?re.join(" + "):void 0,St=Ee?"mount":"update",Ft=L.length?`view update \xB7 ${N(L)} \u2190 ${me}`:Ee?`view mount \xB7 ${ne}`:`view update \xB7 ${ne}`,Vm=U?.renderTotal??I.length,f5=[V.length?`mounted ${K(V)}`:"",Y.length?`re-rendered ${K(Y)}`:"",!L.length&&!Ee&&I.length?"trigger not recorded \u2014 every captured render came from its parent":"",U?`${Vm} renders, ${U.renderPublished??I.length} recorded (per-commit cap)`:`${I.length} render${I.length===1?"":"s"}`,S.length?`${S.length} effect${S.length===1?"":"s"}: ${S.map(ye).join(", ")}`:""].filter(Boolean).join(" \xB7 "),Jm=j(I);return Je({..._,...Ze(b),kind:"view-update",title:Ft,detail:f5,commitId:_.commitId,viewPhase:St,...me?{cause:me}:{},causeComponents:L,components:Jm,mounted:j(V),renderCount:Vm,recordedRenders:I.length,effects:S.length,effectHooks:S.map(ye),memberIds:b.map(he=>he.id),sig:`commit:${St}:${me??"-"}:${L.join(",")}:${Jm.slice().sort().join(",")}`,severity:b.some(he=>he.severity==="error")?"error":_.severity})}s(_t,"mr"),o(_t,"viewUpdateNode");function tt(b){let _=b[0],I=b.map(ye);return Je({..._,...Ze(b),kind:"commit-effects",title:b.length===1?`effect \xB7 ${I[0]}`:`effects \xB7 ${I[0]} + ${b.length-1} more`,detail:I.join(", "),commitId:_.commitId,effects:b.length,effectHooks:I,memberIds:b.map(S=>S.id),sig:`effects:${I.slice().sort().join(",")}`})}s(tt,"_t"),o(tt,"effectsNode");let xi=o(b=>A(b.map(_=>_==="state-update"?"state update":_==="fetch-start"?"request":_==="flow-origin"?"interaction":"response")).join(" + "),"describeInputs");function Zu(b,_){let I=b[0],S=b[b.length-1],U=b.length,W=I.detail,ue=Math.min(...b.map(Y=>Y.start)),re=Math.max(...b.map(Y=>Y.start+(Y.durationMs??0))),L=Math.round(b.reduce((Y,ne)=>Y+(ne.durationMs??0),0)/U*10)/10,V=Math.round((re-ue)*10)/10;I.count=U,I.avgMs=L,I.wallMs=V,I.durationMs=re-ue,I.items=b.slice(0,12).map(Y=>({start:Y.start-ue,...Y.durationMs!=null?{durationMs:Y.durationMs}:{}})),I.memberIds=b.flatMap(Y=>Y.memberIds??[Y.id]),I.title=`\xD7${U} ${I.title}`,b.some(Y=>Y.severity==="error")&&(I.severity="error"),I.kind==="view-update"?I.detail=[`${U} commits, ${_.length?`one per ${xi(_)}`:"back to back"}`,`avg ${L}ms \xB7 wall ${V}ms`,W??""].filter(Boolean).join(" \xB7 "):I.kind==="state-update"&&W&&S.detail?I.detail=`${U} updates in a row \xB7 wall ${V}ms \xB7 first ${W} \xB7 last ${S.detail}`:I.detail=[`${U} in a row \xB7 wall ${V}ms`,W??""].filter(Boolean).join(" \xB7 ")}s(Zu,"ri"),o(Zu,"collapseRepeat");let Oe=[],Ci=new Map,Zm=new Set;for(let b=0;b<y.length;b++){if(Zm.has(b))continue;let _=y[b];if(!D(_)){Oe.push(_);continue}let I=[b];for(let W=b+1;W<y.length;W++){let ue=y[W];if(ue.group==="browser"){if(!D(ue)||ue.commitId!==_.commitId)break;I.push(W)}}for(let W of I)Zm.add(W);let S=I.map(W=>y[W]),U=S.some(W=>W.kind!=="effect-run")?_t(S):tt(S);for(let W of S)W.id!==U.id&&Ci.set(W.id,U.id);Oe.push(U)}if(Ci.size>0||Oe.some(b=>b.kind==="view-update"||b.kind==="commit-effects")){y=Oe;for(let b of y)for(;b.parent&&Ci.has(b.parent);)b.parent=Ci.get(b.parent)}{let b=new Map;for(let _ of y)_.kind==="view-update"&&_.commitId&&!b.has(_.commitId)&&b.set(_.commitId,_);for(let _ of y){if(_.kind!=="commit-effects"||_.parent||!_.commitId)continue;let I=b.get(_.commitId);I&&I.start<=_.start&&(_.parent=I.id)}}{let b=new Set(["state-update","fetch","fetch-start","fetch-done","fetch-error","flow-origin"]),_=y.map((L,V)=>L.group==="browser"?V:-1).filter(L=>L>=0),I=o(L=>`${L.kind}|${L.sig??L.title}`,"keyOf"),S=_.map(L=>I(y[L])),U=o((L,V,Y)=>{for(let ne=0;ne<Y;ne++)if(S[L+ne]!==S[V+ne])return!1;return!0},"sameBlock"),W=o(L=>S[L].split("|")[0],"kindAt"),ue=o(L=>{let V=0,Y=1;for(let ne=1;ne<=4&&L+ne<=S.length;ne++){let Ee=1;for(;L+(Ee+1)*ne<=S.length&&U(L,L+Ee*ne,ne);)Ee+=1;Ee>=3&&ne*Ee>V*Y&&(V=ne,Y=Ee)}return{k:V,r:Y}},"bestBlockAt"),re=new Map;for(let L=0;L<S.length;){let{k:V,r:Y}=ue(L);if(V===0){L+=1;continue}let ne=[...Array(V).keys()].find(me=>b.has(W(L+me)));if(ne!==void 0&&ne>0){let me=ue(L+ne);if(me.k===V&&me.r>=3&&me.r>=Y-1){L+=ne;continue}}let Ee=S.slice(L,L+V).map(me=>me.split("|")[0]).filter(me=>b.has(me));for(let me=0;me<V;me++){let St=[];for(let Ft=0;Ft<Y;Ft++)St.push(y[_[L+me+Ft*V]]);Zu(St,Ee);for(let Ft of St.slice(1))re.set(Ft.id,St[0].id)}L+=V*Y}if(re.size>0){y=y.filter(L=>!re.has(L.id));for(let L of y)for(;L.parent&&re.has(L.parent);)L.parent=re.get(L.parent)}}{let b=new Map(y.map(_=>[_.id,_]));for(let _ of y){let I=new Set([_.id]),S=_;for(;S?.parent;){if(I.has(S.parent)){S.parent=void 0;break}I.add(S.parent),S=b.get(S.parent)}}}let Lm=o(b=>{let _=new Map;for(let S of y){if(!S.sig||l(S)!==b||S.kind==="server-request"||S.kind==="gateway-request"||S.group==="browser")continue;let U=`${S.parent??"root"}|${S.kind}|${S.sig}`,W=_.get(U);W?W.push(S):_.set(U,[S])}let I=new Map;for(let S of _.values()){if(S.length<3)continue;S.sort((V,Y)=>V.start-Y.start);let U=S[0],W=!1;for(let V=0;V+1<S.length;V++)if(S[V+1].start<S[V].start+(S[V].durationMs??0)){W=!0;break}let ue=U.start,re=Math.max(...S.map(V=>V.start+(V.durationMs??0))),L=S.reduce((V,Y)=>V+(Y.durationMs??0),0);U.count=S.length,U.parallel=W,U.avgMs=Math.round(L/S.length*10)/10,U.wallMs=re-ue,U.durationMs=re-ue,U.title=`\xD7${S.length} ${U.title.replace(/\s*\((?:\d+ rows?, )?\d+ms\)$/,"")}`,U.detail=`${U.sig} \xD7${S.length} ${W?"\u2016 parallel":"\u21BB sequential loop"} \xB7 avg ${U.avgMs}ms \xB7 wall ${U.wallMs}ms`,U.items=S.slice(0,12).map(V=>({start:V.start-ue,...V.durationMs!=null?{durationMs:V.durationMs}:{}})),U.memberIds=S.flatMap(V=>V.memberIds??[V.id]),S.some(V=>V.severity==="error")&&(U.severity="error");for(let V of S.slice(1))I.set(V.id,U.id)}if(I.size!==0){y=y.filter(S=>!I.has(S.id));for(let S of y)for(;S.parent&&I.has(S.parent);)S.parent=I.get(S.parent)}},"aggregatePass");Lm(!0),Lm(!1);for(let b of y){if(!l(b))continue;let _=b.durationMs??0;if(_<40)continue;let I=y.filter(re=>re.parent===b.id&&(re.durationMs??0)>0).map(re=>[re.start,re.start+(re.durationMs??0)]).sort((re,L)=>re[0]-L[0]),S=0,U=-1,W=-1;for(let[re,L]of I)re>W?(W>U&&(S+=W-U),U=re,W=L):L>W&&(W=L);W>U&&(S+=W-U);let ue=Math.max(0,_-S);(ue>=50||ue/_>=.7&&_>=40)&&(b.selfMs=ue,b.detail=`\u26A0 cpu-heavy: ${ue}ms self-time of ${_}ms${b.detail?" \xB7 "+b.detail:""}`)}return{events:y,...r?{sql:r}:{}}}s(Yn,"fo"),o(Yn,"buildFlowDetail");var Qn=["user-action","page-load","navigation","api","ai","background","test","system","other"],es=new Map;function xu(e,t){let r=es.get(e);return r||(r=new RegExp(`^${e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".")}$`),es.size>500&&es.clear(),es.set(e,r)),r.test(t)}s(xu,"mo"),o(xu,"globMatch");var a$=o(e=>/^[A-Z]+ /.test(e),"hasMethod");function f3(e,t){return t.some(r=>r.route?a$(e)?xu(e,`${r.method??"GET"} ${r.route}`):xu(e,r.route):!1)}s(f3,"ZE"),o(f3,"routeMatches");function $d(e,t){return!([e.flowId,e.originType,e.origin,e.route,e.project].filter(r=>r!==void 0).length===0||e.flowId!==void 0&&!xu(e.flowId,t.flowId)||e.originType!==void 0&&e.originType!==t.origin.type||e.origin!==void 0&&!(t.origin.nodeId!==void 0&&xu(e.origin,t.origin.nodeId))||e.route!==void 0&&!f3(e.route,t.segments)||e.project!==void 0&&!t.segments.some(r=>r.projects.some(i=>xu(e.project,i))))}s($d,"_$"),o($d,"ruleMatches");var Bd=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isObj"),yt=o(e=>typeof e=="string"&&e!==""?e:void 0,"str"),ts=o(e=>Bd(e.raw)?yt(e.raw.kind)??"":"","kindOf");function h3(e){let t=[...e].sort((l,d)=>(Number(l.timestamp)||0)-(Number(d.timestamp)||0)||(l.id<d.id?-1:1)),r=t.find(l=>ts(l)==="flow-origin"),i=r??t.find(l=>yt(l.context?.originType));if(!i)return{};let u=Bd(i.raw)?i.raw:{},n=yt(i.context?.originType)??(r?yt(i.title):void 0),a=yt(u.originNodeId)??yt(i.context?.originNodeId);return{...n?{type:n}:{},...a?{nodeId:a}:{}}}s(h3,"qE"),o(h3,"originOf");var o$=/^(verify|e2e|test|smoke|load)[-_:]/i,l$=o((e,t)=>o$.test(e)||t!==void 0&&/^(ui:)?(tools|scripts?|e2e)\//.test(t),"isTestFlow"),g3={"page-load":"page-load","user-click":"user-action","form-submit":"user-action","input-change":"user-action","double-click":"user-action","context-menu":"user-action","key-press":"user-action","route-load":"navigation","route-change":"navigation",navigation:"navigation","ai-turn":"ai",timer:"background",cron:"background",interval:"background",queue:"background",job:"background","websocket-message":"background","hmr-update":"system"},d$=new Set(["page-load","user-action","navigation"]),c$=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function us(e){return e.replace(/[?#].*$/,"").split("/").map(t=>c$.test(t)||/^[0-9a-f]{16,}$/i.test(t)||/^\d{2,}$/.test(t)?":id":t).join("/")}s(us,"Rm"),o(us,"templatePath");function v3(e){let t=/^ui:(?:.*\/)?([^/:]+?)(?:\.[a-z]+)?:\d+:([A-Za-z]+)$/.exec(e);return t?`${t[1]} \xB7 ${t[2]}`:e}s(v3,"WE"),o(v3,"componentOf");function y3(e){let t=e.replace(/[-_:][0-9a-f]{6,}(?:-[0-9a-f]+)*$/i,"");return t=t.replace(/[-_:](?=[a-z0-9]*\d)[a-z0-9]{6,}$/i,""),t=t.replace(/[-_:]\d+$/,""),t||e}s(y3,"XE"),o(y3,"scriptFamily");function E3(e,t,r,i){let u=t.nodeId,n=u?/^(page|route|ambient):(.*)$/.exec(u):null;if(n)return`${n[1]}:${us(n[2])}`;if(t.type&&g3[t.type]==="user-action"&&u)return v3(u);if(e==="test")return y3(r.flowId);let a=r.segments.find(d=>d.kind==="request"&&d.route);if(a?.route)return`${a.method??"GET"} ${us(a.route)}`;let l=i.find(d=>ts(d)==="ai-call");return l&&Bd(l.raw)?`ai \xB7 ${yt(l.raw.model)??yt(l.raw.provider)??"call"}`:u?us(u):void 0}s(E3,"HE"),o(E3,"subjectOf");var p$=10,m$=1e3,f$=3,h$=500,g$=1e3;function b3(e,t){let r=new Set,i=t.segments.filter(n=>n.kind==="request");t.segments.some(n=>n.counts.errors>0)&&r.add("has-error"),i.some(n=>n.durationMs>=m$)&&r.add("slow"),i.length>=p$&&r.add("fan-out"),new Set(t.segments.flatMap(n=>n.projects)).size>=3&&r.add("multi-service"),e.some(n=>ts(n)==="queue-enqueued")&&r.add("queue"),e.some(n=>ts(n)==="ai-call"||n.source==="ai")&&r.add("ai"),t.stats.bookkeeping>=h$&&t.stats.bookkeeping*2>=t.stats.events&&r.add("storm"),t.stats.events>=g$&&r.add("large");let u=new Map;for(let n of i)(!n.part||n.part.index===1)&&u.set(n.label,(u.get(n.label)??0)+1);return[...u.values()].some(n=>n>=f$)&&r.add("repeated-requests"),[...r].sort()}s(b3,"nT"),o(b3,"tagsOf");function w3(e,t,r=[]){let i=h3(e),u={flowId:t.flowId,origin:i,segments:t.segments},n=b3(e,t),a=o((p,m,f)=>{let h=E3(p,i,t,e);return{category:p,decidedBy:m,...f!==void 0?{ruleIndex:f}:{},tags:n,origin:i,...h?{subject:h}:{}}},"done"),l=r.findIndex(p=>p.category&&$d(p,u));if(l!==-1)return a(r[l].category,"rule",l);if(l$(t.flowId,i.nodeId))return a("test","test");let d=i.type?g3[i.type]:void 0;if(d)return a(d,"origin");if(n.includes("ai"))return a("ai","shape");let c=t.segments.filter(p=>p.kind==="request");return c.length>0?a(c.every(p=>p.requestId?.startsWith("job:"))?"background":"api","shape"):t.segments.length>0&&t.segments.every(p=>p.kind==="ambient")?a("system","shape"):a("other","shape")}s(w3,"S$"),o(w3,"classifyFlow");function D3(e,t,r=[]){let i=r.find(u=>u.category&&(u.route!==void 0||u.project!==void 0)&&u.flowId===void 0&&u.origin===void 0&&u.originType===void 0&&$d(u,{flowId:e.flowId,origin:t.origin,segments:[e]}));return i?i.category:e.kind==="request"?e.requestId?.startsWith("job:")?"background":"api":e.kind==="ambient"?"system":e.kind==="origin"&&d$.has(t.category)?t.category:"ui"}s(D3,"I$"),o(D3,"categoryOfSegment");function $3(e){return B3(e).map(t=>{let r=new Map;for(let u of t.items){let n=r.get(u.subject);n?n.push(u):r.set(u.subject,[u])}let i=[...r.entries()].sort((u,n)=>(u[0]===void 0?1:0)-(n[0]===void 0?1:0)||n[1].length-u[1].length||String(u[0]).localeCompare(String(n[0]))).map(([u,n])=>({subject:u,count:n.length,items:n}));return{...t,subjects:i}})}s($3,"R$"),o($3,"groupFlows");function B3(e){let t=new Map;for(let i of e){let u=t.get(i.category);u?u.push(i):t.set(i.category,[i])}let r=o(i=>{let u=Qn.indexOf(i);return u===-1?Qn.length:u},"rank");return[...t.entries()].sort((i,u)=>r(i[0])-r(u[0])||(i[0]<u[0]?-1:i[0]>u[0]?1:0)).map(([i,u])=>({category:i,count:u.length,items:u}))}s(B3,"oT"),o(B3,"groupByCategory");var Et={categories:[],segments:{},problems:[]},xd=200,x3=200,C3=64,v$=/^[A-Za-z0-9][A-Za-z0-9 ._:/-]*$/,y$=["category","flowId","originType","origin","route","project"],E$={phaseGapMs:[50,6e5],burstGapMs:[10,6e4],attachWindowMs:[0,6e4],maxSegmentEvents:[20,1e4],occurrenceSlackMs:[0,1e3]},Cd=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isObj");function k3(e,t){if(!Cd(e))return{problems:[`${t}: not an object`]};let r=[];for(let l of Object.keys(e))y$.includes(l)||r.push(`${t}: unknown field "${l}" ignored`);let i=e.category;if(typeof i!="string"||i.trim()==="")return{problems:[...r,`${t}: "category" must be a non-empty string \u2014 rule dropped`]};let u=i.trim();if(u.length>C3||!v$.test(u))return{problems:[...r,`${t}: category "${u.slice(0,40)}" is not a usable name (letters, digits, space . _ : / -; up to ${C3}) \u2014 rule dropped`]};let n={category:u},a=0;for(let l of["flowId","originType","origin","route","project"]){let d=e[l];if(d!==void 0){if(typeof d!="string"||d===""||d.length>x3)return{problems:[...r,`${t}: "${l}" must be a non-empty string of up to ${x3} characters \u2014 rule dropped`]};n[l]=d,a+=1}}return a===0?{problems:[...r,`${t}: "${u}" has no match field (flowId, originType, origin, route or project) \u2014 rule dropped`]}:{rule:n,problems:r}}s(k3,"cT"),o(k3,"parseRule");function A3(e){if(e==null)return Et;if(!Cd(e))return{...Et,problems:["lensmcp.flows must be an object \u2014 ignored"]};let t=[],r=[],i=e.categories;i!==void 0&&(Array.isArray(i)?(i.length>xd&&t.push(`flows.categories has ${i.length} rules; only the first ${xd} are used`),i.slice(0,xd).forEach((a,l)=>{let d=k3(a,`flows.categories[${l}]`);t.push(...d.problems),d.rule&&r.push(d.rule)})):t.push("flows.categories must be an array \u2014 ignored"));let u={},n=e.segments;if(n!==void 0)if(!Cd(n))t.push("flows.segments must be an object \u2014 ignored");else for(let[a,l]of Object.entries(n)){let d=E$[a];if(!d){t.push(`flows.segments.${a}: unknown option ignored`);continue}if(typeof l!="number"||!Number.isFinite(l)||l<d[0]||l>d[1]){t.push(`flows.segments.${a}: ${JSON.stringify(l)} is outside ${d[0]}\u2013${d[1]}; using the default (${l4[a]})`);continue}u[a]=l}return{categories:r,segments:u,problems:t}}s(A3,"A$"),o(A3,"parseFlowsConfig");function rs(e,t=Et){let r=g4(e,t.segments),i=w3(e,r,t.categories),u={};for(let n of r.segments)u[n.id]=D3(n,i,t.categories);return{segmentation:r,classification:i,segmentCategories:u}}s(rs,"an"),o(rs,"analyzeFlow");function kd(e,t={}){let r=t.threshold??5,i=[];for(let u of e){let n=u.raw??null;if(n?.kind!=="loop"||!n.loop)continue;let a=n.loop.dbCallsInsideLoop??0;a>r&&i.push({kind:"db-in-loop",severity:"warning",title:`${a} DB calls inside a loop (${n.loop.iterations??"?"} iterations)`,evidence:[u.id],details:{dbCallsInsideLoop:a,iterations:n.loop.iterations,durationMs:n.loop.durationMs,threshold:r},detectedAt:u.timestamp})}return i}s(kd,"Ws"),o(kd,"detectDbInLoop");function I3(e,t={}){let r=t.threshold??3,i=new Map;for(let n of e){let a=n.raw??null;if(a?.kind!=="db-query"||!a.query?.signature)continue;let l=a.query.signature,d=i.get(l);d||(d=[],i.set(l,d)),d.push(n)}let u=[];for(let[n,a]of i)a.length>=r&&u.push({kind:"n+1-query",severity:"warning",title:`Query repeated ${a.length}\xD7 \u2014 likely N+1`,evidence:a.map(l=>l.id),details:{signature:n,count:a.length,threshold:r},detectedAt:a[a.length-1].timestamp});return u}s(I3,"j$"),o(I3,"detectNPlusOne");function _3(e,t={}){let r=t.threshold??5,i=t.windowMs??250,u=new Map;for(let a of e){if(a.source!=="react")continue;let l=a.raw??null;if(l?.kind!=="render"||!l.render?.componentInstanceId)continue;let d=l.render.componentInstanceId,c=u.get(d);c||(c=[],u.set(d,c)),c.push(a)}let n=[];for(let[a,l]of u){l.sort((c,p)=>c.timestamp-p.timestamp);let d=0;for(let c=0;c<l.length;c++){for(;l[c].timestamp-l[d].timestamp>i;)d++;let p=c-d+1;if(p>r){let m=l.slice(d,c+1),f=m[0].raw.render?.componentName??a;n.push({kind:"render-storm",severity:"warning",title:`${f} rendered ${p}\xD7 in ${i}ms`,evidence:m.map(h=>h.id),details:{componentInstanceId:a,count:p,windowMs:i,threshold:r},detectedAt:m[m.length-1].timestamp});break}}}return n}s(_3,"z$"),o(_3,"detectRenderStorm");function S3(e,t,r){let i=new Map,u=new Set;function n(l){let d=i.get(l);if(d)return d;if(u.has(l))return{path:[l],totalDurationMs:r(l)};u.add(l);let c=r(l),p=t.get(l)??[],m;for(let h of p){let g=n(h);(!m||g.totalDurationMs>m.totalDurationMs)&&(m=g)}u.delete(l);let f=m?{path:[l,...m.path],totalDurationMs:c+m.totalDurationMs}:{path:[l],totalDurationMs:c};return i.set(l,f),f}s(n,"i"),o(n,"best");let a={path:[],totalDurationMs:0};for(let l of e){let d=n(l);d.totalDurationMs>a.totalDurationMs&&(a=d)}return a}s(S3,"O$"),o(S3,"findSlowPath");var F3={dbInLoop:5,nPlusOne:3,renderStorm:5,slowRouteMs:500,slowRenderMs:16,slowQueryMs:100,duplicateRequestPeak:3,slowEgressMs:1e3};function Ye(e){let t={...F3};if(e)for(let r of Object.keys(F3)){let i=e[r];typeof i=="number"&&Number.isFinite(i)&&i>=0&&(t[r]=i)}return t}s(Ye,"Ee"),o(Ye,"resolveThresholds");function j3(e){let t=e.raw??null,r=t?.kind,i=e.context,u={id:e.id,parentTraceNodeId:i.causedByNodeId??i.originNodeId,lifecycle:"completed",context:i,startTime:e.timestamp,attributes:{...t??{}}};if(e.source==="react"&&r==="render"){let n=t;return{parentAxis:"render",node:{...u,type:"render",logicalId:n.render?.componentLogicalId,instanceId:n.render?.componentInstanceId,name:`render ${n.render?.componentName??"?"}`,durationMs:n.render?.actualDurationMs}}}if(e.source==="valtio"&&r==="state-update"){let n=t;return{parentAxis:"state",node:{...u,type:"state-update",logicalId:n.update?.storeId,name:`${n.update?.storeId??"?"}.${n.update?.path??"?"}`}}}if(e.source==="nestjs"&&r==="server-request"){let n=t;return{parentAxis:"backend",node:{...u,type:"server-request",name:`${n.request?.method??"?"} ${n.request?.route??"?"}`,durationMs:n.request?.durationMs}}}if(r==="db-query"){let n=t,a=[n.op,n.table].filter(Boolean).join(" ")||(n.name??"query");return{parentAxis:"backend",node:{...u,type:"db-query",logicalId:n.table?`db:${n.op??"query"}:${n.table}`:void 0,name:n.error?`${a} (failed)`:a,durationMs:n.durationMs}}}if(r==="loop")return{parentAxis:"performance",node:{...u,type:"loop",name:"loop",durationMs:t.loop?.durationMs}};if(e.source==="client-runtime"&&r==="user-action"){let n=t;return{parentAxis:"caused",node:{...u,type:"ui-event",logicalId:n.origin?.nodeId,name:n.origin?.label??e.title}}}}s(j3,"uT"),o(j3,"eventToNode");function z3(e,t){let r=[...t].sort((l,d)=>l.timestamp-d.timestamp),i=[];for(let l of r){let d=j3(l);d&&(e.addNode(d.node),i.push(d))}let u=0,n=o((l,d,c,p)=>{let m={id:`${c}:${l}->${d}`,from:l,to:d,axis:c,type:p,timestamp:e.getNode(d)?.startTime??0};e.addEdge(m),u++},"addEdge");for(let l of i){let d=l.node.context.causedByNodeId;d&&e.getNode(d)&&n(d,l.node.id,l.parentAxis??"caused","caused-by")}let a=new Map;for(let l of i){let d=l.node.context.flowId;if(!d)continue;let c=a.get(d);c||(c=[],a.set(d,c)),c.push(l)}for(let l of a.values())for(let d=1;d<l.length;d++){let c=l[d-1].node,p=l[d].node;p.context.causedByNodeId!==c.id&&n(c.id,p.id,"caused","flow-sequence")}return{nodeCount:i.length,edgeCount:u}}s(z3,"N$"),o(z3,"buildGraphFromEvents");var N3=new WeakMap;function is(e){let t=N3.get(e);if(t!==void 0)return t;let r=Xe(e);return N3.set(e,r),r}s(is,"cn"),o(is,"estimateEventBytes");function M3(e,t={}){let r=t.rawByteLimit??32768,i=t.maxDepth??12,u=e.raw;if(u==null)return{event:e,truncated:!1,originalBytes:0,keptBytes:0};if(!Ed(u,r,i)){let c=Xe(u,r,i);return{event:e,truncated:!1,originalBytes:c,keptBytes:c}}let n=Xe(u,Number.POSITIVE_INFINITY,64),a={budget:r,maxStringBytes:t.maxStringBytes??4096,maxArrayItems:t.maxArrayItems??64,paths:[],truncatedAnything:!1},l=Du(u,a,i,""),d=Xe(l,Number.POSITIVE_INFINITY,i);if(a.truncatedAnything&&l!==null&&typeof l=="object"&&!Array.isArray(l)){let c={truncated:!0,originalBytes:n,keptBytes:d,paths:a.paths};l[yd]=c}return{event:{...e,raw:l},truncated:a.truncatedAnything,originalBytes:n,keptBytes:d}}s(M3,"mT"),o(M3,"clampEventRaw");function Ad(e={}){let t=0,r=0,i=0,u=e.rawByteLimit??32768;return{clamp(n){t+=1;let a=M3(n,e);return a.truncated&&(r+=1,i+=Math.max(0,a.originalBytes-a.keptBytes)),a.event},stats(){return{inspected:t,truncated:r,bytesReclaimed:i,rawByteLimit:u}},reset(){t=0,r=0,i=0}}}s(Ad,"Xs"),o(Ad,"createEventClamp");var b$={screenshot:50,"visual-crop":50,"visual-frame":200,"build-report":20,"heap-snapshot":3,"trace-with-errors":20,verification:10},w$=64*1024*1024,D$=32*1024*1024,$$=class{static{s(this,"Hs")}static{o(this,"InMemoryRingBuffer")}constructor(e={}){this.events=[],this.eventBytes=[],this.residentEventBytes=0,this.ingested=0,this.dropped=0,this.droppedForBytes=0,this.artifactsByKind=new Map,this.artifactsById=new Map,this.artifactBytesById=new Map,this.artifactOrder=[],this.residentArtifactBytes=0,this.artifactsDropped=0,this.eventCap=e.eventCap??5e3,this.eventByteCap=e.eventByteCap??w$,this.artifactCaps={...b$,...e.artifactCapacities},this.artifactByteCap=e.artifactByteCap??D$}appendEvent(e){let t=is(e);for(this.events.push(e),this.eventBytes.push(t),this.residentEventBytes+=t,this.ingested+=1,this.events.length>this.eventCap&&this.evictOldestEvents(this.events.length-this.eventCap);this.residentEventBytes>this.eventByteCap&&this.events.length>1;)this.evictOldestEvents(1),this.droppedForBytes+=1}evictOldestEvents(e){if(e<=0)return;let t=Math.min(e,this.events.length);for(let r=0;r<t;r++)this.residentEventBytes-=this.eventBytes[r]??0;this.events.splice(0,t),this.eventBytes.splice(0,t),this.dropped+=t,this.events.length===0&&(this.residentEventBytes=0)}recentEvents(e){return e===void 0||e>=this.events.length?[...this.events]:this.events.slice(this.events.length-e)}totalEventsIngested(){return this.ingested}totalEventsDropped(){return this.dropped}putArtifact(e){let t=this.artifactCaps[e.kind]??0;if(t<=0)return;let r=this.artifactsByKind.get(e.kind);r||(r=[],this.artifactsByKind.set(e.kind,r)),this.artifactsById.has(e.id)&&this.removeArtifact(e.id);let i=Xe(e.data);for(r.push(e),this.artifactsById.set(e.id,e),this.artifactBytesById.set(e.id,i),this.artifactOrder.push(e.id),this.residentArtifactBytes+=i;r.length>t;){let u=r.shift();u&&(this.forgetArtifact(u.id),this.artifactsDropped+=1)}for(;this.residentArtifactBytes>this.artifactByteCap&&this.artifactOrder.length>1;){let u=this.artifactOrder[0];if(u===void 0)break;this.removeArtifact(u),this.artifactsDropped+=1}}removeArtifact(e){let t=this.artifactsById.get(e);if(t){let r=this.artifactsByKind.get(t.kind);if(r){let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}this.forgetArtifact(e)}forgetArtifact(e){this.artifactsById.delete(e),this.residentArtifactBytes-=this.artifactBytesById.get(e)??0,this.artifactBytesById.delete(e);let t=this.artifactOrder.indexOf(e);t!==-1&&this.artifactOrder.splice(t,1),this.artifactsById.size===0&&(this.residentArtifactBytes=0)}getArtifact(e){return this.artifactsById.get(e)}listArtifacts(e){return[...this.artifactsByKind.get(e)??[]]}approximateSizeBytes(){return this.residentEventBytes+this.residentArtifactBytes}stats(){let e={};for(let[t,r]of this.artifactsByKind)r.length>0&&(e[t]=r.length);return{events:{resident:this.events.length,residentBytes:this.residentEventBytes,ingested:this.ingested,dropped:this.dropped,droppedForBytes:this.droppedForBytes,cap:this.eventCap,byteCap:this.eventByteCap},artifacts:{resident:this.artifactsById.size,residentBytes:this.residentArtifactBytes,dropped:this.artifactsDropped,byteCap:this.artifactByteCap,byKind:e}}}},B$=class{static{s(this,"Ys")}static{o(this,"Session")}constructor(e={}){this.state="idle",this.hooks=[],this.reducerRetention=new Map,this.id=e.sessionId??lt(),this.storage=e.storage??new $$,this.clamp=e.clamp===!1?void 0:Ad(e.clamp??{}),this.redactor=e.redact===!1?void 0:da(e.redact??{});let t=[this.clamp?.clamp,this.redactor?.redact].filter(r=>r!==void 0);this.bus=new e4({capacity:e.eventBusCapacity,...t.length?{transform:o(r=>t.reduce((i,u)=>u(i),r),"transform")}:{}}),this.graph=new n4,this.resources=new i4,this.reducers=new F5,this.bus.subscribe(r=>{this.storage.appendEvent(r),this.reducers.dispatch(r)})}get lifecycle(){return this.state}storageStats(){let e=Object.fromEntries([...this.reducerRetention].map(([t,r])=>[t,r()]));return{...this.storage.stats?{storage:this.storage.stats()}:{},...this.clamp?{clamp:this.clamp.stats()}:{},...Object.keys(e).length>0?{reducers:e}:{}}}registerReducerRetention(e,t){this.reducerRetention.set(e,t)}start(){this.state==="idle"&&(this.state="active")}onShutdown(e){this.hooks.push(e)}async stop(){if(!(this.state==="closed"||this.state==="stopping")){this.state="stopping";for(let e=this.hooks.length-1;e>=0;e--){let t=this.hooks[e];try{let r=t.stop();r&&typeof r.then=="function"&&await r}catch{}}this.state="closed"}}};import{AsyncProvider as Vr,ProviderScope as Jr}from"@frontmcp/sdk";var Id;function O3(e){Id=e}s(O3,"D$"),o(O3,"setActiveSession");function Cu(){if(!Id)throw new Error("No LensMCP session is active. Did you call bootstrapLensmcp() before the FrontMCP container started?");return Id}s(Cu,"yo"),o(Cu,"requireSession");var x$=Vr({provide:qr,name:"LensmcpSession",description:"The active LensMCP Session instance.",scope:Jr.GLOBAL,inject:o(()=>[],"inject"),useFactory:o(()=>Cu(),"useFactory")}),C$=Vr({provide:Zr,name:"LensmcpEventBus",description:"The session's normalised event bus.",scope:Jr.GLOBAL,inject:o(()=>[],"inject"),useFactory:o(()=>Cu().bus,"useFactory")}),k$=Vr({provide:JD,name:"LensmcpGraphStore",description:"The typed multi-axis trace graph.",scope:Jr.GLOBAL,inject:o(()=>[],"inject"),useFactory:o(()=>Cu().graph,"useFactory")}),A$=Vr({provide:Z,name:"LensmcpResourceStore",description:"Registry of agent-readable MCP resources.",scope:Jr.GLOBAL,inject:o(()=>[],"inject"),useFactory:o(()=>Cu().resources,"useFactory")}),I$=Vr({provide:WD,name:"LensmcpStorage",description:"Hot-tier storage backend (in-memory ring buffer by default).",scope:Jr.GLOBAL,inject:o(()=>[],"inject"),useFactory:o(()=>Cu().storage,"useFactory")}),_$=[x$,C$,k$,A$,I$];function R3(e={}){let t=new B$(e);return t.start(),O3(t),{session:t,providers:_$}}s(R3,"U$"),o(R3,"bootstrapLensmcp");var A_=new RegExp("\x1B\\[[0-9;]*[A-Za-z]","g"),I_=["ai/agents/hazard-analyst/src/hazard-analyst.agent.ts(52,12): error TS2416: Property 'outputSchema' in type 'HazardAnalystAgent' is not assignable to the same property in base type 'BaseAgent<HazardInput, HazardOutput>'.","server/apps/haccp/src/modules/plan/plan.service.ts(118,7): error TS2322: Type 'string' is not assignable to type 'PlanStatus'.","web/libs/ui/src/report/report-renderer.tsx(9,3): warning TS6133: {0} is declared but its value is never read."].join(`
66
- `);import{createSocket as S$}from"node:dgram";import{closeSync as F$,existsSync as T3,openSync as j$,readSync as z$,statSync as P3}from"node:fs";import{createServer as N$}from"node:net";import{existsSync as U3,unlinkSync as q3}from"node:fs";var M$=1024*1024;function Z3(e){let t=e.onError??(()=>{});try{U3(e.path)&&q3(e.path)}catch{}let r=new Set,i=e.maxFrameBytes??M$,u=N$(n=>{r.add(n);let a="";n.setEncoding("utf8"),n.on("data",l=>{a+=l;let d;for(;(d=a.indexOf(`
67
- `))!==-1;){let c=a.slice(0,d);a=a.slice(d+1),c&&e.onMessage(c)}a.length>i&&(t(new Error(`uds: frame exceeded ${i} bytes without a newline \u2014 connection dropped`)),a="",n.destroy())}),n.on("error",l=>t(l)),n.on("close",()=>r.delete(n))});return u.on("error",n=>t(n)),u.listen(e.path,()=>e.onListening?.()),u.unref(),{close:o(()=>new Promise(n=>{for(let a of r)try{a.destroy()}catch{}r.clear();try{u.close(()=>{try{U3(e.path)&&q3(e.path)}catch{}n()})}catch{n()}}),"close")}}s(Z3,"Om"),o(Z3,"createUdsServer");function L3(e){let t=e.eventFile??process.env.LENSMCP_EVENT_FILE,r=e.socketPath??process.env.LENSMCP_IPC_SOCKET,i=e.udsPath??process.env.LENSMCP_UDS,u=e.onError??(()=>{}),n=0,a=o(f=>{let h=f.trim();if(!h)return;let g;try{g=JSON.parse(h)}catch{return}if(!(!g||typeof g!="object"||!("id"in g)||!("source"in g)))try{e.sessionId&&g.sessionId==="pending"&&(g.sessionId=e.sessionId,g.context&&g.context.sessionId==="pending"&&(g.context.sessionId=e.sessionId)),e.bus.publish(g),n+=1}catch(E){u(E)}},"publish"),l=[],d=!1,c=!1,p=!1;if(t){d=!0;let f=0,h="",g=!1,E=e.replayBytes??Number(process.env.LENSMCP_REPLAY_BYTES??4*1024*1024);if(T3(t))try{let w=P3(t).size;Number.isFinite(E)&&E>0&&w>0?(f=Math.max(0,w-E),g=f>0):f=w}catch{f=0}let x=Buffer.alloc(64*1024),$=setInterval(o(()=>{if(!T3(t))return;let w;try{w=P3(t).size}catch{return}for(w<f&&(f=0,h="");f<w;){let k;try{k=j$(t,"r")}catch(C){u(C);return}try{let C=Math.min(x.length,w-f),M=z$(k,x,0,C,f);if(M<=0)break;f+=M,h+=x.toString("utf8",0,M);let y;for(;(y=h.indexOf(`
68
- `))!==-1;){let D=h.slice(0,y);if(h=h.slice(y+1),g){g=!1;continue}a(D)}}finally{F$(k)}}},"drain"),e.pollMs??50);$.unref?.(),l.push(()=>clearInterval($))}if(r){let[f,h]=r.split(":"),g=Number(h);if(f&&Number.isFinite(g)){c=!0;let E;try{E=S$("udp4"),E.on("message",x=>a(x.toString("utf8"))),E.on("error",x=>u(x)),E.bind(g,f),E.unref()}catch(x){u(x),c=!1}if(E){let x=E;l.push(()=>new Promise($=>{try{x.close(()=>$())}catch{$()}}))}}}if(i)try{let f=Z3({path:i,onMessage:o(h=>a(h),"onMessage"),onError:u});p=!0,l.push(()=>f.close())}catch(f){u(f)}let m=[];return d&&m.push("file"),c&&m.push("udp"),p&&m.push("uds"),{mode:m.join("+")||"none",count:o(()=>n,"count"),async stop(){for(let f of l)try{await f()}catch{}}}}s(L3,"Mm"),o(L3,"startEventIngest");import{existsSync as O$,readFileSync as V3}from"node:fs";import{dirname as R$,join as T$}from"node:path";function J3(e=process.cwd()){let t=_d("nx.json",e);if(!t)return Ye();try{let r=JSON.parse(V3(t,"utf8"));return Ye(r.lensmcp?.thresholds)}catch{return Ye()}}s(J3,"Nm"),o(J3,"loadWorkspaceThresholds");function W3(e=process.cwd()){let t=_d("nx.json",e);if(!t)return Et;try{let r=JSON.parse(V3(t,"utf8"));return A3(r.lensmcp?.flows)}catch(r){return{...Et,problems:[`${t} could not be read as JSON (${r instanceof Error?r.message:String(r)}) \u2014 flow config ignored`]}}}s(W3,"Pm"),o(W3,"loadWorkspaceFlowsConfig");function _d(e,t){let r=t;for(let i=0;i<8;i++){let u=T$(r,e);if(O$(u))return u;let n=R$(r);if(n===r)break;r=n}}s(_d,"V$"),o(_d,"findUp");function F(e,t,r,i){var u=arguments.length,n=u<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,i);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(n=(u<3?a(n):u>3?a(t,r,n):a(t,r))||n);return u>3&&n&&Object.defineProperty(t,r,n),n}s(F,"$"),o(F,"__decorate");import{App as P$}from"@frontmcp/sdk";import{Resource as U$,ResourceContext as q$}from"@frontmcp/sdk";import{existsSync as Z$,readFileSync as L$}from"node:fs";import{dirname as V$,join as J$}from"node:path";var Le="perf://rules",Lt="pod/heap-budget",Vt="pod/retained-generation",G3=512,K3=.9,W$=64,G$=16,K$=16,H3=256,X3=1024*1024,H$="LENSMCP_PERF_RULES",X$="LENSMCP_POD_HEAP_BUDGET_MB",Y$={heapBudgetEnabled:!0,retainedEnabled:!0,budgetMb:G3,services:{}},Q$=/^(0|off|false|no)$/i,Sd=o(e=>{let t=typeof e=="string"&&e.trim()!==""?Number(e):e;return typeof t=="number"&&Number.isFinite(t)&&t>=16&&t<=1e6?t:void 0},"budget");function ns(e,t){let r=t&&typeof t=="object"&&!Array.isArray(t)?t:{},i=r[Lt]&&typeof r[Lt]=="object"?r[Lt]:{},u=r[Vt]&&typeof r[Vt]=="object"?r[Vt]:{},n=Q$.test((e[H$]??"").trim())||r.enabled===!1,a={};if(i.services&&typeof i.services=="object"&&!Array.isArray(i.services))for(let[l,d]of Object.entries(i.services)){let c=Sd(d);c!==void 0&&(a[l]=c)}return{heapBudgetEnabled:!n&&i.enabled!==!1,retainedEnabled:!n&&u.enabled!==!1,budgetMb:Sd(e[X$])??Sd(i.budgetMb)??G3,services:a}}s(ns,"Qs"),o(ns,"resolvePodRuleThresholds");function Y3(e=process.cwd(),t=process.env){let r=e;for(let i=0;i<8;i++){let u=J$(r,".lensmcp","config.json");if(Z$(u))try{let a=JSON.parse(L$(u,"utf8"));return ns(t,a?.perfRules)}catch{return ns(t,void 0)}let n=V$(r);if(n===r)break;r=n}return ns(t,void 0)}s(Y3,"Lm"),o(Y3,"loadPodRuleThresholds");var Wr=o((e,t,r)=>`${e}\0${t}\0${r}`,"key"),Ve=o(e=>Math.round(e/X3),"mb"),Fd=0,eB=o(()=>(Fd=(Fd+1)%65535,`perf-${Date.now().toString(36)}${Fd.toString(36)}${Math.random().toString(36).slice(2,7)}`),"eventId"),tB=class{static{s(this,"wo")}static{o(this,"PerfRuleBook")}constructor(e={}){this.options=e,this.findings=new Map,this.pods=new Map,this.heard=!1,this.thresholds=e.thresholds??Y$,this.now=e.now??Date.now}ingest(e){return e.source==="perf"?this.ingestRule(e):e.source==="memory"?this.ingestPod(e):!1}ingestRule(e){let t=a3(e.raw);if(!t||t.rule.startsWith("pod/"))return!1;let r=!this.heard;if(this.heard=!0,t.kind==="perf-rule-scan"){let n=!1,a=new Set(t.open);for(let[l,d]of this.findings)d.rule===t.rule&&d.project===t.project&&!a.has(d.subject)&&(this.findings.delete(l),n=!0);return n||r}let i=Wr(t.rule,t.project,t.subject);if(t.kind==="perf-rule-retracted")return this.findings.delete(i)||r;let u=this.findings.get(i);return this.findings.set(i,{rule:t.rule,project:t.project,subject:t.subject,severity:t.severity,title:t.title,summary:t.summary,evidence:t.evidence,cost:t.cost,fix:t.fix,verify:t.verify,docs:t.docs,firstSeenAt:u?.firstSeenAt??e.timestamp,lastSeenAt:Math.max(e.timestamp,u?.lastSeenAt??0)}),this.bound(),!0}projectPods(e,t,r){let i=this.pods.get(e);if(!i&&(i={service:t,lastSeenAt:r,readings:new Map,retained:new Map},this.pods.set(e,i),this.pods.size>W$)){let u=[...this.pods.entries()].sort((n,a)=>n[1].lastSeenAt-a[1].lastSeenAt)[0];u&&u[0]!==e&&(this.pods.delete(u[0]),this.close(Wr(Lt,u[0],u[1].service),"evicted",r),this.close(Wr(Vt,u[0],u[1].service),"evicted",r))}return i.service=t||i.service,i.lastSeenAt=Math.max(i.lastSeenAt,r),i}ingestPod(e){let t=Hn(e.raw);if(!t)return!1;let r=e.timestamp,i=this.projectPods(t.project,t.service||t.project,r),u=`${t.pod}:${t.pid}`;if(t.kind==="pod-memory"){if(t.previousAlive!==!0&&i.readings.set(u,this.reading(t,r)),t.trigger==="boot"){for(let d of[...i.readings.keys()])d.startsWith(`${t.pod}:`)&&d!==u&&i.readings.delete(d);for(let d of[...i.retained.keys()])d.startsWith(`${t.pod}:`)&&!d.startsWith(`${u}:`)&&i.retained.delete(d)}if(i.readings.size>G$){let d=[...i.readings.entries()].sort((c,p)=>c[1].at-p[1].at)[0];d&&i.readings.delete(d[0])}}else if(t.kind==="pod-memory-retained"){i.retained.set(`${u}:${t.gen}`,this.retainedOf(t,r));let d=[...i.retained.keys()].filter(c=>c.startsWith(`${u}:`));d.length>K$&&i.retained.delete(d[0])}else if(t.kind==="pod-memory-released")i.retained.delete(`${u}:${t.gen}`);else if(t.kind==="pod-memory-exited"){i.readings.delete(u);for(let d of[...i.retained.keys()])d.startsWith(`${u}:`)&&i.retained.delete(d)}let n=!this.heard;this.heard=!0;let a=this.evaluateHeap(t.project,i,r),l=this.evaluateRetained(t.project,i,r);return a||l||n}reading(e,t){return{pod:e.pod,pid:e.pid,service:e.service||e.project,at:e.at??t,trigger:e.trigger,gen:e.gen,swaps:e.swaps,live:e.live,reserved:e.reserved,rss:e.rss,...e.baseline!==void 0?{baseline:e.baseline}:{}}}retainedOf(e,t){return{pod:e.pod,pid:e.pid,gen:e.gen,at:t,ageMs:e.ageMs,swapsSinceClose:e.swapsSinceClose,gcs:e.gcs,alive:Array.isArray(e.alive)?e.alive.slice(0,8):[],...e.counts?{counts:e.counts}:{},live:e.live}}budgetFor(e,t){return this.thresholds.services[t]??this.thresholds.services[e]??this.thresholds.budgetMb}related(e){return[...this.findings.values()].filter(t=>t.project===e&&!t.rule.startsWith("pod/")).map(t=>`${t.rule}: ${t.title}`)}evaluateHeap(e,t,r){let i=t.service,u=Wr(Lt,e,i),n=this.findings.get(u);if(!this.thresholds.heapBudgetEnabled)return n?this.close(u,"disabled",r):!1;let a=this.budgetFor(e,t.service),l=a*X3,d=[...t.readings.values()].sort((g,E)=>E.live-g.live),c=d.filter(g=>g.live>l),p=d.some(g=>g.live>l*K3);if(c.length===0&&!(n&&p))return n?this.close(u,d.length?"cleared":"pod-exited",r):!1;if(c.length===0)return!1;let m=c[0],f=c.reduce((g,E)=>g+(E.live-l),0),h={rule:Lt,project:e,subject:i,severity:m.live>=2*l?"error":"warning",title:`${t.service}: ${Ve(m.live)} MB live heap after a full GC \u2014 over its ${a} MB budget${c.length>1?` (${c.length} pods)`:""}`,summary:`Pod #${m.pod} of ${t.service} holds ${Ve(m.live)} MB of live objects right after a full GC (${Ve(m.reserved)} MB reserved, rss ${Ve(m.rss)} MB${m.baseline!==void 0?`; ${Ve(m.baseline)} MB at boot`:""}, generation ${m.gen} after ${m.swaps} swap${m.swaps===1?"":"s"}). That is not garbage: it is what the app keeps, in every pod of the service.`,evidence:{budgetMb:a,pods:c.map(g=>({pod:g.pod,pid:g.pid,liveMb:Ve(g.live),reservedMb:Ve(g.reserved),rssMb:Ve(g.rss),...g.baseline!==void 0?{baselineMb:Ve(g.baseline)}:{},gen:g.gen,swaps:g.swaps,trigger:g.trigger,at:g.at})),related:this.related(e)},cost:{bytes:f,memoryMb:Ve(f),basis:`live heap after a full GC above the ${a} MB budget, summed over the pods over it`},fix:[`See what the heap is made of: \`memory.explain_pod({ service: '${t.service}' })\`, then \`lensmcp mem ${t.service} --snapshot --analyze\` \u2014 read "bytes by package/module" and the largest retainers.`,`If one shared library dominates (FoodGuard: ~300 MB of zod schemas per pod from a contracts barrel), import it by subpath \u2014 see any bundle/heavy-barrel-import finding for ${e} \u2014 and build large schema catalogs lazily (a function that builds on first use), not at module load.`,"If the bundle text dominates (eval strings, source maps), keep the default `eval` devtool and no `--enable-source-maps` (LENSMCP_DEV_DEVTOOL unset).",`If the heap grows with each swap or request, it is retention, not size: look for module-level caches, registries and listeners that outlive a request (\`memory.explain_leak\`). A service that genuinely needs more raises its budget: \`.lensmcp/config.json\` perfRules["pod/heap-budget"].services["${t.service}"].`],verify:`After the change rebuilds and the pod swaps, its next post-GC report (\`memory.pods\`) shows live heap under ${Math.round(a*K3)} MB and LensMCP retracts this finding (\`observe_current_status\` no longer lists pod/heap-budget for ${t.service}).`,docs:n3[Lt],firstSeenAt:n?.firstSeenAt??r,lastSeenAt:r};return this.open(u,h,n)}evaluateRetained(e,t,r){let i=t.service,u=Wr(Vt,e,i),n=this.findings.get(u),a=[...t.retained.values()].sort((p,m)=>m.ageMs-p.ageMs);if(!this.thresholds.retainedEnabled||a.length===0)return n?this.close(u,this.thresholds.retainedEnabled?"released":"disabled",r):!1;let l=a[0],d=Math.max(1,Math.round(l.ageMs/6e4)),c={rule:Vt,project:e,subject:i,severity:"warning",title:`${t.service}: ${a.length===1?`generation ${l.gen} is`:`${a.length} closed generations are`} still in memory ${d} min after the hot swap that closed ${a.length===1?"it":"them"}`,summary:`Pod #${l.pod} closed generation ${l.gen} ${d} min ago, ${l.swapsSinceClose} swap(s) and ${l.gcs} full GC(s) since, and ${l.alive.join(", ")||"its objects"} ${l.alive.length===1?"is":"are"} still alive: something still points into the old app \u2014 a whole copy of it stays resident with every swap that leaks.`,evidence:{generations:a.slice(0,8).map(p=>({pod:p.pod,pid:p.pid,gen:p.gen,ageMs:p.ageMs,swapsSinceClose:p.swapsSinceClose,gcs:p.gcs,alive:p.alive,...p.counts?{counts:p.counts}:{},liveMb:Ve(p.live)}))},cost:{basis:"one copy of the app per retained generation; its size is in the heap snapshot (`lensmcp mem --snapshot --analyze`)"},fix:[`Find what holds it: \`lensmcp mem ${t.service} --snapshot --analyze\` prints the shortest path from the GC roots to generation ${l.gen} \u2014 the first frame outside your app's own objects is the culprit.`,"Usual culprits: a timer or interval never cleared on shutdown; a BullMQ worker, queue event or Redis client never closed in onModuleDestroy / onApplicationShutdown; `process.on(\u2026)` / an EventEmitter listener added per app instance; a module-level registry, cache or singleton keyed by class or holding app instances.","Release it in the app's shutdown hooks (Nest calls them on every hot swap), or move the module-level state into a provider the container owns."],verify:'Save a file to swap again; within ~5 min the pod reports "generation N freed" (`memory.pods`), LensMCP retracts this finding, and `memory://leaks/suspected` no longer lists the generation.',docs:n3[Vt],firstSeenAt:n?.firstSeenAt??r,lastSeenAt:r};return this.open(u,c,n)}open(e,t,r){return this.findings.set(e,t),this.bound(),(!r||r.title!==t.title||r.severity!==t.severity)&&this.emit(t,"finding"),!0}close(e,t,r){let i=this.findings.get(e);return i?(this.findings.delete(e),this.emit({...i,lastSeenAt:r},"retracted",t),!0):!1}emit(e,t,r){let i=this.options.publish;if(!i)return;let u=this.options.sessionId??"pending",n=this.now(),a={id:eB(),sessionId:u,timestamp:n,source:"perf",category:"performance",severity:t==="finding"?e.severity:"info",context:{sessionId:u,projectName:e.project},fingerprint:s3(e.rule,e.project,e.subject),title:t==="finding"?`${e.rule}: ${e.title}`:`${e.rule}: cleared for ${e.project} (${e.subject})`,raw:t==="finding"?{kind:"perf-rule-finding",rule:e.rule,project:e.project,subject:e.subject,severity:e.severity,title:e.title,summary:e.summary,evidence:e.evidence,cost:e.cost,fix:e.fix,verify:e.verify,docs:e.docs,detectedAt:n}:{kind:"perf-rule-retracted",rule:e.rule,project:e.project,subject:e.subject,reason:r??"cleared",at:n}};queueMicrotask(()=>{try{i(a)}catch{}})}bound(){if(this.findings.size<=H3)return;let e=[...this.findings.entries()].sort((t,r)=>t[1].lastSeenAt-r[1].lastSeenAt).slice(0,this.findings.size-H3);for(let[t]of e)this.findings.delete(t)}openFindings(){return[...this.findings.values()].sort((e,t)=>e.severity===t.severity?t.lastSeenAt-e.lastSeenAt:e.severity==="error"?-1:1)}report(e){let t=this.openFindings(),r={};for(let i of t)r[i.rule]=(r[i.rule]??0)+1;return{schemaVersion:1,revision:e,updatedAt:new Date(this.now()).toISOString(),producer:this.heard?"connected":"none",detail:this.heard?t.length?`${t.length} open performance finding${t.length===1?"":"s"}: ${Object.entries(r).map(([i,u])=>`${u} ${i}`).join(", ")}`:"no open performance findings":"no performance rule has reported yet \u2014 rules run after a dev-cluster compilation (bundle/*) and on pod memory reports (pod/*); start the gateway",findings:t,counts:r}}};function Q3(e,t=700){let r=e.fix.map((i,u)=>`${u+1}) ${i}`).join(" ");return r.length>t?`${r.slice(0,t-40).trimEnd()}\u2026 (all steps: ${Le})`:r}s(Q3,"Fm"),o(Q3,"compactFix");var ey=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0,"asRecord"),ty=o(e=>Array.isArray(e)?e.length:void 0,"arrayLen"),bt=o(e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,"asCount"),Te=o(e=>typeof e=="string"?e:void 0,"asString");function pe(e,...t){for(let r of t){let i=ty(e[r])??bt(e[r]);if(i!==void 0)return i}}s(pe,"me"),o(pe,"countOf");var fe=o((e,t,r=`${t}s`)=>`${e} ${e===1?t:r}`,"plural");function ss(e,t,r,i,u){if(t>0)return{state:"failed",count:t,detail:`${fe(t,`${i} error`)} \u2014 read ${u}`};if(r>0)return{state:"warning",count:r,detail:fe(r,`${i} warning`)};let n=Te(e.status);return n==="clean"||n==="passed"?{state:"passed",count:0,detail:`${i} clean`}:{state:"unknown",detail:`${i} has not reported a result yet (status=${n??"absent"})`}}s(ss,"Bm"),o(ss,"fromStatusField");var as=[{kind:"typecheck",resource:"typecheck://current",reads:o(()=>["typecheck://errors"],"reads"),blocking:!0,source:"typescript",read:o(e=>ss(e,pe(e,"errorCount","errors")??0,0,"typecheck","typecheck://errors"),"read")},{kind:"lint",resource:"lint://current",reads:o(e=>e==="warning"?["lint://warnings"]:["lint://errors"],"reads"),blocking:!0,source:"eslint",read:o(e=>ss(e,pe(e,"errorCount","errors")??0,pe(e,"warningCount","warnings")??0,"lint","lint://errors"),"read")},{kind:"build",resource:"build://current",reads:o(e=>e==="warning"?["build://current"]:["build://failures"],"reads"),blocking:!0,source:"vite",read:o(e=>{let t=Array.isArray(e.failures)?e.failures.filter(u=>{let n=u?.domain;return n!=="typecheck"&&n!=="lint"}).length:pe(e,"failures","failureCount")??0,r=(ty(e.failures)??t)-t,i=t===0&&r>0&&Te(e.status)==="failing"?{...e,status:"clean"}:e;return ss(i,t,pe(e,"warnings","warningCount")??0,"build","build://failures")},"read")},{kind:"runtime",resource:"runtime://browser/errors",reads:o(()=>["runtime://browser/errors","runtime://browser/failed-requests"],"reads"),blocking:!0,source:"client-runtime",read:o(e=>{let t=pe(e,"count","entries")??0;return t>0?{state:"failed",count:t,detail:`${fe(t,"browser runtime error")} \u2014 read runtime://browser/errors`}:{state:"unknown",count:0,detail:"no browser runtime errors recorded (a browser may never have connected)"}},"read")},{kind:"runtime",resource:"runtime://errors",reads:o(()=>["runtime://errors"],"reads"),blocking:!0,source:"nestjs",read:o(e=>{let t=pe(e,"count","entries")??0,r=Array.isArray(e.entries)?e.entries.filter(u=>u?.outcome==="declared").length:0,i=r>0?` (${t-r} unhandled, ${r} a 5xx the app answered on purpose)`:"";return t>0?{state:"failed",count:t,detail:`${fe(t,"server-side error")}${i} \u2014 read runtime://errors (route, status, request id and stack)`}:{state:"unknown",count:0,detail:"no server-side errors recorded (no pod may have handled a request yet)"}},"read")},{kind:"cluster",resource:"process://cluster",reads:o(()=>["process://cluster"],"reads"),blocking:!0,source:"gateway",read:o(e=>{if((pe(e,"services")??0)===0)return{state:"unknown",detail:"no cluster lifecycle events seen (the gateway may not be running)"};let t=pe(e,"crashLooping")??0,r=pe(e,"wedged")??0,i=pe(e,"buildFailed")??0,u=pe(e,"typeErrors")??0,n=u>0?`${fe(u,"service")} with type errors no typecheck producer reports`:void 0,a=pe(e,"down")??0,l=bt(e.restarts)??0,d=Array.isArray(e.services)?e.services.filter(h=>{let g=h??{};return g.buildFailed===!0&&g.state==="up"}).length:0,c=Math.max(0,i-d),p=d>0?`${fe(d,"service")} failing to build while still serving the last good bundle`:void 0,m=[p,n?`${n} (still serving)`:void 0].filter(Boolean);if(t>0||r>0||c>0){let h=[t>0?`${fe(t,"service")} crash-looping`:void 0,r>0?`${fe(r,"service")} wedged`:void 0,c>0?`${fe(c,"service")} failing to build`:void 0].filter(Boolean);return{state:"failed",count:t+r+i+u,detail:`${h.join(", ")} \u2014 read process://cluster (requests to them 502)${m.length?`; ${m.join("; ")}`:""}`}}if(p)return{state:"failed",count:i+u,detail:`${p} \u2014 read process://cluster for the error lines${n?`; ${n} (still serving)`:""}`};if(n)return{state:"failed",count:u,detail:`${n} \u2014 read process://cluster for the lines (the bundle built; the services still serve)`};if(a>0)return{state:"warning",count:a,detail:`${fe(a,"service")} down (idle scale-to-zero is normal; the next request restarts it)`};let f=pe(e,"up")??0;return{state:"passed",count:0,detail:`${fe(f,"service")} up${l>0?`, ${fe(l,"restart")} this session`:""}`}},"read")},{kind:"memory",resource:"memory://leaks/suspected",reads:o(()=>["memory://leaks/suspected","memory://owners/growing"],"reads"),blocking:!1,source:"memory",read:o(e=>{let t=pe(e,"suspected","leaks")??0;return t>0?{state:"warning",count:t,detail:`${fe(t,"suspected leak")} \u2014 read memory://leaks/suspected`}:{state:"passed",count:0,detail:"no suspected leaks"}},"read")},{kind:"visual",resource:"visual://violations/current",reads:o(()=>["visual://violations/current"],"reads"),blocking:!1,source:"visual",read:o(e=>{let t=pe(e,"violations")??0;return t>0?{state:"warning",count:t,detail:`${fe(t,"visual violation")} \u2014 read visual://violations/current`}:{state:"passed",count:0,detail:"no visual violations"}},"read")},{kind:"perf",resource:"perf://slow-routes",reads:o(()=>["perf://slow-routes"],"reads"),blocking:!1,source:"perf",read:o(e=>{let t=pe(e,"routes")??0,r=bt(e.thresholdMs);return t>0?{state:"warning",count:t,detail:`${fe(t,"route")} over${r?` ${r}ms`:" the slow-route threshold"} \u2014 read perf://slow-routes`}:{state:"passed",count:0,detail:"no slow routes"}},"read")},{kind:"duplicate-requests",resource:"perf://duplicate-requests",reads:o(()=>["perf://duplicate-requests"],"reads"),blocking:!1,source:"perf",read:o(e=>{let t=pe(e,"endpoints")??0,r=bt(e.peakThreshold);return t>0?{state:"warning",count:t,detail:`${fe(t,"endpoint")} called ${r?`\u2265${r}\xD7`:"several times"} concurrently by one page \u2014 read perf://duplicate-requests`}:{state:"passed",count:0,detail:"no duplicated requests"}},"read")},{kind:"db",resource:"db://slow-queries",reads:o(()=>["db://slow-queries","db://analysis"],"reads"),blocking:!1,source:"db",read:o(e=>{let t=pe(e,"queries")??0,r=bt(e.thresholdMs);return t>0?{state:"warning",count:t,detail:`${fe(t,"query shape")} over${r?` ${r}ms`:" the slow-query threshold"} \u2014 read db://slow-queries`}:{state:"passed",count:0,detail:"no slow query shapes"}},"read")},{kind:"egress",resource:"net://egress/hosts",reads:o(e=>e==="warning"?["net://egress/hosts","net://egress/failures"]:["net://egress/hosts"],"reads"),blocking:!1,source:"external",read:o(e=>{let t=pe(e,"failingHosts")??0,r=pe(e,"slowHosts")??0,i=bt(e.thresholdMs);return t>0?{state:"warning",count:t,detail:`${fe(t,"external host")} failing \u2014 read net://egress/failures`}:r>0?{state:"warning",count:r,detail:`${fe(r,"external host")} over${i?` ${i}ms`:" the slow-egress threshold"} \u2014 read net://egress/hosts`}:{state:"passed",count:0,detail:"no failing or slow external calls"}},"read")},{kind:"perf-rules",resource:Le,reads:o(()=>[Le],"reads"),blocking:!1,source:"perf",read:o(e=>{let t=pe(e,"findings")??0;return t>0?{state:"warning",count:t,detail:`${fe(t,"performance finding")} \u2014 read ${Le} (each has a fix and a verify step)`}:{state:"passed",count:0,detail:"no open performance findings"}},"read"),items:o(e=>{let t=(Array.isArray(e.findings)?e.findings:[]).map(ey).filter(i=>!!i),r=t.slice(0,jd).map(i=>{let u=Te(i.rule)??"perf",n=Te(i.project)??"?",a=Te(i.subject)??"?",l=Array.isArray(i.fix)?i.fix.filter(d=>typeof d=="string"):[];return{source:"perf",severity:"warning",title:`${u} \xB7 ${Te(i.title)??n}`,fingerprint:`agent-status:perf-rule:${u}:${n}:${a}`,resource:Le,rule:u,...l.length?{fix:Q3({fix:l})}:{},...Te(i.verify)?{verify:Te(i.verify)}:{},...Te(i.docs)?{docs:Te(i.docs)}:{}}});return t.length>jd&&r.push({source:"perf",severity:"warning",title:`${fe(t.length-jd,"more performance finding")} \u2014 read ${Le}`,fingerprint:"agent-status:perf-rules:more",resource:Le}),r},"items")}],jd=5,uy=new WeakMap,U_=as.map(e=>e.resource);async function ry(e,t){let r={kind:t.kind,resource:t.resource},i;try{i=ey(await e.read(t.resource))}catch{return{...r,producer:"none",state:"unknown",detail:`no producer for ${t.resource} \u2014 this signal is unmonitored, not healthy`,reads:t.reads("unknown")}}if(!i)return{...r,producer:"none",state:"unknown",detail:`${t.resource} produced no readable payload`,reads:t.reads("unknown")};let u=Te(i.producer),n=(e.revision(t.resource)??0)>0,a=u==="none"?"none":u==="connected"||n?"connected":"none",l=Te(i.detail);if(a==="none")return{...r,producer:a,state:"unknown",detail:l??(u==="none"?`${t.resource} reports no producer attached \u2014 this signal is unmonitored, not healthy`:`${t.resource} is registered but has never reported \u2014 this signal is unmonitored, not healthy`),reads:t.reads("unknown")};let d;try{d=t.read(i)}catch{d={state:"unknown",detail:`${t.resource} payload could not be interpreted`}}let c=i.stale===!0,p=c?`${d.detail} (as of ${bt(i.ageMs)!==void 0?iy(bt(i.ageMs)):"a while ago"}; nothing has re-checked since)`:d.detail,m={...r,producer:a,state:d.state,...d.count===void 0?{}:{count:d.count},...c?{stale:!0}:{},detail:p,reads:t.reads(d.state)};if(t.items&&(d.state==="warning"||d.state==="failed"))try{let f=t.items(i);f.length&&uy.set(m,f)}catch{}return m}s(ry,"XT"),o(ry,"readSignal");function iy(e){return e<6e4?`${Math.max(1,Math.round(e/1e3))}s ago`:e<36e5?`${Math.round(e/6e4)}m ago`:`${Math.round(e/36e5)}h ago`}s(iy,"HT"),o(iy,"describeAge");async function zd(e){return Promise.all(as.map(t=>ry(e,t)))}s(zd,"ta"),o(zd,"readSignals");var Gr=o(e=>as.find(t=>t.resource===e.resource)??as.find(t=>t.kind===e.kind),"specFor");function ny(e){return{source:Gr(e).source,severity:e.state==="failed"?"error":"warning",title:e.detail,fingerprint:`agent-status:${e.kind}:${e.state}`,resource:e.reads[0]??e.resource}}s(ny,"YT"),o(ny,"toItem");function sy(e){let t={failed:3,warning:2,unknown:1,passed:0},r=o(n=>{let a=e.filter(l=>l.kind===n);return a.length===0?"unknown":a.reduce((l,d)=>t[d.state]>t[l]?d.state:l,a[0].state)},"pick"),i=o(n=>n==="failed"?"failed":n==="passed"||n==="warning"?"passed":"unknown","tri"),u=o(n=>n,"quad");return{typecheck:i(r("typecheck")),lint:i(r("lint")),build:i(r("build")),runtime:u(r("runtime")),visual:u(r("visual")),memory:u(r("memory"))}}s(sy,"QT"),o(sy,"toChecks");function ay(e){let t=e.filter(p=>p.state==="failed"),r=e.filter(p=>p.state==="warning"),i=e.filter(p=>p.state==="passed"),u=o(p=>uy.get(p)??[ny(p)],"itemsOf"),n=t.filter(p=>Gr(p).blocking).flatMap(u),a=[...t.filter(p=>!Gr(p).blocking),...r].flatMap(u),l=n.length>0?"failing":a.length>0?"warning":i.length>0?"clean":"starting",d=[...t.filter(p=>Gr(p).blocking).flatMap(p=>p.reads),...t.filter(p=>!Gr(p).blocking).flatMap(p=>p.reads),...r.flatMap(p=>p.reads)],c=[...new Set(d)];return c.length===0&&c.push("events://recent"),{status:l,blocking:n,warnings:a,suggestedReads:c,checks:sy(e)}}s(ay,"Q$"),o(ay,"deriveVerdict");function oy(e=process.env){let t=e.LENSMCP_TRANSPORT==="http"||e.LENSMCP_TRANSPORT==="socket",r=e.LENSMCP_PORT;return{mode:t?"shared":"embedded",pid:process.pid,startedAt:new Date(Date.now()-Math.round(process.uptime()*1e3)).toISOString(),...t&&r?{url:`http://127.0.0.1:${r}/mcp`}:{}}}s(oy,"eA"),o(oy,"readServerInfo");async function os(e){let t=await zd(e.resources),r=ay(t);return{schemaVersion:1,revision:e.revision,updatedAt:new Date().toISOString(),sessionId:e.sessionId,server:oy(),status:r.status,blocking:r.blocking,warnings:r.warnings,suggestedReads:r.suggestedReads,checks:r.checks,signals:t}}s(os,"cr"),o(os,"aggregateStatus");var Nd="agent://current-status",Md=class extends q${static{s(this,"Vm")}static{o(this,"AgentCurrentStatusResource")}async execute(){let e=this.get(Z);try{return await e.read(Nd)}catch{}let t=this.get(qr);return os({resources:e,sessionId:t.id,revision:e.revision(Nd)??0})}};Md=F([U$({name:"agent-current-status",uri:Nd,mimeType:"application/json",description:'Workspace health in one read: status (clean/warning/failing/starting), what is BLOCKING (typecheck/lint/build errors, browser runtime errors, wedged or crash-looping services), warnings, and the exact resources to read next. Signals with no producer report `producer: "none"` \u2014 unmonitored, not healthy.'})],Md);var uB=Md;import{Resource as rB,ResourceContext as iB}from"@frontmcp/sdk";var Od=class extends iB{static{s(this,"Jm")}static{o(this,"ProcessClusterResource")}async execute(){return this.get(Z).read("process://cluster")}};Od=F([rB({name:"process-cluster",uri:"process://cluster",mimeType:"application/json",description:"Dev-cluster service health: which services are up / down / wedged / crash-looping, which fail to build, restart counts, and the error lines services printed (ERROR in, EADDRINUSE, and error TS\u2026 for a project no typecheck producer reports for \u2014 otherwise type errors are in typecheck://errors). Read this when a request 502s or a dev server stopped responding."})],Od);var nB=Od;import{Resource as sB,ResourceContext as aB}from"@frontmcp/sdk";var Rd=class extends aB{static{s(this,"Wm")}static{o(this,"PerfRulesResource")}async execute(){return this.get(Z).read("perf://rules")}};Rd=F([sB({name:"perf-rules",uri:"perf://rules",mimeType:"application/json",description:"Performance problems the lens detected by rule, each with a stable rule id, the measured evidence, the estimated cost (modules / MB / compile ms), the FIX steps and a VERIFY step: bundle/heavy-barrel-import (a service compiles most of a shared library through its root barrel while using a few symbols), pod/heap-budget (a dev pod's live heap after GC is over its budget), pod/retained-generation (a hot-swapped app copy is still in memory). A finding is retracted when the next build or memory report no longer shows it \u2014 that is how to prove a fix."})],Rd);var oB=Rd;import{Tool as lB,ToolContext as dB}from"@frontmcp/sdk";var ly=["typecheck","lint","build","runtime","cluster"],cB=[...ly,"all"],pB={typecheck:[{signal:"typecheck://current",resource:"typecheck://errors",keys:["errors"],hint:"TypeScript diagnostics from the watching tsc. Already computed \u2014 no need to run `nx typecheck`."}],lint:[{signal:"lint://current",resource:"lint://errors",keys:["errors"],hint:"ESLint errors from the watching lint pass. Already computed \u2014 no need to run `nx lint`."}],build:[{signal:"build://current",resource:"build://failures",keys:["failures"],hint:"Bundler/compile failures. The dev server is serving a stale or broken bundle until these clear."}],runtime:[{signal:"runtime://browser/errors",resource:"runtime://browser/errors",keys:["entries"],hint:"Uncaught errors from the browser. Pair with flow_list_recent to see what the user did first."},{signal:"runtime://errors",resource:"runtime://errors",keys:["entries"],hint:"Errors a dev service raised while handling a request (a 500 from a curl, an e2e runner or the page) \u2014 route, status, request id and stack. No browser is involved."}],cluster:[{signal:"process://cluster",resource:"process://cluster",keys:["errors"],hint:"Error lines printed by dev services (ERROR in / EADDRINUSE; error TS only for a project no typecheck producer reports for). A wedged or crash-looping service 502s every request routed to it."}]},mB=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0,"asRecord");async function dy(e,t){let r;try{r=mB(await e.read(t.resource))}catch{return[]}if(!r)return[];for(let i of t.keys){let u=r[i];if(Array.isArray(u))return u}return[]}s(dy,"uA"),o(dy,"readItems");async function cy(e){let t=e.kind==="all"?ly:[e.kind],r=await zd(e.resources),i=new Map(r.map(n=>[n.resource,n])),u=[];for(let n of t)for(let a of pB[n]){let l=i.get(a.signal),d=l?.producer??"none",c=l?.state??"unknown",p=d==="none"?[]:await dy(e.resources,a);u.push({kind:n,resource:a.resource,producer:d,state:c,count:p.length,returned:Math.min(p.length,e.limit),items:p.slice(0,e.limit),detail:l?.detail??`no producer for ${a.resource} \u2014 unmonitored, not healthy`,hint:a.hint})}return{kind:e.kind,totalErrors:u.reduce((n,a)=>n+a.count,0),unmonitored:[...new Set(u.filter(n=>n.producer==="none").map(n=>n.kind))],groups:u}}s(cy,"Qm"),o(cy,"collectErrors");var py={name:"observe.current_status",description:'Workspace health in one call: whether anything is BLOCKING right now (typecheck errors, lint errors, build failures, browser runtime errors, wedged or crash-looping dev services), plus warnings and the exact resources to read next. Warnings include PERFORMANCE problems found by rule (a service compiling a whole shared library through its root barrel, a dev pod over its heap budget, a hot-swapped app copy still in memory), each with its rule id, a fix and how to verify it. Call this FIRST when a build, dev server, or page looks broken \u2014 and before running `nx typecheck` / `nx lint` for a project the dev cluster already watches, because those results are already computed here. Signals reporting `producer: "none"` are UNMONITORED, not healthy. Use observe.errors for the individual error items.'},Jt={name:"observe.errors",description:"The actual error items the lens already computed: TypeScript diagnostics, ESLint errors, build failures, uncaught browser errors, server-side request errors (a dev service's 500: route, status, stack), and error lines printed by dev services (ERROR in\u2026, error TS\u2026, EADDRINUSE). Filter with `kind`. Prefer this over running `nx typecheck` / `nx lint` or tailing a dev-server log for a project the dev cluster watches: the watching producers already have the answer, so this costs one call instead of a rebuild. Each group reports `producer` \u2014 `none` means nothing is feeding that check, so an empty list there is NOT proof it is clean.",kinds:cB,defaultKind:"all",defaultLimit:25,maxLimit:200},ls={name:"observe.dismiss_errors",description:"Hide runtime errors that are already UNDERSTOOD and are not a problem to fix \u2014 a 401 your own signed-out test browser caused, a failure from a fixture that exists to throw \u2014 so they stop counting in observe.current_status and the Stop hook. Give the entry `ids` from observe.errors (kind `runtime`), or `all: true`, and a `reason`: it is recorded with the dismissal and shown to the person in the dashboard. This HIDES, it does not fix: each error shows again the next time it happens. It cannot dismiss a failing typecheck, lint, build or a broken service \u2014 those are current verdicts and clear only when the code is fixed. Never dismiss an error you have not explained; undo with observe.restore_errors.",maxIds:250,minReasonChars:8},Td={name:"observe.restore_errors",description:"Undo a dismissal, so the errors it hid are listed and counted again. Give the dismissal `ids` from runtime://dismissed (or the id of an entry it hid), or `all: true` for every dismissal in effect \u2014 including ones a person made in the dashboard.",maxIds:250},my="agent://current-status",Pd=class extends dB{static{s(this,"th")}static{o(this,"ObserveCurrentStatusTool")}async execute(){let e=this.get(Z);try{return await e.read(my)}catch{}let t=this.get(qr);return os({resources:e,sessionId:t.id,revision:e.revision(my)??0})}};Pd=F([lB({name:py.name,description:py.description,inputSchema:{}})],Pd);var fB=Pd;import{Tool as hB,ToolContext as gB,z as fy}from"@frontmcp/sdk";var Ud=class extends gB{static{s(this,"nh")}static{o(this,"ObserveErrorsTool")}async execute(e){let t=this.get(Z);return cy({resources:t,kind:e.kind,limit:e.limit})}};Ud=F([hB({name:Jt.name,description:Jt.description,inputSchema:{kind:fy.enum(Jt.kinds).default(Jt.defaultKind).describe("Which failures to return. 'runtime' = browser errors AND a service's own request errors (the 500 case); 'cluster' = dev-service/pod errors (the 502 case). Default 'all'."),limit:fy.number().int().positive().max(Jt.maxLimit).default(Jt.defaultLimit).describe(`Max items per kind (default ${Jt.defaultLimit}). \`count\` still reports the true total.`)}})],Ud);var vB=Ud;import{Tool as yB,ToolContext as EB,z as Kr}from"@frontmcp/sdk";import{appendFileSync as bB,closeSync as wB,mkdirSync as DB,openSync as $B,renameSync as BB,statSync as xB,unlinkSync as CB}from"node:fs";import{dirname as kB,join as AB}from"node:path";function hy(e,t){let{fs:r,maxBytes:i,maxFiles:u}=t,n=`${e}.rotate.lock`,a=t.staleLockMs??3e4,l;for(let d=0;d<2&&l===void 0;d++)try{l=r.openSync(n,"wx")}catch{try{if(Date.now()-r.statSync(n).mtimeMs<=a)return"busy";r.unlinkSync(n)}catch{}}if(l===void 0)return"busy";try{try{if(r.statSync(e).size<=i)return"not-needed"}catch{return"not-needed"}try{r.unlinkSync(`${e}.${u}`)}catch{}for(let d=u-1;d>=1;d--)try{r.renameSync(`${e}.${d}`,`${e}.${d+1}`)}catch{}try{r.renameSync(e,`${e}.1`)}catch{}return"rotated"}finally{try{r.closeSync(l)}catch{}try{r.unlinkSync(n)}catch{}}}s(hy,"r_"),o(hy,"rotateBusFile");function gy(e=process.env,t=process.cwd()){return e.LENSMCP_EVENT_FILE??AB(t,".lensmcp","events.jsonl")}s(gy,"o_"),o(gy,"lensEventFile");var vy=o((e,t,r,i,u)=>({id:lt(),sessionId:e,timestamp:t,source:i3,category:"runtime",severity:"info",context:{sessionId:e},fingerprint:r,title:i,raw:u}),"lensEvent");function qd(e,t){return vy(t,e.until,`${$u}:${e.groupId}`,`error dismissed: ${e.title??e.groupId}`,{kind:$u,groupId:e.groupId,until:e.until,eventIds:e.eventIds,...e.by?{by:e.by}:{},...e.reason?{reason:e.reason}:{},...e.title?{title:e.title}:{}})}s(qd,"na"),o(qd,"dismissalEvent");function Zd(e,t,r){return vy(t,r,`${Kn}:${e}`,"error restored",{kind:Kn,groupId:e})}s(Zd,"oa"),o(Zd,"restoralEvent");var yy=o((e,t,r)=>{let i=Number(process.env[e]);return Number.isFinite(i)&&r(i)?i:t},"envNumber");function ds(e,t){t.length!==0&&(DB(kB(e),{recursive:!0}),hy(e,{maxBytes:yy("LENSMCP_EVENT_MAX_BYTES",50*1024*1024,r=>r>0),maxFiles:yy("LENSMCP_EVENT_MAX_FILES",5,r=>r>=1&&r<=20),fs:{statSync:xB,renameSync:BB,unlinkSync:CB,openSync:$B,closeSync:wB}}),bB(e,t.map(r=>JSON.stringify(r)+`
69
- `).join("")))}s(ds,"un"),o(ds,"appendBusEvents");var IB=["runtime://errors","runtime://browser/errors","runtime://browser/failed-requests"],_B="runtime://dismissed";async function Ey(e,t){let r;try{r=await e.read(t)}catch{return[]}let i=r?.entries;return Array.isArray(i)?i.flatMap(u=>{let n=u;if(!n||typeof n.id!="string"||!n.id)return[];let a=typeof n.title=="string"&&n.title?n.title:typeof n.message=="string"?n.message:n.id;return[{id:n.id,title:a,timestamp:typeof n.timestamp=="number"?n.timestamp:0}]}):[]}s(Ey,"IA"),o(Ey,"entriesOf");async function by(e,t,r=Date.now()){let i=new Set(t.ids??[]),u=[],n=r;for(let c of IB)for(let p of await Ey(e,c))!t.all&&!i.has(p.id)||u.some(m=>m.id===p.id)||(u.push({id:p.id,title:p.title,resource:c}),n=Math.max(n,p.timestamp));let a=new Set(u.map(c=>c.id)),l=t.reason.trim().slice(0,500),d=[];for(let c=0;c<u.length;c+=200){let p=u.slice(c,c+200),m=p[0]?.title??"";d.push({groupId:`events:${lt()}`,until:n,eventIds:p.map(f=>f.id),by:t.by??"agent",reason:l,title:p.length===1?m:`${p.length} errors \u2014 ${m}`})}return{drafts:d,items:u,notFound:[...i].filter(c=>!a.has(c))}}s(by,"s_"),o(by,"planDismissal");async function wy(e,t){let r;try{r=await e.read(_B)}catch{r=void 0}let i=r?.dismissals,u=(Array.isArray(i)?i:[]).flatMap(d=>{let c=d;return c&&typeof c.id=="string"?[{id:c.id,eventIds:Array.isArray(c.eventIds)?c.eventIds.filter(p=>typeof p=="string"):[]}]:[]});if(t.all)return{keys:u.map(d=>d.id),notFound:[]};let n=[...new Set(t.ids??[])],a=new Set,l=[];for(let d of n){let c=u.filter(p=>p.id===d||p.eventIds.includes(d));c.length===0&&l.push(d);for(let p of c)a.add(p.id)}return{keys:[...a],notFound:l}}s(wy,"a_"),o(wy,"planRestore");var SB="Hidden, not fixed. Each of these shows again the next time it happens, and runtime://dismissed lists what is hidden, by whom and why.",Ld=class extends EB{static{s(this,"ih")}static{o(this,"ObserveDismissErrorsTool")}async execute(e){if(!e.all&&!e.ids?.length)return{dismissed:0,items:[],notFound:[],note:"Nothing named: pass `ids` (from observe.errors, kind runtime) or `all: true`."};let t=this.get(Z),r=this.get(qr),i=await by(t,e),u=i.drafts.map(a=>qd(a,r.id)),n=process.env.LENSMCP_EVENT_FILE;if(n)ds(n,u);else for(let a of u)this.get(Zr).publish(a);return{dismissed:i.items.length,items:i.items,notFound:i.notFound,note:i.items.length?SB:"Nothing was dismissed: none of those ids is in a runtime error list right now."}}};Ld=F([yB({name:ls.name,description:ls.description,inputSchema:{ids:Kr.array(Kr.string().min(1)).max(ls.maxIds).optional().describe("Entry ids to dismiss \u2014 the `id` of items observe.errors returns for kind `runtime`."),all:Kr.boolean().optional().describe("Dismiss every runtime error currently listed (server-side, browser, failed requests)."),reason:Kr.string().min(ls.minReasonChars).describe("Why these are not a problem to fix. Recorded with the dismissal and shown to the person in the dashboard."),by:Kr.enum(["agent","cli"]).default("agent").describe("Who is dismissing. Leave as 'agent'; the lensmcp CLI passes 'cli'.")}})],Ld);var FB=Ld;import{Tool as jB,ToolContext as zB,z as Vd}from"@frontmcp/sdk";var Jd=class extends zB{static{s(this,"ch")}static{o(this,"ObserveRestoreErrorsTool")}async execute(e){if(!e.all&&!e.ids?.length)return{restored:0,notFound:[],note:"Nothing named: pass dismissal `ids` (from runtime://dismissed) or `all: true`."};let t=this.get(Z),r=this.get(qr),i=await wy(t,e),u=Date.now(),n=i.keys.map(l=>Zd(l,r.id,u)),a=process.env.LENSMCP_EVENT_FILE;if(a)ds(a,n);else for(let l of n)this.get(Zr).publish(l);return{restored:i.keys.length,notFound:i.notFound,note:i.keys.length?"Restored: what those dismissals hid is listed and counted again.":"Nothing was restored: no dismissal matches."}}};Jd=F([jB({name:Td.name,description:Td.description,inputSchema:{ids:Vd.array(Vd.string().min(1)).max(Td.maxIds).optional().describe("Dismissal ids from runtime://dismissed, or ids of entries a dismissal hid."),all:Vd.boolean().optional().describe("Undo every dismissal in effect.")}})],Jd);var NB=Jd;import{spawn as MB}from"node:child_process";import{existsSync as Wd,readFileSync as OB}from"node:fs";import{join as Dy}from"node:path";import{Job as RB,JobContext as TB,z as Ie}from"@frontmcp/sdk";import{existsSync as PB}from"node:fs";import{dirname as UB,join as qB,relative as ZB,resolve as Wt,isAbsolute as LB}from"node:path";var VB=6;function $y(e=process.env,t=process.cwd()){return Wt(e.LENSMCP_WORKSPACE_ROOT??t)}s($y,"u_"),o($y,"resolveAllowedRoot");function cs(e,t){let r=ZB(Wt(e),Wt(t));return r===""||!r.startsWith("..")&&!LB(r)}s(cs,"lh"),o(cs,"isWithinRoot");function By(e,t){let r=Wt(e);if(t===void 0)return{ok:!0,cwd:r};let i=Wt(r,t);return cs(r,i)?{ok:!0,cwd:i}:{ok:!1,reason:`cwd ${i} is outside this server's workspace (${r}). verify_fix runs a workspace-defined Nx target, so it only runs in the workspace this server was started for. Set LENSMCP_WORKSPACE_ROOT to serve a different one.`}}s(By,"l_"),o(By,"confineToWorkspace");function xy(e,t){let r=Wt(t),i=Wt(e);if(cs(r,i))for(let u=0;u<VB;u++){if(PB(qB(i,"nx.json")))return i;if(i===r)break;let n=UB(i);if(n===i||!cs(r,n))break;i=n}}s(xy,"d_"),o(xy,"findNxWorkspaceRootWithin");var JB=/^[@A-Za-z0-9][\w./-]*$/;function Cy(e){return e.length<=214&&JB.test(e)}s(Cy,"p_"),o(Cy,"isValidProjectName");var Gd=class extends TB{static{s(this,"ph")}static{o(this,"VerifyFixJob")}async execute(e){let t=Date.now(),r=e.project??process.env.LENSMCP_VERIFY_PROJECT??"example-web",i=$y(),u=By(i,e.cwd);if(!u.ok)return this.log(`[verify_fix] refused: ${u.reason}`),{status:"errored",project:r,durationMs:Date.now()-t,stages:[],reportPath:null};let n=u.cwd;if(!Cy(r))return this.log(`[verify_fix] refused: ${r} is not a valid Nx project name`),{status:"errored",project:r,durationMs:Date.now()-t,stages:[],reportPath:null};let a=xy(n,i);if(!a)return this.log(`No nx.json found between ${n} and ${i}`),{status:"errored",project:r,durationMs:Date.now()-t,stages:[],reportPath:null};let l=ky("nx",[a]);if(!l)return this.log(`Could not find node_modules/.bin/nx under ${a}`),{status:"errored",project:r,durationMs:Date.now()-t,stages:[],reportPath:null};this.log(`[verify_fix] nx run ${r}:agent-verify (cwd=${a})`);let d=MB(l,["run",`${r}:agent-verify`],{cwd:a,env:{...process.env},stdio:["ignore","pipe","pipe"]}),c=[],p=o(x=>{let $=/\[agent-verify\] ([a-z]+): (passed|failed|skipped|errored)/.exec(x);$&&$[1]&&$[2]&&(c.push({name:$[1],result:$[2],durationMs:0}),this.log(` ${$[1]}: ${$[2]}`))},"captureLine");Kd(d.stdout,p),Kd(d.stderr,p);let m=!1,f=setTimeout(()=>{m=!0;try{d.kill("SIGTERM")}catch{}},e.timeoutMs),h=await new Promise(x=>{d.on("exit",$=>x($??1))});if(clearTimeout(f),m)return{status:"timeout",project:r,durationMs:Date.now()-t,stages:c,reportPath:null};let g=Dy(a,".lensmcp","verifications","latest.json"),E;if(Wd(g))try{E=JSON.parse(OB(g,"utf-8"))}catch{E=void 0}return{status:E?.status??(h===0?"passed":"failed"),project:r,durationMs:E?.durationMs??Date.now()-t,stages:E?.stages??c,reportPath:Wd(g)?g:null}}};Gd=F([RB({name:"observe.verify_fix",description:"Run the deterministic verification loop (typecheck \u2192 lint \u2192 build) for a host project. Returns a per-stage report; suggested next read on failure is the relevant *://errors resource.",inputSchema:{project:Ie.string().describe('Nx project name in the host workspace to verify. Defaults to LENSMCP_VERIFY_PROJECT or "example-web".').optional(),cwd:Ie.string().describe("Directory to verify from. MUST be inside the workspace this server was started for (LENSMCP_WORKSPACE_ROOT, else the server's cwd); a path outside it is refused. Defaults to that workspace root.").optional(),timeoutMs:Ie.number().int().positive().default(5*6e4).describe("How long to wait for the verify pipeline before declaring it stuck.")},outputSchema:{status:Ie.enum(["passed","failed","errored","timeout"]),project:Ie.string().nullable(),durationMs:Ie.number(),stages:Ie.array(Ie.object({name:Ie.string(),result:Ie.enum(["passed","failed","skipped","errored"]),durationMs:Ie.number(),exitCode:Ie.number().optional(),summary:Ie.string().optional()})),reportPath:Ie.string().nullable()}})],Gd);var WB=Gd;function ky(e,t){for(let r of t){let i=Dy(r,"node_modules",".bin",e);if(Wd(i))return i}}s(ky,"BA"),o(ky,"locateBin");function Kd(e,t){if(!e)return;let r="";e.setEncoding("utf-8"),e.on("data",i=>{r+=typeof i=="string"?i:i.toString("utf-8");let u;for(;(u=r.indexOf(`
70
- `))!==-1;){let n=r.slice(0,u);r=r.slice(u+1),t(n)}}),e.on("end",()=>{r.length&&t(r)})}s(Kd,"f_"),o(Kd,"bufferLines");var Ay=class{static{s(this,"mh")}static{o(this,"AgentApp")}};Ay=F([P$({id:"agent",name:"Agent",description:"Agent-facing summary, suggested reads, verification.",resources:[uB,nB,oB],tools:[fB,vB,FB,NB],jobs:[WB]})],Ay);var GB={"service-starting":"starting","service-respawn":"starting","lens-app-up":"starting","service-up":"up","cold-start":"up","service-down":"down","idle-kill":"idle","service-recycle":"wedged","pod-recycle":"wedged","service-crash-loop":"crash-looping","lens-handoff-complete":"up","gateway-up":"up","gateway-down":"down","lens-child-starting":"starting","lens-child-up":"up","lens-child-exit":"down"},KB=new Set(["service-respawn","service-recycle","pod-recycle","lens-handoff-complete"]),Iy=new Set(["build","types","process"]),_y=o(e=>Iy.has(e)?e:"unknown","faultOf"),HB=class{static{s(this,"ko")}static{o(this,"ClusterHealth")}constructor(){this.services=new Map,this.errors=[],this.typechecked=new Set}ingest(e){if(e.category==="typecheck")return this.noteTypecheck(e);if(e.source!=="gateway"||e.category!=="cluster")return!1;let t=e.raw??{},r=typeof t.kind=="string"?t.kind:void 0;if(!r)return!1;let i=typeof t.project=="string"?t.project:void 0;if(!i)return!1;if(r==="service-error"){let a=_y(t.fault),l=this.touch(i,e.timestamp);if(l.faults.add(a),l.lastTitle=e.title,a==="types"&&this.typechecked.has(i))return!0;let d=typeof t.line=="string"?t.line:e.message??e.title;return this.errors.push({project:i,timestamp:e.timestamp,line:d,fingerprint:e.fingerprint,fault:a}),this.errors.length>50&&this.errors.splice(0,this.errors.length-50),!0}if(r==="service-fault-closed"){let a=this.services.get(i),l=Array.isArray(t.closed)?t.closed.filter(d=>Iy.has(d)).map(_y):[];return!a||l.length===0?!1:(a.lastSeenAt=e.timestamp,a.lastTitle=e.title,this.resolve(a,l),!0)}if(r==="service-recovered"){let a=this.services.get(i);return a?(a.lastSeenAt=e.timestamp,this.resolve(a),a.lastTitle=e.title,!0):!1}if(r==="lens-handoff-start"){let a=this.touch(i,e.timestamp);return t.oldServing!==!0&&(a.state="starting"),a.lastTitle=e.title,!0}if(r==="lens-handoff-failed"){let a=this.touch(i,e.timestamp);return t.oldKept!==!0&&(a.state="down"),a.lastTitle=e.title,!0}let u=GB[r];if(!u)return!1;let n=this.touch(i,e.timestamp);return n.state=u,n.lastTitle=e.title,KB.has(r)&&(n.restarts+=1),u==="up"&&this.resolve(n),!0}resolve(e,t){if(t)for(let i of t)e.faults.delete(i);else e.faults.clear();let r=o(i=>i.project===e.project&&(!t||t.includes(i.fault)),"gone");this.errors.splice(0,this.errors.length,...this.errors.filter(i=>!r(i)))}noteTypecheck(e){let t=e.raw??{};if(t.kind!=="typecheck-run"||t.phase!=="end"||typeof t.project!="string")return!1;let r=t.project,i=t.status==="clean"||t.status==="failing";return i===this.typechecked.has(r)?!1:(i?(this.typechecked.size>=100&&this.typechecked.delete(this.typechecked.values().next().value),this.typechecked.add(r),this.errors.splice(0,this.errors.length,...this.errors.filter(u=>!(u.project===r&&u.fault==="types")))):this.typechecked.delete(r),this.services.get(r)?.faults.has("types")??!1)}snapshot(){let e=[...this.services.values()].sort((r,i)=>r.project.localeCompare(i.project)).map(({faults:r,...i})=>({...i,buildFailed:r.has("build")||r.has("process")||r.has("unknown"),typeErrors:r.has("types")&&!this.typechecked.has(i.project)})),t=o(r=>e.filter(i=>i.state===r).map(i=>i.project),"byState");return{services:e,up:t("up"),down:t("down"),wedged:t("wedged"),crashLooping:t("crash-looping"),idle:t("idle"),buildFailed:e.filter(r=>r.buildFailed).map(r=>r.project),typeErrors:e.filter(r=>r.typeErrors).map(r=>r.project),restarts:e.reduce((r,i)=>r+i.restarts,0),errors:this.errors.slice()}}touch(e,t){let r=this.services.get(e);if(!r){if(this.services.size>=100){let i;for(let u of this.services.values())(!i||u.lastSeenAt<i.lastSeenAt)&&(i=u);i&&this.services.delete(i.project)}r={project:e,state:"starting",restarts:0,faults:new Set,lastTitle:"",lastSeenAt:t},this.services.set(e,r)}return r.lastSeenAt=t,r}},ps="agent://current-status",ms="process://cluster",XB=250,YB=new Set(["build","lint","typecheck","runtime","cluster","memory","visual","performance"]);function Sy(e){let t=new HB,r=e.sessionId??"pending",i=new tB({thresholds:e.podRules??Y3(),sessionId:r,publish:o(d=>e.bus.publish(d),"publish")}),u,n=o(()=>{u||(u=setTimeout(()=>{u=void 0,e.resources.markDirty(ps)},XB),u.unref?.())},"scheduleStatusRefresh"),a=o(d=>{let c=t.ingest(d);c&&e.resources.markDirty(ms);let p=i.ingest(d);p&&e.resources.markDirty(Le),(c||p||YB.has(d.category))&&n()},"handler"),l=e.bus.subscribe(a);return e.resources.register(ms,()=>({schemaVersion:1,revision:e.resources.revision(ms)??0,updatedAt:new Date().toISOString(),...t.snapshot()})),e.resources.register(Le,()=>i.report(e.resources.revision(Le)??0)),e.resources.register(ps,()=>os({resources:e.resources,sessionId:r,revision:e.resources.revision(ps)??0})),{unsubscribe:o(()=>{l(),u&&(clearTimeout(u),u=void 0)},"unsubscribe"),uris:[ps,ms,Le]}}s(Sy,"hh"),o(Sy,"installAgentReducer");import{App as QB}from"@frontmcp/sdk";import{Resource as e2,ResourceContext as t2}from"@frontmcp/sdk";var Hd=class extends t2{static{s(this,"gh")}static{o(this,"FlowRecentResource")}async execute(){return this.get(Z).read("flow://recent")}};Hd=F([e2({name:"flow-recent",uri:"flow://recent",mimeType:"application/json",description:"Last 50 flows seen this session, most recent first."})],Hd);var u2=Hd;import{Resource as r2,ResourceContext as i2}from"@frontmcp/sdk";var Xd=class extends i2{static{s(this,"yh")}static{o(this,"FlowCurrentResource")}async execute(){return this.get(Z).read("flow://current")}};Xd=F([r2({name:"flow-current",uri:"flow://current",mimeType:"application/json",description:"The most recently active flow (origin + event count + headline)."})],Xd);var n2=Xd;import{Resource as s2,ResourceContext as a2}from"@frontmcp/sdk";var Yd=class extends a2{static{s(this,"wh")}static{o(this,"FlowOriginsRecentResource")}async execute(){return this.get(Z).read("flow://origins/recent")}};Yd=F([s2({name:"flow-origins-recent",uri:"flow://origins/recent",mimeType:"application/json",description:"Last 50 flow-origin events (one per detected flow start)."})],Yd);var o2=Yd;import{Tool as l2,ToolContext as d2,z as fs}from"@frontmcp/sdk";var Fy;function Qd(e){Fy=e}s(Qd,"ca"),o(Qd,"setActiveFlowLookups");function Qe(){return Fy}s(Qe,"ke"),o(Qe,"activeFlowLookups");var jy;function ec(e){jy=e}s(ec,"ua"),o(ec,"setFlowRecoverySource");function tc(){return jy}s(tc,"So"),o(tc,"flowRecoverySource");import{existsSync as c2}from"node:fs";import{open as p2}from"node:fs/promises";import{basename as m2}from"node:path";var hs="flow://recent",gs="flow://current",vs="flow://origins/recent",ku=50,zy=50,uc=2e3,f2=4*1024*1024,rc=32*1024*1024,h2=ku+10;function ic(e){let t={flows:new Map,origins:[],recentOrder:[],retainedEvents:0,retainedBytes:0,evictedEvents:0,evictedForBytes:0,evictedFlows:0},r=e.register??!0,i=o((m,f,h,g=!0)=>{let E=Math.min(f,m.events.length);if(E<=0)return;if(g&&E>0&&(m.events[0]?.raw??{}).kind==="flow-origin"&&m.events.length>1){let $=m.eventBytes[1]??0;if(m.events.splice(1,1),m.eventBytes.splice(1,1),m.retainedBytes=Math.max(0,m.retainedBytes-$),t.retainedEvents=Math.max(0,t.retainedEvents-1),t.retainedBytes=Math.max(0,t.retainedBytes-$),t.evictedEvents+=1,h&&(t.evictedForBytes+=1),E-=1,E<=0)return}let x=0;for(let $=0;$<E;$+=1)x+=m.eventBytes[$]??0;m.events.splice(0,E),m.eventBytes.splice(0,E),m.retainedBytes=Math.max(0,m.retainedBytes-x),t.retainedEvents=Math.max(0,t.retainedEvents-E),t.retainedBytes=Math.max(0,t.retainedBytes-x),t.evictedEvents+=E,h&&(t.evictedForBytes+=E)},"evictPrefix"),u=o(m=>{let f=0,h=m.retainedBytes;for(;h>f2&&f<m.eventBytes.length;)h-=m.eventBytes[f]??0,f+=1;i(m,f,!0)},"enforceEntryByteCap"),n=o(()=>{for(let m=t.recentOrder.length-1;t.retainedBytes>rc&&m>=0;m-=1){let f=t.flows.get(t.recentOrder[m]);if(!f)continue;let h=0,g=t.retainedBytes;for(;g>rc&&h<f.eventBytes.length;)g-=f.eventBytes[h]??0,h+=1;i(f,h,!0)}},"enforceGlobalByteCap"),a=o(m=>{let f=m.context.flowId;if(!f)return;let h=(m.raw??{}).kind;if(h==="subscription-added"||h==="subscription-removed"||h==="hook-run"||h==="store-created"||h==="singleton-instance"||h==="visual-frame")return;let g=h==="flow-origin";(t.seenSince===void 0||m.timestamp<t.seenSince)&&(t.seenSince=m.timestamp);let E=t.flows.get(f);if(!E){E={summary:{flowId:f,originType:m.context.originType,originNodeId:m.context.originNodeId,startedAt:m.timestamp,lastSeenAt:m.timestamp,eventCount:0,headline:m.title},events:[],eventBytes:[],retainedBytes:0,hasOrigin:!1},t.flows.set(f,E);let w={flowId:f,originType:m.context.originType,originNodeId:m.context.originNodeId,at:m.timestamp,label:m.title,eventId:m.id};t.origins.push(w),t.origins.length>zy&&t.origins.splice(0,t.origins.length-zy),e.resources.markDirty(vs)}g&&!E.hasOrigin&&(E.hasOrigin=!0,E.summary.headline=m.title,m.context.originType&&(E.summary.originType=m.context.originType),m.context.originNodeId&&(E.summary.originNodeId=m.context.originNodeId)),m.timestamp<E.summary.startedAt&&(E.summary.startedAt=m.timestamp);let x=is(m);E.events.push(m),E.eventBytes.push(x),E.retainedBytes+=x,t.retainedEvents+=1,t.retainedBytes+=x,E.events.length>uc&&i(E,E.events.length-uc,!1),u(E),E.summary.eventCount+=1,E.summary.lastSeenAt=m.timestamp;let $=t.recentOrder.indexOf(f);if($>=0&&t.recentOrder.splice($,1),t.recentOrder.unshift(f),t.recentOrder.length>ku){let w=t.recentOrder.splice(ku);for(let k of w){let C=t.flows.get(k);C&&(t.evictedFlows+=1,t.evictedThrough=Math.max(t.evictedThrough??0,C.summary.lastSeenAt),i(C,C.events.length,!1,!1)),t.flows.delete(k)}}n(),t.currentFlowId!==f&&(t.currentFlowId=f,e.resources.markDirty(gs)),e.resources.markDirty(hs)},"handler"),l=e.bus.subscribe(a);e.resources.register(hs,()=>({schemaVersion:1,revision:e.resources.revision(hs)??0,updatedAt:new Date().toISOString(),flows:t.recentOrder.map(m=>t.flows.get(m)?.summary).filter(m=>!!m)})),e.resources.register(gs,()=>{let m=t.currentFlowId,f=m?t.flows.get(m):void 0;return{schemaVersion:1,revision:e.resources.revision(gs)??0,updatedAt:new Date().toISOString(),flow:f?.summary??null}}),e.resources.register(vs,()=>({schemaVersion:1,revision:e.resources.revision(vs)??0,updatedAt:new Date().toISOString(),origins:t.origins.slice().reverse()}));let d=e.flows??Et,c=new Map,p={getFlowEvents(m){return t.flows.get(m)?.events.slice().sort((f,h)=>f.timestamp-h.timestamp)},getFlowSummary(m){return t.flows.get(m)?.summary},recentFlowIds(){return t.recentOrder.slice()},findFlowsByOrigin(m){return[...t.flows.values()].filter(f=>f.summary.originNodeId===m).map(f=>f.summary)},flowsConfig:d,analyzeFlow(m){let f=t.flows.get(m);if(!f)return;let h=`${f.summary.eventCount}:${f.events.length}:${f.summary.lastSeenAt}`,g=c.get(m);if(g&&g.key===h)return c.delete(m),c.set(m,g),g.analysis;let E=rs(p.getFlowEvents(m)??[],d);for(c.delete(m),c.set(m,{key:h,analysis:E});c.size>h2;)c.delete(c.keys().next().value);return E},classifiedRecent(m=ku){let f=[];for(let h of t.recentOrder){if(f.length>=m)break;let g=t.flows.get(h)?.summary,E=p.analyzeFlow(h);!g||!E||f.push({summary:g,category:E.classification.category,decidedBy:E.classification.decidedBy,...E.classification.subject?{subject:E.classification.subject}:{},tags:E.classification.tags,segmentCount:E.segmentation.stats.segments,phaseCount:E.segmentation.stats.phases,signalCount:E.segmentation.stats.signal})}return f},window(){return{since:(t.evictedThrough!==void 0?Math.max(t.evictedThrough,t.seenSince??0):t.seenSince)??null,flows:t.flows.size,maxFlows:ku,evicted:t.evictedFlows}}};return r&&Qd(p),{unsubscribe:o(()=>{r&&Qd(void 0),l()},"unsubscribe"),uris:[hs,gs,vs],lookups:p,retentionStats:o(()=>({residentEvents:t.retainedEvents,residentBytes:t.retainedBytes,evictedEvents:t.evictedEvents,evictedForBytes:t.evictedForBytes,eventCap:ku*uc,byteCap:rc}),"retentionStats")}}s(ic,"Io"),o(ic,"installFlowReducer");var nc={maxBytes:320*1024*1024,maxMs:2e3};function Ny(e=process.env){let t=Number(e.LENSMCP_FLOW_RECOVER_BYTES??""),r=Number(e.LENSMCP_FLOW_RECOVER_MS??""),i=o(u=>(e[u]??"").trim()!=="","set");return{maxBytes:i("LENSMCP_FLOW_RECOVER_BYTES")&&Number.isFinite(t)&&t>=0?t:nc.maxBytes,maxMs:i("LENSMCP_FLOW_RECOVER_MS")&&Number.isFinite(r)&&r>0?r:nc.maxMs}}s(Ny,"Rh"),o(Ny,"recoveryBudgetFromEnv");var My=1024*1024,sc=10;function Oy(e,t){let r=[e];for(let i=1;i<=t;i++)r.push(`${e}.${i}`);return r.filter(i=>c2(i))}s(Oy,"ij"),o(Oy,"busFiles");function Ry(e,t){try{let r=JSON.parse(e);return!r||typeof r!="object"||!("id"in r)||!("source"in r)?void 0:r.context?.flowId===t?r:void 0}catch{return}}s(Ry,"sj"),o(Ry,"eventOf");function Ty(e,t,r,i){let u=e.indexOf(t);for(;u!==-1;){let n=e.lastIndexOf(sc,u)+1,a=e.indexOf(sc,u),l=Ry(e.toString("utf8",n,a),r);l&&i.push(l),u=e.indexOf(t,a+1)}}s(Ty,"aj"),o(Ty,"collect");async function Py(e,t,r,i,u){let n=[],a={file:m2(e),size:0,read:0,matched:0},l;try{l=await p2(e,"r")}catch{return{searched:a,events:n}}let d=o(c=>(a.matched=n.length,{searched:a,events:n,...c?{stoppedBy:c}:{}}),"done");try{a.size=(await l.stat()).size;let c=Buffer.allocUnsafe(My),p=Buffer.alloc(0);for(;a.read<a.size;){if(a.read>=i)return d("bytes");if(Date.now()>=u)return d("time");let m=Math.min(My,a.size-a.read,i-a.read),{bytesRead:f}=await l.read(c,0,m,a.read);if(f<=0)break;a.read+=f;let h=p.length>0?Buffer.concat([p,c.subarray(0,f)]):c.subarray(0,f),g=h.lastIndexOf(sc);g>=0&&Ty(h.subarray(0,g+1),t,r,n),p=Buffer.from(h.subarray(g+1))}}finally{await l.close().catch(()=>{})}return d()}s(Py,"cj"),o(Py,"searchFile");async function Uy(e,t,r){let i=Date.now(),u=i+r.maxMs,n=Buffer.from(JSON.stringify(t)),a=[],l=[],d=0,c;for(let p of Oy(e.eventFile,e.maxGenerations??20)){let m=await Py(p,n,t,r.maxBytes-d,u);if(a.push(m.searched),d+=m.searched.read,l.push(m.events),m.stoppedBy){c=m.stoppedBy;break}let f=l.some(g=>g.length>0),h=m.events.some(g=>g.raw?.kind==="flow-origin");if(f&&(h||m.events.length===0))break}return{events:l.reverse().flat(),files:a,bytesRead:d,elapsedMs:Date.now()-i,...c?{stoppedBy:c}:{}}}s(Uy,"uj"),o(Uy,"findFlowOnBus");var g2=4,Hr=new Map,ac=new Map;function qy(e,t){let r=new e4,i=ic({bus:r,resources:new i4,...t.flows?{flows:t.flows}:{},register:!1});for(let u of e)r.publish(t.prepare(u));return i.unsubscribe(),i.lookups}s(qy,"dj"),o(qy,"replay");var Zy="There is no bus file to search (LENSMCP_EVENT_FILE is not set for this server).",v2="Searching the bus files is turned off (LENSMCP_FLOW_RECOVER_BYTES=0).";function oc(e,t,r,i=Zy){let u=`This server holds the ${t.maxFlows} most recently active flows${t.since!==null?` (every flow active since ${new Date(t.since).toISOString()})`:""}, and on start replays only the recent tail of the bus \u2014 this id is not among them.`,n=r?`Its search of the bus files ran out of budget (${r.stoppedBy==="time"?`${r.budgetMs} ms`:`${r.budgetBytes} bytes`}) before finding the flow.`:i;return{found:!1,flowId:e,reason:"outside-window",window:t,...r?{searched:r}:{},hint:`${u} ${n} The flow may still exist further back: re-run it to capture it fresh, raise LENSMCP_FLOW_RECOVER_BYTES / LENSMCP_FLOW_RECOVER_MS, or search .lensmcp/events.jsonl* for the id.`}}s(oc,"$_"),o(oc,"outsideWindow");async function Ly(e,t,r,i,u){let n=await Uy(r,t,i);if(n.events.length>0){let a=qy(n.events,r);if(!a.getFlowSummary(t))return{found:!1,flowId:t};let l={lookups:a,recovered:{from:"bus",files:n.files.filter(d=>d.matched>0).map(d=>d.file),events:n.events.length,complete:n.stoppedBy===void 0}};for(Hr.set(u,l);Hr.size>g2;)Hr.delete(Hr.keys().next().value);return l}if(n.stoppedBy){let a={files:n.files,bytes:n.bytesRead,budgetBytes:i.maxBytes,budgetMs:i.maxMs,stoppedBy:n.stoppedBy};return oc(t,e.window(),a)}return{found:!1,flowId:t}}s(Ly,"fj"),o(Ly,"search");async function lc(e,t,r){if(e.getFlowSummary(t))return{lookups:e};let i=r?.budget??nc;if(!r||i.maxBytes<=0){let l=e.window();return l.evicted>0?oc(t,l,void 0,r?v2:Zy):{found:!1,flowId:t}}let u=`${r.eventFile}\0${t}`,n=Hr.get(u);if(n)return n;let a=ac.get(u);return a||(a=Ly(e,t,r,i,u).finally(()=>ac.delete(u)),ac.set(u,a)),a}s(lc,"Eh"),o(lc,"locateFlow");var y2=120;function dc(e,t,r){return{id:e.id,kind:e.kind,label:e.label,category:t,phase:e.phase,startOffsetMs:Math.max(0,e.start-r),durationMs:e.durationMs,events:e.counts.total,signal:e.counts.signal,errors:e.counts.errors,worstSeverity:e.worstSeverity,projects:e.projects,...e.route?{route:e.route}:{},...e.method?{method:e.method}:{},...e.part?{part:e.part}:{},...e.hot?{hot:e.hot}:{},...e.after?{after:e.after}:{},...e.sql?{sql:e.sql}:{}}}s(dc,"Th"),o(dc,"segmentView");function cc(e,t={}){let{segmentation:r,classification:i,segmentCategories:u}=e,n=Math.max(1,t.maxSegments??y2),a=r.segments.reduce((c,p)=>Math.min(c,p.start),1/0),l=Number.isFinite(a)?a:0,d=r.segments;if(d.length>n){let c=o(m=>m.counts.errors*1e6+m.counts.signal,"rank"),p=new Set([...d].sort((m,f)=>c(f)-c(m)||(m.id<f.id?-1:1)).slice(0,n).map(m=>m.id));d=d.filter(m=>p.has(m.id))}return{flowId:r.flowId,category:i.category,decidedBy:i.decidedBy,...i.subject?{subject:i.subject}:{},tags:i.tags,origin:i.origin,stats:{events:r.stats.events,signal:r.stats.signal,bookkeeping:r.stats.bookkeeping,segments:r.stats.segments,phases:r.stats.phases},phases:r.phases.map(c=>({index:c.index,startOffsetMs:Math.max(0,c.start-l),endOffsetMs:Math.max(0,c.end-l),segmentIds:c.segmentIds})),segments:d.map(c=>dc(c,u[c.id]??"other",l)),segmentsTruncated:d.length<r.segments.length,...r.sql?{sql:r.sql}:{}}}s(cc,"Ah"),o(cc,"overviewOf");function Vy(e,t,r){let i=t.segmentation.segments.find(n=>n.id===r);if(!i)return;let u=new Set(i.eventIds);return e.filter(n=>u.has(n.id))}s(Vy,"__"),o(Vy,"eventsOfSegment");function Jy(e,t){return e.filter(r=>(t.category===void 0||r.category===t.category)&&(t.tag===void 0||r.tags.includes(t.tag))&&(t.subject===void 0||r.subject===t.subject))}s(Jy,"k_"),o(Jy,"filterClassified");function Wy(e){let t=e.map(r=>({category:r.category,...r.subject?{subject:r.subject}:{},id:r.summary.flowId}));return $3(t).map(r=>({category:r.category,count:r.count,subjects:r.subjects.map(i=>({...i.subject!==void 0?{subject:i.subject}:{},count:i.count,flowIds:i.items.map(u=>u.id)}))}))}s(Wy,"S_"),o(Wy,"groupClassified");function Gy(e){let t={};for(let r of e)t[r.category]=(t[r.category]??0)+1;return t}s(Gy,"I_"),o(Gy,"categoryCounts");async function Ky(e,t,r){if(!e)return mc(e,t);let i=await lc(e,t.flowId,r);if(!("lookups"in i))return i;let u=mc(i.lookups,t);return i.recovered?{...u,recovered:i.recovered}:u}s(Ky,"A_"),o(Ky,"readFlowDetail");function pc(e,t){let r=new Map(t.map(i=>[i.id,i.raw]));return e.map(i=>"ai"in i||!r.has(i.id)?i:{...i,raw:r.get(i.id)})}s(pc,"R_"),o(pc,"withRaw");function mc(e,t){if(!e)return{found:!1,reason:"no active flow reducer"};let r=e.getFlowSummary(t.flowId),i=e.getFlowEvents(t.flowId);if(!r||!i)return{found:!1,flowId:t.flowId};let u=e.analyzeFlow(t.flowId);if(t.segmentId){let a=u?Vy(i,u,t.segmentId):void 0,l=u?.segmentation.segments.find(p=>p.id===t.segmentId);if(!u||!a||!l)return{found:!1,flowId:t.flowId,segmentId:t.segmentId,reason:"unknown segment id for this flow (the flow may have changed \u2014 re-read overview.segments)",segmentIds:u?.segmentation.segments.map(p=>p.id)??[]};let d=u.segmentation.segments.reduce((p,m)=>Math.min(p,m.start),1/0),{events:c}=Yn(a,{includeRaw:t.includeRaw});return{found:!0,summary:r,segment:dc(l,u.segmentCategories[l.id]??"other",Number.isFinite(d)?d:l.start),truncated:c.length>t.limit,events:t.includeRaw?pc(c.slice(0,t.limit),a):c.slice(0,t.limit)}}let{events:n}=Yn(i,{includeRaw:t.includeRaw});if(t.expand){let a=n.find(c=>c.id===t.expand);if(!a)return{found:!1,flowId:t.flowId,expand:t.expand};let l=new Set(a.memberIds??[a.id]),d=i.filter(c=>l.has(c.id));return{found:!0,flowId:t.flowId,expanded:{id:a.id,title:a.title,count:d.length},events:d.map(c=>({id:c.id,timestamp:c.timestamp,source:c.source,category:c.category,severity:c.severity,title:c.title,message:c.message,...t.includeRaw?{raw:c.raw}:{}}))}}return{found:!0,summary:r,...u?{overview:cc(u)}:{},truncated:n.length>t.limit,events:t.includeRaw?pc(n.slice(0,t.limit),i):n.slice(0,t.limit)}}s(mc,"E_"),o(mc,"getFlowDetail");async function Hy(e,t,r){if(e){let u=e.classifiedRecent(),n=Jy(u,{...t.category?{category:t.category}:{},...t.tag?{tag:t.tag}:{}}),a=n.slice(0,t.limit);return{flows:a.map(l=>({...l.summary,category:l.category,decidedBy:l.decidedBy,...l.subject?{subject:l.subject}:{},tags:l.tags,segmentCount:l.segmentCount,phaseCount:l.phaseCount,signalCount:l.signalCount})),totalKnown:u.length,matching:n.length,categories:Gy(u),...t.groupBy==="category"?{groups:Wy(a)}:{}}}let i=await r();return{flows:i.flows.slice(0,t.limit),totalKnown:i.flows.length}}s(Hy,"j_"),o(Hy,"listRecentFlows");async function Xy(e,t,r){if(!e)return fc(e,t);let i=await lc(e,t.flowId,r);if(!("lookups"in i))return i;let u=fc(i.lookups,t);return i.recovered?{...u,recovered:i.recovered}:u}s(Xy,"z_"),o(Xy,"readFlowSegments");function fc(e,t){if(!e)return{found:!1,reason:"no active flow reducer"};let r=e.analyzeFlow(t.flowId);return r?{found:!0,...cc(r,{maxSegments:t.maxSegments})}:{found:!1,flowId:t.flowId}}s(fc,"T_"),o(fc,"getFlowSegments");var hc=class extends d2{static{s(this,"jh")}static{o(this,"FlowListRecentTool")}async execute(e){return Hy(Qe(),e,async()=>await this.get(Z).read("flow://recent"))}};hc=F([l2({name:"flow.list_recent",description:'Lists the last N flows with their origin + event count + headline, and what each one IS: `category` (page-load, user-action, api, ai, test, or one you defined in nx.json#lensmcp.flows), `subject` (the templated page, component or route), `tags` (fan-out, has-error, slow, storm\u2026), `segmentCount`/`phaseCount`. Filter with `category` / `tag`; pass `groupBy: "category"` to also get the flows grouped category \u2192 subject; `categories` always counts every known flow per category. Same data as flow://recent but with a tunable limit.',inputSchema:{limit:fs.number().int().positive().max(50).default(10).describe("How many flows to return (default 10, max 50)."),category:fs.string().optional().describe('Only flows in this category, e.g. "page-load" or "checkout".'),tag:fs.string().optional().describe('Only flows carrying this tag, e.g. "has-error" or "fan-out".'),groupBy:fs.enum(["none","category"]).default("none").describe('"category" adds `groups`: the returned flows grouped category \u2192 subject.')}})],hc);var E2=hc;import{Tool as b2,ToolContext as w2,z as Xr}from"@frontmcp/sdk";var gc=class extends w2{static{s(this,"Oh")}static{o(this,"FlowGetTool")}async execute(e){return Ky(Qe(),e,tc())}};gc=F([b2({name:"flow.get",description:'Returns one flow as the ordered, parented mechanism tree the dashboard renders: each node has `parent`, `area`, `start`, `durationMs`, and repeated work is collapsed (`count`, `memberIds`). Pass `expand: "<node id>"` to list the individual events a collapsed node stands for, or `includeRaw: true` to add each event\'s full `raw` payload (an AI turn\'s is its `ai` field; a collapsed node carries its first member\'s \u2014 `expand` lists every member\'s). The response also carries `overview`: the flow cut into segments (one backend request each, UI bursts, the origin) grouped into phases, with its category, subject and tags \u2014 for a big flow read that first, then pass `segmentId: "<segment id>"` to get just that unit as a mechanism tree. Before summing SQL counts or time, read `overview.sql`: db-query events are flood-guarded per query shape, so only `status: "complete"` means they are every statement; `gaps` names the requests that fall short and by how much. Each request\'s verdict carries `basis`: `end` (accounted when the request ended) or `settled` (a quiet-period snapshot that later SQL in the same context could still change); `overview.sql.settled` counts the verdicts resting on one. A flow this server no longer holds in memory (it keeps the 50 most recently active, and replays only the recent tail of the bus on start) is read back from the bus files on demand: the same answer, plus `recovered` (`files`, `events`, and `complete: false` when older events may be missing). `found: false` alone means no event of this id is retained anywhere the server can read; `reason: "outside-window"` means it may exist further back than the server can see (`window`, `searched`, `hint`) \u2014 re-run the flow rather than concluding it never happened.',inputSchema:{flowId:Xr.string().describe("Flow id from flow://recent."),includeRaw:Xr.boolean().default(!1),limit:Xr.number().int().positive().max(500).default(200),expand:Xr.string().optional().describe("A node id from a previous call: returns the individual events it collapsed."),segmentId:Xr.string().optional().describe("A segment id from `overview.segments` (or flow.segments): returns only that unit of the flow, shaped like the whole.")}})],gc);var D2=gc;import{Tool as $2,ToolContext as B2,z as x2}from"@frontmcp/sdk";var vc=class extends B2{static{s(this,"Nh")}static{o(this,"FlowFindByOriginTool")}async execute(e){let t=Qe();if(!t)return{found:!1,reason:"no active flow reducer"};let r=t.findFlowsByOrigin(e.originNodeId);return{found:r.length>0,count:r.length,flows:r}}};vc=F([$2({name:"flow.find_by_origin",description:"Returns all flows whose origin node id matches `originNodeId` (e.g. a data-agent-component target).",inputSchema:{originNodeId:x2.string().describe("Origin node id \u2014 usually the value of data-agent-component on the originating element.")}})],vc);var C2=vc;import{Tool as k2,ToolContext as A2,z as I2}from"@frontmcp/sdk";import*as _2 from"node:fs";import{dirname as S2,join as Yy}from"node:path";var F2="ai",j2=/^ai_[0-9a-z]{8,40}$/,ys=o(e=>typeof e=="string"&&j2.test(e),"isAiCallId");function Qy(e){return Yy(S2(e),F2)}s(Qy,"Sj"),o(Qy,"aiContentDir");function e6(e,t){if(!ys(t))throw new Error("invalid ai call id");return Yy(Qy(e),`${t}.json`)}s(e6,"Ij"),o(e6,"aiContentFile");function yc(e,t){if(ys(t))try{let r=JSON.parse(_2.readFileSync(e6(e,t),"utf8"));return r&&r.schemaVersion===1&&r.id===t?r:void 0}catch{return}}s(yc,"ma"),o(yc,"readAiContent");var Ec=class extends A2{static{s(this,"Dh")}static{o(this,"AiGetCallTool")}async execute(e){if(!ys(e.callId))return{found:!1,reason:"invalid call id"};let t=yc(process.env.LENSMCP_EVENT_FILE??`${process.cwd()}/.lensmcp/events.jsonl`,e.callId);return t?{found:!0,call:t}:{found:!1,callId:e.callId,reason:"no captured content for this call \u2014 it was not captured (LENSMCP_AI_CAPTURE=content), or it has been rotated away"}}};Ec=F([k2({name:"ai.get_call",description:"Returns the prompt and completion of ONE AI call (OpenAI, Anthropic, \u2026) captured by the node tap: system prompt, messages, tools offered, completion, tool calls, usage. `callId` is the `ai.contentRef` of a flow node whose kind is `ai-call` (see flow.get). Only exists when the service ran with LENSMCP_AI_CAPTURE=content; the text was redacted and size-capped when it was captured, and `truncated: true` says if anything was cut.",inputSchema:{callId:I2.string().describe('The contentRef of an ai-call flow node, e.g. "ai_0abc12345xyz78".')}})],Ec);var z2=Ec;import{Tool as N2,ToolContext as M2,z as t6}from"@frontmcp/sdk";var bc=class extends M2{static{s(this,"Ch")}static{o(this,"FlowSegmentsTool")}async execute(e){return Xy(Qe(),e,tc())}};bc=F([N2({name:"flow.segments",description:'Returns one flow cut into segments and phases \u2014 the right first read for a flow with hundreds or thousands of events. Each segment is a backend request (its browser fetch, every service hop, db/redis/ai work and any queue worker it enqueued), a UI burst (state updates and renders, named by what churned), the origin that started the flow, or background noise; with times relative to the flow start, event/error counts, and a category. Also returns the flow\'s category, subject and tags. Open one unit with flow.get { flowId, segmentId }. A flow no longer in memory is read back from the bus as in flow.get (`recovered`); `reason: "outside-window"` means it may exist further back than the server can see.',inputSchema:{flowId:t6.string().describe("Flow id from flow://recent or flow.list_recent."),maxSegments:t6.number().int().positive().max(500).default(120).describe("Cap on segments listed (failing and heaviest are kept first when it truncates).")}})],bc);var O2=bc,u6=class{static{s(this,"Uh")}static{o(this,"FlowApp")}};u6=F([QB({id:"flow",name:"Flow",description:"Causal-chain index: every event carries a flowId; the app surfaces recent flows + origin events. story.compile turns one of these into a phase summary.",resources:[u2,n2,o2],tools:[E2,D2,O2,C2,z2]})],u6);import{App as R2}from"@frontmcp/sdk";import{Resource as T2,ResourceContext as P2}from"@frontmcp/sdk";var wc=class extends P2{static{s(this,"Lh")}static{o(this,"StoryRecentResource")}async execute(){return this.get(Z).read("story://recent")}};wc=F([T2({name:"story-recent",uri:"story://recent",mimeType:"application/json",description:"Last 50 compiled stories (one per flow), most recent first."})],wc);var U2=wc;import{Resource as q2,ResourceContext as Z2}from"@frontmcp/sdk";var Dc=class extends Z2{static{s(this,"Bh")}static{o(this,"StoryLastResource")}async execute(){return this.get(Z).read("story://last")}};Dc=F([q2({name:"story-last",uri:"story://last",mimeType:"application/json",description:"The most recently compiled story (full phase list)."})],Dc);var L2=Dc;import{Tool as V2,ToolContext as J2,z as W2}from"@frontmcp/sdk";var Es="story://recent",bs="story://last",Pe={byFlowId:new Map,order:[]},r6=!1;function i6(e){return r6||(e.resources.register(Es,()=>({schemaVersion:1,revision:e.resources.revision(Es)??0,updatedAt:new Date().toISOString(),stories:Pe.order.map(t=>Pe.byFlowId.get(t)).filter(t=>!!t).map(t=>({flowId:t.flowId,origin:t.origin,phaseCount:t.phases.length,startedAt:t.startedAt,endedAt:t.endedAt,eventCount:t.eventCount,finalState:t.finalState}))})),e.resources.register(bs,()=>{let t=Pe.order[0],r=t?Pe.byFlowId.get(t):void 0;return{schemaVersion:1,revision:e.resources.revision(bs)??0,updatedAt:new Date().toISOString(),story:r??null}}),r6=!0),n6(e.resources),{uris:[Es,bs]}}s(i6,"Vh"),o(i6,"installStoryReducer");var $c;function n6(e){$c=o(t=>{e.markDirty(t)},"markDirty")}s(n6,"Dj"),o(n6,"setMarkDirty");function Bc(e){Pe.byFlowId.set(e.flowId,e);let t=Pe.order.indexOf(e.flowId);if(t>=0&&Pe.order.splice(t,1),Pe.order.unshift(e.flowId),Pe.order.length>50){let r=Pe.order.splice(50);for(let i of r)Pe.byFlowId.delete(i)}$c?.(Es),$c?.(bs)}s(Bc,"To"),o(Bc,"recordCompiledStory");function s6(e){return Pe.byFlowId.get(e)}s(s6,"Gh"),o(s6,"getCompiledStory");var xc=class extends J2{static{s(this,"Jh")}static{o(this,"StoryCompileTool")}async execute(e){let t=Qe();if(!t)return{compiled:!1,reason:"no active flow reducer"};let r=t.getFlowEvents(e.flowId);if(!r)return{compiled:!1,flowId:e.flowId};let i=ca(r,{flowId:e.flowId});return i?(Bc(i),{compiled:!0,story:i}):{compiled:!1,flowId:e.flowId}}};xc=F([V2({name:"story.compile",description:"Compile a flow into a `FlowStory` (origin, phases, finalState). Caches the result; subsequent story.get(flowId) calls return it directly.",inputSchema:{flowId:W2.string().describe("Flow id (from flow://recent).")}})],xc);var G2=xc;import{Tool as K2,ToolContext as H2,z as X2}from"@frontmcp/sdk";var Cc=class extends H2{static{s(this,"Wh")}static{o(this,"StoryGetTool")}async execute(e){let t=s6(e.flowId);return t?{found:!0,story:t}:{found:!1,flowId:e.flowId}}};Cc=F([K2({name:"story.get",description:"Returns a previously compiled story. If the story has not been compiled yet, returns `found: false`; call story.compile first.",inputSchema:{flowId:X2.string().describe("Flow id.")}})],Cc);var Y2=Cc,a6=class{static{s(this,"Hh")}static{o(this,"StoryApp")}};a6=F([R2({id:"story",name:"Story",description:"Compiles flows into phase summaries (user-action / loading-ui / backend-request / state-update / final-render).",resources:[U2,L2],tools:[G2,Y2]})],a6);import{App as Q2}from"@frontmcp/sdk";import{Resource as ex,ResourceContext as tx}from"@frontmcp/sdk";var kc=class extends tx{static{s(this,"Yh")}static{o(this,"BuildCurrentResource")}async execute(){return this.get(Z).read("build://current")}};kc=F([ex({name:"build-current",uri:"build://current",mimeType:"application/json",description:"Current build status (clean / warning / failing), open failures and warnings."})],kc);var ux=kc;import{Resource as rx,ResourceContext as ix}from"@frontmcp/sdk";var Ac=class extends ix{static{s(this,"eg")}static{o(this,"BuildFailuresResource")}async execute(){return this.get(Z).read("build://failures")}};Ac=F([rx({name:"build-failures",uri:"build://failures",mimeType:"application/json",description:"Currently-open build failures (deduped by fingerprint)."})],Ac);var nx=Ac;import{Resource as sx,ResourceContext as ax}from"@frontmcp/sdk";var Ic=class extends ax{static{s(this,"rg")}static{o(this,"BuildRecentResource")}async execute(){return this.get(Z).read("build://events/recent")}};Ic=F([sx({name:"build-events-recent",uri:"build://events/recent",mimeType:"application/json",description:"Last 50 build/lint/typecheck/HMR events in chronological order."})],Ic);var ox=Ic,o6=class{static{s(this,"og")}static{o(this,"BuildApp")}};o6=F([Q2({id:"build",name:"Build",description:"Vite / TS / lint / HMR state.",resources:[ux,nx,ox]})],o6);var ws="build://current",Ds="build://failures",$s="build://events/recent",lx=new Set(["vite","rollup","typescript","eslint"]),l6=new Set(["build","typecheck","lint"]),d6=50,dx="Install the LensMCP Vite plugin (@lensmcp/vite-plugin) in the dev server, or run under the dev cluster, so build events reach this session.";function c6(e){let t=e.raw;return t&&typeof t=="object"?t:{}}s(c6,"ez"),o(c6,"readRaw");function p6(e,t){return e==="typecheck"?"tsc":e==="lint"?"eslint":t}s(p6,"tz"),o(p6,"defaultTool");function m6(e){let t={status:"unknown",recent:[],failures:new Map,warnings:new Map,hmrUpdates:0,producers:new Map,sawVerdict:!1},r=o((f,h)=>{let g=t.producers.get(f);t.producers.set(f,{id:f,tool:h.tool,...h.project?{project:h.project}:{},firstReportedAt:g?.firstReportedAt??h.at,lastReportedAt:Math.max(g?.lastReportedAt??0,h.at),lastRunStatus:h.runStatus,errorCount:h.errorCount??g?.errorCount??0,...h.warningCount!==void 0?{warningCount:h.warningCount}:g?.warningCount!==void 0?{warningCount:g.warningCount}:{},...h.durationMs!==void 0?{lastRunDurationMs:h.durationMs}:g?.lastRunDurationMs!==void 0?{lastRunDurationMs:g.lastRunDurationMs}:{},...h.error?{error:h.error}:{}}),Zt(t.producers,Lr)},"touchProducer"),i=o(f=>{for(let[h,g]of t.failures)f(g)&&t.failures.delete(h);for(let[h,g]of t.warnings)f(g)&&t.warnings.delete(h)},"drop"),u=o((f,h)=>{i(g=>g.domain===f&&(h===void 0||g.project===h))},"clearScope"),n=o((f,h)=>{if(h.length===0)return;let g=new Set(h);i(E=>E.domain===f&&E.file!==void 0&&g.has(E.file))},"clearFiles"),a=o(()=>{if(t.failures.size>0){t.status="failing";return}if(t.warnings.size>0){t.status="warning";return}let f=[...t.producers.values()].some(h=>h.lastRunStatus==="error");t.status=f||!t.sawVerdict?"unknown":"clean"},"recomputeStatus"),l=o(()=>{e.resources.markDirty(ws),e.resources.markDirty(Ds),e.resources.markDirty($s)},"markDirty"),d=o(f=>{if([...t.failures.values()].some(h=>h.project===f)||[...t.warnings.values()].some(h=>h.project===f)||[...t.producers.values()].some(h=>h.project===f)){for(let h of l6)u(h,f);for(let[h,g]of t.producers)g.project===f&&t.producers.delete(h);t.sawVerdict=[...t.producers.values()].some(h=>h.lastRunStatus!=="error"),a(),l()}},"supersedeProject"),c=o(f=>{if(f.source==="gateway"&&f.category==="cluster"){let C=f.raw??null,M=C?.kind;(M==="service-starting"||M==="service-respawn")&&C?.project&&d(C.project);return}if(!lx.has(f.source)||!l6.has(f.category))return;let h=f.category,g=c6(f),E=g.project,x=g.tool??p6(h,f.source),$=`${x}:${E??"*"}`,w=typeof g.kind=="string"&&g.kind.endsWith("-run"),k={id:f.id,timestamp:f.timestamp,severity:f.severity,title:f.title,...f.message!==void 0?{message:f.message}:{},...f.location?.file?{file:f.location.file}:g.file?{file:g.file}:{},domain:h,...E?{project:E}:{},fingerprint:f.fingerprint};if(f.severity==="info"&&(w&&g.phase==="start"||f.title.startsWith("tsc clear")||f.title.startsWith("ESLint clear"))){u(h,E),t.lastRunAt=f.timestamp,Yr(t,k),r($,{tool:x,...E?{project:E}:{},at:f.timestamp,runStatus:"running"}),w||(t.sawVerdict=!0),a(),l();return}if(w&&g.phase==="end"){let C=g.status==="error"?"error":g.status==="failing"?"failing":"clean";C==="clean"&&u(h,E),C!=="error"&&(t.sawVerdict=!0),t.lastRunAt=f.timestamp,Yr(t,k),r($,{tool:x,...E?{project:E}:{},at:f.timestamp,runStatus:C,...g.durationMs!==void 0?{durationMs:g.durationMs}:{},...g.errorCount!==void 0?{errorCount:g.errorCount}:{},...g.warningCount!==void 0?{warningCount:g.warningCount}:{},...g.error?{error:g.error}:{}}),a(),l();return}if(g.kind==="hmr"||f.title.startsWith("HMR ")){t.hmrUpdates+=1;let C=[...k.file?[k.file]:[],...f.relatedFiles??[]];n("build",C),t.lastRunAt=f.timestamp,t.sawVerdict=!0,Yr(t,k),r($,{tool:x,...E?{project:E}:{},at:f.timestamp,runStatus:"clean"}),a(),l();return}Yr(t,k),f.severity==="error"||f.severity==="fatal"?(t.failures.set(k.fingerprint,k),t.warnings.delete(k.fingerprint)):f.severity==="warning"?t.failures.has(k.fingerprint)||t.warnings.set(k.fingerprint,k):(t.failures.delete(k.fingerprint),t.warnings.delete(k.fingerprint)),t.lastRunAt=f.timestamp,t.sawVerdict=!0,r($,{tool:x,...E?{project:E}:{},at:f.timestamp,runStatus:t.failures.size>0?"failing":"clean"}),a(),l()},"handler"),p=e.bus.subscribe(c),m=o(()=>Wn({producers:[...t.producers.values()],domain:"build",noProducerHint:dx}),"health");return e.resources.register(ws,()=>({schemaVersion:1,revision:e.resources.revision(ws)??0,updatedAt:new Date().toISOString(),status:t.status,failures:[...t.failures.values()],warnings:[...t.warnings.values()],hmrUpdates:t.hmrUpdates,lastRunAt:t.lastRunAt,...m()})),e.resources.register(Ds,()=>({schemaVersion:1,revision:e.resources.revision(Ds)??0,updatedAt:new Date().toISOString(),failures:[...t.failures.values()],...m()})),e.resources.register($s,()=>({schemaVersion:1,revision:e.resources.revision($s)??0,updatedAt:new Date().toISOString(),events:t.recent.slice()})),{unsubscribe:p,uris:[ws,Ds,$s]}}s(m6,"ig"),o(m6,"installBuildReducer");function Yr(e,t){e.recent.push(t),e.recent.length>d6&&e.recent.splice(0,e.recent.length-d6)}s(Yr,"wa"),o(Yr,"pushRecent");import{App as cx}from"@frontmcp/sdk";import{Resource as px,ResourceContext as mx}from"@frontmcp/sdk";var _c=class extends mx{static{s(this,"sg")}static{o(this,"LintCurrentResource")}async execute(){return this.get(Z).read("lint://current")}};_c=F([px({name:"lint-current",uri:"lint://current",mimeType:"application/json",description:"Current lint status (clean / warning / failing) + counts."})],_c);var fx=_c;import{Resource as hx,ResourceContext as gx}from"@frontmcp/sdk";var Sc=class extends gx{static{s(this,"cg")}static{o(this,"LintErrorsResource")}async execute(){return this.get(Z).read("lint://errors")}};Sc=F([hx({name:"lint-errors",uri:"lint://errors",mimeType:"application/json",description:"Currently-open ESLint errors (deduped by fingerprint)."})],Sc);var vx=Sc;import{Resource as yx,ResourceContext as Ex}from"@frontmcp/sdk";var Fc=class extends Ex{static{s(this,"lg")}static{o(this,"LintWarningsResource")}async execute(){return this.get(Z).read("lint://warnings")}};Fc=F([yx({name:"lint-warnings",uri:"lint://warnings",mimeType:"application/json",description:"Currently-open ESLint warnings."})],Fc);var bx=Fc,f6=class{static{s(this,"pg")}static{o(this,"LintApp")}};f6=F([cx({id:"lint",name:"Lint",description:"ESLint state.",resources:[fx,vx,bx]})],f6);var Bs="lint://current",xs="lint://errors",Cs="lint://warnings",wx="Nothing runs ESLint in the dev loop, so this is expected. Run `lensmcp lint [paths\u2026]` to publish a run; until then treat lint as UNCHECKED, not passing.";function h6(e){let t=e.raw;return t&&typeof t=="object"?t:{}}s(h6,"lz"),o(h6,"readRaw");function g6(e){let t={status:"unknown",errors:new Map,warnings:new Map,producers:new Map,sawVerdict:!1},r=o((p,m)=>{let f=t.producers.get(p);t.producers.set(p,{id:p,tool:m.tool,...m.project?{project:m.project}:{},firstReportedAt:f?.firstReportedAt??m.at,lastReportedAt:Math.max(f?.lastReportedAt??0,m.at),lastRunStatus:m.runStatus,errorCount:m.errorCount??f?.errorCount??0,...m.warningCount!==void 0?{warningCount:m.warningCount}:f?.warningCount!==void 0?{warningCount:f.warningCount}:{},...m.durationMs!==void 0?{lastRunDurationMs:m.durationMs}:f?.lastRunDurationMs!==void 0?{lastRunDurationMs:f.lastRunDurationMs}:{},...m.error?{error:m.error}:{}}),Zt(t.producers,Lr)},"touchProducer"),i=o((p,m)=>{let f=o((h,g)=>{for(let[E,x]of h)g(x)&&h.delete(E)},"drop");if(p){f(t.errors,h=>h.project===p),f(t.warnings,h=>h.project===p);return}if(m){f(t.errors,h=>h.file===m),f(t.warnings,h=>h.file===m);return}t.errors.clear(),t.warnings.clear()},"clearScope"),u=o(()=>{if(t.errors.size>0){t.status="failing";return}if(t.warnings.size>0){t.status="warning";return}let p=[...t.producers.values()].some(m=>m.lastRunStatus==="error");t.status=p||!t.sawVerdict?"unknown":"clean"},"recomputeStatus"),n=o(()=>{e.resources.markDirty(Bs),e.resources.markDirty(xs),e.resources.markDirty(Cs)},"markDirty"),a=o(p=>{if([...t.errors.values()].some(m=>m.project===p)||[...t.warnings.values()].some(m=>m.project===p)||[...t.producers.values()].some(m=>m.project===p)){i(p,void 0);for(let[m,f]of t.producers)f.project===p&&t.producers.delete(m);t.sawVerdict=[...t.producers.values()].some(m=>m.lastRunStatus!=="error"),u(),n()}},"supersedeProject"),l=o(p=>{if(p.source==="gateway"&&p.category==="cluster"){let w=p.raw??null,k=w?.kind;(k==="service-starting"||k==="service-respawn")&&w?.project&&a(w.project);return}if(p.source!=="eslint"||p.category!=="lint")return;let m=h6(p),f=m.project,h=m.tool??"eslint",g=`${h}:${f??"*"}`,E=m.kind==="lint-run";if(p.severity==="info"&&(E&&m.phase==="start"||p.title.startsWith("ESLint clear"))){i(f,p.location?.file),t.lastRunAt=p.timestamp,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:"running"}),E||(t.sawVerdict=!0),u(),n();return}if(E&&m.phase==="end"){let w=m.status==="error"?"error":m.status==="failing"?"failing":"clean";w!=="error"&&(t.sawVerdict=!0),t.lastRunAt=p.timestamp,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:w,...m.durationMs!==void 0?{durationMs:m.durationMs}:{},...m.errorCount!==void 0?{errorCount:m.errorCount}:{},...m.warningCount!==void 0?{warningCount:m.warningCount}:{},...m.error?{error:m.error}:{}}),u(),n();return}let x=p.title.match(/^\[([^\]]+)\]/),$={id:p.id,timestamp:p.timestamp,severity:p.severity,...m.rule?{rule:m.rule}:x?.[1]?{rule:x[1]}:{},message:p.message??p.title,...p.location?.file?{file:p.location.file}:{},...p.location?.line!==void 0?{line:p.location.line}:{},...p.location?.column!==void 0?{column:p.location.column}:{},...f?{project:f}:{},fingerprint:p.fingerprint};if(p.severity==="error"||p.severity==="fatal")t.errors.set($.fingerprint,$),t.warnings.delete($.fingerprint);else if(p.severity==="warning")t.errors.has($.fingerprint)||t.warnings.set($.fingerprint,$);else return;t.lastRunAt=p.timestamp,t.sawVerdict=!0,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:t.errors.size>0?"failing":"clean"}),u(),n()},"handler"),d=e.bus.subscribe(l),c=o(()=>Wn({producers:[...t.producers.values()],domain:"lint",noProducerHint:wx}),"health");return e.resources.register(Bs,()=>({schemaVersion:1,revision:e.resources.revision(Bs)??0,updatedAt:new Date().toISOString(),status:t.status,errorCount:t.errors.size,warningCount:t.warnings.size,lastRunAt:t.lastRunAt,...c()})),e.resources.register(xs,()=>({schemaVersion:1,revision:e.resources.revision(xs)??0,updatedAt:new Date().toISOString(),errors:[...t.errors.values()],...c()})),e.resources.register(Cs,()=>({schemaVersion:1,revision:e.resources.revision(Cs)??0,updatedAt:new Date().toISOString(),warnings:[...t.warnings.values()],...c()})),{unsubscribe:d,uris:[Bs,xs,Cs]}}s(g6,"fg"),o(g6,"installLintReducer");import{App as Dx}from"@frontmcp/sdk";import{Resource as $x,ResourceContext as Bx}from"@frontmcp/sdk";var jc=class extends Bx{static{s(this,"mg")}static{o(this,"TypecheckCurrentResource")}async execute(){return this.get(Z).read("typecheck://current")}};jc=F([$x({name:"typecheck-current",uri:"typecheck://current",mimeType:"application/json",description:"Current TypeScript typecheck status + error count."})],jc);var xx=jc;import{Resource as Cx,ResourceContext as kx}from"@frontmcp/sdk";var zc=class extends kx{static{s(this,"gg")}static{o(this,"TypecheckErrorsResource")}async execute(){return this.get(Z).read("typecheck://errors")}};zc=F([Cx({name:"typecheck-errors",uri:"typecheck://errors",mimeType:"application/json",description:"Current TypeScript errors (deduped by fingerprint)."})],zc);var Ax=zc,v6=class{static{s(this,"yg")}static{o(this,"TypecheckApp")}};v6=F([Dx({id:"typecheck",name:"Typecheck",description:"TypeScript diagnostics from `tsc --watch`.",resources:[xx,Ax]})],v6);var ks="typecheck://current",As="typecheck://errors",Ix="Wire one: the dev cluster publishes from `TsgoCheckPlugin` when `LENSMCP_TYPECHECK=tsgo` (@lensmcp/cluster), or call `startTscCollector()` from @lensmcp/session for a `tsc --watch` workspace.";function y6(e){let t=e.raw;return t&&typeof t=="object"?t:{}}s(y6,"vz"),o(y6,"readRaw");function E6(e){let t={status:"unknown",errors:new Map,producers:new Map,sawVerdict:!1},r=o((p,m)=>{let f=t.producers.get(p),h={id:p,tool:m.tool,...m.project?{project:m.project}:{},firstReportedAt:f?.firstReportedAt??m.at,lastReportedAt:Math.max(f?.lastReportedAt??0,m.at),lastRunStatus:m.runStatus,errorCount:m.errorCount??f?.errorCount??0,...m.durationMs!==void 0?{lastRunDurationMs:m.durationMs}:f?.lastRunDurationMs!==void 0?{lastRunDurationMs:f.lastRunDurationMs}:{},...m.warningCount!==void 0?{warningCount:m.warningCount}:{},...m.error?{error:m.error}:{}};t.producers.set(p,h),Zt(t.producers,Lr)},"touchProducer"),i=o(p=>{if(!p){t.errors.clear();return}for(let[m,f]of t.errors)f.project===p&&t.errors.delete(m)},"clearScope"),u=o(()=>{if(t.errors.size>0){t.status="failing";return}let p=[...t.producers.values()].some(m=>m.lastRunStatus==="error");t.status=p||!t.sawVerdict?"unknown":"clean"},"recomputeStatus"),n=o(()=>{e.resources.markDirty(ks),e.resources.markDirty(As)},"markDirty"),a=o(p=>{let m=[...t.errors.values()].some(h=>h.project===p),f=[...t.producers.values()].some(h=>h.project===p);if(!(!m&&!f)){i(p);for(let[h,g]of t.producers)g.project===p&&t.producers.delete(h);t.sawVerdict=[...t.producers.values()].some(h=>h.lastRunStatus!=="error"),u(),n()}},"supersedeProject"),l=o(p=>{if(p.source==="gateway"&&p.category==="cluster"){let w=p.raw??null,k=w?.kind;(k==="service-starting"||k==="service-respawn")&&w?.project&&a(w.project);return}if(p.source!=="typescript"||p.category!=="typecheck")return;let m=y6(p),f=m.project,h=m.tool??"tsc",g=`${h}:${f??"*"}`,E=m.kind==="typecheck-run";if(p.severity==="info"&&(E&&m.phase==="start"||p.title.startsWith("tsc clear"))){i(f),t.lastRunAt=p.timestamp,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:"running"}),E||(t.sawVerdict=!0),u(),n();return}if(E&&m.phase==="end"){let w=m.status==="error"?"error":m.status==="failing"?"failing":"clean";w!=="error"&&(t.sawVerdict=!0),t.lastRunAt=p.timestamp,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:w,...m.durationMs!==void 0?{durationMs:m.durationMs}:{},...m.errorCount!==void 0?{errorCount:m.errorCount}:{},...m.warningCount!==void 0?{warningCount:m.warningCount}:{},...m.error?{error:m.error}:{}}),u(),n();return}if(p.severity!=="error"&&p.severity!=="fatal")return;let x=p.title.match(/\bTS(\d+):/),$={id:p.id,timestamp:p.timestamp,...m.code?{code:m.code}:x?{code:`TS${x[1]}`}:{},message:p.message??p.title,...p.location?.file?{file:p.location.file}:{},...p.location?.line!==void 0?{line:p.location.line}:{},...p.location?.column!==void 0?{column:p.location.column}:{},...f?{project:f}:{},fingerprint:p.fingerprint};t.errors.set($.fingerprint,$),t.lastRunAt=p.timestamp,t.sawVerdict=!0,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:"failing"}),u(),n()},"handler"),d=e.bus.subscribe(l),c=o(()=>Wn({producers:[...t.producers.values()],domain:"typecheck",noProducerHint:Ix}),"health");return e.resources.register(ks,()=>({schemaVersion:1,revision:e.resources.revision(ks)??0,updatedAt:new Date().toISOString(),status:t.status,errorCount:t.errors.size,lastRunAt:t.lastRunAt,...c()})),e.resources.register(As,()=>({schemaVersion:1,revision:e.resources.revision(As)??0,updatedAt:new Date().toISOString(),errors:[...t.errors.values()],...c()})),{unsubscribe:d,uris:[ks,As]}}s(E6,"bg"),o(E6,"installTypecheckReducer");import{App as _x}from"@frontmcp/sdk";import{Resource as Sx,ResourceContext as Fx}from"@frontmcp/sdk";var Nc=class extends Fx{static{s(this,"wg")}static{o(this,"BundleCurrentResource")}async execute(){return this.get(Z).read("bundle://current")}};Nc=F([Sx({name:"bundle-current",uri:"bundle://current",mimeType:"application/json",description:"Most recent Vite/Rollup bundle report (chunks + sizes)."})],Nc);var jx=Nc;import{Resource as zx,ResourceContext as Nx}from"@frontmcp/sdk";var Mc=class extends Nx{static{s(this,"$g")}static{o(this,"BundleChunksResource")}async execute(){return this.get(Z).read("bundle://chunks")}};Mc=F([zx({name:"bundle-chunks",uri:"bundle://chunks",mimeType:"application/json",description:"Per-chunk bundle sizes (most recent build)."})],Mc);var Mx=Mc;import{Resource as Ox,ResourceContext as Rx}from"@frontmcp/sdk";var Oc=class extends Rx{static{s(this,"kg")}static{o(this,"BundleModulesResource")}async execute(){return this.get(Z).read("bundle://modules")}};Oc=F([Ox({name:"bundle-modules",uri:"bundle://modules",mimeType:"application/json",description:"Flattened per-module bundle sizes (most recent build)."})],Oc);var Tx=Oc;import{Resource as Px,ResourceContext as Ux}from"@frontmcp/sdk";var Rc=class extends Ux{static{s(this,"Ig")}static{o(this,"BundleRegressionsResource")}async execute(){return this.get(Z).read("bundle://regressions")}};Rc=F([Px({name:"bundle-regressions",uri:"bundle://regressions",mimeType:"application/json",description:"Chunks/modules that grew, were added, or were removed vs the baseline."})],Rc);var qx=Rc;import{Resource as Zx,ResourceContext as Lx}from"@frontmcp/sdk";var Tc=class extends Lx{static{s(this,"Eg")}static{o(this,"BundleCompareResource")}async execute(){return this.get(Z).read("bundle://compare/latest")}};Tc=F([Zx({name:"bundle-compare-latest",uri:"bundle://compare/latest",mimeType:"application/json",description:"Most recent build vs baseline: totals + delta."})],Tc);var Vx=Tc,b6=class{static{s(this,"Ag")}static{o(this,"BundleApp")}};b6=F([_x({id:"bundle",name:"Bundle",description:"Vite/Rollup bundle reports + regressions against baseline.",resources:[jx,Mx,Tx,qx,Vx]})],b6);function Pc(e,t){let r=[],i=new Map(e.chunks.map(n=>[n.name,n])),u=new Map(t.chunks.map(n=>[n.name,n]));for(let[n,a]of u){let l=i.get(n);if(!l){r.push({kind:"chunk-added",name:n,afterBytes:a.sizeBytes,deltaBytes:a.sizeBytes});continue}let d=a.sizeBytes-l.sizeBytes;d>256&&r.push({kind:"chunk-grew",name:n,beforeBytes:l.sizeBytes,afterBytes:a.sizeBytes,deltaBytes:d}),r.push(...w6(l,a))}for(let[n,a]of i)u.has(n)||r.push({kind:"chunk-removed",name:n,beforeBytes:a.sizeBytes,deltaBytes:-a.sizeBytes});return r.sort((n,a)=>Math.abs(a.deltaBytes)-Math.abs(n.deltaBytes))}s(Pc,"Ia"),o(Pc,"compareReports");function w6(e,t){let r=[],i=new Map(e.modules.map(u=>[u.id,u.sizeBytes]));for(let u of t.modules){let n=i.get(u.id);if(n===void 0)u.sizeBytes>256&&r.push({kind:"module-added",name:`${t.name}::${u.id}`,afterBytes:u.sizeBytes,deltaBytes:u.sizeBytes});else{let a=u.sizeBytes-n;a>256&&r.push({kind:"module-grew",name:`${t.name}::${u.id}`,beforeBytes:n,afterBytes:u.sizeBytes,deltaBytes:a})}}return r}s(w6,"Tz"),o(w6,"compareModules");var Is="bundle://current",_s="bundle://chunks",Ss="bundle://modules",Qr="bundle://regressions",ei="bundle://compare/latest";function D6(e){let t={baseline:e.initialBaseline,regressions:[]},r=o(u=>{if(u.source!=="rollup"&&u.source!=="vite"||u.category!=="build")return;let n=u.raw;if(!n||typeof n!="object"||!("kind"in n)||n.kind!=="bundle-report")return;let a=n.report;!a||!Array.isArray(a.chunks)||(t.current=a,t.regressions=t.baseline?Pc(t.baseline,a):[],e.resources.markDirty(Is),e.resources.markDirty(_s),e.resources.markDirty(Ss),e.resources.markDirty(Qr),e.resources.markDirty(ei))},"handler"),i=e.bus.subscribe(r);return e.resources.register(Is,()=>({schemaVersion:1,revision:e.resources.revision(Is)??0,updatedAt:new Date().toISOString(),report:t.current??null})),e.resources.register(_s,()=>({schemaVersion:1,revision:e.resources.revision(_s)??0,updatedAt:new Date().toISOString(),chunks:t.current?.chunks??[]})),e.resources.register(Ss,()=>{let u=t.current?.chunks.flatMap(n=>n.modules.map(a=>({...a,chunk:n.name})))??[];return{schemaVersion:1,revision:e.resources.revision(Ss)??0,updatedAt:new Date().toISOString(),modules:u}}),e.resources.register(Qr,()=>({schemaVersion:1,revision:e.resources.revision(Qr)??0,updatedAt:new Date().toISOString(),regressions:t.regressions.slice()})),e.resources.register(ei,()=>({schemaVersion:1,revision:e.resources.revision(ei)??0,updatedAt:new Date().toISOString(),baseline:t.baseline??null,current:t.current??null,deltaBytes:t.baseline&&t.current?t.current.totalBytes-t.baseline.totalBytes:0})),{unsubscribe:i,uris:[Is,_s,Ss,Qr,ei],setBaseline:o(u=>{t.baseline=u,t.current&&(t.regressions=Pc(t.baseline,t.current)),e.resources.markDirty(Qr),e.resources.markDirty(ei)},"setBaseline")}}s(D6,"jg"),o(D6,"installBundleReducer");import{App as Jx}from"@frontmcp/sdk";import{Resource as Wx,ResourceContext as Gx}from"@frontmcp/sdk";var Uc=class extends Gx{static{s(this,"zg")}static{o(this,"RuntimeBrowserConsoleResource")}async execute(){return this.get(Z).read("runtime://browser/console")}};Uc=F([Wx({name:"runtime-browser-console",uri:"runtime://browser/console",mimeType:"application/json",description:"Most recent 200 console.* messages from any tab."})],Uc);var Kx=Uc;import{Resource as Hx,ResourceContext as Xx}from"@frontmcp/sdk";var qc=class extends Xx{static{s(this,"Mg")}static{o(this,"RuntimeBrowserErrorsResource")}async execute(){return this.get(Z).read("runtime://browser/errors")}};qc=F([Hx({name:"runtime-browser-errors",uri:"runtime://browser/errors",mimeType:"application/json",description:"Uncaught browser errors + promise rejections, per tab, since that tab's current page load (a reload retracts the previous document's errors)."})],qc);var Yx=qc;import{Resource as Qx,ResourceContext as eC}from"@frontmcp/sdk";var Zc=class extends eC{static{s(this,"Pg")}static{o(this,"RuntimeServerErrorsResource")}async execute(){return this.get(Z).read("runtime://errors")}};Zc=F([Qx({name:"runtime-errors",uri:"runtime://errors",mimeType:"application/json",description:"Errors raised INSIDE a backend pod, with no browser involved \u2014 the 500s a curl, an e2e runner or a queue job produces. Each entry carries the route, the status, the request id the gateway stamped, and the stack. Use this when a server-side call failed and no browser flow exists to explain it; `runtime://browser/errors` is the browser-side counterpart."})],Zc);var tC=Zc;import{Resource as uC,ResourceContext as rC}from"@frontmcp/sdk";var Lc=class extends rC{static{s(this,"Cg")}static{o(this,"RuntimeBrowserNetworkResource")}async execute(){return this.get(Z).read("runtime://browser/network")}};Lc=F([uC({name:"runtime-browser-network",uri:"runtime://browser/network",mimeType:"application/json",description:"Recent fetch / XHR / browser network activity."})],Lc);var iC=Lc;import{Resource as nC,ResourceContext as sC}from"@frontmcp/sdk";var Vc=class extends sC{static{s(this,"Lg")}static{o(this,"RuntimeBrowserFailedRequestsResource")}async execute(){return this.get(Z).read("runtime://browser/failed-requests")}};Vc=F([nC({name:"runtime-browser-failed-requests",uri:"runtime://browser/failed-requests",mimeType:"application/json",description:"Recent failed network requests (status >= 400 or transport errors)."})],Vc);var aC=Vc;import{Resource as oC,ResourceContext as lC}from"@frontmcp/sdk";var Jc=class extends lC{static{s(this,"Bg")}static{o(this,"RuntimeDismissedResource")}async execute(){return this.get(Z).read("runtime://dismissed")}};Jc=F([oC({name:"runtime-dismissed",uri:"runtime://dismissed",mimeType:"application/json",description:"Errors someone DISMISSED by hand \u2014 in the dashboard, at the CLI, or an agent through observe.dismiss_errors \u2014 with who did it and the reason they gave. A dismissed error is hidden from runtime://errors and the browser error lists, not fixed: it shows again the next time it happens. Read this when an error list is shorter than you expected."})],Jc);var dC=Jc,$6=class{static{s(this,"qg")}static{o(this,"RuntimeApp")}};$6=F([Jx({id:"runtime",name:"Runtime",description:"Live browser/node runtime state (console, errors, network).",resources:[Kx,Yx,tC,iC,aC,dC]})],$6);var Au="runtime://browser/console",wt="runtime://browser/errors",Iu="runtime://browser/network",Dt="runtime://browser/failed-requests",$t="runtime://errors",ti="runtime://dismissed",cC=200,B6=100,pC=200,mC=50,fC=500,hC="default",gC=1e3,Wc=o(e=>e??hC,"tabOf");function x6(e){if(e.category!=="runtime")return!1;let t=e.raw;return t&&typeof t=="object"&&t.kind==="ready"?!0:e.title==="Client runtime ready"}s(x6,"Wz"),o(x6,"isDocumentBoundary");function C6(e){if(e.category!=="runtime")return!1;let t=e.raw;return!!(t&&typeof t=="object"&&t.kind==="gone")}s(C6,"Xz"),o(C6,"isTabGone");function k6(e){let t=(e.now??(()=>Date.now()))(),r={console:[],errors:[],network:[],failed:[],serverErrors:[],readyByTab:new Map,dismissed:new Map,changedAt:new Map},i=o((c,p)=>{r.changedAt.set(c,p),e.resources.markDirty(c)},"touch"),u=o((c,p,m)=>{let f=c.filter(h=>!(Wc(h.tabId)===p&&h.timestamp<m));f.length!==c.length&&(c.length=0,c.push(...f))},"retract"),n=o(c=>{let p=bd(c);if(p){let f=r.dismissed.get(p.groupId);r.dismissed.delete(p.groupId),p.kind===$u&&(r.dismissed.set(p.groupId,{eventIds:new Set(p.eventIds),at:c.timestamp,...p.by?{by:p.by}:{},...p.reason?{reason:p.reason}:{},...p.title?{title:p.title}:{}}),r.dismissed.size>fC&&r.dismissed.delete(r.dismissed.keys().next().value));let h=new Set([...f?.eventIds??[],...r.dismissed.get(p.groupId)?.eventIds??[]]);for(let[g,E]of[[$t,r.serverErrors],[wt,r.errors],[Dt,r.failed]])E.some(x=>h.has(x.id))&&i(g,c.timestamp);i(ti,c.timestamp);return}if(A6(c)){let f=c.raw?.project;if(f){let h=r.serverErrors.length;r.serverErrors=r.serverErrors.filter(g=>g.project!==f),r.serverErrors.length!==h&&i($t,c.timestamp)}return}if(I6(c)){r.lastServerEventAt=Math.max(r.lastServerEventAt??0,c.timestamp),_u(r.serverErrors,_6(c),B6),i($t,c.timestamp);return}if(!(c.source==="client-runtime"||c.source==="chrome")&&!(c.source==="react"&&c.category==="network"))return;if(r.lastEventAt=Math.max(r.lastEventAt??0,c.timestamp),C6(c)){let f=Wc(c.context.tabId);u(r.errors,f,Number.POSITIVE_INFINITY),u(r.failed,f,Number.POSITIVE_INFINITY),r.readyByTab.delete(f);for(let h of[wt,Dt,Au,Iu])i(h,c.timestamp);return}if(x6(c)){let f=Wc(c.context.tabId);r.readyByTab.set(f,Math.max(r.readyByTab.get(f)??0,c.timestamp)),r.lastReadyAt=Math.max(r.lastReadyAt??0,c.timestamp);let h=c.timestamp-gC;u(r.errors,f,h),u(r.failed,f,h);for(let g of[wt,Dt,Au,Iu])i(g,c.timestamp);return}let m={id:c.id,timestamp:c.timestamp,severity:c.severity,title:c.title,message:c.message,source:c.source,fingerprint:c.fingerprint,tabId:c.context.tabId,url:c.context.url,raw:c.raw};if(c.category==="network"){_u(r.network,m,pC),i(Iu,c.timestamp),c.severity==="error"&&(_u(r.failed,m,mC),i(Dt,c.timestamp));return}(c.severity==="error"||c.severity==="fatal")&&(_u(r.errors,m,B6),i(wt,c.timestamp)),c.title?.startsWith("console.")&&(_u(r.console,m,cC),i(Au,c.timestamp))},"handler"),a=e.bus.subscribe(n),l=new Set([$t,wt,Dt]),d=o((c,p)=>{if(!l.has(c)||r.dismissed.size===0)return Kc(e.resources,c,p,r,t,0);let m=new Set([...r.dismissed.values()].flatMap(h=>[...h.eventIds])),f=p.filter(h=>!m.has(h.id));return Kc(e.resources,c,f,r,t,p.length-f.length)},"snap");return e.resources.register($t,()=>d($t,r.serverErrors)),e.resources.register(Au,()=>d(Au,r.console)),e.resources.register(wt,()=>d(wt,r.errors)),e.resources.register(Iu,()=>d(Iu,r.network)),e.resources.register(Dt,()=>d(Dt,r.failed)),e.resources.register(ti,()=>{let c=new Set([...r.serverErrors,...r.errors,...r.failed].map(m=>m.id)),p=[...r.dismissed].map(([m,f])=>({id:m,at:f.at,...f.by?{by:f.by}:{},...f.reason?{reason:f.reason}:{},...f.title?{title:f.title}:{},eventIds:[...f.eventIds],hiding:[...f.eventIds].filter(h=>c.has(h)).length}));return{schemaVersion:1,revision:e.resources.revision(ti)??0,updatedAt:new Date(r.changedAt.get(ti)??t).toISOString(),count:p.length,dismissals:p,detail:p.length?`${p.length} dismissal${p.length===1?"":"s"} in effect \u2014 hidden, not fixed. Each error shows again the next time it happens; undo one with observe.restore_errors.`:"Nothing has been dismissed."}}),{unsubscribe:a,uris:[Au,wt,Iu,Dt,$t,ti]}}s(k6,"Jg"),o(k6,"installRuntimeReducer");function Gc(e){let t=e.raw??null,r=e.context;return t?.project??r.projectName}s(Gc,"B_"),o(Gc,"projectOf");function A6(e){if(e.source!=="gateway"||e.category!=="cluster")return!1;let t=e.raw?.kind;return t==="service-starting"||t==="service-respawn"}s(A6,"Hz"),o(A6,"isGenerationBoundary");function I6(e){if(e.source!=="nestjs"||e.severity!=="error"&&e.severity!=="fatal")return!1;let t=e.raw??{};return t.kind==="server-request"||t.kind==="uncaught"?!0:t.kind!=="log"?!1:t.request?.error?!0:/\b[A-Za-z0-9_$]*(?:Error|Exception)\b|\b(?:ERROR|FATAL)\b/.test(e.title??"")}s(I6,"Yz"),o(I6,"isServerError");function _6(e){let t=(e.raw??{}).request??{},r=t.error;return{id:e.id,timestamp:e.timestamp,severity:e.severity,title:e.title,message:e.message??r?.message,source:e.source,fingerprint:e.fingerprint,...e.context.requestId?{requestId:e.context.requestId}:{},...Gc(e)?{project:Gc(e)}:{},...typeof t.route=="string"?{route:t.route}:{},...typeof t.status=="number"?{status:t.status}:{},...typeof t.outcome=="string"?{outcome:t.outcome}:{},...r?.stack?{stack:r.stack}:{},raw:e.raw}}s(_6,"Qz"),o(_6,"serverEntry");function Kc(e,t,r,i,u,n){let a=t===$t,l=a?i.lastServerEventAt:i.lastEventAt,d=l!==void 0;return{schemaVersion:1,revision:e.revision(t)??0,updatedAt:new Date(i.changedAt.get(t)??u).toISOString(),count:r.length,entries:r.slice(),...n>0?{dismissedCount:n}:{},producer:d?"connected":"none",lastEventAt:l,lastReadyAt:i.lastReadyAt,detail:a?d?r.length===0?"No server-side errors held. Pods HAVE reported, but a new pod generation retracts the errors of the one it replaced \u2014 so this is NOT evidence the routes are healthy: nobody may have re-made the failing request since."+Fs(n):`${r.length} server-side error${r.length===1?"":"s"} from ${new Set(r.map(c=>c.project??"unknown")).size} project${new Set(r.map(c=>c.project??"unknown")).size===1?"":"s"}`+Fs(n):"No pod has ever reported into this session \u2014 this is NOT evidence the backend is healthy, nothing is watching. Run the backend under the dev cluster so pod errors reach this session.":d?`browser attached; ${r.length} entr${r.length===1?"y":"ies"} from ${i.readyByTab.size} open tab${i.readyByTab.size===1?"":"s"}`+(i.lastReadyAt===void 0?" (no page load observed yet)":"")+Fs(n):"No browser has ever reported into this session \u2014 this is NOT evidence the app is healthy, nothing is watching. Open the app under the dev cluster (or the Vite dev server with @lensmcp/vite-plugin installed) so browser events reach this session."}}s(Kc,"Z_"),o(Kc,"snapshot");function Fs(e){return e>0?` \u2014 ${e} more dismissed by hand in the dashboard (hidden, not fixed)`:""}s(Fs,"Gg"),o(Fs,"dismissedNote");function _u(e,t,r){e.push(t),e.length>r&&e.splice(0,e.length-r)}s(_u,"Oo"),o(_u,"pushBounded");import{App as vC}from"@frontmcp/sdk";import{Resource as yC,ResourceContext as EC}from"@frontmcp/sdk";var Hc=class extends EC{static{s(this,"Kg")}static{o(this,"BrowserTabsResource")}async execute(){return this.get(Z).read("browser://tabs")}};Hc=F([yC({name:"browser-tabs",uri:"browser://tabs",mimeType:"application/json",description:"Open browser tabs with per-tab status, url, and event counts. `status` reflects the tab's CURRENT page load \u2014 a reload resets it."})],Hc);var bC=Hc;import{Resource as wC,ResourceContext as DC}from"@frontmcp/sdk";var Xc=class extends DC{static{s(this,"Xg")}static{o(this,"BrowserActiveTabResource")}async execute(){return this.get(Z).read("browser://active-tab")}};Xc=F([wC({name:"browser-active-tab",uri:"browser://active-tab",mimeType:"application/json",description:"The currently-focused browser tab."})],Xc);var $C=Xc,S6=class{static{s(this,"Yg")}static{o(this,"BrowserApp")}};S6=F([vC({id:"browser",name:"Browser",description:"Per-tab browser state (multi-tab refinement comes in Phase 6).",resources:[bC,$C]})],S6);var Bt="browser://tabs",xt="browser://active-tab";function F6(e){if(e.category!=="runtime")return!1;let t=e.raw;return t&&typeof t=="object"&&t.kind==="ready"?!0:e.title==="Client runtime ready"}s(F6,"iO"),o(F6,"isDocumentBoundary");function j6(e){if(e.category!=="runtime")return!1;let t=e.raw;return!!(t&&typeof t=="object"&&t.kind==="gone")}s(j6,"sO"),o(j6,"isTabGone");function z6(e){let t=(e.now??(()=>Date.now()))(),r={tabs:new Map,changedAt:new Map},i=o(a=>{if(a.source!=="chrome"&&a.source!=="client-runtime")return;let l=a.context.tabId??"default";if(j6(a)){if(r.tabs.delete(l),r.activePageId===l){let c=[...r.tabs.keys()];r.activePageId=c[c.length-1]}r.lastEventAt=Math.max(r.lastEventAt??0,a.timestamp),r.changedAt.set(Bt,a.timestamp),r.changedAt.set(xt,a.timestamp),e.resources.markDirty(Bt),e.resources.markDirty(xt);return}let d=r.tabs.get(l);if(d||(d={pageId:l,url:a.context.url??"",status:"unknown",unreadEvents:0,totalEvents:0,loads:0}),r.tabs.delete(l),r.tabs.set(l,d),r.tabs.size>100){let c=r.tabs.keys().next().value;c!==void 0&&c!==l&&r.tabs.delete(c)}a.context.url&&(d.url=a.context.url),d.totalEvents+=1,d.lastEventAt=a.timestamp,r.activePageId=l,r.lastEventAt=Math.max(r.lastEventAt??0,a.timestamp),F6(a)?(d.status="clean",d.unreadEvents=0,d.loads+=1,d.lastReadyAt=a.timestamp):(d.unreadEvents+=1,a.severity==="error"||a.severity==="fatal"?d.status="failing":d.status!=="failing"&&a.severity==="warning"?d.status="warning":d.status==="unknown"&&(d.status="clean")),r.changedAt.set(Bt,a.timestamp),r.changedAt.set(xt,a.timestamp),e.resources.markDirty(Bt),e.resources.markDirty(xt)},"handler"),u=e.bus.subscribe(i),n=o(a=>new Date(r.changedAt.get(a)??t).toISOString(),"stamp");return e.resources.register(Bt,()=>({schemaVersion:1,revision:e.resources.revision(Bt)??0,updatedAt:n(Bt),activePageId:r.activePageId,tabs:[...r.tabs.values()],lastEventAt:r.lastEventAt,producer:r.lastEventAt===void 0?"none":"connected"})),e.resources.register(xt,()=>{let a=r.activePageId;return{schemaVersion:1,revision:e.resources.revision(xt)??0,updatedAt:n(xt),tab:a?r.tabs.get(a)??null:null,lastEventAt:r.lastEventAt,producer:r.lastEventAt===void 0?"none":"connected"}}),{unsubscribe:u,uris:[Bt,xt]}}s(z6,"Qg"),o(z6,"installBrowserReducer");import{App as BC}from"@frontmcp/sdk";import{Resource as xC,ResourceContext as CC}from"@frontmcp/sdk";var Yc=class extends CC{static{s(this,"ev")}static{o(this,"NestProvidersResource")}async execute(){return this.get(Z).read("nest://providers")}};Yc=F([xC({name:"nest-providers",uri:"nest://providers",mimeType:"application/json",description:"All known NestJS singleton-instance generations (with lifecycle)."})],Yc);var kC=Yc;import{Resource as AC,ResourceContext as IC}from"@frontmcp/sdk";var Qc=class extends IC{static{s(this,"rv")}static{o(this,"NestRequestsResource")}async execute(){return this.get(Z).read("nest://requests/recent")}};Qc=F([AC({name:"nest-requests-recent",uri:"nest://requests/recent",mimeType:"application/json",description:"Last 50 NestJS server requests with status + duration."})],Qc);var _C=Qc,N6=class{static{s(this,"ov")}static{o(this,"NestApp")}};N6=F([BC({id:"nest",name:"Nest",description:"NestJS providers, request lifecycle, singleton generations.",resources:[kC,_C]})],N6);var js="nest://providers",zs="nest://requests/recent";function M6(e){let t={providers:new Map,recentRequests:[]},r=o(u=>{if(u.source!=="nestjs")return;let n=u.raw??null;if(n?.kind==="singleton-instance"&&n.provider){let a=n.provider;if(t.providers.delete(a.instanceId),t.providers.set(a.instanceId,{...a}),t.providers.size>500){for(let l of t.providers.keys())if(t.providers.delete(l),t.providers.size<=500)break}e.resources.markDirty(js);return}if(n?.kind==="server-request"&&n.request){let a={...n.request,fingerprint:u.fingerprint,id:u.id};t.recentRequests.push(a),t.recentRequests.length>50&&t.recentRequests.splice(0,t.recentRequests.length-50),e.resources.markDirty(zs);return}},"handler"),i=e.bus.subscribe(r);return e.resources.register(js,()=>({schemaVersion:1,revision:e.resources.revision(js)??0,updatedAt:new Date().toISOString(),providers:[...t.providers.values()]})),e.resources.register(zs,()=>({schemaVersion:1,revision:e.resources.revision(zs)??0,updatedAt:new Date().toISOString(),requests:t.recentRequests.slice()})),{unsubscribe:i,uris:[js,zs]}}s(M6,"iv"),o(M6,"installNestReducer");import{App as SC}from"@frontmcp/sdk";import{Resource as FC,ResourceContext as jC}from"@frontmcp/sdk";var ep=class extends jC{static{s(this,"sv")}static{o(this,"TraceRecentResource")}async execute(){return this.get(Z).read("trace://recent")}};ep=F([FC({name:"trace-recent",uri:"trace://recent",mimeType:"application/json",description:"Last 100 trace spans (flattened)."})],ep);var zC=ep;import{Resource as NC,ResourceContext as MC}from"@frontmcp/sdk";var tp=class extends MC{static{s(this,"cv")}static{o(this,"TraceFailedResource")}async execute(){return this.get(Z).read("trace://failed")}};tp=F([NC({name:"trace-failed",uri:"trace://failed",mimeType:"application/json",description:"Trace spans that ended with status=error."})],tp);var OC=tp,O6=class{static{s(this,"lv")}static{o(this,"TraceApp")}};O6=F([SC({id:"trace",name:"Trace",description:"Cross-process span timeline (Phase 3 \u2014 flat; Phase 7 promotes to multi-axis graph).",resources:[zC,OC]})],O6);var Ns="trace://recent",Ms="trace://failed";function R6(e){let t={recent:[],failed:[]},r=o(u=>{let n=u.raw??null;if(!n||n.kind!=="span"||!n.span?.name)return;let a={id:u.id,traceId:n.span.traceId,parentSpanId:n.span.parentSpanId,flowId:n.span.flowId??u.context.flowId,requestId:n.span.requestId??u.context.requestId,name:n.span.name,source:u.source,startTime:n.span.startTime??u.timestamp,endTime:n.span.endTime,durationMs:n.span.durationMs,status:n.span.status??(u.severity==="error"?"error":"ok")};up(t.recent,a,100),a.status==="error"&&up(t.failed,a,50),e.resources.markDirty(Ns),a.status==="error"&&e.resources.markDirty(Ms)},"handler"),i=e.bus.subscribe(r);return e.resources.register(Ns,()=>({schemaVersion:1,revision:e.resources.revision(Ns)??0,updatedAt:new Date().toISOString(),spans:t.recent.slice()})),e.resources.register(Ms,()=>({schemaVersion:1,revision:e.resources.revision(Ms)??0,updatedAt:new Date().toISOString(),spans:t.failed.slice()})),{unsubscribe:i,uris:[Ns,Ms]}}s(R6,"dv"),o(R6,"installTraceReducer");function up(e,t,r){e.push(t),e.length>r&&e.splice(0,e.length-r)}s(up,"q_"),o(up,"pushBounded");import{App as RC}from"@frontmcp/sdk";import{Resource as TC,ResourceContext as PC}from"@frontmcp/sdk";var rp=class extends PC{static{s(this,"pv")}static{o(this,"PerfSlowRoutesResource")}async execute(){return this.get(Z).read("perf://slow-routes")}};rp=F([TC({name:"perf-slow-routes",uri:"perf://slow-routes",mimeType:"application/json",description:"Routes that are slow NOW (\u2265 threshold on their latest call, or repeatedly lately). A one-off spike is retracted once later calls prove the route recovered; worstEver keeps the history."})],rp);var UC=rp;import{Resource as qC,ResourceContext as ZC}from"@frontmcp/sdk";var ip=class extends ZC{static{s(this,"mv")}static{o(this,"PerfDuplicateRequestsResource")}async execute(){return this.get(Z).read("perf://duplicate-requests")}};ip=F([qC({name:"perf-duplicate-requests",uri:"perf://duplicate-requests",mimeType:"application/json",description:"Endpoints one page called SEVERAL TIMES CONCURRENTLY \u2014 the missing-dedupe signal (a hook fetching outside the shared resource cache, multiplied by however many components mount it). Concurrency, not count: sequential repeats are a caching question and are not reported. The threshold sits above 2 so React StrictMode\u2019s double-invoke never fires it. Two consecutive clean loads retract a finding, so a fix clears it without a restart."})],ip);var LC=ip,T6=class{static{s(this,"gv")}static{o(this,"PerfApp")}};T6=F([RC({id:"perf",name:"Perf",description:"Performance signals: slow server routes, and endpoints one page calls concurrently (the missing-dedupe signal).",resources:[UC,LC]})],T6);var Os="perf://slow-routes",Rs=20,P6=2,VC=200;function U6(e){let t=Ye(e.thresholds).slowRouteMs,r=(e.now??(()=>Date.now()))(),i={routes:new Map},u=o(d=>{let c=d.raw??null;if(c?.kind!=="server-request"||!c.request)return;let{method:p,route:m}=c.request,f=c.request.durationMs??0,h=`${p} ${m}`,g=i.routes.get(h);if(g||(g={method:p,route:m,recent:[],samples:0,slowSamples:0,lastDurationMs:f,lastSeenAt:d.timestamp,worstEverMs:0,worstEverAt:d.timestamp}),i.routes.delete(h),i.routes.set(h,g),g.recent.push(f),g.recent.length>Rs&&g.recent.splice(0,g.recent.length-Rs),g.samples+=1,f>=t&&(g.slowSamples+=1),g.lastDurationMs=f,g.lastSeenAt=d.timestamp,f>g.worstEverMs&&(g.worstEverMs=f,g.worstEverAt=d.timestamp),i.routes.size>VC){let E=i.routes.keys().next().value;E!==void 0&&i.routes.delete(E)}i.lastSampleAt=Math.max(i.lastSampleAt??0,d.timestamp),i.changedAt=d.timestamp,e.resources.markDirty(Os)},"handler"),n=e.bus.subscribe(u),a=o(d=>d.recent.reduce((c,p)=>p>=t?c+1:c,0),"recentSlowCount"),l=o(d=>d.lastDurationMs>=t||a(d)>=P6,"currentlySlow");return e.resources.register(Os,()=>{let d=[...i.routes.values()].filter(l);return{schemaVersion:1,revision:e.resources.revision(Os)??0,updatedAt:new Date(i.changedAt??r).toISOString(),thresholdMs:t,routes:d.map(c=>({method:c.method,route:c.route,worstRecentMs:Math.max(...c.recent),lastDurationMs:c.lastDurationMs,lastSeenAt:c.lastSeenAt,samples:c.samples,slowSamples:c.slowSamples,recentSlowSamples:a(c),worstEverMs:c.worstEverMs,worstEverAt:c.worstEverAt})).sort((c,p)=>p.worstRecentMs-c.worstRecentMs),routesTracked:i.routes.size,recentSampleWindow:Rs,minRecentSlowToKeep:P6,lastSampleAt:i.lastSampleAt,producer:i.lastSampleAt===void 0?"none":"connected",detail:i.lastSampleAt===void 0?"No server request has ever been observed \u2014 this is NOT evidence the backend is fast, nothing is watching. Run the backend under the dev cluster (or with @lensmcp/nest-instrumentation) so request timings reach this session.":`${i.routes.size} route${i.routes.size===1?"":"s"} observed; ${d.length} slow in the last ${Rs} calls each (\u2265${t}ms).`}}),{unsubscribe:n,uris:[Os]}}s(U6,"vv"),o(U6,"installPerfReducer");var Ts="perf://duplicate-requests",np=10,q6=2,JC=200,Z6=300,WC=new Set(["t","_","cacheBust","ts"]),GC=8,L6=2,KC="react";function V6(e,t){return t.start<=e.end+L6&&t.end>=e.start-L6}s(V6,"RO"),o(V6,"sameRequest");function J6(e){try{let t=new URL(e,"http://lensmcp.invalid");for(let u of[...t.searchParams.keys()])WC.has(u)&&t.searchParams.delete(u);let r=t.searchParams.toString(),i=`${t.pathname}${r?`?${r}`:""}`;return t.host==="lensmcp.invalid"?i:`${t.origin}${i}`}catch{return e}}s(J6,"W_"),o(J6,"normalizeRequestUrl");function W6(e){if(e.length===0)return 0;let t=[];for(let{start:u,end:n}of e)t.push({at:u,delta:1}),t.push({at:n+1,delta:-1});t.sort((u,n)=>u.at-n.at||u.delta-n.delta);let r=0,i=0;for(let{delta:u}of t)r+=u,r>i&&(i=r);return i}s(W6,"X_"),o(W6,"peakConcurrency");function G6(e){let t=Ye(e.thresholds).duplicateRequestPeak,r=(e.now??(()=>Date.now()))(),i={endpoints:new Map},u=o((p,m,f)=>{p.open.delete(m),f.windows.length!==0&&(p.recentPeaks.push(f.peak),p.recentPeaks.length>np&&p.recentPeaks.splice(0,p.recentPeaks.length-np))},"closeFlow"),n=o(p=>{if(p.source!==KC||p.category!=="network")return;let m=p.raw??null;if(m?.kind!=="fetch-done"&&m?.kind!=="fetch-error"||!m.url||!m.method)return;let f=J6(m.url),h=m.method.toUpperCase();if(typeof m.startedAt!="number")return;let g=m.startedAt,E=g+(typeof m.durationMs=="number"?m.durationMs:0),x=p.context?.originNodeId??null,$=p.context?.flowId??null,w=p.context?.tabId??"-",k=m.requestId??p.context?.requestId,C=k?`${w}|${k}`:void 0,M=`${h} ${f} @ ${x??"-"}`,y=i.endpoints.get(M);y||(y={method:h,url:f,originNodeId:x,open:new Map,recentPeaks:[],totalRequests:0,repeatedReceipts:0,lastSeenAt:p.timestamp,worstEverPeak:0,worstEverAt:p.timestamp}),i.endpoints.delete(M),i.endpoints.set(M,y);let D=y.open.get(w);if(D&&D.flowId!==$&&(u(y,w,D),D=void 0),D||(D={flowId:$,windows:[],byIdentity:new Map,peak:0}),y.open.delete(w),y.open.set(w,D),y.open.size>GC){let[N,K]=y.open.entries().next().value;u(y,N,K)}let A={start:g,end:E},j=C?D.byIdentity.get(C):void 0;if(j&&V6(j,A))j.start=Math.min(j.start,g),j.end=Math.max(j.end,E),y.repeatedReceipts+=1;else{let N=C?{...A,identity:C}:A;if(D.windows.push(N),C&&D.byIdentity.set(C,N),D.windows.length>Z6)for(let K of D.windows.splice(0,D.windows.length-Z6))K.identity&&D.byIdentity.get(K.identity)===K&&D.byIdentity.delete(K.identity);y.totalRequests+=1}if(D.peak=W6(D.windows),y.lastSeenAt=p.timestamp,D.peak>y.worstEverPeak&&(y.worstEverPeak=D.peak,y.worstEverAt=p.timestamp),i.endpoints.size>JC){let N=i.endpoints.keys().next().value;N!==void 0&&i.endpoints.delete(N)}i.lastSampleAt=Math.max(i.lastSampleAt??0,p.timestamp),i.changedAt=p.timestamp,e.resources.markDirty(Ts)},"handler"),a=e.bus.subscribe(n),l=o(p=>[...p.open.values()].filter(m=>m.windows.length>0).map(m=>m.peak),"openPeaks"),d=o(p=>{let m=[...p.recentPeaks,...l(p)],f=0;for(let h=m.length-1;h>=0&&!((m[h]??0)>=t);h-=1)f+=1;return f},"consecutiveCleanFlows"),c=o(p=>p.worstEverPeak>=t&&d(p)<q6,"currentlyDuplicated");return e.resources.register(Ts,()=>{let p=[...i.endpoints.values()].filter(c);return{schemaVersion:1,revision:e.resources.revision(Ts)??0,updatedAt:new Date(i.changedAt??r).toISOString(),peakThreshold:t,endpoints:p.map(m=>({method:m.method,url:m.url,originNodeId:m.originNodeId,peakConcurrent:l(m).at(-1)??0,cleanFlowsSince:d(m),flowsObserved:m.recentPeaks.length+l(m).length,totalRequests:m.totalRequests,repeatedReceipts:m.repeatedReceipts,worstEverPeak:m.worstEverPeak,worstEverAt:m.worstEverAt,lastSeenAt:m.lastSeenAt})).sort((m,f)=>f.peakConcurrent-m.peakConcurrent),endpointsTracked:i.endpoints.size,recentFlowWindow:np,minCleanFlowsToRetract:q6,lastSampleAt:i.lastSampleAt,producer:i.lastSampleAt===void 0?"none":"connected",detail:i.lastSampleAt===void 0?"No browser fetch has ever been observed \u2014 this is NOT evidence the app fetches cleanly, nothing is watching. Load a page under the dev cluster so flow-fetch events reach this session.":p.length===0?`${i.endpoints.size} endpoint${i.endpoints.size===1?"":"s"} observed; none exceeded ${t} concurrent identical calls.`:`${p.length} endpoint${p.length===1?"":"s"} called \u2265${t}\xD7 concurrently \u2014 usually a hook fetching outside the shared resource cache, multiplied by however many components mount it.`}}),{unsubscribe:a,uris:[Ts]}}s(G6,"bv"),o(G6,"installDuplicateRequestsReducer");import{App as HC}from"@frontmcp/sdk";import{Resource as XC,ResourceContext as YC}from"@frontmcp/sdk";var sp=class extends YC{static{s(this,"wv")}static{o(this,"DbSlowQueriesResource")}async execute(){return this.get(Z).read("db://slow-queries")}};sp=F([XC({name:"db-slow-queries",uri:"db://slow-queries",mimeType:"application/json",description:"Query shapes (project\xB7op\xB7table) whose worst observed duration crosses the slowQueryMs threshold, aggregated live from the pg instrumentation. counts are an undercount for hot shapes (the emitter flood-guards per shape); suppressedEvents carries the drop count."})],sp);var QC=sp;import{Resource as ek,ResourceContext as tk}from"@frontmcp/sdk";var ap=class extends tk{static{s(this,"$v")}static{o(this,"DbAnalysisResource")}async execute(){return this.get(Z).read("db://analysis")}};ap=F([ek({name:"db-analysis",uri:"db://analysis",mimeType:"application/json",description:"The latest DB analyzer run per project (missing indexes, seq-scan hot spots, unused indexes, migration-parity drift, slow statements) \u2014 ingested from the workspace analyzer's `db-analyze-run` events on the lens bus file."})],ap);var uk=ap,K6=class{static{s(this,"kv")}static{o(this,"DbApp")}};K6=F([HC({id:"db",name:"Db",description:"Database signals: slow query shapes observed live from the pg instrumentation, and the latest externally-ingested analyzer run (missing indexes, migration parity, unused indexes).",resources:[QC,uk]})],K6);var ui="db://slow-queries",Ps="db://analysis",H6=50,rk=20,ik=200,nk=1e3,sk=["statements","failed","workMs","recorded","suppressed","unwritten"];function X6(e){let t=e[yd];if(!t)return;let r=Array.isArray(t.paths)?t.paths:[];for(let i of r){let u=typeof i=="string"?/^findings\[\] \(\+(\d+) items dropped\)$/.exec(i):null;if(u)return Number(u[1])}return r.some(i=>typeof i=="string"&&i.startsWith("findings"))?0:void 0}s(X6,"DO"),o(X6,"findingsDroppedByClamp");function Y6(e){let t=Ye(e.thresholds).slowQueryMs,r=(e.now??(()=>Date.now()))(),i={shapes:new Map,analyzeRuns:new Map,accounts:new Map,accountsSeen:0,census:{statements:0,failed:0,workMs:0,recorded:0,suppressed:0,unwritten:0}},u=o(l=>{let d=l.raw??null;if(d){if(d.kind==="db-query"){let c=d.project??"unknown",p=d.op??"query",m=d.table??"query",f=d.durationMs??0,h=`${c}|${p}|${m}`,g=i.shapes.get(h);if(g||(g={project:c,op:p,table:m,count:0,errorCount:0,totalMs:0,maxMs:0,maxAt:l.timestamp,recent:[],rowsTotal:0,lastSql:"",lastDurationMs:0,lastSeenAt:l.timestamp,suppressed:0}),i.shapes.delete(h),i.shapes.set(h,g),g.count+=1,d.error!==void 0&&(g.errorCount+=1),g.totalMs+=f,f>g.maxMs&&(g.maxMs=f,g.maxAt=l.timestamp),g.recent.push(f),g.recent.length>H6&&g.recent.splice(0,g.recent.length-H6),g.rowsTotal+=d.rows??0,d.query&&(g.lastSql=d.query),g.lastDurationMs=f,g.lastSeenAt=l.timestamp,g.suppressed+=d.floodSuppressed??0,i.shapes.size>ik){let E=i.shapes.keys().next().value;E!==void 0&&i.shapes.delete(E)}i.lastQueryAt=Math.max(i.lastQueryAt??0,l.timestamp),i.changedAt=l.timestamp,e.resources.markDirty(ui);return}if(d.kind==="db-request-account"){let c=d,p=typeof c.accountId=="string"?c.accountId:l.id,m=typeof c.seq=="number"?c.seq:0,f=i.accounts.get(p);if(f&&f.seq>=m)return;let h={seq:m,statements:0,failed:0,workMs:0,recorded:0,suppressed:0,unwritten:0};for(let g of sk){let E=c[g];h[g]=typeof E=="number"&&Number.isFinite(E)?E:0,i.census[g]+=h[g]-(f?.[g]??0)}if(f||(i.accountsSeen+=1),i.accounts.delete(p),i.accounts.set(p,h),i.accounts.size>nk){let g=i.accounts.keys().next().value;g!==void 0&&i.accounts.delete(g)}i.changedAt=l.timestamp,e.resources.markDirty(ui);return}if(d.kind==="db-analyze-run"){let c=d.project??"unknown",p=X6(d);i.analyzeRuns.set(c,{project:c,runAt:d.runAt??l.timestamp,tool:d.tool??"unknown",findings:Array.isArray(d.findings)?d.findings:[],...p!==void 0?{droppedFindings:p}:{}}),Zt(i.analyzeRuns,Lr),i.lastAnalyzeAt=Math.max(i.lastAnalyzeAt??0,l.timestamp),i.changedAt=l.timestamp,e.resources.markDirty(Ps)}}},"handler"),n=e.bus.subscribe(u),a=o(l=>{if(l.length===0)return 0;let d=[...l].sort((c,p)=>c-p);return d[Math.min(d.length-1,Math.floor(d.length*.95))]??0},"p95");return e.resources.register(ui,()=>{let l=[...i.shapes.values()].filter(d=>d.maxMs>=t);return{schemaVersion:1,revision:e.resources.revision(ui)??0,updatedAt:new Date(i.changedAt??r).toISOString(),thresholdMs:t,queries:l.map(d=>({project:d.project,op:d.op,table:d.table,count:d.count,errorCount:d.errorCount,maxMs:d.maxMs,maxAt:d.maxAt,avgMs:Math.round(d.totalMs/Math.max(d.count,1)*10)/10,p95Ms:a(d.recent),rowsTotal:d.rowsTotal,lastDurationMs:d.lastDurationMs,lastSeenAt:d.lastSeenAt,lastSql:d.lastSql,suppressedEvents:d.suppressed})).sort((d,c)=>c.maxMs-d.maxMs).slice(0,rk),shapesTracked:i.shapes.size,...i.accountsSeen>0?{requestAccounting:{requests:i.accountsSeen,...i.census}}:{},note:"count/avg are an UNDERCOUNT for hot shapes: the emitter flood-guards each query-shape fingerprint at 30 burst / 5 events/s; suppressedEvents is the emitter's own count of dropped events, reported by the next admitted event of the shape \u2014 drops with none after them are missing from it. requestAccounting, when present, is the requests' own census (statements run vs recorded on the bus), exact including those; per flow, read flow.get's overview.sql.",lastSampleAt:i.lastQueryAt,producer:i.lastQueryAt===void 0?"none":"connected",detail:i.lastQueryAt===void 0?"No db-query event has ever been observed \u2014 this is NOT evidence queries are fast, nothing is watching. Run the backend under the dev cluster (the @lensmcp/cluster serve preload taps pg) so query timings reach this session.":`${i.shapes.size} query shape${i.shapes.size===1?"":"s"} observed; ${l.length} with a worst duration \u2265${t}ms.`}}),e.resources.register(Ps,()=>{let l=[...i.analyzeRuns.values()].sort((x,$)=>$.runAt-x.runAt),d=l.flatMap(x=>x.findings),c=d.length,p=d.filter(x=>x.severity==="error").length,m=d.filter(x=>x.severity==="warning").length,f=c-p-m,h=l.filter(x=>x.droppedFindings!==void 0),g=h.reduce((x,$)=>x+($.droppedFindings??0),0),E=h.length>0;return{schemaVersion:1,revision:e.resources.revision(Ps)??0,updatedAt:new Date(i.changedAt??r).toISOString(),runs:l,findingCount:c,errorCount:p,warningCount:m,infoCount:f,...E?{incomplete:!0,droppedFindings:g}:{},lastSampleAt:i.lastAnalyzeAt,producer:i.lastAnalyzeAt===void 0?"none":"connected",detail:i.lastAnalyzeAt===void 0?"No db-analyze run has ever been ingested \u2014 this is NOT evidence the schema is healthy, nothing has analyzed it. Run the workspace's DB analyzer (it appends a `db-analyze-run` event to the lens bus file) to populate this.":`${l.length} analyze run${l.length===1?"":"s"} held (latest per project); ${c} finding${c===1?"":"s"} (${p} error, ${m} warning, ${f} info).`+(E?` INCOMPLETE: ${g>0?`${g} more findings were`:"part of a run was"} cut by the bus payload bound before reaching the lens (an event over 32 KiB keeps only the first 64 items of a list), and the cut takes whatever came last. The analyzer must keep one run under that bound, most severe first.`:"")}}),{unsubscribe:n,uris:[ui,Ps]}}s(Y6,"Sv"),o(Y6,"installDbReducer");import{App as ak}from"@frontmcp/sdk";import{Resource as ok,ResourceContext as lk}from"@frontmcp/sdk";var op=class extends lk{static{s(this,"Iv")}static{o(this,"NetEgressHostsResource")}async execute(){return this.get(Z).read("net://egress/hosts")}};op=F([ok({name:"net-egress-hosts",uri:"net://egress/hosts",mimeType:"application/json",description:"External hosts this backend called (pod \u2192 third party), rolled up per project\xB7host with count, error/4xx/5xx counters, p95 and worst duration, plus the top endpoints under each. `slow` and `failing` are retracted by later healthy responses, so a one-off blip does not warn all day."})],op);var dk=op;import{Resource as ck,ResourceContext as pk}from"@frontmcp/sdk";var lp=class extends pk{static{s(this,"Ev")}static{o(this,"NetEgressRecentResource")}async execute(){return this.get(Z).read("net://egress/recent")}};lp=F([ck({name:"net-egress-recent",uri:"net://egress/recent",mimeType:"application/json",description:"The last 200 outbound calls with their RAW path and the flowId that caused them \u2014 the evidence behind net://egress/hosts. Query strings are never captured; treat this as the sensitive view, since a path segment can itself be a secret."})],lp);var mk=lp;import{Resource as fk,ResourceContext as hk}from"@frontmcp/sdk";var dp=class extends hk{static{s(this,"Av")}static{o(this,"NetEgressFailuresResource")}async execute(){return this.get(Z).read("net://egress/failures")}};dp=F([fk({name:"net-egress-failures",uri:"net://egress/failures",mimeType:"application/json",description:"Outbound calls that failed \u2014 transport errors and any status \u2265 400 \u2014 kept in their own ring so a high-volume host cannot evict the one failure you need. Empty is NOT proof nothing failed: check `producer`."})],dp);var gk=dp,Q6=class{static{s(this,"zv")}static{o(this,"NetApp")}};Q6=F([ak({id:"net",name:"Net",description:"Outbound (egress) HTTP the backend makes to THIRD PARTIES \u2014 which external services, how often, how slow, and whether they failed. The server-side twin of runtime://browser/network. Internal service-to-service traffic is deliberately absent: the gateway already attributes it.",resources:[dk,mk,gk]})],Q6);var Us="net://egress/hosts",qs="net://egress/recent",Zs="net://egress/failures",Su=20,vk=25,yk=200,Ek=20,bk=5,eE=200,tE=50,uE=2;function rE(e){return e.length===0?!1:!!(/^\d{2,}$/.test(e)||/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^[A-Z][A-Z0-9]*-\d+$/.test(e)||e.length>=16&&/^[A-Za-z0-9_-]+$/.test(e)&&/\d/.test(e))}s(rE,"WO"),o(rE,"isIdSegment");function iE(e){let[t="/"]=e.split("?"),r=t.split("/"),i=[];for(let n of r){if(i.length>12){i.push("\u2026");break}i.push(rE(n)?":id":n)}let u=i.join("/");return u.length===0?"/":u}s(iE,"tk"),o(iE,"templatisePath");function nE(e){let t=Ye(e.thresholds).slowEgressMs,r=(e.now??(()=>Date.now()))(),i={hosts:new Map,recent:[],failures:[]},u=o(p=>{let m=p.raw??null;if(!m||m.kind!=="egress")return;let f=m.project??"unknown",h=m.host??"unknown",g=(m.method??"GET").toUpperCase(),E=m.durationMs??0,x=typeof m.status=="number"?m.status:void 0,$=m.error===void 0?void 0:String(m.error),w=$!==void 0||x!==void 0&&x>=400,k=m.path??"(path not captured \u2014 upgrade @lensmcp/node-instrumentation)",C=`${f}|${h}`,M=i.hosts.get(C);M||(M={project:f,host:h,count:0,errorCount:0,status4xx:0,status5xx:0,totalMs:0,maxMs:0,maxAt:p.timestamp,recent:[],outcomes:[],firstSeenAt:p.timestamp,lastSeenAt:p.timestamp,lastDurationMs:0,lastBad:!1,suppressed:0,endpoints:new Map}),i.hosts.delete(C),i.hosts.set(C,M),M.count+=1,$!==void 0&&(M.errorCount+=1),x!==void 0&&x>=400&&x<500&&(M.status4xx+=1),x!==void 0&&x>=500&&(M.status5xx+=1),M.totalMs+=E,E>M.maxMs&&(M.maxMs=E,M.maxAt=p.timestamp),M.recent.push(E),M.recent.length>Su&&M.recent.splice(0,M.recent.length-Su),M.outcomes.push(w),M.outcomes.length>Su&&M.outcomes.splice(0,M.outcomes.length-Su),M.lastDurationMs=E,M.lastBad=w,M.lastSeenAt=p.timestamp,M.suppressed+=m.floodSuppressed??0;let y=iE(k),D=`${g} ${y}`,A=M.endpoints.get(D);if(A||(A={method:g,path:y,count:0,errorCount:0,status4xx:0,status5xx:0,totalMs:0,maxMs:0,recent:[],lastDurationMs:0,lastSeenAt:p.timestamp}),M.endpoints.delete(D),M.endpoints.set(D,A),A.count+=1,$!==void 0&&(A.errorCount+=1,A.lastError=$),x!==void 0&&x>=400&&x<500&&(A.status4xx+=1),x!==void 0&&x>=500&&(A.status5xx+=1),A.totalMs+=E,E>A.maxMs&&(A.maxMs=E),A.recent.push(E),A.recent.length>Su&&A.recent.splice(0,A.recent.length-Su),A.lastStatus=x,A.lastDurationMs=E,A.lastSeenAt=p.timestamp,M.endpoints.size>Ek){let K=M.endpoints.keys().next().value;K!==void 0&&M.endpoints.delete(K)}if(i.hosts.size>yk){let K=i.hosts.keys().next().value;K!==void 0&&i.hosts.delete(K)}let j=p.context??{},N={id:p.id,timestamp:p.timestamp,project:f,method:g,host:h,path:k,...x!==void 0?{status:x}:{},...$!==void 0?{error:$}:{},durationMs:E,...j.flowId?{flowId:j.flowId}:{},...j.requestId?{requestId:j.requestId}:{}};i.recent.push(N),i.recent.length>eE&&i.recent.splice(0,i.recent.length-eE),w&&(i.failures.push(N),i.failures.length>tE&&i.failures.splice(0,i.failures.length-tE),e.resources.markDirty(Zs)),i.lastSampleAt=Math.max(i.lastSampleAt??0,p.timestamp),i.changedAt=p.timestamp,e.resources.markDirty(Us),e.resources.markDirty(qs)},"handler"),n=e.bus.subscribe(u),a=o(p=>{if(p.length===0)return 0;let m=[...p].sort((f,h)=>f-h);return m[Math.min(m.length-1,Math.floor(m.length*.95))]??0},"p95"),l=o(p=>p.lastDurationMs>=t||p.recent.filter(m=>m>=t).length>=uE,"isSlow"),d=o(p=>p.lastBad||p.outcomes.filter(Boolean).length>=uE,"isFailing"),c=o(p=>{let m=p.outcomes.filter(Boolean).length;return d(p)?`${m} of the last ${p.outcomes.length} call${p.outcomes.length===1?"":"s"} failed`:l(p)?`${p.recent.filter(f=>f>=t).length} of the last ${p.recent.length} call${p.recent.length===1?"":"s"} took \u2265${t}ms`:"healthy"},"describe");return e.resources.register(Us,()=>{let p=[...i.hosts.values()],m=p.filter(d),f=p.filter(h=>!d(h)&&l(h));return{schemaVersion:1,revision:e.resources.revision(Us)??0,updatedAt:new Date(i.changedAt??r).toISOString(),thresholdMs:t,hosts:p.map(h=>({project:h.project,host:h.host,count:h.count,errorCount:h.errorCount,status4xx:h.status4xx,status5xx:h.status5xx,avgMs:Math.round(h.totalMs/Math.max(h.count,1)*10)/10,p95Ms:a(h.recent),maxMs:h.maxMs,maxAt:h.maxAt,lastDurationMs:h.lastDurationMs,firstSeenAt:h.firstSeenAt,lastSeenAt:h.lastSeenAt,slow:l(h),failing:d(h),detail:c(h),suppressedEvents:h.suppressed,endpoints:[...h.endpoints.values()].map(g=>({method:g.method,path:g.path,count:g.count,errorCount:g.errorCount,status4xx:g.status4xx,status5xx:g.status5xx,avgMs:Math.round(g.totalMs/Math.max(g.count,1)*10)/10,p95Ms:a(g.recent),maxMs:g.maxMs,...g.lastStatus!==void 0?{lastStatus:g.lastStatus}:{},...g.lastError!==void 0?{lastError:g.lastError}:{},lastSeenAt:g.lastSeenAt})).sort((g,E)=>E.maxMs-g.maxMs).slice(0,bk)})).sort((h,g)=>h.failing!==g.failing?h.failing?-1:1:g.maxMs-h.maxMs).slice(0,vk),hostsTracked:i.hosts.size,failingHosts:m.length,slowHosts:f.length,note:"count/avg are an UNDERCOUNT for hot hosts: the emitter flood-guards each host fingerprint at 30 burst / 5 events/s; suppressedEvents is the emitter's own count of dropped events. Query strings are not captured; endpoint paths are templatised (\u2026/:id).",lastSampleAt:i.lastSampleAt,producer:i.lastSampleAt===void 0?"none":"connected",detail:i.lastSampleAt===void 0?"No egress event has ever been observed \u2014 this is NOT evidence the app makes no external calls, nothing is watching. Run the backend under the dev cluster (the @lensmcp/cluster serve preload taps fetch and http/https) so outbound calls reach this session. Internal destinations (*.local, loopback, RFC1918) are skipped by design \u2014 the gateway already attributes service-to-service traffic.":`${i.hosts.size} external host${i.hosts.size===1?"":"s"} observed; ${m.length} failing, ${f.length} slower than ${t}ms.`}}),e.resources.register(qs,()=>({schemaVersion:1,revision:e.resources.revision(qs)??0,updatedAt:new Date(i.changedAt??r).toISOString(),entries:[...i.recent],count:i.recent.length,note:"Raw paths, as requested. flowId joins an outbound call back to the click that caused it. Treat this as the sensitive view: a path segment can itself be a secret (a presigned key, a reset token), which the templatised rollup collapses but this does not.",lastSampleAt:i.lastSampleAt,producer:i.lastSampleAt===void 0?"none":"connected",detail:i.lastSampleAt===void 0?"No egress event has ever been observed \u2014 this is NOT evidence the app makes no external calls, nothing is watching.":`${i.recent.length} recent outbound call${i.recent.length===1?"":"s"}.`})),e.resources.register(Zs,()=>({schemaVersion:1,revision:e.resources.revision(Zs)??0,updatedAt:new Date(i.changedAt??r).toISOString(),entries:[...i.failures],count:i.failures.length,note:"A separate ring from net://egress/recent on purpose: a host called 200\xD7/min would otherwise evict the one 503 you need.",lastSampleAt:i.lastSampleAt,producer:i.lastSampleAt===void 0?"none":"connected",detail:i.lastSampleAt===void 0?"No egress event has ever been observed \u2014 an empty list here is NOT evidence that nothing failed, nothing is watching.":`${i.failures.length} failed outbound call${i.failures.length===1?"":"s"} held.`})),{unsubscribe:n,uris:[Us,qs,Zs]}}s(nE,"Ov"),o(nE,"installNetReducer");import{App as wk}from"@frontmcp/sdk";import{Resource as Dk,ResourceContext as $k}from"@frontmcp/sdk";var cp=class extends $k{static{s(this,"Mv")}static{o(this,"VisualCurrentResource")}async execute(){return this.get(Z).read("visual://current")}};cp=F([Dk({name:"visual-current",uri:"visual://current",mimeType:"application/json",description:"Most recent visual-frame (causedBy, changedNodes, stable)."})],cp);var Bk=cp;import{Resource as xk,ResourceContext as Ck}from"@frontmcp/sdk";var pp=class extends Ck{static{s(this,"Pv")}static{o(this,"VisualViolationsCurrentResource")}async execute(){return this.get(Z).read("visual://violations/current")}};pp=F([xk({name:"visual-violations-current",uri:"visual://violations/current",mimeType:"application/json",description:"Violations of the CURRENT frame, regardless of timing mode. Every rule re-runs per frame, so a fixed violation simply stops being reported."})],pp);var kk=pp;import{Resource as Ak,ResourceContext as Ik}from"@frontmcp/sdk";var mp=class extends Ik{static{s(this,"Cv")}static{o(this,"VisualViolationsStableResource")}async execute(){return this.get(Z).read("visual://violations/stable")}};mp=F([Ak({name:"visual-violations-stable",uri:"visual://violations/stable",mimeType:"application/json",description:'Violations from rules with timing "after-animation" | "stable-only" | "always".'})],mp);var _k=mp;import{Resource as Sk,ResourceContext as Fk}from"@frontmcp/sdk";var fp=class extends Fk{static{s(this,"Lv")}static{o(this,"VisualViolationsDuringAnimationResource")}async execute(){return this.get(Z).read("visual://violations/during-animation")}};fp=F([Sk({name:"visual-violations-during-animation",uri:"visual://violations/during-animation",mimeType:"application/json",description:"Violations seen on midpoint (during-animation) samples only."})],fp);var jk=fp;import{Resource as zk,ResourceContext as Nk}from"@frontmcp/sdk";var hp=class extends Nk{static{s(this,"Bv")}static{o(this,"VisualRulesResource")}async execute(){return this.get(Z).read("visual://rules")}};hp=F([zk({name:"visual-rules",uri:"visual://rules",mimeType:"application/json",description:"All registered visual rules (builtins + lensmcp.rules.json + visual.register_rule)."})],hp);var Mk=hp;import{Resource as Ok,ResourceContext as Rk}from"@frontmcp/sdk";var gp=class extends Rk{static{s(this,"qv")}static{o(this,"VisualTokensResource")}async execute(){return this.get(Z).read("visual://tokens")}};gp=F([Ok({name:"visual-tokens",uri:"visual://tokens",mimeType:"application/json",description:"Resolved design tokens from lensmcp.tokens.json."})],gp);var Tk=gp;import{Tool as Pk,ToolContext as Uk,z as sE}from"@frontmcp/sdk";import{existsSync as qk,mkdirSync as Zk,readFileSync as Lk,writeFileSync as Vk}from"node:fs";import{dirname as Jk,join as vp}from"node:path";function yp(e=process.env,t=process.cwd()){let r=e.LENSMCP_EVENT_FILE;return r?Jk(r):vp(t,".lensmcp")}s(yp,"Fa"),o(yp,"captureDir");function aE(e){try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}s(aE,"fM"),o(aE,"pidAlive");function Ep(e,t=aE){let r=vp(e,KD);try{if(!qk(r))return;let i=JSON.parse(Lk(r,"utf8"));return typeof i?.pid!="number"||!Number.isFinite(i.pid)?void 0:t(i.pid)?i:void 0}catch{return}}s(Ep,"Ba"),o(Ep,"liveRunner");function oE(e,t){try{return Zk(e,{recursive:!0}),Vk(vp(e,GD),JSON.stringify(t)),!0}catch{return!1}}s(oE,"rk"),o(oE,"publishCaptureRequest");var bp;async function lE(e,t){let r=bp;if(r)return{fresh:await r.promise,coalesced:!0,requestId:r.requestId};let i=t().finally(()=>{bp=void 0});return bp={promise:i,requestId:e},{fresh:await i,coalesced:!1,requestId:e}}s(lE,"nk"),o(lE,"captureSingleFlight");async function dE(e){let t=e.now??(()=>Date.now()),r=e.sleep??(a=>new Promise(l=>setTimeout(l,a))),i=e.budgetMs??8e3,u=e.pollMs??100,n=t()+i;for(;t()<n;){await r(u);let a=await e.readFrameId();if(a!==void 0&&a!==e.before)return!0}return!1}s(dE,"ok"),o(dE,"waitForFreshFrame");var wp=class extends Uk{static{s(this,"Kv")}static{o(this,"VisualCaptureFrameTool")}async execute(e){let t=this.get(Zr),r=this.get(Z),i=o(async()=>(await r.read("visual://current"))?.frame?.id,"readFrameId"),u=await i(),n=lt(),a=Date.now();t.publish({id:lt(),sessionId:"visual.capture_frame",timestamp:a,source:"visual",category:"visual",severity:"info",context:{sessionId:"visual.capture_frame"},fingerprint:`visual-capture-request:${e.cause}`,title:`visual.capture_frame(${e.cause})`,raw:{kind:"visual-capture-request",cause:e.cause,stable:e.stable,requestId:n}});let l=yp(),d=Ep(l),c=!1,p=await lE(n,async()=>(c=oE(l,{requestedAt:a,cause:e.cause,stable:e.stable,requestId:n}),c&&d?await dE({readFrameId:i,before:u}):!1));return{requested:p.coalesced?!0:c,cause:e.cause,stable:e.stable,fresh:p.fresh,coalesced:p.coalesced,requestId:p.requestId,waitedMs:Date.now()-a,runner:d?{pid:d.pid,url:d.url}:void 0,latest:await r.read("visual://current")}}};wp=F([Pk({name:"visual.capture_frame",description:"Capture a fresh visual frame. Signals the host capture runner (which launches a headless browser on demand), waits for the new frame, and returns it. Frames are captured per request \u2014 no browser is held open between calls.",inputSchema:{cause:sE.enum(["page-load","route-change","user-action","react-commit","state-update","api-response","hmr-update","animation-tick"]).default("user-action").describe("Hint why this frame is being requested."),stable:sE.boolean().default(!0).describe("Whether to treat the captured frame as the stable final state.")}})],wp);var Wk=wp;import{Tool as Gk,ToolContext as Kk,z as Hk}from"@frontmcp/sdk";var Dp=class extends Kk{static{s(this,"Xv")}static{o(this,"VisualInspectNodeTool")}async execute(e){let t=await this.get(Z).read("visual://current");if(!t.frame)return{found:!1,uid:e.uid};let r=t.frame.changedNodes.filter(i=>i.uid===e.uid);return{found:r.length>0,uid:e.uid,frameId:t.frame.id,changes:r}}};Dp=F([Gk({name:"visual.inspect_node",description:"Returns the changedNodes entry for `uid` from visual://current \u2014 the per-property before/after used to compute the latest frame.",inputSchema:{uid:Hk.string().describe('Node uid as it appeared in visual://current.changedNodes (e.g. "hero-card" or "bid:42").')}})],Dp);var Xk=Dp;import{Tool as Yk,ToolContext as Qk,z as e7}from"@frontmcp/sdk";var $p=class extends Qk{static{s(this,"Yv")}static{o(this,"VisualCompareFramesTool")}async execute(e){let t=await this.get(Z).read("visual://current");return t.frame?e.frameId&&e.frameId!==t.frame.id?{found:!1,reason:"Only the latest frame is retained in Phase 4."}:{found:!0,frameId:t.frame.id,causedBy:t.frame.causedBy,changedCount:t.frame.changedNodes.length,appeared:t.frame.appearedNodes.length,disappeared:t.frame.disappearedNodes.length,changedNodes:t.frame.changedNodes.slice(0,50)}:{found:!1}}};$p=F([Yk({name:"visual.compare_frames",description:"Summarises the last visual-frame. Phase 4 ships a single-frame view (Phase 6 adds story-relative deltas).",inputSchema:{frameId:e7.string().optional().describe("Optional frame id; defaults to the latest.")}})],$p);var t7=$p;import{Tool as u7,ToolContext as r7,z as i7}from"@frontmcp/sdk";var Bp=class extends r7{static{s(this,"ey")}static{o(this,"VisualExplainViolationTool")}async execute(e){let t=(await this.get(Z).read("visual://violations/current")).violations.find(r=>r.id===e.violationId);return t?{found:!0,violation:t,explanation:cE(t)}:{found:!1,violationId:e.violationId}}};Bp=F([u7({name:"visual.explain_violation",description:"Returns the full violation record (rule id + expected/actual + evidence.cssCause / trace / screenshot crop URIs) for a given violationId.",inputSchema:{violationId:i7.string().describe("Id of the violation as seen in visual://violations/current.")}})],Bp);var n7=Bp;function cE(e){let t=[`Rule ${e.ruleId} (${e.ruleType}) at ${e.element.component??e.element.uid}.`,`Expected: ${JSON.stringify(e.expected)}`,`Actual: ${JSON.stringify(e.actual)}`];return e.evidence.cssCause&&t.push(`CSS cause: ${e.evidence.cssCause.selector} { ${e.evidence.cssCause.declaration??"?"} }`+(e.evidence.cssCause.file?` @ ${e.evidence.cssCause.file}:${e.evidence.cssCause.line??"?"}`:"")),e.evidence.trace&&t.push(`Trace: ${e.evidence.trace}`),e.evidence.screenshotCrop&&t.push(`Crop: ${e.evidence.screenshotCrop}`),t.join(`
71
- `)}s(cE,"SM"),o(cE,"buildExplanation");import{Tool as s7,ToolContext as a7,z as Me}from"@frontmcp/sdk";import{mkdirSync as o7,readFileSync as l7,renameSync as d7,writeFileSync as c7}from"node:fs";import{join as p7}from"node:path";var m7=500;function pE(e){try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}s(pE,"zM"),o(pE,"pidAlive");function mE(e){try{let t=JSON.parse(l7(e,"utf8"));return Array.isArray(t?.rules)?t.rules:[]}catch{return[]}}s(mE,"OM"),o(mE,"readEntries");function fE(e,t,r={}){let i=r.pid??process.pid,u=r.isAlive??pE,n=p7(e,HD),a=[...mE(n).filter(d=>typeof d?.registeredBy=="number"&&typeof d?.rule?.id=="string"&&d.rule.id!==t.id&&(d.registeredBy===i||u(d.registeredBy))),{rule:t,registeredBy:i,registeredAt:(r.now??Date.now)()}].slice(-m7);o7(e,{recursive:!0});let l=`${n}.${i}.tmp`;return c7(l,JSON.stringify({schemaVersion:1,rules:a})),d7(l,n),a}s(fE,"sk"),o(fE,"registerSessionRule");var xp=class extends a7{static{s(this,"ry")}static{o(this,"VisualRegisterRuleTool")}async execute(e){let t=this.get(Zr),r=this.get(Z),i={id:e.id,type:e.type,target:e.target,severity:e.severity,timing:e.timing,expected:e.expected,breakpoints:e.breakpoints};t.publish({id:lt(),sessionId:"visual.register_rule",timestamp:Date.now(),source:"visual",category:"visual",severity:"info",context:{sessionId:"visual.register_rule"},fingerprint:`visual-rule-registered:${e.id}`,title:`visual.register_rule(${e.id})`,raw:{kind:"visual-rule-registered",rule:i}});let u=yp(),n=!1,a;try{fE(u,i),n=Ep(u)!==void 0,a=n?"The capture runner evaluates this rule on the next captured frame (visual.capture_frame).":"No capture runner is listening, so nothing will evaluate this rule until one starts (the dev cluster gateway or agent-dev). It is listed, not enforced."}catch(l){a=`Could not hand the rule to the capture runner (${l.message}). It is listed, but will NOT be evaluated.`}return{registered:!0,evaluated:n,note:a,rule:{id:e.id,type:e.type,target:e.target},rules:await r.read("visual://rules")}}};xp=F([s7({name:"visual.register_rule",description:"Register (or replace) a visual rule. It is handed to the capture runner, which evaluates it on every frame captured from now on, for as long as this lens server runs. The result says whether a runner is listening; if `evaluated` is false the rule is only listed, and no violation can come of it.",inputSchema:{id:Me.string().describe("Stable rule id; replaces a prior rule with the same id."),type:Me.enum(["grid-spacing","alignment","overflow","text-clipping","color-contrast","token-usage","z-index","responsive","custom"]).describe("Built-in rule type to evaluate."),target:Me.string().optional().describe('CSS-like selector / role:label / [data-agent-component="\u2026"]; default = every node.'),severity:Me.enum(["info","warning","error"]).default("warning"),timing:Me.enum(["always","after-animation","stable-only","during-animation"]).default("always"),expected:Me.record(Me.string(),Me.unknown()).default({}).describe('Rule-type-specific expectations (e.g. { gap: "spacing.6" }).'),breakpoints:Me.record(Me.string(),Me.record(Me.string(),Me.unknown())).optional().describe("Per-breakpoint expectation overrides for the responsive rule type.")}})],xp);var f7=xp,hE=class{static{s(this,"oy")}static{o(this,"VisualApp")}};hE=F([wk({id:"visual",name:"Visual",description:"Visual rule engine: DOMSnapshot/LayerTree diffs, grid/alignment/overflow/contrast/z-index rules, design tokens.",resources:[Bk,kk,_k,jk,Mk,Tk],tools:[Wk,Xk,t7,n7,f7]})],hE);var ri="visual://current",ii="visual://violations/current",ni="visual://violations/stable",si="visual://violations/during-animation",ai="visual://rules",oi="visual://tokens";function gE(e){let t=(e.now??(()=>Date.now()))(),r={violations:[],rules:[],framesSeen:0,changedAt:new Map},i=o((f,h)=>{r.changedAt.set(f,h),e.resources.markDirty(f)},"touch"),u=o(f=>{i(ii,f),i(ni,f),i(si,f)},"touchViolationViews"),n=o(f=>{let h=f.raw??null;if(h?.kind)switch(h.kind){case"visual-frame":{let g=h.frame;if(!g)return;r.currentFrame=g,r.lastFrameAt=f.timestamp,r.framesSeen+=1,r.rulesEvaluated=typeof h.rulesEvaluated=="number"?h.rulesEvaluated:void 0,i(ri,f.timestamp);let E=r.violations.length;r.violations=r.violations.filter(x=>x.frameId===g.id),E!==r.violations.length&&u(f.timestamp);return}case"visual-violation":if(!h.violation)return;r.violations.push(h.violation),r.violations.length>50&&r.violations.splice(0,r.violations.length-50),u(f.timestamp);return;case"visual-rule-registered":{let g=h.rule;if(!g)return;let E=r.rules.findIndex(x=>x.id===g.id);E>=0&&r.rules.splice(E,1),r.rules.push(g),r.rules.length>500&&r.rules.splice(0,r.rules.length-500),i(ai,f.timestamp);return}case"visual-tokens-loaded":if(!h.tokens)return;r.tokens=h.tokens,i(oi,f.timestamp);return;default:return}},"handler"),a=e.bus.subscribe(n),l=o(f=>new Date(r.changedAt.get(f)??t).toISOString(),"stamp"),d="No visual frame has ever been captured \u2014 an empty violation list is NOT evidence the UI is correct, nothing is looking. Drive a capture (visual_capture_frame) or run the browser-capture loop so frames reach this session.",c=o(()=>`${r.framesSeen} frame${r.framesSeen===1?"":"s"} captured`,"frameCount"),p=o(()=>({framesSeen:r.framesSeen,lastFrameAt:r.lastFrameAt,currentFrameId:r.currentFrame?.id,...r.rulesEvaluated!==void 0?{rulesEvaluated:r.rulesEvaluated}:{},producer:r.framesSeen===0?"none":"connected",detail:r.framesSeen===0?d:r.rulesEvaluated===void 0?`${c()}; ${r.rules.length} rule${r.rules.length===1?"":"s"} registered.`:`${c()}; ${r.rulesEvaluated} rule${r.rulesEvaluated===1?"":"s"} evaluated on the current one.`}),"frameHealth"),m=o(()=>{let f=p();return r.framesSeen===0||r.rulesEvaluated===void 0?r.framesSeen===0?f:{...f,detail:`${f.detail} Violations are those of the CURRENT frame \u2014 every rule is re-run per frame, so anything fixed simply stops being reported.`}:r.rulesEvaluated===0?{...f,producer:"none",detail:`${c()}, but NO rule was evaluated on the current one \u2014 an empty violation list is NOT evidence the UI is correct, nothing is being checked. Add rules to \`lensmcp.rules.json\` at the workspace root, or register one with visual.register_rule.`}:{...f,detail:`${f.detail} Violations are those of the CURRENT frame \u2014 every rule is re-run per frame, so anything fixed simply stops being reported.`}},"violationHealth");return e.resources.register(ri,()=>({schemaVersion:1,revision:e.resources.revision(ri)??0,updatedAt:l(ri),frame:r.currentFrame??null,...p()})),e.resources.register(ii,()=>({schemaVersion:1,revision:e.resources.revision(ii)??0,updatedAt:l(ii),violations:r.violations.slice(),...m()})),e.resources.register(ni,()=>({schemaVersion:1,revision:e.resources.revision(ni)??0,updatedAt:l(ni),violations:r.violations.filter(f=>f.timing==="after-animation"||f.timing==="stable-only"||f.timing==="always"),...m()})),e.resources.register(si,()=>({schemaVersion:1,revision:e.resources.revision(si)??0,updatedAt:l(si),violations:r.violations.filter(f=>f.timing==="during-animation"),...m()})),e.resources.register(ai,()=>({schemaVersion:1,revision:e.resources.revision(ai)??0,updatedAt:l(ai),rules:r.rules.slice()})),e.resources.register(oi,()=>({schemaVersion:1,revision:e.resources.revision(oi)??0,updatedAt:l(oi),tokens:r.tokens??null})),{unsubscribe:a,uris:[ri,ii,ni,si,ai,oi]}}s(gE,"iy"),o(gE,"installVisualReducer");import{App as h7}from"@frontmcp/sdk";import{Resource as g7,ResourceContext as v7}from"@frontmcp/sdk";var Cp=class extends v7{static{s(this,"sy")}static{o(this,"ReactPagesCurrentResource")}async execute(){return this.get(Z).read("react://pages/current")}};Cp=F([g7({name:"react-pages-current",uri:"react://pages/current",mimeType:"application/json",description:"The most recently active React page (from <LensmcpRoot>)."})],Cp);var y7=Cp;import{Resource as E7,ResourceContext as b7}from"@frontmcp/sdk";var kp=class extends b7{static{s(this,"cy")}static{o(this,"ReactComponentsHotResource")}async execute(){return this.get(Z).read("react://components/hot")}};kp=F([E7({name:"react-components-hot",uri:"react://components/hot",mimeType:"application/json",description:"Components ranked by render count this session."})],kp);var w7=kp;import{Resource as D7,ResourceContext as $7}from"@frontmcp/sdk";var Ap=class extends $7{static{s(this,"ly")}static{o(this,"ReactRendersSlowResource")}async execute(){return this.get(Z).read("react://renders/slow")}};Ap=F([D7({name:"react-renders-slow",uri:"react://renders/slow",mimeType:"application/json",description:"Renders with actualDurationMs >= threshold (default 16ms)."})],Ap);var B7=Ap;import{Resource as x7,ResourceContext as C7}from"@frontmcp/sdk";var Ip=class extends C7{static{s(this,"py")}static{o(this,"ReactRendersRecentResource")}async execute(){return this.get(Z).read("react://renders/recent")}};Ip=F([x7({name:"react-renders-recent",uri:"react://renders/recent",mimeType:"application/json",description:"Last 100 render commits with attribution (why)."})],Ip);var k7=Ip;import{Resource as A7,ResourceContext as I7}from"@frontmcp/sdk";var _p=class extends I7{static{s(this,"my")}static{o(this,"ReactEffectsRecentResource")}async execute(){return this.get(Z).read("react://effects/recent")}};_p=F([A7({name:"react-effects-recent",uri:"react://effects/recent",mimeType:"application/json",description:"Last 100 useEffect runs/cleanups from tracedUseEffect."})],_p);var _7=_p;import{Resource as S7,ResourceContext as F7}from"@frontmcp/sdk";var Sp=class extends F7{static{s(this,"gy")}static{o(this,"ReactMemosRecomputedResource")}async execute(){return this.get(Z).read("react://memos/recomputed")}};Sp=F([S7({name:"react-memos-recomputed",uri:"react://memos/recomputed",mimeType:"application/json",description:"Recent useMemo recomputations (depsHash changed)."})],Sp);var j7=Sp;import{Resource as z7,ResourceContext as N7}from"@frontmcp/sdk";var Fp=class extends N7{static{s(this,"yy")}static{o(this,"ReactHooksRecentResource")}async execute(){return this.get(Z).read("react://hooks/recent")}};Fp=F([z7({name:"react-hooks-recent",uri:"react://hooks/recent",mimeType:"application/json",description:"Recent hook-run events (useMemo / useCallback)."})],Fp);var M7=Fp;import{Tool as O7,ToolContext as R7,z as jp}from"@frontmcp/sdk";var zp=class extends R7{static{s(this,"xy")}static{o(this,"GraphExplainRerenderTool")}async execute(e){let t=await this.get(Z).read("react://renders/recent"),r;if(e.renderNodeId)r=t.renders.find(u=>u.id===e.renderNodeId);else if(e.componentInstanceId)for(let u=t.renders.length-1;u>=0;u--){let n=t.renders[u];if(n&&n.componentInstanceId===e.componentInstanceId){r=n;break}}else if(e.componentLogicalId)for(let u=t.renders.length-1;u>=0;u--){let n=t.renders[u];if(n&&n.componentLogicalId===e.componentLogicalId){r=n;break}}if(!r)return{found:!1,searched:e};let i=(r.why??[]).map(u=>({...u,summary:vE(u)}));return{found:!0,renderNodeId:r.id,componentInstanceId:r.componentInstanceId,componentLogicalId:r.componentLogicalId,componentName:r.componentName,page:r.page,route:r.route,phase:r.phase,actualDurationMs:r.actualDurationMs,why:i,parentRenderId:r.parentRenderId}}};zp=F([O7({name:"graph.explain_rerender",description:"Returns the most recent render record for a component (by `renderNodeId`, `componentInstanceId`, or `componentLogicalId`), with its `why` causal list (valtio-path / parent-render / hook-dep-changed / props / context / react-state / force).",inputSchema:{renderNodeId:jp.string().optional().describe("Exact render commit id from react://renders/recent."),componentInstanceId:jp.string().optional().describe("Component instance id; resolves to that instance\u2019s last render."),componentLogicalId:jp.string().optional().describe("Component logical id (e.g. react:component:src/App.tsx:CardGrid); resolves to its most recent render across HMR generations.")}})],zp);var T7=zp;function vE(e){switch(e.type){case"valtio-path":return`valtio path ${String(e.path)} changed (${e.changedKeys?.join(",")??""})`;case"react-state":return`useState hook #${String(e.hookIndex)} changed`;case"context":return`context ${String(e.contextName)} changed`;case"props":return`prop(s) changed: ${e.changedKeys?.join(",")??""}`;case"parent-render":return`parent render ${String(e.parentRenderId)} triggered this`;case"hook-dep-changed":return`hook ${String(e.hookInstanceId)} deps changed`;case"force":return`forced render: ${String(e.reason)}`;default:return`unknown cause: ${JSON.stringify(e)}`}}s(vE,"QM"),o(vE,"summariseWhy");var yE=class{static{s(this,"_y")}static{o(this,"ReactApp")}};yE=F([h7({id:"react",name:"React",description:"React render attribution: pages, hot components, slow renders, hook + effect + memo events. Hosts graph.explain_rerender.",resources:[y7,w7,B7,k7,_7,j7,M7],tools:[T7]})],yE);var li="react://pages/current",Ls="react://components/hot",Vs="react://renders/slow",Js="react://renders/recent",Ws="react://effects/recent",Gs="react://memos/recomputed",Ks="react://hooks/recent",Hs=100,Np=50,EE=500;function bE(e){let t=Ye(e.thresholds).slowRenderMs,r={rendersRecent:[],rendersSlow:[],effectsRecent:[],hooksRecent:[],memosRecomputed:[],rendersByInstance:new Map,hotByLogical:new Map},i=o(n=>{if(n.source!=="react")return;let a=n.raw??null;if(a?.kind)switch(a.kind){case"render":{let l=a.render;if(!l)return;if(Fu(r.rendersRecent,l,Hs),r.rendersByInstance.delete(l.componentInstanceId),r.rendersByInstance.set(l.componentInstanceId,l),r.rendersByInstance.size>EE){for(let c of r.rendersByInstance.keys())if(r.rendersByInstance.delete(c),r.rendersByInstance.size<=EE)break}l.actualDurationMs>=t&&(Fu(r.rendersSlow,l,Np),r.rendersSlow.sort((c,p)=>p.actualDurationMs-c.actualDurationMs),r.rendersSlow.length>Np&&(r.rendersSlow.length=Np));let d=r.hotByLogical.get(l.componentLogicalId);d?(d.renderCount+=1,d.totalActualMs+=l.actualDurationMs,d.lastRenderId=l.id):r.hotByLogical.set(l.componentLogicalId,{componentLogicalId:l.componentLogicalId,componentName:l.componentName,renderCount:1,totalActualMs:l.actualDurationMs,lastRenderId:l.id}),(l.page||l.route)&&(r.currentPage={page:l.page??"(unknown)",route:l.route,updatedAt:n.timestamp},e.resources.markDirty(li)),e.resources.markDirty(Js),e.resources.markDirty(Ls),l.actualDurationMs>=t&&e.resources.markDirty(Vs);return}case"effect-run":{let l=a.effect;if(!l)return;Fu(r.effectsRecent,l,Hs),e.resources.markDirty(Ws);return}case"hook-run":{let l=a.hook;if(!l)return;Fu(r.hooksRecent,l,Hs),e.resources.markDirty(Ks),l.recomputed&&l.hookType==="useMemo"&&(Fu(r.memosRecomputed,l,Hs),e.resources.markDirty(Gs));return}case"component-mount":case"component-unmount":{let l=a.component;if(!l)return;(l.page||l.route)&&(r.currentPage={page:l.page??"(unknown)",route:l.route,updatedAt:n.timestamp},e.resources.markDirty(li));return}default:return}},"handler"),u=e.bus.subscribe(i);return e.resources.register(li,()=>({schemaVersion:1,revision:e.resources.revision(li)??0,updatedAt:new Date().toISOString(),page:r.currentPage??null})),e.resources.register(Ls,()=>({schemaVersion:1,revision:e.resources.revision(Ls)??0,updatedAt:new Date().toISOString(),components:[...r.hotByLogical.values()].sort((n,a)=>a.renderCount-n.renderCount)})),e.resources.register(Vs,()=>({schemaVersion:1,revision:e.resources.revision(Vs)??0,updatedAt:new Date().toISOString(),thresholdMs:t,renders:r.rendersSlow.slice()})),e.resources.register(Js,()=>({schemaVersion:1,revision:e.resources.revision(Js)??0,updatedAt:new Date().toISOString(),renders:r.rendersRecent.slice()})),e.resources.register(Ws,()=>({schemaVersion:1,revision:e.resources.revision(Ws)??0,updatedAt:new Date().toISOString(),effects:r.effectsRecent.slice()})),e.resources.register(Gs,()=>({schemaVersion:1,revision:e.resources.revision(Gs)??0,updatedAt:new Date().toISOString(),memos:r.memosRecomputed.slice()})),e.resources.register(Ks,()=>({schemaVersion:1,revision:e.resources.revision(Ks)??0,updatedAt:new Date().toISOString(),hooks:r.hooksRecent.slice()})),{unsubscribe:u,uris:[li,Ls,Vs,Js,Ws,Gs,Ks],lookups:{latestRenderFor(n){return r.rendersByInstance.get(n)},latestRenderForLogical(n){if(r.hotByLogical.get(n))for(let a=r.rendersRecent.length-1;a>=0;a--){let l=r.rendersRecent[a];if(l&&l.componentLogicalId===n)return l}}}}}s(bE,"Sy"),o(bE,"installReactReducer");function Fu(e,t,r){e.push(t),e.length>r&&e.splice(0,e.length-r)}s(Fu,"Bo"),o(Fu,"pushBounded");import{App as P7}from"@frontmcp/sdk";import{Resource as U7,ResourceContext as q7}from"@frontmcp/sdk";var Mp=class extends q7{static{s(this,"Iy")}static{o(this,"ValtioUpdatesRecentResource")}async execute(){return this.get(Z).read("valtio://updates/recent")}};Mp=F([U7({name:"valtio-updates-recent",uri:"valtio://updates/recent",mimeType:"application/json",description:"Last 100 Valtio state-update events with path + changedKeys + subscribers."})],Mp);var Z7=Mp;import{Resource as L7,ResourceContext as V7}from"@frontmcp/sdk";var Op=class extends V7{static{s(this,"Ey")}static{o(this,"ValtioStoresResource")}async execute(){return this.get(Z).read("valtio://stores")}};Op=F([L7({name:"valtio-stores",uri:"valtio://stores",mimeType:"application/json",description:"Registered Valtio stores (created via lensmcp-wrapped proxy())."})],Op);var J7=Op;import{Resource as W7,ResourceContext as G7}from"@frontmcp/sdk";var Rp=class extends G7{static{s(this,"Ay")}static{o(this,"ValtioSubscribersResource")}async execute(){return this.get(Z).read("valtio://subscribers")}};Rp=F([W7({name:"valtio-subscribers",uri:"valtio://subscribers",mimeType:"application/json",description:"Per-(storeId, path) list of component instance ids currently subscribed via tracked useSnapshot."})],Rp);var K7=Rp,wE=class{static{s(this,"zy")}static{o(this,"ValtioApp")}};wE=F([P7({id:"valtio",name:"Valtio",description:"Valtio store + subscription tracking. Phase 5 ships updates/stores/subscribers; per-path subscriber walks land via graph.explain_rerender.",resources:[Z7,J7,K7]})],wE);var Xs="valtio://updates/recent",Ys="valtio://stores",di="valtio://subscribers",DE=100,$E=1e3,H7=1e3,X7=256,Y7=256;function BE(e,t){if(e.size<=t)return;let r=e.values();for(;e.size>t;){let i=r.next();if(i.done)break;e.delete(i.value)}}s(BE,"dN"),o(BE,"capSet");function Tp(e){let t=Array.isArray(e.paths)?e.paths.filter(r=>typeof r=="string"):void 0;return t&&t.length>0?t.slice(0,X7):typeof e.path=="string"?[e.path]:[]}s(Tp,"lk"),o(Tp,"subscriptionPaths");function Pp(e){return e.componentLogicalId??e.componentInstanceId??"react:component:anonymous"}s(Pp,"dk"),o(Pp,"subscriberId");function xE(e){let t={updates:[],stores:new Map,subscribers:new Map,latestUpdateByPath:new Map},r=o(u=>{if(u.source!=="valtio")return;let n=u.raw??null;if(n?.kind)switch(n.kind){case"state-update":{let a=n.update;if(!a)return;let l={...a,emittedAt:u.timestamp};t.updates.push(l),t.updates.length>DE&&t.updates.splice(0,t.updates.length-DE);let d=`${a.storeId}::${a.path}`;if(t.latestUpdateByPath.delete(d),t.latestUpdateByPath.set(d,l),t.latestUpdateByPath.size>$E){for(let c of t.latestUpdateByPath.keys())if(t.latestUpdateByPath.delete(c),t.latestUpdateByPath.size<=$E)break}e.resources.markDirty(Xs);return}case"store-created":{let a=n.store;if(!a)return;t.stores.set(a.storeId,{...a,createdAt:u.timestamp}),e.resources.markDirty(Ys);return}case"subscription-added":{let a=n.subscription;if(!a||!a.componentInstanceId)return;let l=Pp(a);for(let d of Tp(a)){let c=`${a.storeId}::${d}`,p=t.subscribers.get(c);p||(p=new Map,t.subscribers.set(c,p));let m=p.get(l);m||(m=new Set,p.set(l,m)),m.add(a.componentInstanceId),Zt(p,Lr),BE(m,Y7)}Zt(t.subscribers,H7),e.resources.markDirty(di);return}case"subscription-removed":{let a=n.subscription;if(!a||!a.componentInstanceId)return;let l=Pp(a);for(let d of Tp(a)){let c=`${a.storeId}::${d}`,p=t.subscribers.get(c);if(!p)continue;let m=p.get(l);m&&(m.delete(a.componentInstanceId),m.size===0&&p.delete(l)),p.size===0&&t.subscribers.delete(c)}e.resources.markDirty(di);return}default:return}},"handler"),i=e.bus.subscribe(r);return e.resources.register(Xs,()=>({schemaVersion:1,revision:e.resources.revision(Xs)??0,updatedAt:new Date().toISOString(),updates:t.updates.slice()})),e.resources.register(Ys,()=>({schemaVersion:1,revision:e.resources.revision(Ys)??0,updatedAt:new Date().toISOString(),stores:[...t.stores.values()]})),e.resources.register(di,()=>({schemaVersion:1,revision:e.resources.revision(di)??0,updatedAt:new Date().toISOString(),subscriptions:[...t.subscribers.entries()].map(([u,n])=>{let[a,l]=u.split("::");return{storeId:a,path:l,componentInstanceIds:[...n.keys()]}})})),{unsubscribe:i,uris:[Xs,Ys,di],lookups:{latestUpdateForPath(u,n){return t.latestUpdateByPath.get(`${u}::${n}`)},subscribersFor(u,n){return[...t.subscribers.get(`${u}::${n}`)?.keys()??[]]}}}}s(xE,"Oy"),o(xE,"installValtioReducer");import{App as Q7}from"@frontmcp/sdk";import{Resource as eA,ResourceContext as tA}from"@frontmcp/sdk";var Up=class extends tA{static{s(this,"My")}static{o(this,"GraphPatternsResource")}async execute(){return this.get(Z).read("graph://patterns")}};Up=F([eA({name:"graph-patterns",uri:"graph://patterns",mimeType:"application/json",description:"Recent detected anti-patterns (db-in-loop, n+1-query, render-storm)."})],Up);var uA=Up;import{Resource as rA,ResourceContext as iA}from"@frontmcp/sdk";var qp=class extends iA{static{s(this,"Py")}static{o(this,"GraphEventLoopLagResource")}async execute(){return this.get(Z).read("graph://performance/event-loop-lag")}};qp=F([rA({name:"graph-event-loop-lag",uri:"graph://performance/event-loop-lag",mimeType:"application/json",description:"Recent event-loop-lag samples + the max lag seen."})],qp);var nA=qp;import{Tool as sA,ToolContext as aA,z as oA}from"@frontmcp/sdk";var CE;function Zp(e){CE=e}s(Zp,"Ya"),o(Zp,"setActiveGraphBuffer");function ci(){return CE?.events??[]}s(ci,"Gt"),o(ci,"currentEvents");function Gt(){let e=new n4;return z3(e,ci()),e}s(Gt,"Ve"),o(Gt,"buildGraph");var Lp=class extends aA{static{s(this,"Cy")}static{o(this,"GraphGetNodeTool")}async execute(e){let t=Gt().getNode(e.nodeId);return t?{found:!0,node:t}:{found:!1,nodeId:e.nodeId}}};Lp=F([sA({name:"graph.get_node",description:"Returns a single graph node by id (built from the current event window).",inputSchema:{nodeId:oA.string().describe("Node id (usually the originating event id).")}})],Lp);var lA=Lp;import{Tool as dA,ToolContext as cA,z as ju}from"@frontmcp/sdk";var pA=["ownership","caused","async","data","render","state","network","backend","db","visual","performance","memory","lifecycle"],Vp=class extends cA{static{s(this,"Ly")}static{o(this,"GraphTraverseTool")}async execute(e){let t=Gt().traverse({from:e.from,lens:e.lens,depth:e.depth,direction:e.direction,maxNodes:e.maxNodes});return{nodeCount:t.nodes.length,edgeCount:t.edges.length,nodes:t.nodes.map(r=>({id:r.id,type:r.type,name:r.name,durationMs:r.durationMs,flowId:r.context.flowId})),edges:t.edges.map(r=>({from:r.from,to:r.to,axis:r.axis,type:r.type}))}}};Vp=F([dA({name:"graph.traverse",description:'Walk the multi-axis trace graph from a node along one or more edge axes (the "lens"). Bounded by depth + node count.',inputSchema:{from:ju.string().describe("Start node id."),lens:ju.array(ju.enum(pA)).min(1).describe('Edge axes to follow (e.g. ["caused","backend"]).'),depth:ju.number().int().positive().max(12).default(4),direction:ju.enum(["out","in","both"]).default("both"),maxNodes:ju.number().int().positive().max(1e3).default(200)}})],Vp);var mA=Vp;import{Tool as fA,ToolContext as hA,z as gA}from"@frontmcp/sdk";var Jp=class extends hA{static{s(this,"By")}static{o(this,"GraphFindDbInLoopTool")}async execute(e){let t=kd(ci(),{threshold:e.threshold});return{count:t.length,matches:t}}};Jp=F([fA({name:"graph.find_db_in_loop",description:"Scan the current event window for loops that issued more than `threshold` DB calls (N+1-ish backend anti-pattern).",inputSchema:{threshold:gA.number().int().positive().default(5)}})],Jp);var vA=Jp;import{Tool as yA,ToolContext as EA,z as bA}from"@frontmcp/sdk";var Wp=class extends EA{static{s(this,"qy")}static{o(this,"GraphFindSlowPathTool")}async execute(e){let t=Gt(),r=new Map,i=ci(),u=e.from?[e.from]:i.filter(l=>l.context.originNodeId===void 0&&l.context.flowId).map(l=>l.id);for(let l of i){let d=t.traverse({from:l.id,lens:["caused","async","backend"],depth:1,direction:"out",maxNodes:50});r.set(l.id,d.edges.filter(c=>c.from===l.id).map(c=>c.to))}let n=o(l=>t.getNode(l)?.durationMs??0,"durationOf"),a=S3(u.length?u:i.map(l=>l.id),r,n);return{totalDurationMs:a.totalDurationMs,path:a.path.map(l=>{let d=t.getNode(l);return{id:l,name:d?.name,type:d?.type,durationMs:d?.durationMs}})}}};Wp=F([yA({name:"graph.find_slow_path",description:"Find the slowest cumulative chain on the caused/async/backend axes starting from a node (or every flow origin if `from` is omitted).",inputSchema:{from:bA.string().optional().describe("Start node id; defaults to all flow origins.")}})],Wp);var wA=Wp;import{Tool as DA,ToolContext as $A,z as kE}from"@frontmcp/sdk";var Gp=class extends $A{static{s(this,"Gy")}static{o(this,"GraphTraceFromOriginTool")}async execute(e){let t=Gt(),r=e.originNodeId;if(!t.getNode(r)){let n=ci().find(a=>a.context.originNodeId===e.originNodeId||a.raw?.origin?.nodeId===e.originNodeId);n&&(r=n.id)}let i=t.getNode(r);if(!i)return{found:!1,originNodeId:e.originNodeId};let u=t.traverse({from:r,lens:["caused","render","state","backend","async"],depth:e.depth,direction:"out",maxNodes:500});return{found:!0,origin:{id:r,name:i.name,type:i.type},nodeCount:u.nodes.length,nodes:u.nodes.map(n=>({id:n.id,type:n.type,name:n.name,durationMs:n.durationMs}))}}};Gp=F([DA({name:"graph.trace_from_origin",description:'Given an origin node id (e.g. a data-agent-component value or an event id), returns every node reachable on the caused/render/state/backend axes \u2014 "what did this cause?".',inputSchema:{originNodeId:kE.string().describe("Origin node id, logicalId, or originating event id."),depth:kE.number().int().positive().max(12).default(6)}})],Gp);var BA=Gp;import{Tool as xA,ToolContext as CA,z as AE}from"@frontmcp/sdk";var Kp=class extends CA{static{s(this,"Ky")}static{o(this,"GraphFindStateUpdatesCausedByTool")}async execute(e){let t=Gt();if(!t.getNode(e.from))return{found:!1,from:e.from};let r=t.traverse({from:e.from,lens:["caused","state"],depth:e.depth,direction:"out",maxNodes:500}).nodes.filter(i=>i.type==="state-update");return{found:!0,count:r.length,stateUpdates:r.map(i=>({id:i.id,name:i.name,logicalId:i.logicalId}))}}};Kp=F([xA({name:"graph.find_state_updates_caused_by",description:'From an origin node, returns the state-update nodes reachable on the caused/state axes \u2014 "what state changed because of this?".',inputSchema:{from:AE.string().describe("Origin node id."),depth:AE.number().int().positive().max(12).default(6)}})],Kp);var kA=Kp;import{Tool as AA,ToolContext as IA,z as IE}from"@frontmcp/sdk";var Hp=class extends IA{static{s(this,"Xy")}static{o(this,"GraphFindBackendWorkCausedByClickTool")}async execute(e){let t=Gt();if(!t.getNode(e.from))return{found:!1,from:e.from};let r=t.traverse({from:e.from,lens:["caused","backend","async"],depth:e.depth,direction:"out",maxNodes:500}).nodes.filter(i=>i.type==="server-request");return{found:!0,count:r.length,requests:r.map(i=>({id:i.id,name:i.name,durationMs:i.durationMs}))}}};Hp=F([AA({name:"graph.find_backend_work_caused_by_click",description:'From a UI origin node, returns the server-request nodes reachable on the caused/backend/async axes \u2014 "what backend work did this click trigger?".',inputSchema:{from:IE.string().describe("UI origin node id (e.g. the user-action event id)."),depth:IE.number().int().positive().max(12).default(8)}})],Hp);var _A=Hp,_E=class{static{s(this,"Yy")}static{o(this,"GraphApp")}};_E=F([Q7({id:"graph",name:"Graph",description:"Multi-axis causal graph: traverse by lens, trace from origin, find slow paths + db-in-loop / n+1 / render-storm patterns.",resources:[uA,nA],tools:[lA,mA,vA,wA,BA,kA,_A]})],_E);var zu="graph://patterns",Nu="graph://performance/event-loop-lag",Xp=2e3,SE=8*1024*1024,SA=100,FE=100;function jE(e){let t=Ye(e.thresholds),r=(e.now??(()=>Date.now()))(),i={events:[]},u=[],n=0,a=0,l=0,d=new Set,c=[],p=new Map,m,f=new Map,h=o(C=>{switch(C.kind){case"n+1-query":return`n+1:${String(C.details.signature??"")}`;case"render-storm":return`storm:${String(C.details.componentInstanceId??"")}`;case"db-in-loop":return`dbloop:${C.evidence[0]??""}`;default:return`${C.kind}:${C.evidence.join(",")}`}},"patternKey"),g=o(C=>{p.set(zu,C),e.resources.markDirty(zu)},"markPatterns"),E=o((C,M)=>{let y=h(C);if(f.delete(y),f.set(y,C),f.size>SA){let D=f.keys().next().value;D!==void 0&&f.delete(D)}g(M)},"pushPattern"),x=o(C=>{let M=!1;for(let[y,D]of f){if(D.evidence.length===0)continue;let A=D.evidence.filter(j=>d.has(j));if(A.length===0){f.delete(y),M=!0;continue}A.length!==D.evidence.length&&(D.evidence=A,M=!0)}M&&g(C)},"dropUnevidencedPatterns"),$=o(C=>{m=C.timestamp;let M=is(C);i.events.push(C),u.push(M),n+=M,d.add(C.id);let y=Math.max(0,i.events.length-Xp),D=n;for(let N=0;N<y;N+=1)D-=u[N]??0;let A=0;for(;D>SE&&y<u.length;)D-=u[y]??0,y+=1,A+=1;if(y>0){let N=i.events.splice(0,y);u.splice(0,y),n=Math.max(0,D),a+=N.length,l+=A;for(let K of N)d.delete(K.id);x(C.timestamp)}let j=C.raw??null;if(j?.kind==="loop")for(let N of kd(i.events,{threshold:t.dbInLoop}))E(N,C.timestamp);if(j?.kind==="db-query")for(let N of I3(i.events,{threshold:t.nPlusOne}))E(N,C.timestamp);if(C.source==="react"&&j?.kind==="render")for(let N of _3(i.events,{threshold:t.renderStorm}))E(N,C.timestamp);C.source==="perf"&&j?.kind==="event-loop-lag"&&typeof j.lagMs=="number"&&(c.push({at:C.timestamp,lagMs:j.lagMs,source:C.source}),c.length>FE&&c.splice(0,c.length-FE),p.set(Nu,C.timestamp),e.resources.markDirty(Nu))},"handler"),w=e.bus.subscribe($);Zp(i);let k=o(C=>new Date(p.get(C)??r).toISOString(),"stamp");return e.resources.register(zu,()=>({schemaVersion:1,revision:e.resources.revision(zu)??0,updatedAt:k(zu),patterns:[...f.values()],eventsBuffered:i.events.length,eventBufferCapacity:Xp,lastEventAt:m,producer:m===void 0?"none":"connected"})),e.resources.register(Nu,()=>({schemaVersion:1,revision:e.resources.revision(Nu)??0,updatedAt:k(Nu),samples:c.slice(),maxLagMs:c.reduce((C,M)=>Math.max(C,M.lagMs),0),lastEventAt:m})),{unsubscribe:o(()=>{Zp(void 0),w()},"unsubscribe"),uris:[zu,Nu],retentionStats:o(()=>({residentEvents:i.events.length,residentBytes:n,evictedEvents:a,evictedForBytes:l,eventCap:Xp,byteCap:SE}),"retentionStats")}}s(jE,"eb"),o(jE,"installGraphReducer");import{App as FA}from"@frontmcp/sdk";import{Resource as jA,ResourceContext as zA}from"@frontmcp/sdk";var Yp=class extends zA{static{s(this,"tb")}static{o(this,"MemoryCurrentResource")}async execute(){return this.get(Z).read("memory://current")}};Yp=F([jA({name:"memory-current",uri:"memory://current",mimeType:"application/json",description:"Last process-memory sample (heapUsed / rss)."})],Yp);var NA=Yp;import{Resource as MA,ResourceContext as OA}from"@frontmcp/sdk";var Qp=class extends OA{static{s(this,"nb")}static{o(this,"MemoryOwnersResource")}async execute(){return this.get(Z).read("memory://owners")}};Qp=F([MA({name:"memory-owners",uri:"memory://owners",mimeType:"application/json",description:"All tracked container owners with current item count + byte estimate."})],Qp);var RA=Qp;import{Resource as TA,ResourceContext as PA}from"@frontmcp/sdk";var em=class extends PA{static{s(this,"ib")}static{o(this,"MemoryOwnersGrowingResource")}async execute(){return this.get(Z).read("memory://owners/growing")}};em=F([TA({name:"memory-owners-growing",uri:"memory://owners/growing",mimeType:"application/json",description:"Top 20 container owners by growth-since-start."})],em);var UA=em;import{Resource as qA,ResourceContext as ZA}from"@frontmcp/sdk";var tm=class extends ZA{static{s(this,"ab")}static{o(this,"MemoryLeaksSuspectedResource")}async execute(){return this.get(Z).read("memory://leaks/suspected")}};tm=F([qA({name:"memory-leaks-suspected",uri:"memory://leaks/suspected",mimeType:"application/json",description:"Suspected leaks: per-flow retentions + stale-generation singletons."})],tm);var LA=tm;import{Resource as VA,ResourceContext as JA}from"@frontmcp/sdk";var um=class extends JA{static{s(this,"ub")}static{o(this,"MemoryPodsResource")}async execute(){return this.get(Z).read("memory://pods")}};um=F([VA({name:"memory-pods",uri:"memory://pods",mimeType:"application/json",description:"Each dev-cluster pod's heap after a full GC (boot, after every hot swap, after bursts), a short per-service history, and closed generations proven still in memory."})],um);var WA=um;import{Tool as GA,ToolContext as KA,z as HA}from"@frontmcp/sdk";var zE;function rm(e){zE=e}s(rm,"Qa"),o(rm,"setActiveMemoryLookups");function Mu(){return zE}s(Mu,"nt"),o(Mu,"activeMemoryLookups");var im=class extends KA{static{s(this,"db")}static{o(this,"MemoryFindGrowthByFlowTool")}async execute(e){let t=Mu();if(!t)return{found:!1,reason:"no active memory reducer"};let r=t.growthByFlow(e.flowId);return{found:!0,flowId:e.flowId,owners:r}}};im=F([GA({name:"memory.find_growth_by_flow",description:'Returns the container owners mutated during a flow and how much each grew \u2014 "what did this flow allocate?".',inputSchema:{flowId:HA.string().describe("Flow id.")}})],im);var XA=im;import{Tool as YA,ToolContext as QA,z as eI}from"@frontmcp/sdk";var nm=class extends QA{static{s(this,"fb")}static{o(this,"MemoryFindFlowsThatMutatedOwnerTool")}async execute(e){let t=Mu();if(!t)return{found:!1,reason:"no active memory reducer"};let r=t.flowsThatMutatedOwner(e.ownerId);return{found:!0,ownerId:e.ownerId,flowIds:r}}};nm=F([YA({name:"memory.find_flows_that_mutated_owner",description:"Returns the flow ids that mutated a given container owner.",inputSchema:{ownerId:eI.string().describe("Owner id (<ownerInstanceId>::<fieldName>).")}})],nm);var tI=nm;import{Tool as uI,ToolContext as rI,z as iI}from"@frontmcp/sdk";var sm=class extends rI{static{s(this,"hb")}static{o(this,"MemoryExplainLeakTool")}async execute(e){let t=Mu();if(!t)return{found:!1,reason:"no active memory reducer"};let r=t.getLeak(e.leakIndex);if(!r)return{found:!1,leakIndex:e.leakIndex};let i,u;if(r.kind==="retention"){let n=r.detail;i=`Owner ${n.ownerId} grew by ${n.growth} items during flow ${n.flowId} and did not shrink after the flow settled.`,u="Add a TTL / max-size eviction policy to this container, or clear it when the owning scope is disposed. If it is a request-scoped cache, move it off the singleton."}else{let n=r.detail;i=`${r.service??r.project} pod #${r.pod} (pid ${r.pid}): hot-swap generation ${n.gen} is still in memory ${Math.round(n.ageMs/1e3)}s after its app was closed, through ${n.gcs} full GCs and ${n.swapsSinceClose} swap(s) \u2014 still alive: ${(n.alive??[]).join(", ")}. Not garbage: something still points into it.`,u=`Run \`lensmcp mem ${r.service??r.project} --snapshot --analyze\` for the shortest path from the GC roots to it. Usual retainers: a listener on a process-global emitter, a module-level cache or registry, a timer the old app's onModuleDestroy does not clear. memory.explain_pod reads the pod's whole picture.`}return{found:!0,leak:r,narrative:i,recommendation:u}}};sm=F([uI({name:"memory.explain_leak",description:"Returns a narrative explanation of a suspected leak (by index in memory://leaks/suspected): which owner and flow grew, or which pod generation outlived its close \u2014 and a remediation hint.",inputSchema:{leakIndex:iI.number().int().nonnegative().describe("Index into memory://leaks/suspected.")}})],sm);var nI=sm;import{Tool as sI,ToolContext as aI,z as NE}from"@frontmcp/sdk";var ME=6,am=class extends aI{static{s(this,"vb")}static{o(this,"MemoryPodsTool")}async execute(e){let t=Mu();if(!t)return{found:!1,reason:"no active memory reducer"};if(e.service){let i=t.podsOf(e.service);return i?{found:!0,...i,history:i.history.slice(-(e.history??ME))}:{found:!1,service:e.service,known:t.pods().map(u=>u.service).slice(0,32),reason:"no pod of that service has reported \u2014 pods report at boot and after every hot swap"}}let r=t.pods().slice(0,32).map(i=>({project:i.project,service:i.service,lastSeenAt:i.lastSeenAt,pods:i.pods}));return{found:r.length>0,services:r}}};am=F([sI({name:"memory.pods",description:"What each dev-cluster pod weighs: heap after a full GC, reserved heap, rss, boot baseline, swaps, and any closed hot-swap generation proven still in memory. Give `service` for that service's recent per-swap history.",inputSchema:{service:NE.string().optional().describe("Nx project or cluster service name. Omit for every service (latest reading per pod, no history)."),history:NE.number().int().min(0).max(12).optional().describe(`Recent readings to include for one service (default ${ME}).`)}})],am);var oI=am;import{Tool as lI,ToolContext as dI,z as OE}from"@frontmcp/sdk";var Qs=o(e=>e>=1073741824?`${(e/1073741824).toFixed(1)} GB`:`${Math.round(e/1048576)} MB`,"mb"),RE=o(e=>e<9e4?`${Math.round(e/1e3)}s`:`${Math.round(e/6e4)} min`,"age");function TE(e,t,r=Date.now()){let i=t.latest,u=[];if(!i)return{service:e.service,pod:t.pod,pid:t.pid,narrative:`${e.service} pod #${t.pod} (pid ${t.pid}) has not reported a reading yet.`,findings:u,recommendation:"It reports at boot and after every swap \u2014 check `lensmcp mem` once it has booted."};let n=i.baseline??(i.trigger==="boot"?i.live:void 0),a=n?i.live/n:void 0,l=`${e.service} pod #${t.pod} (pid ${t.pid}): ${Qs(i.live)} live after a full GC (${i.trigger}, ${RE(r-i.at)} ago), generation ${i.gen} after ${i.swaps} swap${i.swaps===1?"":"s"}`;n&&a!==void 0&&(l+=` \u2014 ${a.toFixed(1)}\xD7 the ${Qs(n)} it booted with`),l+=".",a!==void 0&&a>=2.5?u.push(`At ${a.toFixed(1)}\xD7 its boot heap it is near the recycle bound (3\xD7 by default): the pod will be replaced by a fresh process if it grows further.`):a!==void 0&&a>=1.4&&u.push(`More than one generation's worth of live heap (${a.toFixed(1)}\xD7): a generation still draining or pinned, or state the app accumulated since boot.`),i.used-i.live>=64*1048576&&u.push(`That collection gave back ${Qs(i.used-i.live)} of garbage \u2014 what an idle pod kept before it collected on its own.`),i.reserved-i.live>=128*1048576&&u.push(`V8 holds ${Qs(i.reserved-i.live)} reserved beyond the live heap; that is the allocator's slack, which a later GC shrinks \u2014 not a leak.`),i.previousAlive===!0?u.push(`Generation ${i.previousGen} \u2014 the one the last swap replaced \u2014 was still in memory at this reading.`):i.previousAlive===!1&&u.push(`Generation ${i.previousGen} \u2014 the one the last swap replaced \u2014 has been collected.`),i.containers!==void 0&&i.containers>1&&u.push(`${i.containers} Nest DI containers are alive: more than one app's worth.`);for(let c of t.retained){let p=c.counts&&Object.keys(c.counts).length?` Live then: ${Object.entries(c.counts).map(([m,f])=>`${m} ${f}`).join(", ")}.`:"";u.push(`RETAINED: generation ${c.gen} is still in memory ${RE(r-c.closedAt)} after its app was closed, through ${c.gcs} full GCs and ${c.swapsSinceClose} swap${c.swapsSinceClose===1?"":"s"} (still alive: ${c.alive.join(", ")}).${p}`)}i.sourceMaps&&u.push("The pod runs with source maps enabled: with an eval devtool the bundle is held as text several times (`lensmcp doctor` checks it).");let d=t.retained.length?`Something still points into the retained generation. \`lensmcp mem ${e.service} --snapshot --analyze\` prints the shortest path from the GC roots to it \u2014 usually a listener on a process-global emitter, a module-level cache or registry, or a timer an onModuleDestroy does not clear. Until it is fixed the pod is replaced once the generation has been retained for LENSMCP_SWAP_RECYCLE_RETAINED_MS (10 min by default).`:a!==void 0&&a>=2?`No closed generation is retained, so this is growth inside the serving app. Compare readings across swaps with \`lensmcp mem ${e.service}\`; \`lensmcp mem ${e.service} --snapshot --analyze\` lists the largest retainers by class and by package.`:"Nothing to act on: one generation in memory, and the previous one collected.";return{service:e.service,pod:t.pod,pid:t.pid,narrative:l,findings:u,recommendation:d}}s(TE,"bb"),o(TE,"explainPod");var om=class extends dI{static{s(this,"wb")}static{o(this,"MemoryExplainPodTool")}async execute(e){let t=Mu();if(!t)return{found:!1,reason:"no active memory reducer"};let r=t.podsOf(e.service);if(!r)return{found:!1,service:e.service,reason:"no pod of that service has reported"};let i=r.pods.filter(u=>e.pod===void 0||u.pod===e.pod).slice(0,8);return i.length===0?{found:!1,service:e.service,pods:r.pods.map(u=>u.pod),reason:`no pod #${e.pod}`}:{found:!0,explanations:i.map(u=>TE(r,u))}}};om=F([lI({name:"memory.explain_pod",description:"Explains one dev-cluster pod's memory in a few sentences: how many app generations its live heap is, whether the last hot swap's copy was collected, reserved-heap slack, and any closed generation proven still in memory \u2014 with the next step (e.g. a heap snapshot).",inputSchema:{service:OE.string().describe("Nx project or cluster service name."),pod:OE.number().int().positive().optional().describe("Pod id (the N of Child#N). Omit for every pod of the service (at most 8).")}})],om);var cI=om,PE=class{static{s(this,"$b")}static{o(this,"MemoryApp")}};PE=F([FA({id:"memory",name:"Memory",description:"Container-owner growth tracking, suspect-leak detection, and dev-cluster pod heaps (post-GC readings, retained hot-swap generations). Hosts memory.explain_leak, memory.pods, memory.explain_pod.",resources:[NA,RA,UA,LA,WA],tools:[XA,tI,nI,oI,cI]})],PE);var pI=64,mI=16,UE=12,fI=16,qE=24*36e5;function Kt(e,t,r,i){return`pod-retained:${e}:${t}:${r}:${i}`}s(Kt,"yn"),o(Kt,"retainedLeakKey");var hI=o((e,t)=>`${e}:${t}`,"podKey");function lm(e,t){let r={};for(let[i,u]of Object.entries(e))t.includes(i)||(r[i]=u);return r}s(lm,"Sk"),o(lm,"stripIdentity");var gI=class{static{s(this,"tc")}static{o(this,"PodMemoryState")}constructor(){this.services=new Map}apply(e){if(e.source!=="memory")return;let t=Hn(e.raw);if(!t)return;let r=e.timestamp;this.lastEventAt=Math.max(this.lastEventAt??0,r);let i={pods:!0,retainedAdded:[],retainedRemoved:[]},u=this.service(t.project,t.service||t.project,r),n=hI(t.pod,t.pid);if(t.kind==="pod-memory-exited"){let l=u.pods.get(n);if(l)for(let d of l.retained.keys())i.retainedRemoved.push(Kt(t.project,t.pod,t.pid,d));return u.pods.delete(n),i}let a=u.pods.get(n);if(!a){if(t.kind==="pod-memory"&&t.trigger==="boot"){for(let[l,d]of u.pods)if(d.pod===t.pod){for(let c of d.retained.keys())i.retainedRemoved.push(Kt(t.project,d.pod,d.pid,c));u.pods.delete(l)}}if(a={pod:t.pod,pid:t.pid,podGeneration:t.podGeneration??1,lastSeenAt:r,retained:new Map},u.pods.set(n,a),u.pods.size>mI){let l=[...u.pods.entries()].sort((d,c)=>d[1].lastSeenAt-c[1].lastSeenAt)[0];if(l){for(let d of l[1].retained.keys())i.retainedRemoved.push(Kt(t.project,l[1].pod,l[1].pid,d));u.pods.delete(l[0])}}}if(a.lastSeenAt=r,t.kind==="pod-memory")a.latest=lm(t,["project","service","pod","pid","podGeneration","floodSuppressed"]),u.history.push({at:t.at??r,pod:t.pod,pid:t.pid,trigger:t.trigger,gen:t.gen,swaps:t.swaps,live:t.live,used:t.used,reserved:t.reserved,rss:t.rss,...t.previousGen!==void 0?{previousGen:t.previousGen}:{},previousAlive:t.previousAlive??null,retained:t.retained??0}),u.history.length>UE&&u.history.splice(0,u.history.length-UE);else if(t.kind==="pod-memory-retained"){let l={...lm(t,["project","service","floodSuppressed"]),at:r};a.retained.delete(t.gen),a.retained.set(t.gen,l),a.retained.size>fI&&a.retained.delete(a.retained.keys().next().value),i.retainedAdded.push({key:Kt(t.project,t.pod,t.pid,t.gen),project:t.project,service:u.service,pod:t.pod,pid:t.pid,generation:l})}else t.kind==="pod-memory-released"&&(a.retained.delete(t.gen),i.retainedRemoved.push(Kt(t.project,t.pod,t.pid,t.gen)));return this.sweep(r,i,t.project),i}views(){return[...this.services.values()].sort((e,t)=>e.project.localeCompare(t.project)).map(e=>this.view(e))}find(e){let t=this.services.get(e)??[...this.services.values()].find(r=>r.service===e);return t?this.view(t):void 0}view(e){return{project:e.project,service:e.service,lastSeenAt:e.lastSeenAt,pods:[...e.pods.values()].sort((t,r)=>t.pod-r.pod).map(t=>({pod:t.pod,pid:t.pid,podGeneration:t.podGeneration,lastSeenAt:t.lastSeenAt,...t.latest?{latest:t.latest}:{},retained:[...t.retained.values()]})),history:[...e.history]}}service(e,t,r){let i=this.services.get(e);if(!i&&(i={project:e,service:t,lastSeenAt:r,pods:new Map,history:[]},this.services.set(e,i),this.services.size>pI)){let u=[...this.services.values()].sort((n,a)=>n.lastSeenAt-a.lastSeenAt)[0];u&&u!==i&&this.services.delete(u.project)}return i.lastSeenAt=Math.max(i.lastSeenAt,r),i.service=t,i}sweep(e,t,r){for(let i of this.services.values()){for(let[u,n]of i.pods)if(!(e-n.lastSeenAt<=qE)){for(let a of n.retained.keys())t.retainedRemoved.push(Kt(i.project,n.pod,n.pid,a));i.pods.delete(u)}i.pods.size===0&&i.project!==r&&e-i.lastSeenAt>qE&&this.services.delete(i.project)}}},pi="memory://current",mi="memory://owners",fi="memory://owners/growing",Ht="memory://leaks/suspected",hi="memory://pods",vI=200,ZE=50,yI=500;function LE(e){let t=(e.now??(()=>Date.now()))(),r={owners:new Map,leaks:new Map,changedAt:new Map},i=new gI,u=o(($,w)=>{r.changedAt.set($,w),e.resources.markDirty($)},"touch"),n=o(($,w)=>{if(r.leaks.delete($),r.leaks.set($,w),r.leaks.size>vI){let k=r.leaks.keys().next().value;k!==void 0&&r.leaks.delete(k)}},"pushLeak"),a=new Map,l=o(($,w)=>{$!==w&&(a.delete($),a.set($,w),a.size>5e3&&a.delete(a.keys().next().value))},"noteRequestFlow"),d=o(($,w)=>{if($.flowIds.add(w),$.flowIds.size>ZE){for(let k of $.flowIds)if($.flowIds.delete(k),$.flowIds.size<=ZE)break}},"noteFlow"),c=o(($,w,k)=>{let C=r.owners.get($);if(C||(C={ownerId:$,itemCount:w,estimatedBytes:0,startCount:w,mutations:0,flowIds:new Set,lastMutatedAt:k}),r.owners.delete($),r.owners.set($,C),r.owners.size>yI){let M=r.owners.keys().next().value;M!==void 0&&M!==$&&r.owners.delete(M)}return C},"ensure"),p=o(($,w)=>{let k=!1;for(let[C,M]of r.leaks){if(M.kind!=="retention"||M.ownerId!==$)continue;let y=M.detail.startCount;typeof y=="number"&&w<=y&&(r.leaks.delete(C),k=!0)}return k},"retractReleasedRetentions"),m=o($=>{let w=i.apply($);if(!w)return!1;r.lastEventAt=Math.max(r.lastEventAt??0,$.timestamp),u(hi,$.timestamp);let k=!1;for(let C of w.retainedRemoved)k=r.leaks.delete(C)||k;for(let C of w.retainedAdded)n(C.key,{kind:"retained-generation",project:C.project,service:C.service,pod:C.pod,pid:C.pid,generation:C.generation.gen,detail:{...C.generation},at:$.timestamp}),k=!0;return k&&u(Ht,$.timestamp),!0},"applyPodMemory"),f=o($=>{if($.source!=="memory"&&$.source!=="perf"||m($))return;let w=$.raw??null;if(w?.kind)switch(r.lastEventAt=Math.max(r.lastEventAt??0,$.timestamp),w.kind){case"memory-mutation":{if(!w.mutation)return;let k=w.mutation,C=c(k.ownerNodeId,k.beforeCount??k.afterCount,$.timestamp);C.itemCount=k.afterCount,C.estimatedBytes=k.afterCount*64,C.mutations+=1,C.lastMutatedAt=$.timestamp,$.context.flowId&&d(C,$.context.flowId),$.context.requestId&&$.context.flowId&&l($.context.requestId,$.context.flowId),u(mi,$.timestamp),u(fi,$.timestamp),p(k.ownerNodeId,k.afterCount)&&u(Ht,$.timestamp);return}case"memory-retention":{if(!w.retention)return;let k=w.retention,C=k.requestId?k.flowId:a.get(k.flowId)??k.flowId;n(`retention:${k.ownerId}:${C}`,{kind:"retention",ownerId:k.ownerId,flowId:C,detail:{...k,flowId:C},at:$.timestamp}),u(Ht,$.timestamp);return}case"process-memory":{if(!w.memory)return;r.current={...w.role?{role:w.role}:{},heapUsed:w.memory.heapUsed,heapTotal:w.memory.heapTotal,rss:w.memory.rss,external:w.memory.external,arrayBuffers:w.memory.arrayBuffers,at:$.timestamp},u(pi,$.timestamp);return}default:return}},"handler"),h=e.bus.subscribe(f),g=o($=>new Date(r.changedAt.get($)??t).toISOString(),"stamp"),E=o(()=>({lastEventAt:r.lastEventAt,ownersTracked:r.owners.size,producer:r.lastEventAt===void 0?"none":"connected",detail:r.lastEventAt===void 0?"No memory event has ever been observed \u2014 an empty leak list is NOT evidence there is no leak, nothing is watching. Run under the dev cluster with @lensmcp/memory-tracker wired.":`${r.owners.size} owner${r.owners.size===1?"":"s"} tracked; ${r.leaks.size} suspected leak${r.leaks.size===1?"":"s"}.`}),"health");e.resources.register(pi,()=>({schemaVersion:1,revision:e.resources.revision(pi)??0,updatedAt:g(pi),current:r.current??null})),e.resources.register(mi,()=>({schemaVersion:1,revision:e.resources.revision(mi)??0,updatedAt:g(mi),owners:[...r.owners.values()].map(dm),...E()})),e.resources.register(fi,()=>({schemaVersion:1,revision:e.resources.revision(fi)??0,updatedAt:g(fi),owners:[...r.owners.values()].map(dm).filter($=>$.growthSinceStart>0).sort(($,w)=>w.growthSinceStart-$.growthSinceStart).slice(0,20),...E()})),e.resources.register(Ht,()=>({schemaVersion:1,revision:e.resources.revision(Ht)??0,updatedAt:g(Ht),suspected:[...r.leaks.values()],...E()})),e.resources.register(hi,()=>({schemaVersion:1,revision:e.resources.revision(hi)??0,updatedAt:g(hi),services:i.views(),lastEventAt:i.lastEventAt,producer:i.lastEventAt===void 0?"none":"connected",detail:i.lastEventAt===void 0?"No pod has reported its heap \u2014 these readings come from the dev cluster (`@lensmcp/cluster` devserver pods, which report at boot and after every hot swap). An empty list is not evidence the pods are small.":"Bytes. `live` is the heap after a full GC; `used` the heap just before it; `reserved` what V8 keeps. A `retained` generation was closed and is PROVEN still in memory \u2014 see memory.explain_pod."}));let x={ownersMutatedByFlow($){return[...r.owners.values()].filter(w=>w.flowIds.has($))},growthByFlow($){return[...r.owners.values()].filter(w=>w.flowIds.has($)).map(w=>({ownerId:w.ownerId,growth:w.itemCount-w.startCount}))},flowsThatMutatedOwner($){let w=r.owners.get($);return w?[...w.flowIds]:[]},getLeak($){return[...r.leaks.values()][$]},allLeaks(){return[...r.leaks.values()]},pods(){return i.views()},podsOf($){return i.find($)}};return rm(x),{unsubscribe:o(()=>{rm(void 0),h()},"unsubscribe"),uris:[pi,mi,fi,Ht,hi],lookups:x}}s(LE,"_b"),o(LE,"installMemoryReducer");function dm(e){return{ownerId:e.ownerId,itemCount:e.itemCount,estimatedBytes:e.estimatedBytes,mutations:e.mutations,startCount:e.startCount,growthSinceStart:e.itemCount-e.startCount,lastMutatedAt:e.lastMutatedAt,flowIds:[...e.flowIds]}}s(dm,"Rk"),o(dm,"toOwnerView");function VE(){let{session:e,providers:t}=R3(),r=J3(),i=W3();for(let x of i.problems)console.error(`[lensmcp] nx.json lensmcp.flows: ${x}`);m6({bus:e.bus,resources:e.resources}),g6({bus:e.bus,resources:e.resources}),E6({bus:e.bus,resources:e.resources}),D6({bus:e.bus,resources:e.resources}),k6({bus:e.bus,resources:e.resources}),z6({bus:e.bus,resources:e.resources}),M6({bus:e.bus,resources:e.resources}),R6({bus:e.bus,resources:e.resources}),U6({bus:e.bus,resources:e.resources,thresholds:r}),G6({bus:e.bus,resources:e.resources,thresholds:r}),Y6({bus:e.bus,resources:e.resources,thresholds:r}),nE({bus:e.bus,resources:e.resources,thresholds:r}),gE({bus:e.bus,resources:e.resources}),bE({bus:e.bus,resources:e.resources,thresholds:r}),xE({bus:e.bus,resources:e.resources});let u=ic({bus:e.bus,resources:e.resources,flows:i});e.registerReducerRetention("flow",u.retentionStats),i6({resources:e.resources});let n=jE({bus:e.bus,resources:e.resources,thresholds:r});e.registerReducerRetention("graph",n.retentionStats),LE({bus:e.bus,resources:e.resources}),Sy({bus:e.bus,resources:e.resources,sessionId:e.id});let a=3e4,l=512*1024*1024,d=0,c=o(()=>{let x=process.memoryUsage(),$=Date.now(),w=x.rss>=l;w&&$-d>=5*6e4&&(d=$,console.warn(`[lensmcp] high process memory: rss=${Math.round(x.rss/1024/1024)}MB heap=${Math.round(x.heapUsed/1024/1024)}MB`)),e.bus.publish({id:lt(),sessionId:e.id,timestamp:$,source:"perf",category:"runtime",severity:w?"warning":"info",context:{sessionId:e.id},fingerprint:a4({kind:"process-memory",identity:process.env.LENSMCP_PROCESS_ROLE??"session"}),title:`LensMCP process memory (${process.env.LENSMCP_PROCESS_ROLE??"session"})`,raw:{kind:"process-memory",role:process.env.LENSMCP_PROCESS_ROLE??"session",memory:{rss:x.rss,heapUsed:x.heapUsed,heapTotal:x.heapTotal,external:x.external,arrayBuffers:x.arrayBuffers}}})},"publishProcessMemory");c();let p=setInterval(c,a);p.unref?.(),e.onShutdown({name:"process-memory",stop:o(()=>clearInterval(p),"stop")});let m=1200,f=new Map,h=e.bus.subscribe(x=>{let $=x.context.flowId;if(!$)return;let w=f.get($);w&&clearTimeout(w);let k=setTimeout(()=>{f.delete($);try{let C=Qe()?.getFlowEvents($);if(!C||C.length===0)return;let M=ca(C,{flowId:$});M&&Bc(M)}catch{}},m);k.unref?.(),f.set($,k)});e.onShutdown({name:"story-autocompile",stop:o(()=>{h();for(let x of f.values())clearTimeout(x);f.clear()},"stop")});let g=L3({bus:e.bus,sessionId:e.id,onError:o(x=>console.error("[lensmcp] ingest error:",x),"onError")});g.mode!=="none"&&console.error(`[lensmcp] event ingest active (mode=${g.mode})`),e.onShutdown({name:"event-ingest",stop:o(()=>g.stop(),"stop")});let E=process.env.LENSMCP_EVENT_FILE;return E&&(ec({eventFile:E,flows:i,budget:Ny(),prepare:JE(e.id)}),e.onShutdown({name:"flow-recovery",stop:o(()=>ec(void 0),"stop")})),{session:e,providers:t,ingest:g,flows:i}}s(VE,"Ek"),o(VE,"createLensSession");function JE(e){let t=Ad({}),r=da({});return i=>(i.sessionId==="pending"&&(i.sessionId=e,i.context&&i.context.sessionId==="pending"&&(i.context.sessionId=e)),r.redact(t.clamp(i)))}s(JE,"pP"),o(JE,"ingestPreparation");var EI=new Set(["localhost","127.0.0.1","lensmcp.local"]);function WE(e){if(!e)return!1;let t=e.trim().toLowerCase();if(t.startsWith("[")){let r=t.indexOf("]");return r!==-1&&t.slice(1,r)==="::1"}return t.indexOf(":")===t.lastIndexOf(":")&&(t=t.split(":")[0]??""),EI.has(t)}s(WE,"mP"),o(WE,"hostHeaderIsLocal");function GE(e,t){if(!e||WE(t))return{ok:!0};let r=(t??"").replace(/[^\x20-\x7e]/g,"?").slice(0,80);return{ok:!1,status:403,error:"this dashboard answers only requests addressed to this machine (localhost, 127.0.0.1, [::1] or lensmcp.local)"+(r?`; this one was addressed to "${r}"`:"")}}s(GE,"Tk"),o(GE,"dashboardHostVerdict");import{createHmac as KE,randomBytes as HE,timingSafeEqual as bI}from"node:crypto";import{chmodSync as wI,mkdirSync as DI,readFileSync as $I,writeFileSync as XE}from"node:fs";import{dirname as BI,join as xI}from"node:path";var ea="__lensmcp_token",cm="__lensmcp_login",YE=10*6e4,CI=720*60*60;function pm(e){return xI(e,".lensmcp","dashboard-token")}s(pm,"kb"),o(pm,"dashboardTokenPath");function QE(e,t,r={}){if(e.LENSMCP_ALLOW_INSECURE==="1")return{source:"disabled"};let i=e.LENSMCP_DASHBOARD_TOKEN?.trim();if(i)return{token:i,source:"env"};let u=r.read??(c=>$I(c,"utf8")),n=r.write??((c,p)=>XE(c,p,{mode:384,flag:"wx"})),a=r.ensureDir??(c=>{DI(c,{recursive:!0,mode:448})}),l=r.chmod??((c,p)=>wI(c,p)),d=pm(t);try{let c=u(d).trim();if(c){try{l(d,384)}catch{}return{token:c,source:"file"}}}catch{}try{a(BI(d));let c=HE(32).toString("hex");try{n(d,`${c}
72
- `)}catch(p){if(p.code!=="EEXIST")throw p;let m=u(d).trim();if(m)return{token:m,source:"file"};XE(d,`${c}
73
- `,{mode:384})}try{l(d,384)}catch{}return{token:c,source:"created"}}catch(c){return{source:"unavailable",reason:c instanceof Error?c.message:String(c)}}}s(QE,"Mk"),o(QE,"resolveDashboardToken");function gi(e,t){let r=Buffer.from(e,"utf8"),i=Buffer.from(t,"utf8");return r.length!==i.length?!1:bI(r,i)}s(gi,"rc"),o(gi,"sameSecret");function mm(e,t,r,i){if(!e)return!0;let u=Array.isArray(t)?t[0]:t,n=/^Bearer\s+(.+)$/i.exec((u??"").trim())?.[1]?.trim();if(n&&gi(n,e))return!0;let a=r?.trim();if(a&&gi(a,e))return!0;let l=i?tb(i.header,i.name):void 0;return!!l&&gi(l,fm(e))}s(mm,"Sb"),o(mm,"dashboardAuthorized");function eb(e){return`lensmcp_dash_${e.replace(/[^A-Za-z0-9_-]/g,"_")}`}s(eb,"Nk"),o(eb,"sessionCookieName");function fm(e){return KE("sha256",e).update("lensmcp-dashboard-session-v1").digest("hex")}s(fm,"Ib"),o(fm,"sessionCookieValue");function tb(e,t){for(let r of(e??"").split(";")){let i=r.indexOf("=");if(i>0&&r.slice(0,i).trim()===t)return r.slice(i+1).trim()}}s(tb,"$P"),o(tb,"readCookie");function ub(e,t,r,i){return`${e}=${t}; Path=${r}; HttpOnly; SameSite=Strict; Max-Age=${CI}${i?"; Secure":""}`}s(ub,"Pk"),o(ub,"sessionCookieHeader");function hm(e,t,r){return KE("sha256",e).update(`lensmcp-dashboard-login
65
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let l=a[1];if(t===a[0]){i(a);continue}if(e.external){let d=e.external.registry.get(a[0])?.id;if(t!==a[0]&&d){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(l.cycle){i(a);continue}if(l.count>1&&e.reused==="ref"){i(a);continue}}}s(Tt,"zt"),o(Tt,"extractDefs");function Pt(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=o(l=>{let d=e.seen.get(l);if(d.ref===null)return;let c=d.def??d.schema,p={...c},m=d.ref;if(d.ref=null,m){n(m);let h=e.seen.get(m),g=h.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(g)):Object.assign(c,g),Object.assign(c,p),l._zod.parent===m)for(let b in c)b==="$ref"||b==="allOf"||b in p||delete c[b];if(g.$ref&&h.def)for(let b in c)b==="$ref"||b==="allOf"||b in h.def&&JSON.stringify(c[b])===JSON.stringify(h.def[b])&&delete c[b]}let f=l._zod.parent;if(f&&f!==m){n(f);let h=e.seen.get(f);if(h?.schema.$ref&&(c.$ref=h.schema.$ref,h.def))for(let g in c)g==="$ref"||g==="allOf"||g in h.def&&JSON.stringify(c[g])===JSON.stringify(h.def[g])&&delete c[g]}e.override({zodSchema:l,jsonSchema:c,path:d.path??[]})},"flattenRef");for(let l of[...e.seen.entries()].reverse())n(l[0]);let u={};if(e.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?u.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?u.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");u.$id=e.external.uri(l)}Object.assign(u,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&u.id===i&&delete u.id;let a=e.external?.defs??{};for(let l of e.seen.entries()){let d=l[1];d.def&&d.defId&&(d.def.id===d.defId&&delete d.def.id,a[d.defId]=d.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?u.$defs=a:u.definitions=a);try{let l=JSON.parse(JSON.stringify(u));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:kr(t,"input",e.processors),output:kr(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}s(Pt,"Mt"),o(Pt,"finalize");function xe(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return xe(n.element,r);if(n.type==="set")return xe(n.valueType,r);if(n.type==="lazy")return xe(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return xe(n.innerType,r);if(n.type==="intersection")return xe(n.left,r)||xe(n.right,r);if(n.type==="record"||n.type==="map")return xe(n.keyType,r)||xe(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:xe(n.in,r)||xe(n.out,r);if(n.type==="object"){for(let u in n.shape)if(xe(n.shape[u],r))return!0;return!1}if(n.type==="union"){for(let u of n.options)if(xe(u,r))return!0;return!1}if(n.type==="tuple"){for(let u of n.items)if(xe(u,r))return!0;return!!(n.rest&&xe(n.rest,r))}return!1}s(xe,"Oe"),o(xe,"isTransforming");var Kv=o((e,t={})=>r=>{let n=Rt({...r,processors:t});return ne(e,n),Tt(n,e),Pt(n,e)},"createToJSONSchemaMethod"),kr=o((e,t,r={})=>n=>{let{libraryOptions:u,target:i}=n??{},a=Rt({...u??{},target:i,io:t,processors:r});return ne(e,a),Tt(a,e),Pt(a,e)},"createStandardJSONSchemaMethod"),GD={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Hv=o((e,t,r,n)=>{let u=r;u.type="string";let{minimum:i,maximum:a,format:l,patterns:d,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(u.minLength=i),typeof a=="number"&&(u.maxLength=a),l&&(u.format=GD[l]??l,u.format===""&&delete u.format,l==="time"&&delete u.format),c&&(u.contentEncoding=c),d&&d.size>0){let p=[...d];p.length===1?u.pattern=p[0].source:p.length>1&&(u.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},"stringProcessor"),Xv=o((e,t,r,n)=>{let u=r,{minimum:i,maximum:a,format:l,multipleOf:d,exclusiveMaximum:c,exclusiveMinimum:p}=e._zod.bag;typeof l=="string"&&l.includes("int")?u.type="integer":u.type="number";let m=typeof p=="number"&&p>=(i??Number.NEGATIVE_INFINITY),f=typeof c=="number"&&c<=(a??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";m?h?(u.minimum=p,u.exclusiveMinimum=!0):u.exclusiveMinimum=p:typeof i=="number"&&(u.minimum=i),f?h?(u.maximum=c,u.exclusiveMaximum=!0):u.exclusiveMaximum=c:typeof a=="number"&&(u.maximum=a),typeof d=="number"&&(u.multipleOf=d)},"numberProcessor"),Yv=o((e,t,r,n)=>{r.type="boolean"},"booleanProcessor"),Qv=o((e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},"bigintProcessor"),e1=o((e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},"symbolProcessor"),t1=o((e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},"nullProcessor"),u1=o((e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},"undefinedProcessor"),r1=o((e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},"voidProcessor"),n1=o((e,t,r,n)=>{r.not={}},"neverProcessor"),i1=o((e,t,r,n)=>{},"anyProcessor"),s1=o((e,t,r,n)=>{},"unknownProcessor"),a1=o((e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},"dateProcessor"),o1=o((e,t,r,n)=>{let u=e._zod.def,i=zn(u.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},"enumProcessor"),l1=o((e,t,r,n)=>{let u=e._zod.def,i=[];for(let a of u.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){let a=i[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i},"literalProcessor"),d1=o((e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},"nanProcessor"),c1=o((e,t,r,n)=>{let u=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");u.type="string",u.pattern=i.source},"templateLiteralProcessor"),p1=o((e,t,r,n)=>{let u=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:l,mime:d}=e._zod.bag;a!==void 0&&(i.minLength=a),l!==void 0&&(i.maxLength=l),d?d.length===1?(i.contentMediaType=d[0],Object.assign(u,i)):(Object.assign(u,i),u.anyOf=d.map(c=>({contentMediaType:c}))):Object.assign(u,i)},"fileProcessor"),m1=o((e,t,r,n)=>{r.type="boolean"},"successProcessor"),f1=o((e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},"customProcessor"),h1=o((e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},"functionProcessor"),g1=o((e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},"transformProcessor"),v1=o((e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},"mapProcessor"),y1=o((e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},"setProcessor"),b1=o((e,t,r,n)=>{let u=r,i=e._zod.def,{minimum:a,maximum:l}=e._zod.bag;typeof a=="number"&&(u.minItems=a),typeof l=="number"&&(u.maxItems=l),u.type="array",u.items=ne(i.element,t,{...n,path:[...n.path,"items"]})},"arrayProcessor"),E1=o((e,t,r,n)=>{let u=r,i=e._zod.def;u.type="object",u.properties={};let a=i.shape;for(let c in a)u.properties[c]=ne(a[c],t,{...n,path:[...n.path,"properties",c]});let l=new Set(Object.keys(a)),d=new Set([...l].filter(c=>{let p=i.shape[c]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));d.size>0&&(u.required=Array.from(d)),i.catchall?._zod.def.type==="never"?u.additionalProperties=!1:i.catchall?i.catchall&&(u.additionalProperties=ne(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(u.additionalProperties=!1)},"objectProcessor"),b0=o((e,t,r,n)=>{let u=e._zod.def,i=u.inclusive===!1,a=u.options.map((l,d)=>ne(l,t,{...n,path:[...n.path,i?"oneOf":"anyOf",d]}));i?r.oneOf=a:r.anyOf=a},"unionProcessor"),w1=o((e,t,r,n)=>{let u=e._zod.def,i=ne(u.left,t,{...n,path:[...n.path,"allOf",0]}),a=ne(u.right,t,{...n,path:[...n.path,"allOf",1]}),l=o(c=>"allOf"in c&&Object.keys(c).length===1,"isSimpleIntersection"),d=[...l(i)?i.allOf:[i],...l(a)?a.allOf:[a]];r.allOf=d},"intersectionProcessor"),D1=o((e,t,r,n)=>{let u=r,i=e._zod.def;u.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",l=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",d=i.items.map((f,h)=>ne(f,t,{...n,path:[...n.path,a,h]})),c=i.rest?ne(i.rest,t,{...n,path:[...n.path,l,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(u.prefixItems=d,c&&(u.items=c)):t.target==="openapi-3.0"?(u.items={anyOf:d},c&&u.items.anyOf.push(c),u.minItems=d.length,c||(u.maxItems=d.length)):(u.items=d,c&&(u.additionalItems=c));let{minimum:p,maximum:m}=e._zod.bag;typeof p=="number"&&(u.minItems=p),typeof m=="number"&&(u.maxItems=m)},"tupleProcessor"),$1=o((e,t,r,n)=>{let u=r,i=e._zod.def;u.type="object";let a=i.keyType,l=a._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){let c=ne(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});u.patternProperties={};for(let p of l)u.patternProperties[p.source]=c}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(u.propertyNames=ne(i.keyType,t,{...n,path:[...n.path,"propertyNames"]})),u.additionalProperties=ne(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]});let d=a._zod.values;if(d){let c=[...d].filter(p=>typeof p=="string"||typeof p=="number");c.length>0&&(u.required=c)}},"recordProcessor"),B1=o((e,t,r,n)=>{let u=e._zod.def,i=ne(u.innerType,t,n),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=u.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},"nullableProcessor"),x1=o((e,t,r,n)=>{let u=e._zod.def;ne(u.innerType,t,n);let i=t.seen.get(e);i.ref=u.innerType},"nonoptionalProcessor"),k1=o((e,t,r,n)=>{let u=e._zod.def;ne(u.innerType,t,n);let i=t.seen.get(e);i.ref=u.innerType,r.default=JSON.parse(JSON.stringify(u.defaultValue))},"defaultProcessor"),C1=o((e,t,r,n)=>{let u=e._zod.def;ne(u.innerType,t,n);let i=t.seen.get(e);i.ref=u.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(u.defaultValue)))},"prefaultProcessor"),A1=o((e,t,r,n)=>{let u=e._zod.def;ne(u.innerType,t,n);let i=t.seen.get(e);i.ref=u.innerType;let a;try{a=u.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},"catchProcessor"),_1=o((e,t,r,n)=>{let u=e._zod.def,i=u.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?u.out:u.in:u.out;ne(a,t,n);let l=t.seen.get(e);l.ref=a},"pipeProcessor"),I1=o((e,t,r,n)=>{let u=e._zod.def;ne(u.innerType,t,n);let i=t.seen.get(e);i.ref=u.innerType,r.readOnly=!0},"readonlyProcessor"),S1=o((e,t,r,n)=>{let u=e._zod.def;ne(u.innerType,t,n);let i=t.seen.get(e);i.ref=u.innerType},"promiseProcessor"),E0=o((e,t,r,n)=>{let u=e._zod.def;ne(u.innerType,t,n);let i=t.seen.get(e);i.ref=u.innerType},"optionalProcessor"),F1=o((e,t,r,n)=>{let u=e._zod.innerType;ne(u,t,n);let i=t.seen.get(e);i.ref=u},"lazyProcessor"),w0={string:Hv,number:Xv,boolean:Yv,bigint:Qv,symbol:e1,null:t1,undefined:u1,void:r1,never:n1,any:i1,unknown:s1,date:a1,enum:o1,literal:l1,nan:d1,template_literal:c1,file:p1,success:m1,custom:f1,function:h1,transform:g1,map:v1,set:y1,array:b1,object:E1,union:b0,intersection:w1,tuple:D1,record:$1,nullable:B1,nonoptional:x1,default:k1,prefault:C1,catch:A1,pipe:_1,readonly:I1,promise:S1,optional:E0,lazy:F1};function D0(e,t){if("_idmap"in e){let n=e,u=Rt({...t,processors:w0}),i={};for(let d of n._idmap.entries()){let[c,p]=d;ne(p,u)}let a={},l={registry:n,uri:t?.uri,defs:i};u.external=l;for(let d of n._idmap.entries()){let[c,p]=d;Tt(u,p),a[c]=Pt(u,p)}if(Object.keys(i).length>0){let d=u.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[d]:i}}return{schemas:a}}let r=Rt({...t,processors:w0});return ne(e,r),Tt(r,e),Pt(r,e)}s(D0,"ms"),o(D0,"toJSONSchema");var KD=class{static{s(this,"hs")}static{o(this,"JSONSchemaGenerator")}get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),this.ctx=Rt({processors:w0,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return ne(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),Tt(this.ctx,e);let r=Pt(this.ctx,e),{"~standard":n,...u}=r;return u}},HD={},j1={};ut(j1,{ZodAny:s(()=>bl,"ZodAny"),ZodArray:s(()=>kl,"ZodArray"),ZodBase64:s(()=>Ci,"ZodBase64"),ZodBase64URL:s(()=>Ai,"ZodBase64URL"),ZodBigInt:s(()=>jr,"ZodBigInt"),ZodBigIntFormat:s(()=>ji,"ZodBigIntFormat"),ZodBoolean:s(()=>Fr,"ZodBoolean"),ZodCIDRv4:s(()=>xi,"ZodCIDRv4"),ZodCIDRv6:s(()=>ki,"ZodCIDRv6"),ZodCUID:s(()=>yi,"ZodCUID"),ZodCUID2:s(()=>bi,"ZodCUID2"),ZodCatch:s(()=>ud,"ZodCatch"),ZodCodec:s(()=>qr,"ZodCodec"),ZodCustom:s(()=>Lr,"ZodCustom"),ZodCustomStringFormat:s(()=>vu,"ZodCustomStringFormat"),ZodDate:s(()=>Ni,"ZodDate"),ZodDefault:s(()=>Yl,"ZodDefault"),ZodDiscriminatedUnion:s(()=>jl,"ZodDiscriminatedUnion"),ZodE164:s(()=>_i,"ZodE164"),ZodEmail:s(()=>hi,"ZodEmail"),ZodEmoji:s(()=>gi,"ZodEmoji"),ZodEnum:s(()=>Eu,"ZodEnum"),ZodExactOptional:s(()=>Kl,"ZodExactOptional"),ZodFile:s(()=>Vl,"ZodFile"),ZodFunction:s(()=>fd,"ZodFunction"),ZodGUID:s(()=>Ar,"ZodGUID"),ZodIPv4:s(()=>$i,"ZodIPv4"),ZodIPv6:s(()=>Bi,"ZodIPv6"),ZodIntersection:s(()=>Nl,"ZodIntersection"),ZodJWT:s(()=>Ii,"ZodJWT"),ZodKSUID:s(()=>Di,"ZodKSUID"),ZodLazy:s(()=>cd,"ZodLazy"),ZodLiteral:s(()=>Ll,"ZodLiteral"),ZodMAC:s(()=>G0,"ZodMAC"),ZodMap:s(()=>Tl,"ZodMap"),ZodNaN:s(()=>rd,"ZodNaN"),ZodNanoID:s(()=>vi,"ZodNanoID"),ZodNever:s(()=>Dl,"ZodNever"),ZodNonOptional:s(()=>Zi,"ZodNonOptional"),ZodNull:s(()=>yl,"ZodNull"),ZodNullable:s(()=>Hl,"ZodNullable"),ZodNumber:s(()=>Ir,"ZodNumber"),ZodNumberFormat:s(()=>Ut,"ZodNumberFormat"),ZodObject:s(()=>Nr,"ZodObject"),ZodOptional:s(()=>Ti,"ZodOptional"),ZodPipe:s(()=>Pr,"ZodPipe"),ZodPrefault:s(()=>Ql,"ZodPrefault"),ZodPreprocess:s(()=>ad,"ZodPreprocess"),ZodPromise:s(()=>pd,"ZodPromise"),ZodReadonly:s(()=>od,"ZodReadonly"),ZodRecord:s(()=>bu,"ZodRecord"),ZodSet:s(()=>Ul,"ZodSet"),ZodString:s(()=>Cr,"ZodString"),ZodStringFormat:s(()=>ae,"ZodStringFormat"),ZodSuccess:s(()=>ed,"ZodSuccess"),ZodSymbol:s(()=>fl,"ZodSymbol"),ZodTemplateLiteral:s(()=>ld,"ZodTemplateLiteral"),ZodTransform:s(()=>Gl,"ZodTransform"),ZodTuple:s(()=>Ml,"ZodTuple"),ZodType:s(()=>Q,"ZodType"),ZodULID:s(()=>Ei,"ZodULID"),ZodURL:s(()=>_r,"ZodURL"),ZodUUID:s(()=>He,"ZodUUID"),ZodUndefined:s(()=>gl,"ZodUndefined"),ZodUnion:s(()=>Mr,"ZodUnion"),ZodUnknown:s(()=>wl,"ZodUnknown"),ZodVoid:s(()=>$l,"ZodVoid"),ZodXID:s(()=>wi,"ZodXID"),ZodXor:s(()=>Sl,"ZodXor"),_ZodString:s(()=>fi,"_ZodString"),_default:s(()=>Ui,"_default"),_function:s(()=>Zr,"_function"),any:s(()=>El,"any"),array:s(()=>yu,"array"),base64:s(()=>Q0,"base64"),base64url:s(()=>el,"base64url"),bigint:s(()=>cl,"bigint"),boolean:s(()=>Fi,"boolean"),catch:s(()=>Ji,"catch"),check:s(()=>hd,"check"),cidrv4:s(()=>X0,"cidrv4"),cidrv6:s(()=>Y0,"cidrv6"),codec:s(()=>id,"codec"),cuid:s(()=>q0,"cuid"),cuid2:s(()=>Z0,"cuid2"),custom:s(()=>gd,"custom"),date:s(()=>xl,"date"),describe:s(()=>K1,"describe"),discriminatedUnion:s(()=>zl,"discriminatedUnion"),e164:s(()=>tl,"e164"),email:s(()=>F0,"email"),emoji:s(()=>P0,"emoji"),enum:s(()=>Rr,"enum"),exactOptional:s(()=>Pi,"exactOptional"),file:s(()=>Wl,"file"),float32:s(()=>al,"float32"),float64:s(()=>ol,"float64"),function:s(()=>Zr,"function"),guid:s(()=>j0,"guid"),hash:s(()=>sl,"hash"),hex:s(()=>il,"hex"),hostname:s(()=>nl,"hostname"),httpUrl:s(()=>T0,"httpUrl"),instanceof:s(()=>vd,"instanceof"),int:s(()=>Sr,"int"),int32:s(()=>ll,"int32"),int64:s(()=>pl,"int64"),intersection:s(()=>Mi,"intersection"),invertCodec:s(()=>sd,"invertCodec"),ipv4:s(()=>W0,"ipv4"),ipv6:s(()=>H0,"ipv6"),json:s(()=>yd,"json"),jwt:s(()=>ul,"jwt"),keyof:s(()=>Cl,"keyof"),ksuid:s(()=>V0,"ksuid"),lazy:s(()=>Wi,"lazy"),literal:s(()=>Jl,"literal"),looseObject:s(()=>Il,"looseObject"),looseRecord:s(()=>Rl,"looseRecord"),mac:s(()=>K0,"mac"),map:s(()=>Pl,"map"),meta:s(()=>H1,"meta"),nan:s(()=>nd,"nan"),nanoid:s(()=>U0,"nanoid"),nativeEnum:s(()=>Zl,"nativeEnum"),never:s(()=>zr,"never"),nonoptional:s(()=>Li,"nonoptional"),null:s(()=>zi,"null"),nullable:s(()=>Du,"nullable"),nullish:s(()=>Xl,"nullish"),number:s(()=>Si,"number"),object:s(()=>Al,"object"),optional:s(()=>wu,"optional"),partialRecord:s(()=>Ol,"partialRecord"),pipe:s(()=>Ur,"pipe"),prefault:s(()=>qi,"prefault"),preprocess:s(()=>bd,"preprocess"),promise:s(()=>md,"promise"),readonly:s(()=>Vi,"readonly"),record:s(()=>Ri,"record"),refine:s(()=>Gi,"refine"),set:s(()=>ql,"set"),strictObject:s(()=>_l,"strictObject"),string:s(()=>gu,"string"),stringFormat:s(()=>rl,"stringFormat"),stringbool:s(()=>X1,"stringbool"),success:s(()=>td,"success"),superRefine:s(()=>Ki,"superRefine"),symbol:s(()=>hl,"symbol"),templateLiteral:s(()=>dd,"templateLiteral"),transform:s(()=>Tr,"transform"),tuple:s(()=>Oi,"tuple"),uint32:s(()=>dl,"uint32"),uint64:s(()=>ml,"uint64"),ulid:s(()=>L0,"ulid"),undefined:s(()=>vl,"undefined"),union:s(()=>Or,"union"),unknown:s(()=>gt,"unknown"),url:s(()=>R0,"url"),uuid:s(()=>z0,"uuid"),uuidv4:s(()=>N0,"uuidv4"),uuidv6:s(()=>M0,"uuidv6"),uuidv7:s(()=>O0,"uuidv7"),void:s(()=>Bl,"void"),xid:s(()=>J0,"xid"),xor:s(()=>Fl,"xor")});var z1={};ut(z1,{endsWith:s(()=>br,"endsWith"),gt:s(()=>it,"gt"),gte:s(()=>ke,"gte"),includes:s(()=>vr,"includes"),length:s(()=>mu,"length"),lowercase:s(()=>hr,"lowercase"),lt:s(()=>nt,"lt"),lte:s(()=>ze,"lte"),maxLength:s(()=>pu,"maxLength"),maxSize:s(()=>Ot,"maxSize"),mime:s(()=>Er,"mime"),minLength:s(()=>ht,"minLength"),minSize:s(()=>st,"minSize"),multipleOf:s(()=>Mt,"multipleOf"),negative:s(()=>di,"negative"),nonnegative:s(()=>pi,"nonnegative"),nonpositive:s(()=>ci,"nonpositive"),normalize:s(()=>wr,"normalize"),overwrite:s(()=>Ke,"overwrite"),positive:s(()=>li,"positive"),property:s(()=>mi,"property"),regex:s(()=>fr,"regex"),size:s(()=>cu,"size"),slugify:s(()=>xr,"slugify"),startsWith:s(()=>yr,"startsWith"),toLowerCase:s(()=>$r,"toLowerCase"),toUpperCase:s(()=>Br,"toUpperCase"),trim:s(()=>Dr,"trim"),uppercase:s(()=>gr,"uppercase")});var $0={};ut($0,{ZodISODate:s(()=>k0,"ZodISODate"),ZodISODateTime:s(()=>B0,"ZodISODateTime"),ZodISODuration:s(()=>I0,"ZodISODuration"),ZodISOTime:s(()=>A0,"ZodISOTime"),date:s(()=>C0,"date"),datetime:s(()=>x0,"datetime"),duration:s(()=>S0,"duration"),time:s(()=>_0,"time")});var B0=B("ZodISODateTime",(e,t)=>{Ah.init(e,t),ae.init(e,t)});function x0(e){return Oo(B0,e)}s(x0,"gf"),o(x0,"datetime");var k0=B("ZodISODate",(e,t)=>{_h.init(e,t),ae.init(e,t)});function C0(e){return Ro(k0,e)}s(C0,"vf"),o(C0,"date");var A0=B("ZodISOTime",(e,t)=>{Ih.init(e,t),ae.init(e,t)});function _0(e){return To(A0,e)}s(_0,"yf"),o(_0,"time");var I0=B("ZodISODuration",(e,t)=>{Sh.init(e,t),ae.init(e,t)});function S0(e){return Po(I0,e)}s(S0,"bf"),o(S0,"duration");var N1=o((e,t)=>{Sa.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o(r=>Rn(e,r),"value")},flatten:{value:o(r=>On(e,r),"value")},addIssue:{value:o(r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Hu,2)},"value")},addIssues:{value:o(r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Hu,2)},"value")},isEmpty:{get(){return e.issues.length===0}}})},"initializer"),XD=B("ZodError",N1),Ne=B("ZodError",N1,{Parent:Error}),M1=tr(Ne),O1=ur(Ne),R1=rr(Ne),T1=nr(Ne),P1=Oa(Ne),U1=Ra(Ne),q1=Ta(Ne),Z1=Pa(Ne),L1=Ua(Ne),J1=qa(Ne),V1=Za(Ne),W1=La(Ne),G1=new WeakMap;function hu(e,t,r){let n=Object.getPrototypeOf(e),u=G1.get(n);if(u||(u=new Set,G1.set(n,u)),!u.has(t)){u.add(t);for(let i in r){let a=r[i];Object.defineProperty(n,i,{configurable:!0,enumerable:!1,get(){let l=a.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:l}),l},set(l){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:l})}})}}}s(hu,"oo"),o(hu,"_installLazyMethods");var Q=B("ZodType",(e,t)=>(X.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:kr(e,"input"),output:kr(e,"output")}}),e.toJSONSchema=Kv(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,n)=>M1(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>R1(e,r,n),e.parseAsync=async(r,n)=>O1(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>T1(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>P1(e,r,n),e.decode=(r,n)=>U1(e,r,n),e.encodeAsync=async(r,n)=>q1(e,r,n),e.decodeAsync=async(r,n)=>Z1(e,r,n),e.safeEncode=(r,n)=>L1(e,r,n),e.safeDecode=(r,n)=>J1(e,r,n),e.safeEncodeAsync=async(r,n)=>V1(e,r,n),e.safeDecodeAsync=async(r,n)=>W1(e,r,n),hu(e,"ZodType",{check(...r){let n=this.def;return this.clone(te.mergeDefs(n,{checks:[...n.checks??[],...r.map(u=>typeof u=="function"?{_zod:{check:u,def:{check:"custom"},onattach:[]}}:u)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return Se(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(Gi(r,n))},superRefine(r,n){return this.check(Ki(r,n))},overwrite(r){return this.check(Ke(r))},optional(){return wu(this)},exactOptional(){return Pi(this)},nullable(){return Du(this)},nullish(){return wu(Du(this))},nonoptional(r){return Li(this,r)},array(){return yu(this)},or(r){return Or([this,r])},and(r){return Mi(this,r)},transform(r){return Ur(this,Tr(r))},default(r){return Ui(this,r)},prefault(r){return qi(this,r)},catch(r){return Ji(this,r)},pipe(r){return Ur(this,r)},readonly(){return Vi(this)},describe(r){let n=this.clone();return Re.add(n,{description:r}),n},meta(...r){if(r.length===0)return Re.get(this);let n=this.clone();return Re.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Re.get(e)?.description},configurable:!0}),e)),fi=B("_ZodString",(e,t)=>{sr.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(n,u,i)=>Hv(e,n,u,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,hu(e,"_ZodString",{regex(...n){return this.check(fr(...n))},includes(...n){return this.check(vr(...n))},startsWith(...n){return this.check(yr(...n))},endsWith(...n){return this.check(br(...n))},min(...n){return this.check(ht(...n))},max(...n){return this.check(pu(...n))},length(...n){return this.check(mu(...n))},nonempty(...n){return this.check(ht(1,...n))},lowercase(n){return this.check(hr(n))},uppercase(n){return this.check(gr(n))},trim(){return this.check(Dr())},normalize(...n){return this.check(wr(...n))},toLowerCase(){return this.check($r())},toUpperCase(){return this.check(Br())},slugify(){return this.check(xr())}})}),Cr=B("ZodString",(e,t)=>{sr.init(e,t),fi.init(e,t),e.email=r=>e.check(Zn(hi,r)),e.url=r=>e.check(mr(_r,r)),e.jwt=r=>e.check(oi(Ii,r)),e.emoji=r=>e.check(Gn(gi,r)),e.guid=r=>e.check(pr(Ar,r)),e.uuid=r=>e.check(Ln(He,r)),e.uuidv4=r=>e.check(Jn(He,r)),e.uuidv6=r=>e.check(Vn(He,r)),e.uuidv7=r=>e.check(Wn(He,r)),e.nanoid=r=>e.check(Kn(vi,r)),e.guid=r=>e.check(pr(Ar,r)),e.cuid=r=>e.check(Hn(yi,r)),e.cuid2=r=>e.check(Xn(bi,r)),e.ulid=r=>e.check(Yn(Ei,r)),e.base64=r=>e.check(ii(Ci,r)),e.base64url=r=>e.check(si(Ai,r)),e.xid=r=>e.check(Qn(wi,r)),e.ksuid=r=>e.check(ei(Di,r)),e.ipv4=r=>e.check(ti($i,r)),e.ipv6=r=>e.check(ui(Bi,r)),e.cidrv4=r=>e.check(ri(xi,r)),e.cidrv6=r=>e.check(ni(ki,r)),e.e164=r=>e.check(ai(_i,r)),e.datetime=r=>e.check(x0(r)),e.date=r=>e.check(C0(r)),e.time=r=>e.check(_0(r)),e.duration=r=>e.check(S0(r))});function gu(e){return zo(Cr,e)}s(gu,"eo"),o(gu,"string");var ae=B("ZodStringFormat",(e,t)=>{se.init(e,t),fi.init(e,t)}),hi=B("ZodEmail",(e,t)=>{bh.init(e,t),ae.init(e,t)});function F0(e){return Zn(hi,e)}s(F0,"fx"),o(F0,"email");var Ar=B("ZodGUID",(e,t)=>{vh.init(e,t),ae.init(e,t)});function j0(e){return pr(Ar,e)}s(j0,"mx"),o(j0,"guid");var He=B("ZodUUID",(e,t)=>{yh.init(e,t),ae.init(e,t)});function z0(e){return Ln(He,e)}s(z0,"hx"),o(z0,"uuid");function N0(e){return Jn(He,e)}s(N0,"gx"),o(N0,"uuidv4");function M0(e){return Vn(He,e)}s(M0,"vx"),o(M0,"uuidv6");function O0(e){return Wn(He,e)}s(O0,"yx"),o(O0,"uuidv7");var _r=B("ZodURL",(e,t)=>{Eh.init(e,t),ae.init(e,t)});function R0(e){return mr(_r,e)}s(R0,"bx"),o(R0,"url");function T0(e){return mr(_r,{protocol:ft.httpProtocol,hostname:ft.domain,...te.normalizeParams(e)})}s(T0,"wx"),o(T0,"httpUrl");var gi=B("ZodEmoji",(e,t)=>{wh.init(e,t),ae.init(e,t)});function P0(e){return Gn(gi,e)}s(P0,"xx"),o(P0,"emoji");var vi=B("ZodNanoID",(e,t)=>{Dh.init(e,t),ae.init(e,t)});function U0(e){return Kn(vi,e)}s(U0,"$x"),o(U0,"nanoid");var yi=B("ZodCUID",(e,t)=>{$h.init(e,t),ae.init(e,t)});function q0(e){return Hn(yi,e)}s(q0,"_x"),o(q0,"cuid");var bi=B("ZodCUID2",(e,t)=>{Bh.init(e,t),ae.init(e,t)});function Z0(e){return Xn(bi,e)}s(Z0,"kx"),o(Z0,"cuid2");var Ei=B("ZodULID",(e,t)=>{xh.init(e,t),ae.init(e,t)});function L0(e){return Yn(Ei,e)}s(L0,"Sx"),o(L0,"ulid");var wi=B("ZodXID",(e,t)=>{kh.init(e,t),ae.init(e,t)});function J0(e){return Qn(wi,e)}s(J0,"Ix"),o(J0,"xid");var Di=B("ZodKSUID",(e,t)=>{Ch.init(e,t),ae.init(e,t)});function V0(e){return ei(Di,e)}s(V0,"Rx"),o(V0,"ksuid");var $i=B("ZodIPv4",(e,t)=>{Fh.init(e,t),ae.init(e,t)});function W0(e){return ti($i,e)}s(W0,"Ex"),o(W0,"ipv4");var G0=B("ZodMAC",(e,t)=>{zh.init(e,t),ae.init(e,t)});function K0(e){return Mo(G0,e)}s(K0,"Tx"),o(K0,"mac");var Bi=B("ZodIPv6",(e,t)=>{jh.init(e,t),ae.init(e,t)});function H0(e){return ui(Bi,e)}s(H0,"Ax"),o(H0,"ipv6");var xi=B("ZodCIDRv4",(e,t)=>{Nh.init(e,t),ae.init(e,t)});function X0(e){return ri(xi,e)}s(X0,"jx"),o(X0,"cidrv4");var ki=B("ZodCIDRv6",(e,t)=>{Mh.init(e,t),ae.init(e,t)});function Y0(e){return ni(ki,e)}s(Y0,"Ox"),o(Y0,"cidrv6");var Ci=B("ZodBase64",(e,t)=>{Oh.init(e,t),ae.init(e,t)});function Q0(e){return ii(Ci,e)}s(Q0,"zx"),o(Q0,"base64");var Ai=B("ZodBase64URL",(e,t)=>{Rh.init(e,t),ae.init(e,t)});function el(e){return si(Ai,e)}s(el,"Mx"),o(el,"base64url");var _i=B("ZodE164",(e,t)=>{Th.init(e,t),ae.init(e,t)});function tl(e){return ai(_i,e)}s(tl,"Nx"),o(tl,"e164");var Ii=B("ZodJWT",(e,t)=>{Ph.init(e,t),ae.init(e,t)});function ul(e){return oi(Ii,e)}s(ul,"Px"),o(ul,"jwt");var vu=B("ZodCustomStringFormat",(e,t)=>{Uh.init(e,t),ae.init(e,t)});function rl(e,t,r={}){return fu(vu,e,t,r)}s(rl,"Dx"),o(rl,"stringFormat");function nl(e){return fu(vu,"hostname",ft.hostname,e)}s(nl,"Cx"),o(nl,"hostname");function il(e){return fu(vu,"hex",ft.hex,e)}s(il,"Ux"),o(il,"hex");function sl(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,u=ft[n];if(!u)throw new Error(`Unrecognized hash format: ${n}`);return fu(vu,n,u,t)}s(sl,"Lx"),o(sl,"hash");var Ir=B("ZodNumber",(e,t)=>{uo.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(n,u,i)=>Xv(e,n,u,i),hu(e,"ZodNumber",{gt(n,u){return this.check(it(n,u))},gte(n,u){return this.check(ke(n,u))},min(n,u){return this.check(ke(n,u))},lt(n,u){return this.check(nt(n,u))},lte(n,u){return this.check(ze(n,u))},max(n,u){return this.check(ze(n,u))},int(n){return this.check(Sr(n))},safe(n){return this.check(Sr(n))},positive(n){return this.check(it(0,n))},nonnegative(n){return this.check(ke(0,n))},negative(n){return this.check(nt(0,n))},nonpositive(n){return this.check(ze(0,n))},multipleOf(n,u){return this.check(Mt(n,u))},step(n,u){return this.check(Mt(n,u))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function Si(e){return Uo(Ir,e)}s(Si,"zf"),o(Si,"number");var Ut=B("ZodNumberFormat",(e,t)=>{qh.init(e,t),Ir.init(e,t)});function Sr(e){return Zo(Ut,e)}s(Sr,"xs"),o(Sr,"int");function al(e){return Lo(Ut,e)}s(al,"Fx"),o(al,"float32");function ol(e){return Jo(Ut,e)}s(ol,"Bx"),o(ol,"float64");function ll(e){return Vo(Ut,e)}s(ll,"qx"),o(ll,"int32");function dl(e){return Wo(Ut,e)}s(dl,"Zx"),o(dl,"uint32");var Fr=B("ZodBoolean",(e,t)=>{ro.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>Yv(e,r,n,u)});function Fi(e){return Go(Fr,e)}s(Fi,"Mf"),o(Fi,"boolean");var jr=B("ZodBigInt",(e,t)=>{no.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(n,u,i)=>Qv(e,n,u,i),e.gte=(n,u)=>e.check(ke(n,u)),e.min=(n,u)=>e.check(ke(n,u)),e.gt=(n,u)=>e.check(it(n,u)),e.gte=(n,u)=>e.check(ke(n,u)),e.min=(n,u)=>e.check(ke(n,u)),e.lt=(n,u)=>e.check(nt(n,u)),e.lte=(n,u)=>e.check(ze(n,u)),e.max=(n,u)=>e.check(ze(n,u)),e.positive=n=>e.check(it(BigInt(0),n)),e.negative=n=>e.check(nt(BigInt(0),n)),e.nonpositive=n=>e.check(ze(BigInt(0),n)),e.nonnegative=n=>e.check(ke(BigInt(0),n)),e.multipleOf=(n,u)=>e.check(Mt(n,u));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function cl(e){return Ho(jr,e)}s(cl,"Vx"),o(cl,"bigint");var ji=B("ZodBigIntFormat",(e,t)=>{Zh.init(e,t),jr.init(e,t)});function pl(e){return Yo(ji,e)}s(pl,"Gx"),o(pl,"int64");function ml(e){return Qo(ji,e)}s(ml,"Wx"),o(ml,"uint64");var fl=B("ZodSymbol",(e,t)=>{Lh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>e1(e,r,n,u)});function hl(e){return e0(fl,e)}s(hl,"Jx"),o(hl,"symbol");var gl=B("ZodUndefined",(e,t)=>{Jh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>u1(e,r,n,u)});function vl(e){return t0(gl,e)}s(vl,"Kx"),o(vl,"_undefined");var yl=B("ZodNull",(e,t)=>{Vh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>t1(e,r,n,u)});function zi(e){return u0(yl,e)}s(zi,"Cf"),o(zi,"_null");var bl=B("ZodAny",(e,t)=>{Wh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>i1(e,r,n,u)});function El(){return r0(bl)}s(El,"Hx"),o(El,"any");var wl=B("ZodUnknown",(e,t)=>{Gh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>s1(e,r,n,u)});function gt(){return n0(wl)}s(gt,"sr"),o(gt,"unknown");var Dl=B("ZodNever",(e,t)=>{Kh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>n1(e,r,n,u)});function zr(e){return i0(Dl,e)}s(zr,"Fs"),o(zr,"never");var $l=B("ZodVoid",(e,t)=>{Hh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>r1(e,r,n,u)});function Bl(e){return s0($l,e)}s(Bl,"Xx"),o(Bl,"_void");var Ni=B("ZodDate",(e,t)=>{Xh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(n,u,i)=>a1(e,n,u,i),e.min=(n,u)=>e.check(ke(n,u)),e.max=(n,u)=>e.check(ze(n,u));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function xl(e){return a0(Ni,e)}s(xl,"Yx"),o(xl,"date");var kl=B("ZodArray",(e,t)=>{Yh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>b1(e,r,n,u),e.element=t.element,hu(e,"ZodArray",{min(r,n){return this.check(ht(r,n))},nonempty(r){return this.check(ht(1,r))},max(r,n){return this.check(pu(r,n))},length(r,n){return this.check(mu(r,n))},unwrap(){return this.element}})});function yu(e,t){return d0(kl,e,t)}s(yu,"ao"),o(yu,"array");function Cl(e){let t=e._zod.def.shape;return Rr(Object.keys(t))}s(Cl,"Qx"),o(Cl,"keyof");var Nr=B("ZodObject",(e,t)=>{eg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>E1(e,r,n,u),te.defineLazy(e,"shape",()=>t.shape),hu(e,"ZodObject",{keyof(){return Rr(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:gt()})},loose(){return this.clone({...this._zod.def,catchall:gt()})},strict(){return this.clone({...this._zod.def,catchall:zr()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return te.extend(this,r)},safeExtend(r){return te.safeExtend(this,r)},merge(r){return te.merge(this,r)},pick(r){return te.pick(this,r)},omit(r){return te.omit(this,r)},partial(...r){return te.partial(Ti,this,r[0])},required(...r){return te.required(Zi,this,r[0])}})});function Al(e,t){let r={type:"object",shape:e??{},...te.normalizeParams(t)};return new Nr(r)}s(Al,"e$"),o(Al,"object");function _l(e,t){return new Nr({type:"object",shape:e,catchall:zr(),...te.normalizeParams(t)})}s(_l,"t$"),o(_l,"strictObject");function Il(e,t){return new Nr({type:"object",shape:e,catchall:gt(),...te.normalizeParams(t)})}s(Il,"r$"),o(Il,"looseObject");var Mr=B("ZodUnion",(e,t)=>{Pn.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>b0(e,r,n,u),e.options=t.options});function Or(e,t){return new Mr({type:"union",options:e,...te.normalizeParams(t)})}s(Or,"Bs"),o(Or,"union");var Sl=B("ZodXor",(e,t)=>{Mr.init(e,t),tg.init(e,t),e._zod.processJSONSchema=(r,n,u)=>b0(e,r,n,u),e.options=t.options});function Fl(e,t){return new Sl({type:"union",options:e,inclusive:!1,...te.normalizeParams(t)})}s(Fl,"n$"),o(Fl,"xor");var jl=B("ZodDiscriminatedUnion",(e,t)=>{Mr.init(e,t),ug.init(e,t)});function zl(e,t,r){return new jl({type:"union",options:t,discriminator:e,...te.normalizeParams(r)})}s(zl,"o$"),o(zl,"discriminatedUnion");var Nl=B("ZodIntersection",(e,t)=>{rg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>w1(e,r,n,u)});function Mi(e,t){return new Nl({type:"intersection",left:e,right:t})}s(Mi,"Wf"),o(Mi,"intersection");var Ml=B("ZodTuple",(e,t)=>{po.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>D1(e,r,n,u),e.rest=r=>e.clone({...e._zod.def,rest:r})});function Oi(e,t,r){let n=t instanceof X,u=n?r:t,i=n?t:null;return new Ml({type:"tuple",items:e,rest:i,...te.normalizeParams(u)})}s(Oi,"Kf"),o(Oi,"tuple");var bu=B("ZodRecord",(e,t)=>{ng.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>$1(e,r,n,u),e.keyType=t.keyType,e.valueType=t.valueType});function Ri(e,t,r){return!t||!t._zod?new bu({type:"record",keyType:gu(),valueType:e,...te.normalizeParams(t)}):new bu({type:"record",keyType:e,valueType:t,...te.normalizeParams(r)})}s(Ri,"Hf"),o(Ri,"record");function Ol(e,t,r){let n=Se(e);return n._zod.values=void 0,new bu({type:"record",keyType:n,valueType:t,...te.normalizeParams(r)})}s(Ol,"i$"),o(Ol,"partialRecord");function Rl(e,t,r){return new bu({type:"record",keyType:e,valueType:t,mode:"loose",...te.normalizeParams(r)})}s(Rl,"s$"),o(Rl,"looseRecord");var Tl=B("ZodMap",(e,t)=>{ig.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>v1(e,r,n,u),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(st(...r)),e.nonempty=r=>e.check(st(1,r)),e.max=(...r)=>e.check(Ot(...r)),e.size=(...r)=>e.check(cu(...r))});function Pl(e,t,r){return new Tl({type:"map",keyType:e,valueType:t,...te.normalizeParams(r)})}s(Pl,"a$"),o(Pl,"map");var Ul=B("ZodSet",(e,t)=>{sg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>y1(e,r,n,u),e.min=(...r)=>e.check(st(...r)),e.nonempty=r=>e.check(st(1,r)),e.max=(...r)=>e.check(Ot(...r)),e.size=(...r)=>e.check(cu(...r))});function ql(e,t){return new Ul({type:"set",valueType:e,...te.normalizeParams(t)})}s(ql,"c$"),o(ql,"set");var Eu=B("ZodEnum",(e,t)=>{ag.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(n,u,i)=>o1(e,n,u,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,u)=>{let i={};for(let a of n)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Eu({...t,checks:[],...te.normalizeParams(u),entries:i})},e.exclude=(n,u)=>{let i={...t.entries};for(let a of n)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new Eu({...t,checks:[],...te.normalizeParams(u),entries:i})}});function Rr(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Eu({type:"enum",entries:r,...te.normalizeParams(t)})}s(Rr,"qs"),o(Rr,"_enum");function Zl(e,t){return new Eu({type:"enum",entries:e,...te.normalizeParams(t)})}s(Zl,"u$"),o(Zl,"nativeEnum");var Ll=B("ZodLiteral",(e,t)=>{og.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>l1(e,r,n,u),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Jl(e,t){return new Ll({type:"literal",values:Array.isArray(e)?e:[e],...te.normalizeParams(t)})}s(Jl,"l$"),o(Jl,"literal");var Vl=B("ZodFile",(e,t)=>{lg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>p1(e,r,n,u),e.min=(r,n)=>e.check(st(r,n)),e.max=(r,n)=>e.check(Ot(r,n)),e.mime=(r,n)=>e.check(Er(Array.isArray(r)?r:[r],n))});function Wl(e){return c0(Vl,e)}s(Wl,"d$"),o(Wl,"file");var Gl=B("ZodTransform",(e,t)=>{dg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>g1(e,r,n,u),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new jn(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(te.issue(i,r.value,t));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(te.issue(a))}};let u=t.transform(r.value,r);return u instanceof Promise?u.then(i=>(r.value=i,r.fallback=!0,r)):(r.value=u,r.fallback=!0,r)}});function Tr(e){return new Gl({type:"transform",transform:e})}s(Tr,"Zs"),o(Tr,"transform");var Ti=B("ZodOptional",(e,t)=>{bo.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>E0(e,r,n,u),e.unwrap=()=>e._zod.def.innerType});function wu(e){return new Ti({type:"optional",innerType:e})}s(wu,"ro"),o(wu,"optional");var Kl=B("ZodExactOptional",(e,t)=>{cg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>E0(e,r,n,u),e.unwrap=()=>e._zod.def.innerType});function Pi(e){return new Kl({type:"optional",innerType:e})}s(Pi,"nm"),o(Pi,"exactOptional");var Hl=B("ZodNullable",(e,t)=>{pg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>B1(e,r,n,u),e.unwrap=()=>e._zod.def.innerType});function Du(e){return new Hl({type:"nullable",innerType:e})}s(Du,"no"),o(Du,"nullable");function Xl(e){return wu(Du(e))}s(Xl,"p$"),o(Xl,"nullish");var Yl=B("ZodDefault",(e,t)=>{mg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>k1(e,r,n,u),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ui(e,t){return new Yl({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():te.shallowClone(t)}})}s(Ui,"sm"),o(Ui,"_default");var Ql=B("ZodPrefault",(e,t)=>{fg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>C1(e,r,n,u),e.unwrap=()=>e._zod.def.innerType});function qi(e,t){return new Ql({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():te.shallowClone(t)}})}s(qi,"cm"),o(qi,"prefault");var Zi=B("ZodNonOptional",(e,t)=>{hg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>x1(e,r,n,u),e.unwrap=()=>e._zod.def.innerType});function Li(e,t){return new Zi({type:"nonoptional",innerType:e,...te.normalizeParams(t)})}s(Li,"um"),o(Li,"nonoptional");var ed=B("ZodSuccess",(e,t)=>{gg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>m1(e,r,n,u),e.unwrap=()=>e._zod.def.innerType});function td(e){return new ed({type:"success",innerType:e})}s(td,"f$"),o(td,"success");var ud=B("ZodCatch",(e,t)=>{vg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>A1(e,r,n,u),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ji(e,t){return new ud({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}s(Ji,"pm"),o(Ji,"_catch");var rd=B("ZodNaN",(e,t)=>{yg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>d1(e,r,n,u)});function nd(e){return l0(rd,e)}s(nd,"m$"),o(nd,"nan");var Pr=B("ZodPipe",(e,t)=>{Do.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>_1(e,r,n,u),e.in=t.in,e.out=t.out});function Ur(e,t){return new Pr({type:"pipe",in:e,out:t})}s(Ur,"$s"),o(Ur,"pipe");var qr=B("ZodCodec",(e,t)=>{Pr.init(e,t),$o.init(e,t)});function id(e,t,r){return new qr({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}s(id,"h$"),o(id,"codec");function sd(e){let t=e._zod.def;return new qr({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}s(sd,"g$"),o(sd,"invertCodec");var ad=B("ZodPreprocess",(e,t)=>{Pr.init(e,t),bg.init(e,t)}),od=B("ZodReadonly",(e,t)=>{Eg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>I1(e,r,n,u),e.unwrap=()=>e._zod.def.innerType});function Vi(e){return new od({type:"readonly",innerType:e})}s(Vi,"gm"),o(Vi,"readonly");var ld=B("ZodTemplateLiteral",(e,t)=>{wg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>c1(e,r,n,u)});function dd(e,t){return new ld({type:"template_literal",parts:e,...te.normalizeParams(t)})}s(dd,"v$"),o(dd,"templateLiteral");var cd=B("ZodLazy",(e,t)=>{Bg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>F1(e,r,n,u),e.unwrap=()=>e._zod.def.getter()});function Wi(e){return new cd({type:"lazy",getter:e})}s(Wi,"bm"),o(Wi,"lazy");var pd=B("ZodPromise",(e,t)=>{$g.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>S1(e,r,n,u),e.unwrap=()=>e._zod.def.innerType});function md(e){return new pd({type:"promise",innerType:e})}s(md,"y$"),o(md,"promise");var fd=B("ZodFunction",(e,t)=>{Dg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>h1(e,r,n,u)});function Zr(e){return new fd({type:"function",input:Array.isArray(e?.input)?Oi(e?.input):e?.input??yu(gt()),output:e?.output??gt()})}s(Zr,"b$"),o(Zr,"_function");var Lr=B("ZodCustom",(e,t)=>{xg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,n,u)=>f1(e,r,n,u)});function hd(e){let t=new de({check:"custom"});return t._zod.check=e,t}s(hd,"w$"),o(hd,"check");function gd(e,t){return p0(Lr,e??(()=>!0),t)}s(gd,"x$"),o(gd,"custom");function Gi(e,t={}){return m0(Lr,e,t)}s(Gi,"$m"),o(Gi,"refine");function Ki(e,t){return f0(e,t)}s(Ki,"_m"),o(Ki,"superRefine");var K1=g0,H1=v0;function vd(e,t={}){let r=new Lr({type:"custom",check:"custom",fn:o(n=>n instanceof e,"fn"),abort:!0,...te.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}s(vd,"k$"),o(vd,"_instanceof");var X1=o((...e)=>y0({Codec:qr,Boolean:Fr,String:Cr},...e),"stringbool");function yd(e){let t=Wi(()=>Or([gu(e),Si(),Fi(),zi(),yu(t),Ri(gu(),t)]));return t}s(yd,"I$"),o(yd,"json");function bd(e,t){return new ad({type:"pipe",in:Tr(e),out:t})}s(bd,"R$"),o(bd,"preprocess");var YD={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Y1(e){Ee({customError:e})}s(Y1,"IE"),o(Y1,"setErrorMap");function Q1(){return Ee().customError}s(Q1,"RE"),o(Q1,"getErrorMap");var Ed;Ed||(Ed={});var q={...j1,...z1,iso:$0},QD=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function e3(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}s(e3,"TE"),o(e3,"detectVersion");function t3(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let n=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let u=r[1];if(!u||!t.defs[u])throw new Error(`Reference not found: ${e}`);return t.defs[u]}throw new Error(`Reference not found: ${e}`)}s(t3,"AE"),o(t3,"resolveRef");function wd(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return q.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let u=e.$ref;if(t.refs.has(u))return t.refs.get(u);if(t.processing.has(u))return q.lazy(()=>{if(!t.refs.has(u))throw new Error(`Circular reference not resolved: ${u}`);return t.refs.get(u)});t.processing.add(u);let i=t3(u,t),a=$e(i,t);return t.refs.set(u,a),t.processing.delete(u),a}if(e.enum!==void 0){let u=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&u.length===1&&u[0]===null)return q.null();if(u.length===0)return q.never();if(u.length===1)return q.literal(u[0]);if(u.every(a=>typeof a=="string"))return q.enum(u);let i=u.map(a=>q.literal(a));return i.length<2?i[0]:q.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return q.literal(e.const);let r=e.type;if(Array.isArray(r)){let u=r.map(i=>{let a={...e,type:i};return wd(a,t)});return u.length===0?q.never():u.length===1?u[0]:q.union(u)}if(!r)return q.any();let n;switch(r){case"string":{let u=q.string();if(e.format){let i=e.format;i==="email"?u=u.check(q.email()):i==="uri"||i==="uri-reference"?u=u.check(q.url()):i==="uuid"||i==="guid"?u=u.check(q.uuid()):i==="date-time"?u=u.check(q.iso.datetime()):i==="date"?u=u.check(q.iso.date()):i==="time"?u=u.check(q.iso.time()):i==="duration"?u=u.check(q.iso.duration()):i==="ipv4"?u=u.check(q.ipv4()):i==="ipv6"?u=u.check(q.ipv6()):i==="mac"?u=u.check(q.mac()):i==="cidr"?u=u.check(q.cidrv4()):i==="cidr-v6"?u=u.check(q.cidrv6()):i==="base64"?u=u.check(q.base64()):i==="base64url"?u=u.check(q.base64url()):i==="e164"?u=u.check(q.e164()):i==="jwt"?u=u.check(q.jwt()):i==="emoji"?u=u.check(q.emoji()):i==="nanoid"?u=u.check(q.nanoid()):i==="cuid"?u=u.check(q.cuid()):i==="cuid2"?u=u.check(q.cuid2()):i==="ulid"?u=u.check(q.ulid()):i==="xid"?u=u.check(q.xid()):i==="ksuid"&&(u=u.check(q.ksuid()))}typeof e.minLength=="number"&&(u=u.min(e.minLength)),typeof e.maxLength=="number"&&(u=u.max(e.maxLength)),e.pattern&&(u=u.regex(new RegExp(e.pattern))),n=u;break}case"number":case"integer":{let u=r==="integer"?q.number().int():q.number();typeof e.minimum=="number"&&(u=u.min(e.minimum)),typeof e.maximum=="number"&&(u=u.max(e.maximum)),typeof e.exclusiveMinimum=="number"?u=u.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(u=u.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?u=u.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(u=u.lt(e.maximum)),typeof e.multipleOf=="number"&&(u=u.multipleOf(e.multipleOf)),n=u;break}case"boolean":{n=q.boolean();break}case"null":{n=q.null();break}case"object":{let u={},i=e.properties||{},a=new Set(e.required||[]);for(let[d,c]of Object.entries(i)){let p=$e(c,t);u[d]=a.has(d)?p:p.optional()}if(e.propertyNames){let d=$e(e.propertyNames,t),c=e.additionalProperties&&typeof e.additionalProperties=="object"?$e(e.additionalProperties,t):q.any();if(Object.keys(u).length===0){n=q.record(d,c);break}let p=q.object(u).passthrough(),m=q.looseRecord(d,c);n=q.intersection(p,m);break}if(e.patternProperties){let d=e.patternProperties,c=Object.keys(d),p=[];for(let f of c){let h=$e(d[f],t),g=q.string().regex(new RegExp(f));p.push(q.looseRecord(g,h))}let m=[];if(Object.keys(u).length>0&&m.push(q.object(u).passthrough()),m.push(...p),m.length===0)n=q.object({}).passthrough();else if(m.length===1)n=m[0];else{let f=q.intersection(m[0],m[1]);for(let h=2;h<m.length;h++)f=q.intersection(f,m[h]);n=f}break}let l=q.object(u);e.additionalProperties===!1?n=l.strict():typeof e.additionalProperties=="object"?n=l.catchall($e(e.additionalProperties,t)):n=l.passthrough();break}case"array":{let u=e.prefixItems,i=e.items;if(u&&Array.isArray(u)){let a=u.map(d=>$e(d,t)),l=i&&typeof i=="object"&&!Array.isArray(i)?$e(i,t):void 0;l?n=q.tuple(a).rest(l):n=q.tuple(a),typeof e.minItems=="number"&&(n=n.check(q.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(q.maxLength(e.maxItems)))}else if(Array.isArray(i)){let a=i.map(d=>$e(d,t)),l=e.additionalItems&&typeof e.additionalItems=="object"?$e(e.additionalItems,t):void 0;l?n=q.tuple(a).rest(l):n=q.tuple(a),typeof e.minItems=="number"&&(n=n.check(q.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(q.maxLength(e.maxItems)))}else if(i!==void 0){let a=$e(i,t),l=q.array(a);typeof e.minItems=="number"&&(l=l.min(e.minItems)),typeof e.maxItems=="number"&&(l=l.max(e.maxItems)),n=l}else n=q.array(q.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n}s(wd,"E$"),o(wd,"convertBaseSchema");function $e(e,t){if(typeof e=="boolean")return e?q.any():q.never();let r=wd(e,t),n=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let l=e.anyOf.map(c=>$e(c,t)),d=q.union(l);r=n?q.intersection(r,d):d}if(e.oneOf&&Array.isArray(e.oneOf)){let l=e.oneOf.map(c=>$e(c,t)),d=q.xor(l);r=n?q.intersection(r,d):d}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=n?r:q.any();else{let l=n?r:$e(e.allOf[0],t),d=n?0:1;for(let c=d;c<e.allOf.length;c++)l=q.intersection(l,$e(e.allOf[c],t));r=l}e.nullable===!0&&t.version==="openapi-3.0"&&(r=q.nullable(r)),e.readOnly===!0&&(r=q.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let u={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let l of i)l in e&&(u[l]=e[l]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let l of a)l in e&&(u[l]=e[l]);for(let l of Object.keys(e))QD.has(l)||(u[l]=e[l]);return Object.keys(u).length>0&&t.registry.add(r,u),e.description&&(r=r.describe(e.description)),r}s($e,"Re"),o($e,"convertSchema");function u3(e,t){if(typeof e=="boolean")return e?q.any():q.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=e3(r,t?.defaultTarget),u=r.$defs||r.definitions||{},i={version:n,defs:u,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??Re};return $e(r,i)}s(u3,"T$"),o(u3,"fromJSONSchema");var r3={};ut(r3,{bigint:s(()=>a3,"bigint"),boolean:s(()=>s3,"boolean"),date:s(()=>o3,"date"),number:s(()=>i3,"number"),string:s(()=>n3,"string")});function n3(e){return No(Cr,e)}s(n3,"jE"),o(n3,"string");function i3(e){return qo(Ir,e)}s(i3,"OE"),o(i3,"number");function s3(e){return Ko(Fr,e)}s(s3,"zE"),o(s3,"boolean");function a3(e){return Xo(jr,e)}s(a3,"ME"),o(a3,"bigint");function o3(e){return o0(Ni,e)}s(o3,"NE"),o(o3,"date"),Ee(Ao());var Dd=v.object({file:v.string(),line:v.number().int().nonnegative().optional(),column:v.number().int().nonnegative().optional(),symbol:v.string().optional(),componentName:v.string().optional(),hookName:v.string().optional()}),e$=v.enum(["user-click","user-input","keyboard","route-load","effect","memo-recompute","timer","raf","idle-callback","websocket-message","broadcast-channel","post-message","storage-event","service-worker-message","media-query-change","visibility-change","resize","intersection-observer","mutation-observer","backend-response","hmr-update","ai-turn","page-load","form-submit","input-change"]),l3=v.object({sessionId:v.string(),browserContextId:v.string().optional(),tabId:v.string().optional(),frameId:v.string().optional(),route:v.string().optional(),url:v.string().optional(),flowId:v.string().optional(),originType:e$.optional(),originNodeId:v.string().optional(),causedByNodeId:v.string().optional(),requestId:v.string().optional(),parentRequestId:v.string().optional(),traceparent:v.string().optional(),projectName:v.string().optional(),userActionId:v.string().optional(),userIdHash:v.string().optional(),tenantIdHash:v.string().optional()}),t$=v.enum(["nx","vite","typescript","eslint","rollup","client-runtime","chrome","react","valtio","nestjs","nextjs","db","redis","queue","memory","visual","perf","security","gateway","external","ai","lens"]),u$=v.enum(["build","lint","typecheck","test","runtime","render","visual","trace","state","network","backend","db","memory","performance","security","deps","cluster","ai"]),$d=v.enum(["debug","info","warning","error","fatal"]),cS=v.object({id:v.string(),sessionId:v.string(),timestamp:v.number().int().nonnegative(),source:t$,category:u$,severity:$d,context:l3,fingerprint:v.string(),title:v.string(),message:v.string().optional(),location:Dd.optional(),relatedFiles:v.array(v.string()).optional(),relatedUrls:v.array(v.string()).optional(),raw:v.unknown().optional()}),r$=v.enum(["session","browser-context","tab","renderer","router","route","page","component","element","slot","render","react-mount","react-unmount","hook","effect","effect-run","memo","memo-compute","ui-event","handler","animation","animation-frame","transition","timer","api-client-call","http-request","http-response","server-process","nest-app","nest-module","nest-provider","singleton-instance","server-request","guard","controller","service-method","loop","loop-iteration","queue-job","db-query","redis-op","promise","promise-continuation","state-store","state-update","selector","selector-update","visual-frame","visual-violation","style-change","layout-change","memory-owner","memory-mutation","memory-retention","heap-snapshot","build-event","lint-event","typecheck-event","test-event","bundle-report","hmr-update"]),n$=v.enum(["created","active","completed","disposed","errored"]),pS=v.object({id:v.string(),parentTraceNodeId:v.string().optional(),type:r$,logicalId:v.string().optional(),instanceId:v.string().optional(),generation:v.number().int().nonnegative().optional(),lifecycle:n$,context:l3,name:v.string(),startTime:v.number().int().nonnegative(),endTime:v.number().int().nonnegative().optional(),durationMs:v.number().nonnegative().optional(),location:Dd.optional(),attributes:v.record(v.string(),v.unknown())}),i$=v.enum(["ownership","caused","async","data","render","state","network","backend","db","visual","performance","memory","lifecycle"]),mS=v.object({id:v.string(),from:v.string(),to:v.string(),axis:i$,type:v.string(),timestamp:v.number().int().nonnegative(),attributes:v.record(v.string(),v.unknown()).optional()}),s$=v.enum(["mount","update"]),a$=v.discriminatedUnion("type",[v.object({type:v.literal("props"),changedKeys:v.array(v.string())}),v.object({type:v.literal("react-state"),hookIndex:v.number().int()}),v.object({type:v.literal("context"),contextName:v.string()}),v.object({type:v.literal("valtio-path"),path:v.string(),changedKeys:v.array(v.string())}),v.object({type:v.literal("parent-render"),parentRenderId:v.string()}),v.object({type:v.literal("hook-dep-changed"),hookInstanceId:v.string(),depsHashBefore:v.string(),depsHashAfter:v.string()}),v.object({type:v.literal("force"),reason:v.string()})]),fS=v.object({phase:s$,actualDurationMs:v.number().nonnegative(),baseDurationMs:v.number().nonnegative(),startTime:v.number().nonnegative(),commitTime:v.number().nonnegative(),why:v.array(a$)}),hS=v.object({hookInstanceId:v.string(),depsHash:v.string(),prevDepsHash:v.string().optional(),durationMs:v.number().nonnegative(),cleanupRan:v.boolean().optional()}),gS=v.object({storeId:v.string(),path:v.string(),changedKeys:v.array(v.string()),beforeHash:v.string(),afterHash:v.string(),preview:v.unknown().optional()}),vS=v.object({method:v.string(),route:v.string(),status:v.number().int().optional(),durationMs:v.number().nonnegative().optional(),traceparent:v.string().optional()}),o$=v.enum(["N+1","sequential-await","growing-allocation"]),yS=v.object({iterations:v.number().int().nonnegative(),durationMs:v.number().nonnegative(),dbCallsInsideLoop:v.number().int().nonnegative(),redisCallsInsideLoop:v.number().int().nonnegative(),awaitedOperationsInsideLoop:v.number().int().nonnegative(),slowestIterations:v.array(v.object({index:v.number().int().nonnegative(),durationMs:v.number().nonnegative(),childNodeIds:v.array(v.string())})).optional(),patterns:v.array(o$).optional()}),l$=v.enum(["Map","Set","Array","EventEmitter","Queue","RxSubject","Timer","Interval","Custom"]),bS=v.object({ownerInstanceId:v.string(),containerKind:l$,fieldName:v.string(),itemCount:v.number().int().nonnegative(),estimatedBytes:v.number().nonnegative(),retainedBytes:v.number().nonnegative().optional(),growthSinceStart:v.number()}),d$=v.enum(["set","push","add","delete","clear","subscribe","listen","schedule"]),ES=v.object({ownerNodeId:v.string(),operation:d$,beforeCount:v.number().int().nonnegative(),afterCount:v.number().int().nonnegative(),estimatedDeltaBytes:v.number(),keyPreview:v.string().optional(),valueType:v.string().optional()}),d3=v.object({x:v.number(),y:v.number(),width:v.number().nonnegative(),height:v.number().nonnegative()}),c$=v.enum(["page-load","route-change","user-action","react-commit","state-update","api-response","hmr-update","animation-tick"]),p$=v.enum(["computed-style","layout","paint-order"]),wS=v.object({causedBy:c$,viewport:d3,layoutSnapshotId:v.string(),styleSnapshotId:v.string(),screenshotId:v.string().optional(),changedNodes:v.array(v.object({uid:v.string(),component:v.string().optional(),change:p$,property:v.string().optional(),before:v.unknown().optional(),after:v.unknown().optional()}))}),m$=v.enum(["grid-spacing","alignment","overflow","text-clipping","color-contrast","token-usage","z-index","responsive","custom"]),f$=v.enum(["always","after-animation","stable-only","during-animation"]),h$=v.enum(["info","warning","error"]),DS=v.object({ruleId:v.string(),ruleType:m$,severity:h$,timing:f$,element:v.object({uid:v.string(),component:v.string().optional(),rect:d3}),expected:v.record(v.string(),v.unknown()),actual:v.record(v.string(),v.unknown()),evidence:v.object({computedStyle:v.string().optional(),screenshotCrop:v.string().optional(),trace:v.string().optional(),cssCause:v.object({selector:v.string(),file:v.string().optional(),line:v.number().int().optional(),declaration:v.string().optional()}).optional()})}),g$=v.enum(["none","connected"]),v$=v.enum(["running","clean","failing","error"]),y$=v.object({id:v.string(),tool:v.string(),project:v.string().optional(),firstReportedAt:v.number().int().nonnegative(),lastReportedAt:v.number().int().nonnegative(),lastRunStatus:v$,lastRunDurationMs:v.number().int().nonnegative().optional(),errorCount:v.number().int().nonnegative(),warningCount:v.number().int().nonnegative().optional(),error:v.string().optional()}),Hi=v.object({producer:g$,producers:v.array(y$),lastReportedAt:v.number().int().nonnegative().optional(),ageMs:v.number().int().nonnegative().optional(),stale:v.boolean(),detail:v.string()}),c3=10*6e4;function Xi(e){let t=e.now??Date.now(),r=[...e.producers].sort((c,p)=>p.lastReportedAt-c.lastReportedAt);if(r.length===0)return{producer:"none",producers:[],stale:!1,detail:`No ${e.domain} producer has ever reported into this session \u2014 this is NOT a clean result, nothing is watching. ${e.noProducerHint}`};let n=r[0].lastReportedAt,u=Math.max(0,t-n),i=u>c3,a=r.filter(c=>c.lastRunStatus==="failing"),l=r.filter(c=>c.lastRunStatus==="error"),d=[`${r.length} ${e.domain} producer${r.length===1?"":"s"} reporting (${r.map(c=>c.id).join(", ")}); newest report ${p3(u)}.`];return l.length>0&&d.push(`${l.length} produced NO verdict (the tool itself failed): ${l.map(c=>`${c.id} \u2014 ${c.error??"unknown error"}`).join("; ")}.`),a.length>0&&d.push(`${a.length} reporting errors.`),i&&d.push(`Older than ${Math.round(c3/6e4)}m \u2014 the verdict may predate the current source.`),{producer:"connected",producers:r,lastReportedAt:n,ageMs:u,stale:i,detail:d.join(" ")}}s(Xi,"rn"),o(Xi,"summariseProducers");function p3(e){return e<1e3?"just now":e<6e4?`${Math.round(e/1e3)}s ago`:e<36e5?`${Math.round(e/6e4)}m ago`:`${Math.round(e/36e5)}h ago`}s(p3,"tT"),o(p3,"describeAge");var $u=v.object({$schema:v.string().optional(),schemaVersion:v.literal(1),revision:v.number().int().nonnegative(),updatedAt:v.string().datetime().optional()}),b$=v.enum(["starting","clean","warning","failing"]),m3=v.object({source:v.string(),severity:$d,title:v.string(),fingerprint:v.string(),resource:v.string(),pageId:v.string().optional(),flowId:v.string().optional(),location:Dd.optional(),rule:v.string().optional(),fix:v.string().optional(),verify:v.string().optional(),docs:v.string().optional()}),E$=v.object({typecheck:v.enum(["passed","failed","unknown"]).optional(),lint:v.enum(["passed","failed","unknown"]).optional(),build:v.enum(["passed","failed","unknown"]).optional(),runtime:v.enum(["passed","failed","warning","unknown"]).optional(),visual:v.enum(["passed","failed","warning","unknown"]).optional(),memory:v.enum(["passed","failed","warning","unknown"]).optional()}),w$=v.enum(["embedded","shared"]),D$=v.object({mode:w$,pid:v.number(),startedAt:v.string(),url:v.string().optional()}),$S=$u.extend({sessionId:v.string(),status:b$,activeTab:v.string().optional(),tabsWithIssues:v.array(v.string()).optional(),blocking:v.array(m3),warnings:v.array(m3).default([]),suggestedReads:v.array(v.string()),checks:E$.optional(),server:D$.optional()}),$$=v.object({eventsResident:v.number().int().nonnegative(),eventsResidentBytes:v.number().int().nonnegative(),eventsIngested:v.number().int().nonnegative(),eventsDropped:v.number().int().nonnegative(),eventsDroppedForBytes:v.number().int().nonnegative().optional(),eventCap:v.number().int().nonnegative().optional(),eventByteCap:v.number().int().nonnegative().optional(),artifactsResident:v.number().int().nonnegative().optional(),artifactsResidentBytes:v.number().int().nonnegative().optional(),artifactsDropped:v.number().int().nonnegative().optional(),artifactByteCap:v.number().int().nonnegative().optional(),truncatedEvents:v.number().int().nonnegative().optional(),truncatedBytesReclaimed:v.number().int().nonnegative().optional(),rawByteLimit:v.number().int().nonnegative().optional(),reducers:v.record(v.string(),v.object({residentEvents:v.number().int().nonnegative(),residentBytes:v.number().int().nonnegative(),evictedEvents:v.number().int().nonnegative(),evictedForBytes:v.number().int().nonnegative(),eventCap:v.number().int().nonnegative(),byteCap:v.number().int().nonnegative()})).optional()}),BS=$u.extend({sessionId:v.string(),supportedResources:v.array(v.string()),supportedTools:v.array(v.string()),supportedJobs:v.array(v.string()),supportedChannels:v.array(v.string()),subscribedByDefault:v.array(v.string()),transports:v.array(v.enum(["stdio","http","socket"])),host:v.object({platform:v.string(),node:v.string()}),project:v.object({name:v.string(),nxVersion:v.string().optional()}),storage:$$.optional()}),B$=v.object({id:v.string(),timestamp:v.number().int().nonnegative(),message:v.string(),fingerprint:v.string(),code:v.string().optional(),rule:v.string().optional(),severity:$d.optional(),file:v.string().optional(),line:v.number().int().nonnegative().optional(),column:v.number().int().nonnegative().optional(),project:v.string().optional()}),xS=$u.merge(Hi).extend({status:v.enum(["unknown","clean","failing"]),errorCount:v.number().int().nonnegative(),lastRunAt:v.number().int().nonnegative().optional()}),kS=$u.merge(Hi).extend({errors:v.array(B$)}),CS=$u.merge(Hi).extend({status:v.enum(["unknown","clean","warning","failing"]),errorCount:v.number().int().nonnegative(),warningCount:v.number().int().nonnegative(),lastRunAt:v.number().int().nonnegative().optional()}),AS=$u.merge(Hi).extend({status:v.enum(["unknown","clean","warning","failing"]),hmrUpdates:v.number().int().nonnegative(),lastRunAt:v.number().int().nonnegative().optional()}),Jr=Symbol.for("@lensmcp/session/Session"),Vr=Symbol.for("@lensmcp/core/EventBus"),x$=Symbol.for("@lensmcp/core/GraphStore"),Z=Symbol.for("@lensmcp/core/ResourceStore"),k$=Symbol.for("@lensmcp/storage/Storage"),C$="capture-request.json",A$="capture-runner.json",_$="capture-rules.json",Bd="__lensmcpTruncation",I$="__lensmcpTruncated";function Xe(e,t=Number.POSITIVE_INFINITY,r=12){return qt(e,t,r,32)}s(Xe,"Je"),o(Xe,"estimateJsonBytes");function xd(e,t,r=12){return qt(e,t,r,Number.POSITIVE_INFINITY)>t}s(xd,"Ks"),o(xd,"exceedsJsonByteBudget");function qt(e,t,r,n){switch(typeof e){case"undefined":case"function":case"symbol":return 0;case"boolean":return 5;case"number":return Number.isFinite(e)?8:4;case"bigint":return 20;case"string":return e.length+2;default:break}if(e===null)return 4;if(r<=0)return n;if(e instanceof Date)return 26;if(Array.isArray(e)){let a=2;for(let l=0;l<e.length;l++)if(a+=qt(e[l],t-a,r-1,n)+1,a>t)return a;return a}let u=2,i=e;for(let a in i){if(!Object.prototype.hasOwnProperty.call(i,a))continue;let l=qt(i[a],t-u,r-1,n);if(l!==0&&(u+=a.length+4+l,u>t))return u}return u}s(qt,"on"),o(qt,"walk");function Yi(e,t){e.truncatedAnything=!0,e.paths.length<20&&e.paths.push(t||"<root>")}s(Yi,"Im"),o(Yi,"record");function f3(e,t,r){return Yi(e,r),{[I$]:!0,originalBytes:Xe(t,Number.POSITIVE_INFINITY,64)}}s(f3,"cT"),o(f3,"stub");function h3(e){if(e===null)return!0;let t=typeof e;return t==="number"||t==="boolean"||t==="string"||t==="bigint"}s(h3,"uT"),o(h3,"isScalar");function Bu(e,t,r,n){if(typeof e=="string"){let u=t.budget<=0?256:t.maxStringBytes;if(e.length+2<=u)return t.budget-=e.length+2,e;let i=Math.max(0,u-64);return Yi(t,n),t.budget-=i,`${e.slice(0,i)}\u2026[lensmcp truncated: ${e.length-i} more chars]`}return e===null||typeof e!="object"?(t.budget-=qt(e,Number.POSITIVE_INFINITY,1,32),e):r<=0?f3(t,e,n):e instanceof Date?(t.budget-=26,e):Array.isArray(e)?g3(e,t,r,n):v3(e,t,r,n)}s(Bu,"sn"),o(Bu,"clampValue");function g3(e,t,r,n){let u=[],i=Math.min(e.length,t.maxArrayItems);for(let a=0;a<i&&!(t.budget<=0);a++)u.push(Bu(e[a],t,r-1,`${n}[${a}]`));return u.length<e.length&&Yi(t,`${n}[] (+${e.length-u.length} items dropped)`),u}s(g3,"lT"),o(g3,"clampArray");function v3(e,t,r,n){let u={},i,a=t.budget<=0;for(let l in e){if(!Object.prototype.hasOwnProperty.call(e,l))continue;let d=e[l],c=qt(d,512,r-1,Number.POSITIVE_INFINITY);if(c<=512&&(!a||h3(d))){u[l]=d,t.budget-=l.length+4+c;continue}(i??=[]).push({key:l,bytes:c})}if(!i)return u;i.sort((l,d)=>l.bytes===d.bytes?0:l.bytes<d.bytes?-1:1);for(let{key:l}of i){let d=n?`${n}.${l}`:l;u[l]=Bu(e[l],t,r-1,d)}return u}s(v3,"dT"),o(v3,"clampObject");function y3(e,t={}){let r=t.rawByteLimit??32768,n=t.maxDepth??12;if(r<=0)return{value:void 0,truncated:!1,originalBytes:0,keptBytes:0,paths:[]};if(e==null)return{value:e,truncated:!1,originalBytes:0,keptBytes:0,paths:[]};if(!xd(e,r,n)){let d=Xe(e,r,n),c={budget:r,maxStringBytes:t.maxStringBytes??4096,maxArrayItems:t.maxArrayItems??64,paths:[],truncatedAnything:!1};return{value:Bu(e,c,n,""),truncated:!1,originalBytes:d,keptBytes:d,paths:[]}}let u=Xe(e,Number.POSITIVE_INFINITY,64),i={budget:r,maxStringBytes:t.maxStringBytes??4096,maxArrayItems:t.maxArrayItems??64,paths:[],truncatedAnything:!1},a=Bu(e,i,n,""),l=Xe(a,Number.POSITIVE_INFINITY,n);if(i.truncatedAnything&&a!==null&&typeof a=="object"&&!Array.isArray(a)){let d={truncated:!0,originalBytes:u,keptBytes:l,paths:i.paths};a[Bd]=d}return{value:a,truncated:i.truncatedAnything,originalBytes:u,keptBytes:l,paths:i.paths}}s(y3,"Rm"),o(y3,"boundedClone");function Zt(e,t){if(e.size<=t)return 0;let r=0,n=e.keys();for(;e.size>t;){let u=n.next();if(u.done)break;e.delete(u.value)&&(r+=1)}return r}s(Zt,"tt"),o(Zt,"capMap");var Wr=256,xu="error-dismissed",Qi="error-restored",b3="lens",S$=new Set(["dashboard","cli","agent"]);function kd(e){if(e.source!==b3||!e.raw||typeof e.raw!="object")return;let t=e.raw,r=t.groupId;if(typeof r!="string"||r.length===0||r.length>2048)return;if(t.kind===Qi)return{kind:Qi,groupId:r};if(t.kind!==xu)return;let n=t.until;if(typeof n!="number"||!Number.isFinite(n))return;let u=Array.isArray(t.eventIds)?t.eventIds.filter(c=>typeof c=="string"&&c.length>0).slice(0,200):[],i=S$.has(t.by)?t.by:void 0,a=o((c,p)=>typeof c=="string"&&c.trim()?c.trim().slice(0,p):void 0,"text"),l=a(t.reason,500),d=a(t.title,300);return{kind:xu,groupId:r,until:Math.min(n,e.timestamp),eventIds:u,...i?{by:i}:{},...l?{reason:l}:{},...d?{title:d}:{}}}s(kd,"Hs"),o(kd,"readErrorDismissal");var F$=["pod-memory","pod-memory-retained","pod-memory-released","pod-memory-exited"];function es(e){if(!e||typeof e!="object")return;let t=e;if(F$.includes(t.kind)&&!(typeof t.project!="string"||!t.project)&&!(typeof t.pod!="number"||typeof t.pid!="number")&&!(t.kind==="pod-memory"&&(typeof t.live!="number"||!Number.isFinite(t.live)))&&!((t.kind==="pod-memory-retained"||t.kind==="pod-memory-released")&&typeof t.gen!="number"))return e}s(es,"cn"),o(es,"asPodMemoryRaw");var j$=["perf-rule-finding","perf-rule-retracted","perf-rule-scan"],Cd="https://github.com/kiwiapps-ltd/lensmcp/blob/main/docs/lensmcp/concepts/memory-and-build-cost.mdx",E3={"bundle/heavy-barrel-import":`${Cd}#bundleheavy-barrel-import`,"pod/heap-budget":`${Cd}#podheap-budget`,"pod/retained-generation":`${Cd}#podretained-generation`};function w3(e,t,r){return`perf-rule:${e}:${t}:${r}`}s(w3,"U$"),o(w3,"perfRuleFingerprint");var z$=/^[a-z][a-z0-9-]*\/[a-z0-9][a-z0-9-]*$/,N$=12,M$=4e3,vt=o((e,t=M$)=>typeof e=="string"&&e.length>0&&e.length<=t,"isText");function D3(e){if(!e||typeof e!="object")return;let t=e;if(!j$.includes(t.kind)||typeof t.rule!="string"||!z$.test(t.rule)||!vt(t.project,512))return;if(t.kind==="perf-rule-scan"){let n=t.open;return!Array.isArray(n)||n.length>256||!n.every(u=>vt(u,512))?void 0:e}if(!vt(t.subject,512))return;if(t.kind==="perf-rule-retracted")return e;if(t.severity!=="warning"&&t.severity!=="error"||!vt(t.title)||!vt(t.summary)||!vt(t.verify)||!vt(t.docs,1024))return;let r=t.fix;if(!(!Array.isArray(r)||r.length===0||r.length>N$||!r.every(n=>vt(n)))&&!(!t.evidence||typeof t.evidence!="object"||Array.isArray(t.evidence))&&!(!t.cost||typeof t.cost!="object"||Array.isArray(t.cost)))return e}s(D3,"L$"),o(D3,"asPerfRuleRaw");function Ad(e){let{source:t,category:r,title:n,kind:u}=e;return t==="ai"?"ai":u?.startsWith("memory")||u==="db-query"?"data":t==="gateway"||u==="gateway-request"?"gateway":u==="queue-process"||u==="queue-active"||u==="queue-completed"||u==="queue-failed"?"services":t==="db"||t==="redis"||t==="queue"||u==="redis-op"||u?.startsWith("queue-")?"data":t==="external"||u==="egress"?"network":t==="nestjs"||t==="nest"?/(?:Repository|Repo|Dao|Store)\./.test(n)?"data":"services":t==="valtio"?"state":r==="network"?"network":"browser"}s(Ad,"Om"),o(Ad,"areaOf");var $3=240,O$=new Set(["systemPrompt","prompt","prompts","messages","completion","completions","input","output","draft","text","content","result","arguments","params"]),R$=new Set(["tenantId","caller","userId","accountId","email","subject"]),T$=8;function B3(e){let t=ts(e,0);return y3(Gu({redacted:!0,...t}),{rawByteLimit:16*1024}).value}s(B3,"xT"),o(B3,"aiProjection");function ts(e,t){if(typeof e=="string")return x3(e);if(e===null||typeof e!="object")return e;if(t>=T$)return;if(Array.isArray(e))return e.slice(0,32).map(n=>ts(n,t+1));let r={};for(let[n,u]of Object.entries(e))if(!R$.has(n)){if(O$.has(n)){typeof u=="string"?r[`${n}Chars`]=u.length:Array.isArray(u)?r[`${n}Count`]=u.length:u!=null&&(r[`${n}Present`]=!0);continue}r[n]=ts(u,t+1)}return r}s(ts,"jm"),o(ts,"projectAi");function x3(e){return e.length<=$3?dt(e):`${dt(e.slice(0,$3))}\u2026`}s(x3,"$T"),o(x3,"clipText");function k3(e,t={}){let r=e.raw??{},n=r.render??{},u=r.span??{},i=r.request??{},a=o(y=>typeof y=="number"?y:void 0,"num"),l=r.loop??{},d=r.effect??{},c=a(r.durationMs)??a(u.durationMs)??a(i.durationMs)??a(l.durationMs)??a(n.actualDurationMs)??a(d.durationMs),p=typeof r.kind=="string"?r.kind:void 0,m=p==="fetch-done"||p==="fetch-error",f=a(n.commitTime),h=p==="render"&&f!==void 0&&Math.abs(f-e.timestamp)<6e4,g=m?e.timestamp:h?f:a(r.startedAt)??a(u.startTime)??a(i.startedAt)??a(l.startedAt)??(c!==void 0?e.timestamp-c:e.timestamp),b;if(typeof r.query=="string"){let y=Array.isArray(r.params)?` [${r.params.join(", ")}]`:"",D=typeof r.result=="string"?` \u2192 ${r.result}`:"";b=r.query+y+D}else if(typeof r.command=="string"){let y=typeof r.value=="string"?` \u2192 ${r.value}`:r.hit===!1?" \u2192 (miss)":"";b=r.command+y}else if(p==="state-update"){let y=r.update??{},D="";try{D=JSON.stringify(y.preview)}catch{}b=`${y.storeId??""}.${y.path??""} = ${D}`}else p==="queue-completed"&&typeof r.returned=="string"?b=`returned ${r.returned}`:p==="queue-enqueued"&&(b=`${r.job??"job"}#${r.jobId??"?"} \u2192 ${r.queue??""}${typeof r.data=="string"?" "+r.data:""}`);let x;if(p==="gateway-request")x=`${r.host??""}${String(r.url??"").split("?")[0]}`;else if(p==="fetch-start"||p==="fetch-done"||p==="fetch-error")try{let y=new URL(String(r.href??r.url??""));x=`${y.hostname}${y.pathname}`}catch{}let $;if(p==="gateway-request"&&Array.isArray(r.steps))$=r.steps.map(y=>{let D=[String(y.step)];return y.project&&D.push(String(y.project)),y.prefix&&D.push(String(y.prefix)),y.mode&&D.push(String(y.mode)+(y.ok===!1?" \u2717":y.ok===!0?" \u2713":"")),y.caller&&D.push("by "+String(y.caller)),y.pod&&D.push(String(y.pod)),typeof y.atMs=="number"&&D.push(`@${y.atMs}ms`),D.join(" ")}),b=$.map(y=>y.replace(/ @\d+ms$/,"")).join(" \u2192 ");else if(p==="egress")b=`${r.method??"GET"} ${r.host??""} \u2192 ${r.status??"?"}`;else if(e.source==="ai"){if(p==="ai-call"){let y=r.usage??{},D=y.promptTokens!==void 0||y.completionTokens!==void 0?` \xB7 ${a(y.promptTokens)??"?"}\u2192${a(y.completionTokens)??"?"} tok`:"",A=r.status!==void 0?` \xB7 ${String(r.status)}`:r.error?" \xB7 failed":"",j=a(r.toolCallCount)?` \xB7 ${a(r.toolCallCount)} tool call${a(r.toolCallCount)===1?"":"s"}`:"",N=a(r.durationMs)!==void 0?` \xB7 ${(a(r.durationMs)/1e3).toFixed(1)}s`:"";b=`${r.provider??""}/${r.model??"?"}${D}${A}${j}${N}${r.stream===!0?" \xB7 stream":""}`}else if(p==="ai-round"){let y=r.model??{},D=r.usage??{},A=Array.isArray(r.toolCalls)?r.toolCalls:[],j=`${a(D.promptTokens)??"?"}\u2192${a(D.completionTokens)??"?"} tok`,N=A.length?` \xB7 ${A.length} tool call${A.length===1?"":"s"}`:"",K=a(r.durationMs)!==void 0?` \xB7 ${(a(r.durationMs)/1e3).toFixed(1)}s`:"";b=`${y.provider??""}/${y.model??""} \xB7 ${j}${N}${K}`}else if(p==="ai-turn-start"){let y=Array.isArray(r.tools)?r.tools:[];b=`skill ${r.skill??""} \xB7 ${r.output??""}${y.length?" \xB7 tools: "+y.join(", "):""}`}else if(p==="ai-tool-call"){let y=r.call??{},D=r.result??{},A=a(r.durationMs)!==void 0?` \xB7 ${(a(r.durationMs)/1e3).toFixed(1)}s`:"";b=`${y.name??"tool"} ${D.error!=null?"\u2717 "+String(D.error):"\u2713"}${A}`}else if(p==="ai-turn-end"){let y=r.usage??{},D=a(r.rounds)!==void 0?` \xB7 ${a(r.rounds)} round${a(r.rounds)===1?"":"s"}`:"",A=a(r.durationMs)!==void 0?` \xB7 ${(a(r.durationMs)/1e3).toFixed(1)}s`:"";b=`${r.ok===!1?"FAILED":"ok"} \xB7 ${a(y.promptTokens)??"?"}+${a(y.completionTokens)??"?"} tok${D}${A}`}}let w;p==="db-query"&&typeof r.query=="string"?w=r.query:p==="redis-op"?w=`${r.op??""} ${String(r.key??"").replace(/\d+/g,"#")}`:p==="egress"?w=`${r.method??"GET"} ${r.host??""}`:p==="ai-call"?w=`ai ${r.provider??""} ${r.model??""} ${r.api??""}`:p==="queue-enqueued"?w=`enqueue ${r.queue??""}`:p==="span"&&typeof u.name=="string"?w=u.name:p==="memory-mutation"&&(w=e.title);let C=e.context??{},k=n.commitId??d.commitId??r.commitId,M=Array.isArray(n.why)?n.why.map(y=>typeof y?.type=="string"?y.type:void 0).filter(y=>!!y):[];return{id:e.id,t:e.timestamp,start:g,...w?{sig:w}:{},...x?{urlKey:x}:{},...typeof r.queue=="string"?{queue:r.queue}:{},...r.jobId!=null?{jobId:String(r.jobId)}:{},source:e.source,category:e.category,severity:e.severity,title:e.title,kind:p,area:Ad({source:e.source,category:e.category,title:e.title,kind:p}),...typeof u.role=="string"?{role:u.role}:{},...typeof C.requestId=="string"?{requestId:C.requestId}:{},...typeof C.parentRequestId=="string"?{parentRequestId:C.parentRequestId}:{},...typeof k=="string"?{commitId:k}:{},...typeof n.componentName=="string"?{component:n.componentName}:{},...typeof n.phase=="string"?{phase:n.phase}:{},...M.length?{why:M}:{},...p==="effect-run"&&typeof d.hookLogicalId=="string"?{hook:d.hookLogicalId}:{},...p==="effect-run"&&d.cleanupRan===!0?{cleanup:!0}:{},...p==="render-commit-truncated"?{renderTotal:a(r.total),renderPublished:a(r.published)}:{},...typeof C.projectName=="string"?{project:C.projectName}:typeof r.project=="string"?{project:r.project}:{},...c!==void 0?{durationMs:c}:{},...m&&a(r.startedAt)!==void 0?{fetchStartedAt:a(r.startedAt)}:{},...e.source==="ai"?{ai:t.includeRaw?r:B3(r)}:{},...b?{detail:b}:{},...$?{steps:$}:{}}}s(k3,"_T"),o(k3,"trimFlowEvent");var C3=1;function A3(e){return e==="flow-origin"?0:e?.endsWith("-start")?1:e==="gateway-request"?2:e==="server-request"?3:e==="span"?4:e==="render"||e==="render-commit-truncated"?6:e==="effect-run"?7:5}s(A3,"kT"),o(A3,"kindRank");function ku(e){return e.kind==="span"&&e.role==="controller"?3.5:e.kind==="queue-process"?3:A3(e.kind)}s(ku,"go"),o(ku,"causalRank");function us(e,t={}){let r=Fn(e),n=e.slice().filter(E=>{let I=E.raw??{},_=typeof I.kind=="string"?I.kind:"";if(_==="subscription-added"||_==="subscription-removed"||_==="hook-run"||_==="store-created"||_==="singleton-instance"||_===ya)return!1;let S=I.span;return!(typeof S?.name=="string"&&S.name.startsWith("nest.request "))}).map(E=>k3(E,t)),u=new Set;for(let E=n.length-1;E>=0;E--)u.has(n[E].id)?n.splice(E,1):u.add(n[E].id);let i=new Map;for(let E of n)(E.kind==="gateway-request"||E.kind==="queue-process")&&E.requestId&&!i.has(E.requestId)&&i.set(E.requestId,E.start);let a=o(E=>E.source!=="react"&&E.source!=="valtio"&&E.requestId&&i.has(E.requestId)?i.get(E.requestId):E.start,"anchorOf");n.sort((E,I)=>a(E)-a(I)||E.start-I.start||ku(E)-ku(I)||(I.durationMs??0)-(E.durationMs??0)||E.t-I.t);let l=o(E=>(E.kind==="span"||E.kind==="server-request"||E.kind==="gateway-request"||E.kind==="queue-process")&&(E.durationMs??0)>0,"spanLike"),d=n;for(let E of d)E.group=E.source==="react"||E.source==="valtio"||E.source==="client-runtime"||E.source==="visual"?"browser":"server";let c=new Map;for(let E of d)if((E.kind==="gateway-request"||E.kind==="queue-process")&&E.requestId&&E.project){let I=c.get(E.requestId)??[];I.push({project:E.project,start:E.start,end:E.start+(E.durationMs??0)}),c.set(E.requestId,I)}let p=o((E,I)=>{let _=c.get(E);if(_?.length)return _.every(S=>S.project===_[0].project)?_[0].project:_.filter(S=>S.start<=I+1&&S.end>=I-1).sort((S,U)=>U.start-S.start)[0]?.project},"projectOf");for(let E of d)if(!E.project&&E.source==="nestjs"&&E.requestId){let I=p(E.requestId,E.start);I&&(E.project=I)}for(let E of d){let I,_=E.requestId;for(let S of d){if(S===E||!l(S)||S.group!==E.group||S.requestId!==_)continue;let U=S.project,W=E.project;if(S.kind!=="gateway-request"&&E.kind!=="gateway-request"&&U!==void 0&&W!==void 0&&U!==W)continue;let ue=S.durationMs??0,re=E.durationMs??0,L=Math.abs(S.start-E.start)<=C3,J=ku(S),Y=ku(E),ie=S.start<=E.start;if(!(S.start+ue>E.start&&(ie||L&&J<Y)&&(!L||(J!==Y?J<Y:ie&&ue>re))))continue;let be=I?ku(I):-1,fe=I?Math.abs(S.start-I.start)<=C3:!1;(!I||!fe&&S.start>I.start||fe&&J>be||fe&&J===be&&(S.durationMs??0)<(I.durationMs??0))&&(I=S)}I&&(E.parent=I.id)}let m=new Map;for(let E of d){if(!E.requestId)continue;let I=m.get(E.requestId);I?I.push(E):m.set(E.requestId,[E])}let f=new Map(d.map(E=>[E.id,E])),h=o((E,I)=>{let _=(m.get(E)??[]).filter(S=>l(S)&&S.start<=I&&S.start+(S.durationMs??0)>=I);if(_.length!==0)return _.sort((S,U)=>U.start-S.start||(S.durationMs??0)-(U.durationMs??0)),_[0]},"callerNodeFor");for(let E of d){if(!E.parentRequestId||E.kind!=="server-request"&&E.kind!=="gateway-request")continue;let I=E.parent?f.get(E.parent):void 0;if(I&&I.requestId===E.requestId)continue;let _=h(E.parentRequestId,E.start);_&&_!==E&&_.start<=E.start&&(E.parent=_.id)}let g=d,b=new Map;for(let E of g)E.kind==="gateway-request"&&E.requestId&&!b.has(E.requestId)&&b.set(E.requestId,E);for(let E of g)if(E.group==="server"&&!E.parent&&E.requestId&&E.kind!=="gateway-request"){let I=b.get(E.requestId);I&&I!==E&&I.start<=E.start&&(E.parent=I.id)}let x=new Set,$=new Set,w=[];for(let E of g){if(E.kind!=="gateway-request")continue;if(!E.requestId){w.push(E);continue}let I=m.get(E.requestId)??[];if(I.filter(U=>U.kind==="gateway-request").sort((U,W)=>U.start-W.start)[0]!==E)continue;let _=I.find(U=>U.kind==="fetch-start"),S=I.find(U=>U.kind==="fetch-done"||U.kind==="fetch-error");if(!_&&!S){w.push(E);continue}_&&(E.fetchStartId=_.id,x.add(_.id)),S&&(E.fetchDoneId=S.id,$.add(S.id))}let C=new Map;for(let E of g){if(!E.urlKey)continue;let I=C.get(E.urlKey)??{gws:[],starts:[],dones:[]};E.kind==="gateway-request"?w.includes(E)&&I.gws.push(E):E.kind==="fetch-start"?x.has(E.id)||I.starts.push(E):(E.kind==="fetch-done"||E.kind==="fetch-error")&&($.has(E.id)||I.dones.push(E)),C.set(E.urlKey,I)}for(let{gws:E,starts:I,dones:_}of C.values()){E.sort((U,W)=>U.start-W.start),I.sort((U,W)=>U.start-W.start);let S=new Set;E.forEach((U,W)=>{let ue=I[W];ue&&(U.fetchStartId=ue.id);let re=ue?ue.t:U.start,L,J=1/0;for(let Y of _){if(S.has(Y.id))continue;let ie=Y.fetchStartedAt??Y.start-(Y.durationMs??0),be=Math.abs(ie-re);be<J&&(J=be,L=Y)}L&&(U.fetchDoneId=L.id,S.add(L.id))})}let k=new Map,M=new Map;for(let E of g)!E.queue||!E.jobId||(E.kind==="queue-enqueued"&&k.set(`${E.queue}#${E.jobId}`,E),E.kind==="queue-process"&&M.set(`${E.queue}#${E.jobId}`,E));for(let E of g){if(!E.queue||!E.jobId)continue;let I=`${E.queue}#${E.jobId}`;if(E.kind==="queue-process"&&!E.parent){let _=k.get(I);_&&_!==E&&_.start<=E.start&&(E.parent=_.id)}else if(E.kind==="queue-active"||E.kind==="queue-completed"||E.kind==="queue-failed"){let _=M.get(I);_&&_!==E&&_.start<=E.start&&(E.parent=_.id)}}let y=d;{let E=new Map;for(let _ of y)_.kind==="fetch-start"&&E.set(_.id,_);let I=new Map;for(let _ of y){if(_.kind!=="fetch-done"&&_.kind!=="fetch-error")continue;let S=[...E.values()].find(ue=>ue.requestId&&ue.requestId===_.requestId)?.id,U=S?E.get(S):void 0;if(!U)continue;let W=_.fetchStartedAt??U.start;U.title=_.title,U.severity=_.severity,U.durationMs=_.durationMs??Math.max(0,_.t-W),U.kind="fetch",_.detail&&!U.detail&&(U.detail=_.detail),I.set(_.id,U.id)}if(I.size>0){y=y.filter(_=>!I.has(_.id));for(let _ of y)for(_.fetchDoneId&&I.has(_.fetchDoneId)&&(_.fetchDoneId=I.get(_.fetchDoneId));_.parent&&I.has(_.parent);)_.parent=I.get(_.parent)}}let D=o(E=>!!E.commitId&&(E.kind==="render"||E.kind==="effect-run"||E.kind==="render-commit-truncated"),"commitMember"),A=o(E=>[...new Set(E)],"uniq"),j=o(E=>A(E.map(I=>I.component).filter(I=>!!I)),"named"),N=o(E=>E.length<=2?E.join(" + "):`${E[0]} + ${E.length-1} more`,"nameList"),K=o(E=>{let I=new Map;for(let _ of E)_.component&&I.set(_.component,(I.get(_.component)??0)+1);return[...I].map(([_,S])=>S>1?`${_} \xD7${S}`:_).join(", ")},"tally"),H=o(E=>{if(!E)return"effect";let I=/([^/\\]+?):(\d+)(?::\d+)?$/.exec(E);return I?`${I[1]}:${I[2]}`:E},"shortHook"),ye=o(E=>`${H(E.hook)}${E.cleanup?" (cleanup)":""}`,"hookLabel"),Ze=o(E=>{let I=Math.min(...E.map(S=>S.start)),_=Math.max(...E.map(S=>S.start+(S.durationMs??0)));return{start:I,durationMs:_-I}},"extent"),Ve=o(E=>(delete E.component,delete E.why,delete E.phase,delete E.hook,delete E.cleanup,delete E.renderTotal,delete E.renderPublished,E),"asGroup");function It(E){let I=E[0],_=E.filter(he=>he.kind==="render"),S=E.filter(he=>he.kind==="effect-run"),U=E.find(he=>he.kind==="render-commit-truncated"),W=[..._].sort((he,Wu)=>(Wu.durationMs??0)-(he.durationMs??0)),ue=W.filter(he=>(he.why??[]).some(Wu=>Wu!=="parent-render")),re=A(ue.flatMap(he=>(he.why??[]).filter(Wu=>Wu!=="parent-render"))),L=j(ue),J=_.filter(he=>he.phase==="mount"),Y=_.filter(he=>he.phase!=="mount"&&!ue.includes(he)),ie=W[0]?.component??"view",be=_.length>0&&J.length===_.length,fe=re.length?re.join(" + "):void 0,St=be?"mount":"update",Ft=L.length?`view update \xB7 ${N(L)} \u2190 ${fe}`:be?`view mount \xB7 ${ie}`:`view update \xB7 ${ie}`,s4=U?.renderTotal??_.length,Ww=[J.length?`mounted ${K(J)}`:"",Y.length?`re-rendered ${K(Y)}`:"",!L.length&&!be&&_.length?"trigger not recorded \u2014 every captured render came from its parent":"",U?`${s4} renders, ${U.renderPublished??_.length} recorded (per-commit cap)`:`${_.length} render${_.length===1?"":"s"}`,S.length?`${S.length} effect${S.length===1?"":"s"}: ${S.map(ye).join(", ")}`:""].filter(Boolean).join(" \xB7 "),a4=j(_);return Ve({...I,...Ze(E),kind:"view-update",title:Ft,detail:Ww,commitId:I.commitId,viewPhase:St,...fe?{cause:fe}:{},causeComponents:L,components:a4,mounted:j(J),renderCount:s4,recordedRenders:_.length,effects:S.length,effectHooks:S.map(ye),memberIds:E.map(he=>he.id),sig:`commit:${St}:${fe??"-"}:${L.join(",")}:${a4.slice().sort().join(",")}`,severity:E.some(he=>he.severity==="error")?"error":I.severity})}s(It,"gr"),o(It,"viewUpdateNode");function tt(E){let I=E[0],_=E.map(ye);return Ve({...I,...Ze(E),kind:"commit-effects",title:E.length===1?`effect \xB7 ${_[0]}`:`effects \xB7 ${_[0]} + ${E.length-1} more`,detail:_.join(", "),commitId:I.commitId,effects:E.length,effectHooks:_,memberIds:E.map(S=>S.id),sig:`effects:${_.slice().sort().join(",")}`})}s(tt,"_t"),o(tt,"effectsNode");let In=o(E=>A(E.map(I=>I==="state-update"?"state update":I==="fetch-start"?"request":I==="flow-origin"?"interaction":"response")).join(" + "),"describeInputs");function Vu(E,I){let _=E[0],S=E[E.length-1],U=E.length,W=_.detail,ue=Math.min(...E.map(Y=>Y.start)),re=Math.max(...E.map(Y=>Y.start+(Y.durationMs??0))),L=Math.round(E.reduce((Y,ie)=>Y+(ie.durationMs??0),0)/U*10)/10,J=Math.round((re-ue)*10)/10;_.count=U,_.avgMs=L,_.wallMs=J,_.durationMs=re-ue,_.items=E.slice(0,12).map(Y=>({start:Y.start-ue,...Y.durationMs!=null?{durationMs:Y.durationMs}:{}})),_.memberIds=E.flatMap(Y=>Y.memberIds??[Y.id]),_.title=`\xD7${U} ${_.title}`,E.some(Y=>Y.severity==="error")&&(_.severity="error"),_.kind==="view-update"?_.detail=[`${U} commits, ${I.length?`one per ${In(I)}`:"back to back"}`,`avg ${L}ms \xB7 wall ${J}ms`,W??""].filter(Boolean).join(" \xB7 "):_.kind==="state-update"&&W&&S.detail?_.detail=`${U} updates in a row \xB7 wall ${J}ms \xB7 first ${W} \xB7 last ${S.detail}`:_.detail=[`${U} in a row \xB7 wall ${J}ms`,W??""].filter(Boolean).join(" \xB7 ")}s(Vu,"si"),o(Vu,"collapseRepeat");let Oe=[],Sn=new Map,n4=new Set;for(let E=0;E<y.length;E++){if(n4.has(E))continue;let I=y[E];if(!D(I)){Oe.push(I);continue}let _=[E];for(let W=E+1;W<y.length;W++){let ue=y[W];if(ue.group==="browser"){if(!D(ue)||ue.commitId!==I.commitId)break;_.push(W)}}for(let W of _)n4.add(W);let S=_.map(W=>y[W]),U=S.some(W=>W.kind!=="effect-run")?It(S):tt(S);for(let W of S)W.id!==U.id&&Sn.set(W.id,U.id);Oe.push(U)}if(Sn.size>0||Oe.some(E=>E.kind==="view-update"||E.kind==="commit-effects")){y=Oe;for(let E of y)for(;E.parent&&Sn.has(E.parent);)E.parent=Sn.get(E.parent)}{let E=new Map;for(let I of y)I.kind==="view-update"&&I.commitId&&!E.has(I.commitId)&&E.set(I.commitId,I);for(let I of y){if(I.kind!=="commit-effects"||I.parent||!I.commitId)continue;let _=E.get(I.commitId);_&&_.start<=I.start&&(I.parent=_.id)}}{let E=new Set(["state-update","fetch","fetch-start","fetch-done","fetch-error","flow-origin"]),I=y.map((L,J)=>L.group==="browser"?J:-1).filter(L=>L>=0),_=o(L=>`${L.kind}|${L.sig??L.title}`,"keyOf"),S=I.map(L=>_(y[L])),U=o((L,J,Y)=>{for(let ie=0;ie<Y;ie++)if(S[L+ie]!==S[J+ie])return!1;return!0},"sameBlock"),W=o(L=>S[L].split("|")[0],"kindAt"),ue=o(L=>{let J=0,Y=1;for(let ie=1;ie<=4&&L+ie<=S.length;ie++){let be=1;for(;L+(be+1)*ie<=S.length&&U(L,L+be*ie,ie);)be+=1;be>=3&&ie*be>J*Y&&(J=ie,Y=be)}return{k:J,r:Y}},"bestBlockAt"),re=new Map;for(let L=0;L<S.length;){let{k:J,r:Y}=ue(L);if(J===0){L+=1;continue}let ie=[...Array(J).keys()].find(fe=>E.has(W(L+fe)));if(ie!==void 0&&ie>0){let fe=ue(L+ie);if(fe.k===J&&fe.r>=3&&fe.r>=Y-1){L+=ie;continue}}let be=S.slice(L,L+J).map(fe=>fe.split("|")[0]).filter(fe=>E.has(fe));for(let fe=0;fe<J;fe++){let St=[];for(let Ft=0;Ft<Y;Ft++)St.push(y[I[L+fe+Ft*J]]);Vu(St,be);for(let Ft of St.slice(1))re.set(Ft.id,St[0].id)}L+=J*Y}if(re.size>0){y=y.filter(L=>!re.has(L.id));for(let L of y)for(;L.parent&&re.has(L.parent);)L.parent=re.get(L.parent)}}{let E=new Map(y.map(I=>[I.id,I]));for(let I of y){let _=new Set([I.id]),S=I;for(;S?.parent;){if(_.has(S.parent)){S.parent=void 0;break}_.add(S.parent),S=E.get(S.parent)}}}let i4=o(E=>{let I=new Map;for(let S of y){if(!S.sig||l(S)!==E||S.kind==="server-request"||S.kind==="gateway-request"||S.group==="browser")continue;let U=`${S.parent??"root"}|${S.kind}|${S.sig}`,W=I.get(U);W?W.push(S):I.set(U,[S])}let _=new Map;for(let S of I.values()){if(S.length<3)continue;S.sort((J,Y)=>J.start-Y.start);let U=S[0],W=!1;for(let J=0;J+1<S.length;J++)if(S[J+1].start<S[J].start+(S[J].durationMs??0)){W=!0;break}let ue=U.start,re=Math.max(...S.map(J=>J.start+(J.durationMs??0))),L=S.reduce((J,Y)=>J+(Y.durationMs??0),0);U.count=S.length,U.parallel=W,U.avgMs=Math.round(L/S.length*10)/10,U.wallMs=re-ue,U.durationMs=re-ue,U.title=`\xD7${S.length} ${U.title.replace(/\s*\((?:\d+ rows?, )?\d+ms\)$/,"")}`,U.detail=`${U.sig} \xD7${S.length} ${W?"\u2016 parallel":"\u21BB sequential loop"} \xB7 avg ${U.avgMs}ms \xB7 wall ${U.wallMs}ms`,U.items=S.slice(0,12).map(J=>({start:J.start-ue,...J.durationMs!=null?{durationMs:J.durationMs}:{}})),U.memberIds=S.flatMap(J=>J.memberIds??[J.id]),S.some(J=>J.severity==="error")&&(U.severity="error");for(let J of S.slice(1))_.set(J.id,U.id)}if(_.size!==0){y=y.filter(S=>!_.has(S.id));for(let S of y)for(;S.parent&&_.has(S.parent);)S.parent=_.get(S.parent)}},"aggregatePass");i4(!0),i4(!1);for(let E of y){if(!l(E))continue;let I=E.durationMs??0;if(I<40)continue;let _=y.filter(re=>re.parent===E.id&&(re.durationMs??0)>0).map(re=>[re.start,re.start+(re.durationMs??0)]).sort((re,L)=>re[0]-L[0]),S=0,U=-1,W=-1;for(let[re,L]of _)re>W?(W>U&&(S+=W-U),U=re,W=L):L>W&&(W=L);W>U&&(S+=W-U);let ue=Math.max(0,I-S);(ue>=50||ue/I>=.7&&I>=40)&&(E.selfMs=ue,E.detail=`\u26A0 cpu-heavy: ${ue}ms self-time of ${I}ms${E.detail?" \xB7 "+E.detail:""}`)}return{events:y,...r?{sql:r}:{}}}s(us,"vo"),o(us,"buildFlowDetail");var rs=["user-action","page-load","navigation","api","ai","background","test","system","other"],ns=new Map;function Cu(e,t){let r=ns.get(e);return r||(r=new RegExp(`^${e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".")}$`),ns.size>500&&ns.clear(),ns.set(e,r)),r.test(t)}s(Cu,"yo"),o(Cu,"globMatch");var P$=o(e=>/^[A-Z]+ /.test(e),"hasMethod");function _3(e,t){return t.some(r=>r.route?P$(e)?Cu(e,`${r.method??"GET"} ${r.route}`):Cu(e,r.route):!1)}s(_3,"IT"),o(_3,"routeMatches");function _d(e,t){return!([e.flowId,e.originType,e.origin,e.route,e.project].filter(r=>r!==void 0).length===0||e.flowId!==void 0&&!Cu(e.flowId,t.flowId)||e.originType!==void 0&&e.originType!==t.origin.type||e.origin!==void 0&&!(t.origin.nodeId!==void 0&&Cu(e.origin,t.origin.nodeId))||e.route!==void 0&&!_3(e.route,t.segments)||e.project!==void 0&&!t.segments.some(r=>r.projects.some(n=>Cu(e.project,n))))}s(_d,"q$"),o(_d,"ruleMatches");var Id=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isObj"),yt=o(e=>typeof e=="string"&&e!==""?e:void 0,"str"),is=o(e=>Id(e.raw)?yt(e.raw.kind)??"":"","kindOf");function I3(e){let t=[...e].sort((l,d)=>(Number(l.timestamp)||0)-(Number(d.timestamp)||0)||(l.id<d.id?-1:1)),r=t.find(l=>is(l)==="flow-origin"),n=r??t.find(l=>yt(l.context?.originType));if(!n)return{};let u=Id(n.raw)?n.raw:{},i=yt(n.context?.originType)??(r?yt(n.title):void 0),a=yt(u.originNodeId)??yt(n.context?.originNodeId);return{...i?{type:i}:{},...a?{nodeId:a}:{}}}s(I3,"RT"),o(I3,"originOf");var U$=/^(verify|e2e|test|smoke|load)[-_:]/i,q$=o((e,t)=>U$.test(e)||t!==void 0&&/^(ui:)?(tools|scripts?|e2e)\//.test(t),"isTestFlow"),S3={"page-load":"page-load","user-click":"user-action","form-submit":"user-action","input-change":"user-action","double-click":"user-action","context-menu":"user-action","key-press":"user-action","route-load":"navigation","route-change":"navigation",navigation:"navigation","ai-turn":"ai",timer:"background",cron:"background",interval:"background",queue:"background",job:"background","websocket-message":"background","hmr-update":"system"},Z$=new Set(["page-load","user-action","navigation"]),L$=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ss(e){return e.replace(/[?#].*$/,"").split("/").map(t=>L$.test(t)||/^[0-9a-f]{16,}$/i.test(t)||/^\d{2,}$/.test(t)?":id":t).join("/")}s(ss,"zm"),o(ss,"templatePath");function F3(e){let t=/^ui:(?:.*\/)?([^/:]+?)(?:\.[a-z]+)?:\d+:([A-Za-z]+)$/.exec(e);return t?`${t[1]} \xB7 ${t[2]}`:e}s(F3,"OT"),o(F3,"componentOf");function j3(e){let t=e.replace(/[-_:][0-9a-f]{6,}(?:-[0-9a-f]+)*$/i,"");return t=t.replace(/[-_:](?=[a-z0-9]*\d)[a-z0-9]{6,}$/i,""),t=t.replace(/[-_:]\d+$/,""),t||e}s(j3,"zT"),o(j3,"scriptFamily");function z3(e,t,r,n){let u=t.nodeId,i=u?/^(page|route|ambient):(.*)$/.exec(u):null;if(i)return`${i[1]}:${ss(i[2])}`;if(t.type&&S3[t.type]==="user-action"&&u)return F3(u);if(e==="test")return j3(r.flowId);let a=r.segments.find(d=>d.kind==="request"&&d.route);if(a?.route)return`${a.method??"GET"} ${ss(a.route)}`;let l=n.find(d=>is(d)==="ai-call");return l&&Id(l.raw)?`ai \xB7 ${yt(l.raw.model)??yt(l.raw.provider)??"call"}`:u?ss(u):void 0}s(z3,"MT"),o(z3,"subjectOf");var J$=10,V$=1e3,W$=3,G$=500,K$=1e3;function N3(e,t){let r=new Set,n=t.segments.filter(i=>i.kind==="request");t.segments.some(i=>i.counts.errors>0)&&r.add("has-error"),n.some(i=>i.durationMs>=V$)&&r.add("slow"),n.length>=J$&&r.add("fan-out"),new Set(t.segments.flatMap(i=>i.projects)).size>=3&&r.add("multi-service"),e.some(i=>is(i)==="queue-enqueued")&&r.add("queue"),e.some(i=>is(i)==="ai-call"||i.source==="ai")&&r.add("ai"),t.stats.bookkeeping>=G$&&t.stats.bookkeeping*2>=t.stats.events&&r.add("storm"),t.stats.events>=K$&&r.add("large");let u=new Map;for(let i of n)(!i.part||i.part.index===1)&&u.set(i.label,(u.get(i.label)??0)+1);return[...u.values()].some(i=>i>=W$)&&r.add("repeated-requests"),[...r].sort()}s(N3,"LT"),o(N3,"tagsOf");function M3(e,t,r=[]){let n=I3(e),u={flowId:t.flowId,origin:n,segments:t.segments},i=N3(e,t),a=o((p,m,f)=>{let h=z3(p,n,t,e);return{category:p,decidedBy:m,...f!==void 0?{ruleIndex:f}:{},tags:i,origin:n,...h?{subject:h}:{}}},"done"),l=r.findIndex(p=>p.category&&_d(p,u));if(l!==-1)return a(r[l].category,"rule",l);if(q$(t.flowId,n.nodeId))return a("test","test");let d=n.type?S3[n.type]:void 0;if(d)return a(d,"origin");if(i.includes("ai"))return a("ai","shape");let c=t.segments.filter(p=>p.kind==="request");return c.length>0?a(c.every(p=>p.requestId?.startsWith("job:"))?"background":"api","shape"):t.segments.length>0&&t.segments.every(p=>p.kind==="ambient")?a("system","shape"):a("other","shape")}s(M3,"V$"),o(M3,"classifyFlow");function O3(e,t,r=[]){let n=r.find(u=>u.category&&(u.route!==void 0||u.project!==void 0)&&u.flowId===void 0&&u.origin===void 0&&u.originType===void 0&&_d(u,{flowId:e.flowId,origin:t.origin,segments:[e]}));return n?n.category:e.kind==="request"?e.requestId?.startsWith("job:")?"background":"api":e.kind==="ambient"?"system":e.kind==="origin"&&Z$.has(t.category)?t.category:"ui"}s(O3,"G$"),o(O3,"categoryOfSegment");function R3(e){return T3(e).map(t=>{let r=new Map;for(let u of t.items){let i=r.get(u.subject);i?i.push(u):r.set(u.subject,[u])}let n=[...r.entries()].sort((u,i)=>(u[0]===void 0?1:0)-(i[0]===void 0?1:0)||i[1].length-u[1].length||String(u[0]).localeCompare(String(i[0]))).map(([u,i])=>({subject:u,count:i.length,items:i}));return{...t,subjects:n}})}s(R3,"W$"),o(R3,"groupFlows");function T3(e){let t=new Map;for(let n of e){let u=t.get(n.category);u?u.push(n):t.set(n.category,[n])}let r=o(n=>{let u=rs.indexOf(n);return u===-1?rs.length:u},"rank");return[...t.entries()].sort((n,u)=>r(n[0])-r(u[0])||(n[0]<u[0]?-1:n[0]>u[0]?1:0)).map(([n,u])=>({category:n,count:u.length,items:u}))}s(T3,"FT"),o(T3,"groupByCategory");var bt={categories:[],segments:{},problems:[]},Sd=200,P3=200,U3=64,H$=/^[A-Za-z0-9][A-Za-z0-9 ._:/-]*$/,X$=["category","flowId","originType","origin","route","project"],Y$={phaseGapMs:[50,6e5],burstGapMs:[10,6e4],attachWindowMs:[0,6e4],maxSegmentEvents:[20,1e4],occurrenceSlackMs:[0,1e3]},Fd=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isObj");function q3(e,t){if(!Fd(e))return{problems:[`${t}: not an object`]};let r=[];for(let l of Object.keys(e))X$.includes(l)||r.push(`${t}: unknown field "${l}" ignored`);let n=e.category;if(typeof n!="string"||n.trim()==="")return{problems:[...r,`${t}: "category" must be a non-empty string \u2014 rule dropped`]};let u=n.trim();if(u.length>U3||!H$.test(u))return{problems:[...r,`${t}: category "${u.slice(0,40)}" is not a usable name (letters, digits, space . _ : / -; up to ${U3}) \u2014 rule dropped`]};let i={category:u},a=0;for(let l of["flowId","originType","origin","route","project"]){let d=e[l];if(d!==void 0){if(typeof d!="string"||d===""||d.length>P3)return{problems:[...r,`${t}: "${l}" must be a non-empty string of up to ${P3} characters \u2014 rule dropped`]};i[l]=d,a+=1}}return a===0?{problems:[...r,`${t}: "${u}" has no match field (flowId, originType, origin, route or project) \u2014 rule dropped`]}:{rule:i,problems:r}}s(q3,"VT"),o(q3,"parseRule");function Z3(e){if(e==null)return bt;if(!Fd(e))return{...bt,problems:["lensmcp.flows must be an object \u2014 ignored"]};let t=[],r=[],n=e.categories;n!==void 0&&(Array.isArray(n)?(n.length>Sd&&t.push(`flows.categories has ${n.length} rules; only the first ${Sd} are used`),n.slice(0,Sd).forEach((a,l)=>{let d=q3(a,`flows.categories[${l}]`);t.push(...d.problems),d.rule&&r.push(d.rule)})):t.push("flows.categories must be an array \u2014 ignored"));let u={},i=e.segments;if(i!==void 0)if(!Fd(i))t.push("flows.segments must be an object \u2014 ignored");else for(let[a,l]of Object.entries(i)){let d=Y$[a];if(!d){t.push(`flows.segments.${a}: unknown option ignored`);continue}if(typeof l!="number"||!Number.isFinite(l)||l<d[0]||l>d[1]){t.push(`flows.segments.${a}: ${JSON.stringify(l)} is outside ${d[0]}\u2013${d[1]}; using the default (${B4[a]})`);continue}u[a]=l}return{categories:r,segments:u,problems:t}}s(Z3,"H$"),o(Z3,"parseFlowsConfig");function as(e,t=bt){let r=S4(e,t.segments),n=M3(e,r,t.categories),u={};for(let i of r.segments)u[i.id]=O3(i,n,t.categories);return{segmentation:r,classification:n,segmentCategories:u}}s(as,"un"),o(as,"analyzeFlow");function jd(e,t={}){let r=t.threshold??5,n=[];for(let u of e){let i=u.raw??null;if(i?.kind!=="loop"||!i.loop)continue;let a=i.loop.dbCallsInsideLoop??0;a>r&&n.push({kind:"db-in-loop",severity:"warning",title:`${a} DB calls inside a loop (${i.loop.iterations??"?"} iterations)`,evidence:[u.id],details:{dbCallsInsideLoop:a,iterations:i.loop.iterations,durationMs:i.loop.durationMs,threshold:r},detectedAt:u.timestamp})}return n}s(jd,"Qs"),o(jd,"detectDbInLoop");function L3(e,t={}){let r=t.threshold??3,n=new Map;for(let i of e){let a=i.raw??null;if(a?.kind!=="db-query"||!a.query?.signature)continue;let l=a.query.signature,d=n.get(l);d||(d=[],n.set(l,d)),d.push(i)}let u=[];for(let[i,a]of n)a.length>=r&&u.push({kind:"n+1-query",severity:"warning",title:`Query repeated ${a.length}\xD7 \u2014 likely N+1`,evidence:a.map(l=>l.id),details:{signature:i,count:a.length,threshold:r},detectedAt:a[a.length-1].timestamp});return u}s(L3,"X$"),o(L3,"detectNPlusOne");function J3(e,t={}){let r=t.threshold??5,n=t.windowMs??250,u=new Map;for(let a of e){if(a.source!=="react")continue;let l=a.raw??null;if(l?.kind!=="render"||!l.render?.componentInstanceId)continue;let d=l.render.componentInstanceId,c=u.get(d);c||(c=[],u.set(d,c)),c.push(a)}let i=[];for(let[a,l]of u){l.sort((c,p)=>c.timestamp-p.timestamp);let d=0;for(let c=0;c<l.length;c++){for(;l[c].timestamp-l[d].timestamp>n;)d++;let p=c-d+1;if(p>r){let m=l.slice(d,c+1),f=m[0].raw.render?.componentName??a;i.push({kind:"render-storm",severity:"warning",title:`${f} rendered ${p}\xD7 in ${n}ms`,evidence:m.map(h=>h.id),details:{componentInstanceId:a,count:p,windowMs:n,threshold:r},detectedAt:m[m.length-1].timestamp});break}}}return i}s(J3,"Y$"),o(J3,"detectRenderStorm");function V3(e,t,r){let n=new Map,u=new Set;function i(l){let d=n.get(l);if(d)return d;if(u.has(l))return{path:[l],totalDurationMs:r(l)};u.add(l);let c=r(l),p=t.get(l)??[],m;for(let h of p){let g=i(h);(!m||g.totalDurationMs>m.totalDurationMs)&&(m=g)}u.delete(l);let f=m?{path:[l,...m.path],totalDurationMs:c+m.totalDurationMs}:{path:[l],totalDurationMs:c};return n.set(l,f),f}s(i,"i"),o(i,"best");let a={path:[],totalDurationMs:0};for(let l of e){let d=i(l);d.totalDurationMs>a.totalDurationMs&&(a=d)}return a}s(V3,"Q$"),o(V3,"findSlowPath");var W3={dbInLoop:5,nPlusOne:3,renderStorm:5,slowRouteMs:500,slowRenderMs:16,slowQueryMs:100,duplicateRequestPeak:3,slowEgressMs:1e3};function Ye(e){let t={...W3};if(e)for(let r of Object.keys(W3)){let n=e[r];typeof n=="number"&&Number.isFinite(n)&&n>=0&&(t[r]=n)}return t}s(Ye,"Ee"),o(Ye,"resolveThresholds");function G3(e){let t=e.raw??null,r=t?.kind,n=e.context,u={id:e.id,parentTraceNodeId:n.causedByNodeId??n.originNodeId,lifecycle:"completed",context:n,startTime:e.timestamp,attributes:{...t??{}}};if(e.source==="react"&&r==="render"){let i=t;return{parentAxis:"render",node:{...u,type:"render",logicalId:i.render?.componentLogicalId,instanceId:i.render?.componentInstanceId,name:`render ${i.render?.componentName??"?"}`,durationMs:i.render?.actualDurationMs}}}if(e.source==="valtio"&&r==="state-update"){let i=t;return{parentAxis:"state",node:{...u,type:"state-update",logicalId:i.update?.storeId,name:`${i.update?.storeId??"?"}.${i.update?.path??"?"}`}}}if(e.source==="nestjs"&&r==="server-request"){let i=t;return{parentAxis:"backend",node:{...u,type:"server-request",name:`${i.request?.method??"?"} ${i.request?.route??"?"}`,durationMs:i.request?.durationMs}}}if(r==="db-query"){let i=t,a=[i.op,i.table].filter(Boolean).join(" ")||(i.name??"query");return{parentAxis:"backend",node:{...u,type:"db-query",logicalId:i.table?`db:${i.op??"query"}:${i.table}`:void 0,name:i.error?`${a} (failed)`:a,durationMs:i.durationMs}}}if(r==="loop")return{parentAxis:"performance",node:{...u,type:"loop",name:"loop",durationMs:t.loop?.durationMs}};if(e.source==="client-runtime"&&r==="user-action"){let i=t;return{parentAxis:"caused",node:{...u,type:"ui-event",logicalId:i.origin?.nodeId,name:i.origin?.label??e.title}}}}s(G3,"GT"),o(G3,"eventToNode");function K3(e,t){let r=[...t].sort((l,d)=>l.timestamp-d.timestamp),n=[];for(let l of r){let d=G3(l);d&&(e.addNode(d.node),n.push(d))}let u=0,i=o((l,d,c,p)=>{let m={id:`${c}:${l}->${d}`,from:l,to:d,axis:c,type:p,timestamp:e.getNode(d)?.startTime??0};e.addEdge(m),u++},"addEdge");for(let l of n){let d=l.node.context.causedByNodeId;d&&e.getNode(d)&&i(d,l.node.id,l.parentAxis??"caused","caused-by")}let a=new Map;for(let l of n){let d=l.node.context.flowId;if(!d)continue;let c=a.get(d);c||(c=[],a.set(d,c)),c.push(l)}for(let l of a.values())for(let d=1;d<l.length;d++){let c=l[d-1].node,p=l[d].node;p.context.causedByNodeId!==c.id&&i(c.id,p.id,"caused","flow-sequence")}return{nodeCount:n.length,edgeCount:u}}s(K3,"t_"),o(K3,"buildGraphFromEvents");var H3=new WeakMap;function os(e){let t=H3.get(e);if(t!==void 0)return t;let r=Xe(e);return H3.set(e,r),r}s(os,"ln"),o(os,"estimateEventBytes");function X3(e,t={}){let r=t.rawByteLimit??32768,n=t.maxDepth??12,u=e.raw;if(u==null)return{event:e,truncated:!1,originalBytes:0,keptBytes:0};if(!xd(u,r,n)){let c=Xe(u,r,n);return{event:e,truncated:!1,originalBytes:c,keptBytes:c}}let i=Xe(u,Number.POSITIVE_INFINITY,64),a={budget:r,maxStringBytes:t.maxStringBytes??4096,maxArrayItems:t.maxArrayItems??64,paths:[],truncatedAnything:!1},l=Bu(u,a,n,""),d=Xe(l,Number.POSITIVE_INFINITY,n);if(a.truncatedAnything&&l!==null&&typeof l=="object"&&!Array.isArray(l)){let c={truncated:!0,originalBytes:i,keptBytes:d,paths:a.paths};l[Bd]=c}return{event:{...e,raw:l},truncated:a.truncatedAnything,originalBytes:i,keptBytes:d}}s(X3,"XT"),o(X3,"clampEventRaw");function zd(e={}){let t=0,r=0,n=0,u=e.rawByteLimit??32768;return{clamp(i){t+=1;let a=X3(i,e);return a.truncated&&(r+=1,n+=Math.max(0,a.originalBytes-a.keptBytes)),a.event},stats(){return{inspected:t,truncated:r,bytesReclaimed:n,rawByteLimit:u}},reset(){t=0,r=0,n=0}}}s(zd,"ea"),o(zd,"createEventClamp");var Q$={screenshot:50,"visual-crop":50,"visual-frame":200,"build-report":20,"heap-snapshot":3,"trace-with-errors":20,verification:10},e2=64*1024*1024,t2=32*1024*1024,u2=class{static{s(this,"ta")}static{o(this,"InMemoryRingBuffer")}constructor(e={}){this.events=[],this.eventBytes=[],this.residentEventBytes=0,this.ingested=0,this.dropped=0,this.droppedForBytes=0,this.artifactsByKind=new Map,this.artifactsById=new Map,this.artifactBytesById=new Map,this.artifactOrder=[],this.residentArtifactBytes=0,this.artifactsDropped=0,this.eventCap=e.eventCap??5e3,this.eventByteCap=e.eventByteCap??e2,this.artifactCaps={...Q$,...e.artifactCapacities},this.artifactByteCap=e.artifactByteCap??t2}appendEvent(e){let t=os(e);for(this.events.push(e),this.eventBytes.push(t),this.residentEventBytes+=t,this.ingested+=1,this.events.length>this.eventCap&&this.evictOldestEvents(this.events.length-this.eventCap);this.residentEventBytes>this.eventByteCap&&this.events.length>1;)this.evictOldestEvents(1),this.droppedForBytes+=1}evictOldestEvents(e){if(e<=0)return;let t=Math.min(e,this.events.length);for(let r=0;r<t;r++)this.residentEventBytes-=this.eventBytes[r]??0;this.events.splice(0,t),this.eventBytes.splice(0,t),this.dropped+=t,this.events.length===0&&(this.residentEventBytes=0)}recentEvents(e){return e===void 0||e>=this.events.length?[...this.events]:this.events.slice(this.events.length-e)}totalEventsIngested(){return this.ingested}totalEventsDropped(){return this.dropped}putArtifact(e){let t=this.artifactCaps[e.kind]??0;if(t<=0)return;let r=this.artifactsByKind.get(e.kind);r||(r=[],this.artifactsByKind.set(e.kind,r)),this.artifactsById.has(e.id)&&this.removeArtifact(e.id);let n=Xe(e.data);for(r.push(e),this.artifactsById.set(e.id,e),this.artifactBytesById.set(e.id,n),this.artifactOrder.push(e.id),this.residentArtifactBytes+=n;r.length>t;){let u=r.shift();u&&(this.forgetArtifact(u.id),this.artifactsDropped+=1)}for(;this.residentArtifactBytes>this.artifactByteCap&&this.artifactOrder.length>1;){let u=this.artifactOrder[0];if(u===void 0)break;this.removeArtifact(u),this.artifactsDropped+=1}}removeArtifact(e){let t=this.artifactsById.get(e);if(t){let r=this.artifactsByKind.get(t.kind);if(r){let n=r.indexOf(t);n!==-1&&r.splice(n,1)}}this.forgetArtifact(e)}forgetArtifact(e){this.artifactsById.delete(e),this.residentArtifactBytes-=this.artifactBytesById.get(e)??0,this.artifactBytesById.delete(e);let t=this.artifactOrder.indexOf(e);t!==-1&&this.artifactOrder.splice(t,1),this.artifactsById.size===0&&(this.residentArtifactBytes=0)}getArtifact(e){return this.artifactsById.get(e)}listArtifacts(e){return[...this.artifactsByKind.get(e)??[]]}approximateSizeBytes(){return this.residentEventBytes+this.residentArtifactBytes}stats(){let e={};for(let[t,r]of this.artifactsByKind)r.length>0&&(e[t]=r.length);return{events:{resident:this.events.length,residentBytes:this.residentEventBytes,ingested:this.ingested,dropped:this.dropped,droppedForBytes:this.droppedForBytes,cap:this.eventCap,byteCap:this.eventByteCap},artifacts:{resident:this.artifactsById.size,residentBytes:this.residentArtifactBytes,dropped:this.artifactsDropped,byteCap:this.artifactByteCap,byKind:e}}}},r2=class{static{s(this,"ra")}static{o(this,"Session")}constructor(e={}){this.state="idle",this.hooks=[],this.reducerRetention=new Map,this.id=e.sessionId??lt(),this.storage=e.storage??new u2,this.clamp=e.clamp===!1?void 0:zd(e.clamp??{}),this.redactor=e.redact===!1?void 0:ga(e.redact??{});let t=[this.clamp?.clamp,this.redactor?.redact].filter(r=>r!==void 0);this.bus=new h4({capacity:e.eventBusCapacity,...t.length?{transform:o(r=>t.reduce((n,u)=>u(n),r),"transform")}:{}}),this.graph=new E4,this.resources=new b4,this.reducers=new c5,this.bus.subscribe(r=>{this.storage.appendEvent(r),this.reducers.dispatch(r)})}get lifecycle(){return this.state}storageStats(){let e=Object.fromEntries([...this.reducerRetention].map(([t,r])=>[t,r()]));return{...this.storage.stats?{storage:this.storage.stats()}:{},...this.clamp?{clamp:this.clamp.stats()}:{},...Object.keys(e).length>0?{reducers:e}:{}}}registerReducerRetention(e,t){this.reducerRetention.set(e,t)}start(){this.state==="idle"&&(this.state="active")}onShutdown(e){this.hooks.push(e)}async stop(){if(!(this.state==="closed"||this.state==="stopping")){this.state="stopping";for(let e=this.hooks.length-1;e>=0;e--){let t=this.hooks[e];try{let r=t.stop();r&&typeof r.then=="function"&&await r}catch{}}this.state="closed"}}};import{AsyncProvider as Gr,ProviderScope as Kr}from"@frontmcp/sdk";var Nd;function Y3(e){Nd=e}s(Y3,"n_"),o(Y3,"setActiveSession");function Au(){if(!Nd)throw new Error("No LensMCP session is active. Did you call bootstrapLensmcp() before the FrontMCP container started?");return Nd}s(Au,"$o"),o(Au,"requireSession");var n2=Gr({provide:Jr,name:"LensmcpSession",description:"The active LensMCP Session instance.",scope:Kr.GLOBAL,inject:o(()=>[],"inject"),useFactory:o(()=>Au(),"useFactory")}),i2=Gr({provide:Vr,name:"LensmcpEventBus",description:"The session's normalised event bus.",scope:Kr.GLOBAL,inject:o(()=>[],"inject"),useFactory:o(()=>Au().bus,"useFactory")}),s2=Gr({provide:x$,name:"LensmcpGraphStore",description:"The typed multi-axis trace graph.",scope:Kr.GLOBAL,inject:o(()=>[],"inject"),useFactory:o(()=>Au().graph,"useFactory")}),a2=Gr({provide:Z,name:"LensmcpResourceStore",description:"Registry of agent-readable MCP resources.",scope:Kr.GLOBAL,inject:o(()=>[],"inject"),useFactory:o(()=>Au().resources,"useFactory")}),o2=Gr({provide:k$,name:"LensmcpStorage",description:"Hot-tier storage backend (in-memory ring buffer by default).",scope:Kr.GLOBAL,inject:o(()=>[],"inject"),useFactory:o(()=>Au().storage,"useFactory")}),l2=[n2,i2,s2,a2,o2];function Q3(e={}){let t=new r2(e);return t.start(),Y3(t),{session:t,providers:l2}}s(Q3,"i_"),o(Q3,"bootstrapLensmcp");var IS=new RegExp("\x1B\\[[0-9;]*[A-Za-z]","g"),SS=["ai/agents/hazard-analyst/src/hazard-analyst.agent.ts(52,12): error TS2416: Property 'outputSchema' in type 'HazardAnalystAgent' is not assignable to the same property in base type 'BaseAgent<HazardInput, HazardOutput>'.","server/apps/haccp/src/modules/plan/plan.service.ts(118,7): error TS2322: Type 'string' is not assignable to type 'PlanStatus'.","web/libs/ui/src/report/report-renderer.tsx(9,3): warning TS6133: {0} is declared but its value is never read."].join(`
66
+ `);import{createSocket as d2}from"node:dgram";import{closeSync as c2,existsSync as ey,openSync as p2,readSync as m2,statSync as ty}from"node:fs";import{createServer as f2}from"node:net";import{existsSync as uy,unlinkSync as ry}from"node:fs";var h2=1024*1024;function ny(e){let t=e.onError??(()=>{});try{uy(e.path)&&ry(e.path)}catch{}let r=new Set,n=e.maxFrameBytes??h2,u=f2(i=>{r.add(i);let a="";i.setEncoding("utf8"),i.on("data",l=>{a+=l;let d;for(;(d=a.indexOf(`
67
+ `))!==-1;){let c=a.slice(0,d);a=a.slice(d+1),c&&e.onMessage(c)}a.length>n&&(t(new Error(`uds: frame exceeded ${n} bytes without a newline \u2014 connection dropped`)),a="",i.destroy())}),i.on("error",l=>t(l)),i.on("close",()=>r.delete(i))});return u.on("error",i=>t(i)),u.listen(e.path,()=>e.onListening?.()),u.unref(),{close:o(()=>new Promise(i=>{for(let a of r)try{a.destroy()}catch{}r.clear();try{u.close(()=>{try{uy(e.path)&&ry(e.path)}catch{}i()})}catch{i()}}),"close")}}s(ny,"Um"),o(ny,"createUdsServer");function iy(e){let t=e.eventFile??process.env.LENSMCP_EVENT_FILE,r=e.socketPath??process.env.LENSMCP_IPC_SOCKET,n=e.udsPath??process.env.LENSMCP_UDS,u=e.onError??(()=>{}),i=0,a=o(f=>{let h=f.trim();if(!h)return;let g;try{g=JSON.parse(h)}catch{return}if(!(!g||typeof g!="object"||!("id"in g)||!("source"in g)))try{e.sessionId&&g.sessionId==="pending"&&(g.sessionId=e.sessionId,g.context&&g.context.sessionId==="pending"&&(g.context.sessionId=e.sessionId)),e.bus.publish(g),i+=1}catch(b){u(b)}},"publish"),l=[],d=!1,c=!1,p=!1;if(t){d=!0;let f=0,h="",g=!1,b=e.replayBytes??Number(process.env.LENSMCP_REPLAY_BYTES??4*1024*1024);if(ey(t))try{let w=ty(t).size;Number.isFinite(b)&&b>0&&w>0?(f=Math.max(0,w-b),g=f>0):f=w}catch{f=0}let x=Buffer.alloc(64*1024),$=setInterval(o(()=>{if(!ey(t))return;let w;try{w=ty(t).size}catch{return}for(w<f&&(f=0,h="");f<w;){let C;try{C=p2(t,"r")}catch(k){u(k);return}try{let k=Math.min(x.length,w-f),M=m2(C,x,0,k,f);if(M<=0)break;f+=M,h+=x.toString("utf8",0,M);let y;for(;(y=h.indexOf(`
68
+ `))!==-1;){let D=h.slice(0,y);if(h=h.slice(y+1),g){g=!1;continue}a(D)}}finally{c2(C)}}},"drain"),e.pollMs??50);$.unref?.(),l.push(()=>clearInterval($))}if(r){let[f,h]=r.split(":"),g=Number(h);if(f&&Number.isFinite(g)){c=!0;let b;try{b=d2("udp4"),b.on("message",x=>a(x.toString("utf8"))),b.on("error",x=>u(x)),b.bind(g,f),b.unref()}catch(x){u(x),c=!1}if(b){let x=b;l.push(()=>new Promise($=>{try{x.close(()=>$())}catch{$()}}))}}}if(n)try{let f=ny({path:n,onMessage:o(h=>a(h),"onMessage"),onError:u});p=!0,l.push(()=>f.close())}catch(f){u(f)}let m=[];return d&&m.push("file"),c&&m.push("udp"),p&&m.push("uds"),{mode:m.join("+")||"none",count:o(()=>i,"count"),async stop(){for(let f of l)try{await f()}catch{}}}}s(iy,"Lm"),o(iy,"startEventIngest");import{existsSync as g2,readFileSync as sy}from"node:fs";import{dirname as v2,join as y2}from"node:path";function ay(e=process.cwd()){let t=Md("nx.json",e);if(!t)return Ye();try{let r=JSON.parse(sy(t,"utf8"));return Ye(r.lensmcp?.thresholds)}catch{return Ye()}}s(ay,"Fm"),o(ay,"loadWorkspaceThresholds");function oy(e=process.cwd()){let t=Md("nx.json",e);if(!t)return bt;try{let r=JSON.parse(sy(t,"utf8"));return Z3(r.lensmcp?.flows)}catch(r){return{...bt,problems:[`${t} could not be read as JSON (${r instanceof Error?r.message:String(r)}) \u2014 flow config ignored`]}}}s(oy,"Bm"),o(oy,"loadWorkspaceFlowsConfig");function Md(e,t){let r=t;for(let n=0;n<8;n++){let u=y2(r,e);if(g2(u))return u;let i=v2(r);if(i===r)break;r=i}}s(Md,"d_"),o(Md,"findUp");function F(e,t,r,n){var u=arguments.length,i=u<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(i=(u<3?a(i):u>3?a(t,r,i):a(t,r))||i);return u>3&&i&&Object.defineProperty(t,r,i),i}s(F,"x"),o(F,"__decorate");import{App as b2}from"@frontmcp/sdk";import{Resource as E2,ResourceContext as w2}from"@frontmcp/sdk";import{existsSync as D2,readFileSync as $2}from"node:fs";import{dirname as B2,join as x2}from"node:path";var Le="perf://rules",Lt="pod/heap-budget",Jt="pod/retained-generation",ly=512,dy=.9,k2=64,C2=16,A2=16,cy=256,py=1024*1024,_2="LENSMCP_PERF_RULES",I2="LENSMCP_POD_HEAP_BUDGET_MB",S2={heapBudgetEnabled:!0,retainedEnabled:!0,budgetMb:ly,services:{}},F2=/^(0|off|false|no)$/i,Od=o(e=>{let t=typeof e=="string"&&e.trim()!==""?Number(e):e;return typeof t=="number"&&Number.isFinite(t)&&t>=16&&t<=1e6?t:void 0},"budget");function ls(e,t){let r=t&&typeof t=="object"&&!Array.isArray(t)?t:{},n=r[Lt]&&typeof r[Lt]=="object"?r[Lt]:{},u=r[Jt]&&typeof r[Jt]=="object"?r[Jt]:{},i=F2.test((e[_2]??"").trim())||r.enabled===!1,a={};if(n.services&&typeof n.services=="object"&&!Array.isArray(n.services))for(let[l,d]of Object.entries(n.services)){let c=Od(d);c!==void 0&&(a[l]=c)}return{heapBudgetEnabled:!i&&n.enabled!==!1,retainedEnabled:!i&&u.enabled!==!1,budgetMb:Od(e[I2])??Od(n.budgetMb)??ly,services:a}}s(ls,"na"),o(ls,"resolvePodRuleThresholds");function my(e=process.cwd(),t=process.env){let r=e;for(let n=0;n<8;n++){let u=x2(r,".lensmcp","config.json");if(D2(u))try{let a=JSON.parse($2(u,"utf8"));return ls(t,a?.perfRules)}catch{return ls(t,void 0)}let i=B2(r);if(i===r)break;r=i}return ls(t,void 0)}s(my,"Gm"),o(my,"loadPodRuleThresholds");var Hr=o((e,t,r)=>`${e}\0${t}\0${r}`,"key"),Je=o(e=>Math.round(e/py),"mb"),Rd=0,j2=o(()=>(Rd=(Rd+1)%65535,`perf-${Date.now().toString(36)}${Rd.toString(36)}${Math.random().toString(36).slice(2,7)}`),"eventId"),z2=class{static{s(this,"ko")}static{o(this,"PerfRuleBook")}constructor(e={}){this.options=e,this.findings=new Map,this.pods=new Map,this.heard=!1,this.thresholds=e.thresholds??S2,this.now=e.now??Date.now}ingest(e){return e.source==="perf"?this.ingestRule(e):e.source==="memory"?this.ingestPod(e):!1}ingestRule(e){let t=D3(e.raw);if(!t||t.rule.startsWith("pod/"))return!1;let r=!this.heard;if(this.heard=!0,t.kind==="perf-rule-scan"){let i=!1,a=new Set(t.open);for(let[l,d]of this.findings)d.rule===t.rule&&d.project===t.project&&!a.has(d.subject)&&(this.findings.delete(l),i=!0);return i||r}let n=Hr(t.rule,t.project,t.subject);if(t.kind==="perf-rule-retracted")return this.findings.delete(n)||r;let u=this.findings.get(n);return this.findings.set(n,{rule:t.rule,project:t.project,subject:t.subject,severity:t.severity,title:t.title,summary:t.summary,evidence:t.evidence,cost:t.cost,fix:t.fix,verify:t.verify,docs:t.docs,firstSeenAt:u?.firstSeenAt??e.timestamp,lastSeenAt:Math.max(e.timestamp,u?.lastSeenAt??0)}),this.bound(),!0}projectPods(e,t,r){let n=this.pods.get(e);if(!n&&(n={service:t,lastSeenAt:r,readings:new Map,retained:new Map},this.pods.set(e,n),this.pods.size>k2)){let u=[...this.pods.entries()].sort((i,a)=>i[1].lastSeenAt-a[1].lastSeenAt)[0];u&&u[0]!==e&&(this.pods.delete(u[0]),this.close(Hr(Lt,u[0],u[1].service),"evicted",r),this.close(Hr(Jt,u[0],u[1].service),"evicted",r))}return n.service=t||n.service,n.lastSeenAt=Math.max(n.lastSeenAt,r),n}ingestPod(e){let t=es(e.raw);if(!t)return!1;let r=e.timestamp,n=this.projectPods(t.project,t.service||t.project,r),u=`${t.pod}:${t.pid}`;if(t.kind==="pod-memory"){if(t.previousAlive!==!0&&n.readings.set(u,this.reading(t,r)),t.trigger==="boot"){for(let d of[...n.readings.keys()])d.startsWith(`${t.pod}:`)&&d!==u&&n.readings.delete(d);for(let d of[...n.retained.keys()])d.startsWith(`${t.pod}:`)&&!d.startsWith(`${u}:`)&&n.retained.delete(d)}if(n.readings.size>C2){let d=[...n.readings.entries()].sort((c,p)=>c[1].at-p[1].at)[0];d&&n.readings.delete(d[0])}}else if(t.kind==="pod-memory-retained"){n.retained.set(`${u}:${t.gen}`,this.retainedOf(t,r));let d=[...n.retained.keys()].filter(c=>c.startsWith(`${u}:`));d.length>A2&&n.retained.delete(d[0])}else if(t.kind==="pod-memory-released")n.retained.delete(`${u}:${t.gen}`);else if(t.kind==="pod-memory-exited"){n.readings.delete(u);for(let d of[...n.retained.keys()])d.startsWith(`${u}:`)&&n.retained.delete(d)}let i=!this.heard;this.heard=!0;let a=this.evaluateHeap(t.project,n,r),l=this.evaluateRetained(t.project,n,r);return a||l||i}reading(e,t){return{pod:e.pod,pid:e.pid,service:e.service||e.project,at:e.at??t,trigger:e.trigger,gen:e.gen,swaps:e.swaps,live:e.live,reserved:e.reserved,rss:e.rss,...e.baseline!==void 0?{baseline:e.baseline}:{}}}retainedOf(e,t){return{pod:e.pod,pid:e.pid,gen:e.gen,at:t,ageMs:e.ageMs,swapsSinceClose:e.swapsSinceClose,gcs:e.gcs,alive:Array.isArray(e.alive)?e.alive.slice(0,8):[],...e.counts?{counts:e.counts}:{},live:e.live}}budgetFor(e,t){return this.thresholds.services[t]??this.thresholds.services[e]??this.thresholds.budgetMb}related(e){return[...this.findings.values()].filter(t=>t.project===e&&!t.rule.startsWith("pod/")).map(t=>`${t.rule}: ${t.title}`)}evaluateHeap(e,t,r){let n=t.service,u=Hr(Lt,e,n),i=this.findings.get(u);if(!this.thresholds.heapBudgetEnabled)return i?this.close(u,"disabled",r):!1;let a=this.budgetFor(e,t.service),l=a*py,d=[...t.readings.values()].sort((g,b)=>b.live-g.live),c=d.filter(g=>g.live>l),p=d.some(g=>g.live>l*dy);if(c.length===0&&!(i&&p))return i?this.close(u,d.length?"cleared":"pod-exited",r):!1;if(c.length===0)return!1;let m=c[0],f=c.reduce((g,b)=>g+(b.live-l),0),h={rule:Lt,project:e,subject:n,severity:m.live>=2*l?"error":"warning",title:`${t.service}: ${Je(m.live)} MB live heap after a full GC \u2014 over its ${a} MB budget${c.length>1?` (${c.length} pods)`:""}`,summary:`Pod #${m.pod} of ${t.service} holds ${Je(m.live)} MB of live objects right after a full GC (${Je(m.reserved)} MB reserved, rss ${Je(m.rss)} MB${m.baseline!==void 0?`; ${Je(m.baseline)} MB at boot`:""}, generation ${m.gen} after ${m.swaps} swap${m.swaps===1?"":"s"}). That is not garbage: it is what the app keeps, in every pod of the service.`,evidence:{budgetMb:a,pods:c.map(g=>({pod:g.pod,pid:g.pid,liveMb:Je(g.live),reservedMb:Je(g.reserved),rssMb:Je(g.rss),...g.baseline!==void 0?{baselineMb:Je(g.baseline)}:{},gen:g.gen,swaps:g.swaps,trigger:g.trigger,at:g.at})),related:this.related(e)},cost:{bytes:f,memoryMb:Je(f),basis:`live heap after a full GC above the ${a} MB budget, summed over the pods over it`},fix:[`See what the heap is made of: \`memory.explain_pod({ service: '${t.service}' })\`, then \`lensmcp mem ${t.service} --snapshot --analyze\` \u2014 read "bytes by package/module" and the largest retainers.`,`If one shared library dominates (FoodGuard: ~300 MB of zod schemas per pod from a contracts barrel), import it by subpath \u2014 see any bundle/heavy-barrel-import finding for ${e} \u2014 and build large schema catalogs lazily (a function that builds on first use), not at module load.`,"If the bundle text dominates (eval strings, source maps), keep the default `eval` devtool and no `--enable-source-maps` (LENSMCP_DEV_DEVTOOL unset).",`If the heap grows with each swap or request, it is retention, not size: look for module-level caches, registries and listeners that outlive a request (\`memory.explain_leak\`). A service that genuinely needs more raises its budget: \`.lensmcp/config.json\` perfRules["pod/heap-budget"].services["${t.service}"].`],verify:`After the change rebuilds and the pod swaps, its next post-GC report (\`memory.pods\`) shows live heap under ${Math.round(a*dy)} MB and LensMCP retracts this finding (\`observe_current_status\` no longer lists pod/heap-budget for ${t.service}).`,docs:E3[Lt],firstSeenAt:i?.firstSeenAt??r,lastSeenAt:r};return this.open(u,h,i)}evaluateRetained(e,t,r){let n=t.service,u=Hr(Jt,e,n),i=this.findings.get(u),a=[...t.retained.values()].sort((p,m)=>m.ageMs-p.ageMs);if(!this.thresholds.retainedEnabled||a.length===0)return i?this.close(u,this.thresholds.retainedEnabled?"released":"disabled",r):!1;let l=a[0],d=Math.max(1,Math.round(l.ageMs/6e4)),c={rule:Jt,project:e,subject:n,severity:"warning",title:`${t.service}: ${a.length===1?`generation ${l.gen} is`:`${a.length} closed generations are`} still in memory ${d} min after the hot swap that closed ${a.length===1?"it":"them"}`,summary:`Pod #${l.pod} closed generation ${l.gen} ${d} min ago, ${l.swapsSinceClose} swap(s) and ${l.gcs} full GC(s) since, and ${l.alive.join(", ")||"its objects"} ${l.alive.length===1?"is":"are"} still alive: something still points into the old app \u2014 a whole copy of it stays resident with every swap that leaks.`,evidence:{generations:a.slice(0,8).map(p=>({pod:p.pod,pid:p.pid,gen:p.gen,ageMs:p.ageMs,swapsSinceClose:p.swapsSinceClose,gcs:p.gcs,alive:p.alive,...p.counts?{counts:p.counts}:{},liveMb:Je(p.live)}))},cost:{basis:"one copy of the app per retained generation; its size is in the heap snapshot (`lensmcp mem --snapshot --analyze`)"},fix:[`Find what holds it: \`lensmcp mem ${t.service} --snapshot --analyze\` prints the shortest path from the GC roots to generation ${l.gen} \u2014 the first frame outside your app's own objects is the culprit.`,"Usual culprits: a timer or interval never cleared on shutdown; a BullMQ worker, queue event or Redis client never closed in onModuleDestroy / onApplicationShutdown; `process.on(\u2026)` / an EventEmitter listener added per app instance; a module-level registry, cache or singleton keyed by class or holding app instances.","Release it in the app's shutdown hooks (Nest calls them on every hot swap), or move the module-level state into a provider the container owns."],verify:'Save a file to swap again; within ~5 min the pod reports "generation N freed" (`memory.pods`), LensMCP retracts this finding, and `memory://leaks/suspected` no longer lists the generation.',docs:E3[Jt],firstSeenAt:i?.firstSeenAt??r,lastSeenAt:r};return this.open(u,c,i)}open(e,t,r){return this.findings.set(e,t),this.bound(),(!r||r.title!==t.title||r.severity!==t.severity)&&this.emit(t,"finding"),!0}close(e,t,r){let n=this.findings.get(e);return n?(this.findings.delete(e),this.emit({...n,lastSeenAt:r},"retracted",t),!0):!1}emit(e,t,r){let n=this.options.publish;if(!n)return;let u=this.options.sessionId??"pending",i=this.now(),a={id:j2(),sessionId:u,timestamp:i,source:"perf",category:"performance",severity:t==="finding"?e.severity:"info",context:{sessionId:u,projectName:e.project},fingerprint:w3(e.rule,e.project,e.subject),title:t==="finding"?`${e.rule}: ${e.title}`:`${e.rule}: cleared for ${e.project} (${e.subject})`,raw:t==="finding"?{kind:"perf-rule-finding",rule:e.rule,project:e.project,subject:e.subject,severity:e.severity,title:e.title,summary:e.summary,evidence:e.evidence,cost:e.cost,fix:e.fix,verify:e.verify,docs:e.docs,detectedAt:i}:{kind:"perf-rule-retracted",rule:e.rule,project:e.project,subject:e.subject,reason:r??"cleared",at:i}};queueMicrotask(()=>{try{n(a)}catch{}})}bound(){if(this.findings.size<=cy)return;let e=[...this.findings.entries()].sort((t,r)=>t[1].lastSeenAt-r[1].lastSeenAt).slice(0,this.findings.size-cy);for(let[t]of e)this.findings.delete(t)}openFindings(){return[...this.findings.values()].sort((e,t)=>e.severity===t.severity?t.lastSeenAt-e.lastSeenAt:e.severity==="error"?-1:1)}report(e){let t=this.openFindings(),r={};for(let n of t)r[n.rule]=(r[n.rule]??0)+1;return{schemaVersion:1,revision:e,updatedAt:new Date(this.now()).toISOString(),producer:this.heard?"connected":"none",detail:this.heard?t.length?`${t.length} open performance finding${t.length===1?"":"s"}: ${Object.entries(r).map(([n,u])=>`${u} ${n}`).join(", ")}`:"no open performance findings":"no performance rule has reported yet \u2014 rules run after a dev-cluster compilation (bundle/*) and on pod memory reports (pod/*); start the gateway",findings:t,counts:r}}};function fy(e,t=700){let r=e.fix.map((n,u)=>`${u+1}) ${n}`).join(" ");return r.length>t?`${r.slice(0,t-40).trimEnd()}\u2026 (all steps: ${Le})`:r}s(fy,"Wm"),o(fy,"compactFix");var hy=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0,"asRecord"),gy=o(e=>Array.isArray(e)?e.length:void 0,"arrayLen"),Et=o(e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,"asCount"),Te=o(e=>typeof e=="string"?e:void 0,"asString");function pe(e,...t){for(let r of t){let n=gy(e[r])??Et(e[r]);if(n!==void 0)return n}}s(pe,"he"),o(pe,"countOf");var me=o((e,t,r=`${t}s`)=>`${e} ${e===1?t:r}`,"plural");function ds(e,t,r,n,u){if(t>0)return{state:"failed",count:t,detail:`${me(t,`${n} error`)} \u2014 read ${u}`};if(r>0)return{state:"warning",count:r,detail:me(r,`${n} warning`)};let i=Te(e.status);return i==="clean"||i==="passed"?{state:"passed",count:0,detail:`${n} clean`}:{state:"unknown",detail:`${n} has not reported a result yet (status=${i??"absent"})`}}s(ds,"Jm"),o(ds,"fromStatusField");var cs=[{kind:"typecheck",resource:"typecheck://current",reads:o(()=>["typecheck://errors"],"reads"),blocking:!0,source:"typescript",read:o(e=>ds(e,pe(e,"errorCount","errors")??0,0,"typecheck","typecheck://errors"),"read")},{kind:"lint",resource:"lint://current",reads:o(e=>e==="warning"?["lint://warnings"]:["lint://errors"],"reads"),blocking:!0,source:"eslint",read:o(e=>ds(e,pe(e,"errorCount","errors")??0,pe(e,"warningCount","warnings")??0,"lint","lint://errors"),"read")},{kind:"build",resource:"build://current",reads:o(e=>e==="warning"?["build://current"]:["build://failures"],"reads"),blocking:!0,source:"vite",read:o(e=>{let t=Array.isArray(e.failures)?e.failures.filter(u=>{let i=u?.domain;return i!=="typecheck"&&i!=="lint"}).length:pe(e,"failures","failureCount")??0,r=(gy(e.failures)??t)-t,n=t===0&&r>0&&Te(e.status)==="failing"?{...e,status:"clean"}:e;return ds(n,t,pe(e,"warnings","warningCount")??0,"build","build://failures")},"read")},{kind:"runtime",resource:"runtime://browser/errors",reads:o(()=>["runtime://browser/errors","runtime://browser/failed-requests"],"reads"),blocking:!0,source:"client-runtime",read:o(e=>{let t=pe(e,"count","entries")??0;return t>0?{state:"failed",count:t,detail:`${me(t,"browser runtime error")} \u2014 read runtime://browser/errors`}:{state:"unknown",count:0,detail:"no browser runtime errors recorded (a browser may never have connected)"}},"read")},{kind:"runtime",resource:"runtime://errors",reads:o(()=>["runtime://errors"],"reads"),blocking:!0,source:"nestjs",read:o(e=>{let t=pe(e,"count","entries")??0,r=Array.isArray(e.entries)?e.entries.filter(u=>u?.outcome==="declared").length:0,n=r>0?` (${t-r} unhandled, ${r} a 5xx the app answered on purpose)`:"";return t>0?{state:"failed",count:t,detail:`${me(t,"server-side error")}${n} \u2014 read runtime://errors (route, status, request id and stack)`}:{state:"unknown",count:0,detail:"no server-side errors recorded (no pod may have handled a request yet)"}},"read")},{kind:"cluster",resource:"process://cluster",reads:o(()=>["process://cluster"],"reads"),blocking:!0,source:"gateway",read:o(e=>{if((pe(e,"services")??0)===0)return{state:"unknown",detail:"no cluster lifecycle events seen (the gateway may not be running)"};let t=pe(e,"crashLooping")??0,r=pe(e,"wedged")??0,n=pe(e,"buildFailed")??0,u=pe(e,"typeErrors")??0,i=u>0?`${me(u,"service")} with type errors no typecheck producer reports`:void 0,a=pe(e,"down")??0,l=Et(e.restarts)??0,d=Array.isArray(e.services)?e.services.filter(b=>{let x=b??{};return x.buildFailed===!0&&x.state==="up"}).length:0,c=Math.max(0,n-d),p=Array.isArray(e.incidents)?e.incidents:[],m=p.length>0?`${me(p.length,"request")} the gateway answered itself in the last 15 min (${[...new Set(p.map(b=>`${String(b.project)} ${b.kind==="pod-evicted"?"pod evicted":"request given up"} \u2192 ${String(b.status)}`))].join("; ")}) \u2014 read process://cluster \`incidents\`, or observe.errors kind cluster`:void 0,f=d>0?`${me(d,"service")} failing to build while still serving the last good bundle`:void 0,h=[f,i?`${i} (still serving)`:void 0].filter(Boolean);if(t>0||r>0||c>0){let b=[t>0?`${me(t,"service")} crash-looping`:void 0,r>0?`${me(r,"service")} wedged`:void 0,c>0?`${me(c,"service")} failing to build`:void 0].filter(Boolean);return{state:"failed",count:t+r+n+u,detail:`${b.join(", ")} \u2014 read process://cluster (requests to them 502)${h.length?`; ${h.join("; ")}`:""}`}}if(f)return{state:"failed",count:n+u,detail:`${f} \u2014 read process://cluster for the error lines${i?`; ${i} (still serving)`:""}`};if(i)return{state:"failed",count:u,detail:`${i} \u2014 read process://cluster for the lines (the bundle built; the services still serve)`};if(m)return{state:"warning",count:p.length+a,detail:`${m}${a>0?`; ${me(a,"service")} down (idle scale-to-zero is normal)`:""}`};if(a>0)return{state:"warning",count:a,detail:`${me(a,"service")} down (idle scale-to-zero is normal; the next request restarts it)`};let g=pe(e,"up")??0;return{state:"passed",count:0,detail:`${me(g,"service")} up${l>0?`, ${me(l,"restart")} this session`:""}`}},"read")},{kind:"memory",resource:"memory://leaks/suspected",reads:o(()=>["memory://leaks/suspected","memory://owners/growing"],"reads"),blocking:!1,source:"memory",read:o(e=>{let t=pe(e,"suspected","leaks")??0;return t>0?{state:"warning",count:t,detail:`${me(t,"suspected leak")} \u2014 read memory://leaks/suspected`}:{state:"passed",count:0,detail:"no suspected leaks"}},"read")},{kind:"visual",resource:"visual://violations/current",reads:o(()=>["visual://violations/current"],"reads"),blocking:!1,source:"visual",read:o(e=>{let t=pe(e,"violations")??0;return t>0?{state:"warning",count:t,detail:`${me(t,"visual violation")} \u2014 read visual://violations/current`}:{state:"passed",count:0,detail:"no visual violations"}},"read")},{kind:"perf",resource:"perf://slow-routes",reads:o(()=>["perf://slow-routes"],"reads"),blocking:!1,source:"perf",read:o(e=>{let t=pe(e,"routes")??0,r=Et(e.thresholdMs);return t>0?{state:"warning",count:t,detail:`${me(t,"route")} over${r?` ${r}ms`:" the slow-route threshold"} \u2014 read perf://slow-routes`}:{state:"passed",count:0,detail:"no slow routes"}},"read")},{kind:"duplicate-requests",resource:"perf://duplicate-requests",reads:o(()=>["perf://duplicate-requests"],"reads"),blocking:!1,source:"perf",read:o(e=>{let t=pe(e,"endpoints")??0,r=Et(e.peakThreshold);return t>0?{state:"warning",count:t,detail:`${me(t,"endpoint")} called ${r?`\u2265${r}\xD7`:"several times"} concurrently by one page \u2014 read perf://duplicate-requests`}:{state:"passed",count:0,detail:"no duplicated requests"}},"read")},{kind:"db",resource:"db://slow-queries",reads:o(()=>["db://slow-queries","db://analysis"],"reads"),blocking:!1,source:"db",read:o(e=>{let t=pe(e,"queries")??0,r=Et(e.thresholdMs);return t>0?{state:"warning",count:t,detail:`${me(t,"query shape")} over${r?` ${r}ms`:" the slow-query threshold"} \u2014 read db://slow-queries`}:{state:"passed",count:0,detail:"no slow query shapes"}},"read")},{kind:"egress",resource:"net://egress/hosts",reads:o(e=>e==="warning"?["net://egress/hosts","net://egress/failures"]:["net://egress/hosts"],"reads"),blocking:!1,source:"external",read:o(e=>{let t=pe(e,"failingHosts")??0,r=pe(e,"slowHosts")??0,n=Et(e.thresholdMs);return t>0?{state:"warning",count:t,detail:`${me(t,"external host")} failing \u2014 read net://egress/failures`}:r>0?{state:"warning",count:r,detail:`${me(r,"external host")} over${n?` ${n}ms`:" the slow-egress threshold"} \u2014 read net://egress/hosts`}:{state:"passed",count:0,detail:"no failing or slow external calls"}},"read")},{kind:"perf-rules",resource:Le,reads:o(()=>[Le],"reads"),blocking:!1,source:"perf",read:o(e=>{let t=pe(e,"findings")??0;return t>0?{state:"warning",count:t,detail:`${me(t,"performance finding")} \u2014 read ${Le} (each has a fix and a verify step)`}:{state:"passed",count:0,detail:"no open performance findings"}},"read"),items:o(e=>{let t=(Array.isArray(e.findings)?e.findings:[]).map(hy).filter(n=>!!n),r=t.slice(0,Td).map(n=>{let u=Te(n.rule)??"perf",i=Te(n.project)??"?",a=Te(n.subject)??"?",l=Array.isArray(n.fix)?n.fix.filter(d=>typeof d=="string"):[];return{source:"perf",severity:"warning",title:`${u} \xB7 ${Te(n.title)??i}`,fingerprint:`agent-status:perf-rule:${u}:${i}:${a}`,resource:Le,rule:u,...l.length?{fix:fy({fix:l})}:{},...Te(n.verify)?{verify:Te(n.verify)}:{},...Te(n.docs)?{docs:Te(n.docs)}:{}}});return t.length>Td&&r.push({source:"perf",severity:"warning",title:`${me(t.length-Td,"more performance finding")} \u2014 read ${Le}`,fingerprint:"agent-status:perf-rules:more",resource:Le}),r},"items")}],Td=5,vy=new WeakMap,ZS=cs.map(e=>e.resource);async function yy(e,t){let r={kind:t.kind,resource:t.resource},n;try{n=hy(await e.read(t.resource))}catch{return{...r,producer:"none",state:"unknown",detail:`no producer for ${t.resource} \u2014 this signal is unmonitored, not healthy`,reads:t.reads("unknown")}}if(!n)return{...r,producer:"none",state:"unknown",detail:`${t.resource} produced no readable payload`,reads:t.reads("unknown")};let u=Te(n.producer),i=(e.revision(t.resource)??0)>0,a=u==="none"?"none":u==="connected"||i?"connected":"none",l=Te(n.detail);if(a==="none")return{...r,producer:a,state:"unknown",detail:l??(u==="none"?`${t.resource} reports no producer attached \u2014 this signal is unmonitored, not healthy`:`${t.resource} is registered but has never reported \u2014 this signal is unmonitored, not healthy`),reads:t.reads("unknown")};let d;try{d=t.read(n)}catch{d={state:"unknown",detail:`${t.resource} payload could not be interpreted`}}let c=n.stale===!0,p=c?`${d.detail} (as of ${Et(n.ageMs)!==void 0?by(Et(n.ageMs)):"a while ago"}; nothing has re-checked since)`:d.detail,m={...r,producer:a,state:d.state,...d.count===void 0?{}:{count:d.count},...c?{stale:!0}:{},detail:p,reads:t.reads(d.state)};if(t.items&&(d.state==="warning"||d.state==="failed"))try{let f=t.items(n);f.length&&vy.set(m,f)}catch{}return m}s(yy,"zA"),o(yy,"readSignal");function by(e){return e<6e4?`${Math.max(1,Math.round(e/1e3))}s ago`:e<36e5?`${Math.round(e/6e4)}m ago`:`${Math.round(e/36e5)}h ago`}s(by,"MA"),o(by,"describeAge");async function Pd(e){return Promise.all(cs.map(t=>yy(e,t)))}s(Pd,"ia"),o(Pd,"readSignals");var Xr=o(e=>cs.find(t=>t.resource===e.resource)??cs.find(t=>t.kind===e.kind),"specFor");function Ey(e){return{source:Xr(e).source,severity:e.state==="failed"?"error":"warning",title:e.detail,fingerprint:`agent-status:${e.kind}:${e.state}`,resource:e.reads[0]??e.resource}}s(Ey,"NA"),o(Ey,"toItem");function wy(e){let t={failed:3,warning:2,unknown:1,passed:0},r=o(i=>{let a=e.filter(l=>l.kind===i);return a.length===0?"unknown":a.reduce((l,d)=>t[d.state]>t[l]?d.state:l,a[0].state)},"pick"),n=o(i=>i==="failed"?"failed":i==="passed"||i==="warning"?"passed":"unknown","tri"),u=o(i=>i,"quad");return{typecheck:n(r("typecheck")),lint:n(r("lint")),build:n(r("build")),runtime:u(r("runtime")),visual:u(r("visual")),memory:u(r("memory"))}}s(wy,"PA"),o(wy,"toChecks");function Dy(e){let t=e.filter(p=>p.state==="failed"),r=e.filter(p=>p.state==="warning"),n=e.filter(p=>p.state==="passed"),u=o(p=>vy.get(p)??[Ey(p)],"itemsOf"),i=t.filter(p=>Xr(p).blocking).flatMap(u),a=[...t.filter(p=>!Xr(p).blocking),...r].flatMap(u),l=i.length>0?"failing":a.length>0?"warning":n.length>0?"clean":"starting",d=[...t.filter(p=>Xr(p).blocking).flatMap(p=>p.reads),...t.filter(p=>!Xr(p).blocking).flatMap(p=>p.reads),...r.flatMap(p=>p.reads)],c=[...new Set(d)];return c.length===0&&c.push("events://recent"),{status:l,blocking:i,warnings:a,suggestedReads:c,checks:wy(e)}}s(Dy,"b_"),o(Dy,"deriveVerdict");function $y(e=process.env){let t=e.LENSMCP_TRANSPORT==="http"||e.LENSMCP_TRANSPORT==="socket",r=e.LENSMCP_PORT;return{mode:t?"shared":"embedded",pid:process.pid,startedAt:new Date(Date.now()-Math.round(process.uptime()*1e3)).toISOString(),...t&&r?{url:`http://127.0.0.1:${r}/mcp`}:{}}}s($y,"DA"),o($y,"readServerInfo");async function ps(e){let t=await Pd(e.resources),r=Dy(t);return{schemaVersion:1,revision:e.revision,updatedAt:new Date().toISOString(),sessionId:e.sessionId,server:$y(),status:r.status,blocking:r.blocking,warnings:r.warnings,suggestedReads:r.suggestedReads,checks:r.checks,signals:t}}s(ps,"ur"),o(ps,"aggregateStatus");var Ud="agent://current-status",qd=class extends w2{static{s(this,"Xm")}static{o(this,"AgentCurrentStatusResource")}async execute(){let e=this.get(Z);try{return await e.read(Ud)}catch{}let t=this.get(Jr);return ps({resources:e,sessionId:t.id,revision:e.revision(Ud)??0})}};qd=F([E2({name:"agent-current-status",uri:Ud,mimeType:"application/json",description:'Workspace health in one read: status (clean/warning/failing/starting), what is BLOCKING (typecheck/lint/build errors, browser runtime errors, wedged or crash-looping services), warnings, and the exact resources to read next. Signals with no producer report `producer: "none"` \u2014 unmonitored, not healthy.'})],qd);var N2=qd;import{Resource as M2,ResourceContext as O2}from"@frontmcp/sdk";var Zd=class extends O2{static{s(this,"Qm")}static{o(this,"ProcessClusterResource")}async execute(){return this.get(Z).read("process://cluster")}};Zd=F([M2({name:"process-cluster",uri:"process://cluster",mimeType:"application/json",description:"Dev-cluster service health: which services are up / down / wedged / crash-looping, which fail to build, restart counts, and the error lines services printed (ERROR in, EADDRINUSE, and error TS\u2026 for a project no typecheck producer reports for \u2014 otherwise type errors are in typecheck://errors), and `incidents`: the requests of the last 15 minutes the gateway answered itself because of the pod \u2014 evicted (502: silent through the liveness check, or the process gone; the service restarted, so work in flight was cut short) or given up on (504: alive past the ceiling, pod kept) \u2014 each with its method, path and the traceId of the 502/504 body. Read this when a request 502s or a dev server stopped responding."})],Zd);var R2=Zd;import{Resource as T2,ResourceContext as P2}from"@frontmcp/sdk";var Ld=class extends P2{static{s(this,"th")}static{o(this,"PerfRulesResource")}async execute(){return this.get(Z).read("perf://rules")}};Ld=F([T2({name:"perf-rules",uri:"perf://rules",mimeType:"application/json",description:"Performance problems the lens detected by rule, each with a stable rule id, the measured evidence, the estimated cost (modules / MB / compile ms), the FIX steps and a VERIFY step: bundle/heavy-barrel-import (a service compiles most of a shared library through its root barrel while using a few symbols), pod/heap-budget (a dev pod's live heap after GC is over its budget), pod/retained-generation (a hot-swapped app copy is still in memory). A finding is retracted when the next build or memory report no longer shows it \u2014 that is how to prove a fix."})],Ld);var U2=Ld;import{Tool as q2,ToolContext as Z2}from"@frontmcp/sdk";var By=["typecheck","lint","build","runtime","cluster"],L2=[...By,"all"],J2={typecheck:[{signal:"typecheck://current",resource:"typecheck://errors",keys:["errors"],hint:"TypeScript diagnostics from the watching tsc. Already computed \u2014 no need to run `nx typecheck`."}],lint:[{signal:"lint://current",resource:"lint://errors",keys:["errors"],hint:"ESLint errors from the watching lint pass. Already computed \u2014 no need to run `nx lint`."}],build:[{signal:"build://current",resource:"build://failures",keys:["failures"],hint:"Bundler/compile failures. The dev server is serving a stale or broken bundle until these clear."}],runtime:[{signal:"runtime://browser/errors",resource:"runtime://browser/errors",keys:["entries"],hint:"Uncaught errors from the browser. Pair with flow_list_recent to see what the user did first."},{signal:"runtime://errors",resource:"runtime://errors",keys:["entries"],hint:"Errors a dev service raised while handling a request (a 500 from a curl, an e2e runner or the page) \u2014 route, status, request id and stack. No browser is involved."}],cluster:[{signal:"process://cluster",resource:"process://cluster",keys:["errors"],hint:"Error lines printed by dev services (ERROR in / EADDRINUSE; error TS only for a project no typecheck producer reports for). A wedged or crash-looping service 502s every request routed to it."},{signal:"process://cluster",resource:"process://cluster",keys:["incidents"],hint:"Requests the gateway answered itself because of the pod, in the last 15 minutes \u2014 each with its method, path and traceId (the one in the 502/504 body). `pod-evicted` (502): the pod sent nothing and its liveness route stayed silent past the confirmation window (or its process was gone); the service is restarted, so work it was doing for that request may have been cut short \u2014 check before repeating a call that is not safe to repeat. `request-gave-up` (504): the pod stayed alive past the ceiling and was kept; the request may still complete there."}]},V2=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0,"asRecord");async function xy(e,t){let r;try{r=V2(await e.read(t.resource))}catch{return[]}if(!r)return[];for(let n of t.keys){let u=r[n];if(Array.isArray(u))return u}return[]}s(xy,"GA"),o(xy,"readItems");async function ky(e){let t=e.kind==="all"?By:[e.kind],r=await Pd(e.resources),n=new Map(r.map(i=>[i.resource,i])),u=[];for(let i of t)for(let a of J2[i]){let l=n.get(a.signal),d=l?.producer??"none",c=l?.state??"unknown",p=d==="none"?[]:await xy(e.resources,a);u.push({kind:i,resource:a.resource,producer:d,state:c,count:p.length,returned:Math.min(p.length,e.limit),items:p.slice(0,e.limit),detail:l?.detail??`no producer for ${a.resource} \u2014 unmonitored, not healthy`,hint:a.hint})}return{kind:e.kind,totalErrors:u.reduce((i,a)=>i+a.count,0),unmonitored:[...new Set(u.filter(i=>i.producer==="none").map(i=>i.kind))],groups:u}}s(ky,"ih"),o(ky,"collectErrors");var Cy={name:"observe.current_status",description:'Workspace health in one call: whether anything is BLOCKING right now (typecheck errors, lint errors, build failures, browser runtime errors, wedged or crash-looping dev services), plus warnings and the exact resources to read next. Warnings include PERFORMANCE problems found by rule (a service compiling a whole shared library through its root barrel, a dev pod over its heap budget, a hot-swapped app copy still in memory), each with its rule id, a fix and how to verify it. Call this FIRST when a build, dev server, or page looks broken \u2014 and before running `nx typecheck` / `nx lint` for a project the dev cluster already watches, because those results are already computed here. Signals reporting `producer: "none"` are UNMONITORED, not healthy. Use observe.errors for the individual error items.'},Vt={name:"observe.errors",description:"The actual error items the lens already computed: TypeScript diagnostics, ESLint errors, build failures, uncaught browser errors, server-side request errors (a dev service's 500: route, status, stack), and error lines printed by dev services (ERROR in\u2026, error TS\u2026, EADDRINUSE). Filter with `kind`. Prefer this over running `nx typecheck` / `nx lint` or tailing a dev-server log for a project the dev cluster watches: the watching producers already have the answer, so this costs one call instead of a rebuild. Each group reports `producer` \u2014 `none` means nothing is feeding that check, so an empty list there is NOT proof it is clean.",kinds:L2,defaultKind:"all",defaultLimit:25,maxLimit:200},ms={name:"observe.dismiss_errors",description:"Hide runtime errors that are already UNDERSTOOD and are not a problem to fix \u2014 a 401 your own signed-out test browser caused, a failure from a fixture that exists to throw \u2014 so they stop counting in observe.current_status and the Stop hook. Give the entry `ids` from observe.errors (kind `runtime`), or `all: true`, and a `reason`: it is recorded with the dismissal and shown to the person in the dashboard. This HIDES, it does not fix: each error shows again the next time it happens. It cannot dismiss a failing typecheck, lint, build or a broken service \u2014 those are current verdicts and clear only when the code is fixed. Never dismiss an error you have not explained; undo with observe.restore_errors.",maxIds:250,minReasonChars:8},Jd={name:"observe.restore_errors",description:"Undo a dismissal, so the errors it hid are listed and counted again. Give the dismissal `ids` from runtime://dismissed (or the id of an entry it hid), or `all: true` for every dismissal in effect \u2014 including ones a person made in the dashboard.",maxIds:250},Ay={name:"worktree.create",description:"Make a git worktree of this workspace and run it as its own instance of the app \u2014 beside the main checkout, on its own hosts (app.<name>.<project>.localhost), with its own databases and queues (nx.json \u2192 lensmcp.instances) \u2014 then point THIS session's lens at it. Use it to work on a task in isolation while the main checkout keeps running: a risky change, a migration, a second task in parallel, or reviewing a branch (frozen). It starts from the main checkout's last commit (HEAD), not its uncommitted edits. Afterwards do every edit and command in the returned `root` (absolute paths, or cd there) \u2014 `lensmcp instance exec -- <cmd>` there gives a command the worktree's own variables. A slow `prepare` (migrations, seeds) may still be running when this returns: `state` says so, and worktree.list follows it. Load the lensmcp-worktrees skill for the whole workflow."},_y={name:"worktree.list",description:"This workspace's checkouts \u2014 the main one and every worktree instance: its state (running, stopped, preparing, failed\u2026), branch, how many files hold uncommitted work, its hosts and dashboard, whether the lens made it, and `active` \u2014 the one this session's lens reports on now. Call it to find a worktree to continue in, to see whether a create has finished, or to check which app the observe.* tools are describing."},Iy={name:"worktree.switch",description:"Point this session's lens at another checkout of this workspace \u2014 a worktree by name, or 'main' \u2014 so observe.*, flows, errors and every other lens tool describe ITS running app. A stopped worktree is started first. It does not move your shell: work in the returned `root`."},Sy={name:"worktree.remove",description:"Take a worktree away: stop its app, drop the databases and queues the lens made for it, and \u2014 when the lens made the worktree \u2014 remove its folder. The branch is kept (deleteBranch: true deletes it once merged). It REFUSES while the worktree holds uncommitted work and lists the files: commit them on its branch first. Pass force: true only when the person has said to throw that work away. Removing the worktree the lens is on moves the lens back to main."},Fy="agent://current-status",Vd=class extends Z2{static{s(this,"dh")}static{o(this,"ObserveCurrentStatusTool")}async execute(){let e=this.get(Z);try{return await e.read(Fy)}catch{}let t=this.get(Jr);return ps({resources:e,sessionId:t.id,revision:e.revision(Fy)??0})}};Vd=F([q2({name:Cy.name,description:Cy.description,inputSchema:{}})],Vd);var W2=Vd;import{Tool as G2,ToolContext as K2,z as jy}from"@frontmcp/sdk";var Wd=class extends K2{static{s(this,"fh")}static{o(this,"ObserveErrorsTool")}async execute(e){let t=this.get(Z);return ky({resources:t,kind:e.kind,limit:e.limit})}};Wd=F([G2({name:Vt.name,description:Vt.description,inputSchema:{kind:jy.enum(Vt.kinds).default(Vt.defaultKind).describe("Which failures to return. 'runtime' = browser errors AND a service's own request errors (the 500 case); 'cluster' = dev-service/pod errors (the 502 case). Default 'all'."),limit:jy.number().int().positive().max(Vt.maxLimit).default(Vt.defaultLimit).describe(`Max items per kind (default ${Vt.defaultLimit}). \`count\` still reports the true total.`)}})],Wd);var H2=Wd;import{Tool as X2,ToolContext as Y2,z as Yr}from"@frontmcp/sdk";import{appendFileSync as Q2,closeSync as eB,mkdirSync as tB,openSync as uB,renameSync as rB,statSync as nB,unlinkSync as iB}from"node:fs";import{dirname as sB,join as aB}from"node:path";function zy(e,t){let{fs:r,maxBytes:n,maxFiles:u}=t,i=`${e}.rotate.lock`,a=t.staleLockMs??3e4,l;for(let d=0;d<2&&l===void 0;d++)try{l=r.openSync(i,"wx")}catch{try{if(Date.now()-r.statSync(i).mtimeMs<=a)return"busy";r.unlinkSync(i)}catch{}}if(l===void 0)return"busy";try{try{if(r.statSync(e).size<=n)return"not-needed"}catch{return"not-needed"}try{r.unlinkSync(`${e}.${u}`)}catch{}for(let d=u-1;d>=1;d--)try{r.renameSync(`${e}.${d}`,`${e}.${d+1}`)}catch{}try{r.renameSync(e,`${e}.1`)}catch{}return"rotated"}finally{try{r.closeSync(l)}catch{}try{r.unlinkSync(i)}catch{}}}s(zy,"$_"),o(zy,"rotateBusFile");function Ny(e=process.env,t=process.cwd()){return e.LENSMCP_EVENT_FILE??aB(t,".lensmcp","events.jsonl")}s(Ny,"k_"),o(Ny,"lensEventFile");var My=o((e,t,r,n,u)=>({id:lt(),sessionId:e,timestamp:t,source:b3,category:"runtime",severity:"info",context:{sessionId:e},fingerprint:r,title:n,raw:u}),"lensEvent");function Gd(e,t){return My(t,e.until,`${xu}:${e.groupId}`,`error dismissed: ${e.title??e.groupId}`,{kind:xu,groupId:e.groupId,until:e.until,eventIds:e.eventIds,...e.by?{by:e.by}:{},...e.reason?{reason:e.reason}:{},...e.title?{title:e.title}:{}})}s(Gd,"aa"),o(Gd,"dismissalEvent");function Kd(e,t,r){return My(t,r,`${Qi}:${e}`,"error restored",{kind:Qi,groupId:e})}s(Kd,"ca"),o(Kd,"restoralEvent");var Oy=o((e,t,r)=>{let n=Number(process.env[e]);return Number.isFinite(n)&&r(n)?n:t},"envNumber");function fs(e,t){t.length!==0&&(tB(sB(e),{recursive:!0}),zy(e,{maxBytes:Oy("LENSMCP_EVENT_MAX_BYTES",50*1024*1024,r=>r>0),maxFiles:Oy("LENSMCP_EVENT_MAX_FILES",5,r=>r>=1&&r<=20),fs:{statSync:nB,renameSync:rB,unlinkSync:iB,openSync:uB,closeSync:eB}}),Q2(e,t.map(r=>JSON.stringify(r)+`
69
+ `).join("")))}s(fs,"dn"),o(fs,"appendBusEvents");var oB=["runtime://errors","runtime://browser/errors","runtime://browser/failed-requests"],lB="runtime://dismissed";async function Ry(e,t){let r;try{r=await e.read(t)}catch{return[]}let n=r?.entries;return Array.isArray(n)?n.flatMap(u=>{let i=u;if(!i||typeof i.id!="string"||!i.id)return[];let a=typeof i.title=="string"&&i.title?i.title:typeof i.message=="string"?i.message:i.id;return[{id:i.id,title:a,timestamp:typeof i.timestamp=="number"?i.timestamp:0}]}):[]}s(Ry,"uj"),o(Ry,"entriesOf");async function Ty(e,t,r=Date.now()){let n=new Set(t.ids??[]),u=[],i=r;for(let c of oB)for(let p of await Ry(e,c))!t.all&&!n.has(p.id)||u.some(m=>m.id===p.id)||(u.push({id:p.id,title:p.title,resource:c}),i=Math.max(i,p.timestamp));let a=new Set(u.map(c=>c.id)),l=t.reason.trim().slice(0,500),d=[];for(let c=0;c<u.length;c+=200){let p=u.slice(c,c+200),m=p[0]?.title??"";d.push({groupId:`events:${lt()}`,until:i,eventIds:p.map(f=>f.id),by:t.by??"agent",reason:l,title:p.length===1?m:`${p.length} errors \u2014 ${m}`})}return{drafts:d,items:u,notFound:[...n].filter(c=>!a.has(c))}}s(Ty,"I_"),o(Ty,"planDismissal");async function Py(e,t){let r;try{r=await e.read(lB)}catch{r=void 0}let n=r?.dismissals,u=(Array.isArray(n)?n:[]).flatMap(d=>{let c=d;return c&&typeof c.id=="string"?[{id:c.id,eventIds:Array.isArray(c.eventIds)?c.eventIds.filter(p=>typeof p=="string"):[]}]:[]});if(t.all)return{keys:u.map(d=>d.id),notFound:[]};let i=[...new Set(t.ids??[])],a=new Set,l=[];for(let d of i){let c=u.filter(p=>p.id===d||p.eventIds.includes(d));c.length===0&&l.push(d);for(let p of c)a.add(p.id)}return{keys:[...a],notFound:l}}s(Py,"R_"),o(Py,"planRestore");var dB="Hidden, not fixed. Each of these shows again the next time it happens, and runtime://dismissed lists what is hidden, by whom and why.",Hd=class extends Y2{static{s(this,"hh")}static{o(this,"ObserveDismissErrorsTool")}async execute(e){if(!e.all&&!e.ids?.length)return{dismissed:0,items:[],notFound:[],note:"Nothing named: pass `ids` (from observe.errors, kind runtime) or `all: true`."};let t=this.get(Z),r=this.get(Jr),n=await Ty(t,e),u=n.drafts.map(a=>Gd(a,r.id)),i=process.env.LENSMCP_EVENT_FILE;if(i)fs(i,u);else for(let a of u)this.get(Vr).publish(a);return{dismissed:n.items.length,items:n.items,notFound:n.notFound,note:n.items.length?dB:"Nothing was dismissed: none of those ids is in a runtime error list right now."}}};Hd=F([X2({name:ms.name,description:ms.description,inputSchema:{ids:Yr.array(Yr.string().min(1)).max(ms.maxIds).optional().describe("Entry ids to dismiss \u2014 the `id` of items observe.errors returns for kind `runtime`."),all:Yr.boolean().optional().describe("Dismiss every runtime error currently listed (server-side, browser, failed requests)."),reason:Yr.string().min(ms.minReasonChars).describe("Why these are not a problem to fix. Recorded with the dismissal and shown to the person in the dashboard."),by:Yr.enum(["agent","cli"]).default("agent").describe("Who is dismissing. Leave as 'agent'; the lensmcp CLI passes 'cli'.")}})],Hd);var cB=Hd;import{Tool as pB,ToolContext as mB,z as Xd}from"@frontmcp/sdk";var Yd=class extends mB{static{s(this,"yh")}static{o(this,"ObserveRestoreErrorsTool")}async execute(e){if(!e.all&&!e.ids?.length)return{restored:0,notFound:[],note:"Nothing named: pass dismissal `ids` (from runtime://dismissed) or `all: true`."};let t=this.get(Z),r=this.get(Jr),n=await Py(t,e),u=Date.now(),i=n.keys.map(l=>Kd(l,r.id,u)),a=process.env.LENSMCP_EVENT_FILE;if(a)fs(a,i);else for(let l of i)this.get(Vr).publish(l);return{restored:n.keys.length,notFound:n.notFound,note:n.keys.length?"Restored: what those dismissals hid is listed and counted again.":"Nothing was restored: no dismissal matches."}}};Yd=F([pB({name:Jd.name,description:Jd.description,inputSchema:{ids:Xd.array(Xd.string().min(1)).max(Jd.maxIds).optional().describe("Dismissal ids from runtime://dismissed, or ids of entries a dismissal hid."),all:Xd.boolean().optional().describe("Undo every dismissal in effect.")}})],Yd);var fB=Yd;import{Tool as hB,ToolContext as gB,z as _u}from"@frontmcp/sdk";import{spawn as Uy}from"node:child_process";import{closeSync as vB,existsSync as qy,mkdirSync as yB,openSync as bB,readFileSync as Zy,realpathSync as EB}from"node:fs";import{homedir as wB}from"node:os";import{dirname as Qd,join as Wt,resolve as Ly}from"node:path";var DB="lensmcp/switch",$B="lensmcp/replay",Jy=/^[a-z0-9](?:[a-z0-9-]{0,18}[a-z0-9])?$/,BB=45e3;function ec(e){try{let t=JSON.parse(Zy(e,"utf8"));return t&&typeof t=="object"?t:void 0}catch{return}}s(ec,"D_"),o(ec,"readJson");function Vy(e=process.env,t=process.cwd()){let r=Ly(e.LENSMCP_WORKSPACE_ROOT??t),n=ec(Wt(r,".lensmcp","config.json")),u=typeof n?.key=="string"?n.key:e.LENSMCP_WORKSPACE_KEY;if(!u)return;let i=n?.instance;return typeof i?.name=="string"&&typeof i.baseKey=="string"&&u===`${i.baseKey}-${i.name}`?{root:r,key:u,baseKey:i.baseKey,mainRoot:typeof i.mainRoot=="string"?i.mainRoot:r,instance:i.name}:{root:r,key:u,baseKey:u,mainRoot:r}}s(Vy,"C_"),o(Vy,"servedWorkspace");function Wy(e,t,r){let n=e.LENSMCP_CLI;if(n)return qy(n)?n:void 0;let u=[];if(t){let i=Ly(t),a=i;try{a=EB(i)}catch{}for(let l of new Set([i,a])){let d=Qd(Qd(l));u.push(Wt(d,"bin.js"),Wt(d,"dist","bin.js"))}}return u.push(Wt(r,"node_modules","lensmcp","bin.js"),Wt(r,"node_modules","lensmcp","dist","bin.js")),u.find(i=>qy(i))}s(Wy,"U_"),o(Wy,"findCli");function Gy(e){let t={...e};for(let r of["LENSMCP_EVENT_FILE","LENSMCP_PORT","LENSMCP_TRANSPORT","LENSMCP_PROCESS_ROLE","LENSMCP_WORKSPACE_KEY","LENSMCP_WORKSPACE_ROOT","LENSMCP_MCP_MODE","LENSMCP_DASHBOARD_BASE","LENSMCP_GATEWAY_PORTS","LENSMCP_SHARED_OWNER","LENSMCP_PARENT_PID"])delete t[r];return t}s(Gy,"wj"),o(Gy,"cliEnv");function Ky(e,t,r=process.env){let n=Gy(r);return{ws:e,home:r.LENSMCP_HOME||wB(),run:o((u,i)=>new Promise(a=>{let l=Uy(process.execPath,[t,...u],{cwd:i?.cwd??e.root,env:n,stdio:["ignore","pipe","pipe"]}),d="",c="";l.stdout.on("data",m=>d+=m.toString()),l.stderr.on("data",m=>c+=m.toString());let p=setTimeout(()=>l.kill("SIGTERM"),i?.timeoutMs??6e4);l.on("error",m=>{clearTimeout(p),a({code:null,stdout:d,stderr:c+m.message})}),l.on("close",m=>{clearTimeout(p),a({code:m,stdout:d,stderr:c})})}),"run"),spawnDetached:o((u,i)=>{yB(Qd(i.log),{recursive:!0,mode:448});let a=bB(i.log,"w",384);try{let l=Uy(process.execPath,[t,...u],{cwd:i.cwd,env:{...n,LENSMCP_CREATE_LOG:i.log},stdio:["ignore",a,a],detached:!0});return l.on("error",()=>{}),l.unref(),l.pid}finally{vB(a)}},"spawnDetached"),now:o(()=>Date.now(),"now"),sleep:o(u=>new Promise(i=>setTimeout(i,u)),"sleep"),alive:o(u=>{try{return process.kill(u,0),!0}catch(i){return i.code==="EPERM"}},"alive")}}s(Ky,"L_"),o(Ky,"defaultDeps");var Hy=o(e=>`https://lensmcp.local/${e}/`,"dashboardOf");function tc(e,t,r){let n=e.progress?.state??(t?"running":e.folderGone?"folder-gone":"stopped");return{name:e.instance??e.name??e.key,key:e.key,root:e.root??"",state:n,active:e.key===r,...e.branch?{branch:e.branch}:{},...typeof e.changes=="number"?{changes:e.changes}:{},...e.frozen?{frozen:!0}:{},...e.apex?{apex:e.apex}:{},...e.hosts&&Object.keys(e.hosts).length?{hosts:e.hosts}:{},dashboard:Hy(e.key),...typeof e.services=="number"?{services:e.services}:{},createdByLens:!!e.worktree,...e.progress?.detail?{detail:e.progress.detail}:{}}}s(tc,"j_"),o(tc,"viewOf");async function hs(e){let{ws:t}=e,r=await e.run(["instance","list","--json",`--base=${t.baseKey}`],{cwd:t.mainRoot,timeoutMs:3e4}),n;try{n=JSON.parse(r.stdout)}catch{return{error:`lensmcp instance list failed (exit ${r.code}): ${r.stderr.trim()||r.stdout.trim()}`}}let u={...n.checkout?.branch?{branch:n.checkout.branch}:{},...typeof n.checkout?.changes=="number"?{changes:n.checkout.changes}:{}},i=[{name:"main",key:t.baseKey,root:t.mainRoot,state:"running",active:t.key===t.baseKey,...u,dashboard:Hy(t.baseKey),createdByLens:!1},...(n.instances??[]).map(a=>tc(a,!0,t.key)),...(n.stopped??[]).map(a=>tc(a,!1,t.key))];return{project:t.baseKey,active:t.instance??"main",worktrees:i,...i.length===1?{note:"No worktrees yet \u2014 worktree.create makes one."}:{}}}s(hs,"la"),o(hs,"listWorktrees");var xB=o((e,t)=>Wt(e,".lensmcp","worktrees",`${t}.json`),"progressPath"),kB=o((e,t)=>Wt(e,".lensmcp","worktrees",`${t}.log`),"logPath");function uc(e){let t=ec(e);return t&&typeof t.state=="string"&&typeof t.pid=="number"?t:void 0}s(uc,"O_"),o(uc,"readProgress");function rc(e,t=25){try{return Zy(e,"utf8").trimEnd().split(`
70
+ `).slice(-t).join(`
71
+ `)}catch{return""}}s(rc,"B_"),o(rc,"tail");function Gt(e,t,r,n=!1){return{...e,_meta:{[DB]:{root:t,key:r},...n?{[$B]:!0}:{}}}}s(Gt,"pn"),o(Gt,"switching");async function Xy(e,t,r=BB){let{ws:n}=e;if(!Jy.test(t.name))return{ok:!1,error:`'${t.name}' is not a worktree name: one DNS label of at most 20 characters \u2014 lowercase letters, digits and inner hyphens (it becomes part of its hosts).`};let u=`${n.baseKey}-${t.name}`,i=["instance","create",t.name,"--json",...t.detach?["--detach"]:t.branch?[`--branch=${t.branch}`]:[],...t.from?[`--from=${t.from}`]:[],...t.frozen?["--frozen"]:[],...t.prepare===!1?["--no-prepare"]:t.prepare===!0?["--prepare"]:[],`--cwd=${n.mainRoot}`],a=xB(e.home,u),l=kB(e.home,u),d=e.spawnDetached(i,{cwd:n.mainRoot,log:l});if(d===void 0)return{ok:!1,error:"could not start `lensmcp instance create`"};let c=e.now()+r,p;for(;;){let m=uc(a);if(m?.pid===d&&(p=m),p&&(p.state==="ready"||p.state==="failed"))break;if(!e.alive(d)){let f=uc(a);if(f?.pid===d&&(p=f),!p||p.state!=="ready"&&p.state!=="failed")return{ok:!1,error:rc(l)||"lensmcp instance create ended without a word",log:l};break}if(e.now()>=c)break;await e.sleep(300)}return p?Yy(p,l,n):{ok:!1,error:"lensmcp instance create has not started yet \u2014 call worktree.list in a moment",log:l}}s(Xy,"q_"),o(Xy,"createWorktree");function Yy(e,t,r){let n=e.key.slice(r.baseKey.length+1),u=e.worktree?.path??e.root,i={...e.result??{},name:n,key:e.key,root:e.root,...e.worktree?{worktree:e.worktree}:{},state:e.state},a=e.state==="preparing"||e.state==="ready"||e.state==="failed"&&!!e.result,l=e.worktree?.path?` If your client can move its session into an existing git worktree, do it now (Claude Code: EnterWorktree { path: "${e.worktree.path}" }).`:"",d=`Do this task's work in ${e.root}: edit files there (absolute paths, or cd there first) and run its commands there \u2014 \`lensmcp instance exec -- <cmd>\` gives a command the worktree's own database, queues and hosts. Your edits in ${r.mainRoot} are not in it: it starts from the commit, not the working copy.${l}`;if(e.state==="ready")return Gt({ok:!0,...i,next:`${d} The lens now reports on this worktree \u2014 observe.*, flows and errors are ITS app's. worktree.remove takes it away when the work is committed.`},e.root,e.key);if(e.state==="failed"){let p={ok:!1,...i,error:e.detail??"the create failed",log:t,logTail:rc(t)};return a?Gt({...p,next:`It is served, but not ready: read the log, fix the cause, then \`lensmcp instance start --prepare\` in ${e.root} \u2014 or worktree.remove { name: '${n}', force: true } to drop it.`},e.root,e.key):{...p,next:`worktree.remove { name: '${n}' } takes away what was made.`}}let c={ok:!0,...i,detail:e.detail,log:t,next:`Still ${e.state}${e.detail?` (${e.detail})`:""}. The files are at ${u} \u2014 you can start editing. worktree.list shows when it is ready.`};return a?Gt({...c,next:`${c.next} The lens already reports on this worktree. ${d}`},e.root,e.key):c}s(Yy,"_j"),o(Yy,"createAnswer");async function Qy(e,t){let{ws:r}=e;if(t==="main"||t===r.baseKey)return r.instance?Gt({ok:!0,active:"main",root:r.mainRoot,next:`The lens reports on the main checkout (${r.mainRoot}) again.`},r.mainRoot,r.baseKey):{ok:!0,active:"main",note:"The lens already reports on the main checkout."};let n=await hs(e);if("error"in n)return{ok:!1,error:n.error};let u=n.worktrees.find(i=>i.name===t||i.key===t);if(!u)return{ok:!1,error:`No worktree '${t}' in ${r.baseKey}: ${n.worktrees.map(i=>i.name).join(", ")}.`};if(u.active)return{ok:!0,active:u.name,note:`The lens already reports on '${u.name}'.`};if(u.state==="folder-gone")return{ok:!1,error:`'${u.name}' has no folder any more \u2014 worktree.remove clears it.`};if(u.state==="creating"||u.state==="provisioning"||u.state==="registering")return{ok:!1,error:`'${u.name}' is still ${u.state} \u2014 try again when worktree.list shows it running.`};if(u.state==="stopped"||u.state==="failed"){let i=await e.run(["instance","start",`--name=${u.name}`,`--cwd=${u.root}`],{cwd:u.root,timeoutMs:12e4});if(i.code!==0)return{ok:!1,error:`could not start '${u.name}': ${i.stderr.trim()||i.stdout.trim()}`}}return Gt({ok:!0,active:u.name,key:u.key,root:u.root,...u.branch?{branch:u.branch}:{},...u.hosts?{hosts:u.hosts}:{},dashboard:u.dashboard,next:`The lens now reports on '${u.name}'. Do its work in ${u.root}.`},u.root,u.key)}s(Qy,"Z_"),o(Qy,"switchWorktree");async function e6(e,t){let{ws:r}=e;if(t.name==="main"||t.name===r.baseKey)return{ok:!1,error:"The main checkout is not a worktree \u2014 it cannot be removed."};if(r.instance&&(t.name===r.instance||t.name===r.key))return Gt({ok:!1,retry:!0,note:`Moving the lens back to the main checkout to remove '${r.instance}'.`},r.mainRoot,r.baseKey,!0);let n=await hs(e);if("error"in n)return{ok:!1,error:n.error};let u=n.worktrees.find(d=>d.name===t.name||d.key===t.name);if(!u||u.name==="main")return{ok:!1,error:`No worktree '${t.name}' in ${r.baseKey}: ${n.worktrees.filter(d=>d.name!=="main").map(d=>d.name).join(", ")||"none"}.`};let i=["instance","rm",u.key,"--json",`--base=${r.baseKey}`,...u.createdByLens?["--worktree"]:[],...t.force?["--force"]:[],...t.keepData?["--keep-data"]:[],...t.deleteBranch?["--delete-branch"]:[],`--cwd=${r.mainRoot}`],a=await e.run(i,{cwd:r.mainRoot,timeoutMs:18e4}),l={};try{l=JSON.parse(a.stdout)}catch{}if(a.code!==0){let d=l.uncommitted;return{ok:!1,name:u.name,...l,error:Array.isArray(d)?`'${u.name}' has uncommitted work \u2014 commit it on its branch first. Pass force: true ONLY if the person said to throw it away.`:a.stderr.trim()||`lensmcp instance rm exited ${a.code}`}}return{ok:!0,name:u.name,...l,...u.createdByLens?{}:{note:`The lens did not make ${u.root}, so the folder stays \u2014 only its instance and data are gone.`}}}s(e6,"V_"),o(e6,"removeWorktree");function Qr(e=process.env){let t=Vy(e);if(!t)return{error:"This lens server does not know which workspace it serves (no LENSMCP_WORKSPACE_ROOT and no .lensmcp/config.json)."};let r=Wy(e,process.argv[1],t.mainRoot);return r?Ky(t,r,e):{error:`The lensmcp CLI was not found beside this server or in ${t.mainRoot}/node_modules \u2014 install lensmcp in the workspace.`}}s(Qr,"Ft"),o(Qr,"worktreeDeps");var nc=class extends gB{static{s(this,"$h")}static{o(this,"WorktreeCreateTool")}async execute(e){let t=Qr();return"error"in t?{ok:!1,error:t.error}:Xy(t,e)}};nc=F([hB({name:Ay.name,description:Ay.description,inputSchema:{name:_u.string().regex(Jy).describe("Short and lowercase \u2014 one DNS label of at most 20 characters (it becomes part of its hosts: app.<name>.<project>.localhost). E.g. 'auth-fix'."),branch:_u.string().min(1).max(200).optional().describe("The branch to work on. Default lensmcp/<name>, made new from `from`. An existing branch is checked out as it is."),from:_u.string().min(1).max(200).optional().describe("The commit a new branch starts from (a branch, tag or sha). Default: the main checkout's HEAD."),detach:_u.boolean().optional().describe("Check out `from` itself with no branch \u2014 to look at or review a commit."),frozen:_u.boolean().optional().describe("Serve the commit as it is: every service compiles once, no file watcher, no type checker. For reviewing or comparing, not for editing."),prepare:_u.boolean().optional().describe("Run the project's prepare (migrations, seeds): true always, false never. Default: when its data is new.")}})],nc);var CB=nc;import{Tool as AB,ToolContext as _B}from"@frontmcp/sdk";var ic=class extends _B{static{s(this,"kh")}static{o(this,"WorktreeListTool")}async execute(){let e=Qr();if("error"in e)return{ok:!1,error:e.error};let t=await hs(e);return"error"in t?{ok:!1,error:t.error}:{ok:!0,...t}}};ic=F([AB({name:_y.name,description:_y.description,inputSchema:{}})],ic);var IB=ic;import{Tool as SB,ToolContext as FB,z as jB}from"@frontmcp/sdk";var sc=class extends FB{static{s(this,"Ih")}static{o(this,"WorktreeSwitchTool")}async execute(e){let t=Qr();return"error"in t?{ok:!1,error:t.error}:Qy(t,e.name)}};sc=F([SB({name:Iy.name,description:Iy.description,inputSchema:{name:jB.string().min(1).max(80).describe("A worktree's name (or key) from worktree.list, or 'main'.")}})],sc);var zB=sc;import{Tool as NB,ToolContext as MB,z as gs}from"@frontmcp/sdk";var ac=class extends MB{static{s(this,"Eh")}static{o(this,"WorktreeRemoveTool")}async execute(e){let t=Qr();return"error"in t?{ok:!1,error:t.error}:e6(t,e)}};ac=F([NB({name:Sy.name,description:Sy.description,inputSchema:{name:gs.string().min(1).max(80).describe("The worktree's name (or key) from worktree.list."),force:gs.boolean().optional().describe("Throw away its uncommitted work (and delete an unmerged branch with deleteBranch). ONLY when the person said so."),keepData:gs.boolean().optional().describe("Keep its databases and queues on record, for a worktree you will start again."),deleteBranch:gs.boolean().optional().describe("Also delete the branch the lens made for it \u2014 refused while it has commits merged nowhere, unless force.")}})],ac);var OB=ac;import{spawn as RB}from"node:child_process";import{existsSync as oc,readFileSync as TB}from"node:fs";import{join as t6}from"node:path";import{Job as PB,JobContext as UB,z as _e}from"@frontmcp/sdk";import{existsSync as qB}from"node:fs";import{dirname as ZB,join as LB,relative as JB,resolve as Kt,isAbsolute as VB}from"node:path";var WB=6;function u6(e=process.env,t=process.cwd()){return Kt(e.LENSMCP_WORKSPACE_ROOT??t)}s(u6,"G_"),o(u6,"resolveAllowedRoot");function vs(e,t){let r=JB(Kt(e),Kt(t));return r===""||!r.startsWith("..")&&!VB(r)}s(vs,"Ah"),o(vs,"isWithinRoot");function r6(e,t){let r=Kt(e);if(t===void 0)return{ok:!0,cwd:r};let n=Kt(r,t);return vs(r,n)?{ok:!0,cwd:n}:{ok:!1,reason:`cwd ${n} is outside this server's workspace (${r}). verify_fix runs a workspace-defined Nx target, so it only runs in the workspace this server was started for. Set LENSMCP_WORKSPACE_ROOT to serve a different one.`}}s(r6,"W_"),o(r6,"confineToWorkspace");function n6(e,t){let r=Kt(t),n=Kt(e);if(vs(r,n))for(let u=0;u<WB;u++){if(qB(LB(n,"nx.json")))return n;if(n===r)break;let i=ZB(n);if(i===n||!vs(r,i))break;n=i}}s(n6,"J_"),o(n6,"findNxWorkspaceRootWithin");var GB=/^[@A-Za-z0-9][\w./-]*$/;function i6(e){return e.length<=214&&GB.test(e)}s(i6,"K_"),o(i6,"isValidProjectName");var lc=class extends UB{static{s(this,"Oh")}static{o(this,"VerifyFixJob")}async execute(e){let t=Date.now(),r=e.project??process.env.LENSMCP_VERIFY_PROJECT??"example-web",n=u6(),u=r6(n,e.cwd);if(!u.ok)return this.log(`[verify_fix] refused: ${u.reason}`),{status:"errored",project:r,durationMs:Date.now()-t,stages:[],reportPath:null};let i=u.cwd;if(!i6(r))return this.log(`[verify_fix] refused: ${r} is not a valid Nx project name`),{status:"errored",project:r,durationMs:Date.now()-t,stages:[],reportPath:null};let a=n6(i,n);if(!a)return this.log(`No nx.json found between ${i} and ${n}`),{status:"errored",project:r,durationMs:Date.now()-t,stages:[],reportPath:null};let l=s6("nx",[a]);if(!l)return this.log(`Could not find node_modules/.bin/nx under ${a}`),{status:"errored",project:r,durationMs:Date.now()-t,stages:[],reportPath:null};this.log(`[verify_fix] nx run ${r}:agent-verify (cwd=${a})`);let d=RB(l,["run",`${r}:agent-verify`],{cwd:a,env:{...process.env},stdio:["ignore","pipe","pipe"]}),c=[],p=o(x=>{let $=/\[agent-verify\] ([a-z]+): (passed|failed|skipped|errored)/.exec(x);$&&$[1]&&$[2]&&(c.push({name:$[1],result:$[2],durationMs:0}),this.log(` ${$[1]}: ${$[2]}`))},"captureLine");dc(d.stdout,p),dc(d.stderr,p);let m=!1,f=setTimeout(()=>{m=!0;try{d.kill("SIGTERM")}catch{}},e.timeoutMs),h=await new Promise(x=>{d.on("exit",$=>x($??1))});if(clearTimeout(f),m)return{status:"timeout",project:r,durationMs:Date.now()-t,stages:c,reportPath:null};let g=t6(a,".lensmcp","verifications","latest.json"),b;if(oc(g))try{b=JSON.parse(TB(g,"utf-8"))}catch{b=void 0}return{status:b?.status??(h===0?"passed":"failed"),project:r,durationMs:b?.durationMs??Date.now()-t,stages:b?.stages??c,reportPath:oc(g)?g:null}}};lc=F([PB({name:"observe.verify_fix",description:"Run the deterministic verification loop (typecheck \u2192 lint \u2192 build) for a host project. Returns a per-stage report; suggested next read on failure is the relevant *://errors resource.",inputSchema:{project:_e.string().describe('Nx project name in the host workspace to verify. Defaults to LENSMCP_VERIFY_PROJECT or "example-web".').optional(),cwd:_e.string().describe("Directory to verify from. MUST be inside the workspace this server was started for (LENSMCP_WORKSPACE_ROOT, else the server's cwd); a path outside it is refused. Defaults to that workspace root.").optional(),timeoutMs:_e.number().int().positive().default(5*6e4).describe("How long to wait for the verify pipeline before declaring it stuck.")},outputSchema:{status:_e.enum(["passed","failed","errored","timeout"]),project:_e.string().nullable(),durationMs:_e.number(),stages:_e.array(_e.object({name:_e.string(),result:_e.enum(["passed","failed","skipped","errored"]),durationMs:_e.number(),exitCode:_e.number().optional(),summary:_e.string().optional()})),reportPath:_e.string().nullable()}})],lc);var KB=lc;function s6(e,t){for(let r of t){let n=t6(r,"node_modules",".bin",e);if(oc(n))return n}}s(s6,"Zj"),o(s6,"locateBin");function dc(e,t){if(!e)return;let r="";e.setEncoding("utf-8"),e.on("data",n=>{r+=typeof n=="string"?n:n.toString("utf-8");let u;for(;(u=r.indexOf(`
72
+ `))!==-1;){let i=r.slice(0,u);r=r.slice(u+1),t(i)}}),e.on("end",()=>{r.length&&t(r)})}s(dc,"H_"),o(dc,"bufferLines");var a6=class{static{s(this,"Mh")}static{o(this,"AgentApp")}};a6=F([b2({id:"agent",name:"Agent",description:"Agent-facing summary, suggested reads, verification.",resources:[N2,R2,U2],tools:[W2,H2,cB,fB,CB,IB,zB,OB],jobs:[KB]})],a6);var HB={"service-starting":"starting","service-respawn":"starting","lens-app-up":"starting","service-up":"up","cold-start":"up","service-down":"down","idle-kill":"idle","service-recycle":"wedged","pod-recycle":"wedged","service-crash-loop":"crash-looping","lens-handoff-complete":"up","gateway-up":"up","gateway-down":"down","lens-child-starting":"starting","lens-child-up":"up","lens-child-exit":"down"},XB=new Set(["service-respawn","service-recycle","pod-recycle","lens-handoff-complete"]),o6=new Set(["build","types","process"]),l6=o(e=>o6.has(e)?e:"unknown","faultOf"),YB=class{static{s(this,"Eo")}static{o(this,"ClusterHealth")}constructor(){this.services=new Map,this.errors=[],this.incidents=[],this.typechecked=new Set}ingest(e){if(e.category==="typecheck")return this.noteTypecheck(e);if(e.source!=="gateway"||e.category!=="cluster")return!1;let t=this.pruneIncidents(e.timestamp),r=e.raw??{},n=typeof r.kind=="string"?r.kind:void 0;if(!n)return t;let u=typeof r.project=="string"?r.project:void 0;if(!u)return t;if(n==="pod-evicted"||n==="request-gave-up"){let l=e.raw,d=o(m=>typeof l[m]=="string"?l[m]:void 0,"str"),c=o(m=>typeof l[m]=="number"&&Number.isFinite(l[m])?l[m]:void 0,"num"),p={project:u,timestamp:e.timestamp,kind:n,pod:d("pod")??"?",status:c("status")??(n==="pod-evicted"?502:504),reason:d("reason")??e.title};for(let m of["traceId","method","path","failure"]){let f=d(m);f&&(p[m]=f)}for(let m of["heldMs","silentMs","probes"]){let f=c(m);f!==void 0&&(p[m]=f)}return this.incidents.push(p),this.incidents.length>30&&this.incidents.splice(0,this.incidents.length-30),!0}if(n==="service-error"){let l=l6(r.fault),d=this.touch(u,e.timestamp);if(d.faults.add(l),d.lastTitle=e.title,l==="types"&&this.typechecked.has(u))return!0;let c=typeof r.line=="string"?r.line:e.message??e.title;return this.errors.push({project:u,timestamp:e.timestamp,line:c,fingerprint:e.fingerprint,fault:l}),this.errors.length>50&&this.errors.splice(0,this.errors.length-50),!0}if(n==="service-fault-closed"){let l=this.services.get(u),d=Array.isArray(r.closed)?r.closed.filter(c=>o6.has(c)).map(l6):[];return!l||d.length===0?t:(l.lastSeenAt=e.timestamp,l.lastTitle=e.title,this.resolve(l,d),!0)}if(n==="service-recovered"){let l=this.services.get(u);return l?(l.lastSeenAt=e.timestamp,this.resolve(l),l.lastTitle=e.title,!0):t}if(n==="lens-handoff-start"){let l=this.touch(u,e.timestamp);return r.oldServing!==!0&&(l.state="starting"),l.lastTitle=e.title,!0}if(n==="lens-handoff-failed"){let l=this.touch(u,e.timestamp);return r.oldKept!==!0&&(l.state="down"),l.lastTitle=e.title,!0}let i=HB[n];if(!i)return t;let a=this.touch(u,e.timestamp);return a.state=i,a.lastTitle=e.title,XB.has(n)&&(a.restarts+=1),i==="up"&&this.resolve(a),!0}pruneIncidents(e){if(this.incidents.length===0||e-this.incidents[0].timestamp<=9e5)return!1;let t=this.incidents.filter(r=>e-r.timestamp<=9e5);return this.incidents.splice(0,this.incidents.length,...t),!0}resolve(e,t){if(t)for(let n of t)e.faults.delete(n);else e.faults.clear();let r=o(n=>n.project===e.project&&(!t||t.includes(n.fault)),"gone");this.errors.splice(0,this.errors.length,...this.errors.filter(n=>!r(n)))}noteTypecheck(e){let t=e.raw??{};if(t.kind!=="typecheck-run"||t.phase!=="end"||typeof t.project!="string")return!1;let r=t.project,n=t.status==="clean"||t.status==="failing";return n===this.typechecked.has(r)?!1:(n?(this.typechecked.size>=100&&this.typechecked.delete(this.typechecked.values().next().value),this.typechecked.add(r),this.errors.splice(0,this.errors.length,...this.errors.filter(u=>!(u.project===r&&u.fault==="types")))):this.typechecked.delete(r),this.services.get(r)?.faults.has("types")??!1)}snapshot(){let e=[...this.services.values()].sort((r,n)=>r.project.localeCompare(n.project)).map(({faults:r,...n})=>({...n,buildFailed:r.has("build")||r.has("process")||r.has("unknown"),typeErrors:r.has("types")&&!this.typechecked.has(n.project)})),t=o(r=>e.filter(n=>n.state===r).map(n=>n.project),"byState");return{services:e,up:t("up"),down:t("down"),wedged:t("wedged"),crashLooping:t("crash-looping"),idle:t("idle"),buildFailed:e.filter(r=>r.buildFailed).map(r=>r.project),typeErrors:e.filter(r=>r.typeErrors).map(r=>r.project),restarts:e.reduce((r,n)=>r+n.restarts,0),errors:this.errors.slice(),incidents:this.incidents.slice()}}touch(e,t){let r=this.services.get(e);if(!r){if(this.services.size>=100){let n;for(let u of this.services.values())(!n||u.lastSeenAt<n.lastSeenAt)&&(n=u);n&&this.services.delete(n.project)}r={project:e,state:"starting",restarts:0,faults:new Set,lastTitle:"",lastSeenAt:t},this.services.set(e,r)}return r.lastSeenAt=t,r}},ys="agent://current-status",bs="process://cluster",QB=250,ex=new Set(["build","lint","typecheck","runtime","cluster","memory","visual","performance"]);function d6(e){let t=new YB,r=e.sessionId??"pending",n=new z2({thresholds:e.podRules??my(),sessionId:r,publish:o(d=>e.bus.publish(d),"publish")}),u,i=o(()=>{u||(u=setTimeout(()=>{u=void 0,e.resources.markDirty(ys)},QB),u.unref?.())},"scheduleStatusRefresh"),a=o(d=>{let c=t.ingest(d);c&&e.resources.markDirty(bs);let p=n.ingest(d);p&&e.resources.markDirty(Le),(c||p||ex.has(d.category))&&i()},"handler"),l=e.bus.subscribe(a);return e.resources.register(bs,()=>({schemaVersion:1,revision:e.resources.revision(bs)??0,updatedAt:new Date().toISOString(),...t.snapshot()})),e.resources.register(Le,()=>n.report(e.resources.revision(Le)??0)),e.resources.register(ys,()=>ps({resources:e.resources,sessionId:r,revision:e.resources.revision(ys)??0})),{unsubscribe:o(()=>{l(),u&&(clearTimeout(u),u=void 0)},"unsubscribe"),uris:[ys,bs,Le]}}s(d6,"Nh"),o(d6,"installAgentReducer");import{App as tx}from"@frontmcp/sdk";import{Resource as ux,ResourceContext as rx}from"@frontmcp/sdk";var cc=class extends rx{static{s(this,"Ph")}static{o(this,"FlowRecentResource")}async execute(){return this.get(Z).read("flow://recent")}};cc=F([ux({name:"flow-recent",uri:"flow://recent",mimeType:"application/json",description:"Last 50 flows seen this session, most recent first."})],cc);var nx=cc;import{Resource as ix,ResourceContext as sx}from"@frontmcp/sdk";var pc=class extends sx{static{s(this,"Ch")}static{o(this,"FlowCurrentResource")}async execute(){return this.get(Z).read("flow://current")}};pc=F([ix({name:"flow-current",uri:"flow://current",mimeType:"application/json",description:"The most recently active flow (origin + event count + headline)."})],pc);var ax=pc;import{Resource as ox,ResourceContext as lx}from"@frontmcp/sdk";var mc=class extends lx{static{s(this,"Lh")}static{o(this,"FlowOriginsRecentResource")}async execute(){return this.get(Z).read("flow://origins/recent")}};mc=F([ox({name:"flow-origins-recent",uri:"flow://origins/recent",mimeType:"application/json",description:"Last 50 flow-origin events (one per detected flow start)."})],mc);var dx=mc;import{Tool as cx,ToolContext as px,z as Es}from"@frontmcp/sdk";var c6;function fc(e){c6=e}s(fc,"ma"),o(fc,"setActiveFlowLookups");function Qe(){return c6}s(Qe,"ke"),o(Qe,"activeFlowLookups");var p6;function hc(e){p6=e}s(hc,"ha"),o(hc,"setFlowRecoverySource");function gc(){return p6}s(gc,"To"),o(gc,"flowRecoverySource");import{existsSync as mx}from"node:fs";import{open as fx}from"node:fs/promises";import{basename as hx}from"node:path";var ws="flow://recent",Ds="flow://current",$s="flow://origins/recent",Iu=50,m6=50,vc=2e3,gx=4*1024*1024,yc=32*1024*1024,vx=Iu+10;function bc(e){let t={flows:new Map,origins:[],recentOrder:[],retainedEvents:0,retainedBytes:0,evictedEvents:0,evictedForBytes:0,evictedFlows:0},r=e.register??!0,n=o((m,f,h,g=!0)=>{let b=Math.min(f,m.events.length);if(b<=0)return;if(g&&b>0&&(m.events[0]?.raw??{}).kind==="flow-origin"&&m.events.length>1){let $=m.eventBytes[1]??0;if(m.events.splice(1,1),m.eventBytes.splice(1,1),m.retainedBytes=Math.max(0,m.retainedBytes-$),t.retainedEvents=Math.max(0,t.retainedEvents-1),t.retainedBytes=Math.max(0,t.retainedBytes-$),t.evictedEvents+=1,h&&(t.evictedForBytes+=1),b-=1,b<=0)return}let x=0;for(let $=0;$<b;$+=1)x+=m.eventBytes[$]??0;m.events.splice(0,b),m.eventBytes.splice(0,b),m.retainedBytes=Math.max(0,m.retainedBytes-x),t.retainedEvents=Math.max(0,t.retainedEvents-b),t.retainedBytes=Math.max(0,t.retainedBytes-x),t.evictedEvents+=b,h&&(t.evictedForBytes+=b)},"evictPrefix"),u=o(m=>{let f=0,h=m.retainedBytes;for(;h>gx&&f<m.eventBytes.length;)h-=m.eventBytes[f]??0,f+=1;n(m,f,!0)},"enforceEntryByteCap"),i=o(()=>{for(let m=t.recentOrder.length-1;t.retainedBytes>yc&&m>=0;m-=1){let f=t.flows.get(t.recentOrder[m]);if(!f)continue;let h=0,g=t.retainedBytes;for(;g>yc&&h<f.eventBytes.length;)g-=f.eventBytes[h]??0,h+=1;n(f,h,!0)}},"enforceGlobalByteCap"),a=o(m=>{let f=m.context.flowId;if(!f)return;let h=(m.raw??{}).kind;if(h==="subscription-added"||h==="subscription-removed"||h==="hook-run"||h==="store-created"||h==="singleton-instance"||h==="visual-frame")return;let g=h==="flow-origin";(t.seenSince===void 0||m.timestamp<t.seenSince)&&(t.seenSince=m.timestamp);let b=t.flows.get(f);if(!b){b={summary:{flowId:f,originType:m.context.originType,originNodeId:m.context.originNodeId,startedAt:m.timestamp,lastSeenAt:m.timestamp,eventCount:0,headline:m.title},events:[],eventBytes:[],retainedBytes:0,hasOrigin:!1},t.flows.set(f,b);let w={flowId:f,originType:m.context.originType,originNodeId:m.context.originNodeId,at:m.timestamp,label:m.title,eventId:m.id};t.origins.push(w),t.origins.length>m6&&t.origins.splice(0,t.origins.length-m6),e.resources.markDirty($s)}g&&!b.hasOrigin&&(b.hasOrigin=!0,b.summary.headline=m.title,m.context.originType&&(b.summary.originType=m.context.originType),m.context.originNodeId&&(b.summary.originNodeId=m.context.originNodeId)),m.timestamp<b.summary.startedAt&&(b.summary.startedAt=m.timestamp);let x=os(m);b.events.push(m),b.eventBytes.push(x),b.retainedBytes+=x,t.retainedEvents+=1,t.retainedBytes+=x,b.events.length>vc&&n(b,b.events.length-vc,!1),u(b),b.summary.eventCount+=1,b.summary.lastSeenAt=m.timestamp;let $=t.recentOrder.indexOf(f);if($>=0&&t.recentOrder.splice($,1),t.recentOrder.unshift(f),t.recentOrder.length>Iu){let w=t.recentOrder.splice(Iu);for(let C of w){let k=t.flows.get(C);k&&(t.evictedFlows+=1,t.evictedThrough=Math.max(t.evictedThrough??0,k.summary.lastSeenAt),n(k,k.events.length,!1,!1)),t.flows.delete(C)}}i(),t.currentFlowId!==f&&(t.currentFlowId=f,e.resources.markDirty(Ds)),e.resources.markDirty(ws)},"handler"),l=e.bus.subscribe(a);e.resources.register(ws,()=>({schemaVersion:1,revision:e.resources.revision(ws)??0,updatedAt:new Date().toISOString(),flows:t.recentOrder.map(m=>t.flows.get(m)?.summary).filter(m=>!!m)})),e.resources.register(Ds,()=>{let m=t.currentFlowId,f=m?t.flows.get(m):void 0;return{schemaVersion:1,revision:e.resources.revision(Ds)??0,updatedAt:new Date().toISOString(),flow:f?.summary??null}}),e.resources.register($s,()=>({schemaVersion:1,revision:e.resources.revision($s)??0,updatedAt:new Date().toISOString(),origins:t.origins.slice().reverse()}));let d=e.flows??bt,c=new Map,p={getFlowEvents(m){return t.flows.get(m)?.events.slice().sort((f,h)=>f.timestamp-h.timestamp)},getFlowSummary(m){return t.flows.get(m)?.summary},recentFlowIds(){return t.recentOrder.slice()},findFlowsByOrigin(m){return[...t.flows.values()].filter(f=>f.summary.originNodeId===m).map(f=>f.summary)},flowsConfig:d,analyzeFlow(m){let f=t.flows.get(m);if(!f)return;let h=`${f.summary.eventCount}:${f.events.length}:${f.summary.lastSeenAt}`,g=c.get(m);if(g&&g.key===h)return c.delete(m),c.set(m,g),g.analysis;let b=as(p.getFlowEvents(m)??[],d);for(c.delete(m),c.set(m,{key:h,analysis:b});c.size>vx;)c.delete(c.keys().next().value);return b},classifiedRecent(m=Iu){let f=[];for(let h of t.recentOrder){if(f.length>=m)break;let g=t.flows.get(h)?.summary,b=p.analyzeFlow(h);!g||!b||f.push({summary:g,category:b.classification.category,decidedBy:b.classification.decidedBy,...b.classification.subject?{subject:b.classification.subject}:{},tags:b.classification.tags,segmentCount:b.segmentation.stats.segments,phaseCount:b.segmentation.stats.phases,signalCount:b.segmentation.stats.signal})}return f},window(){return{since:(t.evictedThrough!==void 0?Math.max(t.evictedThrough,t.seenSince??0):t.seenSince)??null,flows:t.flows.size,maxFlows:Iu,evicted:t.evictedFlows}}};return r&&fc(p),{unsubscribe:o(()=>{r&&fc(void 0),l()},"unsubscribe"),uris:[ws,Ds,$s],lookups:p,retentionStats:o(()=>({residentEvents:t.retainedEvents,residentBytes:t.retainedBytes,evictedEvents:t.evictedEvents,evictedForBytes:t.evictedForBytes,eventCap:Iu*vc,byteCap:yc}),"retentionStats")}}s(bc,"Ao"),o(bc,"installFlowReducer");var Ec={maxBytes:320*1024*1024,maxMs:2e3};function f6(e=process.env){let t=Number(e.LENSMCP_FLOW_RECOVER_BYTES??""),r=Number(e.LENSMCP_FLOW_RECOVER_MS??""),n=o(u=>(e[u]??"").trim()!=="","set");return{maxBytes:n("LENSMCP_FLOW_RECOVER_BYTES")&&Number.isFinite(t)&&t>=0?t:Ec.maxBytes,maxMs:n("LENSMCP_FLOW_RECOVER_MS")&&Number.isFinite(r)&&r>0?r:Ec.maxMs}}s(f6,"Wh"),o(f6,"recoveryBudgetFromEnv");var h6=1024*1024,wc=10;function g6(e,t){let r=[e];for(let n=1;n<=t;n++)r.push(`${e}.${n}`);return r.filter(n=>mx(n))}s(g6,"aO"),o(g6,"busFiles");function v6(e,t){try{let r=JSON.parse(e);return!r||typeof r!="object"||!("id"in r)||!("source"in r)?void 0:r.context?.flowId===t?r:void 0}catch{return}}s(v6,"cO"),o(v6,"eventOf");function y6(e,t,r,n){let u=e.indexOf(t);for(;u!==-1;){let i=e.lastIndexOf(wc,u)+1,a=e.indexOf(wc,u),l=v6(e.toString("utf8",i,a),r);l&&n.push(l),u=e.indexOf(t,a+1)}}s(y6,"uO"),o(y6,"collect");async function b6(e,t,r,n,u){let i=[],a={file:hx(e),size:0,read:0,matched:0},l;try{l=await fx(e,"r")}catch{return{searched:a,events:i}}let d=o(c=>(a.matched=i.length,{searched:a,events:i,...c?{stoppedBy:c}:{}}),"done");try{a.size=(await l.stat()).size;let c=Buffer.allocUnsafe(h6),p=Buffer.alloc(0);for(;a.read<a.size;){if(a.read>=n)return d("bytes");if(Date.now()>=u)return d("time");let m=Math.min(h6,a.size-a.read,n-a.read),{bytesRead:f}=await l.read(c,0,m,a.read);if(f<=0)break;a.read+=f;let h=p.length>0?Buffer.concat([p,c.subarray(0,f)]):c.subarray(0,f),g=h.lastIndexOf(wc);g>=0&&y6(h.subarray(0,g+1),t,r,i),p=Buffer.from(h.subarray(g+1))}}finally{await l.close().catch(()=>{})}return d()}s(b6,"lO"),o(b6,"searchFile");async function E6(e,t,r){let n=Date.now(),u=n+r.maxMs,i=Buffer.from(JSON.stringify(t)),a=[],l=[],d=0,c;for(let p of g6(e.eventFile,e.maxGenerations??20)){let m=await b6(p,i,t,r.maxBytes-d,u);if(a.push(m.searched),d+=m.searched.read,l.push(m.events),m.stoppedBy){c=m.stoppedBy;break}let f=l.some(g=>g.length>0),h=m.events.some(g=>g.raw?.kind==="flow-origin");if(f&&(h||m.events.length===0))break}return{events:l.reverse().flat(),files:a,bytesRead:d,elapsedMs:Date.now()-n,...c?{stoppedBy:c}:{}}}s(E6,"dO"),o(E6,"findFlowOnBus");var yx=4,en=new Map,Dc=new Map;function w6(e,t){let r=new h4,n=bc({bus:r,resources:new b4,...t.flows?{flows:t.flows}:{},register:!1});for(let u of e)r.publish(t.prepare(u));return n.unsubscribe(),n.lookups}s(w6,"fO"),o(w6,"replay");var D6="There is no bus file to search (LENSMCP_EVENT_FILE is not set for this server).",bx="Searching the bus files is turned off (LENSMCP_FLOW_RECOVER_BYTES=0).";function $c(e,t,r,n=D6){let u=`This server holds the ${t.maxFlows} most recently active flows${t.since!==null?` (every flow active since ${new Date(t.since).toISOString()})`:""}, and on start replays only the recent tail of the bus \u2014 this id is not among them.`,i=r?`Its search of the bus files ran out of budget (${r.stoppedBy==="time"?`${r.budgetMs} ms`:`${r.budgetBytes} bytes`}) before finding the flow.`:n;return{found:!1,flowId:e,reason:"outside-window",window:t,...r?{searched:r}:{},hint:`${u} ${i} The flow may still exist further back: re-run it to capture it fresh, raise LENSMCP_FLOW_RECOVER_BYTES / LENSMCP_FLOW_RECOVER_MS, or search .lensmcp/events.jsonl* for the id.`}}s($c,"ik"),o($c,"outsideWindow");async function $6(e,t,r,n,u){let i=await E6(r,t,n);if(i.events.length>0){let a=w6(i.events,r);if(!a.getFlowSummary(t))return{found:!1,flowId:t};let l={lookups:a,recovered:{from:"bus",files:i.files.filter(d=>d.matched>0).map(d=>d.file),events:i.events.length,complete:i.stoppedBy===void 0}};for(en.set(u,l);en.size>yx;)en.delete(en.keys().next().value);return l}if(i.stoppedBy){let a={files:i.files,bytes:i.bytesRead,budgetBytes:n.maxBytes,budgetMs:n.maxMs,stoppedBy:i.stoppedBy};return $c(t,e.window(),a)}return{found:!1,flowId:t}}s($6,"hO"),o($6,"search");async function Bc(e,t,r){if(e.getFlowSummary(t))return{lookups:e};let n=r?.budget??Ec;if(!r||n.maxBytes<=0){let l=e.window();return l.evicted>0?$c(t,l,void 0,r?bx:D6):{found:!1,flowId:t}}let u=`${r.eventFile}\0${t}`,i=en.get(u);if(i)return i;let a=Dc.get(u);return a||(a=$6(e,t,r,n,u).finally(()=>Dc.delete(u)),Dc.set(u,a)),a}s(Bc,"Jh"),o(Bc,"locateFlow");var Ex=120;function xc(e,t,r){return{id:e.id,kind:e.kind,label:e.label,category:t,phase:e.phase,startOffsetMs:Math.max(0,e.start-r),durationMs:e.durationMs,events:e.counts.total,signal:e.counts.signal,errors:e.counts.errors,worstSeverity:e.worstSeverity,projects:e.projects,...e.route?{route:e.route}:{},...e.method?{method:e.method}:{},...e.part?{part:e.part}:{},...e.hot?{hot:e.hot}:{},...e.after?{after:e.after}:{},...e.sql?{sql:e.sql}:{}}}s(xc,"Kh"),o(xc,"segmentView");function kc(e,t={}){let{segmentation:r,classification:n,segmentCategories:u}=e,i=Math.max(1,t.maxSegments??Ex),a=r.segments.reduce((c,p)=>Math.min(c,p.start),1/0),l=Number.isFinite(a)?a:0,d=r.segments;if(d.length>i){let c=o(m=>m.counts.errors*1e6+m.counts.signal,"rank"),p=new Set([...d].sort((m,f)=>c(f)-c(m)||(m.id<f.id?-1:1)).slice(0,i).map(m=>m.id));d=d.filter(m=>p.has(m.id))}return{flowId:r.flowId,category:n.category,decidedBy:n.decidedBy,...n.subject?{subject:n.subject}:{},tags:n.tags,origin:n.origin,stats:{events:r.stats.events,signal:r.stats.signal,bookkeeping:r.stats.bookkeeping,segments:r.stats.segments,phases:r.stats.phases},phases:r.phases.map(c=>({index:c.index,startOffsetMs:Math.max(0,c.start-l),endOffsetMs:Math.max(0,c.end-l),segmentIds:c.segmentIds})),segments:d.map(c=>xc(c,u[c.id]??"other",l)),segmentsTruncated:d.length<r.segments.length,...r.sql?{sql:r.sql}:{}}}s(kc,"Hh"),o(kc,"overviewOf");function B6(e,t,r){let n=t.segmentation.segments.find(i=>i.id===r);if(!n)return;let u=new Set(n.eventIds);return e.filter(i=>u.has(i.id))}s(B6,"sk"),o(B6,"eventsOfSegment");function x6(e,t){return e.filter(r=>(t.category===void 0||r.category===t.category)&&(t.tag===void 0||r.tags.includes(t.tag))&&(t.subject===void 0||r.subject===t.subject))}s(x6,"ak"),o(x6,"filterClassified");function k6(e){let t=e.map(r=>({category:r.category,...r.subject?{subject:r.subject}:{},id:r.summary.flowId}));return R3(t).map(r=>({category:r.category,count:r.count,subjects:r.subjects.map(n=>({...n.subject!==void 0?{subject:n.subject}:{},count:n.count,flowIds:n.items.map(u=>u.id)}))}))}s(k6,"ck"),o(k6,"groupClassified");function C6(e){let t={};for(let r of e)t[r.category]=(t[r.category]??0)+1;return t}s(C6,"uk"),o(C6,"categoryCounts");async function A6(e,t,r){if(!e)return Ac(e,t);let n=await Bc(e,t.flowId,r);if(!("lookups"in n))return n;let u=Ac(n.lookups,t);return n.recovered?{...u,recovered:n.recovered}:u}s(A6,"fk"),o(A6,"readFlowDetail");function Cc(e,t){let r=new Map(t.map(n=>[n.id,n.raw]));return e.map(n=>"ai"in n||!r.has(n.id)?n:{...n,raw:r.get(n.id)})}s(Cc,"lk"),o(Cc,"withRaw");function Ac(e,t){if(!e)return{found:!1,reason:"no active flow reducer"};let r=e.getFlowSummary(t.flowId),n=e.getFlowEvents(t.flowId);if(!r||!n)return{found:!1,flowId:t.flowId};let u=e.analyzeFlow(t.flowId);if(t.segmentId){let a=u?B6(n,u,t.segmentId):void 0,l=u?.segmentation.segments.find(p=>p.id===t.segmentId);if(!u||!a||!l)return{found:!1,flowId:t.flowId,segmentId:t.segmentId,reason:"unknown segment id for this flow (the flow may have changed \u2014 re-read overview.segments)",segmentIds:u?.segmentation.segments.map(p=>p.id)??[]};let d=u.segmentation.segments.reduce((p,m)=>Math.min(p,m.start),1/0),{events:c}=us(a,{includeRaw:t.includeRaw});return{found:!0,summary:r,segment:xc(l,u.segmentCategories[l.id]??"other",Number.isFinite(d)?d:l.start),truncated:c.length>t.limit,events:t.includeRaw?Cc(c.slice(0,t.limit),a):c.slice(0,t.limit)}}let{events:i}=us(n,{includeRaw:t.includeRaw});if(t.expand){let a=i.find(c=>c.id===t.expand);if(!a)return{found:!1,flowId:t.flowId,expand:t.expand};let l=new Set(a.memberIds??[a.id]),d=n.filter(c=>l.has(c.id));return{found:!0,flowId:t.flowId,expanded:{id:a.id,title:a.title,count:d.length},events:d.map(c=>({id:c.id,timestamp:c.timestamp,source:c.source,category:c.category,severity:c.severity,title:c.title,message:c.message,...t.includeRaw?{raw:c.raw}:{}}))}}return{found:!0,summary:r,...u?{overview:kc(u)}:{},truncated:i.length>t.limit,events:t.includeRaw?Cc(i.slice(0,t.limit),n):i.slice(0,t.limit)}}s(Ac,"dk"),o(Ac,"getFlowDetail");async function _6(e,t,r){if(e){let u=e.classifiedRecent(),i=x6(u,{...t.category?{category:t.category}:{},...t.tag?{tag:t.tag}:{}}),a=i.slice(0,t.limit);return{flows:a.map(l=>({...l.summary,category:l.category,decidedBy:l.decidedBy,...l.subject?{subject:l.subject}:{},tags:l.tags,segmentCount:l.segmentCount,phaseCount:l.phaseCount,signalCount:l.signalCount})),totalKnown:u.length,matching:i.length,categories:C6(u),...t.groupBy==="category"?{groups:k6(a)}:{}}}let n=await r();return{flows:n.flows.slice(0,t.limit),totalKnown:n.flows.length}}s(_6,"mk"),o(_6,"listRecentFlows");async function I6(e,t,r){if(!e)return _c(e,t);let n=await Bc(e,t.flowId,r);if(!("lookups"in n))return n;let u=_c(n.lookups,t);return n.recovered?{...u,recovered:n.recovered}:u}s(I6,"hk"),o(I6,"readFlowSegments");function _c(e,t){if(!e)return{found:!1,reason:"no active flow reducer"};let r=e.analyzeFlow(t.flowId);return r?{found:!0,...kc(r,{maxSegments:t.maxSegments})}:{found:!1,flowId:t.flowId}}s(_c,"pk"),o(_c,"getFlowSegments");var Ic=class extends px{static{s(this,"Xh")}static{o(this,"FlowListRecentTool")}async execute(e){return _6(Qe(),e,async()=>await this.get(Z).read("flow://recent"))}};Ic=F([cx({name:"flow.list_recent",description:'Lists the last N flows with their origin + event count + headline, and what each one IS: `category` (page-load, user-action, api, ai, test, or one you defined in nx.json#lensmcp.flows), `subject` (the templated page, component or route), `tags` (fan-out, has-error, slow, storm\u2026), `segmentCount`/`phaseCount`. Filter with `category` / `tag`; pass `groupBy: "category"` to also get the flows grouped category \u2192 subject; `categories` always counts every known flow per category. Same data as flow://recent but with a tunable limit.',inputSchema:{limit:Es.number().int().positive().max(50).default(10).describe("How many flows to return (default 10, max 50)."),category:Es.string().optional().describe('Only flows in this category, e.g. "page-load" or "checkout".'),tag:Es.string().optional().describe('Only flows carrying this tag, e.g. "has-error" or "fan-out".'),groupBy:Es.enum(["none","category"]).default("none").describe('"category" adds `groups`: the returned flows grouped category \u2192 subject.')}})],Ic);var wx=Ic;import{Tool as Dx,ToolContext as $x,z as tn}from"@frontmcp/sdk";var Sc=class extends $x{static{s(this,"Qh")}static{o(this,"FlowGetTool")}async execute(e){return A6(Qe(),e,gc())}};Sc=F([Dx({name:"flow.get",description:'Returns one flow as the ordered, parented mechanism tree the dashboard renders: each node has `parent`, `area`, `start`, `durationMs`, and repeated work is collapsed (`count`, `memberIds`). Pass `expand: "<node id>"` to list the individual events a collapsed node stands for, or `includeRaw: true` to add each event\'s full `raw` payload (an AI turn\'s is its `ai` field; a collapsed node carries its first member\'s \u2014 `expand` lists every member\'s). The response also carries `overview`: the flow cut into segments (one backend request each, UI bursts, the origin) grouped into phases, with its category, subject and tags \u2014 for a big flow read that first, then pass `segmentId: "<segment id>"` to get just that unit as a mechanism tree. Before summing SQL counts or time, read `overview.sql`: db-query events are flood-guarded per query shape, so only `status: "complete"` means they are every statement; `gaps` names the requests that fall short and by how much. Each request\'s verdict carries `basis`: `end` (accounted when the request ended) or `settled` (a quiet-period snapshot that later SQL in the same context could still change); `overview.sql.settled` counts the verdicts resting on one. A flow this server no longer holds in memory (it keeps the 50 most recently active, and replays only the recent tail of the bus on start) is read back from the bus files on demand: the same answer, plus `recovered` (`files`, `events`, and `complete: false` when older events may be missing). `found: false` alone means no event of this id is retained anywhere the server can read; `reason: "outside-window"` means it may exist further back than the server can see (`window`, `searched`, `hint`) \u2014 re-run the flow rather than concluding it never happened.',inputSchema:{flowId:tn.string().describe("Flow id from flow://recent."),includeRaw:tn.boolean().default(!1),limit:tn.number().int().positive().max(500).default(200),expand:tn.string().optional().describe("A node id from a previous call: returns the individual events it collapsed."),segmentId:tn.string().optional().describe("A segment id from `overview.segments` (or flow.segments): returns only that unit of the flow, shaped like the whole.")}})],Sc);var Bx=Sc;import{Tool as xx,ToolContext as kx,z as Cx}from"@frontmcp/sdk";var Fc=class extends kx{static{s(this,"tg")}static{o(this,"FlowFindByOriginTool")}async execute(e){let t=Qe();if(!t)return{found:!1,reason:"no active flow reducer"};let r=t.findFlowsByOrigin(e.originNodeId);return{found:r.length>0,count:r.length,flows:r}}};Fc=F([xx({name:"flow.find_by_origin",description:"Returns all flows whose origin node id matches `originNodeId` (e.g. a data-agent-component target).",inputSchema:{originNodeId:Cx.string().describe("Origin node id \u2014 usually the value of data-agent-component on the originating element.")}})],Fc);var Ax=Fc;import{Tool as _x,ToolContext as Ix,z as Sx}from"@frontmcp/sdk";import*as Fx from"node:fs";import{dirname as jx,join as S6}from"node:path";var zx="ai",Nx=/^ai_[0-9a-z]{8,40}$/,Bs=o(e=>typeof e=="string"&&Nx.test(e),"isAiCallId");function F6(e){return S6(jx(e),zx)}s(F6,"RO"),o(F6,"aiContentDir");function j6(e,t){if(!Bs(t))throw new Error("invalid ai call id");return S6(F6(e),`${t}.json`)}s(j6,"EO"),o(j6,"aiContentFile");function jc(e,t){if(Bs(t))try{let r=JSON.parse(Fx.readFileSync(j6(e,t),"utf8"));return r&&r.schemaVersion===1&&r.id===t?r:void 0}catch{return}}s(jc,"wa"),o(jc,"readAiContent");var zc=class extends Ix{static{s(this,"ng")}static{o(this,"AiGetCallTool")}async execute(e){if(!Bs(e.callId))return{found:!1,reason:"invalid call id"};let t=jc(process.env.LENSMCP_EVENT_FILE??`${process.cwd()}/.lensmcp/events.jsonl`,e.callId);return t?{found:!0,call:t}:{found:!1,callId:e.callId,reason:"no captured content for this call \u2014 it was not captured (LENSMCP_AI_CAPTURE=content), or it has been rotated away"}}};zc=F([_x({name:"ai.get_call",description:"Returns the prompt and completion of ONE AI call (OpenAI, Anthropic, \u2026) captured by the node tap: system prompt, messages, tools offered, completion, tool calls, usage. `callId` is the `ai.contentRef` of a flow node whose kind is `ai-call` (see flow.get). Only exists when the service ran with LENSMCP_AI_CAPTURE=content; the text was redacted and size-capped when it was captured, and `truncated: true` says if anything was cut.",inputSchema:{callId:Sx.string().describe('The contentRef of an ai-call flow node, e.g. "ai_0abc12345xyz78".')}})],zc);var Mx=zc;import{Tool as Ox,ToolContext as Rx,z as z6}from"@frontmcp/sdk";var Nc=class extends Rx{static{s(this,"og")}static{o(this,"FlowSegmentsTool")}async execute(e){return I6(Qe(),e,gc())}};Nc=F([Ox({name:"flow.segments",description:'Returns one flow cut into segments and phases \u2014 the right first read for a flow with hundreds or thousands of events. Each segment is a backend request (its browser fetch, every service hop, db/redis/ai work and any queue worker it enqueued), a UI burst (state updates and renders, named by what churned), the origin that started the flow, or background noise; with times relative to the flow start, event/error counts, and a category. Also returns the flow\'s category, subject and tags. Open one unit with flow.get { flowId, segmentId }. A flow no longer in memory is read back from the bus as in flow.get (`recovered`); `reason: "outside-window"` means it may exist further back than the server can see.',inputSchema:{flowId:z6.string().describe("Flow id from flow://recent or flow.list_recent."),maxSegments:z6.number().int().positive().max(500).default(120).describe("Cap on segments listed (failing and heaviest are kept first when it truncates).")}})],Nc);var Tx=Nc,N6=class{static{s(this,"ig")}static{o(this,"FlowApp")}};N6=F([tx({id:"flow",name:"Flow",description:"Causal-chain index: every event carries a flowId; the app surfaces recent flows + origin events. story.compile turns one of these into a phase summary.",resources:[nx,ax,dx],tools:[wx,Bx,Tx,Ax,Mx]})],N6);import{App as Px}from"@frontmcp/sdk";import{Resource as Ux,ResourceContext as qx}from"@frontmcp/sdk";var Mc=class extends qx{static{s(this,"sg")}static{o(this,"StoryRecentResource")}async execute(){return this.get(Z).read("story://recent")}};Mc=F([Ux({name:"story-recent",uri:"story://recent",mimeType:"application/json",description:"Last 50 compiled stories (one per flow), most recent first."})],Mc);var Zx=Mc;import{Resource as Lx,ResourceContext as Jx}from"@frontmcp/sdk";var Oc=class extends Jx{static{s(this,"cg")}static{o(this,"StoryLastResource")}async execute(){return this.get(Z).read("story://last")}};Oc=F([Lx({name:"story-last",uri:"story://last",mimeType:"application/json",description:"The most recently compiled story (full phase list)."})],Oc);var Vx=Oc;import{Tool as Wx,ToolContext as Gx,z as Kx}from"@frontmcp/sdk";var xs="story://recent",ks="story://last",Pe={byFlowId:new Map,order:[]},M6=!1;function O6(e){return M6||(e.resources.register(xs,()=>({schemaVersion:1,revision:e.resources.revision(xs)??0,updatedAt:new Date().toISOString(),stories:Pe.order.map(t=>Pe.byFlowId.get(t)).filter(t=>!!t).map(t=>({flowId:t.flowId,origin:t.origin,phaseCount:t.phases.length,startedAt:t.startedAt,endedAt:t.endedAt,eventCount:t.eventCount,finalState:t.finalState}))})),e.resources.register(ks,()=>{let t=Pe.order[0],r=t?Pe.byFlowId.get(t):void 0;return{schemaVersion:1,revision:e.resources.revision(ks)??0,updatedAt:new Date().toISOString(),story:r??null}}),M6=!0),R6(e.resources),{uris:[xs,ks]}}s(O6,"dg"),o(O6,"installStoryReducer");var Rc;function R6(e){Rc=o(t=>{e.markDirty(t)},"markDirty")}s(R6,"UO"),o(R6,"setMarkDirty");function Tc(e){Pe.byFlowId.set(e.flowId,e);let t=Pe.order.indexOf(e.flowId);if(t>=0&&Pe.order.splice(t,1),Pe.order.unshift(e.flowId),Pe.order.length>50){let r=Pe.order.splice(50);for(let n of r)Pe.byFlowId.delete(n)}Rc?.(xs),Rc?.(ks)}s(Tc,"zo"),o(Tc,"recordCompiledStory");function T6(e){return Pe.byFlowId.get(e)}s(T6,"pg"),o(T6,"getCompiledStory");var Pc=class extends Gx{static{s(this,"fg")}static{o(this,"StoryCompileTool")}async execute(e){let t=Qe();if(!t)return{compiled:!1,reason:"no active flow reducer"};let r=t.getFlowEvents(e.flowId);if(!r)return{compiled:!1,flowId:e.flowId};let n=va(r,{flowId:e.flowId});return n?(Tc(n),{compiled:!0,story:n}):{compiled:!1,flowId:e.flowId}}};Pc=F([Wx({name:"story.compile",description:"Compile a flow into a `FlowStory` (origin, phases, finalState). Caches the result; subsequent story.get(flowId) calls return it directly.",inputSchema:{flowId:Kx.string().describe("Flow id (from flow://recent).")}})],Pc);var Hx=Pc;import{Tool as Xx,ToolContext as Yx,z as Qx}from"@frontmcp/sdk";var Uc=class extends Yx{static{s(this,"hg")}static{o(this,"StoryGetTool")}async execute(e){let t=T6(e.flowId);return t?{found:!0,story:t}:{found:!1,flowId:e.flowId}}};Uc=F([Xx({name:"story.get",description:"Returns a previously compiled story. If the story has not been compiled yet, returns `found: false`; call story.compile first.",inputSchema:{flowId:Qx.string().describe("Flow id.")}})],Uc);var ek=Uc,P6=class{static{s(this,"vg")}static{o(this,"StoryApp")}};P6=F([Px({id:"story",name:"Story",description:"Compiles flows into phase summaries (user-action / loading-ui / backend-request / state-update / final-render).",resources:[Zx,Vx],tools:[Hx,ek]})],P6);import{App as tk}from"@frontmcp/sdk";import{Resource as uk,ResourceContext as rk}from"@frontmcp/sdk";var qc=class extends rk{static{s(this,"yg")}static{o(this,"BuildCurrentResource")}async execute(){return this.get(Z).read("build://current")}};qc=F([uk({name:"build-current",uri:"build://current",mimeType:"application/json",description:"Current build status (clean / warning / failing), open failures and warnings."})],qc);var nk=qc;import{Resource as ik,ResourceContext as sk}from"@frontmcp/sdk";var Zc=class extends sk{static{s(this,"wg")}static{o(this,"BuildFailuresResource")}async execute(){return this.get(Z).read("build://failures")}};Zc=F([ik({name:"build-failures",uri:"build://failures",mimeType:"application/json",description:"Currently-open build failures (deduped by fingerprint)."})],Zc);var ak=Zc;import{Resource as ok,ResourceContext as lk}from"@frontmcp/sdk";var Lc=class extends lk{static{s(this,"$g")}static{o(this,"BuildRecentResource")}async execute(){return this.get(Z).read("build://events/recent")}};Lc=F([ok({name:"build-events-recent",uri:"build://events/recent",mimeType:"application/json",description:"Last 50 build/lint/typecheck/HMR events in chronological order."})],Lc);var dk=Lc,U6=class{static{s(this,"kg")}static{o(this,"BuildApp")}};U6=F([tk({id:"build",name:"Build",description:"Vite / TS / lint / HMR state.",resources:[nk,ak,dk]})],U6);var Cs="build://current",As="build://failures",_s="build://events/recent",ck=new Set(["vite","rollup","typescript","eslint"]),q6=new Set(["build","typecheck","lint"]),Z6=50,pk="Install the LensMCP Vite plugin (@lensmcp/vite-plugin) in the dev server, or run under the dev cluster, so build events reach this session.";function L6(e){let t=e.raw;return t&&typeof t=="object"?t:{}}s(L6,"rz"),o(L6,"readRaw");function J6(e,t){return e==="typecheck"?"tsc":e==="lint"?"eslint":t}s(J6,"nz"),o(J6,"defaultTool");function V6(e){let t={status:"unknown",recent:[],failures:new Map,warnings:new Map,hmrUpdates:0,producers:new Map,sawVerdict:!1},r=o((f,h)=>{let g=t.producers.get(f);t.producers.set(f,{id:f,tool:h.tool,...h.project?{project:h.project}:{},firstReportedAt:g?.firstReportedAt??h.at,lastReportedAt:Math.max(g?.lastReportedAt??0,h.at),lastRunStatus:h.runStatus,errorCount:h.errorCount??g?.errorCount??0,...h.warningCount!==void 0?{warningCount:h.warningCount}:g?.warningCount!==void 0?{warningCount:g.warningCount}:{},...h.durationMs!==void 0?{lastRunDurationMs:h.durationMs}:g?.lastRunDurationMs!==void 0?{lastRunDurationMs:g.lastRunDurationMs}:{},...h.error?{error:h.error}:{}}),Zt(t.producers,Wr)},"touchProducer"),n=o(f=>{for(let[h,g]of t.failures)f(g)&&t.failures.delete(h);for(let[h,g]of t.warnings)f(g)&&t.warnings.delete(h)},"drop"),u=o((f,h)=>{n(g=>g.domain===f&&(h===void 0||g.project===h))},"clearScope"),i=o((f,h)=>{if(h.length===0)return;let g=new Set(h);n(b=>b.domain===f&&b.file!==void 0&&g.has(b.file))},"clearFiles"),a=o(()=>{if(t.failures.size>0){t.status="failing";return}if(t.warnings.size>0){t.status="warning";return}let f=[...t.producers.values()].some(h=>h.lastRunStatus==="error");t.status=f||!t.sawVerdict?"unknown":"clean"},"recomputeStatus"),l=o(()=>{e.resources.markDirty(Cs),e.resources.markDirty(As),e.resources.markDirty(_s)},"markDirty"),d=o(f=>{if([...t.failures.values()].some(h=>h.project===f)||[...t.warnings.values()].some(h=>h.project===f)||[...t.producers.values()].some(h=>h.project===f)){for(let h of q6)u(h,f);for(let[h,g]of t.producers)g.project===f&&t.producers.delete(h);t.sawVerdict=[...t.producers.values()].some(h=>h.lastRunStatus!=="error"),a(),l()}},"supersedeProject"),c=o(f=>{if(f.source==="gateway"&&f.category==="cluster"){let k=f.raw??null,M=k?.kind;(M==="service-starting"||M==="service-respawn")&&k?.project&&d(k.project);return}if(!ck.has(f.source)||!q6.has(f.category))return;let h=f.category,g=L6(f),b=g.project,x=g.tool??J6(h,f.source),$=`${x}:${b??"*"}`,w=typeof g.kind=="string"&&g.kind.endsWith("-run"),C={id:f.id,timestamp:f.timestamp,severity:f.severity,title:f.title,...f.message!==void 0?{message:f.message}:{},...f.location?.file?{file:f.location.file}:g.file?{file:g.file}:{},domain:h,...b?{project:b}:{},fingerprint:f.fingerprint};if(f.severity==="info"&&(w&&g.phase==="start"||f.title.startsWith("tsc clear")||f.title.startsWith("ESLint clear"))){u(h,b),t.lastRunAt=f.timestamp,un(t,C),r($,{tool:x,...b?{project:b}:{},at:f.timestamp,runStatus:"running"}),w||(t.sawVerdict=!0),a(),l();return}if(w&&g.phase==="end"){let k=g.status==="error"?"error":g.status==="failing"?"failing":"clean";k==="clean"&&u(h,b),k!=="error"&&(t.sawVerdict=!0),t.lastRunAt=f.timestamp,un(t,C),r($,{tool:x,...b?{project:b}:{},at:f.timestamp,runStatus:k,...g.durationMs!==void 0?{durationMs:g.durationMs}:{},...g.errorCount!==void 0?{errorCount:g.errorCount}:{},...g.warningCount!==void 0?{warningCount:g.warningCount}:{},...g.error?{error:g.error}:{}}),a(),l();return}if(g.kind==="hmr"||f.title.startsWith("HMR ")){t.hmrUpdates+=1;let k=[...C.file?[C.file]:[],...f.relatedFiles??[]];i("build",k),t.lastRunAt=f.timestamp,t.sawVerdict=!0,un(t,C),r($,{tool:x,...b?{project:b}:{},at:f.timestamp,runStatus:"clean"}),a(),l();return}un(t,C),f.severity==="error"||f.severity==="fatal"?(t.failures.set(C.fingerprint,C),t.warnings.delete(C.fingerprint)):f.severity==="warning"?t.failures.has(C.fingerprint)||t.warnings.set(C.fingerprint,C):(t.failures.delete(C.fingerprint),t.warnings.delete(C.fingerprint)),t.lastRunAt=f.timestamp,t.sawVerdict=!0,r($,{tool:x,...b?{project:b}:{},at:f.timestamp,runStatus:t.failures.size>0?"failing":"clean"}),a(),l()},"handler"),p=e.bus.subscribe(c),m=o(()=>Xi({producers:[...t.producers.values()],domain:"build",noProducerHint:pk}),"health");return e.resources.register(Cs,()=>({schemaVersion:1,revision:e.resources.revision(Cs)??0,updatedAt:new Date().toISOString(),status:t.status,failures:[...t.failures.values()],warnings:[...t.warnings.values()],hmrUpdates:t.hmrUpdates,lastRunAt:t.lastRunAt,...m()})),e.resources.register(As,()=>({schemaVersion:1,revision:e.resources.revision(As)??0,updatedAt:new Date().toISOString(),failures:[...t.failures.values()],...m()})),e.resources.register(_s,()=>({schemaVersion:1,revision:e.resources.revision(_s)??0,updatedAt:new Date().toISOString(),events:t.recent.slice()})),{unsubscribe:p,uris:[Cs,As,_s]}}s(V6,"Sg"),o(V6,"installBuildReducer");function un(e,t){e.recent.push(t),e.recent.length>Z6&&e.recent.splice(0,e.recent.length-Z6)}s(un,"Ia"),o(un,"pushRecent");import{App as mk}from"@frontmcp/sdk";import{Resource as fk,ResourceContext as hk}from"@frontmcp/sdk";var Jc=class extends hk{static{s(this,"Ig")}static{o(this,"LintCurrentResource")}async execute(){return this.get(Z).read("lint://current")}};Jc=F([fk({name:"lint-current",uri:"lint://current",mimeType:"application/json",description:"Current lint status (clean / warning / failing) + counts."})],Jc);var gk=Jc;import{Resource as vk,ResourceContext as yk}from"@frontmcp/sdk";var Vc=class extends yk{static{s(this,"Eg")}static{o(this,"LintErrorsResource")}async execute(){return this.get(Z).read("lint://errors")}};Vc=F([vk({name:"lint-errors",uri:"lint://errors",mimeType:"application/json",description:"Currently-open ESLint errors (deduped by fingerprint)."})],Vc);var bk=Vc;import{Resource as Ek,ResourceContext as wk}from"@frontmcp/sdk";var Wc=class extends wk{static{s(this,"Ag")}static{o(this,"LintWarningsResource")}async execute(){return this.get(Z).read("lint://warnings")}};Wc=F([Ek({name:"lint-warnings",uri:"lint://warnings",mimeType:"application/json",description:"Currently-open ESLint warnings."})],Wc);var Dk=Wc,W6=class{static{s(this,"Og")}static{o(this,"LintApp")}};W6=F([mk({id:"lint",name:"Lint",description:"ESLint state.",resources:[gk,bk,Dk]})],W6);var Is="lint://current",Ss="lint://errors",Fs="lint://warnings",$k="Nothing runs ESLint in the dev loop, so this is expected. Run `lensmcp lint [paths\u2026]` to publish a run; until then treat lint as UNCHECKED, not passing.";function G6(e){let t=e.raw;return t&&typeof t=="object"?t:{}}s(G6,"pz"),o(G6,"readRaw");function K6(e){let t={status:"unknown",errors:new Map,warnings:new Map,producers:new Map,sawVerdict:!1},r=o((p,m)=>{let f=t.producers.get(p);t.producers.set(p,{id:p,tool:m.tool,...m.project?{project:m.project}:{},firstReportedAt:f?.firstReportedAt??m.at,lastReportedAt:Math.max(f?.lastReportedAt??0,m.at),lastRunStatus:m.runStatus,errorCount:m.errorCount??f?.errorCount??0,...m.warningCount!==void 0?{warningCount:m.warningCount}:f?.warningCount!==void 0?{warningCount:f.warningCount}:{},...m.durationMs!==void 0?{lastRunDurationMs:m.durationMs}:f?.lastRunDurationMs!==void 0?{lastRunDurationMs:f.lastRunDurationMs}:{},...m.error?{error:m.error}:{}}),Zt(t.producers,Wr)},"touchProducer"),n=o((p,m)=>{let f=o((h,g)=>{for(let[b,x]of h)g(x)&&h.delete(b)},"drop");if(p){f(t.errors,h=>h.project===p),f(t.warnings,h=>h.project===p);return}if(m){f(t.errors,h=>h.file===m),f(t.warnings,h=>h.file===m);return}t.errors.clear(),t.warnings.clear()},"clearScope"),u=o(()=>{if(t.errors.size>0){t.status="failing";return}if(t.warnings.size>0){t.status="warning";return}let p=[...t.producers.values()].some(m=>m.lastRunStatus==="error");t.status=p||!t.sawVerdict?"unknown":"clean"},"recomputeStatus"),i=o(()=>{e.resources.markDirty(Is),e.resources.markDirty(Ss),e.resources.markDirty(Fs)},"markDirty"),a=o(p=>{if([...t.errors.values()].some(m=>m.project===p)||[...t.warnings.values()].some(m=>m.project===p)||[...t.producers.values()].some(m=>m.project===p)){n(p,void 0);for(let[m,f]of t.producers)f.project===p&&t.producers.delete(m);t.sawVerdict=[...t.producers.values()].some(m=>m.lastRunStatus!=="error"),u(),i()}},"supersedeProject"),l=o(p=>{if(p.source==="gateway"&&p.category==="cluster"){let w=p.raw??null,C=w?.kind;(C==="service-starting"||C==="service-respawn")&&w?.project&&a(w.project);return}if(p.source!=="eslint"||p.category!=="lint")return;let m=G6(p),f=m.project,h=m.tool??"eslint",g=`${h}:${f??"*"}`,b=m.kind==="lint-run";if(p.severity==="info"&&(b&&m.phase==="start"||p.title.startsWith("ESLint clear"))){n(f,p.location?.file),t.lastRunAt=p.timestamp,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:"running"}),b||(t.sawVerdict=!0),u(),i();return}if(b&&m.phase==="end"){let w=m.status==="error"?"error":m.status==="failing"?"failing":"clean";w!=="error"&&(t.sawVerdict=!0),t.lastRunAt=p.timestamp,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:w,...m.durationMs!==void 0?{durationMs:m.durationMs}:{},...m.errorCount!==void 0?{errorCount:m.errorCount}:{},...m.warningCount!==void 0?{warningCount:m.warningCount}:{},...m.error?{error:m.error}:{}}),u(),i();return}let x=p.title.match(/^\[([^\]]+)\]/),$={id:p.id,timestamp:p.timestamp,severity:p.severity,...m.rule?{rule:m.rule}:x?.[1]?{rule:x[1]}:{},message:p.message??p.title,...p.location?.file?{file:p.location.file}:{},...p.location?.line!==void 0?{line:p.location.line}:{},...p.location?.column!==void 0?{column:p.location.column}:{},...f?{project:f}:{},fingerprint:p.fingerprint};if(p.severity==="error"||p.severity==="fatal")t.errors.set($.fingerprint,$),t.warnings.delete($.fingerprint);else if(p.severity==="warning")t.errors.has($.fingerprint)||t.warnings.set($.fingerprint,$);else return;t.lastRunAt=p.timestamp,t.sawVerdict=!0,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:t.errors.size>0?"failing":"clean"}),u(),i()},"handler"),d=e.bus.subscribe(l),c=o(()=>Xi({producers:[...t.producers.values()],domain:"lint",noProducerHint:$k}),"health");return e.resources.register(Is,()=>({schemaVersion:1,revision:e.resources.revision(Is)??0,updatedAt:new Date().toISOString(),status:t.status,errorCount:t.errors.size,warningCount:t.warnings.size,lastRunAt:t.lastRunAt,...c()})),e.resources.register(Ss,()=>({schemaVersion:1,revision:e.resources.revision(Ss)??0,updatedAt:new Date().toISOString(),errors:[...t.errors.values()],...c()})),e.resources.register(Fs,()=>({schemaVersion:1,revision:e.resources.revision(Fs)??0,updatedAt:new Date().toISOString(),warnings:[...t.warnings.values()],...c()})),{unsubscribe:d,uris:[Is,Ss,Fs]}}s(K6,"zg"),o(K6,"installLintReducer");import{App as Bk}from"@frontmcp/sdk";import{Resource as xk,ResourceContext as kk}from"@frontmcp/sdk";var Gc=class extends kk{static{s(this,"Mg")}static{o(this,"TypecheckCurrentResource")}async execute(){return this.get(Z).read("typecheck://current")}};Gc=F([xk({name:"typecheck-current",uri:"typecheck://current",mimeType:"application/json",description:"Current TypeScript typecheck status + error count."})],Gc);var Ck=Gc;import{Resource as Ak,ResourceContext as _k}from"@frontmcp/sdk";var Kc=class extends _k{static{s(this,"Pg")}static{o(this,"TypecheckErrorsResource")}async execute(){return this.get(Z).read("typecheck://errors")}};Kc=F([Ak({name:"typecheck-errors",uri:"typecheck://errors",mimeType:"application/json",description:"Current TypeScript errors (deduped by fingerprint)."})],Kc);var Ik=Kc,H6=class{static{s(this,"Cg")}static{o(this,"TypecheckApp")}};H6=F([Bk({id:"typecheck",name:"Typecheck",description:"TypeScript diagnostics from `tsc --watch`.",resources:[Ck,Ik]})],H6);var js="typecheck://current",zs="typecheck://errors",Sk="Wire one: the dev cluster publishes from `TsgoCheckPlugin` when `LENSMCP_TYPECHECK=tsgo` (@lensmcp/cluster), or call `startTscCollector()` from @lensmcp/session for a `tsc --watch` workspace.";function X6(e){let t=e.raw;return t&&typeof t=="object"?t:{}}s(X6,"bz"),o(X6,"readRaw");function Y6(e){let t={status:"unknown",errors:new Map,producers:new Map,sawVerdict:!1},r=o((p,m)=>{let f=t.producers.get(p),h={id:p,tool:m.tool,...m.project?{project:m.project}:{},firstReportedAt:f?.firstReportedAt??m.at,lastReportedAt:Math.max(f?.lastReportedAt??0,m.at),lastRunStatus:m.runStatus,errorCount:m.errorCount??f?.errorCount??0,...m.durationMs!==void 0?{lastRunDurationMs:m.durationMs}:f?.lastRunDurationMs!==void 0?{lastRunDurationMs:f.lastRunDurationMs}:{},...m.warningCount!==void 0?{warningCount:m.warningCount}:{},...m.error?{error:m.error}:{}};t.producers.set(p,h),Zt(t.producers,Wr)},"touchProducer"),n=o(p=>{if(!p){t.errors.clear();return}for(let[m,f]of t.errors)f.project===p&&t.errors.delete(m)},"clearScope"),u=o(()=>{if(t.errors.size>0){t.status="failing";return}let p=[...t.producers.values()].some(m=>m.lastRunStatus==="error");t.status=p||!t.sawVerdict?"unknown":"clean"},"recomputeStatus"),i=o(()=>{e.resources.markDirty(js),e.resources.markDirty(zs)},"markDirty"),a=o(p=>{let m=[...t.errors.values()].some(h=>h.project===p),f=[...t.producers.values()].some(h=>h.project===p);if(!(!m&&!f)){n(p);for(let[h,g]of t.producers)g.project===p&&t.producers.delete(h);t.sawVerdict=[...t.producers.values()].some(h=>h.lastRunStatus!=="error"),u(),i()}},"supersedeProject"),l=o(p=>{if(p.source==="gateway"&&p.category==="cluster"){let w=p.raw??null,C=w?.kind;(C==="service-starting"||C==="service-respawn")&&w?.project&&a(w.project);return}if(p.source!=="typescript"||p.category!=="typecheck")return;let m=X6(p),f=m.project,h=m.tool??"tsc",g=`${h}:${f??"*"}`,b=m.kind==="typecheck-run";if(p.severity==="info"&&(b&&m.phase==="start"||p.title.startsWith("tsc clear"))){n(f),t.lastRunAt=p.timestamp,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:"running"}),b||(t.sawVerdict=!0),u(),i();return}if(b&&m.phase==="end"){let w=m.status==="error"?"error":m.status==="failing"?"failing":"clean";w!=="error"&&(t.sawVerdict=!0),t.lastRunAt=p.timestamp,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:w,...m.durationMs!==void 0?{durationMs:m.durationMs}:{},...m.errorCount!==void 0?{errorCount:m.errorCount}:{},...m.warningCount!==void 0?{warningCount:m.warningCount}:{},...m.error?{error:m.error}:{}}),u(),i();return}if(p.severity!=="error"&&p.severity!=="fatal")return;let x=p.title.match(/\bTS(\d+):/),$={id:p.id,timestamp:p.timestamp,...m.code?{code:m.code}:x?{code:`TS${x[1]}`}:{},message:p.message??p.title,...p.location?.file?{file:p.location.file}:{},...p.location?.line!==void 0?{line:p.location.line}:{},...p.location?.column!==void 0?{column:p.location.column}:{},...f?{project:f}:{},fingerprint:p.fingerprint};t.errors.set($.fingerprint,$),t.lastRunAt=p.timestamp,t.sawVerdict=!0,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:"failing"}),u(),i()},"handler"),d=e.bus.subscribe(l),c=o(()=>Xi({producers:[...t.producers.values()],domain:"typecheck",noProducerHint:Sk}),"health");return e.resources.register(js,()=>({schemaVersion:1,revision:e.resources.revision(js)??0,updatedAt:new Date().toISOString(),status:t.status,errorCount:t.errors.size,lastRunAt:t.lastRunAt,...c()})),e.resources.register(zs,()=>({schemaVersion:1,revision:e.resources.revision(zs)??0,updatedAt:new Date().toISOString(),errors:[...t.errors.values()],...c()})),{unsubscribe:d,uris:[js,zs]}}s(Y6,"Ug"),o(Y6,"installTypecheckReducer");import{App as Fk}from"@frontmcp/sdk";import{Resource as jk,ResourceContext as zk}from"@frontmcp/sdk";var Hc=class extends zk{static{s(this,"Lg")}static{o(this,"BundleCurrentResource")}async execute(){return this.get(Z).read("bundle://current")}};Hc=F([jk({name:"bundle-current",uri:"bundle://current",mimeType:"application/json",description:"Most recent Vite/Rollup bundle report (chunks + sizes)."})],Hc);var Nk=Hc;import{Resource as Mk,ResourceContext as Ok}from"@frontmcp/sdk";var Xc=class extends Ok{static{s(this,"Bg")}static{o(this,"BundleChunksResource")}async execute(){return this.get(Z).read("bundle://chunks")}};Xc=F([Mk({name:"bundle-chunks",uri:"bundle://chunks",mimeType:"application/json",description:"Per-chunk bundle sizes (most recent build)."})],Xc);var Rk=Xc;import{Resource as Tk,ResourceContext as Pk}from"@frontmcp/sdk";var Yc=class extends Pk{static{s(this,"Zg")}static{o(this,"BundleModulesResource")}async execute(){return this.get(Z).read("bundle://modules")}};Yc=F([Tk({name:"bundle-modules",uri:"bundle://modules",mimeType:"application/json",description:"Flattened per-module bundle sizes (most recent build)."})],Yc);var Uk=Yc;import{Resource as qk,ResourceContext as Zk}from"@frontmcp/sdk";var Qc=class extends Zk{static{s(this,"Gg")}static{o(this,"BundleRegressionsResource")}async execute(){return this.get(Z).read("bundle://regressions")}};Qc=F([qk({name:"bundle-regressions",uri:"bundle://regressions",mimeType:"application/json",description:"Chunks/modules that grew, were added, or were removed vs the baseline."})],Qc);var Lk=Qc;import{Resource as Jk,ResourceContext as Vk}from"@frontmcp/sdk";var ep=class extends Vk{static{s(this,"Jg")}static{o(this,"BundleCompareResource")}async execute(){return this.get(Z).read("bundle://compare/latest")}};ep=F([Jk({name:"bundle-compare-latest",uri:"bundle://compare/latest",mimeType:"application/json",description:"Most recent build vs baseline: totals + delta."})],ep);var Wk=ep,Q6=class{static{s(this,"Hg")}static{o(this,"BundleApp")}};Q6=F([Fk({id:"bundle",name:"Bundle",description:"Vite/Rollup bundle reports + regressions against baseline.",resources:[Nk,Rk,Uk,Lk,Wk]})],Q6);function tp(e,t){let r=[],n=new Map(e.chunks.map(i=>[i.name,i])),u=new Map(t.chunks.map(i=>[i.name,i]));for(let[i,a]of u){let l=n.get(i);if(!l){r.push({kind:"chunk-added",name:i,afterBytes:a.sizeBytes,deltaBytes:a.sizeBytes});continue}let d=a.sizeBytes-l.sizeBytes;d>256&&r.push({kind:"chunk-grew",name:i,beforeBytes:l.sizeBytes,afterBytes:a.sizeBytes,deltaBytes:d}),r.push(...eb(l,a))}for(let[i,a]of n)u.has(i)||r.push({kind:"chunk-removed",name:i,beforeBytes:a.sizeBytes,deltaBytes:-a.sizeBytes});return r.sort((i,a)=>Math.abs(a.deltaBytes)-Math.abs(i.deltaBytes))}s(tp,"Oa"),o(tp,"compareReports");function eb(e,t){let r=[],n=new Map(e.modules.map(u=>[u.id,u.sizeBytes]));for(let u of t.modules){let i=n.get(u.id);if(i===void 0)u.sizeBytes>256&&r.push({kind:"module-added",name:`${t.name}::${u.id}`,afterBytes:u.sizeBytes,deltaBytes:u.sizeBytes});else{let a=u.sizeBytes-i;a>256&&r.push({kind:"module-grew",name:`${t.name}::${u.id}`,beforeBytes:i,afterBytes:u.sizeBytes,deltaBytes:a})}}return r}s(eb,"jz"),o(eb,"compareModules");var Ns="bundle://current",Ms="bundle://chunks",Os="bundle://modules",rn="bundle://regressions",nn="bundle://compare/latest";function tb(e){let t={baseline:e.initialBaseline,regressions:[]},r=o(u=>{if(u.source!=="rollup"&&u.source!=="vite"||u.category!=="build")return;let i=u.raw;if(!i||typeof i!="object"||!("kind"in i)||i.kind!=="bundle-report")return;let a=i.report;!a||!Array.isArray(a.chunks)||(t.current=a,t.regressions=t.baseline?tp(t.baseline,a):[],e.resources.markDirty(Ns),e.resources.markDirty(Ms),e.resources.markDirty(Os),e.resources.markDirty(rn),e.resources.markDirty(nn))},"handler"),n=e.bus.subscribe(r);return e.resources.register(Ns,()=>({schemaVersion:1,revision:e.resources.revision(Ns)??0,updatedAt:new Date().toISOString(),report:t.current??null})),e.resources.register(Ms,()=>({schemaVersion:1,revision:e.resources.revision(Ms)??0,updatedAt:new Date().toISOString(),chunks:t.current?.chunks??[]})),e.resources.register(Os,()=>{let u=t.current?.chunks.flatMap(i=>i.modules.map(a=>({...a,chunk:i.name})))??[];return{schemaVersion:1,revision:e.resources.revision(Os)??0,updatedAt:new Date().toISOString(),modules:u}}),e.resources.register(rn,()=>({schemaVersion:1,revision:e.resources.revision(rn)??0,updatedAt:new Date().toISOString(),regressions:t.regressions.slice()})),e.resources.register(nn,()=>({schemaVersion:1,revision:e.resources.revision(nn)??0,updatedAt:new Date().toISOString(),baseline:t.baseline??null,current:t.current??null,deltaBytes:t.baseline&&t.current?t.current.totalBytes-t.baseline.totalBytes:0})),{unsubscribe:n,uris:[Ns,Ms,Os,rn,nn],setBaseline:o(u=>{t.baseline=u,t.current&&(t.regressions=tp(t.baseline,t.current)),e.resources.markDirty(rn),e.resources.markDirty(nn)},"setBaseline")}}s(tb,"Xg"),o(tb,"installBundleReducer");import{App as Gk}from"@frontmcp/sdk";import{Resource as Kk,ResourceContext as Hk}from"@frontmcp/sdk";var up=class extends Hk{static{s(this,"Yg")}static{o(this,"RuntimeBrowserConsoleResource")}async execute(){return this.get(Z).read("runtime://browser/console")}};up=F([Kk({name:"runtime-browser-console",uri:"runtime://browser/console",mimeType:"application/json",description:"Most recent 200 console.* messages from any tab."})],up);var Xk=up;import{Resource as Yk,ResourceContext as Qk}from"@frontmcp/sdk";var rp=class extends Qk{static{s(this,"ev")}static{o(this,"RuntimeBrowserErrorsResource")}async execute(){return this.get(Z).read("runtime://browser/errors")}};rp=F([Yk({name:"runtime-browser-errors",uri:"runtime://browser/errors",mimeType:"application/json",description:"Uncaught browser errors + promise rejections, per tab, since that tab's current page load (a reload retracts the previous document's errors)."})],rp);var eC=rp;import{Resource as tC,ResourceContext as uC}from"@frontmcp/sdk";var np=class extends uC{static{s(this,"rv")}static{o(this,"RuntimeServerErrorsResource")}async execute(){return this.get(Z).read("runtime://errors")}};np=F([tC({name:"runtime-errors",uri:"runtime://errors",mimeType:"application/json",description:"Errors raised INSIDE a backend pod, with no browser involved \u2014 the 500s a curl, an e2e runner or a queue job produces. Each entry carries the route, the status, the request id the gateway stamped, and the stack. Use this when a server-side call failed and no browser flow exists to explain it; `runtime://browser/errors` is the browser-side counterpart."})],np);var rC=np;import{Resource as nC,ResourceContext as iC}from"@frontmcp/sdk";var ip=class extends iC{static{s(this,"ov")}static{o(this,"RuntimeBrowserNetworkResource")}async execute(){return this.get(Z).read("runtime://browser/network")}};ip=F([nC({name:"runtime-browser-network",uri:"runtime://browser/network",mimeType:"application/json",description:"Recent fetch / XHR / browser network activity."})],ip);var sC=ip;import{Resource as aC,ResourceContext as oC}from"@frontmcp/sdk";var sp=class extends oC{static{s(this,"sv")}static{o(this,"RuntimeBrowserFailedRequestsResource")}async execute(){return this.get(Z).read("runtime://browser/failed-requests")}};sp=F([aC({name:"runtime-browser-failed-requests",uri:"runtime://browser/failed-requests",mimeType:"application/json",description:"Recent failed network requests (status >= 400 or transport errors)."})],sp);var lC=sp;import{Resource as dC,ResourceContext as cC}from"@frontmcp/sdk";var ap=class extends cC{static{s(this,"cv")}static{o(this,"RuntimeDismissedResource")}async execute(){return this.get(Z).read("runtime://dismissed")}};ap=F([dC({name:"runtime-dismissed",uri:"runtime://dismissed",mimeType:"application/json",description:"Errors someone DISMISSED by hand \u2014 in the dashboard, at the CLI, or an agent through observe.dismiss_errors \u2014 with who did it and the reason they gave. A dismissed error is hidden from runtime://errors and the browser error lists, not fixed: it shows again the next time it happens. Read this when an error list is shorter than you expected."})],ap);var pC=ap,ub=class{static{s(this,"lv")}static{o(this,"RuntimeApp")}};ub=F([Gk({id:"runtime",name:"Runtime",description:"Live browser/node runtime state (console, errors, network).",resources:[Xk,eC,rC,sC,lC,pC]})],ub);var Su="runtime://browser/console",wt="runtime://browser/errors",Fu="runtime://browser/network",Dt="runtime://browser/failed-requests",$t="runtime://errors",sn="runtime://dismissed",mC=200,rb=100,fC=200,hC=50,gC=500,vC="default",yC=1e3,op=o(e=>e??vC,"tabOf");function nb(e){if(e.category!=="runtime")return!1;let t=e.raw;return t&&typeof t=="object"&&t.kind==="ready"?!0:e.title==="Client runtime ready"}s(nb,"Xz"),o(nb,"isDocumentBoundary");function ib(e){if(e.category!=="runtime")return!1;let t=e.raw;return!!(t&&typeof t=="object"&&t.kind==="gone")}s(ib,"Yz"),o(ib,"isTabGone");function sb(e){let t=(e.now??(()=>Date.now()))(),r={console:[],errors:[],network:[],failed:[],serverErrors:[],readyByTab:new Map,dismissed:new Map,changedAt:new Map},n=o((c,p)=>{r.changedAt.set(c,p),e.resources.markDirty(c)},"touch"),u=o((c,p,m)=>{let f=c.filter(h=>!(op(h.tabId)===p&&h.timestamp<m));f.length!==c.length&&(c.length=0,c.push(...f))},"retract"),i=o(c=>{let p=kd(c);if(p){let f=r.dismissed.get(p.groupId);r.dismissed.delete(p.groupId),p.kind===xu&&(r.dismissed.set(p.groupId,{eventIds:new Set(p.eventIds),at:c.timestamp,...p.by?{by:p.by}:{},...p.reason?{reason:p.reason}:{},...p.title?{title:p.title}:{}}),r.dismissed.size>gC&&r.dismissed.delete(r.dismissed.keys().next().value));let h=new Set([...f?.eventIds??[],...r.dismissed.get(p.groupId)?.eventIds??[]]);for(let[g,b]of[[$t,r.serverErrors],[wt,r.errors],[Dt,r.failed]])b.some(x=>h.has(x.id))&&n(g,c.timestamp);n(sn,c.timestamp);return}if(ab(c)){let f=c.raw?.project;if(f){let h=r.serverErrors.length;r.serverErrors=r.serverErrors.filter(g=>g.project!==f),r.serverErrors.length!==h&&n($t,c.timestamp)}return}if(ob(c)){r.lastServerEventAt=Math.max(r.lastServerEventAt??0,c.timestamp),ju(r.serverErrors,lb(c),rb),n($t,c.timestamp);return}if(!(c.source==="client-runtime"||c.source==="chrome")&&!(c.source==="react"&&c.category==="network"))return;if(r.lastEventAt=Math.max(r.lastEventAt??0,c.timestamp),ib(c)){let f=op(c.context.tabId);u(r.errors,f,Number.POSITIVE_INFINITY),u(r.failed,f,Number.POSITIVE_INFINITY),r.readyByTab.delete(f);for(let h of[wt,Dt,Su,Fu])n(h,c.timestamp);return}if(nb(c)){let f=op(c.context.tabId);r.readyByTab.set(f,Math.max(r.readyByTab.get(f)??0,c.timestamp)),r.lastReadyAt=Math.max(r.lastReadyAt??0,c.timestamp);let h=c.timestamp-yC;u(r.errors,f,h),u(r.failed,f,h);for(let g of[wt,Dt,Su,Fu])n(g,c.timestamp);return}let m={id:c.id,timestamp:c.timestamp,severity:c.severity,title:c.title,message:c.message,source:c.source,fingerprint:c.fingerprint,tabId:c.context.tabId,url:c.context.url,raw:c.raw};if(c.category==="network"){ju(r.network,m,fC),n(Fu,c.timestamp),c.severity==="error"&&(ju(r.failed,m,hC),n(Dt,c.timestamp));return}(c.severity==="error"||c.severity==="fatal")&&(ju(r.errors,m,rb),n(wt,c.timestamp)),c.title?.startsWith("console.")&&(ju(r.console,m,mC),n(Su,c.timestamp))},"handler"),a=e.bus.subscribe(i),l=new Set([$t,wt,Dt]),d=o((c,p)=>{if(!l.has(c)||r.dismissed.size===0)return dp(e.resources,c,p,r,t,0);let m=new Set([...r.dismissed.values()].flatMap(h=>[...h.eventIds])),f=p.filter(h=>!m.has(h.id));return dp(e.resources,c,f,r,t,p.length-f.length)},"snap");return e.resources.register($t,()=>d($t,r.serverErrors)),e.resources.register(Su,()=>d(Su,r.console)),e.resources.register(wt,()=>d(wt,r.errors)),e.resources.register(Fu,()=>d(Fu,r.network)),e.resources.register(Dt,()=>d(Dt,r.failed)),e.resources.register(sn,()=>{let c=new Set([...r.serverErrors,...r.errors,...r.failed].map(m=>m.id)),p=[...r.dismissed].map(([m,f])=>({id:m,at:f.at,...f.by?{by:f.by}:{},...f.reason?{reason:f.reason}:{},...f.title?{title:f.title}:{},eventIds:[...f.eventIds],hiding:[...f.eventIds].filter(h=>c.has(h)).length}));return{schemaVersion:1,revision:e.resources.revision(sn)??0,updatedAt:new Date(r.changedAt.get(sn)??t).toISOString(),count:p.length,dismissals:p,detail:p.length?`${p.length} dismissal${p.length===1?"":"s"} in effect \u2014 hidden, not fixed. Each error shows again the next time it happens; undo one with observe.restore_errors.`:"Nothing has been dismissed."}}),{unsubscribe:a,uris:[Su,wt,Fu,Dt,$t,sn]}}s(sb,"fv"),o(sb,"installRuntimeReducer");function lp(e){let t=e.raw??null,r=e.context;return t?.project??r.projectName}s(lp,"Sk"),o(lp,"projectOf");function ab(e){if(e.source!=="gateway"||e.category!=="cluster")return!1;let t=e.raw?.kind;return t==="service-starting"||t==="service-respawn"}s(ab,"Qz"),o(ab,"isGenerationBoundary");function ob(e){if(e.source!=="nestjs"||e.severity!=="error"&&e.severity!=="fatal")return!1;let t=e.raw??{};return t.kind==="server-request"||t.kind==="uncaught"?!0:t.kind!=="log"?!1:t.request?.error?!0:/\b[A-Za-z0-9_$]*(?:Error|Exception)\b|\b(?:ERROR|FATAL)\b/.test(e.title??"")}s(ob,"eM"),o(ob,"isServerError");function lb(e){let t=(e.raw??{}).request??{},r=t.error;return{id:e.id,timestamp:e.timestamp,severity:e.severity,title:e.title,message:e.message??r?.message,source:e.source,fingerprint:e.fingerprint,...e.context.requestId?{requestId:e.context.requestId}:{},...lp(e)?{project:lp(e)}:{},...typeof t.route=="string"?{route:t.route}:{},...typeof t.status=="number"?{status:t.status}:{},...typeof t.outcome=="string"?{outcome:t.outcome}:{},...r?.stack?{stack:r.stack}:{},raw:e.raw}}s(lb,"tM"),o(lb,"serverEntry");function dp(e,t,r,n,u,i){let a=t===$t,l=a?n.lastServerEventAt:n.lastEventAt,d=l!==void 0;return{schemaVersion:1,revision:e.revision(t)??0,updatedAt:new Date(n.changedAt.get(t)??u).toISOString(),count:r.length,entries:r.slice(),...i>0?{dismissedCount:i}:{},producer:d?"connected":"none",lastEventAt:l,lastReadyAt:n.lastReadyAt,detail:a?d?r.length===0?"No server-side errors held. Pods HAVE reported, but a new pod generation retracts the errors of the one it replaced \u2014 so this is NOT evidence the routes are healthy: nobody may have re-made the failing request since."+Rs(i):`${r.length} server-side error${r.length===1?"":"s"} from ${new Set(r.map(c=>c.project??"unknown")).size} project${new Set(r.map(c=>c.project??"unknown")).size===1?"":"s"}`+Rs(i):"No pod has ever reported into this session \u2014 this is NOT evidence the backend is healthy, nothing is watching. Run the backend under the dev cluster so pod errors reach this session.":d?`browser attached; ${r.length} entr${r.length===1?"y":"ies"} from ${n.readyByTab.size} open tab${n.readyByTab.size===1?"":"s"}`+(n.lastReadyAt===void 0?" (no page load observed yet)":"")+Rs(i):"No browser has ever reported into this session \u2014 this is NOT evidence the app is healthy, nothing is watching. Open the app under the dev cluster (or the Vite dev server with @lensmcp/vite-plugin installed) so browser events reach this session."}}s(dp,"Ik"),o(dp,"snapshot");function Rs(e){return e>0?` \u2014 ${e} more dismissed by hand in the dashboard (hidden, not fixed)`:""}s(Rs,"pv"),o(Rs,"dismissedNote");function ju(e,t,r){e.push(t),e.length>r&&e.splice(0,e.length-r)}s(ju,"Do"),o(ju,"pushBounded");import{App as bC}from"@frontmcp/sdk";import{Resource as EC,ResourceContext as wC}from"@frontmcp/sdk";var cp=class extends wC{static{s(this,"mv")}static{o(this,"BrowserTabsResource")}async execute(){return this.get(Z).read("browser://tabs")}};cp=F([EC({name:"browser-tabs",uri:"browser://tabs",mimeType:"application/json",description:"Open browser tabs with per-tab status, url, and event counts. `status` reflects the tab's CURRENT page load \u2014 a reload resets it."})],cp);var DC=cp;import{Resource as $C,ResourceContext as BC}from"@frontmcp/sdk";var pp=class extends BC{static{s(this,"gv")}static{o(this,"BrowserActiveTabResource")}async execute(){return this.get(Z).read("browser://active-tab")}};pp=F([$C({name:"browser-active-tab",uri:"browser://active-tab",mimeType:"application/json",description:"The currently-focused browser tab."})],pp);var xC=pp,db=class{static{s(this,"yv")}static{o(this,"BrowserApp")}};db=F([bC({id:"browser",name:"Browser",description:"Per-tab browser state (multi-tab refinement comes in Phase 6).",resources:[DC,xC]})],db);var Bt="browser://tabs",xt="browser://active-tab";function cb(e){if(e.category!=="runtime")return!1;let t=e.raw;return t&&typeof t=="object"&&t.kind==="ready"?!0:e.title==="Client runtime ready"}s(cb,"aM"),o(cb,"isDocumentBoundary");function pb(e){if(e.category!=="runtime")return!1;let t=e.raw;return!!(t&&typeof t=="object"&&t.kind==="gone")}s(pb,"cM"),o(pb,"isTabGone");function mb(e){let t=(e.now??(()=>Date.now()))(),r={tabs:new Map,changedAt:new Map},n=o(a=>{if(a.source!=="chrome"&&a.source!=="client-runtime")return;let l=a.context.tabId??"default";if(pb(a)){if(r.tabs.delete(l),r.activePageId===l){let c=[...r.tabs.keys()];r.activePageId=c[c.length-1]}r.lastEventAt=Math.max(r.lastEventAt??0,a.timestamp),r.changedAt.set(Bt,a.timestamp),r.changedAt.set(xt,a.timestamp),e.resources.markDirty(Bt),e.resources.markDirty(xt);return}let d=r.tabs.get(l);if(d||(d={pageId:l,url:a.context.url??"",status:"unknown",unreadEvents:0,totalEvents:0,loads:0}),r.tabs.delete(l),r.tabs.set(l,d),r.tabs.size>100){let c=r.tabs.keys().next().value;c!==void 0&&c!==l&&r.tabs.delete(c)}a.context.url&&(d.url=a.context.url),d.totalEvents+=1,d.lastEventAt=a.timestamp,r.activePageId=l,r.lastEventAt=Math.max(r.lastEventAt??0,a.timestamp),cb(a)?(d.status="clean",d.unreadEvents=0,d.loads+=1,d.lastReadyAt=a.timestamp):(d.unreadEvents+=1,a.severity==="error"||a.severity==="fatal"?d.status="failing":d.status!=="failing"&&a.severity==="warning"?d.status="warning":d.status==="unknown"&&(d.status="clean")),r.changedAt.set(Bt,a.timestamp),r.changedAt.set(xt,a.timestamp),e.resources.markDirty(Bt),e.resources.markDirty(xt)},"handler"),u=e.bus.subscribe(n),i=o(a=>new Date(r.changedAt.get(a)??t).toISOString(),"stamp");return e.resources.register(Bt,()=>({schemaVersion:1,revision:e.resources.revision(Bt)??0,updatedAt:i(Bt),activePageId:r.activePageId,tabs:[...r.tabs.values()],lastEventAt:r.lastEventAt,producer:r.lastEventAt===void 0?"none":"connected"})),e.resources.register(xt,()=>{let a=r.activePageId;return{schemaVersion:1,revision:e.resources.revision(xt)??0,updatedAt:i(xt),tab:a?r.tabs.get(a)??null:null,lastEventAt:r.lastEventAt,producer:r.lastEventAt===void 0?"none":"connected"}}),{unsubscribe:u,uris:[Bt,xt]}}s(mb,"bv"),o(mb,"installBrowserReducer");import{App as kC}from"@frontmcp/sdk";import{Resource as CC,ResourceContext as AC}from"@frontmcp/sdk";var mp=class extends AC{static{s(this,"wv")}static{o(this,"NestProvidersResource")}async execute(){return this.get(Z).read("nest://providers")}};mp=F([CC({name:"nest-providers",uri:"nest://providers",mimeType:"application/json",description:"All known NestJS singleton-instance generations (with lifecycle)."})],mp);var _C=mp;import{Resource as IC,ResourceContext as SC}from"@frontmcp/sdk";var fp=class extends SC{static{s(this,"$v")}static{o(this,"NestRequestsResource")}async execute(){return this.get(Z).read("nest://requests/recent")}};fp=F([IC({name:"nest-requests-recent",uri:"nest://requests/recent",mimeType:"application/json",description:"Last 50 NestJS server requests with status + duration."})],fp);var FC=fp,fb=class{static{s(this,"kv")}static{o(this,"NestApp")}};fb=F([kC({id:"nest",name:"Nest",description:"NestJS providers, request lifecycle, singleton generations.",resources:[_C,FC]})],fb);var Ts="nest://providers",Ps="nest://requests/recent";function hb(e){let t={providers:new Map,recentRequests:[]},r=o(u=>{if(u.source!=="nestjs")return;let i=u.raw??null;if(i?.kind==="singleton-instance"&&i.provider){let a=i.provider;if(t.providers.delete(a.instanceId),t.providers.set(a.instanceId,{...a}),t.providers.size>500){for(let l of t.providers.keys())if(t.providers.delete(l),t.providers.size<=500)break}e.resources.markDirty(Ts);return}if(i?.kind==="server-request"&&i.request){let a={...i.request,fingerprint:u.fingerprint,id:u.id};t.recentRequests.push(a),t.recentRequests.length>50&&t.recentRequests.splice(0,t.recentRequests.length-50),e.resources.markDirty(Ps);return}},"handler"),n=e.bus.subscribe(r);return e.resources.register(Ts,()=>({schemaVersion:1,revision:e.resources.revision(Ts)??0,updatedAt:new Date().toISOString(),providers:[...t.providers.values()]})),e.resources.register(Ps,()=>({schemaVersion:1,revision:e.resources.revision(Ps)??0,updatedAt:new Date().toISOString(),requests:t.recentRequests.slice()})),{unsubscribe:n,uris:[Ts,Ps]}}s(hb,"Sv"),o(hb,"installNestReducer");import{App as jC}from"@frontmcp/sdk";import{Resource as zC,ResourceContext as NC}from"@frontmcp/sdk";var hp=class extends NC{static{s(this,"Iv")}static{o(this,"TraceRecentResource")}async execute(){return this.get(Z).read("trace://recent")}};hp=F([zC({name:"trace-recent",uri:"trace://recent",mimeType:"application/json",description:"Last 100 trace spans (flattened)."})],hp);var MC=hp;import{Resource as OC,ResourceContext as RC}from"@frontmcp/sdk";var gp=class extends RC{static{s(this,"Ev")}static{o(this,"TraceFailedResource")}async execute(){return this.get(Z).read("trace://failed")}};gp=F([OC({name:"trace-failed",uri:"trace://failed",mimeType:"application/json",description:"Trace spans that ended with status=error."})],gp);var TC=gp,gb=class{static{s(this,"Av")}static{o(this,"TraceApp")}};gb=F([jC({id:"trace",name:"Trace",description:"Cross-process span timeline (Phase 3 \u2014 flat; Phase 7 promotes to multi-axis graph).",resources:[MC,TC]})],gb);var Us="trace://recent",qs="trace://failed";function vb(e){let t={recent:[],failed:[]},r=o(u=>{let i=u.raw??null;if(!i||i.kind!=="span"||!i.span?.name)return;let a={id:u.id,traceId:i.span.traceId,parentSpanId:i.span.parentSpanId,flowId:i.span.flowId??u.context.flowId,requestId:i.span.requestId??u.context.requestId,name:i.span.name,source:u.source,startTime:i.span.startTime??u.timestamp,endTime:i.span.endTime,durationMs:i.span.durationMs,status:i.span.status??(u.severity==="error"?"error":"ok")};vp(t.recent,a,100),a.status==="error"&&vp(t.failed,a,50),e.resources.markDirty(Us),a.status==="error"&&e.resources.markDirty(qs)},"handler"),n=e.bus.subscribe(r);return e.resources.register(Us,()=>({schemaVersion:1,revision:e.resources.revision(Us)??0,updatedAt:new Date().toISOString(),spans:t.recent.slice()})),e.resources.register(qs,()=>({schemaVersion:1,revision:e.resources.revision(qs)??0,updatedAt:new Date().toISOString(),spans:t.failed.slice()})),{unsubscribe:n,uris:[Us,qs]}}s(vb,"jv"),o(vb,"installTraceReducer");function vp(e,t,r){e.push(t),e.length>r&&e.splice(0,e.length-r)}s(vp,"Rk"),o(vp,"pushBounded");import{App as PC}from"@frontmcp/sdk";import{Resource as UC,ResourceContext as qC}from"@frontmcp/sdk";var yp=class extends qC{static{s(this,"Ov")}static{o(this,"PerfSlowRoutesResource")}async execute(){return this.get(Z).read("perf://slow-routes")}};yp=F([UC({name:"perf-slow-routes",uri:"perf://slow-routes",mimeType:"application/json",description:"Routes that are slow NOW (\u2265 threshold on their latest call, or repeatedly lately). A one-off spike is retracted once later calls prove the route recovered; worstEver keeps the history."})],yp);var ZC=yp;import{Resource as LC,ResourceContext as JC}from"@frontmcp/sdk";var bp=class extends JC{static{s(this,"Mv")}static{o(this,"PerfDuplicateRequestsResource")}async execute(){return this.get(Z).read("perf://duplicate-requests")}};bp=F([LC({name:"perf-duplicate-requests",uri:"perf://duplicate-requests",mimeType:"application/json",description:"Endpoints one page called SEVERAL TIMES CONCURRENTLY \u2014 the missing-dedupe signal (a hook fetching outside the shared resource cache, multiplied by however many components mount it). Concurrency, not count: sequential repeats are a caching question and are not reported. The threshold sits above 2 so React StrictMode\u2019s double-invoke never fires it. Two consecutive clean loads retract a finding, so a fix clears it without a restart."})],bp);var VC=bp,yb=class{static{s(this,"Pv")}static{o(this,"PerfApp")}};yb=F([PC({id:"perf",name:"Perf",description:"Performance signals: slow server routes, and endpoints one page calls concurrently (the missing-dedupe signal).",resources:[ZC,VC]})],yb);var Zs="perf://slow-routes",Ls=20,bb=2,WC=200;function Eb(e){let t=Ye(e.thresholds).slowRouteMs,r=(e.now??(()=>Date.now()))(),n={routes:new Map},u=o(d=>{let c=d.raw??null;if(c?.kind!=="server-request"||!c.request)return;let{method:p,route:m}=c.request,f=c.request.durationMs??0,h=`${p} ${m}`,g=n.routes.get(h);if(g||(g={method:p,route:m,recent:[],samples:0,slowSamples:0,lastDurationMs:f,lastSeenAt:d.timestamp,worstEverMs:0,worstEverAt:d.timestamp}),n.routes.delete(h),n.routes.set(h,g),g.recent.push(f),g.recent.length>Ls&&g.recent.splice(0,g.recent.length-Ls),g.samples+=1,f>=t&&(g.slowSamples+=1),g.lastDurationMs=f,g.lastSeenAt=d.timestamp,f>g.worstEverMs&&(g.worstEverMs=f,g.worstEverAt=d.timestamp),n.routes.size>WC){let b=n.routes.keys().next().value;b!==void 0&&n.routes.delete(b)}n.lastSampleAt=Math.max(n.lastSampleAt??0,d.timestamp),n.changedAt=d.timestamp,e.resources.markDirty(Zs)},"handler"),i=e.bus.subscribe(u),a=o(d=>d.recent.reduce((c,p)=>p>=t?c+1:c,0),"recentSlowCount"),l=o(d=>d.lastDurationMs>=t||a(d)>=bb,"currentlySlow");return e.resources.register(Zs,()=>{let d=[...n.routes.values()].filter(l);return{schemaVersion:1,revision:e.resources.revision(Zs)??0,updatedAt:new Date(n.changedAt??r).toISOString(),thresholdMs:t,routes:d.map(c=>({method:c.method,route:c.route,worstRecentMs:Math.max(...c.recent),lastDurationMs:c.lastDurationMs,lastSeenAt:c.lastSeenAt,samples:c.samples,slowSamples:c.slowSamples,recentSlowSamples:a(c),worstEverMs:c.worstEverMs,worstEverAt:c.worstEverAt})).sort((c,p)=>p.worstRecentMs-c.worstRecentMs),routesTracked:n.routes.size,recentSampleWindow:Ls,minRecentSlowToKeep:bb,lastSampleAt:n.lastSampleAt,producer:n.lastSampleAt===void 0?"none":"connected",detail:n.lastSampleAt===void 0?"No server request has ever been observed \u2014 this is NOT evidence the backend is fast, nothing is watching. Run the backend under the dev cluster (or with @lensmcp/nest-instrumentation) so request timings reach this session.":`${n.routes.size} route${n.routes.size===1?"":"s"} observed; ${d.length} slow in the last ${Ls} calls each (\u2265${t}ms).`}}),{unsubscribe:i,uris:[Zs]}}s(Eb,"Dv"),o(Eb,"installPerfReducer");var Js="perf://duplicate-requests",Ep=10,wb=2,GC=200,Db=300,KC=new Set(["t","_","cacheBust","ts"]),HC=8,$b=2,XC="react";function Bb(e,t){return t.start<=e.end+$b&&t.end>=e.start-$b}s(Bb,"TM"),o(Bb,"sameRequest");function xb(e){try{let t=new URL(e,"http://lensmcp.invalid");for(let u of[...t.searchParams.keys()])KC.has(u)&&t.searchParams.delete(u);let r=t.searchParams.toString(),n=`${t.pathname}${r?`?${r}`:""}`;return t.host==="lensmcp.invalid"?n:`${t.origin}${n}`}catch{return e}}s(xb,"Ok"),o(xb,"normalizeRequestUrl");function kb(e){if(e.length===0)return 0;let t=[];for(let{start:u,end:i}of e)t.push({at:u,delta:1}),t.push({at:i+1,delta:-1});t.sort((u,i)=>u.at-i.at||u.delta-i.delta);let r=0,n=0;for(let{delta:u}of t)r+=u,r>n&&(n=r);return n}s(kb,"zk"),o(kb,"peakConcurrency");function Cb(e){let t=Ye(e.thresholds).duplicateRequestPeak,r=(e.now??(()=>Date.now()))(),n={endpoints:new Map},u=o((p,m,f)=>{p.open.delete(m),f.windows.length!==0&&(p.recentPeaks.push(f.peak),p.recentPeaks.length>Ep&&p.recentPeaks.splice(0,p.recentPeaks.length-Ep))},"closeFlow"),i=o(p=>{if(p.source!==XC||p.category!=="network")return;let m=p.raw??null;if(m?.kind!=="fetch-done"&&m?.kind!=="fetch-error"||!m.url||!m.method)return;let f=xb(m.url),h=m.method.toUpperCase();if(typeof m.startedAt!="number")return;let g=m.startedAt,b=g+(typeof m.durationMs=="number"?m.durationMs:0),x=p.context?.originNodeId??null,$=p.context?.flowId??null,w=p.context?.tabId??"-",C=m.requestId??p.context?.requestId,k=C?`${w}|${C}`:void 0,M=`${h} ${f} @ ${x??"-"}`,y=n.endpoints.get(M);y||(y={method:h,url:f,originNodeId:x,open:new Map,recentPeaks:[],totalRequests:0,repeatedReceipts:0,lastSeenAt:p.timestamp,worstEverPeak:0,worstEverAt:p.timestamp}),n.endpoints.delete(M),n.endpoints.set(M,y);let D=y.open.get(w);if(D&&D.flowId!==$&&(u(y,w,D),D=void 0),D||(D={flowId:$,windows:[],byIdentity:new Map,peak:0}),y.open.delete(w),y.open.set(w,D),y.open.size>HC){let[N,K]=y.open.entries().next().value;u(y,N,K)}let A={start:g,end:b},j=k?D.byIdentity.get(k):void 0;if(j&&Bb(j,A))j.start=Math.min(j.start,g),j.end=Math.max(j.end,b),y.repeatedReceipts+=1;else{let N=k?{...A,identity:k}:A;if(D.windows.push(N),k&&D.byIdentity.set(k,N),D.windows.length>Db)for(let K of D.windows.splice(0,D.windows.length-Db))K.identity&&D.byIdentity.get(K.identity)===K&&D.byIdentity.delete(K.identity);y.totalRequests+=1}if(D.peak=kb(D.windows),y.lastSeenAt=p.timestamp,D.peak>y.worstEverPeak&&(y.worstEverPeak=D.peak,y.worstEverAt=p.timestamp),n.endpoints.size>GC){let N=n.endpoints.keys().next().value;N!==void 0&&n.endpoints.delete(N)}n.lastSampleAt=Math.max(n.lastSampleAt??0,p.timestamp),n.changedAt=p.timestamp,e.resources.markDirty(Js)},"handler"),a=e.bus.subscribe(i),l=o(p=>[...p.open.values()].filter(m=>m.windows.length>0).map(m=>m.peak),"openPeaks"),d=o(p=>{let m=[...p.recentPeaks,...l(p)],f=0;for(let h=m.length-1;h>=0&&!((m[h]??0)>=t);h-=1)f+=1;return f},"consecutiveCleanFlows"),c=o(p=>p.worstEverPeak>=t&&d(p)<wb,"currentlyDuplicated");return e.resources.register(Js,()=>{let p=[...n.endpoints.values()].filter(c);return{schemaVersion:1,revision:e.resources.revision(Js)??0,updatedAt:new Date(n.changedAt??r).toISOString(),peakThreshold:t,endpoints:p.map(m=>({method:m.method,url:m.url,originNodeId:m.originNodeId,peakConcurrent:l(m).at(-1)??0,cleanFlowsSince:d(m),flowsObserved:m.recentPeaks.length+l(m).length,totalRequests:m.totalRequests,repeatedReceipts:m.repeatedReceipts,worstEverPeak:m.worstEverPeak,worstEverAt:m.worstEverAt,lastSeenAt:m.lastSeenAt})).sort((m,f)=>f.peakConcurrent-m.peakConcurrent),endpointsTracked:n.endpoints.size,recentFlowWindow:Ep,minCleanFlowsToRetract:wb,lastSampleAt:n.lastSampleAt,producer:n.lastSampleAt===void 0?"none":"connected",detail:n.lastSampleAt===void 0?"No browser fetch has ever been observed \u2014 this is NOT evidence the app fetches cleanly, nothing is watching. Load a page under the dev cluster so flow-fetch events reach this session.":p.length===0?`${n.endpoints.size} endpoint${n.endpoints.size===1?"":"s"} observed; none exceeded ${t} concurrent identical calls.`:`${p.length} endpoint${p.length===1?"":"s"} called \u2265${t}\xD7 concurrently \u2014 usually a hook fetching outside the shared resource cache, multiplied by however many components mount it.`}}),{unsubscribe:a,uris:[Js]}}s(Cb,"Uv"),o(Cb,"installDuplicateRequestsReducer");import{App as YC}from"@frontmcp/sdk";import{Resource as QC,ResourceContext as e7}from"@frontmcp/sdk";var wp=class extends e7{static{s(this,"Lv")}static{o(this,"DbSlowQueriesResource")}async execute(){return this.get(Z).read("db://slow-queries")}};wp=F([QC({name:"db-slow-queries",uri:"db://slow-queries",mimeType:"application/json",description:"Query shapes (project\xB7op\xB7table) whose worst observed duration crosses the slowQueryMs threshold, aggregated live from the pg instrumentation. counts are an undercount for hot shapes (the emitter flood-guards per shape); suppressedEvents carries the drop count."})],wp);var t7=wp;import{Resource as u7,ResourceContext as r7}from"@frontmcp/sdk";var Dp=class extends r7{static{s(this,"Bv")}static{o(this,"DbAnalysisResource")}async execute(){return this.get(Z).read("db://analysis")}};Dp=F([u7({name:"db-analysis",uri:"db://analysis",mimeType:"application/json",description:"The latest DB analyzer run per project (missing indexes, seq-scan hot spots, unused indexes, migration-parity drift, slow statements) \u2014 ingested from the workspace analyzer's `db-analyze-run` events on the lens bus file."})],Dp);var n7=Dp,Ab=class{static{s(this,"Zv")}static{o(this,"DbApp")}};Ab=F([YC({id:"db",name:"Db",description:"Database signals: slow query shapes observed live from the pg instrumentation, and the latest externally-ingested analyzer run (missing indexes, migration parity, unused indexes).",resources:[t7,n7]})],Ab);var an="db://slow-queries",Vs="db://analysis",_b=50,i7=20,s7=200,a7=1e3,o7=["statements","failed","workMs","recorded","suppressed","unwritten"];function Ib(e){let t=e[Bd];if(!t)return;let r=Array.isArray(t.paths)?t.paths:[];for(let n of r){let u=typeof n=="string"?/^findings\[\] \(\+(\d+) items dropped\)$/.exec(n):null;if(u)return Number(u[1])}return r.some(n=>typeof n=="string"&&n.startsWith("findings"))?0:void 0}s(Ib,"UM"),o(Ib,"findingsDroppedByClamp");function Sb(e){let t=Ye(e.thresholds).slowQueryMs,r=(e.now??(()=>Date.now()))(),n={shapes:new Map,analyzeRuns:new Map,accounts:new Map,accountsSeen:0,census:{statements:0,failed:0,workMs:0,recorded:0,suppressed:0,unwritten:0}},u=o(l=>{let d=l.raw??null;if(d){if(d.kind==="db-query"){let c=d.project??"unknown",p=d.op??"query",m=d.table??"query",f=d.durationMs??0,h=`${c}|${p}|${m}`,g=n.shapes.get(h);if(g||(g={project:c,op:p,table:m,count:0,errorCount:0,totalMs:0,maxMs:0,maxAt:l.timestamp,recent:[],rowsTotal:0,lastSql:"",lastDurationMs:0,lastSeenAt:l.timestamp,suppressed:0}),n.shapes.delete(h),n.shapes.set(h,g),g.count+=1,d.error!==void 0&&(g.errorCount+=1),g.totalMs+=f,f>g.maxMs&&(g.maxMs=f,g.maxAt=l.timestamp),g.recent.push(f),g.recent.length>_b&&g.recent.splice(0,g.recent.length-_b),g.rowsTotal+=d.rows??0,d.query&&(g.lastSql=d.query),g.lastDurationMs=f,g.lastSeenAt=l.timestamp,g.suppressed+=d.floodSuppressed??0,n.shapes.size>s7){let b=n.shapes.keys().next().value;b!==void 0&&n.shapes.delete(b)}n.lastQueryAt=Math.max(n.lastQueryAt??0,l.timestamp),n.changedAt=l.timestamp,e.resources.markDirty(an);return}if(d.kind==="db-request-account"){let c=d,p=typeof c.accountId=="string"?c.accountId:l.id,m=typeof c.seq=="number"?c.seq:0,f=n.accounts.get(p);if(f&&f.seq>=m)return;let h={seq:m,statements:0,failed:0,workMs:0,recorded:0,suppressed:0,unwritten:0};for(let g of o7){let b=c[g];h[g]=typeof b=="number"&&Number.isFinite(b)?b:0,n.census[g]+=h[g]-(f?.[g]??0)}if(f||(n.accountsSeen+=1),n.accounts.delete(p),n.accounts.set(p,h),n.accounts.size>a7){let g=n.accounts.keys().next().value;g!==void 0&&n.accounts.delete(g)}n.changedAt=l.timestamp,e.resources.markDirty(an);return}if(d.kind==="db-analyze-run"){let c=d.project??"unknown",p=Ib(d);n.analyzeRuns.set(c,{project:c,runAt:d.runAt??l.timestamp,tool:d.tool??"unknown",findings:Array.isArray(d.findings)?d.findings:[],...p!==void 0?{droppedFindings:p}:{}}),Zt(n.analyzeRuns,Wr),n.lastAnalyzeAt=Math.max(n.lastAnalyzeAt??0,l.timestamp),n.changedAt=l.timestamp,e.resources.markDirty(Vs)}}},"handler"),i=e.bus.subscribe(u),a=o(l=>{if(l.length===0)return 0;let d=[...l].sort((c,p)=>c-p);return d[Math.min(d.length-1,Math.floor(d.length*.95))]??0},"p95");return e.resources.register(an,()=>{let l=[...n.shapes.values()].filter(d=>d.maxMs>=t);return{schemaVersion:1,revision:e.resources.revision(an)??0,updatedAt:new Date(n.changedAt??r).toISOString(),thresholdMs:t,queries:l.map(d=>({project:d.project,op:d.op,table:d.table,count:d.count,errorCount:d.errorCount,maxMs:d.maxMs,maxAt:d.maxAt,avgMs:Math.round(d.totalMs/Math.max(d.count,1)*10)/10,p95Ms:a(d.recent),rowsTotal:d.rowsTotal,lastDurationMs:d.lastDurationMs,lastSeenAt:d.lastSeenAt,lastSql:d.lastSql,suppressedEvents:d.suppressed})).sort((d,c)=>c.maxMs-d.maxMs).slice(0,i7),shapesTracked:n.shapes.size,...n.accountsSeen>0?{requestAccounting:{requests:n.accountsSeen,...n.census}}:{},note:"count/avg are an UNDERCOUNT for hot shapes: the emitter flood-guards each query-shape fingerprint at 30 burst / 5 events/s; suppressedEvents is the emitter's own count of dropped events, reported by the next admitted event of the shape \u2014 drops with none after them are missing from it. requestAccounting, when present, is the requests' own census (statements run vs recorded on the bus), exact including those; per flow, read flow.get's overview.sql.",lastSampleAt:n.lastQueryAt,producer:n.lastQueryAt===void 0?"none":"connected",detail:n.lastQueryAt===void 0?"No db-query event has ever been observed \u2014 this is NOT evidence queries are fast, nothing is watching. Run the backend under the dev cluster (the @lensmcp/cluster serve preload taps pg) so query timings reach this session.":`${n.shapes.size} query shape${n.shapes.size===1?"":"s"} observed; ${l.length} with a worst duration \u2265${t}ms.`}}),e.resources.register(Vs,()=>{let l=[...n.analyzeRuns.values()].sort((x,$)=>$.runAt-x.runAt),d=l.flatMap(x=>x.findings),c=d.length,p=d.filter(x=>x.severity==="error").length,m=d.filter(x=>x.severity==="warning").length,f=c-p-m,h=l.filter(x=>x.droppedFindings!==void 0),g=h.reduce((x,$)=>x+($.droppedFindings??0),0),b=h.length>0;return{schemaVersion:1,revision:e.resources.revision(Vs)??0,updatedAt:new Date(n.changedAt??r).toISOString(),runs:l,findingCount:c,errorCount:p,warningCount:m,infoCount:f,...b?{incomplete:!0,droppedFindings:g}:{},lastSampleAt:n.lastAnalyzeAt,producer:n.lastAnalyzeAt===void 0?"none":"connected",detail:n.lastAnalyzeAt===void 0?"No db-analyze run has ever been ingested \u2014 this is NOT evidence the schema is healthy, nothing has analyzed it. Run the workspace's DB analyzer (it appends a `db-analyze-run` event to the lens bus file) to populate this.":`${l.length} analyze run${l.length===1?"":"s"} held (latest per project); ${c} finding${c===1?"":"s"} (${p} error, ${m} warning, ${f} info).`+(b?` INCOMPLETE: ${g>0?`${g} more findings were`:"part of a run was"} cut by the bus payload bound before reaching the lens (an event over 32 KiB keeps only the first 64 items of a list), and the cut takes whatever came last. The analyzer must keep one run under that bound, most severe first.`:"")}}),{unsubscribe:i,uris:[an,Vs]}}s(Sb,"Vv"),o(Sb,"installDbReducer");import{App as l7}from"@frontmcp/sdk";import{Resource as d7,ResourceContext as c7}from"@frontmcp/sdk";var $p=class extends c7{static{s(this,"Gv")}static{o(this,"NetEgressHostsResource")}async execute(){return this.get(Z).read("net://egress/hosts")}};$p=F([d7({name:"net-egress-hosts",uri:"net://egress/hosts",mimeType:"application/json",description:"External hosts this backend called (pod \u2192 third party), rolled up per project\xB7host with count, error/4xx/5xx counters, p95 and worst duration, plus the top endpoints under each. `slow` and `failing` are retracted by later healthy responses, so a one-off blip does not warn all day."})],$p);var p7=$p;import{Resource as m7,ResourceContext as f7}from"@frontmcp/sdk";var Bp=class extends f7{static{s(this,"Jv")}static{o(this,"NetEgressRecentResource")}async execute(){return this.get(Z).read("net://egress/recent")}};Bp=F([m7({name:"net-egress-recent",uri:"net://egress/recent",mimeType:"application/json",description:"The last 200 outbound calls with their RAW path and the flowId that caused them \u2014 the evidence behind net://egress/hosts. Query strings are never captured; treat this as the sensitive view, since a path segment can itself be a secret."})],Bp);var h7=Bp;import{Resource as g7,ResourceContext as v7}from"@frontmcp/sdk";var xp=class extends v7{static{s(this,"Hv")}static{o(this,"NetEgressFailuresResource")}async execute(){return this.get(Z).read("net://egress/failures")}};xp=F([g7({name:"net-egress-failures",uri:"net://egress/failures",mimeType:"application/json",description:"Outbound calls that failed \u2014 transport errors and any status \u2265 400 \u2014 kept in their own ring so a high-volume host cannot evict the one failure you need. Empty is NOT proof nothing failed: check `producer`."})],xp);var y7=xp,Fb=class{static{s(this,"Yv")}static{o(this,"NetApp")}};Fb=F([l7({id:"net",name:"Net",description:"Outbound (egress) HTTP the backend makes to THIRD PARTIES \u2014 which external services, how often, how slow, and whether they failed. The server-side twin of runtime://browser/network. Internal service-to-service traffic is deliberately absent: the gateway already attributes it.",resources:[p7,h7,y7]})],Fb);var Ws="net://egress/hosts",Gs="net://egress/recent",Ks="net://egress/failures",zu=20,b7=25,E7=200,w7=20,D7=5,jb=200,zb=50,Nb=2;function Mb(e){return e.length===0?!1:!!(/^\d{2,}$/.test(e)||/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^[A-Z][A-Z0-9]*-\d+$/.test(e)||e.length>=16&&/^[A-Za-z0-9_-]+$/.test(e)&&/\d/.test(e))}s(Mb,"XM"),o(Mb,"isIdSegment");function Ob(e){let[t="/"]=e.split("?"),r=t.split("/"),n=[];for(let i of r){if(n.length>12){n.push("\u2026");break}n.push(Mb(i)?":id":i)}let u=n.join("/");return u.length===0?"/":u}s(Ob,"Ck"),o(Ob,"templatisePath");function Rb(e){let t=Ye(e.thresholds).slowEgressMs,r=(e.now??(()=>Date.now()))(),n={hosts:new Map,recent:[],failures:[]},u=o(p=>{let m=p.raw??null;if(!m||m.kind!=="egress")return;let f=m.project??"unknown",h=m.host??"unknown",g=(m.method??"GET").toUpperCase(),b=m.durationMs??0,x=typeof m.status=="number"?m.status:void 0,$=m.error===void 0?void 0:String(m.error),w=$!==void 0||x!==void 0&&x>=400,C=m.path??"(path not captured \u2014 upgrade @lensmcp/node-instrumentation)",k=`${f}|${h}`,M=n.hosts.get(k);M||(M={project:f,host:h,count:0,errorCount:0,status4xx:0,status5xx:0,totalMs:0,maxMs:0,maxAt:p.timestamp,recent:[],outcomes:[],firstSeenAt:p.timestamp,lastSeenAt:p.timestamp,lastDurationMs:0,lastBad:!1,suppressed:0,endpoints:new Map}),n.hosts.delete(k),n.hosts.set(k,M),M.count+=1,$!==void 0&&(M.errorCount+=1),x!==void 0&&x>=400&&x<500&&(M.status4xx+=1),x!==void 0&&x>=500&&(M.status5xx+=1),M.totalMs+=b,b>M.maxMs&&(M.maxMs=b,M.maxAt=p.timestamp),M.recent.push(b),M.recent.length>zu&&M.recent.splice(0,M.recent.length-zu),M.outcomes.push(w),M.outcomes.length>zu&&M.outcomes.splice(0,M.outcomes.length-zu),M.lastDurationMs=b,M.lastBad=w,M.lastSeenAt=p.timestamp,M.suppressed+=m.floodSuppressed??0;let y=Ob(C),D=`${g} ${y}`,A=M.endpoints.get(D);if(A||(A={method:g,path:y,count:0,errorCount:0,status4xx:0,status5xx:0,totalMs:0,maxMs:0,recent:[],lastDurationMs:0,lastSeenAt:p.timestamp}),M.endpoints.delete(D),M.endpoints.set(D,A),A.count+=1,$!==void 0&&(A.errorCount+=1,A.lastError=$),x!==void 0&&x>=400&&x<500&&(A.status4xx+=1),x!==void 0&&x>=500&&(A.status5xx+=1),A.totalMs+=b,b>A.maxMs&&(A.maxMs=b),A.recent.push(b),A.recent.length>zu&&A.recent.splice(0,A.recent.length-zu),A.lastStatus=x,A.lastDurationMs=b,A.lastSeenAt=p.timestamp,M.endpoints.size>w7){let K=M.endpoints.keys().next().value;K!==void 0&&M.endpoints.delete(K)}if(n.hosts.size>E7){let K=n.hosts.keys().next().value;K!==void 0&&n.hosts.delete(K)}let j=p.context??{},N={id:p.id,timestamp:p.timestamp,project:f,method:g,host:h,path:C,...x!==void 0?{status:x}:{},...$!==void 0?{error:$}:{},durationMs:b,...j.flowId?{flowId:j.flowId}:{},...j.requestId?{requestId:j.requestId}:{}};n.recent.push(N),n.recent.length>jb&&n.recent.splice(0,n.recent.length-jb),w&&(n.failures.push(N),n.failures.length>zb&&n.failures.splice(0,n.failures.length-zb),e.resources.markDirty(Ks)),n.lastSampleAt=Math.max(n.lastSampleAt??0,p.timestamp),n.changedAt=p.timestamp,e.resources.markDirty(Ws),e.resources.markDirty(Gs)},"handler"),i=e.bus.subscribe(u),a=o(p=>{if(p.length===0)return 0;let m=[...p].sort((f,h)=>f-h);return m[Math.min(m.length-1,Math.floor(m.length*.95))]??0},"p95"),l=o(p=>p.lastDurationMs>=t||p.recent.filter(m=>m>=t).length>=Nb,"isSlow"),d=o(p=>p.lastBad||p.outcomes.filter(Boolean).length>=Nb,"isFailing"),c=o(p=>{let m=p.outcomes.filter(Boolean).length;return d(p)?`${m} of the last ${p.outcomes.length} call${p.outcomes.length===1?"":"s"} failed`:l(p)?`${p.recent.filter(f=>f>=t).length} of the last ${p.recent.length} call${p.recent.length===1?"":"s"} took \u2265${t}ms`:"healthy"},"describe");return e.resources.register(Ws,()=>{let p=[...n.hosts.values()],m=p.filter(d),f=p.filter(h=>!d(h)&&l(h));return{schemaVersion:1,revision:e.resources.revision(Ws)??0,updatedAt:new Date(n.changedAt??r).toISOString(),thresholdMs:t,hosts:p.map(h=>({project:h.project,host:h.host,count:h.count,errorCount:h.errorCount,status4xx:h.status4xx,status5xx:h.status5xx,avgMs:Math.round(h.totalMs/Math.max(h.count,1)*10)/10,p95Ms:a(h.recent),maxMs:h.maxMs,maxAt:h.maxAt,lastDurationMs:h.lastDurationMs,firstSeenAt:h.firstSeenAt,lastSeenAt:h.lastSeenAt,slow:l(h),failing:d(h),detail:c(h),suppressedEvents:h.suppressed,endpoints:[...h.endpoints.values()].map(g=>({method:g.method,path:g.path,count:g.count,errorCount:g.errorCount,status4xx:g.status4xx,status5xx:g.status5xx,avgMs:Math.round(g.totalMs/Math.max(g.count,1)*10)/10,p95Ms:a(g.recent),maxMs:g.maxMs,...g.lastStatus!==void 0?{lastStatus:g.lastStatus}:{},...g.lastError!==void 0?{lastError:g.lastError}:{},lastSeenAt:g.lastSeenAt})).sort((g,b)=>b.maxMs-g.maxMs).slice(0,D7)})).sort((h,g)=>h.failing!==g.failing?h.failing?-1:1:g.maxMs-h.maxMs).slice(0,b7),hostsTracked:n.hosts.size,failingHosts:m.length,slowHosts:f.length,note:"count/avg are an UNDERCOUNT for hot hosts: the emitter flood-guards each host fingerprint at 30 burst / 5 events/s; suppressedEvents is the emitter's own count of dropped events. Query strings are not captured; endpoint paths are templatised (\u2026/:id).",lastSampleAt:n.lastSampleAt,producer:n.lastSampleAt===void 0?"none":"connected",detail:n.lastSampleAt===void 0?"No egress event has ever been observed \u2014 this is NOT evidence the app makes no external calls, nothing is watching. Run the backend under the dev cluster (the @lensmcp/cluster serve preload taps fetch and http/https) so outbound calls reach this session. Internal destinations (*.local, loopback, RFC1918) are skipped by design \u2014 the gateway already attributes service-to-service traffic.":`${n.hosts.size} external host${n.hosts.size===1?"":"s"} observed; ${m.length} failing, ${f.length} slower than ${t}ms.`}}),e.resources.register(Gs,()=>({schemaVersion:1,revision:e.resources.revision(Gs)??0,updatedAt:new Date(n.changedAt??r).toISOString(),entries:[...n.recent],count:n.recent.length,note:"Raw paths, as requested. flowId joins an outbound call back to the click that caused it. Treat this as the sensitive view: a path segment can itself be a secret (a presigned key, a reset token), which the templatised rollup collapses but this does not.",lastSampleAt:n.lastSampleAt,producer:n.lastSampleAt===void 0?"none":"connected",detail:n.lastSampleAt===void 0?"No egress event has ever been observed \u2014 this is NOT evidence the app makes no external calls, nothing is watching.":`${n.recent.length} recent outbound call${n.recent.length===1?"":"s"}.`})),e.resources.register(Ks,()=>({schemaVersion:1,revision:e.resources.revision(Ks)??0,updatedAt:new Date(n.changedAt??r).toISOString(),entries:[...n.failures],count:n.failures.length,note:"A separate ring from net://egress/recent on purpose: a host called 200\xD7/min would otherwise evict the one 503 you need.",lastSampleAt:n.lastSampleAt,producer:n.lastSampleAt===void 0?"none":"connected",detail:n.lastSampleAt===void 0?"No egress event has ever been observed \u2014 an empty list here is NOT evidence that nothing failed, nothing is watching.":`${n.failures.length} failed outbound call${n.failures.length===1?"":"s"} held.`})),{unsubscribe:i,uris:[Ws,Gs,Ks]}}s(Rb,"Qv"),o(Rb,"installNetReducer");import{App as $7}from"@frontmcp/sdk";import{Resource as B7,ResourceContext as x7}from"@frontmcp/sdk";var kp=class extends x7{static{s(this,"ey")}static{o(this,"VisualCurrentResource")}async execute(){return this.get(Z).read("visual://current")}};kp=F([B7({name:"visual-current",uri:"visual://current",mimeType:"application/json",description:"Most recent visual-frame (causedBy, changedNodes, stable)."})],kp);var k7=kp;import{Resource as C7,ResourceContext as A7}from"@frontmcp/sdk";var Cp=class extends A7{static{s(this,"ry")}static{o(this,"VisualViolationsCurrentResource")}async execute(){return this.get(Z).read("visual://violations/current")}};Cp=F([C7({name:"visual-violations-current",uri:"visual://violations/current",mimeType:"application/json",description:"Violations of the CURRENT frame, regardless of timing mode. Every rule re-runs per frame, so a fixed violation simply stops being reported."})],Cp);var _7=Cp;import{Resource as I7,ResourceContext as S7}from"@frontmcp/sdk";var Ap=class extends S7{static{s(this,"oy")}static{o(this,"VisualViolationsStableResource")}async execute(){return this.get(Z).read("visual://violations/stable")}};Ap=F([I7({name:"visual-violations-stable",uri:"visual://violations/stable",mimeType:"application/json",description:'Violations from rules with timing "after-animation" | "stable-only" | "always".'})],Ap);var F7=Ap;import{Resource as j7,ResourceContext as z7}from"@frontmcp/sdk";var _p=class extends z7{static{s(this,"sy")}static{o(this,"VisualViolationsDuringAnimationResource")}async execute(){return this.get(Z).read("visual://violations/during-animation")}};_p=F([j7({name:"visual-violations-during-animation",uri:"visual://violations/during-animation",mimeType:"application/json",description:"Violations seen on midpoint (during-animation) samples only."})],_p);var N7=_p;import{Resource as M7,ResourceContext as O7}from"@frontmcp/sdk";var Ip=class extends O7{static{s(this,"cy")}static{o(this,"VisualRulesResource")}async execute(){return this.get(Z).read("visual://rules")}};Ip=F([M7({name:"visual-rules",uri:"visual://rules",mimeType:"application/json",description:"All registered visual rules (builtins + lensmcp.rules.json + visual.register_rule)."})],Ip);var R7=Ip;import{Resource as T7,ResourceContext as P7}from"@frontmcp/sdk";var Sp=class extends P7{static{s(this,"ly")}static{o(this,"VisualTokensResource")}async execute(){return this.get(Z).read("visual://tokens")}};Sp=F([T7({name:"visual-tokens",uri:"visual://tokens",mimeType:"application/json",description:"Resolved design tokens from lensmcp.tokens.json."})],Sp);var U7=Sp;import{Tool as q7,ToolContext as Z7,z as Tb}from"@frontmcp/sdk";import{existsSync as L7,mkdirSync as J7,readFileSync as V7,writeFileSync as W7}from"node:fs";import{dirname as G7,join as Fp}from"node:path";function jp(e=process.env,t=process.cwd()){let r=e.LENSMCP_EVENT_FILE;return r?G7(r):Fp(t,".lensmcp")}s(jp,"Wa"),o(jp,"captureDir");function Pb(e){try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}s(Pb,"hN"),o(Pb,"pidAlive");function zp(e,t=Pb){let r=Fp(e,A$);try{if(!L7(r))return;let n=JSON.parse(V7(r,"utf8"));return typeof n?.pid!="number"||!Number.isFinite(n.pid)?void 0:t(n.pid)?n:void 0}catch{return}}s(zp,"Ja"),o(zp,"liveRunner");function Ub(e,t){try{return J7(e,{recursive:!0}),W7(Fp(e,C$),JSON.stringify(t)),!0}catch{return!1}}s(Ub,"Uk"),o(Ub,"publishCaptureRequest");var Np;async function qb(e,t){let r=Np;if(r)return{fresh:await r.promise,coalesced:!0,requestId:r.requestId};let n=t().finally(()=>{Np=void 0});return Np={promise:n,requestId:e},{fresh:await n,coalesced:!1,requestId:e}}s(qb,"Lk"),o(qb,"captureSingleFlight");async function Zb(e){let t=e.now??(()=>Date.now()),r=e.sleep??(a=>new Promise(l=>setTimeout(l,a))),n=e.budgetMs??8e3,u=e.pollMs??100,i=t()+n;for(;t()<i;){await r(u);let a=await e.readFrameId();if(a!==void 0&&a!==e.before)return!0}return!1}s(Zb,"Fk"),o(Zb,"waitForFreshFrame");var Mp=class extends Z7{static{s(this,"my")}static{o(this,"VisualCaptureFrameTool")}async execute(e){let t=this.get(Vr),r=this.get(Z),n=o(async()=>(await r.read("visual://current"))?.frame?.id,"readFrameId"),u=await n(),i=lt(),a=Date.now();t.publish({id:lt(),sessionId:"visual.capture_frame",timestamp:a,source:"visual",category:"visual",severity:"info",context:{sessionId:"visual.capture_frame"},fingerprint:`visual-capture-request:${e.cause}`,title:`visual.capture_frame(${e.cause})`,raw:{kind:"visual-capture-request",cause:e.cause,stable:e.stable,requestId:i}});let l=jp(),d=zp(l),c=!1,p=await qb(i,async()=>(c=Ub(l,{requestedAt:a,cause:e.cause,stable:e.stable,requestId:i}),c&&d?await Zb({readFrameId:n,before:u}):!1));return{requested:p.coalesced?!0:c,cause:e.cause,stable:e.stable,fresh:p.fresh,coalesced:p.coalesced,requestId:p.requestId,waitedMs:Date.now()-a,runner:d?{pid:d.pid,url:d.url}:void 0,latest:await r.read("visual://current")}}};Mp=F([q7({name:"visual.capture_frame",description:"Capture a fresh visual frame. Signals the host capture runner (which launches a headless browser on demand), waits for the new frame, and returns it. Frames are captured per request \u2014 no browser is held open between calls.",inputSchema:{cause:Tb.enum(["page-load","route-change","user-action","react-commit","state-update","api-response","hmr-update","animation-tick"]).default("user-action").describe("Hint why this frame is being requested."),stable:Tb.boolean().default(!0).describe("Whether to treat the captured frame as the stable final state.")}})],Mp);var K7=Mp;import{Tool as H7,ToolContext as X7,z as Y7}from"@frontmcp/sdk";var Op=class extends X7{static{s(this,"gy")}static{o(this,"VisualInspectNodeTool")}async execute(e){let t=await this.get(Z).read("visual://current");if(!t.frame)return{found:!1,uid:e.uid};let r=t.frame.changedNodes.filter(n=>n.uid===e.uid);return{found:r.length>0,uid:e.uid,frameId:t.frame.id,changes:r}}};Op=F([H7({name:"visual.inspect_node",description:"Returns the changedNodes entry for `uid` from visual://current \u2014 the per-property before/after used to compute the latest frame.",inputSchema:{uid:Y7.string().describe('Node uid as it appeared in visual://current.changedNodes (e.g. "hero-card" or "bid:42").')}})],Op);var Q7=Op;import{Tool as eA,ToolContext as tA,z as uA}from"@frontmcp/sdk";var Rp=class extends tA{static{s(this,"yy")}static{o(this,"VisualCompareFramesTool")}async execute(e){let t=await this.get(Z).read("visual://current");return t.frame?e.frameId&&e.frameId!==t.frame.id?{found:!1,reason:"Only the latest frame is retained in Phase 4."}:{found:!0,frameId:t.frame.id,causedBy:t.frame.causedBy,changedCount:t.frame.changedNodes.length,appeared:t.frame.appearedNodes.length,disappeared:t.frame.disappearedNodes.length,changedNodes:t.frame.changedNodes.slice(0,50)}:{found:!1}}};Rp=F([eA({name:"visual.compare_frames",description:"Summarises the last visual-frame. Phase 4 ships a single-frame view (Phase 6 adds story-relative deltas).",inputSchema:{frameId:uA.string().optional().describe("Optional frame id; defaults to the latest.")}})],Rp);var rA=Rp;import{Tool as nA,ToolContext as iA,z as sA}from"@frontmcp/sdk";var Tp=class extends iA{static{s(this,"wy")}static{o(this,"VisualExplainViolationTool")}async execute(e){let t=(await this.get(Z).read("visual://violations/current")).violations.find(r=>r.id===e.violationId);return t?{found:!0,violation:t,explanation:Lb(t)}:{found:!1,violationId:e.violationId}}};Tp=F([nA({name:"visual.explain_violation",description:"Returns the full violation record (rule id + expected/actual + evidence.cssCause / trace / screenshot crop URIs) for a given violationId.",inputSchema:{violationId:sA.string().describe("Id of the violation as seen in visual://violations/current.")}})],Tp);var aA=Tp;function Lb(e){let t=[`Rule ${e.ruleId} (${e.ruleType}) at ${e.element.component??e.element.uid}.`,`Expected: ${JSON.stringify(e.expected)}`,`Actual: ${JSON.stringify(e.actual)}`];return e.evidence.cssCause&&t.push(`CSS cause: ${e.evidence.cssCause.selector} { ${e.evidence.cssCause.declaration??"?"} }`+(e.evidence.cssCause.file?` @ ${e.evidence.cssCause.file}:${e.evidence.cssCause.line??"?"}`:"")),e.evidence.trace&&t.push(`Trace: ${e.evidence.trace}`),e.evidence.screenshotCrop&&t.push(`Crop: ${e.evidence.screenshotCrop}`),t.join(`
73
+ `)}s(Lb,"RN"),o(Lb,"buildExplanation");import{Tool as oA,ToolContext as lA,z as Me}from"@frontmcp/sdk";import{mkdirSync as dA,readFileSync as cA,renameSync as pA,writeFileSync as mA}from"node:fs";import{join as fA}from"node:path";var hA=500;function Jb(e){try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}s(Jb,"MN"),o(Jb,"pidAlive");function Vb(e){try{let t=JSON.parse(cA(e,"utf8"));return Array.isArray(t?.rules)?t.rules:[]}catch{return[]}}s(Vb,"NN"),o(Vb,"readEntries");function Wb(e,t,r={}){let n=r.pid??process.pid,u=r.isAlive??Jb,i=fA(e,_$),a=[...Vb(i).filter(d=>typeof d?.registeredBy=="number"&&typeof d?.rule?.id=="string"&&d.rule.id!==t.id&&(d.registeredBy===n||u(d.registeredBy))),{rule:t,registeredBy:n,registeredAt:(r.now??Date.now)()}].slice(-hA);dA(e,{recursive:!0});let l=`${i}.${n}.tmp`;return mA(l,JSON.stringify({schemaVersion:1,rules:a})),pA(l,i),a}s(Wb,"qk"),o(Wb,"registerSessionRule");var Pp=class extends lA{static{s(this,"$y")}static{o(this,"VisualRegisterRuleTool")}async execute(e){let t=this.get(Vr),r=this.get(Z),n={id:e.id,type:e.type,target:e.target,severity:e.severity,timing:e.timing,expected:e.expected,breakpoints:e.breakpoints};t.publish({id:lt(),sessionId:"visual.register_rule",timestamp:Date.now(),source:"visual",category:"visual",severity:"info",context:{sessionId:"visual.register_rule"},fingerprint:`visual-rule-registered:${e.id}`,title:`visual.register_rule(${e.id})`,raw:{kind:"visual-rule-registered",rule:n}});let u=jp(),i=!1,a;try{Wb(u,n),i=zp(u)!==void 0,a=i?"The capture runner evaluates this rule on the next captured frame (visual.capture_frame).":"No capture runner is listening, so nothing will evaluate this rule until one starts (the dev cluster gateway or agent-dev). It is listed, not enforced."}catch(l){a=`Could not hand the rule to the capture runner (${l.message}). It is listed, but will NOT be evaluated.`}return{registered:!0,evaluated:i,note:a,rule:{id:e.id,type:e.type,target:e.target},rules:await r.read("visual://rules")}}};Pp=F([oA({name:"visual.register_rule",description:"Register (or replace) a visual rule. It is handed to the capture runner, which evaluates it on every frame captured from now on, for as long as this lens server runs. The result says whether a runner is listening; if `evaluated` is false the rule is only listed, and no violation can come of it.",inputSchema:{id:Me.string().describe("Stable rule id; replaces a prior rule with the same id."),type:Me.enum(["grid-spacing","alignment","overflow","text-clipping","color-contrast","token-usage","z-index","responsive","custom"]).describe("Built-in rule type to evaluate."),target:Me.string().optional().describe('CSS-like selector / role:label / [data-agent-component="\u2026"]; default = every node.'),severity:Me.enum(["info","warning","error"]).default("warning"),timing:Me.enum(["always","after-animation","stable-only","during-animation"]).default("always"),expected:Me.record(Me.string(),Me.unknown()).default({}).describe('Rule-type-specific expectations (e.g. { gap: "spacing.6" }).'),breakpoints:Me.record(Me.string(),Me.record(Me.string(),Me.unknown())).optional().describe("Per-breakpoint expectation overrides for the responsive rule type.")}})],Pp);var gA=Pp,Gb=class{static{s(this,"ky")}static{o(this,"VisualApp")}};Gb=F([$7({id:"visual",name:"Visual",description:"Visual rule engine: DOMSnapshot/LayerTree diffs, grid/alignment/overflow/contrast/z-index rules, design tokens.",resources:[k7,_7,F7,N7,R7,U7],tools:[K7,Q7,rA,aA,gA]})],Gb);var on="visual://current",ln="visual://violations/current",dn="visual://violations/stable",cn="visual://violations/during-animation",pn="visual://rules",mn="visual://tokens";function Kb(e){let t=(e.now??(()=>Date.now()))(),r={violations:[],rules:[],framesSeen:0,changedAt:new Map},n=o((f,h)=>{r.changedAt.set(f,h),e.resources.markDirty(f)},"touch"),u=o(f=>{n(ln,f),n(dn,f),n(cn,f)},"touchViolationViews"),i=o(f=>{let h=f.raw??null;if(h?.kind)switch(h.kind){case"visual-frame":{let g=h.frame;if(!g)return;r.currentFrame=g,r.lastFrameAt=f.timestamp,r.framesSeen+=1,r.rulesEvaluated=typeof h.rulesEvaluated=="number"?h.rulesEvaluated:void 0,n(on,f.timestamp);let b=r.violations.length;r.violations=r.violations.filter(x=>x.frameId===g.id),b!==r.violations.length&&u(f.timestamp);return}case"visual-violation":if(!h.violation)return;r.violations.push(h.violation),r.violations.length>50&&r.violations.splice(0,r.violations.length-50),u(f.timestamp);return;case"visual-rule-registered":{let g=h.rule;if(!g)return;let b=r.rules.findIndex(x=>x.id===g.id);b>=0&&r.rules.splice(b,1),r.rules.push(g),r.rules.length>500&&r.rules.splice(0,r.rules.length-500),n(pn,f.timestamp);return}case"visual-tokens-loaded":if(!h.tokens)return;r.tokens=h.tokens,n(mn,f.timestamp);return;default:return}},"handler"),a=e.bus.subscribe(i),l=o(f=>new Date(r.changedAt.get(f)??t).toISOString(),"stamp"),d="No visual frame has ever been captured \u2014 an empty violation list is NOT evidence the UI is correct, nothing is looking. Drive a capture (visual_capture_frame) or run the browser-capture loop so frames reach this session.",c=o(()=>`${r.framesSeen} frame${r.framesSeen===1?"":"s"} captured`,"frameCount"),p=o(()=>({framesSeen:r.framesSeen,lastFrameAt:r.lastFrameAt,currentFrameId:r.currentFrame?.id,...r.rulesEvaluated!==void 0?{rulesEvaluated:r.rulesEvaluated}:{},producer:r.framesSeen===0?"none":"connected",detail:r.framesSeen===0?d:r.rulesEvaluated===void 0?`${c()}; ${r.rules.length} rule${r.rules.length===1?"":"s"} registered.`:`${c()}; ${r.rulesEvaluated} rule${r.rulesEvaluated===1?"":"s"} evaluated on the current one.`}),"frameHealth"),m=o(()=>{let f=p();return r.framesSeen===0||r.rulesEvaluated===void 0?r.framesSeen===0?f:{...f,detail:`${f.detail} Violations are those of the CURRENT frame \u2014 every rule is re-run per frame, so anything fixed simply stops being reported.`}:r.rulesEvaluated===0?{...f,producer:"none",detail:`${c()}, but NO rule was evaluated on the current one \u2014 an empty violation list is NOT evidence the UI is correct, nothing is being checked. Add rules to \`lensmcp.rules.json\` at the workspace root, or register one with visual.register_rule.`}:{...f,detail:`${f.detail} Violations are those of the CURRENT frame \u2014 every rule is re-run per frame, so anything fixed simply stops being reported.`}},"violationHealth");return e.resources.register(on,()=>({schemaVersion:1,revision:e.resources.revision(on)??0,updatedAt:l(on),frame:r.currentFrame??null,...p()})),e.resources.register(ln,()=>({schemaVersion:1,revision:e.resources.revision(ln)??0,updatedAt:l(ln),violations:r.violations.slice(),...m()})),e.resources.register(dn,()=>({schemaVersion:1,revision:e.resources.revision(dn)??0,updatedAt:l(dn),violations:r.violations.filter(f=>f.timing==="after-animation"||f.timing==="stable-only"||f.timing==="always"),...m()})),e.resources.register(cn,()=>({schemaVersion:1,revision:e.resources.revision(cn)??0,updatedAt:l(cn),violations:r.violations.filter(f=>f.timing==="during-animation"),...m()})),e.resources.register(pn,()=>({schemaVersion:1,revision:e.resources.revision(pn)??0,updatedAt:l(pn),rules:r.rules.slice()})),e.resources.register(mn,()=>({schemaVersion:1,revision:e.resources.revision(mn)??0,updatedAt:l(mn),tokens:r.tokens??null})),{unsubscribe:a,uris:[on,ln,dn,cn,pn,mn]}}s(Kb,"Sy"),o(Kb,"installVisualReducer");import{App as vA}from"@frontmcp/sdk";import{Resource as yA,ResourceContext as bA}from"@frontmcp/sdk";var Up=class extends bA{static{s(this,"Iy")}static{o(this,"ReactPagesCurrentResource")}async execute(){return this.get(Z).read("react://pages/current")}};Up=F([yA({name:"react-pages-current",uri:"react://pages/current",mimeType:"application/json",description:"The most recently active React page (from <LensmcpRoot>)."})],Up);var EA=Up;import{Resource as wA,ResourceContext as DA}from"@frontmcp/sdk";var qp=class extends DA{static{s(this,"Ey")}static{o(this,"ReactComponentsHotResource")}async execute(){return this.get(Z).read("react://components/hot")}};qp=F([wA({name:"react-components-hot",uri:"react://components/hot",mimeType:"application/json",description:"Components ranked by render count this session."})],qp);var $A=qp;import{Resource as BA,ResourceContext as xA}from"@frontmcp/sdk";var Zp=class extends xA{static{s(this,"Ay")}static{o(this,"ReactRendersSlowResource")}async execute(){return this.get(Z).read("react://renders/slow")}};Zp=F([BA({name:"react-renders-slow",uri:"react://renders/slow",mimeType:"application/json",description:"Renders with actualDurationMs >= threshold (default 16ms)."})],Zp);var kA=Zp;import{Resource as CA,ResourceContext as AA}from"@frontmcp/sdk";var Lp=class extends AA{static{s(this,"Oy")}static{o(this,"ReactRendersRecentResource")}async execute(){return this.get(Z).read("react://renders/recent")}};Lp=F([CA({name:"react-renders-recent",uri:"react://renders/recent",mimeType:"application/json",description:"Last 100 render commits with attribution (why)."})],Lp);var _A=Lp;import{Resource as IA,ResourceContext as SA}from"@frontmcp/sdk";var Jp=class extends SA{static{s(this,"My")}static{o(this,"ReactEffectsRecentResource")}async execute(){return this.get(Z).read("react://effects/recent")}};Jp=F([IA({name:"react-effects-recent",uri:"react://effects/recent",mimeType:"application/json",description:"Last 100 useEffect runs/cleanups from tracedUseEffect."})],Jp);var FA=Jp;import{Resource as jA,ResourceContext as zA}from"@frontmcp/sdk";var Vp=class extends zA{static{s(this,"Py")}static{o(this,"ReactMemosRecomputedResource")}async execute(){return this.get(Z).read("react://memos/recomputed")}};Vp=F([jA({name:"react-memos-recomputed",uri:"react://memos/recomputed",mimeType:"application/json",description:"Recent useMemo recomputations (depsHash changed)."})],Vp);var NA=Vp;import{Resource as MA,ResourceContext as OA}from"@frontmcp/sdk";var Wp=class extends OA{static{s(this,"Cy")}static{o(this,"ReactHooksRecentResource")}async execute(){return this.get(Z).read("react://hooks/recent")}};Wp=F([MA({name:"react-hooks-recent",uri:"react://hooks/recent",mimeType:"application/json",description:"Recent hook-run events (useMemo / useCallback)."})],Wp);var RA=Wp;import{Tool as TA,ToolContext as PA,z as Gp}from"@frontmcp/sdk";var Kp=class extends PA{static{s(this,"Fy")}static{o(this,"GraphExplainRerenderTool")}async execute(e){let t=await this.get(Z).read("react://renders/recent"),r;if(e.renderNodeId)r=t.renders.find(u=>u.id===e.renderNodeId);else if(e.componentInstanceId)for(let u=t.renders.length-1;u>=0;u--){let i=t.renders[u];if(i&&i.componentInstanceId===e.componentInstanceId){r=i;break}}else if(e.componentLogicalId)for(let u=t.renders.length-1;u>=0;u--){let i=t.renders[u];if(i&&i.componentLogicalId===e.componentLogicalId){r=i;break}}if(!r)return{found:!1,searched:e};let n=(r.why??[]).map(u=>({...u,summary:Hb(u)}));return{found:!0,renderNodeId:r.id,componentInstanceId:r.componentInstanceId,componentLogicalId:r.componentLogicalId,componentName:r.componentName,page:r.page,route:r.route,phase:r.phase,actualDurationMs:r.actualDurationMs,why:n,parentRenderId:r.parentRenderId}}};Kp=F([TA({name:"graph.explain_rerender",description:"Returns the most recent render record for a component (by `renderNodeId`, `componentInstanceId`, or `componentLogicalId`), with its `why` causal list (valtio-path / parent-render / hook-dep-changed / props / context / react-state / force).",inputSchema:{renderNodeId:Gp.string().optional().describe("Exact render commit id from react://renders/recent."),componentInstanceId:Gp.string().optional().describe("Component instance id; resolves to that instance\u2019s last render."),componentLogicalId:Gp.string().optional().describe("Component logical id (e.g. react:component:src/App.tsx:CardGrid); resolves to its most recent render across HMR generations.")}})],Kp);var UA=Kp;function Hb(e){switch(e.type){case"valtio-path":return`valtio path ${String(e.path)} changed (${e.changedKeys?.join(",")??""})`;case"react-state":return`useState hook #${String(e.hookIndex)} changed`;case"context":return`context ${String(e.contextName)} changed`;case"props":return`prop(s) changed: ${e.changedKeys?.join(",")??""}`;case"parent-render":return`parent render ${String(e.parentRenderId)} triggered this`;case"hook-dep-changed":return`hook ${String(e.hookInstanceId)} deps changed`;case"force":return`forced render: ${String(e.reason)}`;default:return`unknown cause: ${JSON.stringify(e)}`}}s(Hb,"tP"),o(Hb,"summariseWhy");var Xb=class{static{s(this,"qy")}static{o(this,"ReactApp")}};Xb=F([vA({id:"react",name:"React",description:"React render attribution: pages, hot components, slow renders, hook + effect + memo events. Hosts graph.explain_rerender.",resources:[EA,$A,kA,_A,FA,NA,RA],tools:[UA]})],Xb);var fn="react://pages/current",Hs="react://components/hot",Xs="react://renders/slow",Ys="react://renders/recent",Qs="react://effects/recent",ea="react://memos/recomputed",ta="react://hooks/recent",ua=100,Hp=50,Yb=500;function Qb(e){let t=Ye(e.thresholds).slowRenderMs,r={rendersRecent:[],rendersSlow:[],effectsRecent:[],hooksRecent:[],memosRecomputed:[],rendersByInstance:new Map,hotByLogical:new Map},n=o(i=>{if(i.source!=="react")return;let a=i.raw??null;if(a?.kind)switch(a.kind){case"render":{let l=a.render;if(!l)return;if(Nu(r.rendersRecent,l,ua),r.rendersByInstance.delete(l.componentInstanceId),r.rendersByInstance.set(l.componentInstanceId,l),r.rendersByInstance.size>Yb){for(let c of r.rendersByInstance.keys())if(r.rendersByInstance.delete(c),r.rendersByInstance.size<=Yb)break}l.actualDurationMs>=t&&(Nu(r.rendersSlow,l,Hp),r.rendersSlow.sort((c,p)=>p.actualDurationMs-c.actualDurationMs),r.rendersSlow.length>Hp&&(r.rendersSlow.length=Hp));let d=r.hotByLogical.get(l.componentLogicalId);d?(d.renderCount+=1,d.totalActualMs+=l.actualDurationMs,d.lastRenderId=l.id):r.hotByLogical.set(l.componentLogicalId,{componentLogicalId:l.componentLogicalId,componentName:l.componentName,renderCount:1,totalActualMs:l.actualDurationMs,lastRenderId:l.id}),(l.page||l.route)&&(r.currentPage={page:l.page??"(unknown)",route:l.route,updatedAt:i.timestamp},e.resources.markDirty(fn)),e.resources.markDirty(Ys),e.resources.markDirty(Hs),l.actualDurationMs>=t&&e.resources.markDirty(Xs);return}case"effect-run":{let l=a.effect;if(!l)return;Nu(r.effectsRecent,l,ua),e.resources.markDirty(Qs);return}case"hook-run":{let l=a.hook;if(!l)return;Nu(r.hooksRecent,l,ua),e.resources.markDirty(ta),l.recomputed&&l.hookType==="useMemo"&&(Nu(r.memosRecomputed,l,ua),e.resources.markDirty(ea));return}case"component-mount":case"component-unmount":{let l=a.component;if(!l)return;(l.page||l.route)&&(r.currentPage={page:l.page??"(unknown)",route:l.route,updatedAt:i.timestamp},e.resources.markDirty(fn));return}default:return}},"handler"),u=e.bus.subscribe(n);return e.resources.register(fn,()=>({schemaVersion:1,revision:e.resources.revision(fn)??0,updatedAt:new Date().toISOString(),page:r.currentPage??null})),e.resources.register(Hs,()=>({schemaVersion:1,revision:e.resources.revision(Hs)??0,updatedAt:new Date().toISOString(),components:[...r.hotByLogical.values()].sort((i,a)=>a.renderCount-i.renderCount)})),e.resources.register(Xs,()=>({schemaVersion:1,revision:e.resources.revision(Xs)??0,updatedAt:new Date().toISOString(),thresholdMs:t,renders:r.rendersSlow.slice()})),e.resources.register(Ys,()=>({schemaVersion:1,revision:e.resources.revision(Ys)??0,updatedAt:new Date().toISOString(),renders:r.rendersRecent.slice()})),e.resources.register(Qs,()=>({schemaVersion:1,revision:e.resources.revision(Qs)??0,updatedAt:new Date().toISOString(),effects:r.effectsRecent.slice()})),e.resources.register(ea,()=>({schemaVersion:1,revision:e.resources.revision(ea)??0,updatedAt:new Date().toISOString(),memos:r.memosRecomputed.slice()})),e.resources.register(ta,()=>({schemaVersion:1,revision:e.resources.revision(ta)??0,updatedAt:new Date().toISOString(),hooks:r.hooksRecent.slice()})),{unsubscribe:u,uris:[fn,Hs,Xs,Ys,Qs,ea,ta],lookups:{latestRenderFor(i){return r.rendersByInstance.get(i)},latestRenderForLogical(i){if(r.hotByLogical.get(i))for(let a=r.rendersRecent.length-1;a>=0;a--){let l=r.rendersRecent[a];if(l&&l.componentLogicalId===i)return l}}}}}s(Qb,"Vy"),o(Qb,"installReactReducer");function Nu(e,t,r){e.push(t),e.length>r&&e.splice(0,e.length-r)}s(Nu,"Go"),o(Nu,"pushBounded");import{App as qA}from"@frontmcp/sdk";import{Resource as ZA,ResourceContext as LA}from"@frontmcp/sdk";var Xp=class extends LA{static{s(this,"Gy")}static{o(this,"ValtioUpdatesRecentResource")}async execute(){return this.get(Z).read("valtio://updates/recent")}};Xp=F([ZA({name:"valtio-updates-recent",uri:"valtio://updates/recent",mimeType:"application/json",description:"Last 100 Valtio state-update events with path + changedKeys + subscribers."})],Xp);var JA=Xp;import{Resource as VA,ResourceContext as WA}from"@frontmcp/sdk";var Yp=class extends WA{static{s(this,"Jy")}static{o(this,"ValtioStoresResource")}async execute(){return this.get(Z).read("valtio://stores")}};Yp=F([VA({name:"valtio-stores",uri:"valtio://stores",mimeType:"application/json",description:"Registered Valtio stores (created via lensmcp-wrapped proxy())."})],Yp);var GA=Yp;import{Resource as KA,ResourceContext as HA}from"@frontmcp/sdk";var Qp=class extends HA{static{s(this,"Hy")}static{o(this,"ValtioSubscribersResource")}async execute(){return this.get(Z).read("valtio://subscribers")}};Qp=F([KA({name:"valtio-subscribers",uri:"valtio://subscribers",mimeType:"application/json",description:"Per-(storeId, path) list of component instance ids currently subscribed via tracked useSnapshot."})],Qp);var XA=Qp,eE=class{static{s(this,"Yy")}static{o(this,"ValtioApp")}};eE=F([qA({id:"valtio",name:"Valtio",description:"Valtio store + subscription tracking. Phase 5 ships updates/stores/subscribers; per-path subscriber walks land via graph.explain_rerender.",resources:[JA,GA,XA]})],eE);var ra="valtio://updates/recent",na="valtio://stores",hn="valtio://subscribers",tE=100,uE=1e3,YA=1e3,QA=256,e_=256;function rE(e,t){if(e.size<=t)return;let r=e.values();for(;e.size>t;){let n=r.next();if(n.done)break;e.delete(n.value)}}s(rE,"fP"),o(rE,"capSet");function em(e){let t=Array.isArray(e.paths)?e.paths.filter(r=>typeof r=="string"):void 0;return t&&t.length>0?t.slice(0,QA):typeof e.path=="string"?[e.path]:[]}s(em,"Wk"),o(em,"subscriptionPaths");function tm(e){return e.componentLogicalId??e.componentInstanceId??"react:component:anonymous"}s(tm,"Jk"),o(tm,"subscriberId");function nE(e){let t={updates:[],stores:new Map,subscribers:new Map,latestUpdateByPath:new Map},r=o(u=>{if(u.source!=="valtio")return;let i=u.raw??null;if(i?.kind)switch(i.kind){case"state-update":{let a=i.update;if(!a)return;let l={...a,emittedAt:u.timestamp};t.updates.push(l),t.updates.length>tE&&t.updates.splice(0,t.updates.length-tE);let d=`${a.storeId}::${a.path}`;if(t.latestUpdateByPath.delete(d),t.latestUpdateByPath.set(d,l),t.latestUpdateByPath.size>uE){for(let c of t.latestUpdateByPath.keys())if(t.latestUpdateByPath.delete(c),t.latestUpdateByPath.size<=uE)break}e.resources.markDirty(ra);return}case"store-created":{let a=i.store;if(!a)return;t.stores.set(a.storeId,{...a,createdAt:u.timestamp}),e.resources.markDirty(na);return}case"subscription-added":{let a=i.subscription;if(!a||!a.componentInstanceId)return;let l=tm(a);for(let d of em(a)){let c=`${a.storeId}::${d}`,p=t.subscribers.get(c);p||(p=new Map,t.subscribers.set(c,p));let m=p.get(l);m||(m=new Set,p.set(l,m)),m.add(a.componentInstanceId),Zt(p,Wr),rE(m,e_)}Zt(t.subscribers,YA),e.resources.markDirty(hn);return}case"subscription-removed":{let a=i.subscription;if(!a||!a.componentInstanceId)return;let l=tm(a);for(let d of em(a)){let c=`${a.storeId}::${d}`,p=t.subscribers.get(c);if(!p)continue;let m=p.get(l);m&&(m.delete(a.componentInstanceId),m.size===0&&p.delete(l)),p.size===0&&t.subscribers.delete(c)}e.resources.markDirty(hn);return}default:return}},"handler"),n=e.bus.subscribe(r);return e.resources.register(ra,()=>({schemaVersion:1,revision:e.resources.revision(ra)??0,updatedAt:new Date().toISOString(),updates:t.updates.slice()})),e.resources.register(na,()=>({schemaVersion:1,revision:e.resources.revision(na)??0,updatedAt:new Date().toISOString(),stores:[...t.stores.values()]})),e.resources.register(hn,()=>({schemaVersion:1,revision:e.resources.revision(hn)??0,updatedAt:new Date().toISOString(),subscriptions:[...t.subscribers.entries()].map(([u,i])=>{let[a,l]=u.split("::");return{storeId:a,path:l,componentInstanceIds:[...i.keys()]}})})),{unsubscribe:n,uris:[ra,na,hn],lookups:{latestUpdateForPath(u,i){return t.latestUpdateByPath.get(`${u}::${i}`)},subscribersFor(u,i){return[...t.subscribers.get(`${u}::${i}`)?.keys()??[]]}}}}s(nE,"Qy"),o(nE,"installValtioReducer");import{App as t_}from"@frontmcp/sdk";import{Resource as u_,ResourceContext as r_}from"@frontmcp/sdk";var um=class extends r_{static{s(this,"eb")}static{o(this,"GraphPatternsResource")}async execute(){return this.get(Z).read("graph://patterns")}};um=F([u_({name:"graph-patterns",uri:"graph://patterns",mimeType:"application/json",description:"Recent detected anti-patterns (db-in-loop, n+1-query, render-storm)."})],um);var n_=um;import{Resource as i_,ResourceContext as s_}from"@frontmcp/sdk";var rm=class extends s_{static{s(this,"rb")}static{o(this,"GraphEventLoopLagResource")}async execute(){return this.get(Z).read("graph://performance/event-loop-lag")}};rm=F([i_({name:"graph-event-loop-lag",uri:"graph://performance/event-loop-lag",mimeType:"application/json",description:"Recent event-loop-lag samples + the max lag seen."})],rm);var a_=rm;import{Tool as o_,ToolContext as l_,z as d_}from"@frontmcp/sdk";var iE;function nm(e){iE=e}s(nm,"oc"),o(nm,"setActiveGraphBuffer");function gn(){return iE?.events??[]}s(gn,"Wt"),o(gn,"currentEvents");function Ht(){let e=new E4;return K3(e,gn()),e}s(Ht,"Ve"),o(Ht,"buildGraph");var im=class extends l_{static{s(this,"ob")}static{o(this,"GraphGetNodeTool")}async execute(e){let t=Ht().getNode(e.nodeId);return t?{found:!0,node:t}:{found:!1,nodeId:e.nodeId}}};im=F([o_({name:"graph.get_node",description:"Returns a single graph node by id (built from the current event window).",inputSchema:{nodeId:d_.string().describe("Node id (usually the originating event id).")}})],im);var c_=im;import{Tool as p_,ToolContext as m_,z as Mu}from"@frontmcp/sdk";var f_=["ownership","caused","async","data","render","state","network","backend","db","visual","performance","memory","lifecycle"],sm=class extends m_{static{s(this,"sb")}static{o(this,"GraphTraverseTool")}async execute(e){let t=Ht().traverse({from:e.from,lens:e.lens,depth:e.depth,direction:e.direction,maxNodes:e.maxNodes});return{nodeCount:t.nodes.length,edgeCount:t.edges.length,nodes:t.nodes.map(r=>({id:r.id,type:r.type,name:r.name,durationMs:r.durationMs,flowId:r.context.flowId})),edges:t.edges.map(r=>({from:r.from,to:r.to,axis:r.axis,type:r.type}))}}};sm=F([p_({name:"graph.traverse",description:'Walk the multi-axis trace graph from a node along one or more edge axes (the "lens"). Bounded by depth + node count.',inputSchema:{from:Mu.string().describe("Start node id."),lens:Mu.array(Mu.enum(f_)).min(1).describe('Edge axes to follow (e.g. ["caused","backend"]).'),depth:Mu.number().int().positive().max(12).default(4),direction:Mu.enum(["out","in","both"]).default("both"),maxNodes:Mu.number().int().positive().max(1e3).default(200)}})],sm);var h_=sm;import{Tool as g_,ToolContext as v_,z as y_}from"@frontmcp/sdk";var am=class extends v_{static{s(this,"cb")}static{o(this,"GraphFindDbInLoopTool")}async execute(e){let t=jd(gn(),{threshold:e.threshold});return{count:t.length,matches:t}}};am=F([g_({name:"graph.find_db_in_loop",description:"Scan the current event window for loops that issued more than `threshold` DB calls (N+1-ish backend anti-pattern).",inputSchema:{threshold:y_.number().int().positive().default(5)}})],am);var b_=am;import{Tool as E_,ToolContext as w_,z as D_}from"@frontmcp/sdk";var om=class extends w_{static{s(this,"lb")}static{o(this,"GraphFindSlowPathTool")}async execute(e){let t=Ht(),r=new Map,n=gn(),u=e.from?[e.from]:n.filter(l=>l.context.originNodeId===void 0&&l.context.flowId).map(l=>l.id);for(let l of n){let d=t.traverse({from:l.id,lens:["caused","async","backend"],depth:1,direction:"out",maxNodes:50});r.set(l.id,d.edges.filter(c=>c.from===l.id).map(c=>c.to))}let i=o(l=>t.getNode(l)?.durationMs??0,"durationOf"),a=V3(u.length?u:n.map(l=>l.id),r,i);return{totalDurationMs:a.totalDurationMs,path:a.path.map(l=>{let d=t.getNode(l);return{id:l,name:d?.name,type:d?.type,durationMs:d?.durationMs}})}}};om=F([E_({name:"graph.find_slow_path",description:"Find the slowest cumulative chain on the caused/async/backend axes starting from a node (or every flow origin if `from` is omitted).",inputSchema:{from:D_.string().optional().describe("Start node id; defaults to all flow origins.")}})],om);var $_=om;import{Tool as B_,ToolContext as x_,z as sE}from"@frontmcp/sdk";var lm=class extends x_{static{s(this,"pb")}static{o(this,"GraphTraceFromOriginTool")}async execute(e){let t=Ht(),r=e.originNodeId;if(!t.getNode(r)){let i=gn().find(a=>a.context.originNodeId===e.originNodeId||a.raw?.origin?.nodeId===e.originNodeId);i&&(r=i.id)}let n=t.getNode(r);if(!n)return{found:!1,originNodeId:e.originNodeId};let u=t.traverse({from:r,lens:["caused","render","state","backend","async"],depth:e.depth,direction:"out",maxNodes:500});return{found:!0,origin:{id:r,name:n.name,type:n.type},nodeCount:u.nodes.length,nodes:u.nodes.map(i=>({id:i.id,type:i.type,name:i.name,durationMs:i.durationMs}))}}};lm=F([B_({name:"graph.trace_from_origin",description:'Given an origin node id (e.g. a data-agent-component value or an event id), returns every node reachable on the caused/render/state/backend axes \u2014 "what did this cause?".',inputSchema:{originNodeId:sE.string().describe("Origin node id, logicalId, or originating event id."),depth:sE.number().int().positive().max(12).default(6)}})],lm);var k_=lm;import{Tool as C_,ToolContext as A_,z as aE}from"@frontmcp/sdk";var dm=class extends A_{static{s(this,"mb")}static{o(this,"GraphFindStateUpdatesCausedByTool")}async execute(e){let t=Ht();if(!t.getNode(e.from))return{found:!1,from:e.from};let r=t.traverse({from:e.from,lens:["caused","state"],depth:e.depth,direction:"out",maxNodes:500}).nodes.filter(n=>n.type==="state-update");return{found:!0,count:r.length,stateUpdates:r.map(n=>({id:n.id,name:n.name,logicalId:n.logicalId}))}}};dm=F([C_({name:"graph.find_state_updates_caused_by",description:'From an origin node, returns the state-update nodes reachable on the caused/state axes \u2014 "what state changed because of this?".',inputSchema:{from:aE.string().describe("Origin node id."),depth:aE.number().int().positive().max(12).default(6)}})],dm);var __=dm;import{Tool as I_,ToolContext as S_,z as oE}from"@frontmcp/sdk";var cm=class extends S_{static{s(this,"gb")}static{o(this,"GraphFindBackendWorkCausedByClickTool")}async execute(e){let t=Ht();if(!t.getNode(e.from))return{found:!1,from:e.from};let r=t.traverse({from:e.from,lens:["caused","backend","async"],depth:e.depth,direction:"out",maxNodes:500}).nodes.filter(n=>n.type==="server-request");return{found:!0,count:r.length,requests:r.map(n=>({id:n.id,name:n.name,durationMs:n.durationMs}))}}};cm=F([I_({name:"graph.find_backend_work_caused_by_click",description:'From a UI origin node, returns the server-request nodes reachable on the caused/backend/async axes \u2014 "what backend work did this click trigger?".',inputSchema:{from:oE.string().describe("UI origin node id (e.g. the user-action event id)."),depth:oE.number().int().positive().max(12).default(8)}})],cm);var F_=cm,lE=class{static{s(this,"yb")}static{o(this,"GraphApp")}};lE=F([t_({id:"graph",name:"Graph",description:"Multi-axis causal graph: traverse by lens, trace from origin, find slow paths + db-in-loop / n+1 / render-storm patterns.",resources:[n_,a_],tools:[c_,h_,b_,$_,k_,__,F_]})],lE);var Ou="graph://patterns",Ru="graph://performance/event-loop-lag",pm=2e3,dE=8*1024*1024,j_=100,cE=100;function pE(e){let t=Ye(e.thresholds),r=(e.now??(()=>Date.now()))(),n={events:[]},u=[],i=0,a=0,l=0,d=new Set,c=[],p=new Map,m,f=new Map,h=o(k=>{switch(k.kind){case"n+1-query":return`n+1:${String(k.details.signature??"")}`;case"render-storm":return`storm:${String(k.details.componentInstanceId??"")}`;case"db-in-loop":return`dbloop:${k.evidence[0]??""}`;default:return`${k.kind}:${k.evidence.join(",")}`}},"patternKey"),g=o(k=>{p.set(Ou,k),e.resources.markDirty(Ou)},"markPatterns"),b=o((k,M)=>{let y=h(k);if(f.delete(y),f.set(y,k),f.size>j_){let D=f.keys().next().value;D!==void 0&&f.delete(D)}g(M)},"pushPattern"),x=o(k=>{let M=!1;for(let[y,D]of f){if(D.evidence.length===0)continue;let A=D.evidence.filter(j=>d.has(j));if(A.length===0){f.delete(y),M=!0;continue}A.length!==D.evidence.length&&(D.evidence=A,M=!0)}M&&g(k)},"dropUnevidencedPatterns"),$=o(k=>{m=k.timestamp;let M=os(k);n.events.push(k),u.push(M),i+=M,d.add(k.id);let y=Math.max(0,n.events.length-pm),D=i;for(let N=0;N<y;N+=1)D-=u[N]??0;let A=0;for(;D>dE&&y<u.length;)D-=u[y]??0,y+=1,A+=1;if(y>0){let N=n.events.splice(0,y);u.splice(0,y),i=Math.max(0,D),a+=N.length,l+=A;for(let K of N)d.delete(K.id);x(k.timestamp)}let j=k.raw??null;if(j?.kind==="loop")for(let N of jd(n.events,{threshold:t.dbInLoop}))b(N,k.timestamp);if(j?.kind==="db-query")for(let N of L3(n.events,{threshold:t.nPlusOne}))b(N,k.timestamp);if(k.source==="react"&&j?.kind==="render")for(let N of J3(n.events,{threshold:t.renderStorm}))b(N,k.timestamp);k.source==="perf"&&j?.kind==="event-loop-lag"&&typeof j.lagMs=="number"&&(c.push({at:k.timestamp,lagMs:j.lagMs,source:k.source}),c.length>cE&&c.splice(0,c.length-cE),p.set(Ru,k.timestamp),e.resources.markDirty(Ru))},"handler"),w=e.bus.subscribe($);nm(n);let C=o(k=>new Date(p.get(k)??r).toISOString(),"stamp");return e.resources.register(Ou,()=>({schemaVersion:1,revision:e.resources.revision(Ou)??0,updatedAt:C(Ou),patterns:[...f.values()],eventsBuffered:n.events.length,eventBufferCapacity:pm,lastEventAt:m,producer:m===void 0?"none":"connected"})),e.resources.register(Ru,()=>({schemaVersion:1,revision:e.resources.revision(Ru)??0,updatedAt:C(Ru),samples:c.slice(),maxLagMs:c.reduce((k,M)=>Math.max(k,M.lagMs),0),lastEventAt:m})),{unsubscribe:o(()=>{nm(void 0),w()},"unsubscribe"),uris:[Ou,Ru],retentionStats:o(()=>({residentEvents:n.events.length,residentBytes:i,evictedEvents:a,evictedForBytes:l,eventCap:pm,byteCap:dE}),"retentionStats")}}s(pE,"wb"),o(pE,"installGraphReducer");import{App as z_}from"@frontmcp/sdk";import{Resource as N_,ResourceContext as M_}from"@frontmcp/sdk";var mm=class extends M_{static{s(this,"xb")}static{o(this,"MemoryCurrentResource")}async execute(){return this.get(Z).read("memory://current")}};mm=F([N_({name:"memory-current",uri:"memory://current",mimeType:"application/json",description:"Last process-memory sample (heapUsed / rss)."})],mm);var O_=mm;import{Resource as R_,ResourceContext as T_}from"@frontmcp/sdk";var fm=class extends T_{static{s(this,"_b")}static{o(this,"MemoryOwnersResource")}async execute(){return this.get(Z).read("memory://owners")}};fm=F([R_({name:"memory-owners",uri:"memory://owners",mimeType:"application/json",description:"All tracked container owners with current item count + byte estimate."})],fm);var P_=fm;import{Resource as U_,ResourceContext as q_}from"@frontmcp/sdk";var hm=class extends q_{static{s(this,"Sb")}static{o(this,"MemoryOwnersGrowingResource")}async execute(){return this.get(Z).read("memory://owners/growing")}};hm=F([U_({name:"memory-owners-growing",uri:"memory://owners/growing",mimeType:"application/json",description:"Top 20 container owners by growth-since-start."})],hm);var Z_=hm;import{Resource as L_,ResourceContext as J_}from"@frontmcp/sdk";var gm=class extends J_{static{s(this,"Rb")}static{o(this,"MemoryLeaksSuspectedResource")}async execute(){return this.get(Z).read("memory://leaks/suspected")}};gm=F([L_({name:"memory-leaks-suspected",uri:"memory://leaks/suspected",mimeType:"application/json",description:"Suspected leaks: per-flow retentions + stale-generation singletons."})],gm);var V_=gm;import{Resource as W_,ResourceContext as G_}from"@frontmcp/sdk";var vm=class extends G_{static{s(this,"Tb")}static{o(this,"MemoryPodsResource")}async execute(){return this.get(Z).read("memory://pods")}};vm=F([W_({name:"memory-pods",uri:"memory://pods",mimeType:"application/json",description:"Each dev-cluster pod's heap after a full GC (boot, after every hot swap, after bursts), a short per-service history, and closed generations proven still in memory."})],vm);var K_=vm;import{Tool as H_,ToolContext as X_,z as Y_}from"@frontmcp/sdk";var mE;function ym(e){mE=e}s(ym,"ic"),o(ym,"setActiveMemoryLookups");function Tu(){return mE}s(Tu,"nt"),o(Tu,"activeMemoryLookups");var bm=class extends X_{static{s(this,"jb")}static{o(this,"MemoryFindGrowthByFlowTool")}async execute(e){let t=Tu();if(!t)return{found:!1,reason:"no active memory reducer"};let r=t.growthByFlow(e.flowId);return{found:!0,flowId:e.flowId,owners:r}}};bm=F([H_({name:"memory.find_growth_by_flow",description:'Returns the container owners mutated during a flow and how much each grew \u2014 "what did this flow allocate?".',inputSchema:{flowId:Y_.string().describe("Flow id.")}})],bm);var Q_=bm;import{Tool as eI,ToolContext as tI,z as uI}from"@frontmcp/sdk";var Em=class extends tI{static{s(this,"zb")}static{o(this,"MemoryFindFlowsThatMutatedOwnerTool")}async execute(e){let t=Tu();if(!t)return{found:!1,reason:"no active memory reducer"};let r=t.flowsThatMutatedOwner(e.ownerId);return{found:!0,ownerId:e.ownerId,flowIds:r}}};Em=F([eI({name:"memory.find_flows_that_mutated_owner",description:"Returns the flow ids that mutated a given container owner.",inputSchema:{ownerId:uI.string().describe("Owner id (<ownerInstanceId>::<fieldName>).")}})],Em);var rI=Em;import{Tool as nI,ToolContext as iI,z as sI}from"@frontmcp/sdk";var wm=class extends iI{static{s(this,"Nb")}static{o(this,"MemoryExplainLeakTool")}async execute(e){let t=Tu();if(!t)return{found:!1,reason:"no active memory reducer"};let r=t.getLeak(e.leakIndex);if(!r)return{found:!1,leakIndex:e.leakIndex};let n,u;if(r.kind==="retention"){let i=r.detail;n=`Owner ${i.ownerId} grew by ${i.growth} items during flow ${i.flowId} and did not shrink after the flow settled.`,u="Add a TTL / max-size eviction policy to this container, or clear it when the owning scope is disposed. If it is a request-scoped cache, move it off the singleton."}else{let i=r.detail;n=`${r.service??r.project} pod #${r.pod} (pid ${r.pid}): hot-swap generation ${i.gen} is still in memory ${Math.round(i.ageMs/1e3)}s after its app was closed, through ${i.gcs} full GCs and ${i.swapsSinceClose} swap(s) \u2014 still alive: ${(i.alive??[]).join(", ")}. Not garbage: something still points into it.`,u=`Run \`lensmcp mem ${r.service??r.project} --snapshot --analyze\` for the shortest path from the GC roots to it. Usual retainers: a listener on a process-global emitter, a module-level cache or registry, a timer the old app's onModuleDestroy does not clear. memory.explain_pod reads the pod's whole picture.`}return{found:!0,leak:r,narrative:n,recommendation:u}}};wm=F([nI({name:"memory.explain_leak",description:"Returns a narrative explanation of a suspected leak (by index in memory://leaks/suspected): which owner and flow grew, or which pod generation outlived its close \u2014 and a remediation hint.",inputSchema:{leakIndex:sI.number().int().nonnegative().describe("Index into memory://leaks/suspected.")}})],wm);var aI=wm;import{Tool as oI,ToolContext as lI,z as fE}from"@frontmcp/sdk";var hE=6,Dm=class extends lI{static{s(this,"Db")}static{o(this,"MemoryPodsTool")}async execute(e){let t=Tu();if(!t)return{found:!1,reason:"no active memory reducer"};if(e.service){let n=t.podsOf(e.service);return n?{found:!0,...n,history:n.history.slice(-(e.history??hE))}:{found:!1,service:e.service,known:t.pods().map(u=>u.service).slice(0,32),reason:"no pod of that service has reported \u2014 pods report at boot and after every hot swap"}}let r=t.pods().slice(0,32).map(n=>({project:n.project,service:n.service,lastSeenAt:n.lastSeenAt,pods:n.pods}));return{found:r.length>0,services:r}}};Dm=F([oI({name:"memory.pods",description:"What each dev-cluster pod weighs: heap after a full GC, reserved heap, rss, boot baseline, swaps, and any closed hot-swap generation proven still in memory. Give `service` for that service's recent per-swap history.",inputSchema:{service:fE.string().optional().describe("Nx project or cluster service name. Omit for every service (latest reading per pod, no history)."),history:fE.number().int().min(0).max(12).optional().describe(`Recent readings to include for one service (default ${hE}).`)}})],Dm);var dI=Dm;import{Tool as cI,ToolContext as pI,z as gE}from"@frontmcp/sdk";var ia=o(e=>e>=1073741824?`${(e/1073741824).toFixed(1)} GB`:`${Math.round(e/1048576)} MB`,"mb"),vE=o(e=>e<9e4?`${Math.round(e/1e3)}s`:`${Math.round(e/6e4)} min`,"age");function yE(e,t,r=Date.now()){let n=t.latest,u=[];if(!n)return{service:e.service,pod:t.pod,pid:t.pid,narrative:`${e.service} pod #${t.pod} (pid ${t.pid}) has not reported a reading yet.`,findings:u,recommendation:"It reports at boot and after every swap \u2014 check `lensmcp mem` once it has booted."};let i=n.baseline??(n.trigger==="boot"?n.live:void 0),a=i?n.live/i:void 0,l=`${e.service} pod #${t.pod} (pid ${t.pid}): ${ia(n.live)} live after a full GC (${n.trigger}, ${vE(r-n.at)} ago), generation ${n.gen} after ${n.swaps} swap${n.swaps===1?"":"s"}`;i&&a!==void 0&&(l+=` \u2014 ${a.toFixed(1)}\xD7 the ${ia(i)} it booted with`),l+=".",a!==void 0&&a>=2.5?u.push(`At ${a.toFixed(1)}\xD7 its boot heap it is near the recycle bound (3\xD7 by default): the pod will be replaced by a fresh process if it grows further.`):a!==void 0&&a>=1.4&&u.push(`More than one generation's worth of live heap (${a.toFixed(1)}\xD7): a generation still draining or pinned, or state the app accumulated since boot.`),n.used-n.live>=64*1048576&&u.push(`That collection gave back ${ia(n.used-n.live)} of garbage \u2014 what an idle pod kept before it collected on its own.`),n.reserved-n.live>=128*1048576&&u.push(`V8 holds ${ia(n.reserved-n.live)} reserved beyond the live heap; that is the allocator's slack, which a later GC shrinks \u2014 not a leak.`),n.previousAlive===!0?u.push(`Generation ${n.previousGen} \u2014 the one the last swap replaced \u2014 was still in memory at this reading.`):n.previousAlive===!1&&u.push(`Generation ${n.previousGen} \u2014 the one the last swap replaced \u2014 has been collected.`),n.containers!==void 0&&n.containers>1&&u.push(`${n.containers} Nest DI containers are alive: more than one app's worth.`);for(let c of t.retained){let p=c.counts&&Object.keys(c.counts).length?` Live then: ${Object.entries(c.counts).map(([m,f])=>`${m} ${f}`).join(", ")}.`:"";u.push(`RETAINED: generation ${c.gen} is still in memory ${vE(r-c.closedAt)} after its app was closed, through ${c.gcs} full GCs and ${c.swapsSinceClose} swap${c.swapsSinceClose===1?"":"s"} (still alive: ${c.alive.join(", ")}).${p}`)}n.sourceMaps&&u.push("The pod runs with source maps enabled: with an eval devtool the bundle is held as text several times (`lensmcp doctor` checks it).");let d=t.retained.length?`Something still points into the retained generation. \`lensmcp mem ${e.service} --snapshot --analyze\` prints the shortest path from the GC roots to it \u2014 usually a listener on a process-global emitter, a module-level cache or registry, or a timer an onModuleDestroy does not clear. Until it is fixed the pod is replaced once the generation has been retained for LENSMCP_SWAP_RECYCLE_RETAINED_MS (10 min by default).`:a!==void 0&&a>=2?`No closed generation is retained, so this is growth inside the serving app. Compare readings across swaps with \`lensmcp mem ${e.service}\`; \`lensmcp mem ${e.service} --snapshot --analyze\` lists the largest retainers by class and by package.`:"Nothing to act on: one generation in memory, and the previous one collected.";return{service:e.service,pod:t.pod,pid:t.pid,narrative:l,findings:u,recommendation:d}}s(yE,"Ub"),o(yE,"explainPod");var $m=class extends pI{static{s(this,"Lb")}static{o(this,"MemoryExplainPodTool")}async execute(e){let t=Tu();if(!t)return{found:!1,reason:"no active memory reducer"};let r=t.podsOf(e.service);if(!r)return{found:!1,service:e.service,reason:"no pod of that service has reported"};let n=r.pods.filter(u=>e.pod===void 0||u.pod===e.pod).slice(0,8);return n.length===0?{found:!1,service:e.service,pods:r.pods.map(u=>u.pod),reason:`no pod #${e.pod}`}:{found:!0,explanations:n.map(u=>yE(r,u))}}};$m=F([cI({name:"memory.explain_pod",description:"Explains one dev-cluster pod's memory in a few sentences: how many app generations its live heap is, whether the last hot swap's copy was collected, reserved-heap slack, and any closed generation proven still in memory \u2014 with the next step (e.g. a heap snapshot).",inputSchema:{service:gE.string().describe("Nx project or cluster service name."),pod:gE.number().int().positive().optional().describe("Pod id (the N of Child#N). Omit for every pod of the service (at most 8).")}})],$m);var mI=$m,bE=class{static{s(this,"Bb")}static{o(this,"MemoryApp")}};bE=F([z_({id:"memory",name:"Memory",description:"Container-owner growth tracking, suspect-leak detection, and dev-cluster pod heaps (post-GC readings, retained hot-swap generations). Hosts memory.explain_leak, memory.pods, memory.explain_pod.",resources:[O_,P_,Z_,V_,K_],tools:[Q_,rI,aI,dI,mI]})],bE);var fI=64,hI=16,EE=12,gI=16,wE=24*36e5;function Xt(e,t,r,n){return`pod-retained:${e}:${t}:${r}:${n}`}s(Xt,"$n"),o(Xt,"retainedLeakKey");var vI=o((e,t)=>`${e}:${t}`,"podKey");function Bm(e,t){let r={};for(let[n,u]of Object.entries(e))t.includes(n)||(r[n]=u);return r}s(Bm,"cS"),o(Bm,"stripIdentity");var yI=class{static{s(this,"ac")}static{o(this,"PodMemoryState")}constructor(){this.services=new Map}apply(e){if(e.source!=="memory")return;let t=es(e.raw);if(!t)return;let r=e.timestamp;this.lastEventAt=Math.max(this.lastEventAt??0,r);let n={pods:!0,retainedAdded:[],retainedRemoved:[]},u=this.service(t.project,t.service||t.project,r),i=vI(t.pod,t.pid);if(t.kind==="pod-memory-exited"){let l=u.pods.get(i);if(l)for(let d of l.retained.keys())n.retainedRemoved.push(Xt(t.project,t.pod,t.pid,d));return u.pods.delete(i),n}let a=u.pods.get(i);if(!a){if(t.kind==="pod-memory"&&t.trigger==="boot"){for(let[l,d]of u.pods)if(d.pod===t.pod){for(let c of d.retained.keys())n.retainedRemoved.push(Xt(t.project,d.pod,d.pid,c));u.pods.delete(l)}}if(a={pod:t.pod,pid:t.pid,podGeneration:t.podGeneration??1,lastSeenAt:r,retained:new Map},u.pods.set(i,a),u.pods.size>hI){let l=[...u.pods.entries()].sort((d,c)=>d[1].lastSeenAt-c[1].lastSeenAt)[0];if(l){for(let d of l[1].retained.keys())n.retainedRemoved.push(Xt(t.project,l[1].pod,l[1].pid,d));u.pods.delete(l[0])}}}if(a.lastSeenAt=r,t.kind==="pod-memory")a.latest=Bm(t,["project","service","pod","pid","podGeneration","floodSuppressed"]),u.history.push({at:t.at??r,pod:t.pod,pid:t.pid,trigger:t.trigger,gen:t.gen,swaps:t.swaps,live:t.live,used:t.used,reserved:t.reserved,rss:t.rss,...t.previousGen!==void 0?{previousGen:t.previousGen}:{},previousAlive:t.previousAlive??null,retained:t.retained??0}),u.history.length>EE&&u.history.splice(0,u.history.length-EE);else if(t.kind==="pod-memory-retained"){let l={...Bm(t,["project","service","floodSuppressed"]),at:r};a.retained.delete(t.gen),a.retained.set(t.gen,l),a.retained.size>gI&&a.retained.delete(a.retained.keys().next().value),n.retainedAdded.push({key:Xt(t.project,t.pod,t.pid,t.gen),project:t.project,service:u.service,pod:t.pod,pid:t.pid,generation:l})}else t.kind==="pod-memory-released"&&(a.retained.delete(t.gen),n.retainedRemoved.push(Xt(t.project,t.pod,t.pid,t.gen)));return this.sweep(r,n,t.project),n}views(){return[...this.services.values()].sort((e,t)=>e.project.localeCompare(t.project)).map(e=>this.view(e))}find(e){let t=this.services.get(e)??[...this.services.values()].find(r=>r.service===e);return t?this.view(t):void 0}view(e){return{project:e.project,service:e.service,lastSeenAt:e.lastSeenAt,pods:[...e.pods.values()].sort((t,r)=>t.pod-r.pod).map(t=>({pod:t.pod,pid:t.pid,podGeneration:t.podGeneration,lastSeenAt:t.lastSeenAt,...t.latest?{latest:t.latest}:{},retained:[...t.retained.values()]})),history:[...e.history]}}service(e,t,r){let n=this.services.get(e);if(!n&&(n={project:e,service:t,lastSeenAt:r,pods:new Map,history:[]},this.services.set(e,n),this.services.size>fI)){let u=[...this.services.values()].sort((i,a)=>i.lastSeenAt-a.lastSeenAt)[0];u&&u!==n&&this.services.delete(u.project)}return n.lastSeenAt=Math.max(n.lastSeenAt,r),n.service=t,n}sweep(e,t,r){for(let n of this.services.values()){for(let[u,i]of n.pods)if(!(e-i.lastSeenAt<=wE)){for(let a of i.retained.keys())t.retainedRemoved.push(Xt(n.project,i.pod,i.pid,a));n.pods.delete(u)}n.pods.size===0&&n.project!==r&&e-n.lastSeenAt>wE&&this.services.delete(n.project)}}},vn="memory://current",yn="memory://owners",bn="memory://owners/growing",Yt="memory://leaks/suspected",En="memory://pods",bI=200,DE=50,EI=500;function $E(e){let t=(e.now??(()=>Date.now()))(),r={owners:new Map,leaks:new Map,changedAt:new Map},n=new yI,u=o(($,w)=>{r.changedAt.set($,w),e.resources.markDirty($)},"touch"),i=o(($,w)=>{if(r.leaks.delete($),r.leaks.set($,w),r.leaks.size>bI){let C=r.leaks.keys().next().value;C!==void 0&&r.leaks.delete(C)}},"pushLeak"),a=new Map,l=o(($,w)=>{$!==w&&(a.delete($),a.set($,w),a.size>5e3&&a.delete(a.keys().next().value))},"noteRequestFlow"),d=o(($,w)=>{if($.flowIds.add(w),$.flowIds.size>DE){for(let C of $.flowIds)if($.flowIds.delete(C),$.flowIds.size<=DE)break}},"noteFlow"),c=o(($,w,C)=>{let k=r.owners.get($);if(k||(k={ownerId:$,itemCount:w,estimatedBytes:0,startCount:w,mutations:0,flowIds:new Set,lastMutatedAt:C}),r.owners.delete($),r.owners.set($,k),r.owners.size>EI){let M=r.owners.keys().next().value;M!==void 0&&M!==$&&r.owners.delete(M)}return k},"ensure"),p=o(($,w)=>{let C=!1;for(let[k,M]of r.leaks){if(M.kind!=="retention"||M.ownerId!==$)continue;let y=M.detail.startCount;typeof y=="number"&&w<=y&&(r.leaks.delete(k),C=!0)}return C},"retractReleasedRetentions"),m=o($=>{let w=n.apply($);if(!w)return!1;r.lastEventAt=Math.max(r.lastEventAt??0,$.timestamp),u(En,$.timestamp);let C=!1;for(let k of w.retainedRemoved)C=r.leaks.delete(k)||C;for(let k of w.retainedAdded)i(k.key,{kind:"retained-generation",project:k.project,service:k.service,pod:k.pod,pid:k.pid,generation:k.generation.gen,detail:{...k.generation},at:$.timestamp}),C=!0;return C&&u(Yt,$.timestamp),!0},"applyPodMemory"),f=o($=>{if($.source!=="memory"&&$.source!=="perf"||m($))return;let w=$.raw??null;if(w?.kind)switch(r.lastEventAt=Math.max(r.lastEventAt??0,$.timestamp),w.kind){case"memory-mutation":{if(!w.mutation)return;let C=w.mutation,k=c(C.ownerNodeId,C.beforeCount??C.afterCount,$.timestamp);k.itemCount=C.afterCount,k.estimatedBytes=C.afterCount*64,k.mutations+=1,k.lastMutatedAt=$.timestamp,$.context.flowId&&d(k,$.context.flowId),$.context.requestId&&$.context.flowId&&l($.context.requestId,$.context.flowId),u(yn,$.timestamp),u(bn,$.timestamp),p(C.ownerNodeId,C.afterCount)&&u(Yt,$.timestamp);return}case"memory-retention":{if(!w.retention)return;let C=w.retention,k=C.requestId?C.flowId:a.get(C.flowId)??C.flowId;i(`retention:${C.ownerId}:${k}`,{kind:"retention",ownerId:C.ownerId,flowId:k,detail:{...C,flowId:k},at:$.timestamp}),u(Yt,$.timestamp);return}case"process-memory":{if(!w.memory)return;r.current={...w.role?{role:w.role}:{},heapUsed:w.memory.heapUsed,heapTotal:w.memory.heapTotal,rss:w.memory.rss,external:w.memory.external,arrayBuffers:w.memory.arrayBuffers,at:$.timestamp},u(vn,$.timestamp);return}default:return}},"handler"),h=e.bus.subscribe(f),g=o($=>new Date(r.changedAt.get($)??t).toISOString(),"stamp"),b=o(()=>({lastEventAt:r.lastEventAt,ownersTracked:r.owners.size,producer:r.lastEventAt===void 0?"none":"connected",detail:r.lastEventAt===void 0?"No memory event has ever been observed \u2014 an empty leak list is NOT evidence there is no leak, nothing is watching. Run under the dev cluster with @lensmcp/memory-tracker wired.":`${r.owners.size} owner${r.owners.size===1?"":"s"} tracked; ${r.leaks.size} suspected leak${r.leaks.size===1?"":"s"}.`}),"health");e.resources.register(vn,()=>({schemaVersion:1,revision:e.resources.revision(vn)??0,updatedAt:g(vn),current:r.current??null})),e.resources.register(yn,()=>({schemaVersion:1,revision:e.resources.revision(yn)??0,updatedAt:g(yn),owners:[...r.owners.values()].map(xm),...b()})),e.resources.register(bn,()=>({schemaVersion:1,revision:e.resources.revision(bn)??0,updatedAt:g(bn),owners:[...r.owners.values()].map(xm).filter($=>$.growthSinceStart>0).sort(($,w)=>w.growthSinceStart-$.growthSinceStart).slice(0,20),...b()})),e.resources.register(Yt,()=>({schemaVersion:1,revision:e.resources.revision(Yt)??0,updatedAt:g(Yt),suspected:[...r.leaks.values()],...b()})),e.resources.register(En,()=>({schemaVersion:1,revision:e.resources.revision(En)??0,updatedAt:g(En),services:n.views(),lastEventAt:n.lastEventAt,producer:n.lastEventAt===void 0?"none":"connected",detail:n.lastEventAt===void 0?"No pod has reported its heap \u2014 these readings come from the dev cluster (`@lensmcp/cluster` devserver pods, which report at boot and after every hot swap). An empty list is not evidence the pods are small.":"Bytes. `live` is the heap after a full GC; `used` the heap just before it; `reserved` what V8 keeps. A `retained` generation was closed and is PROVEN still in memory \u2014 see memory.explain_pod."}));let x={ownersMutatedByFlow($){return[...r.owners.values()].filter(w=>w.flowIds.has($))},growthByFlow($){return[...r.owners.values()].filter(w=>w.flowIds.has($)).map(w=>({ownerId:w.ownerId,growth:w.itemCount-w.startCount}))},flowsThatMutatedOwner($){let w=r.owners.get($);return w?[...w.flowIds]:[]},getLeak($){return[...r.leaks.values()][$]},allLeaks(){return[...r.leaks.values()]},pods(){return n.views()},podsOf($){return n.find($)}};return ym(x),{unsubscribe:o(()=>{ym(void 0),h()},"unsubscribe"),uris:[vn,yn,bn,Yt,En],lookups:x}}s($E,"qb"),o($E,"installMemoryReducer");function xm(e){return{ownerId:e.ownerId,itemCount:e.itemCount,estimatedBytes:e.estimatedBytes,mutations:e.mutations,startCount:e.startCount,growthSinceStart:e.itemCount-e.startCount,lastMutatedAt:e.lastMutatedAt,flowIds:[...e.flowIds]}}s(xm,"lS"),o(xm,"toOwnerView");function BE(){let{session:e,providers:t}=Q3(),r=ay(),n=oy();for(let x of n.problems)console.error(`[lensmcp] nx.json lensmcp.flows: ${x}`);V6({bus:e.bus,resources:e.resources}),K6({bus:e.bus,resources:e.resources}),Y6({bus:e.bus,resources:e.resources}),tb({bus:e.bus,resources:e.resources}),sb({bus:e.bus,resources:e.resources}),mb({bus:e.bus,resources:e.resources}),hb({bus:e.bus,resources:e.resources}),vb({bus:e.bus,resources:e.resources}),Eb({bus:e.bus,resources:e.resources,thresholds:r}),Cb({bus:e.bus,resources:e.resources,thresholds:r}),Sb({bus:e.bus,resources:e.resources,thresholds:r}),Rb({bus:e.bus,resources:e.resources,thresholds:r}),Kb({bus:e.bus,resources:e.resources}),Qb({bus:e.bus,resources:e.resources,thresholds:r}),nE({bus:e.bus,resources:e.resources});let u=bc({bus:e.bus,resources:e.resources,flows:n});e.registerReducerRetention("flow",u.retentionStats),O6({resources:e.resources});let i=pE({bus:e.bus,resources:e.resources,thresholds:r});e.registerReducerRetention("graph",i.retentionStats),$E({bus:e.bus,resources:e.resources}),d6({bus:e.bus,resources:e.resources,sessionId:e.id});let a=3e4,l=512*1024*1024,d=0,c=o(()=>{let x=process.memoryUsage(),$=Date.now(),w=x.rss>=l;w&&$-d>=5*6e4&&(d=$,console.warn(`[lensmcp] high process memory: rss=${Math.round(x.rss/1024/1024)}MB heap=${Math.round(x.heapUsed/1024/1024)}MB`)),e.bus.publish({id:lt(),sessionId:e.id,timestamp:$,source:"perf",category:"runtime",severity:w?"warning":"info",context:{sessionId:e.id},fingerprint:D4({kind:"process-memory",identity:process.env.LENSMCP_PROCESS_ROLE??"session"}),title:`LensMCP process memory (${process.env.LENSMCP_PROCESS_ROLE??"session"})`,raw:{kind:"process-memory",role:process.env.LENSMCP_PROCESS_ROLE??"session",memory:{rss:x.rss,heapUsed:x.heapUsed,heapTotal:x.heapTotal,external:x.external,arrayBuffers:x.arrayBuffers}}})},"publishProcessMemory");c();let p=setInterval(c,a);p.unref?.(),e.onShutdown({name:"process-memory",stop:o(()=>clearInterval(p),"stop")});let m=1200,f=new Map,h=e.bus.subscribe(x=>{let $=x.context.flowId;if(!$)return;let w=f.get($);w&&clearTimeout(w);let C=setTimeout(()=>{f.delete($);try{let k=Qe()?.getFlowEvents($);if(!k||k.length===0)return;let M=va(k,{flowId:$});M&&Tc(M)}catch{}},m);C.unref?.(),f.set($,C)});e.onShutdown({name:"story-autocompile",stop:o(()=>{h();for(let x of f.values())clearTimeout(x);f.clear()},"stop")});let g=iy({bus:e.bus,sessionId:e.id,onError:o(x=>console.error("[lensmcp] ingest error:",x),"onError")});g.mode!=="none"&&console.error(`[lensmcp] event ingest active (mode=${g.mode})`),e.onShutdown({name:"event-ingest",stop:o(()=>g.stop(),"stop")});let b=process.env.LENSMCP_EVENT_FILE;return b&&(hc({eventFile:b,flows:n,budget:f6(),prepare:xE(e.id)}),e.onShutdown({name:"flow-recovery",stop:o(()=>hc(void 0),"stop")})),{session:e,providers:t,ingest:g,flows:n}}s(BE,"dS"),o(BE,"createLensSession");function xE(e){let t=zd({}),r=ga({});return n=>(n.sessionId==="pending"&&(n.sessionId=e,n.context&&n.context.sessionId==="pending"&&(n.context.sessionId=e)),r.redact(t.clamp(n)))}s(xE,"mD"),o(xE,"ingestPreparation");var wI=new Set(["localhost","127.0.0.1","lensmcp.local"]);function kE(e){if(!e)return!1;let t=e.trim().toLowerCase();if(t.startsWith("[")){let r=t.indexOf("]");return r!==-1&&t.slice(1,r)==="::1"}return t.indexOf(":")===t.lastIndexOf(":")&&(t=t.split(":")[0]??""),wI.has(t)}s(kE,"gD"),o(kE,"hostHeaderIsLocal");function CE(e,t){if(!e||kE(t))return{ok:!0};let r=(t??"").replace(/[^\x20-\x7e]/g,"?").slice(0,80);return{ok:!1,status:403,error:"this dashboard answers only requests addressed to this machine (localhost, 127.0.0.1, [::1] or lensmcp.local)"+(r?`; this one was addressed to "${r}"`:"")}}s(CE,"pS"),o(CE,"dashboardHostVerdict");import{createHmac as AE,randomBytes as _E,timingSafeEqual as DI}from"node:crypto";import{chmodSync as $I,mkdirSync as BI,readFileSync as xI,writeFileSync as IE}from"node:fs";import{dirname as kI,join as CI}from"node:path";var sa="__lensmcp_token",km="__lensmcp_login",SE=10*6e4,AI=720*60*60;function Cm(e){return CI(e,".lensmcp","dashboard-token")}s(Cm,"Zb"),o(Cm,"dashboardTokenPath");function FE(e,t,r={}){if(e.LENSMCP_ALLOW_INSECURE==="1")return{source:"disabled"};let n=e.LENSMCP_DASHBOARD_TOKEN?.trim();if(n)return{token:n,source:"env"};let u=r.read??(c=>xI(c,"utf8")),i=r.write??((c,p)=>IE(c,p,{mode:384,flag:"wx"})),a=r.ensureDir??(c=>{BI(c,{recursive:!0,mode:448})}),l=r.chmod??((c,p)=>$I(c,p)),d=Cm(t);try{let c=u(d).trim();if(c){try{l(d,384)}catch{}return{token:c,source:"file"}}}catch{}try{a(kI(d));let c=_E(32).toString("hex");try{i(d,`${c}
74
+ `)}catch(p){if(p.code!=="EEXIST")throw p;let m=u(d).trim();if(m)return{token:m,source:"file"};IE(d,`${c}
75
+ `,{mode:384})}try{l(d,384)}catch{}return{token:c,source:"created"}}catch(c){return{source:"unavailable",reason:c instanceof Error?c.message:String(c)}}}s(FE,"vS"),o(FE,"resolveDashboardToken");function wn(e,t){let r=Buffer.from(e,"utf8"),n=Buffer.from(t,"utf8");return r.length!==n.length?!1:DI(r,n)}s(wn,"cc"),o(wn,"sameSecret");function Am(e,t,r,n){if(!e)return!0;let u=Array.isArray(t)?t[0]:t,i=/^Bearer\s+(.+)$/i.exec((u??"").trim())?.[1]?.trim();if(i&&wn(i,e))return!0;let a=r?.trim();if(a&&wn(a,e))return!0;let l=n?zE(n.header,n.name):void 0;return!!l&&wn(l,_m(e))}s(Am,"Vb"),o(Am,"dashboardAuthorized");function jE(e){return`lensmcp_dash_${e.replace(/[^A-Za-z0-9_-]/g,"_")}`}s(jE,"yS"),o(jE,"sessionCookieName");function _m(e){return AE("sha256",e).update("lensmcp-dashboard-session-v1").digest("hex")}s(_m,"Gb"),o(_m,"sessionCookieValue");function zE(e,t){for(let r of(e??"").split(";")){let n=r.indexOf("=");if(n>0&&r.slice(0,n).trim()===t)return r.slice(n+1).trim()}}s(zE,"kD"),o(zE,"readCookie");function NE(e,t,r,n){return`${e}=${t}; Path=${r}; HttpOnly; SameSite=Strict; Max-Age=${AI}${n?"; Secure":""}`}s(NE,"bS"),o(NE,"sessionCookieHeader");function Im(e,t,r){return AE("sha256",e).update(`lensmcp-dashboard-login
74
76
  ${t}
75
- ${r}`).digest("hex")}s(hm,"Dk"),o(hm,"loginSignature");function rb(e,t,r=HE(16).toString("hex")){let i=t+YE;return`${i}.${r}.${hm(e,i,r)}`}s(rb,"Ck"),o(rb,"mintLoginCode");var kI=/^(\d{1,16})\.([0-9a-f]{32})\.([0-9a-f]{64})$/,AI=class{static{s(this,"nc")}static{o(this,"LoginLedger")}constructor(){this.redeemed=new Map}redeem(e,t,r){for(let[a,l]of this.redeemed)l<=r&&this.redeemed.delete(a);let i=kI.exec(t.trim());if(!i)return"invalid";let u=Number(i[1]),n=i[2];return gi(i[3],hm(e,u,n))?u<=r||u>r+YE+6e4?"expired":this.redeemed.has(n)?"used":(this.redeemed.set(n,u),"ok"):"invalid"}};function ib(e){return e==="/api"||e.startsWith("/api/")}s(ib,"Uk"),o(ib,"isDataEndpoint");function nb(e){return e.startsWith("/assets/dashboard-ui/")}s(nb,"Lk"),o(nb,"isAssetPath");function sb(e){let t=Number(process.env.LENSMCP_PARENT_PID??0);!Number.isInteger(t)||t<=0||setInterval(()=>{process.ppid!==t&&(console.error(`[lensmcp] ${e}: parent gateway (pid ${t}) is gone \u2014 exiting to free the port.`),process.exit(0))},5e3).unref()}s(sb,"Fk"),o(sb,"watchParentGateway");import{closeSync as II,openSync as _I,readSync as SI,statSync as FI}from"node:fs";function ab(e,t,r){let i=FI(e).size;if(i===0)return[];let u=Math.max(0,i-t),n=Buffer.alloc(i-u),a=_I(e,"r");try{SI(a,n,0,n.length,u)}finally{II(a)}let l=n.toString("utf8").trim().split(`
76
- `);return u>0&&l.shift(),l.slice(-r)}s(ab,"Bk"),o(ab,"readEventTailLines");import{execFileSync as ob}from"node:child_process";import{createHash as jI}from"node:crypto";import{readdirSync as lb,readFileSync as Ou,realpathSync as db}from"node:fs";import{homedir as gm}from"node:os";import{join as Ct}from"node:path";var cb=new Set(["db","redis","queue","memory","external","fs","exec"]),zI=16;function ke(e){let t=Number(e??0);return Number.isFinite(t)&&t>=0?t:0}s(ke,"Ce"),o(ke,"finite");var NI=class{static{s(this,"ic")}static{o(this,"ClusterState")}constructor(e){this.opts=e,this.gateway=null,this.services=new Map,this.edges=new Map,this.recent=[],this.dataNodes=new Map,this.podMemory=new Map,this.declCache={at:0,decls:[]},this.worktreeCache={at:0,view:{}},this.branches=new Map,this.registryCache={at:0}}worktreeView(e=Date.now()){if(e-this.worktreeCache.at<5e3)return this.worktreeCache.view;let t=Ct(this.opts.env?.LENSMCP_HOME||process.env.LENSMCP_HOME||gm(),".lensmcp"),r=o(c=>{try{return JSON.parse(Ou(Ct(t,c),"utf8"))}catch{return}},"readJson"),i=Array.isArray(r("workspaces.json"))?r("workspaces.json"):[],u=r("instances.json")?.instances??{},n=this.opts.workspaceKey,a=[];if(n){for(let c of i){if(c.instance?.baseKey!==n||typeof c.key!="string"||typeof c.root!="string")continue;let p=typeof c.pid=="number"?c.pid:0,m=p>0&&ta(p)&&(typeof c.procStamp!="string"||!c.procStamp||ym(p)===c.procStamp),f=Object.keys(u[c.key]?.resources??{});a.push({key:c.key,name:typeof c.instance.name=="string"?c.instance.name:c.key,...typeof c.instance.apex=="string"?{apex:c.instance.apex}:{},live:m,dashboard:typeof c.base=="string"?c.base:`/${c.key}`,root:vm(c.root),...this.branchField(c.root,e),...f.length?{data:f}:{},...typeof c.updatedAt=="string"?{updatedAt:c.updatedAt}:{}})}for(let c of Object.values(u)){if(c.baseKey!==n||a.some(m=>m.key===c.key))continue;let p=Object.keys(c.resources??{});a.push({key:c.key,name:c.name,live:!1,dashboard:`/${c.key}`,root:vm(c.root),...this.branchField(c.root,e),...p.length?{data:p}:{}})}a.sort((c,p)=>Number(p.live)-Number(c.live)||c.name.localeCompare(p.name))}let l=n?i.find(c=>c.key===n)?.instance:void 0,d={...a.length?{worktrees:a}:{},...l&&typeof l.name=="string"&&typeof l.baseKey=="string"?{instance:{name:l.name,baseKey:l.baseKey,apex:typeof l.apex=="string"?l.apex:"",baseDashboard:`/${l.baseKey}`}}:{}};return this.worktreeCache={at:e,view:d},d}branchField(e,t){let r=this.branches.get(e);if(r&&t-r.at<3e4)return r.branch?{branch:r.branch}:{};let i;try{i=this.opts.branchOf?this.opts.branchOf(e):pb(e)}catch{i=void 0}return this.branches.set(e,{at:t,branch:i}),i?{branch:i}:{}}reduce(e){if(e.source==="memory"&&this.reducePodMemory(e))return;if(cb.has(e.source)){let u=e.raw??{},n=e.context??{},a=String(u.queue??u.store??u.name??e.source),l=n.projectName??u.project,d=typeof l=="string"&&l?l:void 0,c=e.source+":"+a,p=this.dataNodes.get(c),m=u.kind==="queue-state",f=u.kind==="fs-ops"?ke(u.reads)+ke(u.writes):m?0:1,h=new Set(p?.usedBy??[]);d&&h.add(d),this.dataNodes.set(c,{id:c,kind:e.source,name:a,viaProject:p?.viaProject??d??"unknown",usedBy:[...h].sort(),count:(p?.count??0)+f,lastSeenAt:e.timestamp,counts:m?u.counts:p?.counts,recent:m?u.recent:p?.recent}),this.opts.onChange?.();return}if(e.source!=="gateway")return;let t=e.raw??{},r=typeof t.kind=="string"?t.kind:"",i=e.timestamp;if(r==="gateway-up")this.gateway={at:i,ports:t.ports??[],routes:t.routes??[]};else if(r==="gateway-down")this.gateway&&(this.gateway={...this.gateway,ports:[]});else if(r==="gateway-traffic"){this.gateway||(this.gateway={at:i,ports:[],routes:[]}),this.gateway.aliveAt=i;let u=String(t.host??""),n=String(t.project??""),a=typeof t.caller=="string"?t.caller:void 0,l=(a?a+"\u21D2":"")+u+"\u2192"+n,d=this.edges.get(l);this.edges.set(l,{host:u,project:n,caller:a,count:(d?.count??0)+ke(t.count),avgMs:ke(t.avgMs),errors:(d?.errors??0)+ke(t.errors),lastSeenAt:i})}else if(r.startsWith("service-")||r==="cold-start"||r==="autoscale"||r==="idle-kill"){let u=String(t.project??"");if(!u)return;let n=this.services.get(u),a={project:u,state:n?.state??"unknown",pods:n?.pods,lastColdStartMs:n?.lastColdStartMs,lastEventAt:i,lastEvent:e.title};r==="service-starting"&&(a.state="starting"),r==="service-up"&&(a.state="up",a.pods=ke(t.pods??a.pods)),r==="cold-start"&&(a.state="up",a.pods=ke(t.pods??a.pods),typeof t.durationMs=="number"&&(a.lastColdStartMs=t.durationMs)),r==="autoscale"&&(a.pods=ke(t.to??a.pods)),(r==="service-down"||r==="idle-kill")&&(a.state="down",a.pods=0,r==="idle-kill"&&(a.idle=!0)),this.services.set(u,a)}this.recent.push({at:i,title:e.title,severity:e.severity}),this.recent.length>40&&this.recent.splice(0,this.recent.length-40),this.opts.onChange?.()}reducePodMemory(e){let t=Hn(e.raw);if(!t)return!1;let r=this.podMemory.get(t.project);r||(r=new Map,this.podMemory.set(t.project,r));let i=`${t.pod}:${t.pid}`;if(t.kind==="pod-memory-exited")r.delete(i);else{let u=r.get(i);if(!u&&(u={pod:t.pod,pid:t.pid,podGeneration:t.podGeneration??1,retained:new Map,lastSeenAt:e.timestamp},r.set(i,u),r.size>zI)){let n=[...r.entries()].sort((a,l)=>a[1].lastSeenAt-l[1].lastSeenAt)[0];n&&r.delete(n[0])}u.lastSeenAt=e.timestamp,t.kind==="pod-memory"?u.latest=t:t.kind==="pod-memory-retained"?u.retained.set(t.gen,{gen:t.gen,closedAt:ke(t.closedAt)}):u.retained.delete(t.gen)}return this.opts.onChange?.(),!0}memoryOf(e,t,r){let i=this.podMemory.get(e);if(!i||i.size===0)return;let u=[...i.values()].filter(l=>l.latest?t.length===0?r-l.lastSeenAt<=30*6e4:t.includes(l.podGeneration>1?`child-${l.pod}-g${l.podGeneration}`:`child-${l.pod}`):!1);if(u.length===0)return;let n=u.reduce((l,d)=>(l.latest?.at??0)>=(d.latest?.at??0)?l:d),a=u.map(l=>l.latest?.baseline??(l.latest?.trigger==="boot"?l.latest.live:void 0)).filter(l=>typeof l=="number");return{live:u.reduce((l,d)=>l+ke(d.latest?.live),0),reserved:u.reduce((l,d)=>l+ke(d.latest?.reserved),0),rss:u.reduce((l,d)=>l+ke(d.latest?.rss),0),...a.length?{baseline:Math.max(...a)}:{},swaps:Math.max(...u.map(l=>ke(l.latest?.swaps))),pods:u.length,retained:u.flatMap(l=>[...l.retained.values()].map(d=>({pod:l.pod,gen:d.gen,ageMs:Math.max(0,r-d.closedAt)}))),at:ke(n.latest?.at),trigger:String(n.latest?.trigger??""),...n.latest?.service?{service:n.latest.service}:{}}}discoverDecls(){if(Date.now()-this.declCache.at<1e4)return this.declCache.decls;let e=[],t,r=o((u,n)=>{if(n>4)return;let a;try{a=lb(u,{withFileTypes:!0})}catch{return}for(let l of a){if(l.name==="node_modules"||l.name.startsWith("."))continue;let d=`${u}/${l.name}`;if(l.isDirectory())r(d,n+1);else if(l.name==="project.json")try{let c=JSON.parse(Ou(d,"utf8")),p=c.targets??{};!t&&/cluster:trust$/.test(p.trust?.executor??"")&&(t=String(c.name??""));let m=c.cluster??c.davnx;if(!m)continue;let f=p["serve-hmr"]?.options?.internalPort,h=(p["serve-hmr"]?.options?.workers??[]).map(E=>E.name),g=typeof m.service=="string"?m.service:void 0;e.push({project:String(c.name??d),host:m.host,path:m.path,internalHost:m.internalHost,service:g,port:m.port,upstream:m.upstream,prependPrefix:m.prependPrefix,default:m.default,internalPort:f,workers:h,podNames:g?this.podNames(g):[],eager:m.eager,minPods:m.minPods,maxPods:m.maxPods,auth:m.auth})}catch{}}},"walk");r(this.opts.root,0);let i=fb(this.opts.root,e);if(i)for(let u of e)u.host&&(u.host=i(u.host)),typeof u.internalHost=="string"&&(u.internalHost=i(u.internalHost)??!1);return this.declCache={at:Date.now(),decls:e,...t?{trustProject:t}:{}},e}trustCommand(){return this.discoverDecls(),`yarn nx run ${this.declCache.trustProject||"gateway"}:trust`}podNames(e){try{return lb(this.opts.podSockDir(e)).filter(t=>t.endsWith(".sock")).map(t=>t.replace(".sock","")).sort()}catch{return[]}}hostsSetup(e){let t="";try{t=(this.opts.readHosts??(()=>Ou("/etc/hosts","utf8")))()}catch{}let r=t.split(`
77
- `).map(n=>n.trim()).filter(n=>n&&!n.startsWith("#")).map(n=>n.split(/\s+/)),i=o((n,a)=>r.some(l=>l[0]===n&&l.slice(1).includes(a)),"has"),u=[];for(let n of e)n.host&&!n.host.includes("*")&&(u.push(n.host),n.service&&n.internalHost!==!1&&u.push(typeof n.internalHost=="string"?n.internalHost:`internal.${n.host}`));return[...new Set(u)].map(n=>({host:n,v4:i("127.0.0.1",n),v6:i("::1",n)}))}serviceKeyView(){let e;try{e=JSON.parse(Ou(hb(this.opts.root),"utf8"))}catch{return{}}let t={};for(let[r,i]of Object.entries(e))typeof i!="string"||i===""||(t[r]={fingerprint:jI("sha256").update(i).digest("hex").slice(0,12)});return t}liveDecls(){let e=this.discoverDecls();for(let t of e)t.service&&(t.podNames=this.podNames(t.service));return e}legacyView(){let e=this.liveDecls();return{at:Date.now(),gateway:this.gateway,decls:e,hostsSetup:this.hostsSetup(e),trustCommand:this.trustCommand(),serviceKeys:this.serviceKeyView(),services:[...this.services.values()].sort((t,r)=>t.project.localeCompare(r.project)),edges:[...this.edges.values()].sort((t,r)=>r.lastSeenAt-t.lastSeenAt),dataNodes:[...this.dataNodes.values()].sort((t,r)=>r.count-t.count).slice(0,24),recent:this.recent.slice(-20).reverse()}}gatewayLiveness(e=Date.now()){let t=this.opts.env??process.env,r=(t.LENSMCP_GATEWAY_PORTS??"").split(",").map(d=>Number(d.trim())).filter(d=>Number.isInteger(d)&&d>0),i=this.gateway?.ports??[],u=r.length?r:i,n=Number(t.LENSMCP_PARENT_PID??0);if(n>0)return ta(n)?{state:"live",role:"gateway-child",ports:u,since:this.gateway?.at,evidence:`served by the gateway process (pid ${n})`}:{state:"down",role:"gateway-child",ports:u,evidence:`the gateway that started this dashboard (pid ${n}) is gone`};if(i.length>0)return{state:"live",role:"standalone",ports:u,since:this.gateway?.at,evidence:"gateway-up event on this workspace\u2019s bus"};let a=this.registeredGateway(e);if(a)return{state:"live",role:"standalone",ports:u,evidence:`registered with the gateway daemon (pid ${a})`};let l=this.gateway?.aliveAt??0;return l>e-3e4?{state:"live",role:"standalone",ports:u,since:l,evidence:`gateway traffic ${Math.round((e-l)/1e3)}s ago`}:this.gateway?{state:"down",role:"standalone",ports:u,evidence:"no gateway traffic in the last 30s"}:{state:"unknown",role:"standalone",ports:u,evidence:"no gateway events seen \u2014 is this dashboard running without the gateway?"}}registeredGateway(e){if(e-this.registryCache.at<15e3)return this.registryCache.pid;let t;try{let r=`${(this.opts.env??process.env).LENSMCP_HOME||gm()}/.lensmcp/workspaces.json`,i=JSON.parse(Ou(r,"utf8")),u=Array.isArray(i)?i.find(n=>n.root===this.opts.root):void 0;u&&typeof u.pid=="number"&&u.pid>0&&ta(u.pid)&&(!u.procStamp||ym(u.pid)===u.procStamp)&&(t=u.pid)}catch{}return this.registryCache={at:e,...t?{pid:t}:{}},t}view(e){let t=e.now??Date.now(),r=this.liveDecls(),i=this.hostsSetup(r),u=this.serviceKeyView(),n=new Map((e.processCluster?.services??[]).map(h=>[h.project,h])),a=new Map;for(let h of e.processCluster?.errors??[]){if(!h.project||!h.line)continue;let g=a.get(h.project)??[];g.push(h.line),a.set(h.project,g.slice(-6))}let l=[...this.edges.values()].filter(h=>!h.caller),d=r.map(h=>{let g=h.service?h.eager?"eager":"lazy":"web",E=this.services.get(h.project),x=n.get(h.project),$=(e.processCluster?.errors??[]).filter(H=>H.project===h.project&&H.fault!=="types"),w=x?.buildFailed===!0&&$.length>0&&$.every(H=>H.fault==="process"),{state:k,reason:C}=gb(g,E,x,h.podNames.length,w),M=l.filter(H=>H.project===h.project),y=M.reduce((H,ye)=>H+ye.count,0),D=M.reduce((H,ye)=>H+ye.errors,0),A=M.slice().sort((H,ye)=>ye.lastSeenAt-H.lastSeenAt)[0],j=e.kpis?.projectStats(h.project,t),N=h.service&&h.internalHost!==!1&&h.host?typeof h.internalHost=="string"?h.internalHost:`internal.${h.host}`:void 0,K=h.service?this.memoryOf(h.project,h.podNames,t):void 0;return{project:h.project,kind:g,state:k,...C?{stateReason:C}:{},...h.host?{host:h.host}:{},...h.path?{path:h.path}:{},...N?{internalHost:N}:{},...h.port!==void 0?{port:h.port}:{},...h.internalPort!==void 0?{internalPort:h.internalPort}:{},pods:{running:h.podNames.length,names:h.podNames,...h.minPods!==void 0?{min:h.minPods}:{},...h.maxPods!==void 0?{max:h.maxPods}:{}},workers:h.workers??[],...E?.lastColdStartMs!==void 0?{lastColdStartMs:E.lastColdStartMs}:{},restarts:x?.restarts??0,buildFailed:(x?.buildFailed??!1)&&!w,processError:w,typeErrors:x?.typeErrors??!1,errorLines:a.get(h.project)??[],...h.auth?{auth:{...h.auth.default?{default:h.auth.default}:{},overrides:h.auth.overrides?.length??0}}:{},traffic:{count:y,errors:D,avgMs:A?A.avgMs:null,...A?{lastSeenAt:A.lastSeenAt}:{}},...j?{window:j}:{},...u[h.project]?{keyFingerprint:u[h.project].fingerprint}:{},...K?{memory:K}:{},...E?{lastEvent:{at:E.lastEventAt,title:E.lastEvent}}:x?.lastTitle?{lastEvent:{at:x.lastSeenAt??0,title:x.lastTitle}}:{}}}).sort((h,g)=>mb[h.kind]-mb[g.kind]||h.project.localeCompare(g.project)),c=l.map(h=>({host:h.host,project:h.project,count:h.count,errors:h.errors,avgMs:h.avgMs,lastSeenAt:h.lastSeenAt})).sort((h,g)=>g.count-h.count);for(let h of r)h.host&&!c.some(g=>g.host===h.host&&g.project===h.project)&&c.push({host:h.host,project:h.project,count:0,errors:0,avgMs:null});let p=[...this.edges.values()].filter(h=>!!h.caller).map(h=>({caller:h.caller,callee:h.project,host:h.host,count:h.count,errors:h.errors,avgMs:h.avgMs,lastSeenAt:h.lastSeenAt})).sort((h,g)=>g.count-h.count),m=[...this.dataNodes.values()].filter(h=>h.kind!=="memory").map(h=>({id:h.id,kind:h.kind,name:h.name,usedBy:h.usedBy??(h.viaProject&&h.viaProject!=="unknown"?[h.viaProject]:[]),ops:h.count,lastSeenAt:h.lastSeenAt,...h.kind==="queue"&&(h.counts||h.recent)?{queue:{counts:h.counts??{},recent:(h.recent??[]).slice(0,8).map(g=>({id:String(g.id??""),...typeof g.name=="string"?{name:g.name}:{},...typeof g.state=="string"?{state:g.state}:typeof g.status=="string"?{state:g.status}:{},...typeof g.finishedOn=="number"?{at:g.finishedOn}:typeof g.timestamp=="number"?{at:g.timestamp}:{}}))}}:{}})).sort((h,g)=>g.ops-h.ops).slice(0,24),f=i.filter(h=>!h.v4||!h.v6);return{at:t,gateway:this.gatewayLiveness(t),services:d,routes:c,edges:p,backends:m,hosts:i,...f.length?{hostsFix:vb(f)}:{},trustCommand:this.trustCommand(),recent:this.recent.slice(-20).reverse(),...this.worktreeView(t)}}};function pb(e){let t=o(r=>{try{return ob("git",["-C",e,...r],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}).trim()||void 0}catch{return}},"git");return t(["symbolic-ref","--short","-q","HEAD"])??t(["rev-parse","--short","HEAD"])}s(pb,"AP"),o(pb,"gitBranch");function vm(e,t=gm()){let r=e.replace(/\/+$/,"").split("/").filter(Boolean),i=r.slice(-2).join("/");if(!i)return"/";let u=t!==""&&(e===t||e.startsWith(`${t}/`)),n=r.length>2;return u?n?`~/\u2026/${i}`:`~/${i}`:n?`\u2026/${i}`:`/${i}`}s(vm,"Vk"),o(vm,"shortRoot");var mb={web:0,eager:1,lazy:2};function fb(e,t){let r;try{r=JSON.parse(Ou(Ct(e,".lensmcp","config.json"),"utf8"))}catch{return}let i=r.instance?.name,u=r.instance?.baseKey;if(typeof i!="string"||!/^[a-z0-9](?:[a-z0-9-]{0,18}[a-z0-9])?$/.test(i)||typeof u!="string"||!u||r.key!==`${u}-${i}`)return;let n=typeof r.instance?.apex=="string"?r.instance.apex.toLowerCase():void 0,a=t.flatMap(p=>[...p.host?[p.host]:[],...typeof p.internalHost=="string"?[p.internalHost]:[]]).map(p=>p.toLowerCase().replace(/^\*\./,"").split(".").reverse()),l=[];for(let p=0;a.length>0;p++){let m=a[0]?.[p];if(m===void 0||!a.every(f=>f[p]===m))break;l.push(m)}let d=n??(l.length>=2?l.reverse().join("."):void 0);if(!d)return()=>{};let c=o(p=>{let m=p.toLowerCase();if(m.startsWith("*.")){let f=c(m.slice(2));return f===void 0?void 0:`*.${f}`}return m===d?`${i}.${d}`:m.endsWith(`.${d}`)?`${m.slice(0,-d.length)}${i}.${d}`:void 0},"rewrite");return c}s(fb,"jP"),o(fb,"instanceHostRewriter");function hb(e){let t=o((n,a)=>{try{return db(n)===a}catch{return!0}},"own"),r=e;try{r=db(e)}catch{}let i=Ct(r,"node_modules"),u=t(Ct(e,"node_modules"),i)&&t(Ct(e,"node_modules",".cache"),Ct(i,".cache"));return Ct(e,...u?["node_modules",".cache"]:[".lensmcp","cache"],"davnx-webpack","service-keys.json")}s(hb,"zP"),o(hb,"serviceKeysFile");function ym(e){if(process.platform==="win32")return"";try{return ob("ps",["-p",String(e),"-o","lstart="],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}).trim()}catch{return""}}s(ym,"Jk"),o(ym,"processStamp");function ta(e){if(process.ppid===e)return!0;try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}s(ta,"Rb"),o(ta,"pidAlive");function gb(e,t,r,i,u=!1){let n=r?.state;if(n==="crash-looping")return{state:"crash-looping",reason:"keeps exiting right after start"};if(n==="wedged")return{state:"wedged",reason:"running but not answering"};let a=n==="up"||t?.state==="up";return r?.buildFailed&&!a?{state:"down",reason:`${u?"a process error":"build failed"} \u2014 see the error lines`}:a?r?.buildFailed?{state:"up",reason:u?"reported a process error \u2014 see the error lines":"serving its last good build \u2014 the current build failed"}:{state:"up"}:n==="starting"||t?.state==="starting"?{state:"starting",reason:e==="lazy"?"cold start in progress":"starting"}:!n&&!t&&i>0?{state:"up",reason:`${i} pod socket${i===1?"":"s"} live`}:n==="idle"||t?.idle||e==="lazy"&&(n==="down"||t?.state==="down"||!t)?{state:"idle",reason:"scaled to zero \u2014 starts on the next request"}:n==="down"||t?.state==="down"?{state:"down",reason:"not running"}:{state:"unknown",reason:"no lifecycle events seen yet"}}s(gb,"OP"),o(gb,"serviceState");function vb(e){let t=e.filter(i=>!i.v4).map(i=>i.host),r=e.filter(i=>!i.v6).map(i=>i.host);return`printf '${[...t.length?[`127.0.0.1 ${t.join(" ")}`]:[],...r.length?[`::1 ${r.join(" ")}`]:[]].join("\\n")}\\n' | sudo tee -a /etc/hosts`}s(vb,"MP"),o(vb,"hostsFixCommand");var MI=class{static{s(this,"sc")}static{o(this,"LogRing")}constructor(e=5e3){this.cap=e,this.lines=[],this.seqN=0,this.sourceSet=new Set}get seq(){return this.seqN}get size(){return this.lines.length}sources(){return[...this.sourceSet].sort()}append(e){let t=yb(e,++this.seqN);return this.sourceSet.add(t.source),this.lines.push(t),this.lines.length>this.cap+Math.ceil(this.cap/10)&&this.lines.splice(0,this.lines.length-this.cap),t}since(e,t=this.cap){let r=this.indexAfter(e),i=this.lines.slice(r);return i.length>t?i.slice(i.length-t):i}recent(e){return this.lines.slice(Math.max(0,this.lines.length-e))}query(e){let t=e.limit??2e3,r=e.q?.toLowerCase(),i=e.since&&e.since>0?this.lines.slice(this.indexAfter(e.since)):this.lines,u=[];for(let n=i.length-1;n>=0&&u.length<t;n--){let a=i[n];e.flowId&&a.flowId!==e.flowId||e.from!==void 0&&a.at<e.from||e.to!==void 0&&a.at>e.to||r&&!`${a.title} ${a.message??""} ${a.source}`.toLowerCase().includes(r)||u.push(a)}return u.reverse()}indexAfter(e){let t=0,r=this.lines.length;for(;t<r;){let i=t+r>>>1;this.lines[i].seq<=e?t=i+1:r=i}return t}};function yb(e,t){let r=e.raw??{},i=e.context??{},u=typeof r.project=="string"&&r.project?r.project:e.source,n=typeof i.flowId=="string"?i.flowId:typeof i.traceId=="string"?i.traceId:void 0;return{seq:t,at:e.timestamp,source:u,category:e.category,severity:e.severity,title:e.title,...e.message?{message:e.message}:{},...n?{flowId:n}:{}}}s(yb,"NP"),o(yb,"logLineOf");var Eb=class{static{s(this,"Ko")}static{o(this,"SeenIds")}constructor(e=5e4){this.cap=e,this.set=new Set,this.order=[]}firstTime(e){if(!e)return!0;if(this.set.has(e))return!1;if(this.set.add(e),this.order.push(e),this.order.length>this.cap)for(let t of this.order.splice(0,this.order.length-this.cap))this.set.delete(t);return!0}},bb=class{static{s(this,"ac")}static{o(this,"Series")}constructor(e){this.horizonSec=e,this.buckets=new Map}bucket(e){let t=this.buckets.get(e);return t||(t={sec:e,count:0,errors:0,lat:[],latReq:[]},this.buckets.set(e,t)),t}addTraffic(e,t,r){let i=this.bucket(e);i.count+=t,i.errors+=r}addLatency(e,t,r){let i=this.bucket(e),u=r?i.lat:i.latReq;u.length<256&&u.push(t)}prune(e){for(let t of this.buckets.keys())t<=e-this.horizonSec&&this.buckets.delete(t)}range(e,t){let r=[];for(let i of this.buckets.values())i.sec>e&&i.sec<=t&&r.push(i);return r}},OI=class{static{s(this,"cc")}static{o(this,"KpiWindow")}constructor(e={}){this.byProject=new Map,this.windowSec=e.windowSec??300,this.sparkBuckets=e.sparkBuckets??30,this.sparkBucketSec=e.sparkBucketSec??10,this.horizonSec=Math.max(this.windowSec,this.sparkBuckets*this.sparkBucketSec)+5,this.global=new bb(this.horizonSec)}project(e){let t=this.byProject.get(e);return t||(t=new bb(this.horizonSec),this.byProject.set(e,t)),t}observe(e){if(e.source!=="gateway")return;let t=e.raw??{},r=t.kind,i=Math.floor(e.timestamp/1e3),u=typeof t.project=="string"?t.project:"",n=typeof t.caller=="string"&&t.caller?t.caller:void 0;if(r==="gateway-traffic"){let a=Em(t.count),l=Em(t.errors);if(a===0&&l===0)return;n||this.global.addTraffic(i,a,l),u&&this.project(u).addTraffic(i,a,l);let d=Array.isArray(t.durationsMs)?t.durationsMs:[];for(let c of d){let p=Number(c);!Number.isFinite(p)||p<0||(n||this.global.addLatency(i,p,!0),u&&this.project(u).addLatency(i,p,!0))}}else if(r==="gateway-request"){let a=Number(t.durationMs);if(!Number.isFinite(a)||a<0)return;n||this.global.addLatency(i,a,!1),u&&this.project(u).addLatency(i,a,!1)}}snapshot(e=Date.now()){let t=Math.floor(e/1e3);this.global.prune(t);for(let u of this.byProject.values())u.prune(t);let r=this.global,i=Dm(r,t,this.sparkBuckets,this.sparkBucketSec);return{at:e,windowSec:this.windowSec,req60:Xt(r.range(t-60,t),"count"),last:wm(r.range(t-this.windowSec,t)),sparkBucketSec:this.sparkBucketSec,spark:i}}projectStats(e,t=Date.now()){let r=this.byProject.get(e);if(!r)return;let i=Math.floor(t/1e3);return r.prune(i),{...wm(r.range(i-this.windowSec,i)),req60:Xt(r.range(i-60,i),"count"),spark:Dm(r,i,this.sparkBuckets,this.sparkBucketSec).req}}};function Em(e){let t=Number(e??0);return Number.isFinite(t)&&t>0?t:0}s(Em,"Wk"),o(Em,"nonNeg");function Xt(e,t){let r=0;for(let i of e)r+=i[t];return r}s(Xt,"xn"),o(Xt,"sum");function bm(e){let t=[];for(let i of e)for(let u of i.lat)t.push(u);if(t.length)return{lat:t.sort((i,u)=>i-u),complete:!0};let r=[];for(let i of e)for(let u of i.latReq)r.push(u);return{lat:r.sort((i,u)=>i-u),complete:!1}}s(bm,"Yk"),o(bm,"latencies");function wm(e){let t=Xt(e,"count"),r=Xt(e,"errors"),{lat:i,complete:u}=bm(e),n=i.length?i.reduce((a,l)=>a+l,0)/i.length:null;return{count:t,errors:r,errorRate:t>0?r/t:null,p50:ua(i,.5),p95:ua(i,.95),avgMs:n===null?null:Math.round(n),samples:i.length,sampled:!u||i.length<t}}s(wm,"Xk"),o(wm,"statsOf");function ua(e,t){if(e.length===0)return null;let r=Math.min(e.length-1,Math.max(0,Math.ceil(t*e.length)-1));return Math.round(e[r])}s(ua,"Ab"),o(ua,"percentile");function Dm(e,t,r,i){let u=[],n=[],a=[];for(let l=r-1;l>=0;l--){let d=t-l*i,c=e.range(d-i,d);u.push(Xt(c,"count")),n.push(Xt(c,"errors")),a.push(ua(bm(c).lat,.95))}return{req:u,errors:n,p95:a}}s(Dm,"Hk"),o(Dm,"sparkOf");var RI=class{static{s(this,"uc")}static{o(this,"FlowIndex")}constructor(e={flows:2e3,events:5e4},t=Et){this.caps=e,this.config=t,this.revs=new Map,this.pending=new Set,this.eventFlow=new Map,this.cache=new Map,this.evidenceCache=new Map}observe(e){let t=$m(e);if(!t)return;let r=(this.revs.get(t)??0)+1;this.revs.delete(t),this.revs.set(t,r),this.revs.size>this.caps.flows&&this.revs.delete(this.revs.keys().next().value),this.pending.add(t),e.id&&(this.eventFlow.set(e.id,t),this.eventFlow.size>this.caps.events&&this.eventFlow.delete(this.eventFlow.keys().next().value))}rev(e){return this.revs.get(e)??0}drainRevs(){let e=[...this.pending].map(t=>({flowId:t,rev:this.rev(t)}));return this.pending.clear(),e}flowOfEvent(e){return this.eventFlow.get(e)}summaries(e,t=50){if(!e)return[];let r=[];for(let u of e.recentFlowIds().slice(0,t)){let n=this.rev(u),a=this.cache.get(u);if(a&&a.rev===n&&n>0){r.push(a.summary);continue}let l=e.getFlowSummary(u);if(!l)continue;let d=e.getFlowEvents(u)??[],c=e.analyzeFlow?.(u)??(d.length?rs(d,this.config):void 0),p=kb(l,d,n,c);this.cache.set(u,{rev:n,summary:p}),r.push(p)}let i=new Set(r.map(u=>u.flowId));for(let u of this.cache.keys())i.has(u)||this.cache.delete(u);return r.sort((u,n)=>n.lastSeenAt-u.lastSeenAt)}evidence(e,t=50){let r=[];if(e){for(let i of e.recentFlowIds().slice(0,t)){let u=this.rev(i),n=this.evidenceCache.get(i);if(n&&n.rev===u&&u>0){r.push(...n.samples);continue}let a=wb(i,e.getFlowEvents(i)??[]);this.evidenceCache.set(i,{rev:u,samples:a}),r.push(...a)}if(this.evidenceCache.size>t*2){let i=new Set(e.recentFlowIds().slice(0,t));for(let u of this.evidenceCache.keys())i.has(u)||this.evidenceCache.delete(u)}}return new TI(r)}findByRoute(e,t,r){let i=ra(r);return e.find(u=>u.request&&u.request.method===t&&i.test(u.request.path))?.flowId}};function wb(e,t){let r=[],i=new Map;for(let n of t){let a=n.raw??{};if(a.kind==="server-request"&&n.id){let l=a.request??{},d=$b(n)??(typeof l.requestId=="string"?l.requestId:void 0);if(!d)continue;let c=typeof l.endedAt=="number"?l.endedAt:Db(n),p=typeof l.startedAt=="number"?l.startedAt:c-(typeof l.durationMs=="number"?l.durationMs:0);i.set(d,[...i.get(d)??[],{id:n.id,start:p,end:c}])}}let u=o((n,a)=>{let l=n?i.get(n):void 0;if(l?.length)return l.length===1?l[0].id:l.filter(d=>d.start-5<=a&&a<=d.end+5).sort((d,c)=>c.start-d.start)[0]?.id},"handlerAt");for(let n of t){if(!n.id)continue;let a=n.raw??{},l=Db(n),d=o(p=>typeof p=="number"&&Number.isFinite(p)?p:0,"num"),c=a.kind;if(c==="server-request"){let p=a.request??{};if(typeof p.route!="string")continue;r.push({key:`route:${String(p.method??"GET")} ${p.route}`,flowId:e,eventId:n.id,ms:d(p.durationMs),at:l,failed:d(p.status)>=500})}else if(c==="db-query"&&typeof a.project=="string"){let p=`${String(a.op??"query")} ${String(a.table??"")}`.trim(),m=n.title.replace(/\s*\(.*$/,"").trim();for(let f of new Set([p,m]))r.push({key:`sql:${a.project}:${f}`,flowId:e,eventId:n.id,ms:d(a.durationMs),at:l,failed:n.severity==="error"})}else if(c==="egress"&&typeof a.project=="string"&&typeof a.host=="string"){let p=typeof a.error=="string"||d(a.status)>=500||n.severity==="error";r.push({key:`egress:${a.project}:${a.host}`,flowId:e,eventId:n.id,ms:d(a.durationMs),at:l,failed:p})}else if(c==="memory-mutation"){let p=(a.mutation??{}).ownerNodeId;if(typeof p!="string")continue;r.push({key:`mem:${p}`,flowId:e,eventId:u($b(n),l)??n.id,ms:0,at:l,failed:!1})}}return r}s(wb,"PP"),o(wb,"evidenceSamples");var Db=o(e=>typeof e.timestamp=="number"?e.timestamp:Date.parse(String(e.timestamp))||0,"tsOf"),$b=o(e=>{let t=e.context??{};return typeof t.requestId=="string"&&t.requestId?t.requestId:void 0},"requestIdOf"),TI=class{static{s(this,"jb")}static{o(this,"EvidenceLookup")}constructor(e){this.samples=e}find(e,t,r={}){let i;for(let u of this.samples)!e(u.key)||r.inFlow!==void 0&&u.flowId!==r.inFlow||t==="failing"&&!u.failed||r.minMs!==void 0&&u.ms<r.minMs||(i?(t==="slowest"?u.ms>i.ms||u.ms===i.ms&&u.at>i.at:u.at>i.at)&&(i=u):i=u);return i?{flowId:i.flowId,nodeId:i.eventId}:void 0}};function $m(e){let t=e.context??{};return typeof t.flowId=="string"&&t.flowId?t.flowId:void 0}s($m,"zb"),o($m,"flowIdOf");function ra(e){let t=e.split("/").map(r=>r.startsWith(":")?"[^/?#]+":r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("/");return new RegExp(`^${t}(?:[?#].*)?$`)}s(ra,"lc"),o(ra,"routeRegex");var PI=new Set(["memory-mutation","memory-retention","singleton-instance","subscription-added","subscription-removed","store-created","hook-run"]),UI={"user-click":"click","user-input":"input","input-change":"input",keyboard:"key press","route-load":"navigate","page-load":"page load","form-submit":"submit",effect:"effect",timer:"timer","websocket-message":"socket message","backend-response":"response","hmr-update":"hot reload","ai-turn":"AI turn"};function Bb(e){return e?UI[e]??e.replace(/-/g," "):"request"}s(Bb,"UP"),o(Bb,"originLabelOf");function xb(e){if(!e)return;if(e.startsWith("page:"))return e.slice(5)||"/";let t=/([^/:]+\.[cm]?[jt]sx?):(\d+)/.exec(e);if(t)return`${t[1]}:${t[2]}`;let r=e.replace(/^[a-z]+:/,"");return r.length>40?"\u2026"+r.slice(-39):r}s(xb,"LP"),o(xb,"originWhereOf");function Cb(e){let t=Qn.indexOf(e);return t===-1?Qn.length:t}s(Cb,"FP"),o(Cb,"categoryRankOf");function kb(e,t,r,i){let u={},n=new Set,a="ok",l,d=1/0,c,p=1/0,m=1/0,f=-1/0,h=new Set,g=0,E=0,x,$=o(j=>{(j==="error"||j==="warn"&&a==="ok")&&(a=j)},"bump");for(let j of t){let N=j.raw??{},K=j.context??{},H=typeof N.kind=="string"?N.kind:void 0,ye=Dd({source:j.source,category:j.category,title:j.title,kind:H});u[ye]=(u[ye]??0)+1;let Ze=typeof N.project=="string"?N.project:typeof K.projectName=="string"?K.projectName:void 0;Ze&&j.source!=="gateway"&&n.add(Ze),j.severity==="error"||j.severity==="fatal"?($("error"),E++,(!x||j.timestamp<x.at)&&(x={at:j.timestamp,title:j.title})):j.severity==="warning"&&$("warn");let Je=Number(N.status??N.request?.status);if(Number.isFinite(Je)&&(Je>=500?$("error"):Je>=400&&$("warn")),(H==="fetch-start"||H==="fetch-done"||H==="fetch-error")&&typeof N.url=="string"){let Oe=Number(N.startedAt??j.timestamp);(Oe<d||Oe===d&&l&&l.status===void 0)&&(d=Oe,l={method:String(N.method??"GET"),path:N.url,...Number.isFinite(Je)?{status:Je}:l?.status!==void 0?{status:l.status}:{}})}if(h.size<80)if(H==="gateway-request"&&typeof N.url=="string")h.add(`${String(N.method??"GET")} ${Bm(N.url)}`);else if(H==="server-request"){let Oe=N.request??{};typeof Oe.route=="string"&&h.add(`${String(Oe.method??"GET")} ${Oe.route}`)}else H==="db-query"&&Ze?h.add(`sql:${Ze}:${j.title.replace(/\s*\(.*$/,"")}`):H==="egress"&&Ze&&typeof N.host=="string"&&h.add(`egress:${Ze}:${N.host}`);if(H==="gateway-request"&&!N.caller&&j.source==="gateway"&&g++,H==="gateway-request"&&!N.caller&&typeof N.url=="string"&&j.timestamp<p&&(p=j.timestamp,c={method:String(N.method??"GET"),path:N.url,...Number.isFinite(Je)?{status:Je}:{}}),H&&PI.has(H))continue;let _t=Number(N.durationMs??N.request?.durationMs??0),tt=Number(N.startedAt),xi=Number.isFinite(tt)&&tt>0?tt:j.timestamp-(Number.isFinite(_t)?_t:0),Zu=Number.isFinite(tt)&&tt>0&&Number.isFinite(_t)?tt+_t:j.timestamp;xi<m&&(m=xi),Zu>f&&(f=Zu)}!l&&c&&(l=c);let w=Bb(e.originType),k=xb(e.originNodeId),C=l?`${l.method} ${Bm(l.path)}`:void 0,M=e.headline&&e.headline!==e.originType?e.headline:void 0,y=!e.originType&&g>1?` +${g-1} more request${g===2?"":"s"}`:"",D=e.originType?`${w}${k?` \xB7 ${k}`:""}`:C?`${C}${y}`:M??w,A=e.originType&&C?`${D} \u2192 ${C}`:D;return{flowId:e.flowId,...e.originType?{originType:e.originType}:{},...e.originNodeId?{originNodeId:e.originNodeId}:{},startedAt:e.startedAt,lastSeenAt:e.lastSeenAt,eventCount:e.eventCount,headline:A,originLabel:w,...k?{originWhere:k}:{},...l?{request:l}:{},worst:a,durationMs:Number.isFinite(m)&&f>=m?Math.round(f-m):0,lanes:u,projects:[...n].sort(),rev:r,...g?{requestCount:g}:{},...E?{errorCount:E,firstError:Ib(x.title)}:{},...h.size?{touches:[...h]}:{},...i?Ab(i):{}}}s(kb,"BP"),o(kb,"summarizeFlow");function Ab(e){let t=e.classification,r=e.segmentation.stats;return{category:t.category,categoryRank:Cb(t.category),decidedBy:t.decidedBy,...t.subject?{subject:t.subject}:{},tags:t.tags,segmentCount:r.segments,phaseCount:r.phases,signalCount:r.signal}}s(Ab,"ZP"),o(Ab,"analysisFields");function Ib(e){return e.replace(/\s*✗\s*$/,"").replace(/\s*\((?:\d+ rows?, )?[\d.]+ ?ms\)$/,"")}s(Ib,"qP"),o(Ib,"cleanTitle");function Bm(e){let t=e.indexOf("?");return t>=0?e.slice(0,t):e}s(Bm,"tS"),o(Bm,"stripQuery");function xm(e,t){return{id:e.id,kind:e.kind,label:e.label,phase:e.phase,start:e.start,end:e.end,durationMs:e.durationMs,counts:e.counts,projects:e.projects,...e.method?{method:e.method}:{},...e.route?{route:e.route}:{},...e.requestId?{requestId:e.requestId}:{},...e.after?{after:e.after}:{},...e.hot?{hot:e.hot}:{},...e.part?{part:e.part}:{},worstSeverity:e.worstSeverity,category:t}}s(xm,"rS"),o(xm,"toDashSegment");function _b(e,t,r){if(!e)return{flowId:t,summary:null,events:[],rev:r.rev};let i=e.getFlowSummary(t)??null,u=e.getFlowEvents(t)??[],n=e.analyzeFlow?.(t)??(u.length?rs(u,r.config??Et):void 0),a,l=u;if(r.segmentId!==void 0){a=n?.segmentation.segments.find(g=>g.id===r.segmentId);let h=new Set(a?.eventIds??[]);l=u.filter(g=>h.has(g.id))}let d=Yn(l,{includeRaw:r.includeRaw===!0}),c={flowId:t,summary:i,...d,rev:r.rev};if(!n)return c;let p=n.segmentation.assignment;c.events=c.events.map(h=>{let g=p[h.id]??(h.memberIds?.[0]?p[h.memberIds[0]]:void 0);return g?{...h,segmentId:g}:h});let m=o(h=>n.segmentCategories[h.id]??"other","category");c.segments=n.segmentation.segments.map(h=>xm(h,m(h))),c.phases=n.segmentation.phases,c.segmentCategories=n.segmentCategories,c.segmentStats=n.segmentation.stats;let f=n.classification;return c.classification={category:f.category,decidedBy:f.decidedBy,...f.ruleIndex!==void 0?{ruleIndex:f.ruleIndex}:{},...f.subject?{subject:f.subject}:{},tags:f.tags,origin:f.origin},a&&(c.focus=xm(a,m(a))),c}s(_b,"nS"),o(_b,"flowDetailPayload");var qI=300,ZI=1e3,Sb=20,Fb=30,LI=1500,we=o(e=>e&&typeof e=="object"?e:{},"obj"),P=o(e=>typeof e=="string"&&e?e:void 0,"str"),ve=o(e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,"num"),VI=class{static{s(this,"fc")}static{o(this,"ErrorLog")}constructor(e=Date.now){this.now=e,this.groups=new Map,this.pending=[],this.byRequest=new Map,this.projectOfRequest=new Map,this.seen=new Set,this.dismissals=new Map,this.changed=!1}observe(e){if(e.id){if(this.seen.has(e.id))return!1;this.seen.add(e.id),this.seen.size>2e4&&this.seen.delete(this.seen.values().next().value)}let t=bd(e);if(t)return this.dismissals.delete(t.groupId),t.kind===$u&&(this.dismissals.set(t.groupId,{until:t.until,at:e.timestamp,eventIds:new Set(t.eventIds),...t.by?{by:t.by}:{},...t.reason?{reason:t.reason}:{}}),this.dismissals.size>ZI&&this.dismissals.delete(this.dismissals.keys().next().value)),this.changed=!0,!0;let r=we(e.raw),i=we(e.context),u=P(r.kind),n=P(i.requestId);u==="gateway-request"&&n&&P(r.project)&&(this.projectOfRequest.set(n,P(r.project)),this.projectOfRequest.size>5e3&&this.projectOfRequest.delete(this.projectOfRequest.keys().next().value));let a=e.severity==="error"||e.severity==="fatal",l=we(r.request),d=ve(r.status)??ve(l.status);return u==="server-request"&&(a||(d??0)>=500)?this.defer(e,"server"):e.source==="client-runtime"&&a&&(u==="error"||u==="unhandledrejection"||u==="resource-error"||u==="console")?this.browser(e,r,i):u==="egress"&&(P(r.error)||(d??0)>=500)?this.external(e,r,i,d):u==="queue-failed"?this.queue(e,r,i):u==="span"&&a?this.defer(e,"span"):u==="gateway-request"&&((d??0)>=500||d===0)?this.defer(e,"gateway"):u==="fetch-done"&&(d??0)>=500||u==="fetch-error"?this.defer(e,"fetch"):u==="log"&&a&&(e.source==="nestjs"||e.source==="nest")?this.defer(e,"log"):!1}flush(e=!1){let t=this.now(),r=o(a=>e||t-a.arrivedAt>=LI,"ready"),i=o(a=>P(we(a.event.context).requestId),"requestOf");for(let a of this.pending.filter(l=>l.kind==="server"&&r(l))){this.pending.splice(this.pending.indexOf(a),1);let l=we(a.event.raw);this.server(a.event,l,we(l.request),we(a.event.context))}let u=new Set(this.pending.filter(a=>a.kind==="server").map(i).filter(Boolean));for(let a of this.pending.filter(l=>l.kind!=="server"&&r(l)&&!(i(l)&&u.has(i(l)))))this.pending.splice(this.pending.indexOf(a),1),this.settle(a);let n=this.changed;return this.changed=!1,n}snapshot(e=[],t=15*6e4){let r=this.now(),i=Math.floor(r/6e4),u=[...this.groups.values()].map(c=>{let p=[];for(let E=i-Fb+1;E<=i;E++)p.push(c.perMinute.get(E)??0);let{flows:m,perMinute:f,eventIds:h,...g}=c;return{...g,occurrences:[...g.occurrences],flowCount:m.size,spark:p}}),n=this.hiddenEvents(),a=[],l=[];for(let c of[...e,...u].sort((p,m)=>+!!m.ongoing-+!!p.ongoing||m.lastSeenAt-p.lastSeenAt)){let p=this.dismissalOf(c,n);p?l.push({...c,dismissedAt:p.at,...p.by?{dismissedBy:p.by}:{},...p.reason?{dismissedReason:p.reason}:{}}):a.push(c)}let d=a.filter(c=>c.ongoing||r-c.lastSeenAt<=t);return{at:r,recentMs:t,groups:a,recentGroups:d.length,recentOccurrences:d.reduce((c,p)=>c+(p.ongoing?1:p.occurrences.filter(m=>r-m.at<=t).length),0),dismissed:l}}hiddenEvents(){let e=new Map;for(let t of this.dismissals.values())for(let r of t.eventIds)(e.get(r)?.at??-1)<=t.at&&e.set(r,t);return e}dismissalOf(e,t){let r=this.dismissals.get(e.id);if(r&&e.lastSeenAt<=r.until)return r;let i=this.groups.get(e.id)?.eventIds,u=i?.[i.length-1];return u===void 0?void 0:t.get(u)}dismissalsFor(e,t=[],r=this.now()){let i=[];for(let u of new Set(e)){let n=this.groups.get(u),a=n??t.find(l=>l.id===u);a&&i.push({groupId:u,until:Math.max(r,a.lastSeenAt),eventIds:n?n.eventIds.slice():[],by:"dashboard",title:a.title})}return i}restorable(e){let t=new Set;for(let r of new Set(e)){this.dismissals.has(r)&&t.add(r);let i=this.groups.get(r)?.eventIds??[];for(let[u,n]of this.dismissals)i.some(a=>n.eventIds.has(a))&&t.add(u)}return[...t]}server(e,t,r,i){let u=P(i.requestId)??P(r.requestId),n=P(i.projectName)??P(t.project)??(u?this.projectOfRequest.get(u):void 0),a=P(r.method)??"GET",l=P(r.route)??"?",d=ve(r.status)??ve(t.status),c=we(r.error),p=P(c.message)??P(e.message),m=P(c.name),f=`${a} ${l}${d?` \u2192 ${d}`:""}`,h=`server:${n??"?"}:${a} ${l}:${d??""}:${m??""}:${Yt(p)}`,g=this.record(h,"server",e,{title:f,...n?{where:n,project:n}:{},...p?{message:p}:{},...P(c.stack)?{stack:vi(P(c.stack))}:{},...d!==void 0?{status:d}:{}},u,d);return u&&this.byRequest.set(u,{group:this.groups.get(h),occ:g}),this.trimRequests(),!0}browser(e,t,r){let i=P(t.message)??e.title,u=P(r.url)??P(r.route),n=`browser:${P(t.kind)}:${Yt(i)}`;return this.record(n,"browser",e,{title:i.split(`
78
- `)[0].slice(0,160),...u?{where:jb(u)}:{},message:i,...P(t.stack)?{stack:vi(P(t.stack))}:{}},P(r.requestId)),!0}external(e,t,r,i){let u=P(t.project)??P(r.projectName),n=P(t.host)??"?",a=P(t.method)??"GET",l=P(t.path)??"",d=P(t.error),c=i?String(i):d??"failed",p=`external:${u??"?"}:${n}:${a} ${Ru(l)}:${i??Yt(d)}`;return this.record(p,"external",e,{title:`${a} ${n}${Ru(l)} \u2192 ${c}`,where:`${u??"?"} \u2192 ${n}`,...u?{project:u}:{},...d?{message:d}:{},...i?{status:i}:{}},P(r.requestId),i),!0}queue(e,t,r){let i=P(t.queue)??"?",u=P(t.failedReason)??P(t.error)??e.message,n=P(t.project)??P(r.projectName),a=`queue:${i}:${P(t.name)??""}:${Yt(u)}`;return this.record(a,"queue",e,{title:`Job ${P(t.name)??""} failed on ${i}`.replace(/\s+/g," "),where:n?`${n} \xB7 ${i}`:i,...n?{project:n}:{},...u?{message:u}:{},...P(t.stack)?{stack:vi(P(t.stack))}:{}},P(r.requestId)),!0}defer(e,t){return this.pending.push({event:e,kind:t,arrivedAt:this.now()}),this.pending.length>2e3&&this.pending.splice(0,this.pending.length-2e3),!1}settle(e){let t=e.event,r=we(t.raw),i=we(t.context),u=P(i.requestId),n=u?this.byRequest.get(u):void 0;if(n){e.kind==="span"&&!n.occ.stepId&&(n.occ.stepId=t.id),!n.occ.flowId&&P(i.flowId)&&(n.occ.flowId=P(i.flowId)),this.changed=!0;return}if(e.kind==="log"){let E=P(r.project)??P(i.projectName);if([...this.groups.values()].some(w=>w.kind==="server"&&(w.project===E||!w.project)&&Math.abs(w.lastSeenAt-t.timestamp)<3e3))return;let x=we(we(r.request).error),$=Am(P(x.message)??t.title);this.record(`log:${E??"?"}:${Yt($)}`,"log",t,{title:$.split(`
79
- `)[0].slice(0,160),...E?{where:E,project:E}:{},message:$,...P(x.stack)?{stack:vi(Am(P(x.stack)))}:{}},u);return}if(e.kind==="span"){let E=we(r.span),x=P(E.name)??t.title.replace(/\s*\(\d+ms\)\s*✗?$/,""),$=P(i.projectName)??(u?this.projectOfRequest.get(u):void 0),w=P(t.message)??P(we(E.error).message),k=this.record(`exception:${$??"?"}:${x}:${Yt(w)}`,"exception",t,{title:`${x} threw${w?`: ${w.split(`
80
- `)[0].slice(0,100)}`:""}`,...$?{where:$,project:$}:{},...w?{message:w}:{}},u);u&&this.byRequest.set(u,{group:[...this.groups.values()].find(C=>C.occurrences.includes(k)),occ:k});return}let a=ve(r.status),l=P(r.method)??"GET",d=P(r.url)??"?",c=P(r.project),p=P(r.host),m=e.kind==="fetch"&&!a?"network error":String(a??"failed"),f=e.kind==="gateway"?`${l} ${p??""}${Ru(d)} \u2192 ${m}`:`${l} ${Ru(d)} \u2192 ${m}`,h=`request:${e.kind}:${c??p??""}:${l} ${Ru(d)}:${m}`,g=this.record(h,"request",t,{title:f,where:e.kind==="gateway"?`gateway \u2192 ${c??p??"?"}`:"browser",...c?{project:c}:{},...a!==void 0?{status:a}:{},...e.kind==="gateway"?{message:zb(r,a)}:{}},u,a);u&&this.byRequest.set(u,{group:this.groups.get(h),occ:g})}record(e,t,r,i,u,n){let a=we(r.context),l=P(a.flowId),d=this.groups.get(e);d||(d={id:e,kind:t,...i,count:0,firstSeenAt:r.timestamp,lastSeenAt:r.timestamp,occurrences:[],flows:new Set,perMinute:new Map,eventIds:[]},this.groups.set(e,d),this.evict()),d.count+=1,d.eventIds.push(r.id),d.eventIds.length>200&&d.eventIds.shift(),d.firstSeenAt=Math.min(d.firstSeenAt,r.timestamp),r.timestamp>=d.lastSeenAt&&(d.lastSeenAt=r.timestamp,i.stack&&(d.stack=i.stack),i.message&&(d.message=i.message)),l&&d.flows.add(l);let c=Math.floor(r.timestamp/6e4);d.perMinute.set(c,(d.perMinute.get(c)??0)+1);for(let m of d.perMinute.keys())m<c-Fb&&d.perMinute.delete(m);let p={id:r.id,at:r.timestamp,...l?{flowId:l}:{},...u?{requestId:u}:{},...n!==void 0?{status:n}:{}};return d.occurrences.unshift(p),d.occurrences.sort((m,f)=>f.at-m.at),d.occurrences.length>Sb&&(d.occurrences.length=Sb),this.changed=!0,p}evict(){if(this.groups.size<=qI)return;let e=[...this.groups.values()].sort((t,r)=>t.lastSeenAt-r.lastSeenAt)[0];e&&this.groups.delete(e.id)}trimRequests(){this.byRequest.size>5e3&&this.byRequest.delete(this.byRequest.keys().next().value)}};function Cm(e,t,r){if(t==="crash-looping")return{kind:"service",title:`${e} keeps crashing`,serving:!1};if(t==="wedged")return{kind:"service",title:`${e} is not answering`,serving:!1};let i=r.length>0&&r.every(n=>n.fault==="process"),u=t==="up";return{kind:u?i?"log":"build":"service",title:i?`${e} reported a process error`:`${e} failed to build`,serving:u}}s(Cm,"Ob"),o(Cm,"describeServiceFault");function km(e,t=Date.now()){let r=[],i=o((c,p=!0)=>({...c,count:c.count??1,firstSeenAt:c.at??t,lastSeenAt:c.at??t,occurrences:[],flowCount:0,spark:[],...p?{ongoing:!0}:{}}),"base"),u=o(c=>{let p=new Map;for(let m of ia(we(e[c]).errors))p.set(P(m.project)??"workspace",[...p.get(P(m.project)??"workspace")??[],m]);return p},"grouped"),n=u("typecheck://errors"),a=u("lint://errors");for(let c of ia(we(e["build://failures"]).failures)){let p=c.domain==="typecheck"||c.domain==="lint"?c.domain:"build",m=P(c.project)??"workspace";p==="typecheck"&&n.has(m)||p==="lint"&&a.has(m)||r.push(i({id:`build:${P(c.fingerprint)??P(c.message)??"?"}`,kind:p,title:`${p==="typecheck"?"Type error":p==="lint"?"Lint error":"Build error"}${P(c.project)?` in ${P(c.project)}`:""}`,...P(c.file)?{where:P(c.file)}:{},...P(c.project)?{project:P(c.project)}:{},...P(c.message)?{message:P(c.message)}:{},resource:"build://failures",...ve(c.timestamp)!==void 0?{at:ve(c.timestamp)}:{}}))}for(let[c,p]of n){let m=p[0];r.push(i({id:`typecheck:${c}`,kind:"typecheck",title:`${p.length} type error${p.length===1?"":"s"} in ${c}`,where:[P(m.file),ve(m.line)].filter(f=>f!==void 0).join(":")||c,project:c,message:p.slice(0,5).map(f=>`${P(f.file)??""}${ve(f.line)!==void 0?`:${ve(f.line)}`:""} ${P(f.code)??""} ${P(f.message)??""}`.trim()).join(`
81
- `),count:p.length,resource:"typecheck://errors",at:Math.max(...p.map(f=>ve(f.timestamp)??0))||t}))}for(let[c,p]of a){let m=p[0]??{};r.push(i({id:`lint:${c}`,kind:"lint",title:`${p.length} lint error${p.length===1?"":"s"} in ${c}`,where:[P(m.file),ve(m.line)].filter(f=>f!==void 0).join(":")||c,project:c,message:p.slice(0,5).map(f=>`${P(f.file)??""}${ve(f.line)!==void 0?`:${ve(f.line)}`:""} ${P(f.rule)??""} ${P(f.message)??""}`.trim()).join(`
82
- `),count:p.length,resource:"lint://errors",at:Math.max(...p.map(f=>ve(f.timestamp)??0))||t},!1))}let l=we(e["process://cluster"]),d=ia(l.errors);for(let c of ia(l.services)){let p=P(c.state),m=P(c.project)??"?",f=d.filter($=>$.project===m),h=o($=>$.map(w=>P(w.line)).filter(Boolean),"text");if(c.typeErrors===!0&&!n.has(m)){let $=h(f.filter(w=>w.fault==="types"));r.push(i({id:`typecheck:${m}`,kind:"typecheck",title:`Type errors in ${m}`,where:m,project:m,...$.length?{message:$.slice(-6).join(`
83
- `)}:{},resource:"process://cluster",...ve(c.lastSeenAt)!==void 0?{at:ve(c.lastSeenAt)}:{}}))}if(p!=="crash-looping"&&p!=="wedged"&&c.buildFailed!==!0)continue;let g=f.filter($=>$.fault!=="types"),E=h(g),x=Cm(m,p,g);r.push(i({id:`service:${m}:${p}`,kind:x.kind,title:x.title,where:x.serving?`${m} \u2014 still serving its last good build`:m,project:m,...E.length?{message:E.slice(-6).join(`
84
- `)}:P(c.lastTitle)?{message:P(c.lastTitle)}:{},resource:"process://cluster",...ve(c.lastSeenAt)!==void 0?{at:ve(c.lastSeenAt)}:{}}))}return r}s(km,"Mb"),o(km,"standingErrors");var ia=o(e=>Array.isArray(e)?e.filter(t=>t&&typeof t=="object"):[],"arr");function Yt(e){return e?e.split(`
85
- `)[0].replace(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,"<id>").replace(/\b[0-9A-HJKMNP-TV-Z]{26}\b/g,"<id>").replace(/0x[0-9a-f]+/gi,"<hex>").replace(/\d+/g,"#").slice(0,140):""}s(Yt,"$n"),o(Yt,"norm");function Ru(e){let t=(e.split("?")[0]??e).split("/");return t.map((r,i)=>{let u=t[i-1]??"";return/^\d+$/.test(r)&&!(/^(?:api|v)$/i.test(u)&&r.length<=2)||/^[0-9a-f]{16,}$/i.test(r)||/^[0-9a-f]{8}-[0-9a-f-]{27}$/i.test(r)?":id":r}).join("/")}s(Ru,"Wo"),o(Ru,"routeShape");function jb(e){try{return new URL(e).pathname}catch{return e}}s(jb,"KP"),o(jb,"pagePath");function vi(e){let t=e.split(`
86
- `),r=t[0]??"",i=t.slice(1).filter(a=>/^\s*at /.test(a)),u=i.filter(a=>!/node_modules|node:internal|node:async_hooks|\(native\)|<anonymous>/.test(a)),n=(u.length?u:i).slice(0,8);return[r,...n].join(`
87
- `)}s(vi,"pc"),o(vi,"appFrames");function Am(e){return e.replace(/^\[Nest\]\s+\d+\s+-\s+[^A-Z]*?\s+(?:ERROR|WARN)\s+(?:\[[^\]]+\]\s+)?/,"")}s(Am,"sS"),o(Am,"stripNestPrefix");function zb(e,t){let r=Array.isArray(e.steps)?e.steps:[],i=r[r.length-1],u=i?P(i.step):void 0;return t===503?`the gateway answered 503${u?` after "${u}"`:""} \u2014 the service did not become ready (cold start or crash)`:t===502?"the gateway could not reach the service (502)":t===504?"the service did not answer in time (504)":`the gateway answered ${t??"with a failure"}${u?` after "${u}"`:""}`}s(zb,"WP"),o(zb,"gatewayReason");var Nb=["graph://patterns","perf://slow-routes","perf://duplicate-requests","db://slow-queries","db://analysis","memory://leaks/suspected","memory://owners/growing","memory://current","react://components/hot","runtime://errors","runtime://browser/errors","trace://failed","net://egress/hosts","typecheck://current","typecheck://errors","build://current","build://failures","lint://current","process://cluster","visual://violations/current","perf://rules"],oe=o(e=>e&&typeof e=="object"?e:{},"obj"),ce=o(e=>Array.isArray(e)?e.filter(t=>t&&typeof t=="object"):[],"arr"),z=o(e=>typeof e=="string"&&e?e:void 0,"str"),R=o(e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,"num");function Mb(e){let t=e.resources,r=[],i=o(y=>{for(let D of y){let A=e.flowOfEvent(D);if(A)return{flowId:A,nodeId:D,eventIds:y.slice(0,50)}}return y.length?{eventIds:y.slice(0,50)}:void 0},"evidenceOf"),u=o((y,D)=>{let A=ra(D),j=o(N=>N.startsWith(`${y} `)&&A.test(N.slice(y.length+1)),"hit");return e.flows.find(N=>N.request&&N.request.method===y&&A.test(N.request.path)||N.touches?.some(j))?.flowId},"flowForRoute"),n=o(y=>e.flows.find(D=>D.touches?.includes(y))?.flowId,"flowTouching"),a=o((y,D)=>y?{flowId:y.flowId,nodeId:y.nodeId}:D?{flowId:D}:void 0,"at"),l=o((y,D)=>{let A=ra(D),j=`route:${y} `;return N=>N.startsWith(j)&&(N.slice(j.length)===D||A.test(N.slice(j.length)))},"routeKey");for(let y of ce(oe(t["graph://patterns"]).patterns)){let D=z(y.kind),A=oe(y.details),j=(Array.isArray(y.evidence)?y.evidence:[]).filter(ye=>typeof ye=="string"),N=z(y.title)??D??"pattern",K=D==="n+1-query"?"n-plus-one":D==="db-in-loop"?"db-in-loop":D==="render-storm"?"render-storm":D==="slow-path"?"slow-path":D==="leak"?"leak":"other",H=z(A.signature)??z(A.componentInstanceId)??N;r.push({id:`graph:${D}:${H}`,kind:K,severity:y.severity==="error"?"high":"medium",title:N,...z(A.signature)?{code:z(A.signature)}:{},...K==="render-storm"&&z(A.componentInstanceId)?{where:Im(z(A.componentInstanceId))}:{},detail:Vb(K,A),...R(A.count)!==void 0?{count:R(A.count)}:R(A.dbCallsInsideLoop)!==void 0?{count:R(A.dbCallsInsideLoop)}:{},evidence:i(j),resource:"graph://patterns",at:R(y.detectedAt)})}let d=oe(t["perf://slow-routes"]),c=R(d.thresholdMs)??500;for(let y of ce(d.routes)){let D=z(y.method)??"GET",A=z(y.route)??"?",j=R(y.worstRecentMs)??0,N=a(e.evidence?.find(l(D,A),"latest",{minMs:c})??e.evidence?.find(l(D,A),"slowest"),u(D,A));r.push({id:`perf:slow-route:${D} ${A}`,kind:"slow-route",severity:j>=c*3?"high":"medium",title:`${D} ${A} is slow`,where:`${D} ${A}`,detail:`worst ${Ue(j)} recently \u2014 ${R(y.recentSlowSamples)??0} of the last ${Math.min(R(y.samples)??0,R(d.recentSampleWindow)??20)} calls over the ${Ue(c)} budget (last call ${Ue(R(y.lastDurationMs)??0)})`,count:R(y.slowSamples),...N?{evidence:N}:{},resource:"perf://slow-routes",at:R(y.lastSeenAt)})}for(let y of ce(oe(t["perf://duplicate-requests"]).endpoints)){let D=z(y.method)??"GET",A=z(y.url)??"?";r.push({id:`perf:dup:${D} ${A}`,kind:"duplicate-requests",severity:"medium",title:`${D} ${A} fired ${R(y.peakConcurrent)??"?"}\xD7 at once`,where:`${D} ${A}`,detail:`${R(y.peakConcurrent)??"?"} identical requests in flight together \u2014 the browser asked for the same thing repeatedly`,count:R(y.totalRequests),resource:"perf://duplicate-requests",at:R(y.lastSeenAt)})}let p=oe(t["db://slow-queries"]),m=R(p.thresholdMs)??100;for(let y of ce(p.queries)){let D=R(y.p95Ms)??0,A=R(y.maxMs)??0,j=`${z(y.op)??"query"} ${z(y.table)??""}`.trim();r.push({id:`db:slow:${z(y.project)??"?"}:${j}`,kind:"slow-query",severity:D>=m*5?"high":D>=m?"medium":"low",title:D>=m?`Slow query: ${j}`:`Occasionally slow query: ${j}`,where:`${z(y.project)??"?"} \xB7 ${j}`,detail:`p95 ${Ue(D)} \xB7 max ${Ue(A)} \xB7 avg ${Ue(R(y.avgMs)??0)} over ${R(y.count)??0} runs (budget ${Ue(m)})`,...z(y.lastSql)?{code:z(y.lastSql)}:{},count:R(y.count),...(()=>{let N=`sql:${z(y.project)??"?"}:${j}`,K=a(e.evidence?.find(H=>H===N,"latest",{minMs:m})??e.evidence?.find(H=>H===N,"slowest"),n(N));return K?{evidence:K}:{}})(),resource:"db://slow-queries",at:R(y.lastSeenAt)})}for(let y of ce(oe(t["db://analysis"]).runs))for(let D of ce(y.findings)){let A=z(D.kind)??"finding";r.push({id:`db:analysis:${z(y.project)??"?"}:${A}:${z(D.table)??""}`,kind:A==="missing-index"?"missing-index":"slow-query",severity:D.severity==="error"?"high":D.severity==="info"?"low":"medium",title:`${A.replace(/-/g," ")} on ${z(D.table)??"a table"}`,where:`${z(y.project)??"?"} \xB7 ${z(D.table)??""}`,...z(D.detail)?{detail:z(D.detail)}:{},resource:"db://analysis",at:R(y.runAt)})}let f=new Map;for(let y of ce(oe(t["memory://leaks/suspected"]).suspected)){let D=z(y.ownerId)??"?",A=f.get(D);(!A||(R(y.at)??0)>=(R(A.at)??0))&&f.set(D,y)}for(let y of f.values()){let D=z(y.ownerId)??"?",A=oe(y.detail),j=z(y.flowId),N=a(j?e.evidence?.find(K=>K===`mem:${D}`,"latest",{inFlow:j}):void 0,j);r.push({id:`memory:leak:${_m(D)}`,kind:"leak",severity:"high",title:`Suspected leak: ${_m(D)}`,where:D,detail:`grew by ${R(A.growth)??"?"} (${R(A.startCount)??"?"} \u2192 ${R(A.endCount)??"?"}) during one flow and did not shrink`,...N?{evidence:N}:{},resource:"memory://leaks/suspected",at:R(y.at)})}let h=new Map;for(let y of ce(oe(t["runtime://errors"]).entries)){let D=z(y.fingerprint)??z(y.title)??"?",A=h.get(D),j=!A||(R(y.timestamp)??0)>(R(A.e.timestamp)??0),N=j?z(y.stack)??A?.stack:A?.stack??z(y.stack);h.set(D,{e:j?y:A.e,n:(A?.n??0)+1,...N?{stack:N}:{}})}let g=new Set;for(let[y,{e:D,n:A,stack:j}]of h){let N=z(D.id),K=z(D.requestId);K&&g.add(K),r.push({id:`runtime:server:${y}`,kind:"server-error",severity:"high",title:z(D.title)??"Server error",where:[z(D.source),z(D.route)].filter(Boolean).join(" \xB7 ")||void 0,...z(D.message)?{detail:z(D.message)}:{},...j?{code:Sm(j)}:{},count:A,evidence:i(N?[N]:[]),resource:"runtime://errors",at:R(D.timestamp)})}let E=new Map;for(let y of ce(oe(t["runtime://browser/errors"]).entries)){let D=z(y.fingerprint)??z(y.title)??z(y.message)??"?",A=E.get(D);E.set(D,{e:A&&(R(A.e.timestamp)??0)>(R(y.timestamp)??0)?A.e:y,n:(A?.n??0)+1})}for(let[y,{e:D,n:A}]of E){let j=z(D.id);r.push({id:`runtime:browser:${y}`,kind:"browser-error",severity:"high",title:z(D.title)??z(D.message)??"Browser error",...z(D.url)?{where:z(D.url)}:{},...z(D.message)&&z(D.message)!==z(D.title)?{detail:z(D.message)}:{},...z(D.stack)?{code:Sm(z(D.stack))}:{},count:A,evidence:i(j?[j]:[]),resource:"runtime://browser/errors",at:R(D.timestamp)})}let x=new Map;for(let y of ce(oe(t["trace://failed"]).spans)){let D=z(y.name)??"?";if(D.startsWith("nest.request ")||z(y.requestId)&&g.has(z(y.requestId)))continue;let A=x.get(D);x.set(D,{s:A&&(R(A.s.startTime)??0)>(R(y.startTime)??0)?A.s:y,n:(A?.n??0)+1})}for(let[y,{s:D,n:A}]of x){let j=z(D.id);r.push({id:`trace:failed:${y}`,kind:"failed-span",severity:"medium",title:`${y} failed`,where:y,count:A,evidence:i(j?[j]:[])??(z(D.flowId)?{flowId:z(D.flowId)}:void 0),resource:"trace://failed",at:R(D.startTime)})}for(let y of ce(oe(t["net://egress/hosts"]).hosts)){let D=z(y.host)??"?",A=z(y.project)??"?",j=ce(y.endpoints).find(N=>(R(N.errorCount)??0)+(R(N.status5xx)??0)>0);y.failing===!0?r.push({id:`net:failing:${A}:${D}`,kind:"egress-failing",severity:"high",title:`Calls to ${D} are failing`,where:`${A} \u2192 ${D}`,detail:z(y.detail)??`${R(y.errorCount)??0} errors, ${R(y.status5xx)??0}\xD7 5xx`,...j?{code:`${z(j.method)??"GET"} ${D}${z(j.path)??""}${z(j.lastError)?`
88
- ${z(j.lastError)}`:R(j.lastStatus)?` \u2192 ${R(j.lastStatus)}`:""}`}:{},count:R(y.count),...(()=>{let N=`egress:${A}:${D}`,K=a(e.evidence?.find(H=>H===N,"failing")??e.evidence?.find(H=>H===N,"latest"),n(N));return K?{evidence:K}:{}})(),resource:"net://egress/hosts",at:R(y.lastSeenAt)}):y.slow===!0&&r.push({id:`net:slow:${A}:${D}`,kind:"egress-slow",severity:"medium",title:`${D} is slow`,where:`${A} \u2192 ${D}`,detail:`p95 ${Ue(R(y.p95Ms)??0)} \xB7 max ${Ue(R(y.maxMs)??0)} over ${R(y.count)??0} calls`,count:R(y.count),...(()=>{let N=`egress:${A}:${D}`,K=a(e.evidence?.find(H=>H===N,"slowest"),n(N));return K?{evidence:K}:{}})(),resource:"net://egress/hosts",at:R(y.lastSeenAt)})}for(let y of ce(oe(t["build://failures"]).failures)){let D=z(y.file);r.push({id:`build:${z(y.fingerprint)??z(y.message)??D??"?"}`,kind:"build",severity:"high",title:`Build error${z(y.project)?` in ${z(y.project)}`:""}`,...D?{where:D}:{},...z(y.message)?{detail:z(y.message)}:{},resource:"build://failures",at:R(y.timestamp)})}let $=ce(oe(t["typecheck://errors"]).errors),w=new Map;for(let y of $){let D=z(y.project)??"workspace";w.set(D,[...w.get(D)??[],y])}for(let[y,D]of w){let A=D[0];r.push({id:`typecheck:${y}`,kind:"typecheck",severity:"high",title:`${D.length} type error${D.length===1?"":"s"} in ${y}`,where:[z(A.file),R(A.line)].filter(j=>j!==void 0).join(":")||void 0,detail:`${z(A.code)?z(A.code)+": ":""}${z(A.message)??""}`,count:D.length,resource:"typecheck://errors",at:Math.max(...D.map(j=>R(j.timestamp)??0))})}let k=oe(t["process://cluster"]),C=ce(k.errors);for(let y of ce(k.services)){let D=z(y.state),A=z(y.project)??"?";if(D!=="crash-looping"&&D!=="wedged"&&y.buildFailed!==!0)continue;let j=C.filter(H=>H.project===A&&H.fault!=="types"),N=j.map(H=>z(H.line)).filter(Boolean),K=Cm(A,D,j);r.push({id:`service:${A}:${D}`,kind:"service",severity:"high",title:K.title,where:K.serving?`${A} \u2014 still serving its last good build`:A,...z(y.lastTitle)?{detail:z(y.lastTitle)}:{},...N.length?{code:N.slice(-6).join(`
77
+ ${r}`).digest("hex")}s(Im,"wS"),o(Im,"loginSignature");function ME(e,t,r=_E(16).toString("hex")){let n=t+SE;return`${n}.${r}.${Im(e,n,r)}`}s(ME,"xS"),o(ME,"mintLoginCode");var _I=/^(\d{1,16})\.([0-9a-f]{32})\.([0-9a-f]{64})$/,II=class{static{s(this,"uc")}static{o(this,"LoginLedger")}constructor(){this.redeemed=new Map}redeem(e,t,r){for(let[a,l]of this.redeemed)l<=r&&this.redeemed.delete(a);let n=_I.exec(t.trim());if(!n)return"invalid";let u=Number(n[1]),i=n[2];return wn(n[3],Im(e,u,i))?u<=r||u>r+SE+6e4?"expired":this.redeemed.has(i)?"used":(this.redeemed.set(i,u),"ok"):"invalid"}};function OE(e){return e==="/api"||e.startsWith("/api/")}s(OE,"$S"),o(OE,"isDataEndpoint");function RE(e){return e.startsWith("/assets/dashboard-ui/")}s(RE,"_S"),o(RE,"isAssetPath");function TE(e){let t=Number(process.env.LENSMCP_PARENT_PID??0);!Number.isInteger(t)||t<=0||setInterval(()=>{process.ppid!==t&&(console.error(`[lensmcp] ${e}: parent gateway (pid ${t}) is gone \u2014 exiting to free the port.`),process.exit(0))},5e3).unref()}s(TE,"kS"),o(TE,"watchParentGateway");import{closeSync as SI,openSync as FI,readSync as jI,statSync as zI}from"node:fs";function PE(e,t,r){let n=zI(e).size;if(n===0)return[];let u=Math.max(0,n-t),i=Buffer.alloc(n-u),a=FI(e,"r");try{jI(a,i,0,i.length,u)}finally{SI(a)}let l=i.toString("utf8").trim().split(`
78
+ `);return u>0&&l.shift(),l.slice(-r)}s(PE,"SS"),o(PE,"readEventTailLines");import{execFileSync as UE}from"node:child_process";import{createHash as NI}from"node:crypto";import{readdirSync as qE,readFileSync as Pu,realpathSync as ZE}from"node:fs";import{homedir as Sm}from"node:os";import{join as kt}from"node:path";var LE=new Set(["db","redis","queue","memory","external","fs","exec"]),MI=16;function Ce(e){let t=Number(e??0);return Number.isFinite(t)&&t>=0?t:0}s(Ce,"Ce"),o(Ce,"finite");var OI=class{static{s(this,"dc")}static{o(this,"ClusterState")}constructor(e){this.opts=e,this.gateway=null,this.services=new Map,this.edges=new Map,this.recent=[],this.dataNodes=new Map,this.podMemory=new Map,this.declCache={at:0,decls:[]},this.worktreeCache={at:0,view:{}},this.branches=new Map,this.registryCache={at:0}}worktreeView(e=Date.now()){if(e-this.worktreeCache.at<5e3)return this.worktreeCache.view;let t=kt(this.opts.env?.LENSMCP_HOME||process.env.LENSMCP_HOME||Sm(),".lensmcp"),r=o(c=>{try{return JSON.parse(Pu(kt(t,c),"utf8"))}catch{return}},"readJson"),n=Array.isArray(r("workspaces.json"))?r("workspaces.json"):[],u=r("instances.json")?.instances??{},i=this.opts.workspaceKey,a=[];if(i){for(let c of n){if(c.instance?.baseKey!==i||typeof c.key!="string"||typeof c.root!="string")continue;let p=typeof c.pid=="number"?c.pid:0,m=p>0&&aa(p)&&(typeof c.procStamp!="string"||!c.procStamp||jm(p)===c.procStamp),f=Object.keys(u[c.key]?.resources??{});a.push({key:c.key,name:typeof c.instance.name=="string"?c.instance.name:c.key,...typeof c.instance.apex=="string"?{apex:c.instance.apex}:{},live:m,dashboard:typeof c.base=="string"?c.base:`/${c.key}`,root:Fm(c.root),...this.branchField(c.root,e),...f.length?{data:f}:{},...typeof c.updatedAt=="string"?{updatedAt:c.updatedAt}:{}})}for(let c of Object.values(u)){if(c.baseKey!==i||a.some(m=>m.key===c.key))continue;let p=Object.keys(c.resources??{});a.push({key:c.key,name:c.name,live:!1,dashboard:`/${c.key}`,root:Fm(c.root),...this.branchField(c.root,e),...p.length?{data:p}:{}})}a.sort((c,p)=>Number(p.live)-Number(c.live)||c.name.localeCompare(p.name))}let l=i?n.find(c=>c.key===i)?.instance:void 0,d={...a.length?{worktrees:a}:{},...l&&typeof l.name=="string"&&typeof l.baseKey=="string"?{instance:{name:l.name,baseKey:l.baseKey,apex:typeof l.apex=="string"?l.apex:"",baseDashboard:`/${l.baseKey}`}}:{}};return this.worktreeCache={at:e,view:d},d}branchField(e,t){let r=this.branches.get(e);if(r&&t-r.at<3e4)return r.branch?{branch:r.branch}:{};let n;try{n=this.opts.branchOf?this.opts.branchOf(e):JE(e)}catch{n=void 0}return this.branches.set(e,{at:t,branch:n}),n?{branch:n}:{}}reduce(e){if(e.source==="memory"&&this.reducePodMemory(e))return;if(LE.has(e.source)){let u=e.raw??{},i=e.context??{},a=String(u.queue??u.store??u.name??e.source),l=i.projectName??u.project,d=typeof l=="string"&&l?l:void 0,c=e.source+":"+a,p=this.dataNodes.get(c),m=u.kind==="queue-state",f=u.kind==="fs-ops"?Ce(u.reads)+Ce(u.writes):m?0:1,h=new Set(p?.usedBy??[]);d&&h.add(d),this.dataNodes.set(c,{id:c,kind:e.source,name:a,viaProject:p?.viaProject??d??"unknown",usedBy:[...h].sort(),count:(p?.count??0)+f,lastSeenAt:e.timestamp,counts:m?u.counts:p?.counts,recent:m?u.recent:p?.recent}),this.opts.onChange?.();return}if(e.source!=="gateway")return;let t=e.raw??{},r=typeof t.kind=="string"?t.kind:"",n=e.timestamp;if(r==="gateway-up")this.gateway={at:n,ports:t.ports??[],routes:t.routes??[]};else if(r==="gateway-down")this.gateway&&(this.gateway={...this.gateway,ports:[]});else if(r==="gateway-traffic"){this.gateway||(this.gateway={at:n,ports:[],routes:[]}),this.gateway.aliveAt=n;let u=String(t.host??""),i=String(t.project??""),a=typeof t.caller=="string"?t.caller:void 0,l=(a?a+"\u21D2":"")+u+"\u2192"+i,d=this.edges.get(l);this.edges.set(l,{host:u,project:i,caller:a,count:(d?.count??0)+Ce(t.count),avgMs:Ce(t.avgMs),errors:(d?.errors??0)+Ce(t.errors),lastSeenAt:n})}else if(r.startsWith("service-")||r==="cold-start"||r==="autoscale"||r==="idle-kill"){let u=String(t.project??"");if(!u)return;let i=this.services.get(u),a={project:u,state:i?.state??"unknown",pods:i?.pods,lastColdStartMs:i?.lastColdStartMs,lastEventAt:n,lastEvent:e.title};r==="service-starting"&&(a.state="starting"),r==="service-up"&&(a.state="up",a.pods=Ce(t.pods??a.pods)),r==="cold-start"&&(a.state="up",a.pods=Ce(t.pods??a.pods),typeof t.durationMs=="number"&&(a.lastColdStartMs=t.durationMs)),r==="autoscale"&&(a.pods=Ce(t.to??a.pods)),(r==="service-down"||r==="idle-kill")&&(a.state="down",a.pods=0,r==="idle-kill"&&(a.idle=!0)),this.services.set(u,a)}this.recent.push({at:n,title:e.title,severity:e.severity}),this.recent.length>40&&this.recent.splice(0,this.recent.length-40),this.opts.onChange?.()}reducePodMemory(e){let t=es(e.raw);if(!t)return!1;let r=this.podMemory.get(t.project);r||(r=new Map,this.podMemory.set(t.project,r));let n=`${t.pod}:${t.pid}`;if(t.kind==="pod-memory-exited")r.delete(n);else{let u=r.get(n);if(!u&&(u={pod:t.pod,pid:t.pid,podGeneration:t.podGeneration??1,retained:new Map,lastSeenAt:e.timestamp},r.set(n,u),r.size>MI)){let i=[...r.entries()].sort((a,l)=>a[1].lastSeenAt-l[1].lastSeenAt)[0];i&&r.delete(i[0])}u.lastSeenAt=e.timestamp,t.kind==="pod-memory"?u.latest=t:t.kind==="pod-memory-retained"?u.retained.set(t.gen,{gen:t.gen,closedAt:Ce(t.closedAt)}):u.retained.delete(t.gen)}return this.opts.onChange?.(),!0}memoryOf(e,t,r){let n=this.podMemory.get(e);if(!n||n.size===0)return;let u=[...n.values()].filter(l=>l.latest?t.length===0?r-l.lastSeenAt<=30*6e4:t.includes(l.podGeneration>1?`child-${l.pod}-g${l.podGeneration}`:`child-${l.pod}`):!1);if(u.length===0)return;let i=u.reduce((l,d)=>(l.latest?.at??0)>=(d.latest?.at??0)?l:d),a=u.map(l=>l.latest?.baseline??(l.latest?.trigger==="boot"?l.latest.live:void 0)).filter(l=>typeof l=="number");return{live:u.reduce((l,d)=>l+Ce(d.latest?.live),0),reserved:u.reduce((l,d)=>l+Ce(d.latest?.reserved),0),rss:u.reduce((l,d)=>l+Ce(d.latest?.rss),0),...a.length?{baseline:Math.max(...a)}:{},swaps:Math.max(...u.map(l=>Ce(l.latest?.swaps))),pods:u.length,retained:u.flatMap(l=>[...l.retained.values()].map(d=>({pod:l.pod,gen:d.gen,ageMs:Math.max(0,r-d.closedAt)}))),at:Ce(i.latest?.at),trigger:String(i.latest?.trigger??""),...i.latest?.service?{service:i.latest.service}:{}}}discoverDecls(){if(Date.now()-this.declCache.at<1e4)return this.declCache.decls;let e=[],t,r=o((u,i)=>{if(i>4)return;let a;try{a=qE(u,{withFileTypes:!0})}catch{return}for(let l of a){if(l.name==="node_modules"||l.name.startsWith("."))continue;let d=`${u}/${l.name}`;if(l.isDirectory())r(d,i+1);else if(l.name==="project.json")try{let c=JSON.parse(Pu(d,"utf8")),p=c.targets??{};!t&&/cluster:trust$/.test(p.trust?.executor??"")&&(t=String(c.name??""));let m=c.cluster??c.davnx;if(!m)continue;let f=p["serve-hmr"]?.options?.internalPort,h=(p["serve-hmr"]?.options?.workers??[]).map(b=>b.name),g=typeof m.service=="string"?m.service:void 0;e.push({project:String(c.name??d),host:m.host,path:m.path,internalHost:m.internalHost,service:g,port:m.port,upstream:m.upstream,prependPrefix:m.prependPrefix,default:m.default,internalPort:f,workers:h,podNames:g?this.podNames(g):[],eager:m.eager,minPods:m.minPods,maxPods:m.maxPods,auth:m.auth})}catch{}}},"walk");r(this.opts.root,0);let n=WE(this.opts.root,e);if(n)for(let u of e)u.host&&(u.host=n(u.host)),typeof u.internalHost=="string"&&(u.internalHost=n(u.internalHost)??!1);return this.declCache={at:Date.now(),decls:e,...t?{trustProject:t}:{}},e}trustCommand(){return this.discoverDecls(),`yarn nx run ${this.declCache.trustProject||"gateway"}:trust`}podNames(e){try{return qE(this.opts.podSockDir(e)).filter(t=>t.endsWith(".sock")).map(t=>t.replace(".sock","")).sort()}catch{return[]}}hostsSetup(e){let t="";try{t=(this.opts.readHosts??(()=>Pu("/etc/hosts","utf8")))()}catch{}let r=t.split(`
79
+ `).map(i=>i.trim()).filter(i=>i&&!i.startsWith("#")).map(i=>i.split(/\s+/)),n=o((i,a)=>r.some(l=>l[0]===i&&l.slice(1).includes(a)),"has"),u=[];for(let i of e)i.host&&!i.host.includes("*")&&(u.push(i.host),i.service&&i.internalHost!==!1&&u.push(typeof i.internalHost=="string"?i.internalHost:`internal.${i.host}`));return[...new Set(u)].map(i=>({host:i,v4:n("127.0.0.1",i),v6:n("::1",i)}))}serviceKeyView(){let e;try{e=JSON.parse(Pu(GE(this.opts.root),"utf8"))}catch{return{}}let t={};for(let[r,n]of Object.entries(e))typeof n!="string"||n===""||(t[r]={fingerprint:NI("sha256").update(n).digest("hex").slice(0,12)});return t}liveDecls(){let e=this.discoverDecls();for(let t of e)t.service&&(t.podNames=this.podNames(t.service));return e}legacyView(){let e=this.liveDecls();return{at:Date.now(),gateway:this.gateway,decls:e,hostsSetup:this.hostsSetup(e),trustCommand:this.trustCommand(),serviceKeys:this.serviceKeyView(),services:[...this.services.values()].sort((t,r)=>t.project.localeCompare(r.project)),edges:[...this.edges.values()].sort((t,r)=>r.lastSeenAt-t.lastSeenAt),dataNodes:[...this.dataNodes.values()].sort((t,r)=>r.count-t.count).slice(0,24),recent:this.recent.slice(-20).reverse()}}gatewayLiveness(e=Date.now()){let t=this.opts.env??process.env,r=(t.LENSMCP_GATEWAY_PORTS??"").split(",").map(d=>Number(d.trim())).filter(d=>Number.isInteger(d)&&d>0),n=this.gateway?.ports??[],u=r.length?r:n,i=Number(t.LENSMCP_PARENT_PID??0);if(i>0)return aa(i)?{state:"live",role:"gateway-child",ports:u,since:this.gateway?.at,evidence:`served by the gateway process (pid ${i})`}:{state:"down",role:"gateway-child",ports:u,evidence:`the gateway that started this dashboard (pid ${i}) is gone`};if(n.length>0)return{state:"live",role:"standalone",ports:u,since:this.gateway?.at,evidence:"gateway-up event on this workspace\u2019s bus"};let a=this.registeredGateway(e);if(a)return{state:"live",role:"standalone",ports:u,evidence:`registered with the gateway daemon (pid ${a})`};let l=this.gateway?.aliveAt??0;return l>e-3e4?{state:"live",role:"standalone",ports:u,since:l,evidence:`gateway traffic ${Math.round((e-l)/1e3)}s ago`}:this.gateway?{state:"down",role:"standalone",ports:u,evidence:"no gateway traffic in the last 30s"}:{state:"unknown",role:"standalone",ports:u,evidence:"no gateway events seen \u2014 is this dashboard running without the gateway?"}}registeredGateway(e){if(e-this.registryCache.at<15e3)return this.registryCache.pid;let t;try{let r=`${(this.opts.env??process.env).LENSMCP_HOME||Sm()}/.lensmcp/workspaces.json`,n=JSON.parse(Pu(r,"utf8")),u=Array.isArray(n)?n.find(i=>i.root===this.opts.root):void 0;u&&typeof u.pid=="number"&&u.pid>0&&aa(u.pid)&&(!u.procStamp||jm(u.pid)===u.procStamp)&&(t=u.pid)}catch{}return this.registryCache={at:e,...t?{pid:t}:{}},t}view(e){let t=e.now??Date.now(),r=this.liveDecls(),n=this.hostsSetup(r),u=this.serviceKeyView(),i=new Map((e.processCluster?.services??[]).map(h=>[h.project,h])),a=new Map;for(let h of e.processCluster?.errors??[]){if(!h.project||!h.line)continue;let g=a.get(h.project)??[];g.push(h.line),a.set(h.project,g.slice(-6))}let l=[...this.edges.values()].filter(h=>!h.caller),d=r.map(h=>{let g=h.service?h.eager?"eager":"lazy":"web",b=this.services.get(h.project),x=i.get(h.project),$=(e.processCluster?.errors??[]).filter(H=>H.project===h.project&&H.fault!=="types"),w=x?.buildFailed===!0&&$.length>0&&$.every(H=>H.fault==="process"),{state:C,reason:k}=KE(g,b,x,h.podNames.length,w),M=l.filter(H=>H.project===h.project),y=M.reduce((H,ye)=>H+ye.count,0),D=M.reduce((H,ye)=>H+ye.errors,0),A=M.slice().sort((H,ye)=>ye.lastSeenAt-H.lastSeenAt)[0],j=e.kpis?.projectStats(h.project,t),N=h.service&&h.internalHost!==!1&&h.host?typeof h.internalHost=="string"?h.internalHost:`internal.${h.host}`:void 0,K=h.service?this.memoryOf(h.project,h.podNames,t):void 0;return{project:h.project,kind:g,state:C,...k?{stateReason:k}:{},...h.host?{host:h.host}:{},...h.path?{path:h.path}:{},...N?{internalHost:N}:{},...h.port!==void 0?{port:h.port}:{},...h.internalPort!==void 0?{internalPort:h.internalPort}:{},pods:{running:h.podNames.length,names:h.podNames,...h.minPods!==void 0?{min:h.minPods}:{},...h.maxPods!==void 0?{max:h.maxPods}:{}},workers:h.workers??[],...b?.lastColdStartMs!==void 0?{lastColdStartMs:b.lastColdStartMs}:{},restarts:x?.restarts??0,buildFailed:(x?.buildFailed??!1)&&!w,processError:w,typeErrors:x?.typeErrors??!1,errorLines:a.get(h.project)??[],...h.auth?{auth:{...h.auth.default?{default:h.auth.default}:{},overrides:h.auth.overrides?.length??0}}:{},traffic:{count:y,errors:D,avgMs:A?A.avgMs:null,...A?{lastSeenAt:A.lastSeenAt}:{}},...j?{window:j}:{},...u[h.project]?{keyFingerprint:u[h.project].fingerprint}:{},...K?{memory:K}:{},...b?{lastEvent:{at:b.lastEventAt,title:b.lastEvent}}:x?.lastTitle?{lastEvent:{at:x.lastSeenAt??0,title:x.lastTitle}}:{}}}).sort((h,g)=>VE[h.kind]-VE[g.kind]||h.project.localeCompare(g.project)),c=l.map(h=>({host:h.host,project:h.project,count:h.count,errors:h.errors,avgMs:h.avgMs,lastSeenAt:h.lastSeenAt})).sort((h,g)=>g.count-h.count);for(let h of r)h.host&&!c.some(g=>g.host===h.host&&g.project===h.project)&&c.push({host:h.host,project:h.project,count:0,errors:0,avgMs:null});let p=[...this.edges.values()].filter(h=>!!h.caller).map(h=>({caller:h.caller,callee:h.project,host:h.host,count:h.count,errors:h.errors,avgMs:h.avgMs,lastSeenAt:h.lastSeenAt})).sort((h,g)=>g.count-h.count),m=[...this.dataNodes.values()].filter(h=>h.kind!=="memory").map(h=>({id:h.id,kind:h.kind,name:h.name,usedBy:h.usedBy??(h.viaProject&&h.viaProject!=="unknown"?[h.viaProject]:[]),ops:h.count,lastSeenAt:h.lastSeenAt,...h.kind==="queue"&&(h.counts||h.recent)?{queue:{counts:h.counts??{},recent:(h.recent??[]).slice(0,8).map(g=>({id:String(g.id??""),...typeof g.name=="string"?{name:g.name}:{},...typeof g.state=="string"?{state:g.state}:typeof g.status=="string"?{state:g.status}:{},...typeof g.finishedOn=="number"?{at:g.finishedOn}:typeof g.timestamp=="number"?{at:g.timestamp}:{}}))}}:{}})).sort((h,g)=>g.ops-h.ops).slice(0,24),f=n.filter(h=>!h.v4||!h.v6);return{at:t,gateway:this.gatewayLiveness(t),services:d,routes:c,edges:p,backends:m,hosts:n,...f.length?{hostsFix:HE(f)}:{},trustCommand:this.trustCommand(),recent:this.recent.slice(-20).reverse(),...this.worktreeView(t)}}};function JE(e){let t=o(r=>{try{return UE("git",["-C",e,...r],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}).trim()||void 0}catch{return}},"git");return t(["symbolic-ref","--short","-q","HEAD"])??t(["rev-parse","--short","HEAD"])}s(JE,"OD"),o(JE,"gitBranch");function Fm(e,t=Sm()){let r=e.replace(/\/+$/,"").split("/").filter(Boolean),n=r.slice(-2).join("/");if(!n)return"/";let u=t!==""&&(e===t||e.startsWith(`${t}/`)),i=r.length>2;return u?i?`~/\u2026/${n}`:`~/${n}`:i?`\u2026/${n}`:`/${n}`}s(Fm,"ES"),o(Fm,"shortRoot");var VE={web:0,eager:1,lazy:2};function WE(e,t){let r;try{r=JSON.parse(Pu(kt(e,".lensmcp","config.json"),"utf8"))}catch{return}let n=r.instance?.name,u=r.instance?.baseKey;if(typeof n!="string"||!/^[a-z0-9](?:[a-z0-9-]{0,18}[a-z0-9])?$/.test(n)||typeof u!="string"||!u||r.key!==`${u}-${n}`)return;let i=typeof r.instance?.apex=="string"?r.instance.apex.toLowerCase():void 0,a=t.flatMap(p=>[...p.host?[p.host]:[],...typeof p.internalHost=="string"?[p.internalHost]:[]]).map(p=>p.toLowerCase().replace(/^\*\./,"").split(".").reverse()),l=[];for(let p=0;a.length>0;p++){let m=a[0]?.[p];if(m===void 0||!a.every(f=>f[p]===m))break;l.push(m)}let d=i??(l.length>=2?l.reverse().join("."):void 0);if(!d)return()=>{};let c=o(p=>{let m=p.toLowerCase();if(m.startsWith("*.")){let f=c(m.slice(2));return f===void 0?void 0:`*.${f}`}return m===d?`${n}.${d}`:m.endsWith(`.${d}`)?`${m.slice(0,-d.length)}${n}.${d}`:void 0},"rewrite");return c}s(WE,"zD"),o(WE,"instanceHostRewriter");function GE(e){let t=o((i,a)=>{try{return ZE(i)===a}catch{return!0}},"own"),r=e;try{r=ZE(e)}catch{}let n=kt(r,"node_modules"),u=t(kt(e,"node_modules"),n)&&t(kt(e,"node_modules",".cache"),kt(n,".cache"));return kt(e,...u?["node_modules",".cache"]:[".lensmcp","cache"],"davnx-webpack","service-keys.json")}s(GE,"MD"),o(GE,"serviceKeysFile");function jm(e){if(process.platform==="win32")return"";try{return UE("ps",["-p",String(e),"-o","lstart="],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}).trim()}catch{return""}}s(jm,"AS"),o(jm,"processStamp");function aa(e){if(process.ppid===e)return!0;try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}s(aa,"Wb"),o(aa,"pidAlive");function KE(e,t,r,n,u=!1){let i=r?.state;if(i==="crash-looping")return{state:"crash-looping",reason:"keeps exiting right after start"};if(i==="wedged")return{state:"wedged",reason:"running but not answering"};let a=i==="up"||t?.state==="up";return r?.buildFailed&&!a?{state:"down",reason:`${u?"a process error":"build failed"} \u2014 see the error lines`}:a?r?.buildFailed?{state:"up",reason:u?"reported a process error \u2014 see the error lines":"serving its last good build \u2014 the current build failed"}:{state:"up"}:i==="starting"||t?.state==="starting"?{state:"starting",reason:e==="lazy"?"cold start in progress":"starting"}:!i&&!t&&n>0?{state:"up",reason:`${n} pod socket${n===1?"":"s"} live`}:i==="idle"||t?.idle||e==="lazy"&&(i==="down"||t?.state==="down"||!t)?{state:"idle",reason:"scaled to zero \u2014 starts on the next request"}:i==="down"||t?.state==="down"?{state:"down",reason:"not running"}:{state:"unknown",reason:"no lifecycle events seen yet"}}s(KE,"ND"),o(KE,"serviceState");function HE(e){let t=e.filter(n=>!n.v4).map(n=>n.host),r=e.filter(n=>!n.v6).map(n=>n.host);return`printf '${[...t.length?[`127.0.0.1 ${t.join(" ")}`]:[],...r.length?[`::1 ${r.join(" ")}`]:[]].join("\\n")}\\n' | sudo tee -a /etc/hosts`}s(HE,"PD"),o(HE,"hostsFixCommand");var RI=class{static{s(this,"pc")}static{o(this,"LogRing")}constructor(e=5e3){this.cap=e,this.lines=[],this.seqN=0,this.sourceSet=new Set}get seq(){return this.seqN}get size(){return this.lines.length}sources(){return[...this.sourceSet].sort()}append(e){let t=XE(e,++this.seqN);return this.sourceSet.add(t.source),this.lines.push(t),this.lines.length>this.cap+Math.ceil(this.cap/10)&&this.lines.splice(0,this.lines.length-this.cap),t}since(e,t=this.cap){let r=this.indexAfter(e),n=this.lines.slice(r);return n.length>t?n.slice(n.length-t):n}recent(e){return this.lines.slice(Math.max(0,this.lines.length-e))}query(e){let t=e.limit??2e3,r=e.q?.toLowerCase(),n=e.since&&e.since>0?this.lines.slice(this.indexAfter(e.since)):this.lines,u=[];for(let i=n.length-1;i>=0&&u.length<t;i--){let a=n[i];e.flowId&&a.flowId!==e.flowId||e.from!==void 0&&a.at<e.from||e.to!==void 0&&a.at>e.to||r&&!`${a.title} ${a.message??""} ${a.source}`.toLowerCase().includes(r)||u.push(a)}return u.reverse()}indexAfter(e){let t=0,r=this.lines.length;for(;t<r;){let n=t+r>>>1;this.lines[n].seq<=e?t=n+1:r=n}return t}};function XE(e,t){let r=e.raw??{},n=e.context??{},u=typeof r.project=="string"&&r.project?r.project:e.source,i=typeof n.flowId=="string"?n.flowId:typeof n.traceId=="string"?n.traceId:void 0,a=r.request?.error?.stack,l=typeof r.text=="string"?r.text:typeof a=="string"?a:void 0;return{seq:t,at:e.timestamp,source:u,category:e.category,severity:e.severity,title:e.title,...e.message?{message:e.message}:{},...l&&l!==e.title?{detail:l}:{},...i?{flowId:i}:{}}}s(XE,"DD"),o(XE,"logLineOf");var YE=class{static{s(this,"Yo")}static{o(this,"SeenIds")}constructor(e=5e4){this.cap=e,this.set=new Set,this.order=[]}firstTime(e){if(!e)return!0;if(this.set.has(e))return!1;if(this.set.add(e),this.order.push(e),this.order.length>this.cap)for(let t of this.order.splice(0,this.order.length-this.cap))this.set.delete(t);return!0}},QE=class{static{s(this,"fc")}static{o(this,"Series")}constructor(e){this.horizonSec=e,this.buckets=new Map}bucket(e){let t=this.buckets.get(e);return t||(t={sec:e,count:0,errors:0,lat:[],latReq:[]},this.buckets.set(e,t)),t}addTraffic(e,t,r){let n=this.bucket(e);n.count+=t,n.errors+=r}addLatency(e,t,r){let n=this.bucket(e),u=r?n.lat:n.latReq;u.length<256&&u.push(t)}prune(e){for(let t of this.buckets.keys())t<=e-this.horizonSec&&this.buckets.delete(t)}range(e,t){let r=[];for(let n of this.buckets.values())n.sec>e&&n.sec<=t&&r.push(n);return r}},TI=class{static{s(this,"mc")}static{o(this,"KpiWindow")}constructor(e={}){this.byProject=new Map,this.windowSec=e.windowSec??300,this.sparkBuckets=e.sparkBuckets??30,this.sparkBucketSec=e.sparkBucketSec??10,this.horizonSec=Math.max(this.windowSec,this.sparkBuckets*this.sparkBucketSec)+5,this.global=new QE(this.horizonSec)}project(e){let t=this.byProject.get(e);return t||(t=new QE(this.horizonSec),this.byProject.set(e,t)),t}observe(e){if(e.source!=="gateway")return;let t=e.raw??{},r=t.kind,n=Math.floor(e.timestamp/1e3),u=typeof t.project=="string"?t.project:"",i=typeof t.caller=="string"&&t.caller?t.caller:void 0;if(r==="gateway-traffic"){let a=zm(t.count),l=zm(t.errors);if(a===0&&l===0)return;i||this.global.addTraffic(n,a,l),u&&this.project(u).addTraffic(n,a,l);let d=Array.isArray(t.durationsMs)?t.durationsMs:[];for(let c of d){let p=Number(c);!Number.isFinite(p)||p<0||(i||this.global.addLatency(n,p,!0),u&&this.project(u).addLatency(n,p,!0))}}else if(r==="gateway-request"){let a=Number(t.durationMs);if(!Number.isFinite(a)||a<0)return;i||this.global.addLatency(n,a,!1),u&&this.project(u).addLatency(n,a,!1)}}snapshot(e=Date.now()){let t=Math.floor(e/1e3);this.global.prune(t);for(let u of this.byProject.values())u.prune(t);let r=this.global,n=Om(r,t,this.sparkBuckets,this.sparkBucketSec);return{at:e,windowSec:this.windowSec,req60:Qt(r.range(t-60,t),"count"),last:Mm(r.range(t-this.windowSec,t)),sparkBucketSec:this.sparkBucketSec,spark:n}}projectStats(e,t=Date.now()){let r=this.byProject.get(e);if(!r)return;let n=Math.floor(t/1e3);return r.prune(n),{...Mm(r.range(n-this.windowSec,n)),req60:Qt(r.range(n-60,n),"count"),spark:Om(r,n,this.sparkBuckets,this.sparkBucketSec).req}}};function zm(e){let t=Number(e??0);return Number.isFinite(t)&&t>0?t:0}s(zm,"OS"),o(zm,"nonNeg");function Qt(e,t){let r=0;for(let n of e)r+=n[t];return r}s(Qt,"Sn"),o(Qt,"sum");function Nm(e){let t=[];for(let n of e)for(let u of n.lat)t.push(u);if(t.length)return{lat:t.sort((n,u)=>n-u),complete:!0};let r=[];for(let n of e)for(let u of n.latReq)r.push(u);return{lat:r.sort((n,u)=>n-u),complete:!1}}s(Nm,"NS"),o(Nm,"latencies");function Mm(e){let t=Qt(e,"count"),r=Qt(e,"errors"),{lat:n,complete:u}=Nm(e),i=n.length?n.reduce((a,l)=>a+l,0)/n.length:null;return{count:t,errors:r,errorRate:t>0?r/t:null,p50:oa(n,.5),p95:oa(n,.95),avgMs:i===null?null:Math.round(i),samples:n.length,sampled:!u||n.length<t}}s(Mm,"zS"),o(Mm,"statsOf");function oa(e,t){if(e.length===0)return null;let r=Math.min(e.length-1,Math.max(0,Math.ceil(t*e.length)-1));return Math.round(e[r])}s(oa,"Hb"),o(oa,"percentile");function Om(e,t,r,n){let u=[],i=[],a=[];for(let l=r-1;l>=0;l--){let d=t-l*n,c=e.range(d-n,d);u.push(Qt(c,"count")),i.push(Qt(c,"errors")),a.push(oa(Nm(c).lat,.95))}return{req:u,errors:i,p95:a}}s(Om,"MS"),o(Om,"sparkOf");var PI=class{static{s(this,"hc")}static{o(this,"FlowIndex")}constructor(e={flows:2e3,events:5e4},t=bt){this.caps=e,this.config=t,this.revs=new Map,this.pending=new Set,this.eventFlow=new Map,this.cache=new Map,this.evidenceCache=new Map}observe(e){let t=Rm(e);if(!t)return;let r=(this.revs.get(t)??0)+1;this.revs.delete(t),this.revs.set(t,r),this.revs.size>this.caps.flows&&this.revs.delete(this.revs.keys().next().value),this.pending.add(t),e.id&&(this.eventFlow.set(e.id,t),this.eventFlow.size>this.caps.events&&this.eventFlow.delete(this.eventFlow.keys().next().value))}rev(e){return this.revs.get(e)??0}drainRevs(){let e=[...this.pending].map(t=>({flowId:t,rev:this.rev(t)}));return this.pending.clear(),e}flowOfEvent(e){return this.eventFlow.get(e)}summaries(e,t=50){if(!e)return[];let r=[];for(let u of e.recentFlowIds().slice(0,t)){let i=this.rev(u),a=this.cache.get(u);if(a&&a.rev===i&&i>0){r.push(a.summary);continue}let l=e.getFlowSummary(u);if(!l)continue;let d=e.getFlowEvents(u)??[],c=e.analyzeFlow?.(u)??(d.length?as(d,this.config):void 0),p=sw(l,d,i,c);this.cache.set(u,{rev:i,summary:p}),r.push(p)}let n=new Set(r.map(u=>u.flowId));for(let u of this.cache.keys())n.has(u)||this.cache.delete(u);return r.sort((u,i)=>i.lastSeenAt-u.lastSeenAt)}evidence(e,t=50){let r=[];if(e){for(let n of e.recentFlowIds().slice(0,t)){let u=this.rev(n),i=this.evidenceCache.get(n);if(i&&i.rev===u&&u>0){r.push(...i.samples);continue}let a=ew(n,e.getFlowEvents(n)??[]);this.evidenceCache.set(n,{rev:u,samples:a}),r.push(...a)}if(this.evidenceCache.size>t*2){let n=new Set(e.recentFlowIds().slice(0,t));for(let u of this.evidenceCache.keys())n.has(u)||this.evidenceCache.delete(u)}}return new UI(r)}findByRoute(e,t,r){let n=la(r);return e.find(u=>u.request&&u.request.method===t&&n.test(u.request.path))?.flowId}};function ew(e,t){let r=[],n=new Map;for(let i of t){let a=i.raw??{};if(a.kind==="server-request"&&i.id){let l=a.request??{},d=uw(i)??(typeof l.requestId=="string"?l.requestId:void 0);if(!d)continue;let c=typeof l.endedAt=="number"?l.endedAt:tw(i),p=typeof l.startedAt=="number"?l.startedAt:c-(typeof l.durationMs=="number"?l.durationMs:0);n.set(d,[...n.get(d)??[],{id:i.id,start:p,end:c}])}}let u=o((i,a)=>{let l=i?n.get(i):void 0;if(l?.length)return l.length===1?l[0].id:l.filter(d=>d.start-5<=a&&a<=d.end+5).sort((d,c)=>c.start-d.start)[0]?.id},"handlerAt");for(let i of t){if(!i.id)continue;let a=i.raw??{},l=tw(i),d=o(p=>typeof p=="number"&&Number.isFinite(p)?p:0,"num"),c=a.kind;if(c==="server-request"){let p=a.request??{};if(typeof p.route!="string")continue;r.push({key:`route:${String(p.method??"GET")} ${p.route}`,flowId:e,eventId:i.id,ms:d(p.durationMs),at:l,failed:d(p.status)>=500})}else if(c==="db-query"&&typeof a.project=="string"){let p=`${String(a.op??"query")} ${String(a.table??"")}`.trim(),m=i.title.replace(/\s*\(.*$/,"").trim();for(let f of new Set([p,m]))r.push({key:`sql:${a.project}:${f}`,flowId:e,eventId:i.id,ms:d(a.durationMs),at:l,failed:i.severity==="error"})}else if(c==="egress"&&typeof a.project=="string"&&typeof a.host=="string"){let p=typeof a.error=="string"||d(a.status)>=500||i.severity==="error";r.push({key:`egress:${a.project}:${a.host}`,flowId:e,eventId:i.id,ms:d(a.durationMs),at:l,failed:p})}else if(c==="memory-mutation"){let p=(a.mutation??{}).ownerNodeId;if(typeof p!="string")continue;r.push({key:`mem:${p}`,flowId:e,eventId:u(uw(i),l)??i.id,ms:0,at:l,failed:!1})}}return r}s(ew,"CD"),o(ew,"evidenceSamples");var tw=o(e=>typeof e.timestamp=="number"?e.timestamp:Date.parse(String(e.timestamp))||0,"tsOf"),uw=o(e=>{let t=e.context??{};return typeof t.requestId=="string"&&t.requestId?t.requestId:void 0},"requestIdOf"),UI=class{static{s(this,"Xb")}static{o(this,"EvidenceLookup")}constructor(e){this.samples=e}find(e,t,r={}){let n;for(let u of this.samples)!e(u.key)||r.inFlow!==void 0&&u.flowId!==r.inFlow||t==="failing"&&!u.failed||r.minMs!==void 0&&u.ms<r.minMs||(n?(t==="slowest"?u.ms>n.ms||u.ms===n.ms&&u.at>n.at:u.at>n.at)&&(n=u):n=u);return n?{flowId:n.flowId,nodeId:n.eventId}:void 0}};function Rm(e){let t=e.context??{};return typeof t.flowId=="string"&&t.flowId?t.flowId:void 0}s(Rm,"Yb"),o(Rm,"flowIdOf");function la(e){let t=e.split("/").map(r=>r.startsWith(":")?"[^/?#]+":r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("/");return new RegExp(`^${t}(?:[?#].*)?$`)}s(la,"gc"),o(la,"routeRegex");var qI=new Set(["memory-mutation","memory-retention","singleton-instance","subscription-added","subscription-removed","store-created","hook-run"]),ZI={"user-click":"click","user-input":"input","input-change":"input",keyboard:"key press","route-load":"navigate","page-load":"page load","form-submit":"submit",effect:"effect",timer:"timer","websocket-message":"socket message","backend-response":"response","hmr-update":"hot reload","ai-turn":"AI turn"};function rw(e){return e?ZI[e]??e.replace(/-/g," "):"request"}s(rw,"FD"),o(rw,"originLabelOf");function nw(e){if(!e)return;if(e.startsWith("page:"))return e.slice(5)||"/";let t=/([^/:]+\.[cm]?[jt]sx?):(\d+)/.exec(e);if(t)return`${t[1]}:${t[2]}`;let r=e.replace(/^[a-z]+:/,"");return r.length>40?"\u2026"+r.slice(-39):r}s(nw,"BD"),o(nw,"originWhereOf");function iw(e){let t=rs.indexOf(e);return t===-1?rs.length:t}s(iw,"qD"),o(iw,"categoryRankOf");function sw(e,t,r,n){let u={},i=new Set,a="ok",l,d=1/0,c,p=1/0,m=1/0,f=-1/0,h=new Set,g=0,b=0,x,$=o(j=>{(j==="error"||j==="warn"&&a==="ok")&&(a=j)},"bump");for(let j of t){let N=j.raw??{},K=j.context??{},H=typeof N.kind=="string"?N.kind:void 0,ye=Ad({source:j.source,category:j.category,title:j.title,kind:H});u[ye]=(u[ye]??0)+1;let Ze=typeof N.project=="string"?N.project:typeof K.projectName=="string"?K.projectName:void 0;Ze&&j.source!=="gateway"&&i.add(Ze),j.severity==="error"||j.severity==="fatal"?($("error"),b++,(!x||j.timestamp<x.at)&&(x={at:j.timestamp,title:j.title})):j.severity==="warning"&&$("warn");let Ve=Number(N.status??N.request?.status);if(Number.isFinite(Ve)&&(Ve>=500?$("error"):Ve>=400&&$("warn")),(H==="fetch-start"||H==="fetch-done"||H==="fetch-error")&&typeof N.url=="string"){let Oe=Number(N.startedAt??j.timestamp);(Oe<d||Oe===d&&l&&l.status===void 0)&&(d=Oe,l={method:String(N.method??"GET"),path:N.url,...Number.isFinite(Ve)?{status:Ve}:l?.status!==void 0?{status:l.status}:{}})}if(h.size<80)if(H==="gateway-request"&&typeof N.url=="string")h.add(`${String(N.method??"GET")} ${Tm(N.url)}`);else if(H==="server-request"){let Oe=N.request??{};typeof Oe.route=="string"&&h.add(`${String(Oe.method??"GET")} ${Oe.route}`)}else H==="db-query"&&Ze?h.add(`sql:${Ze}:${j.title.replace(/\s*\(.*$/,"")}`):H==="egress"&&Ze&&typeof N.host=="string"&&h.add(`egress:${Ze}:${N.host}`);if(H==="gateway-request"&&!N.caller&&j.source==="gateway"&&g++,H==="gateway-request"&&!N.caller&&typeof N.url=="string"&&j.timestamp<p&&(p=j.timestamp,c={method:String(N.method??"GET"),path:N.url,...Number.isFinite(Ve)?{status:Ve}:{}}),H&&qI.has(H))continue;let It=Number(N.durationMs??N.request?.durationMs??0),tt=Number(N.startedAt),In=Number.isFinite(tt)&&tt>0?tt:j.timestamp-(Number.isFinite(It)?It:0),Vu=Number.isFinite(tt)&&tt>0&&Number.isFinite(It)?tt+It:j.timestamp;In<m&&(m=In),Vu>f&&(f=Vu)}!l&&c&&(l=c);let w=rw(e.originType),C=nw(e.originNodeId),k=l?`${l.method} ${Tm(l.path)}`:void 0,M=e.headline&&e.headline!==e.originType?e.headline:void 0,y=!e.originType&&g>1?` +${g-1} more request${g===2?"":"s"}`:"",D=e.originType?`${w}${C?` \xB7 ${C}`:""}`:k?`${k}${y}`:M??w,A=e.originType&&k?`${D} \u2192 ${k}`:D;return{flowId:e.flowId,...e.originType?{originType:e.originType}:{},...e.originNodeId?{originNodeId:e.originNodeId}:{},startedAt:e.startedAt,lastSeenAt:e.lastSeenAt,eventCount:e.eventCount,headline:A,originLabel:w,...C?{originWhere:C}:{},...l?{request:l}:{},worst:a,durationMs:Number.isFinite(m)&&f>=m?Math.round(f-m):0,lanes:u,projects:[...i].sort(),rev:r,...g?{requestCount:g}:{},...b?{errorCount:b,firstError:ow(x.title)}:{},...h.size?{touches:[...h]}:{},...n?aw(n):{}}}s(sw,"ZD"),o(sw,"summarizeFlow");function aw(e){let t=e.classification,r=e.segmentation.stats;return{category:t.category,categoryRank:iw(t.category),decidedBy:t.decidedBy,...t.subject?{subject:t.subject}:{},tags:t.tags,segmentCount:r.segments,phaseCount:r.phases,signalCount:r.signal}}s(aw,"VD"),o(aw,"analysisFields");function ow(e){return e.replace(/\s*✗\s*$/,"").replace(/\s*\((?:\d+ rows?, )?[\d.]+ ?ms\)$/,"")}s(ow,"GD"),o(ow,"cleanTitle");function Tm(e){let t=e.indexOf("?");return t>=0?e.slice(0,t):e}s(Tm,"CS"),o(Tm,"stripQuery");function Pm(e,t){return{id:e.id,kind:e.kind,label:e.label,phase:e.phase,start:e.start,end:e.end,durationMs:e.durationMs,counts:e.counts,projects:e.projects,...e.method?{method:e.method}:{},...e.route?{route:e.route}:{},...e.requestId?{requestId:e.requestId}:{},...e.after?{after:e.after}:{},...e.hot?{hot:e.hot}:{},...e.part?{part:e.part}:{},worstSeverity:e.worstSeverity,category:t}}s(Pm,"US"),o(Pm,"toDashSegment");function lw(e,t,r){if(!e)return{flowId:t,summary:null,events:[],rev:r.rev};let n=e.getFlowSummary(t)??null,u=e.getFlowEvents(t)??[],i=e.analyzeFlow?.(t)??(u.length?as(u,r.config??bt):void 0),a,l=u;if(r.segmentId!==void 0){a=i?.segmentation.segments.find(g=>g.id===r.segmentId);let h=new Set(a?.eventIds??[]);l=u.filter(g=>h.has(g.id))}let d=us(l,{includeRaw:r.includeRaw===!0}),c={flowId:t,summary:n,...d,rev:r.rev};if(!i)return c;let p=i.segmentation.assignment;c.events=c.events.map(h=>{let g=p[h.id]??(h.memberIds?.[0]?p[h.memberIds[0]]:void 0);return g?{...h,segmentId:g}:h});let m=o(h=>i.segmentCategories[h.id]??"other","category");c.segments=i.segmentation.segments.map(h=>Pm(h,m(h))),c.phases=i.segmentation.phases,c.segmentCategories=i.segmentCategories,c.segmentStats=i.segmentation.stats;let f=i.classification;return c.classification={category:f.category,decidedBy:f.decidedBy,...f.ruleIndex!==void 0?{ruleIndex:f.ruleIndex}:{},...f.subject?{subject:f.subject}:{},tags:f.tags,origin:f.origin},a&&(c.focus=Pm(a,m(a))),c}s(lw,"LS"),o(lw,"flowDetailPayload");var LI=300,JI=1e3,dw=20,cw=30,VI=1500,we=o(e=>e&&typeof e=="object"?e:{},"obj"),P=o(e=>typeof e=="string"&&e?e:void 0,"str"),ve=o(e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,"num"),WI=class{static{s(this,"bc")}static{o(this,"ErrorLog")}constructor(e=Date.now){this.now=e,this.groups=new Map,this.pending=[],this.byRequest=new Map,this.projectOfRequest=new Map,this.seen=new Set,this.dismissals=new Map,this.changed=!1}observe(e){if(e.id){if(this.seen.has(e.id))return!1;this.seen.add(e.id),this.seen.size>2e4&&this.seen.delete(this.seen.values().next().value)}let t=kd(e);if(t)return this.dismissals.delete(t.groupId),t.kind===xu&&(this.dismissals.set(t.groupId,{until:t.until,at:e.timestamp,eventIds:new Set(t.eventIds),...t.by?{by:t.by}:{},...t.reason?{reason:t.reason}:{}}),this.dismissals.size>JI&&this.dismissals.delete(this.dismissals.keys().next().value)),this.changed=!0,!0;let r=we(e.raw),n=we(e.context),u=P(r.kind),i=P(n.requestId);u==="gateway-request"&&i&&P(r.project)&&(this.projectOfRequest.set(i,P(r.project)),this.projectOfRequest.size>5e3&&this.projectOfRequest.delete(this.projectOfRequest.keys().next().value));let a=e.severity==="error"||e.severity==="fatal",l=we(r.request),d=ve(r.status)??ve(l.status);return u==="server-request"&&(a||(d??0)>=500)?this.defer(e,"server"):e.source==="client-runtime"&&a&&(u==="error"||u==="unhandledrejection"||u==="resource-error"||u==="console")?this.browser(e,r,n):u==="egress"&&(P(r.error)||(d??0)>=500)?this.external(e,r,n,d):u==="queue-failed"?this.queue(e,r,n):u==="span"&&a?this.defer(e,"span"):u==="gateway-request"&&((d??0)>=500||d===0)?this.defer(e,"gateway"):u==="fetch-done"&&(d??0)>=500||u==="fetch-error"?this.defer(e,"fetch"):u==="log"&&a&&(e.source==="nestjs"||e.source==="nest")?this.defer(e,"log"):!1}flush(e=!1){let t=this.now(),r=o(a=>e||t-a.arrivedAt>=VI,"ready"),n=o(a=>P(we(a.event.context).requestId),"requestOf");for(let a of this.pending.filter(l=>l.kind==="server"&&r(l))){this.pending.splice(this.pending.indexOf(a),1);let l=we(a.event.raw);this.server(a.event,l,we(l.request),we(a.event.context))}let u=new Set(this.pending.filter(a=>a.kind==="server").map(n).filter(Boolean));for(let a of this.pending.filter(l=>l.kind!=="server"&&r(l)&&!(n(l)&&u.has(n(l)))))this.pending.splice(this.pending.indexOf(a),1),this.settle(a);let i=this.changed;return this.changed=!1,i}snapshot(e=[],t=15*6e4){let r=this.now(),n=Math.floor(r/6e4),u=[...this.groups.values()].map(c=>{let p=[];for(let b=n-cw+1;b<=n;b++)p.push(c.perMinute.get(b)??0);let{flows:m,perMinute:f,eventIds:h,...g}=c;return{...g,occurrences:[...g.occurrences],flowCount:m.size,spark:p}}),i=this.hiddenEvents(),a=[],l=[];for(let c of[...e,...u].sort((p,m)=>+!!m.ongoing-+!!p.ongoing||m.lastSeenAt-p.lastSeenAt)){let p=this.dismissalOf(c,i);p?l.push({...c,dismissedAt:p.at,...p.by?{dismissedBy:p.by}:{},...p.reason?{dismissedReason:p.reason}:{}}):a.push(c)}let d=a.filter(c=>c.ongoing||r-c.lastSeenAt<=t);return{at:r,recentMs:t,groups:a,recentGroups:d.length,recentOccurrences:d.reduce((c,p)=>c+(p.ongoing?1:p.occurrences.filter(m=>r-m.at<=t).length),0),dismissed:l}}hiddenEvents(){let e=new Map;for(let t of this.dismissals.values())for(let r of t.eventIds)(e.get(r)?.at??-1)<=t.at&&e.set(r,t);return e}dismissalOf(e,t){let r=this.dismissals.get(e.id);if(r&&e.lastSeenAt<=r.until)return r;let n=this.groups.get(e.id)?.eventIds,u=n?.[n.length-1];return u===void 0?void 0:t.get(u)}dismissalsFor(e,t=[],r=this.now()){let n=[];for(let u of new Set(e)){let i=this.groups.get(u),a=i??t.find(l=>l.id===u);a&&n.push({groupId:u,until:Math.max(r,a.lastSeenAt),eventIds:i?i.eventIds.slice():[],by:"dashboard",title:a.title})}return n}restorable(e){let t=new Set;for(let r of new Set(e)){this.dismissals.has(r)&&t.add(r);let n=this.groups.get(r)?.eventIds??[];for(let[u,i]of this.dismissals)n.some(a=>i.eventIds.has(a))&&t.add(u)}return[...t]}server(e,t,r,n){let u=P(n.requestId)??P(r.requestId),i=P(n.projectName)??P(t.project)??(u?this.projectOfRequest.get(u):void 0),a=P(r.method)??"GET",l=P(r.route)??"?",d=ve(r.status)??ve(t.status),c=we(r.error),p=P(c.message)??P(e.message),m=P(c.name),f=`${a} ${l}${d?` \u2192 ${d}`:""}`,h=`server:${i??"?"}:${a} ${l}:${d??""}:${m??""}:${eu(p)}`,g=this.record(h,"server",e,{title:f,...i?{where:i,project:i}:{},...p?{message:p}:{},...P(c.stack)?{stack:Dn(P(c.stack))}:{},...d!==void 0?{status:d}:{}},u,d);return u&&this.byRequest.set(u,{group:this.groups.get(h),occ:g}),this.trimRequests(),!0}browser(e,t,r){let n=P(t.message)??e.title,u=P(r.url)??P(r.route),i=`browser:${P(t.kind)}:${eu(n)}`;return this.record(i,"browser",e,{title:n.split(`
80
+ `)[0].slice(0,160),...u?{where:pw(u)}:{},message:n,...P(t.stack)?{stack:Dn(P(t.stack))}:{}},P(r.requestId)),!0}external(e,t,r,n){let u=P(t.project)??P(r.projectName),i=P(t.host)??"?",a=P(t.method)??"GET",l=P(t.path)??"",d=P(t.error),c=n?String(n):d??"failed",p=`external:${u??"?"}:${i}:${a} ${Uu(l)}:${n??eu(d)}`;return this.record(p,"external",e,{title:`${a} ${i}${Uu(l)} \u2192 ${c}`,where:`${u??"?"} \u2192 ${i}`,...u?{project:u}:{},...d?{message:d}:{},...n?{status:n}:{}},P(r.requestId),n),!0}queue(e,t,r){let n=P(t.queue)??"?",u=P(t.failedReason)??P(t.error)??e.message,i=P(t.project)??P(r.projectName),a=`queue:${n}:${P(t.name)??""}:${eu(u)}`;return this.record(a,"queue",e,{title:`Job ${P(t.name)??""} failed on ${n}`.replace(/\s+/g," "),where:i?`${i} \xB7 ${n}`:n,...i?{project:i}:{},...u?{message:u}:{},...P(t.stack)?{stack:Dn(P(t.stack))}:{}},P(r.requestId)),!0}defer(e,t){return this.pending.push({event:e,kind:t,arrivedAt:this.now()}),this.pending.length>2e3&&this.pending.splice(0,this.pending.length-2e3),!1}settle(e){let t=e.event,r=we(t.raw),n=we(t.context),u=P(n.requestId),i=u?this.byRequest.get(u):void 0;if(i){e.kind==="span"&&!i.occ.stepId&&(i.occ.stepId=t.id),!i.occ.flowId&&P(n.flowId)&&(i.occ.flowId=P(n.flowId)),this.changed=!0;return}if(e.kind==="log"){let b=P(r.project)??P(n.projectName);if([...this.groups.values()].some(w=>w.kind==="server"&&(w.project===b||!w.project)&&Math.abs(w.lastSeenAt-t.timestamp)<3e3))return;let x=we(we(r.request).error),$=Zm(P(x.message)??t.title);this.record(`log:${b??"?"}:${eu($)}`,"log",t,{title:$.split(`
81
+ `)[0].slice(0,160),...b?{where:b,project:b}:{},message:$,...P(x.stack)?{stack:Dn(Zm(P(x.stack)))}:{}},u);return}if(e.kind==="span"){let b=we(r.span),x=P(b.name)??t.title.replace(/\s*\(\d+ms\)\s*✗?$/,""),$=P(n.projectName)??(u?this.projectOfRequest.get(u):void 0),w=P(t.message)??P(we(b.error).message),C=this.record(`exception:${$??"?"}:${x}:${eu(w)}`,"exception",t,{title:`${x} threw${w?`: ${w.split(`
82
+ `)[0].slice(0,100)}`:""}`,...$?{where:$,project:$}:{},...w?{message:w}:{}},u);u&&this.byRequest.set(u,{group:[...this.groups.values()].find(k=>k.occurrences.includes(C)),occ:C});return}let a=ve(r.status),l=P(r.method)??"GET",d=P(r.url)??"?",c=P(r.project),p=P(r.host),m=e.kind==="fetch"&&!a?"network error":String(a??"failed"),f=e.kind==="gateway"?`${l} ${p??""}${Uu(d)} \u2192 ${m}`:`${l} ${Uu(d)} \u2192 ${m}`,h=`request:${e.kind}:${c??p??""}:${l} ${Uu(d)}:${m}`,g=this.record(h,"request",t,{title:f,where:e.kind==="gateway"?`gateway \u2192 ${c??p??"?"}`:"browser",...c?{project:c}:{},...a!==void 0?{status:a}:{},...e.kind==="gateway"?{message:mw(r,a)}:{}},u,a);u&&this.byRequest.set(u,{group:this.groups.get(h),occ:g})}record(e,t,r,n,u,i){let a=we(r.context),l=P(a.flowId),d=this.groups.get(e);d||(d={id:e,kind:t,...n,count:0,firstSeenAt:r.timestamp,lastSeenAt:r.timestamp,occurrences:[],flows:new Set,perMinute:new Map,eventIds:[]},this.groups.set(e,d),this.evict()),d.count+=1,d.eventIds.push(r.id),d.eventIds.length>200&&d.eventIds.shift(),d.firstSeenAt=Math.min(d.firstSeenAt,r.timestamp),r.timestamp>=d.lastSeenAt&&(d.lastSeenAt=r.timestamp,n.stack&&(d.stack=n.stack),n.message&&(d.message=n.message)),l&&d.flows.add(l);let c=Math.floor(r.timestamp/6e4);d.perMinute.set(c,(d.perMinute.get(c)??0)+1);for(let m of d.perMinute.keys())m<c-cw&&d.perMinute.delete(m);let p={id:r.id,at:r.timestamp,...l?{flowId:l}:{},...u?{requestId:u}:{},...i!==void 0?{status:i}:{}};return d.occurrences.unshift(p),d.occurrences.sort((m,f)=>f.at-m.at),d.occurrences.length>dw&&(d.occurrences.length=dw),this.changed=!0,p}evict(){if(this.groups.size<=LI)return;let e=[...this.groups.values()].sort((t,r)=>t.lastSeenAt-r.lastSeenAt)[0];e&&this.groups.delete(e.id)}trimRequests(){this.byRequest.size>5e3&&this.byRequest.delete(this.byRequest.keys().next().value)}};function Um(e,t,r){if(t==="crash-looping")return{kind:"service",title:`${e} keeps crashing`,serving:!1};if(t==="wedged")return{kind:"service",title:`${e} is not answering`,serving:!1};let n=r.length>0&&r.every(i=>i.fault==="process"),u=t==="up";return{kind:u?n?"log":"build":"service",title:n?`${e} reported a process error`:`${e} failed to build`,serving:u}}s(Um,"Qb"),o(Um,"describeServiceFault");function qm(e,t=Date.now()){let r=[],n=o((c,p=!0)=>({...c,count:c.count??1,firstSeenAt:c.at??t,lastSeenAt:c.at??t,occurrences:[],flowCount:0,spark:[],...p?{ongoing:!0}:{}}),"base"),u=o(c=>{let p=new Map;for(let m of da(we(e[c]).errors))p.set(P(m.project)??"workspace",[...p.get(P(m.project)??"workspace")??[],m]);return p},"grouped"),i=u("typecheck://errors"),a=u("lint://errors");for(let c of da(we(e["build://failures"]).failures)){let p=c.domain==="typecheck"||c.domain==="lint"?c.domain:"build",m=P(c.project)??"workspace";p==="typecheck"&&i.has(m)||p==="lint"&&a.has(m)||r.push(n({id:`build:${P(c.fingerprint)??P(c.message)??"?"}`,kind:p,title:`${p==="typecheck"?"Type error":p==="lint"?"Lint error":"Build error"}${P(c.project)?` in ${P(c.project)}`:""}`,...P(c.file)?{where:P(c.file)}:{},...P(c.project)?{project:P(c.project)}:{},...P(c.message)?{message:P(c.message)}:{},resource:"build://failures",...ve(c.timestamp)!==void 0?{at:ve(c.timestamp)}:{}}))}for(let[c,p]of i){let m=p[0];r.push(n({id:`typecheck:${c}`,kind:"typecheck",title:`${p.length} type error${p.length===1?"":"s"} in ${c}`,where:[P(m.file),ve(m.line)].filter(f=>f!==void 0).join(":")||c,project:c,message:p.slice(0,5).map(f=>`${P(f.file)??""}${ve(f.line)!==void 0?`:${ve(f.line)}`:""} ${P(f.code)??""} ${P(f.message)??""}`.trim()).join(`
83
+ `),count:p.length,resource:"typecheck://errors",at:Math.max(...p.map(f=>ve(f.timestamp)??0))||t}))}for(let[c,p]of a){let m=p[0]??{};r.push(n({id:`lint:${c}`,kind:"lint",title:`${p.length} lint error${p.length===1?"":"s"} in ${c}`,where:[P(m.file),ve(m.line)].filter(f=>f!==void 0).join(":")||c,project:c,message:p.slice(0,5).map(f=>`${P(f.file)??""}${ve(f.line)!==void 0?`:${ve(f.line)}`:""} ${P(f.rule)??""} ${P(f.message)??""}`.trim()).join(`
84
+ `),count:p.length,resource:"lint://errors",at:Math.max(...p.map(f=>ve(f.timestamp)??0))||t},!1))}let l=we(e["process://cluster"]),d=da(l.errors);for(let c of da(l.services)){let p=P(c.state),m=P(c.project)??"?",f=d.filter($=>$.project===m),h=o($=>$.map(w=>P(w.line)).filter(Boolean),"text");if(c.typeErrors===!0&&!i.has(m)){let $=h(f.filter(w=>w.fault==="types"));r.push(n({id:`typecheck:${m}`,kind:"typecheck",title:`Type errors in ${m}`,where:m,project:m,...$.length?{message:$.slice(-6).join(`
85
+ `)}:{},resource:"process://cluster",...ve(c.lastSeenAt)!==void 0?{at:ve(c.lastSeenAt)}:{}}))}if(p!=="crash-looping"&&p!=="wedged"&&c.buildFailed!==!0)continue;let g=f.filter($=>$.fault!=="types"),b=h(g),x=Um(m,p,g);r.push(n({id:`service:${m}:${p}`,kind:x.kind,title:x.title,where:x.serving?`${m} \u2014 still serving its last good build`:m,project:m,...b.length?{message:b.slice(-6).join(`
86
+ `)}:P(c.lastTitle)?{message:P(c.lastTitle)}:{},resource:"process://cluster",...ve(c.lastSeenAt)!==void 0?{at:ve(c.lastSeenAt)}:{}}))}return r}s(qm,"ew"),o(qm,"standingErrors");var da=o(e=>Array.isArray(e)?e.filter(t=>t&&typeof t=="object"):[],"arr");function eu(e){return e?e.split(`
87
+ `)[0].replace(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,"<id>").replace(/\b[0-9A-HJKMNP-TV-Z]{26}\b/g,"<id>").replace(/0x[0-9a-f]+/gi,"<hex>").replace(/\d+/g,"#").slice(0,140):""}s(eu,"In"),o(eu,"norm");function Uu(e){let t=(e.split("?")[0]??e).split("/");return t.map((r,n)=>{let u=t[n-1]??"";return/^\d+$/.test(r)&&!(/^(?:api|v)$/i.test(u)&&r.length<=2)||/^[0-9a-f]{16,}$/i.test(r)||/^[0-9a-f]{8}-[0-9a-f-]{27}$/i.test(r)?":id":r}).join("/")}s(Uu,"Qo"),o(Uu,"routeShape");function pw(e){try{return new URL(e).pathname}catch{return e}}s(pw,"HD"),o(pw,"pagePath");function Dn(e){let t=e.split(`
88
+ `),r=t[0]??"",n=t.slice(1).filter(a=>/^\s*at /.test(a)),u=n.filter(a=>!/node_modules|node:internal|node:async_hooks|\(native\)|<anonymous>/.test(a)),i=(u.length?u:n).slice(0,8);return[r,...i].join(`
89
+ `)}s(Dn,"yc"),o(Dn,"appFrames");function Zm(e){return e.replace(/^\[Nest\]\s+\d+\s+-\s+[^A-Z]*?\s+(?:ERROR|WARN)\s+(?:\[[^\]]+\]\s+)?/,"")}s(Zm,"qS"),o(Zm,"stripNestPrefix");function mw(e,t){let r=Array.isArray(e.steps)?e.steps:[],n=r[r.length-1],u=n?P(n.step):void 0;return t===503?`the gateway answered 503${u?` after "${u}"`:""} \u2014 the service did not become ready (cold start or crash)`:t===502?"the gateway could not reach the service (502)":t===504?"the service did not answer in time (504)":`the gateway answered ${t??"with a failure"}${u?` after "${u}"`:""}`}s(mw,"XD"),o(mw,"gatewayReason");var fw=["graph://patterns","perf://slow-routes","perf://duplicate-requests","db://slow-queries","db://analysis","memory://leaks/suspected","memory://owners/growing","memory://current","react://components/hot","runtime://errors","runtime://browser/errors","trace://failed","net://egress/hosts","typecheck://current","typecheck://errors","build://current","build://failures","lint://current","process://cluster","visual://violations/current","perf://rules"],oe=o(e=>e&&typeof e=="object"?e:{},"obj"),ce=o(e=>Array.isArray(e)?e.filter(t=>t&&typeof t=="object"):[],"arr"),z=o(e=>typeof e=="string"&&e?e:void 0,"str"),R=o(e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,"num");function hw(e){let t=e.resources,r=[],n=o(y=>{for(let D of y){let A=e.flowOfEvent(D);if(A)return{flowId:A,nodeId:D,eventIds:y.slice(0,50)}}return y.length?{eventIds:y.slice(0,50)}:void 0},"evidenceOf"),u=o((y,D)=>{let A=la(D),j=o(N=>N.startsWith(`${y} `)&&A.test(N.slice(y.length+1)),"hit");return e.flows.find(N=>N.request&&N.request.method===y&&A.test(N.request.path)||N.touches?.some(j))?.flowId},"flowForRoute"),i=o(y=>e.flows.find(D=>D.touches?.includes(y))?.flowId,"flowTouching"),a=o((y,D)=>y?{flowId:y.flowId,nodeId:y.nodeId}:D?{flowId:D}:void 0,"at"),l=o((y,D)=>{let A=la(D),j=`route:${y} `;return N=>N.startsWith(j)&&(N.slice(j.length)===D||A.test(N.slice(j.length)))},"routeKey");for(let y of ce(oe(t["graph://patterns"]).patterns)){let D=z(y.kind),A=oe(y.details),j=(Array.isArray(y.evidence)?y.evidence:[]).filter(ye=>typeof ye=="string"),N=z(y.title)??D??"pattern",K=D==="n+1-query"?"n-plus-one":D==="db-in-loop"?"db-in-loop":D==="render-storm"?"render-storm":D==="slow-path"?"slow-path":D==="leak"?"leak":"other",H=z(A.signature)??z(A.componentInstanceId)??N;r.push({id:`graph:${D}:${H}`,kind:K,severity:y.severity==="error"?"high":"medium",title:N,...z(A.signature)?{code:z(A.signature)}:{},...K==="render-storm"&&z(A.componentInstanceId)?{where:Lm(z(A.componentInstanceId))}:{},detail:Bw(K,A),...R(A.count)!==void 0?{count:R(A.count)}:R(A.dbCallsInsideLoop)!==void 0?{count:R(A.dbCallsInsideLoop)}:{},evidence:n(j),resource:"graph://patterns",at:R(y.detectedAt)})}let d=oe(t["perf://slow-routes"]),c=R(d.thresholdMs)??500;for(let y of ce(d.routes)){let D=z(y.method)??"GET",A=z(y.route)??"?",j=R(y.worstRecentMs)??0,N=a(e.evidence?.find(l(D,A),"latest",{minMs:c})??e.evidence?.find(l(D,A),"slowest"),u(D,A));r.push({id:`perf:slow-route:${D} ${A}`,kind:"slow-route",severity:j>=c*3?"high":"medium",title:`${D} ${A} is slow`,where:`${D} ${A}`,detail:`worst ${Ue(j)} recently \u2014 ${R(y.recentSlowSamples)??0} of the last ${Math.min(R(y.samples)??0,R(d.recentSampleWindow)??20)} calls over the ${Ue(c)} budget (last call ${Ue(R(y.lastDurationMs)??0)})`,count:R(y.slowSamples),...N?{evidence:N}:{},resource:"perf://slow-routes",at:R(y.lastSeenAt)})}for(let y of ce(oe(t["perf://duplicate-requests"]).endpoints)){let D=z(y.method)??"GET",A=z(y.url)??"?";r.push({id:`perf:dup:${D} ${A}`,kind:"duplicate-requests",severity:"medium",title:`${D} ${A} fired ${R(y.peakConcurrent)??"?"}\xD7 at once`,where:`${D} ${A}`,detail:`${R(y.peakConcurrent)??"?"} identical requests in flight together \u2014 the browser asked for the same thing repeatedly`,count:R(y.totalRequests),resource:"perf://duplicate-requests",at:R(y.lastSeenAt)})}let p=oe(t["db://slow-queries"]),m=R(p.thresholdMs)??100;for(let y of ce(p.queries)){let D=R(y.p95Ms)??0,A=R(y.maxMs)??0,j=`${z(y.op)??"query"} ${z(y.table)??""}`.trim();r.push({id:`db:slow:${z(y.project)??"?"}:${j}`,kind:"slow-query",severity:D>=m*5?"high":D>=m?"medium":"low",title:D>=m?`Slow query: ${j}`:`Occasionally slow query: ${j}`,where:`${z(y.project)??"?"} \xB7 ${j}`,detail:`p95 ${Ue(D)} \xB7 max ${Ue(A)} \xB7 avg ${Ue(R(y.avgMs)??0)} over ${R(y.count)??0} runs (budget ${Ue(m)})`,...z(y.lastSql)?{code:z(y.lastSql)}:{},count:R(y.count),...(()=>{let N=`sql:${z(y.project)??"?"}:${j}`,K=a(e.evidence?.find(H=>H===N,"latest",{minMs:m})??e.evidence?.find(H=>H===N,"slowest"),i(N));return K?{evidence:K}:{}})(),resource:"db://slow-queries",at:R(y.lastSeenAt)})}for(let y of ce(oe(t["db://analysis"]).runs))for(let D of ce(y.findings)){let A=z(D.kind)??"finding";r.push({id:`db:analysis:${z(y.project)??"?"}:${A}:${z(D.table)??""}`,kind:A==="missing-index"?"missing-index":"slow-query",severity:D.severity==="error"?"high":D.severity==="info"?"low":"medium",title:`${A.replace(/-/g," ")} on ${z(D.table)??"a table"}`,where:`${z(y.project)??"?"} \xB7 ${z(D.table)??""}`,...z(D.detail)?{detail:z(D.detail)}:{},resource:"db://analysis",at:R(y.runAt)})}let f=new Map;for(let y of ce(oe(t["memory://leaks/suspected"]).suspected)){let D=z(y.ownerId)??"?",A=f.get(D);(!A||(R(y.at)??0)>=(R(A.at)??0))&&f.set(D,y)}for(let y of f.values()){let D=z(y.ownerId)??"?",A=oe(y.detail),j=z(y.flowId),N=a(j?e.evidence?.find(K=>K===`mem:${D}`,"latest",{inFlow:j}):void 0,j);r.push({id:`memory:leak:${Jm(D)}`,kind:"leak",severity:"high",title:`Suspected leak: ${Jm(D)}`,where:D,detail:`grew by ${R(A.growth)??"?"} (${R(A.startCount)??"?"} \u2192 ${R(A.endCount)??"?"}) during one flow and did not shrink`,...N?{evidence:N}:{},resource:"memory://leaks/suspected",at:R(y.at)})}let h=new Map;for(let y of ce(oe(t["runtime://errors"]).entries)){let D=z(y.fingerprint)??z(y.title)??"?",A=h.get(D),j=!A||(R(y.timestamp)??0)>(R(A.e.timestamp)??0),N=j?z(y.stack)??A?.stack:A?.stack??z(y.stack);h.set(D,{e:j?y:A.e,n:(A?.n??0)+1,...N?{stack:N}:{}})}let g=new Set;for(let[y,{e:D,n:A,stack:j}]of h){let N=z(D.id),K=z(D.requestId);K&&g.add(K),r.push({id:`runtime:server:${y}`,kind:"server-error",severity:"high",title:z(D.title)??"Server error",where:[z(D.source),z(D.route)].filter(Boolean).join(" \xB7 ")||void 0,...z(D.message)?{detail:z(D.message)}:{},...j?{code:Vm(j)}:{},count:A,evidence:n(N?[N]:[]),resource:"runtime://errors",at:R(D.timestamp)})}let b=new Map;for(let y of ce(oe(t["runtime://browser/errors"]).entries)){let D=z(y.fingerprint)??z(y.title)??z(y.message)??"?",A=b.get(D);b.set(D,{e:A&&(R(A.e.timestamp)??0)>(R(y.timestamp)??0)?A.e:y,n:(A?.n??0)+1})}for(let[y,{e:D,n:A}]of b){let j=z(D.id);r.push({id:`runtime:browser:${y}`,kind:"browser-error",severity:"high",title:z(D.title)??z(D.message)??"Browser error",...z(D.url)?{where:z(D.url)}:{},...z(D.message)&&z(D.message)!==z(D.title)?{detail:z(D.message)}:{},...z(D.stack)?{code:Vm(z(D.stack))}:{},count:A,evidence:n(j?[j]:[]),resource:"runtime://browser/errors",at:R(D.timestamp)})}let x=new Map;for(let y of ce(oe(t["trace://failed"]).spans)){let D=z(y.name)??"?";if(D.startsWith("nest.request ")||z(y.requestId)&&g.has(z(y.requestId)))continue;let A=x.get(D);x.set(D,{s:A&&(R(A.s.startTime)??0)>(R(y.startTime)??0)?A.s:y,n:(A?.n??0)+1})}for(let[y,{s:D,n:A}]of x){let j=z(D.id);r.push({id:`trace:failed:${y}`,kind:"failed-span",severity:"medium",title:`${y} failed`,where:y,count:A,evidence:n(j?[j]:[])??(z(D.flowId)?{flowId:z(D.flowId)}:void 0),resource:"trace://failed",at:R(D.startTime)})}for(let y of ce(oe(t["net://egress/hosts"]).hosts)){let D=z(y.host)??"?",A=z(y.project)??"?",j=ce(y.endpoints).find(N=>(R(N.errorCount)??0)+(R(N.status5xx)??0)>0);y.failing===!0?r.push({id:`net:failing:${A}:${D}`,kind:"egress-failing",severity:"high",title:`Calls to ${D} are failing`,where:`${A} \u2192 ${D}`,detail:z(y.detail)??`${R(y.errorCount)??0} errors, ${R(y.status5xx)??0}\xD7 5xx`,...j?{code:`${z(j.method)??"GET"} ${D}${z(j.path)??""}${z(j.lastError)?`
90
+ ${z(j.lastError)}`:R(j.lastStatus)?` \u2192 ${R(j.lastStatus)}`:""}`}:{},count:R(y.count),...(()=>{let N=`egress:${A}:${D}`,K=a(e.evidence?.find(H=>H===N,"failing")??e.evidence?.find(H=>H===N,"latest"),i(N));return K?{evidence:K}:{}})(),resource:"net://egress/hosts",at:R(y.lastSeenAt)}):y.slow===!0&&r.push({id:`net:slow:${A}:${D}`,kind:"egress-slow",severity:"medium",title:`${D} is slow`,where:`${A} \u2192 ${D}`,detail:`p95 ${Ue(R(y.p95Ms)??0)} \xB7 max ${Ue(R(y.maxMs)??0)} over ${R(y.count)??0} calls`,count:R(y.count),...(()=>{let N=`egress:${A}:${D}`,K=a(e.evidence?.find(H=>H===N,"slowest"),i(N));return K?{evidence:K}:{}})(),resource:"net://egress/hosts",at:R(y.lastSeenAt)})}for(let y of ce(oe(t["build://failures"]).failures)){let D=z(y.file);r.push({id:`build:${z(y.fingerprint)??z(y.message)??D??"?"}`,kind:"build",severity:"high",title:`Build error${z(y.project)?` in ${z(y.project)}`:""}`,...D?{where:D}:{},...z(y.message)?{detail:z(y.message)}:{},resource:"build://failures",at:R(y.timestamp)})}let $=ce(oe(t["typecheck://errors"]).errors),w=new Map;for(let y of $){let D=z(y.project)??"workspace";w.set(D,[...w.get(D)??[],y])}for(let[y,D]of w){let A=D[0];r.push({id:`typecheck:${y}`,kind:"typecheck",severity:"high",title:`${D.length} type error${D.length===1?"":"s"} in ${y}`,where:[z(A.file),R(A.line)].filter(j=>j!==void 0).join(":")||void 0,detail:`${z(A.code)?z(A.code)+": ":""}${z(A.message)??""}`,count:D.length,resource:"typecheck://errors",at:Math.max(...D.map(j=>R(j.timestamp)??0))})}let C=oe(t["process://cluster"]),k=ce(C.errors);for(let y of ce(C.services)){let D=z(y.state),A=z(y.project)??"?";if(D!=="crash-looping"&&D!=="wedged"&&y.buildFailed!==!0)continue;let j=k.filter(H=>H.project===A&&H.fault!=="types"),N=j.map(H=>z(H.line)).filter(Boolean),K=Um(A,D,j);r.push({id:`service:${A}:${D}`,kind:"service",severity:"high",title:K.title,where:K.serving?`${A} \u2014 still serving its last good build`:A,...z(y.lastTitle)?{detail:z(y.lastTitle)}:{},...N.length?{code:N.slice(-6).join(`
89
91
  `)}:{},count:R(y.restarts),resource:"process://cluster",at:R(y.lastSeenAt)})}for(let y of ce(oe(t["perf://rules"]).findings)){let D=z(y.rule)??"perf",A=z(y.project)??"?",j=z(y.subject)??"?",N=(Array.isArray(y.fix)?y.fix:[]).filter(ye=>typeof ye=="string"),K=oe(y.cost),H=oe(y.evidence);r.push({id:`perf-rule:${D}:${A}:${j}`,kind:"perf-rule",severity:y.severity==="error"?"high":"medium",title:z(y.title)??D,where:`${D} \xB7 ${A}${j!==A?` \xB7 ${j}`:""}`,...z(y.summary)?{detail:z(y.summary)}:{},...N.length?{fix:N.map((ye,Ze)=>`${Ze+1}. ${ye}`).join(`
90
- `)}:{},...z(y.verify)?{verify:z(y.verify)}:{},...z(y.docs)?{docs:z(y.docs)}:{},code:Lb(K,H),...R(K.modules)!==void 0?{count:R(K.modules)}:{},resource:"perf://rules",at:R(y.lastSeenAt)})}let M=new Map;for(let y of r){let D=M.get(y.id);(!D||(y.at??0)>=(D.at??0))&&M.set(y.id,y)}return[...M.values()]}s(Mb,"XP"),o(Mb,"collectProblems");function Ob(e){let t=oe(e["process://cluster"]),r=ce(t.errors);return ce(t.services).filter(i=>i.buildFailed===!0).map(i=>z(i.project)??"?").filter(i=>{let u=r.filter(n=>n.project===i&&n.fault!=="types");return!(u.length>0&&u.every(n=>n.fault==="process"))})}s(Ob,"HP"),o(Ob,"podBuildFailures");function Rb(e,t=Date.now()){let r=[],i=o((n,a,l,d,c)=>{let p=oe(e[n]);if(!e[n])return;let m,f=z(p.detail)??"",h=d(p),g=h?void 0:c?.(p);p.producer==="none"?(m="unchecked",f=f||"nothing is reporting this yet \u2014 not a pass"):h?(m="fail",f=h):g?(m="warn",f=g):p.stale===!0?m="stale":m="pass",r.push({id:a,label:l,status:m,detail:Fm(f),resource:n})},"health");i("build://current","build","Build",n=>{let a=ce(n.failures),l=a.filter(d=>d.domain!=="typecheck"&&d.domain!=="lint").length;return l>0||a.length===0&&n.status==="failing"?`${l||"some"} build failure${l===1?"":"s"}`:void 0});let u=Ob(e);if(u.length){let n=r.find(d=>d.id==="build"),a=n?.status==="fail"?`${n.detail}; `:"",l=Fm(`${a}${u.length} service build${u.length===1?"":"s"} failing (${u.join(", ")})`);n?Object.assign(n,{status:"fail",detail:l,resource:n.status==="fail"?n.resource:"process://cluster"}):r.unshift({id:"build",label:"Build",status:"fail",detail:l,resource:"process://cluster"})}return i("typecheck://current","typecheck","Typecheck",n=>{let a=R(n.errorCount)??0;return a>0?`${a} type error${a===1?"":"s"}`:void 0}),i("lint://current","lint","Lint",n=>{let a=R(n.errorCount)??0;return a>0?`${a} lint error${a===1?"":"s"}`:void 0}),i("runtime://browser/errors","browser","Browser capture",n=>{let a=R(n.count)??0;return a>0?`${a} browser error${a===1?"":"s"}`:void 0}),i("visual://violations/current","visual","Visual rules",n=>{let a=ce(n.violations).length;return a>0?`${a} visual violation${a===1?"":"s"}`:void 0}),i("db://analysis","db-analysis","DB analysis",n=>{let a=R(n.errorCount),l=a??R(n.findingCount)??0;if(l!==0)return a===void 0?`${l} finding${l===1?"":"s"}`:`${l} error-level finding${l===1?"":"s"}`},n=>{let a=R(n.warningCount)??0,l=[];if(a>0&&l.push(`${a} warning${a===1?"":"s"}`),n.incomplete===!0){let d=R(n.droppedFindings)??0;l.push(d>0?`incomplete \u2014 ${d} findings never reached the lens`:"incomplete \u2014 part of the run never reached the lens")}return l.length>0?l.join("; "):void 0}),r}s(Rb,"YP"),o(Rb,"collectChecks");function Tb(e){let t=oe(oe(e["memory://current"]).current),r=new Set(ce(oe(e["memory://leaks/suspected"]).suspected).map(u=>z(u.ownerId))),i=ce(oe(e["memory://owners/growing"]).owners).map(u=>({ownerId:z(u.ownerId)??"?",itemCount:R(u.itemCount)??0,growth:R(u.growthSinceStart)??0,mutations:R(u.mutations)??0,...R(u.lastMutatedAt)!==void 0?{lastMutatedAt:R(u.lastMutatedAt)}:{},suspected:r.has(z(u.ownerId)),flowIds:(Array.isArray(u.flowIds)?u.flowIds:[]).filter(n=>typeof n=="string").slice(-5)})).filter(u=>!/^Lensmcp/i.test(u.ownerId)).sort((u,n)=>Number(n.suspected)-Number(u.suspected)||n.growth-u.growth).slice(0,8);return{...R(t.heapUsed)!==void 0?{heapUsed:R(t.heapUsed)}:{},...R(t.rss)!==void 0?{rss:R(t.rss)}:{},owners:i}}s(Tb,"QP"),o(Tb,"collectMemory");function Pb(e){return{hot:ce(oe(e["react://components/hot"]).components).map(t=>({component:z(t.componentName)??Im(z(t.componentLogicalId)??"?"),renders:R(t.renderCount)??0,totalMs:Math.round((R(t.totalActualMs)??0)*10)/10})).sort((t,r)=>r.renders-t.renders).slice(0,8)}}s(Pb,"eD"),o(Pb,"collectReact");var JI=class{static{s(this,"mc")}static{o(this,"ProblemLedger")}constructor(e=10*6e4){this.keepResolvedMs=e,this.known=new Map}update(e,t=Date.now()){let r=new Set;for(let i of e){if(r.has(i.id))continue;r.add(i.id);let{at:u,...n}=i,a=this.known.get(i.id),l=u??a?.lastSeenAt??t,d={...n,firstSeenAt:a?.firstSeenAt??Math.min(l,t),lastSeenAt:l};this.known.set(i.id,{firstSeenAt:d.firstSeenAt,lastSeenAt:l,problem:d})}for(let[i,u]of this.known)r.has(i)||(u.resolvedAt===void 0?u.resolvedAt=t:t-u.resolvedAt>this.keepResolvedMs&&this.known.delete(i));return[...this.known.values()].map(i=>i.resolvedAt!==void 0?{...i.problem,resolvedAt:i.resolvedAt}:i.problem).sort(qb)}},Ub={high:0,medium:1,low:2};function qb(e,t){let r=e.resolvedAt!==void 0?1:0,i=t.resolvedAt!==void 0?1:0;return r-i||Ub[e.severity]-Ub[t.severity]||t.lastSeenAt-e.lastSeenAt}s(qb,"tD"),o(qb,"problemOrder");function Zb(e,t){let r=e.now??Date.now();return{at:r,problems:t.update(Mb(e),r),checks:Rb(e.resources,r),memory:Tb(e.resources),react:Pb(e.resources)}}s(Zb,"dS"),o(Zb,"buildDiagnostics");function Lb(e,t){let r=[],i=[R(e.modules)!==void 0?`${R(e.modules)} modules`:void 0,R(e.bytes)!==void 0?`${(R(e.bytes)/1048576).toFixed(1)} MB`:void 0,R(e.compileMs)!==void 0?`~${Ue(R(e.compileMs))} compile`:void 0,R(e.memoryMb)!==void 0?`~${R(e.memoryMb)} MB memory`:void 0].filter(Boolean);i.length&&r.push(`cost: ${i.join(" \xB7 ")}${z(e.basis)?` (${z(e.basis)})`:""}`);for(let[u,n]of Object.entries(t)){if(n==null||Array.isArray(n)&&n.length===0)continue;let a=typeof n=="object"?JSON.stringify(n):String(n);if(r.push(`${u}: ${a.length>400?`${a.slice(0,399)}\u2026`:a}`),r.length>=24)break}return r.join(`
91
- `)}s(Lb,"rD"),o(Lb,"perfRuleEvidence");function Vb(e,t){return e==="n-plus-one"?`the same query ran ${R(t.count)??"?"}\xD7 in one request (threshold ${R(t.threshold)??"?"}) \u2014 one round-trip per row`:e==="db-in-loop"?`${R(t.dbCallsInsideLoop)??"?"} database calls inside one loop of ${R(t.iterations)??"?"} iterations${R(t.durationMs)!==void 0?` (${Ue(R(t.durationMs))})`:""}`:e==="render-storm"?`rendered ${R(t.count)??"?"}\xD7 within ${R(t.windowMs)??"?"}ms (threshold ${R(t.threshold)??"?"})`:e==="slow-path"?z(t.summary)??"the longest causal chain in the flow":z(t.summary)??""}s(Vb,"nD"),o(Vb,"patternDetail");function Im(e){let t=e.split(":").pop()??e;return t.split("#")[0]||t}s(Im,"pS"),o(Im,"componentName");function _m(e){let[t,r]=e.split("::"),i=(t??e).split("#")[0];return r?`${i}.${r}`:i??e}s(_m,"cS"),o(_m,"ownerName");function Sm(e){return e.split(`
92
+ `)}:{},...z(y.verify)?{verify:z(y.verify)}:{},...z(y.docs)?{docs:z(y.docs)}:{},code:$w(K,H),...R(K.modules)!==void 0?{count:R(K.modules)}:{},resource:"perf://rules",at:R(y.lastSeenAt)})}let M=new Map;for(let y of r){let D=M.get(y.id);(!D||(y.at??0)>=(D.at??0))&&M.set(y.id,y)}return[...M.values()]}s(hw,"YD"),o(hw,"collectProblems");function gw(e){let t=oe(e["process://cluster"]),r=ce(t.errors);return ce(t.services).filter(n=>n.buildFailed===!0).map(n=>z(n.project)??"?").filter(n=>{let u=r.filter(i=>i.project===n&&i.fault!=="types");return!(u.length>0&&u.every(i=>i.fault==="process"))})}s(gw,"QD"),o(gw,"podBuildFailures");function vw(e,t=Date.now()){let r=[],n=o((i,a,l,d,c)=>{let p=oe(e[i]);if(!e[i])return;let m,f=z(p.detail)??"",h=d(p),g=h?void 0:c?.(p);p.producer==="none"?(m="unchecked",f=f||"nothing is reporting this yet \u2014 not a pass"):h?(m="fail",f=h):g?(m="warn",f=g):p.stale===!0?m="stale":m="pass",r.push({id:a,label:l,status:m,detail:Wm(f),resource:i})},"health");n("build://current","build","Build",i=>{let a=ce(i.failures),l=a.filter(d=>d.domain!=="typecheck"&&d.domain!=="lint").length;return l>0||a.length===0&&i.status==="failing"?`${l||"some"} build failure${l===1?"":"s"}`:void 0});let u=gw(e);if(u.length){let i=r.find(d=>d.id==="build"),a=i?.status==="fail"?`${i.detail}; `:"",l=Wm(`${a}${u.length} service build${u.length===1?"":"s"} failing (${u.join(", ")})`);i?Object.assign(i,{status:"fail",detail:l,resource:i.status==="fail"?i.resource:"process://cluster"}):r.unshift({id:"build",label:"Build",status:"fail",detail:l,resource:"process://cluster"})}return n("typecheck://current","typecheck","Typecheck",i=>{let a=R(i.errorCount)??0;return a>0?`${a} type error${a===1?"":"s"}`:void 0}),n("lint://current","lint","Lint",i=>{let a=R(i.errorCount)??0;return a>0?`${a} lint error${a===1?"":"s"}`:void 0}),n("runtime://browser/errors","browser","Browser capture",i=>{let a=R(i.count)??0;return a>0?`${a} browser error${a===1?"":"s"}`:void 0}),n("visual://violations/current","visual","Visual rules",i=>{let a=ce(i.violations).length;return a>0?`${a} visual violation${a===1?"":"s"}`:void 0}),n("db://analysis","db-analysis","DB analysis",i=>{let a=R(i.errorCount),l=a??R(i.findingCount)??0;if(l!==0)return a===void 0?`${l} finding${l===1?"":"s"}`:`${l} error-level finding${l===1?"":"s"}`},i=>{let a=R(i.warningCount)??0,l=[];if(a>0&&l.push(`${a} warning${a===1?"":"s"}`),i.incomplete===!0){let d=R(i.droppedFindings)??0;l.push(d>0?`incomplete \u2014 ${d} findings never reached the lens`:"incomplete \u2014 part of the run never reached the lens")}return l.length>0?l.join("; "):void 0}),r}s(vw,"eC"),o(vw,"collectChecks");function yw(e){let t=oe(oe(e["memory://current"]).current),r=new Set(ce(oe(e["memory://leaks/suspected"]).suspected).map(u=>z(u.ownerId))),n=ce(oe(e["memory://owners/growing"]).owners).map(u=>({ownerId:z(u.ownerId)??"?",itemCount:R(u.itemCount)??0,growth:R(u.growthSinceStart)??0,mutations:R(u.mutations)??0,...R(u.lastMutatedAt)!==void 0?{lastMutatedAt:R(u.lastMutatedAt)}:{},suspected:r.has(z(u.ownerId)),flowIds:(Array.isArray(u.flowIds)?u.flowIds:[]).filter(i=>typeof i=="string").slice(-5)})).filter(u=>!/^Lensmcp/i.test(u.ownerId)).sort((u,i)=>Number(i.suspected)-Number(u.suspected)||i.growth-u.growth).slice(0,8);return{...R(t.heapUsed)!==void 0?{heapUsed:R(t.heapUsed)}:{},...R(t.rss)!==void 0?{rss:R(t.rss)}:{},owners:n}}s(yw,"tC"),o(yw,"collectMemory");function bw(e){return{hot:ce(oe(e["react://components/hot"]).components).map(t=>({component:z(t.componentName)??Lm(z(t.componentLogicalId)??"?"),renders:R(t.renderCount)??0,totalMs:Math.round((R(t.totalActualMs)??0)*10)/10})).sort((t,r)=>r.renders-t.renders).slice(0,8)}}s(bw,"rC"),o(bw,"collectReact");var GI=class{static{s(this,"wc")}static{o(this,"ProblemLedger")}constructor(e=10*6e4){this.keepResolvedMs=e,this.known=new Map}update(e,t=Date.now()){let r=new Set;for(let n of e){if(r.has(n.id))continue;r.add(n.id);let{at:u,...i}=n,a=this.known.get(n.id),l=u??a?.lastSeenAt??t,d={...i,firstSeenAt:a?.firstSeenAt??Math.min(l,t),lastSeenAt:l};this.known.set(n.id,{firstSeenAt:d.firstSeenAt,lastSeenAt:l,problem:d})}for(let[n,u]of this.known)r.has(n)||(u.resolvedAt===void 0?u.resolvedAt=t:t-u.resolvedAt>this.keepResolvedMs&&this.known.delete(n));return[...this.known.values()].map(n=>n.resolvedAt!==void 0?{...n.problem,resolvedAt:n.resolvedAt}:n.problem).sort(ww)}},Ew={high:0,medium:1,low:2};function ww(e,t){let r=e.resolvedAt!==void 0?1:0,n=t.resolvedAt!==void 0?1:0;return r-n||Ew[e.severity]-Ew[t.severity]||t.lastSeenAt-e.lastSeenAt}s(ww,"nC"),o(ww,"problemOrder");function Dw(e,t){let r=e.now??Date.now();return{at:r,problems:t.update(hw(e),r),checks:vw(e.resources,r),memory:yw(e.resources),react:bw(e.resources)}}s(Dw,"JS"),o(Dw,"buildDiagnostics");function $w(e,t){let r=[],n=[R(e.modules)!==void 0?`${R(e.modules)} modules`:void 0,R(e.bytes)!==void 0?`${(R(e.bytes)/1048576).toFixed(1)} MB`:void 0,R(e.compileMs)!==void 0?`~${Ue(R(e.compileMs))} compile`:void 0,R(e.memoryMb)!==void 0?`~${R(e.memoryMb)} MB memory`:void 0].filter(Boolean);n.length&&r.push(`cost: ${n.join(" \xB7 ")}${z(e.basis)?` (${z(e.basis)})`:""}`);for(let[u,i]of Object.entries(t)){if(i==null||Array.isArray(i)&&i.length===0)continue;let a=typeof i=="object"?JSON.stringify(i):String(i);if(r.push(`${u}: ${a.length>400?`${a.slice(0,399)}\u2026`:a}`),r.length>=24)break}return r.join(`
93
+ `)}s($w,"oC"),o($w,"perfRuleEvidence");function Bw(e,t){return e==="n-plus-one"?`the same query ran ${R(t.count)??"?"}\xD7 in one request (threshold ${R(t.threshold)??"?"}) \u2014 one round-trip per row`:e==="db-in-loop"?`${R(t.dbCallsInsideLoop)??"?"} database calls inside one loop of ${R(t.iterations)??"?"} iterations${R(t.durationMs)!==void 0?` (${Ue(R(t.durationMs))})`:""}`:e==="render-storm"?`rendered ${R(t.count)??"?"}\xD7 within ${R(t.windowMs)??"?"}ms (threshold ${R(t.threshold)??"?"})`:e==="slow-path"?z(t.summary)??"the longest causal chain in the flow":z(t.summary)??""}s(Bw,"iC"),o(Bw,"patternDetail");function Lm(e){let t=e.split(":").pop()??e;return t.split("#")[0]||t}s(Lm,"KS"),o(Lm,"componentName");function Jm(e){let[t,r]=e.split("::"),n=(t??e).split("#")[0];return r?`${n}.${r}`:n??e}s(Jm,"VS"),o(Jm,"ownerName");function Vm(e){return e.split(`
92
94
  `).filter(t=>!/node_modules|node:internal|node:async_hooks/.test(t)).slice(0,5).join(`
93
- `)}s(Sm,"uS"),o(Sm,"firstFrames");function Ue(e){return e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}s`:`${Math.round(e)}ms`}s(Ue,"ot"),o(Ue,"fmtMs");function Fm(e,t=160){return e.length>t?e.slice(0,t-1)+"\u2026":e}s(Fm,"lS"),o(Fm,"shorten");function na(e,t){return`event: ${e.type}
95
+ `)}s(Vm,"GS"),o(Vm,"firstFrames");function Ue(e){return e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}s`:`${Math.round(e)}ms`}s(Ue,"ot"),o(Ue,"fmtMs");function Wm(e,t=160){return e.length>t?e.slice(0,t-1)+"\u2026":e}s(Wm,"WS"),o(Wm,"shorten");function ca(e,t){return`event: ${e.type}
94
96
  ${t!==void 0?`id: ${t}
95
97
  `:""}data: ${JSON.stringify(e.data)}
96
98
 
97
- `}s(na,"Pb"),o(na,"sseFrame");var WI=class{static{s(this,"hc")}static{o(this,"StreamHub")}constructor(e=15e3){this.clients=new Set,this.latest=new Map,this.latestJson=new Map,this.frameId=0,this.currentLogSeq=0,this.pinger=setInterval(()=>this.writeAll(`:ping
99
+ `}s(ca,"rw"),o(ca,"sseFrame");var KI=class{static{s(this,"xc")}static{o(this,"StreamHub")}constructor(e=15e3){this.clients=new Set,this.latest=new Map,this.latestJson=new Map,this.frameId=0,this.currentLogSeq=0,this.pinger=setInterval(()=>this.writeAll(`:ping
98
100
 
99
101
  `),e),this.pinger.unref()}get size(){return this.clients.size}attach(e,t){e.writeHead(200,{"content-type":"text/event-stream; charset=utf-8","cache-control":"no-store",connection:"keep-alive","x-accel-buffering":"no"}),e.write(`retry: 3000
100
102
 
101
- `);let r={res:e,logsDropped:!1};for(let i of t)e.write(na(i,++this.frameId));for(let[i,u]of this.latest)i!=="logs"&&i!=="logs-resync"&&e.write(u);this.clients.add(r),e.on("drain",()=>{r.logsDropped&&(r.logsDropped=!1,this.safeWrite(r,na({type:"logs-resync",data:{seq:this.currentLogSeq}},++this.frameId)))}),e.on("close",()=>this.clients.delete(r))}publish(e){let t=JSON.stringify(e.data);if(this.latestJson.get(e.type)===t)return!1;this.latestJson.set(e.type,t);let r=`event: ${e.type}
103
+ `);let r={res:e,logsDropped:!1};for(let n of t)e.write(ca(n,++this.frameId));for(let[n,u]of this.latest)n!=="logs"&&n!=="logs-resync"&&e.write(u);this.clients.add(r),e.on("drain",()=>{r.logsDropped&&(r.logsDropped=!1,this.safeWrite(r,ca({type:"logs-resync",data:{seq:this.currentLogSeq}},++this.frameId)))}),e.on("close",()=>this.clients.delete(r))}publish(e){let t=JSON.stringify(e.data);if(this.latestJson.get(e.type)===t)return!1;this.latestJson.set(e.type,t);let r=`event: ${e.type}
102
104
  id: ${++this.frameId}
103
105
  data: ${t}
104
106
 
105
- `;return this.latest.set(e.type,r),this.writeAll(r),!0}publishLogs(e){if(this.currentLogSeq=e.data.seq,this.clients.size===0)return;let t=na(e,++this.frameId);for(let r of this.clients)if(!r.logsDropped){if(r.res.writableNeedDrain){r.logsDropped=!0;continue}this.safeWrite(r,t)}}latestData(e){let t=this.latestJson.get(e);return t===void 0?void 0:JSON.parse(t)}close(){clearInterval(this.pinger);for(let e of this.clients)try{e.res.end()}catch{}this.clients.clear()}writeAll(e){for(let t of this.clients)this.safeWrite(t,e)}safeWrite(e,t){try{e.res.write(t)}catch{this.clients.delete(e)}}};function kt(e,t){let r,i=0,u=!1,n=!1,a=o(async()=>{if(r=void 0,u){n=!0;return}u=!0,i=Date.now();try{await e()}catch(d){console.error("[lensmcp] dashboard: stream producer failed (contained):",d)}finally{u=!1,n&&(n=!1,l())}},"fire"),l=o(()=>{if(r)return;let d=Math.max(0,t-(Date.now()-i));r=setTimeout(()=>{a()},d),r.unref()},"kick");return{kick:l}}s(kt,"Kt"),o(kt,"coalesce");function Jb(e,t){if(e!=="POST")return{ok:!1,status:405,error:"this endpoint changes state \u2014 POST only"};if((String(t["content-type"]??"").split(";")[0]??"").trim().toLowerCase()!=="application/json")return{ok:!1,status:415,error:"send the body as application/json"};let r=t["sec-fetch-site"];return r!==void 0&&r!=="same-origin"?{ok:!1,status:403,error:"cross-site requests may not change dashboard state"}:{ok:!0}}s(Jb,"mS"),o(Jb,"mutationVerdict");var Tu=class extends Error{static{s(this,"wt")}static{o(this,"RequestRefused")}constructor(e,t){super(t),this.status=e}},GI=256*1024,Wb=500,KI=2048;function Gb(e,t=GI){return new Promise((r,i)=>{let u=[],n=0;e.on("data",a=>{if(n+=a.length,n>t){i(new Tu(413,`body over ${t} bytes`)),e.destroy();return}u.push(a)}),e.on("end",()=>r(Buffer.concat(u).toString("utf8"))),e.on("error",i)})}s(Gb,"hS"),o(Gb,"readBody");function Kb(e){let t;try{t=JSON.parse(e)}catch{throw new Tu(400,"the body is not JSON")}let r=t?.ids;if(!Array.isArray(r)||r.length===0)throw new Tu(400,'expected { "ids": [<error id>, \u2026] }');if(r.length>Wb)throw new Tu(400,`at most ${Wb} ids in one request`);if(!r.every(i=>typeof i=="string"&&i.length>0&&i.length<=KI))throw new Tu(400,"every id is a non-empty string");return r}s(Kb,"gS"),o(Kb,"parseErrorIds");function Hb(e){let t=JSON.stringify(e.base),r=encodeURIComponent(e.assetVersion),i=`${Qb(e.base)}/assets/dashboard-ui`,u=e.assetsReady?"":'<div class="lm-missing"><strong>The dashboard UI is not built.</strong><br>Run <code>yarn nx run @lensmcp/lensmcp-mcp:bundle</code> and reload. The data endpoints under <code>/api</code> are live.</div>';return`<!doctype html>
107
+ `;return this.latest.set(e.type,r),this.writeAll(r),!0}publishLogs(e){if(this.currentLogSeq=e.data.seq,this.clients.size===0)return;let t=ca(e,++this.frameId);for(let r of this.clients)if(!r.logsDropped){if(r.res.writableNeedDrain){r.logsDropped=!0;continue}this.safeWrite(r,t)}}latestData(e){let t=this.latestJson.get(e);return t===void 0?void 0:JSON.parse(t)}close(){clearInterval(this.pinger);for(let e of this.clients)try{e.res.end()}catch{}this.clients.clear()}writeAll(e){for(let t of this.clients)this.safeWrite(t,e)}safeWrite(e,t){try{e.res.write(t)}catch{this.clients.delete(e)}}};function Ct(e,t){let r,n=0,u=!1,i=!1,a=o(async()=>{if(r=void 0,u){i=!0;return}u=!0,n=Date.now();try{await e()}catch(d){console.error("[lensmcp] dashboard: stream producer failed (contained):",d)}finally{u=!1,i&&(i=!1,l())}},"fire"),l=o(()=>{if(r)return;let d=Math.max(0,t-(Date.now()-n));r=setTimeout(()=>{a()},d),r.unref()},"kick");return{kick:l}}s(Ct,"Kt"),o(Ct,"coalesce");function xw(e,t){if(e!=="POST")return{ok:!1,status:405,error:"this endpoint changes state \u2014 POST only"};if((String(t["content-type"]??"").split(";")[0]??"").trim().toLowerCase()!=="application/json")return{ok:!1,status:415,error:"send the body as application/json"};let r=t["sec-fetch-site"];return r!==void 0&&r!=="same-origin"?{ok:!1,status:403,error:"cross-site requests may not change dashboard state"}:{ok:!0}}s(xw,"XS"),o(xw,"mutationVerdict");var qu=class extends Error{static{s(this,"wt")}static{o(this,"RequestRefused")}constructor(e,t){super(t),this.status=e}},HI=256*1024,kw=500,XI=2048;function Cw(e,t=HI){return new Promise((r,n)=>{let u=[],i=0;e.on("data",a=>{if(i+=a.length,i>t){n(new qu(413,`body over ${t} bytes`)),e.destroy();return}u.push(a)}),e.on("end",()=>r(Buffer.concat(u).toString("utf8"))),e.on("error",n)})}s(Cw,"YS"),o(Cw,"readBody");function Aw(e){let t;try{t=JSON.parse(e)}catch{throw new qu(400,"the body is not JSON")}let r=t?.ids;if(!Array.isArray(r)||r.length===0)throw new qu(400,'expected { "ids": [<error id>, \u2026] }');if(r.length>kw)throw new qu(400,`at most ${kw} ids in one request`);if(!r.every(n=>typeof n=="string"&&n.length>0&&n.length<=XI))throw new qu(400,"every id is a non-empty string");return r}s(Aw,"QS"),o(Aw,"parseErrorIds");function _w(e){let t=JSON.stringify(e.base),r=encodeURIComponent(e.assetVersion),n=`${Fw(e.base)}/assets/dashboard-ui`,u=e.assetsReady?"":'<div class="lm-missing"><strong>The dashboard UI is not built.</strong><br>Run <code>yarn nx run @lensmcp/lensmcp-mcp:bundle</code> and reload. The data endpoints under <code>/api</code> are live.</div>';return`<!doctype html>
106
108
  <html lang="en">
107
109
  <head>
108
110
  <meta charset="utf-8">
109
111
  <meta name="viewport" content="width=device-width, initial-scale=1">
110
112
  <meta name="color-scheme" content="dark light">
111
- <title>${yi(e.title)}</title>
112
- <link rel="icon" href="data:image/svg+xml,${encodeURIComponent(Yb)}">
113
+ <title>${$n(e.title)}</title>
114
+ <link rel="icon" href="data:image/svg+xml,${encodeURIComponent(Sw)}">
113
115
  <script>
114
116
  window.__LENS_BASE__=${t};
115
- window.__LENS_TOKEN_PARAM__=${JSON.stringify(ea)};
117
+ window.__LENS_TOKEN_PARAM__=${JSON.stringify(sa)};
116
118
  (function(){try{var t=localStorage.getItem('lensmcp.theme');if(t==='whiteprint'||t==='blueprint')document.documentElement.dataset.theme=t;}catch(e){}})();
117
119
  </script>
118
120
  <style>
@@ -122,22 +124,22 @@ html[data-theme="whiteprint"],html[data-theme="whiteprint"] body{background:#e6e
122
124
  .lm-missing{font:14px/1.6 ui-monospace,Menlo,monospace;max-width:560px;margin:15vh auto;padding:24px;border:1px solid rgba(146,183,220,.3)}
123
125
  .lm-missing code{color:#79dcff}
124
126
  </style>
125
- ${e.assetsReady?`<link rel="stylesheet" href="${i}/app.css?v=${r}">
126
- <script type="module" src="${i}/app.js?v=${r}"></script>`:""}
127
+ ${e.assetsReady?`<link rel="stylesheet" href="${n}/app.css?v=${r}">
128
+ <script type="module" src="${n}/app.js?v=${r}"></script>`:""}
127
129
  </head>
128
130
  <body>
129
131
  <div id="root">${u}</div>
130
132
  <noscript><div class="lm-missing">The LensMCP dashboard needs JavaScript.</div></noscript>
131
133
  </body>
132
- </html>`}s(Hb,"vS"),o(Hb,"renderShell");function Xb(e){let t=yi(e.wsKey),r=e.reason==="expired"?"That sign-in link has expired or was already used. Links work once, for ten minutes.":"This dashboard shows your workspace\u2019s telemetry, so it asks for proof you are its owner.";return`<!doctype html>
134
+ </html>`}s(_w,"eI"),o(_w,"renderShell");function Iw(e){let t=$n(e.wsKey),r=e.reason==="expired"?"That sign-in link has expired or was already used. Links work once, for ten minutes.":"This dashboard shows your workspace\u2019s telemetry, so it asks for proof you are its owner.";return`<!doctype html>
133
135
  <html lang="en">
134
136
  <head>
135
137
  <meta charset="utf-8">
136
138
  <meta name="viewport" content="width=device-width, initial-scale=1">
137
139
  <meta name="color-scheme" content="dark light">
138
140
  <meta name="referrer" content="no-referrer">
139
- <title>${yi(e.title)} \xB7 sign in</title>
140
- <link rel="icon" href="data:image/svg+xml,${encodeURIComponent(Yb)}">
141
+ <title>${$n(e.title)} \xB7 sign in</title>
142
+ <link rel="icon" href="data:image/svg+xml,${encodeURIComponent(Sw)}">
141
143
  <style>
142
144
  html,body{margin:0;background:#0a1826;color:#dce9f6}
143
145
  @media (prefers-color-scheme: light){html,body{background:#e6ecf2;color:#0f2a40}}
@@ -158,10 +160,10 @@ html,body{margin:0;background:#0a1826;color:#dce9f6}
158
160
  After that this browser stays signed in for 30 days.
159
161
  </div>
160
162
  </body>
161
- </html>`}s(Xb,"yS"),o(Xb,"renderLockedPage");var Yb='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect x="3" y="3" width="26" height="26" fill="#0a1826" stroke="#79dcff" stroke-width="2"/><path d="M16 3v26M3 16h26" stroke="#79dcff" stroke-opacity=".5"/><circle cx="16" cy="16" r="4" fill="#79dcff"/></svg>';function yi(e){return e.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t])}s(yi,"gc"),o(yi,"escapeHtml");function Qb(e){return yi(e)}s(Qb,"sD"),o(Qb,"escapeAttr"),process.env.LENSMCP_EVENT_FILE??=`${process.cwd()}/.lensmcp/events.jsonl`,sb("dashboard");var{session:Be,flows:e5}=VE(),HI=Date.now(),At=process.cwd(),Ei=Number(process.env.LENSMCP_DASHBOARD_PORT??4321),et=(process.env.LENSMCP_DASHBOARD_BASE??"").replace(/\/+$/,""),Qt=process.env.LENSMCP_WS_KEY||et.replace(/^\//,"")||y5(At),t5=process.env.LENSMCP_SOCK_NS||(process.env.LENSMCP_WS_KEY??""),jm=(()=>{try{let e=JSON.parse(Km(`${At}/.lensmcp/config.json`,"utf8"));return typeof e.sockNs=="string"&&/^[a-z0-9][a-z0-9-]{0,31}$/.test(e.sockNs)?e.sockNs:typeof e.key=="string"&&/^[\w.-]+$/.test(e.key)?e.key:""}catch{return""}})();function u5(e){let t=process.env.TMPDIR??"/tmp";if(t5)return`${t}/${t5}/${e}-devserver`;let r=`${t}/${e}-devserver`;return jm&&!Gm(r)&&Gm(`${t}/${jm}/${e}-devserver`)?`${t}/${jm}/${e}-devserver`:r}s(u5,"pD"),o(u5,"podSockDir");var It=process.env.LENSMCP_DASHBOARD_BIND??"127.0.0.1",at=It==="127.0.0.1"||It==="::1"||It==="localhost",Pu=QE(process.env,At),ot=Pu.token,r5=eb(Qt),XI=new AI,qe=new WI,_e=new MI(5e3),sa=new OI,Uu=new RI(void 0,e5),YI=new JI,bi=new VI,eu=new NI({root:At,podSockDir:u5,workspaceKey:Qt,onChange:o(()=>{Nm.kick(),l5.kick()},"onChange")});async function wi(e){try{return await Be.resources.read(e)}catch{return}}s(wi,"yc"),o(wi,"readResource");async function aa(e){let t={};return await Promise.all(e.map(async r=>{let i=await wi(r);i!==void 0&&(t[r]=i)})),t}s(aa,"Ub"),o(aa,"readResources");var QI=new Eb,i5=new Eb,tu=[];function n5(e){QI.firstTime(e.id)&&(tu.push(_e.append(e)),tu.length>2e3&&tu.splice(0,tu.length-2e3),sa.observe(e),Uu.observe(e),$m(e)&&e_.kick(),bi.observe(e)&&$i.kick(),i5.firstTime(e.id)&&eu.reduce(e))}s(n5,"gD"),o(n5,"onBusEvent");function s5(){try{let e=process.env.LENSMCP_EVENT_FILE??`${At}/.lensmcp/events.jsonl`;for(let t of ab(e,8*1024*1024,25e3))try{let r=JSON.parse(t);if(!r||r.source!=="gateway"&&!cb.has(r.source))continue;i5.firstTime(r.id)&&eu.reduce(r)}catch{}}catch{}}s(s5,"vD"),o(s5,"replayClusterTail");var zm,Di=[],Nm=kt(async()=>{let e=await wi("process://cluster");zm=eu.view({processCluster:e,kpis:sa}),qe.publish({type:"cluster",data:zm}),Bi.kick()},250),Mm=kt(()=>{Di=Uu.summaries(Qe()),qe.publish({type:"flows",data:{flows:Di}})&&Bi.kick()},300),e_=kt(()=>{let e=Uu.drainRevs();e.length&&qe.publish({type:"flow-rev",data:e}),Mm.kick()},300),Om=kt(async()=>{let e=await aa(Nb),t=Zb({resources:e,flows:Di,flowOfEvent:o(r=>Uu.flowOfEvent(r),"flowOfEvent"),evidence:Uu.evidence(Qe())},YI);qe.publish({type:"diagnostics",data:t})},1e3),Rm=["build://failures","typecheck://errors","lint://errors","process://cluster"],$i=kt(async()=>{let e=km(await aa(Rm));qe.publish({type:"errors",data:bi.snapshot(e)})},500),Bi=kt(async()=>{qe.publish({type:"session",data:await o5()})},500),a5=o(()=>{qe.publish({type:"kpis",data:sa.snapshot()})},"kpiPush");setInterval(()=>{if(tu.length===0)return;let e=tu.splice(0,tu.length);qe.publishLogs({type:"logs",data:{seq:_e.seq,sources:_e.sources(),lines:e.slice(-500)}})},250).unref(),setInterval(a5,2e3).unref(),setInterval(()=>Nm.kick(),3e3).unref(),setInterval(()=>Om.kick(),1e4).unref(),setInterval(()=>{bi.flush()&&$i.kick()},500).unref(),setInterval(()=>$i.kick(),15e3).unref(),setInterval(()=>Bi.kick(),5e3).unref(),Be.bus.subscribe(n5),s5(),Be.resources.subscribe("flow://recent",()=>Mm.kick());for(let e of Nb)Be.resources.subscribe(e,()=>Om.kick());Be.resources.subscribe("agent://current-status",()=>Bi.kick());for(let e of Rm)Be.resources.subscribe(e,()=>$i.kick());async function o5(){let e=await wi("agent://current-status")??{},t=zm??eu.view({kpis:sa}),r=[],i=t.hosts.filter(l=>!l.v4||!l.v6);i.length&&r.push({id:"hosts",title:`${i.length} host${i.length===1?" does":"s do"} not resolve to this machine`,detail:`${i.map(l=>l.host).join(", ")} \u2014 requests to ${i.length===1?"it":"them"} fail until /etc/hosts maps ${i.length===1?"it":"them"} to 127.0.0.1 and ::1.`,...t.hostsFix?{fix:t.hostsFix}:{}}),t.gateway.state==="down"&&r.push({id:"gateway",title:"The dev gateway is not running",detail:t.gateway.evidence,fix:"lensmcp gateway start"});let u=[...e.blocking??[],...e.warnings??[]].map(l=>(l.title??"").split(" \u2014 ")[0].trim()).filter(Boolean),n=e.status??"starting",a=u.length?u.slice(0,3).join(" \xB7 ")+(u.length>3?` \xB7 +${u.length-3} more`:""):n==="clean"?"Nothing is failing":"Waiting for the first signals";return{phase:r.length?"setup-incomplete":Di.length===0?"empty":"live",gateway:t.gateway,status:n,headline:a,flowCount:Di.length,eventCount:_e.seq,setupIssues:r}}s(o5,"bD"),o(o5,"sessionView");var qu=new Set,l5=kt(()=>{if(qu.size===0)return;let e=`event: update
162
- data: `+JSON.stringify(eu.legacyView())+`
163
+ </html>`}s(Iw,"tI"),o(Iw,"renderLockedPage");var Sw='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect x="3" y="3" width="26" height="26" fill="#0a1826" stroke="#79dcff" stroke-width="2"/><path d="M16 3v26M3 16h26" stroke="#79dcff" stroke-opacity=".5"/><circle cx="16" cy="16" r="4" fill="#79dcff"/></svg>';function $n(e){return e.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t])}s($n,"$c"),o($n,"escapeHtml");function Fw(e){return $n(e)}s(Fw,"cC"),o(Fw,"escapeAttr"),process.env.LENSMCP_EVENT_FILE??=`${process.cwd()}/.lensmcp/events.jsonl`,TE("dashboard");var{session:Be,flows:jw}=BE(),YI=Date.now(),At=process.cwd(),Bn=Number(process.env.LENSMCP_DASHBOARD_PORT??4321),et=(process.env.LENSMCP_DASHBOARD_BASE??"").replace(/\/+$/,""),tu=process.env.LENSMCP_WS_KEY||et.replace(/^\//,"")||Xw(At),zw=process.env.LENSMCP_SOCK_NS||(process.env.LENSMCP_WS_KEY??""),Gm=(()=>{try{let e=JSON.parse(d4(`${At}/.lensmcp/config.json`,"utf8"));return typeof e.sockNs=="string"&&/^[a-z0-9][a-z0-9-]{0,31}$/.test(e.sockNs)?e.sockNs:typeof e.key=="string"&&/^[\w.-]+$/.test(e.key)?e.key:""}catch{return""}})();function Nw(e){let t=process.env.TMPDIR??"/tmp";if(zw)return`${t}/${zw}/${e}-devserver`;let r=`${t}/${e}-devserver`;return Gm&&!l4(r)&&l4(`${t}/${Gm}/${e}-devserver`)?`${t}/${Gm}/${e}-devserver`:r}s(Nw,"mC"),o(Nw,"podSockDir");var _t=process.env.LENSMCP_DASHBOARD_BIND??"127.0.0.1",at=_t==="127.0.0.1"||_t==="::1"||_t==="localhost",Zu=FE(process.env,At),ot=Zu.token,Mw=jE(tu),QI=new II,qe=new KI,Ie=new RI(5e3),pa=new TI,Lu=new PI(void 0,jw),eS=new GI,xn=new WI,uu=new OI({root:At,podSockDir:Nw,workspaceKey:tu,onChange:o(()=>{Hm.kick(),qw.kick()},"onChange")});async function kn(e){try{return await Be.resources.read(e)}catch{return}}s(kn,"kc"),o(kn,"readResource");async function ma(e){let t={};return await Promise.all(e.map(async r=>{let n=await kn(r);n!==void 0&&(t[r]=n)})),t}s(ma,"iw"),o(ma,"readResources");var tS=new YE,Ow=new YE,ru=[];function Rw(e){tS.firstTime(e.id)&&(ru.push(Ie.append(e)),ru.length>2e3&&ru.splice(0,ru.length-2e3),pa.observe(e),Lu.observe(e),Rm(e)&&uS.kick(),xn.observe(e)&&An.kick(),Ow.firstTime(e.id)&&uu.reduce(e))}s(Rw,"yC"),o(Rw,"onBusEvent");function Tw(){try{let e=process.env.LENSMCP_EVENT_FILE??`${At}/.lensmcp/events.jsonl`;for(let t of PE(e,8*1024*1024,25e3))try{let r=JSON.parse(t);if(!r||r.source!=="gateway"&&!LE.has(r.source))continue;Ow.firstTime(r.id)&&uu.reduce(r)}catch{}}catch{}}s(Tw,"bC"),o(Tw,"replayClusterTail");var Km,Cn=[],Hm=Ct(async()=>{let e=await kn("process://cluster");Km=uu.view({processCluster:e,kpis:pa}),qe.publish({type:"cluster",data:Km}),_n.kick()},250),Xm=Ct(()=>{Cn=Lu.summaries(Qe()),qe.publish({type:"flows",data:{flows:Cn}})&&_n.kick()},300),uS=Ct(()=>{let e=Lu.drainRevs();e.length&&qe.publish({type:"flow-rev",data:e}),Xm.kick()},300),Ym=Ct(async()=>{let e=await ma(fw),t=Dw({resources:e,flows:Cn,flowOfEvent:o(r=>Lu.flowOfEvent(r),"flowOfEvent"),evidence:Lu.evidence(Qe())},eS);qe.publish({type:"diagnostics",data:t})},1e3),Qm=["build://failures","typecheck://errors","lint://errors","process://cluster"],An=Ct(async()=>{let e=qm(await ma(Qm));qe.publish({type:"errors",data:xn.snapshot(e)})},500),_n=Ct(async()=>{qe.publish({type:"session",data:await Uw()})},500),Pw=o(()=>{qe.publish({type:"kpis",data:pa.snapshot()})},"kpiPush");setInterval(()=>{if(ru.length===0)return;let e=ru.splice(0,ru.length);qe.publishLogs({type:"logs",data:{seq:Ie.seq,sources:Ie.sources(),lines:e.slice(-500)}})},250).unref(),setInterval(Pw,2e3).unref(),setInterval(()=>Hm.kick(),3e3).unref(),setInterval(()=>Ym.kick(),1e4).unref(),setInterval(()=>{xn.flush()&&An.kick()},500).unref(),setInterval(()=>An.kick(),15e3).unref(),setInterval(()=>_n.kick(),5e3).unref(),Be.bus.subscribe(Rw),Tw(),Be.resources.subscribe("flow://recent",()=>Xm.kick());for(let e of fw)Be.resources.subscribe(e,()=>Ym.kick());Be.resources.subscribe("agent://current-status",()=>_n.kick());for(let e of Qm)Be.resources.subscribe(e,()=>An.kick());async function Uw(){let e=await kn("agent://current-status")??{},t=Km??uu.view({kpis:pa}),r=[],n=t.hosts.filter(l=>!l.v4||!l.v6);n.length&&r.push({id:"hosts",title:`${n.length} host${n.length===1?" does":"s do"} not resolve to this machine`,detail:`${n.map(l=>l.host).join(", ")} \u2014 requests to ${n.length===1?"it":"them"} fail until /etc/hosts maps ${n.length===1?"it":"them"} to 127.0.0.1 and ::1.`,...t.hostsFix?{fix:t.hostsFix}:{}}),t.gateway.state==="down"&&r.push({id:"gateway",title:"The dev gateway is not running",detail:t.gateway.evidence,fix:"lensmcp gateway start"});let u=[...e.blocking??[],...e.warnings??[]].map(l=>(l.title??"").split(" \u2014 ")[0].trim()).filter(Boolean),i=e.status??"starting",a=u.length?u.slice(0,3).join(" \xB7 ")+(u.length>3?` \xB7 +${u.length-3} more`:""):i==="clean"?"Nothing is failing":"Waiting for the first signals";return{phase:r.length?"setup-incomplete":Cn.length===0?"empty":"live",gateway:t.gateway,status:i,headline:a,flowCount:Cn.length,eventCount:Ie.seq,setupIssues:r}}s(Uw,"xC"),o(Uw,"sessionView");var Ju=new Set,qw=Ct(()=>{if(Ju.size===0)return;let e=`event: update
164
+ data: `+JSON.stringify(uu.legacyView())+`
163
165
 
164
- `;for(let t of qu)try{t.write(e)}catch{qu.delete(t)}},80);setInterval(()=>{qu.size>0&&l5.kick()},3e3).unref();function d5(e,t=!1,r){return _b(Qe(),e,{includeRaw:t,rev:Uu.rev(e),config:e5,...r!==void 0?{segmentId:r}:{}})}s(d5,"wD"),o(d5,"flowDetail");async function c5(){let e=Be.resources.list().sort(),t={};return await Promise.all(e.map(async r=>{try{t[r]=await Be.resources.read(r)}catch(i){t[r]={__error:i instanceof Error?i.message:String(i)}}})),{at:Date.now(),count:e.length,resources:t}}s(c5,"xD"),o(c5,"snapshot");var p5=["./dashboard-ui/","../../../libs/cli/bundled/dashboard-ui/"].map(e=>new URL(e,import.meta.url)),t_=/^[A-Za-z0-9_.-]+(?:\/[A-Za-z0-9_.-]+)*$/,u_={js:"application/javascript; charset=utf-8",css:"text/css; charset=utf-8",woff2:"font/woff2",woff:"font/woff",svg:"image/svg+xml",png:"image/png",json:"application/json",map:"application/json"};function m5(e){if(!(!t_.test(e)||e.split("/").some(t=>t===".."||t===".")))for(let t of p5)try{let r=new URL(e,t),i=Hm(r);if(!i.isFile())continue;return{body:Km(r),mtimeMs:i.mtimeMs}}catch{}}s(m5,"kD"),o(m5,"findAsset");function Tm(){for(let e of p5)try{return String(Math.round(Hm(new URL("app.js",e)).mtimeMs))}catch{}}s(Tm,"jS"),o(Tm,"uiAssetVersion"),Tm()||console.warn("[lensmcp] dashboard: the UI bundle (dashboard-ui/app.js) was not found beside the dashboard or in libs/cli/bundled/ \u2014 the page will ask for a rebuild. Build it: yarn nx run @lensmcp/lensmcp-mcp:bundle");function ge(e,t,r){e.writeHead(t,{"content-type":"application/json","cache-control":"no-store"}),e.end(JSON.stringify(r))}s(ge,"ye"),o(ge,"json");function Pm(e,t){e.writeHead(401,{"content-type":"text/html; charset=utf-8","cache-control":"no-store","referrer-policy":"no-referrer"}),e.end(Xb({title:`LensMCP \xB7 ${Qt}`,wsKey:Qt,reason:t}))}s(Pm,"_S"),o(Pm,"locked");var Um=v5((e,t)=>{let r;try{r=new URL(e.url??"/","http://localhost")}catch{t.writeHead(400,{"content-type":"text/plain"}),t.end("bad request target");return}let i=GE(at,e.headers.host);if(!i.ok){ge(t,i.status,{error:i.error});return}let u=r.pathname;if(et){if(u===et){t.writeHead(302,{location:et+"/"+r.search}),t.end();return}u.startsWith(et+"/")&&(u=u.slice(et.length))}if(ot){let a=r.searchParams.get(ea),l=mm(ot,e.headers.authorization,a,{header:e.headers.cookie,name:r5});if(ib(u)){if(!l){t.writeHead(401,{"content-type":"application/json","www-authenticate":'Bearer realm="lensmcp-dashboard"',"cache-control":"no-store"}),t.end(JSON.stringify({error:`unauthorized \u2014 ${at?"":`this dashboard is bound to ${It}; `}sign in with the link \`lensmcp gateway status\` prints, or send the workspace token as a Bearer`}));return}}else if(!nb(u)){let d=r.searchParams.get(cm);if(d!==null||a!==null){let c=d!==null?XI.redeem(ot,d,Date.now())==="ok":mm(ot,void 0,a);if(!c&&!l){Pm(t,"expired");return}r.searchParams.delete(cm),r.searchParams.delete(ea);let p=e.headers["x-forwarded-proto"]==="https";t.writeHead(303,{location:r.pathname+r.search,"cache-control":"no-store","referrer-policy":"no-referrer",...c?{"set-cookie":ub(r5,fm(ot),et||"/",p)}:{}}),t.end();return}if(!l){Pm(t,"signin");return}}}if(u==="/api/stream"){let a=Number(r.searchParams.get("logsSince")??"0"),l=a>0?_e.since(a,2e3):_e.recent(1500),d=[{type:"hello",data:{protocol:1,sessionId:Be.id,startedAt:HI,rawAllowed:at,workspace:{key:Qt,name:Qt,base:et},logSeq:_e.seq}},{type:"logs",data:{seq:_e.seq,sources:_e.sources(),lines:l}}];qe.attach(t,d);for(let[c,p]of[["cluster",Nm],["flows",Mm],["diagnostics",Om],["session",Bi],["errors",$i]])qe.latestData(c)===void 0&&p.kick();qe.latestData("kpis")===void 0&&a5();return}if(u==="/api/cluster/stream"){t.writeHead(200,{"content-type":"text/event-stream","cache-control":"no-store",connection:"keep-alive"}),t.write(`event: snapshot
165
- data: `+JSON.stringify(eu.legacyView())+`
166
+ `;for(let t of Ju)try{t.write(e)}catch{Ju.delete(t)}},80);setInterval(()=>{Ju.size>0&&qw.kick()},3e3).unref();function Zw(e,t=!1,r){return lw(Qe(),e,{includeRaw:t,rev:Lu.rev(e),config:jw,...r!==void 0?{segmentId:r}:{}})}s(Zw,"$C"),o(Zw,"flowDetail");async function Lw(){let e=Be.resources.list().sort(),t={};return await Promise.all(e.map(async r=>{try{t[r]=await Be.resources.read(r)}catch(n){t[r]={__error:n instanceof Error?n.message:String(n)}}})),{at:Date.now(),count:e.length,resources:t}}s(Lw,"_C"),o(Lw,"snapshot");var Jw=["./dashboard-ui/","../../../libs/cli/bundled/dashboard-ui/"].map(e=>new URL(e,import.meta.url)),rS=/^[A-Za-z0-9_.-]+(?:\/[A-Za-z0-9_.-]+)*$/,nS={js:"application/javascript; charset=utf-8",css:"text/css; charset=utf-8",woff2:"font/woff2",woff:"font/woff",svg:"image/svg+xml",png:"image/png",json:"application/json",map:"application/json"};function Vw(e){if(!(!rS.test(e)||e.split("/").some(t=>t===".."||t===".")))for(let t of Jw)try{let r=new URL(e,t),n=c4(r);if(!n.isFile())continue;return{body:d4(r),mtimeMs:n.mtimeMs}}catch{}}s(Vw,"IC"),o(Vw,"findAsset");function e4(){for(let e of Jw)try{return String(Math.round(c4(new URL("app.js",e)).mtimeMs))}catch{}}s(e4,"mI"),o(e4,"uiAssetVersion"),e4()||console.warn("[lensmcp] dashboard: the UI bundle (dashboard-ui/app.js) was not found beside the dashboard or in libs/cli/bundled/ \u2014 the page will ask for a rebuild. Build it: yarn nx run @lensmcp/lensmcp-mcp:bundle");function ge(e,t,r){e.writeHead(t,{"content-type":"application/json","cache-control":"no-store"}),e.end(JSON.stringify(r))}s(ge,"ye"),o(ge,"json");function t4(e,t){e.writeHead(401,{"content-type":"text/html; charset=utf-8","cache-control":"no-store","referrer-policy":"no-referrer"}),e.end(Iw({title:`LensMCP \xB7 ${tu}`,wsKey:tu,reason:t}))}s(t4,"sI"),o(t4,"locked");var u4=Hw((e,t)=>{let r;try{r=new URL(e.url??"/","http://localhost")}catch{t.writeHead(400,{"content-type":"text/plain"}),t.end("bad request target");return}let n=CE(at,e.headers.host);if(!n.ok){ge(t,n.status,{error:n.error});return}let u=r.pathname;if(et){if(u===et){t.writeHead(302,{location:et+"/"+r.search}),t.end();return}u.startsWith(et+"/")&&(u=u.slice(et.length))}if(ot){let a=r.searchParams.get(sa),l=Am(ot,e.headers.authorization,a,{header:e.headers.cookie,name:Mw});if(OE(u)){if(!l){t.writeHead(401,{"content-type":"application/json","www-authenticate":'Bearer realm="lensmcp-dashboard"',"cache-control":"no-store"}),t.end(JSON.stringify({error:`unauthorized \u2014 ${at?"":`this dashboard is bound to ${_t}; `}sign in with the link \`lensmcp gateway status\` prints, or send the workspace token as a Bearer`}));return}}else if(!RE(u)){let d=r.searchParams.get(km);if(d!==null||a!==null){let c=d!==null?QI.redeem(ot,d,Date.now())==="ok":Am(ot,void 0,a);if(!c&&!l){t4(t,"expired");return}r.searchParams.delete(km),r.searchParams.delete(sa);let p=e.headers["x-forwarded-proto"]==="https";t.writeHead(303,{location:r.pathname+r.search,"cache-control":"no-store","referrer-policy":"no-referrer",...c?{"set-cookie":NE(Mw,_m(ot),et||"/",p)}:{}}),t.end();return}if(!l){t4(t,"signin");return}}}if(u==="/api/stream"){let a=Number(r.searchParams.get("logsSince")??"0"),l=a>0?Ie.since(a,2e3):Ie.recent(1500),d=[{type:"hello",data:{protocol:1,sessionId:Be.id,startedAt:YI,rawAllowed:at,workspace:{key:tu,name:tu,base:et},logSeq:Ie.seq}},{type:"logs",data:{seq:Ie.seq,sources:Ie.sources(),lines:l}}];qe.attach(t,d);for(let[c,p]of[["cluster",Hm],["flows",Xm],["diagnostics",Ym],["session",_n],["errors",An]])qe.latestData(c)===void 0&&p.kick();qe.latestData("kpis")===void 0&&Pw();return}if(u==="/api/cluster/stream"){t.writeHead(200,{"content-type":"text/event-stream","cache-control":"no-store",connection:"keep-alive"}),t.write(`event: snapshot
167
+ data: `+JSON.stringify(uu.legacyView())+`
166
168
 
167
- `),qu.add(t),e.on("close",()=>qu.delete(t));return}if(u==="/api/cluster"){ge(t,200,eu.legacyView());return}if(u==="/api/snapshot"){c5().then(a=>ge(t,200,a)).catch(a=>ge(t,500,{error:a instanceof Error?a.message:String(a)}));return}if(u==="/api/resources"){let a=Be.resources.list().sort().map(l=>({uri:l,scheme:l.split("://")[0]??l,revision:Be.resources.revision(l)}));ge(t,200,{resources:a});return}if(u==="/api/resource"){let a=r.searchParams.get("uri")??"";if(!Be.resources.list().includes(a)){ge(t,404,{error:`unknown resource: ${a}`});return}wi(a).then(l=>ge(t,200,{uri:a,revision:Be.resources.revision(a),value:l}));return}if(u==="/api/flow"){let a=r.searchParams.get("id")??"",l=r.searchParams.get("raw")==="1";if(l&&!at){ge(t,403,{error:"raw AI payloads are served only on a loopback-bound dashboard; unset LENSMCP_DASHBOARD_BIND"});return}let d=r.searchParams.get("segment");ge(t,200,d5(a,l,d!==null&&d.length>0&&d.length<=512?d:void 0));return}if(u==="/api/ai-call"){if(!at){ge(t,403,{error:"AI call content is served only on a loopback-bound dashboard; unset LENSMCP_DASHBOARD_BIND"});return}let a=r.searchParams.get("id")??"";if(!ys(a)){ge(t,400,{error:"invalid ai call id"});return}let l=yc(process.env.LENSMCP_EVENT_FILE??`${At}/.lensmcp/events.jsonl`,a);if(!l){ge(t,404,{error:"no captured content for this call \u2014 not captured (LENSMCP_AI_CAPTURE=content), or rotated away"});return}ge(t,200,l);return}if(u==="/api/logs"){let a=Number(r.searchParams.get("since")??"0"),l=r.searchParams.get("flow")??void 0,d=r.searchParams.get("q")??void 0,c=Number(r.searchParams.get("around")??""),p=Math.min(6e4,Math.max(100,Number(r.searchParams.get("window")??"5000")||5e3)),m=Math.min(5e3,Math.max(1,Number(r.searchParams.get("limit")??"2000")||2e3)),f=l||d||Number.isFinite(c)&&c>0?_e.query({since:a,...l?{flowId:l}:{},...d?{q:d}:{},...Number.isFinite(c)&&c>0?{from:c-p,to:c+p}:{},limit:m}):a>0?_e.since(a,m):_e.recent(m);ge(t,200,{seq:_e.seq,sources:_e.sources(),events:f});return}if(u==="/api/errors/dismiss"||u==="/api/errors/restore"){let a=Jb(e.method,e.headers);if(!a.ok){ge(t,a.status,{error:a.error});return}let l=u==="/api/errors/dismiss";Gb(e).then(async d=>{let c=Kb(d),p=l?bi.dismissalsFor(c,km(await aa(Rm))).map(m=>qd(m,Be.id)):bi.restorable(c).map(m=>Zd(m,Be.id,Date.now()));ds(gy(process.env,At),p),ge(t,200,{count:p.length})}).catch(d=>{t.headersSent||(d instanceof Tu?ge(t,d.status,{error:d.message}):ge(t,500,{error:`could not write to the event bus: ${d instanceof Error?d.message:String(d)}`}))});return}if(u.startsWith("/api/")){ge(t,404,{error:`no such endpoint: ${u}`});return}if(u.startsWith("/assets/dashboard-ui/")){let a=u.slice(21),l=m5(a);if(!l){t.writeHead(404,{"content-type":"text/plain"}),t.end("asset not bundled");return}let d=a.split(".").pop()??"",c=/^(?:chunks|media)\//.test(a),p=`"${g5("sha1").update(l.body).digest("hex").slice(0,16)}"`;if(!c&&e.headers["if-none-match"]===p){t.writeHead(304,{etag:p}),t.end();return}t.writeHead(200,{"content-type":u_[d]??"application/octet-stream","cache-control":c?"public, max-age=31536000, immutable":"no-cache",...c?{}:{etag:p}}),t.end(l.body);return}let n=Tm();t.writeHead(200,{"content-type":"text/html; charset=utf-8","cache-control":"no-store"}),t.end(Hb({base:et,title:`LensMCP \xB7 ${Qt}`,assetsReady:!!n,assetVersion:n??"0"}))});Um.on("error",e=>{throw e.code==="EADDRINUSE"&&(console.error(`[lensmcp] dashboard: port ${Ei} is already in use (an orphaned dashboard from a crashed gateway?) \u2014 exiting.`),process.exit(1)),e}),Um.listen(Ei,It,()=>{let e=Be.resources.list().length;console.error(`[lensmcp] dashboard \u2192 http://${at?"localhost":It}:${Ei} (${e} resources registered)`),ot&&at?process.stderr.isTTY?console.error(`[lensmcp] sign in \u2192 http://localhost:${Ei}${et}/?${cm}=${rb(ot,Date.now())} (one use, 10 min)`):console.error("[lensmcp] dashboard sign-in: `lensmcp gateway status` (or `lensmcp dashboard`) prints a one-time link."):!ot&&at&&console.error(`[lensmcp] WARNING: the dashboard serves workspace telemetry to ANY account on this machine${Pu.source==="unavailable"?` (could not establish a token: ${Pu.reason})`:" (LENSMCP_ALLOW_INSECURE=1)"}.`),at||(console.error(`[lensmcp] WARNING: dashboard bound to ${It} \u2014 reachable beyond this machine.`),console.error(ot?`[lensmcp] its data endpoints require a token (${Pu.source==="env"?"LENSMCP_DASHBOARD_TOKEN":pm(At)}). Open the page as http://${It}:${Ei}/?${ea}=YOUR_TOKEN`:`[lensmcp] WARNING: it serves workspace telemetry with NO authentication${Pu.source==="unavailable"?` (could not establish a token: ${Pu.reason})`:" (LENSMCP_ALLOW_INSECURE=1)"}. Unset LENSMCP_DASHBOARD_BIND to restore loopback.`))}),process.on("uncaughtException",e=>{console.error("[lensmcp] dashboard: uncaught exception (contained):",e)});function qm(e){qe.close(),Um.close(),Be.stop().catch(()=>{}).finally(()=>process.exit(e==="SIGINT"?130:0))}s(qm,"zS"),o(qm,"shutdown"),process.on("SIGINT",qm),process.on("SIGTERM",qm);
169
+ `),Ju.add(t),e.on("close",()=>Ju.delete(t));return}if(u==="/api/cluster"){ge(t,200,uu.legacyView());return}if(u==="/api/snapshot"){Lw().then(a=>ge(t,200,a)).catch(a=>ge(t,500,{error:a instanceof Error?a.message:String(a)}));return}if(u==="/api/resources"){let a=Be.resources.list().sort().map(l=>({uri:l,scheme:l.split("://")[0]??l,revision:Be.resources.revision(l)}));ge(t,200,{resources:a});return}if(u==="/api/resource"){let a=r.searchParams.get("uri")??"";if(!Be.resources.list().includes(a)){ge(t,404,{error:`unknown resource: ${a}`});return}kn(a).then(l=>ge(t,200,{uri:a,revision:Be.resources.revision(a),value:l}));return}if(u==="/api/flow"){let a=r.searchParams.get("id")??"",l=r.searchParams.get("raw")==="1";if(l&&!at){ge(t,403,{error:"raw AI payloads are served only on a loopback-bound dashboard; unset LENSMCP_DASHBOARD_BIND"});return}let d=r.searchParams.get("segment");ge(t,200,Zw(a,l,d!==null&&d.length>0&&d.length<=512?d:void 0));return}if(u==="/api/ai-call"){if(!at){ge(t,403,{error:"AI call content is served only on a loopback-bound dashboard; unset LENSMCP_DASHBOARD_BIND"});return}let a=r.searchParams.get("id")??"";if(!Bs(a)){ge(t,400,{error:"invalid ai call id"});return}let l=jc(process.env.LENSMCP_EVENT_FILE??`${At}/.lensmcp/events.jsonl`,a);if(!l){ge(t,404,{error:"no captured content for this call \u2014 not captured (LENSMCP_AI_CAPTURE=content), or rotated away"});return}ge(t,200,l);return}if(u==="/api/logs"){let a=Number(r.searchParams.get("since")??"0"),l=r.searchParams.get("flow")??void 0,d=r.searchParams.get("q")??void 0,c=Number(r.searchParams.get("around")??""),p=Math.min(6e4,Math.max(100,Number(r.searchParams.get("window")??"5000")||5e3)),m=Math.min(5e3,Math.max(1,Number(r.searchParams.get("limit")??"2000")||2e3)),f=l||d||Number.isFinite(c)&&c>0?Ie.query({since:a,...l?{flowId:l}:{},...d?{q:d}:{},...Number.isFinite(c)&&c>0?{from:c-p,to:c+p}:{},limit:m}):a>0?Ie.since(a,m):Ie.recent(m);ge(t,200,{seq:Ie.seq,sources:Ie.sources(),events:f});return}if(u==="/api/errors/dismiss"||u==="/api/errors/restore"){let a=xw(e.method,e.headers);if(!a.ok){ge(t,a.status,{error:a.error});return}let l=u==="/api/errors/dismiss";Cw(e).then(async d=>{let c=Aw(d),p=l?xn.dismissalsFor(c,qm(await ma(Qm))).map(m=>Gd(m,Be.id)):xn.restorable(c).map(m=>Kd(m,Be.id,Date.now()));fs(Ny(process.env,At),p),ge(t,200,{count:p.length})}).catch(d=>{t.headersSent||(d instanceof qu?ge(t,d.status,{error:d.message}):ge(t,500,{error:`could not write to the event bus: ${d instanceof Error?d.message:String(d)}`}))});return}if(u.startsWith("/api/")){ge(t,404,{error:`no such endpoint: ${u}`});return}if(u.startsWith("/assets/dashboard-ui/")){let a=u.slice(21),l=Vw(a);if(!l){t.writeHead(404,{"content-type":"text/plain"}),t.end("asset not bundled");return}let d=a.split(".").pop()??"",c=/^(?:chunks|media)\//.test(a),p=`"${Kw("sha1").update(l.body).digest("hex").slice(0,16)}"`;if(!c&&e.headers["if-none-match"]===p){t.writeHead(304,{etag:p}),t.end();return}t.writeHead(200,{"content-type":nS[d]??"application/octet-stream","cache-control":c?"public, max-age=31536000, immutable":"no-cache",...c?{}:{etag:p}}),t.end(l.body);return}let i=e4();t.writeHead(200,{"content-type":"text/html; charset=utf-8","cache-control":"no-store"}),t.end(_w({base:et,title:`LensMCP \xB7 ${tu}`,assetsReady:!!i,assetVersion:i??"0"}))});u4.on("error",e=>{throw e.code==="EADDRINUSE"&&(console.error(`[lensmcp] dashboard: port ${Bn} is already in use (an orphaned dashboard from a crashed gateway?) \u2014 exiting.`),process.exit(1)),e}),u4.listen(Bn,_t,()=>{let e=Be.resources.list().length;console.error(`[lensmcp] dashboard \u2192 http://${at?"localhost":_t}:${Bn} (${e} resources registered)`),ot&&at?process.stderr.isTTY?console.error(`[lensmcp] sign in \u2192 http://localhost:${Bn}${et}/?${km}=${ME(ot,Date.now())} (one use, 10 min)`):console.error("[lensmcp] dashboard sign-in: `lensmcp gateway status` (or `lensmcp dashboard`) prints a one-time link."):!ot&&at&&console.error(`[lensmcp] WARNING: the dashboard serves workspace telemetry to ANY account on this machine${Zu.source==="unavailable"?` (could not establish a token: ${Zu.reason})`:" (LENSMCP_ALLOW_INSECURE=1)"}.`),at||(console.error(`[lensmcp] WARNING: dashboard bound to ${_t} \u2014 reachable beyond this machine.`),console.error(ot?`[lensmcp] its data endpoints require a token (${Zu.source==="env"?"LENSMCP_DASHBOARD_TOKEN":Cm(At)}). Open the page as http://${_t}:${Bn}/?${sa}=YOUR_TOKEN`:`[lensmcp] WARNING: it serves workspace telemetry with NO authentication${Zu.source==="unavailable"?` (could not establish a token: ${Zu.reason})`:" (LENSMCP_ALLOW_INSECURE=1)"}. Unset LENSMCP_DASHBOARD_BIND to restore loopback.`))}),process.on("uncaughtException",e=>{console.error("[lensmcp] dashboard: uncaught exception (contained):",e)});function r4(e){qe.close(),u4.close(),Be.stop().catch(()=>{}).finally(()=>process.exit(e==="SIGINT"?130:0))}s(r4,"hI"),o(r4,"shutdown"),process.on("SIGINT",r4),process.on("SIGTERM",r4);