@makuja/peek 1.12.2 → 1.12.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +1 -1
  2. package/package.json +5 -7
package/dist/index.mjs CHANGED
@@ -1295,7 +1295,7 @@ function createProjectId(absolutePath) {
1295
1295
  return createHash("sha256").update(normalized).digest("hex").slice(0, 16);
1296
1296
  }
1297
1297
  // src/server/renderer/client-bundle.js
1298
- const clientBundle = "\"use strict\";(()=>{var ne,y,ot,mn,D,et,it,at,he,Q,W,st,ve,ye,ge,hn,G={},ee=[],yn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,re=Array.isArray;function L(e,t){for(var n in t)e[n]=t[n];return e}function be(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function gn(e,t,n){var r,a,i,s={};for(i in t)i==\"key\"?r=t[i]:i==\"ref\"?a=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?ne.call(arguments,2):n),typeof e==\"function\"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return Z(e,s,r,a,null)}function Z(e,t,n,r,a){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++ot,__i:-1,__u:0};return a==null&&y.vnode!=null&&y.vnode(i),i}function w(e){return e.children}function J(e,t){this.props=e,this.context=t}function B(e,t){if(t==null)return e.__?B(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==\"function\"?B(e):null}function vn(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],a=[],i=L({},t);i.__v=t.__v+1,y.vnode&&y.vnode(i),Se(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??B(t),!!(32&t.__u),a),i.__v=t.__v,i.__.__k[i.__i]=i,pt(r,i,a),t.__e=t.__=null,i.__e!=n&&lt(i)}}function lt(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),lt(e)}function tt(e){(!e.__d&&(e.__d=!0)&&D.push(e)&&!te.__r++||et!=y.debounceRendering)&&((et=y.debounceRendering)||it)(te)}function te(){try{for(var e,t=1;D.length;)D.length>t&&D.sort(at),e=D.shift(),t=D.length,vn(e)}finally{D.length=te.__r=0}}function ct(e,t,n,r,a,i,s,c,u,d,p){var f,l,_,m,P,g,S=r&&r.__k||ee,h=t.length;for(u=bn(n,t,S,u,h),f=0;f<h;f++)(_=n.__k[f])!=null&&(l=_.__i!=-1&&S[_.__i]||G,_.__i=f,g=Se(e,_,l,a,i,s,c,u,d,p),m=_.__e,_.ref&&l.ref!=_.ref&&(l.ref&&xe(l.ref,null,_),p.push(_.ref,_.__c||m,_)),P==null&&m!=null&&(P=m),4&_.__u?(u=dt(_,u,e),l.__e&&(l.__e=null)):typeof _.type==\"function\"&&g!==void 0?u=g:m&&(u=m.nextSibling),_.__u&=-7);return n.__e=P,u}function bn(e,t,n,r,a){var i,s,c,u,d,p=n.length,f=p,l=0;for(e.__k=new Array(a),i=0;i<a;i++)(s=t[i])!=null&&typeof s!=\"boolean\"&&typeof s!=\"function\"?(typeof s==\"string\"||typeof s==\"number\"||typeof s==\"bigint\"||s.constructor==String?s=e.__k[i]=Z(null,s,null,null,null):re(s)?s=e.__k[i]=Z(w,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[i]=Z(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[i]=s,u=i+l,s.__=e,s.__b=e.__b+1,c=null,(d=s.__i=Sn(s,n,u,f))!=-1&&(f--,(c=n[d])&&(c.__u|=2)),c==null||c.__v==null?(d==-1&&(a>p?l--:a<p&&l++),typeof s.type!=\"function\"&&(s.__u|=4)):d!=u&&(d==u-1?l--:d==u+1?l++:(d>u?l--:l++,s.__u|=4))):e.__k[i]=null;if(f)for(i=0;i<p;i++)(c=n[i])!=null&&(2&c.__u)==0&&(c.__e==r&&(r=B(c)),_t(c,c));return r}function dt(e,t,n){var r,a;if(typeof e.type==\"function\"){for(r=e.__k,a=0;r&&a<r.length;a++)r[a]&&(r[a].__=e,t=dt(r[a],t,n));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=B(e)),t=n.insertBefore(e.__e,t||null));do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Sn(e,t,n,r){var a,i,s,c=e.key,u=e.type,d=t[n],p=d!=null&&(2&d.__u)==0;if(d===null&&c==null||p&&c==d.key&&u==d.type)return n;if(r>(p?1:0)){for(a=n-1,i=n+1;a>=0||i<t.length;)if((d=t[s=a>=0?a--:i++])!=null&&(2&d.__u)==0&&c==d.key&&u==d.type)return s}return-1}function nt(e,t,n){t[0]==\"-\"?e.setProperty(t,n??\"\"):e[t]=n==null?\"\":typeof n!=\"number\"||yn.test(t)?n:n+\"px\"}function Y(e,t,n,r,a){var i,s;e:if(t==\"style\")if(typeof n==\"string\")e.style.cssText=n;else{if(typeof r==\"string\"&&(e.style.cssText=r=\"\"),r)for(t in r)n&&t in n||nt(e.style,t,\"\");if(n)for(t in n)r&&n[t]==r[t]||nt(e.style,t,n[t])}else if(t[0]==\"o\"&&t[1]==\"n\")i=t!=(t=t.replace(st,\"$1\")),s=t.toLowerCase(),t=s in e||t==\"onFocusOut\"||t==\"onFocusIn\"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n[W]=r[W]:(n[W]=ve,e.addEventListener(t,i?ge:ye,i)):e.removeEventListener(t,i?ge:ye,i);else{if(a==\"http://www.w3.org/2000/svg\")t=t.replace(/xlink(H|:h)/,\"h\").replace(/sName$/,\"s\");else if(t!=\"width\"&&t!=\"height\"&&t!=\"href\"&&t!=\"list\"&&t!=\"form\"&&t!=\"tabIndex\"&&t!=\"download\"&&t!=\"rowSpan\"&&t!=\"colSpan\"&&t!=\"role\"&&t!=\"popover\"&&t in e)try{e[t]=n??\"\";break e}catch{}typeof n==\"function\"||(n==null||n===!1&&t[4]!=\"-\"?e.removeAttribute(t):e.setAttribute(t,t==\"popover\"&&n==1?\"\":n))}}function rt(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[Q]==null)t[Q]=ve++;else if(t[Q]<n[W])return;return n(y.event?y.event(t):t)}}}function Se(e,t,n,r,a,i,s,c,u,d){var p,f,l,_,m,P,g,S,h,C,A,I,N,j,U,H,T=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),i=[c=t.__e=n.__e]),(p=y.__b)&&p(t);e:if(typeof T==\"function\"){f=s.length;try{if(h=t.props,C=T.prototype&&T.prototype.render,A=(p=T.contextType)&&r[p.__c],I=p?A?A.props.value:p.__:r,n.__c?S=(l=t.__c=n.__c).__=l.__E:(C?t.__c=l=new T(h,I):(t.__c=l=new J(h,I),l.constructor=T,l.render=Pn),A&&A.sub(l),l.state||(l.state={}),l.__n=r,_=l.__d=!0,l.__h=[],l._sb=[]),C&&l.__s==null&&(l.__s=l.state),C&&T.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=L({},l.__s)),L(l.__s,T.getDerivedStateFromProps(h,l.__s))),m=l.props,P=l.state,l.__v=t,_)C&&T.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),C&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(C&&T.getDerivedStateFromProps==null&&h!==m&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(h,I),t.__v==n.__v||!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(h,l.__s,I)===!1){t.__v!=n.__v&&(l.props=h,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(R){R&&(R.__=t)}),ee.push.apply(l.__h,l._sb),l._sb=[],l.__h.length&&s.push(l),c=B(n);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(h,l.__s,I),C&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(m,P,g)})}if(l.context=I,l.props=h,l.__P=e,l.__e=!1,N=y.__r,j=0,C)l.state=l.__s,l.__d=!1,N&&N(t),p=l.render(l.props,l.state,l.context),ee.push.apply(l.__h,l._sb),l._sb=[];else do l.__d=!1,N&&N(t),p=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++j<25);l.state=l.__s,l.getChildContext!=null&&(r=L(L({},r),l.getChildContext())),C&&!_&&l.getSnapshotBeforeUpdate!=null&&(g=l.getSnapshotBeforeUpdate(m,P)),U=p!=null&&p.type===w&&p.key==null?ft(p.props.children):p,c=ct(e,re(U)?U:[U],t,n,r,a,i,s,c,u,d),l.base=t.__e,t.__u&=-161,l.__h.length&&s.push(l),S&&(l.__E=l.__=null)}catch(R){if(s.length=f,t.__v=null,u||i!=null){if(R.then){for(t.__u|=u?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;i!=null&&(i[i.indexOf(c)]=null),t.__e=c}else if(i!=null)for(H=i.length;H--;)be(i[H])}else t.__e=n.__e;t.__k==null&&(t.__k=n.__k||[]),R.then||ut(t),y.__e(R,t,n)}}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):c=t.__e=xn(n.__e,t,n,r,a,i,s,u,d);return(p=y.diffed)&&p(t),128&t.__u?void 0:c}function ut(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ut))}function pt(e,t,n){for(var r=0;r<n.length;r++)xe(n[r],n[++r],n[++r]);y.__c&&y.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(i){i.call(a)})}catch(i){y.__e(i,a.__v)}})}function ft(e){return typeof e!=\"object\"||e==null||e.__b>0?e:re(e)?e.map(ft):e.constructor!==void 0?null:L({},e)}function xn(e,t,n,r,a,i,s,c,u){var d,p,f,l,_,m,P,g=n.props||G,S=t.props,h=t.type;if(h==\"svg\"?a=\"http://www.w3.org/2000/svg\":h==\"math\"?a=\"http://www.w3.org/1998/Math/MathML\":a||(a=\"http://www.w3.org/1999/xhtml\"),i!=null){for(d=0;d<i.length;d++)if((_=i[d])&&\"setAttribute\"in _==!!h&&(h?_.localName==h:_.nodeType==3)){e=_,i[d]=null;break}}if(e==null){if(h==null)return document.createTextNode(S);e=document.createElementNS(a,h,S.is&&S),c&&(y.__m&&y.__m(t,i),c=!1),i=null}if(h==null)g===S||c&&e.data==S||(e.data=S);else{if(i=h==\"textarea\"&&S.defaultValue!=null?null:i&&ne.call(e.childNodes),!c&&i!=null)for(g={},d=0;d<e.attributes.length;d++)g[(_=e.attributes[d]).name]=_.value;for(d in g)_=g[d],d==\"dangerouslySetInnerHTML\"?f=_:d==\"children\"||d in S||d==\"value\"&&\"defaultValue\"in S||d==\"checked\"&&\"defaultChecked\"in S||Y(e,d,null,_,a);for(d in S)_=S[d],d==\"children\"?l=_:d==\"dangerouslySetInnerHTML\"?p=_:d==\"value\"?m=_:d==\"checked\"?P=_:c&&typeof _!=\"function\"||g[d]===_||Y(e,d,_,g[d],a);if(p)c||f&&(p.__html==f.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(f&&(e.innerHTML=\"\"),ct(t.type==\"template\"?e.content:e,re(l)?l:[l],t,n,r,h==\"foreignObject\"?\"http://www.w3.org/1999/xhtml\":a,i,s,i?i[0]:n.__k&&B(n,0),c,u),i!=null)for(d=i.length;d--;)be(i[d]);c&&h!=\"textarea\"||(d=\"value\",h==\"progress\"&&m==null?e.removeAttribute(\"value\"):m!=null&&(m!==e[d]||h==\"progress\"&&!m||h==\"option\"&&m!=g[d])&&Y(e,d,m,g[d],a),d=\"checked\",P!=null&&P!=e[d]&&Y(e,d,P,g[d],a))}return e}function xe(e,t,n){try{if(typeof e==\"function\"){var r=typeof e.__u==\"function\";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(a){y.__e(a,n)}}function _t(e,t,n){var r,a;if(y.unmount&&y.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||xe(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){y.__e(i,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(a=0;a<r.length;a++)r[a]&&_t(r[a],t,n||typeof e.type!=\"function\");n||be(e.__e),e.__c=e.__=e.__e=void 0}function Pn(e,t,n){return this.constructor(e,n)}function Tn(e,t,n){var r,a,i,s;t==document&&(t=document.documentElement),y.__&&y.__(e,t),a=(r=typeof n==\"function\")?null:n&&n.__k||t.__k,i=[],s=[],Se(t,e=(!r&&n||t).__k=gn(w,null,[e]),a||G,G,t.namespaceURI,!r&&n?[n]:a?null:t.firstChild?ne.call(t.childNodes):null,i,!r&&n?n:a?a.__e:t.firstChild,r,s),pt(i,e,s),e.props.children=null}function oe(e,t){Tn(e,t,oe)}ne=ee.slice,y={__e:function(e,t,n,r){for(var a,i,s;t=t.__;)if((a=t.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(e)),s=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,r||{}),s=a.__d),s)return a.__E=a}catch(c){e=c}throw e}},ot=0,mn=function(e){return e!=null&&e.constructor===void 0},J.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=L({},this.state),typeof e==\"function\"&&(e=e(L({},n),this.props)),e&&L(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),tt(this))},J.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),tt(this))},J.prototype.render=w,D=[],it=typeof Promise==\"function\"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,at=function(e,t){return e.__v.__b-t.__v.__b},te.__r=0,he=Math.random().toString(8),Q=\"__d\"+he,W=\"__a\"+he,st=/(PointerCapture)$|Capture$/i,ve=0,ye=rt(!1),ge=rt(!0),hn=0;var $,v,Pe,mt,K=0,Pt=[],x=y,ht=x.__b,yt=x.__r,gt=x.diffed,vt=x.__c,bt=x.unmount,St=x.__;function ae(e,t){x.__h&&x.__h(v,e,K||t),K=0;var n=v.__H||(v.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function E(e){return K=1,wn(Tt,e)}function wn(e,t,n){var r=ae($++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Tt(void 0,t),function(c){var u=r.__N?r.__N[0]:r.__[0],d=r.t(u,c);u!==d&&(r.__N=[d,r.__[1]],r.__c.setState({}))}],r.__c=v,!v.__f)){var a=function(c,u,d){if(!r.__c.__H)return!0;var p=!1,f=r.__c.props!==c;if(r.__c.__H.__.some(function(_){if(_.__N){p=!0;var m=_.__[0];_.__=_.__N,_.__N=void 0,m!==_.__[0]&&(f=!0)}}),i){var l=i.call(this,c,u,d);return p?l||f:l}return!p||f};v.__f=!0;var i=v.shouldComponentUpdate,s=v.componentWillUpdate;v.componentWillUpdate=function(c,u,d){if(this.__e){var p=i;i=void 0,a(c,u,d),i=p}s&&s.call(this,c,u,d)},v.shouldComponentUpdate=a}return r.__N||r.__}function F(e,t){var n=ae($++,3);!x.__s&&we(n.__H,t)&&(n.__=e,n.u=t,v.__H.__h.push(n))}function se(e,t){var n=ae($++,4);!x.__s&&we(n.__H,t)&&(n.__=e,n.u=t,v.__h.push(n))}function k(e){return K=5,q(function(){return{current:e}},[])}function q(e,t){var n=ae($++,7);return we(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function M(e,t){return K=8,q(function(){return e},t)}function kn(){for(var e;e=Pt.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(ie),t.__h.some(Te),t.__h=[]}catch(n){t.__h=[],x.__e(n,e.__v)}}}x.__b=function(e){v=null,ht&&ht(e)},x.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),St&&St(e,t)},x.__r=function(e){yt&&yt(e),$=0;var t=(v=e.__c).__H;t&&(Pe===v?(t.__h=[],v.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(ie),t.__h.some(Te),t.__h=[],$=0)),Pe=v},x.diffed=function(e){gt&&gt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Pt.push(t)!==1&&mt===x.requestAnimationFrame||((mt=x.requestAnimationFrame)||En)(kn)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),Pe=v=null},x.__c=function(e,t){t.some(function(n){try{n.__h.some(ie),n.__h=n.__h.filter(function(r){return!r.__||Te(r)})}catch(r){t.some(function(a){a.__h&&(a.__h=[])}),t=[],x.__e(r,n.__v)}}),vt&&vt(e,t)},x.unmount=function(e){bt&&bt(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{ie(r)}catch(a){t=a}}),n.__H=void 0,t&&x.__e(t,n.__v))};var xt=typeof requestAnimationFrame==\"function\";function En(e){var t,n=function(){clearTimeout(r),xt&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);xt&&(t=requestAnimationFrame(n))}function ie(e){var t=v,n=e.__c;typeof n==\"function\"&&(e.__c=void 0,n()),v=t}function Te(e){var t=v;e.__c=e.__(),v=t}function we(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Tt(e,t){return typeof t==\"function\"?t(e):t}var wt={border:\"none\",width:\"100%\",height:\"100%\",position:\"absolute\",top:\"0\",left:\"0\"};var Cn=\"/__peek/raw/\";function ke(e){return e.split(\"/\").map(encodeURIComponent).join(\"/\")}function le(e){return`${Cn}${ke(e)}`}var kt=\"/__peek/print\";function Et(e){return`${kt}?file=${encodeURIComponent(e)}`}function Ct(e){return`${kt}?dir=${encodeURIComponent(e??\"\")}`}var In=0;function o(e,t,n,r,a,i){t||(t={});var s,c,u=t;if(\"ref\"in u)for(c in u={},t)c==\"ref\"?s=t[c]:u[c]=t[c];var d={type:e,props:u,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--In,__i:-1,__u:0,__source:a,__self:i};if(typeof e==\"function\"&&(s=e.defaultProps))for(c in s)u[c]===void 0&&(u[c]=s[c]);return y.vnode&&y.vnode(d),d}function Ee({class:e,children:t}){return o(\"main\",{id:\"main-content\",class:e??\"\",children:t})}function ce({htmlContent:e}){return o(\"div\",{id:\"markdown-content\",class:\"markdown-body\",dangerouslySetInnerHTML:{__html:e}})}function It({contentType:e,fileTitle:t,filePath:n,htmlContent:r,htmlReloadKey:a,markdownClass:i=\"px-5 sm:px-10 py-5 sm:py-10\"}){return e===\"html\"?o(Ee,{class:\"relative flex-1 overflow-hidden\",children:o(\"iframe\",{title:t,src:le(n),style:wt},a)}):o(Ee,{class:i,children:o(\"div\",{class:\"max-w-4xl mx-auto\",children:o(ce,{htmlContent:r})})})}function b({class:e,children:t,width:n=\"24\",height:r=\"24\",viewBox:a=\"0 0 24 24\",...i}){return o(\"svg\",{...i,class:e,\"aria-hidden\":\"true\",xmlns:\"http://www.w3.org/2000/svg\",width:n,height:r,viewBox:a,fill:\"none\",stroke:\"currentColor\",\"stroke-width\":\"2\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\",children:t})}function Ce(e){return o(b,{...e,children:o(\"path\",{d:\"m6 9 6 6 6-6\"})})}function Ie({class:e}){return o(b,{class:e,children:[o(\"path\",{d:\"M15 3h6v6\"}),o(\"path\",{d:\"M10 14 21 3\"}),o(\"path\",{d:\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\"})]})}function Fe(e){return o(b,{...e,children:[o(\"path\",{d:\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\"}),o(\"path\",{d:\"M14 2v4a2 2 0 0 0 2 2h4\"}),o(\"path\",{d:\"M12 18v-6\"}),o(\"path\",{d:\"m9 15 3 3 3-3\"})]})}function z(e){return o(b,{...e,children:[o(\"path\",{d:\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\"}),o(\"path\",{d:\"M14 2v4a2 2 0 0 0 2 2h4\"})]})}function V(e){return o(b,{...e,children:o(\"path\",{d:\"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 0-1.69.9L9.6 8H4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2Z\"})})}function Me({class:e,...t}){return o(b,{class:e,...t,children:o(\"path\",{d:\"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z\"})})}function Ae({class:e,...t}){return o(b,{class:e,...t,children:[o(\"polyline\",{points:\"7 8 3 12 7 16\"}),o(\"line\",{x1:\"21\",x2:\"11\",y1:\"12\",y2:\"12\"}),o(\"line\",{x1:\"21\",x2:\"11\",y1:\"6\",y2:\"6\"}),o(\"line\",{x1:\"21\",x2:\"11\",y1:\"18\",y2:\"18\"})]})}function Le({class:e,...t}){return o(b,{class:e,...t,children:o(\"path\",{d:\"M17 8L21 12L17 16M3 12H13M3 6H13M3 18H13\"})})}function Re(e){return o(b,{...e,width:\"16\",height:\"16\",viewBox:\"0 0 16 16\",children:o(\"path\",{d:\"M6 13L10 3\",\"stroke-linecap\":\"round\"})})}function De({class:e,...t}){return o(b,{class:e,...t,children:[o(\"circle\",{cx:\"12\",cy:\"12\",r:\"4\"}),o(\"path\",{d:\"M12 2v2\"}),o(\"path\",{d:\"M12 20v2\"}),o(\"path\",{d:\"m4.93 4.93 1.41 1.41\"}),o(\"path\",{d:\"m17.66 17.66 1.41 1.41\"}),o(\"path\",{d:\"M2 12h2\"}),o(\"path\",{d:\"M20 12h2\"}),o(\"path\",{d:\"m6.34 17.66-1.41 1.41\"}),o(\"path\",{d:\"m19.07 4.93-1.41 1.41\"})]})}function Ne({class:e,...t}){return o(b,{class:e,...t,children:[o(\"path\",{d:\"M12 2v2\"}),o(\"path\",{d:\"M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715\"}),o(\"path\",{d:\"M16 12a4 4 0 0 0-4-4\"}),o(\"path\",{d:\"m19 5-1.256 1.256\"}),o(\"path\",{d:\"M20 12h2\"})]})}var He={dirItem:\"inline-flex items-center shrink-0\",dirLink:\"text-sm text-muted-foreground hover:text-foreground\",fileItem:\"inline-flex items-center text-sm font-semibold text-foreground truncate\"},Fn=\"shrink-0 mx-1 size-4 text-muted-foreground\";function Ft({items:e}){return o(\"nav\",{\"aria-label\":\"Breadcrumb\",children:o(\"ol\",{class:\"flex items-center min-w-0\",children:e.map((t,n)=>{let r=n===e.length-1;return o(\"li\",{class:r?He.fileItem:He.dirItem,\"aria-current\":r?\"page\":void 0,children:r?t.label:o(w,{children:[o(\"a\",{class:He.dirLink,href:t.href??\"#\",children:t.label}),o(Re,{class:Fn})]})},n)})})})}function Mt({href:e}){return o(\"a\",{href:e,target:\"_blank\",rel:\"noopener noreferrer\",class:\"shrink-0 w-7 h-7 inline-flex justify-center items-center rounded-lg text-muted-foreground hover:text-foreground cursor-pointer\",\"aria-label\":\"Open in new tab\",children:o(Ie,{class:\"size-4\"})})}function At(){return o(\"button\",{type:\"button\",id:\"theme-toggle\",class:\"shrink-0 w-7 h-7 inline-flex justify-center items-center rounded-lg text-muted-foreground hover:text-foreground cursor-pointer\",\"aria-label\":\"Toggle theme\",children:[o(De,{class:\"hidden size-4\",id:\"icon-theme-light\"}),o(Me,{class:\"hidden size-4\",id:\"icon-theme-dark\"}),o(Ne,{class:\"hidden size-4\",id:\"icon-theme-system\"})]})}function Lt({id:e,breadcrumbs:t,showSidebarToggle:n,onToggleSidebar:r,externalLinkHref:a,actions:i}){return o(\"header\",{id:e,class:\"sticky top-0 z-50 bg-background border-b border-border\",children:o(\"div\",{class:\"flex items-center justify-between w-full py-2 px-2 sm:px-5\",children:[o(\"div\",{class:\"flex items-center gap-1 min-w-0\",children:[n&&o(\"button\",{type:\"button\",id:\"sidebar-toggle\",onClick:r,class:\"shrink-0 w-7 h-7 inline-flex justify-center items-center rounded-lg text-muted-foreground hover:bg-sidebar-accent cursor-pointer\",children:[o(Le,{class:\"shrink-0 size-4\",id:\"icon-sidebar-open\"}),o(Ae,{class:\"shrink-0 size-4 hidden\",id:\"icon-sidebar-close\"})]}),o(Ft,{items:t})]}),o(\"div\",{class:\"flex items-center gap-1\",children:[i,o(At,{}),a!==void 0&&o(Mt,{href:a})]})]})})}var Mn=new Map([[\".md\",\"markdown\"],[\".html\",\"html\"],[\".htm\",\"html\"]]);function Be(e){let t=Math.max(e.lastIndexOf(\"/\"),e.lastIndexOf(\"\\\\\")),n=t===-1?e:e.slice(t+1),r=n.lastIndexOf(\".\");return r===-1||r===n.length-1?\"\":n.slice(r).toLowerCase()}function de(e){return Mn.get(Be(e))??null}function Rt(e,t){return e.name.toLowerCase().includes(t)}function O(e,t){for(let n of e)if(n.type===\"directory\"&&t.startsWith(`${n.path}/`))return[n.path,...O(n.children??[],t)];return[]}function Dt(e,t){let n=t.trim().toLowerCase();return n===\"\"?e:Nt(e,n)}function Nt(e,t){let n=[];for(let r of e){if(r.type===\"directory\"){if(Rt(r,t)){n.push(r);continue}let a=r.children?Nt(r.children,t):[];a.length>0&&n.push({...r,children:a});continue}Rt(r,t)&&n.push(r)}return n}var Oe=200;function An(e){let t=e.slice(e.lastIndexOf(\"/\")+1),n=Be(t);return n===\"\"?t:t.slice(0,-n.length)}function Ln(e,t){return e===null?t:e.slice(e.lastIndexOf(\"/\")+1)}function Bt(e){return e===0?\"empty\":e>Oe?\"too-many\":\"ok\"}function Ot(e){return e.flatMap(t=>t.type===\"directory\"?Ot(t.children??[]):de(t.path)===\"markdown\"?[t.path]:[])}function Ut(e,t){for(let n of e)if(n.type===\"directory\"){if(n.path===t)return n.children??[];if(t.startsWith(`${n.path}/`))return Ut(n.children??[],t)}}function Rn(e,t){let n=t===null?e:Ut(e,t);return n&&Ot(n)}function Ht(e,t,n){return{path:t,name:Ln(t,n),markdownFileCount:Rn(e,t)?.length??0}}function $t(e,t,n){return[Ht(e,null,n),...O(e,t).map(r=>Ht(e,r,n))]}function jt(e,t){return{url:t===\"html\"?le(e):Et(e),title:An(e)}}function Wt(e){return{url:Ct(e.path),title:e.name}}function Kt(e,t,n){switch(e){case\"Escape\":return{type:\"close\",returnFocus:!0};case\"Tab\":return{type:\"close\",returnFocus:!1}}if(n!==0)switch(e){case\"ArrowDown\":return{type:\"focus\",index:t<0?0:(t+1)%n};case\"ArrowUp\":return{type:\"focus\",index:t<0?n-1:(t-1+n)%n};case\"Home\":return{type:\"focus\",index:0};case\"End\":return{type:\"focus\",index:n-1};default:return}}var Dn=\"flex items-center gap-x-3 w-full py-2 px-3 text-left text-sm text-foreground rounded-md enabled:cursor-pointer enabled:hover:bg-sidebar-accent focus-visible:bg-sidebar-accent disabled:opacity-50\";function Nn(e){switch(Bt(e)){case\"empty\":return{description:\"No Markdown files\",disabled:!0};case\"too-many\":return{description:`More than ${Oe} Markdown files`,disabled:!0};case\"ok\":return{description:`${e} Markdown file${e===1?\"\":\"s\"}`,disabled:!1}}}function Hn({icon:e,label:t,description:n,disabled:r,onSelect:a}){return o(\"button\",{type:\"button\",role:\"menuitem\",disabled:r,onClick:a,class:Dn,children:[e,o(\"span\",{class:\"min-w-0 flex-1\",children:[o(\"span\",{class:\"block truncate\",children:t}),o(\"span\",{class:\"block text-xs text-muted-foreground\",children:n})]})]})}function Bn({currentPath:e,currentName:t,contentType:n,directories:r}){return[{kind:\"file\",key:`file:${e}`,label:t,description:\"This file\",disabled:!1,request:jt(e,n)},...r.map(a=>({kind:\"directory\",key:`dir:${a.path??\"\"}`,label:a.name,...Nn(a.markdownFileCount),request:Wt(a)}))]}function qt({onPrint:e,...t}){let[n,r]=E(!1),a=k(null),i=k(null),s=k(null),c=()=>Array.from(s.current?.querySelectorAll(\"[role=menuitem]:not(:disabled)\")??[]);F(()=>{if(!n)return;c()[0]?.focus();let f=_=>{a.current?.contains(_.target)||r(!1)},l=()=>r(!1);return document.addEventListener(\"pointerdown\",f),window.addEventListener(\"blur\",l),()=>{document.removeEventListener(\"pointerdown\",f),window.removeEventListener(\"blur\",l)}},[n]);let u=()=>{r(!1),i.current?.focus()},d=f=>{u(),e(f)};return o(\"div\",{ref:a,class:\"relative\",children:[o(\"button\",{ref:i,type:\"button\",id:\"pdf-menu-button\",\"aria-label\":\"Save as PDF\",\"aria-haspopup\":\"menu\",\"aria-expanded\":n,\"aria-controls\":n?\"pdf-menu\":void 0,onClick:()=>r(f=>!f),onKeyDown:f=>{(f.key===\"ArrowDown\"||f.key===\"ArrowUp\")&&(f.preventDefault(),r(!0))},class:\"shrink-0 w-7 h-7 inline-flex justify-center items-center rounded-lg text-muted-foreground hover:text-foreground cursor-pointer\",children:o(Fe,{class:\"size-4\"})}),n&&o(\"div\",{ref:s,id:\"pdf-menu\",role:\"menu\",\"aria-labelledby\":\"pdf-menu-button\",onKeyDown:f=>{let l=c(),_=Kt(f.key,l.indexOf(document.activeElement),l.length);if(_){if(_.type===\"focus\")l[_.index]?.focus();else if(_.returnFocus)u();else{r(!1);return}f.preventDefault()}},class:\"absolute end-0 top-full mt-1 z-60 w-64 max-w-[calc(100vw-1rem)] p-1 bg-background border border-muted-foreground/25 rounded-lg shadow-lg\",children:[o(\"p\",{\"aria-hidden\":\"true\",class:\"px-3 pt-1.5 pb-1 text-xs font-medium text-muted-foreground\",children:\"Save as PDF\"}),Bn(t).map(f=>o(w,{children:[o(Hn,{icon:f.kind===\"file\"?o(z,{class:\"shrink-0 size-4\"}):o(V,{class:\"shrink-0 size-4\"}),label:f.label,description:f.description,disabled:f.disabled,onSelect:()=>d(f.request)}),f.kind===\"file\"&&o(\"hr\",{class:\"my-1 border-border\"})]},f.key))]})]})}var On=20;function Un({node:e,currentPath:t,depth:n,isOpen:r,onToggle:a}){let i=r(e.path);return o(\"li\",{class:n===0?\"px-2 lg:px-5\":\"\",children:[o(\"button\",{type:\"button\",\"aria-expanded\":i,onClick:()=>a?.(e.path),class:\"flex items-center gap-x-3 w-full py-2 px-3 text-left text-sm text-sidebar-foreground hover:bg-sidebar-accent rounded-lg overflow-hidden\",children:[o(V,{class:\"shrink-0 size-4\"}),o(\"span\",{class:\"min-w-0 truncate\",children:e.name}),o(Ce,{class:`${i?\"\":\"-rotate-90 \"}shrink-0 size-3.5 ms-auto transition-transform`})]}),i&&o(\"ul\",{class:\"ps-7 mt-1 flex flex-col gap-y-1 relative before:absolute before:top-0 before:start-[1.125rem] before:w-px before:h-full before:bg-sidebar-border\",children:e.children&&n<On?o(Ue,{nodes:e.children,currentPath:t,depth:n+1,isOpen:r,onToggle:a}):null})]})}function Ue({nodes:e,currentPath:t,depth:n=0,isOpen:r,onToggle:a}){return o(w,{children:e.map(i=>{if(i.type===\"directory\")return o(Un,{node:i,currentPath:t,depth:n,isOpen:r,onToggle:a},i.path);let s=t===i.path;return o(\"li\",{class:n===0?\"px-2 lg:px-5\":\"\",children:o(\"a\",{href:`/view?path=${encodeURIComponent(i.path)}`,class:`flex items-center gap-x-3 py-2 px-3 text-sm rounded-lg overflow-hidden ${s?\"bg-sidebar-accent text-sidebar-primary font-medium\":\"hover:bg-sidebar-accent text-sidebar-foreground\"}`,children:[o(z,{class:\"shrink-0 size-4\"}),o(\"span\",{class:\"min-w-0 truncate\",children:i.name})]})},i.path)})})}function zt({nodes:e,currentPath:t,isOpen:n,onToggle:r}){return o(\"ul\",{id:\"file-tree\",class:\"flex flex-col gap-y-1\",children:o(Ue,{nodes:e,currentPath:t,isOpen:n,onToggle:r})})}function Vt({title:e,tree:t,currentPath:n,onClose:r,isOpen:a,onToggle:i,searchQuery:s,onSearchChange:c,isSearching:u}){return o(w,{children:[o(\"div\",{role:\"none\",id:\"sidebar-overlay\",class:\"fixed inset-0 z-50 bg-black/50 hidden\",onClick:r}),o(\"aside\",{id:\"sidebar\",\"aria-label\":\"File navigation\",class:\"fixed inset-y-0 start-0 z-60 w-72 lg:w-auto overflow-hidden bg-sidebar border-e border-sidebar-border -translate-x-full\",children:[o(\"div\",{class:\"relative flex flex-col h-full max-h-full pt-3\",children:[o(\"header\",{class:\"flex-none h-11.5 ps-5 pe-2 lg:ps-8 flex items-center\",children:o(\"a\",{href:\"/\",class:\"flex-none text-sm font-semibold text-sidebar-foreground hover:text-sidebar-primary\",children:e})}),o(\"div\",{class:\"flex-none px-2 lg:px-5 mt-1.5 mb-1\",children:o(\"input\",{id:\"sidebar-search\",type:\"search\",\"aria-label\":\"Search files\",placeholder:\"Search files\\u2026\",value:s??\"\",onInput:d=>c?.(d.target.value),onKeyDown:d=>{d.key===\"Escape\"&&!d.isComposing&&(c?.(\"\"),d.currentTarget.blur())},class:\"w-full py-1.5 px-3 text-sm text-sidebar-foreground bg-sidebar-accent border border-sidebar-border rounded-lg outline-none focus:border-sidebar-primary placeholder:text-sidebar-foreground/50\"})}),o(\"div\",{class:\"flex-1 min-h-0 overflow-x-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-none [&::-webkit-scrollbar-track]:bg-scrollbar-track [&::-webkit-scrollbar-thumb]:bg-scrollbar-thumb\",children:o(\"nav\",{class:\"pb-3 w-full flex flex-col\",children:u&&t.length===0?o(\"p\",{class:\"px-5 py-3 text-sm text-sidebar-foreground/60\",children:\"No matches found\"}):o(zt,{nodes:t,currentPath:n,isOpen:a,onToggle:i})})})]}),o(\"div\",{id:\"sidebar-resize\",class:\"absolute inset-y-0 end-0 w-1 cursor-col-resize hover:bg-sidebar-border hidden lg:block pointer-events-auto\"})]})]})}function Yt(e,t){return{expanded:new Set,revealed:new Set(O(e,t))}}function $e(e,t){return e.expanded.has(t)||e.revealed.has(t)}function Qt(e,t,n){return $e(e,n)?{expanded:Xt(e.expanded,n),revealed:Xt(e.revealed,n)}:{expanded:new Set([...e.expanded,...O(t,n),n]),revealed:e.revealed}}function Zt(e,t,n){return{expanded:e.expanded,revealed:new Set([...e.revealed,...O(t,n)])}}function Xt(e,t){let n=new Set(e);return n.delete(t),n}var je=\"file-tree-state\";function Jt(e){if(!e)return{};try{let t=JSON.parse(e);if(!t||typeof t!=\"object\"||Array.isArray(t))return{};let n={};for(let[r,a]of Object.entries(t)){if(!a||typeof a!=\"object\"||Array.isArray(a))continue;let{expanded:i,lastAccess:s}=a;typeof s!=\"number\"||!Array.isArray(i)||(n[r]={expanded:i.filter(c=>typeof c==\"string\"),lastAccess:s})}return n}catch{return{}}}function Gt(e,t,n){let r={};for(let[a,i]of Object.entries(e))t-i.lastAccess<=n&&(r[a]=i);return r}function en(e,t){return new Set(e[t]?.expanded??[])}function We(e,t,n,r){return{...e,[t]:{expanded:Array.from(n),lastAccess:r}}}function tn(e){return JSON.stringify(e)}function nn(e,t,n){let[r,a]=E(()=>Yt(t,n)),i=k(!0),s=k(t);s.current=t;let c=k(r);c.current=r;function u(m){c.current=m,a(m)}function d(){try{return Jt(localStorage.getItem(je))}catch{return{}}}function p(m){try{localStorage.setItem(je,tn(m))}catch{}}se(()=>{if(!i.current)return;i.current=!1;let m=Date.now(),P=Gt(d(),m,2592e6),g=en(P,e);p(We(P,e,g,m)),u({...c.current,expanded:g})},[e]);let f=M(m=>{let P=Qt(c.current,s.current,m);u(P),p(We(d(),e,P.expanded,Date.now()))},[e]),l=M(m=>{u(Zt(c.current,s.current,m))},[]);return{isOpen:M(m=>$e(r,m),[r]),toggle:f,reveal:l}}async function X(e,t){try{let n=e?`/api/content?path=${encodeURIComponent(e)}`:\"/api/content\",r=await fetch(n,t?.signal?{signal:t.signal}:void 0);return r.ok?await r.text():(console.error(`[peek] Failed to fetch content: HTTP ${r.status}`),null)}catch(n){if(n instanceof DOMException&&n.name===\"AbortError\")throw n;return console.error(\"[peek] Failed to fetch content:\",n),null}}async function rn(e){try{let t=await fetch(\"/api/tree\",e?.signal?{signal:e.signal}:void 0);if(!t.ok)return console.error(`[peek] Failed to fetch tree: HTTP ${t.status}`),null;let n=await t.json();return Array.isArray(n)?n:(console.error(\"[peek] Unexpected tree response format\"),null)}catch(t){if(t instanceof DOMException&&t.name===\"AbortError\")throw t;return console.error(\"[peek] Failed to fetch tree:\",t),null}}function ue(e){let n=e.replace(/\\/+$/,\"\").split(\"/\");return n[n.length-1]||e}function on(e){let t=k(null),n=k(e);n.current=e;let r=M(async(a,i)=>{t.current&&t.current.abort();let s=new AbortController;t.current=s;try{let c=await X(a,{signal:s.signal});if(c===null)return;n.current(a,c),document.title=`${ue(a)} - peek`;let u=`/view?path=${encodeURIComponent(a)}`;i&&history.pushState({path:a},\"\",u)}catch(c){if(c instanceof DOMException&&c.name===\"AbortError\")return;console.error(\"[peek] Failed to navigate:\",c)}},[]);return F(()=>{let a=new URLSearchParams(window.location.search).get(\"path\");a&&history.replaceState({path:a},\"\");function i(c){if(c.ctrlKey||c.metaKey||c.shiftKey||c.altKey)return;let u=c.target.closest(\"a[href]\");if(!u)return;let d;try{d=new URL(u.href,window.location.origin)}catch{return}if(d.origin!==window.location.origin||d.pathname!==\"/view\")return;let p=d.searchParams.get(\"path\");p&&(c.preventDefault(),r(p,!0))}function s(c){let d=c.state?.path??new URLSearchParams(window.location.search).get(\"path\");d?r(d,!1):window.location.reload()}return document.addEventListener(\"click\",i),window.addEventListener(\"popstate\",s),()=>{document.removeEventListener(\"click\",i),window.removeEventListener(\"popstate\",s)}},[r]),r}var jn=\"sidebar-search\";function Wn(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return t===\"INPUT\"||t===\"TEXTAREA\"||t===\"SELECT\"||e.isContentEditable}function an(e){F(()=>{function t(n){n.key===\"/\"&&(n.isComposing||Wn(n.target)||(n.preventDefault(),e?.(),document.getElementById(jn)?.focus()))}return window.addEventListener(\"keydown\",t),()=>window.removeEventListener(\"keydown\",t)},[e])}var pe=\"sidebar-open\",sn=\"sidebar-width\",Ke=200,qe=480,Kn=1024;function fe(){return window.innerWidth>=Kn}function ln(){let[e,t]=E(!1),n=k(!0);se(()=>{if(n.current){n.current=!1;let s=localStorage.getItem(sn);if(s){let c=Number(s);c>=Ke&&c<=qe&&document.documentElement.style.setProperty(\"--sidebar-width\",`${c}px`)}if(fe()&&localStorage.getItem(pe)!==\"false\"){let c=[document.getElementById(\"sidebar\"),document.getElementById(\"header-bar\"),document.getElementById(\"main-content\")];for(let u of c)u&&(u.style.transition=\"none\");document.body.setAttribute(\"data-sidebar-open\",\"\"),document.body.offsetHeight,requestAnimationFrame(()=>{for(let u of c)u&&u.style.removeProperty(\"transition\")}),t(!0)}return}e?document.body.setAttribute(\"data-sidebar-open\",\"\"):document.body.removeAttribute(\"data-sidebar-open\")},[e]),F(()=>{let s=document.getElementById(\"sidebar-resize\");if(!s)return;let c=u=>{u.preventDefault(),s.setPointerCapture(u.pointerId);let d=document.getElementById(\"sidebar\");document.body.style.setProperty(\"user-select\",\"none\"),d?.style.setProperty(\"transition\",\"none\");function p(l){let _=Math.min(Math.max(l.clientX,Ke),qe);document.documentElement.style.setProperty(\"--sidebar-width\",`${_}px`)}let f=l=>{if(s.releasePointerCapture(l.pointerId),s.removeEventListener(\"pointermove\",p),s.removeEventListener(\"pointerup\",f),s.removeEventListener(\"pointercancel\",f),document.body.style.removeProperty(\"user-select\"),d?.style.removeProperty(\"transition\"),l.type===\"pointerup\"){let _=Math.min(Math.max(l.clientX,Ke),qe);localStorage.setItem(sn,String(_))}};s.addEventListener(\"pointermove\",p),s.addEventListener(\"pointerup\",f),s.addEventListener(\"pointercancel\",f)};return s.addEventListener(\"pointerdown\",c),()=>s.removeEventListener(\"pointerdown\",c)},[]);let r=M(()=>{t(s=>{let c=!s;return fe()&&localStorage.setItem(pe,String(c)),c})},[]),a=M(()=>{t(!1),fe()&&localStorage.setItem(pe,\"false\")},[]),i=M(()=>{t(!0),fe()&&localStorage.setItem(pe,\"true\")},[]);return{toggle:r,close:a,open:i}}var ze=\"[peek]\",Ve={info:(...e)=>console.log(ze,...e),warn:(...e)=>console.warn(ze,...e),error:(...e)=>console.error(ze,...e)};function Xn(e){let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!=\"object\")return null;let n=t;return typeof n.path!=\"string\"?null:{path:n.path}}function cn(e){let t=0,n=null,r=null,a=null;function i(){r&&(clearTimeout(r),r=null);let s=new EventSource(\"/sse\");if(a=s,s.addEventListener(\"file-changed\",c=>{let u=Xn(c.data);e.onFileChanged(u?u.path:null)}),e.onTreeChanged){let c=e.onTreeChanged;s.addEventListener(\"tree-changed\",()=>{c()})}s.onerror=()=>{if(s.close(),a=null,r&&(clearTimeout(r),r=null),t++,t>10){Ve.warn(`SSE connection lost after ${10} retries, giving up.`);return}let c=Math.min(1e3*2**(t-1),3e4);Ve.info(`SSE reconnecting in ${c}ms (${t}/${10})...`),n=setTimeout(i,c)},r=setTimeout(()=>{t=0,r=null},5e3)}return i(),()=>{n&&clearTimeout(n),r&&clearTimeout(r),a&&a.close()}}function _e(e){let{onContentUpdate:t,getCurrentPath:n,getCurrentContentType:r,onHtmlReload:a,onTreeUpdate:i}=e;F(()=>{let s=null,c=null,u=cn({onFileChanged:d=>{if(n){if(d===null)return;let p=n();if(d!==p)return;if(r?.()===\"html\"){a?.();return}s?.abort(),s=new AbortController,X(p,{signal:s.signal}).then(f=>{f!==null&&t(f)}).catch(f=>{f instanceof DOMException&&f.name===\"AbortError\"||console.error(\"[peek] Failed to refresh content:\",f)})}else s?.abort(),s=new AbortController,X(void 0,{signal:s.signal}).then(p=>{p!==null&&t(p)}).catch(p=>{p instanceof DOMException&&p.name===\"AbortError\"||console.error(\"[peek] Failed to refresh content:\",p)})},onTreeChanged:i?()=>{c?.abort(),c=new AbortController,rn({signal:c.signal}).then(d=>{d&&i(d)}).catch(d=>{d instanceof DOMException&&d.name===\"AbortError\"||console.error(\"[peek] Failed to refresh tree:\",d)})}:void 0});return()=>{s?.abort(),c?.abort(),u()}},[])}function Yn(e,t,n){let r=n(e);return r?(r.addEventListener(\"load\",()=>{r.document.contentType===\"text/html\"&&(r.document.title=t,r.addEventListener(\"afterprint\",()=>r.close(),{once:!0}),r.print())},{once:!0}),!0):!1}var Qn=\"Pop-ups are blocked. Allow pop-ups for this site to save as PDF.\";function dn({url:e,title:t},n){Yn(e,t,r=>n.open(r,\"_blank\"))||n.alert(Qn)}function un({projectId:e,dirTitle:t,currentPath:n,contentType:r,content:a,tree:i}){let[s,c]=E(n),[u,d]=E(r),[p,f]=E(a),[l,_]=E(i),[m,P]=E(\"\"),[g,S]=E(0),h=k(s);h.current=s;let C=ln(),A=nn(e,l,n),I=m.trim()!==\"\",N=q(()=>Dt(l,m),[l,m]);an(C.open),on((T,R)=>{let Ge=de(T);if(!Ge){console.error(`Unexpected unsupported file type: ${T}`);return}h.current=T,c(T),d(Ge),f(R),S(0),A.reveal(T)});let j=k(u);j.current=u,_e({getCurrentPath:()=>h.current,getCurrentContentType:()=>j.current,onContentUpdate:f,onHtmlReload:()=>S(T=>T+1),onTreeUpdate:_});let U=q(()=>$t(l,s,t),[l,s,t]),H=ue(s);return o(w,{children:[o(Vt,{title:t,tree:N,currentPath:s,onClose:C.close,isOpen:I?()=>!0:A.isOpen,onToggle:I?void 0:A.toggle,searchQuery:m,onSearchChange:P,isSearching:I}),o(Lt,{id:\"header-bar\",breadcrumbs:[{label:t,href:\"/\"},{label:H}],showSidebarToggle:!0,onToggleSidebar:C.toggle,externalLinkHref:`/${ke(s)}`,actions:o(qt,{currentPath:s,currentName:H,contentType:u,directories:U,onPrint:T=>dn(T,window)})}),o(It,{contentType:u,fileTitle:H,filePath:s,htmlContent:p,htmlReloadKey:g})]})}function pn({content:e}){let[t,n]=E(e);return _e({onContentUpdate:n}),o(\"main\",{class:\"px-2 sm:px-5 py-5 sm:py-15\",children:o(\"div\",{class:\"max-w-4xl mx-auto\",children:o(ce,{htmlContent:t})})})}var Ze=\"theme\";function Ye(){let e=localStorage.getItem(Ze);return e===\"light\"||e===\"dark\"?e:\"system\"}function Qe(e){let t=document.documentElement;e===\"dark\"?t.classList.add(\"dark\"):e===\"light\"?t.classList.remove(\"dark\"):window.matchMedia(\"(prefers-color-scheme: dark)\").matches?t.classList.add(\"dark\"):t.classList.remove(\"dark\")}function fn(e){let t=document.getElementById(\"icon-theme-light\"),n=document.getElementById(\"icon-theme-dark\"),r=document.getElementById(\"icon-theme-system\");!t||!n||!r||(t.classList.add(\"hidden\"),n.classList.add(\"hidden\"),r.classList.add(\"hidden\"),e===\"light\"?t.classList.remove(\"hidden\"):e===\"dark\"?n.classList.remove(\"hidden\"):r.classList.remove(\"hidden\"))}function Zn(e){return e===\"light\"?\"dark\":e===\"dark\"?\"system\":\"light\"}function _n(){let e=Ye();Qe(e),fn(e);let t=document.getElementById(\"theme-toggle\");t&&t.addEventListener(\"click\",()=>{let n=Zn(Ye());n===\"system\"?localStorage.removeItem(Ze):localStorage.setItem(Ze,n),Qe(n),fn(n)}),window.matchMedia(\"(prefers-color-scheme: dark)\").addEventListener(\"change\",()=>{Ye()===\"system\"&&Qe(\"system\")})}var me=window.__INITIAL_STATE__,Je=document.getElementById(\"app\");Je&&me?me.mode===\"directory\"?oe(o(un,{...me}),Je):oe(o(pn,{...me}),Je):console.error(\"[peek] hydration failed: missing #app or initial state\");_n();})();\n";
1298
+ const clientBundle = "\"use strict\";(()=>{var g,rt,_n,N,ye,re,ot,G,it,ve,ge,mn,W=Symbol.for(\"pv\"),oe={},ie=[],hn=/^m(i|n|o|s|text|space)$/,at=Array.isArray,st=ie.slice,O=Object.assign;function H(t){t&&t.parentNode&&t.remove()}function ee(t,e,n,r,i){var a={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:W,__v:i||++rt,__i:-1,__u:0};return!i&&g.vnode&&g.vnode(a),a}function k(t){return t.children}function te(t,e){this.props=t,this.context=e,this.__g=0}function U(t,e){if(e!=null){for(var n;e<t.__k.length;e++)if((n=t.__k[e])&&n.__e)return n.__e;if(typeof t.type!=\"function\"||t.props.__P)return null}return t.__&&U(t.__,t.__i+1)}function tt(t){(8&t.__g||(t.__g|=8,N.push(t),re++))&&ye==g.debounceRendering||((ye=g.debounceRendering)||queueMicrotask)(lt)}function lt(){try{for(var t,e,n,r,i,a,l,s=1;N.length;)if(g.__k&&g.__k(),N.length>s&&N.sort(ot),t=N.shift(),s=N.length,t&&8&t.__g&&(i=t.__P)&&(r=(e=t.__v).__e,a=[],l=[],(n=O({constructor:W},e)).__v=e.__v+1,g.vnode&&g.vnode(n),be(i,n,e,t.__n,i.namespaceURI,32&e.__u?[r]:null,a,r||U(e),32&e.__u,l),n.__v=e.__v,n.__.__k[n.__i]=n,pt(a,n,l),e.__=e.__e=null,n.__e!=r))for(;(n=n.__)&&n.__c&&!n.props.__P;)n.__e=null,n.__k.some(function(d){return d&&(n.__e=d.__e)})}finally{(re=N.length)&&(ye||queueMicrotask)(lt)}}function ct(t,e,n,r,i,a,l,s,d,f,u){var p,m,c,_,b,y,v,h=r.__k||ie;for(at(e)||(e=[e]),d=yn(n,e,h,d,y=e.length),p=0;p<y;p++)(c=n.__k[p])!=null&&(m=~c.__i&&h[c.__i]||oe,c.__i=p,v=be(t,c,m,i,a,l,s,d,f,u),_=c.__e,(m.ref!=c.ref||8&m.__u)&&(m.ref&&Se(m.ref,null,c,m),c.ref&&u.push(c.ref,c.__c||_,c)),b=b||_,!(4&c.__u)||c.__v&&d&&d==m.__e&&typeof c.type==\"function\"?typeof c.type==\"function\"&&v!==void 0?d=v:_&&(d=_.nextSibling):d=ut(c,d,t,!m.__v),m.__&&(m.__=m.__e=null),c.__u&=-21);return n.__e=b,d}function yn(t,e,n,r,i){var a,l,s,d,f,u,p,m,c,_=n.length,b=_,y=0,v=0,h=t.__k=Array(i);for(a=0;a<i;a++)(l=e[a])!=null&&typeof l!=\"boolean\"&&typeof l!=\"function\"?(typeof l!=\"object\"||l.constructor===String?l=h[a]=ee(null,l):at(l)?l=h[a]=ee(k,{children:l}):l.constructor===W&&l.__b?l=h[a]=ee(l.type,l.props,l.key,l.ref,l.__v):h[a]=l,d=a+y,l.__=t,l.__b=t.__b+1,s=null,~(f=l.__i=gn(l,n,d,b))&&(b--,(s=n[f])&&(s.__u|=2)),s&&s.__v?(l.__u|=16,f==d-1?y--:f==d+1?y++:f!=d&&(f>d?y--:y++,v=1)):(~f||(i>_?y--:i<_&&y++),typeof l.type!=\"function\"&&(l.__u|=4))):h[a]=null;if(v){for(u=[],p=[],a=0;a<i;a++)if((l=h[a])&&16&l.__u){for(y=0,m=u.length;y<m;)u[c=y+m>>1]<l.__i?y=c+1:m=c;u[y]=l.__i,p[a]=y+1}for(y=u.length;a--;)p[a]&&(p[a]==y?y--:h[a].__u|=4)}if(b)for(a=0;a<_;a++)!(s=n[a])||2&s.__u||(s.__e==r&&(r=U(s)),xe(s,s));return r}function ut(t,e,n,r){var i,a,l,s,d;if(typeof t.type==\"function\"){if(t.props.__P)return e;if(i=t.__k)for(a=0;a<i.length;a++)(l=i[a])&&(l.__=t,e=ut(l,e,n,!1));return e}for(e&&!e.parentNode&&(e=U(t))&&!e.parentNode&&(e=null),s=t.__e,d=e;d&&d.nodeType==8;)d=d.nextSibling;for(s!=d&&(!r&&n.moveBefore&&s.parentNode?n.moveBefore(s,e):n.insertBefore(s,e||null)),e=s;(e=e&&e.nextSibling)&&e.nodeType==8&&!e.data.startsWith(\"$s\"););return e}function gn(t,e,n,r){var i,a=t.key,l=t.type,s=e[n],d=s&&!(2&s.__u);if(s===null&&a==null||d&&a==s.key&&l==s.type)return n;if(r>(d?1:0)){for(i=n-1;i>=0;i--)if((s=e[i])&&!(2&s.__u)&&a==s.key&&l==s.type)return i;for(i=n+1;i<e.length;i++)if((s=e[i])&&!(2&s.__u)&&a==s.key&&l==s.type)return i}return-1}function nt(t,e,n){n==null&&(n=\"\"),e[0]==\"-\"?t.setProperty(e,n):t[e]=n}function J(t,e,n,r,i){var a,l;if(e==\"style\")if(typeof n==\"string\")t.style.cssText=n;else{if(typeof r==\"string\"&&(t.style.cssText=r=\"\"),r)for(e in r)n&&e in n||nt(t.style,e);if(n)for(e in n)r&&n[e]===r[e]||nt(t.style,e,n[e])}else if(e[0]==\"o\"&&e[1]==\"n\")typeof n!=\"function\"&&(n=null),(t.__e||(t.__e={}))[e]=n,n&&typeof r==\"function\"||(l=ge[e]||(ge[e]=vn(e)),(t.__a||(t.__a={}))[e]=ve,a=e!=(e=e.replace(it,\"$1\")),(e=e.slice(2))[0]<\"a\"&&(e=e.toLowerCase()),n?t.addEventListener(e,l,a):t.removeEventListener(e,l,a));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{return void(t[e]=n??\"\")}catch{}if(typeof n==\"function\")return;n==null||n===!1&&e[4]!=\"-\"?t.removeAttribute(e):t.setAttribute(e,e==\"popover\"&&n==1?\"\":n)}}function vn(t){return function(e){var n=this.__e;if(n){if(n=n[t],e[G]==null)e[G]=ve++;else if(e[G]<this.__a[t])return;return n(g.event?g.event(e):e)}}}function be(t,e,n,r,i,a,l,s,d,f){var u,p,m,c,_,b,y,v,h,x,S,B,Z,q,R,j,T,D,F=e.type;if(e.constructor!==W)return null;128&n.__u&&(d=32&n.__u,u=n.__c.__z)&&(e.__u|=d,p=a=[],u.nodeType==8?s=ne(u,a):a.push(u),s=a[0]||s),(u=g.__b)&&u(e);e:if(typeof F==\"function\"){m=l.length;try{if(v=e.props,h=(u=F.prototype)&&u.render,x=(u=F.contextType)&&r[u.__c],S=u?x?x.props.value:u.__:r,(c=n.__c)?(e.__c=c,2&c.__g&&(c.__g|=1)):(h?e.__c=c=new F(v,S):(e.__c=c=new te(v,S),c.constructor=F,c.render=Sn),x&&x.sub(c),c.state||(c.state={}),c.__n=r,c.__g|=8,c.__h=[],c.__k=[]),h&&(c.__s||(c.__s=c.state),F.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=O({},c.__s)),O(c.__s,F.getDerivedStateFromProps(v,c.__s)))),_=c.props,b=c.state,c.__v=e,n.__c){if(v!==_&&h&&!F.getDerivedStateFromProps&&c.componentWillReceiveProps&&c.componentWillReceiveProps(v,S),e.__v==n.__v&&!(8&c.__g)||!(4&c.__g)&&c.shouldComponentUpdate&&c.shouldComponentUpdate(v,c.__s,S)===!1){e.__v!=n.__v&&(c.props=v,c.state=c.__s,c.__g&=-9),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(M){M&&(M.__=e)}),ie.push.apply(c.__h,c.__k),c.__k=[],c.__h.length&&l.push(c),s=U(n);break e}c.componentWillUpdate&&c.componentWillUpdate(v,c.__s,S),h&&c.componentDidUpdate&&c.__h.push(function(){c.componentDidUpdate(_,b,y)})}else h&&!F.getDerivedStateFromProps&&c.componentWillMount&&c.componentWillMount(),h&&c.componentDidMount&&c.__h.push(c.componentDidMount);c.context=S,c.props=v,c.__P=t,c.__g&=-5,B=g.__r,Z=h?1:25;do c.__g&=-9,B&&B(e),u=c.render(c.props,c.state=c.__s,c.context);while(8&c.__g&&--Z);h&&(ie.push.apply(c.__h,c.__k),c.__k=[]),c.state=c.__s,c.getChildContext&&(r=O({},r,c.getChildContext())),h&&n.__c&&c.getSnapshotBeforeUpdate&&(y=c.getSnapshotBeforeUpdate(_,b)),q=u&&u.type===k&&u.key==null?u.props.children:u,v.__P&&(u=s,i=(t=v.__P).namespaceURI,d=a=null,n.props&&n.props.__P!=t&&(n.__k.some(function(M){M&&xe(M,M)}),n.__k=null),s=n.__k&&U(n,0)),s=ct(t,q,e,n,r,i,a,l,s,d,f),v.__P&&(e.__e=null,s=u),e.__u&=-161,p&&p.some(H),c.__h.length&&l.push(c),1&c.__g&&(c.__g&=-4)}catch(M){if(l.length=m,e.__v=null,d||a)if(M&&M.then){if(e.__u|=128|d,a){for(~(T=a.indexOf(s||void 0))||(T=a.length);(D=a[T-1])&&D.nodeType==8;)T--;for(;T<a.length;T++)if(D=a[T])if(a[T]=null,R){if(D==j)break}else{if(D.nodeType!=8)break;D.data.startsWith(\"$s\")&&(j=ne(R=D))}}if(!R){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;R=s}(u=ne(R=e.__c.__z||(e.__c.__z=R)))?(e.__e=R,s=u):e.__e=s,s=s&&s.nextSibling}else a&&a.some(H);else e.__e=n.__e;e.__k||(e.__k=n.__k||[]),e.__k.some(function(et){et&&(et.__=e)}),M&&M.then||dt(e),(u=n.__c)&&u.__v!=e&&((e.__c=u).__v=e),g.__e(M,e,n)}}else s=e.__e=bn(n.__e,e,n,r,i,a,l,d,f,t);return(u=g.diffed)&&u(e),s}function ne(t,e){if(t&&t.nodeType==8&&t.data.startsWith(\"$s\"))for(var n=1;t=t.nextSibling;){if(t.nodeType==8){if(t.data.startsWith(\"$s\"))n++;else if(t.data.startsWith(\"/$s\")&&!--n)return t}e&&e.push(t)}}function dt(t){t&&(t.__c&&(t.__c.__g|=4),t.__k&&t.__k.some(dt))}function pt(t,e,n){for(var r=0;r<n.length;)Se(n[r++],n[r++],n[r++]);g.__c&&g.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(a){a.call(i)})}catch(a){g.__e(a,i.__v)}})}function bn(t,e,n,r,i,a,l,s,d,f){var u,p,m,c,_,b,y,v,h=n.props||oe,x=e.props,S=e.type;if(S==\"svg\"?i=\"http://www.w3.org/2000/svg\":S==\"math\"?i=\"http://www.w3.org/1998/Math/MathML\":i||(i=\"http://www.w3.org/1999/xhtml\"),a){for(u=0;u<a.length;u++)if((_=a[u])&&(S?_.localName==S:_.nodeType==3)){t=_,a[u]=null;break}}if(!t){if(v=f.ownerDocument||document,!S)return v.createTextNode(x);t=v.createElementNS(i,S,x.is?x:f),s&&(g.__m&&g.__m(e,a),s=!1),a=null}if(S){if(f=S==\"template\"&&t.content||t,a=S==\"textarea\"&&x.defaultValue!=null?null:a&&st.call(f.childNodes),!s&&a)for(h={},u=0;u<t.attributes.length;u++)h[(_=t.attributes[u]).name]=_.value;for(u in h)_=h[u],u==\"dangerouslySetInnerHTML\"?m=_:u==\"children\"||u in x||u==\"value\"&&\"defaultValue\"in x||u==\"checked\"&&\"defaultChecked\"in x||J(t,u,null,_,i);for(u in x)_=x[u],u==\"children\"?c=_:u==\"dangerouslySetInnerHTML\"?p=_:u==\"value\"?b=_:u==\"checked\"?y=_:s&&typeof _!=\"function\"||h[u]===_||J(t,u,_,h[u],i);p?(s||m&&(p.__html==m.__html||p.__html==t.innerHTML)||(t.innerHTML=p.__html),e.__k=[]):(m&&(t.textContent=\"\"),(S==\"foreignObject\"||i==\"http://www.w3.org/1998/Math/MathML\"&&hn.test(S))&&(i=\"http://www.w3.org/1999/xhtml\"),ct(f,c,e,n,r,i,a,l,a?a[0]:n.__k&&U(n,0),s,d),a&&a.some(H)),s&&S!=\"textarea\"||(u=\"value\",S==\"progress\"&&b==null?t.removeAttribute(u):b==null||b===t[u]&&(S!=\"progress\"||b)||J(t,u,b,h[u],i),u=\"checked\",y!=null&&y!=t[u]&&J(t,u,y,h[u],i))}else h===x||s&&t.data==x||(t.data=x);return t}function Se(t,e,n,r){try{typeof t==\"function\"?e?e.__x=t(e)||1:r&&(r=r.__c||r.__e)&&(e=r.__x)&&(r.__x=null,typeof e==\"function\"?e():t(null)):t.current=e}catch(i){g.__e(i,n)}}function xe(t,e,n){var r,i,a,l;if(g.unmount&&g.unmount(t),!(r=t.ref)||r.current&&r.current!=t.__e||Se(r,null,e,t),r=t.__c){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){g.__e(s,e)}r.__P=r.__n=null}if(r=t.__k)for(l=0;l<r.length;l++)r[l]&&xe(r[l],e,typeof t.type!=\"function\"||n&&!t.props.__P);n||((r=t.__c)&&(r=r.__z)&&(i=ne(r,a=[]))&&(r==t.__e&&a.some(H),H(i),H(r)),H(t.__e)),t.__e=t.__c=t.__=null}function Sn(t,e,n){return this.constructor(t,n)}function xn(t,e){var n,r,i,a;g.__&&g.__(t,e),e.nodeType==9&&(e=e.documentElement),r=(n=t&&32&t.__u)?null:e.__k,e.__k=ee(k,{children:[t]}),i=[],a=[],be(e,e.__k,r||oe,oe,e.namespaceURI,r?null:e.firstChild?st.call(e.childNodes):null,i,r?r.__e:e.firstChild,n,a),pt(i,e.__k,a),e.__k.props.children=null}function Pe(t,e){t&&typeof t==\"object\"&&(t.__u|=32),xn(t,e)}g={__e:function(t,e,n,r){for(var i,a,l;e=e.__;)if((i=e.__c)&&(e=i.__v)&&!(1&i.__g)){i.__g|=4;try{if((l=(a=i.constructor)&&a.getDerivedStateFromError)&&i.setState(a.getDerivedStateFromError(t)),i.componentDidCatch&&(i.componentDidCatch(t,r||{}),l=1),l&&8&i.__g)return void(i.__g|=2)}catch(s){t=s}}throw re=0,t}},rt=0,_n=function(t){return t!=null&&t.constructor===W},te.prototype.setState=function(t,e){var n=this.__s;n&&n!=this.state||(n=this.__s=O({},this.state)),typeof t==\"function\"&&(t=t(O({},n),this.props)),t&&(O(n,t),this.__v&&(e&&this.__k.push(e),tt(this)))},te.prototype.forceUpdate=function(t){this.__v&&(this.__g|=4,t&&this.__h.push(t),tt(this))},te.prototype.render=k,N=[],re=0,ot=function(t,e){return t.__v.__b-e.__v.__b},G=Symbol(),it=/(PointerCapture)$|Capture$/i,ve=0,ge={},mn=0;var bt,I,ft,Te=Object.is,K=0,St=[],ae=[],w=g,_t=w.__r,mt=w.diffed,ht=w.__c,yt=w.unmount;function se(t){var e=bt++;w.__h&&w.__h(I,e,K||t),K=0;var n=I.__H||(I.__H={__:[],__h:[]});return n.__[e]||(n.__[e]={})}function C(t){return K=1,Pn(Pt,t)}function Pn(t,e,n){var r,i=se(2);return i.t=t,i.__c||(i.__=[n?n(e):Pt(void 0,e),function(a){var l=(i.__N||i.__)[0],s=i.t(l,a);Te(l,s)||(i.__N=[s,i.__[1]],i.__c.setState({}))}],i.__c=I,I.__f||(I.__f=!0,I.shouldComponentUpdate=(r=I.shouldComponentUpdate,function(a,l,s){var d=this.__H;if(!d)return!0;var f=!1,u=this.props!=a;if(d.__.some(function(m){m.__N&&(f=!0,Te(m.__[0],m.__N[0])||(u=!0))}),r){var p=r.call(this,a,l,s);return f?p||u:p}return!f||u}))),i.__}function A(t,e){var n=se(3);!w.__s&&ke(n.__H,e)&&(n.__P=!0,n.__=t,n.u=e,I.__H.__h.push(n))}function le(t,e){var n=se(4);!w.__s&&ke(n.__H,e)&&(n.__P=!1,n.__=t,n.u=e,I.__h.push(n))}function E(t){return K=5,V(function(){return{current:t}},[])}function V(t,e){var n=se(7);return ke(n.__H,e)&&(n.__=t(),n.__H=e),n.__}function L(t,e){return K=8,V(function(){return t},e)}function xt(t){for(var e,n=[],r=function(){try{z(e)}catch(i){t?w.__e(i,{__:(e=e.__P)&&e.__v}):(e.__c=function(){throw i},n.push(e))}};e=ae.shift();)r();ae=n}function Tn(){var t;do for(xt(1);t=St.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(z),e.__h.some(we),e.__h=[]}catch(n){e.__h=[],w.__e(n,t.__v)}}while(ae.length)}w.__k=xt,w.__r=function(t){_t&&_t(t);var e=t.__c,n=e.__H;n&&(I==e?e.__h=[]:(n.__h.some(z),n.__h.some(we)),n.__h=[],n.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})),I=e,bt=0},w.diffed=function(t){mt&&mt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&vt(St.push(e)),e.__H.__.some(function(n){n.u&&(n.__H=n.u)})),I=null},w.__c=function(t,e){e.some(function(n){try{n.__h.some(z),n.__h=n.__h.filter(function(r){return!r.__||we(r)})}catch(r){n.__h=[function(){throw r}]}}),ht&&ht(t,e)},w.unmount=function(t){yt&&yt(t);var e,n,r=t.__c;r&&r.__H&&(r.__H.__.some(function(i){try{if(i.__P&&i.__c){if(n===void 0){for(n=t.__;n&&(!n.__c||!n.__c.__P);)n=n.__;n=n&&n.__c}i.__P=n,vt(ae.push(i))}else z(i)}catch(a){e=a}}),r.__H=void 0,e&&w.__e(e,r.__v))};var gt=typeof requestAnimationFrame==\"function\";function wn(t){var e=function(){clearTimeout(n),gt&&cancelAnimationFrame(r),setTimeout(t)},n=setTimeout(e,35),r=gt&&requestAnimationFrame(e)}function vt(t){t!=1&&ft==w.requestAnimationFrame||((ft=w.requestAnimationFrame)||wn)(Tn)}function z(t){var e=t.__c;typeof e==\"function\"&&(t.__c=void 0,e())}function we(t){t.__c=t.__()}function ke(t,e){return!t||t.length!=e.length||e.some(function(n,r){return!Te(n,t[r])})}function Pt(t,e){return typeof e==\"function\"?e(t):e}var Tt={border:\"none\",width:\"100%\",height:\"100%\",position:\"absolute\",top:\"0\",left:\"0\"};var kn=\"/__peek/raw/\";function Ee(t){return t.split(\"/\").map(encodeURIComponent).join(\"/\")}function ce(t){return`${kn}${Ee(t)}`}var wt=\"/__peek/print\";function kt(t){return`${wt}?file=${encodeURIComponent(t)}`}function Et(t){return`${wt}?dir=${encodeURIComponent(t??\"\")}`}var En=Symbol.for(\"pv\"),Cn=0;function o(t,e,n,r,i,a){e||(e={});var l,s,d=e;if(\"ref\"in d&&typeof t!=\"function\")for(s in d={},e)s==\"ref\"?l=e[s]:d[s]=e[s];var f={type:t,props:d,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:En,__v:--Cn,__i:-1,__u:0};return(i||a)&&(f.__source=i,f.__self=a),g.vnode&&g.vnode(f),f}function Ce({class:t,children:e}){return o(\"main\",{id:\"main-content\",class:t??\"\",children:e})}function ue({htmlContent:t}){return o(\"div\",{id:\"markdown-content\",class:\"markdown-body\",dangerouslySetInnerHTML:{__html:t}})}function Ct({contentType:t,fileTitle:e,filePath:n,htmlContent:r,htmlReloadKey:i,markdownClass:a=\"px-5 sm:px-10 py-5 sm:py-10\"}){return t===\"html\"?o(Ce,{class:\"relative flex-1 overflow-hidden\",children:o(\"iframe\",{title:e,src:ce(n),style:Tt},i)}):o(Ce,{class:a,children:o(\"div\",{class:\"max-w-4xl mx-auto\",children:o(ue,{htmlContent:r})})})}function P({class:t,children:e,width:n=\"24\",height:r=\"24\",viewBox:i=\"0 0 24 24\",...a}){return o(\"svg\",{...a,class:t,\"aria-hidden\":\"true\",xmlns:\"http://www.w3.org/2000/svg\",width:n,height:r,viewBox:i,fill:\"none\",stroke:\"currentColor\",\"stroke-width\":\"2\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\",children:e})}function Ie(t){return o(P,{...t,children:o(\"path\",{d:\"m6 9 6 6 6-6\"})})}function Fe({class:t}){return o(P,{class:t,children:[o(\"path\",{d:\"M15 3h6v6\"}),o(\"path\",{d:\"M10 14 21 3\"}),o(\"path\",{d:\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\"})]})}function Me(t){return o(P,{...t,children:[o(\"path\",{d:\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\"}),o(\"path\",{d:\"M14 2v4a2 2 0 0 0 2 2h4\"}),o(\"path\",{d:\"M12 18v-6\"}),o(\"path\",{d:\"m9 15 3 3 3-3\"})]})}function X(t){return o(P,{...t,children:[o(\"path\",{d:\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\"}),o(\"path\",{d:\"M14 2v4a2 2 0 0 0 2 2h4\"})]})}function Y(t){return o(P,{...t,children:o(\"path\",{d:\"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 0-1.69.9L9.6 8H4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2Z\"})})}function Ae({class:t,...e}){return o(P,{class:t,...e,children:o(\"path\",{d:\"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z\"})})}function Le({class:t,...e}){return o(P,{class:t,...e,children:[o(\"polyline\",{points:\"7 8 3 12 7 16\"}),o(\"line\",{x1:\"21\",x2:\"11\",y1:\"12\",y2:\"12\"}),o(\"line\",{x1:\"21\",x2:\"11\",y1:\"6\",y2:\"6\"}),o(\"line\",{x1:\"21\",x2:\"11\",y1:\"18\",y2:\"18\"})]})}function Re({class:t,...e}){return o(P,{class:t,...e,children:o(\"path\",{d:\"M17 8L21 12L17 16M3 12H13M3 6H13M3 18H13\"})})}function De(t){return o(P,{...t,width:\"16\",height:\"16\",viewBox:\"0 0 16 16\",children:o(\"path\",{d:\"M6 13L10 3\",\"stroke-linecap\":\"round\"})})}function Ne({class:t,...e}){return o(P,{class:t,...e,children:[o(\"circle\",{cx:\"12\",cy:\"12\",r:\"4\"}),o(\"path\",{d:\"M12 2v2\"}),o(\"path\",{d:\"M12 20v2\"}),o(\"path\",{d:\"m4.93 4.93 1.41 1.41\"}),o(\"path\",{d:\"m17.66 17.66 1.41 1.41\"}),o(\"path\",{d:\"M2 12h2\"}),o(\"path\",{d:\"M20 12h2\"}),o(\"path\",{d:\"m6.34 17.66-1.41 1.41\"}),o(\"path\",{d:\"m19.07 4.93-1.41 1.41\"})]})}function Be({class:t,...e}){return o(P,{class:t,...e,children:[o(\"path\",{d:\"M12 2v2\"}),o(\"path\",{d:\"M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715\"}),o(\"path\",{d:\"M16 12a4 4 0 0 0-4-4\"}),o(\"path\",{d:\"m19 5-1.256 1.256\"}),o(\"path\",{d:\"M20 12h2\"})]})}var He={dirItem:\"inline-flex items-center shrink-0\",dirLink:\"text-sm text-muted-foreground hover:text-foreground\",fileItem:\"inline-flex items-center text-sm font-semibold text-foreground truncate\"},In=\"shrink-0 mx-1 size-4 text-muted-foreground\";function It({items:t}){return o(\"nav\",{\"aria-label\":\"Breadcrumb\",children:o(\"ol\",{class:\"flex items-center min-w-0\",children:t.map((e,n)=>{let r=n===t.length-1;return o(\"li\",{class:r?He.fileItem:He.dirItem,\"aria-current\":r?\"page\":void 0,children:r?e.label:o(k,{children:[o(\"a\",{class:He.dirLink,href:e.href??\"#\",children:e.label}),o(De,{class:In})]})},n)})})})}function Ft({href:t}){return o(\"a\",{href:t,target:\"_blank\",rel:\"noopener noreferrer\",class:\"shrink-0 w-7 h-7 inline-flex justify-center items-center rounded-lg text-muted-foreground hover:text-foreground cursor-pointer\",\"aria-label\":\"Open in new tab\",children:o(Fe,{class:\"size-4\"})})}function Mt(){return o(\"button\",{type:\"button\",id:\"theme-toggle\",class:\"shrink-0 w-7 h-7 inline-flex justify-center items-center rounded-lg text-muted-foreground hover:text-foreground cursor-pointer\",\"aria-label\":\"Toggle theme\",children:[o(Ne,{class:\"hidden size-4\",id:\"icon-theme-light\"}),o(Ae,{class:\"hidden size-4\",id:\"icon-theme-dark\"}),o(Be,{class:\"hidden size-4\",id:\"icon-theme-system\"})]})}function At({id:t,breadcrumbs:e,showSidebarToggle:n,onToggleSidebar:r,externalLinkHref:i,actions:a}){return o(\"header\",{id:t,class:\"sticky top-0 z-50 bg-background border-b border-border\",children:o(\"div\",{class:\"flex items-center justify-between w-full py-2 px-2 sm:px-5\",children:[o(\"div\",{class:\"flex items-center gap-1 min-w-0\",children:[n&&o(\"button\",{type:\"button\",id:\"sidebar-toggle\",onClick:r,class:\"shrink-0 w-7 h-7 inline-flex justify-center items-center rounded-lg text-muted-foreground hover:bg-sidebar-accent cursor-pointer\",children:[o(Re,{class:\"shrink-0 size-4\",id:\"icon-sidebar-open\"}),o(Le,{class:\"shrink-0 size-4 hidden\",id:\"icon-sidebar-close\"})]}),o(It,{items:e})]}),o(\"div\",{class:\"flex items-center gap-1\",children:[a,o(Mt,{}),i!==void 0&&o(Ft,{href:i})]})]})})}var Fn=new Map([[\".md\",\"markdown\"],[\".html\",\"html\"],[\".htm\",\"html\"]]);function Oe(t){let e=Math.max(t.lastIndexOf(\"/\"),t.lastIndexOf(\"\\\\\")),n=e===-1?t:t.slice(e+1),r=n.lastIndexOf(\".\");return r===-1||r===n.length-1?\"\":n.slice(r).toLowerCase()}function de(t){return Fn.get(Oe(t))??null}function Lt(t,e){return t.name.toLowerCase().includes(e)}function $(t,e){for(let n of t)if(n.type===\"directory\"&&e.startsWith(`${n.path}/`))return[n.path,...$(n.children??[],e)];return[]}function Rt(t,e){let n=e.trim().toLowerCase();return n===\"\"?t:Dt(t,n)}function Dt(t,e){let n=[];for(let r of t){if(r.type===\"directory\"){if(Lt(r,e)){n.push(r);continue}let i=r.children?Dt(r.children,e):[];i.length>0&&n.push({...r,children:i});continue}Lt(r,e)&&n.push(r)}return n}var Ue=200;function Mn(t){let e=t.slice(t.lastIndexOf(\"/\")+1),n=Oe(e);return n===\"\"?e:e.slice(0,-n.length)}function An(t,e){return t===null?e:t.slice(t.lastIndexOf(\"/\")+1)}function Bt(t){return t===0?\"empty\":t>Ue?\"too-many\":\"ok\"}function Ht(t){return t.flatMap(e=>e.type===\"directory\"?Ht(e.children??[]):de(e.path)===\"markdown\"?[e.path]:[])}function Ot(t,e){for(let n of t)if(n.type===\"directory\"){if(n.path===e)return n.children??[];if(e.startsWith(`${n.path}/`))return Ot(n.children??[],e)}}function Ln(t,e){let n=e===null?t:Ot(t,e);return n&&Ht(n)}function Nt(t,e,n){return{path:e,name:An(e,n),markdownFileCount:Ln(t,e)?.length??0}}function Ut(t,e,n){return[Nt(t,null,n),...$(t,e).map(r=>Nt(t,r,n))]}function $t(t,e){return{url:e===\"html\"?ce(t):kt(t),title:Mn(t)}}function jt(t){return{url:Et(t.path),title:t.name}}function qt(t,e,n){switch(t){case\"Escape\":return{type:\"close\",returnFocus:!0};case\"Tab\":return{type:\"close\",returnFocus:!1}}if(n!==0)switch(t){case\"ArrowDown\":return{type:\"focus\",index:e<0?0:(e+1)%n};case\"ArrowUp\":return{type:\"focus\",index:e<0?n-1:(e-1+n)%n};case\"Home\":return{type:\"focus\",index:0};case\"End\":return{type:\"focus\",index:n-1};default:return}}var Rn=\"flex items-center gap-x-3 w-full py-2 px-3 text-left text-sm text-foreground rounded-md enabled:cursor-pointer enabled:hover:bg-sidebar-accent focus-visible:bg-sidebar-accent disabled:opacity-50\";function Dn(t){switch(Bt(t)){case\"empty\":return{description:\"No Markdown files\",disabled:!0};case\"too-many\":return{description:`More than ${Ue} Markdown files`,disabled:!0};case\"ok\":return{description:`${t} Markdown file${t===1?\"\":\"s\"}`,disabled:!1}}}function Nn({icon:t,label:e,description:n,disabled:r,onSelect:i}){return o(\"button\",{type:\"button\",role:\"menuitem\",disabled:r,onClick:i,class:Rn,children:[t,o(\"span\",{class:\"min-w-0 flex-1\",children:[o(\"span\",{class:\"block truncate\",children:e}),o(\"span\",{class:\"block text-xs text-muted-foreground\",children:n})]})]})}function Bn({currentPath:t,currentName:e,contentType:n,directories:r}){return[{kind:\"file\",key:`file:${t}`,label:e,description:\"This file\",disabled:!1,request:$t(t,n)},...r.map(i=>({kind:\"directory\",key:`dir:${i.path??\"\"}`,label:i.name,...Dn(i.markdownFileCount),request:jt(i)}))]}function Wt({onPrint:t,...e}){let[n,r]=C(!1),i=E(null),a=E(null),l=E(null),s=()=>Array.from(l.current?.querySelectorAll(\"[role=menuitem]:not(:disabled)\")??[]);A(()=>{if(!n)return;s()[0]?.focus();let p=c=>{i.current?.contains(c.target)||r(!1)},m=()=>r(!1);return document.addEventListener(\"pointerdown\",p),window.addEventListener(\"blur\",m),()=>{document.removeEventListener(\"pointerdown\",p),window.removeEventListener(\"blur\",m)}},[n]);let d=()=>{r(!1),a.current?.focus()},f=p=>{d(),t(p)};return o(\"div\",{ref:i,class:\"relative\",children:[o(\"button\",{ref:a,type:\"button\",id:\"pdf-menu-button\",\"aria-label\":\"Save as PDF\",\"aria-haspopup\":\"menu\",\"aria-expanded\":n,\"aria-controls\":n?\"pdf-menu\":void 0,onClick:()=>r(p=>!p),onKeyDown:p=>{(p.key===\"ArrowDown\"||p.key===\"ArrowUp\")&&(p.preventDefault(),r(!0))},class:\"shrink-0 w-7 h-7 inline-flex justify-center items-center rounded-lg text-muted-foreground hover:text-foreground cursor-pointer\",children:o(Me,{class:\"size-4\"})}),n&&o(\"div\",{ref:l,id:\"pdf-menu\",role:\"menu\",\"aria-labelledby\":\"pdf-menu-button\",onKeyDown:p=>{let m=s(),c=qt(p.key,m.indexOf(document.activeElement),m.length);if(c){if(c.type===\"focus\")m[c.index]?.focus();else if(c.returnFocus)d();else{r(!1);return}p.preventDefault()}},class:\"absolute end-0 top-full mt-1 z-60 w-64 max-w-[calc(100vw-1rem)] p-1 bg-background border border-muted-foreground/25 rounded-lg shadow-lg\",children:[o(\"p\",{\"aria-hidden\":\"true\",class:\"px-3 pt-1.5 pb-1 text-xs font-medium text-muted-foreground\",children:\"Save as PDF\"}),Bn(e).map(p=>o(k,{children:[o(Nn,{icon:p.kind===\"file\"?o(X,{class:\"shrink-0 size-4\"}):o(Y,{class:\"shrink-0 size-4\"}),label:p.label,description:p.description,disabled:p.disabled,onSelect:()=>f(p.request)}),p.kind===\"file\"&&o(\"hr\",{class:\"my-1 border-border\"})]},p.key))]})]})}var Hn=20;function On({node:t,currentPath:e,depth:n,isOpen:r,onToggle:i}){let a=r(t.path);return o(\"li\",{class:n===0?\"px-2 lg:px-5\":\"\",children:[o(\"button\",{type:\"button\",\"aria-expanded\":a,onClick:()=>i?.(t.path),class:\"flex items-center gap-x-3 w-full py-2 px-3 text-left text-sm text-sidebar-foreground hover:bg-sidebar-accent rounded-lg overflow-hidden\",children:[o(Y,{class:\"shrink-0 size-4\"}),o(\"span\",{class:\"min-w-0 truncate\",children:t.name}),o(Ie,{class:`${a?\"\":\"-rotate-90 \"}shrink-0 size-3.5 ms-auto transition-transform`})]}),a&&o(\"ul\",{class:\"ps-7 mt-1 flex flex-col gap-y-1 relative before:absolute before:top-0 before:start-[1.125rem] before:w-px before:h-full before:bg-sidebar-border\",children:t.children&&n<Hn?o($e,{nodes:t.children,currentPath:e,depth:n+1,isOpen:r,onToggle:i}):null})]})}function $e({nodes:t,currentPath:e,depth:n=0,isOpen:r,onToggle:i}){return o(k,{children:t.map(a=>{if(a.type===\"directory\")return o(On,{node:a,currentPath:e,depth:n,isOpen:r,onToggle:i},a.path);let l=e===a.path;return o(\"li\",{class:n===0?\"px-2 lg:px-5\":\"\",children:o(\"a\",{href:`/view?path=${encodeURIComponent(a.path)}`,class:`flex items-center gap-x-3 py-2 px-3 text-sm rounded-lg overflow-hidden ${l?\"bg-sidebar-accent text-sidebar-primary font-medium\":\"hover:bg-sidebar-accent text-sidebar-foreground\"}`,children:[o(X,{class:\"shrink-0 size-4\"}),o(\"span\",{class:\"min-w-0 truncate\",children:a.name})]})},a.path)})})}function zt({nodes:t,currentPath:e,isOpen:n,onToggle:r}){return o(\"ul\",{id:\"file-tree\",class:\"flex flex-col gap-y-1\",children:o($e,{nodes:t,currentPath:e,isOpen:n,onToggle:r})})}function Kt({title:t,tree:e,currentPath:n,onClose:r,isOpen:i,onToggle:a,searchQuery:l,onSearchChange:s,isSearching:d}){return o(k,{children:[o(\"div\",{role:\"none\",id:\"sidebar-overlay\",class:\"fixed inset-0 z-50 bg-black/50 hidden\",onClick:r}),o(\"aside\",{id:\"sidebar\",\"aria-label\":\"File navigation\",class:\"fixed inset-y-0 start-0 z-60 w-72 lg:w-auto overflow-hidden bg-sidebar border-e border-sidebar-border -translate-x-full\",children:[o(\"div\",{class:\"relative flex flex-col h-full max-h-full pt-3\",children:[o(\"header\",{class:\"flex-none h-11.5 ps-5 pe-2 lg:ps-8 flex items-center\",children:o(\"a\",{href:\"/\",class:\"flex-none text-sm font-semibold text-sidebar-foreground hover:text-sidebar-primary\",children:t})}),o(\"div\",{class:\"flex-none px-2 lg:px-5 mt-1.5 mb-1\",children:o(\"input\",{id:\"sidebar-search\",type:\"search\",\"aria-label\":\"Search files\",placeholder:\"Search files\\u2026\",value:l??\"\",onInput:f=>s?.(f.target.value),onKeyDown:f=>{f.key===\"Escape\"&&!f.isComposing&&(s?.(\"\"),f.currentTarget.blur())},class:\"w-full py-1.5 px-3 text-sm text-sidebar-foreground bg-sidebar-accent border border-sidebar-border rounded-lg outline-none focus:border-sidebar-primary placeholder:text-sidebar-foreground/50\"})}),o(\"div\",{class:\"flex-1 min-h-0 overflow-x-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-none [&::-webkit-scrollbar-track]:bg-scrollbar-track [&::-webkit-scrollbar-thumb]:bg-scrollbar-thumb\",children:o(\"nav\",{class:\"pb-3 w-full flex flex-col\",children:d&&e.length===0?o(\"p\",{class:\"px-5 py-3 text-sm text-sidebar-foreground/60\",children:\"No matches found\"}):o(zt,{nodes:e,currentPath:n,isOpen:i,onToggle:a})})})]}),o(\"div\",{id:\"sidebar-resize\",class:\"absolute inset-y-0 end-0 w-1 cursor-col-resize hover:bg-sidebar-border hidden lg:block pointer-events-auto\"})]})]})}function Xt(t,e){return{expanded:new Set,revealed:new Set($(t,e))}}function je(t,e){return t.expanded.has(e)||t.revealed.has(e)}function Yt(t,e,n){return je(t,n)?{expanded:Vt(t.expanded,n),revealed:Vt(t.revealed,n)}:{expanded:new Set([...t.expanded,...$(e,n),n]),revealed:t.revealed}}function Qt(t,e,n){return{expanded:t.expanded,revealed:new Set([...t.revealed,...$(e,n)])}}function Vt(t,e){let n=new Set(t);return n.delete(e),n}var qe=\"file-tree-state\";function Zt(t){if(!t)return{};try{let e=JSON.parse(t);if(!e||typeof e!=\"object\"||Array.isArray(e))return{};let n={};for(let[r,i]of Object.entries(e)){if(!i||typeof i!=\"object\"||Array.isArray(i))continue;let{expanded:a,lastAccess:l}=i;typeof l!=\"number\"||!Array.isArray(a)||(n[r]={expanded:a.filter(s=>typeof s==\"string\"),lastAccess:l})}return n}catch{return{}}}function Jt(t,e,n){let r={};for(let[i,a]of Object.entries(t))e-a.lastAccess<=n&&(r[i]=a);return r}function Gt(t,e){return new Set(t[e]?.expanded??[])}function We(t,e,n,r){return{...t,[e]:{expanded:Array.from(n),lastAccess:r}}}function en(t){return JSON.stringify(t)}function tn(t,e,n){let[r,i]=C(()=>Xt(e,n)),a=E(!0),l=E(e);l.current=e;let s=E(r);s.current=r;function d(_){s.current=_,i(_)}function f(){try{return Zt(localStorage.getItem(qe))}catch{return{}}}function u(_){try{localStorage.setItem(qe,en(_))}catch{}}le(()=>{if(!a.current)return;a.current=!1;let _=Date.now(),b=Jt(f(),_,2592e6),y=Gt(b,t);u(We(b,t,y,_)),d({...s.current,expanded:y})},[t]);let p=L(_=>{let b=Yt(s.current,l.current,_);d(b),u(We(f(),t,b.expanded,Date.now()))},[t]),m=L(_=>{d(Qt(s.current,l.current,_))},[]);return{isOpen:L(_=>je(r,_),[r]),toggle:p,reveal:m}}async function Q(t,e){try{let n=t?`/api/content?path=${encodeURIComponent(t)}`:\"/api/content\",r=await fetch(n,e?.signal?{signal:e.signal}:void 0);return r.ok?await r.text():(console.error(`[peek] Failed to fetch content: HTTP ${r.status}`),null)}catch(n){if(n instanceof DOMException&&n.name===\"AbortError\")throw n;return console.error(\"[peek] Failed to fetch content:\",n),null}}async function nn(t){try{let e=await fetch(\"/api/tree\",t?.signal?{signal:t.signal}:void 0);if(!e.ok)return console.error(`[peek] Failed to fetch tree: HTTP ${e.status}`),null;let n=await e.json();return Array.isArray(n)?n:(console.error(\"[peek] Unexpected tree response format\"),null)}catch(e){if(e instanceof DOMException&&e.name===\"AbortError\")throw e;return console.error(\"[peek] Failed to fetch tree:\",e),null}}function pe(t){let n=t.replace(/\\/+$/,\"\").split(\"/\");return n[n.length-1]||t}function rn(t){let e=E(null),n=E(t);n.current=t;let r=L(async(i,a)=>{e.current&&e.current.abort();let l=new AbortController;e.current=l;try{let s=await Q(i,{signal:l.signal});if(s===null)return;n.current(i,s),document.title=`${pe(i)} - peek`;let d=`/view?path=${encodeURIComponent(i)}`;a&&history.pushState({path:i},\"\",d)}catch(s){if(s instanceof DOMException&&s.name===\"AbortError\")return;console.error(\"[peek] Failed to navigate:\",s)}},[]);return A(()=>{let i=new URLSearchParams(window.location.search).get(\"path\");i&&history.replaceState({path:i},\"\");function a(s){if(s.ctrlKey||s.metaKey||s.shiftKey||s.altKey)return;let d=s.target.closest(\"a[href]\");if(!d)return;let f;try{f=new URL(d.href,window.location.origin)}catch{return}if(f.origin!==window.location.origin||f.pathname!==\"/view\")return;let u=f.searchParams.get(\"path\");u&&(s.preventDefault(),r(u,!0))}function l(s){let f=s.state?.path??new URLSearchParams(window.location.search).get(\"path\");f?r(f,!1):window.location.reload()}return document.addEventListener(\"click\",a),window.addEventListener(\"popstate\",l),()=>{document.removeEventListener(\"click\",a),window.removeEventListener(\"popstate\",l)}},[r]),r}var $n=\"sidebar-search\";function jn(t){if(!(t instanceof HTMLElement))return!1;let e=t.tagName;return e===\"INPUT\"||e===\"TEXTAREA\"||e===\"SELECT\"||t.isContentEditable}function on(t){A(()=>{function e(n){n.key===\"/\"&&(n.isComposing||jn(n.target)||(n.preventDefault(),t?.(),document.getElementById($n)?.focus()))}return window.addEventListener(\"keydown\",e),()=>window.removeEventListener(\"keydown\",e)},[t])}var fe=\"sidebar-open\",an=\"sidebar-width\",ze=200,Ke=480,qn=1024;function _e(){return window.innerWidth>=qn}function sn(){let[t,e]=C(!1),n=E(!0);le(()=>{if(n.current){n.current=!1;let l=localStorage.getItem(an);if(l){let s=Number(l);s>=ze&&s<=Ke&&document.documentElement.style.setProperty(\"--sidebar-width\",`${s}px`)}if(_e()&&localStorage.getItem(fe)!==\"false\"){let s=[document.getElementById(\"sidebar\"),document.getElementById(\"header-bar\"),document.getElementById(\"main-content\")];for(let d of s)d&&(d.style.transition=\"none\");document.body.setAttribute(\"data-sidebar-open\",\"\"),document.body.offsetHeight,requestAnimationFrame(()=>{for(let d of s)d&&d.style.removeProperty(\"transition\")}),e(!0)}return}t?document.body.setAttribute(\"data-sidebar-open\",\"\"):document.body.removeAttribute(\"data-sidebar-open\")},[t]),A(()=>{let l=document.getElementById(\"sidebar-resize\");if(!l)return;let s=d=>{d.preventDefault(),l.setPointerCapture(d.pointerId);let f=document.getElementById(\"sidebar\");document.body.style.setProperty(\"user-select\",\"none\"),f?.style.setProperty(\"transition\",\"none\");function u(m){let c=Math.min(Math.max(m.clientX,ze),Ke);document.documentElement.style.setProperty(\"--sidebar-width\",`${c}px`)}let p=m=>{if(l.releasePointerCapture(m.pointerId),l.removeEventListener(\"pointermove\",u),l.removeEventListener(\"pointerup\",p),l.removeEventListener(\"pointercancel\",p),document.body.style.removeProperty(\"user-select\"),f?.style.removeProperty(\"transition\"),m.type===\"pointerup\"){let c=Math.min(Math.max(m.clientX,ze),Ke);localStorage.setItem(an,String(c))}};l.addEventListener(\"pointermove\",u),l.addEventListener(\"pointerup\",p),l.addEventListener(\"pointercancel\",p)};return l.addEventListener(\"pointerdown\",s),()=>l.removeEventListener(\"pointerdown\",s)},[]);let r=L(()=>{e(l=>{let s=!l;return _e()&&localStorage.setItem(fe,String(s)),s})},[]),i=L(()=>{e(!1),_e()&&localStorage.setItem(fe,\"false\")},[]),a=L(()=>{e(!0),_e()&&localStorage.setItem(fe,\"true\")},[]);return{toggle:r,close:i,open:a}}var Ve=\"[peek]\",Xe={info:(...t)=>console.log(Ve,...t),warn:(...t)=>console.warn(Ve,...t),error:(...t)=>console.error(Ve,...t)};function Vn(t){let e;try{e=JSON.parse(t)}catch{return null}if(!e||typeof e!=\"object\")return null;let n=e;return typeof n.path!=\"string\"?null:{path:n.path}}function ln(t){let e=0,n=null,r=null,i=null;function a(){r&&(clearTimeout(r),r=null);let l=new EventSource(\"/sse\");if(i=l,l.addEventListener(\"file-changed\",s=>{let d=Vn(s.data);t.onFileChanged(d?d.path:null)}),t.onTreeChanged){let s=t.onTreeChanged;l.addEventListener(\"tree-changed\",()=>{s()})}l.onerror=()=>{if(l.close(),i=null,r&&(clearTimeout(r),r=null),e++,e>10){Xe.warn(`SSE connection lost after ${10} retries, giving up.`);return}let s=Math.min(1e3*2**(e-1),3e4);Xe.info(`SSE reconnecting in ${s}ms (${e}/${10})...`),n=setTimeout(a,s)},r=setTimeout(()=>{e=0,r=null},5e3)}return a(),()=>{n&&clearTimeout(n),r&&clearTimeout(r),i&&i.close()}}function me(t){let{onContentUpdate:e,getCurrentPath:n,getCurrentContentType:r,onHtmlReload:i,onTreeUpdate:a}=t;A(()=>{let l=null,s=null,d=ln({onFileChanged:f=>{if(n){if(f===null)return;let u=n();if(f!==u)return;if(r?.()===\"html\"){i?.();return}l?.abort(),l=new AbortController,Q(u,{signal:l.signal}).then(p=>{p!==null&&e(p)}).catch(p=>{p instanceof DOMException&&p.name===\"AbortError\"||console.error(\"[peek] Failed to refresh content:\",p)})}else l?.abort(),l=new AbortController,Q(void 0,{signal:l.signal}).then(u=>{u!==null&&e(u)}).catch(u=>{u instanceof DOMException&&u.name===\"AbortError\"||console.error(\"[peek] Failed to refresh content:\",u)})},onTreeChanged:a?()=>{s?.abort(),s=new AbortController,nn({signal:s.signal}).then(f=>{f&&a(f)}).catch(f=>{f instanceof DOMException&&f.name===\"AbortError\"||console.error(\"[peek] Failed to refresh tree:\",f)})}:void 0});return()=>{l?.abort(),s?.abort(),d()}},[])}function Xn(t,e,n){let r=n(t);return r?(r.addEventListener(\"load\",()=>{r.document.contentType===\"text/html\"&&(r.document.title=e,r.addEventListener(\"afterprint\",()=>r.close(),{once:!0}),r.print())},{once:!0}),!0):!1}var Yn=\"Pop-ups are blocked. Allow pop-ups for this site to save as PDF.\";function cn({url:t,title:e},n){Xn(t,e,r=>n.open(r,\"_blank\"))||n.alert(Yn)}function un({projectId:t,dirTitle:e,currentPath:n,contentType:r,content:i,tree:a}){let[l,s]=C(n),[d,f]=C(r),[u,p]=C(i),[m,c]=C(a),[_,b]=C(\"\"),[y,v]=C(0),h=E(l);h.current=l;let x=sn(),S=tn(t,m,n),B=_.trim()!==\"\",Z=V(()=>Rt(m,_),[m,_]);on(x.open),rn((T,D)=>{let F=de(T);if(!F){console.error(`Unexpected unsupported file type: ${T}`);return}h.current=T,s(T),f(F),p(D),v(0),S.reveal(T)});let q=E(d);q.current=d,me({getCurrentPath:()=>h.current,getCurrentContentType:()=>q.current,onContentUpdate:p,onHtmlReload:()=>v(T=>T+1),onTreeUpdate:c});let R=V(()=>Ut(m,l,e),[m,l,e]),j=pe(l);return o(k,{children:[o(Kt,{title:e,tree:Z,currentPath:l,onClose:x.close,isOpen:B?()=>!0:S.isOpen,onToggle:B?void 0:S.toggle,searchQuery:_,onSearchChange:b,isSearching:B}),o(At,{id:\"header-bar\",breadcrumbs:[{label:e,href:\"/\"},{label:j}],showSidebarToggle:!0,onToggleSidebar:x.toggle,externalLinkHref:`/${Ee(l)}`,actions:o(Wt,{currentPath:l,currentName:j,contentType:d,directories:R,onPrint:T=>cn(T,window)})}),o(Ct,{contentType:d,fileTitle:j,filePath:l,htmlContent:u,htmlReloadKey:y})]})}function dn({content:t}){let[e,n]=C(t);return me({onContentUpdate:n}),o(\"main\",{class:\"px-2 sm:px-5 py-5 sm:py-15\",children:o(\"div\",{class:\"max-w-4xl mx-auto\",children:o(ue,{htmlContent:e})})})}var Je=\"theme\";function Qe(){let t=localStorage.getItem(Je);return t===\"light\"||t===\"dark\"?t:\"system\"}function Ze(t){let e=document.documentElement;t===\"dark\"?e.classList.add(\"dark\"):t===\"light\"?e.classList.remove(\"dark\"):window.matchMedia(\"(prefers-color-scheme: dark)\").matches?e.classList.add(\"dark\"):e.classList.remove(\"dark\")}function pn(t){let e=document.getElementById(\"icon-theme-light\"),n=document.getElementById(\"icon-theme-dark\"),r=document.getElementById(\"icon-theme-system\");!e||!n||!r||(e.classList.add(\"hidden\"),n.classList.add(\"hidden\"),r.classList.add(\"hidden\"),t===\"light\"?e.classList.remove(\"hidden\"):t===\"dark\"?n.classList.remove(\"hidden\"):r.classList.remove(\"hidden\"))}function Qn(t){return t===\"light\"?\"dark\":t===\"dark\"?\"system\":\"light\"}function fn(){let t=Qe();Ze(t),pn(t);let e=document.getElementById(\"theme-toggle\");e&&e.addEventListener(\"click\",()=>{let n=Qn(Qe());n===\"system\"?localStorage.removeItem(Je):localStorage.setItem(Je,n),Ze(n),pn(n)}),window.matchMedia(\"(prefers-color-scheme: dark)\").addEventListener(\"change\",()=>{Qe()===\"system\"&&Ze(\"system\")})}var he=window.__INITIAL_STATE__,Ge=document.getElementById(\"app\");Ge&&he?he.mode===\"directory\"?Pe(o(un,{...he}),Ge):Pe(o(dn,{...he}),Ge):console.error(\"[peek] hydration failed: missing #app or initial state\");fn();})();\n";
1299
1299
  // src/server/renderer/global.css?inline
