`+a[c].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),typeof e=="function"&&G.set(e,_),_}while(c>=1&&f>=0);break}}}finally{ee=!1,Z.current=s,$e(),Error.prepareStackTrace=o}var Y=e?e.displayName||e.name:"",Oe=Y?U(Y):"";return typeof e=="function"&&G.set(e,Oe),Oe}function Ge(e,r,t){return ye(e,!1)}function Be(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function B(e,r,t){if(e==null)return"";if(typeof e=="function")return ye(e,Be(e));if(typeof e=="string")return U(e);switch(e){case v:return U("Suspense");case m:return U("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return Ge(e.render);case h:return B(e.type,r,t);case x:{var n=e,o=n._payload,s=n._init;try{return B(s(o),r,t)}catch{}}}return""}var J=Object.prototype.hasOwnProperty,be={},Ee=D.ReactDebugCurrentFrame;function z(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}function Je(e,r,t,n,o){{var s=Function.call.bind(J);for(var i in e)if(s(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var y=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw y.name="Invariant Violation",y}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){a=c}a&&!(a instanceof Error)&&(z(o),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),z(null)),a instanceof Error&&!(a.message in be)&&(be[a.message]=!0,z(o),g("Failed %s type: %s",t,a.message),z(null))}}}var ze=Array.isArray;function re(e){return ze(e)}function qe(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function He(e){try{return xe(e),!1}catch{return!0}}function xe(e){return""+e}function _e(e){if(He(e))return g("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",qe(e)),xe(e)}var $=D.ReactCurrentOwner,Ke={key:!0,ref:!0,__self:!0,__source:!0},Re,we,te;te={};function Xe(e){if(J.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ze(e){if(J.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Qe(e,r){if(typeof e.ref=="string"&&$.current&&r&&$.current.stateNode!==r){var t=k($.current.type);te[t]||(g('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',k($.current.type),e.ref),te[t]=!0)}}function er(e,r){{var t=function(){Re||(Re=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function rr(e,r){{var t=function(){we||(we=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var tr=function(e,r,t,n,o,s,i){var a={$$typeof:T,type:e,key:r,ref:t,props:i,_owner:s};return a._store={},Object.defineProperty(a._
Checkthetop-levelrendercallusing<`+t+">.")}return r}}function Pe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ir(r);if(je[t])return;je[t]=!0;var n="";e&&e._owner&&e._owner!==ne.current&&(n=" It was passed a child from "+k(e._owner.type)+"."),W(e),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),W(null)}}function ke(e,r){{if(typeof e!="object")return;if(re(e))for(var t=0;t<e.length;t++){var n=e[t];ie(n)&&Pe(n,r)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var o=H(e);if(typeof o=="function"&&o!==e.entries)for(var s=o.call(e),i;!(i=s.next()).done;)ie(i.value)&&Pe(i.value,r)}}}function or(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===d||r.$$typeof===h))t=r.propTypes;else return;if(t){var n=k(r);Je(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!ae){ae=!0;var o=k(r);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){W(e),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),W(null);break}}e.ref!==null&&(W(e),g("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}function Ce(e,r,t,n,o,s){{var i=Ve(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var y=ar(o);y?a+=y:a+=Se();var c;e===null?c="null":re(e)?c="array":e!==void 0&&e.$$typeof===T?(c="<"+(k(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):c=typeof e,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",c,a)}var f=nr(e,r,t,o,s);if(f==null)return f;if(i){var _=r.children;if(_!==void 0)if(n)if(re(_)){for(var Y=0;Y<_.length;Y++)ke(_[Y],e);Object.freeze&&Object.freeze(_)}else g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ke(_,e)}return e===u?sr(f):or(f),f}}function lr(e,r,t){return Ce(e,r,t,!0)}function ur(e,r,t){return Ce(e,r,t,!1)}var cr=ur,fr=lr;L.Fragment=u,L.jsx=cr,L.jsxs=fr}()),L}process.env.NODE_ENV==="production"?q.exports=De():q.exports=Ne();var l=q.exports;function Ae({question:A="",apiKey:T="",selectedDocs:O="",history:u=[],conversationId:E=null,apiHost:j="",onEvent:S=()=>{console.log("Event triggered, but no handler provided.")}}){let b="default";return O&&(b=O),new Promise((d,v)=>{const m={question:A,api_key:T,embeddings_key:T,active_docs:b,history:JSON.stringify(u),conversation_id:E,model:"default"};fetch(j+"/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)}).then(h=>{if(!h.body)throw Error("No response body");const x=h.body.getReader(),p=new TextDecoder("utf-8");let w=0;const P=({done:H,value:D})=>{if(H){console.log(w),d();return}w+=1;const K=p.decode(D).split(`