claudius-chat-widget 1.9.0 → 1.10.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/README.md CHANGED
@@ -8,6 +8,8 @@ component, or use the standalone script embed on any website.
8
8
 
9
9
  **Full documentation: [claudius-docs.pages.dev](https://claudius-docs.pages.dev)**
10
10
 
11
+ **Live playground: [claudius-playground.pages.dev](https://claudius-playground.pages.dev)** — tweak every prop and copy an embed snippet.
12
+
11
13
  > Claudius is two pieces: a **Cloudflare Worker** that keeps your Anthropic API
12
14
  > key server-side, and this **widget**. You point the widget at your deployed
13
15
  > worker via `apiUrl`. See the
@@ -38,4 +38,4 @@ var Claudius=(function(Et){"use strict";var ap=Object.defineProperty;var cp=(Et,
38
38
  `).replace(kd,"")}function Zr(e,t,n){if(t=Ss(t),Ss(e)!==t&&n)throw Error(s(425))}function Jr(){}var Lu=null,Pu=null;function Mu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ju=typeof setTimeout=="function"?setTimeout:void 0,Ed=typeof clearTimeout=="function"?clearTimeout:void 0,ks=typeof Promise=="function"?Promise:void 0,Cd=typeof queueMicrotask=="function"?queueMicrotask:typeof ks<"u"?function(e){return ks.resolve(null).then(e).catch(_d)}:ju;function _d(e){setTimeout(function(){throw e})}function zu(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),qn(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);qn(t)}function At(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Es(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var En=Math.random().toString(36).slice(2),wt="__reactFiber$"+En,ar="__reactProps$"+En,Ct="__reactContainer$"+En,Ou="__reactEvents$"+En,Rd="__reactListeners$"+En,Nd="__reactHandles$"+En;function en(e){var t=e[wt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ct]||n[wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Es(e);e!==null;){if(n=e[wt])return n;e=Es(e)}return t}e=n,n=e.parentNode}return null}function cr(e){return e=e[wt]||e[Ct],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Cn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(s(33))}function qr(e){return e[ar]||null}var Du=[],_n=-1;function Ut(e){return{current:e}}function ye(e){0>_n||(e.current=Du[_n],Du[_n]=null,_n--)}function ve(e,t){_n++,Du[_n]=e.current,e.current=t}var Ht={},Ue=Ut(Ht),Ye=Ut(!1),tn=Ht;function Rn(e,t){var n=e.type.contextTypes;if(!n)return Ht;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},u;for(u in n)l[u]=t[u];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Ge(e){return e=e.childContextTypes,e!=null}function br(){ye(Ye),ye(Ue)}function Cs(e,t,n){if(Ue.current!==Ht)throw Error(s(168));ve(Ue,t),ve(Ye,n)}function _s(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(s(108,de(e)||"Unknown",l));return T({},n,r)}function el(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ht,tn=Ue.current,ve(Ue,e),ve(Ye,Ye.current),!0}function Rs(e,t,n){var r=e.stateNode;if(!r)throw Error(s(169));n?(e=_s(e,t,tn),r.__reactInternalMemoizedMergedChildContext=e,ye(Ye),ye(Ue),ve(Ue,e)):ye(Ye),ve(Ye,n)}var _t=null,tl=!1,Iu=!1;function Ns(e){_t===null?_t=[e]:_t.push(e)}function Td(e){tl=!0,Ns(e)}function Bt(){if(!Iu&&_t!==null){Iu=!0;var e=0,t=se;try{var n=_t;for(se=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}_t=null,tl=!1}catch(l){throw _t!==null&&(_t=_t.slice(e+1)),Li(lu,Bt),l}finally{se=t,Iu=!1}}return null}var Nn=[],Tn=0,nl=null,rl=0,nt=[],rt=0,nn=null,Rt=1,Nt="";function rn(e,t){Nn[Tn++]=rl,Nn[Tn++]=nl,nl=e,rl=t}function Ts(e,t,n){nt[rt++]=Rt,nt[rt++]=Nt,nt[rt++]=nn,nn=e;var r=Rt;e=Nt;var l=32-ct(r)-1;r&=~(1<<l),n+=1;var u=32-ct(t)+l;if(30<u){var o=l-l%5;u=(r&(1<<o)-1).toString(32),r>>=o,l-=o,Rt=1<<32-ct(t)+l|n<<l|r,Nt=u+e}else Rt=1<<u|n<<l|r,Nt=e}function Fu(e){e.return!==null&&(rn(e,1),Ts(e,1,0))}function Au(e){for(;e===nl;)nl=Nn[--Tn],Nn[Tn]=null,rl=Nn[--Tn],Nn[Tn]=null;for(;e===nn;)nn=nt[--rt],nt[rt]=null,Nt=nt[--rt],nt[rt]=null,Rt=nt[--rt],nt[rt]=null}var be=null,et=null,Ee=!1,dt=null;function Ls(e,t){var n=it(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ps(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,be=e,et=At(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,be=e,et=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=nn!==null?{id:Rt,overflow:Nt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=it(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,be=e,et=null,!0):!1;default:return!1}}function Uu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Hu(e){if(Ee){var t=et;if(t){var n=t;if(!Ps(e,t)){if(Uu(e))throw Error(s(418));t=At(n.nextSibling);var r=be;t&&Ps(e,t)?Ls(r,n):(e.flags=e.flags&-4097|2,Ee=!1,be=e)}}else{if(Uu(e))throw Error(s(418));e.flags=e.flags&-4097|2,Ee=!1,be=e}}}function Ms(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;be=e}function ll(e){if(e!==be)return!1;if(!Ee)return Ms(e),Ee=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Mu(e.type,e.memoizedProps)),t&&(t=et)){if(Uu(e))throw js(),Error(s(418));for(;t;)Ls(e,t),t=At(t.nextSibling)}if(Ms(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){et=At(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}et=null}}else et=be?At(e.stateNode.nextSibling):null;return!0}function js(){for(var e=et;e;)e=At(e.nextSibling)}function Ln(){et=be=null,Ee=!1}function Bu(e){dt===null?dt=[e]:dt.push(e)}var Ld=ce.ReactCurrentBatchConfig;function fr(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(s(309));var r=n.stateNode}if(!r)throw Error(s(147,e));var l=r,u=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===u?t.ref:(t=function(o){var i=l.refs;o===null?delete i[u]:i[u]=o},t._stringRef=u,t)}if(typeof e!="string")throw Error(s(284));if(!n._owner)throw Error(s(290,e))}return e}function ul(e,t){throw e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function zs(e){var t=e._init;return t(e._payload)}function Os(e){function t(p,c){if(e){var m=p.deletions;m===null?(p.deletions=[c],p.flags|=16):m.push(c)}}function n(p,c){if(!e)return null;for(;c!==null;)t(p,c),c=c.sibling;return null}function r(p,c){for(p=new Map;c!==null;)c.key!==null?p.set(c.key,c):p.set(c.index,c),c=c.sibling;return p}function l(p,c){return p=Xt(p,c),p.index=0,p.sibling=null,p}function u(p,c,m){return p.index=m,e?(m=p.alternate,m!==null?(m=m.index,m<c?(p.flags|=2,c):m):(p.flags|=2,c)):(p.flags|=1048576,c)}function o(p){return e&&p.alternate===null&&(p.flags|=2),p}function i(p,c,m,_){return c===null||c.tag!==6?(c=zo(m,p.mode,_),c.return=p,c):(c=l(c,m),c.return=p,c)}function a(p,c,m,_){var I=m.type;return I===fe?S(p,c,m.props.children,_,m.key):c!==null&&(c.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===ie&&zs(I)===c.type)?(_=l(c,m.props),_.ref=fr(p,c,m),_.return=p,_):(_=Ll(m.type,m.key,m.props,null,p.mode,_),_.ref=fr(p,c,m),_.return=p,_)}function v(p,c,m,_){return c===null||c.tag!==4||c.stateNode.containerInfo!==m.containerInfo||c.stateNode.implementation!==m.implementation?(c=Oo(m,p.mode,_),c.return=p,c):(c=l(c,m.children||[]),c.return=p,c)}function S(p,c,m,_,I){return c===null||c.tag!==7?(c=dn(m,p.mode,_,I),c.return=p,c):(c=l(c,m),c.return=p,c)}function k(p,c,m){if(typeof c=="string"&&c!==""||typeof c=="number")return c=zo(""+c,p.mode,m),c.return=p,c;if(typeof c=="object"&&c!==null){switch(c.$$typeof){case xe:return m=Ll(c.type,c.key,c.props,null,p.mode,m),m.ref=fr(p,null,c),m.return=p,m;case he:return c=Oo(c,p.mode,m),c.return=p,c;case ie:var _=c._init;return k(p,_(c._payload),m)}if(Hn(c)||A(c))return c=dn(c,p.mode,m,null),c.return=p,c;ul(p,c)}return null}function x(p,c,m,_){var I=c!==null?c.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return I!==null?null:i(p,c,""+m,_);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case xe:return m.key===I?a(p,c,m,_):null;case he:return m.key===I?v(p,c,m,_):null;case ie:return I=m._init,x(p,c,I(m._payload),_)}if(Hn(m)||A(m))return I!==null?null:S(p,c,m,_,null);ul(p,m)}return null}function M(p,c,m,_,I){if(typeof _=="string"&&_!==""||typeof _=="number")return p=p.get(m)||null,i(c,p,""+_,I);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case xe:return p=p.get(_.key===null?m:_.key)||null,a(c,p,_,I);case he:return p=p.get(_.key===null?m:_.key)||null,v(c,p,_,I);case ie:var U=_._init;return M(p,c,m,U(_._payload),I)}if(Hn(_)||A(_))return p=p.get(m)||null,S(c,p,_,I,null);ul(c,_)}return null}function z(p,c,m,_){for(var I=null,U=null,H=c,Q=c=0,De=null;H!==null&&Q<m.length;Q++){H.index>Q?(De=H,H=null):De=H.sibling;var ue=x(p,H,m[Q],_);if(ue===null){H===null&&(H=De);break}e&&H&&ue.alternate===null&&t(p,H),c=u(ue,c,Q),U===null?I=ue:U.sibling=ue,U=ue,H=De}if(Q===m.length)return n(p,H),Ee&&rn(p,Q),I;if(H===null){for(;Q<m.length;Q++)H=k(p,m[Q],_),H!==null&&(c=u(H,c,Q),U===null?I=H:U.sibling=H,U=H);return Ee&&rn(p,Q),I}for(H=r(p,H);Q<m.length;Q++)De=M(H,p,Q,m[Q],_),De!==null&&(e&&De.alternate!==null&&H.delete(De.key===null?Q:De.key),c=u(De,c,Q),U===null?I=De:U.sibling=De,U=De);return e&&H.forEach(function(Zt){return t(p,Zt)}),Ee&&rn(p,Q),I}function O(p,c,m,_){var I=A(m);if(typeof I!="function")throw Error(s(150));if(m=I.call(m),m==null)throw Error(s(151));for(var U=I=null,H=c,Q=c=0,De=null,ue=m.next();H!==null&&!ue.done;Q++,ue=m.next()){H.index>Q?(De=H,H=null):De=H.sibling;var Zt=x(p,H,ue.value,_);if(Zt===null){H===null&&(H=De);break}e&&H&&Zt.alternate===null&&t(p,H),c=u(Zt,c,Q),U===null?I=Zt:U.sibling=Zt,U=Zt,H=De}if(ue.done)return n(p,H),Ee&&rn(p,Q),I;if(H===null){for(;!ue.done;Q++,ue=m.next())ue=k(p,ue.value,_),ue!==null&&(c=u(ue,c,Q),U===null?I=ue:U.sibling=ue,U=ue);return Ee&&rn(p,Q),I}for(H=r(p,H);!ue.done;Q++,ue=m.next())ue=M(H,p,Q,ue.value,_),ue!==null&&(e&&ue.alternate!==null&&H.delete(ue.key===null?Q:ue.key),c=u(ue,c,Q),U===null?I=ue:U.sibling=ue,U=ue);return e&&H.forEach(function(sp){return t(p,sp)}),Ee&&rn(p,Q),I}function Te(p,c,m,_){if(typeof m=="object"&&m!==null&&m.type===fe&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case xe:e:{for(var I=m.key,U=c;U!==null;){if(U.key===I){if(I=m.type,I===fe){if(U.tag===7){n(p,U.sibling),c=l(U,m.props.children),c.return=p,p=c;break e}}else if(U.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===ie&&zs(I)===U.type){n(p,U.sibling),c=l(U,m.props),c.ref=fr(p,U,m),c.return=p,p=c;break e}n(p,U);break}else t(p,U);U=U.sibling}m.type===fe?(c=dn(m.props.children,p.mode,_,m.key),c.return=p,p=c):(_=Ll(m.type,m.key,m.props,null,p.mode,_),_.ref=fr(p,c,m),_.return=p,p=_)}return o(p);case he:e:{for(U=m.key;c!==null;){if(c.key===U)if(c.tag===4&&c.stateNode.containerInfo===m.containerInfo&&c.stateNode.implementation===m.implementation){n(p,c.sibling),c=l(c,m.children||[]),c.return=p,p=c;break e}else{n(p,c);break}else t(p,c);c=c.sibling}c=Oo(m,p.mode,_),c.return=p,p=c}return o(p);case ie:return U=m._init,Te(p,c,U(m._payload),_)}if(Hn(m))return z(p,c,m,_);if(A(m))return O(p,c,m,_);ul(p,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,c!==null&&c.tag===6?(n(p,c.sibling),c=l(c,m),c.return=p,p=c):(n(p,c),c=zo(m,p.mode,_),c.return=p,p=c),o(p)):n(p,c)}return Te}var Pn=Os(!0),Ds=Os(!1),ol=Ut(null),il=null,Mn=null,Vu=null;function Wu(){Vu=Mn=il=null}function $u(e){var t=ol.current;ye(ol),e._currentValue=t}function Qu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function jn(e,t){il=e,Vu=Mn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Xe=!0),e.firstContext=null)}function lt(e){var t=e._currentValue;if(Vu!==e)if(e={context:e,memoizedValue:t,next:null},Mn===null){if(il===null)throw Error(s(308));Mn=e,il.dependencies={lanes:0,firstContext:e}}else Mn=Mn.next=e;return t}var ln=null;function Ku(e){ln===null?ln=[e]:ln.push(e)}function Is(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Ku(t)):(n.next=l.next,l.next=n),t.interleaved=n,Tt(e,r)}function Tt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Vt=!1;function Yu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Fs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Lt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Wt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(ne&2)!==0){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Tt(e,n)}return l=r.interleaved,l===null?(t.next=t,Ku(r)):(t.next=l.next,l.next=t),r.interleaved=t,Tt(e,n)}function sl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,iu(e,n)}}function As(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};u===null?l=u=o:u=u.next=o,n=n.next}while(n!==null);u===null?l=u=t:u=u.next=t}else l=u=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:u,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function al(e,t,n,r){var l=e.updateQueue;Vt=!1;var u=l.firstBaseUpdate,o=l.lastBaseUpdate,i=l.shared.pending;if(i!==null){l.shared.pending=null;var a=i,v=a.next;a.next=null,o===null?u=v:o.next=v,o=a;var S=e.alternate;S!==null&&(S=S.updateQueue,i=S.lastBaseUpdate,i!==o&&(i===null?S.firstBaseUpdate=v:i.next=v,S.lastBaseUpdate=a))}if(u!==null){var k=l.baseState;o=0,S=v=a=null,i=u;do{var x=i.lane,M=i.eventTime;if((r&x)===x){S!==null&&(S=S.next={eventTime:M,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var z=e,O=i;switch(x=t,M=n,O.tag){case 1:if(z=O.payload,typeof z=="function"){k=z.call(M,k,x);break e}k=z;break e;case 3:z.flags=z.flags&-65537|128;case 0:if(z=O.payload,x=typeof z=="function"?z.call(M,k,x):z,x==null)break e;k=T({},k,x);break e;case 2:Vt=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,x=l.effects,x===null?l.effects=[i]:x.push(i))}else M={eventTime:M,lane:x,tag:i.tag,payload:i.payload,callback:i.callback,next:null},S===null?(v=S=M,a=k):S=S.next=M,o|=x;if(i=i.next,i===null){if(i=l.shared.pending,i===null)break;x=i,i=x.next,x.next=null,l.lastBaseUpdate=x,l.shared.pending=null}}while(!0);if(S===null&&(a=k),l.baseState=a,l.firstBaseUpdate=v,l.lastBaseUpdate=S,t=l.shared.interleaved,t!==null){l=t;do o|=l.lane,l=l.next;while(l!==t)}else u===null&&(l.shared.lanes=0);sn|=o,e.lanes=o,e.memoizedState=k}}function Us(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],l=r.callback;if(l!==null){if(r.callback=null,r=n,typeof l!="function")throw Error(s(191,l));l.call(r)}}}var dr={},xt=Ut(dr),pr=Ut(dr),hr=Ut(dr);function un(e){if(e===dr)throw Error(s(174));return e}function Gu(e,t){switch(ve(hr,t),ve(pr,e),ve(xt,dr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Xl(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Xl(t,e)}ye(xt),ve(xt,t)}function zn(){ye(xt),ye(pr),ye(hr)}function Hs(e){un(hr.current);var t=un(xt.current),n=Xl(t,e.type);t!==n&&(ve(pr,e),ve(xt,n))}function Xu(e){pr.current===e&&(ye(xt),ye(pr))}var Ce=Ut(0);function cl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Zu=[];function Ju(){for(var e=0;e<Zu.length;e++)Zu[e]._workInProgressVersionPrimary=null;Zu.length=0}var fl=ce.ReactCurrentDispatcher,qu=ce.ReactCurrentBatchConfig,on=0,_e=null,Me=null,ze=null,dl=!1,mr=!1,vr=0,Pd=0;function He(){throw Error(s(321))}function bu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ft(e[n],t[n]))return!1;return!0}function eo(e,t,n,r,l,u){if(on=u,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,fl.current=e===null||e.memoizedState===null?Od:Dd,e=n(r,l),mr){u=0;do{if(mr=!1,vr=0,25<=u)throw Error(s(301));u+=1,ze=Me=null,t.updateQueue=null,fl.current=Id,e=n(r,l)}while(mr)}if(fl.current=ml,t=Me!==null&&Me.next!==null,on=0,ze=Me=_e=null,dl=!1,t)throw Error(s(300));return e}function to(){var e=vr!==0;return vr=0,e}function St(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ze===null?_e.memoizedState=ze=e:ze=ze.next=e,ze}function ut(){if(Me===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=Me.next;var t=ze===null?_e.memoizedState:ze.next;if(t!==null)ze=t,Me=e;else{if(e===null)throw Error(s(310));Me=e,e={memoizedState:Me.memoizedState,baseState:Me.baseState,baseQueue:Me.baseQueue,queue:Me.queue,next:null},ze===null?_e.memoizedState=ze=e:ze=ze.next=e}return ze}function gr(e,t){return typeof t=="function"?t(e):t}function no(e){var t=ut(),n=t.queue;if(n===null)throw Error(s(311));n.lastRenderedReducer=e;var r=Me,l=r.baseQueue,u=n.pending;if(u!==null){if(l!==null){var o=l.next;l.next=u.next,u.next=o}r.baseQueue=l=u,n.pending=null}if(l!==null){u=l.next,r=r.baseState;var i=o=null,a=null,v=u;do{var S=v.lane;if((on&S)===S)a!==null&&(a=a.next={lane:0,action:v.action,hasEagerState:v.hasEagerState,eagerState:v.eagerState,next:null}),r=v.hasEagerState?v.eagerState:e(r,v.action);else{var k={lane:S,action:v.action,hasEagerState:v.hasEagerState,eagerState:v.eagerState,next:null};a===null?(i=a=k,o=r):a=a.next=k,_e.lanes|=S,sn|=S}v=v.next}while(v!==null&&v!==u);a===null?o=r:a.next=i,ft(r,t.memoizedState)||(Xe=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){l=e;do u=l.lane,_e.lanes|=u,sn|=u,l=l.next;while(l!==e)}else l===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ro(e){var t=ut(),n=t.queue;if(n===null)throw Error(s(311));n.lastRenderedReducer=e;var r=n.dispatch,l=n.pending,u=t.memoizedState;if(l!==null){n.pending=null;var o=l=l.next;do u=e(u,o.action),o=o.next;while(o!==l);ft(u,t.memoizedState)||(Xe=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,r]}function Bs(){}function Vs(e,t){var n=_e,r=ut(),l=t(),u=!ft(r.memoizedState,l);if(u&&(r.memoizedState=l,Xe=!0),r=r.queue,lo(Qs.bind(null,n,r,e),[e]),r.getSnapshot!==t||u||ze!==null&&ze.memoizedState.tag&1){if(n.flags|=2048,yr(9,$s.bind(null,n,r,l,t),void 0,null),Oe===null)throw Error(s(349));(on&30)!==0||Ws(n,t,l)}return l}function Ws(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=_e.updateQueue,t===null?(t={lastEffect:null,stores:null},_e.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function $s(e,t,n,r){t.value=n,t.getSnapshot=r,Ks(t)&&Ys(e)}function Qs(e,t,n){return n(function(){Ks(t)&&Ys(e)})}function Ks(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ft(e,n)}catch{return!0}}function Ys(e){var t=Tt(e,1);t!==null&&vt(t,e,1,-1)}function Gs(e){var t=St();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:gr,lastRenderedState:e},t.queue=e,e=e.dispatch=zd.bind(null,_e,e),[t.memoizedState,e]}function yr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=_e.updateQueue,t===null?(t={lastEffect:null,stores:null},_e.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Xs(){return ut().memoizedState}function pl(e,t,n,r){var l=St();_e.flags|=e,l.memoizedState=yr(1|t,n,void 0,r===void 0?null:r)}function hl(e,t,n,r){var l=ut();r=r===void 0?null:r;var u=void 0;if(Me!==null){var o=Me.memoizedState;if(u=o.destroy,r!==null&&bu(r,o.deps)){l.memoizedState=yr(t,n,u,r);return}}_e.flags|=e,l.memoizedState=yr(1|t,n,u,r)}function Zs(e,t){return pl(8390656,8,e,t)}function lo(e,t){return hl(2048,8,e,t)}function Js(e,t){return hl(4,2,e,t)}function qs(e,t){return hl(4,4,e,t)}function bs(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ea(e,t,n){return n=n!=null?n.concat([e]):null,hl(4,4,bs.bind(null,t,e),n)}function uo(){}function ta(e,t){var n=ut();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&bu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function na(e,t){var n=ut();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&bu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ra(e,t,n){return(on&21)===0?(e.baseState&&(e.baseState=!1,Xe=!0),e.memoizedState=n):(ft(n,t)||(n=zi(),_e.lanes|=n,sn|=n,e.baseState=!0),t)}function Md(e,t){var n=se;se=n!==0&&4>n?n:4,e(!0);var r=qu.transition;qu.transition={};try{e(!1),t()}finally{se=n,qu.transition=r}}function la(){return ut().memoizedState}function jd(e,t,n){var r=Yt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ua(e))oa(t,n);else if(n=Is(e,t,n,r),n!==null){var l=$e();vt(n,e,r,l),ia(n,t,r)}}function zd(e,t,n){var r=Yt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ua(e))oa(t,l);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var o=t.lastRenderedState,i=u(o,n);if(l.hasEagerState=!0,l.eagerState=i,ft(i,o)){var a=t.interleaved;a===null?(l.next=l,Ku(t)):(l.next=a.next,a.next=l),t.interleaved=l;return}}catch{}finally{}n=Is(e,t,l,r),n!==null&&(l=$e(),vt(n,e,r,l),ia(n,t,r))}}function ua(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function oa(e,t){mr=dl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ia(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,iu(e,n)}}var ml={readContext:lt,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useInsertionEffect:He,useLayoutEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useMutableSource:He,useSyncExternalStore:He,useId:He,unstable_isNewReconciler:!1},Od={readContext:lt,useCallback:function(e,t){return St().memoizedState=[e,t===void 0?null:t],e},useContext:lt,useEffect:Zs,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,pl(4194308,4,bs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return pl(4194308,4,e,t)},useInsertionEffect:function(e,t){return pl(4,2,e,t)},useMemo:function(e,t){var n=St();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=St();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=jd.bind(null,_e,e),[r.memoizedState,e]},useRef:function(e){var t=St();return e={current:e},t.memoizedState=e},useState:Gs,useDebugValue:uo,useDeferredValue:function(e){return St().memoizedState=e},useTransition:function(){var e=Gs(!1),t=e[0];return e=Md.bind(null,e[1]),St().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=_e,l=St();if(Ee){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),Oe===null)throw Error(s(349));(on&30)!==0||Ws(r,t,n)}l.memoizedState=n;var u={value:n,getSnapshot:t};return l.queue=u,Zs(Qs.bind(null,r,u,e),[e]),r.flags|=2048,yr(9,$s.bind(null,r,u,n,t),void 0,null),n},useId:function(){var e=St(),t=Oe.identifierPrefix;if(Ee){var n=Nt,r=Rt;n=(r&~(1<<32-ct(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=vr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Pd++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Dd={readContext:lt,useCallback:ta,useContext:lt,useEffect:lo,useImperativeHandle:ea,useInsertionEffect:Js,useLayoutEffect:qs,useMemo:na,useReducer:no,useRef:Xs,useState:function(){return no(gr)},useDebugValue:uo,useDeferredValue:function(e){var t=ut();return ra(t,Me.memoizedState,e)},useTransition:function(){var e=no(gr)[0],t=ut().memoizedState;return[e,t]},useMutableSource:Bs,useSyncExternalStore:Vs,useId:la,unstable_isNewReconciler:!1},Id={readContext:lt,useCallback:ta,useContext:lt,useEffect:lo,useImperativeHandle:ea,useInsertionEffect:Js,useLayoutEffect:qs,useMemo:na,useReducer:ro,useRef:Xs,useState:function(){return ro(gr)},useDebugValue:uo,useDeferredValue:function(e){var t=ut();return Me===null?t.memoizedState=e:ra(t,Me.memoizedState,e)},useTransition:function(){var e=ro(gr)[0],t=ut().memoizedState;return[e,t]},useMutableSource:Bs,useSyncExternalStore:Vs,useId:la,unstable_isNewReconciler:!1};function pt(e,t){if(e&&e.defaultProps){t=T({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function oo(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var vl={isMounted:function(e){return(e=e._reactInternals)?bt(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=$e(),l=Yt(e),u=Lt(r,l);u.payload=t,n!=null&&(u.callback=n),t=Wt(e,u,l),t!==null&&(vt(t,e,l,r),sl(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=$e(),l=Yt(e),u=Lt(r,l);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=Wt(e,u,l),t!==null&&(vt(t,e,l,r),sl(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=$e(),r=Yt(e),l=Lt(n,r);l.tag=2,t!=null&&(l.callback=t),t=Wt(e,l,r),t!==null&&(vt(t,e,r,n),sl(t,e,r))}};function sa(e,t,n,r,l,u,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,u,o):t.prototype&&t.prototype.isPureReactComponent?!lr(n,r)||!lr(l,u):!0}function aa(e,t,n){var r=!1,l=Ht,u=t.contextType;return typeof u=="object"&&u!==null?u=lt(u):(l=Ge(t)?tn:Ue.current,r=t.contextTypes,u=(r=r!=null)?Rn(e,l):Ht),t=new t(n,u),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=vl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=u),t}function ca(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&vl.enqueueReplaceState(t,t.state,null)}function io(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs={},Yu(e);var u=t.contextType;typeof u=="object"&&u!==null?l.context=lt(u):(u=Ge(t)?tn:Ue.current,l.context=Rn(e,u)),l.state=e.memoizedState,u=t.getDerivedStateFromProps,typeof u=="function"&&(oo(e,t,u,n),l.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(t=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),t!==l.state&&vl.enqueueReplaceState(l,l.state,null),al(e,n,l,r),l.state=e.memoizedState),typeof l.componentDidMount=="function"&&(e.flags|=4194308)}function On(e,t){try{var n="",r=t;do n+=ee(r),r=r.return;while(r);var l=n}catch(u){l=`
39
39
  Error generating stack: `+u.message+`
40
40
  `+u.stack}return{value:e,source:t,stack:l,digest:null}}function so(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ao(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Fd=typeof WeakMap=="function"?WeakMap:Map;function fa(e,t,n){n=Lt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){El||(El=!0,_o=r),ao(e,t)},n}function da(e,t,n){n=Lt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){ao(e,t)}}var u=e.stateNode;return u!==null&&typeof u.componentDidCatch=="function"&&(n.callback=function(){ao(e,t),typeof r!="function"&&(Qt===null?Qt=new Set([this]):Qt.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function pa(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Fd;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=Jd.bind(null,e,t,n),t.then(e,e))}function ha(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function ma(e,t,n,r,l){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Lt(-1,1),t.tag=2,Wt(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=l,e)}var Ad=ce.ReactCurrentOwner,Xe=!1;function We(e,t,n,r){t.child=e===null?Ds(t,null,n,r):Pn(t,e.child,n,r)}function va(e,t,n,r,l){n=n.render;var u=t.ref;return jn(t,l),r=eo(e,t,n,r,u,l),n=to(),e!==null&&!Xe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Pt(e,t,l)):(Ee&&n&&Fu(t),t.flags|=1,We(e,t,r,l),t.child)}function ga(e,t,n,r,l){if(e===null){var u=n.type;return typeof u=="function"&&!jo(u)&&u.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=u,ya(e,t,u,r,l)):(e=Ll(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,(e.lanes&l)===0){var o=u.memoizedProps;if(n=n.compare,n=n!==null?n:lr,n(o,r)&&e.ref===t.ref)return Pt(e,t,l)}return t.flags|=1,e=Xt(u,r),e.ref=t.ref,e.return=t,t.child=e}function ya(e,t,n,r,l){if(e!==null){var u=e.memoizedProps;if(lr(u,r)&&e.ref===t.ref)if(Xe=!1,t.pendingProps=r=u,(e.lanes&l)!==0)(e.flags&131072)!==0&&(Xe=!0);else return t.lanes=e.lanes,Pt(e,t,l)}return co(e,t,n,r,l)}function wa(e,t,n){var r=t.pendingProps,l=r.children,u=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ve(In,tt),tt|=n;else{if((n&1073741824)===0)return e=u!==null?u.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ve(In,tt),tt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=u!==null?u.baseLanes:n,ve(In,tt),tt|=r}else u!==null?(r=u.baseLanes|n,t.memoizedState=null):r=n,ve(In,tt),tt|=r;return We(e,t,l,n),t.child}function xa(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function co(e,t,n,r,l){var u=Ge(n)?tn:Ue.current;return u=Rn(t,u),jn(t,l),n=eo(e,t,n,r,u,l),r=to(),e!==null&&!Xe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Pt(e,t,l)):(Ee&&r&&Fu(t),t.flags|=1,We(e,t,n,l),t.child)}function Sa(e,t,n,r,l){if(Ge(n)){var u=!0;el(t)}else u=!1;if(jn(t,l),t.stateNode===null)yl(e,t),aa(t,n,r),io(t,n,r,l),r=!0;else if(e===null){var o=t.stateNode,i=t.memoizedProps;o.props=i;var a=o.context,v=n.contextType;typeof v=="object"&&v!==null?v=lt(v):(v=Ge(n)?tn:Ue.current,v=Rn(t,v));var S=n.getDerivedStateFromProps,k=typeof S=="function"||typeof o.getSnapshotBeforeUpdate=="function";k||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==r||a!==v)&&ca(t,o,r,v),Vt=!1;var x=t.memoizedState;o.state=x,al(t,r,o,l),a=t.memoizedState,i!==r||x!==a||Ye.current||Vt?(typeof S=="function"&&(oo(t,n,S,r),a=t.memoizedState),(i=Vt||sa(t,n,i,r,x,a,v))?(k||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),o.props=r,o.state=a,o.context=v,r=i):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Fs(e,t),i=t.memoizedProps,v=t.type===t.elementType?i:pt(t.type,i),o.props=v,k=t.pendingProps,x=o.context,a=n.contextType,typeof a=="object"&&a!==null?a=lt(a):(a=Ge(n)?tn:Ue.current,a=Rn(t,a));var M=n.getDerivedStateFromProps;(S=typeof M=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==k||x!==a)&&ca(t,o,r,a),Vt=!1,x=t.memoizedState,o.state=x,al(t,r,o,l);var z=t.memoizedState;i!==k||x!==z||Ye.current||Vt?(typeof M=="function"&&(oo(t,n,M,r),z=t.memoizedState),(v=Vt||sa(t,n,v,r,x,z,a)||!1)?(S||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,z,a),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,z,a)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||i===e.memoizedProps&&x===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&x===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=z),o.props=r,o.state=z,o.context=a,r=v):(typeof o.componentDidUpdate!="function"||i===e.memoizedProps&&x===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&x===e.memoizedState||(t.flags|=1024),r=!1)}return fo(e,t,n,r,u,l)}function fo(e,t,n,r,l,u){xa(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return l&&Rs(t,n,!1),Pt(e,t,u);r=t.stateNode,Ad.current=t;var i=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Pn(t,e.child,null,u),t.child=Pn(t,null,i,u)):We(e,t,i,u),t.memoizedState=r.state,l&&Rs(t,n,!0),t.child}function ka(e){var t=e.stateNode;t.pendingContext?Cs(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Cs(e,t.context,!1),Gu(e,t.containerInfo)}function Ea(e,t,n,r,l){return Ln(),Bu(l),t.flags|=256,We(e,t,n,r),t.child}var po={dehydrated:null,treeContext:null,retryLane:0};function ho(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ca(e,t,n){var r=t.pendingProps,l=Ce.current,u=!1,o=(t.flags&128)!==0,i;if((i=o)||(i=e!==null&&e.memoizedState===null?!1:(l&2)!==0),i?(u=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),ve(Ce,l&1),e===null)return Hu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(o=r.children,e=r.fallback,u?(r=t.mode,u=t.child,o={mode:"hidden",children:o},(r&1)===0&&u!==null?(u.childLanes=0,u.pendingProps=o):u=Pl(o,r,0,null),e=dn(e,r,n,null),u.return=t,e.return=t,u.sibling=e,t.child=u,t.child.memoizedState=ho(n),t.memoizedState=po,e):mo(t,o));if(l=e.memoizedState,l!==null&&(i=l.dehydrated,i!==null))return Ud(e,t,o,r,i,l,n);if(u){u=r.fallback,o=t.mode,l=e.child,i=l.sibling;var a={mode:"hidden",children:r.children};return(o&1)===0&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=Xt(l,a),r.subtreeFlags=l.subtreeFlags&14680064),i!==null?u=Xt(i,u):(u=dn(u,o,n,null),u.flags|=2),u.return=t,r.return=t,r.sibling=u,t.child=r,r=u,u=t.child,o=e.child.memoizedState,o=o===null?ho(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},u.memoizedState=o,u.childLanes=e.childLanes&~n,t.memoizedState=po,r}return u=e.child,e=u.sibling,r=Xt(u,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function mo(e,t){return t=Pl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function gl(e,t,n,r){return r!==null&&Bu(r),Pn(t,e.child,null,n),e=mo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ud(e,t,n,r,l,u,o){if(n)return t.flags&256?(t.flags&=-257,r=so(Error(s(422))),gl(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(u=r.fallback,l=t.mode,r=Pl({mode:"visible",children:r.children},l,0,null),u=dn(u,l,o,null),u.flags|=2,r.return=t,u.return=t,r.sibling=u,t.child=r,(t.mode&1)!==0&&Pn(t,e.child,null,o),t.child.memoizedState=ho(o),t.memoizedState=po,u);if((t.mode&1)===0)return gl(e,t,o,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var i=r.dgst;return r=i,u=Error(s(419)),r=so(u,r,void 0),gl(e,t,o,r)}if(i=(o&e.childLanes)!==0,Xe||i){if(r=Oe,r!==null){switch(o&-o){case 4:l=2;break;case 16:l=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=(l&(r.suspendedLanes|o))!==0?0:l,l!==0&&l!==u.retryLane&&(u.retryLane=l,Tt(e,l),vt(r,e,l,-1))}return Mo(),r=so(Error(s(421))),gl(e,t,o,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=qd.bind(null,e),l._reactRetry=t,null):(e=u.treeContext,et=At(l.nextSibling),be=t,Ee=!0,dt=null,e!==null&&(nt[rt++]=Rt,nt[rt++]=Nt,nt[rt++]=nn,Rt=e.id,Nt=e.overflow,nn=t),t=mo(t,r.children),t.flags|=4096,t)}function _a(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Qu(e.return,t,n)}function vo(e,t,n,r,l){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=r,u.tail=n,u.tailMode=l)}function Ra(e,t,n){var r=t.pendingProps,l=r.revealOrder,u=r.tail;if(We(e,t,r.children,n),r=Ce.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&_a(e,n,t);else if(e.tag===19)_a(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ve(Ce,r),(t.mode&1)===0)t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&cl(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),vo(t,!1,l,n,u);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&cl(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}vo(t,!0,n,null,u);break;case"together":vo(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function yl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Pt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),sn|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,n=Xt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Xt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Hd(e,t,n){switch(t.tag){case 3:ka(t),Ln();break;case 5:Hs(t);break;case 1:Ge(t.type)&&el(t);break;case 4:Gu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;ve(ol,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ve(Ce,Ce.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?Ca(e,t,n):(ve(Ce,Ce.current&1),e=Pt(e,t,n),e!==null?e.sibling:null);ve(Ce,Ce.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return Ra(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),ve(Ce,Ce.current),r)break;return null;case 22:case 23:return t.lanes=0,wa(e,t,n)}return Pt(e,t,n)}var Na,go,Ta,La;Na=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},go=function(){},Ta=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,un(xt.current);var u=null;switch(n){case"input":l=Ql(e,l),r=Ql(e,r),u=[];break;case"select":l=T({},l,{value:void 0}),r=T({},r,{value:void 0}),u=[];break;case"textarea":l=Gl(e,l),r=Gl(e,r),u=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Jr)}Zl(n,r);var o;n=null;for(v in l)if(!r.hasOwnProperty(v)&&l.hasOwnProperty(v)&&l[v]!=null)if(v==="style"){var i=l[v];for(o in i)i.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else v!=="dangerouslySetInnerHTML"&&v!=="children"&&v!=="suppressContentEditableWarning"&&v!=="suppressHydrationWarning"&&v!=="autoFocus"&&(g.hasOwnProperty(v)?u||(u=[]):(u=u||[]).push(v,null));for(v in r){var a=r[v];if(i=l!=null?l[v]:void 0,r.hasOwnProperty(v)&&a!==i&&(a!=null||i!=null))if(v==="style")if(i){for(o in i)!i.hasOwnProperty(o)||a&&a.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in a)a.hasOwnProperty(o)&&i[o]!==a[o]&&(n||(n={}),n[o]=a[o])}else n||(u||(u=[]),u.push(v,n)),n=a;else v==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,i=i?i.__html:void 0,a!=null&&i!==a&&(u=u||[]).push(v,a)):v==="children"?typeof a!="string"&&typeof a!="number"||(u=u||[]).push(v,""+a):v!=="suppressContentEditableWarning"&&v!=="suppressHydrationWarning"&&(g.hasOwnProperty(v)?(a!=null&&v==="onScroll"&&ge("scroll",e),u||i===a||(u=[])):(u=u||[]).push(v,a))}n&&(u=u||[]).push("style",n);var v=u;(t.updateQueue=v)&&(t.flags|=4)}},La=function(e,t,n,r){n!==r&&(t.flags|=4)};function wr(e,t){if(!Ee)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Be(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Bd(e,t,n){var r=t.pendingProps;switch(Au(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Be(t),null;case 1:return Ge(t.type)&&br(),Be(t),null;case 3:return r=t.stateNode,zn(),ye(Ye),ye(Ue),Ju(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ll(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,dt!==null&&(To(dt),dt=null))),go(e,t),Be(t),null;case 5:Xu(t);var l=un(hr.current);if(n=t.type,e!==null&&t.stateNode!=null)Ta(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(s(166));return Be(t),null}if(e=un(xt.current),ll(t)){r=t.stateNode,n=t.type;var u=t.memoizedProps;switch(r[wt]=t,r[ar]=u,e=(t.mode&1)!==0,n){case"dialog":ge("cancel",r),ge("close",r);break;case"iframe":case"object":case"embed":ge("load",r);break;case"video":case"audio":for(l=0;l<or.length;l++)ge(or[l],r);break;case"source":ge("error",r);break;case"img":case"image":case"link":ge("error",r),ge("load",r);break;case"details":ge("toggle",r);break;case"input":ai(r,u),ge("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!u.multiple},ge("invalid",r);break;case"textarea":di(r,u),ge("invalid",r)}Zl(n,u),l=null;for(var o in u)if(u.hasOwnProperty(o)){var i=u[o];o==="children"?typeof i=="string"?r.textContent!==i&&(u.suppressHydrationWarning!==!0&&Zr(r.textContent,i,e),l=["children",i]):typeof i=="number"&&r.textContent!==""+i&&(u.suppressHydrationWarning!==!0&&Zr(r.textContent,i,e),l=["children",""+i]):g.hasOwnProperty(o)&&i!=null&&o==="onScroll"&&ge("scroll",r)}switch(n){case"input":qt(r),fi(r,u,!0);break;case"textarea":qt(r),hi(r);break;case"select":case"option":break;default:typeof u.onClick=="function"&&(r.onclick=Jr)}r=l,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=l.nodeType===9?l:l.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=mi(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[wt]=t,e[ar]=r,Na(e,t,!1,!1),t.stateNode=e;e:{switch(o=Jl(n,r),n){case"dialog":ge("cancel",e),ge("close",e),l=r;break;case"iframe":case"object":case"embed":ge("load",e),l=r;break;case"video":case"audio":for(l=0;l<or.length;l++)ge(or[l],e);l=r;break;case"source":ge("error",e),l=r;break;case"img":case"image":case"link":ge("error",e),ge("load",e),l=r;break;case"details":ge("toggle",e),l=r;break;case"input":ai(e,r),l=Ql(e,r),ge("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=T({},r,{value:void 0}),ge("invalid",e);break;case"textarea":di(e,r),l=Gl(e,r),ge("invalid",e);break;default:l=r}Zl(n,l),i=l;for(u in i)if(i.hasOwnProperty(u)){var a=i[u];u==="style"?yi(e,a):u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&vi(e,a)):u==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Bn(e,a):typeof a=="number"&&Bn(e,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(g.hasOwnProperty(u)?a!=null&&u==="onScroll"&&ge("scroll",e):a!=null&&ae(e,u,a,o))}switch(n){case"input":qt(e),fi(e,r,!1);break;case"textarea":qt(e),hi(e);break;case"option":r.value!=null&&e.setAttribute("value",""+le(r.value));break;case"select":e.multiple=!!r.multiple,u=r.value,u!=null?hn(e,!!r.multiple,u,!1):r.defaultValue!=null&&hn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=Jr)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Be(t),null;case 6:if(e&&t.stateNode!=null)La(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(s(166));if(n=un(hr.current),un(xt.current),ll(t)){if(r=t.stateNode,n=t.memoizedProps,r[wt]=t,(u=r.nodeValue!==n)&&(e=be,e!==null))switch(e.tag){case 3:Zr(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Zr(r.nodeValue,n,(e.mode&1)!==0)}u&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[wt]=t,t.stateNode=r}return Be(t),null;case 13:if(ye(Ce),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ee&&et!==null&&(t.mode&1)!==0&&(t.flags&128)===0)js(),Ln(),t.flags|=98560,u=!1;else if(u=ll(t),r!==null&&r.dehydrated!==null){if(e===null){if(!u)throw Error(s(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(s(317));u[wt]=t}else Ln(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Be(t),u=!1}else dt!==null&&(To(dt),dt=null),u=!0;if(!u)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Ce.current&1)!==0?je===0&&(je=3):Mo())),t.updateQueue!==null&&(t.flags|=4),Be(t),null);case 4:return zn(),go(e,t),e===null&&ir(t.stateNode.containerInfo),Be(t),null;case 10:return $u(t.type._context),Be(t),null;case 17:return Ge(t.type)&&br(),Be(t),null;case 19:if(ye(Ce),u=t.memoizedState,u===null)return Be(t),null;if(r=(t.flags&128)!==0,o=u.rendering,o===null)if(r)wr(u,!1);else{if(je!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=cl(e),o!==null){for(t.flags|=128,wr(u,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)u=n,e=r,u.flags&=14680066,o=u.alternate,o===null?(u.childLanes=0,u.lanes=e,u.child=null,u.subtreeFlags=0,u.memoizedProps=null,u.memoizedState=null,u.updateQueue=null,u.dependencies=null,u.stateNode=null):(u.childLanes=o.childLanes,u.lanes=o.lanes,u.child=o.child,u.subtreeFlags=0,u.deletions=null,u.memoizedProps=o.memoizedProps,u.memoizedState=o.memoizedState,u.updateQueue=o.updateQueue,u.type=o.type,e=o.dependencies,u.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ve(Ce,Ce.current&1|2),t.child}e=e.sibling}u.tail!==null&&Ne()>Fn&&(t.flags|=128,r=!0,wr(u,!1),t.lanes=4194304)}else{if(!r)if(e=cl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),wr(u,!0),u.tail===null&&u.tailMode==="hidden"&&!o.alternate&&!Ee)return Be(t),null}else 2*Ne()-u.renderingStartTime>Fn&&n!==1073741824&&(t.flags|=128,r=!0,wr(u,!1),t.lanes=4194304);u.isBackwards?(o.sibling=t.child,t.child=o):(n=u.last,n!==null?n.sibling=o:t.child=o,u.last=o)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Ne(),t.sibling=null,n=Ce.current,ve(Ce,r?n&1|2:n&1),t):(Be(t),null);case 22:case 23:return Po(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(tt&1073741824)!==0&&(Be(t),t.subtreeFlags&6&&(t.flags|=8192)):Be(t),null;case 24:return null;case 25:return null}throw Error(s(156,t.tag))}function Vd(e,t){switch(Au(t),t.tag){case 1:return Ge(t.type)&&br(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zn(),ye(Ye),ye(Ue),Ju(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Xu(t),null;case 13:if(ye(Ce),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Ln()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ye(Ce),null;case 4:return zn(),null;case 10:return $u(t.type._context),null;case 22:case 23:return Po(),null;case 24:return null;default:return null}}var wl=!1,Ve=!1,Wd=typeof WeakSet=="function"?WeakSet:Set,j=null;function Dn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Re(e,t,r)}else n.current=null}function yo(e,t,n){try{n()}catch(r){Re(e,t,r)}}var Pa=!1;function $d(e,t){if(Lu=Ur,e=ss(),Su(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var o=0,i=-1,a=-1,v=0,S=0,k=e,x=null;t:for(;;){for(var M;k!==n||l!==0&&k.nodeType!==3||(i=o+l),k!==u||r!==0&&k.nodeType!==3||(a=o+r),k.nodeType===3&&(o+=k.nodeValue.length),(M=k.firstChild)!==null;)x=k,k=M;for(;;){if(k===e)break t;if(x===n&&++v===l&&(i=o),x===u&&++S===r&&(a=o),(M=k.nextSibling)!==null)break;k=x,x=k.parentNode}k=M}n=i===-1||a===-1?null:{start:i,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Pu={focusedElem:e,selectionRange:n},Ur=!1,j=t;j!==null;)if(t=j,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,j=e;else for(;j!==null;){t=j;try{var z=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(z!==null){var O=z.memoizedProps,Te=z.memoizedState,p=t.stateNode,c=p.getSnapshotBeforeUpdate(t.elementType===t.type?O:pt(t.type,O),Te);p.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(_){Re(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,j=e;break}j=t.return}return z=Pa,Pa=!1,z}function xr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var u=l.destroy;l.destroy=void 0,u!==void 0&&yo(t,n,u)}l=l.next}while(l!==r)}}function xl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function wo(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ma(e){var t=e.alternate;t!==null&&(e.alternate=null,Ma(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[wt],delete t[ar],delete t[Ou],delete t[Rd],delete t[Nd])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ja(e){return e.tag===5||e.tag===3||e.tag===4}function za(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ja(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function xo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Jr));else if(r!==4&&(e=e.child,e!==null))for(xo(e,t,n),e=e.sibling;e!==null;)xo(e,t,n),e=e.sibling}function So(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(So(e,t,n),e=e.sibling;e!==null;)So(e,t,n),e=e.sibling}var Ie=null,ht=!1;function $t(e,t,n){for(n=n.child;n!==null;)Oa(e,t,n),n=n.sibling}function Oa(e,t,n){if(yt&&typeof yt.onCommitFiberUnmount=="function")try{yt.onCommitFiberUnmount(zr,n)}catch{}switch(n.tag){case 5:Ve||Dn(n,t);case 6:var r=Ie,l=ht;Ie=null,$t(e,t,n),Ie=r,ht=l,Ie!==null&&(ht?(e=Ie,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ie.removeChild(n.stateNode));break;case 18:Ie!==null&&(ht?(e=Ie,n=n.stateNode,e.nodeType===8?zu(e.parentNode,n):e.nodeType===1&&zu(e,n),qn(e)):zu(Ie,n.stateNode));break;case 4:r=Ie,l=ht,Ie=n.stateNode.containerInfo,ht=!0,$t(e,t,n),Ie=r,ht=l;break;case 0:case 11:case 14:case 15:if(!Ve&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var u=l,o=u.destroy;u=u.tag,o!==void 0&&((u&2)!==0||(u&4)!==0)&&yo(n,t,o),l=l.next}while(l!==r)}$t(e,t,n);break;case 1:if(!Ve&&(Dn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(i){Re(n,t,i)}$t(e,t,n);break;case 21:$t(e,t,n);break;case 22:n.mode&1?(Ve=(r=Ve)||n.memoizedState!==null,$t(e,t,n),Ve=r):$t(e,t,n);break;default:$t(e,t,n)}}function Da(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Wd),t.forEach(function(r){var l=bd.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function mt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var l=n[r];try{var u=e,o=t,i=o;e:for(;i!==null;){switch(i.tag){case 5:Ie=i.stateNode,ht=!1;break e;case 3:Ie=i.stateNode.containerInfo,ht=!0;break e;case 4:Ie=i.stateNode.containerInfo,ht=!0;break e}i=i.return}if(Ie===null)throw Error(s(160));Oa(u,o,l),Ie=null,ht=!1;var a=l.alternate;a!==null&&(a.return=null),l.return=null}catch(v){Re(l,t,v)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Ia(t,e),t=t.sibling}function Ia(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(mt(t,e),kt(e),r&4){try{xr(3,e,e.return),xl(3,e)}catch(O){Re(e,e.return,O)}try{xr(5,e,e.return)}catch(O){Re(e,e.return,O)}}break;case 1:mt(t,e),kt(e),r&512&&n!==null&&Dn(n,n.return);break;case 5:if(mt(t,e),kt(e),r&512&&n!==null&&Dn(n,n.return),e.flags&32){var l=e.stateNode;try{Bn(l,"")}catch(O){Re(e,e.return,O)}}if(r&4&&(l=e.stateNode,l!=null)){var u=e.memoizedProps,o=n!==null?n.memoizedProps:u,i=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{i==="input"&&u.type==="radio"&&u.name!=null&&ci(l,u),Jl(i,o);var v=Jl(i,u);for(o=0;o<a.length;o+=2){var S=a[o],k=a[o+1];S==="style"?yi(l,k):S==="dangerouslySetInnerHTML"?vi(l,k):S==="children"?Bn(l,k):ae(l,S,k,v)}switch(i){case"input":Kl(l,u);break;case"textarea":pi(l,u);break;case"select":var x=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!u.multiple;var M=u.value;M!=null?hn(l,!!u.multiple,M,!1):x!==!!u.multiple&&(u.defaultValue!=null?hn(l,!!u.multiple,u.defaultValue,!0):hn(l,!!u.multiple,u.multiple?[]:"",!1))}l[ar]=u}catch(O){Re(e,e.return,O)}}break;case 6:if(mt(t,e),kt(e),r&4){if(e.stateNode===null)throw Error(s(162));l=e.stateNode,u=e.memoizedProps;try{l.nodeValue=u}catch(O){Re(e,e.return,O)}}break;case 3:if(mt(t,e),kt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{qn(t.containerInfo)}catch(O){Re(e,e.return,O)}break;case 4:mt(t,e),kt(e);break;case 13:mt(t,e),kt(e),l=e.child,l.flags&8192&&(u=l.memoizedState!==null,l.stateNode.isHidden=u,!u||l.alternate!==null&&l.alternate.memoizedState!==null||(Co=Ne())),r&4&&Da(e);break;case 22:if(S=n!==null&&n.memoizedState!==null,e.mode&1?(Ve=(v=Ve)||S,mt(t,e),Ve=v):mt(t,e),kt(e),r&8192){if(v=e.memoizedState!==null,(e.stateNode.isHidden=v)&&!S&&(e.mode&1)!==0)for(j=e,S=e.child;S!==null;){for(k=j=S;j!==null;){switch(x=j,M=x.child,x.tag){case 0:case 11:case 14:case 15:xr(4,x,x.return);break;case 1:Dn(x,x.return);var z=x.stateNode;if(typeof z.componentWillUnmount=="function"){r=x,n=x.return;try{t=r,z.props=t.memoizedProps,z.state=t.memoizedState,z.componentWillUnmount()}catch(O){Re(r,n,O)}}break;case 5:Dn(x,x.return);break;case 22:if(x.memoizedState!==null){Ua(k);continue}}M!==null?(M.return=x,j=M):Ua(k)}S=S.sibling}e:for(S=null,k=e;;){if(k.tag===5){if(S===null){S=k;try{l=k.stateNode,v?(u=l.style,typeof u.setProperty=="function"?u.setProperty("display","none","important"):u.display="none"):(i=k.stateNode,a=k.memoizedProps.style,o=a!=null&&a.hasOwnProperty("display")?a.display:null,i.style.display=gi("display",o))}catch(O){Re(e,e.return,O)}}}else if(k.tag===6){if(S===null)try{k.stateNode.nodeValue=v?"":k.memoizedProps}catch(O){Re(e,e.return,O)}}else if((k.tag!==22&&k.tag!==23||k.memoizedState===null||k===e)&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===e)break e;for(;k.sibling===null;){if(k.return===null||k.return===e)break e;S===k&&(S=null),k=k.return}S===k&&(S=null),k.sibling.return=k.return,k=k.sibling}}break;case 19:mt(t,e),kt(e),r&4&&Da(e);break;case 21:break;default:mt(t,e),kt(e)}}function kt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(ja(n)){var r=n;break e}n=n.return}throw Error(s(160))}switch(r.tag){case 5:var l=r.stateNode;r.flags&32&&(Bn(l,""),r.flags&=-33);var u=za(e);So(e,u,l);break;case 3:case 4:var o=r.stateNode.containerInfo,i=za(e);xo(e,i,o);break;default:throw Error(s(161))}}catch(a){Re(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Qd(e,t,n){j=e,Fa(e)}function Fa(e,t,n){for(var r=(e.mode&1)!==0;j!==null;){var l=j,u=l.child;if(l.tag===22&&r){var o=l.memoizedState!==null||wl;if(!o){var i=l.alternate,a=i!==null&&i.memoizedState!==null||Ve;i=wl;var v=Ve;if(wl=o,(Ve=a)&&!v)for(j=l;j!==null;)o=j,a=o.child,o.tag===22&&o.memoizedState!==null?Ha(l):a!==null?(a.return=o,j=a):Ha(l);for(;u!==null;)j=u,Fa(u),u=u.sibling;j=l,wl=i,Ve=v}Aa(e)}else(l.subtreeFlags&8772)!==0&&u!==null?(u.return=l,j=u):Aa(e)}}function Aa(e){for(;j!==null;){var t=j;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Ve||xl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ve)if(n===null)r.componentDidMount();else{var l=t.elementType===t.type?n.memoizedProps:pt(t.type,n.memoizedProps);r.componentDidUpdate(l,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var u=t.updateQueue;u!==null&&Us(t,u,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Us(t,o,n)}break;case 5:var i=t.stateNode;if(n===null&&t.flags&4){n=i;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var v=t.alternate;if(v!==null){var S=v.memoizedState;if(S!==null){var k=S.dehydrated;k!==null&&qn(k)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}Ve||t.flags&512&&wo(t)}catch(x){Re(t,t.return,x)}}if(t===e){j=null;break}if(n=t.sibling,n!==null){n.return=t.return,j=n;break}j=t.return}}function Ua(e){for(;j!==null;){var t=j;if(t===e){j=null;break}var n=t.sibling;if(n!==null){n.return=t.return,j=n;break}j=t.return}}function Ha(e){for(;j!==null;){var t=j;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{xl(4,t)}catch(a){Re(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var l=t.return;try{r.componentDidMount()}catch(a){Re(t,l,a)}}var u=t.return;try{wo(t)}catch(a){Re(t,u,a)}break;case 5:var o=t.return;try{wo(t)}catch(a){Re(t,o,a)}}}catch(a){Re(t,t.return,a)}if(t===e){j=null;break}var i=t.sibling;if(i!==null){i.return=t.return,j=i;break}j=t.return}}var Kd=Math.ceil,Sl=ce.ReactCurrentDispatcher,ko=ce.ReactCurrentOwner,ot=ce.ReactCurrentBatchConfig,ne=0,Oe=null,Pe=null,Fe=0,tt=0,In=Ut(0),je=0,Sr=null,sn=0,kl=0,Eo=0,kr=null,Ze=null,Co=0,Fn=1/0,Mt=null,El=!1,_o=null,Qt=null,Cl=!1,Kt=null,_l=0,Er=0,Ro=null,Rl=-1,Nl=0;function $e(){return(ne&6)!==0?Ne():Rl!==-1?Rl:Rl=Ne()}function Yt(e){return(e.mode&1)===0?1:(ne&2)!==0&&Fe!==0?Fe&-Fe:Ld.transition!==null?(Nl===0&&(Nl=zi()),Nl):(e=se,e!==0||(e=window.event,e=e===void 0?16:Vi(e.type)),e)}function vt(e,t,n,r){if(50<Er)throw Er=0,Ro=null,Error(s(185));Yn(e,n,r),((ne&2)===0||e!==Oe)&&(e===Oe&&((ne&2)===0&&(kl|=n),je===4&&Gt(e,Fe)),Je(e,r),n===1&&ne===0&&(t.mode&1)===0&&(Fn=Ne()+500,tl&&Bt()))}function Je(e,t){var n=e.callbackNode;Lf(e,t);var r=Ir(e,e===Oe?Fe:0);if(r===0)n!==null&&Pi(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Pi(n),t===1)e.tag===0?Td(Va.bind(null,e)):Ns(Va.bind(null,e)),Cd(function(){(ne&6)===0&&Bt()}),n=null;else{switch(Oi(r)){case 1:n=lu;break;case 4:n=Mi;break;case 16:n=jr;break;case 536870912:n=ji;break;default:n=jr}n=Za(n,Ba.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Ba(e,t){if(Rl=-1,Nl=0,(ne&6)!==0)throw Error(s(327));var n=e.callbackNode;if(An()&&e.callbackNode!==n)return null;var r=Ir(e,e===Oe?Fe:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=Tl(e,r);else{t=r;var l=ne;ne|=2;var u=$a();(Oe!==e||Fe!==t)&&(Mt=null,Fn=Ne()+500,cn(e,t));do try{Xd();break}catch(i){Wa(e,i)}while(!0);Wu(),Sl.current=u,ne=l,Pe!==null?t=0:(Oe=null,Fe=0,t=je)}if(t!==0){if(t===2&&(l=uu(e),l!==0&&(r=l,t=No(e,l))),t===1)throw n=Sr,cn(e,0),Gt(e,r),Je(e,Ne()),n;if(t===6)Gt(e,r);else{if(l=e.current.alternate,(r&30)===0&&!Yd(l)&&(t=Tl(e,r),t===2&&(u=uu(e),u!==0&&(r=u,t=No(e,u))),t===1))throw n=Sr,cn(e,0),Gt(e,r),Je(e,Ne()),n;switch(e.finishedWork=l,e.finishedLanes=r,t){case 0:case 1:throw Error(s(345));case 2:fn(e,Ze,Mt);break;case 3:if(Gt(e,r),(r&130023424)===r&&(t=Co+500-Ne(),10<t)){if(Ir(e,0)!==0)break;if(l=e.suspendedLanes,(l&r)!==r){$e(),e.pingedLanes|=e.suspendedLanes&l;break}e.timeoutHandle=ju(fn.bind(null,e,Ze,Mt),t);break}fn(e,Ze,Mt);break;case 4:if(Gt(e,r),(r&4194240)===r)break;for(t=e.eventTimes,l=-1;0<r;){var o=31-ct(r);u=1<<o,o=t[o],o>l&&(l=o),r&=~u}if(r=l,r=Ne()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Kd(r/1960))-r,10<r){e.timeoutHandle=ju(fn.bind(null,e,Ze,Mt),r);break}fn(e,Ze,Mt);break;case 5:fn(e,Ze,Mt);break;default:throw Error(s(329))}}}return Je(e,Ne()),e.callbackNode===n?Ba.bind(null,e):null}function No(e,t){var n=kr;return e.current.memoizedState.isDehydrated&&(cn(e,t).flags|=256),e=Tl(e,t),e!==2&&(t=Ze,Ze=n,t!==null&&To(t)),e}function To(e){Ze===null?Ze=e:Ze.push.apply(Ze,e)}function Yd(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var l=n[r],u=l.getSnapshot;l=l.value;try{if(!ft(u(),l))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Gt(e,t){for(t&=~Eo,t&=~kl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ct(t),r=1<<n;e[n]=-1,t&=~r}}function Va(e){if((ne&6)!==0)throw Error(s(327));An();var t=Ir(e,0);if((t&1)===0)return Je(e,Ne()),null;var n=Tl(e,t);if(e.tag!==0&&n===2){var r=uu(e);r!==0&&(t=r,n=No(e,r))}if(n===1)throw n=Sr,cn(e,0),Gt(e,t),Je(e,Ne()),n;if(n===6)throw Error(s(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,fn(e,Ze,Mt),Je(e,Ne()),null}function Lo(e,t){var n=ne;ne|=1;try{return e(t)}finally{ne=n,ne===0&&(Fn=Ne()+500,tl&&Bt())}}function an(e){Kt!==null&&Kt.tag===0&&(ne&6)===0&&An();var t=ne;ne|=1;var n=ot.transition,r=se;try{if(ot.transition=null,se=1,e)return e()}finally{se=r,ot.transition=n,ne=t,(ne&6)===0&&Bt()}}function Po(){tt=In.current,ye(In)}function cn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Ed(n)),Pe!==null)for(n=Pe.return;n!==null;){var r=n;switch(Au(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&br();break;case 3:zn(),ye(Ye),ye(Ue),Ju();break;case 5:Xu(r);break;case 4:zn();break;case 13:ye(Ce);break;case 19:ye(Ce);break;case 10:$u(r.type._context);break;case 22:case 23:Po()}n=n.return}if(Oe=e,Pe=e=Xt(e.current,null),Fe=tt=t,je=0,Sr=null,Eo=kl=sn=0,Ze=kr=null,ln!==null){for(t=0;t<ln.length;t++)if(n=ln[t],r=n.interleaved,r!==null){n.interleaved=null;var l=r.next,u=n.pending;if(u!==null){var o=u.next;u.next=l,r.next=o}n.pending=r}ln=null}return e}function Wa(e,t){do{var n=Pe;try{if(Wu(),fl.current=ml,dl){for(var r=_e.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}dl=!1}if(on=0,ze=Me=_e=null,mr=!1,vr=0,ko.current=null,n===null||n.return===null){je=1,Sr=t,Pe=null;break}e:{var u=e,o=n.return,i=n,a=t;if(t=Fe,i.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var v=a,S=i,k=S.tag;if((S.mode&1)===0&&(k===0||k===11||k===15)){var x=S.alternate;x?(S.updateQueue=x.updateQueue,S.memoizedState=x.memoizedState,S.lanes=x.lanes):(S.updateQueue=null,S.memoizedState=null)}var M=ha(o);if(M!==null){M.flags&=-257,ma(M,o,i,u,t),M.mode&1&&pa(u,v,t),t=M,a=v;var z=t.updateQueue;if(z===null){var O=new Set;O.add(a),t.updateQueue=O}else z.add(a);break e}else{if((t&1)===0){pa(u,v,t),Mo();break e}a=Error(s(426))}}else if(Ee&&i.mode&1){var Te=ha(o);if(Te!==null){(Te.flags&65536)===0&&(Te.flags|=256),ma(Te,o,i,u,t),Bu(On(a,i));break e}}u=a=On(a,i),je!==4&&(je=2),kr===null?kr=[u]:kr.push(u),u=o;do{switch(u.tag){case 3:u.flags|=65536,t&=-t,u.lanes|=t;var p=fa(u,a,t);As(u,p);break e;case 1:i=a;var c=u.type,m=u.stateNode;if((u.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Qt===null||!Qt.has(m)))){u.flags|=65536,t&=-t,u.lanes|=t;var _=da(u,i,t);As(u,_);break e}}u=u.return}while(u!==null)}Ka(n)}catch(I){t=I,Pe===n&&n!==null&&(Pe=n=n.return);continue}break}while(!0)}function $a(){var e=Sl.current;return Sl.current=ml,e===null?ml:e}function Mo(){(je===0||je===3||je===2)&&(je=4),Oe===null||(sn&268435455)===0&&(kl&268435455)===0||Gt(Oe,Fe)}function Tl(e,t){var n=ne;ne|=2;var r=$a();(Oe!==e||Fe!==t)&&(Mt=null,cn(e,t));do try{Gd();break}catch(l){Wa(e,l)}while(!0);if(Wu(),ne=n,Sl.current=r,Pe!==null)throw Error(s(261));return Oe=null,Fe=0,je}function Gd(){for(;Pe!==null;)Qa(Pe)}function Xd(){for(;Pe!==null&&!xf();)Qa(Pe)}function Qa(e){var t=Xa(e.alternate,e,tt);e.memoizedProps=e.pendingProps,t===null?Ka(e):Pe=t,ko.current=null}function Ka(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=Bd(n,t,tt),n!==null){Pe=n;return}}else{if(n=Vd(n,t),n!==null){n.flags&=32767,Pe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{je=6,Pe=null;return}}if(t=t.sibling,t!==null){Pe=t;return}Pe=t=e}while(t!==null);je===0&&(je=5)}function fn(e,t,n){var r=se,l=ot.transition;try{ot.transition=null,se=1,Zd(e,t,n,r)}finally{ot.transition=l,se=r}return null}function Zd(e,t,n,r){do An();while(Kt!==null);if((ne&6)!==0)throw Error(s(327));n=e.finishedWork;var l=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(s(177));e.callbackNode=null,e.callbackPriority=0;var u=n.lanes|n.childLanes;if(Pf(e,u),e===Oe&&(Pe=Oe=null,Fe=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Cl||(Cl=!0,Za(jr,function(){return An(),null})),u=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||u){u=ot.transition,ot.transition=null;var o=se;se=1;var i=ne;ne|=4,ko.current=null,$d(e,n),Ia(n,e),vd(Pu),Ur=!!Lu,Pu=Lu=null,e.current=n,Qd(n),Sf(),ne=i,se=o,ot.transition=u}else e.current=n;if(Cl&&(Cl=!1,Kt=e,_l=l),u=e.pendingLanes,u===0&&(Qt=null),Cf(n.stateNode),Je(e,Ne()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)l=t[n],r(l.value,{componentStack:l.stack,digest:l.digest});if(El)throw El=!1,e=_o,_o=null,e;return(_l&1)!==0&&e.tag!==0&&An(),u=e.pendingLanes,(u&1)!==0?e===Ro?Er++:(Er=0,Ro=e):Er=0,Bt(),null}function An(){if(Kt!==null){var e=Oi(_l),t=ot.transition,n=se;try{if(ot.transition=null,se=16>e?16:e,Kt===null)var r=!1;else{if(e=Kt,Kt=null,_l=0,(ne&6)!==0)throw Error(s(331));var l=ne;for(ne|=4,j=e.current;j!==null;){var u=j,o=u.child;if((j.flags&16)!==0){var i=u.deletions;if(i!==null){for(var a=0;a<i.length;a++){var v=i[a];for(j=v;j!==null;){var S=j;switch(S.tag){case 0:case 11:case 15:xr(8,S,u)}var k=S.child;if(k!==null)k.return=S,j=k;else for(;j!==null;){S=j;var x=S.sibling,M=S.return;if(Ma(S),S===v){j=null;break}if(x!==null){x.return=M,j=x;break}j=M}}}var z=u.alternate;if(z!==null){var O=z.child;if(O!==null){z.child=null;do{var Te=O.sibling;O.sibling=null,O=Te}while(O!==null)}}j=u}}if((u.subtreeFlags&2064)!==0&&o!==null)o.return=u,j=o;else e:for(;j!==null;){if(u=j,(u.flags&2048)!==0)switch(u.tag){case 0:case 11:case 15:xr(9,u,u.return)}var p=u.sibling;if(p!==null){p.return=u.return,j=p;break e}j=u.return}}var c=e.current;for(j=c;j!==null;){o=j;var m=o.child;if((o.subtreeFlags&2064)!==0&&m!==null)m.return=o,j=m;else e:for(o=c;j!==null;){if(i=j,(i.flags&2048)!==0)try{switch(i.tag){case 0:case 11:case 15:xl(9,i)}}catch(I){Re(i,i.return,I)}if(i===o){j=null;break e}var _=i.sibling;if(_!==null){_.return=i.return,j=_;break e}j=i.return}}if(ne=l,Bt(),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(zr,e)}catch{}r=!0}return r}finally{se=n,ot.transition=t}}return!1}function Ya(e,t,n){t=On(n,t),t=fa(e,t,1),e=Wt(e,t,1),t=$e(),e!==null&&(Yn(e,1,t),Je(e,t))}function Re(e,t,n){if(e.tag===3)Ya(e,e,n);else for(;t!==null;){if(t.tag===3){Ya(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Qt===null||!Qt.has(r))){e=On(n,e),e=da(t,e,1),t=Wt(t,e,1),e=$e(),t!==null&&(Yn(t,1,e),Je(t,e));break}}t=t.return}}function Jd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=$e(),e.pingedLanes|=e.suspendedLanes&n,Oe===e&&(Fe&n)===n&&(je===4||je===3&&(Fe&130023424)===Fe&&500>Ne()-Co?cn(e,0):Eo|=n),Je(e,t)}function Ga(e,t){t===0&&((e.mode&1)===0?t=1:(t=Dr,Dr<<=1,(Dr&130023424)===0&&(Dr=4194304)));var n=$e();e=Tt(e,t),e!==null&&(Yn(e,t,n),Je(e,n))}function qd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ga(e,n)}function bd(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(s(314))}r!==null&&r.delete(t),Ga(e,n)}var Xa;Xa=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ye.current)Xe=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return Xe=!1,Hd(e,t,n);Xe=(e.flags&131072)!==0}else Xe=!1,Ee&&(t.flags&1048576)!==0&&Ts(t,rl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;yl(e,t),e=t.pendingProps;var l=Rn(t,Ue.current);jn(t,n),l=eo(null,t,r,e,l,n);var u=to();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ge(r)?(u=!0,el(t)):u=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Yu(t),l.updater=vl,t.stateNode=l,l._reactInternals=t,io(t,r,e,n),t=fo(null,t,r,!0,u,n)):(t.tag=0,Ee&&u&&Fu(t),We(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(yl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=tp(r),e=pt(r,e),l){case 0:t=co(null,t,r,e,n);break e;case 1:t=Sa(null,t,r,e,n);break e;case 11:t=va(null,t,r,e,n);break e;case 14:t=ga(null,t,r,pt(r.type,e),n);break e}throw Error(s(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:pt(r,l),co(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:pt(r,l),Sa(e,t,r,l,n);case 3:e:{if(ka(t),e===null)throw Error(s(387));r=t.pendingProps,u=t.memoizedState,l=u.element,Fs(e,t),al(t,r,null,n);var o=t.memoizedState;if(r=o.element,u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){l=On(Error(s(423)),t),t=Ea(e,t,r,n,l);break e}else if(r!==l){l=On(Error(s(424)),t),t=Ea(e,t,r,n,l);break e}else for(et=At(t.stateNode.containerInfo.firstChild),be=t,Ee=!0,dt=null,n=Ds(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ln(),r===l){t=Pt(e,t,n);break e}We(e,t,r,n)}t=t.child}return t;case 5:return Hs(t),e===null&&Hu(t),r=t.type,l=t.pendingProps,u=e!==null?e.memoizedProps:null,o=l.children,Mu(r,l)?o=null:u!==null&&Mu(r,u)&&(t.flags|=32),xa(e,t),We(e,t,o,n),t.child;case 6:return e===null&&Hu(t),null;case 13:return Ca(e,t,n);case 4:return Gu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pn(t,null,r,n):We(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:pt(r,l),va(e,t,r,l,n);case 7:return We(e,t,t.pendingProps,n),t.child;case 8:return We(e,t,t.pendingProps.children,n),t.child;case 12:return We(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,u=t.memoizedProps,o=l.value,ve(ol,r._currentValue),r._currentValue=o,u!==null)if(ft(u.value,o)){if(u.children===l.children&&!Ye.current){t=Pt(e,t,n);break e}}else for(u=t.child,u!==null&&(u.return=t);u!==null;){var i=u.dependencies;if(i!==null){o=u.child;for(var a=i.firstContext;a!==null;){if(a.context===r){if(u.tag===1){a=Lt(-1,n&-n),a.tag=2;var v=u.updateQueue;if(v!==null){v=v.shared;var S=v.pending;S===null?a.next=a:(a.next=S.next,S.next=a),v.pending=a}}u.lanes|=n,a=u.alternate,a!==null&&(a.lanes|=n),Qu(u.return,n,t),i.lanes|=n;break}a=a.next}}else if(u.tag===10)o=u.type===t.type?null:u.child;else if(u.tag===18){if(o=u.return,o===null)throw Error(s(341));o.lanes|=n,i=o.alternate,i!==null&&(i.lanes|=n),Qu(o,n,t),o=u.sibling}else o=u.child;if(o!==null)o.return=u;else for(o=u;o!==null;){if(o===t){o=null;break}if(u=o.sibling,u!==null){u.return=o.return,o=u;break}o=o.return}u=o}We(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,jn(t,n),l=lt(l),r=r(l),t.flags|=1,We(e,t,r,n),t.child;case 14:return r=t.type,l=pt(r,t.pendingProps),l=pt(r.type,l),ga(e,t,r,l,n);case 15:return ya(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:pt(r,l),yl(e,t),t.tag=1,Ge(r)?(e=!0,el(t)):e=!1,jn(t,n),aa(t,r,l),io(t,r,l,n),fo(null,t,r,!0,e,n);case 19:return Ra(e,t,n);case 22:return wa(e,t,n)}throw Error(s(156,t.tag))};function Za(e,t){return Li(e,t)}function ep(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function it(e,t,n,r){return new ep(e,t,n,r)}function jo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function tp(e){if(typeof e=="function")return jo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ke)return 11;if(e===Se)return 14}return 2}function Xt(e,t){var n=e.alternate;return n===null?(n=it(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ll(e,t,n,r,l,u){var o=2;if(r=e,typeof e=="function")jo(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case fe:return dn(n.children,l,u,t);case Le:o=8,l|=8;break;case b:return e=it(12,n,t,l|2),e.elementType=b,e.lanes=u,e;case Y:return e=it(13,n,t,l),e.elementType=Y,e.lanes=u,e;case J:return e=it(19,n,t,l),e.elementType=J,e.lanes=u,e;case oe:return Pl(n,l,u,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ae:o=10;break e;case at:o=9;break e;case Ke:o=11;break e;case Se:o=14;break e;case ie:o=16,r=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return t=it(o,n,t,l),t.elementType=e,t.type=r,t.lanes=u,t}function dn(e,t,n,r){return e=it(7,e,r,t),e.lanes=n,e}function Pl(e,t,n,r){return e=it(22,e,r,t),e.elementType=oe,e.lanes=n,e.stateNode={isHidden:!1},e}function zo(e,t,n){return e=it(6,e,null,t),e.lanes=n,e}function Oo(e,t,n){return t=it(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function np(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ou(0),this.expirationTimes=ou(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ou(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Do(e,t,n,r,l,u,o,i,a){return e=new np(e,t,n,i,a),t===1?(t=1,u===!0&&(t|=8)):t=0,u=it(3,null,null,t),e.current=u,u.stateNode=e,u.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yu(u),e}function rp(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:he,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Ja(e){if(!e)return Ht;e=e._reactInternals;e:{if(bt(e)!==e||e.tag!==1)throw Error(s(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ge(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(s(171))}if(e.tag===1){var n=e.type;if(Ge(n))return _s(e,n,t)}return t}function qa(e,t,n,r,l,u,o,i,a){return e=Do(n,r,!0,e,l,u,o,i,a),e.context=Ja(null),n=e.current,r=$e(),l=Yt(n),u=Lt(r,l),u.callback=t??null,Wt(n,u,l),e.current.lanes=l,Yn(e,l,r),Je(e,r),e}function Ml(e,t,n,r){var l=t.current,u=$e(),o=Yt(l);return n=Ja(n),t.context===null?t.context=n:t.pendingContext=n,t=Lt(u,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Wt(l,t,o),e!==null&&(vt(e,l,o,u),sl(e,l,o)),o}function jl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function ba(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Io(e,t){ba(e,t),(e=e.alternate)&&ba(e,t)}function lp(){return null}var ec=typeof reportError=="function"?reportError:function(e){console.error(e)};function Fo(e){this._internalRoot=e}zl.prototype.render=Fo.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));Ml(e,t,null,null)},zl.prototype.unmount=Fo.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;an(function(){Ml(null,e,null,null)}),t[Ct]=null}};function zl(e){this._internalRoot=e}zl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Fi();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dt.length&&t!==0&&t<Dt[n].priority;n++);Dt.splice(n,0,e),n===0&&Hi(e)}};function Ao(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ol(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function tc(){}function up(e,t,n,r,l){if(l){if(typeof r=="function"){var u=r;r=function(){var v=jl(o);u.call(v)}}var o=qa(t,r,e,0,null,!1,!1,"",tc);return e._reactRootContainer=o,e[Ct]=o.current,ir(e.nodeType===8?e.parentNode:e),an(),o}for(;l=e.lastChild;)e.removeChild(l);if(typeof r=="function"){var i=r;r=function(){var v=jl(a);i.call(v)}}var a=Do(e,0,!1,null,null,!1,!1,"",tc);return e._reactRootContainer=a,e[Ct]=a.current,ir(e.nodeType===8?e.parentNode:e),an(function(){Ml(t,a,n,r)}),a}function Dl(e,t,n,r,l){var u=n._reactRootContainer;if(u){var o=u;if(typeof l=="function"){var i=l;l=function(){var a=jl(o);i.call(a)}}Ml(t,o,e,l)}else o=up(n,t,e,l,r);return jl(o)}Di=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Kn(t.pendingLanes);n!==0&&(iu(t,n|1),Je(t,Ne()),(ne&6)===0&&(Fn=Ne()+500,Bt()))}break;case 13:an(function(){var r=Tt(e,1);if(r!==null){var l=$e();vt(r,e,1,l)}}),Io(e,1)}},su=function(e){if(e.tag===13){var t=Tt(e,134217728);if(t!==null){var n=$e();vt(t,e,134217728,n)}Io(e,134217728)}},Ii=function(e){if(e.tag===13){var t=Yt(e),n=Tt(e,t);if(n!==null){var r=$e();vt(n,e,t,r)}Io(e,t)}},Fi=function(){return se},Ai=function(e,t){var n=se;try{return se=e,t()}finally{se=n}},eu=function(e,t,n){switch(t){case"input":if(Kl(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var l=qr(r);if(!l)throw Error(s(90));Nr(r),Kl(r,l)}}}break;case"textarea":pi(e,n);break;case"select":t=n.value,t!=null&&hn(e,!!n.multiple,t,!1)}},ki=Lo,Ei=an;var op={usingClientEntryPoint:!1,Events:[cr,Cn,qr,xi,Si,Lo]},Cr={findFiberByHostInstance:en,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ip={bundleType:Cr.bundleType,version:Cr.version,rendererPackageName:Cr.rendererPackageName,rendererConfig:Cr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ce.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Ni(e),e===null?null:e.stateNode},findFiberByHostInstance:Cr.findFiberByHostInstance||lp,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Il=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Il.isDisabled&&Il.supportsFiber)try{zr=Il.inject(ip),yt=Il}catch{}}return Qe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=op,Qe.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ao(t))throw Error(s(200));return rp(e,t,null,n)},Qe.createRoot=function(e,t){if(!Ao(e))throw Error(s(299));var n=!1,r="",l=ec;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=Do(e,1,!1,null,null,n,!1,r,l),e[Ct]=t.current,ir(e.nodeType===8?e.parentNode:e),new Fo(t)},Qe.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=Ni(t),e=e===null?null:e.stateNode,e},Qe.flushSync=function(e){return an(e)},Qe.hydrate=function(e,t,n){if(!Ol(t))throw Error(s(200));return Dl(null,e,t,!0,n)},Qe.hydrateRoot=function(e,t,n){if(!Ao(e))throw Error(s(405));var r=n!=null&&n.hydratedSources||null,l=!1,u="",o=ec;if(n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=qa(t,null,e,1,n??null,l,!1,u,o),e[Ct]=t.current,ir(e),r)for(e=0;e<r.length;e++)n=r[e],l=n._getVersion,l=l(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,l]:t.mutableSourceEagerHydrationData.push(n,l);return new zl(t)},Qe.render=function(e,t,n){if(!Ol(t))throw Error(s(200));return Dl(null,e,t,!1,n)},Qe.unmountComponentAtNode=function(e){if(!Ol(e))throw Error(s(40));return e._reactRootContainer?(an(function(){Dl(null,null,e,!1,function(){e._reactRootContainer=null,e[Ct]=null})}),!0):!1},Qe.unstable_batchedUpdates=Lo,Qe.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ol(n))throw Error(s(200));if(e==null||e._reactInternals===void 0)throw Error(s(38));return Dl(e,t,n,!1,r)},Qe.version="18.3.1-next-f1338f8080-20240426",Qe}var Ko;function sc(){if(Ko)return Ul.exports;Ko=1;function f(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f)}catch(h){console.error(h)}}return f(),Ul.exports=ic(),Ul.exports}var Yo;function ac(){if(Yo)return _r;Yo=1;var f=sc();return _r.createRoot=f.createRoot,_r.hydrateRoot=f.hydrateRoot,_r}var Go=ac(),D=Al();class pn extends Error{constructor(h,s,y,g){super(h),this.status=s,this.code=y,this.retryAfter=g,this.name="ChatApiError"}}class Xo extends Error{constructor(){super("Request debounced"),this.name="DebounceError"}}const cc=3e4;class fc{constructor(h,s){Jt(this,"baseUrl");Jt(this,"maxRetries");Jt(this,"debounceMs");Jt(this,"timeoutMs");Jt(this,"lastSendTime",0);this.baseUrl=h,this.maxRetries=(s==null?void 0:s.maxRetries)??2,this.debounceMs=(s==null?void 0:s.debounceMs)??300,this.timeoutMs=(s==null?void 0:s.timeoutMs)??cc}async sendMessage(h){if(this.debounceMs>0&&Date.now()-this.lastSendTime<this.debounceMs)throw new Xo;this.lastSendTime=Date.now();let s;for(let y=0;y<=this.maxRetries;y++)try{const g=await this.fetchWithTimeout(h);if(g.ok)return await g.json();const E=await g.json().catch(()=>({})),L=g.headers.get("Retry-After"),P=L?Number(L):void 0;if(s=new pn(E.error??`Request failed with status ${g.status}`,g.status,E.code,P),!this.isRetryable(g.status))throw s;if(y<this.maxRetries){const N=this.getRetryDelay(g,y);await this.delay(N)}}catch(g){if(g instanceof pn){if(!this.isRetryable(g.status,g.code))throw g;if(s=g,y<this.maxRetries){const E=this.getRetryDelay(null,y);await this.delay(E)}}else if(s=new pn("Failed to connect. Please try again.",0,"NETWORK_ERROR"),y<this.maxRetries){const E=this.getRetryDelay(null,y);await this.delay(E)}}throw s}async fetchWithTimeout(h){if(this.timeoutMs<=0)return fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:h})});const s=new AbortController,y=setTimeout(()=>s.abort(),this.timeoutMs);try{return await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:h}),signal:s.signal})}catch(g){throw s.signal.aborted?new pn("Request timed out. Please try again.",0,"TIMEOUT"):g}finally{clearTimeout(y)}}isRetryable(h,s){return s==="TIMEOUT"||s==="NETWORK_ERROR"?!0:h===429||h===503}getRetryDelay(h,s){if(h&&h.status===429){const y=h.headers.get("Retry-After");if(y){const g=Number(y);return Math.min(g*1e3,6e4)}}return s===0?1e3:3e3}delay(h){return new Promise(s=>setTimeout(s,h))}}function Zo(f){return typeof f=="string"?{content:f}:f}function Vl(f,h,s){console.error(`[claudius] plugin "${f.name}" failed in ${h}:`,s)}async function dc(f,h,s){let y=h;for(const g of f){if(!g.onBeforeSend)continue;let E=null;const L={...s,respondWith(P){E={type:"respond",message:y,reply:Zo(P)}},abort(P){E={type:"abort",reason:P}}};try{const P=await g.onBeforeSend(y,L);if(E)return E;P&&(y=P)}catch(P){Vl(g,"onBeforeSend",P)}}return{type:"send",message:y}}async function pc(f,h,s){let y=h;for(const g of f)if(g.onAfterReceive)try{const E=await g.onAfterReceive(y,s);E&&(y=E)}catch(E){Vl(g,"onAfterReceive",E)}return y}async function hc(f,h,s){for(const y of f){if(!y.onError)continue;let g=null;const E={...s,respondWith(L){g=Zo(L)}};try{if(await y.onError(h,E),g)return g}catch(L){Vl(y,"onError",L)}}return null}const mc=200,vc="claudius:messages";function gc(f,h){let s;try{s=new URL(h).host}catch{s=h}return`${f}:${s}`}function Wl(){try{return typeof sessionStorage<"u"?sessionStorage:null}catch{return null}}function yc(f){const h=Wl();if(!h)return[];try{const s=h.getItem(f);if(!s)return[];const y=JSON.parse(s);return Array.isArray(y)?y:[]}catch{return[]}}function wc({apiUrl:f,persistMessages:h=!0,storageKeyPrefix:s=vc,timeoutMs:y,translations:g,plugins:E}){const L=D.useMemo(()=>new fc(f,{debounceMs:0,timeoutMs:y}),[f,y]),P=gc(s,f),N=h?yc(P):[],[F,$]=D.useState(N),[G,B]=D.useState(!1),[re,q]=D.useState(null),[V,W]=D.useState(!1),pe=D.useRef(N.length),we=D.useRef(!1),ae=D.useRef(N),ce=D.useRef(E??[]);ce.current=E??[];const xe=D.useCallback(Y=>{if(!h)return;const J=Wl();if(J)try{const Se=Y.slice(-mc);J.setItem(P,JSON.stringify(Se))}catch{}},[h,P]),he=()=>(pe.current+=1,`msg-${pe.current}`),fe=D.useCallback((Y,J)=>{if(!g)return J??"Something went wrong. Please try again.";switch(Y){case"TIMEOUT":return g.errorTimeout;case"NETWORK_ERROR":return g.errorConnection;case"RATE_LIMITED":return J!=null&&J.includes("minute")?g.errorRateLimitMinute:g.errorRateLimitHour;case"VALIDATION_ERROR":case"CONFIG_ERROR":case"SERVICE_ERROR":case"UNKNOWN_ERROR":default:return J??g.errorGeneric}},[g]),Le=D.useCallback(Y=>!(Y instanceof pn)||Y.code==="TIMEOUT"||Y.code==="NETWORK_ERROR"||Y.code==="RATE_LIMITED"||Y.code==="SERVICE_ERROR"||Y.code==="UNKNOWN_ERROR"||Y.status>=500||Y.status===0,[]),b=D.useCallback(async Y=>{B(!0),we.current=!0,q(null),W(!1);try{const J=await L.sendMessage(Y);let Se={id:he(),role:"assistant",content:J.reply,sources:J.sources};ce.current.length>0&&(Se=await pc(ce.current,Se,{messages:Y,apiUrl:f}));const ie=[...Y,Se];ae.current=ie,$(ie),xe(ie)}catch(J){if(J instanceof Xo)return;if(ce.current.length>0){const Se=J instanceof Error?J:new Error(String(J)),ie=await hc(ce.current,Se,{messages:Y,apiUrl:f});if(ie){const oe={id:he(),role:"assistant",content:ie.content,sources:ie.sources},R=[...Y,oe];ae.current=R,$(R),xe(R),q(null),W(!1);return}}J instanceof pn?q(fe(J.code,J.message)):q((g==null?void 0:g.errorConnection)??"Failed to connect. Please try again."),W(Le(J))}finally{B(!1),we.current=!1}},[f,L,fe,Le,xe,g]),Ae=D.useCallback(async Y=>{const J=Y.trim();if(!J||we.current)return;const Se={id:he(),role:"user",content:J};let ie=Se;if(ce.current.length>0){const R=await dc(ce.current,Se,{messages:ae.current,apiUrl:f});if(R.type==="abort")return;if(R.type==="respond"){const A={id:he(),role:"assistant",content:R.reply.content,sources:R.reply.sources},T=[...ae.current,R.message,A];ae.current=T,$(T),xe(T),q(null),W(!1);return}ie=R.message}const oe=[...ae.current,ie];ae.current=oe,$(oe),xe(oe),await b(oe)},[f,xe,b]),at=D.useCallback(async()=>{if(we.current)return;const Y=ae.current[ae.current.length-1];!Y||Y.role!=="user"||await b(ae.current)},[b]),Ke=D.useCallback(()=>{if(ae.current=[],$([]),q(null),W(!1),h){const Y=Wl();if(!Y)return;try{Y.removeItem(P)}catch{}}},[h,P]);return{messages:F,isLoading:G,error:re,canRetry:V,sendMessage:Ae,retry:at,clearMessages:Ke}}function xc(f){const[h,s]=D.useState(()=>typeof window>"u"?!1:window.matchMedia(f).matches);return D.useEffect(()=>{const y=window.matchMedia(f);s(y.matches);const g=E=>s(E.matches);return y.addEventListener("change",g),()=>y.removeEventListener("change",g)},[f]),h}function Rr(f,h){return f instanceof RegExp?f.test(h):h.toLowerCase().includes(f.toLowerCase())}function Sc(){const f=document.documentElement,h=document.body,s=f.scrollTop||h.scrollTop||0,y=Math.max(f.scrollHeight,h.scrollHeight),g=f.clientHeight||window.innerHeight,E=y-g;return E<=0?100:s/E*100}function kc({triggers:f,enabled:h,onOpen:s,onGreeting:y}){D.useEffect(()=>{if(!h||!f||f.length===0)return;const g=new Set,E=[],L=typeof window<"u"?window.location.href:"",P=(N,F)=>{g.has(N)||(g.add(N),F==="open"?s():y(F.greeting))};return f.forEach((N,F)=>{switch(N.on){case"url":{Rr(N.pattern,L)&&P(F,N.action);break}case"time":{if(N.matchUrl&&!Rr(N.matchUrl,L))return;const $=window.setTimeout(()=>P(F,N.action),Math.max(0,N.seconds*1e3));E.push(()=>window.clearTimeout($));break}case"scroll":{if(N.matchUrl&&!Rr(N.matchUrl,L))return;const $=()=>{Sc()>=N.percent&&P(F,N.action)};$(),window.addEventListener("scroll",$,{passive:!0}),E.push(()=>window.removeEventListener("scroll",$));break}case"exit-intent":{if(N.matchUrl&&!Rr(N.matchUrl,L))return;const $=G=>{G.clientY<=0&&P(F,N.action)};document.addEventListener("mouseleave",$),E.push(()=>document.removeEventListener("mouseleave",$));break}}}),()=>{E.forEach(N=>N())}},[f,h,s,y])}const Ec={"bottom-right":"bottom-6 right-6","bottom-left":"bottom-6 left-6","top-right":"top-6 right-6","top-left":"top-6 left-6"},Cc=D.forwardRef(function({isOpen:h,onClick:s,position:y="bottom-right",translations:g},E){const L=h?(g==null?void 0:g.closeChat)??"Close chat":(g==null?void 0:g.openChat)??"Open chat";return C.jsx("button",{ref:E,onClick:s,"aria-label":L,className:`fixed ${Ec[y]} z-50 flex h-14 w-14 items-center justify-center rounded-claudius-full bg-claudius-accent text-claudius-accent-text shadow-claudius-floating transition-transform hover:scale-105 focus:outline-none focus:ring-2 focus:ring-claudius-accent focus:ring-offset-2`,children:h?C.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[C.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),C.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}):C.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:C.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})})}),_c=D.memo(function({count:h,isActive:s,onClick:y}){return C.jsxs("button",{onClick:y,"aria-label":"View sources",title:"View sources",className:`group relative flex h-7 w-7 items-center justify-center rounded-claudius-full transition-colors ${s?"bg-claudius-accent text-claudius-accent-text":"text-claudius-text-muted hover:bg-claudius-surface-muted hover:text-claudius-text"}`,children:[C.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[C.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),C.jsx("polyline",{points:"14 2 14 8 20 8"}),C.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),C.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]}),C.jsx("span",{className:"absolute -right-1 -top-1 flex h-4 min-w-4 items-center justify-center rounded-claudius-full bg-claudius-accent px-1 text-[10px] font-bold text-claudius-accent-text",children:h})]})}),Rc=["http:","https:"];function Jo(f){if(!f||typeof f!="string")return null;const h=f.trim();if(!h)return null;try{const s=new URL(h);return Rc.includes(s.protocol)?h:null}catch{return null}}const qo=/(https?:\/\/[^\s)]+)/,bo=/(\*\*[^*]+\*\*)/,ei=/(\*[^*]+\*)/;function Nc(f,h){const s=f.match(/[.,;:!?'"]+$/),y=s?f.slice(0,-s[0].length):f,g=s?s[0]:"",E=Jo(y);return E?C.jsxs(C.Fragment,{children:[C.jsxs("a",{href:E,target:"_blank",rel:"noopener noreferrer",className:"underline font-medium hover:opacity-80 text-claudius-link",children:[E.replace(/^https?:\/\//,""),C.jsx("span",{className:"sr-only",children:" (opens in a new tab)"})]},h),g]}):f}function Tc(f,h){const s=f.split(bo),y=[];return s.forEach((g,E)=>{if(bo.test(g)){const L=g.slice(2,-2);y.push(C.jsx("strong",{children:L},`${h}-b${E}`))}else g.split(ei).forEach((P,N)=>{if(ei.test(P)){const F=P.slice(1,-1);y.push(C.jsx("em",{children:F},`${h}-b${E}-i${N}`))}else P.split(qo).forEach(($,G)=>{qo.test($)?y.push(Nc($,`${h}-b${E}-i${N}-u${G}`)):$&&y.push($)})})}),y}function Lc(f){const h=f.split(`
41
- `);return h.map((s,y)=>C.jsxs("span",{children:[Tc(s,`l${y}`),y<h.length-1&&C.jsx("br",{})]},y))}const Pc=D.memo(function({role:h,content:s,sources:y,onSourceClick:g,isSourceActive:E}){const L=h==="user";return C.jsxs("div",{className:`${L?"ml-auto":"mr-auto"} max-w-[85%]`,children:[C.jsx("div",{className:`rounded-claudius-bubble px-4 py-2.5 text-sm leading-relaxed font-body ${L?"bg-claudius-user-bubble text-claudius-user-bubble-text rounded-br-claudius-tail":"bg-claudius-assistant-bubble text-claudius-assistant-bubble-text rounded-bl-claudius-tail"}`,children:Lc(s)}),!L&&y&&y.length>0&&g&&C.jsx("div",{className:"mt-1",children:C.jsx(_c,{count:y.length,isActive:E??!1,onClick:g})})]})}),$l=2e3,Mc=1800;function jc({onSend:f,isLoading:h,placeholder:s,translations:y}){const[g,E]=D.useState(""),L=D.useRef(null),P=g.length,N=P>=Mc,F=P>=$l,$=s??(y==null?void 0:y.placeholder)??"Type your message...",G=(y==null?void 0:y.sendMessage)??"Send message",B=(y==null?void 0:y.typeYourMessage)??"Type your message";D.useEffect(()=>{var V;h||(V=L.current)==null||V.focus()},[h]);const re=V=>{V.preventDefault();const W=g.trim();!W||F||(f(W),E(""))},q=V=>{const W=V.target.value;W.length<=$l&&E(W)};return C.jsxs("form",{onSubmit:re,className:"border-t border-claudius-border bg-claudius-surface p-3",children:[C.jsxs("div",{className:"flex gap-2",children:[C.jsx("input",{ref:L,type:"text",value:g,onChange:q,placeholder:$,disabled:h,"aria-label":B,"aria-describedby":N?"char-count":void 0,className:"flex-1 rounded-claudius-sm border border-claudius-border bg-claudius-field px-3 py-2 text-sm font-body text-claudius-text placeholder:text-claudius-text-muted focus:border-claudius-accent focus:outline-none focus:ring-1 focus:ring-claudius-accent disabled:opacity-50"}),C.jsx("button",{type:"submit",disabled:h||F,"aria-label":G,className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-claudius-sm bg-claudius-accent text-claudius-accent-text transition-colors hover:opacity-90 disabled:opacity-50",children:C.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[C.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),C.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),N&&C.jsxs("div",{id:"char-count",className:`mt-1 text-xs text-right ${F?"text-claudius-error":"text-claudius-text-muted"}`,"aria-live":"polite",children:[P,"/",$l]})]})}const zc=["blog","page","external"],Oc={blog:"Blog",page:"Page",external:"External"};function Dc(f){try{return new URL(f).hostname}catch{return f}}const Ic=D.memo(function({sources:h,onClose:s}){const y=zc.map(E=>({type:E,label:Oc[E],items:h.filter(L=>L.type===E)})).filter(E=>E.items.length>0),g=h.length===1?"1 source found":`${h.length} sources found`;return C.jsxs("div",{className:"absolute inset-y-0 left-0 z-10 flex w-[280px] flex-col border-r-2 border-claudius-border bg-claudius-surface rounded-r-claudius-lg transition-transform duration-200 ease-out",children:[C.jsxs("div",{className:"flex items-center justify-between border-b border-claudius-border px-4 py-3",children:[C.jsxs("div",{children:[C.jsx("h3",{className:"text-sm font-heading font-semibold text-claudius-text",children:"Sources"}),C.jsx("p",{className:"text-xs text-claudius-text-muted",children:g})]}),C.jsx("button",{onClick:s,"aria-label":"Close sources",className:"flex h-7 w-7 items-center justify-center rounded-claudius-full text-claudius-text-muted transition-colors hover:bg-claudius-surface-muted hover:text-claudius-text",children:C.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[C.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),C.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),C.jsx("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-4",children:y.map(E=>C.jsxs("div",{children:[C.jsx("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-claudius-text-muted",children:E.label}),C.jsx("div",{className:"space-y-2",children:E.items.map(L=>{const P=Jo(L.url);return P?C.jsxs("a",{href:P,target:"_blank",rel:"noopener noreferrer",className:"block rounded-claudius-md border-2 border-claudius-border bg-claudius-surface-muted p-3 transition-colors hover:bg-claudius-border",children:[C.jsx("p",{className:"truncate text-sm font-medium text-claudius-text",children:L.title}),C.jsx("p",{className:"mt-0.5 text-xs text-claudius-text-muted",children:Dc(P)})]},P):null})})]},E.type))})]})});function Fc({title:f,subtitle:h,titleId:s,closeLabel:y,onClose:g}){return C.jsxs("div",{className:"flex items-center gap-3 bg-claudius-accent px-5 py-4",children:[C.jsx("div",{"aria-hidden":"true",className:"flex h-8 w-8 items-center justify-center rounded-claudius-full bg-claudius-accent-soft text-sm font-bold text-claudius-accent-text",children:f.charAt(0).toUpperCase()}),C.jsxs("div",{className:"flex-1",children:[C.jsx("h2",{id:s,className:"text-sm font-heading font-semibold text-claudius-accent-text",children:f}),C.jsx("p",{className:"text-xs text-claudius-accent-text",children:h})]}),C.jsx("button",{onClick:g,"aria-label":y,className:"flex h-10 w-10 items-center justify-center rounded-claudius-full text-claudius-accent-text-muted transition-colors hover:bg-claudius-accent-soft hover:text-claudius-accent-text",children:C.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[C.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),C.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}function Ac({message:f,retryLabel:h,onRetry:s}){return C.jsxs("div",{role:"alert",className:"mx-auto flex max-w-[90%] flex-col items-center gap-2 rounded-claudius-sm bg-claudius-error-surface px-3 py-2 text-center text-xs text-claudius-error",children:[C.jsx("span",{children:f}),s&&C.jsx("button",{type:"button",onClick:s,className:"rounded-claudius-md bg-claudius-error px-3 py-1 text-xs font-semibold text-claudius-error-text transition-opacity hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-claudius-error focus-visible:ring-offset-1",children:h})]})}function Uc({label:f}){return C.jsx("div",{role:"status","aria-live":"polite","aria-label":f,className:"mr-auto flex max-w-[85%]",children:C.jsxs("div",{className:"flex gap-1 rounded-claudius-bubble rounded-bl-claudius-tail bg-claudius-assistant-bubble px-4 py-3",children:[C.jsx("span",{className:"h-2 w-2 motion-safe:animate-bounce rounded-claudius-full bg-claudius-text-muted [animation-delay:0ms]"}),C.jsx("span",{className:"h-2 w-2 motion-safe:animate-bounce rounded-claudius-full bg-claudius-text-muted [animation-delay:150ms]"}),C.jsx("span",{className:"h-2 w-2 motion-safe:animate-bounce rounded-claudius-full bg-claudius-text-muted [animation-delay:300ms]"})]})})}function Hc(f,h,s){const[y,g]=D.useState(0),E=D.useRef(0),L=D.useRef(0),P=D.useRef(0),N=D.useRef(!1);return D.useEffect(()=>{const F=f.current;if(!s||!F)return;const $=re=>{if(F.scrollTop>0){N.current=!1;return}N.current=!0,L.current=re.touches[0].clientY,P.current=Date.now()},G=re=>{if(!N.current)return;let q=re.touches[0].clientY-L.current;q<0&&(q=q*.3),E.current=q,g(q)},B=()=>{if(!N.current)return;N.current=!1;const re=E.current,q=(Date.now()-P.current)/1e3,V=F.getBoundingClientRect().height,W=q>.05&&re>0&&re/q>500,pe=re>V*.3;W||pe?h():(E.current=0,g(0))};return F.addEventListener("touchstart",$,{passive:!0}),F.addEventListener("touchmove",G,{passive:!0}),F.addEventListener("touchend",B),()=>{F.removeEventListener("touchstart",$),F.removeEventListener("touchmove",G),F.removeEventListener("touchend",B)}},[f,h,s]),{offsetY:y}}const Bc='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function Vc(f,h){D.useEffect(()=>{const s=f.current;if(!s)return;const y=g=>{if(g.key!=="Tab")return;const E=Array.from(s.querySelectorAll(Bc)).filter(F=>!F.hasAttribute("aria-hidden"));if(E.length===0)return;const L=E[0],P=E[E.length-1],N=document.activeElement;g.shiftKey&&N===L?(g.preventDefault(),P.focus()):!g.shiftKey&&N===P&&(g.preventDefault(),L.focus())};return s.addEventListener("keydown",y),()=>s.removeEventListener("keydown",y)},[f,h])}const Wc=/\*\*([^*]+)\*\*/g,$c=/\*([^*]+)\*/g,Qc=/https?:\/\/[^\s)]+/g;function Kc(f){return f.replace(Wc,"$1").replace($c,"$1").replace(Qc,h=>{try{return new URL(h).hostname}catch{return h}})}const Yc={"bottom-right":"bottom-24 right-3 sm:right-6","bottom-left":"bottom-24 left-3 sm:left-6","top-right":"top-24 right-3 sm:right-6","top-left":"top-24 left-3 sm:left-6"};function Gc({messages:f,isLoading:h,error:s,canRetry:y=!1,onSend:g,onRetry:E,onClose:L,title:P="Chat",subtitle:N="Ask me anything",welcomeMessage:F="Hi! How can I help you today?",placeholder:$,position:G="bottom-right",translations:B,isMobile:re=!1}){const q=D.useId(),V=D.useRef(null),W=D.useRef(null),[pe,we]=D.useState(null);Vc(V,!0);const{offsetY:ae}=Hc(W,L,re),ce=ae!==0,xe=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1;D.useEffect(()=>{const b=W.current;b&&(b.scrollTop=b.scrollHeight)},[f,h]),D.useEffect(()=>{const b=Ae=>{Ae.key==="Escape"&&!Ae.isComposing&&L()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[L]);const he=(B==null?void 0:B.closeChat)??"Close chat",fe=(B==null?void 0:B.chatMessages)??"Chat messages",Le=[...f].reverse().find(b=>b.role==="assistant");return C.jsxs("div",{ref:V,role:"dialog","aria-modal":re?"true":void 0,"aria-labelledby":q,className:re?"claudius-bottom-sheet fixed inset-x-0 bottom-0 z-50 flex h-[90vh] w-full flex-col overflow-hidden rounded-t-claudius-lg bg-claudius-surface shadow-claudius-elevated font-body":`fixed ${Yc[G]} z-50 flex h-[min(500px,calc(100vh-7rem))] w-[calc(100vw-1.5rem)] max-w-[380px] sm:max-w-[400px] md:max-w-[440px] flex-col overflow-hidden rounded-claudius-lg bg-claudius-surface shadow-claudius-elevated font-body`,style:re&&!xe?{transform:`translateY(${Math.max(0,ae)}px)`}:void 0,"data-dragging":ce||void 0,children:[re&&C.jsx("div",{className:"flex justify-center py-2","aria-hidden":"true",children:C.jsx("div",{className:"h-1 w-8 rounded-claudius-full bg-claudius-border"})}),C.jsx(Fc,{title:P,subtitle:N,titleId:q,closeLabel:he,onClose:L}),C.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[pe&&C.jsx(Ic,{sources:pe.sources,onClose:()=>we(null)}),C.jsxs("div",{ref:W,role:"log","aria-label":fe,className:"h-full space-y-3 overflow-y-auto px-4 py-4",children:[f.length===0&&!s&&C.jsx("div",{className:"mr-auto flex max-w-[85%]",children:C.jsx("div",{className:"rounded-claudius-bubble rounded-bl-claudius-tail bg-claudius-assistant-bubble px-4 py-2.5 text-sm leading-relaxed text-claudius-assistant-bubble-text",children:F})}),f.map(b=>C.jsx(Pc,{role:b.role,content:b.content,sources:b.sources,isSourceActive:(pe==null?void 0:pe.messageId)===b.id,onSourceClick:()=>{(pe==null?void 0:pe.messageId)===b.id?we(null):b.sources&&b.sources.length>0&&we({messageId:b.id,sources:b.sources})}},b.id)),h&&C.jsx(Uc,{label:(B==null?void 0:B.typingIndicator)??"Assistant is typing"}),s&&C.jsx(Ac,{message:s,retryLabel:(B==null?void 0:B.errorRetry)??"Retry",onRetry:y&&E&&!h?E:void 0})]})]}),C.jsx("div",{"data-claudius-live":"assistant","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:Le?Kc(Le.content):""}),C.jsx(jc,{onSend:g,isLoading:h,placeholder:$,translations:B})]})}function Xc({message:f,position:h,onOpen:s,onDismiss:y,dismissLabel:g}){const E=h.startsWith("bottom"),L=h.endsWith("right"),P=["claudius-greeting-bubble","fixed z-40 max-w-xs",E?"bottom-20":"top-20",L?"right-4":"left-4"].join(" ");return C.jsxs("div",{className:P,role:"status","aria-live":"polite",children:[C.jsx("button",{type:"button",onClick:s,className:"block w-full rounded-claudius-lg bg-claudius-surface p-4 pr-8 text-left text-sm font-body text-claudius-text shadow-claudius-floating ring-1 ring-claudius-border transition hover:shadow-claudius-floating-hover focus:outline-none focus:ring-2 focus:ring-claudius-accent",children:f}),C.jsx("button",{type:"button",onClick:N=>{N.stopPropagation(),y()},"aria-label":g,className:"absolute right-1 top-1 flex h-6 w-6 items-center justify-center rounded-claudius-full text-claudius-text-muted hover:bg-claudius-surface-muted focus:outline-none focus:ring-2 focus:ring-claudius-accent",children:C.jsx("span",{"aria-hidden":"true",children:"×"})})]})}const ti={en:{title:"Chat",subtitle:"Ask me anything",welcomeMessage:"Hi! How can I help you today?",closeChat:"Close chat",chatMessages:"Chat messages",typingIndicator:"Assistant is typing",placeholder:"Type your message...",sendMessage:"Send message",typeYourMessage:"Type your message",openChat:"Open chat",dismissGreeting:"Dismiss greeting",errorGeneric:"Something went wrong. Please try again.",errorConnection:"Failed to connect. Please try again.",errorTimeout:"Request timed out. Please try again.",errorRateLimitMinute:"Too many requests. Please wait a minute.",errorRateLimitHour:"Hourly limit reached. Please try again later.",errorRetry:"Retry"},es:{title:"Chat",subtitle:"Pregúntame lo que quieras",welcomeMessage:"¡Hola! ¿En qué puedo ayudarte hoy?",closeChat:"Cerrar chat",chatMessages:"Mensajes del chat",typingIndicator:"El asistente está escribiendo",placeholder:"Escribe tu mensaje...",sendMessage:"Enviar mensaje",typeYourMessage:"Escribe tu mensaje",openChat:"Abrir chat",dismissGreeting:"Descartar saludo",errorGeneric:"Algo salió mal. Inténtalo de nuevo.",errorConnection:"No se pudo conectar. Inténtalo de nuevo.",errorTimeout:"La solicitud tardó demasiado. Inténtalo de nuevo.",errorRateLimitMinute:"Demasiadas solicitudes. Espera un minuto.",errorRateLimitHour:"Has alcanzado el límite por hora. Inténtalo más tarde.",errorRetry:"Reintentar"},fr:{title:"Chat",subtitle:"Posez-moi vos questions",welcomeMessage:"Bonjour ! Comment puis-je vous aider aujourd'hui ?",closeChat:"Fermer le chat",chatMessages:"Messages du chat",typingIndicator:"L'assistant écrit",placeholder:"Saisissez votre message...",sendMessage:"Envoyer le message",typeYourMessage:"Saisissez votre message",openChat:"Ouvrir le chat",dismissGreeting:"Ignorer le message d'accueil",errorGeneric:"Une erreur s'est produite. Veuillez réessayer.",errorConnection:"Échec de la connexion. Veuillez réessayer.",errorTimeout:"La requête a expiré. Veuillez réessayer.",errorRateLimitMinute:"Trop de requêtes. Veuillez patienter une minute.",errorRateLimitHour:"Limite horaire atteinte. Veuillez réessayer plus tard.",errorRetry:"Réessayer"},de:{title:"Chat",subtitle:"Fragen Sie mich alles",welcomeMessage:"Hallo! Wie kann ich Ihnen heute helfen?",closeChat:"Chat schließen",chatMessages:"Chat-Nachrichten",typingIndicator:"Der Assistent schreibt",placeholder:"Geben Sie Ihre Nachricht ein...",sendMessage:"Nachricht senden",typeYourMessage:"Geben Sie Ihre Nachricht ein",openChat:"Chat öffnen",dismissGreeting:"Begrüßung schließen",errorGeneric:"Etwas ist schiefgelaufen. Bitte versuchen Sie es erneut.",errorConnection:"Verbindung fehlgeschlagen. Bitte versuchen Sie es erneut.",errorTimeout:"Zeitüberschreitung der Anfrage. Bitte versuchen Sie es erneut.",errorRateLimitMinute:"Zu viele Anfragen. Bitte warten Sie eine Minute.",errorRateLimitHour:"Stündliches Limit erreicht. Bitte versuchen Sie es später erneut.",errorRetry:"Erneut versuchen"}};function ni(f){if(!f)return;const h=f.toLowerCase().split("-")[0];return Object.prototype.hasOwnProperty.call(ti,h)?h:void 0}function Zc(){const f=typeof document<"u"?ni(document.documentElement.lang):void 0;if(f)return f;const h=typeof navigator<"u"?ni(navigator.language):void 0;return h||"en"}function Jc(f={}){const{locale:h,translations:s}=f,y=ti[h??Zc()];return s?{...y,...s}:{...y}}const ri=["accent","accentText","accentSoft","accentTextMuted","surface","surfaceMuted","text","textMuted","border","userBubble","userBubbleText","assistantBubble","assistantBubbleText","field","error","errorSurface","errorText","link","scrim"],qc=["sm","md","lg","full","tail"],bc=["elevated","floating","floatingHover"],ef=["heading","body"],li={default:{name:"default"},minimal:{name:"minimal",colors:{accent:"#171717",accentText:"#ffffff",surface:"#ffffff",surfaceMuted:"#f5f5f5",text:"#171717",textMuted:"#737373",border:"#e5e5e5",link:"#171717"},colorsDark:{accent:"#fafafa",accentText:"#171717",surface:"#0a0a0a",surfaceMuted:"#1c1c1c",text:"#fafafa",textMuted:"#a3a3a3",border:"#2e2e2e",field:"#1c1c1c",link:"#fafafa"},radii:{sm:"4px",md:"6px",lg:"10px"},shadows:{elevated:"0 4px 16px rgb(0 0 0 / 0.12)",floating:"0 2px 8px rgb(0 0 0 / 0.12)",floatingHover:"0 4px 12px rgb(0 0 0 / 0.16)"}},playful:{name:"playful",colors:{accent:"#8b5cf6",surfaceMuted:"#f5f3ff",assistantBubbleText:"#4c1d95",link:"#7c3aed"},colorsDark:{accent:"#a78bfa",surfaceMuted:"#2e1065",assistantBubbleText:"#ede9fe",link:"#c4b5fd"},radii:{sm:"12px",md:"16px",lg:"24px",tail:"8px"},shadows:{elevated:"0 24px 48px -12px rgb(139 92 246 / 0.35)",floating:"0 10px 20px -5px rgb(139 92 246 / 0.4)",floatingHover:"0 16px 28px -6px rgb(139 92 246 / 0.5)"},fonts:{heading:"ui-rounded, 'Hiragino Maru Gothic ProN', system-ui",body:"ui-rounded, 'Hiragino Maru Gothic ProN', system-ui"}},corporate:{name:"corporate",colors:{accent:"#1e3a5f",surfaceMuted:"#f3f4f6",text:"#1f2937",textMuted:"#6b7280",border:"#d1d5db",link:"#1d4ed8"},colorsDark:{accent:"#2c5282",link:"#93c5fd"},radii:{sm:"4px",md:"6px",lg:"8px",tail:"2px"},shadows:{elevated:"0 8px 24px rgb(15 23 42 / 0.16)",floating:"0 4px 12px rgb(15 23 42 / 0.18)",floatingHover:"0 6px 16px rgb(15 23 42 / 0.24)"},fonts:{heading:"'Segoe UI', 'Helvetica Neue', Arial, system-ui",body:"'Segoe UI', 'Helvetica Neue', Arial, system-ui"}}};function tf(f){return Object.prototype.hasOwnProperty.call(li,f)}const nf=new Set(["light","dark","auto"]);function rf(f){if(f===void 0)return{mode:"light"};if(typeof f=="string"){if(nf.has(f))return{mode:f};if(tf(f)){const h=li[f];return{mode:h.colorScheme??"light",theme:h}}return{mode:"light",url:f}}return{mode:f.colorScheme??"light",theme:f}}function lf(f){return f.replace(/[A-Z]/g,h=>`-${h.toLowerCase()}`)}function uf(f,h){console.warn(`[Claudius] Ignoring unknown theme token "${h}" in "${f}"`)}function Un(f,h,s,y,g,E=""){if(g)for(const[L,P]of Object.entries(g)){if(!y.includes(L)){uf(h,L);continue}typeof P=="string"&&(f[`${s}${lf(L)}${E}`]=P)}}function of(f){const h={};Un(h,"colors","--cl-color-",ri,f.colors);for(const[s,y]of Object.entries({...h}))h[`${s}-dark`]=y;return Un(h,"colorsDark","--cl-color-",ri,f.colorsDark,"-dark"),Un(h,"radii","--cl-radius-",qc,f.radii),Un(h,"shadows","--cl-shadow-",bc,f.shadows),Un(h,"fonts","--cl-font-",ef,f.fonts),h}function sf(f){return typeof f=="object"&&f!==null&&!Array.isArray(f)}function af(f){const h=D.useMemo(()=>rf(f),[f]),[s,y]=D.useState(null),g=h.url;D.useEffect(()=>{if(y(null),!g)return;const N=new AbortController;return fetch(g,{signal:N.signal}).then(F=>{if(!F.ok)throw new Error(`HTTP ${F.status}`);return F.json()}).then(F=>{if(!sf(F))throw new Error("theme JSON must be an object");y(F)}).catch(F=>{N.signal.aborted||console.error(`[Claudius] Failed to load theme from ${g}:`,F)}),()=>N.abort()},[g]);const E=h.theme??s??null,L=(s==null?void 0:s.colorScheme)??h.mode,P=D.useMemo(()=>E?of(E):{},[E]);return{mode:L,cssVars:P}}const ui="claudius:triggers:dismissed";function cf(){if(typeof window>"u")return!1;try{return window.sessionStorage.getItem(ui)==="1"}catch{return!1}}function ff(){if(!(typeof window>"u"))try{window.sessionStorage.setItem(ui,"1")}catch{}}function oi({apiUrl:f,title:h,subtitle:s,welcomeMessage:y,placeholder:g,persistMessages:E,storageKeyPrefix:L,requestTimeoutMs:P,theme:N="light",accentColor:F,position:$="bottom-right",locale:G,translations:B,triggers:re,plugins:q}){const[V,W]=D.useState(!1),[pe,we]=D.useState(null),[ae,ce]=D.useState(cf),xe=D.useRef(!1),he=xc("(max-width: 639px)"),fe=D.useMemo(()=>Jc({locale:G,translations:B}),[G,B]),{messages:Le,isLoading:b,error:Ae,canRetry:at,sendMessage:Ke,retry:Y}=wc({apiUrl:f,persistMessages:E,storageKeyPrefix:L,timeoutMs:P,translations:fe,plugins:q}),J=D.useRef(null),Se=D.useRef(V),{mode:ie,cssVars:oe}=af(N),[R,A]=D.useState(!1);D.useEffect(()=>{if(ie!=="auto")return;const ke=window.matchMedia("(prefers-color-scheme: dark)");A(ke.matches);const qt=Nr=>A(Nr.matches);return ke.addEventListener("change",qt),()=>ke.removeEventListener("change",qt)},[ie]),D.useEffect(()=>{var ke;Se.current&&!V&&((ke=J.current)==null||ke.focus()),Se.current=V},[V]);const T=D.useCallback(()=>{ce(!0),ff()},[]),d=D.useCallback(()=>{W(!1),xe.current&&(xe.current=!1,T())},[T]),w=D.useCallback(()=>{W(ke=>!ke)},[]),K=D.useCallback(()=>{xe.current=!0,we(null),W(!0)},[]),X=D.useCallback(ke=>{we(ke)},[]),ee=D.useCallback(()=>{we(null),K()},[K]),te=D.useCallback(()=>{we(null),T()},[T]);kc({triggers:re,enabled:!ae&&!V,onOpen:K,onGreeting:X});const de=ie==="dark"||ie==="auto"&&R,le={...oe,...F?{"--cl-color-accent":F,"--cl-color-accent-dark":F}:{}},me=Object.keys(le).length>0?le:void 0;return C.jsx("div",{className:"claudius-root",style:me,children:C.jsxs("div",{"data-claudius-dark":de?"true":"false",children:[V&&he&&C.jsx("div",{className:"claudius-scrim fixed inset-0 z-40 bg-claudius-scrim",onClick:d,"aria-hidden":"true"}),V&&C.jsx(Gc,{messages:Le,isLoading:b,error:Ae,canRetry:at,onSend:Ke,onRetry:Y,onClose:d,title:h??fe.title,subtitle:s??fe.subtitle,welcomeMessage:y??fe.welcomeMessage,placeholder:g??fe.placeholder,position:$,translations:fe,isMobile:he}),!(V&&he)&&C.jsx(Cc,{ref:J,isOpen:V,onClick:w,position:$,translations:fe}),!V&&pe&&C.jsx(Xc,{message:pe,position:$,onOpen:ee,onDismiss:te,dismissLabel:fe.dismissGreeting})]})})}const df="1.9.0";typeof window<"u"&&(window.ClaudiusWidgetVersion=df);function ii(){const f=window.ClaudiusConfig;if(!(f!=null&&f.apiUrl)){console.error("[Claudius] Missing ClaudiusConfig.apiUrl");return}const h=document.createElement("div");h.id="claudius-chat-widget",document.body.appendChild(h),Go.createRoot(h).render(C.jsx(oi,{apiUrl:f.apiUrl,title:f.title,subtitle:f.subtitle,welcomeMessage:f.welcomeMessage,placeholder:f.placeholder,persistMessages:f.persistMessages,storageKeyPrefix:f.storageKeyPrefix,requestTimeoutMs:f.requestTimeoutMs,theme:f.theme,accentColor:f.accentColor,position:f.position,locale:f.locale,translations:f.translations,triggers:f.triggers}))}class si extends HTMLElement{constructor(){super(...arguments);Jt(this,"root",null);Jt(this,"container",null)}static get observedAttributes(){return["api-url","title","subtitle","welcome-message","placeholder","persist-messages","storage-key-prefix","request-timeout-ms","theme","accent-color","position"]}connectedCallback(){this.container=document.createElement("div"),this.appendChild(this.container),this.root=Go.createRoot(this.container),this.render()}disconnectedCallback(){this.root&&(this.root.unmount(),this.root=null),this.container&&(this.container.remove(),this.container=null)}attributeChangedCallback(){this.render()}render(){if(!this.root)return;const s=this.getAttribute("api-url");if(!s){console.error("[Claudius] Missing api-url attribute on <claudius-chat>");return}const y=this.getAttribute("persist-messages"),g=y===null?void 0:y!=="false",E=this.getAttribute("request-timeout-ms"),L=E===null?void 0:Number(E);this.root.render(C.jsx(oi,{apiUrl:s,title:this.getAttribute("title")??void 0,subtitle:this.getAttribute("subtitle")??void 0,welcomeMessage:this.getAttribute("welcome-message")??void 0,placeholder:this.getAttribute("placeholder")??void 0,persistMessages:g,storageKeyPrefix:this.getAttribute("storage-key-prefix")??void 0,requestTimeoutMs:L!==void 0&&Number.isFinite(L)?L:void 0,theme:this.getAttribute("theme")??void 0,accentColor:this.getAttribute("accent-color")??void 0,position:this.getAttribute("position")??void 0}))}}return typeof customElements<"u"&&!customElements.get("claudius-chat")&&customElements.define("claudius-chat",si),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ii):ii(),Et.ClaudiusChat=si,Object.defineProperty(Et,Symbol.toStringTag,{value:"Module"}),Et})({});
41
+ `);return h.map((s,y)=>C.jsxs("span",{children:[Tc(s,`l${y}`),y<h.length-1&&C.jsx("br",{})]},y))}const Pc=D.memo(function({role:h,content:s,sources:y,onSourceClick:g,isSourceActive:E}){const L=h==="user";return C.jsxs("div",{className:`${L?"ml-auto":"mr-auto"} max-w-[85%]`,children:[C.jsx("div",{className:`rounded-claudius-bubble px-4 py-2.5 text-sm leading-relaxed font-body ${L?"bg-claudius-user-bubble text-claudius-user-bubble-text rounded-br-claudius-tail":"bg-claudius-assistant-bubble text-claudius-assistant-bubble-text rounded-bl-claudius-tail"}`,children:Lc(s)}),!L&&y&&y.length>0&&g&&C.jsx("div",{className:"mt-1",children:C.jsx(_c,{count:y.length,isActive:E??!1,onClick:g})})]})}),$l=2e3,Mc=1800;function jc({onSend:f,isLoading:h,placeholder:s,translations:y}){const[g,E]=D.useState(""),L=D.useRef(null),P=g.length,N=P>=Mc,F=P>=$l,$=s??(y==null?void 0:y.placeholder)??"Type your message...",G=(y==null?void 0:y.sendMessage)??"Send message",B=(y==null?void 0:y.typeYourMessage)??"Type your message";D.useEffect(()=>{var V;h||(V=L.current)==null||V.focus()},[h]);const re=V=>{V.preventDefault();const W=g.trim();!W||F||(f(W),E(""))},q=V=>{const W=V.target.value;W.length<=$l&&E(W)};return C.jsxs("form",{onSubmit:re,className:"border-t border-claudius-border bg-claudius-surface p-3",children:[C.jsxs("div",{className:"flex gap-2",children:[C.jsx("input",{ref:L,type:"text",value:g,onChange:q,placeholder:$,disabled:h,"aria-label":B,"aria-describedby":N?"char-count":void 0,className:"flex-1 rounded-claudius-sm border border-claudius-border bg-claudius-field px-3 py-2 text-sm font-body text-claudius-text placeholder:text-claudius-text-muted focus:border-claudius-accent focus:outline-none focus:ring-1 focus:ring-claudius-accent disabled:opacity-50"}),C.jsx("button",{type:"submit",disabled:h||F,"aria-label":G,className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-claudius-sm bg-claudius-accent text-claudius-accent-text transition-colors hover:opacity-90 disabled:opacity-50",children:C.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[C.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),C.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),N&&C.jsxs("div",{id:"char-count",className:`mt-1 text-xs text-right ${F?"text-claudius-error":"text-claudius-text-muted"}`,"aria-live":"polite",children:[P,"/",$l]})]})}const zc=["blog","page","external"],Oc={blog:"Blog",page:"Page",external:"External"};function Dc(f){try{return new URL(f).hostname}catch{return f}}const Ic=D.memo(function({sources:h,onClose:s}){const y=zc.map(E=>({type:E,label:Oc[E],items:h.filter(L=>L.type===E)})).filter(E=>E.items.length>0),g=h.length===1?"1 source found":`${h.length} sources found`;return C.jsxs("div",{className:"absolute inset-y-0 left-0 z-10 flex w-[280px] flex-col border-r-2 border-claudius-border bg-claudius-surface rounded-r-claudius-lg transition-transform duration-200 ease-out",children:[C.jsxs("div",{className:"flex items-center justify-between border-b border-claudius-border px-4 py-3",children:[C.jsxs("div",{children:[C.jsx("h3",{className:"text-sm font-heading font-semibold text-claudius-text",children:"Sources"}),C.jsx("p",{className:"text-xs text-claudius-text-muted",children:g})]}),C.jsx("button",{onClick:s,"aria-label":"Close sources",className:"flex h-7 w-7 items-center justify-center rounded-claudius-full text-claudius-text-muted transition-colors hover:bg-claudius-surface-muted hover:text-claudius-text",children:C.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[C.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),C.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),C.jsx("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-4",children:y.map(E=>C.jsxs("div",{children:[C.jsx("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-claudius-text-muted",children:E.label}),C.jsx("div",{className:"space-y-2",children:E.items.map(L=>{const P=Jo(L.url);return P?C.jsxs("a",{href:P,target:"_blank",rel:"noopener noreferrer",className:"block rounded-claudius-md border-2 border-claudius-border bg-claudius-surface-muted p-3 transition-colors hover:bg-claudius-border",children:[C.jsx("p",{className:"truncate text-sm font-medium text-claudius-text",children:L.title}),C.jsx("p",{className:"mt-0.5 text-xs text-claudius-text-muted",children:Dc(P)})]},P):null})})]},E.type))})]})});function Fc({title:f,subtitle:h,titleId:s,closeLabel:y,onClose:g}){return C.jsxs("div",{className:"flex items-center gap-3 bg-claudius-accent px-5 py-4",children:[C.jsx("div",{"aria-hidden":"true",className:"flex h-8 w-8 items-center justify-center rounded-claudius-full bg-claudius-accent-soft text-sm font-bold text-claudius-accent-text",children:f.charAt(0).toUpperCase()}),C.jsxs("div",{className:"flex-1",children:[C.jsx("h2",{id:s,className:"text-sm font-heading font-semibold text-claudius-accent-text",children:f}),C.jsx("p",{className:"text-xs text-claudius-accent-text",children:h})]}),C.jsx("button",{onClick:g,"aria-label":y,className:"flex h-10 w-10 items-center justify-center rounded-claudius-full text-claudius-accent-text-muted transition-colors hover:bg-claudius-accent-soft hover:text-claudius-accent-text",children:C.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[C.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),C.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}function Ac({message:f,retryLabel:h,onRetry:s}){return C.jsxs("div",{role:"alert",className:"mx-auto flex max-w-[90%] flex-col items-center gap-2 rounded-claudius-sm bg-claudius-error-surface px-3 py-2 text-center text-xs text-claudius-error",children:[C.jsx("span",{children:f}),s&&C.jsx("button",{type:"button",onClick:s,className:"rounded-claudius-md bg-claudius-error px-3 py-1 text-xs font-semibold text-claudius-error-text transition-opacity hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-claudius-error focus-visible:ring-offset-1",children:h})]})}function Uc({label:f}){return C.jsx("div",{role:"status","aria-live":"polite","aria-label":f,className:"mr-auto flex max-w-[85%]",children:C.jsxs("div",{className:"flex gap-1 rounded-claudius-bubble rounded-bl-claudius-tail bg-claudius-assistant-bubble px-4 py-3",children:[C.jsx("span",{className:"h-2 w-2 motion-safe:animate-bounce rounded-claudius-full bg-claudius-text-muted [animation-delay:0ms]"}),C.jsx("span",{className:"h-2 w-2 motion-safe:animate-bounce rounded-claudius-full bg-claudius-text-muted [animation-delay:150ms]"}),C.jsx("span",{className:"h-2 w-2 motion-safe:animate-bounce rounded-claudius-full bg-claudius-text-muted [animation-delay:300ms]"})]})})}function Hc(f,h,s){const[y,g]=D.useState(0),E=D.useRef(0),L=D.useRef(0),P=D.useRef(0),N=D.useRef(!1);return D.useEffect(()=>{const F=f.current;if(!s||!F)return;const $=re=>{if(F.scrollTop>0){N.current=!1;return}N.current=!0,L.current=re.touches[0].clientY,P.current=Date.now()},G=re=>{if(!N.current)return;let q=re.touches[0].clientY-L.current;q<0&&(q=q*.3),E.current=q,g(q)},B=()=>{if(!N.current)return;N.current=!1;const re=E.current,q=(Date.now()-P.current)/1e3,V=F.getBoundingClientRect().height,W=q>.05&&re>0&&re/q>500,pe=re>V*.3;W||pe?h():(E.current=0,g(0))};return F.addEventListener("touchstart",$,{passive:!0}),F.addEventListener("touchmove",G,{passive:!0}),F.addEventListener("touchend",B),()=>{F.removeEventListener("touchstart",$),F.removeEventListener("touchmove",G),F.removeEventListener("touchend",B)}},[f,h,s]),{offsetY:y}}const Bc='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function Vc(f,h){D.useEffect(()=>{const s=f.current;if(!s)return;const y=g=>{if(g.key!=="Tab")return;const E=Array.from(s.querySelectorAll(Bc)).filter(F=>!F.hasAttribute("aria-hidden"));if(E.length===0)return;const L=E[0],P=E[E.length-1],N=document.activeElement;g.shiftKey&&N===L?(g.preventDefault(),P.focus()):!g.shiftKey&&N===P&&(g.preventDefault(),L.focus())};return s.addEventListener("keydown",y),()=>s.removeEventListener("keydown",y)},[f,h])}const Wc=/\*\*([^*]+)\*\*/g,$c=/\*([^*]+)\*/g,Qc=/https?:\/\/[^\s)]+/g;function Kc(f){return f.replace(Wc,"$1").replace($c,"$1").replace(Qc,h=>{try{return new URL(h).hostname}catch{return h}})}const Yc={"bottom-right":"bottom-24 right-3 sm:right-6","bottom-left":"bottom-24 left-3 sm:left-6","top-right":"top-24 right-3 sm:right-6","top-left":"top-24 left-3 sm:left-6"};function Gc({messages:f,isLoading:h,error:s,canRetry:y=!1,onSend:g,onRetry:E,onClose:L,title:P="Chat",subtitle:N="Ask me anything",welcomeMessage:F="Hi! How can I help you today?",placeholder:$,position:G="bottom-right",translations:B,isMobile:re=!1}){const q=D.useId(),V=D.useRef(null),W=D.useRef(null),[pe,we]=D.useState(null);Vc(V,!0);const{offsetY:ae}=Hc(W,L,re),ce=ae!==0,xe=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1;D.useEffect(()=>{const b=W.current;b&&(b.scrollTop=b.scrollHeight)},[f,h]),D.useEffect(()=>{const b=Ae=>{Ae.key==="Escape"&&!Ae.isComposing&&L()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[L]);const he=(B==null?void 0:B.closeChat)??"Close chat",fe=(B==null?void 0:B.chatMessages)??"Chat messages",Le=[...f].reverse().find(b=>b.role==="assistant");return C.jsxs("div",{ref:V,role:"dialog","aria-modal":re?"true":void 0,"aria-labelledby":q,className:re?"claudius-bottom-sheet fixed inset-x-0 bottom-0 z-50 flex h-[90vh] w-full flex-col overflow-hidden rounded-t-claudius-lg bg-claudius-surface shadow-claudius-elevated font-body":`fixed ${Yc[G]} z-50 flex h-[min(500px,calc(100vh-7rem))] w-[calc(100vw-1.5rem)] max-w-[380px] sm:max-w-[400px] md:max-w-[440px] flex-col overflow-hidden rounded-claudius-lg bg-claudius-surface shadow-claudius-elevated font-body`,style:re&&!xe?{transform:`translateY(${Math.max(0,ae)}px)`}:void 0,"data-dragging":ce||void 0,children:[re&&C.jsx("div",{className:"flex justify-center py-2","aria-hidden":"true",children:C.jsx("div",{className:"h-1 w-8 rounded-claudius-full bg-claudius-border"})}),C.jsx(Fc,{title:P,subtitle:N,titleId:q,closeLabel:he,onClose:L}),C.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[pe&&C.jsx(Ic,{sources:pe.sources,onClose:()=>we(null)}),C.jsxs("div",{ref:W,role:"log","aria-label":fe,className:"h-full space-y-3 overflow-y-auto px-4 py-4",children:[f.length===0&&!s&&C.jsx("div",{className:"mr-auto flex max-w-[85%]",children:C.jsx("div",{className:"rounded-claudius-bubble rounded-bl-claudius-tail bg-claudius-assistant-bubble px-4 py-2.5 text-sm leading-relaxed text-claudius-assistant-bubble-text",children:F})}),f.map(b=>C.jsx(Pc,{role:b.role,content:b.content,sources:b.sources,isSourceActive:(pe==null?void 0:pe.messageId)===b.id,onSourceClick:()=>{(pe==null?void 0:pe.messageId)===b.id?we(null):b.sources&&b.sources.length>0&&we({messageId:b.id,sources:b.sources})}},b.id)),h&&C.jsx(Uc,{label:(B==null?void 0:B.typingIndicator)??"Assistant is typing"}),s&&C.jsx(Ac,{message:s,retryLabel:(B==null?void 0:B.errorRetry)??"Retry",onRetry:y&&E&&!h?E:void 0})]})]}),C.jsx("div",{"data-claudius-live":"assistant","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:Le?Kc(Le.content):""}),C.jsx(jc,{onSend:g,isLoading:h,placeholder:$,translations:B})]})}function Xc({message:f,position:h,onOpen:s,onDismiss:y,dismissLabel:g}){const E=h.startsWith("bottom"),L=h.endsWith("right"),P=["claudius-greeting-bubble","fixed z-40 max-w-xs",E?"bottom-20":"top-20",L?"right-4":"left-4"].join(" ");return C.jsxs("div",{className:P,role:"status","aria-live":"polite",children:[C.jsx("button",{type:"button",onClick:s,className:"block w-full rounded-claudius-lg bg-claudius-surface p-4 pr-8 text-left text-sm font-body text-claudius-text shadow-claudius-floating ring-1 ring-claudius-border transition hover:shadow-claudius-floating-hover focus:outline-none focus:ring-2 focus:ring-claudius-accent",children:f}),C.jsx("button",{type:"button",onClick:N=>{N.stopPropagation(),y()},"aria-label":g,className:"absolute right-1 top-1 flex h-6 w-6 items-center justify-center rounded-claudius-full text-claudius-text-muted hover:bg-claudius-surface-muted focus:outline-none focus:ring-2 focus:ring-claudius-accent",children:C.jsx("span",{"aria-hidden":"true",children:"×"})})]})}const ti={en:{title:"Chat",subtitle:"Ask me anything",welcomeMessage:"Hi! How can I help you today?",closeChat:"Close chat",chatMessages:"Chat messages",typingIndicator:"Assistant is typing",placeholder:"Type your message...",sendMessage:"Send message",typeYourMessage:"Type your message",openChat:"Open chat",dismissGreeting:"Dismiss greeting",errorGeneric:"Something went wrong. Please try again.",errorConnection:"Failed to connect. Please try again.",errorTimeout:"Request timed out. Please try again.",errorRateLimitMinute:"Too many requests. Please wait a minute.",errorRateLimitHour:"Hourly limit reached. Please try again later.",errorRetry:"Retry"},es:{title:"Chat",subtitle:"Pregúntame lo que quieras",welcomeMessage:"¡Hola! ¿En qué puedo ayudarte hoy?",closeChat:"Cerrar chat",chatMessages:"Mensajes del chat",typingIndicator:"El asistente está escribiendo",placeholder:"Escribe tu mensaje...",sendMessage:"Enviar mensaje",typeYourMessage:"Escribe tu mensaje",openChat:"Abrir chat",dismissGreeting:"Descartar saludo",errorGeneric:"Algo salió mal. Inténtalo de nuevo.",errorConnection:"No se pudo conectar. Inténtalo de nuevo.",errorTimeout:"La solicitud tardó demasiado. Inténtalo de nuevo.",errorRateLimitMinute:"Demasiadas solicitudes. Espera un minuto.",errorRateLimitHour:"Has alcanzado el límite por hora. Inténtalo más tarde.",errorRetry:"Reintentar"},fr:{title:"Chat",subtitle:"Posez-moi vos questions",welcomeMessage:"Bonjour ! Comment puis-je vous aider aujourd'hui ?",closeChat:"Fermer le chat",chatMessages:"Messages du chat",typingIndicator:"L'assistant écrit",placeholder:"Saisissez votre message...",sendMessage:"Envoyer le message",typeYourMessage:"Saisissez votre message",openChat:"Ouvrir le chat",dismissGreeting:"Ignorer le message d'accueil",errorGeneric:"Une erreur s'est produite. Veuillez réessayer.",errorConnection:"Échec de la connexion. Veuillez réessayer.",errorTimeout:"La requête a expiré. Veuillez réessayer.",errorRateLimitMinute:"Trop de requêtes. Veuillez patienter une minute.",errorRateLimitHour:"Limite horaire atteinte. Veuillez réessayer plus tard.",errorRetry:"Réessayer"},de:{title:"Chat",subtitle:"Fragen Sie mich alles",welcomeMessage:"Hallo! Wie kann ich Ihnen heute helfen?",closeChat:"Chat schließen",chatMessages:"Chat-Nachrichten",typingIndicator:"Der Assistent schreibt",placeholder:"Geben Sie Ihre Nachricht ein...",sendMessage:"Nachricht senden",typeYourMessage:"Geben Sie Ihre Nachricht ein",openChat:"Chat öffnen",dismissGreeting:"Begrüßung schließen",errorGeneric:"Etwas ist schiefgelaufen. Bitte versuchen Sie es erneut.",errorConnection:"Verbindung fehlgeschlagen. Bitte versuchen Sie es erneut.",errorTimeout:"Zeitüberschreitung der Anfrage. Bitte versuchen Sie es erneut.",errorRateLimitMinute:"Zu viele Anfragen. Bitte warten Sie eine Minute.",errorRateLimitHour:"Stündliches Limit erreicht. Bitte versuchen Sie es später erneut.",errorRetry:"Erneut versuchen"}};function ni(f){if(!f)return;const h=f.toLowerCase().split("-")[0];return Object.prototype.hasOwnProperty.call(ti,h)?h:void 0}function Zc(){const f=typeof document<"u"?ni(document.documentElement.lang):void 0;if(f)return f;const h=typeof navigator<"u"?ni(navigator.language):void 0;return h||"en"}function Jc(f={}){const{locale:h,translations:s}=f,y=ti[h??Zc()];return s?{...y,...s}:{...y}}const ri=["accent","accentText","accentSoft","accentTextMuted","surface","surfaceMuted","text","textMuted","border","userBubble","userBubbleText","assistantBubble","assistantBubbleText","field","error","errorSurface","errorText","link","scrim"],qc=["sm","md","lg","full","tail"],bc=["elevated","floating","floatingHover"],ef=["heading","body"],li={default:{name:"default"},minimal:{name:"minimal",colors:{accent:"#171717",accentText:"#ffffff",surface:"#ffffff",surfaceMuted:"#f5f5f5",text:"#171717",textMuted:"#737373",border:"#e5e5e5",link:"#171717"},colorsDark:{accent:"#fafafa",accentText:"#171717",surface:"#0a0a0a",surfaceMuted:"#1c1c1c",text:"#fafafa",textMuted:"#a3a3a3",border:"#2e2e2e",field:"#1c1c1c",link:"#fafafa"},radii:{sm:"4px",md:"6px",lg:"10px"},shadows:{elevated:"0 4px 16px rgb(0 0 0 / 0.12)",floating:"0 2px 8px rgb(0 0 0 / 0.12)",floatingHover:"0 4px 12px rgb(0 0 0 / 0.16)"}},playful:{name:"playful",colors:{accent:"#8b5cf6",surfaceMuted:"#f5f3ff",assistantBubbleText:"#4c1d95",link:"#7c3aed"},colorsDark:{accent:"#a78bfa",surfaceMuted:"#2e1065",assistantBubbleText:"#ede9fe",link:"#c4b5fd"},radii:{sm:"12px",md:"16px",lg:"24px",tail:"8px"},shadows:{elevated:"0 24px 48px -12px rgb(139 92 246 / 0.35)",floating:"0 10px 20px -5px rgb(139 92 246 / 0.4)",floatingHover:"0 16px 28px -6px rgb(139 92 246 / 0.5)"},fonts:{heading:"ui-rounded, 'Hiragino Maru Gothic ProN', system-ui",body:"ui-rounded, 'Hiragino Maru Gothic ProN', system-ui"}},corporate:{name:"corporate",colors:{accent:"#1e3a5f",surfaceMuted:"#f3f4f6",text:"#1f2937",textMuted:"#6b7280",border:"#d1d5db",link:"#1d4ed8"},colorsDark:{accent:"#2c5282",link:"#93c5fd"},radii:{sm:"4px",md:"6px",lg:"8px",tail:"2px"},shadows:{elevated:"0 8px 24px rgb(15 23 42 / 0.16)",floating:"0 4px 12px rgb(15 23 42 / 0.18)",floatingHover:"0 6px 16px rgb(15 23 42 / 0.24)"},fonts:{heading:"'Segoe UI', 'Helvetica Neue', Arial, system-ui",body:"'Segoe UI', 'Helvetica Neue', Arial, system-ui"}}};function tf(f){return Object.prototype.hasOwnProperty.call(li,f)}const nf=new Set(["light","dark","auto"]);function rf(f){if(f===void 0)return{mode:"light"};if(typeof f=="string"){if(nf.has(f))return{mode:f};if(tf(f)){const h=li[f];return{mode:h.colorScheme??"light",theme:h}}return{mode:"light",url:f}}return{mode:f.colorScheme??"light",theme:f}}function lf(f){return f.replace(/[A-Z]/g,h=>`-${h.toLowerCase()}`)}function uf(f,h){console.warn(`[Claudius] Ignoring unknown theme token "${h}" in "${f}"`)}function Un(f,h,s,y,g,E=""){if(g)for(const[L,P]of Object.entries(g)){if(!y.includes(L)){uf(h,L);continue}typeof P=="string"&&(f[`${s}${lf(L)}${E}`]=P)}}function of(f){const h={};Un(h,"colors","--cl-color-",ri,f.colors);for(const[s,y]of Object.entries({...h}))h[`${s}-dark`]=y;return Un(h,"colorsDark","--cl-color-",ri,f.colorsDark,"-dark"),Un(h,"radii","--cl-radius-",qc,f.radii),Un(h,"shadows","--cl-shadow-",bc,f.shadows),Un(h,"fonts","--cl-font-",ef,f.fonts),h}function sf(f){return typeof f=="object"&&f!==null&&!Array.isArray(f)}function af(f){const h=D.useMemo(()=>rf(f),[f]),[s,y]=D.useState(null),g=h.url;D.useEffect(()=>{if(y(null),!g)return;const N=new AbortController;return fetch(g,{signal:N.signal}).then(F=>{if(!F.ok)throw new Error(`HTTP ${F.status}`);return F.json()}).then(F=>{if(!sf(F))throw new Error("theme JSON must be an object");y(F)}).catch(F=>{N.signal.aborted||console.error(`[Claudius] Failed to load theme from ${g}:`,F)}),()=>N.abort()},[g]);const E=h.theme??s??null,L=(s==null?void 0:s.colorScheme)??h.mode,P=D.useMemo(()=>E?of(E):{},[E]);return{mode:L,cssVars:P}}const ui="claudius:triggers:dismissed";function cf(){if(typeof window>"u")return!1;try{return window.sessionStorage.getItem(ui)==="1"}catch{return!1}}function ff(){if(!(typeof window>"u"))try{window.sessionStorage.setItem(ui,"1")}catch{}}function oi({apiUrl:f,title:h,subtitle:s,welcomeMessage:y,placeholder:g,persistMessages:E,storageKeyPrefix:L,requestTimeoutMs:P,theme:N="light",accentColor:F,position:$="bottom-right",locale:G,translations:B,triggers:re,plugins:q}){const[V,W]=D.useState(!1),[pe,we]=D.useState(null),[ae,ce]=D.useState(cf),xe=D.useRef(!1),he=xc("(max-width: 639px)"),fe=D.useMemo(()=>Jc({locale:G,translations:B}),[G,B]),{messages:Le,isLoading:b,error:Ae,canRetry:at,sendMessage:Ke,retry:Y}=wc({apiUrl:f,persistMessages:E,storageKeyPrefix:L,timeoutMs:P,translations:fe,plugins:q}),J=D.useRef(null),Se=D.useRef(V),{mode:ie,cssVars:oe}=af(N),[R,A]=D.useState(!1);D.useEffect(()=>{if(ie!=="auto")return;const ke=window.matchMedia("(prefers-color-scheme: dark)");A(ke.matches);const qt=Nr=>A(Nr.matches);return ke.addEventListener("change",qt),()=>ke.removeEventListener("change",qt)},[ie]),D.useEffect(()=>{var ke;Se.current&&!V&&((ke=J.current)==null||ke.focus()),Se.current=V},[V]);const T=D.useCallback(()=>{ce(!0),ff()},[]),d=D.useCallback(()=>{W(!1),xe.current&&(xe.current=!1,T())},[T]),w=D.useCallback(()=>{W(ke=>!ke)},[]),K=D.useCallback(()=>{xe.current=!0,we(null),W(!0)},[]),X=D.useCallback(ke=>{we(ke)},[]),ee=D.useCallback(()=>{we(null),K()},[K]),te=D.useCallback(()=>{we(null),T()},[T]);kc({triggers:re,enabled:!ae&&!V,onOpen:K,onGreeting:X});const de=ie==="dark"||ie==="auto"&&R,le={...oe,...F?{"--cl-color-accent":F,"--cl-color-accent-dark":F}:{}},me=Object.keys(le).length>0?le:void 0;return C.jsx("div",{className:"claudius-root",style:me,children:C.jsxs("div",{"data-claudius-dark":de?"true":"false",children:[V&&he&&C.jsx("div",{className:"claudius-scrim fixed inset-0 z-40 bg-claudius-scrim",onClick:d,"aria-hidden":"true"}),V&&C.jsx(Gc,{messages:Le,isLoading:b,error:Ae,canRetry:at,onSend:Ke,onRetry:Y,onClose:d,title:h??fe.title,subtitle:s??fe.subtitle,welcomeMessage:y??fe.welcomeMessage,placeholder:g??fe.placeholder,position:$,translations:fe,isMobile:he}),!(V&&he)&&C.jsx(Cc,{ref:J,isOpen:V,onClick:w,position:$,translations:fe}),!V&&pe&&C.jsx(Xc,{message:pe,position:$,onOpen:ee,onDismiss:te,dismissLabel:fe.dismissGreeting})]})})}const df="1.10.0";typeof window<"u"&&(window.ClaudiusWidgetVersion=df);function ii(){const f=window.ClaudiusConfig;if(!(f!=null&&f.apiUrl)){console.error("[Claudius] Missing ClaudiusConfig.apiUrl");return}const h=document.createElement("div");h.id="claudius-chat-widget",document.body.appendChild(h),Go.createRoot(h).render(C.jsx(oi,{apiUrl:f.apiUrl,title:f.title,subtitle:f.subtitle,welcomeMessage:f.welcomeMessage,placeholder:f.placeholder,persistMessages:f.persistMessages,storageKeyPrefix:f.storageKeyPrefix,requestTimeoutMs:f.requestTimeoutMs,theme:f.theme,accentColor:f.accentColor,position:f.position,locale:f.locale,translations:f.translations,triggers:f.triggers}))}class si extends HTMLElement{constructor(){super(...arguments);Jt(this,"root",null);Jt(this,"container",null)}static get observedAttributes(){return["api-url","title","subtitle","welcome-message","placeholder","persist-messages","storage-key-prefix","request-timeout-ms","theme","accent-color","position"]}connectedCallback(){this.container=document.createElement("div"),this.appendChild(this.container),this.root=Go.createRoot(this.container),this.render()}disconnectedCallback(){this.root&&(this.root.unmount(),this.root=null),this.container&&(this.container.remove(),this.container=null)}attributeChangedCallback(){this.render()}render(){if(!this.root)return;const s=this.getAttribute("api-url");if(!s){console.error("[Claudius] Missing api-url attribute on <claudius-chat>");return}const y=this.getAttribute("persist-messages"),g=y===null?void 0:y!=="false",E=this.getAttribute("request-timeout-ms"),L=E===null?void 0:Number(E);this.root.render(C.jsx(oi,{apiUrl:s,title:this.getAttribute("title")??void 0,subtitle:this.getAttribute("subtitle")??void 0,welcomeMessage:this.getAttribute("welcome-message")??void 0,placeholder:this.getAttribute("placeholder")??void 0,persistMessages:g,storageKeyPrefix:this.getAttribute("storage-key-prefix")??void 0,requestTimeoutMs:L!==void 0&&Number.isFinite(L)?L:void 0,theme:this.getAttribute("theme")??void 0,accentColor:this.getAttribute("accent-color")??void 0,position:this.getAttribute("position")??void 0}))}}return typeof customElements<"u"&&!customElements.get("claudius-chat")&&customElements.define("claudius-chat",si),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ii):ii(),Et.ClaudiusChat=si,Object.defineProperty(Et,Symbol.toStringTag,{value:"Module"}),Et})({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudius-chat-widget",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "type": "module",
5
5
  "description": "Embeddable AI chat widget powered by Claude. Drop-in React component or standalone script embed, backed by a Cloudflare Worker.",
6
6
  "keywords": [
@@ -70,6 +70,7 @@
70
70
  "format:check": "prettier --check \"src/**/*.{ts,tsx,css}\"",
71
71
  "typecheck": "tsc --noEmit",
72
72
  "check:exports": "publint --strict && attw --pack . --exclude-entrypoints ./embed ./style.css",
73
+ "size": "size-limit",
73
74
  "storybook": "storybook dev -p 6006",
74
75
  "build-storybook": "storybook build"
75
76
  },
@@ -82,6 +83,7 @@
82
83
  "@eslint/js": "^9.24.0",
83
84
  "@microsoft/api-extractor": "^7.58.9",
84
85
  "@playwright/test": "^1.59.1",
86
+ "@size-limit/file": "^13.0.3",
85
87
  "@storybook/react-vite": "10.4.1",
86
88
  "@testing-library/jest-dom": "^6.6.0",
87
89
  "@testing-library/react": "^16.3.0",
@@ -103,6 +105,7 @@
103
105
  "publint": "^0.3.21",
104
106
  "react": "^18.3.0",
105
107
  "react-dom": "^18.3.0",
108
+ "size-limit": "^13.0.3",
106
109
  "storybook": "10.4.1",
107
110
  "tailwindcss": "^3.4.0",
108
111
  "typedoc": "^0.28.19",