1300
1300
  var global_default = "/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */\n@layer properties {\n @supports (((-webkit-hyphens: none)) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {\n *, :before, :after, ::backdrop {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-translate-z: 0;\n --tw-rotate-x: initial;\n --tw-rotate-y: initial;\n --tw-rotate-z: initial;\n --tw-skew-x: initial;\n --tw-skew-y: initial;\n --tw-border-style: solid;\n --tw-font-weight: initial;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-color: initial;\n --tw-shadow-alpha: 100%;\n --tw-inset-shadow: 0 0 #0000;\n --tw-inset-shadow-color: initial;\n --tw-inset-shadow-alpha: 100%;\n --tw-ring-color: initial;\n --tw-ring-shadow: 0 0 #0000;\n --tw-inset-ring-color: initial;\n --tw-inset-ring-shadow: 0 0 #0000;\n --tw-ring-inset: initial;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-blur: initial;\n --tw-brightness: initial;\n --tw-contrast: initial;\n --tw-grayscale: initial;\n --tw-hue-rotate: initial;\n --tw-invert: initial;\n --tw-opacity: initial;\n --tw-saturate: initial;\n --tw-sepia: initial;\n --tw-drop-shadow: initial;\n --tw-drop-shadow-color: initial;\n --tw-drop-shadow-alpha: 100%;\n --tw-drop-shadow-size: initial;\n --tw-ease: initial;\n --tw-content: \"\";\n }\n }\n}\n\n@layer theme {\n :root, :host {\n --font-sans: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";\n --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n --color-black: #000;\n --spacing: .25rem;\n --container-4xl: 56rem;\n --text-xs: .75rem;\n --text-xs--line-height: calc(1 / .75);\n --text-sm: .875rem;\n --text-sm--line-height: calc(1.25 / .875);\n --font-weight-medium: 500;\n --font-weight-semibold: 600;\n --radius-md: .375rem;\n --radius-lg: .5rem;\n --radius-xl: .75rem;\n --ease-in-out: cubic-bezier(.4, 0, .2, 1);\n --animate-spin: spin 1s linear infinite;\n --animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;\n --default-transition-duration: .15s;\n --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);\n --default-font-family: var(--font-sans);\n --default-mono-font-family: var(--font-mono);\n --color-background: var(--background);\n --color-foreground: var(--foreground);\n --color-card: var(--card);\n --color-muted-foreground: var(--muted-foreground);\n --color-border: var(--border);\n --color-sidebar: var(--sidebar);\n --color-sidebar-foreground: var(--sidebar-foreground);\n --color-sidebar-primary: var(--sidebar-primary);\n --color-sidebar-accent: var(--sidebar-accent);\n --color-sidebar-border: var(--sidebar-border);\n --color-scrollbar-track: var(--scrollbar-track);\n --color-scrollbar-thumb: var(--scrollbar-thumb);\n }\n}\n\n@layer base {\n *, :after, :before, ::backdrop {\n box-sizing: border-box;\n border: 0 solid;\n margin: 0;\n padding: 0;\n }\n\n ::file-selector-button {\n box-sizing: border-box;\n border: 0 solid;\n margin: 0;\n padding: 0;\n }\n\n html, :host {\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n line-height: 1.5;\n font-family: var(--default-font-family, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n -webkit-tap-highlight-color: transparent;\n }\n\n hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n }\n\n abbr:where([title]) {\n text-decoration: underline dotted;\n }\n\n h1, h2, h3, h4, h5, h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n -webkit-text-decoration: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n\n b, strong {\n font-weight: bolder;\n }\n\n code, kbd, samp, pre {\n font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n }\n\n small {\n font-size: 80%;\n }\n\n sub, sup {\n vertical-align: baseline;\n font-size: 75%;\n line-height: 0;\n position: relative;\n }\n\n sub {\n bottom: -.25em;\n }\n\n sup {\n top: -.5em;\n }\n\n table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n }\n\n :-moz-focusring:where(:not(iframe)) {\n outline: auto;\n }\n\n progress {\n vertical-align: baseline;\n }\n\n summary {\n display: list-item;\n }\n\n ol, ul, menu {\n list-style: none;\n }\n\n img, svg, video, canvas, audio, iframe, embed, object {\n vertical-align: middle;\n display: block;\n }\n\n img, video {\n max-width: 100%;\n height: auto;\n }\n\n button, input, select, optgroup, textarea {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n opacity: 1;\n background-color: #0000;\n border-radius: 0;\n }\n\n ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n opacity: 1;\n background-color: #0000;\n border-radius: 0;\n }\n\n :where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n }\n\n :where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n }\n\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n\n ::placeholder {\n opacity: 1;\n }\n\n @supports (not ((-webkit-appearance: -apple-pay-button))) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: currentColor;\n }\n\n @supports (color: color-mix(in lab, red, red)) {\n ::placeholder {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n }\n\n textarea {\n resize: vertical;\n }\n\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n\n ::-webkit-date-and-time-value {\n min-height: 1lh;\n text-align: inherit;\n }\n\n ::-webkit-datetime-edit {\n display: inline-flex;\n }\n\n ::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n }\n\n ::-webkit-datetime-edit {\n padding-block: 0;\n }\n\n ::-webkit-datetime-edit-year-field {\n padding-block: 0;\n }\n\n ::-webkit-datetime-edit-month-field {\n padding-block: 0;\n }\n\n ::-webkit-datetime-edit-day-field {\n padding-block: 0;\n }\n\n ::-webkit-datetime-edit-hour-field {\n padding-block: 0;\n }\n\n ::-webkit-datetime-edit-minute-field {\n padding-block: 0;\n }\n\n ::-webkit-datetime-edit-second-field {\n padding-block: 0;\n }\n\n ::-webkit-datetime-edit-millisecond-field {\n padding-block: 0;\n }\n\n ::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n }\n\n ::-webkit-calendar-picker-indicator {\n line-height: 1;\n }\n\n :-moz-ui-invalid {\n box-shadow: none;\n }\n\n button, input:where([type=\"button\"], [type=\"reset\"], [type=\"submit\"]) {\n appearance: button;\n }\n\n ::file-selector-button {\n appearance: button;\n }\n\n ::-webkit-inner-spin-button {\n height: auto;\n }\n\n ::-webkit-outer-spin-button {\n height: auto;\n }\n\n [hidden]:where(:not([hidden=\"until-found\"])) {\n display: none !important;\n }\n}\n\n@layer components;\n\n@layer utilities {\n .pointer-events-auto {\n pointer-events: auto;\n }\n\n .collapse {\n visibility: collapse;\n }\n\n .visible {\n visibility: visible;\n }\n\n .absolute {\n position: absolute;\n }\n\n .fixed {\n position: fixed;\n }\n\n .relative {\n position: relative;\n }\n\n .sticky {\n position: sticky;\n }\n\n .inset-0 {\n inset: 0;\n }\n\n .inset-y-0 {\n inset-block: 0;\n }\n\n .start-0 {\n inset-inline-start: calc(var(--spacing) * 0);\n }\n\n .end-0 {\n inset-inline-end: calc(var(--spacing) * 0);\n }\n\n .top-0 {\n top: 0;\n }\n\n .top-full {\n top: 100%;\n }\n\n .z-50 {\n z-index: 50;\n }\n\n .z-60 {\n z-index: 60;\n }\n\n .container {\n width: 100%;\n }\n\n @media (width >= 40rem) {\n .container {\n max-width: 40rem;\n }\n }\n\n @media (width >= 48rem) {\n .container {\n max-width: 48rem;\n }\n }\n\n @media (width >= 64rem) {\n .container {\n max-width: 64rem;\n }\n }\n\n @media (width >= 80rem) {\n .container {\n max-width: 80rem;\n }\n }\n\n @media (width >= 96rem) {\n .container {\n max-width: 96rem;\n }\n }\n\n .mx-1 {\n margin-inline: var(--spacing);\n }\n\n .mx-auto {\n margin-inline: auto;\n }\n\n .my-1 {\n margin-block: var(--spacing);\n }\n\n .ms-auto {\n margin-inline-start: auto;\n }\n\n .mt-1 {\n margin-top: var(--spacing);\n }\n\n .mt-1\\.5 {\n margin-top: calc(var(--spacing) * 1.5);\n }\n\n .mb-1 {\n margin-bottom: var(--spacing);\n }\n\n .block {\n display: block;\n }\n\n .contents {\n display: contents;\n }\n\n .flex {\n display: flex;\n }\n\n .hidden {\n display: none;\n }\n\n .inline {\n display: inline;\n }\n\n .inline-flex {\n display: inline-flex;\n }\n\n .table {\n display: table;\n }\n\n .size-3\\.5 {\n width: calc(var(--spacing) * 3.5);\n height: calc(var(--spacing) * 3.5);\n }\n\n .size-4 {\n width: calc(var(--spacing) * 4);\n height: calc(var(--spacing) * 4);\n }\n\n .h-7 {\n height: calc(var(--spacing) * 7);\n }\n\n .h-11\\.5 {\n height: calc(var(--spacing) * 11.5);\n }\n\n .h-full {\n height: 100%;\n }\n\n .max-h-full {\n max-height: 100%;\n }\n\n .min-h-0 {\n min-height: 0;\n }\n\n .min-h-dvh {\n min-height: 100dvh;\n }\n\n .min-h-screen {\n min-height: 100vh;\n }\n\n .w-1 {\n width: var(--spacing);\n }\n\n .w-7 {\n width: calc(var(--spacing) * 7);\n }\n\n .w-64 {\n width: calc(var(--spacing) * 64);\n }\n\n .w-72 {\n width: calc(var(--spacing) * 72);\n }\n\n .w-full {\n width: 100%;\n }\n\n .max-w-4xl {\n max-width: var(--container-4xl);\n }\n\n .max-w-\\[calc\\(100vw-1rem\\)\\] {\n max-width: calc(100vw - 1rem);\n }\n\n .min-w-0 {\n min-width: 0;\n }\n\n .flex-1 {\n flex: 1;\n }\n\n .flex-none {\n flex: none;\n }\n\n .shrink-0 {\n flex-shrink: 0;\n }\n\n .border-collapse {\n border-collapse: collapse;\n }\n\n .-translate-x-full {\n --tw-translate-x: -100%;\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n\n .-rotate-90 {\n rotate: -90deg;\n }\n\n .transform {\n transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );\n }\n\n .animate-pulse {\n animation: var(--animate-pulse);\n }\n\n .animate-spin {\n animation: var(--animate-spin);\n }\n\n .cursor-col-resize {\n cursor: col-resize;\n }\n\n .cursor-pointer {\n cursor: pointer;\n }\n\n .resize {\n resize: both;\n }\n\n .break-before-page {\n break-before: page;\n }\n\n .flex-col {\n flex-direction: column;\n }\n\n .flex-wrap {\n flex-wrap: wrap;\n }\n\n .items-center {\n align-items: center;\n }\n\n .justify-between {\n justify-content: space-between;\n }\n\n .justify-center {\n justify-content: center;\n }\n\n .gap-1 {\n gap: var(--spacing);\n }\n\n .gap-x-3 {\n column-gap: calc(var(--spacing) * 3);\n }\n\n .gap-y-1 {\n row-gap: var(--spacing);\n }\n\n .truncate {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n }\n\n .overflow-hidden {\n overflow: hidden;\n }\n\n .overflow-x-hidden {\n overflow-x: hidden;\n }\n\n .overflow-y-auto {\n overflow-y: auto;\n }\n\n .rounded-lg {\n border-radius: var(--radius-lg);\n }\n\n .rounded-md {\n border-radius: var(--radius-md);\n }\n\n .rounded-xl {\n border-radius: var(--radius-xl);\n }\n\n .border {\n border-style: var(--tw-border-style);\n border-width: 1px;\n }\n\n .border-e {\n border-inline-end-style: var(--tw-border-style);\n border-inline-end-width: 1px;\n }\n\n .border-b {\n border-bottom-style: var(--tw-border-style);\n border-bottom-width: 1px;\n }\n\n .border-border {\n border-color: var(--color-border);\n }\n\n .border-muted-foreground\\/25 {\n border-color: var(--color-muted-foreground);\n }\n\n @supports (color: color-mix(in lab, red, red)) {\n .border-muted-foreground\\/25 {\n border-color: color-mix(in oklab, var(--color-muted-foreground) 25%, transparent);\n }\n }\n\n .border-sidebar-border {\n border-color: var(--color-sidebar-border);\n }\n\n .bg-background {\n background-color: var(--color-background);\n }\n\n .bg-black\\/50 {\n background-color: #00000080;\n }\n\n @supports (color: color-mix(in lab, red, red)) {\n .bg-black\\/50 {\n background-color: color-mix(in oklab, var(--color-black) 50%, transparent);\n }\n }\n\n .bg-card {\n background-color: var(--color-card);\n }\n\n .bg-sidebar {\n background-color: var(--color-sidebar);\n }\n\n .bg-sidebar-accent {\n background-color: var(--color-sidebar-accent);\n }\n\n .p-1 {\n padding: var(--spacing);\n }\n\n .px-2 {\n padding-inline: calc(var(--spacing) * 2);\n }\n\n .px-3 {\n padding-inline: calc(var(--spacing) * 3);\n }\n\n .px-5 {\n padding-inline: calc(var(--spacing) * 5);\n }\n\n .px-6 {\n padding-inline: calc(var(--spacing) * 6);\n }\n\n .py-1\\.5 {\n padding-block: calc(var(--spacing) * 1.5);\n }\n\n .py-2 {\n padding-block: calc(var(--spacing) * 2);\n }\n\n .py-3 {\n padding-block: calc(var(--spacing) * 3);\n }\n\n .py-5 {\n padding-block: calc(var(--spacing) * 5);\n }\n\n .py-8 {\n padding-block: calc(var(--spacing) * 8);\n }\n\n .ps-5 {\n padding-inline-start: calc(var(--spacing) * 5);\n }\n\n .ps-7 {\n padding-inline-start: calc(var(--spacing) * 7);\n }\n\n .pe-2 {\n padding-inline-end: calc(var(--spacing) * 2);\n }\n\n .pt-1\\.5 {\n padding-top: calc(var(--spacing) * 1.5);\n }\n\n .pt-3 {\n padding-top: calc(var(--spacing) * 3);\n }\n\n .pb-1 {\n padding-bottom: var(--spacing);\n }\n\n .pb-3 {\n padding-bottom: calc(var(--spacing) * 3);\n }\n\n .text-left {\n text-align: left;\n }\n\n .text-sm {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n }\n\n .text-xs {\n font-size: var(--text-xs);\n line-height: var(--tw-leading, var(--text-xs--line-height));\n }\n\n .font-medium {\n --tw-font-weight: var(--font-weight-medium);\n font-weight: var(--font-weight-medium);\n }\n\n .font-semibold {\n --tw-font-weight: var(--font-weight-semibold);\n font-weight: var(--font-weight-semibold);\n }\n\n .text-foreground {\n color: var(--color-foreground);\n }\n\n .text-muted-foreground {\n color: var(--color-muted-foreground);\n }\n\n .text-sidebar-foreground, .text-sidebar-foreground\\/60 {\n color: var(--color-sidebar-foreground);\n }\n\n @supports (color: color-mix(in lab, red, red)) {\n .text-sidebar-foreground\\/60 {\n color: color-mix(in oklab, var(--color-sidebar-foreground) 60%, transparent);\n }\n }\n\n .text-sidebar-primary {\n color: var(--color-sidebar-primary);\n }\n\n .italic {\n font-style: italic;\n }\n\n .shadow-2xs {\n --tw-shadow: 0 1px var(--tw-shadow-color, #0000000d);\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n\n .shadow-lg {\n --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, #0000001a), 0 4px 6px -4px var(--tw-shadow-color, #0000001a);\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n\n .blur {\n --tw-blur: blur(8px);\n filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );\n }\n\n .transition {\n transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n\n .transition-transform {\n transition-property: transform, translate, scale, rotate;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n\n .ease-in-out {\n --tw-ease: var(--ease-in-out);\n transition-timing-function: var(--ease-in-out);\n }\n\n .outline-none {\n --tw-outline-style: none;\n outline-style: none;\n }\n\n .\\[print-color-adjust\\:exact\\] {\n -webkit-print-color-adjust: exact;\n print-color-adjust: exact;\n }\n\n .placeholder\\:text-sidebar-foreground\\/50::placeholder {\n color: var(--color-sidebar-foreground);\n }\n\n @supports (color: color-mix(in lab, red, red)) {\n .placeholder\\:text-sidebar-foreground\\/50::placeholder {\n color: color-mix(in oklab, var(--color-sidebar-foreground) 50%, transparent);\n }\n }\n\n .before\\:absolute:before {\n content: var(--tw-content);\n position: absolute;\n }\n\n .before\\:start-\\[1\\.125rem\\]:before {\n content: var(--tw-content);\n inset-inline-start: 1.125rem;\n }\n\n .before\\:top-0:before {\n content: var(--tw-content);\n top: 0;\n }\n\n .before\\:h-full:before {\n content: var(--tw-content);\n height: 100%;\n }\n\n .before\\:w-px:before {\n content: var(--tw-content);\n width: 1px;\n }\n\n .before\\:bg-sidebar-border:before {\n content: var(--tw-content);\n background-color: var(--color-sidebar-border);\n }\n\n @media (hover: hover) {\n .hover\\:bg-sidebar-accent:hover {\n background-color: var(--color-sidebar-accent);\n }\n\n .hover\\:bg-sidebar-border:hover {\n background-color: var(--color-sidebar-border);\n }\n\n .hover\\:text-foreground:hover {\n color: var(--color-foreground);\n }\n\n .hover\\:text-sidebar-primary:hover {\n color: var(--color-sidebar-primary);\n }\n }\n\n .focus\\:border-sidebar-primary:focus {\n border-color: var(--color-sidebar-primary);\n }\n\n .focus-visible\\:bg-sidebar-accent:focus-visible {\n background-color: var(--color-sidebar-accent);\n }\n\n .enabled\\:cursor-pointer:enabled {\n cursor: pointer;\n }\n\n @media (hover: hover) {\n .enabled\\:hover\\:bg-sidebar-accent:enabled:hover {\n background-color: var(--color-sidebar-accent);\n }\n }\n\n .disabled\\:opacity-50:disabled {\n opacity: .5;\n }\n\n @media (width >= 40rem) {\n .sm\\:px-5 {\n padding-inline: calc(var(--spacing) * 5);\n }\n\n .sm\\:px-10 {\n padding-inline: calc(var(--spacing) * 10);\n }\n\n .sm\\:py-10 {\n padding-block: calc(var(--spacing) * 10);\n }\n\n .sm\\:py-15 {\n padding-block: calc(var(--spacing) * 15);\n }\n }\n\n @media (width >= 64rem) {\n .lg\\:block {\n display: block;\n }\n\n .lg\\:w-auto {\n width: auto;\n }\n\n .lg\\:px-5 {\n padding-inline: calc(var(--spacing) * 5);\n }\n\n .lg\\:ps-8 {\n padding-inline-start: calc(var(--spacing) * 8);\n }\n }\n\n .\\[\\&\\:\\:-webkit-scrollbar\\]\\:w-2::-webkit-scrollbar {\n width: calc(var(--spacing) * 2);\n }\n\n .\\[\\&\\:\\:-webkit-scrollbar-thumb\\]\\:rounded-none::-webkit-scrollbar-thumb {\n border-radius: 0;\n }\n\n .\\[\\&\\:\\:-webkit-scrollbar-thumb\\]\\:bg-scrollbar-thumb::-webkit-scrollbar-thumb {\n background-color: var(--color-scrollbar-thumb);\n }\n\n .\\[\\&\\:\\:-webkit-scrollbar-track\\]\\:bg-scrollbar-track::-webkit-scrollbar-track {\n background-color: var(--color-scrollbar-track);\n }\n}\n\n:root {\n --background: #fff;\n --foreground: #393a34;\n --card: #fff;\n --card-foreground: #393a34;\n --primary: #1c6b48;\n --primary-foreground: #fff;\n --muted: #f7f7f7;\n --muted-foreground: #6a737d;\n --border: #f0f0f0;\n --sidebar: #fff;\n --sidebar-foreground: #4e4f47;\n --sidebar-primary: #1c6b48;\n --sidebar-accent: #f7f7f7;\n --sidebar-accent-foreground: #393a34;\n --sidebar-border: #f0f0f0;\n --font-sans: ui-sans-serif, system-ui, sans-serif;\n --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n --scrollbar-track: #f7f7f7;\n --scrollbar-thumb: #393a3450;\n --radius: .5rem;\n}\n\n.dark {\n --background: #121212;\n --foreground: #dbd7caee;\n --card: #181818;\n --card-foreground: #dbd7caee;\n --primary: #4d9375;\n --primary-foreground: #121212;\n --muted: #181818;\n --muted-foreground: #959da5;\n --border: #191919;\n --sidebar: #121212;\n --sidebar-foreground: #bfbaaa;\n --sidebar-primary: #4d9375;\n --sidebar-accent: #181818;\n --sidebar-accent-foreground: #dbd7caee;\n --sidebar-border: #191919;\n --scrollbar-track: #181818;\n --scrollbar-thumb: #dedcd550;\n}\n\n#sidebar {\n transition: translate .3s;\n}\n\nbody[data-sidebar-open] #sidebar {\n translate: 0;\n}\n\nbody[data-sidebar-open] #sidebar-overlay {\n display: block;\n}\n\nbody[data-sidebar-open] #icon-sidebar-open {\n display: none;\n}\n\nbody[data-sidebar-open] #icon-sidebar-close {\n display: inline;\n}\n\n@media (width >= 1024px) {\n #sidebar {\n width: var(--sidebar-width, 18rem);\n }\n\n #header-bar, #main-content {\n transition: margin .3s;\n }\n\n body[data-sidebar-open] #sidebar-overlay {\n display: none;\n }\n\n body[data-sidebar-open] #header-bar, body[data-sidebar-open] #main-content {\n margin-inline-start: var(--sidebar-width, 18rem);\n }\n}\n\n@property --tw-translate-x {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n\n@property --tw-translate-y {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n\n@property --tw-translate-z {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n\n@property --tw-rotate-x {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-rotate-y {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-rotate-z {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-skew-x {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-skew-y {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-border-style {\n syntax: \"*\";\n inherits: false;\n initial-value: solid;\n}\n\n@property --tw-font-weight {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n\n@property --tw-shadow-color {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n\n@property --tw-inset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n\n@property --tw-inset-shadow-color {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-inset-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n\n@property --tw-ring-color {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n\n@property --tw-inset-ring-color {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-inset-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n\n@property --tw-ring-inset {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-ring-offset-width {\n syntax: \"<length>\";\n inherits: false;\n initial-value: 0;\n}\n\n@property --tw-ring-offset-color {\n syntax: \"*\";\n inherits: false;\n initial-value: #fff;\n}\n\n@property --tw-ring-offset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n\n@property --tw-blur {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-brightness {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-contrast {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-grayscale {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-hue-rotate {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-invert {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-opacity {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-saturate {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-sepia {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-drop-shadow {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-drop-shadow-color {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-drop-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n\n@property --tw-drop-shadow-size {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-ease {\n syntax: \"*\";\n inherits: false\n}\n\n@property --tw-content {\n syntax: \"*\";\n inherits: false;\n initial-value: \"\";\n}\n\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes pulse {\n 50% {\n opacity: .5;\n }\n}\n";
