tencil 0.0.0-stage → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +172 -2
- package/THIRD_PARTY_NOTICES.md +16 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +1368 -0
- package/dist/index.d.mts +561 -0
- package/dist/index.mjs +2 -0
- package/dist/loader-BevujQ44.mjs +21 -0
- package/dist/overlay.global.js +611 -0
- package/dist/react.d.mts +17 -0
- package/dist/react.mjs +19 -0
- package/dist/server-PYBcw-eR.mjs +3205 -0
- package/dist/vite.d.mts +22 -0
- package/dist/vite.mjs +27 -0
- package/package.json +97 -3
|
@@ -0,0 +1,611 @@
|
|
|
1
|
+
(function(){var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},n,r,i,a,o,s,c,l,u,d,f,p,m,h={},g=[],_=/^m(i|n|o|s|text|space)$/,v=Array.isArray,y=g.slice,b=Object.assign;function ee(e){e&&e.parentNode&&e.remove()}function x(e,t,n){var r,i,a,o={},s=arguments.length;for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return s>2&&(o.children=s>3?y.call(arguments,2):n),S(e,o,r,i,null)}function S(e,t,i,a,o){var s={type:e,props:t,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o||++r,__i:-1,__u:0};return!o&&n.vnode&&n.vnode(s),s}function C(e){return e.children}function w(e,t){this.props=e,this.context=t,this.__g=0}function te(e,t){if(t==null)return e.__?te(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])&&n.__e)return n.__e;return typeof e.type!=`function`||e.props.__P?null:te(e)}function T(e){if((e=e.__)&&e.__c&&!e.props.__P)return e.__e=null,e.__k.some(function(t){return t&&(e.__e=t.__e)}),T(e)}function E(e){(8&e.__g||!(e.__g|=8)||!a.push(e)||s++)&&o==n.debounceRendering||((o=n.debounceRendering)||queueMicrotask)(ne)}function ne(){var e,t,r,i,o,l,u,d,f;try{for(t=1;a.length;)a.length>t&&a.sort(c),e=a.shift(),t=a.length,8&e.__g&&(i=void 0,o=void 0,l=(o=(r=e).__v).__e,u=[],d=[],(f=r.__P)&&((i=b({constructor:void 0},o)).__v=o.__v+1,n.vnode&&n.vnode(i),k(f,i,o,r.__n,f.namespaceURI,32&o.__u?[l]:null,u,l||te(o),32&o.__u,d),i.__v=o.__v,i.__.__k[i.__i]=i,A(u,i,d),o.__=o.__e=null,i.__e!=l&&T(i)))}finally{a.length=s=0}}function re(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,_,v,y=r.__k||g,b=t.length;for(c=D(n,t,y,c,b),d=0;d<b;d++)(p=n.__k[d])!=null&&(f=~p.__i&&y[p.__i]||h,p.__i=d,v=k(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&(f.ref!=p.ref||8&f.__u)&&(f.ref!=p.ref&&f.ref&&j(f.ref,null,p),u.push(p.ref,p.__c||m,p)),_||=m,4&p.__u?(c=ie(p,c,e,!f.__v),f.__e&&(f.__e=null)):typeof p.type==`function`&&v!==void 0?c=v:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=_,c}function D(e,t,n,r,i){var a,o,s,c,l,u,d,f,p,m,h=n.length,g=h,_=0,y=!1,b=e.__k=Array(i);for(a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o!=`object`||o.constructor==String?o=b[a]=S(null,o):v(o)?o=b[a]=S(C,{children:o}):o.constructor===void 0&&o.__b?o=b[a]=S(o.type,o.props,o.key,o.ref,o.__v):b[a]=o,c=a+_,o.__=e,o.__b=e.__b+1,s=null,~(l=o.__i=ae(o,n,c,g))&&(g--,(s=n[l])&&(s.__u|=2)),s&&s.__v?(o.__u|=2,l==c-1?_--:l==c+1?_++:l!=c&&(l>c?_--:_++,y=!0)):(~l||(i>h?_--:i<h&&_++),typeof o.type!=`function`&&(o.__u|=4))):b[a]=null;if(y){for(u=[],d=[],a=0;a<i;a++)if((o=b[a])&&2&o.__u){for(f=0,p=u.length;f<p;)u[m=f+p>>1]<o.__i?f=m+1:p=m;u[f]=o.__i,d[a]=f+1}for(_=u.length;a--;)d[a]&&(d[a]==_?_--:b[a].__u|=4)}if(g)for(a=0;a<h;a++)!(s=n[a])||2&s.__u||(s.__e==r&&(r=te(s)),ue(s,s));return r}function ie(e,t,n,r){var i,a;if(typeof e.type==`function`){if(e.props.__P)return t;if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&(i[a].__=e,t=ie(i[a],t,n,!1));return t}for(t&&!t.parentNode&&(t=te(e))&&!t.parentNode&&(t=null),e.__e!=t&&(!r&&n.moveBefore&&e.__e.parentNode?n.moveBefore(e.__e,t):n.insertBefore(e.__e,t||null)),t=e.__e;(t&&=t.nextSibling)&&t.nodeType==8;);return t}function ae(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l&&!(2&l.__u);if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function oe(e,t,n){n??=``,t[0]==`-`?e.setProperty(t,n):e[t]=n}function O(e,t,n,r,i){var a;n: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||oe(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||oe(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(d,`$1`)),(t=t.slice(2))[0]<`a`&&(t=t.toLowerCase()),(e.__e||={})[t+a]=n,n?r?n[u]=r[u]:(n[u]=f,e.addEventListener(t,a?m:p,a)):e.removeEventListener(t,a?m:p,a);else{if(i==`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 n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function se(e){return function(t){if(this.__e){var r=this.__e[t.type+e];if(t[l]==null)t[l]=f++;else if(t[l]<r[u])return;return r(n.event?n.event(t):t)}}}function k(e,t,r,i,a,o,s,c,l,u){var d,f,p,m,h,_,y,x,S,T,E,ne,D,ie,ae,oe,O,se,k,A,j=t.type;if(t.constructor!==void 0)return null;if(128&r.__u&&(l=32&r.__u,d=r.__c.__z)){if(t.__u|=l,f=o=[],d.nodeType==8)for(p=1,m=d.nextSibling;m;m=m.nextSibling){if(m.nodeType==8){if(m.data.startsWith(`$s`))p++;else if(m.data.startsWith(`/$s`)&&!--p)break}o.push(m)}else o.push(d);c=o[0]}(d=n.__b)&&d(t);n:if(typeof j==`function`){h=s.length;try{if(T=t.props,E=(d=j.prototype)&&d.render,ne=(d=j.contextType)&&i[d.__c],D=d?ne?ne.props.value:d.__:i,r.__c?2&(_=t.__c=r.__c).__g&&(_.__g|=1):(E?t.__c=_=new j(T,D):(t.__c=_=new w(T,D),_.constructor=j,_.render=de),ne&&ne.sub(_),_.state||(_.state={}),_.__n=i,_.__g|=8,_.__h=[],_.__k=[]),E&&(_.__s||(_.__s=_.state),j.getDerivedStateFromProps&&(_.__s==_.state&&(_.__s=b({},_.__s)),b(_.__s,j.getDerivedStateFromProps(T,_.__s)))),y=_.props,x=_.state,_.__v=t,r.__c){if(E&&!j.getDerivedStateFromProps&&T!==y&&_.componentWillReceiveProps&&_.componentWillReceiveProps(T,D),t.__v==r.__v&&!(8&_.__g)||!(4&_.__g)&&_.shouldComponentUpdate&&!1===_.shouldComponentUpdate(T,_.__s,D)){t.__v!=r.__v&&(_.props=T,_.state=_.__s,_.__g&=-9),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(e){e&&(e.__=t)}),g.push.apply(_.__h,_.__k),_.__k=[],_.__h.length&&s.push(_),c=te(r);break n}_.componentWillUpdate&&_.componentWillUpdate(T,_.__s,D),E&&_.componentDidUpdate&&_.__h.push(function(){_.componentDidUpdate(y,x,S)})}else E&&!j.getDerivedStateFromProps&&_.componentWillMount&&_.componentWillMount(),E&&_.componentDidMount&&_.__h.push(_.componentDidMount);if(_.context=D,_.props=T,_.__P=e,_.__g&=-5,ie=n.__r,ae=0,E)_.state=_.__s,_.__g&=-9,ie&&ie(t),d=_.render(_.props,_.state,_.context),g.push.apply(_.__h,_.__k),_.__k=[];else do _.__g&=-9,ie&&ie(t),d=_.render(_.props,_.state,_.context),_.state=_.__s;while(8&_.__g&&++ae<25);_.state=_.__s,_.getChildContext&&(i=b({},i,_.getChildContext())),E&&r.__c&&_.getSnapshotBeforeUpdate&&(S=_.getSnapshotBeforeUpdate(y,x)),oe=d&&d.type===C&&d.key==null?d.props.children:d,T.__P&&(d=c,a=(e=T.__P).namespaceURI,l=o=null,r.props&&r.props.__P!=e&&(r.__k.some(function(e){e&&ue(e,e)}),r.__k=null),c=r.__k?te(r,0):null),c=re(e,v(oe)?oe:[oe],t,r,i,a,o,s,c,l,u),T.__P&&(t.__e=null,c=d),t.__u&=-161,128&r.__u&&(_.__z=null),f&&f.some(ee),_.__h.length&&s.push(_),1&_.__g&&(_.__g&=-4)}catch(e){if(s.length=h,t.__v=null,l||o){if(e.then){if(O=0,t.__u|=l?160:128,o){for(k=0;k<o.length;k++)if(A=o[k]){if(A.nodeType==8){if(o[k]=null,A.data.startsWith(`$s`))O++||(se=A);else if(A.data.startsWith(`/$s`)&&!--O){c=A;break}}else O&&(o[k]=null)}}if(!se){for(;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o&&(o[o.indexOf(c)]=null),se=c}t.__c.__z||(t.__c.__z=se),t.__e=c}else o&&o.some(ee)}else t.__e=r.__e;t.__k||=r.__k||[],e.then||ce(t),n.__e(e,t,r)}}else c=t.__e=le(r.__e,t,r,i,a,o,s,l,u,e);return(d=n.diffed)&&d(t),128&t.__u?void 0:c}function ce(e){e&&(e.__c&&(e.__c.__g|=4),e.__k&&e.__k.some(ce))}function A(e,t,r){for(var i=0;i<r.length;)j(r[i++],r[i++],r[i++]);n.__c&&n.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){n.__e(e,t.__v)}})}function le(e,t,r,i,a,o,s,c,l,u){var d,f,p,m,g,b,x,S,C,w=r.props||h,T=t.props,E=t.type;if(E==`svg`?a=`http://www.w3.org/2000/svg`:E==`math`?a=`http://www.w3.org/1998/Math/MathML`:a||=`http://www.w3.org/1999/xhtml`,o){for(d=0;d<o.length;d++)if((g=o[d])&&(E?g.localName==E:g.nodeType==3)){e=g,o[d]=null;break}}if(!e){if(S=u.ownerDocument||document,!E)return S.createTextNode(T);e=S.createElementNS(a,E,T.is&&T),c&&=(n.__m&&n.__m(t,o),!1),o=null}if(E){if(u=E==`template`?e.content:e,o=E==`textarea`&&T.defaultValue!=null?null:o&&y.call(u.childNodes),!c&&o)for(w={},d=0;d<e.attributes.length;d++)w[(g=e.attributes[d]).name]=g.value;for(d in w)g=w[d],d==`dangerouslySetInnerHTML`?p=g:d==`children`||d in T||d==`value`&&`defaultValue`in T||d==`checked`&&`defaultChecked`in T||O(e,d,null,g,a);for(d in C=1&r.__u,T)g=T[d],d==`children`?m=g:d==`dangerouslySetInnerHTML`?f=g:d==`value`?b=g:d==`checked`?x=g:c&&typeof g!=`function`||!(w[d]!==g||C&&g!=null)||O(e,d,g,w[d],a);f?(c||p&&(f.__html==p.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[]):(p&&(e.textContent=``),(E==`foreignObject`||a==`http://www.w3.org/1998/Math/MathML`&&_.test(E))&&(a=`http://www.w3.org/1999/xhtml`),re(u,v(m)?m:[m],t,r,i,a,o,s,o?o[0]:r.__k&&te(r,0),c,l),o&&o.some(ee)),c&&E!=`textarea`||(d=`value`,E==`progress`&&b==null?e.removeAttribute(d):b==null||b===e[d]&&(E!=`progress`||b)||O(e,d,b,w[d],a),d=`checked`,x!=null&&x!=e[d]&&O(e,d,x,w[d],a))}else w===T||c&&e.data==T||(e.data=T);return e}function j(e,t,r){try{typeof e==`function`?(typeof e.__u==`function`&&e.__u(),(typeof e.__u!=`function`||t)&&(e.__u=e(t))):e.current=t}catch(e){n.__e(e,r)}}function ue(e,t,r){var i,a;if(n.unmount&&n.unmount(e),!(i=e.ref)||i.current&&i.current!=e.__e||j(i,null,t),i=e.__c){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){n.__e(e,t)}i.__P=i.__n=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&ue(i[a],t,typeof e.type!=`function`||r&&!e.props.__P);(i=e.__e)&&(r||ee(i),i.__e&&(i.__e=null)),e.__e=e.__c=e.__=null}function de(e,t,n){return this.constructor(e,n)}function fe(e,t){var r,i,a,o;n.__&&n.__(e,t),t.nodeType==9&&(t=t.documentElement),i=(r=e&&32&e.__u)?null:t.__k,t.__k=S(C,{children:[e]}),a=[],o=[],k(t,t.__k,i||h,h,t.namespaceURI,i?null:t.firstChild?y.call(t.childNodes):null,a,i?i.__e:t.firstChild,r,o),A(a,t.__k,o),t.__k.props.children=null}n={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t,o=0}}throw s=0,e}},r=0,i=function(e){return e!=null&&e.constructor===void 0},w.prototype.setState=function(e,t){var n=this.__s;n&&n!=this.state||(n=this.__s=b({},this.state)),typeof e==`function`&&(e=e(b({},n),this.props)),e&&(b(n,e),this.__v&&(t&&this.__k.push(t),E(this)))},w.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),E(this))},w.prototype.render=C,a=[],s=0,c=function(e,t){return e.__v.__b-t.__v.__b},l=Symbol(),u=Symbol(),d=/(PointerCapture)$|Capture$/i,f=0,p=se(!1),m=se(!0);var pe,M,me,he,ge=Object.is,_e=0,ve=[],ye=[],N=n,be=N.__b,xe=N.__r,Se=N.diffed,Ce=N.__c,we=N.unmount,Te=N.__;function Ee(e,t){N.__h&&N.__h(M,e,_e||t),_e=0;var n=M.__H||(M.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function P(e){return _e=1,De(Re,e)}function De(e,t,n){var r=Ee(pe++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Re(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);ge(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=M,!M.__f)){M.__f=!0;var i=M.shouldComponentUpdate;M.shouldComponentUpdate=function(e,t,n){var r=this.__H;if(!r)return!0;var a=!1,o=this.props!=e;if(r.__.some(function(e){e.__N&&(a=!0,ge(e.__[0],e.__N[0])||(o=!0))}),i){var s=i.call(this,e,t,n);return a?s||o:s}return!a||o}}return r.__}function F(e,t){var n=Ee(pe++,3);!N.__s&&Le(n.__H,t)&&(n.__P=!0,n.__=e,n.u=t,M.__H.__h.push(n))}function Oe(e,t){var n=Ee(pe++,4);!N.__s&&Le(n.__H,t)&&(n.__P=!1,n.__=e,n.u=t,M.__h.push(n))}function ke(e){return _e=5,Ae(function(){return{current:e}},[])}function Ae(e,t){var n=Ee(pe++,7);return Le(n.__H,t)&&(n.__=e(),n.__H=t),n.__}function je(){var e;do{for(;e=ye.shift();)try{Fe(e)}catch(t){N.__e(t,{__:(e=e.__P)&&e.__v})}for(;e=ve.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Fe),t.__h.some(Ie),t.__h=[]}catch(n){t.__h=[],N.__e(n,e.__v)}}}while(ye.length)}N.__b=function(e){M=null,be&&be(e)},N.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Te&&Te(e,t)},N.__r=function(e){xe&&xe(e),pe=0;var t=(M=e.__c).__H;t&&(me==M?M.__h=[]:(t.__h.some(Fe),t.__h.some(Ie),pe=0),t.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})),me=M},N.diffed=function(e){Se&&Se(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&Pe(ve.push(t)),t.__H.__.some(function(e){e.u&&(e.__H=e.u)})),me=M=null},N.__c=function(e,t){t.some(function(e){try{e.__h.some(Fe),e.__h=e.__h.filter(function(e){return!e.__||Ie(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],N.__e(n,e.__v)}}),Ce&&Ce(e,t)},N.unmount=function(e){we&&we(e);var t,n,r=e.__c;r&&r.__H&&(r.__H.__.some(function(r){try{if(r.__P&&r.__c){if(n===void 0){for(n=e.__;n&&(!n.__c||!n.__c.__P);)n=n.__;n&&=n.__c}r.__P=n,Pe(ye.push(r))}else Fe(r)}catch(e){t=e}}),r.__H=void 0,t&&N.__e(t,r.__v))};var Me=typeof requestAnimationFrame==`function`;function Ne(e){var t,n=function(){clearTimeout(r),Me&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Me&&(t=requestAnimationFrame(n))}function Pe(e){e!=1&&he==N.requestAnimationFrame||((he=N.requestAnimationFrame)||Ne)(je)}function Fe(e){var t=M,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),M=t}function Ie(e){var t=M;e.__c=e.__(),M=t}function Le(e,t){return!e||e.length!=t.length||t.some(function(t,n){return!ge(t,e[n])})}function Re(e,t){return typeof t==`function`?t(e):t}var ze=Symbol.for(`preact-signals`);function Be(){if(L>1)L--;else{var e,t=!1;for((function(){var e=Je;for(Je=void 0;e!==void 0;){var t=e.S;if(t.v===e.v)for(var n=t.t;n!==void 0;n=n.x)n.i===e.i&&(n.i=t.i);e=e.o}})();We!==void 0;){var n=We;for(We=void 0,Ge++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Ze(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(Ge=0,L--,t)throw e}}function Ve(e){if(L>0)return e();qe=++Ke,L++;try{return e()}finally{Be()}}var He,I=void 0;function Ue(e){var t=I,n=He;I=void 0,He=void 0;try{return e()}finally{I=t,He=n}}var We=void 0,L=0,Ge=0,Ke=0,qe=0,Je=void 0,Ye=0;function Xe(e){if(I!==void 0){var t=e.n;if(t===void 0||t.t!==I)return t={i:0,S:e,p:I.s,n:void 0,t:I,e:void 0,x:void 0,r:t},I.s!==void 0&&(I.s.n=t),I.s=t,e.n=t,32&I.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=I.s,t.n=void 0,I.s.n=t,I.s=t),t}}function R(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}R.prototype.brand=ze,R.prototype.h=function(){return!0},R.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n===void 0?Ue(function(){var e;(e=t.W)==null||e.call(t)}):n.e=e)},R.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&Ue(function(){var e;(e=t.Z)==null||e.call(t)}))}},R.prototype.subscribe=function(e){var t=this;return ot(function(){var n=t.value;Ue(function(){return e(n)})},{name:`sub`})},R.prototype.valueOf=function(){return this.value},R.prototype.toString=function(){return this.value+``},R.prototype.toJSON=function(){return this.value},R.prototype.peek=function(){var e=this;return Ue(function(){return e.value})},Object.defineProperty(R.prototype,"value",{get:function(){var e=Xe(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Ge>100)throw Error(`Cycle detected`);(function(e){L!==0&&Ge===0&&e.l!==qe&&(e.l=qe,Je={S:e,v:e.v,i:e.i,o:Je})})(this),this.v=e,this.i++,Ye++,L++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Be()}}}});function z(e,t){return new R(e,t)}function Ze(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Qe(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function $e(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function et(e,t){R.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Ye-1,this.f=4}et.prototype=new R,et.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Ye))return!0;if(this.g=Ye,this.f|=1,this.i>0&&!Ze(this))return this.f&=-2,!0;var e=I;try{Qe(this),I=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return I=e,$e(this),this.f&=-2,!0},et.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}R.prototype.S.call(this,e)},et.prototype.U=function(e){if(this.t!==void 0&&(R.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},et.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(et.prototype,"value",{get:function(){if(1&this.f)throw Error(`Cycle detected`);var e=Xe(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function tt(e,t){return new et(e,t)}function nt(e){var t=e.m;if(e.m=void 0,typeof t==`function`){L++;var n=I;I=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,rt(e),t}finally{I=n,Be()}}}function rt(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,nt(e)}function it(e){if(I!==this)throw Error(`Out-of-order effect`);$e(this),I=e,this.f&=-2,8&this.f&&rt(this),Be()}function at(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,He&&He.push(this)}at.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t==`function`&&(this.m=t)}finally{e()}},at.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,nt(this),Qe(this),L++;var e=I;return I=this,it.bind(this,e)},at.prototype.N=function(){2&this.f||(this.f|=2,this.u=We,We=this)},at.prototype.d=function(){this.f|=8,1&this.f||rt(this)},at.prototype.dispose=function(){this.d()};function ot(e,t){var n=new at(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var st,ct,lt=typeof window<`u`&&!!window.__PREACT_SIGNALS_DEVTOOLS__,ut=[];ot(function(){st=this.N})();function dt(e,t){n[e]=t.bind(null,n[e]||function(){})}function ft(e){if(ct){var t=ct;ct=void 0,t()}ct=e&&e.S()}function pt(e){var t=this,n=e.data,r=ht(n);r.name=`ReactiveDom`,r.value=n;var a=Ae(function(){for(var e=t,n=t.__v;n=n.__;)if(n.__c){n.__c.__$f|=4;break}var a=tt(function(){var e=r.value.value;return e===0?0:!0===e?``:e||``}),o=tt(function(){return!Array.isArray(a.value)&&!i(a.value)}),s=ot(function(){if(this.N=vt,o.value){var t=a.value;e.__v&&e.__v.__e&&e.__v.__e.nodeType===3&&(e.__v.__e.data=t)}}),c=t.__$u.d;return t.__$u.d=function(){s(),c.call(this)},[o,a]},[]),o=a[0],s=a[1];return o.value?s.peek():s.value}pt.displayName=`ReactiveTextNode`,Object.defineProperties(R.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:pt},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}}),dt(`__b`,function(e,t){if(ft(),typeof t.type==`string`){var n,r=t.props;for(var i in r)if(i!==`children`){var a=r[i];a instanceof R&&(n||(t.__np=n={}),n[i]=a,r[i]=a.peek())}}e(t)}),dt(`__r`,function(e,t){if(e(t),t.type!==C){ft();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=function(e,t){var n;return ot(function(){n=this},{name:t}),n.c=e,n}(function(e){return function(){var t;lt&&((t=this.y)==null||t.call(this)),e.__$f|=1,e.setState({})}}(r),typeof t.type==`function`?t.type.displayName||t.type.name:``))),ft(n)}}),dt(`__e`,function(e,t,n,r){ft(),e(t,n,r)}),dt(`diffed`,function(e,t){ft();var n;if(typeof t.type==`string`&&(n=t.__e)){var r=t.__np,i=t.props,a=n.U;if(a)for(var o in a){var s=a[o];s===void 0||r&&o in r||(s.d(),a[o]=void 0)}if(r)for(var c in a||(a={},n.U=a),r){var l=a[c],u=r[c];l===void 0?(l=mt(n,c,u,i),a[c]=l):l.o(u,i)}}e(t)});function mt(e,t,n,r){var i=t in e&&e.ownerSVGElement===void 0,a=z(n);return{o:function(e,t){a.value=e,r=t},d:ot(function(){this.N=vt;var n=a.value.value;r[t]!==n&&(r[t]=n,i?e[t]=n:n!=null&&(!1!==n||t[4]===`-`)?e.setAttribute(t,n):e.removeAttribute(t))})}}dt(`unmount`,function(e,t){if(typeof t.type==`string`){var n=t.__e;if(n){var r=n.U;if(r)for(var i in n.U=void 0,r){var a=r[i];a&&a.d()}}var o=t.__np;if(o){var s=t.props;for(var c in o)s[c]=o[c]}t.__np=void 0}else{var l=t.__c;if(l){l.__$f|=8;var u=l.__$u;u&&(l.__$u=void 0,u.d())}}e(t)}),dt(`__h`,function(e,t,n,r){r<3&&(t.__$f|=2),e(t,n,r)}),w.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,r=n&&n.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u==`boolean`&&!0===this.u){var a=2&this.__$f;if(!(r||a||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var o in e)if(o!==`__source`&&e[o]!==this.props[o])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function ht(e,t){return Ae(function(){return z(e,t)},[])}var gt=function(e){queueMicrotask(function(){queueMicrotask(e)})};function _t(){Ve(function(){for(var e;e=ut.shift();)st.call(e)})}function vt(){ut.push(this)===1&&(n.requestAnimationFrame||gt)(_t)}function yt(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(16));e[6]=(e[6]??0)&15|64,e[8]=(e[8]??0)&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}let bt=z(`connecting`),B=z(null),xt=z(null),St=z(null),V=z(/* @__PURE__ */ new Map),Ct=z(null),wt=z(null),Tt=z(null),Et=z(void 0),Dt=z(null),Ot,kt=500,At=``;function jt(e){At=e,Nt()}function H(e){return Ot?.readyState===WebSocket.OPEN?(Ot.send(JSON.stringify(e)),!0):(Dt.value={message:`Not connected to the Tencil bridge`,at:Date.now()},!1)}function Mt(e){let t=new Map(V.value);t.set(e.id,e),V.value=t}function Nt(){let e=new URL(`/ws`,At);e.protocol=e.protocol===`https:`?`wss:`:`ws:`,bt.value=`connecting`;let t=new WebSocket(e);Ot=t,t.addEventListener(`open`,()=>{kt=500,t.send(JSON.stringify({type:`hello`,protocol:1,pageUrl:location.href}))}),t.addEventListener(`message`,e=>{try{Pt(JSON.parse(String(e.data)))}catch(e){console.warn(`[tencil] bad message`,e)}}),t.addEventListener(`close`,()=>{Ot===t&&(bt.value=`closed`,setTimeout(Nt,kt),kt=Math.min(kt*2,1e4))})}function Pt(e){switch(e.type){case`ready`:Ve(()=>{bt.value=`open`,Tt.value=null,B.value=e.provider,xt.value=e.settings,St.value=e.project,V.value=new Map(e.threads.map(e=>[e.id,e]))});return;case`project.unknown`:Ve(()=>{bt.value=`open`,Tt.value=e.choices,Et.value=e.emptyHint});return;case`provider.status`:B.value=e.provider;return;case`settings`:Ve(()=>{xt.value=e.settings,Ct.value=null,wt.value=null});return;case`thread.upsert`:Mt(e.thread);return;case`thread.removed`:{let t=new Map(V.value);t.delete(e.threadId),V.value=t;return}case`provider.threads`:Ve(()=>{Ct.value=e.threads,wt.value=e.project});return;case`error`:Dt.value={message:e.message,threadId:e.threadId,at:Date.now()};return}}function Ft(e){return xt.value?.providers.find(t=>t.id===e)?.label??e}function It(){Ot?.readyState===WebSocket.OPEN&&Ot.send(JSON.stringify({type:`provider.threads`}))}function Lt(e){for(let t of V.value.values())if(t.provider.threadId===e.id&&!t.anchor)return t.id;let t=yt();return H({type:`thread.open`,id:t,providerThreadId:e.id,title:e.title})?t:null}let U=z(`idle`),Rt=z(null),W=z(null),G=z(null),K=z(!1),zt=z(!1),Bt=z(!1),Vt=z(!1),Ht=z(0),Ut=z(Wt(location.href));function Wt(e){try{let t=new URL(e);return`${t.origin}${t.pathname.replace(/\/$/,``)||`/`}`}catch{return e}}let Gt=tt(()=>[...V.value.values()].sort((e,t)=>t.createdAt.localeCompare(e.createdAt))),Kt=tt(()=>Gt.value.filter(e=>e.anchor&&e.pageUrl&&Wt(e.pageUrl)===Ut.value).filter(e=>Bt.value||!e.resolved).reverse()),qt=tt(()=>Gt.value.filter(e=>!e.resolved).length),Jt=tt(()=>Gt.value.filter(e=>e.status===`working`||e.status===`starting`).length);function Yt(){W.value=null,G.value=null,U.value=`picking`}function Xt(){U.value=`idle`,Rt.value=null}let Zt;function Qt(e){Zt=e}function $t(){if(!Zt)throw Error(`Tencil overlay is not mounted`);return Zt}let en=/* @__PURE__ */ new Map;function tn(e,t){let n=t??nn(e.selector);if(!n?.isConnected)return null;let r=n.getBoundingClientRect();return r.width===0&&r.height===0?null:{x:r.left+r.width*e.offsetX,y:r.top+r.height*e.offsetY}}function nn(e){if(!e)return null;let t=en.get(e)?.deref();if(t?.isConnected&&t.matches(e))return t;try{let t=document.querySelector(e);return t&&en.set(e,new WeakRef(t)),t}catch{return null}}function rn(e,t,n=16){let r=window.innerWidth,i=window.innerHeight,a=e.x+n;a+t.width>r-12&&(a=e.x-n-t.width),a=an(a,12,r-t.width-12);let o=an(e.y-24,12,i-t.height-12),s=`${an(e.x-a,0,t.width)}px ${an(e.y-o,0,t.height)}px`;return{left:a,top:o,origin:s}}function an(e,t,n){return Math.max(t,Math.min(n,e))}function on(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}let sn;function cn(){let e=/* @__PURE__ */ new Int32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e}function ln(e){let t=-1;sn||=cn();for(let n=0;n<e.length;n++)t=sn[(t^e[n])&255]^t>>>8;return t^-1}function un(e){let t=e.length-1;for(let n=t;n>=4;n--)if(e[n-4]===9&&e[n-3]===112&&e[n-2]===72&&e[n-1]===89&&e[n]===115)return n-3;return 0}function dn(e,t,n=!1){let r=/* @__PURE__ */ new Uint8Array(13);t*=39.3701,r[0]=112,r[1]=72,r[2]=89,r[3]=115,r[4]=t>>>24,r[5]=t>>>16,r[6]=t>>>8,r[7]=t&255,r[8]=r[4],r[9]=r[5],r[10]=r[6],r[11]=r[7],r[12]=1;let i=ln(r),a=/* @__PURE__ */ new Uint8Array(4);if(a[0]=i>>>24,a[1]=i>>>16,a[2]=i>>>8,a[3]=i&255,n){let t=un(e);return e.set(r,t),e.set(a,t+13),e}{let t=/* @__PURE__ */ new Uint8Array(4);t[0]=0,t[1]=0,t[2]=0,t[3]=9;let n=/* @__PURE__ */ new Uint8Array(54);return n.set(e,0),n.set(t,33),n.set(r,37),n.set(a,50),n}}function fn(e){let t=e.indexOf(`AAlwSFlz`);return t===-1&&(t=e.indexOf(`AAAJcEhZ`)),t===-1&&(t=e.indexOf(`AAAACXBI`)),t}let pn=`[modern-screenshot]`,q=typeof window<`u`,mn=q&&`Worker`in window,hn=q&&`atob`in window,gn=q&&`btoa`in window,_n=q?window.navigator?.userAgent:``,vn=_n.includes(`Chrome`),yn=_n.includes(`AppleWebKit`)&&!vn,bn=_n.includes(`Firefox`),xn=e=>e&&`__CONTEXT__`in e,Sn=e=>e.constructor.name===`CSSFontFaceRule`,Cn=e=>e.constructor.name===`CSSImportRule`,wn=e=>e.constructor.name===`CSSLayerBlockRule`,J=e=>e.nodeType===1,Tn=e=>typeof e.className==`object`,En=e=>e.tagName===`image`,Dn=e=>e.tagName===`use`,On=e=>J(e)&&e.style!==void 0&&!Tn(e),kn=e=>e.nodeType===8,An=e=>e.nodeType===3,jn=e=>e.tagName===`IMG`,Mn=e=>e.tagName===`VIDEO`,Nn=e=>e.tagName===`CANVAS`,Pn=e=>e.tagName===`TEXTAREA`,Fn=e=>e.tagName===`INPUT`,In=e=>e.tagName===`STYLE`,Ln=e=>e.tagName===`SCRIPT`,Rn=e=>e.tagName===`SELECT`,zn=e=>e.tagName===`SLOT`,Bn=e=>e.tagName===`IFRAME`,Vn=(...e)=>console.warn(pn,...e);function Hn(e){let t=e?.createElement?.(`canvas`);return t&&(t.height=t.width=1),!!t&&`toDataURL`in t&&!!t.toDataURL(`image/webp`).includes(`image/webp`)}let Un=e=>e.startsWith(`data:`);function Wn(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(q&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!q)return e;let n=Gn().implementation.createHTMLDocument(),r=n.createElement(`base`),i=n.createElement(`a`);return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}function Gn(e){return(e&&J(e)?e?.ownerDocument:e)??window.document}let Kn=`http://www.w3.org/2000/svg`;function qn(e,t,n){let r=Gn(n).createElementNS(Kn,`svg`);return r.setAttributeNS(null,`width`,e.toString()),r.setAttributeNS(null,`height`,t.toString()),r.setAttributeNS(null,`viewBox`,`0 0 ${e} ${t}`),r}function Jn(e,t){let n=new XMLSerializer().serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,``)),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}function Yn(e,t){return new Promise((n,r)=>{let i=new FileReader;i.onload=()=>n(i.result),i.onerror=()=>r(i.error),i.onabort=()=>r(/* @__PURE__ */ Error(`Failed read blob to ${t}`)),t===`dataUrl`?i.readAsDataURL(e):t===`arrayBuffer`&&i.readAsArrayBuffer(e)})}let Xn=e=>Yn(e,`dataUrl`);function Zn(e,t){let n=Gn(t).createElement(`img`);return n.decoding=`sync`,n.loading=`eager`,n.src=e,n}function Qn(e,t){return new Promise(n=>{let{timeout:r,ownerDocument:i,onError:a,onWarn:o}=t??{},s=typeof e==`string`?Zn(e,Gn(i)):e,c=null,l=null;function u(){n(s),c&&clearTimeout(c),l?.()}if(r&&(c=setTimeout(u,r)),Mn(s)){let e=s.currentSrc||s.src;if(!e)return s.poster?Qn(s.poster,t).then(n):u();if(s.readyState>=2)return u();let r=u,i=t=>{o?.(`Failed video load`,e,t),a?.(t),u()};l=()=>{s.removeEventListener(`loadeddata`,r),s.removeEventListener(`error`,i)},s.addEventListener(`loadeddata`,r,{once:!0}),s.addEventListener(`error`,i,{once:!0})}else{let e=En(s)?s.href.baseVal:s.currentSrc||s.src;if(!e)return u();let t=async()=>{if(jn(s)&&`decode`in s)try{await s.decode()}catch(t){o?.(`Failed to decode image, trying to render anyway`,s.dataset.originalSrc||e,t)}u()},n=t=>{o?.(`Failed image load`,s.dataset.originalSrc||e,t),u()};if(jn(s)&&s.complete)return t();l=()=>{s.removeEventListener(`load`,t),s.removeEventListener(`error`,n)},s.addEventListener(`load`,t,{once:!0}),s.addEventListener(`error`,n,{once:!0})}})}async function $n(e,t){On(e)&&(jn(e)||Mn(e)?await Qn(e,t):await Promise.all([`img`,`video`].flatMap(n=>Array.from(e.querySelectorAll(n)).map(e=>Qn(e,t)))))}let er=/* @__PURE__ */ function(){let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)}();function tr(e){return e?.split(`,`).map(e=>e.trim().replace(/"|'/g,``).toLowerCase()).filter(Boolean)}let nr=0;function rr(e){let t=`${pn}[#${nr}]`;return nr++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...t)=>e&&Vn(...t)}}function ir(e){return{cache:e?`no-cache`:`force-cache`}}async function ar(e,t){return xn(e)?e:or(e,{...t,autoDestruct:!0})}async function or(e,t){let{scale:n=1,workerUrl:r,workerNumber:i=1}=t||{},a=!!t?.debug,o=t?.features??!0,s=e.ownerDocument??(q?window.document:void 0),c=e.ownerDocument?.defaultView??(q?window:void 0),l=/* @__PURE__ */ new Map,u={width:0,height:0,quality:1,type:`image/png`,scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:a,fetch:{requestInit:ir(t?.fetch?.bypassingCache),placeholderImage:`data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7`,bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:i,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:rr(a),node:e,ownerDocument:s,ownerWindow:c,dpi:n===1?null:96*n,svgStyleElement:sr(s),svgDefsElement:s?.createElementNS(Kn,`defs`),svgStyles:/* @__PURE__ */ new Map,defaultComputedStyles:/* @__PURE__ */ new Map,workers:[...Array.from({length:mn&&r&&i?i:0})].map(()=>{try{let e=new Worker(r);return e.onmessage=async e=>{let{url:t,result:n}=e.data;n?l.get(t)?.resolve?.(n):l.get(t)?.reject?.(/* @__PURE__ */ Error(`Error receiving message from worker: ${t}`))},e.onmessageerror=e=>{let{url:t}=e.data;l.get(t)?.reject?.(/* @__PURE__ */ Error(`Error receiving message from worker: ${t}`))},e}catch(e){return u.log.warn(`Failed to new Worker`,e),null}}).filter(Boolean),fontFamilies:/* @__PURE__ */ new Map,fontCssTexts:/* @__PURE__ */ new Map,acceptOfImage:`${[Hn(s)&&`image/webp`,`image/svg+xml`,`image/*`,`*/*`].filter(Boolean).join(`,`)};q=0.8`,requests:l,drawImageCount:0,tasks:[],features:o,isEnable:e=>e===`restoreScrollPosition`?typeof o==`boolean`?!1:o[e]??!1:typeof o==`boolean`?o:o[e]??!0,shadowRoots:[]};u.log.time(`wait until load`),await $n(e,{timeout:u.timeout,onWarn:u.log.warn}),u.log.timeEnd(`wait until load`);let{width:d,height:f}=cr(e,u);return u.width=d,u.height=f,u}function sr(e){if(!e)return;let t=e.createElement(`style`),n=t.ownerDocument.createTextNode(`
|
|
2
|
+
.______background-clip--text {
|
|
3
|
+
background-clip: text;
|
|
4
|
+
-webkit-background-clip: text;
|
|
5
|
+
}
|
|
6
|
+
`);return t.appendChild(n),t}function cr(e,t){let{width:n,height:r}=t;if(J(e)&&(!n||!r)){let t=e.getBoundingClientRect();n=n||t.width||Number(e.getAttribute(`width`))||0,r=r||t.height||Number(e.getAttribute(`height`))||0}return{width:n,height:r}}async function lr(e,t){let{log:n,timeout:r,drawImageCount:i,drawImageInterval:a}=t;n.time(`image to canvas`);let o=await Qn(e,{timeout:r,onWarn:t.log.warn}),{canvas:s,context2d:c}=ur(e.ownerDocument,t),l=()=>{try{c?.drawImage(o,0,0,s.width,s.height)}catch(e){t.log.warn(`Failed to drawImage`,e)}};if(l(),t.isEnable(`fixSvgXmlDecode`))for(let e=0;e<i;e++)await new Promise(t=>{setTimeout(()=>{c?.clearRect(0,0,s.width,s.height),l(),t()},e+a)});return t.drawImageCount=0,n.timeEnd(`image to canvas`),s}function ur(e,t){let{width:n,height:r,scale:i,backgroundColor:a,maximumCanvasSize:o}=t,s=e.createElement(`canvas`);s.width=Math.floor(n*i),s.height=Math.floor(r*i),s.style.width=`${n}px`,s.style.height=`${r}px`,o&&(s.width>o||s.height>o)&&(s.width>o&&s.height>o?s.width>s.height?(s.height*=o/s.width,s.width=o):(s.width*=o/s.height,s.height=o):s.width>o?(s.height*=o/s.width,s.width=o):(s.width*=o/s.height,s.height=o));let c=s.getContext(`2d`);return c&&a&&(c.fillStyle=a,c.fillRect(0,0,s.width,s.height)),{canvas:s,context2d:c}}function dr(e,t){if(e.ownerDocument)try{let t=e.toDataURL();if(t!==`data:,`)return Zn(t,e.ownerDocument)}catch(e){t.log.warn(`Failed to clone canvas`,e)}let n=e.cloneNode(!1),r=e.getContext(`2d`),i=n.getContext(`2d`);try{return r&&i&&i.putImageData(r.getImageData(0,0,e.width,e.height),0,0),n}catch(e){t.log.warn(`Failed to clone canvas`,e)}return n}function fr(e,t){try{if(e?.contentDocument?.documentElement)return Mr(e.contentDocument.documentElement,t)}catch(e){t.log.warn(`Failed to clone iframe`,e)}return e.cloneNode(!1)}function pr(e){let t=e.cloneNode(!1);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=``),t.loading===`lazy`&&(t.loading=`eager`),t}async function mr(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return Zn(e.poster,e.ownerDocument);let n=e.cloneNode(!1);n.crossOrigin=`anonymous`,e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc);let r=n.ownerDocument;if(r){let i=!0;if(await Qn(n,{onError:()=>i=!1,onWarn:t.log.warn}),!i)return e.poster?Zn(e.poster,e.ownerDocument):n;n.currentTime=e.currentTime,await new Promise(e=>{n.addEventListener(`seeked`,e,{once:!0})});let a=r.createElement(`canvas`);a.width=e.offsetWidth,a.height=e.offsetHeight;try{let e=a.getContext(`2d`);e&&e.drawImage(n,0,0,a.width,a.height)}catch(r){return t.log.warn(`Failed to clone video`,r),e.poster?Zn(e.poster,e.ownerDocument):n}return dr(a,t)}return n}function hr(e,t){return Nn(e)?dr(e,t):Bn(e)?fr(e,t):jn(e)?pr(e):Mn(e)?mr(e,t):e.cloneNode(!1)}function gr(e){let t=e.sandbox;if(!t){let{ownerDocument:n}=e;try{n&&(t=n.createElement(`iframe`),t.id=`__SANDBOX__${er()}`,t.width=`0`,t.height=`0`,t.style.visibility=`hidden`,t.style.position=`fixed`,n.body.appendChild(t),t.srcdoc=`<!DOCTYPE html><meta charset="UTF-8"><title></title><body>`,e.sandbox=t)}catch(t){e.log.warn(`Failed to getSandBox`,t)}}return t}let _r=[`width`,`height`,`-webkit-text-fill-color`],vr=[`stroke`,`fill`];function yr(e,t,n){let{defaultComputedStyles:r}=n,i=e.nodeName.toLowerCase(),a=Tn(e)&&i!==`svg`,o=a?vr.map(t=>[t,e.getAttribute(t)]).filter(([,e])=>e!==null):[],s=[a&&`svg`,i,o.map((e,t)=>`${e}=${t}`).join(`,`),t].filter(Boolean).join(`:`);if(r.has(s))return r.get(s);let c=gr(n)?.contentWindow;if(!c)return/* @__PURE__ */ new Map;let l=c?.document,u,d;a?(u=l.createElementNS(Kn,`svg`),d=u.ownerDocument.createElementNS(u.namespaceURI,i),o.forEach(([e,t])=>{d.setAttributeNS(null,e,t)}),u.appendChild(d)):u=d=l.createElement(i),d.textContent=` `,l.body.appendChild(u);let f=c.getComputedStyle(d,t),p=/* @__PURE__ */ new Map;for(let e=f.length,t=0;t<e;t++){let e=f.item(t);_r.includes(e)||p.set(e,f.getPropertyValue(e))}return l.body.removeChild(u),r.set(s,p),p}function br(e,t,n){let r=/* @__PURE__ */ new Map,i=[],a=/* @__PURE__ */ new Map;if(n)for(let e of n)o(e);else for(let t=e.length,n=0;n<t;n++)o(e.item(n));for(let e=i.length,t=0;t<e;t++)a.get(i[t])?.forEach((e,t)=>r.set(t,e));function o(n){let o=e.getPropertyValue(n),s=e.getPropertyPriority(n),c=n.lastIndexOf(`-`),l=c>-1?n.substring(0,c):void 0;if(l){let e=a.get(l);e||(e=/* @__PURE__ */ new Map,a.set(l,e)),e.set(n,[o,s])}(t.get(n)!==o||s)&&(l?i.push(l):r.set(n,[o,s]))}return r}function xr(e,t,n,r){let{ownerWindow:i,includeStyleProperties:a,currentParentNodeStyle:o}=r,s=t.style,c=i.getComputedStyle(e),l=yr(e,null,r);o?.forEach((e,t)=>{l.delete(t)});let u=br(c,l,a);u.delete(`transition-property`),u.delete(`all`),u.delete(`d`),u.delete(`content`),n&&(u.delete(`position`),u.delete(`margin-top`),u.delete(`margin-right`),u.delete(`margin-bottom`),u.delete(`margin-left`),u.delete(`margin-block-start`),u.delete(`margin-block-end`),u.delete(`margin-inline-start`),u.delete(`margin-inline-end`),u.set(`box-sizing`,[`border-box`,``])),u.get(`background-clip`)?.[0]===`text`&&t.classList.add(`______background-clip--text`),vn&&(u.has(`font-kerning`)||u.set(`font-kerning`,[`normal`,``]),(u.get(`overflow-x`)?.[0]===`hidden`||u.get(`overflow-y`)?.[0]===`hidden`)&&u.get(`text-overflow`)?.[0]===`ellipsis`&&e.scrollWidth===e.clientWidth&&u.set(`text-overflow`,[`clip`,``]));for(let e=s.length,t=0;t<e;t++)s.removeProperty(s.item(t));return u.forEach(([e,t],n)=>{s.setProperty(n,e,t)}),u}function Sr(e,t){(Pn(e)||Fn(e)||Rn(e))&&t.setAttribute(`value`,e.value)}let Cr=[`::before`,`::after`],wr=[`::-webkit-scrollbar`,`::-webkit-scrollbar-button`,`::-webkit-scrollbar-thumb`,`::-webkit-scrollbar-track`,`::-webkit-scrollbar-track-piece`,`::-webkit-scrollbar-corner`,`::-webkit-resizer`];function Tr(e,t,n,r,i){let{ownerWindow:a,svgStyleElement:o,svgStyles:s,currentNodeStyle:c}=r;if(!o||!a)return;function l(n){let o=a.getComputedStyle(e,n),l=o.getPropertyValue(`content`);if(!l||l===`none`)return;i?.(l),l=l.replace(/(')|(")|(counter\(.+\))/g,``);let u=[er()],d=yr(e,n,r);c?.forEach((e,t)=>{d.delete(t)});let f=br(o,d,r.includeStyleProperties);f.delete(`content`),f.delete(`-webkit-locale`),f.get(`background-clip`)?.[0]===`text`&&t.classList.add(`______background-clip--text`);let p=[`content: '${l}';`];if(f.forEach(([e,t],n)=>{p.push(`${n}: ${e}${t?` !important`:``};`)}),p.length===1)return;try{t.className=[t.className,...u].join(` `)}catch(e){r.log.warn(`Failed to copyPseudoClass`,e);return}let m=p.join(`
|
|
7
|
+
`),h=s.get(m);h||(h=[],s.set(m,h)),h.push(`.${u[0]}${n}`)}Cr.forEach(l),n&&wr.forEach(l)}let Er=/* @__PURE__ */ new Set([`symbol`]);async function Dr(e,t,n,r,i){if(J(n)&&(In(n)||Ln(n))||r.filter&&!r.filter(n))return;r.currentParentNodeStyle=Er.has(t.nodeName)||Er.has(n.nodeName)?void 0:r.currentNodeStyle;let a=await Mr(n,r,!1,i);r.isEnable(`restoreScrollPosition`)&&kr(e,a),t.appendChild(a)}async function Or(e,t,n,r){let i=e.firstChild;J(e)&&e.shadowRoot&&(i=e.shadowRoot?.firstChild,n.shadowRoots.push(e.shadowRoot));for(let a=i;a;a=a.nextSibling)if(!kn(a)){if(J(a)&&zn(a)&&typeof a.assignedNodes==`function`){let i=a.assignedNodes();for(let a=0;a<i.length;a++)await Dr(e,t,i[a],n,r)}else await Dr(e,t,a,n,r)}}function kr(e,t){if(!On(e)||!On(t))return;let{scrollTop:n,scrollLeft:r}=e;if(!n&&!r)return;let{transform:i}=t.style,a=new DOMMatrix(i),{a:o,b:s,c,d:l}=a;a.a=1,a.b=0,a.c=0,a.d=1,a.translateSelf(-r,-n),a.a=o,a.b=s,a.c=c,a.d=l,t.style.transform=a.toString()}function Ar(e,t){let{backgroundColor:n,width:r,height:i,style:a}=t,o=e.style;if(n&&o.setProperty(`background-color`,n,`important`),r&&o.setProperty(`width`,`${r}px`,`important`),i&&o.setProperty(`height`,`${i}px`,`important`),a)for(let e in a)o[e]=a[e]}let jr=/^[\w-:]+$/;async function Mr(e,t,n=!1,r){let{ownerDocument:i,ownerWindow:a,fontFamilies:o,onCloneEachNode:s}=t;if(i&&An(e))return r&&/\S/.test(e.data)&&r(e.data),i.createTextNode(e.data);if(i&&a&&J(e)&&(On(e)||Tn(e))){let r=await hr(e,t);if(t.isEnable(`removeAbnormalAttributes`)){let e=r.getAttributeNames();for(let t=e.length,n=0;n<t;n++){let t=e[n];jr.test(t)||r.removeAttribute(t)}}let i=t.currentNodeStyle=xr(e,r,n,t);n&&Ar(r,t);let a=!1;if(t.isEnable(`copyScrollbar`)){let t=[i.get(`overflow-x`)?.[0],i.get(`overflow-y`)?.[0]];a=t.includes(`scroll`)||(t.includes(`auto`)||t.includes(`overlay`))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}let c=i.get(`text-transform`)?.[0],l=tr(i.get(`font-family`)?.[0]),u=l?e=>{c===`uppercase`?e=e.toUpperCase():c===`lowercase`?e=e.toLowerCase():c===`capitalize`&&(e=e[0].toUpperCase()+e.substring(1)),l.forEach(t=>{let n=o.get(t);n||o.set(t,n=/* @__PURE__ */ new Set),e.split(``).forEach(e=>n.add(e))})}:void 0;return Tr(e,r,a,t,u),Sr(e,r),Mn(e)||await Or(e,r,t,u),await s?.(r),r}let c=e.cloneNode(!1);return await Or(e,c,t),await s?.(c),c}function Nr(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove()}catch(t){e.log.warn(`Failed to destroyContext`,t)}e.sandbox=void 0}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[]}function Pr(e){let{url:t,timeout:n,responseType:r,...i}=e,a=new AbortController,o=n?setTimeout(()=>a.abort(),n):void 0;return fetch(t,{signal:a.signal,...i}).then(e=>{if(!e.ok)throw Error(`Failed fetch, not 2xx response`,{cause:e});switch(r){case`arrayBuffer`:return e.arrayBuffer();case`dataUrl`:return e.blob().then(Xn);default:return e.text()}}).finally(()=>clearTimeout(o))}function Fr(e,t){let{url:n,requestType:r=`text`,responseType:i=`text`,imageDom:a}=t,o=n,{timeout:s,acceptOfImage:c,requests:l,fetchFn:u,fetch:{requestInit:d,bypassingCache:f,placeholderImage:p},font:m,workers:h,fontFamilies:g}=e;r===`image`&&(yn||bn)&&e.drawImageCount++;let _=l.get(n);if(!_){f&&f instanceof RegExp&&f.test(o)&&(o+=(/\?/.test(o)?`&`:`?`)+(/* @__PURE__ */ new Date()).getTime());let t=r.startsWith(`font`)&&m&&m.minify,v=/* @__PURE__ */ new Set;t&&r.split(`;`)[1].split(`,`).forEach(e=>{g.has(e)&&g.get(e).forEach(e=>v.add(e))});let y=t&&v.size,b={url:o,timeout:s,responseType:y?`arrayBuffer`:i,headers:r===`image`?{accept:c}:void 0,...d};_={type:r,resolve:void 0,reject:void 0,response:null},_.response=(async()=>{if(u&&r===`image`){let e=await u(n);if(e)return e}return!yn&&n.startsWith(`http`)&&h.length?new Promise((e,t)=>{h[l.size&h.length-1].postMessage({rawUrl:n,...b}),_.resolve=e,_.reject=t}):Pr(b)})().catch(t=>{if(l.delete(n),r===`image`&&p)return e.log.warn(`Failed to fetch image base64, trying to use placeholder image`,o),typeof p==`string`?p:p(a);throw t}),l.set(n,_)}return _.response}async function Ir(e,t,n,r){if(!Lr(e))return e;for(let[i,a]of zr(e,t))try{let t=await Fr(n,{url:a,requestType:r?`image`:`text`,responseType:`dataUrl`});e=e.replace(Br(i),`$1${t}$3`)}catch(e){n.log.warn(`Failed to fetch css data url`,i,e)}return e}function Lr(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}let Rr=/url\((['"]?)([^'"]+?)\1\)/g;function zr(e,t){let n=[];return e.replace(Rr,(e,r,i)=>(n.push([i,Wn(i,t)]),e)),n.filter(([e])=>!Un(e))}function Br(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,`\\$1`);return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,`g`)}let Vr=[`background-image`,`border-image-source`,`-webkit-border-image`,`-webkit-mask-image`,`list-style-image`];function Hr(e,t){return Vr.map(n=>{let r=e.getPropertyValue(n);return!r||r===`none`?null:((yn||bn)&&t.drawImageCount++,Ir(r,null,t,!0).then(t=>{t&&r!==t&&e.setProperty(n,t,e.getPropertyPriority(n))}))}).filter(Boolean)}function Ur(e,t){if(jn(e)){let n=e.currentSrc||e.src;if(!Un(n))return[Fr(t,{url:n,imageDom:e,requestType:`image`,responseType:`dataUrl`}).then(t=>{t&&(e.srcset=``,e.dataset.originalSrc=n,e.src=t||``)})];(yn||bn)&&t.drawImageCount++}else if(Tn(e)&&!Un(e.href.baseVal)){let n=e.href.baseVal;return[Fr(t,{url:n,imageDom:e,requestType:`image`,responseType:`dataUrl`}).then(t=>{t&&(e.dataset.originalSrc=n,e.href.baseVal=t||``)})]}return[]}function Wr(e,t){let{ownerDocument:n,svgDefsElement:r}=t,i=e.getAttribute(`href`)??e.getAttribute(`xlink:href`);if(!i)return[];let[a,o]=i.split(`#`);if(o){let i=`#${o}`,s=t.shadowRoots.reduce((e,t)=>e??t.querySelector(`svg ${i}`),n?.querySelector(`svg ${i}`));if(a&&e.setAttribute(`href`,i),r?.querySelector(i))return[];if(s)return r?.appendChild(s.cloneNode(!0)),[];if(a)return[Fr(t,{url:a,responseType:`text`}).then(e=>{r?.insertAdjacentHTML(`beforeend`,e)})]}return[]}function Gr(e,t){let{tasks:n}=t;J(e)&&((jn(e)||En(e))&&n.push(...Ur(e,t)),Dn(e)&&n.push(...Wr(e,t))),On(e)&&n.push(...Hr(e.style,t)),e.childNodes.forEach(e=>{Gr(e,t)})}async function Kr(e,t){let{ownerDocument:n,svgStyleElement:r,fontFamilies:i,fontCssTexts:a,tasks:o,font:s}=t;if(n&&r&&i.size){if(s&&s.cssText){let e=Qr(s.cssText,t);r.appendChild(n.createTextNode(`${e}
|
|
8
|
+
`))}else{let e=Array.from(n.styleSheets).filter(e=>{try{return`cssRules`in e&&!!e.cssRules.length}catch(n){return t.log.warn(`Error while reading CSS rules from ${e.href}`,n),!1}}),s=n.implementation.createHTMLDocument(``),c=s.createElement(`style`);s.head.appendChild(c);let l=c.sheet;await Promise.all(e.flatMap(e=>Array.from(e.cssRules).map(async e=>{if(Cn(e)){let n=e.href,r=``;try{r=await Fr(t,{url:n,requestType:`text`,responseType:`text`})}catch(e){t.log.warn(`Error fetch remote css import from ${n}`,e)}let i=r.replace(Rr,(e,t,r)=>e.replace(r,Wn(r,n)));for(let e of Yr(i))try{l.insertRule(e,l.cssRules.length)}catch(n){t.log.warn(`Error inserting rule from remote css import`,{rule:e,error:n})}}}))),l.cssRules.length&&e.push(l);let u=[];e.forEach(e=>{$r(e.cssRules,u)}),u.filter(e=>Sn(e)&&Lr(e.style.getPropertyValue(`src`))&&tr(e.style.getPropertyValue(`font-family`))?.some(e=>i.has(e))).forEach(e=>{let i=e,s=a.get(i.cssText);s?r.appendChild(n.createTextNode(`${s}
|
|
9
|
+
`)):o.push(Ir(i.cssText,i.parentStyleSheet?i.parentStyleSheet.href:null,t).then(e=>{e=Qr(e,t),a.set(i.cssText,e),r.appendChild(n.createTextNode(`${e}
|
|
10
|
+
`))}))})}}}let qr=/(\/\*[\s\S]*?\*\/)/g,Jr=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;function Yr(e){if(e==null)return[];let t=[],n=e.replace(qr,``);for(;;){let e=Jr.exec(n);if(!e)break;t.push(e[0])}n=n.replace(Jr,``);let r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i=/* @__PURE__ */ RegExp(`((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})`,`gi`);for(;;){let e=r.exec(n);if(e)i.lastIndex=r.lastIndex;else if(e=i.exec(n),e)r.lastIndex=i.lastIndex;else break;t.push(e[0])}return t}let Xr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Zr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Qr(e,t){let{font:n}=t,r=n?n?.preferredFormat:void 0;return r?e.replace(Zr,e=>{for(;;){let[t,,n]=Xr.exec(e)||[];if(!n)return``;if(n===r)return`src: ${t};`}}):e}function $r(e,t=[]){for(let n of Array.from(e))wn(n)?t.push(...$r(n.cssRules)):`cssRules`in n?$r(n.cssRules,t):t.push(n);return t}let ei=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;function ti(e){return ei.test(e.innerHTML)}async function ni(e,t){let n=await ar(e,t);if(J(n.node)&&Tn(n.node)&&!ti(n.node))return n.node;let{ownerDocument:r,log:i,tasks:a,svgStyleElement:o,svgDefsElement:s,svgStyles:c,font:l,progress:u,autoDestruct:d,onCloneNode:f,onEmbedNode:p,onCreateForeignObjectSvg:m}=n;i.time(`clone node`);let h=await Mr(n.node,n,!0);if(o&&r){let e=``;c.forEach((t,n)=>{e+=`${t.join(`,
|
|
11
|
+
`)} {
|
|
12
|
+
${n}
|
|
13
|
+
}
|
|
14
|
+
`}),o.appendChild(r.createTextNode(e))}i.timeEnd(`clone node`),await f?.(h),l!==!1&&J(h)&&(i.time(`embed web font`),await Kr(h,n),i.timeEnd(`embed web font`)),i.time(`embed node`),Gr(h,n);let g=a.length,_=0,v=async()=>{for(;;){let e=a.pop();if(!e)break;try{await e}catch(e){n.log.warn(`Failed to run task`,e)}u?.(++_,g)}};u?.(_,g),await Promise.all([...Array.from({length:4})].map(v)),i.timeEnd(`embed node`),await p?.(h);let y=ri(h,n);return s&&y.insertBefore(s,y.children[0]),o&&y.insertBefore(o,y.children[0]),d&&Nr(n),await m?.(y),y}function ri(e,t){let{width:n,height:r}=t,i=qn(n,r,e.ownerDocument),a=i.ownerDocument.createElementNS(i.namespaceURI,`foreignObject`);return a.setAttributeNS(null,`x`,`0%`),a.setAttributeNS(null,`y`,`0%`),a.setAttributeNS(null,`width`,`100%`),a.setAttributeNS(null,`height`,`100%`),a.append(e),i.appendChild(a),i}async function ii(e,t){let n=await ar(e,t),r=await ni(n),i=Jn(r,n.isEnable(`removeControlCharacter`));return n.autoDestruct||(n.svgStyleElement=sr(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(Kn,`defs`),n.svgStyles.clear()),await lr(Zn(i,r.ownerDocument),n)}async function ai(e,t){let n=await ar(e,t),{log:r,quality:i,type:a,dpi:o}=n,s=await ii(n);r.time(`canvas to data url`);let c=s.toDataURL(a,i);if([`image/png`,`image/jpeg`].includes(a)&&o&&hn&&gn){let[e,t]=c.split(`,`),n=0,r=!1;if(a===`image/png`){let e=fn(t);e>=0?(n=Math.ceil((e+28)/3)*4,r=!0):n=44}else a===`image/jpeg`&&(n=24);let i=t.substring(0,n),s=t.substring(n),l=window.atob(i),u=new Uint8Array(l.length);for(let e=0;e<u.length;e++)u[e]=l.charCodeAt(e);let d=a===`image/png`?dn(u,o,r):on(u,o);c=[e,`,`,window.btoa(String.fromCharCode(...d)),s].join(``)}return r.timeEnd(`canvas to data url`),c}async function oi(e,t){return ai(await ar(e,{...t,type:`image/jpeg`}))}async function si(e,t){let n=e.getBoundingClientRect(),r=n.width*n.height<4800&&e.parentElement?e.parentElement:e,i=r.getBoundingClientRect(),a=Math.min(window.devicePixelRatio||1,1600/Math.max(i.width+48,i.height+48,1));try{let e=await oi(r,{scale:a,quality:.85,backgroundColor:ci(r),filter:e=>e!==t,timeout:4e3});return e.startsWith(`data:image/jpeg`)?{name:`tencil-element.jpg`,mimeType:`image/jpeg`,dataUrl:e}:null}catch(e){return console.warn(`[tencil] screenshot failed`,e),null}}function ci(e){let t=e;for(;t;){let e=getComputedStyle(t).backgroundColor;if(e&&e!==`transparent`&&!/rgba\(.*,\s*0\)$/.test(e))return e;t=t.parentElement}return`#ffffff`}var li=0;Array.isArray;function Y(e,t,r,i,a,o){t||={};var s,c,l=t;if(`ref`in l&&typeof e!=`function`)for(c in l={},t)c==`ref`?s=t[c]:l[c]=t[c];var u={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--li,__i:-1,__u:0};return(a||o)&&(u.__source=a,u.__self=o),n.vnode&&n.vnode(u),u}let ui={codex:{viewBox:`0 0 256 260`,path:`M239.184 106.203a64.716 64.716 0 0 0-5.576-53.103C219.452 28.459 191 15.784 163.213 21.74A65.586 65.586 0 0 0 52.096 45.22a64.716 64.716 0 0 0-43.23 31.36c-14.31 24.602-11.061 55.634 8.033 76.74a64.665 64.665 0 0 0 5.525 53.102c14.174 24.65 42.644 37.324 70.446 31.36a64.72 64.72 0 0 0 48.754 21.744c28.481.025 53.714-18.361 62.414-45.481a64.767 64.767 0 0 0 43.229-31.36c14.137-24.558 10.875-55.423-8.083-76.483Zm-97.56 136.338a48.397 48.397 0 0 1-31.105-11.255l1.535-.87 51.67-29.825a8.595 8.595 0 0 0 4.247-7.367v-72.85l21.845 12.636c.218.111.37.32.409.563v60.367c-.056 26.818-21.783 48.545-48.601 48.601Zm-104.466-44.61a48.345 48.345 0 0 1-5.781-32.589l1.534.921 51.722 29.826a8.339 8.339 0 0 0 8.441 0l63.181-36.425v25.221a.87.87 0 0 1-.358.665l-52.335 30.184c-23.257 13.398-52.97 5.431-66.404-17.803ZM23.549 85.38a48.499 48.499 0 0 1 25.58-21.333v61.39a8.288 8.288 0 0 0 4.195 7.316l62.874 36.272-21.845 12.636a.819.819 0 0 1-.767 0L41.353 151.53c-23.211-13.454-31.171-43.144-17.804-66.405v.256Zm179.466 41.695-63.08-36.63L161.73 77.86a.819.819 0 0 1 .768 0l52.233 30.184a48.6 48.6 0 0 1-7.316 87.635v-61.391a8.544 8.544 0 0 0-4.4-7.213Zm21.742-32.69-1.535-.922-51.619-30.081a8.39 8.39 0 0 0-8.492 0L99.98 99.808V74.587a.716.716 0 0 1 .307-.665l52.233-30.133a48.652 48.652 0 0 1 72.236 50.391v.205ZM88.061 139.097l-21.845-12.585a.87.87 0 0 1-.41-.614V65.685a48.652 48.652 0 0 1 79.757-37.346l-1.535.87-51.67 29.825a8.595 8.595 0 0 0-4.246 7.367l-.051 72.697Zm11.868-25.58 28.138-16.217 28.188 16.218v32.434l-28.086 16.218-28.188-16.218-.052-32.434Z`,className:`agent-mono`,label:`Codex`},claudeAgent:{viewBox:`0 0 256 257`,path:`m50.228 170.321 50.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0 125.796l.583-3.759 5.12-3.434 7.324.648 16.202 1.101 24.304 1.685 17.629 1.037 26.118 2.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758 7-7.713 9.397.649 2.398.648 9.527 7.323 20.35 15.75L94.817 91.9l3.889 3.24 1.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42 0 82.05 1.426l4.472 3.888 6.61 15.101 10.694 23.786 16.591 32.34 4.861 9.592 2.592 8.879.973 2.722h1.685v-1.556l1.36-18.211 2.528-22.36 2.463-28.776.843-8.1 4.018-9.722 7.971-5.25 6.222 2.981 5.12 7.324-.713 4.73-3.046 19.768-5.962 30.98-3.889 20.739h2.268l2.593-2.593 10.499-13.934 17.628-22.036 7.778-8.749 9.073-9.657 5.833-4.601h11.018l8.1 12.055-3.628 12.443-11.342 14.388-9.398 12.184-13.48 18.147-8.426 14.518.778 1.166 2.01-.194 30.46-6.481 16.462-2.982 19.637-3.37 8.88 4.148.971 4.213-3.5 8.62-20.998 5.184-24.628 4.926-36.682 8.685-.454.324.519.648 16.526 1.555 7.065.389h17.304l32.21 2.398 8.426 5.574 5.055 6.805-.843 5.184-12.962 6.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666 11.406 21.387 19.314 26.767 24.887 1.36 6.157-3.434 4.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73 6.935 25.017 37.59 1.296 11.536-1.814 3.76-6.481 2.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194 77.448-3.37 3.953-7.778 2.981-6.48-4.925-3.436-7.972 3.435-15.749 4.148-20.544 3.37-16.333 3.046-20.285 1.815-6.74-.13-.454-1.49.194-15.295 20.999-23.267 31.433-18.406 19.702-4.407 1.75-7.648-3.954.713-7.064 4.277-6.286 25.47-32.405 15.36-20.092 9.917-11.6-.065-1.686h-.583L44.07 198.125l-12.055 1.555-5.185-4.86.648-7.972 2.463-2.593 20.35-13.999-.064.065Z`,className:`agent-claude`,label:`Claude`},cursor:{viewBox:`0 0 466.73 532.09`,path:`M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z`,className:`agent-mono`,label:`Cursor`}};function di(e){if(ui[e])return ui[e];let t=e.toLowerCase();if(t.includes(`claude`))return ui.claudeAgent;if(t.includes(`codex`)||t.includes(`openai`))return ui.codex;if(t.includes(`cursor`))return ui.cursor}function fi({agent:e,size:t=13}){if(!e)return null;let n=di(e);return n?/* @__PURE__ */ Y(`svg`,{class:`agent-icon ${n.className}`,width:t,height:t,viewBox:n.viewBox,role:`img`,"aria-label":n.label,children:/* @__PURE__ */ Y(`path`,{d:n.path})}):null}function X({children:e,size:t=16}){return/* @__PURE__ */ Y(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,children:e})}let pi=()=>/* @__PURE__ */ Y(X,{children:[/* @__PURE__ */ Y(`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`}),/* @__PURE__ */ Y(`path`,{d:`M12 8v8M8 12h8`})]}),mi=()=>/* @__PURE__ */ Y(X,{children:[/* @__PURE__ */ Y(`path`,{d:`M22 12h-6l-2 3h-4l-2-3H2`}),/* @__PURE__ */ Y(`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`})]}),hi=()=>/* @__PURE__ */ Y(X,{children:[/* @__PURE__ */ Y(`path`,{d:`M10.7 5.1A10.8 10.8 0 0 1 12 5c7 0 10 7 10 7a13.2 13.2 0 0 1-1.7 2.7`}),/* @__PURE__ */ Y(`path`,{d:`M6.6 6.6A13.5 13.5 0 0 0 2 12s3 7 10 7a9.7 9.7 0 0 0 5.4-1.6`}),/* @__PURE__ */ Y(`path`,{d:`M9.9 9.9a3 3 0 1 0 4.2 4.2M2 2l20 20`})]}),gi=()=>/* @__PURE__ */ Y(X,{children:[/* @__PURE__ */ Y(`path`,{d:`M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z`}),/* @__PURE__ */ Y(`circle`,{cx:`12`,cy:`12`,r:`3`})]}),_i=()=>/* @__PURE__ */ Y(X,{children:/* @__PURE__ */ Y(`path`,{d:`m5 12 7-7 7 7M12 19V5`})}),vi=()=>/* @__PURE__ */ Y(X,{size:12,children:/* @__PURE__ */ Y(`rect`,{x:`5`,y:`5`,width:`14`,height:`14`,rx:`2`,fill:`currentColor`})}),yi=()=>/* @__PURE__ */ Y(X,{children:/* @__PURE__ */ Y(`path`,{d:`M20 6 9 17l-5-5`})}),bi=()=>/* @__PURE__ */ Y(X,{children:[/* @__PURE__ */ Y(`path`,{d:`M9 14 4 9l5-5`}),/* @__PURE__ */ Y(`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 0 11H11`})]}),xi=()=>/* @__PURE__ */ Y(X,{children:/* @__PURE__ */ Y(`path`,{d:`M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})}),Si=()=>/* @__PURE__ */ Y(X,{size:14,children:/* @__PURE__ */ Y(`path`,{d:`M15 3h6v6M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`})}),Ci=()=>/* @__PURE__ */ Y(X,{children:/* @__PURE__ */ Y(`path`,{d:`M18 6 6 18M6 6l12 12`})}),wi=()=>/* @__PURE__ */ Y(X,{size:14,children:[/* @__PURE__ */ Y(`path`,{d:`M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z`}),/* @__PURE__ */ Y(`circle`,{cx:`12`,cy:`13`,r:`3`})]}),Ti=()=>/* @__PURE__ */ Y(X,{size:12,children:/* @__PURE__ */ Y(`path`,{d:`m16 18 6-6-6-6M8 6l-6 6 6 6`})}),Ei=()=>/* @__PURE__ */ Y(X,{children:[/* @__PURE__ */ Y(`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}),/* @__PURE__ */ Y(`circle`,{cx:`12`,cy:`12`,r:`3`})]}),Di=()=>/* @__PURE__ */ Y(X,{size:12,children:/* @__PURE__ */ Y(`path`,{d:`m6 9 6 6 6-6`})}),Oi=tt(()=>{let e=/* @__PURE__ */ new Map,t=[...Gt.value].reverse().filter(e=>e.anchor);for(let[n,r]of t.entries())e.set(r.id,n+1);return e});function ki(){if(Ht.value,Vt.value)return null;let e=W.value;return/* @__PURE__ */ Y(C,{children:[Kt.value.map(e=>/* @__PURE__ */ Y(Ai,{thread:e},e.id)),e&&/* @__PURE__ */ Y(ji,{})]})}function Ai({thread:e}){if(!e.anchor)return null;let t=tn(e.anchor);if(!t)return null;let n=G.value===e.id;return/* @__PURE__ */ Y(`button`,{type:`button`,class:`pin pin-${Mi(e)}${n?` pin-open`:``}`,style:{transform:`translate(${t.x}px, ${t.y}px)`},title:e.title,onClick:()=>{W.value=null,G.value=n?null:e.id},children:/* @__PURE__ */ Y(`span`,{class:`pin-body`,children:Oi.value.get(e.id)??`•`})})}function ji(){let e=W.value,t=tn(e.anchor,e.element);return t?/* @__PURE__ */ Y(`div`,{class:`pin pin-draft pin-open`,style:{transform:`translate(${t.x}px, ${t.y}px)`},children:/* @__PURE__ */ Y(`span`,{class:`pin-body`,children:`+`})}):null}function Mi(e){if(e.resolved)return`resolved`;switch(e.status){case`starting`:case`working`:return`working`;case`waiting`:return`waiting`;case`error`:return`error`;default:return`done`}}let Ni=`tencil:open`;function Pi(){let[e,t]=P(`page`),n=B.value?.label??`Agent`,r=bt.value===`open`&&B.value?.state===`ready`,i=B.value?.id;return F(()=>{r&&K.value&&e===`provider`&&It()},[e,K.value,r,i]),K.value?/* @__PURE__ */ Y(`aside`,{class:`inbox`,children:[/* @__PURE__ */ Y(`header`,{class:`inbox-header`,children:[/* @__PURE__ */ Y(`div`,{class:`segmented`,children:[/* @__PURE__ */ Y(`button`,{type:`button`,class:e===`page`?`active`:``,onClick:()=>t(`page`),children:`This page`}),/* @__PURE__ */ Y(`button`,{type:`button`,class:e===`all`?`active`:``,onClick:()=>t(`all`),children:`All pins`}),/* @__PURE__ */ Y(`button`,{type:`button`,class:e===`provider`?`active`:``,onClick:()=>t(`provider`),children:n})]}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`icon-button`,title:`Close`,onClick:()=>{K.value=!1},children:/* @__PURE__ */ Y(Ci,{})})]}),e===`provider`?/* @__PURE__ */ Y(Ii,{label:n}):/* @__PURE__ */ Y(Fi,{scope:e})]}):null}function Fi({scope:e}){let t=Gt.value.filter(e=>Bt.value||!e.resolved).filter(t=>e===`all`||t.anchor&&t.pageUrl&&Wt(t.pageUrl)===Ut.value);return/* @__PURE__ */ Y(C,{children:[/* @__PURE__ */ Y(`label`,{class:`inbox-filter`,children:[/* @__PURE__ */ Y(`input`,{type:`checkbox`,checked:Bt.value,onChange:e=>{Bt.value=e.target.checked}}),`Show resolved`]}),/* @__PURE__ */ Y(`div`,{class:`inbox-list`,children:t.length===0?/* @__PURE__ */ Y(`p`,{class:`empty`,children:[`No pins yet. Press `,/* @__PURE__ */ Y(`kbd`,{children:`C`}),` and click anything on the page.`]}):t.map(e=>/* @__PURE__ */ Y(zi,{thread:e},e.id))})]})}function Ii({label:e}){let t=Ct.value;return t?t.length===0?/* @__PURE__ */ Y(`p`,{class:`empty`,children:[`No `,e,` threads in this project yet.`]}):/* @__PURE__ */ Y(`div`,{class:`inbox-list inbox-list-provider`,children:t.map(e=>/* @__PURE__ */ Y(Li,{summary:e},e.id))}):/* @__PURE__ */ Y(`p`,{class:`empty`,children:[`Loading `,e,` threads…`]})}function Li({summary:e}){let t=wt.value,n=[...V.value.values()].filter(t=>t.provider.threadId===e.id&&t.anchor).length;return/* @__PURE__ */ Y(`button`,{type:`button`,class:`inbox-item provider-item`,onClick:()=>{let t=Lt(e);t&&(G.value=t)},children:[/* @__PURE__ */ Y(`span`,{class:`provider-item-project`,children:[t&&/* @__PURE__ */ Y(Ri,{project:t}),/* @__PURE__ */ Y(`span`,{class:`provider-item-project-name`,children:t?.name}),e.status===`working`||e.status===`waiting`?/* @__PURE__ */ Y(`span`,{class:`provider-item-state state-${e.status}`,children:Hi(e.status)}):e.background===`monitoring`?/* @__PURE__ */ Y(`span`,{class:`provider-item-state state-monitoring`,children:`Monitoring`}):/* @__PURE__ */ Y(`span`,{class:`provider-item-time`,children:Ui(e.updatedAt)})]}),/* @__PURE__ */ Y(`span`,{class:`provider-item-title`,children:e.title}),(e.branch||e.pullRequest||e.agent||n>0)&&/* @__PURE__ */ Y(`span`,{class:`provider-item-meta`,children:[e.branch&&/* @__PURE__ */ Y(`span`,{class:`provider-item-branch`,children:e.branch}),e.pullRequest&&/* @__PURE__ */ Y(`span`,{class:`provider-item-pr`,children:[`#`,e.pullRequest.number]}),n>0&&/* @__PURE__ */ Y(`span`,{class:`provider-item-pins`,children:[n,` pin`,n===1?``:`s`]}),/* @__PURE__ */ Y(fi,{agent:e.agent})]})]})}function Ri({project:e}){return e.emoji?/* @__PURE__ */ Y(`span`,{class:`project-icon project-icon-emoji`,children:e.emoji}):e.iconUrl?/* @__PURE__ */ Y(`img`,{class:`project-icon`,src:e.iconUrl,alt:``}):/* @__PURE__ */ Y(`span`,{class:`project-icon project-icon-letter`,children:e.name.slice(0,1)})}function zi({thread:e}){let t=!!(e.anchor&&e.pageUrl),n=!t||Wt(e.pageUrl)===Ut.value,r=[...e.messages].reverse().find(e=>e.role===`assistant`);return/* @__PURE__ */ Y(`button`,{type:`button`,class:`inbox-item${G.value===e.id?` active`:``}`,onClick:()=>{if(!n){sessionStorage.setItem(Ni,e.id),location.href=e.pageUrl;return}G.value=e.id,Bi(e)},children:[t?/* @__PURE__ */ Y(`span`,{class:`pin pin-static pin-${Mi(e)}`,children:/* @__PURE__ */ Y(`span`,{class:`pin-body`,children:Oi.value.get(e.id)})}):/* @__PURE__ */ Y(`span`,{class:`thread-dot thread-dot-${e.status}`}),/* @__PURE__ */ Y(`span`,{class:`inbox-item-body`,children:[/* @__PURE__ */ Y(`span`,{class:`inbox-item-title`,children:e.title}),/* @__PURE__ */ Y(`span`,{class:`inbox-item-meta`,children:[!t&&/* @__PURE__ */ Y(`span`,{children:`Not pinned · `}),t&&!n&&/* @__PURE__ */ Y(`span`,{children:[new URL(e.pageUrl).pathname,` · `]}),Vi(e),` · `,Ui(e.updatedAt)]}),r&&/* @__PURE__ */ Y(`span`,{class:`inbox-item-preview`,children:r.text.slice(0,140)})]})]})}function Bi(e){if(e.anchor)try{document.querySelector(e.anchor.selector)?.scrollIntoView({block:`center`,behavior:`smooth`})}catch{}}function Vi(e){if(e.resolved)return`Resolved`;switch(e.status){case`starting`:return`Starting`;case`working`:return`Working`;case`waiting`:return`Needs input`;case`error`:return`Error`;default:return`Done`}}function Hi(e){switch(e){case`working`:return`Working`;case`waiting`:return`Needs input`;case`error`:return`Error`;default:return`Idle`}}function Ui(e){let t=Math.max(0,(Date.now()-Date.parse(e))/1e3);return t<60?`just now`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function Wi({placeholder:e,autoFocus:t,disabled:n,busy:r,onSubmit:i,onCancel:a,children:o}){let[s,c]=P(``),l=ke(null);F(()=>{t&&l.current?.focus({preventScroll:!0})},[t]),F(()=>{let e=l.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,200)}px`)},[s]);let u=s.trim().length>0&&!n&&!r,d=async()=>{u&&(await i(s.trim()),c(``))};return/* @__PURE__ */ Y(`div`,{class:`prompt-input`,children:[/* @__PURE__ */ Y(`textarea`,{ref:l,rows:1,value:s,placeholder:e,disabled:n,onInput:e=>c(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&!e.shiftKey&&!e.isComposing?(e.preventDefault(),d()):e.key===`Escape`&&(e.preventDefault(),a?.())}}),/* @__PURE__ */ Y(`div`,{class:`prompt-actions`,children:[/* @__PURE__ */ Y(`div`,{class:`prompt-extras`,children:o}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`send`,disabled:!u,onClick:()=>void d(),"aria-label":`Send`,title:`Send (Enter)`,children:r?/* @__PURE__ */ Y(`span`,{class:`spinner`}):/* @__PURE__ */ Y(_i,{})})]})]})}let Gi=z(null);function Ki(){Ht.value;let e=W.value,t=ke(null),[n,r]=P(140),[i,a]=P(!1),[o,s]=P(!1),[c,l]=P(!1),u=B.value?.state===`ready`,d=B.value?.id;if(F(()=>{e&&u&&It()},[e,u,d]),F(()=>{Gi.value=null},[d]),Oe(()=>{t.current&&r(t.current.offsetHeight)}),!e)return null;let f=tn(e.anchor,e.element);if(!f)return null;let{left:p,top:m,origin:h}=rn(f,{width:340,height:n}),g=B.value,_=g?.state===`ready`,v=Gi.value;return/* @__PURE__ */ Y(`div`,{ref:t,class:`popover composer`,style:{left:`${p}px`,top:`${m}px`,width:`340px`,transformOrigin:h},children:[/* @__PURE__ */ Y(`div`,{class:`composer-target`,children:[/* @__PURE__ */ Y(`span`,{class:`chip`,children:[/* @__PURE__ */ Y(Ti,{}),e.label]}),g&&/* @__PURE__ */ Y(`button`,{type:`button`,class:`composer-provider${c?` open`:``}`,onClick:()=>l(!c),title:`Send to a new thread or continue an existing one`,children:[/* @__PURE__ */ Y(`span`,{class:`composer-provider-label`,children:[`→ `,v?v.title:`New ${g.label} thread`]}),/* @__PURE__ */ Y(Di,{})]})]}),c&&/* @__PURE__ */ Y(qi,{onPick:e=>{Gi.value=e,l(!1)}}),/* @__PURE__ */ Y(Wi,{placeholder:_?v?`Continue the thread with this element…`:`What should change here?`:`Waiting for the agent connection…`,autoFocus:!0,busy:o,disabled:!_,onSubmit:async t=>{s(!0);try{let n=await e.context,r=[];if(i){let t=await si(e.element,$t());t&&r.push(t)}let a=yt(),o={...e.anchor,selector:n.selector};if(!H({type:`thread.create`,id:a,pageUrl:location.href,prompt:t,anchor:o,context:n,attachments:r,...v?{providerThreadId:v.id}:{}}))return;let s=(/* @__PURE__ */ new Date()).toISOString();Mt({id:a,title:t,pageUrl:location.href,anchor:o,context:n,status:v?`working`:`starting`,resolved:!1,messages:[{id:`local:${a}`,role:`user`,text:t,streaming:!1,createdAt:s}],provider:{id:g?.id??`unknown`,...v?{threadId:v.id,url:v.url}:{}},createdAt:s,updatedAt:s}),W.value=null,G.value=a}finally{s(!1)}},onCancel:()=>{W.value=null},children:/* @__PURE__ */ Y(`button`,{type:`button`,class:`toggle${i?` toggle-on`:``}`,onClick:()=>a(!i),title:i?`Screenshot attached`:`No screenshot`,"aria-pressed":i,children:/* @__PURE__ */ Y(wi,{})})}),!_&&g?.detail&&/* @__PURE__ */ Y(`p`,{class:`hint`,children:g.detail})]})}function qi({onPick:e}){let t=Ct.value,n=Gi.value?.id??null;return/* @__PURE__ */ Y(`div`,{class:`target-menu`,role:`listbox`,children:[/* @__PURE__ */ Y(`button`,{type:`button`,role:`option`,"aria-selected":n===null,class:`target-option${n===null?` selected`:``}`,onClick:()=>e(null),children:/* @__PURE__ */ Y(`span`,{class:`target-option-title`,children:`New thread`})}),t===null&&/* @__PURE__ */ Y(`p`,{class:`target-empty`,children:`Loading threads…`}),t?.map(t=>/* @__PURE__ */ Y(`button`,{type:`button`,role:`option`,"aria-selected":n===t.id,class:`target-option${n===t.id?` selected`:``}`,onClick:()=>e(t),children:[/* @__PURE__ */ Y(`span`,{class:`thread-dot thread-dot-${t.status}`}),/* @__PURE__ */ Y(`span`,{class:`target-option-title`,children:t.title}),/* @__PURE__ */ Y(fi,{agent:t.agent,size:12}),/* @__PURE__ */ Y(`span`,{class:`target-option-meta`,children:Ui(t.updatedAt)})]},t.id))]})}
|
|
15
|
+
/**
|
|
16
|
+
* @license bippy
|
|
17
|
+
*
|
|
18
|
+
* Copyright (c) Aiden Bai
|
|
19
|
+
*
|
|
20
|
+
* This source code is licensed under the MIT license found in the
|
|
21
|
+
* LICENSE file in the root directory of this source tree.
|
|
22
|
+
*/
|
|
23
|
+
let Ji=`bippy-0.7.3`,Yi=Object.defineProperty,Xi=()=>{},Zi=e=>e.__REACT_DEVTOOLS_GLOBAL_HOOK__,Qi=e=>Object.assign(e,{[Symbol.dispose]:e}),$i=e=>{let t=e.current.memoizedState;return t===null||t!==void 0&&(t.element===null||t.element===void 0)},ea=e=>{try{Function.prototype.toString.call(e).indexOf(`^_^`)>-1&&setTimeout(()=>{throw Error(`React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://react.dev/link/perf-use-production-build`)})}catch{}},ta=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>!!(e&&`getFiberRoots`in e&&e._isBippyHook!==!0),na=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>{if(!e||typeof e.inject!=`function`||ta(e))return!1;try{return Function.prototype.toString.call(e.inject).includes(`(injected)`)}catch{return!1}},ra=/* @__PURE__ */ new Set,ia=/* @__PURE__ */ new Set,aa=/* @__PURE__ */ new WeakMap,oa=/* @__PURE__ */ new Set,sa=/* @__PURE__ */ new Set,ca=/* @__PURE__ */ new WeakMap,la=(e,t)=>{ra.add(e);let n=aa.get(e)??/* @__PURE__ */ new Set;n.add(t),aa.set(e,n)},ua=e=>{for(let t of ra)aa.get(t)?.has(e)&&t()},da=(e,t)=>{for(let n of oa)n.target===e&&n.listener(t)},fa=(e,t)=>{for(let n of sa)n(e,t)},pa=e=>(sa.add(e),Qi(()=>{sa.delete(e)})),ma=e=>Object.prototype.toString.call(e)===`[object Map]`,ha=e=>(ma(e.renderers)||(e.renderers=/* @__PURE__ */ new Map),e.renderers),ga=(e,t,n,r,i)=>{n.set(r,i),ia.add(i),e._instrumentationIsActive||(e._instrumentationIsActive=!0,ua(t));let a=ca.get(t)??/* @__PURE__ */ new WeakSet;ca.set(t,a),!a.has(i)&&(a.add(i),da(t,i))},_a=(e,t=globalThis)=>{e&&la(e,t);let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map,i=e=>{let t=r.get(e)??/* @__PURE__ */ new Set;return r.set(e,t),t},a=0,o={_instrumentationIsActive:!1,_instrumentationSource:Ji,_isBippyHook:!0,checkDCE:ea,getFiberRoots:i,hasUnsupportedRendererAttached:!1,inject:e=>{let r=++a;return ga(o,t,n,r,e),r},on:Xi,onCommitFiberRoot:(e,t)=>{let n=i(e);$i(t)?n.delete(t):n.add(t)},onCommitFiberUnmount:Xi,onPostCommitFiberRoot:Xi,renderers:n,supportsFiber:!0,supportsFlight:!0};try{if(Yi(t,`__REACT_DEVTOOLS_GLOBAL_HOOK__`,{configurable:!0,enumerable:!0,get:()=>o,set:n=>{if(n&&typeof n==`object`){let r=o.renderers;o=n;let i=ha(o);r.forEach((e,t)=>{ia.add(e),i.set(t,e)}),(r.size>0||sa.size>0)&&va(e,t),fa(o,t)}}}),t===globalThis&&typeof window<`u`){let e=window.hasOwnProperty.bind(window),t=Object.getOwnPropertyDescriptor(window,`hasOwnProperty`),n=!1,r=()=>{t?Yi(window,`hasOwnProperty`,t):Reflect.deleteProperty(window,`hasOwnProperty`)};Yi(window,`hasOwnProperty`,{configurable:!0,value:t=>!n&&t===`__REACT_DEVTOOLS_GLOBAL_HOOK__`?(n=!0,r(),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,!1):e(t),writable:!0})}}catch{va(e,t)}return o},va=(e,t=globalThis)=>{e&&la(e,t);let n=!1,r=Zi(t);if(!r)return;let i=ha(r);if(!r._instrumentationSource){r.checkDCE=ea,r.supportsFiber=!0,r.supportsFlight=!0,r.hasUnsupportedRendererAttached=!1,r._instrumentationSource=Ji,r._instrumentationIsActive=!1;let e=ta(r);e||(r.on=Xi),i.size?(i.forEach(e=>ia.add(e)),r._instrumentationIsActive=!0,ua(t),n=!0):!e&&na(r)&&(r._instrumentationIsActive=!0,ua(t),n=!0);let a=r.inject;r.inject=e=>{let n=a.call(r,e);return ga(r,t,i,n,e),n}}!n&&(i.size||r._instrumentationIsActive)&&e?.()},ya=(e=globalThis)=>Object.hasOwn(e,`__REACT_DEVTOOLS_GLOBAL_HOOK__`),ba=(e,t=globalThis)=>ya(t)?(va(e,t),Zi(t)??_a(e,t)):_a(e,t);
|
|
24
|
+
/**
|
|
25
|
+
* @license bippy
|
|
26
|
+
*
|
|
27
|
+
* Copyright (c) Aiden Bai
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the MIT license found in the
|
|
30
|
+
* LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/
|
|
32
|
+
try{ba()}catch{}
|
|
33
|
+
/**
|
|
34
|
+
* @license bippy
|
|
35
|
+
*
|
|
36
|
+
* Copyright (c) Aiden Bai
|
|
37
|
+
*
|
|
38
|
+
* This source code is licensed under the MIT license found in the
|
|
39
|
+
* LICENSE file in the root directory of this source tree.
|
|
40
|
+
*/
|
|
41
|
+
let xa=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,Sa=/^\d+$/,Ca=e=>wa(e)!==null,wa=e=>{let t=xa.exec(e);if(!t)return null;let n=t[4]?.split(`.`)??[];return n.some(e=>Sa.test(e)&&e.length>1&&e.startsWith(`0`))?null:{major:t[1],minor:t[2],patch:t[3],prerelease:n}},Ta=(e,t)=>e.length===t.length?e===t?0:e<t?-1:1:e.length<t.length?-1:1,Ea=(e,t)=>{let n=Sa.test(e),r=Sa.test(t);return n&&r?Ta(e,t):n===r?e===t?0:e<t?-1:1:n?-1:1},Da=(e,t)=>{if(e.length===0||t.length===0)return e.length===t.length?0:e.length===0?1:-1;let n=Math.max(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===void 0||i===void 0)return n===void 0?-1:1;let a=Ea(n,i);if(a!==0)return a}return 0},Oa=(e,t)=>{let n=wa(e),r=wa(t);if(!n||!r)return null;let i=Ta(n.major,r.major);if(i!==0)return i;let a=Ta(n.minor,r.minor);if(a!==0)return a;let o=Ta(n.patch,r.patch);return o===0?Da(n.prerelease,r.prerelease):o},ka={ChildDeletion:16,Cloned:8,ContentReset:32,Hydrating:4096,PerformedWork:1,Placement:2,Snapshot:1024,Update:4,Visibility:8192},Aa=(e=>e)({"16.0.0":{ActivityComponent:-1,CacheComponent:-1,ClassComponent:2,ContextConsumer:12,ContextProvider:13,CoroutineComponent:7,CoroutineHandlerPhase:8,DehydratedSuspenseComponent:-1,ForwardRef:14,Fragment:10,FunctionComponent:1,HostComponent:5,HostHoistable:-1,HostPortal:4,HostRoot:3,HostSingleton:-1,HostText:6,IncompleteClassComponent:-1,IncompleteFunctionComponent:-1,IndeterminateComponent:0,LazyComponent:-1,LegacyHiddenComponent:-1,MemoComponent:-1,Mode:11,OffscreenComponent:-1,Profiler:15,ScopeComponent:-1,SimpleMemoComponent:-1,SuspenseComponent:16,SuspenseListComponent:-1,Throw:-1,TracingMarkerComponent:-1,ViewTransitionComponent:-1,YieldComponent:9},"16.4.3-alpha":{ActivityComponent:-1,CacheComponent:-1,ClassComponent:2,ContextConsumer:11,ContextProvider:12,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:-1,ForwardRef:13,Fragment:9,FunctionComponent:0,HostComponent:7,HostHoistable:-1,HostPortal:6,HostRoot:5,HostSingleton:-1,HostText:8,IncompleteClassComponent:-1,IncompleteFunctionComponent:-1,IndeterminateComponent:4,LazyComponent:-1,LegacyHiddenComponent:-1,MemoComponent:-1,Mode:10,OffscreenComponent:-1,Profiler:15,ScopeComponent:-1,SimpleMemoComponent:-1,SuspenseComponent:16,SuspenseListComponent:-1,Throw:-1,TracingMarkerComponent:-1,ViewTransitionComponent:-1,YieldComponent:-1},"16.6.0-beta.0":{ActivityComponent:-1,CacheComponent:-1,ClassComponent:1,ContextConsumer:9,ContextProvider:10,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:18,ForwardRef:11,Fragment:7,FunctionComponent:0,HostComponent:5,HostHoistable:-1,HostPortal:4,HostRoot:3,HostSingleton:-1,HostText:6,IncompleteClassComponent:17,IncompleteFunctionComponent:-1,IndeterminateComponent:2,LazyComponent:16,LegacyHiddenComponent:-1,MemoComponent:14,Mode:8,OffscreenComponent:-1,Profiler:12,ScopeComponent:-1,SimpleMemoComponent:15,SuspenseComponent:13,SuspenseListComponent:19,Throw:-1,TracingMarkerComponent:-1,ViewTransitionComponent:-1,YieldComponent:-1},"17.0.0-alpha":{ActivityComponent:-1,CacheComponent:-1,ClassComponent:1,ContextConsumer:9,ContextProvider:10,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:18,ForwardRef:11,Fragment:7,FunctionComponent:0,HostComponent:5,HostHoistable:-1,HostPortal:4,HostRoot:3,HostSingleton:-1,HostText:6,IncompleteClassComponent:17,IncompleteFunctionComponent:-1,IndeterminateComponent:2,LazyComponent:16,LegacyHiddenComponent:24,MemoComponent:14,Mode:8,OffscreenComponent:23,Profiler:12,ScopeComponent:21,SimpleMemoComponent:15,SuspenseComponent:13,SuspenseListComponent:19,Throw:-1,TracingMarkerComponent:-1,ViewTransitionComponent:-1,YieldComponent:-1},"17.0.2":{ActivityComponent:31,CacheComponent:24,ClassComponent:1,ContextConsumer:9,ContextProvider:10,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:18,ForwardRef:11,Fragment:7,FunctionComponent:0,HostComponent:5,HostHoistable:26,HostPortal:4,HostRoot:3,HostSingleton:27,HostText:6,IncompleteClassComponent:17,IncompleteFunctionComponent:28,IndeterminateComponent:2,LazyComponent:16,LegacyHiddenComponent:23,MemoComponent:14,Mode:8,OffscreenComponent:22,Profiler:12,ScopeComponent:21,SimpleMemoComponent:15,SuspenseComponent:13,SuspenseListComponent:19,Throw:29,TracingMarkerComponent:25,ViewTransitionComponent:30,YieldComponent:-1}}),ja=[{isMinimumExcluded:!0,minimumVersion:`17.0.1`,workTags:Aa[`17.0.2`]},{isMinimumExcluded:!1,minimumVersion:`17.0.0-alpha`,workTags:Aa[`17.0.0-alpha`]},{isMinimumExcluded:!1,minimumVersion:`16.6.0-beta.0`,workTags:Aa[`16.6.0-beta.0`]},{isMinimumExcluded:!1,minimumVersion:`16.4.3-alpha`,workTags:Aa[`16.4.3-alpha`]}],Ma=Aa[`17.0.2`],Na=e=>{if(e===void 0)return Ma;for(let t of ja){let n=Oa(e,t.minimumVersion);if(n===null)return Ma;if(n===1||n===0&&!t.isMinimumExcluded)return t.workTags}return Aa[`16.0.0`]},Pa=Na(),Fa=/* @__PURE__ */ new WeakMap,Ia=e=>e.startsWith(`0.0.0-`)?Pa:Na(e),La=e=>{let t=e?.reconcilerVersion;return t&&Ca(t)?Ia(t):e?.version?Ia(e.version):Pa},Ra=(e,t)=>{let n=La(t);Fa.set(e,n),e.alternate&&Fa.set(e.alternate,n)},za=e=>{let t=Fa.get(e);if(t)return t;let n=[e],r=e;for(;r.return;)r=r.return,n.push(r);let i=Fa.get(r)??Pa;for(let e of n)Fa.set(e,i),e.alternate&&Fa.set(e.alternate,i);return i};ka.Placement|ka.Update|ka.ChildDeletion|ka.ContentReset|ka.Hydrating|ka.Visibility|ka.Snapshot;var Ba=class extends Error{constructor(e,t){super(e,{cause:t}),this.name=`BippyError`}},Va=class extends Ba{constructor(e,t){super(e,t),this.name=`BippyHookInspectionError`}},Ha=class extends Va{constructor(e,t){super(e,t),this.name=`BippyUnsupportedHookError`}},Ua=class extends Ba{constructor(e,t){super(e,t),this.name=`BippySourceMapError`}};let Wa=e=>typeof e==`function`,Ga=e=>{let t=`displayName`in e?e.displayName:null;if(typeof t==`string`&&t)return t;let n=`name`in e?e.name:null;return typeof n==`string`&&n?n:null},Ka=e=>typeof e==`object`&&!!e&&`tag`in e&&`stateNode`in e&&`return`in e&&`child`in e&&`sibling`in e&&`flags`in e,qa=e=>{let t=za(e);switch(e.tag){case t.HostComponent:case t.HostText:case t.HostHoistable:case t.HostSingleton:return!0;default:return!1}},Ja=e=>{let t=za(e);switch(e.tag){case t.ClassComponent:case t.ForwardRef:case t.FunctionComponent:case t.MemoComponent:case t.SimpleMemoComponent:return!0;default:return!1}};function Ya(e,t,n=!1){if(!e)return null;let r=t(e);return Xa(r)?Promise.resolve(r).then(r=>r===!0?e:Za(e,t,n)):r===!0?e:Za(e,t,n)}let Xa=e=>(typeof e==`object`||typeof e==`function`)&&e!==null&&`then`in e&&typeof e.then==`function`,Za=(e,t,n)=>{let r=n?e.return:e.child;return Qa(r,t,n)},Qa=(e,t,n)=>{if(!e)return null;let r=n?null:e.sibling,i=Ya(e,t,n);return Xa(i)?Promise.resolve(i).then(e=>e??Qa(r,t,n)):i??Qa(r,t,n)},$a=e=>Wa(e)?e:typeof e!=`object`||!e?null:$a(Reflect.get(e,`type`)??Reflect.get(e,`render`)),eo=e=>{if(typeof e==`string`)return e;if(typeof e!=`function`&&typeof e!=`object`||e===null)return null;let t=Ga(e);if(t)return t;let n=$a(e);return n?Ga(n):null},to=/* @__PURE__ */ new Set,no=/* @__PURE__ */ new WeakMap,ro=/* @__PURE__ */ new WeakMap,io=/* @__PURE__ */ new WeakMap,ao=/* @__PURE__ */ new Map;typeof FinalizationRegistry==`function`&&new FinalizationRegistry(e=>{ao.get(e)?.deref()||ao.delete(e)});let oo=e=>{let t=e.alternate?[e,e.alternate]:[e],n=/* @__PURE__ */ new Set;for(let e of t){let t=io.get(e);t!==void 0&&n.add(t),io.delete(e)}for(let e of n){let n=ao.get(e)?.deref();(!n||t.includes(n))&&ao.delete(e)}},so=/* @__PURE__ */ new Set,co=/* @__PURE__ */ new WeakMap,lo=/* @__PURE__ */ new WeakMap,uo=!1,fo=e=>{let t=co.get(e)??{};if(co.set(e,t),!t.onCommitFiberRoot||e.onCommitFiberRoot!==t.onCommitFiberRoot){let n=e.onCommitFiberRoot,r=(t,i,a,o)=>{if(n&&n.call(e,t,i,a,o),co.get(e)?.onCommitFiberRoot===r){Ra(i.current,e.renderers.get(t)),$i(i)?(to.delete(i),no.delete(i),ro.delete(i)):(to.add(i),no.set(i,t),ro.set(i,e));for(let{options:n,target:r}of so)r===lo.get(e)&&n.onCommitFiberRoot&&n.onCommitFiberRoot(t,i,a,o)}};t.onCommitFiberRoot=r,e.onCommitFiberRoot=r}if(!t.onCommitFiberUnmount||e.onCommitFiberUnmount!==t.onCommitFiberUnmount){let n=e.onCommitFiberUnmount,r=(t,i)=>{if(Ra(i,e.renderers.get(t)),n&&n.call(e,t,i),co.get(e)?.onCommitFiberUnmount===r)try{for(let{options:n,target:r}of so)r===lo.get(e)&&n.onCommitFiberUnmount&&n.onCommitFiberUnmount(t,i)}finally{oo(i)}};t.onCommitFiberUnmount=r,e.onCommitFiberUnmount=r}if(!t.onPostCommitFiberRoot||e.onPostCommitFiberRoot!==t.onPostCommitFiberRoot){let n=e.onPostCommitFiberRoot,r=(t,i)=>{if(n&&n.call(e,t,i),co.get(e)?.onPostCommitFiberRoot===r)for(let{options:n,target:r}of so)r===lo.get(e)&&n.onPostCommitFiberRoot&&n.onPostCommitFiberRoot(t,i)};t.onPostCommitFiberRoot=r,e.onPostCommitFiberRoot=r}if(!t.onScheduleFiberRoot||e.onScheduleFiberRoot!==t.onScheduleFiberRoot){let n=e.onScheduleFiberRoot,r=(t,i,a)=>{if(n&&n.call(e,t,i,a),co.get(e)?.onScheduleFiberRoot===r)for(let{options:n,target:r}of so)r===lo.get(e)&&n.onScheduleFiberRoot&&n.onScheduleFiberRoot(t,i,a)};t.onScheduleFiberRoot=r,e.onScheduleFiberRoot=r}},po=(e,t)=>{lo.set(e,t),fo(e)},mo=(e,t=globalThis)=>{uo||=(pa(po),!0),lo.set(e,t),fo(e)};try{ya()&&mo(ba())}catch{}let ho=/* @__PURE__ */ new Set,go=e=>e.startsWith(`__reactContainer$`)||e.startsWith(`__reactInternalInstance$`)||e.startsWith(`__reactFiber`),_o=e=>{let t=Reflect.get(e,`_reactRootContainer`);if(typeof t!=`object`||!t)return null;let n=Reflect.get(t,`_internalRoot`);if(typeof n!=`object`||!n)return null;let r=Reflect.get(n,`current`);if(typeof r!=`object`||!r)return null;let i=Reflect.get(r,`child`);return Ka(i)?i:null},vo=e=>{let t=Reflect.get(e,`__internalInstanceHandle`)??Reflect.get(e,`_internalInstanceHandle`);return Ka(t)?t:null},yo=e=>{if(typeof e!=`object`||!e)return e;let t=Reflect.get(e,`canonical`);if(typeof t==`object`&&t){let e=Reflect.get(t,`publicInstance`);if(typeof e==`object`&&e)return e}let n=Reflect.get(e,`_nativeTag`);return typeof n==`number`?n:e},bo=(e,t=globalThis)=>{let n=t.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(n)for(let t of n.renderers.values())try{let n=t.findFiberByHostInstance?.(e);if(n)return n}catch{}if(typeof e==`object`&&e){let t=_o(e);if(t)return t;let n=vo(e);if(n)return n;for(let t of ho){let n=Reflect.get(e,t);if(Ka(n))return n}for(let t of Object.keys(e))if(go(t)){ho.add(t);let n=Reflect.get(e,t);if(Ka(n))return n}}if(e!=null&&(typeof e==`object`||typeof e==`number`)){let t=/* @__PURE__ */ new Set;if(n?.getFiberRoots)for(let e of n.renderers.keys())for(let r of n.getFiberRoots(e))t.add(r);for(let e of to)ro.get(e)===n&&t.add(e);for(let n of t){let t=Ya(n.current,t=>qa(t)&&yo(t.stateNode)===e);if(t)return t}}return null};Reflect.get(/* @__PURE__ */ t({useEffect:()=>void 0,useReducer:()=>void 0,useRef:()=>void 0}),`useSyncExternalStore`);
|
|
42
|
+
/**
|
|
43
|
+
* @license bippy
|
|
44
|
+
*
|
|
45
|
+
* Copyright (c) Aiden Bai
|
|
46
|
+
*
|
|
47
|
+
* This source code is licensed under the MIT license found in the
|
|
48
|
+
* LICENSE file in the root directory of this source tree.
|
|
49
|
+
*/
|
|
50
|
+
/**
|
|
51
|
+
* @license bippy
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) Aiden Bai
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the MIT license found in the
|
|
56
|
+
* LICENSE file in the root directory of this source tree.
|
|
57
|
+
*/
|
|
58
|
+
let xo=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,So=[`rsc://`,`file:///`,`webpack-internal://`,`webpack://`,`node:`,`turbopack://`,`metro://`,`/app-pages-browser/`,`/(app-pages-browser)/`],Co=[`rsc://`,`about://React/`],wo=[`<anonymous>`,`eval`,``],To=/\.(cjs|cts|js|jsx|mdx|mjs|mts|ts|tsx)$/,Eo=/(\.min|bundle|chunk|vendor|vendors|runtime|polyfill|polyfills)\.(js|mjs|cjs)$|(chunk|bundle|vendor|vendors|runtime|polyfill|polyfills|framework|app|main|index)[-_.][A-Za-z0-9_-]{4,}\.(js|mjs|cjs)$|[\da-f]{8,}\.(js|mjs|cjs)$|[-_.][\da-f]{20,}\.(js|mjs|cjs)$|\/dist\/|\/build\/|\/.next\/|\/out\/|\/node_modules\/|\.webpack\.|\.vite\.|\.turbopack\./i,Do=/^\?[\w~.-]+(?:=[^&#]*)?(?:&[\w~.-]+(?:=[^&#]*)?)*$/,Oo=/\[[^\]]+\]$/,ko=[`react_stack_bottom_frame`,`react-stack-bottom-frame`],Ao=Error,jo=()=>Ao.prepareStackTrace,Mo=e=>{Ao.prepareStackTrace=e},No=/(^|@)\S+:\d+/,Po=/^\s*at .*(\S+:\d+|\(native\))/m,Fo=/^(eval@)?(\[native code\])?$/,Io=(e,t)=>{if(t?.includeInElement!==!1){let t=e.split(`
|
|
59
|
+
`),n=[];for(let e of t)if(/^\s*at\s+/.test(e)){let t=Ro(e)[0];t&&n.push(t)}else if(/^\s*in\s+/.test(e)){let t=e.replace(/^\s*in\s+/,``).replace(/\s*(?:\(at .*\)|\[[^\]]+\])$/,``);n.push({functionName:t,source:e})}else if(e.match(No)){let t=zo(e)[0];t&&n.push(t)}return n}return e.match(Po)?Ro(e):zo(e)},Lo=e=>{if(!e.includes(`:`))return[e,void 0,void 0];let t=e.startsWith(`(`)&&/:\d+\)$/.test(e)?e.slice(1,-1):e,n=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t);return n?[n[1],n[2]||void 0,n[3]||void 0]:[t,void 0,void 0]},Ro=e=>e.split(`
|
|
60
|
+
`).filter(e=>!!e.match(Po)).map(e=>{let t=e;t.includes(`(eval `)&&(t=t.replace(/eval code/g,`eval`).replace(/(\(eval at [^()]*)|(,.*$)/g,``));let n=t.replace(/^\s+/,``).replace(/\(eval code/g,`(`).replace(/^.*?\s+/,``),r=n.match(/ (\(.+\)$)/);n=r?n.replace(r[0],``):n;let i=Lo(r?r[1]:n);return{functionName:r&&n||void 0,fileName:[`eval`,`<anonymous>`,`(native)`].includes(i[0])?void 0:i[0],lineNumber:i[1]?+i[1]:void 0,columnNumber:i[2]?+i[2]:void 0,source:t}}),zo=e=>e.split(`
|
|
61
|
+
`).filter(e=>!e.match(Fo)).map(e=>{let t=e;if(t.includes(` > eval`)&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,`:$1`)),!t.includes(`@`)&&!t.includes(`:`))return{functionName:t};{let e=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,n=t.match(e),r=n&&n[1]?n[1]:void 0,i=Lo(t.replace(e,``));return{functionName:r,fileName:i[0],lineNumber:i[1]?+i[1]:void 0,columnNumber:i[2]?+i[2]:void 0,source:t}}}),Bo=/* @__PURE__ */ new WeakMap,Vo=e=>ko.some(t=>e.includes(t)),Ho=e=>{let t=e.getFunctionName?.()??``;if(t)return t;let n=e.getTypeName?.()??``,r=e.getMethodName?.()??``;return n&&r?`${n}.${r}`:r},Uo=e=>{let t=[];for(let n=1;n<e.length;n++){let r=e[n],i=Ho(r);if(Vo(i))return{frames:t,isTrusted:!0};if(r.isNative?.()){t.push({functionName:i||void 0});continue}let a=r.getScriptNameOrSourceURL?.()??``;!a&&r.isEval?.()&&(a=r.getEvalOrigin?.()??``),t.push({functionName:i&&i!==`<anonymous>`?i:void 0,fileName:a&&a!==`<anonymous>`?a:void 0,lineNumber:r.getLineNumber?.()??void 0,columnNumber:r.getColumnNumber?.()??void 0,enclosingLineNumber:r.getEnclosingLineNumber?.()??void 0,enclosingColumnNumber:r.getEnclosingColumnNumber?.()??void 0,source:` at ${r.toString()}`})}return{frames:t,isTrusted:!1}},Wo=e=>{let t=-1;for(let n of ko)if(t=e.indexOf(n),t!==-1)break;let n=t===-1?e:e.slice(0,e.lastIndexOf(`
|
|
62
|
+
`,t));return{frames:Io(n).slice(1),isTrusted:t!==-1}},Go=e=>{let t=Bo.get(e);if(t)return t;let n=null,r=(e,t)=>{n=Uo(t);let r=`${e.name||`Error`}: ${e.message||``}`;for(let e of t)r+=`\n at ${e.toString()}`;return r},i=jo();Mo(r);let a;try{a=String(e.stack)}finally{Mo(i)}let o=n??Wo(a);return Bo.set(e,o),o},Ko=(e=globalThis)=>{let t=ba(void 0,e),n=ma(t.renderers)?t.renderers.values():[],r=e===globalThis?/* @__PURE__ */ new Set([...ia,...n]):new Set(n),i=[],a=/* @__PURE__ */ new Set;for(let e of r){let t=e.currentDispatcherRef;!t||a.has(t)||(a.add(t),i.push(t))}return i},qo=e=>`H`in e?e.H:e.current,Jo=(e,t)=>{`H`in e?e.H=t:e.current=t};var Yo=44,Xo=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Zo=/* @__PURE__ */ new Uint8Array(64),Qo=/* @__PURE__ */ new Uint8Array(128);for(let e=0;e<Xo.length;e++){let t=Xo.charCodeAt(e);Zo[e]=t,Qo[t]=e}function $o(e,t){let n=0,r=0,i=0;do i=Qo[e.next()],n|=(i&31)<<r,r+=5;while(i&32);let a=n&1;return n>>>=1,a&&(n=-2147483648|-n),t+n}function es(e,t){return e.pos>=t?!1:e.peek()!==Yo}var ts=class{constructor(e){this.pos=0,this.buffer=e}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(e){let{buffer:t,pos:n}=this,r=t.indexOf(e,n);return r===-1?t.length:r}};function ns(e){let{length:t}=e,n=new ts(e),r=[],i=0,a=0,o=0,s=0,c=0;do{let e=n.indexOf(`;`),t=[],l=!0,u=0;for(i=0;n.pos<e;){let r;i=$o(n,i),i<u&&(l=!1),u=i,es(n,e)?(a=$o(n,a),o=$o(n,o),s=$o(n,s),es(n,e)?(c=$o(n,c),r=[i,a,o,s,c]):r=[i,a,o,s]):r=[i],t.push(r),n.pos++}l||rs(t),r.push(t),n.pos=e+1}while(n.pos<=t);return r}function rs(e){e.sort(is)}function is(e,t){return e[0]-t[0]}let as=/^data:application\/json(?:;[^,]*)?,/i,os=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,ss=/* @__PURE__ */ new Map,cs=/* @__PURE__ */ new WeakMap;var ls=class extends Error{};let us=/* @__PURE__ */ new Map,ds=/* @__PURE__ */ new WeakMap,fs=/* @__PURE__ */ new Set([`chrome-extension:`,`moz-extension:`,`safari-web-extension:`]),ps=/* @__PURE__ */ new Set([`http:`,`https:`,...fs]),ms=(e,t,n,r)=>{let[,i,a,o,s]=e;if(i===void 0||a===void 0||o===void 0)return null;let c=t[i];return c?{columnNumber:o,fileName:c,functionName:s===void 0?void 0:r?.[s]||void 0,isIgnoreListed:n?.has(i)??!1,lineNumber:a+1}:null},hs=(e,t,n,r,i,a)=>{if(n<0||n>=e.length)return null;let o=e[n];if(!o||o.length===0)return null;let s=null,c=0,l=o.length-1;for(;c<=l;){let e=c+l>>1;o[e][0]<=r?(s=o[e],c=e+1):l=e-1}return!s||s.length<4?null:ms(s,t,i,a)},gs=(e,t,n)=>{if(e.sections){let r=t-1,i=null;for(let t of e.sections)if(r>t.offset.line||r===t.offset.line&&n>=t.offset.column)i=t;else break;if(!i)return null;let a=r-i.offset.line,o=r===i.offset.line?n-i.offset.column:n;return hs(i.map.mappings,i.map.sources,a,o,i.map.ignoredSourceIndices,i.map.names)}return hs(e.mappings,e.sources,t-1,n,e.ignoredSourceIndices,e.names)},_s=(e,t)=>{if(as.test(e))return e;try{return new URL(e,t).toString()}catch{try{return new URL(e).toString()}catch{try{let n=new URL(e,new URL(t,`https://bippy.invalid/`));return`${n.pathname}${n.search}${n.hash}`}catch{return null}}}},vs=e=>{try{let t=new URL(e),n=t.pathname.lastIndexOf(`.bundle`);if(n===-1)return null;let r=t.pathname.slice(n+7);if(r&&!r.startsWith(`//&`))return null;if(t.pathname=`${t.pathname.slice(0,n)}.map`,r){let e=new URLSearchParams(r.slice(3));for(let[n,r]of e)t.searchParams.set(n,r)}return t.hash=``,t.toString()}catch{return null}},ys=(e,t,n)=>{let r=n.headers.get(`sourcemap`)??n.headers.get(`x-sourcemap`);if(r)return _s(r.trim(),e);let i,a=t.length;for(;a>0&&!i;){let e=t.lastIndexOf(`
|
|
63
|
+
`,a-1)+1,n=t.slice(e,a).match(os);n&&(i=n[1]||n[2]),a=e-1}return i?_s(i,e):vs(e)},bs=e=>{if(typeof e!=`object`||!e)return!1;let t=Reflect.get(e,`version`),n=Reflect.get(e,`mappings`),r=Reflect.get(e,`file`),i=Reflect.get(e,`names`),a=Reflect.get(e,`sourceRoot`),o=Reflect.get(e,`sources`),s=Reflect.get(e,`sourcesContent`),c=Reflect.get(e,`ignoreList`),l=Reflect.get(e,`x_google_ignoreList`);if(t!==3||typeof n!=`string`||r!==void 0&&typeof r!=`string`||i!==void 0&&(!Array.isArray(i)||i.some(e=>typeof e!=`string`))||a!==void 0&&typeof a!=`string`||s!==void 0&&(!Array.isArray(s)||s.some(e=>typeof e!=`string`&&e!==null))||c!==void 0&&(!Array.isArray(c)||c.some(e=>!Number.isInteger(e)||e<0))||l!==void 0&&(!Array.isArray(l)||l.some(e=>!Number.isInteger(e)||e<0))||!Array.isArray(o)||o.some(e=>typeof e!=`string`)||s&&s.length!==o.length)return!1;let u=o.length;return[...c??[],...l??[]].every(e=>e<u)},xs=e=>{if(typeof e!=`object`||!e)return!1;let t=Reflect.get(e,`version`),n=Reflect.get(e,`sections`);return t!==3||!Array.isArray(n)?!1:n.every(e=>{if(typeof e!=`object`||!e)return!1;let t=Reflect.get(e,`map`),n=Reflect.get(e,`url`),r=Reflect.get(e,`offset`);if(typeof r!=`object`||!r)return!1;let i=Reflect.get(r,`column`),a=Reflect.get(r,`line`);return bs(t)!==(typeof n==`string`&&n.length>0)&&typeof i==`number`&&Number.isInteger(i)&&i>=0&&typeof a==`number`&&Number.isInteger(a)&&a>=0})},Ss=e=>{let t=e.ignoreList??e.x_google_ignoreList;return t?.length?new Set(t):void 0},Cs=(e,t,n)=>{if(!e||xo.test(t)||t.startsWith(`/`))return t;let r=e.endsWith(`/`)?e:`${e}/`,i=t.replace(/^\.\//,``);try{let e=xo.test(r)?r:new URL(r,n).toString();return new URL(i,e).toString()}catch{let e=`${r}${i}`.split(`/`),t=[];for(let n of e)n===`..`?t.pop():n!==`.`&&t.push(n);return t.join(`/`)}},ws=(e,t)=>e.sources.map(n=>Cs(e.sourceRoot,n,t)),Ts=e=>as.test(e)?void 0:e,Es=(e,t)=>{try{return{file:e.file,ignoredSourceIndices:Ss(e),mappings:ns(e.mappings),names:e.names,sourceMapUrl:Ts(t),sourceRoot:e.sourceRoot,sources:ws(e,t),sourcesContent:e.sourcesContent,version:3}}catch{return null}},Ds=async(e,t,n)=>{let r=[],i=-1,a=-1;for(let o of e.sections){if(o.offset.line<i||o.offset.line===i&&o.offset.column<=a)return null;i=o.offset.line,a=o.offset.column;let e=o.url?_s(o.url,t):null,s=o.map??(e?await n(e):null);if(!s)return null;let c=e??t;try{r.push({map:{...s,ignoredSourceIndices:Ss(s),mappings:ns(s.mappings),sources:ws(s,c)},offset:o.offset})}catch{return null}}let o=/* @__PURE__ */ new Set;for(let e of r)for(let t of e.map.sources)o.add(t);return{file:e.file,mappings:[],names:[],sections:r,sourceMapUrl:Ts(t),sourceRoot:void 0,sources:Array.from(o),sourcesContent:void 0,version:3}},Os=(e,t=!1)=>{if(!e)return!1;let n=e.trim();if(!n)return!1;let r=n.match(xo);if(!r)return!0;let i=r[0].toLowerCase();return t||ps.has(i)},ks=()=>typeof window>`u`&&typeof process<`u`&&typeof process.versions?.node==`string`,As=e=>{try{let t=new URL(e);return(t.protocol===`http:`||t.protocol===`https:`)&&!t.username&&!t.password}catch{return!1}},js=e=>{try{return new URL(e).protocol}catch{return null}},Ms=e=>{let t=js(e);return t!==null&&fs.has(t)},Ns=(e,t)=>{try{let n=new URL(e),r=new URL(t);return n.protocol===r.protocol&&n.host===r.host}catch{return!1}},Ps=(e,t,n,r)=>{if(as.test(t))return!0;if(!Os(t,r))return!1;let i=js(e),a=js(t),o=i!==null&&!ps.has(i)||a!==null&&!ps.has(a);return!(n||o||Ms(e)||Ms(t))||Ns(e,t)},Fs=e=>e===408||e===425||e===429||e>=500,Is=e=>{if(e.ok)return!0;if(Fs(e.status))throw new ls;return!1},Ls=(e,t,n)=>!n||t.url.length===0||Ns(e,t.url),Rs=e=>{if(e.timeoutMs===void 0||e.timeoutMs<0)return{cleanup:()=>{},signal:e.signal};let t=new AbortController,n=()=>t.abort(e.signal?.reason);e.signal?.aborted?n():e.signal?.addEventListener(`abort`,n,{once:!0});let r=setTimeout(()=>t.abort(new Ua(`Source map request timed out`)),e.timeoutMs);return{cleanup:()=>{clearTimeout(r),e.signal?.removeEventListener(`abort`,n)},signal:t.signal}},zs=async(e,t)=>{let n=Number(e.headers.get(`content-length`));if(Number.isFinite(n)&&n>t)return null;if(!e.body){let n=await e.text();return new TextEncoder().encode(n).byteLength>t?null:n}let r=e.body.getReader(),i=new TextDecoder,a=[],o=0;try{for(;;){let{done:e,value:n}=await r.read();if(e)break;if(o+=n.byteLength,o>t)return await r.cancel(),null;a.push(i.decode(n,{stream:!0}))}return a.push(i.decode()),a.join(``)}finally{r.releaseLock()}},Bs=e=>{try{if(typeof globalThis.atob==`function`)return new TextDecoder().decode(Uint8Array.from(globalThis.atob(e),e=>e.charCodeAt(0)))}catch{return null}let t=e.replace(/\s/g,``).replace(/=+$/,``),n=[],r=0,i=0;for(let e of t){let t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.indexOf(e);if(t===-1)return null;r=r*64+t,i+=6,i>=8&&(i-=8,n.push(Math.floor(r/2**i)&255),r%=2**i)}return new TextDecoder().decode(Uint8Array.from(n))},Vs=(e,t)=>{let n=e.indexOf(`,`);if(n===-1)return null;let r=e.slice(0,n),i=e.slice(n+1);if(i.length>t*2)return null;try{let e=r.toLowerCase().includes(`;base64`)?Bs(i):decodeURIComponent(i);return e===null||new TextEncoder().encode(e).byteLength>t?null:JSON.parse(e)}catch{return null}},Hs=async(e,t,n,r,i)=>{if(as.test(e))return Vs(e,r);let a=await t(e,{redirect:i?`error`:`follow`,signal:n});if(!Is(a)||!Ls(e,a,i))return null;let o=await zs(a,r);if(o===null)return null;try{return JSON.parse(o)}catch{return null}},Us=async(e,t,n={})=>{let r=t!==void 0;if(!Os(e,r))return null;let i=ks(),a=(i||Ms(e))&&!n.allowCrossOriginSourceMap;if(i&&!t&&(!n.allowUnsafeServerFetch||!As(e)))return null;let o=t??(typeof globalThis.fetch==`function`?globalThis.fetch.bind(globalThis):void 0);if(!o)return null;let s=n.maxBundleSizeBytes??26214400,c=n.maxSourceMapSizeBytes??104857600;if(s<0||c<0)return null;let l=Rs(n);try{let t=await o(e,{redirect:a?`error`:`follow`,signal:l.signal});if(!Is(t)||!Ls(e,t,a))return null;let n=await zs(t,s);if(n===null)return null;let i=ys(e,n,t);if(!i||!Ps(e,i,a,r))return null;let u=await Hs(i,o,l.signal,c,a);return bs(u)?Es(u,i):xs(u)?Ds(u,i,async t=>{if(!Ps(e,t,a,r))return null;let n=await Hs(t,o,l.signal,c,a);return bs(n)?n:null}):null}finally{l.cleanup()}},Ws=(e,t,n)=>{if(!n)return t;let r=e.get(n);return r||(r=/* @__PURE__ */ new Map,e.set(n,r)),r},Gs=e=>Ws(cs,ss,e),Ks=e=>Ws(ds,us,e),qs=(e,t)=>t.allowCrossOriginSourceMap===void 0&&t.allowUnsafeServerFetch===void 0&&t.maxBundleSizeBytes===void 0&&t.maxSourceMapSizeBytes===void 0&&t.timeoutMs===void 0?e:`${e}\0${t.allowCrossOriginSourceMap??``}\0${t.allowUnsafeServerFetch??``}\0${t.maxBundleSizeBytes??``}\0${t.maxSourceMapSizeBytes??``}\0${t.timeoutMs??``}`,Js=async(e,t=!0,n,r={})=>{let i=t&&r.signal===void 0,a=Gs(n),o=Ks(n),s=qs(e,r);if(i&&a.has(s))return a.get(s)??null;let c=i?o.get(s):void 0;if(c)return(await c).sourceMap;let l=Us(e,n,r).then(e=>({sourceMap:e,isTransientFailure:!1}),()=>({sourceMap:null,isTransientFailure:!0}));i&&o.set(s,l);let{sourceMap:u,isTransientFailure:d}=await l;return i&&(o.delete(s),d||a.set(s,u)),u},Ys=async(e,t=!0,n,r={})=>Promise.all(e.map(async e=>{if(!e.fileName)return e;let i=await Js(e.fileName,t,n,r);if(!i||typeof e.lineNumber!=`number`||typeof e.columnNumber!=`number`)return e;let a=gs(i,e.lineNumber,e.columnNumber);return a?{...e,source:a.fileName&&e.source?e.source.replace(e.fileName,a.fileName):e.source,fileName:a.fileName,functionName:a.functionName??e.functionName,lineNumber:a.lineNumber,columnNumber:a.columnNumber,isIgnoreListed:a.isIgnoreListed,isSymbolicated:!0}:e})),Xs=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack==`string`,Zs=e=>`tag`in e&&typeof e.tag==`number`,Qs=e=>{let t=null;if(Ya(e,n=>{if(n===e)return!1;let r=n._debugOwner;return(r===e||e.alternate!==null&&r===e.alternate)&&n._debugStack instanceof Error&&(t=n._debugStack,!0)}),!t)return null;let{frames:n,isTrusted:r}=Go(t);if(!r)return null;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t.fileName)return{...t,lineNumber:t.enclosingLineNumber||t.lineNumber,columnNumber:t.enclosingColumnNumber||t.columnNumber}}return null},$s=()=>{let e=[];for(let t of Ko())e.push({currentDispatcherRef:t,value:qo(t)}),Jo(t,null);return e},ec=e=>{for(let{currentDispatcherRef:t,value:n}of e)Jo(t,n)},Z=e=>`\n in ${e}`,tc=(e,t,n)=>{if(n){let t=sc(n.stack??``),r=t.lastIndexOf(`
|
|
64
|
+
`),i=r===-1?t:t.slice(r+1);if(i.includes(e))return`\n${i}`}return Z(`${e}${t?` [${t}]`:``}`)},nc=!1,rc=/* @__PURE__ */ new WeakMap,ic=(e,t)=>{if(!e||nc)return``;let n=rc.get(e);if(n!==void 0)return n;let r=jo();Mo(void 0),nc=!0;let i=$s(),a=console.error,o=console.warn;console.error=()=>{},console.warn=()=>{};try{let n={DetermineComponentFrameRoot(){let n;try{if(t){let t=function(){throw Error()};Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}});try{Reflect.construct(t,[])}catch(e){n=e}Reflect.construct(e,[],t)}else{try{throw Error()}catch(e){n=e}let t=Function.prototype.apply.call(e,void 0,[]);typeof t==`object`&&t&&`catch`in t&&typeof t.catch==`function`&&t.catch(()=>void 0)}}catch(e){if(e instanceof Error&&n instanceof Error&&typeof e.stack==`string`)return[e.stack,n.stack]}return[null,null]}};Object.defineProperty(n.DetermineComponentFrameRoot,"displayName",{value:`DetermineComponentFrameRoot`}),Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,`name`)?.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});let[r,i]=n.DetermineComponentFrameRoot();if(r&&i){let t=r.split(`
|
|
65
|
+
`),n=i.split(`
|
|
66
|
+
`),a=0,o=0;for(;a<t.length&&!t[a].includes(`DetermineComponentFrameRoot`);)a++;for(;o<n.length&&!n[o].includes(`DetermineComponentFrameRoot`);)o++;if(a===t.length||o===n.length)for(a=t.length-1,o=n.length-1;a>=1&&o>=0&&t[a]!==n[o];)o--;for(;a>=1&&o>=0;a--,o--)if(t[a]!==n[o]){if(a!==1||o!==1)do if(a--,o--,o<0||t[a]!==n[o]){let n=`\n${t[a].replace(` at new `,` at `)}`,[r]=Io(n);if(!r?.fileName)break;let i=eo(e);return i&&n.includes(`<anonymous>`)&&(n=n.replace(`<anonymous>`,i)),rc.set(e,n),n}while(a>=1&&o>=0);break}}}finally{nc=!1,Mo(r),ec(i),console.error=a,console.warn=o}let s=eo(e),c=s?Z(s):``;return rc.set(e,c),c},ac=(e,t)=>{let n=``,r=za(e);switch(e.tag){case r.ActivityComponent:n=Z(`Activity`);break;case r.ClassComponent:n=ic(e.type,!0);break;case r.ForwardRef:n=ic($a(e.type)??e.type,!1);break;case r.FunctionComponent:case r.SimpleMemoComponent:n=ic($a(e.type)??e.type,!1);break;case r.HostComponent:case r.HostHoistable:case r.HostSingleton:typeof e.type==`string`&&(n=Z(e.type));break;case r.LazyComponent:n=Z(`Lazy`);break;case r.SuspenseComponent:n=e.child!==t&&t!==null?Z(`Suspense Fallback`):Z(`Suspense`);break;case r.SuspenseListComponent:n=Z(`SuspenseList`);break;case r.ViewTransitionComponent:n=Z(`ViewTransition`);break;default:return``}return n},oc=e=>{try{let t=``,n=e,r=null;do{t+=ac(n,r);let e=n._debugInfo;if(e&&Array.isArray(e))for(let n=e.length-1;n>=0;n--){let r=e[n];typeof r.name==`string`&&(t+=tc(r.name,r.env,r.debugLocation))}r=n,n=n.return}while(n);return t}catch(e){return e instanceof Error?`\nBippy couldn’t generate the stack: ${e.message}\n${e.stack}`:``}},sc=e=>{let t=e;if(!t)return``;t.startsWith(`Error: react-stack-top-frame
|
|
67
|
+
`)&&(t=t.slice(29));let n=t.indexOf(`
|
|
68
|
+
`);n!==-1&&(t=t.slice(n+1));let r=Math.max(...ko.map(e=>t.indexOf(e)));if(r!==-1&&(r=t.lastIndexOf(`
|
|
69
|
+
`,r)),r!==-1)t=t.slice(0,r);else return``;return t},cc=e=>!!(e.functionName&&e.fileName&&fc(e.fileName)),lc=(e,t)=>e.fileName===t.fileName&&e.lineNumber===t.lineNumber&&e.columnNumber===t.columnNumber,uc=e=>{let t=/* @__PURE__ */ new Map;for(let n of e){if(!cc(n))continue;let e=n.functionName,r=t.get(e)??[];r.some(e=>lc(e,n))||(r.push(n),t.set(e,r))}return t},dc=(e,t,n)=>{if(!e.functionName)return{...e,isServer:!0};let r=t.get(e.functionName);if(!r||r.length===0)return{...e,isServer:!0};let i=n.get(e.functionName)??0,a=r[i%r.length];return n.set(e.functionName,i+1),{...e,isServer:!0,fileName:a.fileName,lineNumber:a.lineNumber,columnNumber:a.columnNumber,source:e.source?.replace(Oo,`(${a.fileName}:${a.lineNumber}:${a.columnNumber})`)}},fc=e=>Co.some(t=>e.startsWith(t)),pc=e=>!e.isServer&&e.fileName&&fc(e.fileName)?{...e,isServer:!0}:e,mc=e=>{let t=[],n=e;for(;n;)if(Zs(n)){let e=n;if(n=e._debugOwner,n&&Xs(e)){let{frames:n,isTrusted:r}=Go(e._debugStack);if(r)for(let e of n)t.push(pc(e))}}else{let e=n;if(n=e.owner,n&&e.debugStack instanceof Error)for(let n of Go(e.debugStack).frames)t.push({...n,isServer:!0})}return t},hc=e=>{let t=[];return Ya(e,e=>{if(!Xs(e))return;let{frames:n,isTrusted:r}=Go(e._debugStack);r&&t.push(...n)},!0),t},gc=e=>{let t=hc(e),n=Io(oc(e)),r=uc(t),i=/* @__PURE__ */ new Map;return n.map(e=>e.source!==void 0&&Oo.test(e.source)?dc(e,r,i):e).filter((e,t,n)=>{if(t===0)return!0;let r=n[t-1];return e.functionName!==r.functionName})},_c=async(e,t=!0,n,r={})=>Ys(gc(e),t,n,r),vc=e=>!!e.fileName&&!e.isIgnoreListed,yc=async(e,t=!0,n,r={})=>{let i=mc(e);if(i.length>0){let a=Qs(e)??{};a.functionName=eo(e.type)??a.functionName;let o=await Ys([a,...i],t,n,r);if(o.some((e,t)=>t>0&&vc(e)))return o}return _c(e,t,n,r)},bc=e=>e.split(`/`).filter(Boolean).length,xc=e=>{let t=e.indexOf(`/`,1);if(t===-1)return e;let n=e.slice(0,t);if(bc(n)!==1)return e;let r=e.slice(t);if(!To.test(r))return e;let i=r.split(`/`).filter(Boolean);if(i.length<2)return e;let a=i[0];return a.startsWith(`@`)||a.length>4?e:r},Sc=e=>{if(!e||wo.some(t=>t===e))return``;let t=e,n=/^[a-zA-Z]:[\\/]/.test(t);if(t.startsWith(`http://`)||t.startsWith(`https://`)){try{t=new URL(t).pathname}catch{}t=xc(t)}if(t.startsWith(`about://React/`)){let e=t.slice(14),n=e.indexOf(`/`),r=e.indexOf(`:`);t=n!==-1&&(r===-1||n<r)?e.slice(n+1):e}let r=!0;for(;r;){r=!1;for(let e of So)if(t.startsWith(e)){t=t.slice(e.length),e===`file:///`&&(t=`/${t.replace(/^\/+/,``)}`),r=!0;break}}if(!n){let e=t.match(xo);e&&(t=t.slice(e[0].length))}if(t.startsWith(`//`)){let e=t.indexOf(`/`,2);t=e===-1?``:t.slice(e)}let i=t.indexOf(`?`);if(i!==-1){let e=t.slice(i);Do.test(e)&&(t=t.slice(0,i))}return t},Cc=e=>{let t=Sc(e);return!(!t||!To.test(t)||Eo.test(t))},wc=Symbol.for(`react.context`),Tc=Symbol.for(`react.recoverable`),Ec=[],Dc=null,Oc=Error("Suspense interrupted this render. This error is an internal implementation detail of `use`."),Q=()=>{let e=Dc;return e!==null&&(Dc=e.next),e},kc=e=>typeof e==`object`&&!!e&&`then`in e&&typeof e.then==`function`,Ac=e=>typeof e==`object`&&!!e&&`current`in e,jc=e=>typeof e==`object`&&!!e&&`_currentValue`in e,Mc=e=>e._currentValue,$=(e,t,n,r=null,i=null)=>{Ec.push({displayName:r,primitive:e,stackError:Error(),value:t,debugInfo:i,dispatcherHookName:n})},Nc=e=>{if(typeof e==`object`&&e){if(kc(e)){let t=e,n=kc(t)?t:e;switch(n.status){case`fulfilled`:return $(`Promise`,n.value,`Use`,null,n._debugInfo??null),n.value;case`rejected`:throw n.reason}throw $(`Unresolved`,n,`Use`,null,n._debugInfo??null),Oc}if(`$$typeof`in e&&e.$$typeof===Tc){$(`Recoverable`,void 0,`Use`);return}if(`$$typeof`in e&&e.$$typeof===wc&&jc(e)){let t={_currentValue:e._currentValue,displayName:typeof e.displayName==`string`?e.displayName:void 0},n=Mc(t);return $(`Context (use)`,n,`Use`,t.displayName||`Context`),n}}throw new Va(`use() received an unsupported value: `+String(e))},Pc=e=>{let t=Mc(e);return $(`Context`,t,`Context`,e.displayName||null),t},Fc=e=>{let t=Q(),n=t===null?typeof e==`function`?e():e:t.memoizedState;return $(`State`,n,`State`),[n,()=>{}]},Ic=(e,t,n)=>{let r=Q(),i=r===null?n===void 0?t:n(t):r.memoizedState;return $(`Reducer`,i,`Reducer`),[i,()=>{}]},Lc=e=>{let t=Q(),n=Ac(t?.memoizedState)?t.memoizedState:{current:e};return $(`Ref`,n.current,`Ref`),n},Rc=()=>{let e=Q();return $(`CacheRefresh`,e===null?()=>{}:e.memoizedState,`CacheRefresh`),()=>{}},zc=e=>{Q(),$(`LayoutEffect`,e,`LayoutEffect`)},Bc=e=>{Q(),$(`InsertionEffect`,e,`InsertionEffect`)},Vc=e=>{Q(),$(`Effect`,e,`Effect`)},Hc=e=>{Q();let t=Ac(e)?e.current:void 0;$(`ImperativeHandle`,t,`ImperativeHandle`)},Uc=(e,t)=>{$(`DebugValue`,typeof t==`function`?t(e):e,`DebugValue`)},Wc=e=>{let t=Q();return $(`Callback`,Array.isArray(t?.memoizedState)?t.memoizedState[0]:e,`Callback`),e},Gc=e=>{let t=Q(),n=Array.isArray(t?.memoizedState)?t.memoizedState[0]:e();return $(`Memo`,n,`Memo`),n},Kc=(e,t)=>{let n=Q();Q();let r=n===null?t():n.memoizedState;return $(`SyncExternalStore`,r,`SyncExternalStore`),r},qc=()=>{let e=Q();Q();let t=e?.memoizedState===!0;return $(`Transition`,t,`Transition`),[t,()=>{}]},Jc=e=>{let t=Q(),n=t===null?e:t.memoizedState;return $(`DeferredValue`,n,`DeferredValue`),n},Yc=()=>{let e=Q(),t=typeof e?.memoizedState==`string`?e.memoizedState:``;return $(`Id`,t,`Id`),t},Xc=e=>[],Zc=e=>{let t=Q(),n=t===null?e:t.memoizedState;return $(`Optimistic`,n,`Optimistic`),[n,()=>{}]},Qc=(e,t)=>{let n,r=null,i=null;if(e!==null){let t=e.memoizedState;if(kc(t))switch(t.status){case`fulfilled`:n=t.value,r=t._debugInfo??null;break;case`rejected`:i=t.reason;break;default:i=Oc,n=t,r=t._debugInfo??null}else n=t}else n=t;return{value:n,debugInfo:r,error:i}},$c=e=>(t,n)=>{let r=Q();Q(),Q();let{value:i,debugInfo:a,error:o}=Qc(r,n);if($(e,i,e,null,a),o!==null)throw o;return[i,()=>{},!1]},el=$c(`ActionState`),tl={readContext:Mc,use:Nc,useCallback:Wc,useContext:Pc,useEffect:Vc,useImperativeHandle:Hc,useLayoutEffect:zc,useInsertionEffect:Bc,useMemo:Gc,useReducer:Ic,useRef:Lc,useState:Fc,useDebugValue:Uc,useDeferredValue:Jc,useTransition:qc,useSyncExternalStore:Kc,useId:Yc,useHostTransitionStatus:()=>{let e=Mc({_currentValue:null});return $(`HostTransitionStatus`,e,`HostTransitionStatus`),e},useFormState:$c(`FormState`),useActionState:el,useOptimistic:Zc,useMemoCache:Xc,useCacheRefresh:Rc,useEffectEvent:e=>(Q(),$(`EffectEvent`,e,`EffectEvent`),e)};new Proxy(tl,{get(e,t){if(Object.hasOwn(e,t))return Reflect.get(e,t);throw new Ha(`The React dispatcher is missing method `+t)}});let nl=e=>{if(!e)return``;let t=e.lastIndexOf(`[as `);if(t!==-1)return nl(e.slice(t+4,-1));if(t=e.lastIndexOf(`.`),t=t===-1?0:t+1,e.slice(t).startsWith(`unstable_`)&&(t+=9),e.slice(t).startsWith(`experimental_`)&&(t+=13),e.slice(t,t+3)===`use`){if(e.length-t===3)return`Use`;t+=3}return e.slice(t)};new Set([$,...Object.values(tl)].map(e=>nl(e.name)));async function rl(e){let t=e.getBoundingClientRect(),n=window.getSelection()?.toString().trim();return{tagName:e.tagName.toLowerCase(),selector:al(e),html:ul(e),text:fl(e),components:await pl(e),rect:{x:t.x,y:t.y,width:t.width,height:t.height},viewport:{width:window.innerWidth,height:window.innerHeight,dpr:Math.round(window.devicePixelRatio*100)/100},...n&&e.contains(window.getSelection()?.anchorNode??null)?{selection:n}:{}}}function il(e){let t=e.tagName.toLowerCase(),n=_l(e);if(!n)return t;let r=null;return Ya(n,e=>Ja(e)?(r=eo(e.type),!(!r||vl(r))):!1,!0),r?`${r} · ${t}`:t}function al(e){let t=[],n=e;for(;n&&n!==document.documentElement;){let r=ol(n);if(r){t.unshift(r);let n=t.join(` > `);if(cl(n,e))return n}else{t.unshift(sl(n));let r=t.join(` > `);if(t.length>=2&&cl(r,e))return r}n=n.parentElement}return t.join(` > `)}function ol(e){for(let t of[`data-testid`,`data-test`,`data-cy`,`data-tencil-id`]){let n=e.getAttribute(t);if(n)return`${e.tagName.toLowerCase()}[${t}="${CSS.escape(n)}"]`}let t=e.id;return t&&!/[:«»]|\d{3,}/.test(t)?`#${CSS.escape(t)}`:null}function sl(e){let t=e.tagName.toLowerCase(),n=e.parentElement;if(!n)return t;let r=[...n.children].filter(t=>t.tagName===e.tagName);return r.length===1?t:`${t}:nth-of-type(${r.indexOf(e)+1})`}function cl(e,t){try{let n=document.querySelectorAll(e);return n.length===1&&n[0]===t}catch{return!1}}let ll=[`id`,`class`,`href`,`src`,`alt`,`type`,`name`,`role`,`aria-label`];function ul(e){let t=e.tagName.toLowerCase(),n=`<${[t,...[...e.attributes].filter(e=>!e.name.startsWith(`data-tencil`)).sort((e,t)=>dl(e.name)-dl(t.name)).slice(0,8).map(e=>{let t=e.name===`class`?80:120;return e.value?`${e.name}="${Sl(e.value,t)}"`:e.name})].join(` `)}>`,r=e.children.length;return`${n}${r>0?`…${r} element${r===1?``:`s`}…`:Sl(e.textContent?.trim()??``,100)}</${t}>`}function dl(e){let t=ll.indexOf(e);return t===-1?ll.length:t}function fl(e){let t=e.innerText?.replace(/\s+/g,` `).trim();return t?Sl(t,200):void 0}async function pl(e){let t=_l(e);if(!t)return[];try{let e=await Cl(yc(t),1500),n=ml(t),r=e.filter(e=>e.functionName&&!/^[a-z]/.test(e.functionName)&&!vl(e.functionName)).slice(0,6).map(e=>hl(e,n.get(e.functionName)));if(r.length>0)return r}catch{}return gl(t)}function ml(e){let t=/* @__PURE__ */ new Map;try{for(let n of mc(e))n.functionName&&n.fileName&&!t.has(n.functionName)&&t.set(n.functionName,bl(n.fileName))}catch{}return t}function hl(e,t){let n=e.functionName??`Anonymous`;if(!e.fileName)return{name:n};let r=xl(e.fileName);return r?{name:n,library:r}:Cc(e.fileName)?{name:n,source:{file:yl(bl(e.fileName),t),...e.lineNumber==null?{}:{line:e.lineNumber},...e.columnNumber==null?{}:{column:e.columnNumber}}}:{name:n}}function gl(e){let t=[];return Ya(e,e=>{if(Ja(e)){let n=eo(e.type);n&&!vl(n)&&t.push({name:n})}return t.length>=6},!0),t}function _l(e){try{return bo(e)}catch{return null}}function vl(e){return/^(?:Anonymous|Fragment|Suspense|StrictMode|Profiler|Provider|Consumer|ErrorBoundary|InnerLayoutRouter|OuterLayoutRouter|RedirectBoundary|NotFoundBoundary|LoadingBoundary|HotReload|Router|AppRouter|ServerRoot|ScrollAndFocusHandler|RenderFromTemplateContext)$/.test(e)||/(?:Provider|Context|Boundary)$/.test(e)}function yl(e,t){return e.includes(`/`)||!t?e:t.endsWith(`/${e}`)?t:e}function bl(e){let t=e;if(/^https?:\/\//.test(e))try{t=decodeURIComponent(new URL(e).pathname)}catch{}return t.replace(/[?#].*$/,``).replace(/^\/@fs/,``).replace(/^(?:webpack-internal:\/\/\/|webpack:\/\/[^/]*\/|turbopack:\/\/\/|rsc:\/\/React\/[^/]+\/|file:\/\/)/,``).replace(/^\/?\((?:app-pages-browser|ssr|rsc)\)\//,``).replace(/^\.\//,``).replace(/^\/(?=(?:src|app|pages|components|lib)\/)/,``)}function xl(e){return e.match(/node_modules\/(?:\.pnpm\/[^/]+\/node_modules\/)?((?:@[^/]+\/)?[^/]+)/)?.[1]}function Sl(e,t){return e.length>t?`${e.slice(0,t-1)}…`:e}function Cl(e,t){return Promise.race([e,new Promise((e,n)=>setTimeout(()=>n(/* @__PURE__ */ Error(`timeout`)),t))])}function wl(){Ht.value;let e=Rt.value;if(U.value!==`picking`||!e)return null;let t=e.getBoundingClientRect(),n=t.top<28;return/* @__PURE__ */ Y(C,{children:[/* @__PURE__ */ Y(`div`,{class:`highlight`,style:{transform:`translate(${t.left}px, ${t.top}px)`,width:`${t.width}px`,height:`${t.height}px`}}),/* @__PURE__ */ Y(`div`,{class:`highlight-label`,style:{transform:`translate(${Math.max(4,t.left)}px, ${n?t.bottom+6:t.top-26}px)`},children:[il(e),/* @__PURE__ */ Y(`span`,{class:`highlight-size`,children:[Math.round(t.width),`×`,Math.round(t.height)]})]})]})}function Tl(){if(!zt.value)return null;let e=xt.value,t=B.value;return/* @__PURE__ */ Y(`aside`,{class:`inbox settings-panel`,"aria-label":`Project settings`,children:[/* @__PURE__ */ Y(`header`,{class:`inbox-header`,children:[/* @__PURE__ */ Y(`strong`,{class:`settings-title`,children:`Settings`}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`icon-button`,title:`Close`,onClick:()=>{zt.value=!1},children:/* @__PURE__ */ Y(Ci,{})})]}),e?/* @__PURE__ */ Y(`section`,{class:`settings-section`,children:[/* @__PURE__ */ Y(`p`,{class:`settings-label`,id:`tencil-provider-label`,children:`Agent for new pins`}),/* @__PURE__ */ Y(`p`,{class:`settings-help`,children:[`For `,St.value?.name??`this project`,`. Pins you already made keep their agent.`]}),/* @__PURE__ */ Y(`fieldset`,{class:`settings-options`,"aria-labelledby":`tencil-provider-label`,children:e.providers.map(n=>{let r=n.id===e.provider;return/* @__PURE__ */ Y(`label`,{class:`target-option${r?` selected`:``}`,children:[/* @__PURE__ */ Y(`input`,{type:`radio`,name:`tencil-provider`,class:`settings-radio`,checked:r,onChange:()=>H({type:`settings.update`,provider:n.id})}),/* @__PURE__ */ Y(`span`,{class:`target-option-title`,children:n.label}),r&&t?.id===n.id&&/* @__PURE__ */ Y(`span`,{class:`target-option-meta`,children:El(t)})]},n.id)})}),t&&t.id===e.provider&&t.state!==`ready`&&t.detail&&/* @__PURE__ */ Y(`p`,{class:`settings-status`,children:t.detail})]}):/* @__PURE__ */ Y(`p`,{class:`empty`,children:`Connecting…`})]})}function El(e){switch(e.state){case`ready`:return`Ready`;case`unauthorized`:return e.canPair?`Not paired`:`Not signed in`;case`unavailable`:return`Unavailable`;default:return`Connecting…`}}function Dl({text:e,animate:t=!1}){let n=t?Ml(e):0;return/* @__PURE__ */ Y(`div`,{class:`md`,children:Ol(e,{index:0,animateFrom:t?n-48:1/0})})}function Ol(e,t){let n=[],r=e.replace(/\r\n/g,`
|
|
70
|
+
`).split(`
|
|
71
|
+
`),i=0,a=0;for(;i<r.length;){let e=r[i];if(e.match(/^\s*```(\w*)/)){let e=[];for(i++;i<r.length&&!/^\s*```/.test(r[i]);)e.push(r[i++]);i++,t.index+=Ml(e.join(`
|
|
72
|
+
`)),n.push(/* @__PURE__ */ Y(`pre`,{children:/* @__PURE__ */ Y(`code`,{children:e.join(`
|
|
73
|
+
`)})},a++));continue}if(/^\s*([-*]|\d+\.)\s+/.test(e)){let o=/^\s*\d+\./.test(e),s=[];for(;i<r.length&&/^\s*([-*]|\d+\.)\s+/.test(r[i]);)s.push(r[i++].replace(/^\s*([-*]|\d+\.)\s+/,``));let c=s.map((e,n)=>/* @__PURE__ */ Y(`li`,{children:Al(e,t)},n));n.push(Y(o?`ol`:`ul`,{children:c},a++));continue}let o=e.match(/^#{1,6}\s+(.*)/);if(o){n.push(/* @__PURE__ */ Y(`p`,{class:`md-heading`,children:Al(o[1],t)},a++)),i++;continue}if(!e.trim()){i++;continue}let s=[];for(;i<r.length&&r[i].trim()&&!/^\s*(```|[-*]\s|\d+\.\s|#{1,6}\s)/.test(r[i]);)s.push(r[i++]);n.push(/* @__PURE__ */ Y(`p`,{children:Al(s.join(` `),t)},a++))}return n}let kl=/(`[^`]+`|\*\*[^*]+\*\*|\[[^\]]+\]\([^)\s]+\))/g;function Al(e,t){return e.split(kl).map((e,n)=>{if(e.startsWith("`")&&e.endsWith("`")&&e.length>1)return t.index+=Ml(e),/* @__PURE__ */ Y(`code`,{children:e.slice(1,-1)},n);if(e.startsWith(`**`)&&e.endsWith(`**`)&&e.length>3)return/* @__PURE__ */ Y(`strong`,{children:jl(e.slice(2,-2),t)},n);let r=e.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);return r&&/^https?:\/\//.test(r[2])?/* @__PURE__ */ Y(`a`,{href:r[2],target:`_blank`,rel:`noreferrer`,children:jl(r[1],t)},n):jl(e,t)})}function jl(e,t){return t.animateFrom===1/0?(t.index+=Ml(e),e):e.split(/(\s+)/).map(e=>{if(!e||/^\s+$/.test(e))return e;let n=t.index++;return n>=t.animateFrom?/* @__PURE__ */ Y(`span`,{class:`w`,children:e},`w${n}`):e})}function Ml(e){let t=e.match(/\S+/g);return t?t.length:0}function Nl(){Ht.value;let e=G.value,t=e?V.value.get(e):void 0,n=ke(null),[r,i]=P(320);if(Oe(()=>{n.current&&i(n.current.offsetHeight)}),!t)return null;let a=t.anchor?tn(t.anchor):null,{left:o,top:s,origin:c}=a?rn(a,{width:380,height:r}):{left:window.innerWidth-380-(K.value?372:16),top:16,origin:`top right`};return/* @__PURE__ */ Y(`div`,{ref:n,class:`popover thread${a?``:` thread-docked`}`,style:{left:`${o}px`,top:`${s}px`,width:`380px`,transformOrigin:c},children:[/* @__PURE__ */ Y(Pl,{thread:t}),/* @__PURE__ */ Y(Fl,{thread:t}),/* @__PURE__ */ Y(Rl,{thread:t}),/* @__PURE__ */ Y(Wi,{placeholder:t.provider.threadId?`Reply…`:`Waiting for the agent…`,disabled:!t.provider.threadId,onSubmit:e=>{H({type:`thread.reply`,threadId:t.id,text:e})},onCancel:()=>{G.value=null}})]})}function Pl({thread:e}){let t=e.context,n=t?.components[0],r=n?.source;return/* @__PURE__ */ Y(`div`,{class:`thread-header`,children:[/* @__PURE__ */ Y(`div`,{class:`thread-heading`,children:t?/* @__PURE__ */ Y(C,{children:[/* @__PURE__ */ Y(`span`,{class:`thread-number`,children:[`#`,Oi.value.get(e.id)]}),/* @__PURE__ */ Y(`span`,{class:`chip`,title:t.selector,children:[/* @__PURE__ */ Y(Ti,{}),n?.name??`<${t.tagName}>`]}),r&&/* @__PURE__ */ Y(`span`,{class:`thread-source`,title:r.file,children:[r.file.split(`/`).pop(),r.line?`:${r.line}`:``]})]}):/* @__PURE__ */ Y(`span`,{class:`thread-title`,title:e.title,children:e.title})}),/* @__PURE__ */ Y(`div`,{class:`thread-tools`,children:[e.provider.url&&/* @__PURE__ */ Y(`a`,{class:`icon-button`,href:e.provider.url,target:`_blank`,rel:`noreferrer`,title:`Open in ${Ft(e.provider.id)}`,children:/* @__PURE__ */ Y(Si,{})}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`icon-button`,title:e.resolved?`Reopen`:`Resolve`,onClick:()=>{H({type:`thread.resolve`,threadId:e.id,resolved:!e.resolved}),e.resolved||(G.value=null)},children:e.resolved?/* @__PURE__ */ Y(bi,{}):/* @__PURE__ */ Y(yi,{})}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`icon-button`,title:`Delete pin (keeps the agent thread)`,onClick:()=>{H({type:`thread.delete`,threadId:e.id}),G.value=null},children:/* @__PURE__ */ Y(xi,{})}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`icon-button`,title:`Close (Esc)`,onClick:()=>{G.value=null},children:/* @__PURE__ */ Y(Ci,{})})]})]})}function Fl({thread:e}){let t=ke(null),[n,r]=P(!1),i=e.messages[e.messages.length-1];return F(()=>{let e=t.current;e&&e.scrollHeight-e.scrollTop-e.clientHeight<80&&(e.scrollTop=e.scrollHeight)},[i?.id,i?.text.length]),/* @__PURE__ */ Y(`div`,{ref:t,class:`messages`,"data-scrolled":n||void 0,onScroll:e=>r(e.target.scrollTop>4),children:e.messages.map(e=>e.role===`user`?/* @__PURE__ */ Y(`div`,{class:`message message-user`,children:e.text},e.id):/* @__PURE__ */ Y(Il,{message:e},e.id))})}function Il({message:e}){let[t]=P(e.streaming);return/* @__PURE__ */ Y(`div`,{class:`message message-assistant`,children:/* @__PURE__ */ Y(Dl,{text:e.text,animate:t})})}function Ll({text:e}){let t=[...e];return/* @__PURE__ */ Y(`span`,{class:`shimmer`,children:[/* @__PURE__ */ Y(`span`,{class:`sr-only`,children:e}),t.map((e,n)=>/* @__PURE__ */ Y(`span`,{"aria-hidden":`true`,style:{"--i":n,"--n":t.length},children:e},n))]})}function Rl({thread:e}){return e.status===`starting`?/* @__PURE__ */ Y(`div`,{class:`status-line`,children:[/* @__PURE__ */ Y(`span`,{class:`live-dot`}),/* @__PURE__ */ Y(Ll,{text:`Starting a thread in ${Ft(e.provider.id)}…`})]}):e.status===`working`?/* @__PURE__ */ Y(`div`,{class:`status-line`,children:[/* @__PURE__ */ Y(`span`,{class:`live-dot`}),/* @__PURE__ */ Y(Ll,{text:`Working…`}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`stop`,onClick:()=>H({type:`thread.interrupt`,threadId:e.id}),children:[/* @__PURE__ */ Y(vi,{}),` Stop`]})]}):e.status===`waiting`?/* @__PURE__ */ Y(`div`,{class:`status-line status-waiting`,children:[e.statusDetail??`Waiting for input`,e.provider.url&&/* @__PURE__ */ Y(`a`,{href:e.provider.url,target:`_blank`,rel:`noreferrer`,children:`Open`})]}):e.status===`error`?/* @__PURE__ */ Y(`div`,{class:`status-line status-error`,children:e.statusDetail??`Something went wrong`}):null}let zl=`tencil:dock`,Bl=[`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`],Vl=z(Hl());function Hl(){try{let e=localStorage.getItem(zl);return e&&Bl.includes(e)?e:`bottom-center`}catch{return`bottom-center`}}function Ul(e){Vl.value=e;try{localStorage.setItem(zl,e)}catch{}}function Wl(e,t,n,r){let i=e<n/3?`left`:e>n*2/3?`right`:`center`;return`${t<r/2?`top`:`bottom`}-${i}`}function Gl(e,t){if(e.button!==0)return;let n=e.currentTarget;try{n.setPointerCapture(e.pointerId)}catch{}let r=e.clientX,i=e.clientY,a=0,o=0,s=!1,c=[];t.style.transition=`none`;let l=e=>{a=e.clientX-r,o=e.clientY-i,!(!s&&Math.hypot(a,o)<3)&&(s=!0,t.dataset.dragging=``,t.style.translate=`${a}px ${o}px`,c=[...c.slice(-4),{x:e.clientX,y:e.clientY,t:e.timeStamp}])},u=()=>{if(n.removeEventListener(`pointermove`,l),n.removeEventListener(`pointerup`,u),n.removeEventListener(`pointercancel`,u),delete t.dataset.dragging,!s){t.style.translate=``,t.style.transition=``;return}let e=c[0],r=c[c.length-1],i=e&&r?Math.max(1,r.t-e.t):1,a=e&&r?(r.x-e.x)/i:0,o=e&&r?(r.y-e.y)/i:0,d=Jl(t);ql(t,d,Wl(d.left+d.width/2+a*120,d.top+d.height/2+o*120,window.innerWidth,window.innerHeight))};n.addEventListener(`pointermove`,l),n.addEventListener(`pointerup`,u),n.addEventListener(`pointercancel`,u)}function Kl(e,t){let[n,r]=Vl.value.split(`-`),i=[`left`,`center`,`right`],a=i.indexOf(r),o;return e===`ArrowLeft`&&a>0&&(o=`${n}-${i[a-1]}`),e===`ArrowRight`&&a<2&&(o=`${n}-${i[a+1]}`),e===`ArrowUp`&&n===`bottom`&&(o=`top-${r}`),e===`ArrowDown`&&n===`top`&&(o=`bottom-${r}`),o?(Ul(o),t.style.translate=``,!0):!1}function ql(e,t,n){Ul(n),requestAnimationFrame(()=>{e.style.translate=``;let n=Jl(e);e.style.translate=`${t.left-n.left}px ${t.top-n.top}px`;let r=matchMedia(`(prefers-reduced-motion: reduce)`).matches;requestAnimationFrame(()=>{e.style.transition=r?`none`:`translate 340ms cubic-bezier(0.32, 0.72, 0, 1)`,e.style.translate=`0px 0px`;let t=()=>{e.style.transition=``,e.style.translate=``};r?t():e.addEventListener(`transitionend`,t,{once:!0})})})}function Jl(e){return(e.querySelector(`.toolbar`)??e).getBoundingClientRect()}function Yl(){let[e,t]=P(``),n=Tt.value??[],r=e.trim().toLowerCase(),i=r?n.filter(e=>e.title.toLowerCase().includes(r)||e.root.toLowerCase().includes(r)):n,a=e=>H({type:`project.select`,root:e});return/* @__PURE__ */ Y(`div`,{class:`project-picker`,children:[/* @__PURE__ */ Y(`p`,{class:`project-picker-title`,children:`Which project is this page?`}),n.length===0?/* @__PURE__ */ Y(`p`,{class:`project-picker-empty`,children:Et.value??`No projects found.`}):/* @__PURE__ */ Y(C,{children:[/* @__PURE__ */ Y(`input`,{class:`project-picker-search`,type:`search`,placeholder:`Search projects`,"aria-label":`Search projects`,autoFocus:!0,value:e,onInput:e=>t(e.target.value),onKeyDown:e=>{e.key===`Enter`&&i[0]&&a(i[0].root)}}),/* @__PURE__ */ Y(`div`,{class:`project-picker-list`,children:[i.length===0&&/* @__PURE__ */ Y(`p`,{class:`project-picker-empty`,children:[`No project matches “`,e.trim(),`”.`]}),i.map(e=>/* @__PURE__ */ Y(`button`,{type:`button`,class:`project-picker-option`,title:e.root,onClick:()=>a(e.root),children:[/* @__PURE__ */ Y(`span`,{class:`project-picker-name`,children:e.title}),/* @__PURE__ */ Y(`span`,{class:`project-picker-root`,children:e.root})]},e.root))]})]})]})}function Xl(){let e=Ql(),t=U.value===`picking`,n=ke(null);return/* @__PURE__ */ Y(`div`,{ref:n,class:`toolbar-wrap dock-${Vl.value}`,children:[t&&/* @__PURE__ */ Y(`div`,{class:`toolbar-hint`,children:`Click any element to pin a prompt · Esc to cancel`}),!t&&Tt.value&&/* @__PURE__ */ Y(Yl,{}),!t&&!Tt.value&&e.hint&&/* @__PURE__ */ Y(`div`,{class:`toolbar-hint hint-${e.tone}`,children:[e.hint,e.action&&/* @__PURE__ */ Y(`button`,{type:`button`,class:`hint-action`,onClick:e.action.run,children:e.action.label})]}),/* @__PURE__ */ Y(`div`,{class:`toolbar`,children:[/* @__PURE__ */ Y(`span`,{class:`status-dot status-${e.tone}`,title:e.title,children:Jt.value>0&&/* @__PURE__ */ Y(`span`,{class:`status-ping`})}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`divider`,"aria-label":`Move toolbar (drag, or use arrow keys)`,title:`Drag to move`,onPointerDown:e=>n.current&&Gl(e,n.current),onKeyDown:e=>{n.current&&Kl(e.key,n.current)&&e.preventDefault()}}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`tool${t?` tool-active`:``}`,title:`Comment (C)`,onClick:()=>t?Xt():Yt(),children:[/* @__PURE__ */ Y(pi,{}),/* @__PURE__ */ Y(`span`,{class:`tool-label`,children:`Comment`}),/* @__PURE__ */ Y(`kbd`,{children:`C`})]}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`tool${K.value?` tool-active`:``}`,title:`Pins`,onClick:()=>{K.value=!K.value,zt.value=!1},children:[/* @__PURE__ */ Y(mi,{}),qt.value>0&&/* @__PURE__ */ Y(`span`,{class:`badge`,children:qt.value})]}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`tool`,title:Vt.value?`Show pins`:`Hide pins`,onClick:()=>{Vt.value=!Vt.value,Vt.value&&Xt()},children:Vt.value?/* @__PURE__ */ Y(hi,{}):/* @__PURE__ */ Y(gi,{})}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`tool${zt.value?` tool-active`:``}`,title:`Project settings`,disabled:!St.value,onClick:()=>{zt.value=!zt.value,K.value=!1},children:/* @__PURE__ */ Y(Ei,{})})]})]})}let Zl={label:`Switch agent`,run:()=>{zt.value=!0,K.value=!1}};function Ql(){if(bt.value!==`open`)return{tone:`error`,title:`Tencil daemon offline`,hint:bt.value===`connecting`?void 0:`The Tencil daemon stopped. Start it again with npx tencil start.`};if(Tt.value)return{tone:`warn`,title:`Pick this page's project`};let e=B.value;if(!e)return{tone:`warn`,title:`Connecting…`};switch(e.state){case`ready`:return{tone:`ok`,title:`${e.label}${e.target?` · ${e.target}`:``}`};case`unauthorized`:return e.canPair?{tone:`warn`,title:`${e.label}: not paired`,hint:`Not paired with ${e.label}`,action:{label:`Pair`,run:()=>H({type:`provider.pair`})}}:{tone:`warn`,title:`${e.label}: not signed in`,hint:e.detail??`Sign in to ${e.label}`,action:Zl};case`unavailable`:return{tone:`error`,title:e.detail??`${e.label} unavailable`,hint:e.detail??`${e.label} is unavailable`,action:Zl};default:return{tone:`warn`,title:`Connecting to ${e.label}…`}}}function $l(){return tu(),/* @__PURE__ */ Y(`div`,{class:`root${U.value===`picking`?` picking`:``}`,children:[/* @__PURE__ */ Y(wl,{}),/* @__PURE__ */ Y(ki,{}),/* @__PURE__ */ Y(Ki,{}),/* @__PURE__ */ Y(Nl,{}),/* @__PURE__ */ Y(Pi,{}),/* @__PURE__ */ Y(Tl,{}),/* @__PURE__ */ Y(eu,{}),/* @__PURE__ */ Y(Xl,{})]})}function eu(){let e=Dt.value,[t,n]=P(!1);return F(()=>{if(!e)return;n(!0);let t=setTimeout(()=>n(!1),5e3);return()=>clearTimeout(t)},[e?.at]),!e||!t?null:/* @__PURE__ */ Y(`div`,{class:`toast`,children:e.message})}function tu(){let e=V.value;F(()=>{let t=sessionStorage.getItem(Ni);if(!t)return;let n=e.get(t);n&&(sessionStorage.removeItem(Ni),G.value=t,Bi(n))},[e])}let nu=[`pointerdown`,`pointerup`,`mousedown`,`mouseup`,`dblclick`,`contextmenu`,`auxclick`];function ru(e){let t=t=>t.composedPath().includes(e),n=(t,n)=>{for(let r of document.elementsFromPoint(t,n)){if(r===e||e.contains(r))return null;if(r!==document.documentElement)return r}return null},r=e=>{U.value===`picking`&&(Rt.value=t(e)?null:n(e.clientX,e.clientY))},i=e=>{if(U.value===`idle`&&e.type===`pointerdown`&&!t(e)){(G.value?V.value.get(G.value):void 0)?.anchor&&(G.value=null);return}U.value!==`picking`||t(e)||(e.preventDefault(),e.stopImmediatePropagation())},a=e=>{if(U.value!==`picking`||t(e))return;e.preventDefault(),e.stopImmediatePropagation();let r=n(e.clientX,e.clientY);if(!r)return;let i=r.getBoundingClientRect(),a=(e,t)=>t>0?Math.min(1,Math.max(0,e/t)):.5;Xt();let o=rl(r);W.value={element:r,label:il(r),anchor:{selector:``,offsetX:a(e.clientX-i.left,i.width),offsetY:a(e.clientY-i.top,i.height)},context:o}},o=e=>{if(!t(e)){if(e.key===`Escape`){if(U.value===`picking`)Xt();else if(W.value)W.value=null;else if(G.value)G.value=null;else if(K.value)K.value=!1;else return;e.preventDefault();return}iu(e)||e.key.toLowerCase()===`c`&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&(e.preventDefault(),Vt.value=!1,U.value===`picking`?Xt():Yt())}},s=0,c=()=>{s||=requestAnimationFrame(()=>{s=0,Ht.value++})},l=new MutationObserver(t=>{t.every(t=>e.contains(t.target)||t.target===e)||c()});l.observe(document.body,{childList:!0,subtree:!0,attributes:!0});let u=setInterval(()=>{let e=Wt(location.href);e!==Ut.value&&(Ut.value=e,W.value=null,G.value=null)},400);window.addEventListener(`pointermove`,r,{capture:!0,passive:!0});for(let e of nu)window.addEventListener(e,i,!0);return window.addEventListener(`click`,a,!0),window.addEventListener(`keydown`,o,!0),window.addEventListener(`scroll`,c,{capture:!0,passive:!0}),window.addEventListener(`resize`,c,{passive:!0}),()=>{window.removeEventListener(`pointermove`,r,!0);for(let e of nu)window.removeEventListener(e,i,!0);window.removeEventListener(`click`,a,!0),window.removeEventListener(`keydown`,o,!0),window.removeEventListener(`scroll`,c,!0),window.removeEventListener(`resize`,c),l.disconnect(),clearInterval(u),cancelAnimationFrame(s)}}function iu(e){let t=e.composedPath()[0];return t instanceof HTMLElement?t.isContentEditable||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement:!1}function au(){let e=document.currentScript;return e?.dataset.bridge?e.dataset.bridge:e?.src?new URL(e.src).origin:`http://localhost:4747`}function ou(e){let t=document.createElement(`tencil-overlay`);t.setAttribute(`data-tencil`,``),t.style.cssText=`position:fixed;inset:0;pointer-events:none;z-index:2147483646;display:block;contain:layout style;`;let n=t.attachShadow({mode:`open`}),r=document.createElement(`style`);r.textContent=`
|
|
74
|
+
:host { all: initial; }
|
|
75
|
+
* { box-sizing: border-box; }
|
|
76
|
+
|
|
77
|
+
.root {
|
|
78
|
+
/* Neutral scale (light). Panels read like a calm document; the toolbar stays dark. */
|
|
79
|
+
--n-50: hsl(120 4% 97%);
|
|
80
|
+
--n-100: hsl(120 2% 92%);
|
|
81
|
+
--n-200: hsl(90 2% 82%);
|
|
82
|
+
--n-400: hsl(105 2% 60%);
|
|
83
|
+
--n-500: hsl(96 2% 50%);
|
|
84
|
+
--n-600: hsl(105 2% 40%);
|
|
85
|
+
--n-700: hsl(100 2% 28%);
|
|
86
|
+
--n-900: hsl(90 2% 9%);
|
|
87
|
+
--n-950: hsl(60 4% 5%);
|
|
88
|
+
--surface: #fff;
|
|
89
|
+
|
|
90
|
+
/* Pixelperfect primary scale. */
|
|
91
|
+
--accent: hsl(214 67% 51%);
|
|
92
|
+
--accent-soft: hsl(214 67% 51% / 0.12);
|
|
93
|
+
--accent-text: hsl(214 58% 32%);
|
|
94
|
+
--primary: hsl(214 62% 42%);
|
|
95
|
+
--user-bg: hsl(212 81% 96%);
|
|
96
|
+
--user-text: hsl(214 58% 32%);
|
|
97
|
+
--live: hsl(214 67% 51%);
|
|
98
|
+
--done: #1a896b;
|
|
99
|
+
--warn: #b7791f;
|
|
100
|
+
--error: #d93036;
|
|
101
|
+
|
|
102
|
+
--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
|
|
103
|
+
--ease-text: cubic-bezier(0.22, 1, 0.36, 1);
|
|
104
|
+
--press: scale(0.97);
|
|
105
|
+
--radius: 14px;
|
|
106
|
+
--shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 4px 8px -2px rgba(0, 0, 0, 0.06),
|
|
107
|
+
0 16px 40px -8px rgba(0, 0, 0, 0.16);
|
|
108
|
+
|
|
109
|
+
font: 13px/1.5 Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
110
|
+
letter-spacing: 0.02rem;
|
|
111
|
+
color: var(--n-950);
|
|
112
|
+
color-scheme: light;
|
|
113
|
+
-webkit-font-smoothing: antialiased;
|
|
114
|
+
}
|
|
115
|
+
@media (prefers-color-scheme: dark) {
|
|
116
|
+
.root {
|
|
117
|
+
--n-50: hsl(60 4% 7%);
|
|
118
|
+
--n-100: hsl(90 2% 13%);
|
|
119
|
+
--n-200: hsl(100 2% 21%);
|
|
120
|
+
--n-400: hsl(100 2% 42%);
|
|
121
|
+
--n-500: hsl(96 2% 52%);
|
|
122
|
+
--n-600: hsl(105 2% 64%);
|
|
123
|
+
--n-700: hsl(100 2% 76%);
|
|
124
|
+
--n-900: hsl(120 2% 90%);
|
|
125
|
+
--n-950: hsl(120 4% 96%);
|
|
126
|
+
--surface: hsl(90 2% 10%);
|
|
127
|
+
--accent-soft: hsl(214 67% 51% / 0.2);
|
|
128
|
+
--accent-text: hsl(214 67% 69%);
|
|
129
|
+
--primary: hsl(214 67% 69%);
|
|
130
|
+
--user-bg: hsl(211 33% 14%);
|
|
131
|
+
--user-text: hsl(215 82% 89%);
|
|
132
|
+
--live: hsl(214 67% 60%);
|
|
133
|
+
--done: #3dd6a4;
|
|
134
|
+
--warn: #f5b84a;
|
|
135
|
+
--error: #ff6369;
|
|
136
|
+
--shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 16px 40px -8px rgba(0, 0, 0, 0.6);
|
|
137
|
+
color-scheme: dark;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* Thin, theme-aware scrollbars everywhere inside the overlay. */
|
|
142
|
+
* { scrollbar-width: thin; scrollbar-color: var(--n-200) transparent; }
|
|
143
|
+
@supports not (scrollbar-color: auto) {
|
|
144
|
+
::-webkit-scrollbar { width: 6px; height: 6px; }
|
|
145
|
+
::-webkit-scrollbar-track { background: transparent; }
|
|
146
|
+
::-webkit-scrollbar-thumb { background: var(--n-200); border-radius: 999px; }
|
|
147
|
+
}
|
|
148
|
+
.root.picking { cursor: crosshair; }
|
|
149
|
+
::selection { background: var(--accent); color: white; }
|
|
150
|
+
|
|
151
|
+
button { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
|
|
152
|
+
a { color: inherit; }
|
|
153
|
+
kbd {
|
|
154
|
+
font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
155
|
+
padding: 2px 5px; border-radius: 4px;
|
|
156
|
+
background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.6);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* ------------------------------- highlight ------------------------------- */
|
|
160
|
+
/* Follows the cursor dozens of times a second: no transition, ever. */
|
|
161
|
+
.highlight {
|
|
162
|
+
position: fixed; left: 0; top: 0;
|
|
163
|
+
border: 1.5px solid var(--accent);
|
|
164
|
+
background: var(--accent-soft);
|
|
165
|
+
border-radius: 4px;
|
|
166
|
+
pointer-events: none;
|
|
167
|
+
}
|
|
168
|
+
.highlight-label {
|
|
169
|
+
position: fixed; left: 0; top: 0;
|
|
170
|
+
display: flex; gap: 6px; align-items: center;
|
|
171
|
+
padding: 3px 7px; border-radius: 6px;
|
|
172
|
+
background: var(--accent); color: white;
|
|
173
|
+
font-size: 11px; font-weight: 500; white-space: nowrap;
|
|
174
|
+
pointer-events: none;
|
|
175
|
+
}
|
|
176
|
+
.highlight-size { opacity: 0.75; }
|
|
177
|
+
|
|
178
|
+
/* ---------------------------------- pins --------------------------------- */
|
|
179
|
+
.pin {
|
|
180
|
+
position: fixed; left: 0; top: 0; width: 0; height: 0;
|
|
181
|
+
pointer-events: auto;
|
|
182
|
+
--pin: var(--accent);
|
|
183
|
+
}
|
|
184
|
+
.pin-body {
|
|
185
|
+
position: absolute; left: 0; bottom: 0;
|
|
186
|
+
min-width: 28px; height: 28px; padding: 0 8px;
|
|
187
|
+
display: grid; place-items: center;
|
|
188
|
+
border-radius: 14px 14px 14px 3px;
|
|
189
|
+
background: var(--pin); color: white;
|
|
190
|
+
font-size: 12px; font-weight: 600;
|
|
191
|
+
border: 2px solid white;
|
|
192
|
+
box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.35);
|
|
193
|
+
transform-origin: bottom left;
|
|
194
|
+
transition: transform 160ms var(--ease-out), opacity 160ms var(--ease-out), background-color 200ms ease;
|
|
195
|
+
@starting-style { opacity: 0; transform: scale(0.85); }
|
|
196
|
+
}
|
|
197
|
+
.pin-open .pin-body { transform: scale(1.1); }
|
|
198
|
+
.pin:active .pin-body { transform: scale(0.94); }
|
|
199
|
+
.pin-done { --pin: var(--done); }
|
|
200
|
+
.pin-waiting { --pin: #e69a10; }
|
|
201
|
+
.pin-error { --pin: #e5484d; }
|
|
202
|
+
.pin-resolved { --pin: #7b7d7a; }
|
|
203
|
+
.pin-resolved .pin-body { opacity: 0.8; }
|
|
204
|
+
.pin-draft .pin-body { background: white; border-color: var(--accent); color: var(--accent); }
|
|
205
|
+
.pin-working .pin-body::after {
|
|
206
|
+
content: ""; position: absolute; inset: -6px;
|
|
207
|
+
border-radius: 18px 18px 18px 6px;
|
|
208
|
+
border: 2px solid transparent; border-top-color: var(--pin); border-right-color: var(--pin);
|
|
209
|
+
animation: spin 700ms linear infinite;
|
|
210
|
+
}
|
|
211
|
+
.pin-static { position: relative; width: 28px; height: 28px; flex: none; pointer-events: none; }
|
|
212
|
+
.pin-static .pin-body { transform: none; border-color: var(--surface); box-shadow: none; }
|
|
213
|
+
@keyframes spin { to { transform: rotate(360deg); } }
|
|
214
|
+
|
|
215
|
+
/* -------------------------------- popovers -------------------------------- */
|
|
216
|
+
.popover {
|
|
217
|
+
position: fixed;
|
|
218
|
+
pointer-events: auto;
|
|
219
|
+
background: var(--n-50);
|
|
220
|
+
border-radius: var(--radius);
|
|
221
|
+
box-shadow: var(--shadow);
|
|
222
|
+
transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
|
|
223
|
+
@starting-style { opacity: 0; transform: scale(0.96); }
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.composer { padding: 10px; display: grid; gap: 8px; }
|
|
227
|
+
.composer-target { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 2px; }
|
|
228
|
+
.composer-provider {
|
|
229
|
+
display: inline-flex; align-items: center; gap: 4px; min-width: 0; margin-left: auto;
|
|
230
|
+
padding: 2px 6px; border-radius: 7px; color: var(--n-600); font-size: 12px;
|
|
231
|
+
}
|
|
232
|
+
.composer-provider-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
233
|
+
.composer-provider svg { flex: none; transition: transform 150ms var(--ease-out); }
|
|
234
|
+
.composer-provider.open svg { transform: rotate(180deg); }
|
|
235
|
+
.target-menu {
|
|
236
|
+
display: grid; max-height: 220px; overflow-y: auto; padding: 4px;
|
|
237
|
+
background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 1px var(--n-200);
|
|
238
|
+
transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
|
|
239
|
+
transform-origin: top right;
|
|
240
|
+
@starting-style { opacity: 0; transform: scale(0.97); }
|
|
241
|
+
}
|
|
242
|
+
.target-option {
|
|
243
|
+
display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0;
|
|
244
|
+
padding: 7px 8px; border-radius: 8px; text-align: left; font-size: 12px;
|
|
245
|
+
}
|
|
246
|
+
.target-option.selected { background: var(--n-100); }
|
|
247
|
+
.target-option-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
248
|
+
.target-option-meta { color: var(--n-500); flex: none; }
|
|
249
|
+
.target-empty { margin: 0; padding: 7px 8px; color: var(--n-500); font-size: 12px; }
|
|
250
|
+
.thread-dot { width: 7px; height: 7px; border-radius: 999px; flex: none; background: var(--n-400); }
|
|
251
|
+
.inbox-item .thread-dot { margin: 7px 4px 0 2px; }
|
|
252
|
+
.thread-dot-working, .thread-dot-starting { background: var(--live); animation: live 1.6s ease-in-out infinite; }
|
|
253
|
+
.thread-dot-waiting { background: var(--warn); }
|
|
254
|
+
.thread-dot-error { background: var(--error); }
|
|
255
|
+
.thread-dot-idle { background: var(--done); }
|
|
256
|
+
|
|
257
|
+
/* Provider thread rows, after T3 Code's sidebar. */
|
|
258
|
+
.inbox-item.provider-item {
|
|
259
|
+
display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 9px 10px;
|
|
260
|
+
}
|
|
261
|
+
.provider-item-project { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--n-500); font-size: 12px; }
|
|
262
|
+
.provider-item-project-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
263
|
+
.provider-item-time { flex: none; font-variant-numeric: tabular-nums; }
|
|
264
|
+
.provider-item-state { flex: none; font-weight: 500; }
|
|
265
|
+
.state-working { color: var(--live); }
|
|
266
|
+
.state-waiting { color: var(--warn); }
|
|
267
|
+
.state-monitoring { color: var(--accent); }
|
|
268
|
+
.provider-item-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
269
|
+
.provider-item-meta { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--n-500); font-size: 12px; }
|
|
270
|
+
.provider-item-branch { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
271
|
+
.provider-item-pr { flex: none; color: var(--done); font-variant-numeric: tabular-nums; }
|
|
272
|
+
.provider-item-pins { flex: none; color: var(--accent); }
|
|
273
|
+
.provider-item-meta .agent-icon { margin-left: auto; }
|
|
274
|
+
.project-icon { width: 14px; height: 14px; border-radius: 4px; flex: none; object-fit: contain; }
|
|
275
|
+
.project-icon-emoji { font-size: 12px; line-height: 14px; text-align: center; }
|
|
276
|
+
.project-icon-letter { display: grid; place-items: center; background: var(--n-200); color: var(--n-700); font-size: 9px; font-weight: 600; text-transform: uppercase; }
|
|
277
|
+
.agent-icon { flex: none; }
|
|
278
|
+
.agent-mono { fill: var(--n-950); }
|
|
279
|
+
.agent-claude { fill: #d97757; }
|
|
280
|
+
.hint { margin: 0; padding: 0 2px; color: var(--warn); font-size: 12px; }
|
|
281
|
+
|
|
282
|
+
.chip {
|
|
283
|
+
display: inline-flex; align-items: center; gap: 5px;
|
|
284
|
+
max-width: 200px; padding: 2px 8px; border-radius: 999px;
|
|
285
|
+
background: var(--accent-soft); color: var(--accent-text);
|
|
286
|
+
font: 500 11px/18px ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
287
|
+
letter-spacing: 0;
|
|
288
|
+
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.prompt-input {
|
|
292
|
+
display: grid; gap: 6px;
|
|
293
|
+
background: var(--surface);
|
|
294
|
+
box-shadow: 0 0 0 1px var(--n-200);
|
|
295
|
+
border-radius: 12px;
|
|
296
|
+
padding: 9px 8px 6px 11px;
|
|
297
|
+
transition: box-shadow 150ms ease;
|
|
298
|
+
}
|
|
299
|
+
.prompt-input:focus-within { box-shadow: 0 0 0 1px var(--n-400), 0 0 0 4px var(--n-100); }
|
|
300
|
+
.prompt-input textarea {
|
|
301
|
+
all: unset; display: block; width: 100%;
|
|
302
|
+
min-height: 20px; max-height: 200px; overflow-y: auto;
|
|
303
|
+
color: var(--n-950); font: inherit; letter-spacing: inherit; line-height: 1.5rem;
|
|
304
|
+
white-space: pre-wrap; word-break: break-word;
|
|
305
|
+
}
|
|
306
|
+
.prompt-input textarea::placeholder { color: var(--n-500); }
|
|
307
|
+
.prompt-input textarea:disabled { opacity: 0.6; }
|
|
308
|
+
.prompt-actions { display: flex; align-items: center; justify-content: space-between; }
|
|
309
|
+
.prompt-extras { display: flex; gap: 4px; }
|
|
310
|
+
.send {
|
|
311
|
+
width: 26px; height: 26px; border-radius: 999px;
|
|
312
|
+
display: grid; place-items: center;
|
|
313
|
+
background: var(--n-950); color: var(--n-50);
|
|
314
|
+
transition: opacity 150ms ease, transform 160ms var(--ease-out);
|
|
315
|
+
}
|
|
316
|
+
.send:disabled { opacity: 0.25; cursor: default; }
|
|
317
|
+
.send:not(:disabled):active { transform: var(--press); }
|
|
318
|
+
.toggle {
|
|
319
|
+
height: 24px; padding: 0 7px; border-radius: 7px;
|
|
320
|
+
display: inline-flex; align-items: center; gap: 4px;
|
|
321
|
+
color: var(--n-500);
|
|
322
|
+
}
|
|
323
|
+
.toggle-on { color: var(--n-950); background: var(--n-100); }
|
|
324
|
+
|
|
325
|
+
.spinner {
|
|
326
|
+
width: 12px; height: 12px; border-radius: 999px;
|
|
327
|
+
border: 2px solid currentColor; border-top-color: transparent;
|
|
328
|
+
animation: spin 600ms linear infinite;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/* --------------------------------- thread -------------------------------- */
|
|
332
|
+
.thread { display: flex; flex-direction: column; max-height: min(560px, calc(100vh - 24px)); padding: 0 10px 10px; }
|
|
333
|
+
.thread-header {
|
|
334
|
+
display: flex; align-items: center; justify-content: space-between; gap: 8px;
|
|
335
|
+
padding: 10px 2px 10px; border-bottom: 1px solid var(--n-200);
|
|
336
|
+
}
|
|
337
|
+
.thread-heading { display: flex; align-items: center; gap: 6px; min-width: 0; }
|
|
338
|
+
.thread-number { color: var(--n-600); font-weight: 500; font-size: 12px; }
|
|
339
|
+
.thread-source { color: var(--n-600); font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
340
|
+
.thread-tools { display: flex; gap: 2px; flex: none; }
|
|
341
|
+
.thread-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 2px; }
|
|
342
|
+
.thread-docked { max-height: calc(100vh - 100px); }
|
|
343
|
+
.icon-button {
|
|
344
|
+
width: 26px; height: 26px; border-radius: 7px;
|
|
345
|
+
display: grid; place-items: center; color: var(--n-600);
|
|
346
|
+
text-decoration: none;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.messages {
|
|
350
|
+
overflow-y: auto; padding: 16px 2px; min-height: 40px;
|
|
351
|
+
display: flex; flex-direction: column; gap: 1.25rem;
|
|
352
|
+
}
|
|
353
|
+
/* Fade the top edge once content scrolls under the header. */
|
|
354
|
+
.messages[data-scrolled] { mask-image: linear-gradient(to bottom, transparent 0, #000 2.5rem); }
|
|
355
|
+
.message { max-width: 100%; word-break: break-word; }
|
|
356
|
+
.message-user {
|
|
357
|
+
align-self: flex-end; max-width: 85%;
|
|
358
|
+
background: var(--user-bg); color: var(--user-text);
|
|
359
|
+
padding: 0.75rem 0.875rem; border-radius: 1.125rem;
|
|
360
|
+
line-height: 1.5rem; white-space: pre-wrap;
|
|
361
|
+
transition: opacity 350ms var(--ease-text), transform 350ms var(--ease-text), filter 350ms var(--ease-text);
|
|
362
|
+
@starting-style { opacity: 0; transform: translateY(8px); filter: blur(4px); }
|
|
363
|
+
}
|
|
364
|
+
.message-assistant { color: var(--n-950); }
|
|
365
|
+
|
|
366
|
+
/* Markdown, after the Eyes assistant: quiet weight, generous leading. */
|
|
367
|
+
.md { font-size: 13px; }
|
|
368
|
+
.md > * { margin: 0; }
|
|
369
|
+
.md > * + * { margin-top: 0.75rem; }
|
|
370
|
+
.md p, .md li { line-height: 1.5rem; }
|
|
371
|
+
.md strong { font-weight: 500; color: var(--n-950); }
|
|
372
|
+
.md a { font-weight: 500; color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
|
|
373
|
+
.md ul { list-style: disc; padding-left: 1.25rem; }
|
|
374
|
+
.md ol { list-style: decimal; padding-left: 1.25rem; }
|
|
375
|
+
.md li + li { margin-top: 0.375rem; }
|
|
376
|
+
.md li::marker { color: var(--n-400); }
|
|
377
|
+
.md .md-heading { font-size: 14px; font-weight: 500; line-height: 1.5rem; }
|
|
378
|
+
.md :not(pre) > code {
|
|
379
|
+
border-radius: 0.5rem; background: var(--n-100); padding: 0.125rem 0.375rem;
|
|
380
|
+
font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0;
|
|
381
|
+
}
|
|
382
|
+
.md pre {
|
|
383
|
+
overflow-x: auto; border-radius: 0.875rem; background: var(--n-100); padding: 0.75rem;
|
|
384
|
+
font: 12px/1.25rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0;
|
|
385
|
+
}
|
|
386
|
+
.md pre > code { background: transparent; padding: 0; }
|
|
387
|
+
|
|
388
|
+
/* Streaming words blur in as they arrive; the stream itself is the stagger. */
|
|
389
|
+
.w { display: inline-block; white-space: pre-wrap; animation: word-in 400ms var(--ease-text) both; }
|
|
390
|
+
@keyframes word-in { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: blur(0); } }
|
|
391
|
+
|
|
392
|
+
.status-line {
|
|
393
|
+
display: flex; align-items: center; gap: 0.5rem; height: 1.25rem;
|
|
394
|
+
margin: 0 2px 10px; color: var(--n-600); font-size: 13px;
|
|
395
|
+
transition: opacity 250ms var(--ease-out);
|
|
396
|
+
@starting-style { opacity: 0; }
|
|
397
|
+
}
|
|
398
|
+
.status-waiting { color: var(--warn); }
|
|
399
|
+
.status-error { color: var(--error); }
|
|
400
|
+
.status-line a { margin-left: auto; color: var(--n-950); font-weight: 500; }
|
|
401
|
+
.live-dot {
|
|
402
|
+
width: 6px; height: 6px; border-radius: 999px; background: var(--live); flex: none;
|
|
403
|
+
animation: live 1.6s ease-in-out infinite;
|
|
404
|
+
}
|
|
405
|
+
@keyframes live { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } }
|
|
406
|
+
.stop {
|
|
407
|
+
margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
|
|
408
|
+
padding: 3px 9px; border-radius: 999px; color: var(--n-700);
|
|
409
|
+
box-shadow: 0 0 0 1px var(--n-200); font-size: 12px;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/* A color wave across the label, one character at a time. */
|
|
413
|
+
.shimmer { display: inline-flex; align-items: center; line-height: 1; user-select: none; }
|
|
414
|
+
.shimmer > span[aria-hidden] {
|
|
415
|
+
display: inline-block; white-space: pre; color: var(--n-500);
|
|
416
|
+
animation: shimmer-char 2.1s ease-in-out infinite;
|
|
417
|
+
animation-delay: calc(var(--i) * 1.6s / var(--n));
|
|
418
|
+
}
|
|
419
|
+
@keyframes shimmer-char { 0% { color: var(--n-500); } 38% { color: var(--n-900); } 76%, 100% { color: var(--n-500); } }
|
|
420
|
+
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
421
|
+
|
|
422
|
+
/* ---------------------------------- inbox --------------------------------- */
|
|
423
|
+
.inbox {
|
|
424
|
+
position: fixed; right: 16px; top: 16px; bottom: 84px; width: 340px;
|
|
425
|
+
display: flex; flex-direction: column;
|
|
426
|
+
pointer-events: auto;
|
|
427
|
+
background: var(--n-50); border-radius: var(--radius); box-shadow: var(--shadow);
|
|
428
|
+
transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
|
|
429
|
+
@starting-style { opacity: 0; transform: translateX(8px); }
|
|
430
|
+
}
|
|
431
|
+
.root:has(.dock-top-right) .inbox { top: 76px; bottom: 16px; }
|
|
432
|
+
.inbox-header { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--n-200); }
|
|
433
|
+
.inbox-header strong { font-size: 14px; font-weight: 500; }
|
|
434
|
+
.segmented { display: flex; margin-right: auto; background: var(--n-100); border-radius: 9px; padding: 2px; }
|
|
435
|
+
.segmented button { padding: 3px 10px; border-radius: 7px; color: var(--n-600); font-size: 12px; }
|
|
436
|
+
.segmented .active { background: var(--surface); color: var(--n-950); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
|
|
437
|
+
.inbox-filter { display: flex; align-items: center; gap: 6px; padding: 10px 16px 6px; color: var(--n-600); font-size: 12px; cursor: pointer; }
|
|
438
|
+
.inbox-filter input { accent-color: var(--accent); margin: 0; }
|
|
439
|
+
.inbox-list { overflow-y: auto; padding: 0 6px 6px; }
|
|
440
|
+
.inbox-item { display: flex; gap: 10px; width: 100%; text-align: left; padding: 10px; border-radius: 12px; align-items: flex-start; }
|
|
441
|
+
.inbox-item.active { background: var(--n-100); }
|
|
442
|
+
.inbox-item-body { display: grid; gap: 2px; min-width: 0; }
|
|
443
|
+
.inbox-item-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
444
|
+
.inbox-item-meta { color: var(--n-600); font-size: 12px; }
|
|
445
|
+
.inbox-item-preview { color: var(--n-600); font-size: 12px; line-height: 1.25rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
|
446
|
+
.empty { color: var(--n-500); padding: 24px 10px; text-align: center; margin: 0; }
|
|
447
|
+
.empty kbd { background: var(--n-100); color: var(--n-700); }
|
|
448
|
+
|
|
449
|
+
/* -------------------------------- settings -------------------------------- */
|
|
450
|
+
.inbox.settings-panel, .root:has(.dock-top-right) .inbox.settings-panel { bottom: auto; }
|
|
451
|
+
.settings-title { margin-right: auto; }
|
|
452
|
+
.settings-section { display: grid; gap: 6px; padding: 14px 16px 16px; }
|
|
453
|
+
.settings-label { margin: 0; font-weight: 500; }
|
|
454
|
+
.settings-help { margin: 0 0 4px; color: var(--n-600); font-size: 12px; }
|
|
455
|
+
.settings-options {
|
|
456
|
+
display: grid; gap: 2px; margin: 0; padding: 4px; border: 0; min-width: 0;
|
|
457
|
+
background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 1px var(--n-200);
|
|
458
|
+
}
|
|
459
|
+
.settings-options .target-option { cursor: pointer; }
|
|
460
|
+
.settings-radio {
|
|
461
|
+
appearance: none; margin: 0; width: 14px; height: 14px; border-radius: 999px; flex: none;
|
|
462
|
+
box-shadow: inset 0 0 0 1.5px var(--n-400);
|
|
463
|
+
transition: box-shadow 150ms var(--ease-out);
|
|
464
|
+
}
|
|
465
|
+
.settings-radio:checked { box-shadow: inset 0 0 0 4px var(--accent); }
|
|
466
|
+
.settings-radio:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
467
|
+
.settings-status { margin: 2px 2px 0; color: var(--n-600); font-size: 12px; }
|
|
468
|
+
|
|
469
|
+
/* --------------------------------- toolbar -------------------------------- */
|
|
470
|
+
.toolbar-wrap {
|
|
471
|
+
position: fixed;
|
|
472
|
+
display: flex; flex-direction: column; align-items: center; gap: 8px;
|
|
473
|
+
pointer-events: none;
|
|
474
|
+
}
|
|
475
|
+
.toolbar-wrap[data-dragging] { cursor: grabbing; }
|
|
476
|
+
.toolbar { transition: scale 160ms var(--ease-out), box-shadow 160ms var(--ease-out); }
|
|
477
|
+
.toolbar-wrap[data-dragging] .toolbar {
|
|
478
|
+
scale: 1.03;
|
|
479
|
+
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 24px 56px -10px rgba(0, 0, 0, 0.6);
|
|
480
|
+
}
|
|
481
|
+
.dock-bottom-center { left: 50%; bottom: 20px; transform: translateX(-50%); }
|
|
482
|
+
.dock-bottom-left { left: 20px; bottom: 20px; align-items: flex-start; }
|
|
483
|
+
.dock-bottom-right { right: 20px; bottom: 20px; align-items: flex-end; }
|
|
484
|
+
.dock-top-center { left: 50%; top: 20px; transform: translateX(-50%); flex-direction: column-reverse; }
|
|
485
|
+
.dock-top-left { left: 20px; top: 20px; align-items: flex-start; flex-direction: column-reverse; }
|
|
486
|
+
.dock-top-right { right: 20px; top: 20px; align-items: flex-end; flex-direction: column-reverse; }
|
|
487
|
+
.toolbar {
|
|
488
|
+
pointer-events: auto;
|
|
489
|
+
display: flex; align-items: center; gap: 2px;
|
|
490
|
+
padding: 4px; border-radius: 999px;
|
|
491
|
+
background: rgba(17, 17, 19, 0.92);
|
|
492
|
+
backdrop-filter: blur(12px);
|
|
493
|
+
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 32px -8px rgba(0, 0, 0, 0.5);
|
|
494
|
+
color: rgba(255, 255, 255, 0.62);
|
|
495
|
+
}
|
|
496
|
+
.toolbar-hint {
|
|
497
|
+
padding: 5px 12px; border-radius: 999px;
|
|
498
|
+
background: rgba(17, 17, 19, 0.92);
|
|
499
|
+
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 24px -8px rgba(0, 0, 0, 0.5);
|
|
500
|
+
color: rgba(255, 255, 255, 0.7); font-size: 12px; white-space: nowrap;
|
|
501
|
+
transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
|
|
502
|
+
@starting-style { opacity: 0; transform: translateY(4px); }
|
|
503
|
+
}
|
|
504
|
+
.hint-warn { color: #f5b84a; }
|
|
505
|
+
.project-picker {
|
|
506
|
+
pointer-events: auto; width: 320px; max-height: 320px; display: flex; flex-direction: column;
|
|
507
|
+
padding: 10px; border-radius: 14px; background: rgba(17, 17, 19, 0.94);
|
|
508
|
+
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 32px -8px rgba(0, 0, 0, 0.5);
|
|
509
|
+
color: rgba(255, 255, 255, 0.86);
|
|
510
|
+
transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
|
|
511
|
+
@starting-style { opacity: 0; transform: translateY(4px); }
|
|
512
|
+
}
|
|
513
|
+
.project-picker-title { margin: 0 4px 8px; font-weight: 500; }
|
|
514
|
+
.project-picker-empty { margin: 0 4px; color: rgba(255, 255, 255, 0.6); font-size: 12px; }
|
|
515
|
+
.project-picker-search {
|
|
516
|
+
margin: 0 0 6px; padding: 6px 8px; border: 0; border-radius: 8px; outline: none;
|
|
517
|
+
background: rgba(255, 255, 255, 0.06); color: inherit; font: inherit;
|
|
518
|
+
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
|
|
519
|
+
transition: box-shadow 150ms ease;
|
|
520
|
+
}
|
|
521
|
+
.project-picker-search::placeholder { color: rgba(255, 255, 255, 0.4); }
|
|
522
|
+
.project-picker-search:focus { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24); }
|
|
523
|
+
.project-picker-list { display: grid; gap: 2px; overflow-y: auto; scrollbar-color: rgba(255, 255, 255, 0.2) transparent; }
|
|
524
|
+
.project-picker-option {
|
|
525
|
+
display: grid; gap: 1px; text-align: left; padding: 7px 8px; border-radius: 8px;
|
|
526
|
+
transition: background-color 150ms ease, transform 160ms var(--ease-out);
|
|
527
|
+
}
|
|
528
|
+
.project-picker-option:active { transform: scale(0.99); }
|
|
529
|
+
.project-picker-name { font-weight: 500; }
|
|
530
|
+
.project-picker-root { font-size: 11px; color: rgba(255, 255, 255, 0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: rtl; text-align: left; }
|
|
531
|
+
.toolbar-hint:has(.hint-action) { display: flex; align-items: center; gap: 8px; pointer-events: auto; padding-right: 4px; }
|
|
532
|
+
.hint-action {
|
|
533
|
+
padding: 2px 10px; border-radius: 999px; background: var(--accent); color: white; font-weight: 500;
|
|
534
|
+
transition: transform 160ms var(--ease-out);
|
|
535
|
+
}
|
|
536
|
+
.hint-action:active { transform: var(--press); }
|
|
537
|
+
.hint-error { color: #ff8589; }
|
|
538
|
+
.status-dot { position: relative; width: 8px; height: 8px; margin: 0 8px 0 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.4); }
|
|
539
|
+
.status-ok { background: #3dd68c; }
|
|
540
|
+
.status-warn { background: #f5b84a; }
|
|
541
|
+
.status-error { background: #ff6369; }
|
|
542
|
+
.status-ping { position: absolute; inset: -3px; border-radius: 999px; border: 2px solid var(--accent); animation: ping 1.2s var(--ease-out) infinite; }
|
|
543
|
+
@keyframes ping { to { transform: scale(1.9); opacity: 0; } }
|
|
544
|
+
/* The separator line is also the drag handle; the hit area is wider than the line. */
|
|
545
|
+
.divider {
|
|
546
|
+
position: relative; width: 11px; height: 28px; margin: 0 -2px;
|
|
547
|
+
cursor: grab; touch-action: none;
|
|
548
|
+
}
|
|
549
|
+
.divider::before {
|
|
550
|
+
content: ""; position: absolute; left: 5px; top: 5px; bottom: 5px; width: 1px;
|
|
551
|
+
background: rgba(255, 255, 255, 0.1);
|
|
552
|
+
transition: background-color 150ms ease;
|
|
553
|
+
}
|
|
554
|
+
.divider:focus-visible { outline: none; }
|
|
555
|
+
.divider:focus-visible::before { background: var(--accent); }
|
|
556
|
+
[data-dragging] .divider { cursor: grabbing; }
|
|
557
|
+
[data-dragging] .divider::before { background: rgba(255, 255, 255, 0.35); }
|
|
558
|
+
.tool {
|
|
559
|
+
position: relative; height: 32px; min-width: 32px; padding: 0 9px;
|
|
560
|
+
display: inline-flex; align-items: center; justify-content: center; gap: 7px;
|
|
561
|
+
border-radius: 999px;
|
|
562
|
+
}
|
|
563
|
+
.tool-active { background: var(--accent); color: white; }
|
|
564
|
+
.tool-active kbd { background: rgba(255, 255, 255, 0.22); color: white; }
|
|
565
|
+
.tool-label { font-weight: 500; color: inherit; }
|
|
566
|
+
.badge {
|
|
567
|
+
position: absolute; top: 2px; right: 0;
|
|
568
|
+
min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
|
|
569
|
+
background: var(--accent); color: white; font-size: 10px; font-weight: 600; line-height: 16px; text-align: center;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
.toast {
|
|
573
|
+
position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%);
|
|
574
|
+
max-width: 480px; padding: 8px 14px; border-radius: 12px;
|
|
575
|
+
background: var(--surface); color: var(--error);
|
|
576
|
+
box-shadow: var(--shadow); pointer-events: auto;
|
|
577
|
+
transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
|
|
578
|
+
@starting-style { opacity: 0; transform: translate(-50%, 6px); }
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/* --------------------------- feedback & motion --------------------------- */
|
|
582
|
+
.tool, .icon-button, .toggle, .stop, .segmented button, .inbox-item, .composer-provider, .target-option {
|
|
583
|
+
transition: transform 160ms var(--ease-out), background-color 150ms ease, color 150ms ease;
|
|
584
|
+
}
|
|
585
|
+
.tool:active, .icon-button:active, .toggle:active, .stop:active, .segmented button:active,
|
|
586
|
+
.composer-provider:active { transform: var(--press); }
|
|
587
|
+
.target-option:active { transform: scale(0.99); }
|
|
588
|
+
.inbox-item:active { transform: scale(0.99); }
|
|
589
|
+
|
|
590
|
+
@media (hover: hover) and (pointer: fine) {
|
|
591
|
+
.pin:hover .pin-body { transform: scale(1.1); }
|
|
592
|
+
.tool:not(.tool-active):hover { background: rgba(255, 255, 255, 0.08); color: white; }
|
|
593
|
+
.icon-button:hover { background: var(--n-100); color: var(--n-950); }
|
|
594
|
+
.divider:hover::before { background: rgba(255, 255, 255, 0.35); }
|
|
595
|
+
.toggle:hover, .stop:hover { background: var(--n-100); }
|
|
596
|
+
.inbox-item:hover { background: var(--n-100); }
|
|
597
|
+
.project-picker-option:hover { background: rgba(255, 255, 255, 0.08); }
|
|
598
|
+
.composer-provider:hover, .target-option:hover { background: var(--n-100); color: var(--n-950); }
|
|
599
|
+
.md a:hover { opacity: 0.8; }
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
/* Reduced motion keeps fades (they aid comprehension) but drops movement. */
|
|
603
|
+
@media (prefers-reduced-motion: reduce) {
|
|
604
|
+
.popover, .inbox, .toast, .toolbar-hint, .message-user, .pin-body,
|
|
605
|
+
.tool, .icon-button, .toggle, .stop, .send, .segmented button, .inbox-item {
|
|
606
|
+
transition-property: opacity, background-color, color;
|
|
607
|
+
}
|
|
608
|
+
.w { animation: none; }
|
|
609
|
+
.shimmer > span[aria-hidden], .status-ping, .live-dot { animation: none; }
|
|
610
|
+
}
|
|
611
|
+
`;let i=document.querySelector(`script[nonce]`)?.nonce;i&&(r.nonce=i),n.append(r);let a=document.createElement(`div`);n.append(a),Qt(t),document.body.append(t);let o=new MutationObserver(()=>{t.isConnected||document.body.append(t)});o.observe(document.body,{childList:!0});let s=ru(t);fe(x($l,{}),a),jt(e),window.__TENCIL__={version:1,bridgeUrl:e,destroy(){o.disconnect(),s(),fe(null,a),t.remove(),window.__TENCIL__=void 0}}}if(typeof window<`u`&&!window.__TENCIL__){let e=au();document.body?ou(e):document.addEventListener(`DOMContentLoaded`,()=>ou(e),{once:!0})}})();
|