tencil 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +69 -103
- package/dist/cloud-CIAGUsk2.d.mts +14 -0
- package/dist/cloud-CiwIrP1h.mjs +104 -0
- package/dist/index-B0phpEz9.d.mts +454 -0
- package/dist/index.d.mts +3 -340
- package/dist/index.mjs +1 -1
- package/dist/next-loader.cjs +163 -0
- package/dist/next.d.mts +14 -0
- package/dist/next.mjs +45 -0
- package/dist/overlay.global.js +53 -26
- package/dist/react.d.mts +10 -3
- package/dist/react.mjs +20 -5
- package/dist/{server-9m0nvaLs.mjs → server-COf9gtqR.mjs} +117 -8
- package/dist/vite.d.mts +23 -4
- package/dist/vite.mjs +178 -4
- package/package.json +13 -6
package/dist/overlay.global.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
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 T(e,t){if(t==null)return e.__?T(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:T(e)}function E(e){if((e=e.__)&&e.__c&&!e.props.__P)return e.__e=null,e.__k.some(function(t){return t&&(e.__e=t.__e)}),E(e)}function D(e){(8&e.__g||!(e.__g|=8)||!a.push(e)||s++)&&o==n.debounceRendering||((o=n.debounceRendering)||queueMicrotask)(te)}function te(){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||T(o),32&o.__u,d),i.__v=o.__v,i.__.__k[i.__i]=i,le(u,i,d),o.__=o.__e=null,i.__e!=l&&E(i)))}finally{a.length=s=0}}function ne(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=O(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&&A(f.ref,null,p),u.push(p.ref,p.__c||m,p)),_||=m,4&p.__u?(c=re(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 O(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=ie(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=T(s)),de(s,s));return r}function re(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=re(i[a],t,n,!1));return t}for(t&&!t.parentNode&&(t=T(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 ie(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 ae(e,t,n){n??=``,t[0]==`-`?e.setProperty(t,n):e[t]=n}function oe(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||ae(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||ae(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,E,D,te,O,re,ie,ae,oe,se,k,le,A=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 A==`function`){h=s.length;try{if(E=t.props,D=(d=A.prototype)&&d.render,te=(d=A.contextType)&&i[d.__c],O=d?te?te.props.value:d.__:i,r.__c?2&(_=t.__c=r.__c).__g&&(_.__g|=1):(D?t.__c=_=new A(E,O):(t.__c=_=new w(E,O),_.constructor=A,_.render=fe),te&&te.sub(_),_.state||(_.state={}),_.__n=i,_.__g|=8,_.__h=[],_.__k=[]),D&&(_.__s||(_.__s=_.state),A.getDerivedStateFromProps&&(_.__s==_.state&&(_.__s=b({},_.__s)),b(_.__s,A.getDerivedStateFromProps(E,_.__s)))),y=_.props,x=_.state,_.__v=t,r.__c){if(D&&!A.getDerivedStateFromProps&&E!==y&&_.componentWillReceiveProps&&_.componentWillReceiveProps(E,O),t.__v==r.__v&&!(8&_.__g)||!(4&_.__g)&&_.shouldComponentUpdate&&!1===_.shouldComponentUpdate(E,_.__s,O)){t.__v!=r.__v&&(_.props=E,_.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=T(r);break n}_.componentWillUpdate&&_.componentWillUpdate(E,_.__s,O),D&&_.componentDidUpdate&&_.__h.push(function(){_.componentDidUpdate(y,x,S)})}else D&&!A.getDerivedStateFromProps&&_.componentWillMount&&_.componentWillMount(),D&&_.componentDidMount&&_.__h.push(_.componentDidMount);if(_.context=O,_.props=E,_.__P=e,_.__g&=-5,re=n.__r,ie=0,D)_.state=_.__s,_.__g&=-9,re&&re(t),d=_.render(_.props,_.state,_.context),g.push.apply(_.__h,_.__k),_.__k=[];else do _.__g&=-9,re&&re(t),d=_.render(_.props,_.state,_.context),_.state=_.__s;while(8&_.__g&&++ie<25);_.state=_.__s,_.getChildContext&&(i=b({},i,_.getChildContext())),D&&r.__c&&_.getSnapshotBeforeUpdate&&(S=_.getSnapshotBeforeUpdate(y,x)),ae=d&&d.type===C&&d.key==null?d.props.children:d,E.__P&&(d=c,a=(e=E.__P).namespaceURI,l=o=null,r.props&&r.props.__P!=e&&(r.__k.some(function(e){e&&de(e,e)}),r.__k=null),c=r.__k?T(r,0):null),c=ne(e,v(ae)?ae:[ae],t,r,i,a,o,s,c,l,u),E.__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(oe=0,t.__u|=l?160:128,o){for(k=0;k<o.length;k++)if(le=o[k]){if(le.nodeType==8){if(o[k]=null,le.data.startsWith(`$s`))oe++||(se=le);else if(le.data.startsWith(`/$s`)&&!--oe){c=le;break}}else oe&&(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=ue(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 le(e,t,r){for(var i=0;i<r.length;)A(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 ue(e,t,r,i,a,o,s,c,l,u){var d,f,p,m,g,b,x,S,C,w=r.props||h,E=t.props,D=t.type;if(D==`svg`?a=`http://www.w3.org/2000/svg`:D==`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])&&(D?g.localName==D:g.nodeType==3)){e=g,o[d]=null;break}}if(!e){if(S=u.ownerDocument||document,!D)return S.createTextNode(E);e=S.createElementNS(a,D,E.is&&E),c&&=(n.__m&&n.__m(t,o),!1),o=null}if(D){if(u=D==`template`?e.content:e,o=D==`textarea`&&E.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 E||d==`value`&&`defaultValue`in E||d==`checked`&&`defaultChecked`in E||oe(e,d,null,g,a);for(d in C=1&r.__u,E)g=E[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)||oe(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=``),(D==`foreignObject`||a==`http://www.w3.org/1998/Math/MathML`&&_.test(D))&&(a=`http://www.w3.org/1999/xhtml`),ne(u,v(m)?m:[m],t,r,i,a,o,s,o?o[0]:r.__k&&T(r,0),c,l),o&&o.some(ee)),c&&D!=`textarea`||(d=`value`,D==`progress`&&b==null?e.removeAttribute(d):b==null||b===e[d]&&(D!=`progress`||b)||oe(e,d,b,w[d],a),d=`checked`,x!=null&&x!=e[d]&&oe(e,d,x,w[d],a))}else w===E||c&&e.data==E||(e.data=E);return e}function A(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 de(e,t,r){var i,a;if(n.unmount&&n.unmount(e),!(i=e.ref)||i.current&&i.current!=e.__e||A(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]&&de(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 fe(e,t,n){return this.constructor(e,n)}function pe(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),le(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),D(this)))},w.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),D(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 me,j,he,ge,_e=Object.is,ve=0,ye=[],be=[],M=n,xe=M.__b,Se=M.__r,Ce=M.diffed,we=M.__c,Te=M.unmount,Ee=M.__;function De(e,t){M.__h&&M.__h(j,e,ve||t),ve=0;var n=j.__H||(j.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function N(e){return ve=1,Oe(Be,e)}function Oe(e,t,n){var r=De(me++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Be(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);_e(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=j,!j.__f)){j.__f=!0;var i=j.shouldComponentUpdate;j.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,_e(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 ke(e,t){var n=De(me++,3);!M.__s&&ze(n.__H,t)&&(n.__P=!0,n.__=e,n.u=t,j.__H.__h.push(n))}function Ae(e,t){var n=De(me++,4);!M.__s&&ze(n.__H,t)&&(n.__P=!1,n.__=e,n.u=t,j.__h.push(n))}function je(e){return ve=5,Me(function(){return{current:e}},[])}function Me(e,t){var n=De(me++,7);return ze(n.__H,t)&&(n.__=e(),n.__H=t),n.__}function Ne(){var e;do{for(;e=be.shift();)try{Le(e)}catch(t){M.__e(t,{__:(e=e.__P)&&e.__v})}for(;e=ye.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Le),t.__h.some(Re),t.__h=[]}catch(n){t.__h=[],M.__e(n,e.__v)}}}while(be.length)}M.__b=function(e){j=null,xe&&xe(e)},M.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ee&&Ee(e,t)},M.__r=function(e){Se&&Se(e),me=0;var t=(j=e.__c).__H;t&&(he==j?j.__h=[]:(t.__h.some(Le),t.__h.some(Re),me=0),t.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})),he=j},M.diffed=function(e){Ce&&Ce(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&Ie(ye.push(t)),t.__H.__.some(function(e){e.u&&(e.__H=e.u)})),he=j=null},M.__c=function(e,t){t.some(function(e){try{e.__h.some(Le),e.__h=e.__h.filter(function(e){return!e.__||Re(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],M.__e(n,e.__v)}}),we&&we(e,t)},M.unmount=function(e){Te&&Te(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,Ie(be.push(r))}else Le(r)}catch(e){t=e}}),r.__H=void 0,t&&M.__e(t,r.__v))};var Pe=typeof requestAnimationFrame==`function`;function Fe(e){var t,n=function(){clearTimeout(r),Pe&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Pe&&(t=requestAnimationFrame(n))}function Ie(e){e!=1&&ge==M.requestAnimationFrame||((ge=M.requestAnimationFrame)||Fe)(Ne)}function Le(e){var t=j,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),j=t}function Re(e){var t=j;e.__c=e.__(),j=t}function ze(e,t){return!e||e.length!=t.length||t.some(function(t,n){return!_e(t,e[n])})}function Be(e,t){return typeof t==`function`?t(e):t}var Ve=Symbol.for(`preact-signals`);function He(){if(F>1)F--;else{var e,t=!1;for((function(){var e=Xe;for(Xe=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}})();Ke!==void 0;){var n=Ke;for(Ke=void 0,qe++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&$e(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(qe=0,F--,t)throw e}}function Ue(e){if(F>0)return e();Ye=++Je,F++;try{return e()}finally{He()}}var We,P=void 0;function Ge(e){var t=P,n=We;P=void 0,We=void 0;try{return e()}finally{P=t,We=n}}var Ke=void 0,F=0,qe=0,Je=0,Ye=0,Xe=void 0,Ze=0;function Qe(e){if(P!==void 0){var t=e.n;if(t===void 0||t.t!==P)return t={i:0,S:e,p:P.s,n:void 0,t:P,e:void 0,x:void 0,r:t},P.s!==void 0&&(P.s.n=t),P.s=t,e.n=t,32&P.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=P.s,t.n=void 0,P.s.n=t,P.s=t),t}}function I(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}I.prototype.brand=Ve,I.prototype.h=function(){return!0},I.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?Ge(function(){var e;(e=t.W)==null||e.call(t)}):n.e=e)},I.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&&Ge(function(){var e;(e=t.Z)==null||e.call(t)}))}},I.prototype.subscribe=function(e){var t=this;return st(function(){var n=t.value;Ge(function(){return e(n)})},{name:`sub`})},I.prototype.valueOf=function(){return this.value},I.prototype.toString=function(){return this.value+``},I.prototype.toJSON=function(){return this.value},I.prototype.peek=function(){var e=this;return Ge(function(){return e.value})},Object.defineProperty(I.prototype,"value",{get:function(){var e=Qe(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(qe>100)throw Error(`Cycle detected`);(function(e){F!==0&&qe===0&&e.l!==Ye&&(e.l=Ye,Xe={S:e,v:e.v,i:e.i,o:Xe})})(this),this.v=e,this.i++,Ze++,F++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{He()}}}});function L(e,t){return new I(e,t)}function $e(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 et(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 tt(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 nt(e,t){I.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Ze-1,this.f=4}nt.prototype=new I,nt.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Ze))return!0;if(this.g=Ze,this.f|=1,this.i>0&&!$e(this))return this.f&=-2,!0;var e=P;try{et(this),P=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 P=e,tt(this),this.f&=-2,!0},nt.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)}I.prototype.S.call(this,e)},nt.prototype.U=function(e){if(this.t!==void 0&&(I.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)}},nt.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(nt.prototype,"value",{get:function(){if(1&this.f)throw Error(`Cycle detected`);var e=Qe(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function R(e,t){return new nt(e,t)}function rt(e){var t=e.m;if(e.m=void 0,typeof t==`function`){F++;var n=P;P=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,it(e),t}finally{P=n,He()}}}function it(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,rt(e)}function at(e){if(P!==this)throw Error(`Out-of-order effect`);tt(this),P=e,this.f&=-2,8&this.f&&it(this),He()}function ot(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,We&&We.push(this)}ot.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()}},ot.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,rt(this),et(this),F++;var e=P;return P=this,at.bind(this,e)},ot.prototype.N=function(){2&this.f||(this.f|=2,this.u=Ke,Ke=this)},ot.prototype.d=function(){this.f|=8,1&this.f||it(this)},ot.prototype.dispose=function(){this.d()};function st(e,t){var n=new ot(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var ct,lt,ut=typeof window<`u`&&!!window.__PREACT_SIGNALS_DEVTOOLS__,dt=[];st(function(){ct=this.N})();function ft(e,t){n[e]=t.bind(null,n[e]||function(){})}function pt(e){if(lt){var t=lt;lt=void 0,t()}lt=e&&e.S()}function mt(e){var t=this,n=e.data,r=gt(n);r.name=`ReactiveDom`,r.value=n;var a=Me(function(){for(var e=t,n=t.__v;n=n.__;)if(n.__c){n.__c.__$f|=4;break}var a=R(function(){var e=r.value.value;return e===0?0:!0===e?``:e||``}),o=R(function(){return!Array.isArray(a.value)&&!i(a.value)}),s=st(function(){if(this.N=yt,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}mt.displayName=`ReactiveTextNode`,Object.defineProperties(I.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:mt},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}}),ft(`__b`,function(e,t){if(pt(),typeof t.type==`string`){var n,r=t.props;for(var i in r)if(i!==`children`){var a=r[i];a instanceof I&&(n||(t.__np=n={}),n[i]=a,r[i]=a.peek())}}e(t)}),ft(`__r`,function(e,t){if(e(t),t.type!==C){pt();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=function(e,t){var n;return st(function(){n=this},{name:t}),n.c=e,n}(function(e){return function(){var t;ut&&((t=this.y)==null||t.call(this)),e.__$f|=1,e.setState({})}}(r),typeof t.type==`function`?t.type.displayName||t.type.name:``))),pt(n)}}),ft(`__e`,function(e,t,n,r){pt(),e(t,n,r)}),ft(`diffed`,function(e,t){pt();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=ht(n,c,u,i),a[c]=l):l.o(u,i)}}e(t)});function ht(e,t,n,r){var i=t in e&&e.ownerSVGElement===void 0,a=L(n);return{o:function(e,t){a.value=e,r=t},d:st(function(){this.N=yt;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))})}}ft(`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)}),ft(`__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 gt(e,t){return Me(function(){return L(e,t)},[])}var _t=function(e){queueMicrotask(function(){queueMicrotask(e)})};function vt(){Ue(function(){for(var e;e=dt.shift();)ct.call(e)})}function yt(){dt.push(this)===1&&(n.requestAnimationFrame||_t)(vt)}function bt(){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 z=L(`connecting`),B=L(null),V=L(null),xt=L(null),St=L(null),H=L(/* @__PURE__ */ new Map),Ct=L(null),wt=L(null),Tt=L(null),Et=L(null),Dt=L(void 0),Ot=L(null),kt,At=500,jt=``;function Mt(e){jt=e,Ft()}function Nt(){try{return new URL(jt).host}catch{return jt}}function U(e){return kt?.readyState===WebSocket.OPEN?(kt.send(JSON.stringify(e)),!0):(Ot.value={message:`Not connected to the Tencil bridge`,at:Date.now()},!1)}function Pt(e){let t=new Map(H.value);t.set(e.id,e),H.value=t}function Ft(){let e=new URL(`/ws`,jt);e.protocol=e.protocol===`https:`?`wss:`:`ws:`,z.value=`connecting`;let t=new WebSocket(e);kt=t,t.addEventListener(`open`,()=>{At=500,t.send(JSON.stringify({type:`hello`,protocol:1,pageUrl:location.href}))}),t.addEventListener(`message`,e=>{try{It(JSON.parse(String(e.data)))}catch(e){console.warn(`[tencil] bad message`,e)}}),t.addEventListener(`close`,()=>{kt===t&&(z.value=`closed`,setTimeout(Ft,At),At=Math.min(At*2,1e4))})}function It(e){switch(e.type){case`ready`:Ue(()=>{z.value=`open`,Et.value=null,B.value=e.provider,V.value=e.settings,xt.value=e.project,St.value=e.version,H.value=new Map(e.threads.map(e=>[e.id,e]))});return;case`project.unknown`:Ue(()=>{z.value=`open`,Et.value=e.choices,Dt.value=e.emptyHint});return;case`provider.status`:B.value=e.provider;return;case`settings`:Ue(()=>{let t=V.value?.provider!==e.settings.provider;V.value=e.settings,t&&(Ct.value=null,wt.value=null,Tt.value=null)});return;case`thread.upsert`:Pt(e.thread);return;case`thread.removed`:{let t=new Map(H.value);t.delete(e.threadId),H.value=t;return}case`provider.models`:Tt.value={provider:e.provider,models:e.models,defaultModel:e.defaultModel};return;case`provider.threads`:Ue(()=>{Ct.value=e.threads,wt.value=e.project});return;case`error`:Ot.value={message:e.message,threadId:e.threadId,at:Date.now()};return}}function Lt(e){return V.value?.providers.find(t=>t.id===e)?.label??e}function Rt(){kt?.readyState===WebSocket.OPEN&&kt.send(JSON.stringify({type:`provider.threads`}))}function zt(){kt?.readyState===WebSocket.OPEN&&kt.send(JSON.stringify({type:`provider.models`}))}function Bt(e){for(let t of H.value.values())if(t.provider.threadId===e.id&&!t.anchor)return t.id;let t=bt();return U({type:`thread.open`,id:t,providerThreadId:e.id,title:e.title})?t:null}let W=L(`idle`),Vt=L(null),G=L(null),K=L(null),q=L(!1),Ht=L(!1),Ut=L(!1),Wt=L(!1),Gt=R(()=>V.value?.batch??!1),Kt=L(!1),qt=R(()=>Gt.value&&Kt.value);function Jt(e){let t=V.value;t&&U({type:`settings.update`,batch:e})&&(V.value={...t,batch:e})}let Yt=L(null),Xt=L(0),Zt=L(Qt(location.href));function Qt(e){try{let t=new URL(e);return`${t.origin}${t.pathname.replace(/\/$/,``)||`/`}`}catch{return e}}let $t=R(()=>[...H.value.values()].sort((e,t)=>t.createdAt.localeCompare(e.createdAt))),en=R(()=>$t.value.filter(e=>e.anchor&&e.pageUrl&&Qt(e.pageUrl)===Zt.value).filter(e=>Ut.value||!e.resolved).reverse()),tn=R(()=>$t.value.filter(e=>!e.resolved).length),nn=R(()=>[...$t.value].reverse().filter(e=>e.status===`draft`)),rn=R(()=>$t.value.filter(e=>e.status===`working`||e.status===`starting`).length);function an(){G.value=null,K.value=null,W.value=`picking`}function on(){W.value=`idle`,Vt.value=null}let sn;function cn(e){sn=e}function ln(){if(!sn)throw Error(`Tencil overlay is not mounted`);return sn}let un=/* @__PURE__ */ new Map;function dn(e,t){let n=t??pn(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 fn(e,t){let n=e.getBoundingClientRect(),r=(e,t)=>t>0?hn(e/t,0,1):.5;return{offsetX:r(t.x-n.left,n.width),offsetY:r(t.y-n.top,n.height)}}function pn(e){if(!e)return null;let t=un.get(e)?.deref();if(t?.isConnected&&t.matches(e))return t;try{let t=document.querySelector(e);return t&&un.set(e,new WeakRef(t)),t}catch{return null}}function mn(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=hn(a,12,r-t.width-12);let o=hn(e.y-24,12,i-t.height-12),s=`${hn(e.x-a,0,t.width)}px ${hn(e.y-o,0,t.height)}px`;return{left:a,top:o,origin:s}}function hn(e,t,n){return Math.max(t,Math.min(n,e))}function gn(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}let _n;function vn(){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 yn(e){let t=-1;_n||=vn();for(let n=0;n<e.length;n++)t=_n[(t^e[n])&255]^t>>>8;return t^-1}function bn(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 xn(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=yn(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=bn(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 Sn(e){let t=e.indexOf(`AAlwSFlz`);return t===-1&&(t=e.indexOf(`AAAJcEhZ`)),t===-1&&(t=e.indexOf(`AAAACXBI`)),t}let Cn=`[modern-screenshot]`,wn=typeof window<`u`,Tn=wn&&`Worker`in window,En=wn&&`atob`in window,Dn=wn&&`btoa`in window,On=wn?window.navigator?.userAgent:``,kn=On.includes(`Chrome`),An=On.includes(`AppleWebKit`)&&!kn,jn=On.includes(`Firefox`),Mn=e=>e&&`__CONTEXT__`in e,Nn=e=>e.constructor.name===`CSSFontFaceRule`,Pn=e=>e.constructor.name===`CSSImportRule`,Fn=e=>e.constructor.name===`CSSLayerBlockRule`,J=e=>e.nodeType===1,In=e=>typeof e.className==`object`,Ln=e=>e.tagName===`image`,Rn=e=>e.tagName===`use`,zn=e=>J(e)&&e.style!==void 0&&!In(e),Bn=e=>e.nodeType===8,Vn=e=>e.nodeType===3,Hn=e=>e.tagName===`IMG`,Un=e=>e.tagName===`VIDEO`,Wn=e=>e.tagName===`CANVAS`,Gn=e=>e.tagName===`TEXTAREA`,Kn=e=>e.tagName===`INPUT`,qn=e=>e.tagName===`STYLE`,Jn=e=>e.tagName===`SCRIPT`,Yn=e=>e.tagName===`SELECT`,Xn=e=>e.tagName===`SLOT`,Zn=e=>e.tagName===`IFRAME`,Qn=(...e)=>console.warn(Cn,...e);function $n(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 er=e=>e.startsWith(`data:`);function tr(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(wn&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!wn)return e;let n=nr().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 nr(e){return(e&&J(e)?e?.ownerDocument:e)??window.document}let rr=`http://www.w3.org/2000/svg`;function ir(e,t,n){let r=nr(n).createElementNS(rr,`svg`);return r.setAttributeNS(null,`width`,e.toString()),r.setAttributeNS(null,`height`,t.toString()),r.setAttributeNS(null,`viewBox`,`0 0 ${e} ${t}`),r}function ar(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 or(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 sr=e=>or(e,`dataUrl`);function cr(e,t){let n=nr(t).createElement(`img`);return n.decoding=`sync`,n.loading=`eager`,n.src=e,n}function lr(e,t){return new Promise(n=>{let{timeout:r,ownerDocument:i,onError:a,onWarn:o}=t??{},s=typeof e==`string`?cr(e,nr(i)):e,c=null,l=null;function u(){n(s),c&&clearTimeout(c),l?.()}if(r&&(c=setTimeout(u,r)),Un(s)){let e=s.currentSrc||s.src;if(!e)return s.poster?lr(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=Ln(s)?s.href.baseVal:s.currentSrc||s.src;if(!e)return u();let t=async()=>{if(Hn(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(Hn(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 ur(e,t){zn(e)&&(Hn(e)||Un(e)?await lr(e,t):await Promise.all([`img`,`video`].flatMap(n=>Array.from(e.querySelectorAll(n)).map(e=>lr(e,t)))))}let dr=/* @__PURE__ */ function(){let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)}();function fr(e){return e?.split(`,`).map(e=>e.trim().replace(/"|'/g,``).toLowerCase()).filter(Boolean)}let pr=0;function mr(e){let t=`${Cn}[#${pr}]`;return pr++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...t)=>e&&Qn(...t)}}function hr(e){return{cache:e?`no-cache`:`force-cache`}}async function gr(e,t){return Mn(e)?e:_r(e,{...t,autoDestruct:!0})}async function _r(e,t){let{scale:n=1,workerUrl:r,workerNumber:i=1}=t||{},a=!!t?.debug,o=t?.features??!0,s=e.ownerDocument??(wn?window.document:void 0),c=e.ownerDocument?.defaultView??(wn?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:hr(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:mr(a),node:e,ownerDocument:s,ownerWindow:c,dpi:n===1?null:96*n,svgStyleElement:vr(s),svgDefsElement:s?.createElementNS(rr,`defs`),svgStyles:/* @__PURE__ */ new Map,defaultComputedStyles:/* @__PURE__ */ new Map,workers:[...Array.from({length:Tn&&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:`${[$n(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 ur(e,{timeout:u.timeout,onWarn:u.log.warn}),u.log.timeEnd(`wait until load`);let{width:d,height:f}=yr(e,u);return u.width=d,u.height=f,u}function vr(e){if(!e)return;let t=e.createElement(`style`),n=t.ownerDocument.createTextNode(`
|
|
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 te(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),x(e,o,r,i,null)}function x(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 S(e){return e.children}function C(e,t){this.props=e,this.context=t,this.__g=0}function ne(e,t){if(t==null)return e.__?ne(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:ne(e)}function w(e){if((e=e.__)&&e.__c&&!e.props.__P)return e.__e=null,e.__k.some(function(t){return t&&(e.__e=t.__e)}),w(e)}function T(e){(8&e.__g||!(e.__g|=8)||!a.push(e)||s++)&&o==n.debounceRendering||((o=n.debounceRendering)||queueMicrotask)(re)}function re(){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),E(f,i,o,r.__n,f.namespaceURI,32&o.__u?[l]:null,u,l||ne(o),32&o.__u,d),i.__v=o.__v,i.__.__k[i.__i]=i,fe(u,i,d),o.__=o.__e=null,i.__e!=l&&w(i)))}finally{a.length=s=0}}function ie(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=ae(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=E(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&&D(f.ref,null,p),u.push(p.ref,p.__c||m,p)),_||=m,4&p.__u?(c=oe(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 ae(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]=x(null,o):v(o)?o=b[a]=x(S,{children:o}):o.constructor===void 0&&o.__b?o=b[a]=x(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=se(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=ne(s)),me(s,s));return r}function oe(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=oe(i[a],t,n,!1));return t}for(t&&!t.parentNode&&(t=ne(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 se(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 ce(e,t,n){n??=``,t[0]==`-`?e.setProperty(t,n):e[t]=n}function le(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||ce(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||ce(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 ue(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 E(e,t,r,i,a,o,s,c,l,u){var d,f,p,m,h,_,y,te,x,w,T,re,ae,oe,se,ce,le,ue,E,fe,D=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 D==`function`){h=s.length;try{if(w=t.props,T=(d=D.prototype)&&d.render,re=(d=D.contextType)&&i[d.__c],ae=d?re?re.props.value:d.__:i,r.__c?2&(_=t.__c=r.__c).__g&&(_.__g|=1):(T?t.__c=_=new D(w,ae):(t.__c=_=new C(w,ae),_.constructor=D,_.render=he),re&&re.sub(_),_.state||(_.state={}),_.__n=i,_.__g|=8,_.__h=[],_.__k=[]),T&&(_.__s||(_.__s=_.state),D.getDerivedStateFromProps&&(_.__s==_.state&&(_.__s=b({},_.__s)),b(_.__s,D.getDerivedStateFromProps(w,_.__s)))),y=_.props,te=_.state,_.__v=t,r.__c){if(T&&!D.getDerivedStateFromProps&&w!==y&&_.componentWillReceiveProps&&_.componentWillReceiveProps(w,ae),t.__v==r.__v&&!(8&_.__g)||!(4&_.__g)&&_.shouldComponentUpdate&&!1===_.shouldComponentUpdate(w,_.__s,ae)){t.__v!=r.__v&&(_.props=w,_.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=ne(r);break n}_.componentWillUpdate&&_.componentWillUpdate(w,_.__s,ae),T&&_.componentDidUpdate&&_.__h.push(function(){_.componentDidUpdate(y,te,x)})}else T&&!D.getDerivedStateFromProps&&_.componentWillMount&&_.componentWillMount(),T&&_.componentDidMount&&_.__h.push(_.componentDidMount);if(_.context=ae,_.props=w,_.__P=e,_.__g&=-5,oe=n.__r,se=0,T)_.state=_.__s,_.__g&=-9,oe&&oe(t),d=_.render(_.props,_.state,_.context),g.push.apply(_.__h,_.__k),_.__k=[];else do _.__g&=-9,oe&&oe(t),d=_.render(_.props,_.state,_.context),_.state=_.__s;while(8&_.__g&&++se<25);_.state=_.__s,_.getChildContext&&(i=b({},i,_.getChildContext())),T&&r.__c&&_.getSnapshotBeforeUpdate&&(x=_.getSnapshotBeforeUpdate(y,te)),ce=d&&d.type===S&&d.key==null?d.props.children:d,w.__P&&(d=c,a=(e=w.__P).namespaceURI,l=o=null,r.props&&r.props.__P!=e&&(r.__k.some(function(e){e&&me(e,e)}),r.__k=null),c=r.__k?ne(r,0):null),c=ie(e,v(ce)?ce:[ce],t,r,i,a,o,s,c,l,u),w.__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(le=0,t.__u|=l?160:128,o){for(E=0;E<o.length;E++)if(fe=o[E]){if(fe.nodeType==8){if(o[E]=null,fe.data.startsWith(`$s`))le++||(ue=fe);else if(fe.data.startsWith(`/$s`)&&!--le){c=fe;break}}else le&&(o[E]=null)}}if(!ue){for(;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o&&(o[o.indexOf(c)]=null),ue=c}t.__c.__z||(t.__c.__z=ue),t.__e=c}else o&&o.some(ee)}else t.__e=r.__e;t.__k||=r.__k||[],e.then||de(t),n.__e(e,t,r)}}else c=t.__e=pe(r.__e,t,r,i,a,o,s,l,u,e);return(d=n.diffed)&&d(t),128&t.__u?void 0:c}function de(e){e&&(e.__c&&(e.__c.__g|=4),e.__k&&e.__k.some(de))}function fe(e,t,r){for(var i=0;i<r.length;)D(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 pe(e,t,r,i,a,o,s,c,l,u){var d,f,p,m,g,b,te,x,S,C=r.props||h,w=t.props,T=t.type;if(T==`svg`?a=`http://www.w3.org/2000/svg`:T==`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])&&(T?g.localName==T:g.nodeType==3)){e=g,o[d]=null;break}}if(!e){if(x=u.ownerDocument||document,!T)return x.createTextNode(w);e=x.createElementNS(a,T,w.is&&w),c&&=(n.__m&&n.__m(t,o),!1),o=null}if(T){if(u=T==`template`?e.content:e,o=T==`textarea`&&w.defaultValue!=null?null:o&&y.call(u.childNodes),!c&&o)for(C={},d=0;d<e.attributes.length;d++)C[(g=e.attributes[d]).name]=g.value;for(d in C)g=C[d],d==`dangerouslySetInnerHTML`?p=g:d==`children`||d in w||d==`value`&&`defaultValue`in w||d==`checked`&&`defaultChecked`in w||le(e,d,null,g,a);for(d in S=1&r.__u,w)g=w[d],d==`children`?m=g:d==`dangerouslySetInnerHTML`?f=g:d==`value`?b=g:d==`checked`?te=g:c&&typeof g!=`function`||!(C[d]!==g||S&&g!=null)||le(e,d,g,C[d],a);f?(c||p&&(f.__html==p.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[]):(p&&(e.textContent=``),(T==`foreignObject`||a==`http://www.w3.org/1998/Math/MathML`&&_.test(T))&&(a=`http://www.w3.org/1999/xhtml`),ie(u,v(m)?m:[m],t,r,i,a,o,s,o?o[0]:r.__k&&ne(r,0),c,l),o&&o.some(ee)),c&&T!=`textarea`||(d=`value`,T==`progress`&&b==null?e.removeAttribute(d):b==null||b===e[d]&&(T!=`progress`||b)||le(e,d,b,C[d],a),d=`checked`,te!=null&&te!=e[d]&&le(e,d,te,C[d],a))}else C===w||c&&e.data==w||(e.data=w);return e}function D(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 me(e,t,r){var i,a;if(n.unmount&&n.unmount(e),!(i=e.ref)||i.current&&i.current!=e.__e||D(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]&&me(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 he(e,t,n){return this.constructor(e,n)}function ge(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=x(S,{children:[e]}),a=[],o=[],E(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),fe(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},C.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),T(this)))},C.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),T(this))},C.prototype.render=S,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=ue(!1),m=ue(!0);var _e,O,ve,ye,be=Object.is,xe=0,Se=[],Ce=[],k=n,we=k.__b,Te=k.__r,Ee=k.diffed,De=k.__c,Oe=k.unmount,ke=k.__;function Ae(e,t){k.__h&&k.__h(O,e,xe||t),xe=0;var n=O.__H||(O.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function A(e){return xe=1,je(He,e)}function je(e,t,n){var r=Ae(_e++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):He(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);be(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=O,!O.__f)){O.__f=!0;var i=O.shouldComponentUpdate;O.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,be(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 Me(e,t){var n=Ae(_e++,3);!k.__s&&Ve(n.__H,t)&&(n.__P=!0,n.__=e,n.u=t,O.__H.__h.push(n))}function Ne(e,t){var n=Ae(_e++,4);!k.__s&&Ve(n.__H,t)&&(n.__P=!1,n.__=e,n.u=t,O.__h.push(n))}function j(e){return xe=5,Pe(function(){return{current:e}},[])}function Pe(e,t){var n=Ae(_e++,7);return Ve(n.__H,t)&&(n.__=e(),n.__H=t),n.__}function Fe(){var e;do{for(;e=Ce.shift();)try{ze(e)}catch(t){k.__e(t,{__:(e=e.__P)&&e.__v})}for(;e=Se.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(ze),t.__h.some(Be),t.__h=[]}catch(n){t.__h=[],k.__e(n,e.__v)}}}while(Ce.length)}k.__b=function(e){O=null,we&&we(e)},k.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ke&&ke(e,t)},k.__r=function(e){Te&&Te(e),_e=0;var t=(O=e.__c).__H;t&&(ve==O?O.__h=[]:(t.__h.some(ze),t.__h.some(Be),_e=0),t.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})),ve=O},k.diffed=function(e){Ee&&Ee(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&Re(Se.push(t)),t.__H.__.some(function(e){e.u&&(e.__H=e.u)})),ve=O=null},k.__c=function(e,t){t.some(function(e){try{e.__h.some(ze),e.__h=e.__h.filter(function(e){return!e.__||Be(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],k.__e(n,e.__v)}}),De&&De(e,t)},k.unmount=function(e){Oe&&Oe(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,Re(Ce.push(r))}else ze(r)}catch(e){t=e}}),r.__H=void 0,t&&k.__e(t,r.__v))};var Ie=typeof requestAnimationFrame==`function`;function Le(e){var t,n=function(){clearTimeout(r),Ie&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Ie&&(t=requestAnimationFrame(n))}function Re(e){e!=1&&ye==k.requestAnimationFrame||((ye=k.requestAnimationFrame)||Le)(Fe)}function ze(e){var t=O,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),O=t}function Be(e){var t=O;e.__c=e.__(),O=t}function Ve(e,t){return!e||e.length!=t.length||t.some(function(t,n){return!be(t,e[n])})}function He(e,t){return typeof t==`function`?t(e):t}var Ue=Symbol.for(`preact-signals`);function We(){if(N>1)N--;else{var e,t=!1;for((function(){var e=Qe;for(Qe=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}})();Je!==void 0;){var n=Je;for(Je=void 0,Ye++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&tt(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(Ye=0,N--,t)throw e}}function Ge(e){if(N>0)return e();Ze=++Xe,N++;try{return e()}finally{We()}}var Ke,M=void 0;function qe(e){var t=M,n=Ke;M=void 0,Ke=void 0;try{return e()}finally{M=t,Ke=n}}var Je=void 0,N=0,Ye=0,Xe=0,Ze=0,Qe=void 0,$e=0;function et(e){if(M!==void 0){var t=e.n;if(t===void 0||t.t!==M)return t={i:0,S:e,p:M.s,n:void 0,t:M,e:void 0,x:void 0,r:t},M.s!==void 0&&(M.s.n=t),M.s=t,e.n=t,32&M.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=M.s,t.n=void 0,M.s.n=t,M.s=t),t}}function P(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}P.prototype.brand=Ue,P.prototype.h=function(){return!0},P.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?qe(function(){var e;(e=t.W)==null||e.call(t)}):n.e=e)},P.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&&qe(function(){var e;(e=t.Z)==null||e.call(t)}))}},P.prototype.subscribe=function(e){var t=this;return lt(function(){var n=t.value;qe(function(){return e(n)})},{name:`sub`})},P.prototype.valueOf=function(){return this.value},P.prototype.toString=function(){return this.value+``},P.prototype.toJSON=function(){return this.value},P.prototype.peek=function(){var e=this;return qe(function(){return e.value})},Object.defineProperty(P.prototype,"value",{get:function(){var e=et(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Ye>100)throw Error(`Cycle detected`);(function(e){N!==0&&Ye===0&&e.l!==Ze&&(e.l=Ze,Qe={S:e,v:e.v,i:e.i,o:Qe})})(this),this.v=e,this.i++,$e++,N++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{We()}}}});function F(e,t){return new P(e,t)}function tt(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 nt(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 rt(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 it(e,t){P.call(this,void 0,t),this.x=e,this.s=void 0,this.g=$e-1,this.f=4}it.prototype=new P,it.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===$e))return!0;if(this.g=$e,this.f|=1,this.i>0&&!tt(this))return this.f&=-2,!0;var e=M;try{nt(this),M=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 M=e,rt(this),this.f&=-2,!0},it.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)}P.prototype.S.call(this,e)},it.prototype.U=function(e){if(this.t!==void 0&&(P.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)}},it.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(it.prototype,"value",{get:function(){if(1&this.f)throw Error(`Cycle detected`);var e=et(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function I(e,t){return new it(e,t)}function at(e){var t=e.m;if(e.m=void 0,typeof t==`function`){N++;var n=M;M=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,ot(e),t}finally{M=n,We()}}}function ot(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,at(e)}function st(e){if(M!==this)throw Error(`Out-of-order effect`);rt(this),M=e,this.f&=-2,8&this.f&&ot(this),We()}function ct(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Ke&&Ke.push(this)}ct.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()}},ct.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,at(this),nt(this),N++;var e=M;return M=this,st.bind(this,e)},ct.prototype.N=function(){2&this.f||(this.f|=2,this.u=Je,Je=this)},ct.prototype.d=function(){this.f|=8,1&this.f||ot(this)},ct.prototype.dispose=function(){this.d()};function lt(e,t){var n=new ct(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var ut,dt,ft=typeof window<`u`&&!!window.__PREACT_SIGNALS_DEVTOOLS__,pt=[];lt(function(){ut=this.N})();function mt(e,t){n[e]=t.bind(null,n[e]||function(){})}function ht(e){if(dt){var t=dt;dt=void 0,t()}dt=e&&e.S()}function gt(e){var t=this,n=e.data,r=vt(n);r.name=`ReactiveDom`,r.value=n;var a=Pe(function(){for(var e=t,n=t.__v;n=n.__;)if(n.__c){n.__c.__$f|=4;break}var a=I(function(){var e=r.value.value;return e===0?0:!0===e?``:e||``}),o=I(function(){return!Array.isArray(a.value)&&!i(a.value)}),s=lt(function(){if(this.N=xt,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}gt.displayName=`ReactiveTextNode`,Object.defineProperties(P.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:gt},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}}),mt(`__b`,function(e,t){if(ht(),typeof t.type==`string`){var n,r=t.props;for(var i in r)if(i!==`children`){var a=r[i];a instanceof P&&(n||(t.__np=n={}),n[i]=a,r[i]=a.peek())}}e(t)}),mt(`__r`,function(e,t){if(e(t),t.type!==S){ht();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=function(e,t){var n;return lt(function(){n=this},{name:t}),n.c=e,n}(function(e){return function(){var t;ft&&((t=this.y)==null||t.call(this)),e.__$f|=1,e.setState({})}}(r),typeof t.type==`function`?t.type.displayName||t.type.name:``))),ht(n)}}),mt(`__e`,function(e,t,n,r){ht(),e(t,n,r)}),mt(`diffed`,function(e,t){ht();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=_t(n,c,u,i),a[c]=l):l.o(u,i)}}e(t)});function _t(e,t,n,r){var i=t in e&&e.ownerSVGElement===void 0,a=F(n);return{o:function(e,t){a.value=e,r=t},d:lt(function(){this.N=xt;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))})}}mt(`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)}),mt(`__h`,function(e,t,n,r){r<3&&(t.__$f|=2),e(t,n,r)}),C.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 vt(e,t){return Pe(function(){return F(e,t)},[])}var yt=function(e){queueMicrotask(function(){queueMicrotask(e)})};function bt(){Ge(function(){for(var e;e=pt.shift();)ut.call(e)})}function xt(){pt.push(this)===1&&(n.requestAnimationFrame||yt)(bt)}let St=F(null),L=F(null),Ct=F(!1),wt=I(()=>St.value?`Sign in to Tencil Cloud to pin`:L.value?.access===`read`?`View only: you need write access to the repository to pin`:null),Tt=6e4;function Et(e){return`tencil-cloud-token:${new URL(e).host}`}function Dt(e,t=Date.now()){try{let n=localStorage.getItem(Et(e));if(!n)return;let r=JSON.parse(n);if(typeof r.token==`string`&&r.expiresAt-Tt>t)return r.token;localStorage.removeItem(Et(e))}catch{}return Ot?.bridgeUrl===e&&Ot.expiresAt-Tt>t?Ot.token:void 0}let Ot;function kt(e,t){Ot={...t,bridgeUrl:e};try{localStorage.setItem(Et(e),JSON.stringify(t))}catch{}}function At(e){Ot=void 0;try{localStorage.removeItem(Et(e))}catch{}}async function jt(e,t){let n=window.open(`about:blank`,`tencil-sign-in`,`popup,width=520,height=680`);if(!n)throw Error(`The sign-in window was blocked. Allow popups for this page.`);let r=Pt(64),i=`${Pt(32)}.${Ft(new TextEncoder().encode(location.origin))}`,a=new URL(t.authorizeUrl);a.search=new URLSearchParams({response_type:`code`,client_id:t.clientId,redirect_uri:t.redirectUri,code_challenge:await Nt(r),code_challenge_method:`S256`,state:i,...t.scope?{scope:t.scope}:{}}).toString(),n.location.href=a.toString(),Ct.value=!0;try{let a=await Mt(n,new URL(t.redirectUri).origin,i),o=await fetch(t.tokenUrl,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams({grant_type:`authorization_code`,client_id:t.clientId,redirect_uri:t.redirectUri,code_verifier:r,code:a})});if(!o.ok)throw Error(`Tencil Cloud refused the sign-in (${o.status})`);let s=await o.json();if(!s.access_token)throw Error(`Tencil Cloud sent no token`);kt(e,{token:s.access_token,expiresAt:Date.now()+(s.expires_in??3600)*1e3})}finally{Ct.value=!1}}function Mt(e,t,n){return new Promise((r,i)=>{let a=setInterval(()=>{e.closed&&(s(),i(/* @__PURE__ */ Error(`Sign-in was cancelled`)))},500),o=a=>{if(a.origin!==t||a.source!==e)return;let o=a.data;o?.type===`tencil:oauth`&&o.state===n&&(s(),e.close(),o.code?r(o.code):i(Error(o.error??`Sign-in failed`)))},s=()=>{clearInterval(a),window.removeEventListener(`message`,o)};window.addEventListener(`message`,o)})}async function Nt(e){let t=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e));return Ft(new Uint8Array(t))}function Pt(e){return Ft(crypto.getRandomValues(new Uint8Array(e)))}function Ft(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function It(){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 R=F(`connecting`),z=F(null),B=F(null),Lt=F(null),Rt=F(null),V=F(/* @__PURE__ */ new Map),zt=F(null),Bt=F(null),Vt=F(null),Ht=F(null),Ut=F(void 0),Wt=F(null),H,Gt=500,Kt=``,qt;function Jt(e,t){Kt=e,qt=t,tn()}function Yt(){return qt!==void 0}function Xt(){return Kt}function Zt(){let e=H;H=void 0,e?.close(),Gt=500,tn()}let Qt;function $t(){try{return new URL(Kt).host}catch{return Kt}}function U(e){return H?.readyState===WebSocket.OPEN?(H.send(JSON.stringify(e)),!0):(Wt.value={message:`Not connected to the Tencil bridge`,at:Date.now()},!1)}function en(e){let t=new Map(V.value);t.set(e.id,e),V.value=t}function tn(){let e=new URL(`/ws`,Kt);e.protocol=e.protocol===`https:`?`wss:`:`ws:`,R.value=`connecting`;let t=new WebSocket(e);H=t,Qt=qt?Dt(Kt):void 0,t.addEventListener(`open`,()=>{Gt=500,t.send(JSON.stringify({type:`hello`,protocol:1,pageUrl:location.href,...qt&&{build:qt},...Qt&&{token:Qt}}))}),t.addEventListener(`message`,e=>{try{nn(JSON.parse(String(e.data)))}catch(e){console.warn(`[tencil] bad message`,e)}}),t.addEventListener(`close`,()=>{H===t&&(R.value=`closed`,setTimeout(tn,Gt),Gt=Math.min(Gt*2,1e4))})}function nn(e){switch(e.type){case`ready`:Ge(()=>{R.value=`open`,St.value=null,L.value=e.viewer??null,Ht.value=null,z.value=e.provider,B.value=e.settings,Lt.value=e.project,Rt.value=e.version,V.value=new Map(e.threads.map(e=>[e.id,e]))});return;case`project.unknown`:Ge(()=>{R.value=`open`,Ht.value=e.choices,Ut.value=e.emptyHint});return;case`auth.required`:Qt&&At(Kt),Ge(()=>{R.value=`open`,L.value=null,St.value={signIn:e.signIn,reason:e.reason}});return;case`provider.status`:z.value=e.provider;return;case`settings`:Ge(()=>{let t=B.value?.provider!==e.settings.provider;B.value=e.settings,t&&(zt.value=null,Bt.value=null,Vt.value=null)});return;case`thread.upsert`:en(e.thread);return;case`thread.removed`:{let t=new Map(V.value);t.delete(e.threadId),V.value=t;return}case`provider.models`:Vt.value={provider:e.provider,models:e.models,defaultModel:e.defaultModel};return;case`provider.threads`:Ge(()=>{zt.value=e.threads,Bt.value=e.project});return;case`error`:Wt.value={message:e.message,threadId:e.threadId,at:Date.now()};return}}function rn(e){return B.value?.providers.find(t=>t.id===e)?.label??e}function an(){H?.readyState===WebSocket.OPEN&&H.send(JSON.stringify({type:`provider.threads`}))}function on(){H?.readyState===WebSocket.OPEN&&H.send(JSON.stringify({type:`provider.models`}))}function sn(e){for(let t of V.value.values())if(t.provider.threadId===e.id&&!t.anchor)return t.id;let t=It();return U({type:`thread.open`,id:t,providerThreadId:e.id,title:e.title})?t:null}let W=F(`idle`),cn=F(null),G=F(null),K=F(null),q=F(!1),ln=F(!1),un=F(!1),dn=F(!1),fn=I(()=>B.value?.batch??!1),pn=F(!1),mn=I(()=>fn.value&&pn.value);function hn(e){let t=B.value;t&&U({type:`settings.update`,batch:e})&&(B.value={...t,batch:e})}let gn=F(null),_n=F(0),vn=F(yn(location.href));function yn(e){try{let t=new URL(e);return`${t.origin}${t.pathname.replace(/\/$/,``)||`/`}`}catch{return e}}let bn=I(()=>[...V.value.values()].sort((e,t)=>t.createdAt.localeCompare(e.createdAt))),xn=I(()=>bn.value.filter(e=>e.anchor&&e.pageUrl&&yn(e.pageUrl)===vn.value).filter(e=>un.value||!e.resolved).reverse()),Sn=I(()=>bn.value.filter(e=>!e.resolved).length),Cn=I(()=>[...bn.value].reverse().filter(e=>e.status===`draft`)),wn=I(()=>bn.value.filter(e=>e.status===`working`||e.status===`starting`).length);function Tn(){wt.value||(G.value=null,K.value=null,W.value=`picking`)}function En(){W.value=`idle`,cn.value=null}let Dn;function On(e){Dn=e}function kn(){if(!Dn)throw Error(`Tencil overlay is not mounted`);return Dn}let An=/* @__PURE__ */ new Map;function jn(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 Mn(e,t){let n=e.getBoundingClientRect(),r=(e,t)=>t>0?Fn(e/t,0,1):.5;return{offsetX:r(t.x-n.left,n.width),offsetY:r(t.y-n.top,n.height)}}function Nn(e){if(!e)return null;let t=An.get(e)?.deref();if(t?.isConnected&&t.matches(e))return t;try{let t=document.querySelector(e);return t&&An.set(e,new WeakRef(t)),t}catch{return null}}function Pn(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=Fn(a,12,r-t.width-12);let o=Fn(e.y-24,12,i-t.height-12),s=`${Fn(e.x-a,0,t.width)}px ${Fn(e.y-o,0,t.height)}px`;return{left:a,top:o,origin:s}}function Fn(e,t,n){return Math.max(t,Math.min(n,e))}function In(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}let Ln;function Rn(){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 zn(e){let t=-1;Ln||=Rn();for(let n=0;n<e.length;n++)t=Ln[(t^e[n])&255]^t>>>8;return t^-1}function Bn(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 Vn(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=zn(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=Bn(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 Hn(e){let t=e.indexOf(`AAlwSFlz`);return t===-1&&(t=e.indexOf(`AAAJcEhZ`)),t===-1&&(t=e.indexOf(`AAAACXBI`)),t}let Un=`[modern-screenshot]`,Wn=typeof window<`u`,Gn=Wn&&`Worker`in window,Kn=Wn&&`atob`in window,qn=Wn&&`btoa`in window,Jn=Wn?window.navigator?.userAgent:``,Yn=Jn.includes(`Chrome`),Xn=Jn.includes(`AppleWebKit`)&&!Yn,Zn=Jn.includes(`Firefox`),Qn=e=>e&&`__CONTEXT__`in e,$n=e=>e.constructor.name===`CSSFontFaceRule`,er=e=>e.constructor.name===`CSSImportRule`,tr=e=>e.constructor.name===`CSSLayerBlockRule`,J=e=>e.nodeType===1,nr=e=>typeof e.className==`object`,rr=e=>e.tagName===`image`,ir=e=>e.tagName===`use`,ar=e=>J(e)&&e.style!==void 0&&!nr(e),or=e=>e.nodeType===8,sr=e=>e.nodeType===3,cr=e=>e.tagName===`IMG`,lr=e=>e.tagName===`VIDEO`,ur=e=>e.tagName===`CANVAS`,dr=e=>e.tagName===`TEXTAREA`,fr=e=>e.tagName===`INPUT`,pr=e=>e.tagName===`STYLE`,mr=e=>e.tagName===`SCRIPT`,hr=e=>e.tagName===`SELECT`,gr=e=>e.tagName===`SLOT`,_r=e=>e.tagName===`IFRAME`,vr=(...e)=>console.warn(Un,...e);function yr(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 br=e=>e.startsWith(`data:`);function xr(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(Wn&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!Wn)return e;let n=Sr().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 Sr(e){return(e&&J(e)?e?.ownerDocument:e)??window.document}let Cr=`http://www.w3.org/2000/svg`;function wr(e,t,n){let r=Sr(n).createElementNS(Cr,`svg`);return r.setAttributeNS(null,`width`,e.toString()),r.setAttributeNS(null,`height`,t.toString()),r.setAttributeNS(null,`viewBox`,`0 0 ${e} ${t}`),r}function Tr(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 Er(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 Dr=e=>Er(e,`dataUrl`);function Or(e,t){let n=Sr(t).createElement(`img`);return n.decoding=`sync`,n.loading=`eager`,n.src=e,n}function kr(e,t){return new Promise(n=>{let{timeout:r,ownerDocument:i,onError:a,onWarn:o}=t??{},s=typeof e==`string`?Or(e,Sr(i)):e,c=null,l=null;function u(){n(s),c&&clearTimeout(c),l?.()}if(r&&(c=setTimeout(u,r)),lr(s)){let e=s.currentSrc||s.src;if(!e)return s.poster?kr(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=rr(s)?s.href.baseVal:s.currentSrc||s.src;if(!e)return u();let t=async()=>{if(cr(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(cr(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 Ar(e,t){ar(e)&&(cr(e)||lr(e)?await kr(e,t):await Promise.all([`img`,`video`].flatMap(n=>Array.from(e.querySelectorAll(n)).map(e=>kr(e,t)))))}let jr=/* @__PURE__ */ function(){let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)}();function Mr(e){return e?.split(`,`).map(e=>e.trim().replace(/"|'/g,``).toLowerCase()).filter(Boolean)}let Nr=0;function Pr(e){let t=`${Un}[#${Nr}]`;return Nr++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...t)=>e&&vr(...t)}}function Fr(e){return{cache:e?`no-cache`:`force-cache`}}async function Ir(e,t){return Qn(e)?e:Lr(e,{...t,autoDestruct:!0})}async function Lr(e,t){let{scale:n=1,workerUrl:r,workerNumber:i=1}=t||{},a=!!t?.debug,o=t?.features??!0,s=e.ownerDocument??(Wn?window.document:void 0),c=e.ownerDocument?.defaultView??(Wn?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:Fr(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:Pr(a),node:e,ownerDocument:s,ownerWindow:c,dpi:n===1?null:96*n,svgStyleElement:Rr(s),svgDefsElement:s?.createElementNS(Cr,`defs`),svgStyles:/* @__PURE__ */ new Map,defaultComputedStyles:/* @__PURE__ */ new Map,workers:[...Array.from({length:Gn&&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:`${[yr(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 Ar(e,{timeout:u.timeout,onWarn:u.log.warn}),u.log.timeEnd(`wait until load`);let{width:d,height:f}=zr(e,u);return u.width=d,u.height=f,u}function Rr(e){if(!e)return;let t=e.createElement(`style`),n=t.ownerDocument.createTextNode(`
|
|
2
2
|
.______background-clip--text {
|
|
3
3
|
background-clip: text;
|
|
4
4
|
-webkit-background-clip: text;
|
|
5
5
|
}
|
|
6
|
-
`);return t.appendChild(n),t}function
|
|
7
|
-
`),h=s.get(m);h||(h=[],s.set(m,h)),h.push(`.${u[0]}${n}`)}
|
|
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(
|
|
9
|
-
`)):o.push(
|
|
10
|
-
`))}))})}}}let
|
|
6
|
+
`);return t.appendChild(n),t}function zr(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 Br(e,t){let{log:n,timeout:r,drawImageCount:i,drawImageInterval:a}=t;n.time(`image to canvas`);let o=await kr(e,{timeout:r,onWarn:t.log.warn}),{canvas:s,context2d:c}=Vr(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 Vr(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 Hr(e,t){if(e.ownerDocument)try{let t=e.toDataURL();if(t!==`data:,`)return Or(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 Ur(e,t){try{if(e?.contentDocument?.documentElement)return li(e.contentDocument.documentElement,t)}catch(e){t.log.warn(`Failed to clone iframe`,e)}return e.cloneNode(!1)}function Wr(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 Gr(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return Or(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 kr(n,{onError:()=>i=!1,onWarn:t.log.warn}),!i)return e.poster?Or(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?Or(e.poster,e.ownerDocument):n}return Hr(a,t)}return n}function Kr(e,t){return ur(e)?Hr(e,t):_r(e)?Ur(e,t):cr(e)?Wr(e):lr(e)?Gr(e,t):e.cloneNode(!1)}function qr(e){let t=e.sandbox;if(!t){let{ownerDocument:n}=e;try{n&&(t=n.createElement(`iframe`),t.id=`__SANDBOX__${jr()}`,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 Jr=[`width`,`height`,`-webkit-text-fill-color`],Yr=[`stroke`,`fill`];function Xr(e,t,n){let{defaultComputedStyles:r}=n,i=e.nodeName.toLowerCase(),a=nr(e)&&i!==`svg`,o=a?Yr.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=qr(n)?.contentWindow;if(!c)return/* @__PURE__ */ new Map;let l=c?.document,u,d;a?(u=l.createElementNS(Cr,`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);Jr.includes(e)||p.set(e,f.getPropertyValue(e))}return l.body.removeChild(u),r.set(s,p),p}function Zr(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 Qr(e,t,n,r){let{ownerWindow:i,includeStyleProperties:a,currentParentNodeStyle:o}=r,s=t.style,c=i.getComputedStyle(e),l=Xr(e,null,r);o?.forEach((e,t)=>{l.delete(t)});let u=Zr(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`),Yn&&(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 $r(e,t){(dr(e)||fr(e)||hr(e))&&t.setAttribute(`value`,e.value)}let ei=[`::before`,`::after`],ti=[`::-webkit-scrollbar`,`::-webkit-scrollbar-button`,`::-webkit-scrollbar-thumb`,`::-webkit-scrollbar-track`,`::-webkit-scrollbar-track-piece`,`::-webkit-scrollbar-corner`,`::-webkit-resizer`];function ni(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=[jr()],d=Xr(e,n,r);c?.forEach((e,t)=>{d.delete(t)});let f=Zr(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}`)}ei.forEach(l),n&&ti.forEach(l)}let ri=/* @__PURE__ */ new Set([`symbol`]);async function ii(e,t,n,r,i){if(J(n)&&(pr(n)||mr(n))||r.filter&&!r.filter(n))return;r.currentParentNodeStyle=ri.has(t.nodeName)||ri.has(n.nodeName)?void 0:r.currentNodeStyle;let a=await li(n,r,!1,i);r.isEnable(`restoreScrollPosition`)&&oi(e,a),t.appendChild(a)}async function ai(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(!or(a)){if(J(a)&&gr(a)&&typeof a.assignedNodes==`function`){let i=a.assignedNodes();for(let a=0;a<i.length;a++)await ii(e,t,i[a],n,r)}else await ii(e,t,a,n,r)}}function oi(e,t){if(!ar(e)||!ar(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 si(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 ci=/^[\w-:]+$/;async function li(e,t,n=!1,r){let{ownerDocument:i,ownerWindow:a,fontFamilies:o,onCloneEachNode:s}=t;if(i&&sr(e))return r&&/\S/.test(e.data)&&r(e.data),i.createTextNode(e.data);if(i&&a&&J(e)&&(ar(e)||nr(e))){let r=await Kr(e,t);if(t.isEnable(`removeAbnormalAttributes`)){let e=r.getAttributeNames();for(let t=e.length,n=0;n<t;n++){let t=e[n];ci.test(t)||r.removeAttribute(t)}}let i=t.currentNodeStyle=Qr(e,r,n,t);n&&si(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=Mr(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 ni(e,r,a,t,u),$r(e,r),lr(e)||await ai(e,r,t,u),await s?.(r),r}let c=e.cloneNode(!1);return await ai(e,c,t),await s?.(c),c}function ui(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 di(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(Dr);default:return e.text()}}).finally(()=>clearTimeout(o))}function fi(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`&&(Xn||Zn)&&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!Xn&&n.startsWith(`http`)&&h.length?new Promise((e,t)=>{h[l.size&h.length-1].postMessage({rawUrl:n,...b}),_.resolve=e,_.reject=t}):di(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 pi(e,t,n,r){if(!mi(e))return e;for(let[i,a]of gi(e,t))try{let t=await fi(n,{url:a,requestType:r?`image`:`text`,responseType:`dataUrl`});e=e.replace(_i(i),`$1${t}$3`)}catch(e){n.log.warn(`Failed to fetch css data url`,i,e)}return e}function mi(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}let hi=/url\((['"]?)([^'"]+?)\1\)/g;function gi(e,t){let n=[];return e.replace(hi,(e,r,i)=>(n.push([i,xr(i,t)]),e)),n.filter(([e])=>!br(e))}function _i(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,`\\$1`);return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,`g`)}let vi=[`background-image`,`border-image-source`,`-webkit-border-image`,`-webkit-mask-image`,`list-style-image`];function yi(e,t){return vi.map(n=>{let r=e.getPropertyValue(n);return!r||r===`none`?null:((Xn||Zn)&&t.drawImageCount++,pi(r,null,t,!0).then(t=>{t&&r!==t&&e.setProperty(n,t,e.getPropertyPriority(n))}))}).filter(Boolean)}function bi(e,t){if(cr(e)){let n=e.currentSrc||e.src;if(!br(n))return[fi(t,{url:n,imageDom:e,requestType:`image`,responseType:`dataUrl`}).then(t=>{t&&(e.srcset=``,e.dataset.originalSrc=n,e.src=t||``)})];(Xn||Zn)&&t.drawImageCount++}else if(nr(e)&&!br(e.href.baseVal)){let n=e.href.baseVal;return[fi(t,{url:n,imageDom:e,requestType:`image`,responseType:`dataUrl`}).then(t=>{t&&(e.dataset.originalSrc=n,e.href.baseVal=t||``)})]}return[]}function xi(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[fi(t,{url:a,responseType:`text`}).then(e=>{r?.insertAdjacentHTML(`beforeend`,e)})]}return[]}function Si(e,t){let{tasks:n}=t;J(e)&&((cr(e)||rr(e))&&n.push(...bi(e,t)),ir(e)&&n.push(...xi(e,t))),ar(e)&&n.push(...yi(e.style,t)),e.childNodes.forEach(e=>{Si(e,t)})}async function Ci(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=ki(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(er(e)){let n=e.href,r=``;try{r=await fi(t,{url:n,requestType:`text`,responseType:`text`})}catch(e){t.log.warn(`Error fetch remote css import from ${n}`,e)}let i=r.replace(hi,(e,t,r)=>e.replace(r,xr(r,n)));for(let e of Ei(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=>{Ai(e.cssRules,u)}),u.filter(e=>$n(e)&&mi(e.style.getPropertyValue(`src`))&&Mr(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(pi(i.cssText,i.parentStyleSheet?i.parentStyleSheet.href:null,t).then(e=>{e=ki(e,t),a.set(i.cssText,e),r.appendChild(n.createTextNode(`${e}
|
|
10
|
+
`))}))})}}}let wi=/(\/\*[\s\S]*?\*\/)/g,Ti=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;function Ei(e){if(e==null)return[];let t=[],n=e.replace(wi,``);for(;;){let e=Ti.exec(n);if(!e)break;t.push(e[0])}n=n.replace(Ti,``);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 Di=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Oi=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function ki(e,t){let{font:n}=t,r=n?n?.preferredFormat:void 0;return r?e.replace(Oi,e=>{for(;;){let[t,,n]=Di.exec(e)||[];if(!n)return``;if(n===r)return`src: ${t};`}}):e}function Ai(e,t=[]){for(let n of Array.from(e))tr(n)?t.push(...Ai(n.cssRules)):`cssRules`in n?Ai(n.cssRules,t):t.push(n);return t}let ji=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;function Mi(e){return ji.test(e.innerHTML)}async function Ni(e,t){let n=await Ir(e,t);if(J(n.node)&&nr(n.node)&&!Mi(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 li(n.node,n,!0);if(o&&r){let e=``;c.forEach((t,n)=>{e+=`${t.join(`,
|
|
11
11
|
`)} {
|
|
12
12
|
${n}
|
|
13
13
|
}
|
|
14
|
-
`}),o.appendChild(r.createTextNode(e))}i.timeEnd(`clone node`),await f?.(h),l!==!1&&J(h)&&(i.time(`embed web font`),await ri(h,n),i.timeEnd(`embed web font`)),i.time(`embed node`),ni(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=mi(h,n);return s&&y.insertBefore(s,y.children[0]),o&&y.insertBefore(o,y.children[0]),d&&Wr(n),await m?.(y),y}function mi(e,t){let{width:n,height:r}=t,i=ir(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 hi(e,t){let n=await gr(e,t),r=await pi(n),i=ar(r,n.isEnable(`removeControlCharacter`));return n.autoDestruct||(n.svgStyleElement=vr(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(rr,`defs`),n.svgStyles.clear()),await br(cr(i,r.ownerDocument),n)}async function gi(e,t){let n=await gr(e,t),{log:r,quality:i,type:a,dpi:o}=n,s=await hi(n);r.time(`canvas to data url`);let c=s.toDataURL(a,i);if([`image/png`,`image/jpeg`].includes(a)&&o&&En&&Dn){let[e,t]=c.split(`,`),n=0,r=!1;if(a===`image/png`){let e=Sn(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`?xn(u,o,r):gn(u,o);c=[e,`,`,window.btoa(String.fromCharCode(...d)),s].join(``)}return r.timeEnd(`canvas to data url`),c}async function _i(e,t){return gi(await gr(e,{...t,type:`image/jpeg`}))}async function vi(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 _i(r,{scale:a,quality:.85,backgroundColor:yi(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 yi(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 bi=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:--bi,__i:-1,__u:0};return(a||o)&&(u.__source=a,u.__self=o),n.vnode&&n.vnode(u),u}let xi={t3code:{viewBox:`15.5309 37 94.3941 56.96`,path:`M33.4509 93V47.56H15.5309V37H64.3309V47.56H46.4109V93H33.4509ZM86.7253 93.96C82.832 93.96 78.9653 93.4533 75.1253 92.44C71.2853 91.3733 68.032 89.88 65.3653 87.96L70.4053 78.04C72.5386 79.5867 75.0186 80.8133 77.8453 81.72C80.672 82.6267 83.5253 83.08 86.4053 83.08C89.6586 83.08 92.2186 82.44 94.0853 81.16C95.952 79.88 96.8853 78.12 96.8853 75.88C96.8853 73.7467 96.0586 72.0667 94.4053 70.84C92.752 69.6133 90.0853 69 86.4053 69H80.4853V60.44L96.0853 42.76L97.5253 47.4H68.1653V37H107.365V45.4L91.8453 63.08L85.2853 59.32H89.0453C95.9253 59.32 101.125 60.8667 104.645 63.96C108.165 67.0533 109.925 71.0267 109.925 75.88C109.925 79.0267 109.099 81.9867 107.445 84.76C105.792 87.48 103.259 89.6933 99.8453 91.4C96.432 93.1067 92.0586 93.96 86.7253 93.96Z`,className:`agent-mono`,label:`T3 Code`},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 Si(e){if(xi[e])return xi[e];let t=e.toLowerCase();if(t.includes(`claude`))return xi.claudeAgent;if(t.includes(`codex`)||t.includes(`openai`))return xi.codex;if(t.includes(`cursor`))return xi.cursor}function Ci({agent:e,size:t=13,decorative:n=!1}){if(!e)return null;let r=Si(e);return r?/* @__PURE__ */ Y(`svg`,{class:`agent-icon ${r.className}`,width:t,height:t,viewBox:r.viewBox,role:n?void 0:`img`,"aria-label":n?void 0:r.label,"aria-hidden":n?`true`:void 0,children:/* @__PURE__ */ Y(`path`,{d:r.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 wi=()=>/* @__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`})]}),Ti=()=>/* @__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`})]}),Ei=()=>/* @__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`})]}),Di=()=>/* @__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`})]}),Oi=()=>/* @__PURE__ */ Y(X,{children:/* @__PURE__ */ Y(`path`,{d:`m5 12 7-7 7 7M12 19V5`})}),ki=()=>/* @__PURE__ */ Y(X,{size:12,children:/* @__PURE__ */ Y(`rect`,{x:`5`,y:`5`,width:`14`,height:`14`,rx:`2`,fill:`currentColor`})}),Ai=()=>/* @__PURE__ */ Y(X,{children:/* @__PURE__ */ Y(`path`,{d:`M20 6 9 17l-5-5`})}),ji=()=>/* @__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`})]}),Mi=()=>/* @__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`})}),Ni=()=>/* @__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`})}),Pi=()=>/* @__PURE__ */ Y(X,{children:/* @__PURE__ */ Y(`path`,{d:`M18 6 6 18M6 6l12 12`})}),Fi=()=>/* @__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`})]}),Ii=()=>/* @__PURE__ */ Y(X,{size:12,children:/* @__PURE__ */ Y(`path`,{d:`m16 18 6-6-6-6M8 6l-6 6 6 6`})}),Li=()=>/* @__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`})]}),Ri=({size:e=16})=>/* @__PURE__ */ Y(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,class:`tencil-logo`,children:[/* @__PURE__ */ Y(`path`,{d:`M3 21V9a6 6 0 0 1 6-6h6a6 6 0 0 1 6 6v6a6 6 0 0 1-6 6Z`,fill:`#3b8dff`}),/* @__PURE__ */ Y(`path`,{d:`M9.25 7.5 16.5 12.6l-3.55.75-1.75 3.4Z`,fill:`#fff`,stroke:`#fff`,"stroke-linejoin":`round`})]}),zi=()=>/* @__PURE__ */ Y(X,{size:14,children:[/* @__PURE__ */ Y(`path`,{d:`m12 2 10 5-10 5L2 7Z`}),/* @__PURE__ */ Y(`path`,{d:`m2 17 10 5 10-5M2 12l10 5 10-5`})]}),Bi=()=>/* @__PURE__ */ Y(X,{size:12,children:/* @__PURE__ */ Y(`path`,{d:`m6 9 6 6 6-6`})}),Vi=`bippy-0.7.3`,Hi=Object.defineProperty,Ui=()=>{
|
|
14
|
+
`}),o.appendChild(r.createTextNode(e))}i.timeEnd(`clone node`),await f?.(h),l!==!1&&J(h)&&(i.time(`embed web font`),await Ci(h,n),i.timeEnd(`embed web font`)),i.time(`embed node`),Si(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=Pi(h,n);return s&&y.insertBefore(s,y.children[0]),o&&y.insertBefore(o,y.children[0]),d&&ui(n),await m?.(y),y}function Pi(e,t){let{width:n,height:r}=t,i=wr(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 Fi(e,t){let n=await Ir(e,t),r=await Ni(n),i=Tr(r,n.isEnable(`removeControlCharacter`));return n.autoDestruct||(n.svgStyleElement=Rr(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(Cr,`defs`),n.svgStyles.clear()),await Br(Or(i,r.ownerDocument),n)}async function Ii(e,t){let n=await Ir(e,t),{log:r,quality:i,type:a,dpi:o}=n,s=await Fi(n);r.time(`canvas to data url`);let c=s.toDataURL(a,i);if([`image/png`,`image/jpeg`].includes(a)&&o&&Kn&&qn){let[e,t]=c.split(`,`),n=0,r=!1;if(a===`image/png`){let e=Hn(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`?Vn(u,o,r):In(u,o);c=[e,`,`,window.btoa(String.fromCharCode(...d)),s].join(``)}return r.timeEnd(`canvas to data url`),c}async function Li(e,t){return Ii(await Ir(e,{...t,type:`image/jpeg`}))}async function Ri(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 Li(r,{scale:a,quality:.85,backgroundColor:zi(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 zi(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 Bi=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:--Bi,__i:-1,__u:0};return(a||o)&&(u.__source=a,u.__self=o),n.vnode&&n.vnode(u),u}let Vi={t3code:{viewBox:`15.5309 37 94.3941 56.96`,path:`M33.4509 93V47.56H15.5309V37H64.3309V47.56H46.4109V93H33.4509ZM86.7253 93.96C82.832 93.96 78.9653 93.4533 75.1253 92.44C71.2853 91.3733 68.032 89.88 65.3653 87.96L70.4053 78.04C72.5386 79.5867 75.0186 80.8133 77.8453 81.72C80.672 82.6267 83.5253 83.08 86.4053 83.08C89.6586 83.08 92.2186 82.44 94.0853 81.16C95.952 79.88 96.8853 78.12 96.8853 75.88C96.8853 73.7467 96.0586 72.0667 94.4053 70.84C92.752 69.6133 90.0853 69 86.4053 69H80.4853V60.44L96.0853 42.76L97.5253 47.4H68.1653V37H107.365V45.4L91.8453 63.08L85.2853 59.32H89.0453C95.9253 59.32 101.125 60.8667 104.645 63.96C108.165 67.0533 109.925 71.0267 109.925 75.88C109.925 79.0267 109.099 81.9867 107.445 84.76C105.792 87.48 103.259 89.6933 99.8453 91.4C96.432 93.1067 92.0586 93.96 86.7253 93.96Z`,className:`agent-mono`,label:`T3 Code`},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 Hi(e){if(Vi[e])return Vi[e];let t=e.toLowerCase();if(t.includes(`claude`))return Vi.claudeAgent;if(t.includes(`codex`)||t.includes(`openai`))return Vi.codex;if(t.includes(`cursor`))return Vi.cursor}function Ui({agent:e,size:t=13,decorative:n=!1}){if(!e)return null;let r=Hi(e);return r?/* @__PURE__ */ Y(`svg`,{class:`agent-icon ${r.className}`,width:t,height:t,viewBox:r.viewBox,role:n?void 0:`img`,"aria-label":n?void 0:r.label,"aria-hidden":n?`true`:void 0,children:/* @__PURE__ */ Y(`path`,{d:r.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 Wi=()=>/* @__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`})]}),Gi=()=>/* @__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`})]}),Ki=()=>/* @__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`})]}),qi=()=>/* @__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`})]}),Ji=()=>/* @__PURE__ */ Y(X,{children:/* @__PURE__ */ Y(`path`,{d:`m5 12 7-7 7 7M12 19V5`})}),Yi=()=>/* @__PURE__ */ Y(X,{size:12,children:/* @__PURE__ */ Y(`rect`,{x:`5`,y:`5`,width:`14`,height:`14`,rx:`2`,fill:`currentColor`})}),Xi=()=>/* @__PURE__ */ Y(X,{children:/* @__PURE__ */ Y(`path`,{d:`M20 6 9 17l-5-5`})}),Zi=()=>/* @__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`})]}),Qi=()=>/* @__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`})}),$i=()=>/* @__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`})}),ea=()=>/* @__PURE__ */ Y(X,{children:/* @__PURE__ */ Y(`path`,{d:`M18 6 6 18M6 6l12 12`})}),ta=()=>/* @__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`})]}),na=()=>/* @__PURE__ */ Y(X,{size:12,children:/* @__PURE__ */ Y(`path`,{d:`m16 18 6-6-6-6M8 6l-6 6 6 6`})}),ra=()=>/* @__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`})]}),ia=({size:e=16})=>/* @__PURE__ */ Y(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,class:`tencil-logo`,children:[/* @__PURE__ */ Y(`path`,{d:`M3 21V9a6 6 0 0 1 6-6h6a6 6 0 0 1 6 6v6a6 6 0 0 1-6 6Z`,fill:`#3b8dff`}),/* @__PURE__ */ Y(`path`,{d:`M9.25 7.5 16.5 12.6l-3.55.75-1.75 3.4Z`,fill:`#fff`,stroke:`#fff`,"stroke-linejoin":`round`})]}),aa=()=>/* @__PURE__ */ Y(X,{size:14,children:[/* @__PURE__ */ Y(`path`,{d:`m12 2 10 5-10 5L2 7Z`}),/* @__PURE__ */ Y(`path`,{d:`m2 17 10 5 10-5M2 12l10 5 10-5`})]}),oa=()=>/* @__PURE__ */ Y(X,{size:12,children:/* @__PURE__ */ Y(`path`,{d:`m6 9 6 6 6-6`})}),sa=`bippy-0.7.3`,ca=Object.defineProperty,la=()=>{
|
|
15
15
|
/**
|
|
16
16
|
* @license bippy
|
|
17
17
|
*
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* This source code is licensed under the MIT license found in the
|
|
21
21
|
* LICENSE file in the root directory of this source tree.
|
|
22
22
|
*/
|
|
23
|
-
},
|
|
23
|
+
},ua=e=>e.__REACT_DEVTOOLS_GLOBAL_HOOK__,da=e=>Object.assign(e,{[Symbol.dispose]:e}),fa=e=>{let t=e.current.memoizedState;return t===null||t!==void 0&&(t.element===null||t.element===void 0)},pa=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{}},ma=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>!!(e&&`getFiberRoots`in e&&e._isBippyHook!==!0),ha=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>{if(!e||typeof e.inject!=`function`||ma(e))return!1;try{return Function.prototype.toString.call(e.inject).includes(`(injected)`)}catch{return!1}},ga=/* @__PURE__ */ new Set,_a=/* @__PURE__ */ new Set,va=/* @__PURE__ */ new WeakMap,ya=/* @__PURE__ */ new Set,ba=/* @__PURE__ */ new Set,xa=/* @__PURE__ */ new WeakMap,Sa=(e,t)=>{ga.add(e);let n=va.get(e)??/* @__PURE__ */ new Set;n.add(t),va.set(e,n)},Ca=e=>{for(let t of ga)va.get(t)?.has(e)&&t()},wa=(e,t)=>{for(let n of ya)n.target===e&&n.listener(t)},Ta=(e,t)=>{for(let n of ba)n(e,t)},Ea=e=>(ba.add(e),da(()=>{ba.delete(e)})),Da=e=>Object.prototype.toString.call(e)===`[object Map]`,Oa=e=>(Da(e.renderers)||(e.renderers=/* @__PURE__ */ new Map),e.renderers),ka=(e,t,n,r,i)=>{n.set(r,i),_a.add(i),e._instrumentationIsActive||(e._instrumentationIsActive=!0,Ca(t));let a=xa.get(t)??/* @__PURE__ */ new WeakSet;xa.set(t,a),!a.has(i)&&(a.add(i),wa(t,i))},Aa=(e,t=globalThis)=>{e&&Sa(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:sa,_isBippyHook:!0,checkDCE:pa,getFiberRoots:i,hasUnsupportedRendererAttached:!1,inject:e=>{let r=++a;return ka(o,t,n,r,e),r},on:la,onCommitFiberRoot:(e,t)=>{let n=i(e);fa(t)?n.delete(t):n.add(t)},onCommitFiberUnmount:la,onPostCommitFiberRoot:la,renderers:n,supportsFiber:!0,supportsFlight:!0};try{if(ca(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=Oa(o);r.forEach((e,t)=>{_a.add(e),i.set(t,e)}),(r.size>0||ba.size>0)&&ja(e,t),Ta(o,t)}}}),t===globalThis&&typeof window<`u`){let e=window.hasOwnProperty.bind(window),t=Object.getOwnPropertyDescriptor(window,`hasOwnProperty`),n=!1,r=()=>{t?ca(window,`hasOwnProperty`,t):Reflect.deleteProperty(window,`hasOwnProperty`)};ca(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{ja(e,t)}return o},ja=(e,t=globalThis)=>{e&&Sa(e,t);let n=!1,r=ua(t);if(!r)return;let i=Oa(r);if(!r._instrumentationSource){r.checkDCE=pa,r.supportsFiber=!0,r.supportsFlight=!0,r.hasUnsupportedRendererAttached=!1,r._instrumentationSource=sa,r._instrumentationIsActive=!1;let e=ma(r);e||(r.on=la),i.size?(i.forEach(e=>_a.add(e)),r._instrumentationIsActive=!0,Ca(t),n=!0):!e&&ha(r)&&(r._instrumentationIsActive=!0,Ca(t),n=!0);let a=r.inject;r.inject=e=>{let n=a.call(r,e);return ka(r,t,i,n,e),n}}!n&&(i.size||r._instrumentationIsActive)&&e?.()},Ma=(e=globalThis)=>Object.hasOwn(e,`__REACT_DEVTOOLS_GLOBAL_HOOK__`),Na=(e,t=globalThis)=>Ma(t)?(ja(e,t),ua(t)??Aa(e,t)):Aa(e,t);
|
|
24
24
|
/**
|
|
25
25
|
* @license bippy
|
|
26
26
|
*
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* This source code is licensed under the MIT license found in the
|
|
30
30
|
* LICENSE file in the root directory of this source tree.
|
|
31
31
|
*/
|
|
32
|
-
try{
|
|
32
|
+
try{Na()}catch{}
|
|
33
33
|
/**
|
|
34
34
|
* @license bippy
|
|
35
35
|
*
|
|
@@ -38,7 +38,7 @@ try{pa()}catch{}
|
|
|
38
38
|
* This source code is licensed under the MIT license found in the
|
|
39
39
|
* LICENSE file in the root directory of this source tree.
|
|
40
40
|
*/
|
|
41
|
-
let ma=/^(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-]+)*)?$/,ha=/^\d+$/,ga=e=>_a(e)!==null,_a=e=>{let t=ma.exec(e);if(!t)return null;let n=t[4]?.split(`.`)??[];return n.some(e=>ha.test(e)&&e.length>1&&e.startsWith(`0`))?null:{major:t[1],minor:t[2],patch:t[3],prerelease:n}},va=(e,t)=>e.length===t.length?e===t?0:e<t?-1:1:e.length<t.length?-1:1,ya=(e,t)=>{let n=ha.test(e),r=ha.test(t);return n&&r?va(e,t):n===r?e===t?0:e<t?-1:1:n?-1:1},ba=(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=ya(n,i);if(a!==0)return a}return 0},xa=(e,t)=>{let n=_a(e),r=_a(t);if(!n||!r)return null;let i=va(n.major,r.major);if(i!==0)return i;let a=va(n.minor,r.minor);if(a!==0)return a;let o=va(n.patch,r.patch);return o===0?ba(n.prerelease,r.prerelease):o},Sa={ChildDeletion:16,Cloned:8,ContentReset:32,Hydrating:4096,PerformedWork:1,Placement:2,Snapshot:1024,Update:4,Visibility:8192},Ca=(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}}),wa=[{isMinimumExcluded:!0,minimumVersion:`17.0.1`,workTags:Ca[`17.0.2`]},{isMinimumExcluded:!1,minimumVersion:`17.0.0-alpha`,workTags:Ca[`17.0.0-alpha`]},{isMinimumExcluded:!1,minimumVersion:`16.6.0-beta.0`,workTags:Ca[`16.6.0-beta.0`]},{isMinimumExcluded:!1,minimumVersion:`16.4.3-alpha`,workTags:Ca[`16.4.3-alpha`]}],Ta=Ca[`17.0.2`],Ea=e=>{if(e===void 0)return Ta;for(let t of wa){let n=xa(e,t.minimumVersion);if(n===null)return Ta;if(n===1||n===0&&!t.isMinimumExcluded)return t.workTags}return Ca[`16.0.0`]},Da=Ea(),Oa=/* @__PURE__ */ new WeakMap,ka=e=>e.startsWith(`0.0.0-`)?Da:Ea(e),Aa=e=>{let t=e?.reconcilerVersion;return t&&ga(t)?ka(t):e?.version?ka(e.version):Da},ja=(e,t)=>{let n=Aa(t);Oa.set(e,n),e.alternate&&Oa.set(e.alternate,n)},Ma=e=>{let t=Oa.get(e);if(t)return t;let n=[e],r=e;for(;r.return;)r=r.return,n.push(r);let i=Oa.get(r)??Da;for(let e of n)Oa.set(e,i),e.alternate&&Oa.set(e.alternate,i);return i};Sa.Placement|Sa.Update|Sa.ChildDeletion|Sa.ContentReset|Sa.Hydrating|Sa.Visibility|Sa.Snapshot;var Na=class extends Error{constructor(e,t){super(e,{cause:t}),this.name=`BippyError`}},Pa=class extends Na{constructor(e,t){super(e,t),this.name=`BippyHookInspectionError`}},Fa=class extends Pa{constructor(e,t){super(e,t),this.name=`BippyUnsupportedHookError`}},Ia=class extends Na{constructor(e,t){super(e,t),this.name=`BippySourceMapError`}};let La=e=>typeof e==`function`,Ra=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},za=e=>typeof e==`object`&&!!e&&`tag`in e&&`stateNode`in e&&`return`in e&&`child`in e&&`sibling`in e&&`flags`in e,Ba=e=>{let t=Ma(e);switch(e.tag){case t.HostComponent:case t.HostText:case t.HostHoistable:case t.HostSingleton:return!0;default:return!1}},Va=e=>{let t=Ma(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 Ha(e,t,n=!1){if(!e)return null;let r=t(e);return Ua(r)?Promise.resolve(r).then(r=>r===!0?e:Wa(e,t,n)):r===!0?e:Wa(e,t,n)}let Ua=e=>(typeof e==`object`||typeof e==`function`)&&e!==null&&`then`in e&&typeof e.then==`function`,Wa=(e,t,n)=>{let r=n?e.return:e.child;return Ga(r,t,n)},Ga=(e,t,n)=>{if(!e)return null;let r=n?null:e.sibling,i=Ha(e,t,n);return Ua(i)?Promise.resolve(i).then(e=>e??Ga(r,t,n)):i??Ga(r,t,n)},Ka=e=>La(e)?e:typeof e!=`object`||!e?null:Ka(Reflect.get(e,`type`)??Reflect.get(e,`render`)),qa=e=>{if(typeof e==`string`)return e;if(typeof e!=`function`&&typeof e!=`object`||e===null)return null;let t=Ra(e);if(t)return t;let n=Ka(e);return n?Ra(n):null},Ja=/* @__PURE__ */ new Set,Ya=/* @__PURE__ */ new WeakMap,Xa=/* @__PURE__ */ new WeakMap,Za=/* @__PURE__ */ new WeakMap,Qa=/* @__PURE__ */ new Map;typeof FinalizationRegistry==`function`&&new FinalizationRegistry(e=>{Qa.get(e)?.deref()||Qa.delete(e)});let $a=e=>{let t=e.alternate?[e,e.alternate]:[e],n=/* @__PURE__ */ new Set;for(let e of t){let t=Za.get(e);t!==void 0&&n.add(t),Za.delete(e)}for(let e of n){let n=Qa.get(e)?.deref();(!n||t.includes(n))&&Qa.delete(e)}},eo=/* @__PURE__ */ new Set,to=/* @__PURE__ */ new WeakMap,no=/* @__PURE__ */ new WeakMap,ro=!1,io=e=>{let t=to.get(e)??{};if(to.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),to.get(e)?.onCommitFiberRoot===r){ja(i.current,e.renderers.get(t)),Ki(i)?(Ja.delete(i),Ya.delete(i),Xa.delete(i)):(Ja.add(i),Ya.set(i,t),Xa.set(i,e));for(let{options:n,target:r}of eo)r===no.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(ja(i,e.renderers.get(t)),n&&n.call(e,t,i),to.get(e)?.onCommitFiberUnmount===r)try{for(let{options:n,target:r}of eo)r===no.get(e)&&n.onCommitFiberUnmount&&n.onCommitFiberUnmount(t,i)}finally{$a(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),to.get(e)?.onPostCommitFiberRoot===r)for(let{options:n,target:r}of eo)r===no.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),to.get(e)?.onScheduleFiberRoot===r)for(let{options:n,target:r}of eo)r===no.get(e)&&n.onScheduleFiberRoot&&n.onScheduleFiberRoot(t,i,a)};t.onScheduleFiberRoot=r,e.onScheduleFiberRoot=r}},ao=(e,t)=>{no.set(e,t),io(e)},oo=(e,t=globalThis)=>{ro||=(oa(ao),!0),no.set(e,t),io(e)};try{fa()&&oo(pa())}catch{}let so=/* @__PURE__ */ new Set,co=e=>e.startsWith(`__reactContainer$`)||e.startsWith(`__reactInternalInstance$`)||e.startsWith(`__reactFiber`),lo=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 za(i)?i:null},uo=e=>{let t=Reflect.get(e,`__internalInstanceHandle`)??Reflect.get(e,`_internalInstanceHandle`);return za(t)?t:null},fo=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},po=(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=lo(e);if(t)return t;let n=uo(e);if(n)return n;for(let t of so){let n=Reflect.get(e,t);if(za(n))return n}for(let t of Object.keys(e))if(co(t)){so.add(t);let n=Reflect.get(e,t);if(za(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 Ja)Xa.get(e)===n&&t.add(e);for(let n of t){let t=Ha(n.current,t=>Ba(t)&&fo(t.stateNode)===e);if(t)return t}}return null};Reflect.get(/* @__PURE__ */ t({useEffect:()=>void 0,useReducer:()=>void 0,useRef:()=>void 0}),`useSyncExternalStore`);
|
|
41
|
+
let Pa=/^(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-]+)*)?$/,Fa=/^\d+$/,Ia=e=>La(e)!==null,La=e=>{let t=Pa.exec(e);if(!t)return null;let n=t[4]?.split(`.`)??[];return n.some(e=>Fa.test(e)&&e.length>1&&e.startsWith(`0`))?null:{major:t[1],minor:t[2],patch:t[3],prerelease:n}},Ra=(e,t)=>e.length===t.length?e===t?0:e<t?-1:1:e.length<t.length?-1:1,za=(e,t)=>{let n=Fa.test(e),r=Fa.test(t);return n&&r?Ra(e,t):n===r?e===t?0:e<t?-1:1:n?-1:1},Ba=(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=za(n,i);if(a!==0)return a}return 0},Va=(e,t)=>{let n=La(e),r=La(t);if(!n||!r)return null;let i=Ra(n.major,r.major);if(i!==0)return i;let a=Ra(n.minor,r.minor);if(a!==0)return a;let o=Ra(n.patch,r.patch);return o===0?Ba(n.prerelease,r.prerelease):o},Ha={ChildDeletion:16,Cloned:8,ContentReset:32,Hydrating:4096,PerformedWork:1,Placement:2,Snapshot:1024,Update:4,Visibility:8192},Ua=(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}}),Wa=[{isMinimumExcluded:!0,minimumVersion:`17.0.1`,workTags:Ua[`17.0.2`]},{isMinimumExcluded:!1,minimumVersion:`17.0.0-alpha`,workTags:Ua[`17.0.0-alpha`]},{isMinimumExcluded:!1,minimumVersion:`16.6.0-beta.0`,workTags:Ua[`16.6.0-beta.0`]},{isMinimumExcluded:!1,minimumVersion:`16.4.3-alpha`,workTags:Ua[`16.4.3-alpha`]}],Ga=Ua[`17.0.2`],Ka=e=>{if(e===void 0)return Ga;for(let t of Wa){let n=Va(e,t.minimumVersion);if(n===null)return Ga;if(n===1||n===0&&!t.isMinimumExcluded)return t.workTags}return Ua[`16.0.0`]},qa=Ka(),Ja=/* @__PURE__ */ new WeakMap,Ya=e=>e.startsWith(`0.0.0-`)?qa:Ka(e),Xa=e=>{let t=e?.reconcilerVersion;return t&&Ia(t)?Ya(t):e?.version?Ya(e.version):qa},Za=(e,t)=>{let n=Xa(t);Ja.set(e,n),e.alternate&&Ja.set(e.alternate,n)},Qa=e=>{let t=Ja.get(e);if(t)return t;let n=[e],r=e;for(;r.return;)r=r.return,n.push(r);let i=Ja.get(r)??qa;for(let e of n)Ja.set(e,i),e.alternate&&Ja.set(e.alternate,i);return i};Ha.Placement|Ha.Update|Ha.ChildDeletion|Ha.ContentReset|Ha.Hydrating|Ha.Visibility|Ha.Snapshot;var $a=class extends Error{constructor(e,t){super(e,{cause:t}),this.name=`BippyError`}},eo=class extends $a{constructor(e,t){super(e,t),this.name=`BippyHookInspectionError`}},to=class extends eo{constructor(e,t){super(e,t),this.name=`BippyUnsupportedHookError`}},no=class extends $a{constructor(e,t){super(e,t),this.name=`BippySourceMapError`}};let ro=e=>typeof e==`function`,io=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},ao=e=>typeof e==`object`&&!!e&&`tag`in e&&`stateNode`in e&&`return`in e&&`child`in e&&`sibling`in e&&`flags`in e,oo=e=>{let t=Qa(e);switch(e.tag){case t.HostComponent:case t.HostText:case t.HostHoistable:case t.HostSingleton:return!0;default:return!1}},so=e=>{let t=Qa(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 co(e,t,n=!1){if(!e)return null;let r=t(e);return lo(r)?Promise.resolve(r).then(r=>r===!0?e:uo(e,t,n)):r===!0?e:uo(e,t,n)}let lo=e=>(typeof e==`object`||typeof e==`function`)&&e!==null&&`then`in e&&typeof e.then==`function`,uo=(e,t,n)=>{let r=n?e.return:e.child;return fo(r,t,n)},fo=(e,t,n)=>{if(!e)return null;let r=n?null:e.sibling,i=co(e,t,n);return lo(i)?Promise.resolve(i).then(e=>e??fo(r,t,n)):i??fo(r,t,n)},po=e=>ro(e)?e:typeof e!=`object`||!e?null:po(Reflect.get(e,`type`)??Reflect.get(e,`render`)),mo=e=>{if(typeof e==`string`)return e;if(typeof e!=`function`&&typeof e!=`object`||e===null)return null;let t=io(e);if(t)return t;let n=po(e);return n?io(n):null},ho=/* @__PURE__ */ new Set,go=/* @__PURE__ */ new WeakMap,_o=/* @__PURE__ */ new WeakMap,vo=/* @__PURE__ */ new WeakMap,yo=/* @__PURE__ */ new Map;typeof FinalizationRegistry==`function`&&new FinalizationRegistry(e=>{yo.get(e)?.deref()||yo.delete(e)});let bo=e=>{let t=e.alternate?[e,e.alternate]:[e],n=/* @__PURE__ */ new Set;for(let e of t){let t=vo.get(e);t!==void 0&&n.add(t),vo.delete(e)}for(let e of n){let n=yo.get(e)?.deref();(!n||t.includes(n))&&yo.delete(e)}},xo=/* @__PURE__ */ new Set,So=/* @__PURE__ */ new WeakMap,Co=/* @__PURE__ */ new WeakMap,wo=!1,To=e=>{let t=So.get(e)??{};if(So.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),So.get(e)?.onCommitFiberRoot===r){Za(i.current,e.renderers.get(t)),fa(i)?(ho.delete(i),go.delete(i),_o.delete(i)):(ho.add(i),go.set(i,t),_o.set(i,e));for(let{options:n,target:r}of xo)r===Co.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(Za(i,e.renderers.get(t)),n&&n.call(e,t,i),So.get(e)?.onCommitFiberUnmount===r)try{for(let{options:n,target:r}of xo)r===Co.get(e)&&n.onCommitFiberUnmount&&n.onCommitFiberUnmount(t,i)}finally{bo(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),So.get(e)?.onPostCommitFiberRoot===r)for(let{options:n,target:r}of xo)r===Co.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),So.get(e)?.onScheduleFiberRoot===r)for(let{options:n,target:r}of xo)r===Co.get(e)&&n.onScheduleFiberRoot&&n.onScheduleFiberRoot(t,i,a)};t.onScheduleFiberRoot=r,e.onScheduleFiberRoot=r}},Eo=(e,t)=>{Co.set(e,t),To(e)},Do=(e,t=globalThis)=>{wo||=(Ea(Eo),!0),Co.set(e,t),To(e)};try{Ma()&&Do(Na())}catch{}let Oo=/* @__PURE__ */ new Set,ko=e=>e.startsWith(`__reactContainer$`)||e.startsWith(`__reactInternalInstance$`)||e.startsWith(`__reactFiber`),Ao=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 ao(i)?i:null},jo=e=>{let t=Reflect.get(e,`__internalInstanceHandle`)??Reflect.get(e,`_internalInstanceHandle`);return ao(t)?t:null},Mo=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},No=(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=Ao(e);if(t)return t;let n=jo(e);if(n)return n;for(let t of Oo){let n=Reflect.get(e,t);if(ao(n))return n}for(let t of Object.keys(e))if(ko(t)){Oo.add(t);let n=Reflect.get(e,t);if(ao(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 ho)_o.get(e)===n&&t.add(e);for(let n of t){let t=co(n.current,t=>oo(t)&&Mo(t.stateNode)===e);if(t)return t}}return null};Reflect.get(/* @__PURE__ */ t({useEffect:()=>void 0,useReducer:()=>void 0,useRef:()=>void 0}),`useSyncExternalStore`);
|
|
42
42
|
/**
|
|
43
43
|
* @license bippy
|
|
44
44
|
*
|
|
@@ -55,22 +55,22 @@ let ma=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za
|
|
|
55
55
|
* This source code is licensed under the MIT license found in the
|
|
56
56
|
* LICENSE file in the root directory of this source tree.
|
|
57
57
|
*/
|
|
58
|
-
let
|
|
59
|
-
`),n=[];for(let e of t)if(/^\s*at\s+/.test(e)){let t=
|
|
60
|
-
`).filter(e=>!!e.match(
|
|
61
|
-
`).filter(e=>!e.match(
|
|
62
|
-
`,t));return{frames:
|
|
63
|
-
`,a-1)+1,n=t.slice(e,a).match(
|
|
64
|
-
`),i=r===-1?t:t.slice(r+1);if(i.includes(e))return`\n${i}`}return Z(`${e}${t?` [${t}]`:``}`)},
|
|
58
|
+
let Po=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,Fo=[`rsc://`,`file:///`,`webpack-internal://`,`webpack://`,`node:`,`turbopack://`,`metro://`,`/app-pages-browser/`,`/(app-pages-browser)/`],Io=[`rsc://`,`about://React/`],Lo=[`<anonymous>`,`eval`,``],Ro=/\.(cjs|cts|js|jsx|mdx|mjs|mts|ts|tsx)$/,zo=/(\.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,Bo=/^\?[\w~.-]+(?:=[^&#]*)?(?:&[\w~.-]+(?:=[^&#]*)?)*$/,Vo=/\[[^\]]+\]$/,Ho=[`react_stack_bottom_frame`,`react-stack-bottom-frame`],Uo=Error,Wo=()=>Uo.prepareStackTrace,Go=e=>{Uo.prepareStackTrace=e},Ko=/(^|@)\S+:\d+/,qo=/^\s*at .*(\S+:\d+|\(native\))/m,Jo=/^(eval@)?(\[native code\])?$/,Yo=(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=Zo(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(Ko)){let t=Qo(e)[0];t&&n.push(t)}return n}return e.match(qo)?Zo(e):Qo(e)},Xo=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]},Zo=e=>e.split(`
|
|
60
|
+
`).filter(e=>!!e.match(qo)).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=Xo(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}}),Qo=e=>e.split(`
|
|
61
|
+
`).filter(e=>!e.match(Jo)).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=Xo(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}}}),$o=/* @__PURE__ */ new WeakMap,es=e=>Ho.some(t=>e.includes(t)),ts=e=>{let t=e.getFunctionName?.()??``;if(t)return t;let n=e.getTypeName?.()??``,r=e.getMethodName?.()??``;return n&&r?`${n}.${r}`:r},ns=e=>{let t=[];for(let n=1;n<e.length;n++){let r=e[n],i=ts(r);if(es(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}},rs=e=>{let t=-1;for(let n of Ho)if(t=e.indexOf(n),t!==-1)break;let n=t===-1?e:e.slice(0,e.lastIndexOf(`
|
|
62
|
+
`,t));return{frames:Yo(n).slice(1),isTrusted:t!==-1}},is=e=>{let t=$o.get(e);if(t)return t;let n=null,r=(e,t)=>{n=ns(t);let r=`${e.name||`Error`}: ${e.message||``}`;for(let e of t)r+=`\n at ${e.toString()}`;return r},i=Wo();Go(r);let a;try{a=String(e.stack)}finally{Go(i)}let o=n??rs(a);return $o.set(e,o),o},as=(e=globalThis)=>{let t=Na(void 0,e),n=Da(t.renderers)?t.renderers.values():[],r=e===globalThis?/* @__PURE__ */ new Set([..._a,...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},os=e=>`H`in e?e.H:e.current,ss=(e,t)=>{`H`in e?e.H=t:e.current=t};var cs=44,ls=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,us=/* @__PURE__ */ new Uint8Array(64),ds=/* @__PURE__ */ new Uint8Array(128);for(let e=0;e<ls.length;e++){let t=ls.charCodeAt(e);us[e]=t,ds[t]=e}function fs(e,t){let n=0,r=0,i=0;do i=ds[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 ps(e,t){return e.pos>=t?!1:e.peek()!==cs}var ms=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 hs(e){let{length:t}=e,n=new ms(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=fs(n,i),i<u&&(l=!1),u=i,ps(n,e)?(a=fs(n,a),o=fs(n,o),s=fs(n,s),ps(n,e)?(c=fs(n,c),r=[i,a,o,s,c]):r=[i,a,o,s]):r=[i],t.push(r),n.pos++}l||gs(t),r.push(t),n.pos=e+1}while(n.pos<=t);return r}function gs(e){e.sort(_s)}function _s(e,t){return e[0]-t[0]}let vs=/^data:application\/json(?:;[^,]*)?,/i,ys=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,bs=/* @__PURE__ */ new Map,xs=/* @__PURE__ */ new WeakMap;var Ss=class extends Error{};let Cs=/* @__PURE__ */ new Map,ws=/* @__PURE__ */ new WeakMap,Ts=/* @__PURE__ */ new Set([`chrome-extension:`,`moz-extension:`,`safari-web-extension:`]),Es=/* @__PURE__ */ new Set([`http:`,`https:`,...Ts]),Ds=(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},Os=(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:Ds(s,t,i,a)},ks=(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 Os(i.map.mappings,i.map.sources,a,o,i.map.ignoredSourceIndices,i.map.names)}return Os(e.mappings,e.sources,t-1,n,e.ignoredSourceIndices,e.names)},As=(e,t)=>{if(vs.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}}}},js=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}},Ms=(e,t,n)=>{let r=n.headers.get(`sourcemap`)??n.headers.get(`x-sourcemap`);if(r)return As(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(ys);n&&(i=n[1]||n[2]),a=e-1}return i?As(i,e):js(e)},Ns=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)},Ps=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 Ns(t)!==(typeof n==`string`&&n.length>0)&&typeof i==`number`&&Number.isInteger(i)&&i>=0&&typeof a==`number`&&Number.isInteger(a)&&a>=0})},Fs=e=>{let t=e.ignoreList??e.x_google_ignoreList;return t?.length?new Set(t):void 0},Is=(e,t,n)=>{if(!e||Po.test(t)||t.startsWith(`/`))return t;let r=e.endsWith(`/`)?e:`${e}/`,i=t.replace(/^\.\//,``);try{let e=Po.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(`/`)}},Ls=(e,t)=>e.sources.map(n=>Is(e.sourceRoot,n,t)),Rs=e=>vs.test(e)?void 0:e,zs=(e,t)=>{try{return{file:e.file,ignoredSourceIndices:Fs(e),mappings:hs(e.mappings),names:e.names,sourceMapUrl:Rs(t),sourceRoot:e.sourceRoot,sources:Ls(e,t),sourcesContent:e.sourcesContent,version:3}}catch{return null}},Bs=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?As(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:Fs(s),mappings:hs(s.mappings),sources:Ls(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:Rs(t),sourceRoot:void 0,sources:Array.from(o),sourcesContent:void 0,version:3}},Vs=(e,t=!1)=>{if(!e)return!1;let n=e.trim();if(!n)return!1;let r=n.match(Po);if(!r)return!0;let i=r[0].toLowerCase();return t||Es.has(i)},Hs=()=>typeof window>`u`&&typeof process<`u`&&typeof process.versions?.node==`string`,Us=e=>{try{let t=new URL(e);return(t.protocol===`http:`||t.protocol===`https:`)&&!t.username&&!t.password}catch{return!1}},Ws=e=>{try{return new URL(e).protocol}catch{return null}},Gs=e=>{let t=Ws(e);return t!==null&&Ts.has(t)},Ks=(e,t)=>{try{let n=new URL(e),r=new URL(t);return n.protocol===r.protocol&&n.host===r.host}catch{return!1}},qs=(e,t,n,r)=>{if(vs.test(t))return!0;if(!Vs(t,r))return!1;let i=Ws(e),a=Ws(t),o=i!==null&&!Es.has(i)||a!==null&&!Es.has(a);return!(n||o||Gs(e)||Gs(t))||Ks(e,t)},Js=e=>e===408||e===425||e===429||e>=500,Ys=e=>{if(e.ok)return!0;if(Js(e.status))throw new Ss;return!1},Xs=(e,t,n)=>!n||t.url.length===0||Ks(e,t.url),Zs=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 no(`Source map request timed out`)),e.timeoutMs);return{cleanup:()=>{clearTimeout(r),e.signal?.removeEventListener(`abort`,n)},signal:t.signal}},Qs=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()}},$s=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))},ec=(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`)?$s(i):decodeURIComponent(i);return e===null||new TextEncoder().encode(e).byteLength>t?null:JSON.parse(e)}catch{return null}},tc=async(e,t,n,r,i)=>{if(vs.test(e))return ec(e,r);let a=await t(e,{redirect:i?`error`:`follow`,signal:n});if(!Ys(a)||!Xs(e,a,i))return null;let o=await Qs(a,r);if(o===null)return null;try{return JSON.parse(o)}catch{return null}},nc=async(e,t,n={})=>{let r=t!==void 0;if(!Vs(e,r))return null;let i=Hs(),a=(i||Gs(e))&&!n.allowCrossOriginSourceMap;if(i&&!t&&(!n.allowUnsafeServerFetch||!Us(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=Zs(n);try{let t=await o(e,{redirect:a?`error`:`follow`,signal:l.signal});if(!Ys(t)||!Xs(e,t,a))return null;let n=await Qs(t,s);if(n===null)return null;let i=Ms(e,n,t);if(!i||!qs(e,i,a,r))return null;let u=await tc(i,o,l.signal,c,a);return Ns(u)?zs(u,i):Ps(u)?Bs(u,i,async t=>{if(!qs(e,t,a,r))return null;let n=await tc(t,o,l.signal,c,a);return Ns(n)?n:null}):null}finally{l.cleanup()}},rc=(e,t,n)=>{if(!n)return t;let r=e.get(n);return r||(r=/* @__PURE__ */ new Map,e.set(n,r)),r},ic=e=>rc(xs,bs,e),ac=e=>rc(ws,Cs,e),oc=(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??``}`,sc=async(e,t=!0,n,r={})=>{let i=t&&r.signal===void 0,a=ic(n),o=ac(n),s=oc(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=nc(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},cc=async(e,t=!0,n,r={})=>Promise.all(e.map(async e=>{if(!e.fileName)return e;let i=await sc(e.fileName,t,n,r);if(!i||typeof e.lineNumber!=`number`||typeof e.columnNumber!=`number`)return e;let a=ks(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})),lc=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack==`string`,uc=e=>`tag`in e&&typeof e.tag==`number`,dc=e=>{let t=null;if(co(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}=is(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},fc=()=>{let e=[];for(let t of as())e.push({currentDispatcherRef:t,value:os(t)}),ss(t,null);return e},pc=e=>{for(let{currentDispatcherRef:t,value:n}of e)ss(t,n)},Z=e=>`\n in ${e}`,mc=(e,t,n)=>{if(n){let t=bc(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}]`:``}`)},hc=!1,gc=/* @__PURE__ */ new WeakMap,_c=(e,t)=>{if(!e||hc)return``;let n=gc.get(e);if(n!==void 0)return n;let r=Wo();Go(void 0),hc=!0;let i=fc(),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
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]=
|
|
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]=Yo(n);if(!r?.fileName)break;let i=mo(e);return i&&n.includes(`<anonymous>`)&&(n=n.replace(`<anonymous>`,i)),gc.set(e,n),n}while(a>=1&&o>=0);break}}}finally{hc=!1,Go(r),pc(i),console.error=a,console.warn=o}let s=mo(e),c=s?Z(s):``;return gc.set(e,c),c},vc=(e,t)=>{let n=``,r=Qa(e);switch(e.tag){case r.ActivityComponent:n=Z(`Activity`);break;case r.ClassComponent:n=_c(e.type,!0);break;case r.ForwardRef:n=_c(po(e.type)??e.type,!1);break;case r.FunctionComponent:case r.SimpleMemoComponent:n=_c(po(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},yc=e=>{try{let t=``,n=e,r=null;do{t+=vc(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+=mc(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}`:``}},bc=e=>{let t=e;if(!t)return``;t.startsWith(`Error: react-stack-top-frame
|
|
67
67
|
`)&&(t=t.slice(29));let n=t.indexOf(`
|
|
68
|
-
`);n!==-1&&(t=t.slice(n+1));let r=Math.max(...
|
|
69
|
-
`,r)),r!==-1)t=t.slice(0,r);else return``;return t},tc=e=>!!(e.functionName&&e.fileName&&ac(e.fileName)),nc=(e,t)=>e.fileName===t.fileName&&e.lineNumber===t.lineNumber&&e.columnNumber===t.columnNumber,rc=e=>{let t=/* @__PURE__ */ new Map;for(let n of e){if(!tc(n))continue;let e=n.functionName,r=t.get(e)??[];r.some(e=>nc(e,n))||(r.push(n),t.set(e,r))}return t},ic=(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(xo,`(${a.fileName}:${a.lineNumber}:${a.columnNumber})`)}},ac=e=>go.some(t=>e.startsWith(t)),oc=e=>!e.isServer&&e.fileName&&ac(e.fileName)?{...e,isServer:!0}:e,sc=e=>{let t=[],n=e;for(;n;)if(Ws(n)){let e=n;if(n=e._debugOwner,n&&Us(e)){let{frames:n,isTrusted:r}=Ro(e._debugStack);if(r)for(let e of n)t.push(oc(e))}}else{let e=n;if(n=e.owner,n&&e.debugStack instanceof Error)for(let n of Ro(e.debugStack).frames)t.push({...n,isServer:!0})}return t},cc=e=>{let t=[];return Ha(e,e=>{if(!Us(e))return;let{frames:n,isTrusted:r}=Ro(e._debugStack);r&&t.push(...n)},!0),t},lc=e=>{let t=cc(e),n=ko($s(e)),r=rc(t),i=/* @__PURE__ */ new Map;return n.map(e=>e.source!==void 0&&xo.test(e.source)?ic(e,r,i):e).filter((e,t,n)=>{if(t===0)return!0;let r=n[t-1];return e.functionName!==r.functionName})},uc=async(e,t=!0,n,r={})=>Hs(lc(e),t,n,r),dc=e=>!!e.fileName&&!e.isIgnoreListed,fc=async(e,t=!0,n,r={})=>{let i=sc(e);if(i.length>0){let a=Gs(e)??{};a.functionName=qa(e.type)??a.functionName;let o=await Hs([a,...i],t,n,r);if(o.some((e,t)=>t>0&&dc(e)))return o}return uc(e,t,n,r)},pc=e=>e.split(`/`).filter(Boolean).length,mc=e=>{let t=e.indexOf(`/`,1);if(t===-1)return e;let n=e.slice(0,t);if(pc(n)!==1)return e;let r=e.slice(t);if(!vo.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},hc=e=>{if(!e||_o.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=mc(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 ho)if(t.startsWith(e)){t=t.slice(e.length),e===`file:///`&&(t=`/${t.replace(/^\/+/,``)}`),r=!0;break}}if(!n){let e=t.match(mo);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);bo.test(e)&&(t=t.slice(0,i))}return t},gc=e=>{let t=hc(e);return!(!t||!vo.test(t)||yo.test(t))},_c=Symbol.for(`react.context`),vc=Symbol.for(`react.recoverable`),yc=[],bc=null,xc=Error("Suspense interrupted this render. This error is an internal implementation detail of `use`."),Q=()=>{let e=bc;return e!==null&&(bc=e.next),e},Sc=e=>typeof e==`object`&&!!e&&`then`in e&&typeof e.then==`function`,Cc=e=>typeof e==`object`&&!!e&&`current`in e,wc=e=>typeof e==`object`&&!!e&&`_currentValue`in e,Tc=e=>e._currentValue,$=(e,t,n,r=null,i=null)=>{yc.push({displayName:r,primitive:e,stackError:Error(),value:t,debugInfo:i,dispatcherHookName:n})},Ec=e=>{if(typeof e==`object`&&e){if(Sc(e)){let t=e,n=Sc(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),xc}if(`$$typeof`in e&&e.$$typeof===vc){$(`Recoverable`,void 0,`Use`);return}if(`$$typeof`in e&&e.$$typeof===_c&&wc(e)){let t={_currentValue:e._currentValue,displayName:typeof e.displayName==`string`?e.displayName:void 0},n=Tc(t);return $(`Context (use)`,n,`Use`,t.displayName||`Context`),n}}throw new Pa(`use() received an unsupported value: `+String(e))},Dc=e=>{let t=Tc(e);return $(`Context`,t,`Context`,e.displayName||null),t},Oc=e=>{let t=Q(),n=t===null?typeof e==`function`?e():e:t.memoizedState;return $(`State`,n,`State`),[n,()=>{}]},kc=(e,t,n)=>{let r=Q(),i=r===null?n===void 0?t:n(t):r.memoizedState;return $(`Reducer`,i,`Reducer`),[i,()=>{}]},Ac=e=>{let t=Q(),n=Cc(t?.memoizedState)?t.memoizedState:{current:e};return $(`Ref`,n.current,`Ref`),n},jc=()=>{let e=Q();return $(`CacheRefresh`,e===null?()=>{}:e.memoizedState,`CacheRefresh`),()=>{}},Mc=e=>{Q(),$(`LayoutEffect`,e,`LayoutEffect`)},Nc=e=>{Q(),$(`InsertionEffect`,e,`InsertionEffect`)},Pc=e=>{Q(),$(`Effect`,e,`Effect`)},Fc=e=>{Q();let t=Cc(e)?e.current:void 0;$(`ImperativeHandle`,t,`ImperativeHandle`)},Ic=(e,t)=>{$(`DebugValue`,typeof t==`function`?t(e):e,`DebugValue`)},Lc=e=>{let t=Q();return $(`Callback`,Array.isArray(t?.memoizedState)?t.memoizedState[0]:e,`Callback`),e},Rc=e=>{let t=Q(),n=Array.isArray(t?.memoizedState)?t.memoizedState[0]:e();return $(`Memo`,n,`Memo`),n},zc=(e,t)=>{let n=Q();Q();let r=n===null?t():n.memoizedState;return $(`SyncExternalStore`,r,`SyncExternalStore`),r},Bc=()=>{let e=Q();Q();let t=e?.memoizedState===!0;return $(`Transition`,t,`Transition`),[t,()=>{}]},Vc=e=>{let t=Q(),n=t===null?e:t.memoizedState;return $(`DeferredValue`,n,`DeferredValue`),n},Hc=()=>{let e=Q(),t=typeof e?.memoizedState==`string`?e.memoizedState:``;return $(`Id`,t,`Id`),t},Uc=e=>[],Wc=e=>{let t=Q(),n=t===null?e:t.memoizedState;return $(`Optimistic`,n,`Optimistic`),[n,()=>{}]},Gc=(e,t)=>{let n,r=null,i=null;if(e!==null){let t=e.memoizedState;if(Sc(t))switch(t.status){case`fulfilled`:n=t.value,r=t._debugInfo??null;break;case`rejected`:i=t.reason;break;default:i=xc,n=t,r=t._debugInfo??null}else n=t}else n=t;return{value:n,debugInfo:r,error:i}},Kc=e=>(t,n)=>{let r=Q();Q(),Q();let{value:i,debugInfo:a,error:o}=Gc(r,n);if($(e,i,e,null,a),o!==null)throw o;return[i,()=>{},!1]},qc=Kc(`ActionState`),Jc={readContext:Tc,use:Ec,useCallback:Lc,useContext:Dc,useEffect:Pc,useImperativeHandle:Fc,useLayoutEffect:Mc,useInsertionEffect:Nc,useMemo:Rc,useReducer:kc,useRef:Ac,useState:Oc,useDebugValue:Ic,useDeferredValue:Vc,useTransition:Bc,useSyncExternalStore:zc,useId:Hc,useHostTransitionStatus:()=>{let e=Tc({_currentValue:null});return $(`HostTransitionStatus`,e,`HostTransitionStatus`),e},useFormState:Kc(`FormState`),useActionState:qc,useOptimistic:Wc,useMemoCache:Uc,useCacheRefresh:jc,useEffectEvent:e=>(Q(),$(`EffectEvent`,e,`EffectEvent`),e)};new Proxy(Jc,{get(e,t){if(Object.hasOwn(e,t))return Reflect.get(e,t);throw new Fa(`The React dispatcher is missing method `+t)}});let Yc=e=>{if(!e)return``;let t=e.lastIndexOf(`[as `);if(t!==-1)return Yc(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(Jc)].map(e=>Yc(e.name)));async function Xc(e){let t=e.getBoundingClientRect(),n=window.getSelection()?.toString().trim();return{tagName:e.tagName.toLowerCase(),selector:Qc(e),html:rl(e),text:al(e),components:await ol(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 Zc(e){let t=e.tagName.toLowerCase(),n=ul(e);if(!n)return t;let r=null;return Ha(n,e=>Va(e)?(r=qa(e.type),!(!r||dl(r))):!1,!0),r?`${r} · ${t}`:t}function Qc(e){let t=[],n=e;for(;n&&n!==document.documentElement;){let r=$c(n);if(r){t.unshift(r);let n=t.join(` > `);if(tl(n,e))return n}else{t.unshift(el(n));let r=t.join(` > `);if(t.length>=2&&tl(r,e))return r}n=n.parentElement}return t.join(` > `)}function $c(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 el(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 tl(e,t){try{let n=document.querySelectorAll(e);return n.length===1&&n[0]===t}catch{return!1}}let nl=[`id`,`class`,`href`,`src`,`alt`,`type`,`name`,`role`,`aria-label`];function rl(e){let t=e.tagName.toLowerCase(),n=`<${[t,...[...e.attributes].filter(e=>!e.name.startsWith(`data-tencil`)).sort((e,t)=>il(e.name)-il(t.name)).slice(0,8).map(e=>{let t=e.name===`class`?80:120;return e.value?`${e.name}="${hl(e.value,t)}"`:e.name})].join(` `)}>`,r=e.children.length;return`${n}${r>0?`…${r} element${r===1?``:`s`}…`:hl(e.textContent?.trim()??``,100)}</${t}>`}function il(e){let t=nl.indexOf(e);return t===-1?nl.length:t}function al(e){let t=e.innerText?.replace(/\s+/g,` `).trim();return t?hl(t,200):void 0}async function ol(e){let t=ul(e);if(!t)return[];try{let e=await gl(fc(t),1500),n=sl(t),r=e.filter(e=>e.functionName&&!/^[a-z]/.test(e.functionName)&&!dl(e.functionName)).slice(0,6).map(e=>cl(e,n.get(e.functionName)));if(r.length>0)return r}catch{}return ll(t)}function sl(e){let t=/* @__PURE__ */ new Map;try{for(let n of sc(e))n.functionName&&n.fileName&&!t.has(n.functionName)&&t.set(n.functionName,pl(n.fileName))}catch{}return t}function cl(e,t){let n=e.functionName??`Anonymous`;if(!e.fileName)return{name:n};let r=ml(e.fileName);return r?{name:n,library:r}:gc(e.fileName)?{name:n,source:{file:fl(pl(e.fileName),t),...e.lineNumber==null?{}:{line:e.lineNumber},...e.columnNumber==null?{}:{column:e.columnNumber}}}:{name:n}}function ll(e){let t=[];return Ha(e,e=>{if(Va(e)){let n=qa(e.type);n&&!dl(n)&&t.push({name:n})}return t.length>=6},!0),t}function ul(e){try{return po(e)}catch{return null}}function dl(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 fl(e,t){return e.includes(`/`)||!t?e:t.endsWith(`/${e}`)?t:e}function pl(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 ml(e){return e.match(/node_modules\/(?:\.pnpm\/[^/]+\/node_modules\/)?((?:@[^/]+\/)?[^/]+)/)?.[1]}function hl(e,t){return e.length>t?`${e.slice(0,t-1)}…`:e}function gl(e,t){return Promise.race([e,new Promise((e,n)=>setTimeout(()=>n(/* @__PURE__ */ Error(`timeout`)),t))])}let _l=R(()=>{let e=/* @__PURE__ */ new Map,t=[...$t.value].reverse().filter(e=>e.anchor);for(let[n,r]of t.entries())e.set(r.id,n+1);return e});function vl(){let e=nn.value.flatMap(e=>{let t=_l.value.get(e.id);return t?[{threadId:e.id,number:t}]:[]});e.length!==0&&U({type:`drafts.send`,drafts:e})&&(K.value=e[0]?.threadId??null)}function yl(){if(Wt.value)return null;let e=G.value;return/* @__PURE__ */ Y(C,{children:[en.value.map(e=>/* @__PURE__ */ Y(bl,{thread:e},e.id)),e&&/* @__PURE__ */ Y(El,{})]})}function bl({thread:e}){if(Xt.value,!e.anchor)return null;let t=Yt.value,n=t?.threadId===e.id,r=n?t.point:dn(e.anchor);if(!r)return null;let i=K.value===e.id;return/* @__PURE__ */ Y(`button`,{type:`button`,class:`pin pin-${Dl(e)}${i?` pin-open`:``}${n?` pin-dragging`:``}`,style:{transform:`translate(${r.x}px, ${r.y}px)`},title:e.title,onPointerDown:t=>Sl(t,e,r),onClick:()=>{if(xl===e.id){xl=null;return}G.value=null,K.value=i?null:e.id},children:/* @__PURE__ */ Y(`span`,{class:`pin-body`,children:_l.value.get(e.id)??`•`})})}let xl=null;function Sl(e,t,n){if(e.button!==0)return;e.preventDefault();let r=e.currentTarget;try{r.setPointerCapture(e.pointerId)}catch{}xl=null;let i=e.clientX,a=e.clientY,o=e=>{let r=e.clientX-i,o=e.clientY-a;!Yt.value&&Math.hypot(r,o)<4||(Yt.value={threadId:t.id,point:{x:n.x+r,y:n.y+o}})},s=e=>{r.removeEventListener(`pointermove`,o),r.removeEventListener(`pointerup`,s),r.removeEventListener(`pointercancel`,s),r.removeEventListener(`lostpointercapture`,s),window.removeEventListener(`dragstart`,Cl,!0);let n=Yt.value;n&&(Yt.value=null,xl=t.id,e.type===`pointerup`&&wl(t,n.point))};r.addEventListener(`pointermove`,o),r.addEventListener(`pointerup`,s),r.addEventListener(`pointercancel`,s),r.addEventListener(`lostpointercapture`,s),window.addEventListener(`dragstart`,Cl,!0)}function Cl(e){e.preventDefault()}function wl(e,t){let n=Tl(t);if(!n)return;let r={selector:Qc(n),...fn(n,t)};U({type:`thread.move`,threadId:e.id,anchor:r})&&Pt({...e,anchor:r})}function Tl(e){let t=ln();return document.elementsFromPoint(e.x,e.y).find(e=>e!==t&&e!==document.documentElement)??null}function El(){Xt.value;let e=G.value,t=dn(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 Dl(e){if(e.resolved)return`resolved`;switch(e.status){case`draft`:return`queued`;case`starting`:case`working`:return`working`;case`waiting`:return`waiting`;case`error`:return`error`;default:return`done`}}let Ol=`tencil:open`;function kl(){let[e,t]=N(`page`),n=B.value?.label??`Agent`,r=z.value===`open`&&B.value?.state===`ready`,i=B.value?.id;return ke(()=>{r&&q.value&&e===`provider`&&Rt()},[e,q.value,r,i]),q.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:()=>{q.value=!1},children:/* @__PURE__ */ Y(Pi,{})})]}),e===`provider`?/* @__PURE__ */ Y(jl,{label:n}):/* @__PURE__ */ Y(Al,{scope:e})]}):null}function Al({scope:e}){let t=$t.value.filter(e=>Ut.value||!e.resolved).filter(t=>e===`all`||t.anchor&&t.pageUrl&&Qt(t.pageUrl)===Zt.value);return/* @__PURE__ */ Y(C,{children:[/* @__PURE__ */ Y(`label`,{class:`inbox-filter`,children:[/* @__PURE__ */ Y(`span`,{class:`checkbox`,children:[/* @__PURE__ */ Y(`input`,{type:`checkbox`,class:`checkbox-input`,checked:Ut.value,onChange:e=>{Ut.value=e.target.checked}}),/* @__PURE__ */ Y(Ai,{})]}),`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(Pl,{thread:e},e.id))})]})}function jl({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(Ml,{summary:e},e.id))}):/* @__PURE__ */ Y(`p`,{class:`empty`,children:[`Loading `,e,` threads…`]})}function Ml({summary:e}){let t=wt.value,n=[...H.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=Bt(e);t&&(K.value=t)},children:[/* @__PURE__ */ Y(`span`,{class:`provider-item-project`,children:[t&&/* @__PURE__ */ Y(Nl,{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:Ll(e.status)}):e.background===`monitoring`?/* @__PURE__ */ Y(`span`,{class:`provider-item-state state-monitoring`,children:`Monitoring`}):/* @__PURE__ */ Y(`span`,{class:`provider-item-time`,children:Rl(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(Ci,{agent:e.agent})]})]})}function Nl({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 Pl({thread:e}){let t=!!(e.anchor&&e.pageUrl),n=!t||Qt(e.pageUrl)===Zt.value,r=[...e.messages].reverse().find(e=>e.role===`assistant`);return/* @__PURE__ */ Y(`button`,{type:`button`,class:`inbox-item${K.value===e.id?` active`:``}`,onClick:()=>{if(!n){sessionStorage.setItem(Ol,e.id),location.href=e.pageUrl;return}K.value=e.id,Fl(e)},children:[t?/* @__PURE__ */ Y(`span`,{class:`pin pin-static pin-${Dl(e)}`,children:/* @__PURE__ */ Y(`span`,{class:`pin-body`,children:_l.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,` · `]}),Il(e),` · `,Rl(e.updatedAt)]}),r&&/* @__PURE__ */ Y(`span`,{class:`inbox-item-preview`,children:r.text.slice(0,140)})]})]})}function Fl(e){if(e.anchor)try{document.querySelector(e.anchor.selector)?.scrollIntoView({block:`center`,behavior:`smooth`})}catch{}}function Il(e){if(e.resolved)return`Resolved`;switch(e.status){case`draft`:return`Queued`;case`starting`:return`Starting`;case`working`:return`Working`;case`waiting`:return`Needs input`;case`error`:return`Error`;default:return`Done`}}function Ll(e){switch(e){case`working`:return`Working`;case`waiting`:return`Needs input`;case`error`:return`Error`;default:return`Idle`}}function Rl(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 zl({placeholder:e,initialText:t=``,autoFocus:n,disabled:r,busy:i,onSubmit:a,onCancel:o,children:s}){let[c,l]=N(t),u=je(null);ke(()=>{n&&u.current?.focus({preventScroll:!0})},[n]),ke(()=>{let e=u.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,200)}px`)},[c]);let d=c.trim().length>0&&!r&&!i,f=async()=>{d&&(await a(c.trim()),l(``))};return/* @__PURE__ */ Y(`div`,{class:`prompt-input`,children:[/* @__PURE__ */ Y(`textarea`,{ref:u,rows:1,value:c,placeholder:e,disabled:r,onInput:e=>l(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&!e.shiftKey&&!e.isComposing?(e.preventDefault(),f()):e.key===`Escape`&&(e.preventDefault(),o?.())}}),/* @__PURE__ */ Y(`div`,{class:`prompt-actions`,children:[/* @__PURE__ */ Y(`div`,{class:`prompt-extras`,children:s}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`send`,disabled:!d,onClick:()=>void f(),"aria-label":`Send`,title:`Send (Enter)`,children:i?/* @__PURE__ */ Y(`span`,{class:`spinner`}):/* @__PURE__ */ Y(Oi,{})})]})]})}let Bl=L(null);function Vl(){Xt.value;let e=G.value,t=je(null),[n,r]=N(140),[i,a]=N(!1),[o,s]=N(!1),[c,l]=N(null),u=B.value?.state===`ready`,d=B.value?.id;if(ke(()=>{e&&u&&(Rt(),zt())},[e,u,d]),ke(()=>{Bl.value=null},[d]),Ae(()=>{t.current&&r(t.current.offsetHeight)}),!e)return null;let f=dn(e.anchor,e.element);if(!f)return null;let{left:p,top:m,origin:h}=mn(f,{width:340,height:n}),g=B.value,_=g?.state===`ready`,v=qt.value,y=v?null:Bl.value,b=y?void 0:Hl(g?.id);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(Ii,{}),e.label]}),g&&v&&/* @__PURE__ */ Y(`span`,{class:`composer-provider composer-batch`,children:[`→ Batch · `,nn.value.length,` queued`]}),g&&!v&&/* @__PURE__ */ Y(`button`,{type:`button`,class:`composer-provider${c===`target`?` open`:``}`,onClick:()=>l(c===`target`?null:`target`),title:`Send to a new thread or continue an existing one`,children:[/* @__PURE__ */ Y(`span`,{class:`composer-provider-label`,children:[`→ `,y?y.title:`New ${g.label} thread`]}),/* @__PURE__ */ Y(Bi,{})]})]}),c===`target`&&!v&&/* @__PURE__ */ Y(Wl,{onPick:e=>{Bl.value=e,l(null)}}),c===`model`&&b&&/* @__PURE__ */ Y(Ul,{choices:b,onPick:e=>{U({type:`model.select`,model:e}),l(null)}}),/* @__PURE__ */ Y(zl,{placeholder:v?`Add a comment to the batch…`:_?y?`Continue the thread with this element…`:`What should change here?`:`Waiting for the agent connection…`,autoFocus:!0,busy:o,disabled:!_&&!v,onSubmit:async t=>{s(!0);try{let n=await e.context,r=[];if(i){let t=await vi(e.element,ln());t&&r.push(t)}let a=bt(),o={...e.anchor,selector:n.selector};if(!U({type:`thread.create`,id:a,pageUrl:location.href,prompt:t,anchor:o,context:n,attachments:r,...y?{providerThreadId:y.id}:{},...v?{draft:!0}:{}}))return;let s=(/* @__PURE__ */ new Date()).toISOString();Pt({id:a,title:t,pageUrl:location.href,anchor:o,context:n,status:v?`draft`:y?`working`:`starting`,resolved:!1,messages:[{id:`local:${a}`,role:`user`,text:t,streaming:!1,createdAt:s}],provider:{id:g?.id??`unknown`,...y?{threadId:y.id,url:y.url}:{}},createdAt:s,updatedAt:s}),G.value=null,v?an():K.value=a}finally{s(!1)}},onCancel:()=>{G.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(Fi,{})}),Gt.value&&/* @__PURE__ */ Y(`button`,{type:`button`,class:`toggle${v?` toggle-on`:``}`,onClick:()=>{Kt.value=!v,l(null)},title:v?`Batch on: comments are queued and sent together`:`Queue comments and send them together`,"aria-label":`Batch`,"aria-pressed":v,children:/* @__PURE__ */ Y(zi,{})}),b&&/* @__PURE__ */ Y(`button`,{type:`button`,class:`toggle model-toggle${c===`model`?` open`:``}`,onClick:()=>l(c===`model`?null:`model`),title:`Agent and model for the new thread`,children:[/* @__PURE__ */ Y(Ci,{agent:b.current?.agent,size:12}),/* @__PURE__ */ Y(`span`,{class:`model-toggle-label`,children:b.current?.label??`Default model`}),/* @__PURE__ */ Y(Bi,{})]})]}),!_&&g?.detail&&/* @__PURE__ */ Y(`p`,{class:`hint`,children:g.detail})]})}function Hl(e){let t=Tt.value;if(!t||t.provider!==e||t.models.length===0)return;let n=e=>t.models.find(t=>t.id===e),r=n(V.value?.model),i=n(t.defaultModel);return{models:t.models,current:r??i,picked:r?.id??null,fallback:i}}function Ul({choices:e,onPick:t}){let n=/* @__PURE__ */ new Map;for(let t of e.models)n.set(t.group,[...n.get(t.group)??[],t]);return/* @__PURE__ */ Y(`div`,{class:`target-menu`,role:`listbox`,children:[/* @__PURE__ */ Y(`button`,{type:`button`,role:`option`,"aria-selected":e.picked===null,class:`target-option${e.picked===null?` selected`:``}`,onClick:()=>t(null),children:[/* @__PURE__ */ Y(`span`,{class:`target-option-title`,children:`Default`}),e.fallback&&/* @__PURE__ */ Y(`span`,{class:`target-option-meta`,children:e.fallback.label})]}),[...n].map(([n,r])=>/* @__PURE__ */ Y(C,{children:[/* @__PURE__ */ Y(`p`,{class:`menu-group`,children:[/* @__PURE__ */ Y(Ci,{agent:r[0]?.agent,size:11}),n]}),r.map(n=>/* @__PURE__ */ Y(`button`,{type:`button`,role:`option`,"aria-selected":e.picked===n.id,class:`target-option${e.picked===n.id?` selected`:``}`,onClick:()=>t(n.id),children:/* @__PURE__ */ Y(`span`,{class:`target-option-title`,children:n.label})},n.id))]},n))]})}function Wl({onPick:e}){let t=Ct.value,n=Bl.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(Ci,{agent:t.agent,size:12}),/* @__PURE__ */ Y(`span`,{class:`target-option-meta`,children:Rl(t.updatedAt)})]},t.id))]})}function Gl(){Xt.value;let e=Vt.value;if(W.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:[Zc(e),/* @__PURE__ */ Y(`span`,{class:`highlight-size`,children:[Math.round(t.width),`×`,Math.round(t.height)]})]})]})}function Kl({text:e,animate:t=!1}){let n=t?Zl(e):0;return/* @__PURE__ */ Y(`div`,{class:`md`,children:ql(e,{index:0,animateFrom:t?n-48:1/0})})}function ql(e,t){let n=[],r=e.replace(/\r\n/g,`
|
|
68
|
+
`);n!==-1&&(t=t.slice(n+1));let r=Math.max(...Ho.map(e=>t.indexOf(e)));if(r!==-1&&(r=t.lastIndexOf(`
|
|
69
|
+
`,r)),r!==-1)t=t.slice(0,r);else return``;return t},xc=e=>!!(e.functionName&&e.fileName&&Tc(e.fileName)),Sc=(e,t)=>e.fileName===t.fileName&&e.lineNumber===t.lineNumber&&e.columnNumber===t.columnNumber,Cc=e=>{let t=/* @__PURE__ */ new Map;for(let n of e){if(!xc(n))continue;let e=n.functionName,r=t.get(e)??[];r.some(e=>Sc(e,n))||(r.push(n),t.set(e,r))}return t},wc=(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(Vo,`(${a.fileName}:${a.lineNumber}:${a.columnNumber})`)}},Tc=e=>Io.some(t=>e.startsWith(t)),Ec=e=>!e.isServer&&e.fileName&&Tc(e.fileName)?{...e,isServer:!0}:e,Dc=e=>{let t=[],n=e;for(;n;)if(uc(n)){let e=n;if(n=e._debugOwner,n&&lc(e)){let{frames:n,isTrusted:r}=is(e._debugStack);if(r)for(let e of n)t.push(Ec(e))}}else{let e=n;if(n=e.owner,n&&e.debugStack instanceof Error)for(let n of is(e.debugStack).frames)t.push({...n,isServer:!0})}return t},Oc=e=>{let t=[];return co(e,e=>{if(!lc(e))return;let{frames:n,isTrusted:r}=is(e._debugStack);r&&t.push(...n)},!0),t},kc=e=>{let t=Oc(e),n=Yo(yc(e)),r=Cc(t),i=/* @__PURE__ */ new Map;return n.map(e=>e.source!==void 0&&Vo.test(e.source)?wc(e,r,i):e).filter((e,t,n)=>{if(t===0)return!0;let r=n[t-1];return e.functionName!==r.functionName})},Ac=async(e,t=!0,n,r={})=>cc(kc(e),t,n,r),jc=e=>!!e.fileName&&!e.isIgnoreListed,Mc=async(e,t=!0,n,r={})=>{let i=Dc(e);if(i.length>0){let a=dc(e)??{};a.functionName=mo(e.type)??a.functionName;let o=await cc([a,...i],t,n,r);if(o.some((e,t)=>t>0&&jc(e)))return o}return Ac(e,t,n,r)},Nc=e=>e.split(`/`).filter(Boolean).length,Pc=e=>{let t=e.indexOf(`/`,1);if(t===-1)return e;let n=e.slice(0,t);if(Nc(n)!==1)return e;let r=e.slice(t);if(!Ro.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},Fc=e=>{if(!e||Lo.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=Pc(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 Fo)if(t.startsWith(e)){t=t.slice(e.length),e===`file:///`&&(t=`/${t.replace(/^\/+/,``)}`),r=!0;break}}if(!n){let e=t.match(Po);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);Bo.test(e)&&(t=t.slice(0,i))}return t},Ic=e=>{let t=Fc(e);return!(!t||!Ro.test(t)||zo.test(t))},Lc=Symbol.for(`react.context`),Rc=Symbol.for(`react.recoverable`),zc=[],Bc=null,Vc=Error("Suspense interrupted this render. This error is an internal implementation detail of `use`."),Q=()=>{let e=Bc;return e!==null&&(Bc=e.next),e},Hc=e=>typeof e==`object`&&!!e&&`then`in e&&typeof e.then==`function`,Uc=e=>typeof e==`object`&&!!e&&`current`in e,Wc=e=>typeof e==`object`&&!!e&&`_currentValue`in e,Gc=e=>e._currentValue,$=(e,t,n,r=null,i=null)=>{zc.push({displayName:r,primitive:e,stackError:Error(),value:t,debugInfo:i,dispatcherHookName:n})},Kc=e=>{if(typeof e==`object`&&e){if(Hc(e)){let t=e,n=Hc(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),Vc}if(`$$typeof`in e&&e.$$typeof===Rc){$(`Recoverable`,void 0,`Use`);return}if(`$$typeof`in e&&e.$$typeof===Lc&&Wc(e)){let t={_currentValue:e._currentValue,displayName:typeof e.displayName==`string`?e.displayName:void 0},n=Gc(t);return $(`Context (use)`,n,`Use`,t.displayName||`Context`),n}}throw new eo(`use() received an unsupported value: `+String(e))},qc=e=>{let t=Gc(e);return $(`Context`,t,`Context`,e.displayName||null),t},Jc=e=>{let t=Q(),n=t===null?typeof e==`function`?e():e:t.memoizedState;return $(`State`,n,`State`),[n,()=>{}]},Yc=(e,t,n)=>{let r=Q(),i=r===null?n===void 0?t:n(t):r.memoizedState;return $(`Reducer`,i,`Reducer`),[i,()=>{}]},Xc=e=>{let t=Q(),n=Uc(t?.memoizedState)?t.memoizedState:{current:e};return $(`Ref`,n.current,`Ref`),n},Zc=()=>{let e=Q();return $(`CacheRefresh`,e===null?()=>{}:e.memoizedState,`CacheRefresh`),()=>{}},Qc=e=>{Q(),$(`LayoutEffect`,e,`LayoutEffect`)},$c=e=>{Q(),$(`InsertionEffect`,e,`InsertionEffect`)},el=e=>{Q(),$(`Effect`,e,`Effect`)},tl=e=>{Q();let t=Uc(e)?e.current:void 0;$(`ImperativeHandle`,t,`ImperativeHandle`)},nl=(e,t)=>{$(`DebugValue`,typeof t==`function`?t(e):e,`DebugValue`)},rl=e=>{let t=Q();return $(`Callback`,Array.isArray(t?.memoizedState)?t.memoizedState[0]:e,`Callback`),e},il=e=>{let t=Q(),n=Array.isArray(t?.memoizedState)?t.memoizedState[0]:e();return $(`Memo`,n,`Memo`),n},al=(e,t)=>{let n=Q();Q();let r=n===null?t():n.memoizedState;return $(`SyncExternalStore`,r,`SyncExternalStore`),r},ol=()=>{let e=Q();Q();let t=e?.memoizedState===!0;return $(`Transition`,t,`Transition`),[t,()=>{}]},sl=e=>{let t=Q(),n=t===null?e:t.memoizedState;return $(`DeferredValue`,n,`DeferredValue`),n},cl=()=>{let e=Q(),t=typeof e?.memoizedState==`string`?e.memoizedState:``;return $(`Id`,t,`Id`),t},ll=e=>[],ul=e=>{let t=Q(),n=t===null?e:t.memoizedState;return $(`Optimistic`,n,`Optimistic`),[n,()=>{}]},dl=(e,t)=>{let n,r=null,i=null;if(e!==null){let t=e.memoizedState;if(Hc(t))switch(t.status){case`fulfilled`:n=t.value,r=t._debugInfo??null;break;case`rejected`:i=t.reason;break;default:i=Vc,n=t,r=t._debugInfo??null}else n=t}else n=t;return{value:n,debugInfo:r,error:i}},fl=e=>(t,n)=>{let r=Q();Q(),Q();let{value:i,debugInfo:a,error:o}=dl(r,n);if($(e,i,e,null,a),o!==null)throw o;return[i,()=>{},!1]},pl=fl(`ActionState`),ml={readContext:Gc,use:Kc,useCallback:rl,useContext:qc,useEffect:el,useImperativeHandle:tl,useLayoutEffect:Qc,useInsertionEffect:$c,useMemo:il,useReducer:Yc,useRef:Xc,useState:Jc,useDebugValue:nl,useDeferredValue:sl,useTransition:ol,useSyncExternalStore:al,useId:cl,useHostTransitionStatus:()=>{let e=Gc({_currentValue:null});return $(`HostTransitionStatus`,e,`HostTransitionStatus`),e},useFormState:fl(`FormState`),useActionState:pl,useOptimistic:ul,useMemoCache:ll,useCacheRefresh:Zc,useEffectEvent:e=>(Q(),$(`EffectEvent`,e,`EffectEvent`),e)};new Proxy(ml,{get(e,t){if(Object.hasOwn(e,t))return Reflect.get(e,t);throw new to(`The React dispatcher is missing method `+t)}});let hl=e=>{if(!e)return``;let t=e.lastIndexOf(`[as `);if(t!==-1)return hl(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(ml)].map(e=>hl(e.name)));async function gl(e){let t=e.getBoundingClientRect(),n=window.getSelection()?.toString().trim();return{tagName:e.tagName.toLowerCase(),selector:vl(e),html:Cl(e),text:Tl(e),components:await El(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 _l(e){let t=e.tagName.toLowerCase(),n=Ml(e);if(!n)return t;let r=null;return co(n,e=>so(e)?(r=mo(e.type),!(!r||Nl(r))):!1,!0),r?`${r} · ${t}`:t}function vl(e){let t=[],n=e;for(;n&&n!==document.documentElement;){let r=yl(n);if(r){t.unshift(r);let n=t.join(` > `);if(xl(n,e))return n}else{t.unshift(bl(n));let r=t.join(` > `);if(t.length>=2&&xl(r,e))return r}n=n.parentElement}return t.join(` > `)}function yl(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 bl(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 xl(e,t){try{let n=document.querySelectorAll(e);return n.length===1&&n[0]===t}catch{return!1}}let Sl=[`id`,`class`,`href`,`src`,`alt`,`type`,`name`,`role`,`aria-label`];function Cl(e){let t=e.tagName.toLowerCase(),n=`<${[t,...[...e.attributes].filter(e=>!e.name.startsWith(`data-tencil`)).sort((e,t)=>wl(e.name)-wl(t.name)).slice(0,8).map(e=>{let t=e.name===`class`?80:120;return e.value?`${e.name}="${Ll(e.value,t)}"`:e.name})].join(` `)}>`,r=e.children.length;return`${n}${r>0?`…${r} element${r===1?``:`s`}…`:Ll(e.textContent?.trim()??``,100)}</${t}>`}function wl(e){let t=Sl.indexOf(e);return t===-1?Sl.length:t}function Tl(e){let t=e.innerText?.replace(/\s+/g,` `).trim();return t?Ll(t,200):void 0}async function El(e){let t=Dl(e);if(t.length>0)return t;let n=Ml(e);if(!n)return[];try{let e=await Rl(Mc(n),1500),t=kl(n),r=e.filter(e=>e.functionName&&!/^[a-z]/.test(e.functionName)&&!Nl(e.functionName)).slice(0,6).map(e=>Al(e,t.get(e.functionName)));if(r.length>0)return r}catch{}return jl(n)}function Dl(e){let t=[],n;for(let r=e;r&&t.length<6;r=r.parentElement){let e=r.getAttribute(`data-tencil-src`)?.match(/^(.+):(\d+):(\d+)$/);if(!e)continue;let[,i=``,a,o]=e,s=r.getAttribute(`data-tencil-component`)??Ol(i);s!==n&&(n=s,t.push({name:s,source:{file:i,line:Number(a),column:Number(o)}}))}return t}function Ol(e){return e.slice(e.lastIndexOf(`/`)+1)}function kl(e){let t=/* @__PURE__ */ new Map;try{for(let n of Dc(e))n.functionName&&n.fileName&&!t.has(n.functionName)&&t.set(n.functionName,Fl(n.fileName))}catch{}return t}function Al(e,t){let n=e.functionName??`Anonymous`;if(!e.fileName)return{name:n};let r=Il(e.fileName);return r?{name:n,library:r}:Ic(e.fileName)?{name:n,source:{file:Pl(Fl(e.fileName),t),...e.lineNumber==null?{}:{line:e.lineNumber},...e.columnNumber==null?{}:{column:e.columnNumber}}}:{name:n}}function jl(e){let t=[];return co(e,e=>{if(so(e)){let n=mo(e.type);n&&!Nl(n)&&t.push({name:n})}return t.length>=6},!0),t}function Ml(e){try{return No(e)}catch{return null}}function Nl(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 Pl(e,t){return e.includes(`/`)||!t?e:t.endsWith(`/${e}`)?t:e}function Fl(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 Il(e){return e.match(/node_modules\/(?:\.pnpm\/[^/]+\/node_modules\/)?((?:@[^/]+\/)?[^/]+)/)?.[1]}function Ll(e,t){return e.length>t?`${e.slice(0,t-1)}…`:e}function Rl(e,t){return Promise.race([e,new Promise((e,n)=>setTimeout(()=>n(/* @__PURE__ */ Error(`timeout`)),t))])}let zl=I(()=>{let e=/* @__PURE__ */ new Map,t=[...bn.value].reverse().filter(e=>e.anchor);for(let[n,r]of t.entries())e.set(r.id,n+1);return e});function Bl(){let e=Cn.value.flatMap(e=>{let t=zl.value.get(e.id);return t?[{threadId:e.id,number:t}]:[]});e.length!==0&&U({type:`drafts.send`,drafts:e})&&(K.value=e[0]?.threadId??null)}function Vl(){if(dn.value)return null;let e=G.value;return/* @__PURE__ */ Y(S,{children:[xn.value.map(e=>/* @__PURE__ */ Y(Hl,{thread:e},e.id)),e&&/* @__PURE__ */ Y(Jl,{})]})}function Hl({thread:e}){if(_n.value,!e.anchor)return null;let t=gn.value,n=t?.threadId===e.id,r=n?t.point:jn(e.anchor);if(!r)return null;let i=K.value===e.id;return/* @__PURE__ */ Y(`button`,{type:`button`,class:`pin pin-${Yl(e)}${i?` pin-open`:``}${n?` pin-dragging`:``}`,style:{transform:`translate(${r.x}px, ${r.y}px)`},title:e.title,onPointerDown:t=>Wl(t,e,r),onClick:()=>{if(Ul===e.id){Ul=null;return}G.value=null,K.value=i?null:e.id},children:/* @__PURE__ */ Y(`span`,{class:`pin-body`,children:zl.value.get(e.id)??`•`})})}let Ul=null;function Wl(e,t,n){if(e.button!==0)return;e.preventDefault();let r=e.currentTarget;try{r.setPointerCapture(e.pointerId)}catch{}Ul=null;let i=e.clientX,a=e.clientY,o=e=>{let r=e.clientX-i,o=e.clientY-a;!gn.value&&Math.hypot(r,o)<4||(gn.value={threadId:t.id,point:{x:n.x+r,y:n.y+o}})},s=e=>{r.removeEventListener(`pointermove`,o),r.removeEventListener(`pointerup`,s),r.removeEventListener(`pointercancel`,s),r.removeEventListener(`lostpointercapture`,s),window.removeEventListener(`dragstart`,Gl,!0);let n=gn.value;n&&(gn.value=null,Ul=t.id,e.type===`pointerup`&&Kl(t,n.point))};r.addEventListener(`pointermove`,o),r.addEventListener(`pointerup`,s),r.addEventListener(`pointercancel`,s),r.addEventListener(`lostpointercapture`,s),window.addEventListener(`dragstart`,Gl,!0)}function Gl(e){e.preventDefault()}function Kl(e,t){let n=ql(t);if(!n)return;let r={selector:vl(n),...Mn(n,t)};U({type:`thread.move`,threadId:e.id,anchor:r})&&en({...e,anchor:r})}function ql(e){let t=kn();return document.elementsFromPoint(e.x,e.y).find(e=>e!==t&&e!==document.documentElement)??null}function Jl(){_n.value;let e=G.value,t=jn(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 Yl(e){if(e.resolved)return`resolved`;let t=e.delivery?.status;if(t&&(e.status===`idle`||e.status===`error`))return t===`queued`||t===`deploying`?`working`:t===`failed`||t===`deploy-failed`?`error`:`done`;switch(e.status){case`draft`:return`queued`;case`starting`:case`working`:return`working`;case`waiting`:return`waiting`;case`error`:return`error`;default:return`done`}}let Xl=`tencil:open`;function Zl(){let[e,t]=A(`page`),n=z.value?.label??`Agent`,r=R.value===`open`&&z.value?.state===`ready`,i=z.value?.id;return Me(()=>{r&&q.value&&e===`provider`&&an()},[e,q.value,r,i]),q.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:()=>{q.value=!1},children:/* @__PURE__ */ Y(ea,{})})]}),e===`provider`?/* @__PURE__ */ Y($l,{label:n}):/* @__PURE__ */ Y(Ql,{scope:e})]}):null}function Ql({scope:e}){let t=bn.value.filter(e=>un.value||!e.resolved).filter(t=>e===`all`||t.anchor&&t.pageUrl&&yn(t.pageUrl)===vn.value);return/* @__PURE__ */ Y(S,{children:[/* @__PURE__ */ Y(`label`,{class:`inbox-filter`,children:[/* @__PURE__ */ Y(`span`,{class:`checkbox`,children:[/* @__PURE__ */ Y(`input`,{type:`checkbox`,class:`checkbox-input`,checked:un.value,onChange:e=>{un.value=e.target.checked}}),/* @__PURE__ */ Y(Xi,{})]}),`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(nu,{thread:e},e.id))})]})}function $l({label:e}){let t=zt.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(eu,{summary:e},e.id))}):/* @__PURE__ */ Y(`p`,{class:`empty`,children:[`Loading `,e,` threads…`]})}function eu({summary:e}){let t=Bt.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=sn(e);t&&(K.value=t)},children:[/* @__PURE__ */ Y(`span`,{class:`provider-item-project`,children:[t&&/* @__PURE__ */ Y(tu,{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:au(e.status)}):e.background===`monitoring`?/* @__PURE__ */ Y(`span`,{class:`provider-item-state state-monitoring`,children:`Monitoring`}):/* @__PURE__ */ Y(`span`,{class:`provider-item-time`,children:ou(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(Ui,{agent:e.agent})]})]})}function tu({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 nu({thread:e}){let t=!!(e.anchor&&e.pageUrl),n=!t||yn(e.pageUrl)===vn.value,r=[...e.messages].reverse().find(e=>e.role===`assistant`);return/* @__PURE__ */ Y(`button`,{type:`button`,class:`inbox-item${K.value===e.id?` active`:``}`,onClick:()=>{if(!n){sessionStorage.setItem(Xl,e.id),location.href=e.pageUrl;return}K.value=e.id,ru(e)},children:[t?/* @__PURE__ */ Y(`span`,{class:`pin pin-static pin-${Yl(e)}`,children:/* @__PURE__ */ Y(`span`,{class:`pin-body`,children:zl.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,` · `]}),iu(e),` · `,ou(e.updatedAt)]}),r&&/* @__PURE__ */ Y(`span`,{class:`inbox-item-preview`,children:r.text.slice(0,140)})]})]})}function ru(e){if(e.anchor)try{document.querySelector(e.anchor.selector)?.scrollIntoView({block:`center`,behavior:`smooth`})}catch{}}function iu(e){if(e.resolved)return`Resolved`;switch(e.status){case`draft`:return`Queued`;case`starting`:return`Starting`;case`working`:return`Working`;case`waiting`:return`Needs input`;case`error`:return`Error`;default:return`Done`}}function au(e){switch(e){case`working`:return`Working`;case`waiting`:return`Needs input`;case`error`:return`Error`;default:return`Idle`}}function ou(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 su({placeholder:e,initialText:t=``,autoFocus:n,disabled:r,busy:i,onSubmit:a,onCancel:o,children:s}){let[c,l]=A(t),u=j(null);Me(()=>{n&&u.current?.focus({preventScroll:!0})},[n]),Me(()=>{let e=u.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,200)}px`)},[c]);let d=c.trim().length>0&&!r&&!i,f=async()=>{d&&(await a(c.trim()),l(``))};return/* @__PURE__ */ Y(`div`,{class:`prompt-input`,children:[/* @__PURE__ */ Y(`textarea`,{ref:u,rows:1,value:c,placeholder:e,disabled:r,onInput:e=>l(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&!e.shiftKey&&!e.isComposing?(e.preventDefault(),f()):e.key===`Escape`&&(e.preventDefault(),o?.())}}),/* @__PURE__ */ Y(`div`,{class:`prompt-actions`,children:[/* @__PURE__ */ Y(`div`,{class:`prompt-extras`,children:s}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`send`,disabled:!d,onClick:()=>void f(),"aria-label":`Send`,title:`Send (Enter)`,children:i?/* @__PURE__ */ Y(`span`,{class:`spinner`}):/* @__PURE__ */ Y(Ji,{})})]})]})}let cu=F(null);function lu(){_n.value;let e=G.value,t=j(null),[n,r]=A(140),[i,a]=A(!1),[o,s]=A(!1),[c,l]=A(null),u=z.value?.state===`ready`,d=z.value?.id;if(Me(()=>{e&&u&&(an(),on())},[e,u,d]),Me(()=>{cu.value=null},[d]),Ne(()=>{t.current&&r(t.current.offsetHeight)}),!e)return null;let f=jn(e.anchor,e.element);if(!f)return null;let{left:p,top:m,origin:h}=Pn(f,{width:340,height:n}),g=z.value,_=g?.state===`ready`,v=mn.value,y=v?null:cu.value,b=y?void 0:uu(g?.id);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(na,{}),e.label]}),g&&v&&/* @__PURE__ */ Y(`span`,{class:`composer-provider composer-batch`,children:[`→ Batch · `,Cn.value.length,` queued`]}),g&&!v&&/* @__PURE__ */ Y(`button`,{type:`button`,class:`composer-provider${c===`target`?` open`:``}`,onClick:()=>l(c===`target`?null:`target`),title:`Send to a new thread or continue an existing one`,children:[/* @__PURE__ */ Y(`span`,{class:`composer-provider-label`,children:[`→ `,y?y.title:`New ${g.label} thread`]}),/* @__PURE__ */ Y(oa,{})]})]}),c===`target`&&!v&&/* @__PURE__ */ Y(fu,{onPick:e=>{cu.value=e,l(null)}}),c===`model`&&b&&/* @__PURE__ */ Y(du,{choices:b,onPick:e=>{U({type:`model.select`,model:e}),l(null)}}),/* @__PURE__ */ Y(su,{placeholder:v?`Add a comment to the batch…`:_?y?`Continue the thread with this element…`:`What should change here?`:`Waiting for the agent connection…`,autoFocus:!0,busy:o,disabled:!_&&!v,onSubmit:async t=>{s(!0);try{let n=await e.context,r=[];if(i){let t=await Ri(e.element,kn());t&&r.push(t)}let a=It(),o={...e.anchor,selector:n.selector};if(!U({type:`thread.create`,id:a,pageUrl:location.href,prompt:t,anchor:o,context:n,attachments:r,...y?{providerThreadId:y.id}:{},...v?{draft:!0}:{}}))return;let s=(/* @__PURE__ */ new Date()).toISOString();en({id:a,title:t,pageUrl:location.href,anchor:o,context:n,status:v?`draft`:y?`working`:`starting`,resolved:!1,messages:[{id:`local:${a}`,role:`user`,text:t,streaming:!1,createdAt:s}],provider:{id:g?.id??`unknown`,...y?{threadId:y.id,url:y.url}:{}},createdAt:s,updatedAt:s}),G.value=null,v?Tn():K.value=a}finally{s(!1)}},onCancel:()=>{G.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(ta,{})}),fn.value&&/* @__PURE__ */ Y(`button`,{type:`button`,class:`toggle${v?` toggle-on`:``}`,onClick:()=>{pn.value=!v,l(null)},title:v?`Batch on: comments are queued and sent together`:`Queue comments and send them together`,"aria-label":`Batch`,"aria-pressed":v,children:/* @__PURE__ */ Y(aa,{})}),b&&/* @__PURE__ */ Y(`button`,{type:`button`,class:`toggle model-toggle${c===`model`?` open`:``}`,onClick:()=>l(c===`model`?null:`model`),title:`Agent and model for the new thread`,children:[/* @__PURE__ */ Y(Ui,{agent:b.current?.agent,size:12}),/* @__PURE__ */ Y(`span`,{class:`model-toggle-label`,children:b.current?.label??`Default model`}),/* @__PURE__ */ Y(oa,{})]})]}),!_&&g?.detail&&/* @__PURE__ */ Y(`p`,{class:`hint`,children:g.detail})]})}function uu(e){let t=Vt.value;if(!t||t.provider!==e||t.models.length===0)return;let n=e=>t.models.find(t=>t.id===e),r=n(B.value?.model),i=n(t.defaultModel);return{models:t.models,current:r??i,picked:r?.id??null,fallback:i}}function du({choices:e,onPick:t}){let n=/* @__PURE__ */ new Map;for(let t of e.models)n.set(t.group,[...n.get(t.group)??[],t]);return/* @__PURE__ */ Y(`div`,{class:`target-menu`,role:`listbox`,children:[/* @__PURE__ */ Y(`button`,{type:`button`,role:`option`,"aria-selected":e.picked===null,class:`target-option${e.picked===null?` selected`:``}`,onClick:()=>t(null),children:[/* @__PURE__ */ Y(`span`,{class:`target-option-title`,children:`Default`}),e.fallback&&/* @__PURE__ */ Y(`span`,{class:`target-option-meta`,children:e.fallback.label})]}),[...n].map(([n,r])=>/* @__PURE__ */ Y(S,{children:[/* @__PURE__ */ Y(`p`,{class:`menu-group`,children:[/* @__PURE__ */ Y(Ui,{agent:r[0]?.agent,size:11}),n]}),r.map(n=>/* @__PURE__ */ Y(`button`,{type:`button`,role:`option`,"aria-selected":e.picked===n.id,class:`target-option${e.picked===n.id?` selected`:``}`,onClick:()=>t(n.id),children:/* @__PURE__ */ Y(`span`,{class:`target-option-title`,children:n.label})},n.id))]},n))]})}function fu({onPick:e}){let t=zt.value,n=cu.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(Ui,{agent:t.agent,size:12}),/* @__PURE__ */ Y(`span`,{class:`target-option-meta`,children:ou(t.updatedAt)})]},t.id))]})}function pu(){_n.value;let e=cn.value;if(W.value!==`picking`||!e)return null;let t=e.getBoundingClientRect(),n=t.top<28;return/* @__PURE__ */ Y(S,{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:[_l(e),/* @__PURE__ */ Y(`span`,{class:`highlight-size`,children:[Math.round(t.width),`×`,Math.round(t.height)]})]})]})}function mu({text:e,animate:t=!1}){let n=t?yu(e):0;return/* @__PURE__ */ Y(`div`,{class:`md`,children:hu(e,{index:0,animateFrom:t?n-48:1/0})})}function hu(e,t){let n=[],r=e.replace(/\r\n/g,`
|
|
70
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+=
|
|
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+=yu(e.join(`
|
|
72
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:Yl(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:Yl(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:Yl(s.join(` `),t)},a++))}return n}let Jl=/(`[^`]+`|\*\*[^*]+\*\*|\[[^\]]+\]\([^)\s]+\))/g;function Yl(e,t){return e.split(Jl).map((e,n)=>{if(e.startsWith("`")&&e.endsWith("`")&&e.length>1)return t.index+=Zl(e),/* @__PURE__ */ Y(`code`,{children:e.slice(1,-1)},n);if(e.startsWith(`**`)&&e.endsWith(`**`)&&e.length>3)return/* @__PURE__ */ Y(`strong`,{children:Xl(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:Xl(r[1],t)},n):Xl(e,t)})}function Xl(e,t){return t.animateFrom===1/0?(t.index+=Zl(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 Zl(e){let t=e.match(/\S+/g);return t?t.length:0}function Ql(){Xt.value;let e=K.value,t=e?H.value.get(e):void 0,n=je(null),[r,i]=N(320);if(Ae(()=>{n.current&&i(n.current.offsetHeight)}),!t)return null;let a=Yt.value,o=a?.threadId===t.id?a.point:t.anchor?dn(t.anchor):null,{left:s,top:c,origin:l}=o?mn(o,{width:380,height:r}):{left:window.innerWidth-380-(q.value?372:16),top:16,origin:`top right`};return/* @__PURE__ */ Y(`div`,{ref:n,class:`popover thread${o?``:` thread-docked`}`,style:{left:`${s}px`,top:`${c}px`,width:`380px`,transformOrigin:l},children:[/* @__PURE__ */ Y(eu,{thread:t}),t.status===`draft`?/* @__PURE__ */ Y($l,{thread:t}):/* @__PURE__ */ Y(C,{children:[/* @__PURE__ */ Y(tu,{thread:t},t.id),/* @__PURE__ */ Y(iu,{thread:t}),/* @__PURE__ */ Y(zl,{placeholder:t.provider.threadId?`Reply…`:`Waiting for the agent…`,disabled:!t.provider.threadId,onSubmit:e=>{U({type:`thread.reply`,threadId:t.id,text:e})},onCancel:()=>{K.value=null}})]})]})}function $l({thread:e}){let t=e.messages[0]?.text??``,n=nn.value.length;return/* @__PURE__ */ Y(C,{children:[/* @__PURE__ */ Y(`div`,{class:`status-line status-queued`,children:[e.statusDetail?/* @__PURE__ */ Y(`span`,{class:`status-error`,children:[`Couldn't send: `,e.statusDetail]}):`Queued with ${n===1?`no other comments`:`${n-1} other ${n===2?`comment`:`comments`}`}`,/* @__PURE__ */ Y(`button`,{type:`button`,class:`stop`,onClick:vl,children:[`Send `,n===1?`it`:`all ${n}`,` now`]})]}),/* @__PURE__ */ Y(zl,{initialText:t,placeholder:`What should change here?`,onSubmit:n=>{n!==t&&U({type:`thread.edit`,threadId:e.id,prompt:n}),K.value=null},onCancel:()=>{K.value=null}},`${e.id}:${t}`)]})}function eu({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:[`#`,_l.value.get(e.id)]}),/* @__PURE__ */ Y(`span`,{class:`chip`,title:t.selector,children:[/* @__PURE__ */ Y(Ii,{}),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 ${Lt(e.provider.id)}`,children:/* @__PURE__ */ Y(Ni,{})}),e.status!==`draft`&&/* @__PURE__ */ Y(`button`,{type:`button`,class:`icon-button`,title:e.resolved?`Reopen`:`Resolve`,onClick:()=>{U({type:`thread.resolve`,threadId:e.id,resolved:!e.resolved}),e.resolved||(K.value=null)},children:e.resolved?/* @__PURE__ */ Y(ji,{}):/* @__PURE__ */ Y(Ai,{})}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`icon-button`,title:`Delete pin (keeps the agent thread)`,onClick:()=>{U({type:`thread.delete`,threadId:e.id}),K.value=null},children:/* @__PURE__ */ Y(Mi,{})}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`icon-button`,title:`Close (Esc)`,onClick:()=>{K.value=null},children:/* @__PURE__ */ Y(Pi,{})})]})]})}function tu({thread:e}){let t=je(null),n=je(null),r=je(!0),[i,a]=N(!1),o=e.messages[e.messages.length-1];return Ae(()=>{o?.role===`user`&&(r.current=!0)},[o?.id]),Ae(()=>{let e=t.current,i=n.current;if(!e||!i)return;let a=()=>{r.current&&(e.scrollTop=e.scrollHeight)};a();let o=new ResizeObserver(a);return o.observe(e),o.observe(i),()=>o.disconnect()},[]),/* @__PURE__ */ Y(`div`,{ref:t,class:`messages`,"data-scrolled":i||void 0,onScroll:e=>{let t=e.currentTarget;r.current=t.scrollHeight-t.scrollTop-t.clientHeight<24,a(t.scrollTop>4)},children:/* @__PURE__ */ Y(`div`,{ref:n,class:`messages-list`,children:e.messages.map(e=>e.role===`user`?/* @__PURE__ */ Y(`div`,{class:`message message-user`,children:e.text},e.id):/* @__PURE__ */ Y(nu,{message:e},e.id))})})}function nu({message:e}){let[t]=N(e.streaming);return/* @__PURE__ */ Y(`div`,{class:`message message-assistant`,children:/* @__PURE__ */ Y(Kl,{text:e.text,animate:t})})}function ru({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 iu({thread:e}){return e.status===`starting`?/* @__PURE__ */ Y(`div`,{class:`status-line`,children:[/* @__PURE__ */ Y(`span`,{class:`live-dot`}),/* @__PURE__ */ Y(ru,{text:`Starting a thread in ${Lt(e.provider.id)}…`})]}):e.status===`working`?/* @__PURE__ */ Y(`div`,{class:`status-line`,children:[/* @__PURE__ */ Y(`span`,{class:`live-dot`}),/* @__PURE__ */ Y(ru,{text:`Working…`}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`stop`,onClick:()=>U({type:`thread.interrupt`,threadId:e.id}),children:[/* @__PURE__ */ Y(ki,{}),` 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 au=`tencil:dock`,ou=[`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`],su,cu=L(lu());function lu(){try{let e=localStorage.getItem(au);return e&&ou.includes(e)?e:`bottom-center`}catch{return`bottom-center`}}function uu(e){cu.value=e;try{localStorage.setItem(au,e)}catch{}}function du(e,t,n,r){let i=e<n/3?`left`:e>n*2/3?`right`:`center`;return`${t<r/2?`top`:`bottom`}-${i}`}function fu(e,t){if(e.button!==0)return;e.preventDefault();let n=e.currentTarget;try{n.setPointerCapture(e.pointerId)}catch{}let[r,i]=gu(t);su?.(),t.style.transition=`none`,t.style.translate=`${r}px ${i}px`;let a=e.clientX,o=e.clientY,s=r!==0||i!==0,c=[],l=e=>{let n=e.clientX-a,l=e.clientY-o;!s&&Math.hypot(n,l)<3||(s=!0,t.dataset.dragging=``,t.style.translate=`${r+n}px ${i+l}px`,c=[...c.filter(t=>e.timeStamp-t.t<80),{x:e.clientX,y:e.clientY,t:e.timeStamp}])},u=e=>{if(n.removeEventListener(`pointermove`,l),n.removeEventListener(`pointerup`,u),n.removeEventListener(`pointercancel`,u),n.removeEventListener(`lostpointercapture`,u),window.removeEventListener(`dragstart`,pu,!0),delete t.dataset.dragging,!s){t.style.translate=``,t.style.transition=``;return}c=c.filter(t=>e.timeStamp-t.t<80);let r=c[0],i=c[c.length-1],a=r&&i?Math.max(1,i.t-r.t):1,o=e=>Math.max(-2.5,Math.min(2.5,e/a)),d=r&&i?o(i.x-r.x):0,f=r&&i?o(i.y-r.y):0,p=_u(t);hu(t,p,du(p.left+p.width/2+d*120,p.top+p.height/2+f*120,window.innerWidth,window.innerHeight))};n.addEventListener(`pointermove`,l),n.addEventListener(`pointerup`,u),n.addEventListener(`pointercancel`,u),n.addEventListener(`lostpointercapture`,u),window.addEventListener(`dragstart`,pu,!0)}function pu(e){e.preventDefault()}function mu(e,t){let[n,r]=cu.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?(uu(o),t.style.translate=``,!0):!1}function hu(e,t,n){uu(n);let r=0,i,a=()=>{cancelAnimationFrame(r),clearTimeout(i),e.removeEventListener(`transitionend`,o),su=void 0,e.style.transition=``,e.style.translate=``},o=t=>{t.target===e&&t.propertyName===`translate`&&a()};su=()=>{cancelAnimationFrame(r),clearTimeout(i),e.removeEventListener(`transitionend`,o),su=void 0},r=requestAnimationFrame(()=>{e.style.translate=``;let n=_u(e);if(e.style.translate=`${t.left-n.left}px ${t.top-n.top}px`,matchMedia(`(prefers-reduced-motion: reduce)`).matches){a();return}r=requestAnimationFrame(()=>{e.style.transition=`translate 340ms cubic-bezier(0.32, 0.72, 0, 1)`,e.style.translate=`0px 0px`,e.addEventListener(`transitionend`,o),i=setTimeout(a,440)})})}function gu(e){let t=getComputedStyle(e).translate;if(!t||t===`none`)return[0,0];let[n=`0`,r=`0`]=t.split(` `);return[Number.parseFloat(n)||0,Number.parseFloat(r)||0]}function _u(e){return(e.querySelector(`.toolbar`)??e).getBoundingClientRect()}let vu=L(null);function yu(){let e=()=>{let e=xu(),t=vu.value;Su(e,t)||(vu.value=e)};e();let t=setInterval(e,500);return window.addEventListener(`resize`,e,{passive:!0}),()=>{clearInterval(t),window.removeEventListener(`resize`,e)}}function bu(e,t){return!t||e.endsWith(`center`)||du((t.left+t.right)/2,(t.top+t.bottom)/2,window.innerWidth,window.innerHeight)!==e?{}:e.endsWith(`left`)?{left:`${t.right+8}px`}:{right:`${window.innerWidth-t.left+8}px`}}function xu(){for(let e of document.querySelectorAll(`nextjs-portal`)){let t=e.shadowRoot?.getElementById(`devtools-indicator`);if(!t)continue;let n=t.getBoundingClientRect();if(n.width!==0&&n.height!==0)return{left:n.left,top:n.top,right:n.right,bottom:n.bottom}}return null}function Su(e,t){return!e||!t?e===t:Math.round(e.left)===Math.round(t.left)&&Math.round(e.top)===Math.round(t.top)&&Math.round(e.right)===Math.round(t.right)&&Math.round(e.bottom)===Math.round(t.bottom)}function Cu(){let[e,t]=N(``),n=Et.value??[],r=e.trim().toLowerCase(),i=r?n.filter(e=>e.title.toLowerCase().includes(r)||e.root.toLowerCase().includes(r)):n,a=e=>U({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:Dt.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 wu(){if(!Ht.value)return null;let e=V.value,t=B.value,n=()=>{Ht.value=!1};return/* @__PURE__ */ Y(`section`,{class:`settings-panel`,role:`dialog`,"aria-label":`Project settings`,onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),n())},children:[/* @__PURE__ */ Y(`header`,{class:`settings-header`,children:[/* @__PURE__ */ Y(`div`,{class:`settings-heading`,children:[/* @__PURE__ */ Y(`strong`,{children:`Settings`}),xt.value&&/* @__PURE__ */ Y(`span`,{class:`settings-project`,children:xt.value.name})]}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`icon-button`,title:`Close (Esc)`,onClick:n,children:/* @__PURE__ */ Y(Pi,{})})]}),e?/* @__PURE__ */ Y(C,{children:[/* @__PURE__ */ Y(`div`,{class:`settings-section`,children:[/* @__PURE__ */ Y(`p`,{class:`settings-label`,id:`tencil-provider-label`,children:`Agent for new pins`}),/* @__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:()=>U({type:`settings.update`,provider:n.id})}),/* @__PURE__ */ Y(Ci,{agent:n.id,size:14,decorative:!0}),/* @__PURE__ */ Y(`span`,{class:`target-option-title`,children:n.label}),r&&t?.id===n.id&&/* @__PURE__ */ Y(`span`,{class:`target-option-meta`,children:Tu(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:`settings-help`,children:`Pins you already made keep their agent.`})]}),/* @__PURE__ */ Y(`label`,{class:`settings-section settings-switch-row`,children:[/* @__PURE__ */ Y(`span`,{class:`settings-switch-text`,children:[/* @__PURE__ */ Y(`span`,{class:`settings-label`,children:`Batch mode`}),/* @__PURE__ */ Y(`span`,{class:`settings-help`,children:[`Adds `,/* @__PURE__ */ Y(zi,{}),` to the comment box to queue comments and send them together.`]})]}),/* @__PURE__ */ Y(`input`,{type:`checkbox`,role:`switch`,class:`settings-switch`,checked:e.batch,"aria-checked":e.batch,onChange:e=>Jt(e.currentTarget.checked)})]})]}):/* @__PURE__ */ Y(`p`,{class:`empty`,children:`Connecting…`})]})}function Tu(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 Eu({tone:e,label:t}){let[n,r]=N(!1),i=je(void 0);ke(()=>()=>clearTimeout(i.current),[]);let a=e=>{clearTimeout(i.current),i.current=setTimeout(()=>r(!0),e)},o=()=>{clearTimeout(i.current),r(!1)};return/* @__PURE__ */ Y(`span`,{class:`status`,onPointerEnter:()=>a(250),onPointerLeave:o,children:[/* @__PURE__ */ Y(`button`,{type:`button`,class:`status-button`,"aria-label":`Tencil status: ${t}`,"aria-expanded":n,"aria-describedby":n?`tencil-status-card`:void 0,onFocus:()=>a(0),onBlur:o,onClick:()=>n?o():a(0),children:/* @__PURE__ */ Y(`span`,{class:`status-dot status-${e}`,children:rn.value>0&&/* @__PURE__ */ Y(`span`,{class:`status-ping`})})}),n&&/* @__PURE__ */ Y(Du,{tone:e})]})}function Du({tone:e}){let t=B.value,n=z.value,r=nn.value.length,i=rn.value;return/* @__PURE__ */ Y(`div`,{class:`status-card`,role:`tooltip`,id:`tencil-status-card`,children:[/* @__PURE__ */ Y(`div`,{class:`status-card-head`,children:[/* @__PURE__ */ Y(Ri,{size:18}),/* @__PURE__ */ Y(`strong`,{children:`Tencil`}),St.value&&/* @__PURE__ */ Y(`span`,{class:`status-card-muted`,children:[`v`,St.value]})]}),/* @__PURE__ */ Y(`dl`,{class:`status-card-rows`,children:[/* @__PURE__ */ Y(Ou,{label:`Daemon`,children:[/* @__PURE__ */ Y(`span`,{class:`status-card-tone tone-${n===`open`?`ok`:e}`}),n===`open`?`Connected`:n===`connecting`?`Connecting…`:`Offline`]}),/* @__PURE__ */ Y(Ou,{label:`Address`,children:Nt()}),/* @__PURE__ */ Y(Ou,{label:`Project`,children:Et.value?`Not picked yet`:xt.value?/* @__PURE__ */ Y(`span`,{title:xt.value.root,children:xt.value.name}):`…`}),/* @__PURE__ */ Y(Ou,{label:`Agent`,children:t?/* @__PURE__ */ Y(C,{children:[/* @__PURE__ */ Y(`span`,{class:`status-card-tone tone-${t.state===`ready`?`ok`:e}`}),t.label,/* @__PURE__ */ Y(`span`,{class:`status-card-muted`,children:Tu(t)})]}):`…`}),t?.target&&/* @__PURE__ */ Y(Ou,{label:`Workspace`,children:t.target}),(i>0||r>0)&&/* @__PURE__ */ Y(Ou,{label:`Pins`,children:[i>0&&`${i} working`,r>0&&`${r} queued`].filter(Boolean).join(` · `)})]}),t&&t.state!==`ready`&&t.detail&&/* @__PURE__ */ Y(`p`,{class:`status-card-detail`,children:t.detail})]})}function Ou({label:e,children:t}){return/* @__PURE__ */ Y(`div`,{class:`status-card-row`,children:[/* @__PURE__ */ Y(`dt`,{children:e}),/* @__PURE__ */ Y(`dd`,{children:t})]})}function ku(){let e=ju(),t=W.value===`picking`,n=je(null);return/* @__PURE__ */ Y(`div`,{ref:n,class:`toolbar-wrap dock-${cu.value}`,style:bu(cu.value,vu.value),children:[t&&/* @__PURE__ */ Y(`div`,{class:`toolbar-hint`,children:`Click any element to pin a prompt · Esc to cancel`}),!t&&/* @__PURE__ */ Y(wu,{}),!t&&Et.value&&/* @__PURE__ */ Y(Cu,{}),!t&&!Et.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(Eu,{tone:e.tone,label:e.title}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`divider`,"aria-label":`Move toolbar (drag, or use arrow keys)`,title:`Drag to move`,onPointerDown:e=>n.current&&fu(e,n.current),onKeyDown:e=>{n.current&&mu(e.key,n.current)&&e.preventDefault()}}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`tool${t?` tool-active`:``}`,title:`Comment (C)`,onClick:()=>t?on():an(),children:[/* @__PURE__ */ Y(wi,{}),/* @__PURE__ */ Y(`span`,{class:`tool-label`,children:`Comment`}),/* @__PURE__ */ Y(`kbd`,{children:`C`})]}),nn.value.length>0&&/* @__PURE__ */ Y(`button`,{type:`button`,class:`tool tool-send`,title:`Send the queued comments to the agent as one thread`,disabled:B.value?.state!==`ready`,onClick:vl,children:[/* @__PURE__ */ Y(Oi,{}),/* @__PURE__ */ Y(`span`,{class:`tool-label`,children:[`Send `,nn.value.length]})]}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`tool${q.value?` tool-active`:``}`,title:`Pins`,onClick:()=>{q.value=!q.value,Ht.value=!1},children:[/* @__PURE__ */ Y(Ti,{}),tn.value>0&&/* @__PURE__ */ Y(`span`,{class:`badge`,children:tn.value})]}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`tool`,title:Wt.value?`Show pins`:`Hide pins`,onClick:()=>{Wt.value=!Wt.value,Wt.value&&on()},children:Wt.value?/* @__PURE__ */ Y(Ei,{}):/* @__PURE__ */ Y(Di,{})}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`tool${Ht.value?` tool-active`:``}`,title:`Project settings`,disabled:!xt.value,onClick:()=>{Ht.value=!Ht.value,q.value=!1},children:/* @__PURE__ */ Y(Li,{})})]})]})}let Au={label:`Switch agent`,run:()=>{Ht.value=!0,q.value=!1}};function ju(){if(z.value!==`open`)return{tone:`error`,title:`Tencil daemon offline`,hint:z.value===`connecting`?void 0:`The Tencil daemon stopped. Start it again with npx tencil start.`};if(Et.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:()=>U({type:`provider.pair`})}}:{tone:`warn`,title:`${e.label}: not signed in`,hint:e.detail??`Sign in to ${e.label}`,action:Au};case`unavailable`:return{tone:`error`,title:e.detail??`${e.label} unavailable`,hint:e.detail??`${e.label} is unavailable`,action:Au};default:return{tone:`warn`,title:`Connecting to ${e.label}…`}}}function Mu(){return Pu(),/* @__PURE__ */ Y(`div`,{class:`root${W.value===`picking`?` picking`:``}`,children:[/* @__PURE__ */ Y(Gl,{}),/* @__PURE__ */ Y(yl,{}),/* @__PURE__ */ Y(Vl,{}),/* @__PURE__ */ Y(Ql,{}),/* @__PURE__ */ Y(kl,{}),/* @__PURE__ */ Y(Nu,{}),/* @__PURE__ */ Y(ku,{})]})}function Nu(){let e=Ot.value,[t,n]=N(!1);return ke(()=>{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 Pu(){let e=H.value;ke(()=>{let t=sessionStorage.getItem(Ol);if(!t)return;let n=e.get(t);n&&(sessionStorage.removeItem(Ol),K.value=t,Fl(n))},[e])}let Fu=[`pointerdown`,`pointerup`,`mousedown`,`mouseup`,`dblclick`,`contextmenu`,`auxclick`];function Iu(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=>{W.value===`picking`&&(Vt.value=t(e)?null:n(e.clientX,e.clientY))},i=e=>{if(W.value===`idle`&&e.type===`pointerdown`&&!t(e)){Ht.value=!1,(K.value?H.value.get(K.value):void 0)?.anchor&&(K.value=null);return}W.value!==`picking`||t(e)||(e.preventDefault(),e.stopImmediatePropagation())},a=e=>{if(W.value!==`picking`||t(e))return;e.preventDefault(),e.stopImmediatePropagation();let r=n(e.clientX,e.clientY);if(!r)return;on();let i=Xc(r);G.value={element:r,label:Zc(r),anchor:{selector:``,...fn(r,{x:e.clientX,y:e.clientY})},context:i}},o=e=>{if(!t(e)){if(e.key===`Escape`){if(W.value===`picking`)on();else if(G.value)G.value=null;else if(K.value)K.value=null;else if(q.value)q.value=!1;else return;e.preventDefault();return}Lu(e)||e.key.toLowerCase()===`c`&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&(e.preventDefault(),Wt.value=!1,W.value===`picking`?on():an())}},s=0,c=()=>{s||=requestAnimationFrame(()=>{s=0,Xt.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=Qt(location.href);e!==Zt.value&&(Zt.value=e,G.value=null,K.value=null)},400);window.addEventListener(`pointermove`,r,{capture:!0,passive:!0});for(let e of Fu)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 Fu)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 Lu(e){let t=e.composedPath()[0];return t instanceof HTMLElement?t.isContentEditable||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement:!1}function Ru(){let e=document.currentScript;return e?.dataset.bridge?e.dataset.bridge:e?.src?new URL(e.src).origin:`http://localhost:4747`}function zu(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=`
|
|
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:_u(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:_u(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:_u(s.join(` `),t)},a++))}return n}let gu=/(`[^`]+`|\*\*[^*]+\*\*|\[[^\]]+\]\([^)\s]+\))/g;function _u(e,t){return e.split(gu).map((e,n)=>{if(e.startsWith("`")&&e.endsWith("`")&&e.length>1)return t.index+=yu(e),/* @__PURE__ */ Y(`code`,{children:e.slice(1,-1)},n);if(e.startsWith(`**`)&&e.endsWith(`**`)&&e.length>3)return/* @__PURE__ */ Y(`strong`,{children:vu(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:vu(r[1],t)},n):vu(e,t)})}function vu(e,t){return t.animateFrom===1/0?(t.index+=yu(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 yu(e){let t=e.match(/\S+/g);return t?t.length:0}function bu(){_n.value;let e=K.value,t=e?V.value.get(e):void 0,n=j(null),[r,i]=A(320);if(Ne(()=>{n.current&&i(n.current.offsetHeight)}),!t)return null;let a=gn.value,o=a?.threadId===t.id?a.point:t.anchor?jn(t.anchor):null,{left:s,top:c,origin:l}=o?Pn(o,{width:380,height:r}):{left:window.innerWidth-380-(q.value?372:16),top:16,origin:`top right`};return/* @__PURE__ */ Y(`div`,{ref:n,class:`popover thread${o?``:` thread-docked`}`,style:{left:`${s}px`,top:`${c}px`,width:`380px`,transformOrigin:l},children:[/* @__PURE__ */ Y(Su,{thread:t}),t.status===`draft`?/* @__PURE__ */ Y(xu,{thread:t}):/* @__PURE__ */ Y(S,{children:[/* @__PURE__ */ Y(Cu,{thread:t},t.id),/* @__PURE__ */ Y(Eu,{thread:t},t.id),/* @__PURE__ */ Y(su,{placeholder:wt.value??(t.provider.threadId?`Reply…`:`Waiting for the agent…`),disabled:!t.provider.threadId||wt.value!==null,onSubmit:e=>{U({type:`thread.reply`,threadId:t.id,text:e})},onCancel:()=>{K.value=null}})]})]})}function xu({thread:e}){let t=e.messages[0]?.text??``,n=Cn.value.length;return/* @__PURE__ */ Y(S,{children:[/* @__PURE__ */ Y(`div`,{class:`status-line status-queued`,children:[e.statusDetail?/* @__PURE__ */ Y(`span`,{class:`status-error`,children:[`Couldn't send: `,e.statusDetail]}):`Queued with ${n===1?`no other comments`:`${n-1} other ${n===2?`comment`:`comments`}`}`,/* @__PURE__ */ Y(`button`,{type:`button`,class:`stop`,onClick:Bl,children:[`Send `,n===1?`it`:`all ${n}`,` now`]})]}),/* @__PURE__ */ Y(su,{initialText:t,placeholder:`What should change here?`,onSubmit:n=>{n!==t&&U({type:`thread.edit`,threadId:e.id,prompt:n}),K.value=null},onCancel:()=>{K.value=null}},`${e.id}:${t}`)]})}function Su({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(S,{children:[/* @__PURE__ */ Y(`span`,{class:`thread-number`,children:[`#`,zl.value.get(e.id)]}),/* @__PURE__ */ Y(`span`,{class:`chip`,title:t.selector,children:[/* @__PURE__ */ Y(na,{}),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 ${rn(e.provider.id)}`,children:/* @__PURE__ */ Y($i,{})}),e.status!==`draft`&&/* @__PURE__ */ Y(`button`,{type:`button`,class:`icon-button`,title:e.resolved?`Reopen`:`Resolve`,onClick:()=>{U({type:`thread.resolve`,threadId:e.id,resolved:!e.resolved}),e.resolved||(K.value=null)},children:e.resolved?/* @__PURE__ */ Y(Zi,{}):/* @__PURE__ */ Y(Xi,{})}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`icon-button`,title:`Delete pin (keeps the agent thread)`,onClick:()=>{U({type:`thread.delete`,threadId:e.id}),K.value=null},children:/* @__PURE__ */ Y(Qi,{})}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`icon-button`,title:`Close (Esc)`,onClick:()=>{K.value=null},children:/* @__PURE__ */ Y(ea,{})})]})]})}function Cu({thread:e}){let t=j(null),n=j(null),r=j(!0),[i,a]=A(!1),o=e.messages[e.messages.length-1];return Ne(()=>{o?.role===`user`&&(r.current=!0)},[o?.id]),Ne(()=>{let e=t.current,i=n.current;if(!e||!i)return;let a=()=>{r.current&&(e.scrollTop=e.scrollHeight)};a();let o=new ResizeObserver(a);return o.observe(e),o.observe(i),()=>o.disconnect()},[]),/* @__PURE__ */ Y(`div`,{ref:t,class:`messages`,"data-scrolled":i||void 0,onScroll:e=>{let t=e.currentTarget;r.current=t.scrollHeight-t.scrollTop-t.clientHeight<24,a(t.scrollTop>4)},children:/* @__PURE__ */ Y(`div`,{ref:n,class:`messages-list`,children:e.messages.map(e=>e.role===`user`?/* @__PURE__ */ Y(`div`,{class:`message message-user`,children:e.text},e.id):/* @__PURE__ */ Y(wu,{message:e},e.id))})})}function wu({message:e}){let[t]=A(e.streaming);return/* @__PURE__ */ Y(`div`,{class:`message message-assistant`,children:/* @__PURE__ */ Y(mu,{text:e.text,animate:t})})}function Tu({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 Eu({thread:e}){let[t,n]=A(!1),r=e.steps??[],i=r.length>0?{open:t,onToggle:()=>n(!t)}:void 0,a=e.status===`working`;return/* @__PURE__ */ Y(S,{children:[t&&r.length>0&&/* @__PURE__ */ Y(Ou,{steps:r,follow:a}),/* @__PURE__ */ Y(Nu,{thread:e,steps:i}),i&&!a&&/* @__PURE__ */ Y(`div`,{class:`status-line`,children:/* @__PURE__ */ Y(Du,{...i,children:[r.filter(e=>!e.parentId).length,` steps`,ju(r)?` · ${ju(r)}`:``]})}),e.delivery&&!a&&/* @__PURE__ */ Y(Pu,{delivery:e.delivery})]})}function Du({open:e,onToggle:t,children:n}){return/* @__PURE__ */ Y(`button`,{type:`button`,class:`steps-toggle${e?` open`:``}`,"aria-expanded":e,title:e?`Hide steps`:`Show steps`,onClick:t,children:[n,/* @__PURE__ */ Y(oa,{})]})}function Ou({steps:e,follow:t}){let n=j(null),r=j(!0);return Ne(()=>{let e=n.current;e&&t&&r.current&&(e.scrollTop=e.scrollHeight)}),/* @__PURE__ */ Y(`ol`,{ref:n,class:`steps`,onScroll:e=>{let t=e.currentTarget;r.current=t.scrollHeight-t.scrollTop-t.clientHeight<16},children:e.map(e=>/* @__PURE__ */ Y(`li`,{class:`step step-${e.status}${e.parentId?` step-child`:``}`,title:e.detail?`${e.label}\n${e.detail}`:e.label,children:[/* @__PURE__ */ Y(`span`,{class:`step-mark`,children:e.status===`running`?/* @__PURE__ */ Y(`span`,{class:`live-dot`}):e.status===`done`?/* @__PURE__ */ Y(Xi,{}):e.status===`failed`?/* @__PURE__ */ Y(ea,{}):`–`}),/* @__PURE__ */ Y(`span`,{class:`step-label`,children:[e.label,e.detail&&/* @__PURE__ */ Y(`span`,{class:`step-detail`,children:e.detail})]}),e.endedAt&&/* @__PURE__ */ Y(`span`,{class:`step-time`,children:Au(e)})]},e.id))})}function ku(e){return e.findLast(e=>e.status===`running`)}function Au(e){return e.endedAt?Mu((Date.parse(e.endedAt)-Date.parse(e.startedAt))/1e3):``}function ju(e){let t=e[0],n=e.map(e=>e.endedAt).filter(e=>!!e);if(!t||n.length===0)return``;let r=n.reduce((e,t)=>e>t?e:t);return Mu((Date.parse(r)-Date.parse(t.startedAt))/1e3)}function Mu(e){return!Number.isFinite(e)||e<1?``:e<60?`${Math.round(e)}s`:`${Math.floor(e/60)}m ${String(Math.round(e%60)).padStart(2,`0`)}s`}function Nu({thread:e,steps:t}){return e.status===`starting`?/* @__PURE__ */ Y(`div`,{class:`status-line`,children:[/* @__PURE__ */ Y(`span`,{class:`live-dot`}),/* @__PURE__ */ Y(Tu,{text:`Starting a thread in ${rn(e.provider.id)}…`})]}):e.status===`working`?/* @__PURE__ */ Y(`div`,{class:`status-line`,children:[/* @__PURE__ */ Y(`span`,{class:`live-dot`}),t?/* @__PURE__ */ Y(Du,{...t,children:/* @__PURE__ */ Y(Tu,{text:`${ku(e.steps??[])?.label??`Working`}…`})}):/* @__PURE__ */ Y(Tu,{text:`Working…`}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`stop`,onClick:()=>U({type:`thread.interrupt`,threadId:e.id}),children:[/* @__PURE__ */ Y(Yi,{}),` 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}function Pu({delivery:e}){let t=e.pullRequest,n=t&&/* @__PURE__ */ Y(`a`,{href:t.url,target:`_blank`,rel:`noreferrer`,children:t.opened?`Opened #${t.number}`:`#${t.number}`}),r=e.commit&&/* @__PURE__ */ Y(`a`,{class:`delivery-commit`,href:e.commit.url,target:`_blank`,rel:`noreferrer`,children:e.commit.sha.slice(0,7)});switch(e.status){case`queued`:return/* @__PURE__ */ Y(`div`,{class:`status-line delivery`,children:[/* @__PURE__ */ Y(`span`,{class:`live-dot`}),/* @__PURE__ */ Y(Tu,{text:e.queuePosition?`Waiting, ${e.queuePosition} ahead on this branch`:`Waiting for the branch…`})]});case`pushed`:return/* @__PURE__ */ Y(`div`,{class:`status-line delivery`,children:[/* @__PURE__ */ Y(`span`,{children:[`Pushed `,r]}),n]});case`deploying`:return/* @__PURE__ */ Y(`div`,{class:`status-line delivery`,children:[/* @__PURE__ */ Y(`span`,{class:`live-dot`}),/* @__PURE__ */ Y(Tu,{text:`Deploying the preview…`}),n]});case`live`:return/* @__PURE__ */ Y(`div`,{class:`status-line delivery delivery-live`,children:[/* @__PURE__ */ Y(`span`,{children:[`Live `,r]}),e.previewUrl?/* @__PURE__ */ Y(`a`,{href:e.previewUrl,children:`Open the new preview`}):n]});case`deploy-failed`:return/* @__PURE__ */ Y(`div`,{class:`status-line delivery status-error`,children:[/* @__PURE__ */ Y(`span`,{children:[`Preview deploy failed `,r]}),e.logsUrl?/* @__PURE__ */ Y(`a`,{href:e.logsUrl,target:`_blank`,rel:`noreferrer`,children:`Logs`}):n]});case`no-changes`:return/* @__PURE__ */ Y(`div`,{class:`status-line delivery`,children:`No changes needed, nothing pushed`});case`failed`:return/* @__PURE__ */ Y(`div`,{class:`status-line delivery status-error`,children:[/* @__PURE__ */ Y(`span`,{class:`delivery-detail`,title:e.detail,children:[`Couldn't push`,e.detail?`: ${e.detail}`:``]}),n]})}}let Fu=`tencil:dock`,Iu=[`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`],Lu,Ru=F(zu());function zu(){try{let e=localStorage.getItem(Fu);return e&&Iu.includes(e)?e:`bottom-center`}catch{return`bottom-center`}}function Bu(e){Ru.value=e;try{localStorage.setItem(Fu,e)}catch{}}function Vu(e,t,n,r){let i=e<n/3?`left`:e>n*2/3?`right`:`center`;return`${t<r/2?`top`:`bottom`}-${i}`}function Hu(e,t){if(e.button!==0)return;e.preventDefault();let n=e.currentTarget;try{n.setPointerCapture(e.pointerId)}catch{}let[r,i]=Ku(t);Lu?.(),t.style.transition=`none`,t.style.translate=`${r}px ${i}px`;let a=e.clientX,o=e.clientY,s=r!==0||i!==0,c=[],l=e=>{let n=e.clientX-a,l=e.clientY-o;!s&&Math.hypot(n,l)<3||(s=!0,t.dataset.dragging=``,t.style.translate=`${r+n}px ${i+l}px`,c=[...c.filter(t=>e.timeStamp-t.t<80),{x:e.clientX,y:e.clientY,t:e.timeStamp}])},u=e=>{if(n.removeEventListener(`pointermove`,l),n.removeEventListener(`pointerup`,u),n.removeEventListener(`pointercancel`,u),n.removeEventListener(`lostpointercapture`,u),window.removeEventListener(`dragstart`,Uu,!0),delete t.dataset.dragging,!s){t.style.translate=``,t.style.transition=``;return}c=c.filter(t=>e.timeStamp-t.t<80);let r=c[0],i=c[c.length-1],a=r&&i?Math.max(1,i.t-r.t):1,o=e=>Math.max(-2.5,Math.min(2.5,e/a)),d=r&&i?o(i.x-r.x):0,f=r&&i?o(i.y-r.y):0,p=qu(t);Gu(t,p,Vu(p.left+p.width/2+d*120,p.top+p.height/2+f*120,window.innerWidth,window.innerHeight))};n.addEventListener(`pointermove`,l),n.addEventListener(`pointerup`,u),n.addEventListener(`pointercancel`,u),n.addEventListener(`lostpointercapture`,u),window.addEventListener(`dragstart`,Uu,!0)}function Uu(e){e.preventDefault()}function Wu(e,t){let[n,r]=Ru.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?(Bu(o),t.style.translate=``,!0):!1}function Gu(e,t,n){Bu(n);let r=0,i,a=()=>{cancelAnimationFrame(r),clearTimeout(i),e.removeEventListener(`transitionend`,o),Lu=void 0,e.style.transition=``,e.style.translate=``},o=t=>{t.target===e&&t.propertyName===`translate`&&a()};Lu=()=>{cancelAnimationFrame(r),clearTimeout(i),e.removeEventListener(`transitionend`,o),Lu=void 0},r=requestAnimationFrame(()=>{e.style.translate=``;let n=qu(e);if(e.style.translate=`${t.left-n.left}px ${t.top-n.top}px`,matchMedia(`(prefers-reduced-motion: reduce)`).matches){a();return}r=requestAnimationFrame(()=>{e.style.transition=`translate 340ms cubic-bezier(0.32, 0.72, 0, 1)`,e.style.translate=`0px 0px`,e.addEventListener(`transitionend`,o),i=setTimeout(a,440)})})}function Ku(e){let t=getComputedStyle(e).translate;if(!t||t===`none`)return[0,0];let[n=`0`,r=`0`]=t.split(` `);return[Number.parseFloat(n)||0,Number.parseFloat(r)||0]}function qu(e){return(e.querySelector(`.toolbar`)??e).getBoundingClientRect()}let Ju=F(null);function Yu(){let e=()=>{let e=Zu(),t=Ju.value;Qu(e,t)||(Ju.value=e)};e();let t=setInterval(e,500);return window.addEventListener(`resize`,e,{passive:!0}),()=>{clearInterval(t),window.removeEventListener(`resize`,e)}}function Xu(e,t){return!t||e.endsWith(`center`)||Vu((t.left+t.right)/2,(t.top+t.bottom)/2,window.innerWidth,window.innerHeight)!==e?{}:e.endsWith(`left`)?{left:`${t.right+8}px`}:{right:`${window.innerWidth-t.left+8}px`}}function Zu(){for(let e of document.querySelectorAll(`nextjs-portal`)){let t=e.shadowRoot?.getElementById(`devtools-indicator`);if(!t)continue;let n=t.getBoundingClientRect();if(n.width!==0&&n.height!==0)return{left:n.left,top:n.top,right:n.right,bottom:n.bottom}}return null}function Qu(e,t){return!e||!t?e===t:Math.round(e.left)===Math.round(t.left)&&Math.round(e.top)===Math.round(t.top)&&Math.round(e.right)===Math.round(t.right)&&Math.round(e.bottom)===Math.round(t.bottom)}function $u(){let[e,t]=A(``),n=Ht.value??[],r=e.trim().toLowerCase(),i=r?n.filter(e=>e.title.toLowerCase().includes(r)||e.root.toLowerCase().includes(r)):n,a=e=>U({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:Ut.value??`No projects found.`}):/* @__PURE__ */ Y(S,{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 ed(){if(!ln.value)return null;let e=B.value,t=z.value,n=()=>{ln.value=!1};return/* @__PURE__ */ Y(`section`,{class:`settings-panel`,role:`dialog`,"aria-label":`Project settings`,onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),n())},children:[/* @__PURE__ */ Y(`header`,{class:`settings-header`,children:[/* @__PURE__ */ Y(`div`,{class:`settings-heading`,children:[/* @__PURE__ */ Y(`strong`,{children:`Settings`}),Lt.value&&/* @__PURE__ */ Y(`span`,{class:`settings-project`,children:Lt.value.name})]}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`icon-button`,title:`Close (Esc)`,onClick:n,children:/* @__PURE__ */ Y(ea,{})})]}),e?/* @__PURE__ */ Y(S,{children:[/* @__PURE__ */ Y(`div`,{class:`settings-section`,children:[/* @__PURE__ */ Y(`p`,{class:`settings-label`,id:`tencil-provider-label`,children:`Agent for new pins`}),/* @__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:()=>U({type:`settings.update`,provider:n.id})}),/* @__PURE__ */ Y(Ui,{agent:n.id,size:14,decorative:!0}),/* @__PURE__ */ Y(`span`,{class:`target-option-title`,children:n.label}),r&&t?.id===n.id&&/* @__PURE__ */ Y(`span`,{class:`target-option-meta`,children:td(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:`settings-help`,children:`Pins you already made keep their agent.`})]}),/* @__PURE__ */ Y(`label`,{class:`settings-section settings-switch-row`,children:[/* @__PURE__ */ Y(`span`,{class:`settings-switch-text`,children:[/* @__PURE__ */ Y(`span`,{class:`settings-label`,children:`Batch mode`}),/* @__PURE__ */ Y(`span`,{class:`settings-help`,children:[`Adds `,/* @__PURE__ */ Y(aa,{}),` to the comment box to queue comments and send them together.`]})]}),/* @__PURE__ */ Y(`input`,{type:`checkbox`,role:`switch`,class:`settings-switch`,checked:e.batch,"aria-checked":e.batch,onChange:e=>hn(e.currentTarget.checked)})]})]}):/* @__PURE__ */ Y(`p`,{class:`empty`,children:`Connecting…`}),L.value&&/* @__PURE__ */ Y(`div`,{class:`settings-section settings-account`,children:[/* @__PURE__ */ Y(`span`,{class:`settings-help`,children:[`Signed in to Tencil Cloud as`,` `,/* @__PURE__ */ Y(`strong`,{children:L.value.login?`@${L.value.login}`:L.value.name})]}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`hint-action`,onClick:()=>{At(Xt()),Zt()},children:`Sign out`})]})]})}function td(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 nd({tone:e,label:t}){let[n,r]=A(!1),i=j(void 0);Me(()=>()=>clearTimeout(i.current),[]);let a=e=>{clearTimeout(i.current),i.current=setTimeout(()=>r(!0),e)},o=()=>{clearTimeout(i.current),r(!1)};return/* @__PURE__ */ Y(`span`,{class:`status`,onPointerEnter:()=>a(250),onPointerLeave:o,children:[/* @__PURE__ */ Y(`button`,{type:`button`,class:`status-button`,"aria-label":`Tencil status: ${t}`,"aria-expanded":n,"aria-describedby":n?`tencil-status-card`:void 0,onFocus:()=>a(0),onBlur:o,onClick:()=>n?o():a(0),children:/* @__PURE__ */ Y(`span`,{class:`status-dot status-${e}`,children:wn.value>0&&/* @__PURE__ */ Y(`span`,{class:`status-ping`})})}),n&&/* @__PURE__ */ Y(rd,{tone:e})]})}function rd({tone:e}){let t=z.value,n=R.value,r=Cn.value.length,i=wn.value;return/* @__PURE__ */ Y(`div`,{class:`status-card`,role:`tooltip`,id:`tencil-status-card`,children:[/* @__PURE__ */ Y(`div`,{class:`status-card-head`,children:[/* @__PURE__ */ Y(ia,{size:18}),/* @__PURE__ */ Y(`strong`,{children:`Tencil`}),Rt.value&&/* @__PURE__ */ Y(`span`,{class:`status-card-muted`,children:[`v`,Rt.value]})]}),/* @__PURE__ */ Y(`dl`,{class:`status-card-rows`,children:[/* @__PURE__ */ Y(id,{label:Yt()?`Tencil Cloud`:`Daemon`,children:[/* @__PURE__ */ Y(`span`,{class:`status-card-tone tone-${n===`open`?`ok`:e}`}),n===`open`?`Connected`:n===`connecting`?`Connecting…`:`Offline`]}),/* @__PURE__ */ Y(id,{label:`Address`,children:$t()}),/* @__PURE__ */ Y(id,{label:`Project`,children:Ht.value?`Not picked yet`:Lt.value?/* @__PURE__ */ Y(`span`,{title:Lt.value.root,children:Lt.value.name}):`…`}),/* @__PURE__ */ Y(id,{label:`Agent`,children:t?/* @__PURE__ */ Y(S,{children:[/* @__PURE__ */ Y(`span`,{class:`status-card-tone tone-${t.state===`ready`?`ok`:e}`}),t.label,/* @__PURE__ */ Y(`span`,{class:`status-card-muted`,children:td(t)})]}):`…`}),t?.target&&/* @__PURE__ */ Y(id,{label:`Workspace`,children:t.target}),L.value&&/* @__PURE__ */ Y(id,{label:`Signed in`,children:[L.value.login?`@${L.value.login}`:L.value.name,L.value.access===`read`&&/* @__PURE__ */ Y(`span`,{class:`status-card-muted`,children:`view only`})]}),(i>0||r>0)&&/* @__PURE__ */ Y(id,{label:`Pins`,children:[i>0&&`${i} working`,r>0&&`${r} queued`].filter(Boolean).join(` · `)})]}),t&&t.state!==`ready`&&t.detail&&/* @__PURE__ */ Y(`p`,{class:`status-card-detail`,children:t.detail})]})}function id({label:e,children:t}){return/* @__PURE__ */ Y(`div`,{class:`status-card-row`,children:[/* @__PURE__ */ Y(`dt`,{children:e}),/* @__PURE__ */ Y(`dd`,{children:t})]})}function ad(){let e=sd(),t=W.value===`picking`,n=j(null);return/* @__PURE__ */ Y(`div`,{ref:n,class:`toolbar-wrap dock-${Ru.value}`,style:Xu(Ru.value,Ju.value),children:[t&&/* @__PURE__ */ Y(`div`,{class:`toolbar-hint`,children:`Click any element to pin a prompt · Esc to cancel`}),!t&&/* @__PURE__ */ Y(ed,{}),!t&&Ht.value&&/* @__PURE__ */ Y($u,{}),!t&&!Ht.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(nd,{tone:e.tone,label:e.title}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`divider`,"aria-label":`Move toolbar (drag, or use arrow keys)`,title:`Drag to move`,onPointerDown:e=>n.current&&Hu(e,n.current),onKeyDown:e=>{n.current&&Wu(e.key,n.current)&&e.preventDefault()}}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`tool${t?` tool-active`:``}`,title:wt.value??`Comment (C)`,disabled:wt.value!==null,onClick:()=>t?En():Tn(),children:[/* @__PURE__ */ Y(Wi,{}),/* @__PURE__ */ Y(`span`,{class:`tool-label`,children:`Comment`}),/* @__PURE__ */ Y(`kbd`,{children:`C`})]}),Cn.value.length>0&&/* @__PURE__ */ Y(`button`,{type:`button`,class:`tool tool-send`,title:`Send the queued comments to the agent as one thread`,disabled:z.value?.state!==`ready`,onClick:Bl,children:[/* @__PURE__ */ Y(Ji,{}),/* @__PURE__ */ Y(`span`,{class:`tool-label`,children:[`Send `,Cn.value.length]})]}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`tool${q.value?` tool-active`:``}`,title:`Pins`,onClick:()=>{q.value=!q.value,ln.value=!1},children:[/* @__PURE__ */ Y(Gi,{}),Sn.value>0&&/* @__PURE__ */ Y(`span`,{class:`badge`,children:Sn.value})]}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`tool`,title:dn.value?`Show pins`:`Hide pins`,onClick:()=>{dn.value=!dn.value,dn.value&&En()},children:dn.value?/* @__PURE__ */ Y(Ki,{}):/* @__PURE__ */ Y(qi,{})}),/* @__PURE__ */ Y(`button`,{type:`button`,class:`tool${ln.value?` tool-active`:``}`,title:`Project settings`,disabled:!Lt.value,onClick:()=>{ln.value=!ln.value,q.value=!1},children:/* @__PURE__ */ Y(ra,{})})]})]})}let od={label:`Switch agent`,run:()=>{ln.value=!0,q.value=!1}};function sd(){if(R.value!==`open`)return Yt()?{tone:`error`,title:`Tencil Cloud unreachable`,hint:R.value===`connecting`?void 0:`Can't reach Tencil Cloud. Retrying…`}:{tone:`error`,title:`Tencil daemon offline`,hint:R.value===`connecting`?void 0:`The Tencil daemon stopped. Start it again with npx tencil start.`};let e=St.value;if(e)return{tone:`warn`,title:`Sign in to Tencil Cloud`,hint:e.reason??`Sign in with GitHub to pin on this preview`,action:Ct.value?void 0:{label:`Sign in`,run:()=>cd(e.signIn)}};if(Ht.value)return{tone:`warn`,title:`Pick this page's project`};let t=z.value;if(!t)return{tone:`warn`,title:`Connecting…`};switch(t.state){case`ready`:return{tone:`ok`,title:`${t.label}${t.target?` · ${t.target}`:``}`};case`unauthorized`:return t.canPair?{tone:`warn`,title:`${t.label}: not paired`,hint:`Not paired with ${t.label}`,action:{label:`Pair`,run:()=>U({type:`provider.pair`})}}:{tone:`warn`,title:`${t.label}: not signed in`,hint:t.detail??`Sign in to ${t.label}`,action:od};case`unavailable`:return{tone:`error`,title:t.detail??`${t.label} unavailable`,hint:t.detail??`${t.label} is unavailable`,action:od};default:return{tone:`warn`,title:`Connecting to ${t.label}…`}}}function cd(e){jt(Xt(),e).then(Zt,e=>{Wt.value={message:e instanceof Error?e.message:String(e),at:Date.now()}})}function ld(){return dd(),/* @__PURE__ */ Y(`div`,{class:`root${W.value===`picking`?` picking`:``}`,children:[/* @__PURE__ */ Y(pu,{}),/* @__PURE__ */ Y(Vl,{}),/* @__PURE__ */ Y(lu,{}),/* @__PURE__ */ Y(bu,{}),/* @__PURE__ */ Y(Zl,{}),/* @__PURE__ */ Y(ud,{}),/* @__PURE__ */ Y(ad,{})]})}function ud(){let e=Wt.value,[t,n]=A(!1);return Me(()=>{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 dd(){let e=V.value;Me(()=>{let t=sessionStorage.getItem(Xl);if(!t)return;let n=e.get(t);n&&(sessionStorage.removeItem(Xl),K.value=t,ru(n))},[e])}let fd=[`pointerdown`,`pointerup`,`mousedown`,`mouseup`,`dblclick`,`contextmenu`,`auxclick`];function pd(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=>{W.value===`picking`&&(cn.value=t(e)?null:n(e.clientX,e.clientY))},i=e=>{if(W.value===`idle`&&e.type===`pointerdown`&&!t(e)){ln.value=!1,(K.value?V.value.get(K.value):void 0)?.anchor&&(K.value=null);return}W.value!==`picking`||t(e)||(e.preventDefault(),e.stopImmediatePropagation())},a=e=>{if(W.value!==`picking`||t(e))return;e.preventDefault(),e.stopImmediatePropagation();let r=n(e.clientX,e.clientY);if(!r)return;En();let i=gl(r);G.value={element:r,label:_l(r),anchor:{selector:``,...Mn(r,{x:e.clientX,y:e.clientY})},context:i}},o=e=>{if(!t(e)){if(e.key===`Escape`){if(W.value===`picking`)En();else if(G.value)G.value=null;else if(K.value)K.value=null;else if(q.value)q.value=!1;else return;e.preventDefault();return}md(e)||e.key.toLowerCase()===`c`&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&(e.preventDefault(),dn.value=!1,W.value===`picking`?En():Tn())}},s=0,c=()=>{s||=requestAnimationFrame(()=>{s=0,_n.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=yn(location.href);e!==vn.value&&(vn.value=e,G.value=null,K.value=null)},400);window.addEventListener(`pointermove`,r,{capture:!0,passive:!0});for(let e of fd)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 fd)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 md(e){let t=e.composedPath()[0];return t instanceof HTMLElement?t.isContentEditable||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement:!1}function hd(){let e=document.currentScript;return e?.dataset.bridge?e.dataset.bridge:e?.src?new URL(e.src).origin:`http://localhost:4747`}function gd(){let e=document.currentScript?.dataset;if(e?.tencilProject&&e.tencilRepo&&e.tencilBranch&&e.tencilSha)return{projectKey:e.tencilProject,repo:e.tencilRepo,branch:e.tencilBranch,sha:e.tencilSha}}function _d(e,t){let n=document.createElement(`tencil-overlay`);n.setAttribute(`data-tencil`,``),n.style.cssText=`position:fixed;inset:0;pointer-events:none;z-index:2147483646;display:block;contain:layout style;`;let r=n.attachShadow({mode:`open`}),i=document.createElement(`style`);i.textContent=`
|
|
74
74
|
:host { all: initial; }
|
|
75
75
|
* { box-sizing: border-box; }
|
|
76
76
|
|
|
@@ -424,6 +424,9 @@ kbd {
|
|
|
424
424
|
.status-queued .status-error { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
425
425
|
.status-error { color: var(--error); }
|
|
426
426
|
.status-line a { margin-left: auto; color: var(--n-950); font-weight: 500; }
|
|
427
|
+
.status-line .delivery-commit { margin-left: 0; font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
|
|
428
|
+
.delivery-live { color: var(--n-950); }
|
|
429
|
+
.delivery-detail { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
427
430
|
.live-dot {
|
|
428
431
|
width: 6px; height: 6px; border-radius: 999px; background: var(--live); flex: none;
|
|
429
432
|
animation: live 1.6s ease-in-out infinite;
|
|
@@ -435,6 +438,27 @@ kbd {
|
|
|
435
438
|
box-shadow: 0 0 0 1px var(--n-200); font-size: 12px;
|
|
436
439
|
}
|
|
437
440
|
|
|
441
|
+
/* A provider's steps for the turn (Tencil Cloud: sandbox, clone, install, the agent's tool calls). */
|
|
442
|
+
.steps-toggle { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--n-600); }
|
|
443
|
+
.steps-toggle:hover { color: var(--n-900); }
|
|
444
|
+
.steps-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
|
|
445
|
+
.steps-toggle svg { flex: none; color: var(--n-500); transition: transform 150ms var(--ease-out); }
|
|
446
|
+
.steps-toggle.open svg { transform: rotate(180deg); }
|
|
447
|
+
.steps {
|
|
448
|
+
display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto;
|
|
449
|
+
margin: 0 2px 10px; padding: 10px 12px; list-style: none; border-radius: 0.875rem;
|
|
450
|
+
background: var(--n-100); color: var(--n-700); font-size: 12px; line-height: 1rem;
|
|
451
|
+
}
|
|
452
|
+
.step { display: flex; align-items: center; gap: 8px; min-width: 0; }
|
|
453
|
+
.step-child { padding-left: 20px; color: var(--n-600); }
|
|
454
|
+
.step-mark { display: inline-grid; place-items: center; width: 12px; flex: none; color: var(--n-500); }
|
|
455
|
+
.step-mark svg { width: 12px; height: 12px; }
|
|
456
|
+
.step-done .step-mark { color: var(--done); }
|
|
457
|
+
.step-failed, .step-failed .step-mark { color: var(--error); }
|
|
458
|
+
.step-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
459
|
+
.step-detail { margin-left: 6px; color: var(--n-500); font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0; }
|
|
460
|
+
.step-time { flex: none; color: var(--n-500); font-variant-numeric: tabular-nums; }
|
|
461
|
+
|
|
438
462
|
/* A color wave across the label, one character at a time. */
|
|
439
463
|
.shimmer { display: inline-flex; align-items: center; line-height: 1; user-select: none; }
|
|
440
464
|
.shimmer > span[aria-hidden] {
|
|
@@ -511,6 +535,7 @@ kbd {
|
|
|
511
535
|
.settings-help { margin: 0; color: var(--n-600); font-size: 12px; line-height: 1.4; }
|
|
512
536
|
.settings-switch-row { grid-template-columns: 1fr auto; align-items: center; gap: 16px; cursor: pointer; }
|
|
513
537
|
.settings-switch-text { display: grid; gap: 2px; }
|
|
538
|
+
.settings-account { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
|
|
514
539
|
.settings-help svg { display: inline; width: 12px; height: 12px; vertical-align: -2px; }
|
|
515
540
|
.settings-switch {
|
|
516
541
|
appearance: none; position: relative; flex: none; margin: 0;
|
|
@@ -616,9 +641,10 @@ kbd {
|
|
|
616
641
|
.status-button { display: grid; place-items: center; height: 32px; padding: 0 8px 0 10px; border-radius: 999px; outline: none; cursor: default; }
|
|
617
642
|
.status-button:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
|
|
618
643
|
.status-dot { position: relative; width: 8px; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.4); }
|
|
619
|
-
.status-
|
|
620
|
-
.status-
|
|
621
|
-
.status-
|
|
644
|
+
/* Scoped to the dot: .status-error alone also colours status lines in threads. */
|
|
645
|
+
.status-dot.status-ok { background: #3dd68c; }
|
|
646
|
+
.status-dot.status-warn { background: #f5b84a; }
|
|
647
|
+
.status-dot.status-error { background: #ff6369; }
|
|
622
648
|
/* The connection card, on the toolbar's open side, starting at the dot. */
|
|
623
649
|
.status-card {
|
|
624
650
|
position: absolute; left: -4px; bottom: calc(100% + 14px); z-index: 1;
|
|
@@ -675,6 +701,7 @@ kbd {
|
|
|
675
701
|
.tool-label { font-weight: 500; color: inherit; }
|
|
676
702
|
.tool-send { background: var(--accent); color: white; }
|
|
677
703
|
.tool-send:disabled { opacity: 0.5; cursor: default; }
|
|
704
|
+
.tool:disabled { opacity: 0.45; cursor: default; }
|
|
678
705
|
.badge {
|
|
679
706
|
position: absolute; top: 2px; right: 0;
|
|
680
707
|
min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
|
|
@@ -720,4 +747,4 @@ kbd {
|
|
|
720
747
|
.w { animation: none; }
|
|
721
748
|
.shimmer > span[aria-hidden], .status-ping, .live-dot { animation: none; }
|
|
722
749
|
}
|
|
723
|
-
`;let
|
|
750
|
+
`;let a=document.querySelector(`script[nonce]`)?.nonce;a&&(i.nonce=a),r.append(i);let o=document.createElement(`div`);r.append(o),On(n),document.body.append(n);let s=new MutationObserver(()=>{n.isConnected||document.body.append(n)});s.observe(document.body,{childList:!0});let c=pd(n),l=Yu();ge(te(ld,{}),o),Jt(e,t),window.__TENCIL__={version:1,bridgeUrl:e,destroy(){s.disconnect(),c(),l(),ge(null,o),n.remove(),window.__TENCIL__=void 0}}}if(typeof window<`u`&&!window.__TENCIL__){let e=hd(),t=gd();document.body?_d(e,t):document.addEventListener(`DOMContentLoaded`,()=>_d(e,t),{once:!0})}})();
|