1301
1301
  // src/server/renderer/page-styles.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makuja/peek",
3
- "version": "1.12.2",
3
+ "version": "1.12.4",
4
4
  "description": "Markdown and HTML preview CLI with live reload",
5
5
  "type": "module",
6
6
  "bin": {
@@ -53,15 +53,14 @@
53
53
  "dependencies": {
54
54
  "@clack/prompts": "^1.0.1",
55
55
  "@hono/node-server": "^2.0.0",
56
- "@mdit/plugin-tasklist": "^0.23.1",
56
+ "@mdit/plugin-tasklist": "^1.0.0",
57
57
  "@shikijs/markdown-it": "^4.0.1",
58
58
  "gunshi": "^0.37.0",
59
59
  "hono": "^4.12.3",
60
60
  "ignore": "^7.0.5",
61
- "markdown-it": "^14.1.1",
62
61
  "markdown-it-async": "^2.2.0",
63
62
  "picocolors": "^1.1.1",
64
- "preact": "^10.28.4",
63
+ "preact": "^11.0.0",
65
64
  "preact-render-to-string": "^6.6.6",
66
65
  "shiki": "^4.0.1"
67
66
  },
@@ -71,10 +70,9 @@
71
70
  "@semantic-release/git": "^11.0.0",
72
71
  "@tailwindcss/postcss": "^4.2.1",
73
72
  "@tsdown/css": "0.23.7",
74
- "@types/markdown-it": "^14.1.2",
75
73
  "@types/node": "^26.0.0",
76
74
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
77
- "@vitest/coverage-v8": "^4.1.1",
75
+ "@vitest/coverage-v8": "^5.0.0",
78
76
  "esbuild": "^0.28.0",
79
77
  "postcss": "^8.5.6",
80
78
  "postcss-cli": "^12.0.0",
@@ -83,6 +81,6 @@
83
81
  "tsdown": "0.23.7",
84
82
  "tsx": "^4.21.0",
85
83
  "typescript": "^7.0.0",
86
- "vitest": "^4.0.18"
84
+ "vitest": "^5.0.0"
87
85
  }
88
86
  }