@fenglimg/fabric-server 1.8.0-rc.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +0,0 @@
1
- (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))a(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const o of n.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&a(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerPolicy&&(n.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?n.credentials="include":i.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function a(i){if(i.ep)return;i.ep=!0;const n=r(i);fetch(i.href,n)}})();var dt,$,Ir,he,Qt,Rr,Nr,ht,De,Ne,jr,Ot,vt,yt,Lr,Be={},Ve=[],fa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,lt=Array.isArray;function ne(t,e){for(var r in e)t[r]=e[r];return t}function Ft(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function ma(t,e,r){var a,i,n,o={};for(n in e)n=="key"?a=e[n]:n=="ref"?i=e[n]:o[n]=e[n];if(arguments.length>2&&(o.children=arguments.length>3?dt.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(n in t.defaultProps)o[n]===void 0&&(o[n]=t.defaultProps[n]);return Ze(t,o,a,i,null)}function Ze(t,e,r,a,i){var n={type:t,props:e,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Ir,__i:-1,__u:0};return i==null&&$.vnode!=null&&$.vnode(n),n}function ct(t){return t.children}function Ue(t,e){this.props=t,this.context=e}function xe(t,e){if(e==null)return t.__?xe(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?xe(t):null}function ba(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,a=[],i=[],n=ne({},e);n.__v=e.__v+1,$.vnode&&$.vnode(n),Mt(t.__P,n,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,a,r??xe(e),!!(32&e.__u),i),n.__v=e.__v,n.__.__k[n.__i]=n,Fr(a,n,i),e.__e=e.__=null,n.__e!=r&&$r(n)}}function $r(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),$r(t)}function kt(t){(!t.__d&&(t.__d=!0)&&he.push(t)&&!qe.__r++||Qt!=$.debounceRendering)&&((Qt=$.debounceRendering)||Rr)(qe)}function qe(){try{for(var t,e=1;he.length;)he.length>e&&he.sort(Nr),t=he.shift(),e=he.length,ba(t)}finally{he.length=qe.__r=0}}function Pr(t,e,r,a,i,n,o,d,u,c,h){var p,y,_,x,F,N,E,I=a&&a.__k||Ve,H=e.length;for(u=ga(r,e,I,u,H),p=0;p<H;p++)(_=r.__k[p])!=null&&(y=_.__i!=-1&&I[_.__i]||Be,_.__i=p,N=Mt(t,_,y,i,n,o,d,u,c,h),x=_.__e,_.ref&&y.ref!=_.ref&&(y.ref&&zt(y.ref,null,_),h.push(_.ref,_.__c||x,_)),F==null&&x!=null&&(F=x),(E=!!(4&_.__u))||y.__k===_.__k?(u=Or(_,u,t,E),E&&y.__e&&(y.__e=null)):typeof _.type=="function"&&N!==void 0?u=N:x&&(u=x.nextSibling),_.__u&=-7);return r.__e=F,u}function ga(t,e,r,a,i){var n,o,d,u,c,h=r.length,p=h,y=0;for(t.__k=new Array(i),n=0;n<i;n++)(o=e[n])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=t.__k[n]=Ze(null,o,null,null,null):lt(o)?o=t.__k[n]=Ze(ct,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=t.__k[n]=Ze(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[n]=o,u=n+y,o.__=t,o.__b=t.__b+1,d=null,(c=o.__i=_a(o,r,u,p))!=-1&&(p--,(d=r[c])&&(d.__u|=2)),d==null||d.__v==null?(c==-1&&(i>h?y--:i<h&&y++),typeof o.type!="function"&&(o.__u|=4)):c!=u&&(c==u-1?y--:c==u+1?y++:(c>u?y--:y++,o.__u|=4))):t.__k[n]=null;if(p)for(n=0;n<h;n++)(d=r[n])!=null&&(2&d.__u)==0&&(d.__e==a&&(a=xe(d)),zr(d,d));return a}function Or(t,e,r,a){var i,n;if(typeof t.type=="function"){for(i=t.__k,n=0;i&&n<i.length;n++)i[n]&&(i[n].__=t,e=Or(i[n],e,r,a));return e}t.__e!=e&&(a&&(e&&t.type&&!e.parentNode&&(e=xe(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function _a(t,e,r,a){var i,n,o,d=t.key,u=t.type,c=e[r],h=c!=null&&(2&c.__u)==0;if(c===null&&d==null||h&&d==c.key&&u==c.type)return r;if(a>(h?1:0)){for(i=r-1,n=r+1;i>=0||n<e.length;)if((c=e[o=i>=0?i--:n++])!=null&&(2&c.__u)==0&&d==c.key&&u==c.type)return o}return-1}function er(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||fa.test(e)?r:r+"px"}function Oe(t,e,r,a,i){var n,o;e:if(e=="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof a=="string"&&(t.style.cssText=a=""),a)for(e in a)r&&e in r||er(t.style,e,"");if(r)for(e in r)a&&r[e]==a[e]||er(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")n=e!=(e=e.replace(jr,"$1")),o=e.toLowerCase(),e=o in t||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+n]=r,r?a?r[Ne]=a[Ne]:(r[Ne]=Ot,t.addEventListener(e,n?yt:vt,n)):t.removeEventListener(e,n?yt:vt,n);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function tr(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e[De]==null)e[De]=Ot++;else if(e[De]<r[Ne])return;return r($.event?$.event(e):e)}}}function Mt(t,e,r,a,i,n,o,d,u,c){var h,p,y,_,x,F,N,E,I,H,W,z,X,V,L,B=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),n=[d=e.__e=r.__e]),(h=$.__b)&&h(e);e:if(typeof B=="function")try{if(E=e.props,I=B.prototype&&B.prototype.render,H=(h=B.contextType)&&a[h.__c],W=h?H?H.props.value:h.__:a,r.__c?N=(p=e.__c=r.__c).__=p.__E:(I?e.__c=p=new B(E,W):(e.__c=p=new Ue(E,W),p.constructor=B,p.render=ya),H&&H.sub(p),p.state||(p.state={}),p.__n=a,y=p.__d=!0,p.__h=[],p._sb=[]),I&&p.__s==null&&(p.__s=p.state),I&&B.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=ne({},p.__s)),ne(p.__s,B.getDerivedStateFromProps(E,p.__s))),_=p.props,x=p.state,p.__v=e,y)I&&B.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),I&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(I&&B.getDerivedStateFromProps==null&&E!==_&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(E,W),e.__v==r.__v||!p.__e&&p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(E,p.__s,W)===!1){e.__v!=r.__v&&(p.props=E,p.state=p.__s,p.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(ae){ae&&(ae.__=e)}),Ve.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&o.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(E,p.__s,W),I&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(_,x,F)})}if(p.context=W,p.props=E,p.__P=t,p.__e=!1,z=$.__r,X=0,I)p.state=p.__s,p.__d=!1,z&&z(e),h=p.render(p.props,p.state,p.context),Ve.push.apply(p.__h,p._sb),p._sb=[];else do p.__d=!1,z&&z(e),h=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++X<25);p.state=p.__s,p.getChildContext!=null&&(a=ne(ne({},a),p.getChildContext())),I&&!y&&p.getSnapshotBeforeUpdate!=null&&(F=p.getSnapshotBeforeUpdate(_,x)),V=h!=null&&h.type===ct&&h.key==null?Mr(h.props.children):h,d=Pr(t,lt(V)?V:[V],e,r,a,i,n,o,d,u,c),p.base=e.__e,e.__u&=-161,p.__h.length&&o.push(p),N&&(p.__E=p.__=null)}catch(ae){if(e.__v=null,u||n!=null)if(ae.then){for(e.__u|=u?160:128;d&&d.nodeType==8&&d.nextSibling;)d=d.nextSibling;n[n.indexOf(d)]=null,e.__e=d}else{for(L=n.length;L--;)Ft(n[L]);xt(e)}else e.__e=r.__e,e.__k=r.__k,ae.then||xt(e);$.__e(ae,e,r)}else n==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):d=e.__e=va(r.__e,e,r,a,i,n,o,u,c);return(h=$.diffed)&&h(e),128&e.__u?void 0:d}function xt(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(xt))}function Fr(t,e,r){for(var a=0;a<r.length;a++)zt(r[a],r[++a],r[++a]);$.__c&&$.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(n){n.call(i)})}catch(n){$.__e(n,i.__v)}})}function Mr(t){return typeof t!="object"||t==null||t.__b>0?t:lt(t)?t.map(Mr):ne({},t)}function va(t,e,r,a,i,n,o,d,u){var c,h,p,y,_,x,F,N=r.props||Be,E=e.props,I=e.type;if(I=="svg"?i="http://www.w3.org/2000/svg":I=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),n!=null){for(c=0;c<n.length;c++)if((_=n[c])&&"setAttribute"in _==!!I&&(I?_.localName==I:_.nodeType==3)){t=_,n[c]=null;break}}if(t==null){if(I==null)return document.createTextNode(E);t=document.createElementNS(i,I,E.is&&E),d&&($.__m&&$.__m(e,n),d=!1),n=null}if(I==null)N===E||d&&t.data==E||(t.data=E);else{if(n=n&&dt.call(t.childNodes),!d&&n!=null)for(N={},c=0;c<t.attributes.length;c++)N[(_=t.attributes[c]).name]=_.value;for(c in N)_=N[c],c=="dangerouslySetInnerHTML"?p=_:c=="children"||c in E||c=="value"&&"defaultValue"in E||c=="checked"&&"defaultChecked"in E||Oe(t,c,null,_,i);for(c in E)_=E[c],c=="children"?y=_:c=="dangerouslySetInnerHTML"?h=_:c=="value"?x=_:c=="checked"?F=_:d&&typeof _!="function"||N[c]===_||Oe(t,c,_,N[c],i);if(h)d||p&&(h.__html==p.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(p&&(t.innerHTML=""),Pr(e.type=="template"?t.content:t,lt(y)?y:[y],e,r,a,I=="foreignObject"?"http://www.w3.org/1999/xhtml":i,n,o,n?n[0]:r.__k&&xe(r,0),d,u),n!=null)for(c=n.length;c--;)Ft(n[c]);d||(c="value",I=="progress"&&x==null?t.removeAttribute("value"):x!=null&&(x!==t[c]||I=="progress"&&!x||I=="option"&&x!=N[c])&&Oe(t,c,x,N[c],i),c="checked",F!=null&&F!=t[c]&&Oe(t,c,F,N[c],i))}return t}function zt(t,e,r){try{if(typeof t=="function"){var a=typeof t.__u=="function";a&&t.__u(),a&&e==null||(t.__u=t(e))}else t.current=e}catch(i){$.__e(i,r)}}function zr(t,e,r){var a,i;if($.unmount&&$.unmount(t),(a=t.ref)&&(a.current&&a.current!=t.__e||zt(a,null,e)),(a=t.__c)!=null){if(a.componentWillUnmount)try{a.componentWillUnmount()}catch(n){$.__e(n,e)}a.base=a.__P=null}if(a=t.__k)for(i=0;i<a.length;i++)a[i]&&zr(a[i],e,r||typeof t.type!="function");r||Ft(t.__e),t.__c=t.__=t.__e=void 0}function ya(t,e,r){return this.constructor(t,r)}function ka(t,e,r){var a,i,n,o;e==document&&(e=document.documentElement),$.__&&$.__(t,e),i=(a=!1)?null:e.__k,n=[],o=[],Mt(e,t=e.__k=ma(ct,null,[t]),i||Be,Be,e.namespaceURI,i?null:e.firstChild?dt.call(e.childNodes):null,n,i?i.__e:e.firstChild,a,o),Fr(n,t,o)}function xa(t){function e(r){var a,i;return this.getChildContext||(a=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){a=null},this.shouldComponentUpdate=function(n){this.props.value!=n.value&&a.forEach(function(o){o.__e=!0,kt(o)})},this.sub=function(n){a.add(n);var o=n.componentWillUnmount;n.componentWillUnmount=function(){a&&a.delete(n),o&&o.call(n)}}),r.children}return e.__c="__cC"+Lr++,e.__=t,e.Provider=e.__l=(e.Consumer=function(r,a){return r.children(a)}).contextType=e,e}dt=Ve.slice,$={__e:function(t,e,r,a){for(var i,n,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((n=i.constructor)&&n.getDerivedStateFromError!=null&&(i.setState(n.getDerivedStateFromError(t)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,a||{}),o=i.__d),o)return i.__E=i}catch(d){t=d}throw t}},Ir=0,Ue.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ne({},this.state),typeof t=="function"&&(t=t(ne({},r),this.props)),t&&ne(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),kt(this))},Ue.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),kt(this))},Ue.prototype.render=ct,he=[],Rr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Nr=function(t,e){return t.__v.__b-e.__v.__b},qe.__r=0,ht=Math.random().toString(8),De="__d"+ht,Ne="__a"+ht,jr=/(PointerCapture)$|Capture$/i,Ot=0,vt=tr(!1),yt=tr(!0),Lr=0;var wa=0;function s(t,e,r,a,i,n){e||(e={});var o,d,u=e;if("ref"in u)for(d in u={},e)d=="ref"?o=e[d]:u[d]=e[d];var c={type:t,props:u,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--wa,__i:-1,__u:0,__source:i,__self:n};if(typeof t=="function"&&(o=t.defaultProps))for(d in o)u[d]===void 0&&(u[d]=o[d]);return $.vnode&&$.vnode(c),c}var we,M,pt,rr,We=0,Dr=[],Z=$,ar=Z.__b,ir=Z.__r,nr=Z.diffed,sr=Z.__c,or=Z.unmount,dr=Z.__;function ut(t,e){Z.__h&&Z.__h(M,t,We||e),We=0;var r=M.__H||(M.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function O(t){return We=1,Ca(Ur,t)}function Ca(t,e,r){var a=ut(we++,2);if(a.t=t,!a.__c&&(a.__=[Ur(void 0,e),function(d){var u=a.__N?a.__N[0]:a.__[0],c=a.t(u,d);u!==c&&(a.__N=[c,a.__[1]],a.__c.setState({}))}],a.__c=M,!M.__f)){var i=function(d,u,c){if(!a.__c.__H)return!0;var h=a.__c.__H.__.filter(function(y){return y.__c});if(h.every(function(y){return!y.__N}))return!n||n.call(this,d,u,c);var p=a.__c.props!==d;return h.some(function(y){if(y.__N){var _=y.__[0];y.__=y.__N,y.__N=void 0,_!==y.__[0]&&(p=!0)}}),n&&n.call(this,d,u,c)||p};M.__f=!0;var n=M.shouldComponentUpdate,o=M.componentWillUpdate;M.componentWillUpdate=function(d,u,c){if(this.__e){var h=n;n=void 0,i(d,u,c),n=h}o&&o.call(this,d,u,c)},M.shouldComponentUpdate=i}return a.__N||a.__}function Q(t,e){var r=ut(we++,3);!Z.__s&&Zr(r.__H,e)&&(r.__=t,r.u=e,M.__H.__h.push(r))}function Fe(t){return We=5,oe(function(){return{current:t}},[])}function oe(t,e){var r=ut(we++,7);return Zr(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function Sa(t){var e=M.context[t.__c],r=ut(we++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(M)),e.props.value):t.__}function Ta(){for(var t;t=Dr.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(He),e.__h.some(wt),e.__h=[]}catch(r){e.__h=[],Z.__e(r,t.__v)}}}Z.__b=function(t){M=null,ar&&ar(t)},Z.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),dr&&dr(t,e)},Z.__r=function(t){ir&&ir(t),we=0;var e=(M=t.__c).__H;e&&(pt===M?(e.__h=[],M.__h=[],e.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(e.__h.some(He),e.__h.some(wt),e.__h=[],we=0)),pt=M},Z.diffed=function(t){nr&&nr(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Dr.push(e)!==1&&rr===Z.requestAnimationFrame||((rr=Z.requestAnimationFrame)||Ea)(Ta)),e.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),pt=M=null},Z.__c=function(t,e){e.some(function(r){try{r.__h.some(He),r.__h=r.__h.filter(function(a){return!a.__||wt(a)})}catch(a){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Z.__e(a,r.__v)}}),sr&&sr(t,e)},Z.unmount=function(t){or&&or(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some(function(a){try{He(a)}catch(i){e=i}}),r.__H=void 0,e&&Z.__e(e,r.__v))};var lr=typeof requestAnimationFrame=="function";function Ea(t){var e,r=function(){clearTimeout(a),lr&&cancelAnimationFrame(e),setTimeout(t)},a=setTimeout(r,35);lr&&(e=requestAnimationFrame(r))}function He(t){var e=M,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),M=e}function wt(t){var e=M;t.__c=t.__(),M=e}function Zr(t,e){return!t||t.length!==e.length||e.some(function(r,a){return r!==t[a]})}function Ur(t,e){return typeof e=="function"?e(t):e}var Aa=Symbol.for("preact-signals");function Dt(){if(be>1)be--;else{var t,e=!1;for((function(){var i=Ye;for(Ye=void 0;i!==void 0;)i.S.v===i.v&&(i.S.i=i.i),i=i.o})();je!==void 0;){var r=je;for(je=void 0,Xe++;r!==void 0;){var a=r.u;if(r.u=void 0,r.f&=-3,!(8&r.f)&&Vr(r))try{r.c()}catch(i){e||(t=i,e=!0)}r=a}}if(Xe=0,be--,e)throw t}}var j=void 0;function Hr(t){var e=j;j=void 0;try{return t()}finally{j=e}}var je=void 0,be=0,Xe=0,cr=0,Ye=void 0,Ge=0;function Br(t){if(j!==void 0){var e=t.n;if(e===void 0||e.t!==j)return e={i:0,S:t,p:j.s,n:void 0,t:j,e:void 0,x:void 0,r:e},j.s!==void 0&&(j.s.n=e),j.s=e,t.n=e,32&j.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=j.s,e.n=void 0,j.s.n=e,j.s=e),e}}function G(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}G.prototype.brand=Aa;G.prototype.h=function(){return!0};G.prototype.S=function(t){var e=this,r=this.t;r!==t&&t.e===void 0&&(t.x=r,this.t=t,r!==void 0?r.e=t:Hr(function(){var a;(a=e.W)==null||a.call(e)}))};G.prototype.U=function(t){var e=this;if(this.t!==void 0){var r=t.e,a=t.x;r!==void 0&&(r.x=a,t.e=void 0),a!==void 0&&(a.e=r,t.x=void 0),t===this.t&&(this.t=a,a===void 0&&Hr(function(){var i;(i=e.Z)==null||i.call(e)}))}};G.prototype.subscribe=function(t){var e=this;return Ra(function(){var r=e.value,a=j;j=void 0;try{t(r)}finally{j=a}},{name:"sub"})};G.prototype.valueOf=function(){return this.value};G.prototype.toString=function(){return this.value+""};G.prototype.toJSON=function(){return this.value};G.prototype.peek=function(){var t=j;j=void 0;try{return this.value}finally{j=t}};Object.defineProperty(G.prototype,"value",{get:function(){var t=Br(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(Xe>100)throw new Error("Cycle detected");(function(r){be!==0&&Xe===0&&r.l!==cr&&(r.l=cr,Ye={S:r,v:r.v,i:r.i,o:Ye})})(this),this.v=t,this.i++,Ge++,be++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Dt()}}}});function Zt(t,e){return new G(t,e)}function Vr(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function qr(t){for(var e=t.s;e!==void 0;e=e.n){var r=e.S.n;if(r!==void 0&&(e.r=r),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function Wr(t){for(var e=t.s,r=void 0;e!==void 0;){var a=e.p;e.i===-1?(e.S.U(e),a!==void 0&&(a.n=e.n),e.n!==void 0&&(e.n.p=a)):r=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=a}t.s=r}function Te(t,e){G.call(this,void 0),this.x=t,this.s=void 0,this.g=Ge-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}Te.prototype=new G;Te.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Ge))return!0;if(this.g=Ge,this.f|=1,this.i>0&&!Vr(this))return this.f&=-2,!0;var t=j;try{qr(this),j=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return j=t,Wr(this),this.f&=-2,!0};Te.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}G.prototype.S.call(this,t)};Te.prototype.U=function(t){if(this.t!==void 0&&(G.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}};Te.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};Object.defineProperty(Te.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=Br(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function Xr(t){var e=t.m;if(t.m=void 0,typeof e=="function"){be++;var r=j;j=void 0;try{e()}catch(a){throw t.f&=-2,t.f|=8,Ut(t),a}finally{j=r,Dt()}}}function Ut(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,Xr(t)}function Ia(t){if(j!==this)throw new Error("Out-of-order effect");Wr(this),j=t,this.f&=-2,8&this.f&&Ut(this),Dt()}function Ee(t,e){this.x=t,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=e?.name}Ee.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.m=e)}finally{t()}};Ee.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Xr(this),qr(this),be++;var t=j;return j=this,Ia.bind(this,t)};Ee.prototype.N=function(){2&this.f||(this.f|=2,this.u=je,je=this)};Ee.prototype.d=function(){this.f|=8,1&this.f||Ut(this)};Ee.prototype.dispose=function(){this.d()};function Ra(t,e){var r=new Ee(t,e);try{r.c()}catch(i){throw r.d(),i}var a=r.d.bind(r);return a[Symbol.dispose]=a,a}async function Na(){return await Ae("/api/rules")}async function ja(t){const e=new URLSearchParams;return e.set("path",t),await Ae(Ht("/api/rules/context",e))}async function La(t={}){const e=new URLSearchParams;return t.source!==void 0&&e.set("source",t.source),t.since!==void 0&&e.set("since",String(t.since)),await Ae(Ht("/api/ledger",e))}async function $a(){return await Ae("/api/scan")}async function Pa(){return await Ae("/api/doctor")}async function Oa(t){return await Ua("/api/intent/annotate",t)}async function Fa(t){const e=new URLSearchParams;return t.ledgerId!==void 0&&e.set("ledger_id",t.ledgerId),t.ts!==void 0&&e.set("ts",String(t.ts)),await Ae(Ht("/api/history/state",e))}let ue;function Ma(t,e,r,a,i){let n=!1;const o=new AbortController;let d=!1;const u=Bt({Accept:"text/event-stream"});return e!==null&&e.length>0&&(u["Last-Event-ID"]=e),(async()=>{try{const h=await fetch(t,{headers:u,signal:o.signal});if(!h.ok||h.body===null){c(()=>{i()});return}a();const p=h.body.getReader(),y=new TextDecoder;let _="";for(;!n;){const{done:x,value:F}=await p.read();if(x)break;_+=y.decode(F,{stream:!0}),_=_.replace(/\r\n/g,`
2
- `);let N;for(;(N=_.indexOf(`
3
-
4
- `))>=0;){const E=_.slice(0,N);_=_.slice(N+2),za(E,r)}}}catch{}finally{n||c(()=>{i()})}})(),{close(){n=!0,o.abort()}};function c(h){d||(d=!0,h())}}function za(t,e){let r="message",a="",i="";for(const n of t.split(`
5
- `))n.startsWith("event:")?r=n.slice(6).trim():n.startsWith("data:")?a=a.length>0?`${a}
6
- ${n.slice(5).trim()}`:n.slice(5).trim():n.startsWith("id:")&&(i=n.slice(3).trim());a.length>0&&e(r,a,i)}function Da(){if(ue!==void 0)return ue;const e=window.__FABRIC_AUTH_TOKEN__;if(typeof e=="string"&&e.length>0)return ue=e,ue;const r=new URL(window.location.href),a=r.searchParams,i=a.get("token");if(i!==null&&i.length>0){a.delete("token");const n=a.toString(),o=`${r.pathname}${n.length>0?`?${n}`:""}${r.hash}`;return window.history.replaceState({},document.title,o),ue=i,ue}return ue=null,ue}function Za(t){try{const e=JSON.parse(t);return typeof e.type=="string"&&"payload"in e?e:null}catch{return null}}async function Ae(t){const e=await fetch(t,{headers:Bt({Accept:"application/json"})});return await Yr(e)}async function Ua(t,e){const r=await fetch(t,{method:"POST",headers:Bt({Accept:"application/json","Content-Type":"application/json"}),body:JSON.stringify(e)});return await Yr(r)}async function Yr(t){const e=await t.text(),r=e.length>0?JSON.parse(e):void 0;if(!t.ok)throw new Error(Ha(r,t.status));return r}function Ha(t,e){return t&&typeof t=="object"&&"error"in t&&typeof t.error?.message=="string"?t.error.message:`Fabric API request failed with HTTP ${e}.`}function Ht(t,e){const r=e.toString();return r.length>0?`${t}?${r}`:t}function Bt(t){const e=Da();return e===null?t:{...t,Authorization:`Bearer ${e}`}}const Ba=["meta:updated","lock:drift","lock:approved","ledger:appended","drift:detected"],Va=new Set(Ba),ft=Zt([]),mt=Zt(!1),bt=Zt(0),ur=1e3,qa=3e4,Wa=2;function Xa(){const[t,e]=O({connected:mt.value,lastEvent:ft.value[0]??null,version:bt.value}),r=Fe(null),a=Fe(ur),i=Fe(void 0),n=Fe(!0);return Q(()=>{n.current=!0;const o=h=>{mt.value=h,e(p=>({...p,connected:h}))},d=(h,p,y)=>{if(!Va.has(h))return;y.length>0&&(r.current=y);const _=Za(p);_!==null&&(ft.value=[_,...ft.value].slice(0,50),bt.value+=1,e({connected:mt.value,lastEvent:_,version:bt.value}))};let u=null;const c=()=>{n.current&&(u=Ma("/events",r.current,d,()=>{n.current&&(a.current=ur,o(!0))},()=>{if(!n.current)return;o(!1);const h=a.current;a.current=Math.min(a.current*Wa,qa),i.current=setTimeout(c,h)}))};return c(),()=>{n.current=!1,clearTimeout(i.current),u?.close(),o(!1)}},[]),t}var Ya={"cli.main.description":"Fabric CLI - AI agent collaboration framework","cli.shared.created":"Created","cli.shared.skipped":"Skipped","cli.shared.next":"Next","cli.shared.reason":"Reason","cli.shared.updated":"Updated","cli.shared.missing":"missing","cli.shared.present":"present","cli.shared.absent":"missing","cli.shared.yes":"yes","cli.shared.no":"no","cli.shared.none":"none","cli.shared.loading":"loading","cli.shared.refresh":"Refresh","cli.shared.target-invalid":"Target must be an existing directory: {target}","cli.shared.template-not-found":"Template not found: {path}","cli.shared.invalid-host-empty":"Invalid host: <empty>","cli.shared.invalid-port":"Invalid port: {value}","cli.approve.description":"Approve drifted human-lock entries from the command line.","cli.approve.args.all.description":"Approve all drifted human-lock entries without prompting.","cli.approve.args.interactive.description":"Prompt before approving each drifted human-lock entry.","cli.approve.args.target.description":"Target project path, default is the current working directory.","cli.approve.no-drift":"No drift entries found.","cli.approve.prompt":"Approve this entry? [y/N] ","cli.approve.approved-one":"Approved {location}","cli.approve.skipped-one":"Skipped {location}","cli.approve.summary":"Approved {approved}/{total} drift entries. Skipped {skipped}.","cli.approve.table.expected":"Expected","cli.approve.table.current":"Current","cli.bootstrap.description":"Install Fabric bootstrap prompts for supported AI clients.","cli.bootstrap.install.description":"Copy Fabric bootstrap templates into native client locations.","cli.bootstrap.install.args.clients.description":"Optional comma-separated client filter, for example claude,cursor,codex.","cli.bootstrap.install.no-targets":"No bootstrap targets detected. Pass --clients claude,cursor,codex to install explicitly.","cli.bootstrap.install.installed":"Installed {path}","cli.bootstrap.install.skipped-header":"Skipped {path}: Fabric Bootstrap header already present.","cli.bootstrap.install.prepended":"Prepended {path}","cli.bootstrap.errors.unknown-client":'Unknown client "{client}". Use a comma-separated list such as claude,cursor,codex.',"cli.config.description":"Manage Fabric MCP client configuration.","cli.config.clients.claude":"Claude Code CLI","cli.config.install.description":"Install Fabric MCP server entries into detected client configs.","cli.config.install.args.clients.description":"Optional comma-separated client filter, for example cursor,codex.","cli.config.install.args.dry-run.description":"Preview detected write operations without modifying files.","cli.config.errors.unknown-client":'Unknown client "{client}". Use a comma-separated list such as cursor,codex.',"cli.config.errors.expected-object":"Expected object in {path}","cli.config.install.no-configs":"No Fabric MCP client config detected. Create the client directory or set clientPaths in fabric.config.json.","cli.config.install.no-config-path":"Skipping {client}: no config path detected.","cli.config.install.dry-run":"[dry-run] {client}: would write {path}","cli.config.install.wrote":"{client}: wrote {path}","cli.doctor.description":"Run Fabric target-state diagnostics.","doctor.section.fixable":"Fixable errors:","doctor.section.manual":"Manual errors:","doctor.section.warnings":"Warnings:","cli.doctor.args.target.description":"Target project path. Defaults to CLI arg, EXTERNAL_FIXTURE_PATH, fabric.config.json, then cwd.","cli.doctor.args.fix.description":"Repair deterministic derived Fabric state, including meta, rule-test index, bootstrap, and events ledger.","cli.doctor.args.json.description":"Print the doctor report as JSON.","cli.doctor.args.strict.description":"Treat warnings as failures.","cli.doctor.args.force.description":"Run even if a serve process appears to hold the lock.","cli.hooks.description":"Manage Fabric Git hook templates.","cli.hooks.install.description":"Install the Fabric Husky pre-commit hook template.","cli.hooks.install.args.target.description":"Target project path, default is the current working directory.","cli.hooks.errors.package-json-required":"package.json is required to install hooks: {path}","cli.hooks.install.hook-skipped":"Fabric hook already present in {path}, skipped.","cli.hooks.install.hook-appended":"Appended Fabric hook to existing {path}","cli.hooks.install.hook-created":"Created {path}","cli.hooks.install.prepare-left":"Left existing prepare script unchanged in {path}","cli.hooks.install.prepare-added":"Added prepare script to {path}","cli.human-lint.description":"Validate locked human-edit regions.","cli.human-lint.args.target.description":"Target project path, default is the current working directory.","cli.human-lint.drift-detected":"Human-locked content drift detected. Revert the edit or update approved hashes before committing.","cli.human-lint.table.location":"Location","cli.human-lint.table.expected":"Expected","cli.human-lint.table.got":"Got","cli.init.description":"Initialize Fabric in the target project.","cli.init.args.target.description":"Target project path. Defaults to CLI arg, EXTERNAL_FIXTURE_PATH, fabric.config.json, then cwd.","cli.init.args.debug.description":"Print target resolution details to stderr.","cli.init.args.force.description":"Overwrite existing files (bypass non-destructive guard)","cli.init.args.yes.description":"Accept the current init plan and run without the TTY wizard","cli.init.args.plan.description":"Print the init plan without writing files or running follow-up stages","cli.init.args.reapply.description":"Reapply Fabric-managed files and stage installers over an existing setup","cli.init.args.no-bootstrap.description":"Compatibility flag: remove bootstrap from the init plan","cli.init.args.no-mcp.description":"Compatibility flag: remove MCP configuration from the init plan","cli.init.args.no-hooks.description":"Compatibility flag: remove git hooks from the init plan","cli.init.args.interactive.description":"Compatibility flag: disable the TTY wizard and use direct execution","cli.init.mcp.install.global":"Using globally-installed @fenglimg/fabric-server","cli.init.mcp.install.local":"Installing @fenglimg/fabric-server to project devDependencies","cli.init.mcp.install.prompt":"MCP server install scope (global|local)","cli.init.mcp.install.invalid":'Invalid --mcp-install value "{value}" — falling back to global',"cli.init.mcp.local.installing":"Running {manager} add -D @fenglimg/fabric-server...","cli.init.mcp.local.installed":"Installed to devDependencies","cli.init.mcp.scope.description":"Claude MCP config scope: project (writes .mcp.json) or user (writes ~/.claude.json)","cli.init.mcp.scope.invalid":'Invalid --scope value "{value}" — falling back to project',"cli.init.mcp.scope.project":"Writes .mcp.json in project root (per Claude Code spec)","cli.init.mcp.scope.user":"Writes ~/.claude.json (user-scoped, applies to all projects)","cli.init.wizard.mcp-scope":"Claude MCP config scope (project/.mcp.json or user/~/.claude.json) [{defaultValue}]","cli.init.created-path":"{label} {path}","cli.init.skipped-existing-path":"{label} {path}: already exists.","cli.init.force.overwritten":"Overwritten","cli.init.force.warning":"--force will overwrite existing Fabric artifacts in {path}","cli.init.stages.bootstrap":"Installing bootstrap templates...","cli.init.stages.mcp":"Configuring MCP clients...","cli.init.stages.hooks":"Installing git hooks...","cli.init.stages.skipped":"skipped","cli.init.stages.completed":"completed","cli.init.stages.failed":"failed","cli.init.stages.summary.ran":"ran","cli.init.stages.summary.skipped":"skipped","cli.init.stages.summary.failed":"failed","cli.init.next-step":"{label} {message}","cli.init.reason-message":"{label} {message}","cli.init.plan.title":"Fabric init plan","cli.init.plan.mode-banner.default":"[mode: apply] Standard init execution","cli.init.plan.mode-banner.plan":"[mode: plan] Dry run only, no files will be written","cli.init.plan.mode-banner.reapply":"[mode: reapply] Force reapplying Fabric-managed assets","cli.init.plan.mode-banner.plan-reapply":"[mode: plan+reapply] Previewing a forced reapply without writing files","cli.init.plan.target":"Target: {target}","cli.init.plan.actions":"Plan: bootstrap={bootstrap} mcp={mcp} hooks={hooks} mcp-install={mcpInstall}","cli.init.plan.detected":"Detected clients: {clients}","cli.init.plan.writes":"Core writes:","cli.init.plan.preview-title":"Fabric init dry run","cli.init.plan.preview-result":"Mode={mode} bootstrap={bootstrap} mcp={mcp} hooks={hooks}","cli.init.mode.default":"default","cli.init.mode.reapply":"reapply","cli.init.mode.badge.default":"APPLY","cli.init.mode.badge.plan":"PLAN","cli.init.mode.badge.reapply":"REAPPLY","cli.init.mode.badge.plan-reapply":"PLAN + REAPPLY","cli.init.compat.plan":"Using standard --plan mode: no files will be written.","cli.init.compat.interactive":"Compatibility: --interactive=false disables the TTY wizard.","cli.init.compat.legacy-stage-flags":"Compatibility: legacy --no-* flags are being mapped into the init plan.","cli.init.wizard.title":"Fabric init wizard","cli.init.wizard.intro":"Fabric init","cli.init.wizard.overview.title":"Install overview","cli.init.wizard.overview.body":`Target: {target}
7
- Mode: {mode}
8
- This wizard only reshapes the init plan; execution still runs through the existing Fabric init stages.`,"cli.init.wizard.step.target":"Confirm target","cli.init.wizard.step.plan":"Shape init plan","cli.init.wizard.step.review":"Review final plan","cli.init.wizard.target.confirm":"Continue initializing Fabric in {target}? [Y/n]","cli.init.wizard.stage.bootstrap":"Install bootstrap templates? [{defaultValue}]","cli.init.wizard.stage.mcp":"Configure MCP clients? [{defaultValue}]","cli.init.wizard.stage.hooks":"Install git hooks? [{defaultValue}]","cli.init.wizard.mcp-install":"MCP server install scope (global/local) [{defaultValue}]","cli.init.wizard.execute.confirm":"Execute this init plan now? [Y/n]","cli.init.wizard.outro":"Init plan accepted. Running Fabric init...","cli.init.wizard.invalid-yes-no":"Please answer yes or no.","cli.init.wizard.invalid-select":"Invalid value. Use one of: {options}.","cli.init.wizard.cancelled":"Fabric init cancelled before execution.","cli.init.capabilities.title":"Client capability summary","cli.init.capabilities.none":"No supported client was detected for bootstrap or MCP follow-up.","cli.init.capabilities.header.client":"Client","cli.init.capabilities.header.bootstrap":"Bootstrap","cli.init.capabilities.header.mcp":"MCP","cli.init.capabilities.header.hook":"Hook","cli.init.capabilities.header.skill":"Skill","cli.init.capabilities.header.follow-up":"Follow-up","cli.init.capabilities.status.ready":"ready","cli.init.capabilities.status.installed":"installed","cli.init.capabilities.status.supported":"supported","cli.init.capabilities.status.manual":"manual","cli.init.capabilities.status.skipped":"skipped","cli.init.capabilities.status.failed":"failed","cli.init.capabilities.status.na":"n/a","cli.init.capabilities.follow-up.ready":"continue in client","cli.init.capabilities.follow-up.install":"install client assets","cli.init.capabilities.follow-up.manual":"manual step required","cli.init.next-step.message":"run fab hooks install to add the Day 4 pre-commit pipeline.","cli.init.reason-message.claude-body":".fabric/forensic.json is ready; use the fabric-init skill to finish internal Fabric initialization.","cli.init.reason-message.codex-body":".fabric/forensic.json is ready; continue with the repo skill at .codex/skills/fabric-init/SKILL.md and enable features.codex_hooks = true for Codex hooks.","cli.init.reason-message.multi-body":".fabric/forensic.json is ready; continue in your installed client flow: Claude can use fabric-init, and Codex can use .codex/skills/fabric-init/SKILL.md with features.codex_hooks = true.","cli.init.reason-message.installable-body":".fabric/forensic.json is ready; some detected clients support Fabric follow-up but still need client assets installed.","cli.init.reason-message.manual-body":".fabric/forensic.json is ready; some detected clients still need manual follow-up because no Fabric skill is installed for them yet.","cli.init.codex-hooks.created":"{label} {path} with Codex hooks config (requires features.codex_hooks = true).","cli.init.codex-hooks.updated":"{label} {path} with Codex hooks config (requires features.codex_hooks = true).","cli.init.codex-hooks.skipped":"{label} {path}: Codex hooks config already present.","cli.init.claude-settings.created":"{label} {path} with Claude Stop hook.","cli.init.claude-settings.updated":"{label} {path} with Claude Stop hook.","cli.init.claude-settings.skipped":"{label} {path}: Claude Stop hook already present.","cli.init.claude-settings.skipped-invalid":"{label} {path}: unable to merge Claude Stop hook.","cli.init.claude-settings.invalid-object":"{label} {path}: expected a JSON object.","cli.init.claude-settings.invalid-json":"{label} {path}: invalid JSON ({reason}).","cli.init.claude-settings.invalid-hooks":'{label} {path}: "hooks" must be a JSON object.',"cli.init.claude-settings.invalid-stop-array":'{label} {path}: "hooks.Stop" must be an array.',"cli.init.errors.abort-existing":"ABORT: {path} already exists. fab init is non-destructive.","cli.ledger-append.description":"Append an entry to the Fabric intent ledger.","cli.ledger-append.args.target.description":"Target project path, default is the current working directory.","cli.ledger-append.args.staged.description":"Derive the entry from staged changes (used during pre-commit).","cli.ledger-append.requires-staged":"requires --staged in pre-commit context","cli.ledger-append.intent.auto":"auto: {head}{suffix}","cli.ledger-append.intent.auto-more":" +{count} more","cli.pre-commit.description":"Composite pre-commit hook: runs sync-meta --check-only, human-lint, and ledger-append --staged in one Node process.","cli.pre-commit.args.target.description":"Project root directory, defaults to cwd or EXTERNAL_FIXTURE_PATH.","cli.pre-commit.run-failed":"fabric pre-commit: {name} failed - {message}","cli.scan.description":"Scan the project to detect Fabric bootstrap candidates.","cli.scan.args.target.description":"Target absolute path. Defaults to CLI arg, EXTERNAL_FIXTURE_PATH, fabric.config.json, then cwd.","cli.scan.args.debug.description":"Print detection evidence in formatted output.","cli.scan.args.json.description":"Print the diagnostic report as JSON.","cli.scan.report.title":"Fabric scan report","cli.scan.report.target":"Target","cli.scan.report.framework":"Framework","cli.scan.report.evidence":"Evidence","cli.scan.report.readme-quality":"README quality","cli.scan.report.contributing":"CONTRIBUTING.md","cli.scan.report.files-counted":"Files counted","cli.scan.report.ignored-entries":"Ignored entries","cli.scan.report.existing-fabric":"Existing Fabric files","cli.scan.report.recommendations":"Recommendations:","cli.scan.readme-quality.ok":"ok","cli.scan.readme-quality.stub":"stub","cli.scan.recommendation.init":"L0: Run fab init to scaffold .fabric/bootstrap/README.md with TODO markers.","cli.scan.recommendation.readme":"L0: Expand README.md before promoting project facts into Fabric references.","cli.scan.recommendation.contributing":"L0: Add CONTRIBUTING.md or leave a bootstrap TODO reference for contribution flow.","cli.scan.recommendation.unknown-framework":"L1: Add tech-stack TODOs manually because no framework marker was detected.","cli.scan.recommendation.framework-dirs":"L1: Review {framework} directories for future scoped Fabric rule files.","cli.serve.description":"Start the local Fabric MCP HTTP service. Set FABRIC_AUTH_TOKEN to enable Bearer auth for non-localhost binding.","cli.serve.args.port.description":"Listen port, default 7373.","cli.serve.args.host.description":"Listen host, default 127.0.0.1. Set FABRIC_AUTH_TOKEN to enable Bearer auth for non-localhost binding.","cli.serve.args.target.description":"Target project path. Defaults to CLI arg, EXTERNAL_FIXTURE_PATH, fabric.config.json, then cwd.","cli.serve.args.debug.description":"Print target resolution details to stderr.","cli.serve.args.force.description":"Force-acquire the serve lock even if another serve process appears to be running.","cli.serve.ready.title":"Fabric Dashboard","cli.serve.warning.host-fallback":"--host {host} requires FABRIC_AUTH_TOKEN; falling back to 127.0.0.1 for safety","cli.serve.error.port-in-use":"Port {port} in use - try --port {nextPort}","cli.update.description":"Refresh MCP host configuration and git hooks without re-creating Fabric files.","cli.update.args.target.description":"Target project path. Defaults to CLI arg, EXTERNAL_FIXTURE_PATH, fabric.config.json, then cwd.","cli.update.args.no-mcp.description":"Skip re-configuring MCP clients","cli.update.args.no-hooks.description":"Skip re-installing git hooks","cli.sync-meta.description":"Sync Fabric metadata from internal rule files.","cli.sync-meta.args.target.description":"Target project path, default is the current working directory.","cli.sync-meta.args.check-only.description":"Exit with code 1 when .fabric/agents.meta.json is out of date.","cli.sync-meta.drift-detected":"Fabric metadata drift detected. Run fab sync-meta to update.","cli.sync-meta.updated":"{label} {path}","dashboard.app.nav.aria-label":"Dashboard views","dashboard.app.nav.readiness.label":"Readiness","dashboard.app.nav.readiness.label-bilingual":"准备情况 Readiness","dashboard.app.nav.readiness.subtitle":"project status","dashboard.app.nav.rules-explain.label":"Rules Explain","dashboard.app.nav.rules-explain.label-bilingual":"规则解析 Rules Explain","dashboard.app.nav.rules-explain.subtitle":"topology & context","dashboard.app.nav.timeline.label":"Timeline","dashboard.app.nav.timeline.label-bilingual":"时间线 Timeline","dashboard.app.nav.timeline.subtitle":"audit & history","dashboard.app.nav.health.label":"Health","dashboard.app.nav.health.label-bilingual":"系统健康 Health","dashboard.app.nav.health.subtitle":"doctor & diagnostics","dashboard.app.nav.section.insights":"Insights","dashboard.app.nav.drift-check":"Drift Check","dashboard.app.nav.modules.read-only":"read-only dashboard","dashboard.app.header.connected":"CONNECTED","dashboard.app.header.connecting":"CONNECTING","dashboard.app.live-region.received":"Received {type}","dashboard.app.breadcrumb.readiness":"readiness","dashboard.app.breadcrumb.rules-explain":"rules-explain","dashboard.app.breadcrumb.timeline":"timeline","dashboard.app.breadcrumb.health":"health","dashboard.rule-topology.title":"Rule Topology","dashboard.rule-topology.subtitle":"See which rules match the current path and why","dashboard.rule-topology.path.placeholder":"Sample path for rules context","dashboard.rule-topology.path.aria-label":"Rules context sample path","dashboard.rule-topology.status.sample":"current path {path}","dashboard.rule-topology.status.hits":"{count} hits","dashboard.rule-topology.status.revision":"version {revision}","dashboard.rule-topology.heatmap.title":"Coverage Heatmap","dashboard.rule-topology.heatmap.subtitle":"Heuristic directory coverage derived from scope_glob patterns","dashboard.rule-topology.heatmap.aria-label":"Directory coverage heatmap","dashboard.rule-topology.heatmap.count":"{count} directories","dashboard.rule-topology.heatmap.rules":"{count} rules","dashboard.rule-topology.heatmap.uncovered":"no matching scope","dashboard.rule-topology.heatmap.empty":"No rule directories available.","dashboard.rule-topology.heatmap.density.full":"covered","dashboard.rule-topology.heatmap.density.partial":"partial","dashboard.rule-topology.heatmap.density.none":"uncovered","dashboard.rule-topology.hit-reason.title":"Hit Reasons","dashboard.rule-topology.hit-reason.subtitle":"Why each rule was loaded for the current sample path","dashboard.rule-topology.hit-reason.aria-label":"Rule hit reasons","dashboard.rule-topology.hit-reason.count":"{count} reasons","dashboard.rule-topology.hit-reason.empty":"No rules loaded for this sample path.","dashboard.rule-topology.hit-reason.global":"Global","dashboard.rule-topology.hit-reason.tier.always":"Always-on","dashboard.rule-topology.hit-reason.tier.path":"Glob","dashboard.rule-topology.hit-reason.tier.description":"Description","dashboard.module-placeholder.coming-soon":"Reserved","dashboard.module-placeholder.read-only":"Reserved for future read-only dashboard capabilities.","dashboard.module-placeholder.forensic.title":"Cognitive Forensic","dashboard.module-placeholder.forensic.subtitle":"Coming later","dashboard.module-placeholder.semantic.title":"Semantic Timeline","dashboard.module-placeholder.semantic.subtitle":"Coming later","dashboard.module-placeholder.ledger.title":"Historical Ledger","dashboard.module-placeholder.ledger.subtitle":"Coming later","dashboard.rules-tree.title":"Rules Tree","dashboard.rules-tree.subtitle":"Browse the rule structure, hierarchy, and sync state from .fabric/agents.meta.json","dashboard.rules-tree.filter.placeholder":"Filter by file, glob, priority, hash...","dashboard.rules-tree.filter.aria-label":"Filter rules tree","dashboard.rules-tree.status.loading":"loading rules","dashboard.rules-tree.status.nodes":"{count} nodes · version {revision}","dashboard.rules-tree.status.locks":"{count} protected regions","dashboard.rules-tree.empty":"No matching rules found.","dashboard.rules-tree.tree.aria-label":"Fabric rules tree","dashboard.rules-tree.detail.title":"Node Detail","dashboard.rules-tree.detail.empty":"Select a rule node to inspect scope, dependencies, priority and hash.","dashboard.rules-tree.detail.file":"file","dashboard.rules-tree.detail.scope":"scope","dashboard.rules-tree.detail.priority":"priority","dashboard.rules-tree.detail.hash":"hash","dashboard.rules-tree.detail.no-deps":"no deps","dashboard.human-lock.title":"Human Protection","dashboard.human-lock.subtitle":"Review protected regions that require human confirmation","dashboard.human-lock.filters.aria-label":"Human lock filters","dashboard.human-lock.filters.all":"all","dashboard.human-lock.filters.drift":"drift","dashboard.human-lock.filters.approved":"approved","dashboard.human-lock.summary":"{drift} drift · {approved} confirmed","dashboard.human-lock.empty":"No human lock entries for this filter.","dashboard.intent-timeline.title":"Intent Timeline","dashboard.intent-timeline.subtitle":"Review AI and human change records in reverse chronological order","dashboard.intent-timeline.filter.label":"Source","dashboard.intent-timeline.filter.all":"All","dashboard.intent-timeline.summary":"AI {aiCount} · Human {humanCount}","dashboard.intent-timeline.columns.ai.title":"AI","dashboard.intent-timeline.columns.ai.entries":"{count} entries","dashboard.intent-timeline.columns.human.title":"Human","dashboard.intent-timeline.columns.human.entries":"{count} entries","dashboard.intent-timeline.empty":"No ledger entries found.","dashboard.intent-timeline.annotate.missing-id":"Cannot annotate a ledger entry without an id.","dashboard.history-replay.title":"History Replay","dashboard.history-replay.subtitle":"Review the rules tree state at any recorded point in history","dashboard.history-replay.toolbar.scrub":"Scrub","dashboard.history-replay.toolbar.latest":"Latest","dashboard.history-replay.selected.none":"No historical entry selected","dashboard.history-replay.status.replay-points":"{count} replay points","dashboard.history-replay.status.entries-applied":"{count} entries applied","dashboard.history-replay.empty.entries":"No ledger entries found for replay.","dashboard.history-replay.state.title":"Viewing state as of {label}","dashboard.history-replay.state.meta":"record {ledgerId} · commit {commit} · {mode}","dashboard.history-replay.status.loading":"loading snapshot","dashboard.history-replay.status.nodes":"{count} nodes","dashboard.history-replay.status.unknown-revision":"unknown version","dashboard.history-replay.tree.aria-label":"Historical Fabric rules tree","dashboard.history-replay.empty.loading":"Loading historical snapshot...","dashboard.history-replay.empty.select":"Select a timeline entry to replay its state.","dashboard.history-replay.meta.not-available":"unavailable","dashboard.history-replay.meta.pending":"pending","dashboard.history-replay.meta.na":"n/a","dashboard.doctor.title":"Doctor Console","dashboard.doctor.subtitle":"Check framework, entry points, version drift, and protected paths","dashboard.doctor.toolbar.overall":"Overall","dashboard.doctor.toolbar.no-summary":"No summary yet","dashboard.doctor.toolbar.entry-points-summary":"{framework} · {count} entry points","dashboard.doctor.toolbar.entry-point-summary":"{framework} · {count} entry point","dashboard.doctor.empty.loading":"Loading doctor report...","dashboard.doctor.summary.framework":"Framework","dashboard.doctor.summary.protected-paths":"Protected paths","dashboard.doctor.summary.intent-ledger":"Intent ledger","dashboard.doctor.summary.no-meta-revision":"No metadata version yet","dashboard.doctor.summary.tracked-paths.none":"No tracked paths","dashboard.doctor.summary.tracked-paths.some":"{count} tracked","dashboard.doctor.summary.hashes-intact":"All approved hashes intact","dashboard.doctor.summary.drifted":"{count} drifted","dashboard.doctor.summary.no-ledger-entries":"No ledger entries yet","dashboard.doctor.card.entry-points":"Entry points","dashboard.doctor.card.checks":"Checks","dashboard.doctor.empty.entry-points":"No current entry points detected.","dashboard.doctor.framework.unknown":"unknown","dashboard.doctor.age.none":"No entries","dashboard.doctor.age.seconds":"{count}s ago","dashboard.doctor.age.minutes":"{count}m ago","dashboard.doctor.age.hours":"{count}h ago","dashboard.doctor.age.days":"{count}d ago","dashboard.doctor.age.weeks":"{count}w ago","dashboard.shared.refresh":"Refresh","dashboard.shared.loading":"loading","dashboard.shared.status.ok":"ok","dashboard.shared.status.warn":"warn","dashboard.shared.status.error":"error","dashboard.shared.status.confirmed":"confirmed","dashboard.shared.status.hash-drift":"hash drift","dashboard.shared.status.stale":"stale","dashboard.shared.status.orphan":"orphan","dashboard.shared.status.attention":"attention","dashboard.source.ai":"AI","dashboard.source.human":"Human","dashboard.timeline-entry.aria-label":"{source} intent {intent}","dashboard.timeline-entry.working-tree":"working tree","dashboard.timeline-entry.parent":"parent {parent}","dashboard.timeline-entry.paths":"paths","dashboard.timeline-entry.annotate":"Annotate","dashboard.timeline-entry.annotation-label":"Human annotation","dashboard.timeline-entry.annotation-placeholder":"Explain review outcome or approval context...","dashboard.timeline-entry.annotation-save":"Save annotation","dashboard.tree-node.locked":"locked","dashboard.tree-node.stale.hash-mismatch":"hash mismatch","dashboard.tree-node.stale.orphan":"orphan","dashboard.lock-card.aria-label":"{file} {lineRange} {status}","dashboard.lock-card.status.drift":"hash drift","dashboard.lock-card.status.confirmed":"confirmed","dashboard.lock-card.hash.locked":"locked hash","dashboard.lock-card.hash.current":"current hash","dashboard.lock-card.hash.diff":"diff","dashboard.lock-card.preview.drift":"DRIFT","dashboard.lock-card.preview.sync":"SYNC","dashboard.lock-card.preview.drift-detail":"Hash differs from protected region.","dashboard.lock-card.preview.sync-detail":"Protected region is in sync.","dashboard.lock-card.footer.region":"protected region · {count} lines","dashboard.lock-card.button.approve":"Approve new hash","dashboard.lock-card.button.confirmed":"Confirmed","dashboard.lock-card.diff.hash-mismatch":"hash mismatch","dashboard.lock-card.diff.no-changes":"no changes","dashboard.lock-card.diff.with-bytes":"+{added} / -{removed} · {bytes} bytes","dashboard.lock-card.diff.without-bytes":"+{added} / -{removed}","dashboard.approve-button.retry":"Retry","dashboard.readiness.filter.analysis":"Project Analysis","dashboard.readiness.loading":"Loading scan data...","dashboard.readiness.summary.framework":"Framework","dashboard.readiness.summary.files":"Files","dashboard.readiness.summary.status":"Fabric Status","dashboard.readiness.card.evidence":"Readiness Evidence","dashboard.readiness.card.recommendations":"Recommendations & Next Steps","dashboard.readiness.readme.description":"Quality of project documentation","dashboard.readiness.contributing.description":"Contribution guidelines for AI/Human","dashboard.readiness.fully-ready":"Project is fully ready.","dashboard.readiness.init-prompt":"Run this command to initialize:","dashboard.rules-explain.analyze":"Analyze Path","dashboard.rules-explain.detail.topology-type":"Topology Type","dashboard.timeline.history-replay.title":"History Replay","dashboard.timeline.close":"Close","dashboard.health.ledger-path.label":"Event Ledger Path","dashboard.health.ledger-path.detail":"Append-only timeline source","dashboard.health.boundary.title":"Control Plane Boundaries","dashboard.health.boundary.description":"The Web Dashboard operates as a Viewer. All rules, metadata, and fixes must be managed via the CLI.","dashboard.health.boundary.cli-action":"CLI Action Required:","dashboard.health.boundary.cli-prompt":"You have {count} fixable issues. Run the following command in your terminal to repair metadata automatically.","dashboard.health.runtime.connected":"MCP Runtime Connected","dashboard.health.runtime.disconnected":"MCP Runtime Disconnected"},Ga={"cli.main.description":"Fabric CLI - AI 智能体协作框架","cli.shared.created":"已创建","cli.shared.skipped":"已跳过","cli.shared.next":"下一步","cli.shared.reason":"原因","cli.shared.updated":"已更新","cli.shared.missing":"缺失","cli.shared.present":"存在","cli.shared.absent":"缺失","cli.shared.yes":"是","cli.shared.no":"否","cli.shared.none":"无","cli.shared.loading":"加载中","cli.shared.refresh":"刷新","cli.shared.target-invalid":"目标必须是已存在的目录:{target}","cli.shared.template-not-found":"未找到模板:{path}","cli.shared.invalid-host-empty":"无效 host:<empty>","cli.shared.invalid-port":"无效端口:{value}","cli.approve.description":"从命令行批准已漂移的 human-lock 记录。","cli.approve.args.all.description":"不提示,批准所有已漂移的 human-lock 记录。","cli.approve.args.interactive.description":"逐条提示后批准已漂移的 human-lock 记录。","cli.approve.args.target.description":"目标项目路径,默认为当前工作目录。","cli.approve.no-drift":"未发现漂移记录。","cli.approve.prompt":"批准此记录?[y/N] ","cli.approve.approved-one":"已批准 {location}","cli.approve.skipped-one":"已跳过 {location}","cli.approve.summary":"已批准 {approved}/{total} 条漂移记录。已跳过 {skipped} 条。","cli.approve.table.expected":"预期","cli.approve.table.current":"当前","cli.bootstrap.description":"为支持的 AI 客户端安装 Fabric 引导提示模板。","cli.bootstrap.install.description":"将 Fabric 引导模板复制到各客户端的原生位置。","cli.bootstrap.install.args.clients.description":"可选的逗号分隔客户端过滤器,例如 claude,cursor,codex。","cli.bootstrap.install.no-targets":"未检测到可安装的 bootstrap 目标。可显式传入 --clients claude,cursor,codex。","cli.bootstrap.install.installed":"已安装 {path}","cli.bootstrap.install.skipped-header":"已跳过 {path}:Fabric Bootstrap 头部已存在。","cli.bootstrap.install.prepended":"已前置写入 {path}","cli.bootstrap.errors.unknown-client":"未知客户端“{client}”。请使用逗号分隔列表,例如 claude,cursor,codex。","cli.config.description":"管理 Fabric MCP 客户端配置。","cli.config.clients.claude":"Claude Code CLI","cli.config.install.description":"将 Fabric MCP 服务端条目安装到检测到的客户端配置中。","cli.config.install.args.clients.description":"可选的逗号分隔客户端过滤器,例如 cursor,codex。","cli.config.install.args.dry-run.description":"仅预览将要发生的写入操作,不修改文件。","cli.config.errors.unknown-client":"未知客户端“{client}”。请使用逗号分隔列表,例如 cursor,codex。","cli.config.errors.expected-object":"{path} 中应为对象。","cli.config.install.no-configs":"未检测到 Fabric MCP 客户端配置。请创建客户端目录,或在 fabric.config.json 中设置 clientPaths。","cli.config.install.no-config-path":"跳过 {client}:未检测到配置路径。","cli.config.install.dry-run":"[dry-run] {client}:将写入 {path}","cli.config.install.wrote":"{client}:已写入 {path}","cli.doctor.description":"运行 Fabric 目标态诊断。","doctor.section.fixable":"可修复错误:","doctor.section.manual":"需手动修复:","doctor.section.warnings":"警告:","cli.doctor.args.target.description":"目标项目路径。默认依次使用 CLI 参数、EXTERNAL_FIXTURE_PATH、fabric.config.json、当前目录。","cli.doctor.args.fix.description":"修复确定性派生的 Fabric 状态,包括 meta、rule-test index、bootstrap 和 events ledger。","cli.doctor.args.json.description":"以 JSON 输出 doctor 报告。","cli.doctor.args.strict.description":"将 warning 也视为失败。","cli.doctor.args.force.description":"即使 serve 进程持有锁,也强制运行。","cli.hooks.description":"管理 Fabric Git 钩子模板。","cli.hooks.install.description":"安装 Fabric Husky pre-commit 钩子模板。","cli.hooks.install.args.target.description":"目标项目路径,默认为当前工作目录。","cli.hooks.errors.package-json-required":"安装 hooks 需要 package.json:{path}","cli.hooks.install.hook-skipped":"{path} 中已存在 Fabric hook,已跳过。","cli.hooks.install.hook-appended":"已向现有 {path} 追加 Fabric hook","cli.hooks.install.hook-created":"已创建 {path}","cli.hooks.install.prepare-left":"保留 {path} 中原有的 prepare 脚本不变","cli.hooks.install.prepare-added":"已向 {path} 添加 prepare 脚本","cli.human-lint.description":"验证锁定的人工编辑区块。","cli.human-lint.args.target.description":"目标项目路径,默认为当前工作目录。","cli.human-lint.drift-detected":"检测到 human-lock 内容漂移。请回退编辑,或在提交前更新已批准的哈希。","cli.human-lint.table.location":"位置","cli.human-lint.table.expected":"预期","cli.human-lint.table.got":"实际","cli.init.description":"在目标项目中初始化 Fabric。","cli.init.args.target.description":"目标项目路径。默认依次使用 CLI 参数、EXTERNAL_FIXTURE_PATH、fabric.config.json、当前目录。","cli.init.args.debug.description":"将目标解析细节输出到 stderr。","cli.init.args.force.description":"覆盖现有文件(绕过非破坏性保护)","cli.init.args.yes.description":"接受当前初始化计划并跳过 TTY 向导直接执行","cli.init.args.plan.description":"仅输出初始化计划,不写文件也不执行后续阶段","cli.init.args.reapply.description":"在已有 setup 上重新应用 Fabric 管理的文件和阶段安装器","cli.init.args.no-bootstrap.description":"兼容标志:从初始化计划中移除 bootstrap","cli.init.args.no-mcp.description":"兼容标志:从初始化计划中移除 MCP 配置","cli.init.args.no-hooks.description":"兼容标志:从初始化计划中移除 git hooks","cli.init.args.interactive.description":"兼容标志:禁用 TTY 向导并直接执行","cli.init.mcp.install.global":"使用全局安装的 @fenglimg/fabric-server","cli.init.mcp.install.local":"将 @fenglimg/fabric-server 安装到项目 devDependencies","cli.init.mcp.install.prompt":"MCP 服务端安装范围(global|local)","cli.init.mcp.install.invalid":"无效的 --mcp-install 值“{value}”,将回退到 global","cli.init.mcp.local.installing":"正在运行 {manager} add -D @fenglimg/fabric-server...","cli.init.mcp.local.installed":"已安装到 devDependencies","cli.init.mcp.scope.description":"Claude MCP 配置范围:project(写入 .mcp.json)或 user(写入 ~/.claude.json)","cli.init.mcp.scope.invalid":"无效的 --scope 值“{value}”,将回退到 project","cli.init.mcp.scope.project":"写入项目根目录的 .mcp.json(符合 Claude Code 规范)","cli.init.mcp.scope.user":"写入 ~/.claude.json(用户范围,适用于所有项目)","cli.init.wizard.mcp-scope":"Claude MCP 配置范围(project/.mcp.json 或 user/~/.claude.json)[{defaultValue}]","cli.init.created-path":"{label} {path}","cli.init.skipped-existing-path":"{label} {path}:已存在。","cli.init.force.overwritten":"已覆盖","cli.init.force.warning":"--force 将覆盖 {path} 中现有的 Fabric 产物","cli.init.stages.bootstrap":"正在安装 bootstrap 模板...","cli.init.stages.mcp":"正在配置 MCP 客户端...","cli.init.stages.hooks":"正在安装 git hooks...","cli.init.stages.skipped":"已跳过","cli.init.stages.completed":"已完成","cli.init.stages.failed":"失败","cli.init.stages.summary.ran":"已执行","cli.init.stages.summary.skipped":"已跳过","cli.init.stages.summary.failed":"失败","cli.init.next-step":"{label} {message}","cli.init.reason-message":"{label} {message}","cli.init.plan.title":"Fabric 初始化计划","cli.init.plan.mode-banner.default":"[mode: apply] 标准初始化执行","cli.init.plan.mode-banner.plan":"[mode: plan] 仅预览,不会写入文件","cli.init.plan.mode-banner.reapply":"[mode: reapply] 将强制重新应用 Fabric 管理资产","cli.init.plan.mode-banner.plan-reapply":"[mode: plan+reapply] 正在预览一次强制 reapply,不会写入文件","cli.init.plan.target":"目标:{target}","cli.init.plan.actions":"计划:bootstrap={bootstrap} mcp={mcp} hooks={hooks} mcp-install={mcpInstall}","cli.init.plan.detected":"检测到的客户端:{clients}","cli.init.plan.writes":"核心写入:","cli.init.plan.preview-title":"Fabric 初始化 dry run","cli.init.plan.preview-result":"模式={mode} bootstrap={bootstrap} mcp={mcp} hooks={hooks}","cli.init.mode.default":"default","cli.init.mode.reapply":"reapply","cli.init.mode.badge.default":"APPLY","cli.init.mode.badge.plan":"PLAN","cli.init.mode.badge.reapply":"REAPPLY","cli.init.mode.badge.plan-reapply":"PLAN + REAPPLY","cli.init.compat.plan":"已启用标准 --plan 模式:不会写入任何文件。","cli.init.compat.interactive":"兼容提示:--interactive=false 会禁用 TTY 向导。","cli.init.compat.legacy-stage-flags":"兼容提示:旧的 --no-* 标志正在映射到初始化计划中。","cli.init.wizard.title":"Fabric 初始化向导","cli.init.wizard.intro":"Fabric init","cli.init.wizard.overview.title":"安装概览","cli.init.wizard.overview.body":`目标:{target}
9
- 模式:{mode}
10
- 这个向导只负责调整初始化计划;真正执行仍然走现有的 Fabric init 阶段。`,"cli.init.wizard.step.target":"确认目标","cli.init.wizard.step.plan":"配置初始化计划","cli.init.wizard.step.review":"复核最终计划","cli.init.wizard.target.confirm":"确认在 {target} 中继续初始化 Fabric?[Y/n]","cli.init.wizard.stage.bootstrap":"是否安装 bootstrap 模板?[{defaultValue}]","cli.init.wizard.stage.mcp":"是否配置 MCP 客户端?[{defaultValue}]","cli.init.wizard.stage.hooks":"是否安装 git hooks?[{defaultValue}]","cli.init.wizard.mcp-install":"MCP 服务端安装范围(global/local)[{defaultValue}]","cli.init.wizard.execute.confirm":"现在执行该初始化计划?[Y/n]","cli.init.wizard.outro":"初始化计划已确认,开始执行 Fabric init...","cli.init.wizard.invalid-yes-no":"请输入 yes 或 no。","cli.init.wizard.invalid-select":"无效输入。可选值:{options}。","cli.init.wizard.cancelled":"Fabric 初始化已在执行前取消。","cli.init.capabilities.title":"客户端能力摘要","cli.init.capabilities.none":"没有检测到可用于 bootstrap 或 MCP 后续接力的受支持客户端。","cli.init.capabilities.header.client":"客户端","cli.init.capabilities.header.bootstrap":"Bootstrap","cli.init.capabilities.header.mcp":"MCP","cli.init.capabilities.header.hook":"Hook","cli.init.capabilities.header.skill":"Skill","cli.init.capabilities.header.follow-up":"后续动作","cli.init.capabilities.status.ready":"已就绪","cli.init.capabilities.status.installed":"已安装","cli.init.capabilities.status.supported":"已支持","cli.init.capabilities.status.manual":"手动处理","cli.init.capabilities.status.skipped":"已跳过","cli.init.capabilities.status.failed":"失败","cli.init.capabilities.status.na":"不适用","cli.init.capabilities.follow-up.ready":"可在客户端继续","cli.init.capabilities.follow-up.install":"安装客户端资产","cli.init.capabilities.follow-up.manual":"需要手动后续处理","cli.init.next-step.message":"运行 fab hooks install 以添加第 4 天的 pre-commit 流水线。","cli.init.reason-message.claude-body":".fabric/forensic.json 已就绪;请使用 fabric-init skill 完成 Fabric 内部初始化。","cli.init.reason-message.codex-body":".fabric/forensic.json 已就绪;请继续使用仓库内的 .codex/skills/fabric-init/SKILL.md,并为 Codex hooks 启用 features.codex_hooks = true。","cli.init.reason-message.multi-body":".fabric/forensic.json 已就绪;请按已安装客户端继续后续流程:Claude 使用 fabric-init,Codex 使用 .codex/skills/fabric-init/SKILL.md,并启用 features.codex_hooks = true。","cli.init.reason-message.installable-body":".fabric/forensic.json 已就绪;部分已检测到的客户端已支持 Fabric 后续接力,但仍需安装客户端资产。","cli.init.reason-message.manual-body":".fabric/forensic.json 已就绪;部分已检测到的客户端尚未安装 Fabric skill,需要手动完成后续初始化。","cli.init.codex-hooks.created":"{label} {path},并写入 Codex hooks 配置(需启用 features.codex_hooks = true)。","cli.init.codex-hooks.updated":"{label} {path},并写入 Codex hooks 配置(需启用 features.codex_hooks = true)。","cli.init.codex-hooks.skipped":"{label} {path}:Codex hooks 配置已存在。","cli.init.claude-settings.created":"{label} {path},并写入 Claude Stop hook。","cli.init.claude-settings.updated":"{label} {path},并写入 Claude Stop hook。","cli.init.claude-settings.skipped":"{label} {path}:Claude Stop hook 已存在。","cli.init.claude-settings.skipped-invalid":"{label} {path}:无法合并 Claude Stop hook。","cli.init.claude-settings.invalid-object":"{label} {path}:预期为 JSON 对象。","cli.init.claude-settings.invalid-json":"{label} {path}:JSON 无效({reason})。","cli.init.claude-settings.invalid-hooks":'{label} {path}:"hooks" 必须是 JSON 对象。',"cli.init.claude-settings.invalid-stop-array":'{label} {path}:"hooks.Stop" 必须是数组。',"cli.init.errors.abort-existing":"中止:{path} 已存在。fab init 是非破坏性的。","cli.ledger-append.description":"向 Fabric 意图日志追加一条记录。","cli.ledger-append.args.target.description":"目标项目路径,默认为当前工作目录。","cli.ledger-append.args.staged.description":"从暂存变更推导记录(用于 pre-commit 阶段)。","cli.ledger-append.requires-staged":"pre-commit 场景下必须传入 --staged","cli.ledger-append.intent.auto":"自动:{head}{suffix}","cli.ledger-append.intent.auto-more":" 等 {count} 项","cli.pre-commit.description":"复合 pre-commit 钩子:在单个 Node 进程中依次执行 sync-meta --check-only、human-lint、ledger-append --staged。","cli.pre-commit.args.target.description":"项目根目录,默认取当前目录或 EXTERNAL_FIXTURE_PATH。","cli.pre-commit.run-failed":"fabric pre-commit:{name} 失败 - {message}","cli.scan.description":"扫描项目以检测 Fabric 引导候选模块。","cli.scan.args.target.description":"目标绝对路径。默认依次使用 CLI 参数、EXTERNAL_FIXTURE_PATH、fabric.config.json、当前目录。","cli.scan.args.debug.description":"以格式化输出打印检测证据。","cli.scan.args.json.description":"以 JSON 格式输出诊断报告。","cli.scan.report.title":"Fabric 扫描报告","cli.scan.report.target":"目标","cli.scan.report.framework":"框架","cli.scan.report.evidence":"证据","cli.scan.report.readme-quality":"README 质量","cli.scan.report.contributing":"CONTRIBUTING.md","cli.scan.report.files-counted":"文件数","cli.scan.report.ignored-entries":"忽略项","cli.scan.report.existing-fabric":"现有 Fabric 文件","cli.scan.report.recommendations":"建议:","cli.scan.readme-quality.ok":"良好","cli.scan.readme-quality.stub":"草稿","cli.scan.recommendation.init":"L0:运行 fab init,在 .fabric/bootstrap/README.md 生成带 TODO 标记的初始说明。","cli.scan.recommendation.readme":"L0:先补充 README.md,再把项目事实整理到 Fabric 参考文件中。","cli.scan.recommendation.contributing":"L0:添加 CONTRIBUTING.md,或在 bootstrap 中留下贡献流程的 TODO 说明。","cli.scan.recommendation.unknown-framework":"L1:当前未检测到框架标记,需要手动补充技术栈说明。","cli.scan.recommendation.framework-dirs":"L1:检查 {framework} 目录,后续为其补充对应作用域的 Fabric 规则文件。","cli.serve.description":"启动本地 Fabric MCP HTTP 服务。若需绑定到非 localhost,请设置 FABRIC_AUTH_TOKEN 以启用 Bearer 鉴权。","cli.serve.args.port.description":"监听端口,默认 7373。","cli.serve.args.host.description":"监听主机,默认 127.0.0.1。若需绑定到非 localhost,请设置 FABRIC_AUTH_TOKEN 以启用 Bearer 鉴权。","cli.serve.args.target.description":"目标项目路径。默认依次使用 CLI 参数、EXTERNAL_FIXTURE_PATH、fabric.config.json、当前目录。","cli.serve.args.debug.description":"将目标解析细节输出到 stderr。","cli.serve.args.force.description":"即使另一个 serve 进程正在运行,也强制获取 serve 锁。","cli.serve.ready.title":"Fabric 仪表盘","cli.serve.warning.host-fallback":"--host {host} 需要 FABRIC_AUTH_TOKEN;为安全起见已回退到 127.0.0.1","cli.serve.error.port-in-use":"端口 {port} 已被占用,可尝试 --port {nextPort}","cli.update.description":"刷新 MCP 主机配置和 git hooks,不重新创建 Fabric 文件。","cli.update.args.target.description":"目标项目路径。默认依次使用 CLI 参数、EXTERNAL_FIXTURE_PATH、fabric.config.json、当前目录。","cli.update.args.no-mcp.description":"跳过重新配置 MCP 客户端","cli.update.args.no-hooks.description":"跳过重新安装 git hooks","cli.sync-meta.description":"从内部规则文件同步 Fabric 元数据。","cli.sync-meta.args.target.description":"目标项目路径,默认为当前工作目录。","cli.sync-meta.args.check-only.description":"如果 .fabric/agents.meta.json 已过期,则以代码 1 退出。","cli.sync-meta.drift-detected":"检测到 Fabric 元数据漂移。请运行 fab sync-meta 进行更新。","cli.sync-meta.updated":"{label} {path}","dashboard.app.nav.aria-label":"仪表盘视图导航","dashboard.app.nav.readiness.label":"准备情况","dashboard.app.nav.readiness.label-bilingual":"准备情况 Readiness","dashboard.app.nav.readiness.subtitle":"项目状态","dashboard.app.nav.rules-explain.label":"规则解析","dashboard.app.nav.rules-explain.label-bilingual":"规则解析 Rules Explain","dashboard.app.nav.rules-explain.subtitle":"拓扑与上下文","dashboard.app.nav.timeline.label":"时间线","dashboard.app.nav.timeline.label-bilingual":"时间线 Timeline","dashboard.app.nav.timeline.subtitle":"审计与历史","dashboard.app.nav.health.label":"系统健康","dashboard.app.nav.health.label-bilingual":"系统健康 Health","dashboard.app.nav.health.subtitle":"诊断台","dashboard.app.nav.section.insights":"洞察","dashboard.app.nav.drift-check":"漂移检查","dashboard.app.nav.modules.read-only":"只读仪表盘","dashboard.app.header.connected":"已连接","dashboard.app.header.connecting":"连接中","dashboard.app.live-region.received":"已收到 {type}","dashboard.app.breadcrumb.readiness":"readiness","dashboard.app.breadcrumb.rules-explain":"rules-explain","dashboard.app.breadcrumb.timeline":"timeline","dashboard.app.breadcrumb.health":"health","dashboard.rule-topology.title":"规则命中","dashboard.rule-topology.subtitle":"查看当前路径会命中哪些规则,以及为什么会命中","dashboard.rule-topology.path.placeholder":"用于规则上下文的样本路径","dashboard.rule-topology.path.aria-label":"规则上下文样本路径","dashboard.rule-topology.status.sample":"当前路径 {path}","dashboard.rule-topology.status.hits":"{count} 条命中","dashboard.rule-topology.status.revision":"版本 {revision}","dashboard.rule-topology.heatmap.title":"覆盖热力图","dashboard.rule-topology.heatmap.subtitle":"基于 scope_glob 模式推导的目录覆盖情况","dashboard.rule-topology.heatmap.aria-label":"目录覆盖热力图","dashboard.rule-topology.heatmap.count":"{count} 个目录","dashboard.rule-topology.heatmap.rules":"{count} 条规则","dashboard.rule-topology.heatmap.uncovered":"没有匹配作用域","dashboard.rule-topology.heatmap.empty":"当前没有可显示的规则目录。","dashboard.rule-topology.heatmap.density.full":"已覆盖","dashboard.rule-topology.heatmap.density.partial":"部分覆盖","dashboard.rule-topology.heatmap.density.none":"未覆盖","dashboard.rule-topology.hit-reason.title":"命中原因","dashboard.rule-topology.hit-reason.subtitle":"显示当前样本路径为何命中这些规则","dashboard.rule-topology.hit-reason.aria-label":"规则命中原因","dashboard.rule-topology.hit-reason.count":"{count} 条原因","dashboard.rule-topology.hit-reason.empty":"当前样本路径没有加载到规则。","dashboard.rule-topology.hit-reason.global":"全局","dashboard.rule-topology.hit-reason.tier.always":"常驻","dashboard.rule-topology.hit-reason.tier.path":"Glob","dashboard.rule-topology.hit-reason.tier.description":"描述","dashboard.module-placeholder.coming-soon":"功能预留","dashboard.module-placeholder.read-only":"为后续只读仪表盘能力预留。","dashboard.module-placeholder.forensic.title":"认知扫描","dashboard.module-placeholder.forensic.subtitle":"后续补充","dashboard.module-placeholder.semantic.title":"语义时间线","dashboard.module-placeholder.semantic.subtitle":"后续补充","dashboard.module-placeholder.ledger.title":"历史记录","dashboard.module-placeholder.ledger.subtitle":"后续补充","dashboard.rules-tree.title":"规则树","dashboard.rules-tree.subtitle":"查看 .fabric/agents.meta.json 中的规则结构、层级和同步状态","dashboard.rules-tree.filter.placeholder":"按文件、作用域、优先级、哈希过滤...","dashboard.rules-tree.filter.aria-label":"过滤规则树","dashboard.rules-tree.status.loading":"规则加载中","dashboard.rules-tree.status.nodes":"{count} 个节点 · 版本 {revision}","dashboard.rules-tree.status.locks":"{count} 个受保护区域","dashboard.rules-tree.empty":"没有匹配的规则。","dashboard.rules-tree.tree.aria-label":"Fabric 规则树","dashboard.rules-tree.detail.title":"节点详情","dashboard.rules-tree.detail.empty":"选择一个规则节点以查看作用域、依赖、优先级和哈希。","dashboard.rules-tree.detail.file":"文件","dashboard.rules-tree.detail.scope":"作用域","dashboard.rules-tree.detail.priority":"优先级","dashboard.rules-tree.detail.hash":"哈希","dashboard.rules-tree.detail.no-deps":"无依赖","dashboard.human-lock.title":"人工保护","dashboard.human-lock.subtitle":"查看需要人工确认的受保护区域","dashboard.human-lock.filters.aria-label":"人工保护过滤器","dashboard.human-lock.filters.all":"全部","dashboard.human-lock.filters.drift":"漂移","dashboard.human-lock.filters.approved":"已批准","dashboard.human-lock.summary":"{drift} 处漂移 · {approved} 项已确认","dashboard.human-lock.empty":"当前过滤条件下没有受保护记录。","dashboard.intent-timeline.title":"意图时间线","dashboard.intent-timeline.subtitle":"查看 AI 与人工留下的变更记录,按时间倒序排列","dashboard.intent-timeline.filter.label":"来源","dashboard.intent-timeline.filter.all":"全部","dashboard.intent-timeline.summary":"AI {aiCount} · Human {humanCount}","dashboard.intent-timeline.columns.ai.title":"AI","dashboard.intent-timeline.columns.ai.entries":"{count} 条记录","dashboard.intent-timeline.columns.human.title":"人工","dashboard.intent-timeline.columns.human.entries":"{count} 条记录","dashboard.intent-timeline.empty":"没有找到日志记录。","dashboard.intent-timeline.annotate.missing-id":"缺少 id,无法为这条日志添加注释。","dashboard.history-replay.title":"历史回放","dashboard.history-replay.subtitle":"按历史记录回看当时的规则树状态","dashboard.history-replay.toolbar.scrub":"拖动","dashboard.history-replay.toolbar.latest":"最新","dashboard.history-replay.selected.none":"尚未选择历史记录","dashboard.history-replay.status.replay-points":"{count} 个回放点","dashboard.history-replay.status.entries-applied":"已应用 {count} 条记录","dashboard.history-replay.empty.entries":"没有可用于回放的日志记录。","dashboard.history-replay.state.title":"查看 {label} 时刻的状态","dashboard.history-replay.state.meta":"记录 {ledgerId} · 提交 {commit} · {mode}","dashboard.history-replay.status.loading":"快照加载中","dashboard.history-replay.status.nodes":"{count} 个节点","dashboard.history-replay.status.unknown-revision":"未知版本","dashboard.history-replay.tree.aria-label":"历史 Fabric 规则树","dashboard.history-replay.empty.loading":"正在加载历史快照...","dashboard.history-replay.empty.select":"请选择一条时间线记录以回放其状态。","dashboard.history-replay.meta.not-available":"不可用","dashboard.history-replay.meta.pending":"等待中","dashboard.history-replay.meta.na":"无","dashboard.doctor.title":"诊断控制台","dashboard.doctor.subtitle":"查看框架、入口点、版本漂移和受保护路径的状态","dashboard.doctor.toolbar.overall":"整体状态","dashboard.doctor.toolbar.no-summary":"暂无摘要","dashboard.doctor.toolbar.entry-points-summary":"{framework} · {count} 个入口点","dashboard.doctor.toolbar.entry-point-summary":"{framework} · {count} 个入口点","dashboard.doctor.empty.loading":"正在加载 doctor 报告...","dashboard.doctor.summary.framework":"框架","dashboard.doctor.summary.protected-paths":"受保护路径","dashboard.doctor.summary.intent-ledger":"意图日志","dashboard.doctor.summary.no-meta-revision":"暂无元数据版本","dashboard.doctor.summary.tracked-paths.none":"没有跟踪路径","dashboard.doctor.summary.tracked-paths.some":"已跟踪 {count} 项","dashboard.doctor.summary.hashes-intact":"所有已批准哈希均完好","dashboard.doctor.summary.drifted":"{count} 项发生漂移","dashboard.doctor.summary.no-ledger-entries":"暂无日志记录","dashboard.doctor.card.entry-points":"入口点","dashboard.doctor.card.checks":"检查项","dashboard.doctor.empty.entry-points":"当前未检测到入口点。","dashboard.doctor.framework.unknown":"未知","dashboard.doctor.age.none":"暂无记录","dashboard.doctor.age.seconds":"{count} 秒前","dashboard.doctor.age.minutes":"{count} 分钟前","dashboard.doctor.age.hours":"{count} 小时前","dashboard.doctor.age.days":"{count} 天前","dashboard.doctor.age.weeks":"{count} 周前","dashboard.shared.refresh":"刷新","dashboard.shared.loading":"加载中","dashboard.shared.status.ok":"正常","dashboard.shared.status.warn":"警告","dashboard.shared.status.error":"错误","dashboard.shared.status.confirmed":"已确认","dashboard.shared.status.hash-drift":"哈希漂移","dashboard.shared.status.stale":"过期","dashboard.shared.status.orphan":"孤立","dashboard.shared.status.attention":"注意","dashboard.source.ai":"AI","dashboard.source.human":"人工","dashboard.timeline-entry.aria-label":"{source} 意图 {intent}","dashboard.timeline-entry.working-tree":"工作区","dashboard.timeline-entry.parent":"父提交 {parent}","dashboard.timeline-entry.paths":"路径","dashboard.timeline-entry.annotate":"添加注释","dashboard.timeline-entry.annotation-label":"人工注释","dashboard.timeline-entry.annotation-placeholder":"说明审核结论或批准背景...","dashboard.timeline-entry.annotation-save":"保存注释","dashboard.tree-node.locked":"已锁定","dashboard.tree-node.stale.hash-mismatch":"哈希不匹配","dashboard.tree-node.stale.orphan":"孤立","dashboard.lock-card.aria-label":"{file} {lineRange} {status}","dashboard.lock-card.status.drift":"哈希漂移","dashboard.lock-card.status.confirmed":"已确认","dashboard.lock-card.hash.locked":"锁定哈希","dashboard.lock-card.hash.current":"当前哈希","dashboard.lock-card.hash.diff":"差异","dashboard.lock-card.preview.drift":"漂移","dashboard.lock-card.preview.sync":"同步","dashboard.lock-card.preview.drift-detail":"哈希与受保护区域不一致。","dashboard.lock-card.preview.sync-detail":"受保护区域当前保持同步。","dashboard.lock-card.footer.region":"受保护区域 · {count} 行","dashboard.lock-card.button.approve":"批准新哈希","dashboard.lock-card.button.confirmed":"已确认","dashboard.lock-card.diff.hash-mismatch":"哈希不一致","dashboard.lock-card.diff.no-changes":"无变更","dashboard.lock-card.diff.with-bytes":"+{added} / -{removed} · {bytes} 字节","dashboard.lock-card.diff.without-bytes":"+{added} / -{removed}","dashboard.approve-button.retry":"重试","dashboard.readiness.filter.analysis":"项目分析","dashboard.readiness.loading":"正在加载扫描数据...","dashboard.readiness.summary.framework":"框架","dashboard.readiness.summary.files":"文件","dashboard.readiness.summary.status":"Fabric 状态","dashboard.readiness.card.evidence":"准备情况凭证","dashboard.readiness.card.recommendations":"建议与后续步骤","dashboard.readiness.readme.description":"项目文档的质量","dashboard.readiness.contributing.description":"AI与人类协作的贡献指南","dashboard.readiness.fully-ready":"项目已完全准备就绪。","dashboard.readiness.init-prompt":"运行此命令进行初始化:","dashboard.rules-explain.analyze":"分析路径","dashboard.rules-explain.detail.topology-type":"拓扑类型","dashboard.timeline.history-replay.title":"历史回放","dashboard.timeline.close":"关闭","dashboard.health.ledger-path.label":"事件账本路径","dashboard.health.ledger-path.detail":"只能追加写入的时间线数据源","dashboard.health.boundary.title":"控制平面边界","dashboard.health.boundary.description":"Web 控制台作为纯查看器 (Viewer) 运行。所有规则、元数据和修复操作都必须通过 CLI 进行管理。","dashboard.health.boundary.cli-action":"需要执行 CLI 操作:","dashboard.health.boundary.cli-prompt":"检测到 {count} 个可修复的问题。请在终端中运行以下命令以自动修复元数据。","dashboard.health.runtime.connected":"MCP 运行时已连接","dashboard.health.runtime.disconnected":"MCP 运行时已断开"},Ja={en:Ya,"zh-CN":Ga};function Ka(t,e=Ja){const r=e[t]??e.en,a=e.en;return(i,n)=>{const o=r[i]??a[i]??i;return n===void 0?o:Object.entries(n).reduce((d,[u,c])=>d.replaceAll(`{${u}}`,c),o)}}function Qa(t){if(typeof t!="string")return"en";const e=t.trim().toLowerCase().replace(/\..*$/,"").replace(/_/g,"-");return e.length===0?"en":e==="zh"||e.startsWith("zh-")?"zh-CN":"en"}function ei(){return typeof navigator<"u"&&typeof navigator.language=="string"?Qa(navigator.language):"en"}function ti(t=ei()){return{locale:t,t:Ka(t)}}const Gr=xa(null);function ri({children:t}){const e=oe(()=>ti(),[]);return s(Gr.Provider,{value:e,children:t})}function J(){const t=Sa(Gr);if(t===null)throw new Error("useI18n must be used within an I18nProvider.");return t}const ai={ok:"dashboard.shared.status.confirmed",drift:"dashboard.shared.status.hash-drift",stale:"dashboard.shared.status.stale",orphan:"dashboard.shared.status.orphan",locked:"dashboard.shared.status.attention"};function de({kind:t,severity:e,message:r,diffStats:a}){const{t:i}=J();if(e==="ok"&&t==="dot")return null;const n=r??i(ai[e]),o=a===void 0?"":` +${a.added} / -${a.removed}`,d="inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-bold font-mono tracking-widest uppercase border",u="flex items-center gap-2 p-3 rounded-lg text-sm font-medium border shadow-sm",c="w-2 h-2 rounded-full shadow-[0_0_8px_currentColor]",h={ok:"bg-green-500/10 border-green-500/30 text-green-600 dark:bg-green-500/20 dark:border-green-500/30 dark:text-green-400",drift:"bg-orange-500/10 border-orange-500/30 text-orange-600 dark:bg-orange-500/20 dark:border-orange-500/30 dark:text-orange-400",stale:"bg-red-500/10 border-red-500/30 text-red-600 dark:bg-red-500/20 dark:border-red-500/30 dark:text-red-400",orphan:"bg-slate-500/10 border-slate-500/30 text-slate-600 dark:bg-slate-500/20 dark:border-slate-500/30 dark:text-slate-400",locked:"bg-amber-500/10 border-amber-500/30 text-amber-600 dark:bg-amber-500/20 dark:border-amber-500/30 dark:text-amber-400"},p={ok:"bg-green-500 text-green-500",drift:"bg-orange-500 text-orange-500 animate-pulse",stale:"bg-red-500 text-red-500 animate-pulse",orphan:"bg-slate-500 text-slate-500",locked:"bg-amber-500 text-amber-500"};return t==="dot"?s("span",{class:`${c} ${p[e]}`,"aria-label":n}):t==="banner"?s("div",{class:`${u} ${h[e]}`,role:"status",children:[s("span",{"aria-hidden":"true",class:"shrink-0",children:e==="ok"?"✓":"!"}),s("span",{children:[n,o]})]}):s("span",{class:`${d} ${h[e]}`,children:[s("span",{"aria-hidden":"true",children:e==="ok"?"✓":"!"}),s("span",{class:"truncate max-w-[150px] sm:max-w-none",children:[n,o]})]})}function ii(){const{t}=J(),[e,r]=O(null),[a,i]=O(!0),[n,o]=O(null),d=async()=>{i(!0);try{r(await $a()),o(null)}catch(u){o(u instanceof Error?u.message:String(u))}finally{i(!1)}};return Q(()=>{d()},[]),s("div",{class:"flex-1 flex flex-col gap-6 max-w-5xl mx-auto w-full p-4 md:p-6 lg:p-8",children:[n!==null?s("div",{class:"mb-4",children:s(de,{kind:"banner",severity:"stale",message:n})}):null,s("div",{class:"flex items-center justify-between bg-light-surface border border-light-border dark:bg-dark-surface dark:border-dark-border dark:backdrop-blur-xl sm:rounded-2xl sm:shadow-sm p-4",children:[s("span",{class:"text-xs font-bold uppercase tracking-wider text-light-muted dark:text-dark-muted",children:t("dashboard.readiness.filter.analysis")}),s("button",{class:"px-3 py-1.5 rounded-lg text-sm font-medium bg-light-border/50 hover:bg-light-border text-light-text dark:bg-white/10 dark:hover:bg-white/20 dark:text-dark-text transition-colors",type:"button",onClick:()=>{d()},children:t("dashboard.shared.refresh")})]}),a&&e===null?s("div",{class:"p-8 text-center text-sm text-light-muted dark:text-dark-muted bg-light-surface border border-light-border dark:bg-dark-surface dark:border-dark-border sm:rounded-2xl",children:t("dashboard.readiness.loading")}):null,e!==null?s("div",{class:"flex flex-col gap-6",children:[s("div",{class:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[s("article",{class:"p-5 flex flex-col gap-2 bg-light-surface border border-light-border dark:bg-dark-surface dark:border-dark-border sm:rounded-2xl sm:shadow-sm dark:shadow-xl dark:backdrop-blur-xl",children:[s("span",{class:"text-[10px] font-bold text-light-muted dark:text-dark-muted uppercase tracking-widest",children:t("dashboard.readiness.summary.framework")}),s("strong",{class:"text-2xl font-bold text-light-text dark:text-dark-text",children:e.framework.kind!=="unknown"?`${e.framework.kind} ${e.framework.version}`:t("dashboard.doctor.framework.unknown")}),s("span",{class:"font-mono text-xs text-light-muted dark:text-dark-muted",children:e.framework.subkind!=="unknown"?e.framework.subkind:"Standard"})]}),s("article",{class:"p-5 flex flex-col gap-2 bg-light-surface border border-light-border dark:bg-dark-surface dark:border-dark-border sm:rounded-2xl sm:shadow-sm dark:shadow-xl dark:backdrop-blur-xl",children:[s("span",{class:"text-[10px] font-bold text-light-muted dark:text-dark-muted uppercase tracking-widest",children:t("dashboard.readiness.summary.files")}),s("strong",{class:"text-2xl font-bold text-light-text dark:text-dark-text",children:e.fileCount}),s("span",{class:"font-mono text-xs text-light-muted dark:text-dark-muted",children:[e.ignoredCount," ignored"]})]}),s("article",{class:"p-5 flex flex-col gap-2 bg-light-surface border border-light-border dark:bg-dark-surface dark:border-dark-border sm:rounded-2xl sm:shadow-sm dark:shadow-xl dark:backdrop-blur-xl",children:[s("span",{class:"text-[10px] font-bold text-light-muted dark:text-dark-muted uppercase tracking-widest",children:t("dashboard.readiness.summary.status")}),s("strong",{class:"text-2xl font-bold text-light-text dark:text-dark-text",children:e.hasExistingFabric?"Initialized":"Not Initialized"}),s("span",{class:"font-mono text-xs text-light-muted dark:text-dark-muted",children:".fabric directory"})]})]}),s("div",{class:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s("article",{class:"flex flex-col bg-light-surface border border-light-border dark:bg-dark-surface dark:border-white/5 sm:rounded-2xl sm:shadow-sm dark:shadow-xl dark:backdrop-blur-3xl overflow-hidden",children:[s("div",{class:"p-5 border-b border-light-border dark:border-dark-border bg-light-surface/90 dark:bg-transparent",children:s("h3",{class:"text-sm font-bold uppercase tracking-wider text-light-text dark:text-dark-text m-0",children:t("dashboard.readiness.card.evidence")})}),s("div",{class:"flex flex-col",children:[s("div",{class:`p-5 flex flex-col gap-2 border-b border-light-border dark:border-dark-border ${e.readmeQuality==="none"?"bg-red-500/5 dark:bg-red-500/10":""}`,children:[s("div",{class:"flex items-center justify-between",children:[s("strong",{class:"font-mono text-sm text-light-text dark:text-dark-text",children:"README.md"}),s(de,{kind:"pill",severity:e.readmeQuality==="none"?"stale":"ok",message:e.readmeQuality})]}),s("p",{class:"text-sm text-light-muted dark:text-dark-muted m-0",children:t("dashboard.readiness.readme.description")})]}),s("div",{class:`p-5 flex flex-col gap-2 ${e.hasContributing?"":"bg-amber-500/5 dark:bg-amber-500/10"}`,children:[s("div",{class:"flex items-center justify-between",children:[s("strong",{class:"font-mono text-sm text-light-text dark:text-dark-text",children:"CONTRIBUTING.md"}),s(de,{kind:"pill",severity:e.hasContributing?"ok":"locked",message:e.hasContributing?"Present":"Missing"})]}),s("p",{class:"text-sm text-light-muted dark:text-dark-muted m-0",children:t("dashboard.readiness.contributing.description")})]})]})]}),s("article",{class:"flex flex-col bg-light-surface border border-light-border dark:bg-dark-surface dark:border-white/5 sm:rounded-2xl sm:shadow-sm dark:shadow-xl dark:backdrop-blur-3xl overflow-hidden",children:[s("div",{class:"p-5 border-b border-light-border dark:border-dark-border bg-light-surface/90 dark:bg-transparent",children:s("h3",{class:"text-sm font-bold uppercase tracking-wider text-light-text dark:text-dark-text m-0",children:t("dashboard.readiness.card.recommendations")})}),s("div",{class:"flex flex-col p-5 gap-4",children:[e.recommendations.length>0?e.recommendations.map((u,c)=>s("div",{class:"flex items-start gap-3 pb-4 border-b border-light-border dark:border-dark-border last:border-0 last:pb-0",children:[s("div",{class:"w-1.5 h-1.5 rounded-full bg-brand-accent mt-2 shrink-0"}),s("span",{class:"text-sm text-light-text dark:text-dark-text leading-relaxed",children:u})]},c)):s("div",{class:"text-sm text-light-muted dark:text-dark-muted text-center py-4",children:s("span",{children:t("dashboard.readiness.fully-ready")})}),!e.hasExistingFabric&&s("div",{class:"mt-2 p-4 rounded-xl border bg-brand-accent/5 border-brand-accent/20 dark:bg-brand-accent/10 dark:border-brand-accent/20",children:[s("strong",{class:"text-sm text-brand-accent dark:text-blue-400 block mb-2",children:t("dashboard.readiness.init-prompt")}),s("div",{class:"rounded-lg p-3 font-mono text-xs flex justify-between items-center border shadow-inner bg-zinc-900 border-zinc-800 text-zinc-300 dark:bg-black/50 dark:border-white/5 dark:text-white/80",children:[s("span",{children:[s("span",{class:"text-zinc-500 dark:text-white/30 mr-2",children:"$"}),"fab init"]}),s("button",{class:"text-zinc-400 hover:text-white dark:text-white/40 dark:hover:text-white transition-colors flex items-center gap-1.5 bg-white/5 px-2 py-1 rounded",onClick:()=>navigator.clipboard.writeText("fab init"),children:[s("svg",{class:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),"Copy"]})]})]})]})]})]})]}):null]})}var R;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{const n={};for(const o of i)n[o]=o;return n},t.getValidEnumValues=i=>{const n=t.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),o={};for(const d of n)o[d]=i[d];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(n){return i[n]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const n=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&n.push(o);return n},t.find=(i,n)=>{for(const o of i)if(n(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function a(i,n=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(n)}t.joinValues=a,t.jsonStringifyReplacer=(i,n)=>typeof n=="bigint"?n.toString():n})(R||(R={}));var hr;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(hr||(hr={}));const v=R.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pe=t=>{switch(typeof t){case"undefined":return v.undefined;case"string":return v.string;case"number":return Number.isNaN(t)?v.nan:v.number;case"boolean":return v.boolean;case"function":return v.function;case"bigint":return v.bigint;case"symbol":return v.symbol;case"object":return Array.isArray(t)?v.array:t===null?v.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?v.promise:typeof Map<"u"&&t instanceof Map?v.map:typeof Set<"u"&&t instanceof Set?v.set:typeof Date<"u"&&t instanceof Date?v.date:v.object;default:return v.unknown}},m=R.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ce extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(n){return n.message},a={_errors:[]},i=n=>{for(const o of n.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)a._errors.push(r(o));else{let d=a,u=0;for(;u<o.path.length;){const c=o.path[u];u===o.path.length-1?(d[c]=d[c]||{_errors:[]},d[c]._errors.push(r(o))):d[c]=d[c]||{_errors:[]},d=d[c],u++}}};return i(this),a}static assert(e){if(!(e instanceof ce))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,R.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},a=[];for(const i of this.issues)if(i.path.length>0){const n=i.path[0];r[n]=r[n]||[],r[n].push(e(i))}else a.push(e(i));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}}ce.create=t=>new ce(t);const Ct=(t,e)=>{let r;switch(t.code){case m.invalid_type:t.received===v.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case m.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,R.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:r=`Unrecognized key(s) in object: ${R.joinValues(t.keys,", ")}`;break;case m.invalid_union:r="Invalid input";break;case m.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${R.joinValues(t.options)}`;break;case m.invalid_enum_value:r=`Invalid enum value. Expected ${R.joinValues(t.options)}, received '${t.received}'`;break;case m.invalid_arguments:r="Invalid function arguments";break;case m.invalid_return_type:r="Invalid function return type";break;case m.invalid_date:r="Invalid date";break;case m.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:R.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case m.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case m.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case m.custom:r="Invalid input";break;case m.invalid_intersection_types:r="Intersection results could not be merged";break;case m.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case m.not_finite:r="Number must be finite";break;default:r=e.defaultError,R.assertNever(t)}return{message:r}};let ni=Ct;function si(){return ni}const oi=t=>{const{data:e,path:r,errorMaps:a,issueData:i}=t,n=[...r,...i.path||[]],o={...i,path:n};if(i.message!==void 0)return{...i,path:n,message:i.message};let d="";const u=a.filter(c=>!!c).slice().reverse();for(const c of u)d=c(o,{data:e,defaultError:d}).message;return{...i,path:n,message:d}};function g(t,e){const r=si(),a=oi({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Ct?void 0:Ct].filter(i=>!!i)});t.common.issues.push(a)}class Y{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const a=[];for(const i of r){if(i.status==="aborted")return w;i.status==="dirty"&&e.dirty(),a.push(i.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,r){const a=[];for(const i of r){const n=await i.key,o=await i.value;a.push({key:n,value:o})}return Y.mergeObjectSync(e,a)}static mergeObjectSync(e,r){const a={};for(const i of r){const{key:n,value:o}=i;if(n.status==="aborted"||o.status==="aborted")return w;n.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(a[n.value]=o.value)}return{status:e.value,value:a}}}const w=Object.freeze({status:"aborted"}),Re=t=>({status:"dirty",value:t}),K=t=>({status:"valid",value:t}),pr=t=>t.status==="aborted",fr=t=>t.status==="dirty",Ce=t=>t.status==="valid",Je=t=>typeof Promise<"u"&&t instanceof Promise;var k;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(k||(k={}));class te{constructor(e,r,a,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=a,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const mr=(t,e)=>{if(Ce(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new ce(t.common.issues);return this._error=r,this._error}}};function T(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:a,description:i}=t;if(e&&(r||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,d)=>{const{message:u}=t;return o.code==="invalid_enum_value"?{message:u??d.defaultError}:typeof d.data>"u"?{message:u??a??d.defaultError}:o.code!=="invalid_type"?{message:d.defaultError}:{message:u??r??d.defaultError}},description:i}}class A{get description(){return this._def.description}_getType(e){return pe(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:pe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Y,ctx:{common:e.parent.common,data:e.data,parsedType:pe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(Je(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const a=this.safeParse(e,r);if(a.success)return a.data;throw a.error}safeParse(e,r){const a={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pe(e)},i=this._parseSync({data:e,path:a.path,parent:a});return mr(a,i)}"~validate"(e){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pe(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:r});return Ce(a)?{value:a.value}:{issues:r.common.issues}}catch(a){a?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(a=>Ce(a)?{value:a.value}:{issues:r.common.issues})}async parseAsync(e,r){const a=await this.safeParseAsync(e,r);if(a.success)return a.data;throw a.error}async safeParseAsync(e,r){const a={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pe(e)},i=this._parse({data:e,path:a.path,parent:a}),n=await(Je(i)?i:Promise.resolve(i));return mr(a,n)}refine(e,r){const a=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,n)=>{const o=e(i),d=()=>n.addIssue({code:m.custom,...a(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(d(),!1)):o?!0:(d(),!1)})}refinement(e,r){return this._refinement((a,i)=>e(a)?!0:(i.addIssue(typeof r=="function"?r(a,i):r),!1))}_refinement(e){return new me({schema:this,typeName:C.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return le.create(this,this._def)}nullable(){return ve.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ee.create(this)}promise(){return at.create(this,this._def)}or(e){return Qe.create([this,e],this._def)}and(e){return et.create(this,e,this._def)}transform(e){return new me({...T(this._def),schema:this,typeName:C.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new it({...T(this._def),innerType:this,defaultValue:r,typeName:C.ZodDefault})}brand(){return new ea({typeName:C.ZodBranded,type:this,...T(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new nt({...T(this._def),innerType:this,catchValue:r,typeName:C.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return qt.create(this,e)}readonly(){return st.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const di=/^c[^\s-]{8,}$/i,li=/^[0-9a-z]+$/,ci=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ui=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,hi=/^[a-z0-9_-]{21}$/i,pi=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,fi=/^[-+]?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)?)??$/,mi=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,bi="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let gt;const gi=/^(?:(?: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])$/,_i=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,vi=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,yi=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ki=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,xi=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Jr="((\\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])))",wi=new RegExp(`^${Jr}$`);function Kr(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function Ci(t){return new RegExp(`^${Kr(t)}$`)}function Si(t){let e=`${Jr}T${Kr(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Ti(t,e){return!!((e==="v4"||!e)&&gi.test(t)||(e==="v6"||!e)&&vi.test(t))}function Ei(t,e){if(!pi.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const a=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(a));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function Ai(t,e){return!!((e==="v4"||!e)&&_i.test(t)||(e==="v6"||!e)&&yi.test(t))}class se extends A{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==v.string){const n=this._getOrReturnCtx(e);return g(n,{code:m.invalid_type,expected:v.string,received:n.parsedType}),w}const a=new Y;let i;for(const n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(i=this._getOrReturnCtx(e,i),g(i,{code:m.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),a.dirty());else if(n.kind==="max")e.data.length>n.value&&(i=this._getOrReturnCtx(e,i),g(i,{code:m.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),a.dirty());else if(n.kind==="length"){const o=e.data.length>n.value,d=e.data.length<n.value;(o||d)&&(i=this._getOrReturnCtx(e,i),o?g(i,{code:m.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):d&&g(i,{code:m.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),a.dirty())}else if(n.kind==="email")mi.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"email",code:m.invalid_string,message:n.message}),a.dirty());else if(n.kind==="emoji")gt||(gt=new RegExp(bi,"u")),gt.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"emoji",code:m.invalid_string,message:n.message}),a.dirty());else if(n.kind==="uuid")ui.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"uuid",code:m.invalid_string,message:n.message}),a.dirty());else if(n.kind==="nanoid")hi.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"nanoid",code:m.invalid_string,message:n.message}),a.dirty());else if(n.kind==="cuid")di.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"cuid",code:m.invalid_string,message:n.message}),a.dirty());else if(n.kind==="cuid2")li.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"cuid2",code:m.invalid_string,message:n.message}),a.dirty());else if(n.kind==="ulid")ci.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"ulid",code:m.invalid_string,message:n.message}),a.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),g(i,{validation:"url",code:m.invalid_string,message:n.message}),a.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"regex",code:m.invalid_string,message:n.message}),a.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(i=this._getOrReturnCtx(e,i),g(i,{code:m.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),a.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(i=this._getOrReturnCtx(e,i),g(i,{code:m.invalid_string,validation:{startsWith:n.value},message:n.message}),a.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(i=this._getOrReturnCtx(e,i),g(i,{code:m.invalid_string,validation:{endsWith:n.value},message:n.message}),a.dirty()):n.kind==="datetime"?Si(n).test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{code:m.invalid_string,validation:"datetime",message:n.message}),a.dirty()):n.kind==="date"?wi.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{code:m.invalid_string,validation:"date",message:n.message}),a.dirty()):n.kind==="time"?Ci(n).test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{code:m.invalid_string,validation:"time",message:n.message}),a.dirty()):n.kind==="duration"?fi.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"duration",code:m.invalid_string,message:n.message}),a.dirty()):n.kind==="ip"?Ti(e.data,n.version)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"ip",code:m.invalid_string,message:n.message}),a.dirty()):n.kind==="jwt"?Ei(e.data,n.alg)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"jwt",code:m.invalid_string,message:n.message}),a.dirty()):n.kind==="cidr"?Ai(e.data,n.version)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"cidr",code:m.invalid_string,message:n.message}),a.dirty()):n.kind==="base64"?ki.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"base64",code:m.invalid_string,message:n.message}),a.dirty()):n.kind==="base64url"?xi.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"base64url",code:m.invalid_string,message:n.message}),a.dirty()):R.assertNever(n);return{status:a.value,value:e.data}}_regex(e,r,a){return this.refinement(i=>e.test(i),{validation:r,code:m.invalid_string,...k.errToObj(a)})}_addCheck(e){return new se({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...k.errToObj(e)})}url(e){return this._addCheck({kind:"url",...k.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...k.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...k.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...k.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...k.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...k.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...k.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...k.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...k.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...k.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...k.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...k.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...k.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...k.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...k.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...k.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...k.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...k.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...k.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...k.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...k.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...k.errToObj(r)})}nonempty(e){return this.min(1,k.errToObj(e))}trim(){return new se({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new se({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new se({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}se.create=t=>new se({checks:[],typeName:C.ZodString,coerce:t?.coerce??!1,...T(t)});function Ii(t,e){const r=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,i=r>a?r:a,n=Number.parseInt(t.toFixed(i).replace(".","")),o=Number.parseInt(e.toFixed(i).replace(".",""));return n%o/10**i}class Se extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==v.number){const n=this._getOrReturnCtx(e);return g(n,{code:m.invalid_type,expected:v.number,received:n.parsedType}),w}let a;const i=new Y;for(const n of this._def.checks)n.kind==="int"?R.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{code:m.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(a=this._getOrReturnCtx(e,a),g(a,{code:m.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(a=this._getOrReturnCtx(e,a),g(a,{code:m.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="multipleOf"?Ii(e.data,n.value)!==0&&(a=this._getOrReturnCtx(e,a),g(a,{code:m.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{code:m.not_finite,message:n.message}),i.dirty()):R.assertNever(n);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,k.toString(r))}gt(e,r){return this.setLimit("min",e,!1,k.toString(r))}lte(e,r){return this.setLimit("max",e,!0,k.toString(r))}lt(e,r){return this.setLimit("max",e,!1,k.toString(r))}setLimit(e,r,a,i){return new Se({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:k.toString(i)}]})}_addCheck(e){return new Se({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:k.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:k.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&R.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(r===null||a.value>r)&&(r=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(r)&&Number.isFinite(e)}}Se.create=t=>new Se({checks:[],typeName:C.ZodNumber,coerce:t?.coerce||!1,...T(t)});class Le extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==v.bigint)return this._getInvalidInput(e);let a;const i=new Y;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(a=this._getOrReturnCtx(e,a),g(a,{code:m.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(a=this._getOrReturnCtx(e,a),g(a,{code:m.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),g(a,{code:m.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):R.assertNever(n);return{status:i.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return g(r,{code:m.invalid_type,expected:v.bigint,received:r.parsedType}),w}gte(e,r){return this.setLimit("min",e,!0,k.toString(r))}gt(e,r){return this.setLimit("min",e,!1,k.toString(r))}lte(e,r){return this.setLimit("max",e,!0,k.toString(r))}lt(e,r){return this.setLimit("max",e,!1,k.toString(r))}setLimit(e,r,a,i){return new Le({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:k.toString(i)}]})}_addCheck(e){return new Le({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Le.create=t=>new Le({checks:[],typeName:C.ZodBigInt,coerce:t?.coerce??!1,...T(t)});class St extends A{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==v.boolean){const a=this._getOrReturnCtx(e);return g(a,{code:m.invalid_type,expected:v.boolean,received:a.parsedType}),w}return K(e.data)}}St.create=t=>new St({typeName:C.ZodBoolean,coerce:t?.coerce||!1,...T(t)});class Ke extends A{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==v.date){const n=this._getOrReturnCtx(e);return g(n,{code:m.invalid_type,expected:v.date,received:n.parsedType}),w}if(Number.isNaN(e.data.getTime())){const n=this._getOrReturnCtx(e);return g(n,{code:m.invalid_date}),w}const a=new Y;let i;for(const n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(i=this._getOrReturnCtx(e,i),g(i,{code:m.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),a.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(i=this._getOrReturnCtx(e,i),g(i,{code:m.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),a.dirty()):R.assertNever(n);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ke({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:k.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:k.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}Ke.create=t=>new Ke({checks:[],coerce:t?.coerce||!1,typeName:C.ZodDate,...T(t)});class br extends A{_parse(e){if(this._getType(e)!==v.symbol){const a=this._getOrReturnCtx(e);return g(a,{code:m.invalid_type,expected:v.symbol,received:a.parsedType}),w}return K(e.data)}}br.create=t=>new br({typeName:C.ZodSymbol,...T(t)});class Tt extends A{_parse(e){if(this._getType(e)!==v.undefined){const a=this._getOrReturnCtx(e);return g(a,{code:m.invalid_type,expected:v.undefined,received:a.parsedType}),w}return K(e.data)}}Tt.create=t=>new Tt({typeName:C.ZodUndefined,...T(t)});class Et extends A{_parse(e){if(this._getType(e)!==v.null){const a=this._getOrReturnCtx(e);return g(a,{code:m.invalid_type,expected:v.null,received:a.parsedType}),w}return K(e.data)}}Et.create=t=>new Et({typeName:C.ZodNull,...T(t)});class gr extends A{constructor(){super(...arguments),this._any=!0}_parse(e){return K(e.data)}}gr.create=t=>new gr({typeName:C.ZodAny,...T(t)});class At extends A{constructor(){super(...arguments),this._unknown=!0}_parse(e){return K(e.data)}}At.create=t=>new At({typeName:C.ZodUnknown,...T(t)});class fe extends A{_parse(e){const r=this._getOrReturnCtx(e);return g(r,{code:m.invalid_type,expected:v.never,received:r.parsedType}),w}}fe.create=t=>new fe({typeName:C.ZodNever,...T(t)});class _r extends A{_parse(e){if(this._getType(e)!==v.undefined){const a=this._getOrReturnCtx(e);return g(a,{code:m.invalid_type,expected:v.void,received:a.parsedType}),w}return K(e.data)}}_r.create=t=>new _r({typeName:C.ZodVoid,...T(t)});class ee extends A{_parse(e){const{ctx:r,status:a}=this._processInputParams(e),i=this._def;if(r.parsedType!==v.array)return g(r,{code:m.invalid_type,expected:v.array,received:r.parsedType}),w;if(i.exactLength!==null){const o=r.data.length>i.exactLength.value,d=r.data.length<i.exactLength.value;(o||d)&&(g(r,{code:o?m.too_big:m.too_small,minimum:d?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),a.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(g(r,{code:m.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),a.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(g(r,{code:m.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),a.dirty()),r.common.async)return Promise.all([...r.data].map((o,d)=>i.type._parseAsync(new te(r,o,r.path,d)))).then(o=>Y.mergeArray(a,o));const n=[...r.data].map((o,d)=>i.type._parseSync(new te(r,o,r.path,d)));return Y.mergeArray(a,n)}get element(){return this._def.type}min(e,r){return new ee({...this._def,minLength:{value:e,message:k.toString(r)}})}max(e,r){return new ee({...this._def,maxLength:{value:e,message:k.toString(r)}})}length(e,r){return new ee({...this._def,exactLength:{value:e,message:k.toString(r)}})}nonempty(e){return this.min(1,e)}}ee.create=(t,e)=>new ee({type:t,minLength:null,maxLength:null,exactLength:null,typeName:C.ZodArray,...T(e)});function ye(t){if(t instanceof U){const e={};for(const r in t.shape){const a=t.shape[r];e[r]=le.create(ye(a))}return new U({...t._def,shape:()=>e})}else return t instanceof ee?new ee({...t._def,type:ye(t.element)}):t instanceof le?le.create(ye(t.unwrap())):t instanceof ve?ve.create(ye(t.unwrap())):t instanceof ge?ge.create(t.items.map(e=>ye(e))):t}class U extends A{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=R.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==v.object){const c=this._getOrReturnCtx(e);return g(c,{code:m.invalid_type,expected:v.object,received:c.parsedType}),w}const{status:a,ctx:i}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),d=[];if(!(this._def.catchall instanceof fe&&this._def.unknownKeys==="strip"))for(const c in i.data)o.includes(c)||d.push(c);const u=[];for(const c of o){const h=n[c],p=i.data[c];u.push({key:{status:"valid",value:c},value:h._parse(new te(i,p,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof fe){const c=this._def.unknownKeys;if(c==="passthrough")for(const h of d)u.push({key:{status:"valid",value:h},value:{status:"valid",value:i.data[h]}});else if(c==="strict")d.length>0&&(g(i,{code:m.unrecognized_keys,keys:d}),a.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const h of d){const p=i.data[h];u.push({key:{status:"valid",value:h},value:c._parse(new te(i,p,i.path,h)),alwaysSet:h in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const h of u){const p=await h.key,y=await h.value;c.push({key:p,value:y,alwaysSet:h.alwaysSet})}return c}).then(c=>Y.mergeObjectSync(a,c)):Y.mergeObjectSync(a,u)}get shape(){return this._def.shape()}strict(e){return k.errToObj,new U({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,a)=>{const i=this._def.errorMap?.(r,a).message??a.defaultError;return r.code==="unrecognized_keys"?{message:k.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new U({...this._def,unknownKeys:"strip"})}passthrough(){return new U({...this._def,unknownKeys:"passthrough"})}extend(e){return new U({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new U({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:C.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new U({...this._def,catchall:e})}pick(e){const r={};for(const a of R.objectKeys(e))e[a]&&this.shape[a]&&(r[a]=this.shape[a]);return new U({...this._def,shape:()=>r})}omit(e){const r={};for(const a of R.objectKeys(this.shape))e[a]||(r[a]=this.shape[a]);return new U({...this._def,shape:()=>r})}deepPartial(){return ye(this)}partial(e){const r={};for(const a of R.objectKeys(this.shape)){const i=this.shape[a];e&&!e[a]?r[a]=i:r[a]=i.optional()}return new U({...this._def,shape:()=>r})}required(e){const r={};for(const a of R.objectKeys(this.shape))if(e&&!e[a])r[a]=this.shape[a];else{let n=this.shape[a];for(;n instanceof le;)n=n._def.innerType;r[a]=n}return new U({...this._def,shape:()=>r})}keyof(){return Qr(R.objectKeys(this.shape))}}U.create=(t,e)=>new U({shape:()=>t,unknownKeys:"strip",catchall:fe.create(),typeName:C.ZodObject,...T(e)});U.strictCreate=(t,e)=>new U({shape:()=>t,unknownKeys:"strict",catchall:fe.create(),typeName:C.ZodObject,...T(e)});U.lazycreate=(t,e)=>new U({shape:t,unknownKeys:"strip",catchall:fe.create(),typeName:C.ZodObject,...T(e)});class Qe extends A{_parse(e){const{ctx:r}=this._processInputParams(e),a=this._def.options;function i(n){for(const d of n)if(d.result.status==="valid")return d.result;for(const d of n)if(d.result.status==="dirty")return r.common.issues.push(...d.ctx.common.issues),d.result;const o=n.map(d=>new ce(d.ctx.common.issues));return g(r,{code:m.invalid_union,unionErrors:o}),w}if(r.common.async)return Promise.all(a.map(async n=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await n._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let n;const o=[];for(const u of a){const c={...r,common:{...r.common,issues:[]},parent:null},h=u._parseSync({data:r.data,path:r.path,parent:c});if(h.status==="valid")return h;h.status==="dirty"&&!n&&(n={result:h,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(n)return r.common.issues.push(...n.ctx.common.issues),n.result;const d=o.map(u=>new ce(u));return g(r,{code:m.invalid_union,unionErrors:d}),w}}get options(){return this._def.options}}Qe.create=(t,e)=>new Qe({options:t,typeName:C.ZodUnion,...T(e)});const ie=t=>t instanceof Rt?ie(t.schema):t instanceof me?ie(t.innerType()):t instanceof rt?[t.value]:t instanceof _e?t.options:t instanceof Nt?R.objectValues(t.enum):t instanceof it?ie(t._def.innerType):t instanceof Tt?[void 0]:t instanceof Et?[null]:t instanceof le?[void 0,...ie(t.unwrap())]:t instanceof ve?[null,...ie(t.unwrap())]:t instanceof ea||t instanceof st?ie(t.unwrap()):t instanceof nt?ie(t._def.innerType):[];class Vt extends A{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==v.object)return g(r,{code:m.invalid_type,expected:v.object,received:r.parsedType}),w;const a=this.discriminator,i=r.data[a],n=this.optionsMap.get(i);return n?r.common.async?n._parseAsync({data:r.data,path:r.path,parent:r}):n._parseSync({data:r.data,path:r.path,parent:r}):(g(r,{code:m.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),w)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,a){const i=new Map;for(const n of r){const o=ie(n.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const d of o){if(i.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);i.set(d,n)}}return new Vt({typeName:C.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...T(a)})}}function It(t,e){const r=pe(t),a=pe(e);if(t===e)return{valid:!0,data:t};if(r===v.object&&a===v.object){const i=R.objectKeys(e),n=R.objectKeys(t).filter(d=>i.indexOf(d)!==-1),o={...t,...e};for(const d of n){const u=It(t[d],e[d]);if(!u.valid)return{valid:!1};o[d]=u.data}return{valid:!0,data:o}}else if(r===v.array&&a===v.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let n=0;n<t.length;n++){const o=t[n],d=e[n],u=It(o,d);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===v.date&&a===v.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class et extends A{_parse(e){const{status:r,ctx:a}=this._processInputParams(e),i=(n,o)=>{if(pr(n)||pr(o))return w;const d=It(n.value,o.value);return d.valid?((fr(n)||fr(o))&&r.dirty(),{status:r.value,value:d.data}):(g(a,{code:m.invalid_intersection_types}),w)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([n,o])=>i(n,o)):i(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}et.create=(t,e,r)=>new et({left:t,right:e,typeName:C.ZodIntersection,...T(r)});class ge extends A{_parse(e){const{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==v.array)return g(a,{code:m.invalid_type,expected:v.array,received:a.parsedType}),w;if(a.data.length<this._def.items.length)return g(a,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),w;!this._def.rest&&a.data.length>this._def.items.length&&(g(a,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const n=[...a.data].map((o,d)=>{const u=this._def.items[d]||this._def.rest;return u?u._parse(new te(a,o,a.path,d)):null}).filter(o=>!!o);return a.common.async?Promise.all(n).then(o=>Y.mergeArray(r,o)):Y.mergeArray(r,n)}get items(){return this._def.items}rest(e){return new ge({...this._def,rest:e})}}ge.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ge({items:t,typeName:C.ZodTuple,rest:null,...T(e)})};class tt extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==v.object)return g(a,{code:m.invalid_type,expected:v.object,received:a.parsedType}),w;const i=[],n=this._def.keyType,o=this._def.valueType;for(const d in a.data)i.push({key:n._parse(new te(a,d,a.path,d)),value:o._parse(new te(a,a.data[d],a.path,d)),alwaysSet:d in a.data});return a.common.async?Y.mergeObjectAsync(r,i):Y.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,a){return r instanceof A?new tt({keyType:e,valueType:r,typeName:C.ZodRecord,...T(a)}):new tt({keyType:se.create(),valueType:e,typeName:C.ZodRecord,...T(r)})}}class vr extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==v.map)return g(a,{code:m.invalid_type,expected:v.map,received:a.parsedType}),w;const i=this._def.keyType,n=this._def.valueType,o=[...a.data.entries()].map(([d,u],c)=>({key:i._parse(new te(a,d,a.path,[c,"key"])),value:n._parse(new te(a,u,a.path,[c,"value"]))}));if(a.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const u of o){const c=await u.key,h=await u.value;if(c.status==="aborted"||h.status==="aborted")return w;(c.status==="dirty"||h.status==="dirty")&&r.dirty(),d.set(c.value,h.value)}return{status:r.value,value:d}})}else{const d=new Map;for(const u of o){const c=u.key,h=u.value;if(c.status==="aborted"||h.status==="aborted")return w;(c.status==="dirty"||h.status==="dirty")&&r.dirty(),d.set(c.value,h.value)}return{status:r.value,value:d}}}}vr.create=(t,e,r)=>new vr({valueType:e,keyType:t,typeName:C.ZodMap,...T(r)});class $e extends A{_parse(e){const{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==v.set)return g(a,{code:m.invalid_type,expected:v.set,received:a.parsedType}),w;const i=this._def;i.minSize!==null&&a.data.size<i.minSize.value&&(g(a,{code:m.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&a.data.size>i.maxSize.value&&(g(a,{code:m.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const n=this._def.valueType;function o(u){const c=new Set;for(const h of u){if(h.status==="aborted")return w;h.status==="dirty"&&r.dirty(),c.add(h.value)}return{status:r.value,value:c}}const d=[...a.data.values()].map((u,c)=>n._parse(new te(a,u,a.path,c)));return a.common.async?Promise.all(d).then(u=>o(u)):o(d)}min(e,r){return new $e({...this._def,minSize:{value:e,message:k.toString(r)}})}max(e,r){return new $e({...this._def,maxSize:{value:e,message:k.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}$e.create=(t,e)=>new $e({valueType:t,minSize:null,maxSize:null,typeName:C.ZodSet,...T(e)});class Rt extends A{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Rt.create=(t,e)=>new Rt({getter:t,typeName:C.ZodLazy,...T(e)});class rt extends A{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return g(r,{received:r.data,code:m.invalid_literal,expected:this._def.value}),w}return{status:"valid",value:e.data}}get value(){return this._def.value}}rt.create=(t,e)=>new rt({value:t,typeName:C.ZodLiteral,...T(e)});function Qr(t,e){return new _e({values:t,typeName:C.ZodEnum,...T(e)})}class _e extends A{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),a=this._def.values;return g(r,{expected:R.joinValues(a),received:r.parsedType,code:m.invalid_type}),w}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),a=this._def.values;return g(r,{received:r.data,code:m.invalid_enum_value,options:a}),w}return K(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return _e.create(e,{...this._def,...r})}exclude(e,r=this._def){return _e.create(this.options.filter(a=>!e.includes(a)),{...this._def,...r})}}_e.create=Qr;class Nt extends A{_parse(e){const r=R.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==v.string&&a.parsedType!==v.number){const i=R.objectValues(r);return g(a,{expected:R.joinValues(i),received:a.parsedType,code:m.invalid_type}),w}if(this._cache||(this._cache=new Set(R.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=R.objectValues(r);return g(a,{received:a.data,code:m.invalid_enum_value,options:i}),w}return K(e.data)}get enum(){return this._def.values}}Nt.create=(t,e)=>new Nt({values:t,typeName:C.ZodNativeEnum,...T(e)});class at extends A{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==v.promise&&r.common.async===!1)return g(r,{code:m.invalid_type,expected:v.promise,received:r.parsedType}),w;const a=r.parsedType===v.promise?r.data:Promise.resolve(r.data);return K(a.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}at.create=(t,e)=>new at({type:t,typeName:C.ZodPromise,...T(e)});class me extends A{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===C.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:a}=this._processInputParams(e),i=this._def.effect||null,n={addIssue:o=>{g(a,o),o.fatal?r.abort():r.dirty()},get path(){return a.path}};if(n.addIssue=n.addIssue.bind(n),i.type==="preprocess"){const o=i.transform(a.data,n);if(a.common.async)return Promise.resolve(o).then(async d=>{if(r.value==="aborted")return w;const u=await this._def.schema._parseAsync({data:d,path:a.path,parent:a});return u.status==="aborted"?w:u.status==="dirty"||r.value==="dirty"?Re(u.value):u});{if(r.value==="aborted")return w;const d=this._def.schema._parseSync({data:o,path:a.path,parent:a});return d.status==="aborted"?w:d.status==="dirty"||r.value==="dirty"?Re(d.value):d}}if(i.type==="refinement"){const o=d=>{const u=i.refinement(d,n);if(a.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(a.common.async===!1){const d=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return d.status==="aborted"?w:(d.status==="dirty"&&r.dirty(),o(d.value),{status:r.value,value:d.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(d=>d.status==="aborted"?w:(d.status==="dirty"&&r.dirty(),o(d.value).then(()=>({status:r.value,value:d.value}))))}if(i.type==="transform")if(a.common.async===!1){const o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Ce(o))return w;const d=i.transform(o.value,n);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:d}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(o=>Ce(o)?Promise.resolve(i.transform(o.value,n)).then(d=>({status:r.value,value:d})):w);R.assertNever(i)}}me.create=(t,e,r)=>new me({schema:t,typeName:C.ZodEffects,effect:e,...T(r)});me.createWithPreprocess=(t,e,r)=>new me({schema:e,effect:{type:"preprocess",transform:t},typeName:C.ZodEffects,...T(r)});class le extends A{_parse(e){return this._getType(e)===v.undefined?K(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}le.create=(t,e)=>new le({innerType:t,typeName:C.ZodOptional,...T(e)});class ve extends A{_parse(e){return this._getType(e)===v.null?K(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ve.create=(t,e)=>new ve({innerType:t,typeName:C.ZodNullable,...T(e)});class it extends A{_parse(e){const{ctx:r}=this._processInputParams(e);let a=r.data;return r.parsedType===v.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}it.create=(t,e)=>new it({innerType:t,typeName:C.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...T(e)});class nt extends A{_parse(e){const{ctx:r}=this._processInputParams(e),a={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Je(i)?i.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new ce(a.common.issues)},input:a.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ce(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}nt.create=(t,e)=>new nt({innerType:t,typeName:C.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...T(e)});class yr extends A{_parse(e){if(this._getType(e)!==v.nan){const a=this._getOrReturnCtx(e);return g(a,{code:m.invalid_type,expected:v.nan,received:a.parsedType}),w}return{status:"valid",value:e.data}}}yr.create=t=>new yr({typeName:C.ZodNaN,...T(t)});class ea extends A{_parse(e){const{ctx:r}=this._processInputParams(e),a=r.data;return this._def.type._parse({data:a,path:r.path,parent:r})}unwrap(){return this._def.type}}class qt extends A{_parse(e){const{status:r,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return n.status==="aborted"?w:n.status==="dirty"?(r.dirty(),Re(n.value)):this._def.out._parseAsync({data:n.value,path:a.path,parent:a})})();{const i=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?w:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:a.path,parent:a})}}static create(e,r){return new qt({in:e,out:r,typeName:C.ZodPipeline})}}class st extends A{_parse(e){const r=this._def.innerType._parse(e),a=i=>(Ce(i)&&(i.value=Object.freeze(i.value)),i);return Je(r)?r.then(i=>a(i)):a(r)}unwrap(){return this._def.innerType}}st.create=(t,e)=>new st({innerType:t,typeName:C.ZodReadonly,...T(e)});var C;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(C||(C={}));const l=se.create,P=Se.create,re=St.create,Wt=At.create;fe.create;const f=ee.create,b=U.create;Qe.create;const Xt=Vt.create;et.create;const jt=ge.create,Ie=tt.create,S=rt.create,D=_e.create;at.create;le.create;ve.create;const Yt=me.createWithPreprocess;var Gt=b({code:l(),file:l(),line:P().optional(),action_hint:l()}),Ri=b({summary:l(),intent_clues:f(l()),tech_stack:f(l()),impact:f(l()),must_read_if:l(),entities:f(l()).optional()}),kr=b({stable_id:l(),level:D(["L0","L1","L2"]),required:re(),selectable:re(),description:Ri}),Ni=b({target_path:l(),path_segments:f(l()),extension:l(),inferred_domain:f(l()),known_tech:f(l()),user_intent:l(),intent_tokens:f(l()),impact_hints:f(l()),detected_entities:f(l())}),ji=b({required_levels:jt([S("L0"),S("L2")]),ai_selectable_levels:jt([S("L1")]),final_fetch_rule:S("required_stable_ids + ai_selected_l1_stable_ids")});b({paths:f(l()).min(1).describe("Candidate file paths to build neutral rule selection context for"),intent:l().optional().describe("User-stated requirement or implementation intent; used only to build a neutral requirement profile"),known_tech:f(l()).optional().describe("Known technologies involved in the requirement profile"),detected_entities:Ie(f(l())).optional().describe("Optional path-keyed detected entities for the requirement profile"),client_hash:l().optional().describe("Revision hash from a prior fab_plan_context response; enables stale detection"),correlation_id:l().optional().describe("Optional caller-provided correlation id for Event Ledger records"),session_id:l().optional().describe("Optional caller-provided session id for Event Ledger records")});b({revision_hash:l(),stale:re(),selection_token:l(),entries:f(b({path:l(),requirement_profile:Ni,description_index:f(kr),required_stable_ids:f(l()),ai_selectable_stable_ids:f(l()),initial_selected_stable_ids:f(l()),selection_policy:ji})),shared:b({required_stable_ids:f(l()),ai_selectable_stable_ids:f(l()),description_index:f(kr),preflight_diagnostics:f(b({code:S("missing_description"),severity:S("warn"),message:l(),stable_ids:f(l()).optional(),path:l().optional()}))}),warnings:f(Gt).optional()});var xr=b({path:l(),content:l()}),Li=b({file:l(),excerpt:l()}),$i=b({path:l(),description:l()});b({path:l().describe("Target file path to query rules for"),client_hash:l().optional().describe("Revision hash from prior fab_get_rules response; enables stale detection"),correlation_id:l().optional().describe("Optional caller-provided correlation id for Event Ledger records"),session_id:l().optional().describe("Optional caller-provided session id for Event Ledger records")});b({revision_hash:l(),stale:re(),rules:b({L0:l(),L1:f(xr),L2:f(xr),human_locked_nearby:f(Li),description_stubs:f($i).optional()}),warnings:f(Gt).optional()});var ta=["MISSION_STATEMENT","MANDATORY_INJECTION","BUSINESS_LOGIC_CHUNKS","CONTEXT_INFO"];b({selection_token:l().min(1).describe("Selection token returned by fab_plan_context"),sections:f(D(ta)).min(1).describe("Structured rule sections to fetch"),ai_selected_stable_ids:f(l()).describe("AI-selected L1 stable_ids chosen from fab_plan_context ai_selectable_stable_ids"),ai_selection_reasons:Ie(l().min(1)).describe("Reason for each AI-selected L1 stable_id"),correlation_id:l().optional().describe("Optional caller-provided correlation id for Event Ledger records"),session_id:l().optional().describe("Optional caller-provided session id for Event Ledger records")});b({revision_hash:l(),precedence:jt([S("L2"),S("L1"),S("L0")]),selected_stable_ids:f(l()),rules:f(b({stable_id:l(),level:D(["L0","L1","L2"]),path:l(),sections:Ie(l())})),diagnostics:f(b({code:S("missing_section"),severity:S("warn"),stable_id:l(),section:D(ta),message:l()})),warnings:f(Gt).optional()});var Pi=D(["ai","human"]),ra=Yt(t=>{if(!(t==null||t==="")){if(typeof t=="number")return t;if(typeof t=="string"){const e=t.trim();if(e.length===0)return;if(/^\d+$/.test(e))return Number.parseInt(e,10);const r=Date.parse(e);return Number.isNaN(r)?t:r}return t}},P().int().nonnegative());b({source:Pi.optional(),since:ra.optional()});b({ledger_id:l().trim().min(1).optional(),ts:ra.optional()}).superRefine((t,e)=>{[t.ledger_id,t.ts].filter(a=>a!==void 0).length!==1&&e.addIssue({code:m.custom,message:"Provide exactly one of ledger_id or ts.",path:["ledger_id"]})});b({file:l().min(1),start_line:P().int().positive(),end_line:P().int().positive(),new_hash:l().min(1)});b({file:l().min(1)});b({ledger_entry_id:l().min(1),annotation:l().trim().min(1)});var wr=".fabric/agents/",Oi=["L0","L1","L2"],Fi=["mirror","cross-cutting","domain","local","global"],Mi=["declared","derived"],Lt=D(Oi),zi=D(Fi),Di=D(Mi),aa=b({summary:l(),intent_clues:f(l()),tech_stack:f(l()),impact:f(l()),must_read_if:l(),entities:f(l()).optional()}).strict();b({stable_id:l(),level:Lt,required:re(),selectable:re(),description:aa}).strict();var Zi=b({file:l(),content_ref:l().optional(),scope_glob:l(),deps:f(l()),priority:D(["high","medium","low"]),level:Lt.optional(),layer:Lt,topology_type:zi,hash:l(),stable_id:l().optional(),identity_source:Di.optional(),activation:b({tier:D(["always","path","description"]),description:l().optional()}).optional(),description:aa.optional(),sections:f(l()).optional()}),Ui=Yt(t=>!Wi(t)||typeof t.file!="string"?t:$t(t),Zi),Hi=b({revision:l(),nodes:Ie(Ui)});function $t(t){const e=t.stable_id??ia(t.file),r=Bi(t);return{...t,layer:t.layer??t.level??Cr(t.file),level:t.level??t.layer??Cr(t.file),topology_type:t.topology_type??Vi(t.file),stable_id:e,identity_source:r}}function ia(t){const e=Jt(t);return e==="AGENTS.md"||e===".fabric/bootstrap/README.md"?"bootstrap":na(e).replace(/\.md$/u,"")}function Bi(t){if(t.identity_source!==void 0)return t.identity_source;const e=ia(t.file);return t.stable_id!==void 0&&t.stable_id!==e?"declared":"derived"}function Cr(t){const e=Jt(t);if(e==="AGENTS.md"||e===".fabric/bootstrap/README.md")return"L0";if(sa(e))return"L1";const r=na(e),a=qi(r);return a===0?"L0":a<=2?"L1":"L2"}function Vi(t){return sa(Jt(t))?"cross-cutting":"mirror"}function na(t){return t.startsWith(wr)?t.slice(wr.length):t}function qi(t){const e=t.split("/").filter(Boolean);return Math.max(e.length-1,0)}function sa(t){return t.split("/").includes("_cross")}function Jt(t){return t.replaceAll("\\","/")}function Wi(t){return typeof t=="object"&&t!==null}var Xi=1,ke=l().min(1),Yi=b({rule_stable_id:l().min(1),rule_file:l().min(1),rule_hash:ke,previous_rule_hash:ke.optional(),test_file:l().min(1),test_hash:ke,previous_test_hash:ke.optional(),annotation_line:P().int().positive()}).strict(),Gi=b({rule_stable_id:l().min(1),test_file:l().min(1),test_hash:ke,previous_test_hash:ke.optional(),annotation_line:P().int().positive()}).strict();b({schema_version:S(Xi),generated_at:l().datetime({offset:!0}),revision:l().min(1).optional(),previous_revision:l().min(1).optional(),links:f(Yi),orphan_annotations:f(Gi)}).strict();var oa={id:l().optional(),ts:P().int().nonnegative(),intent:l(),affected_paths:f(l())},Ji=b({...oa,source:S("ai"),commit_sha:l().optional()}),Ki=b({...oa,source:S("human"),parent_sha:l(),parent_ledger_entry_id:l().optional(),diff_stat:l(),annotation:l().optional()}),Qi=Xt("source",[Ji,Ki]),en=Yt(t=>t&&typeof t=="object"&&!Array.isArray(t)&&(!("source"in t)||t.source===void 0)?{...t,source:"human"}:t,Qi),Pe=b({file:l(),start_line:P().int().nonnegative(),end_line:P().int().nonnegative(),hash:l()});b({locked:f(Pe).optional()});var Sr=D(["strict","warn","off"]),tn=b({claudeCodeCLI:l().optional(),claudeCodeDesktop:l().optional(),cursor:l().optional(),codexCLI:l().optional()}).passthrough(),rn=b({warnBytes:P().int().positive().optional(),hardBytes:P().int().positive().optional()}).optional();b({clientPaths:tn.optional(),externalFixturePath:l().optional(),scanIgnores:f(l()).optional(),auditMode:Sr.optional(),audit_mode:Sr.optional(),mcpPayloadLimits:rn});var an=b({path:l(),lines:l(),snippet:l(),pattern_hint:l()}),nn=b({file:l(),line:l(),snippet:l()}),sn=b({ratio:P().min(0).max(1),total:P().int().nonnegative(),matched:P().int().nonnegative(),co_occurring_patterns:f(l())}),on=b({type:D(["framework","pattern","invariant","domain"]),statement:l(),confidence:D(["HIGH","MEDIUM","LOW"]),evidence:f(nn),coverage:sn,proposed_rule:l().optional(),alternatives:f(l()).optional()}),dn=b({total_files:P().int().nonnegative(),by_ext:Ie(P().int().nonnegative()),key_dirs:f(l()),max_depth:P().int().nonnegative()}),ln=b({path:l(),reason:l(),size_bytes:P().int().nonnegative().optional()}),cn=b({kind:l(),version:l(),subkind:l(),evidence:f(l())}),un=b({quality:D(["missing","stub","ok"]),line_count:P().int().nonnegative(),has_contributing:re()}),hn=b({path:l(),family:D(["entry","component","config","test","domain"]),rationale:l()}),pn=b({max_files:S(15),max_lines_per_file:S(100)}),fn=b({version:l(),generated_at:l(),generated_by:l(),target:l(),project_name:l(),framework:cn,topology:dn,entry_points:f(ln),code_samples:f(an),assertions:f(on),candidate_files:f(hn),sampling_budget:pn,readme:un,recommendations_for_skill:f(l()).optional()}),mn=b({kind:l(),version:l(),subkind:l()}),bn=b({confidence:D(["HIGH","MEDIUM","LOW"]),evidence_refs:f(l())}),gn=b({file:l(),lines:l()}),_n=b({type:D(["ban","require","protect"]),rule:l(),rationale:l().optional(),confidence_snapshot:bn.optional(),source_evidence:f(gn).optional()}),vn=b({name:l(),paths:f(l()),summary:l().optional(),topology_type:D(["mirror","cross-cutting"]).optional(),target_path:l().optional()}),yn=b({phase:l(),question:l(),answer:l(),presentation:l().optional(),user_corrections:f(l()).optional()});b({framework:mn,architecture_patterns:f(l()),invariants:f(_n),domain_groups:f(vn),interview_trail:f(yn),forensic_ref:l()});var kn=b({type:S("meta:updated"),payload:Hi}),xn=b({type:S("lock:drift"),payload:b({locked:f(Pe),drifted:f(Pe)})}),wn=b({type:S("lock:approved"),payload:b({locked:f(Pe),approved:f(Pe)})}),Cn=b({type:S("ledger:appended"),payload:en}),Sn=b({type:S("drift:detected"),payload:fn});Xt("type",[kn,xn,wn,Cn,Sn]);var q={kind:S("fabric-event"),id:l(),ts:P().int().nonnegative(),schema_version:S(1),correlation_id:l().optional(),session_id:l().optional()},Tn=Ie(l()),En=b({...q,event_type:S("rule_context_planned"),target_paths:f(l()),required_stable_ids:f(l()),ai_selectable_stable_ids:f(l()),final_stable_ids:f(l()),selection_token:l().optional(),client_hash:l().optional(),intent:l().optional(),known_tech:f(l()).optional(),diagnostics:f(Wt()).optional()}),An=b({...q,event_type:S("rule_selection"),selection_token:l(),target_paths:f(l()),required_stable_ids:f(l()),ai_selectable_stable_ids:f(l()),ai_selected_stable_ids:f(l()),final_stable_ids:f(l()),ai_selection_reasons:Tn,rejected_stable_ids:f(l()),ignored_stable_ids:f(l())}),In=b({...q,event_type:S("rule_sections_fetched"),selection_token:l(),target_paths:f(l()).optional(),requested_sections:f(l()),final_stable_ids:f(l()),ai_selected_stable_ids:f(l()),diagnostics:f(Wt()).optional()}),Rn=b({...q,event_type:S("edit_intent_checked"),path:l(),compliant:re(),intent:l(),ledger_entry_id:l(),ledger_source:D(["ai","human"]).optional(),commit_sha:l().optional(),parent_sha:l().optional(),parent_ledger_entry_id:l().optional(),diff_stat:l().optional(),annotation:l().optional(),matched_rule_context_ts:P().int().nonnegative().nullable(),window_ms:P().int().nonnegative()}),Nn=b({...q,event_type:S("rule_drift_detected"),revision:l().optional(),drifted_stable_ids:f(l()),missing_files:f(l()),stale_files:f(l()),details:f(b({file:l(),stable_id:l(),expected_hash:l(),actual_hash:l().nullable()})).optional()}),jn=b({...q,event_type:S("rule_baseline_accepted"),revision:l(),previous_revision:l().optional(),accepted_stable_ids:f(l()),source:D(["doctor_fix","sync_meta"]).optional()}),Ln=b({...q,event_type:S("baseline_synced"),revision:l(),previous_revision:l().optional(),synced_files:f(l()),accepted_stable_ids:f(l()),source:D(["doctor_fix","sync_meta"])}),$n=b({...q,event_type:S("mcp_event"),mcp_event_id:l(),stream_id:l(),message:Wt()}),Pn=b({...q,event_type:S("reapply_completed"),preserved_ledger:re(),preserved_meta:re(),rules_count:P().int().nonnegative()}),On=b({...q,event_type:S("event_ledger_truncated"),byte_offset:P().int().nonnegative(),byte_length:P().int().nonnegative(),corrupted_path:l()}),Fn=b({...q,event_type:S("mcp_config_migrated"),source:S("doctor_fix"),removed_from:l()}),Mn=b({...q,event_type:S("meta_reconciled_on_startup"),reconciled_files:f(l()),duration_ms:P().int().nonnegative(),source:S("reconcileRules")}),zn=b({...q,event_type:S("meta_reconciled"),reconciled_files:f(l()),duration_ms:P().int().nonnegative(),trigger:D(["doctor","manual"]),source:S("reconcileRules")}),Dn=b({...q,event_type:S("claude_skill_path_migrated"),from:l(),to:l()}),Zn=b({...q,event_type:S("claude_hook_path_migrated"),from:l(),to:l()}),Un=b({...q,event_type:S("codex_skill_path_migrated"),from:l(),to:l()}),Hn=b({...q,event_type:S("legacy_client_path_present"),removed:f(l())});Xt("event_type",[En,An,In,Rn,Nn,jn,Ln,$n,Pn,On,Fn,Mn,zn,Dn,Zn,Un,Hn]);function Bn({variant:t,state:e="idle",size:r="md",onClick:a,children:i,ariaLabel:n}){const{t:o}=J(),[d,u]=O(e),c=e==="idle"?d:e,h=c==="busy",p=async()=>{if(!h){u("busy");try{await a(),u("success"),window.setTimeout(()=>u("idle"),900)}catch{u("error"),window.setTimeout(()=>u("idle"),1400)}}},y="inline-flex items-center justify-center gap-2 font-medium rounded-lg transition-all duration-200 border",_=r==="sm"?"px-3 py-1.5 text-xs min-h-[32px]":"px-4 py-2 text-sm min-h-[40px]";let x="";return c==="success"?x="bg-green-500/10 border-green-500/30 text-green-600 dark:bg-green-500/20 dark:border-green-500/30 dark:text-green-400 cursor-default":c==="error"?x="bg-red-500/10 border-red-500 text-red-600 dark:bg-red-500/20 dark:border-red-500 dark:text-red-400 cursor-pointer hover:bg-red-500/20 dark:hover:bg-red-500/30":t==="approve"?x="bg-brand-accent border-transparent text-white hover:bg-brand-accent/90 dark:bg-purple-600 dark:hover:bg-purple-500 cursor-pointer shadow-sm":x="bg-light-surface border-light-border text-light-text hover:bg-light-border/50 dark:bg-white/5 dark:border-dark-border dark:text-dark-text dark:hover:bg-white/10 cursor-pointer shadow-sm",s("button",{type:"button",class:`${y} ${_} ${x} ${h?"opacity-70 cursor-not-allowed transform-none":"active:scale-[0.98]"}`,"aria-label":n,"aria-busy":h,"aria-disabled":h,onClick:p,children:[h?s("span",{class:"w-3.5 h-3.5 rounded-full border-2 border-current border-r-transparent animate-spin","aria-hidden":"true"}):null,c==="success"?s("span",{"aria-hidden":"true",children:"✓"}):null,c==="error"?o("dashboard.approve-button.retry"):i]})}function Vn({nodes:t}){const{t:e}=J(),r=Xn(t);return s("section",{class:"flex flex-col bg-light-surface border border-light-border sm:rounded-2xl sm:shadow-sm dark:bg-dark-surface dark:border-dark-border dark:shadow-xl overflow-hidden min-h-[280px]",children:[s("div",{class:"p-4 border-b border-light-border dark:border-dark-border flex justify-between items-start bg-light-surface/90 dark:bg-transparent shrink-0",children:[s("div",{children:[s("h3",{class:"text-sm font-bold text-light-text dark:text-dark-text m-0",children:e("dashboard.rule-topology.heatmap.title")}),s("p",{class:"text-xs text-light-muted dark:text-dark-muted mt-1",children:e("dashboard.rule-topology.heatmap.subtitle")})]}),s("span",{class:"text-[10px] font-mono bg-light-border/50 dark:bg-white/10 px-2 py-0.5 rounded-full border border-light-border dark:border-dark-border whitespace-nowrap",children:e("dashboard.rule-topology.heatmap.count",{count:String(r.length)})})]}),r.length===0?s("div",{class:"p-8 flex-1 flex items-center justify-center text-sm text-light-muted dark:text-dark-muted",children:e("dashboard.rule-topology.heatmap.empty")}):s("div",{class:"flex-1 overflow-y-auto p-4 flex flex-col gap-3",role:"list","aria-label":e("dashboard.rule-topology.heatmap.aria-label"),children:r.map(a=>s("article",{class:`p-3 rounded-xl border bg-light-bg/50 dark:bg-black/20 flex flex-col ${Wn(a.density)}`,role:"listitem",children:[s("div",{class:"flex justify-between items-center gap-2",children:[s("span",{class:"font-mono text-sm font-medium text-light-text dark:text-dark-text truncate",children:a.path}),s("span",{class:`text-[10px] font-bold px-1.5 py-0.5 rounded whitespace-nowrap ${qn(a.density)}`,children:e(`dashboard.rule-topology.heatmap.density.${a.density}`)})]}),s("div",{class:"flex justify-between items-center gap-2 mt-2 text-xs font-mono text-light-muted dark:text-dark-muted",children:[s("span",{class:"whitespace-nowrap",children:e("dashboard.rule-topology.heatmap.rules",{count:String(a.directRuleCount)})}),s("span",{class:"truncate opacity-80",children:a.matchingGlobs.slice(0,2).join(" · ")||e("dashboard.rule-topology.heatmap.uncovered")})]})]},a.path))})]})}function qn(t){switch(t){case"full":return"bg-green-500/10 text-green-600 border border-green-500/30 dark:bg-green-500/20 dark:text-green-400";case"partial":return"bg-amber-500/10 text-amber-600 border border-amber-500/30 dark:bg-amber-500/20 dark:text-amber-400";case"none":return"bg-slate-500/10 text-slate-600 border border-slate-500/30 dark:bg-slate-500/20 dark:text-slate-400"}}function Wn(t){switch(t){case"full":return"border-l-4 border-l-green-500/50 border-t-light-border border-r-light-border border-b-light-border dark:border-t-dark-border dark:border-r-dark-border dark:border-b-dark-border";case"partial":return"border-l-4 border-l-amber-500/50 border-t-light-border border-r-light-border border-b-light-border dark:border-t-dark-border dark:border-r-dark-border dark:border-b-dark-border";case"none":return"border-l-4 border-l-slate-500/30 border-t-light-border border-r-light-border border-b-light-border dark:border-t-dark-border dark:border-r-dark-border dark:border-b-dark-border"}}function Xn(t){return Yn(t).map(a=>{const i=t.filter(o=>Jn(a,ot(o.scope_glob))),n=i.some(o=>Gn(a,ot(o.scope_glob)));return{path:a,density:n?"full":i.length>0?"partial":"none",matchingGlobs:i.map(o=>o.scope_glob),directRuleCount:i.length}}).sort((a,i)=>a.path.localeCompare(i.path))}function Yn(t){const e=new Set;for(const r of t){for(const i of Tr(r.file))e.add(i);const a=Kt(r.scope_glob);if(a.length>0)for(const i of Tr(a))e.add(i)}return Array.from(e)}function Tr(t){const r=ot(t).split("/").filter(Boolean);if(r.length===0)return[];const i=(r.at(-1)??"").includes(".")?r.length-1:r.length,n=[];for(let o=1;o<=i;o+=1)n.push(r.slice(0,o).join("/"));return n}function Kt(t){const e=ot(t).split("/").filter(Boolean),r=[];for(const a of e){if(a==="**"||/[*?[\]{}()!]/.test(a))break;r.push(a)}return r.join("/")}function Gn(t,e){const r=Kt(e);return r.length===0?!1:r===t&&(e===t||e.startsWith(`${t}/**`)||e.startsWith(`${t}/*`))}function Jn(t,e){const r=Kt(e);return r.length===0?!0:r===t||r.startsWith(`${t}/`)||t.startsWith(`${r}/`)}function ot(t){return t.replaceAll("\\","/").replace(/^\.?\//,"").replace(/\/+$/,"")}function Kn({meta:t,rulesContext:e}){const{t:r}=J(),a=es(t,e);return s("section",{class:"flex flex-col bg-light-surface border border-light-border sm:rounded-2xl sm:shadow-sm dark:bg-dark-surface dark:border-dark-border dark:shadow-xl overflow-hidden min-h-[280px]",children:[s("div",{class:"p-4 border-b border-light-border dark:border-dark-border flex justify-between items-start bg-light-surface/90 dark:bg-transparent shrink-0",children:[s("div",{children:[s("h3",{class:"text-sm font-bold text-light-text dark:text-dark-text m-0",children:r("dashboard.rule-topology.hit-reason.title")}),s("p",{class:"text-xs text-light-muted dark:text-dark-muted mt-1",children:r("dashboard.rule-topology.hit-reason.subtitle")})]}),s("span",{class:"text-[10px] font-mono bg-light-border/50 dark:bg-white/10 px-2 py-0.5 rounded-full border border-light-border dark:border-dark-border whitespace-nowrap",children:r("dashboard.rule-topology.hit-reason.count",{count:String(a.length)})})]}),a.length===0?s("div",{class:"p-8 flex-1 flex items-center justify-center text-sm text-light-muted dark:text-dark-muted",children:r("dashboard.rule-topology.hit-reason.empty")}):s("div",{class:"flex-1 overflow-y-auto p-4 flex flex-col gap-3",role:"list","aria-label":r("dashboard.rule-topology.hit-reason.aria-label"),children:a.map(i=>s("article",{class:"p-4 rounded-xl border bg-light-bg/50 border-light-border dark:bg-black/20 dark:border-dark-border flex flex-col",role:"listitem",children:[s("div",{class:"flex justify-between items-center gap-2 mb-2",children:[s("strong",{class:"font-mono text-sm text-light-text dark:text-dark-text truncate",children:i.file}),s("span",{class:`text-[10px] font-bold px-1.5 py-0.5 rounded whitespace-nowrap ${Qn(i.tier)}`,children:r(`dashboard.rule-topology.hit-reason.tier.${i.tier}`)})]}),s("div",{class:"flex justify-between items-center gap-2 text-xs font-mono text-light-muted dark:text-dark-muted",children:[s("span",{children:i.layer}),s("span",{class:"truncate",children:i.tier==="always"?r("dashboard.rule-topology.hit-reason.global"):i.scope})]}),i.description!==null&&i.description.length>0?s("p",{class:"text-sm text-light-text dark:text-dark-muted mt-3 leading-relaxed border-t border-light-border dark:border-dark-border pt-3",children:i.description}):null]},`${i.layer}:${i.file}:${i.tier}`))})]})}function Qn(t){switch(t){case"always":return"bg-green-500/10 text-green-600 border border-green-500/30 dark:bg-green-500/20 dark:text-green-400";case"path":return"bg-amber-500/10 text-amber-600 border border-amber-500/30 dark:bg-amber-500/20 dark:text-amber-400";case"description":return"bg-slate-500/10 text-slate-600 border border-slate-500/30 dark:bg-slate-500/20 dark:text-slate-400";default:return"bg-light-border/50 text-light-muted dark:bg-white/10 dark:text-dark-muted"}}function es(t,e){if(t===null||e===null)return[];const r=new Map(Object.values(t.nodes).map(n=>[n.file,n])),a=[],i=new Set;for(const n of e.L1)Er(a,i,r,n.path,"L1");for(const n of e.L2)Er(a,i,r,n.path,"L2");for(const n of e.description_stubs??[]){const o=`description:${n.path}`;if(i.has(o))continue;const d=r.get(n.path);a.push({file:n.path,layer:"description",tier:"description",scope:d?.scope_glob??"",description:n.description}),i.add(o)}return a.sort((n,o)=>n.file.localeCompare(o.file))}function Er(t,e,r,a,i){const n=`${i}:${a}`;if(e.has(n))return;const o=r.get(a),d=o?.activation?.tier??"path";t.push({file:a,layer:i,tier:d,scope:o?.scope_glob??"",description:d==="description"?o?.activation?.description??null:null}),e.add(n)}function Pt({source:t,size:e="sm",variant:r="filled",interactive:a=!1,selected:i=!1,onClick:n}){const{t:o}=J(),d=o(`dashboard.source.${t}`),u="inline-flex items-center gap-1.5 rounded-full font-mono text-[10px] font-bold uppercase tracking-widest border transition-colors",c=e==="sm"?"px-2 py-0.5":"px-3 py-1";let h="";t==="ai"?r==="filled"?h=i?"bg-brand-accent/20 border-brand-accent/50 text-brand-accent dark:bg-purple-500/30 dark:border-purple-500/50 dark:text-purple-300":"bg-brand-accent/10 border-brand-accent/30 text-brand-accent/80 dark:bg-purple-500/10 dark:border-purple-500/30 dark:text-purple-400":h=i?"bg-transparent border-brand-accent text-brand-accent dark:border-purple-500 dark:text-purple-400":"bg-transparent border-brand-accent/30 text-brand-accent/70 dark:border-purple-500/30 dark:text-purple-400/70":r==="filled"?h=i?"bg-teal-500/20 border-teal-500/50 text-teal-600 dark:bg-teal-500/30 dark:border-teal-500/50 dark:text-teal-300":"bg-teal-500/10 border-teal-500/30 text-teal-600/80 dark:bg-teal-500/10 dark:border-teal-500/30 dark:text-teal-400":h=i?"bg-transparent border-teal-500 text-teal-600 dark:border-teal-500 dark:text-teal-400":"bg-transparent border-teal-500/30 text-teal-600/70 dark:border-teal-500/30 dark:text-teal-400/70";const y=`${u} ${c} ${h} ${a&&!i?"hover:bg-opacity-80 dark:hover:bg-opacity-80 cursor-pointer":""}`,_=t==="ai"?"bg-brand-accent dark:bg-purple-400":"bg-teal-500 dark:bg-teal-400";return a?s("button",{class:y,type:"button","aria-pressed":i,onClick:n,children:[s("span",{class:`w-1.5 h-1.5 rounded-full ${_} ${i?"shadow-[0_0_8px_currentColor]":""}`,"aria-hidden":"true"}),d]}):s("span",{class:y,children:[s("span",{class:`w-1.5 h-1.5 rounded-full ${_} ${i?"shadow-[0_0_8px_currentColor]":""}`,"aria-hidden":"true"}),d]})}function ts({entry:t,onAnnotate:e,expanded:r=!1,readOnly:a=!1}){const{locale:i,t:n}=J(),[o,d]=O(r),[u,c]=O(""),h=t.source==="ai",p=!a&&h&&e!==void 0&&t.id!==void 0,y=async()=>{const x=u.trim();!h||e===void 0||x.length===0||(await e(t,x),c(""),d(!1))};return s("article",{class:`p-5 rounded-2xl border bg-light-surface dark:bg-dark-surface dark:backdrop-blur-xl shadow-sm ${h?"border-brand-accent/30 dark:border-purple-500/30":"border-teal-500/30 dark:border-teal-500/30"} flex flex-col gap-3 relative`,"aria-label":n("dashboard.timeline-entry.aria-label",{source:n(`dashboard.source.${t.source}`),intent:t.intent}),children:[s("div",{class:"flex flex-wrap items-center gap-3",children:[s(Pt,{source:t.source}),h?s("span",{class:"font-mono text-[10px] px-2 py-1 rounded-md bg-light-border/50 text-light-muted dark:bg-white/10 dark:text-dark-muted border border-light-border dark:border-dark-border",children:t.commit_sha?t.commit_sha.substring(0,8):n("dashboard.timeline-entry.working-tree")}):null,h?null:s("span",{class:"font-mono text-[10px] px-2 py-1 rounded-md bg-light-border/50 text-light-muted dark:bg-white/10 dark:text-dark-muted border border-light-border dark:border-dark-border",children:n("dashboard.timeline-entry.parent",{parent:t.parent_sha?t.parent_sha.substring(0,8):""})}),h?null:s("span",{class:"font-mono text-[10px] px-2 py-1 rounded-full bg-light-border/30 text-light-muted dark:bg-black/20 dark:text-dark-muted border border-light-border dark:border-dark-border",children:t.diff_stat}),s("time",{class:"ml-auto font-mono text-[10px] text-light-muted dark:text-dark-muted opacity-60 tracking-wider",dateTime:new Date(t.ts).toISOString(),children:rs(t.ts,i)})]}),s("h3",{class:"text-base font-medium text-light-text dark:text-white/90 leading-tight m-0",children:t.intent}),s("div",{class:"flex flex-wrap gap-2 text-[10px] font-mono text-light-muted dark:text-dark-muted mt-1",children:[s("span",{class:"flex items-center gap-1 opacity-70",children:[s("svg",{class:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})," ",t.affected_paths.length," ",n("dashboard.timeline-entry.paths")]}),t.affected_paths.slice(0,3).map(x=>s("span",{class:"truncate max-w-[120px] bg-light-border/20 dark:bg-white/5 px-1.5 py-0.5 rounded",children:x.split("/").pop()},x)),t.affected_paths.length>3&&s("span",{class:"opacity-50",children:"..."})]}),!h&&t.annotation!==void 0?s("div",{class:"mt-2 p-3 rounded-lg bg-teal-500/5 border border-teal-500/10 dark:bg-teal-500/10 dark:border-teal-500/20 text-sm text-light-text dark:text-dark-text leading-relaxed",children:[s("div",{class:"text-[10px] font-bold text-teal-600 dark:text-teal-400 uppercase tracking-widest mb-1",children:n("dashboard.timeline-entry.annotation-label")}),t.annotation]}):null,h&&p?s("div",{class:"mt-1 flex justify-end",children:s("button",{class:"text-[10px] font-bold uppercase tracking-widest text-light-muted hover:text-light-text dark:text-dark-muted dark:hover:text-white/80 transition-colors flex items-center gap-1 px-2 py-1 rounded hover:bg-light-border/50 dark:hover:bg-white/10",type:"button",onClick:x=>{x.stopPropagation(),d(F=>!F)},children:[s("svg",{class:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})}),n("dashboard.timeline-entry.annotate")]})}):null,o&&h?s("form",{class:"mt-3 flex flex-col gap-3 p-4 rounded-xl bg-light-border/30 border border-light-border dark:bg-black/20 dark:border-dark-border",onClick:x=>x.stopPropagation(),onSubmit:x=>{x.preventDefault(),y()},children:[s("label",{class:"text-[10px] font-bold text-light-muted dark:text-dark-muted uppercase tracking-widest",htmlFor:`annotate-${t.id??t.ts}`,children:n("dashboard.timeline-entry.annotation-label")}),s("input",{id:`annotate-${t.id??t.ts}`,class:"px-3 py-2 rounded-lg text-sm bg-light-surface border border-light-border text-light-text dark:bg-dark-surface dark:border-dark-border dark:text-dark-text placeholder:text-light-muted dark:placeholder:text-dark-muted focus:outline-none focus:ring-2 focus:ring-brand-accent/50 transition-shadow w-full",value:u,onInput:x=>c(x.currentTarget.value),placeholder:n("dashboard.timeline-entry.annotation-placeholder")}),s("div",{class:"flex justify-end gap-2 mt-1",children:s(Bn,{variant:"annotate",size:"sm",onClick:y,children:n("dashboard.timeline-entry.annotation-save")})})]}):null]})}function rs(t,e){return new Intl.DateTimeFormat(e,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(t))}function da({node:t,level:e,selected:r=!1,onSelect:a,humanLockedNearby:i=!1,staleReason:n=null,defaultExpanded:o=!1,readOnly:d=!1,children:u=[]}){const{t:c}=J(),[h,p]=O(o),y=u.length>0,_=t.file,x=n===null?"ok":n==="orphan"?"orphan":"stale",F=()=>{d||(y&&p(z=>!z),a?.(_))},N=z=>{d||((z.key==="Enter"||z.key===" ")&&(z.preventDefault(),F()),z.key==="ArrowRight"&&y&&p(!0),z.key==="ArrowLeft"&&y&&p(!1))},E=()=>{switch(e){case 0:return"";case 1:return"ml-4";case 2:return"ml-8";case 3:return"ml-12";default:return""}},I=()=>r?"bg-brand-accent/10 border border-brand-accent/20 dark:bg-purple-500/10 dark:border-purple-500/20 dark:shadow-[inset_0_0_12px_rgba(168,85,247,0.05)]":d?"border border-transparent":"hover:bg-light-border/30 dark:hover:bg-white/5 border border-transparent",W=(()=>{switch(e){case 0:return{label:"L0",class:"text-light-muted dark:text-dark-muted bg-light-border/50 dark:bg-white/10"};case 1:return{label:"L1",class:"text-brand-accent dark:text-purple-400 bg-brand-accent/20 dark:bg-purple-500/20"};case 2:return{label:"L2",class:"text-brand-warning dark:text-amber-400 bg-brand-warning/10 dark:bg-amber-500/10"};case 3:return{label:"L3",class:"text-slate-500 dark:text-slate-400 bg-slate-500/10 dark:bg-slate-500/10"};default:return{label:"Lx",class:""}}})();return s("div",{class:"flex flex-col mb-0.5",children:[s("div",{class:`flex items-center justify-between px-3 py-2 rounded-lg cursor-pointer text-sm transition-all duration-200 ${E()} ${I()}`,role:"treeitem","aria-expanded":y?h:void 0,"aria-level":e+1,"aria-readonly":d||void 0,tabIndex:d?-1:0,onClick:d?void 0:F,onKeyDown:d?void 0:N,children:[s("div",{class:"flex items-center gap-2 overflow-hidden",children:[s("span",{class:`w-4 h-4 flex items-center justify-center text-light-muted dark:text-dark-muted transition-transform ${h?"rotate-90":""}`,"aria-hidden":"true",children:y?s("svg",{class:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})}):"•"}),s("span",{class:`text-[10px] font-bold px-1.5 py-0.5 rounded ${W.class}`,children:W.label}),s("span",{class:`font-mono truncate ${r?"font-bold text-brand-accent dark:text-purple-100":"text-light-muted dark:text-dark-muted"} ${e===0?"font-medium text-light-text dark:text-white/90":""}`,children:_}),i?s("span",{class:"text-[10px] bg-amber-500/20 text-amber-600 dark:text-amber-400 px-1.5 py-0.5 rounded font-bold uppercase tracking-wider",children:c("dashboard.tree-node.locked")}):null,n!==null?s("div",{class:"ml-2 flex items-center",children:s(de,{kind:"pill",severity:x,message:c(`dashboard.tree-node.stale.${n}`)})}):null]}),s("div",{class:"flex items-center gap-2 shrink-0 ml-4 hidden sm:flex",children:s("span",{class:"font-mono text-xs text-light-muted dark:text-dark-muted opacity-50",children:as(t.hash)})})]}),y&&h?s("div",{class:"flex flex-col mt-0.5 relative",role:"group",children:[s("div",{class:`absolute top-0 bottom-0 left-[22px] ${e===0?"":e===1?"ml-4":e===2?"ml-8":"ml-12"} w-px bg-light-border/50 dark:bg-dark-border/50 z-0`}),u.map(z=>s(da,{...z,onSelect:a,readOnly:d},`${z.node.file}:${z.level}`))]}):null]})}function as(t){return t.length>18?`${t.slice(0,12)}…`:t}const Me="packages/dashboard/src/views/rules-explain.tsx";function is(t,e,r){const a=r.trim().toLowerCase(),i=Object.values(t.nodes).filter(d=>a.length===0||JSON.stringify(d).toLowerCase().includes(a)).sort((d,u)=>d.file.localeCompare(u.file)),n=new Map;for(const d of i){const u=d.file.split("/")[0]??"root";n.set(u,[...n.get(u)??[],d])}return[{node:$t({file:`revision:${t.revision}`,scope_glob:"**/*",deps:[],priority:"high",hash:t.revision}),level:0,defaultExpanded:!0,children:Array.from(n.entries()).map(([d,u])=>({node:$t({file:d,scope_glob:`${d}/**/*`,deps:[],priority:"medium",hash:`${u.length} nodes`}),level:1,defaultExpanded:!0,children:u.map(c=>({node:c,level:2,humanLockedNearby:e.has(c.file),staleReason:c.hash.length===0?"hash-mismatch":null}))}))}]}function ns({lastEvent:t}){const{t:e}=J(),[r,a]=O(null),[i,n]=O(null),[o,d]=O(Me),[u,c]=O(Me),[h,p]=O(null),[y,_]=O(""),[x,F]=O(null),N=async X=>{try{const[V,L]=await Promise.all([Na(),ja(X)]);a(V),n(L),c(X),F(null)}catch(V){F(V instanceof Error?V.message:String(V))}};Q(()=>{N(Me)},[]),Q(()=>{(t?.type==="meta:updated"||t?.type==="drift:detected"||t?.type==="lock:drift")&&N(u)},[u,t]);const E=oe(()=>new Set,[]),I=oe(()=>r===null?[]:is(r,E,y),[r,E,y]),H=h===null?null:r?.nodes[h]??null,W=oe(()=>r===null?[]:Object.values(r.nodes),[r]),z=(i?.L1.length??0)+(i?.L2.length??0)+(i?.description_stubs?.length??0);return s("div",{class:"flex-1 flex flex-col gap-4 min-h-0 relative",children:[x!==null?s("div",{class:"z-50 px-4 pt-2 shrink-0",children:s(de,{kind:"banner",severity:"stale",message:x})}):null,s("div",{class:"flex-1 flex flex-col md:flex-row gap-4 min-h-0",children:[s("div",{class:"w-full md:w-1/3 xl:w-1/4 flex flex-col overflow-hidden bg-light-surface border-r border-light-border sm:border sm:rounded-2xl sm:shadow-sm dark:bg-dark-surface dark:border-white/5 dark:backdrop-blur-3xl dark:shadow-xl",children:[s("div",{class:"p-4 border-b border-light-border dark:border-dark-border flex justify-between items-center bg-light-surface/90 dark:bg-transparent z-10 shrink-0",children:[s("span",{class:"text-xs font-bold uppercase tracking-wider text-light-muted dark:text-dark-muted",children:"Registry Tree"}),s("span",{class:"text-[10px] font-mono bg-light-border/50 dark:bg-white/10 px-2 py-0.5 rounded-full border border-light-border dark:border-dark-border",children:r===null?"...":`${Object.keys(r.nodes).length} Nodes`})]}),s("div",{class:"p-3 border-b border-light-border dark:border-dark-border shrink-0 flex gap-2",children:[s("input",{class:"flex-1 px-3 py-1.5 rounded-lg text-sm bg-light-border/30 border border-light-border text-light-text dark:bg-black/20 dark:border-dark-border dark:text-dark-text placeholder:text-light-muted dark:placeholder:text-dark-muted focus:outline-none focus:ring-2 focus:ring-brand-accent/50 transition-shadow",value:y,onInput:X=>_(X.currentTarget.value),placeholder:e("dashboard.rules-tree.filter.placeholder"),"aria-label":e("dashboard.rules-tree.filter.aria-label")}),s("button",{class:"px-3 py-1.5 rounded-lg text-sm font-medium bg-light-border/50 hover:bg-light-border text-light-text dark:bg-white/10 dark:hover:bg-white/20 dark:text-dark-text transition-colors",type:"button",onClick:()=>{N(u)},children:"↻"})]}),s("div",{class:"p-3 overflow-y-auto space-y-0.5 flex-1",role:"tree","aria-label":e("dashboard.rules-tree.tree.aria-label"),children:I.length>0?I.map(X=>s(da,{...X,selected:X.node.file===h,onSelect:V=>{p(V),V&&(d(V),N(V))}},X.node.file)):s("div",{class:"p-4 text-center text-sm text-light-muted dark:text-dark-muted",children:e(r===null?"dashboard.rules-tree.status.loading":"dashboard.rules-tree.empty")})})]}),s("div",{class:"flex-1 flex flex-col overflow-hidden bg-light-surface border border-light-border sm:rounded-2xl sm:shadow-sm dark:bg-dark-surface dark:border-white/5 dark:backdrop-blur-3xl dark:shadow-xl",children:s("div",{class:"p-6 md:p-8 overflow-y-auto flex-1",children:[s("div",{class:"flex items-center gap-2 mb-6",children:[s("input",{class:"flex-1 px-3 py-2 rounded-lg text-sm bg-light-border/30 border border-light-border text-light-text dark:bg-black/20 dark:border-dark-border dark:text-dark-text focus:outline-none focus:ring-2 focus:ring-brand-accent/50 transition-shadow font-mono",value:o,onInput:X=>d(X.currentTarget.value),placeholder:e("dashboard.rule-topology.path.placeholder"),"aria-label":e("dashboard.rule-topology.path.aria-label")}),s("button",{class:"px-4 py-2 rounded-lg text-sm font-medium bg-brand-accent/10 text-brand-accent hover:bg-brand-accent/20 border border-brand-accent/20 dark:bg-brand-accent/20 dark:text-brand-accent dark:border-brand-accent/30 dark:hover:bg-brand-accent/30 transition-colors whitespace-nowrap",type:"button",onClick:()=>{N(o.trim().length>0?o.trim():Me)},children:e("dashboard.rules-explain.analyze")})]}),s("div",{class:"flex justify-between items-center mb-8 px-4 py-3 rounded-xl border bg-light-bg/50 border-light-border dark:bg-black/20 dark:border-dark-border text-sm font-mono",children:[s("span",{class:"text-light-muted dark:text-dark-muted",children:e("dashboard.rule-topology.status.sample",{path:u})}),s("span",{class:"font-bold text-light-text dark:text-dark-text",children:e("dashboard.rule-topology.status.hits",{count:String(z)})})]}),H!==null?s("div",{class:"mb-8",children:[s("div",{class:"inline-block px-2.5 py-1 text-xs font-bold rounded-lg font-mono mb-3 border bg-brand-accent/10 text-brand-accent border-brand-accent/20 dark:bg-purple-500/20 dark:text-purple-300 dark:border-purple-500/30 uppercase",children:[H.priority," Priority"]}),s("div",{class:"flex justify-between items-start mb-6",children:[s("div",{children:s("h2",{class:"text-2xl font-bold font-mono tracking-tight text-light-text dark:text-white/90 break-all",children:H.file})}),s("div",{class:"text-right hidden sm:block shrink-0 ml-4",children:[s("div",{class:"text-[10px] font-bold text-light-muted dark:text-dark-muted uppercase tracking-widest mb-1",children:"Hash Revision"}),s("div",{class:"font-mono text-xs px-2.5 py-1 rounded-md border bg-light-border/30 border-light-border text-light-text dark:bg-black/30 dark:border-dark-border dark:text-dark-text shadow-inner",children:[H.hash.substring(0,12),"..."]})]})]}),s("div",{class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-8",children:[s("div",{class:"p-4 rounded-xl border bg-light-bg/50 border-light-border dark:bg-black/20 dark:border-dark-border",children:[s("div",{class:"text-[10px] font-bold text-light-muted dark:text-dark-muted uppercase tracking-widest mb-2",children:e("dashboard.rules-tree.detail.scope")}),s("div",{class:"font-mono text-sm font-medium text-light-text dark:text-dark-text break-all",children:H.scope_glob})]}),H.topology_type&&s("div",{class:"p-4 rounded-xl border bg-light-bg/50 border-light-border dark:bg-black/20 dark:border-dark-border",children:[s("div",{class:"text-[10px] font-bold text-light-muted dark:text-dark-muted uppercase tracking-widest mb-2",children:e("dashboard.rules-explain.detail.topology-type")}),s("div",{class:"font-mono text-sm font-medium text-light-text dark:text-dark-text",children:H.topology_type})]})]})]}):null,s("div",{class:"grid grid-cols-1 xl:grid-cols-2 gap-6",children:[s("div",{children:[s("h3",{class:"text-sm font-bold uppercase tracking-wider text-light-muted dark:text-dark-muted mb-4",children:"Hit Reasons"}),s(Kn,{meta:r,rulesContext:i})]}),s("div",{children:[s("h3",{class:"text-sm font-bold uppercase tracking-wider text-light-muted dark:text-dark-muted mb-4",children:"Coverage Heatmap"}),s(Vn,{nodes:W})]})]})]})})]})]})}const ss=(t,e,r)=>[];function os({lastEvent:t}){const{t:e,locale:r}=J(),[a,i]=O([]),[n,o]=O("all"),[d,u]=O(null),[c,h]=O(null),[p,y]=O(!1),[_,x]=O(null),F=async()=>{try{i(await La()),x(null)}catch(L){x(L instanceof Error?L.message:String(L))}};Q(()=>{F()},[]),Q(()=>{(t?.type==="ledger:appended"||t?.type==="drift:detected"||t?.type==="lock:drift")&&F()},[t]),Q(()=>{if(d===null){h(null);return}let L=!1;return y(!0),Fa({ledgerId:d}).then(B=>{L||(h(B),x(null))}).catch(B=>{L||(h(null),x(B instanceof Error?B.message:String(B)))}).finally(()=>{L||y(!1)}),()=>{L=!0}},[d]);const N=oe(()=>a.filter(L=>n==="all"||L.source===n),[a,n]),E=a.filter(L=>L.source==="ai").length,I=a.length-E,H=async(L,B)=>{if(L.id===void 0)throw new Error(e("dashboard.intent-timeline.annotate.missing-id"));const ae=await Oa({ledger_entry_id:L.id,annotation:B});ae.created&&i(ua=>[ae.entry,...ua].sort((ha,pa)=>pa.ts-ha.ts))},W=oe(()=>a.findIndex(L=>L.id===d),[a,d]),z=W>=0?a[W]??null:null,X=z===null?e("dashboard.history-replay.selected.none"):new Date(z.ts).toLocaleString(r),V=oe(()=>c===null?[]:ss(c.meta),[c]);return s("div",{class:"flex-1 flex flex-col gap-4 min-h-0 relative",children:[s("div",{class:"flex flex-col gap-4 shrink-0",children:[_!==null?s("div",{class:"z-50 px-4 pt-2",children:s(de,{kind:"banner",severity:"stale",message:_})}):null,s("div",{class:"flex items-center gap-3 bg-light-surface border-b border-light-border dark:bg-dark-surface dark:border-white/5 dark:backdrop-blur-3xl sm:rounded-2xl sm:shadow-sm sm:border sm:mx-4 p-4 shrink-0 overflow-x-auto",children:[s("span",{class:"text-xs font-bold uppercase tracking-wider text-light-muted dark:text-dark-muted shrink-0 mr-2",children:e("dashboard.intent-timeline.filter.label")}),s("button",{class:`px-3 py-1.5 rounded-full text-xs font-bold font-mono transition-colors shrink-0 ${n==="all"?"bg-light-text text-light-bg dark:bg-white dark:text-black":"bg-light-border/30 hover:bg-light-border/50 text-light-muted dark:bg-white/5 dark:hover:bg-white/10 dark:text-dark-muted"}`,type:"button",onClick:()=>o("all"),children:[e("dashboard.intent-timeline.filter.all")," ",s("span",{class:"opacity-60 ml-1",children:a.length})]}),s("div",{class:"shrink-0",onClick:()=>o("ai"),children:s(Pt,{source:"ai",interactive:!0,selected:n==="ai"})}),s("div",{class:"shrink-0",onClick:()=>o("human"),children:s(Pt,{source:"human",interactive:!0,selected:n==="human"})}),s("span",{class:"font-mono text-xs text-light-muted dark:text-dark-muted ml-auto shrink-0 whitespace-nowrap hidden sm:inline",children:e("dashboard.intent-timeline.summary",{aiCount:String(E),humanCount:String(I)})})]})]}),s("div",{class:"flex-1 flex flex-col md:flex-row gap-4 min-h-0 sm:px-4",children:[s("div",{class:"flex-1 overflow-y-auto pr-2 pb-8 relative",children:[s("div",{class:"absolute left-6 md:left-1/2 top-0 bottom-0 w-0.5 bg-gradient-to-b from-light-border via-light-border/50 to-transparent dark:from-dark-border dark:via-dark-border/50 -translate-x-1/2 z-0 hidden md:block"}),s("div",{class:"absolute left-[39px] top-0 bottom-0 w-0.5 bg-gradient-to-b from-light-border via-light-border/50 to-transparent dark:from-dark-border dark:via-dark-border/50 z-0 block md:hidden"}),s("div",{class:"flex flex-col gap-6 pt-4 relative z-10",children:N.length>0?N.map(L=>s("div",{class:"flex items-start gap-4",onClick:()=>u(L.id??null),children:s("div",{class:"w-full",children:s(ts,{entry:L,onAnnotate:H})})},L.id)):s("div",{class:"p-8 text-center text-sm text-light-muted dark:text-dark-muted bg-light-surface border border-light-border dark:bg-dark-surface dark:border-white/5 dark:backdrop-blur-3xl sm:rounded-2xl max-w-xl mx-auto w-full",children:e("dashboard.intent-timeline.empty")})})]}),d!==null&&s("aside",{class:"w-full md:w-1/3 xl:w-1/4 flex flex-col overflow-hidden bg-light-surface border border-light-border sm:rounded-2xl sm:shadow-sm dark:bg-dark-surface dark:border-white/5 dark:backdrop-blur-3xl dark:shadow-xl shrink-0 h-full",children:[s("div",{class:"p-4 border-b border-light-border dark:border-dark-border flex flex-col gap-3 bg-light-surface/90 dark:bg-transparent z-10 shrink-0",children:[s("div",{class:"flex justify-between items-start w-full",children:[s("div",{children:s("h3",{class:"text-sm font-bold uppercase tracking-wider text-light-text dark:text-dark-text m-0 flex items-center gap-2",children:[s("svg",{class:"w-4 h-4 text-brand-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),e("dashboard.timeline.history-replay.title")]})}),s("button",{class:"w-6 h-6 rounded-full bg-light-border/50 hover:bg-light-border text-light-muted dark:bg-white/10 dark:hover:bg-white/20 dark:text-dark-muted flex items-center justify-center transition-colors",onClick:()=>u(null),children:s("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})})})]}),s("div",{class:"flex flex-col gap-1 text-[10px] font-mono text-light-muted dark:text-dark-muted",children:[s("span",{class:"truncate",children:[s("span",{class:"opacity-50 mr-1",children:"ID:"})," ",d.substring(0,16),"..."]}),s("span",{class:"truncate",children:[s("span",{class:"opacity-50 mr-1",children:"Time:"})," ",X]})]})]}),s("div",{class:"flex-1 overflow-y-auto p-4 flex flex-col gap-4",children:[p&&s("div",{class:"py-12 text-center text-xs text-light-muted dark:text-dark-muted animate-pulse",children:e("dashboard.history-replay.loading")}),!p&&V.length>0?s("div",{class:"text-xs text-light-muted dark:text-dark-muted text-center py-8",children:"Coming soon..."}):!p&&s("div",{class:"text-xs text-light-muted dark:text-dark-muted text-center py-8",children:e("dashboard.history-replay.no-data")})]})]})]})]})}function ds({lastEvent:t,connected:e=!1}){const{t:r}=J(),[a,i]=O(null),[n,o]=O(!0),[d,u]=O(null),c=async()=>{o(!0);try{i(await Pa()),u(null)}catch(h){u(h instanceof Error?h.message:String(h))}finally{o(!1)}};return Q(()=>{c()},[]),Q(()=>{(t?.type==="meta:updated"||t?.type==="ledger:appended"||t?.type==="drift:detected")&&c()},[t]),s("div",{class:"flex-1 flex flex-col gap-6 max-w-5xl mx-auto w-full p-4 md:p-6 lg:p-8",children:[d!==null?s("div",{class:"mb-4",children:s(de,{kind:"banner",severity:"stale",message:d})}):null,s("div",{class:"flex items-center justify-between bg-light-surface border border-light-border dark:bg-dark-surface dark:border-white/5 dark:backdrop-blur-3xl sm:rounded-2xl sm:shadow-sm p-4 flex-wrap gap-4",children:[s("div",{class:"flex items-center gap-3",children:[s("span",{class:"text-xs font-bold uppercase tracking-wider text-light-muted dark:text-dark-muted",children:r("dashboard.doctor.toolbar.overall")}),s(de,{kind:"pill",severity:la(a?.status??"warn"),message:r(a===null?"dashboard.shared.loading":`dashboard.shared.status.${a.status}`)})]}),s("div",{class:"flex items-center gap-4 ml-auto",children:[s("span",{class:"font-mono text-sm text-light-muted dark:text-dark-muted hidden md:inline",children:a===null?r("dashboard.doctor.toolbar.no-summary"):a.summary.entryPoints.length===1?r("dashboard.doctor.toolbar.entry-point-summary",{framework:_t(a.summary.framework,r),count:"1"}):r("dashboard.doctor.toolbar.entry-points-summary",{framework:_t(a.summary.framework,r),count:String(a.summary.entryPoints.length)})}),s("span",{class:`flex items-center gap-1.5 text-[10px] font-bold px-2 py-1 rounded-full uppercase ${e?"bg-green-500/10 text-green-600 dark:bg-green-500/20 dark:text-green-400":"bg-red-500/10 text-red-600 dark:bg-red-500/20 dark:text-red-400"}`,children:[s("span",{class:`w-1.5 h-1.5 rounded-full ${e?"bg-green-500 shadow-[0_0_8px_#22c55e] animate-pulse":"bg-red-500 shadow-[0_0_8px_#ef4444]"}`}),r(e?"dashboard.health.runtime.connected":"dashboard.health.runtime.disconnected")]}),s("button",{class:"px-3 py-1.5 rounded-lg text-sm font-medium bg-light-border/50 hover:bg-light-border text-light-text dark:bg-white/10 dark:hover:bg-white/20 dark:text-dark-text transition-colors",type:"button",onClick:()=>{c()},children:r("dashboard.shared.refresh")})]})]}),n&&a===null?s("div",{class:"p-8 text-center text-sm text-light-muted dark:text-dark-muted bg-light-surface border border-light-border dark:bg-dark-surface dark:border-dark-border sm:rounded-2xl",children:r("dashboard.doctor.empty.loading")}):null,a!==null?s("div",{class:"flex flex-col gap-6",children:[s("div",{class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[s(ze,{label:r("dashboard.doctor.summary.framework"),value:_t(a.summary.framework,r),detail:a.summary.metaRevision===null?r("dashboard.doctor.summary.no-meta-revision"):`rev ${a.summary.metaRevision}`}),s(ze,{label:"Rule index",value:`${a.summary.ruleCount} rules`,detail:a.summary.computedMetaRevision===null?r("dashboard.doctor.summary.no-meta-revision"):`computed ${a.summary.computedMetaRevision}`}),s(ze,{label:"Issues",value:`${a.summary.fixableErrorCount}/${a.summary.manualErrorCount}/${a.summary.warningCount}`,detail:"fixable / manual / warnings"}),s(ze,{label:r("dashboard.health.ledger-path.label"),value:a.summary.eventLedgerPath,detail:r("dashboard.health.ledger-path.detail")})]}),s("div",{class:"p-5 sm:p-6 rounded-2xl border bg-brand-warning/5 border-brand-warning/30 dark:bg-amber-500/5 dark:border-amber-500/20 relative overflow-hidden shadow-sm",children:[s("div",{class:"absolute top-0 left-0 w-1 h-full bg-brand-warning dark:bg-amber-500 shadow-[0_0_10px_#f59e0b]"}),s("h3",{class:"text-sm font-bold mb-2 flex items-center gap-2 text-brand-warning dark:text-amber-400",children:[s("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),r("dashboard.health.boundary.title")]}),s("p",{class:"text-sm mb-4 text-light-text dark:text-dark-muted",children:r("dashboard.health.boundary.description")}),a.summary.fixableErrorCount>0&&s("div",{class:"mt-4",children:[s("strong",{class:"text-sm text-brand-warning dark:text-amber-400 block mb-2",children:r("dashboard.health.boundary.cli-action")}),s("p",{class:"text-xs text-light-muted dark:text-dark-muted mb-2",children:r("dashboard.health.boundary.cli-prompt",{count:String(a.summary.fixableErrorCount)})}),s("div",{class:"rounded-lg p-3 font-mono text-xs flex justify-between items-center border shadow-inner bg-zinc-900 border-zinc-800 text-zinc-300 dark:bg-black/50 dark:border-white/5 dark:text-white/80",children:[s("span",{children:[s("span",{class:"text-zinc-500 dark:text-white/30 mr-2",children:"$"}),"fabric doctor --fix"]}),s("button",{class:"text-zinc-400 hover:text-white dark:text-white/40 dark:hover:text-white transition-colors flex items-center gap-1.5 bg-white/5 px-2 py-1 rounded",onClick:()=>navigator.clipboard.writeText("fabric doctor --fix"),children:[s("svg",{class:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),"Copy"]})]})]})]}),s("div",{class:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s("article",{class:"flex flex-col bg-light-surface border border-light-border dark:bg-dark-surface dark:border-white/5 sm:rounded-2xl sm:shadow-sm dark:shadow-xl dark:backdrop-blur-3xl overflow-hidden",children:[s("div",{class:"p-5 border-b border-light-border dark:border-dark-border bg-light-surface/90 dark:bg-transparent flex justify-between items-center",children:[s("h3",{class:"text-sm font-bold uppercase tracking-wider text-light-text dark:text-dark-text m-0",children:r("dashboard.doctor.card.entry-points")}),s("span",{class:"text-[10px] font-mono bg-light-border/50 dark:bg-white/10 px-2 py-0.5 rounded-full border border-light-border dark:border-dark-border",children:a.summary.entryPoints.length})]}),a.summary.entryPoints.length>0?s("div",{class:"flex flex-col",children:a.summary.entryPoints.map(h=>s("div",{class:"p-5 flex flex-col gap-1 border-b border-light-border dark:border-dark-border last:border-0 hover:bg-light-border/10 dark:hover:bg-white/5 transition-colors",children:[s("strong",{class:"font-mono text-sm text-light-text dark:text-dark-text break-all",children:h.path}),s("span",{class:"text-xs text-light-muted dark:text-dark-muted",children:h.reason})]},`${h.path}:${h.reason}`))}):s("div",{class:"p-8 text-center text-sm text-light-muted dark:text-dark-muted",children:r("dashboard.doctor.empty.entry-points")})]}),s("article",{class:"flex flex-col bg-light-surface border border-light-border dark:bg-dark-surface dark:border-white/5 sm:rounded-2xl sm:shadow-sm dark:shadow-xl dark:backdrop-blur-3xl overflow-hidden",children:[s("div",{class:"p-5 border-b border-light-border dark:border-dark-border bg-light-surface/90 dark:bg-transparent flex justify-between items-center",children:[s("h3",{class:"text-sm font-bold uppercase tracking-wider text-light-text dark:text-dark-text m-0",children:r("dashboard.doctor.card.checks")}),s("span",{class:"text-[10px] font-mono bg-light-border/50 dark:bg-white/10 px-2 py-0.5 rounded-full border border-light-border dark:border-dark-border",children:a.checks.length})]}),s("div",{class:"flex flex-col",children:a.checks.map(h=>s(ls,{check:h},h.name))})]})]})]}):null]})}function ze({label:t,value:e,detail:r}){return s("article",{class:"p-4 sm:p-5 flex flex-col gap-2 bg-light-surface border border-light-border dark:bg-dark-surface dark:border-white/5 sm:rounded-2xl sm:shadow-sm dark:shadow-xl dark:backdrop-blur-3xl",children:[s("span",{class:"text-[10px] font-bold text-light-muted dark:text-dark-muted uppercase tracking-widest",children:t}),s("strong",{class:"text-xl sm:text-2xl font-bold text-light-text dark:text-dark-text truncate",title:e,children:e}),s("span",{class:"font-mono text-xs text-light-muted dark:text-dark-muted truncate",title:r,children:r})]})}function ls({check:t}){const{t:e}=J(),r=la(t.status);return s("div",{class:`p-5 flex flex-col gap-2 border-b border-light-border dark:border-dark-border last:border-0 ${{ok:"bg-green-500/5 dark:bg-green-500/10",locked:"bg-amber-500/5 dark:bg-amber-500/10",stale:"bg-red-500/5 dark:bg-red-500/10"}[r]}`,children:[s("div",{class:"flex items-center justify-between",children:[s("strong",{class:"font-mono text-sm text-light-text dark:text-dark-text",children:t.name}),s(de,{kind:"pill",severity:r,message:e(`dashboard.shared.status.${t.status}`)})]}),s("p",{class:"text-sm text-light-muted dark:text-dark-muted m-0",children:t.message})]})}function la(t){switch(t){case"ok":return"ok";case"warn":return"locked";case"error":return"stale"}}function _t(t,e){const r=[t.kind,t.version,t.subkind].filter(a=>a!=="unknown");return r.length>0?r.join(" · "):e("dashboard.doctor.framework.unknown")}function cs(){return s(ri,{children:s(us,{})})}function us(){const{t}=J(),[e,r]=O(Ar()),[a,i]=O(()=>{const c=localStorage.getItem("fabric-theme");return c==="light"||c==="dark"?c:document.documentElement.classList.contains("dark")?"dark":"light"}),n=Xa();Q(()=>{a==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),localStorage.setItem("fabric-theme",a)},[a]);const o=()=>{i(c=>c==="dark"?"light":"dark")},d=[{id:"readiness",hash:"#/readiness",label:t("dashboard.app.nav.readiness.label"),subtitle:t("dashboard.app.nav.readiness.subtitle"),icon:s("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})},{id:"rules-explain",hash:"#/rules-explain",label:t("dashboard.app.nav.rules-explain.label"),subtitle:t("dashboard.app.nav.rules-explain.subtitle"),icon:s("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})})},{id:"timeline",hash:"#/timeline",label:t("dashboard.app.nav.timeline.label"),subtitle:t("dashboard.app.nav.timeline.subtitle"),icon:s("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})},{id:"health",hash:"#/health",label:t("dashboard.app.nav.health.label"),subtitle:t("dashboard.app.nav.health.subtitle"),icon:s("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"})})}];Q(()=>{const c=()=>r(Ar());return window.addEventListener("hashchange",c),(window.location.hash===""||window.location.hash==="#/topology"||window.location.hash==="#/rules")&&(window.location.hash="#/rules-explain"),()=>window.removeEventListener("hashchange",c)},[]);const u=oe(()=>d.find(c=>c.id===e)??d[1],[d,e]);return s("div",{class:"h-screen w-screen flex overflow-hidden antialiased bg-light-bg text-light-text dark:bg-dark-bg dark:text-dark-text selection:bg-brand-accent/30 relative p-0 sm:p-4 gap-4",children:[s("div",{class:"ambient-blob bg-purple-600 w-[500px] h-[500px] top-[-20%] left-[-10%] transition-opacity duration-500 opacity-0 dark:opacity-30"}),s("div",{class:"ambient-blob bg-brand-accent w-[500px] h-[500px] bottom-[-20%] right-[10%] transition-opacity duration-500 opacity-0 dark:opacity-30"}),s("aside",{class:"w-64 hidden md:flex flex-col overflow-hidden bg-light-surface border-r border-light-border sm:border sm:rounded-2xl sm:shadow-sm dark:bg-dark-surface dark:border-white/5 dark:backdrop-blur-3xl dark:shadow-[0_8px_32px_rgba(0,0,0,0.4)] z-20",children:[s("div",{class:"p-6",children:s("div",{class:"flex items-center justify-between",children:s("div",{class:"flex items-center gap-3",children:[s("div",{class:"w-8 h-8 rounded-xl bg-gradient-to-br from-brand-accent to-purple-600 flex items-center justify-center font-bold text-white shadow-md dark:shadow-[0_0_12px_rgba(59,130,246,0.3)]",children:"F"}),s("span",{class:"font-semibold text-light-text dark:text-dark-text",children:["Fabric ",s("span",{class:"text-light-muted dark:text-dark-muted font-normal",children:["v","1.8.0-rc.3"]})]})]})})}),s("nav",{class:"flex-1 px-4 space-y-1.5 mt-2",children:[s("div",{class:"text-[10px] font-bold text-light-muted dark:text-dark-muted uppercase tracking-widest mb-3 px-3",children:t("dashboard.app.nav.section.insights")}),d.map(c=>{const h=c.id===e;return s("a",{href:c.hash,"aria-current":h?"page":void 0,class:`flex items-center gap-3 px-3 py-2.5 rounded-xl font-medium transition-all duration-200 ${h?"bg-brand-accent/10 text-brand-accent border border-brand-accent/20 dark:bg-white/15 dark:text-white dark:border-white/20 dark:shadow-[0_0_12px_rgba(255,255,255,0.05)]":"text-light-muted hover:bg-light-border/50 hover:text-light-text dark:text-dark-muted dark:hover:bg-white/5 dark:hover:text-dark-text"}`,children:[c.icon,c.label]},c.id)})]}),s("div",{class:"p-4 border-t border-light-border dark:border-dark-border mx-4 mb-4 mt-auto rounded-xl bg-light-border/30 dark:bg-black/20",children:s("div",{class:"flex items-center justify-between",children:s("div",{class:"flex items-center gap-2",children:[s("div",{class:`w-2 h-2 rounded-full ${n.connected?"bg-green-500 shadow-[0_0_8px_#22c55e] animate-pulse":"bg-red-500 shadow-[0_0_8px_#ef4444]"}`}),s("span",{class:"text-[10px] font-bold text-light-muted dark:text-dark-muted font-mono uppercase",children:n.connected?t("dashboard.app.header.connected"):t("dashboard.app.header.connecting")})]})})})]}),s("main",{class:"flex-1 flex flex-col gap-4 min-w-0 z-10",children:[s("header",{class:"h-16 flex items-center justify-between px-6 shrink-0 bg-light-surface border-b border-light-border sm:border sm:rounded-2xl sm:shadow-sm dark:bg-dark-surface dark:border-white/5 dark:backdrop-blur-3xl dark:shadow-xl",children:[s("div",{children:[s("h1",{class:"text-lg font-semibold",children:u.label}),s("p",{class:"text-xs text-light-muted dark:text-dark-muted font-mono mt-0.5",children:u.subtitle})]}),s("div",{class:"flex items-center gap-4",children:s("button",{onClick:o,class:"p-2 rounded-lg bg-light-border/50 hover:bg-light-border text-light-text dark:bg-white/10 dark:hover:bg-white/20 dark:text-dark-text transition-all duration-200 shadow-sm cursor-pointer",title:"Toggle Theme",children:a==="dark"?s("svg",{class:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):s("svg",{class:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})})})]}),s("div",{class:"flex-1 flex flex-col min-h-0 overflow-y-auto",children:[e==="readiness"?s(ii,{}):null,e==="rules-explain"?s(ns,{lastEvent:n.lastEvent}):null,e==="timeline"?s(os,{lastEvent:n.lastEvent}):null,e==="health"?s(ds,{lastEvent:n.lastEvent,connected:n.connected}):null]})]}),s("div",{class:"sr-only","aria-live":"polite","aria-atomic":"true",children:n.lastEvent===null?"":t("dashboard.app.live-region.received",{type:n.lastEvent.type})})]})}function Ar(){switch(window.location.hash){case"#/readiness":return"readiness";case"#/rules-explain":return"rules-explain";case"#/timeline":return"timeline";case"#/health":return"health";default:return"rules-explain"}}const ca=document.getElementById("app");if(ca===null)throw new Error("Fabric Dashboard root element #app was not found.");ka(s(cs,{}),ca);