@ibiz-template-plugin/ai-chat 0.0.12 → 0.0.13

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.
@@ -1 +1 @@
1
- !function(){function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&e(t,n)}function e(t,n){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},e(t,n)}function n(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,o=r(t);if(e){var a=r(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return function(t,e){if(e&&("object"===p(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return i(t)}(this,n)}}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function r(t){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},r(t)}function o(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||c(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,a,c=[],s=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;s=!1}else for(;!(s=(i=o.call(n)).done)&&(c.push(i.value),c.length!==e);s=!0);}catch(t){l=!0,r=t}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw r}}return c}}(t,e)||c(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e){if(t){if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){y(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function h(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */h=function(){return e};var t,e={},n=Object.prototype,i=n.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function u(t,e,n,i){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),c=new M(i||[]);return r(a,"_invoke",{value:S(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var d="suspendedStart",v="suspendedYield",_="executing",m="completed",y={};function g(){}function b(){}function w(){}var x={};l(x,a,(function(){return this}));var k=Object.getPrototypeOf,C=k&&k(k(I([])));C&&C!==n&&i.call(C,a)&&(x=C);var N=w.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function n(r,o,a,c){var s=f(t[r],t,o);if("throw"!==s.type){var l=s.arg,u=l.value;return u&&"object"==p(u)&&i.call(u,"__await")?e.resolve(u.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(u).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;r(this,"_invoke",{value:function(t,i){function r(){return new e((function(e,r){n(t,i,e,r)}))}return o=o?o.then(r,r):r()}})}function S(e,n,i){var r=d;return function(o,a){if(r===_)throw new Error("Generator is already running");if(r===m){if("throw"===o)throw a;return{value:t,done:!0}}for(i.method=o,i.arg=a;;){var c=i.delegate;if(c){var s=A(c,i);if(s){if(s===y)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===d)throw r=m,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=_;var l=f(e,n,i);if("normal"===l.type){if(r=i.done?m:v,l.arg===y)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(r=m,i.method="throw",i.arg=l.arg)}}}function A(e,n){var i=n.method,r=e.iterator[i];if(r===t)return n.delegate=null,"throw"===i&&e.iterator.return&&(n.method="return",n.arg=t,A(e,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var o=f(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function z(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function I(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function n(){for(;++r<e.length;)if(i.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(p(e)+" is not iterable")}return b.prototype=w,r(N,"constructor",{value:w,configurable:!0}),r(w,"constructor",{value:b,configurable:!0}),b.displayName=l(w,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,s,"GeneratorFunction")),t.prototype=Object.create(N),t},e.awrap=function(t){return{__await:t}},E(T.prototype),l(T.prototype,c,(function(){return this})),e.AsyncIterator=T,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var a=new T(u(t,n,i,r),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(N),l(N,s,"Generator"),l(N,a,(function(){return this})),l(N,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var i in e)n.push(i);return n.reverse(),function t(){for(;n.length;){var i=n.pop();if(i in e)return t.value=i,t.done=!1,t}return t.done=!0,t}},e.values=I,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(z),!e)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(i,r){return c.type="throw",c.arg=e,n.next=i,r&&(n.method="next",n.arg=t),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(s&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),z(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;z(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:I(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),y}},e}function f(t,e,n,i,r,o,a){try{var c=t[o](a),s=c.value}catch(l){return void n(l)}c.done?e(s):Promise.resolve(s).then(i,r)}function d(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function a(t){f(o,i,r,a,c,"next",t)}function c(t){f(o,i,r,a,c,"throw",t)}a(void 0)}))}}function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function v(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,g(i.key),i)}}function m(t,e,n){return e&&_(t.prototype,e),n&&_(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function y(t,e,n){return(e=g(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function g(t){var e=function(t,e){if("object"!==p(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==p(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===p(e)?e:String(e)}System.register(["interactjs","cherry-markdown"],(function(e,r){"use strict";var c,s;return{setters:[function(t){c=t.default},function(t){s=t.default}],execute:function(){var r,l,f,_,g,b,w,x,k,C={},N=[],E=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,T=Array.isArray;function S(t,e){for(var n in e)t[n]=e[n];return t}function A(t){var e=t.parentNode;e&&e.removeChild(t)}function O(t,e,n){var i,o,a,c={};for(a in e)"key"==a?i=e[a]:"ref"==a?o=e[a]:c[a]=e[a];if(arguments.length>2&&(c.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(a in t.defaultProps)void 0===c[a]&&(c[a]=t.defaultProps[a]);return z(t,c,i,o,null)}function z(t,e,n,i,r){var o={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++f:r};return null==r&&null!=l.vnode&&l.vnode(o),o}function M(t){return t.children}function I(t,e){this.props=t,this.context=e}function L(t,e){if(null==e)return t.__?L(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__d||n.__e;return"function"==typeof t.type?L(t):null}function D(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return D(t)}}function P(t){(!t.__d&&(t.__d=!0)&&g.push(t)&&!H.__r++||b!==l.debounceRendering)&&((b=l.debounceRendering)||w)(H)}function H(){var t,e,n,i,r,o,a,c,s;for(g.sort(x);t=g.shift();)t.__d&&(e=g.length,i=void 0,r=void 0,o=void 0,c=(a=(n=t).__v).__e,(s=n.__P)&&(i=[],r=[],(o=S({},a)).__v=a.__v+1,$(s,a,o,n.__n,void 0!==s.ownerSVGElement,null!=a.__h?[c]:null,i,null==c?L(a):c,a.__h,r),X(i,a,r),a.__e!=c&&D(a)),g.length>e&&g.sort(x));H.__r=0}function j(t,e,n,i,r,o,a,c,s,l,u){var h,f,d,p,v,_,m,y,g,b=0,w=i&&i.__k||N,x=w.length,k=x,E=e.length;for(n.__k=[],h=0;h<E;h++)null!=(p=n.__k[h]=null==(p=e[h])||"boolean"==typeof p||"function"==typeof p?null:"string"==typeof p||"number"==typeof p||"bigint"==typeof p?z(null,p,null,null,p):T(p)?z(M,{children:p},null,null,null):p.__b>0?z(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)?(p.__=n,p.__b=n.__b+1,-1===(y=U(p,w,m=h+b,k))?d=C:(d=w[y]||C,w[y]=void 0,k--),$(t,p,d,r,o,a,c,s,l,u),v=p.__e,(f=p.ref)&&d.ref!=f&&(d.ref&&G(d.ref,null,p),u.push(f,p.__c||v,p)),null!=v&&(null==_&&(_=v),(g=d===C||null===d.__v)?-1==y&&b--:y!==m&&(y===m+1?b++:y>m?k>E-m?b+=y-m:b--:b=y<m&&y==m-1?y-m:0),m=h+b,"function"!=typeof p.type||y===m&&d.__k!==p.__k?"function"==typeof p.type||y===m&&!g?void 0!==p.__d?(s=p.__d,p.__d=void 0):s=v.nextSibling:s=F(t,v,s):s=B(p,s,t),"function"==typeof n.type&&(n.__d=s))):(d=w[h])&&null==d.key&&d.__e&&(d.__e==s&&(d.__=i,s=L(d)),J(d,d,!1),w[h]=null);for(n.__e=_,h=x;h--;)null!=w[h]&&("function"==typeof n.type&&null!=w[h].__e&&w[h].__e==n.__d&&(n.__d=w[h].__e.nextSibling),J(w[h],w[h]))}function B(t,e,n){for(var i,r=t.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=t,e="function"==typeof i.type?B(i,e,n):F(n,i.__e,e));return e}function R(t,e){return e=e||[],null==t||"boolean"==typeof t||(T(t)?t.some((function(t){R(t,e)})):e.push(t)),e}function F(t,e,n){return null==n||n.parentNode!==t?t.insertBefore(e,null):e==n&&null!=e.parentNode||t.insertBefore(e,n),e.nextSibling}function U(t,e,n,i){var r=t.key,o=t.type,a=n-1,c=n+1,s=e[n];if(null===s||s&&r==s.key&&o===s.type)return n;if(i>(null!=s?1:0))for(;a>=0||c<e.length;){if(a>=0){if((s=e[a])&&r==s.key&&o===s.type)return a;a--}if(c<e.length){if((s=e[c])&&r==s.key&&o===s.type)return c;c++}}return-1}function V(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||E.test(e)?n:n+"px"}function W(t,e,n,i,r){var o;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||V(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||V(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i?n.u=i.u:(n.u=Date.now(),t.addEventListener(e,o?Y:q,o)):t.removeEventListener(e,o?Y:q,o);else if("dangerouslySetInnerHTML"!==e){if(r)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&"role"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function q(t){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(l.event?l.event(t):t)}function Y(t){return this.l[t.type+!0](l.event?l.event(t):t)}function $(t,e,n,i,o,a,c,s,u,h){var f,d,p,v,_,m,y,g,b,w,x,k,N,E,O,z=e.type;if(void 0!==e.constructor)return null;null!=n.__h&&(u=n.__h,s=e.__e=n.__e,e.__h=null,a=[s]),(f=l.__b)&&f(e);t:if("function"==typeof z)try{if(g=e.props,b=(f=z.contextType)&&i[f.__c],w=f?b?b.props.value:f.__:i,n.__c?y=(d=e.__c=n.__c).__=d.__E:("prototype"in z&&z.prototype.render?e.__c=d=new z(g,w):(e.__c=d=new I(g,w),d.constructor=z,d.render=Z),b&&b.sub(d),d.props=g,d.state||(d.state={}),d.context=w,d.__n=i,p=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=z.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=S({},d.__s)),S(d.__s,z.getDerivedStateFromProps(g,d.__s))),v=d.props,_=d.state,d.__v=e,p)null==z.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==z.getDerivedStateFromProps&&g!==v&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(g,w),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(g,d.__s,w)||e.__v===n.__v)){for(e.__v!==n.__v&&(d.props=g,d.state=d.__s,d.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),x=0;x<d._sb.length;x++)d.__h.push(d._sb[x]);d._sb=[],d.__h.length&&c.push(d);break t}null!=d.componentWillUpdate&&d.componentWillUpdate(g,d.__s,w),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(v,_,m)}))}if(d.context=w,d.props=g,d.__P=t,d.__e=!1,k=l.__r,N=0,"prototype"in z&&z.prototype.render){for(d.state=d.__s,d.__d=!1,k&&k(e),f=d.render(d.props,d.state,d.context),E=0;E<d._sb.length;E++)d.__h.push(d._sb[E]);d._sb=[]}else do{d.__d=!1,k&&k(e),f=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++N<25);d.state=d.__s,null!=d.getChildContext&&(i=S(S({},i),d.getChildContext())),p||null==d.getSnapshotBeforeUpdate||(m=d.getSnapshotBeforeUpdate(v,_)),j(t,T(O=null!=f&&f.type===M&&null==f.key?f.props.children:f)?O:[O],e,n,i,o,a,c,s,u,h),d.base=e.__e,e.__h=null,d.__h.length&&c.push(d),y&&(d.__E=d.__=null)}catch(t){e.__v=null,(u||null!=a)&&(e.__e=s,e.__h=!!u,a[a.indexOf(s)]=null),l.__e(t,e,n)}else null==a&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=function(t,e,n,i,o,a,c,s,l){var u,h,f,d=n.props,p=e.props,v=e.type,_=0;if("svg"===v&&(o=!0),null!=a)for(;_<a.length;_++)if((u=a[_])&&"setAttribute"in u==!!v&&(v?u.localName===v:3===u.nodeType)){t=u,a[_]=null;break}if(null==t){if(null===v)return document.createTextNode(p);t=o?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,p.is&&p),a=null,s=!1}if(null===v)d===p||s&&t.data===p||(t.data=p);else{if(a=a&&r.call(t.childNodes),h=(d=n.props||C).dangerouslySetInnerHTML,f=p.dangerouslySetInnerHTML,!s){if(null!=a)for(d={},_=0;_<t.attributes.length;_++)d[t.attributes[_].name]=t.attributes[_].value;(f||h)&&(f&&(h&&f.__html==h.__html||f.__html===t.innerHTML)||(t.innerHTML=f&&f.__html||""))}if(function(t,e,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in e||W(t,o,null,n[o],i);for(o in e)r&&"function"!=typeof e[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===e[o]||W(t,o,e[o],n[o],i)}(t,p,d,o,s),f)e.__k=[];else if(j(t,T(_=e.props.children)?_:[_],e,n,i,o&&"foreignObject"!==v,a,c,a?a[0]:n.__k&&L(n,0),s,l),null!=a)for(_=a.length;_--;)null!=a[_]&&A(a[_]);s||("value"in p&&void 0!==(_=p.value)&&(_!==t.value||"progress"===v&&!_||"option"===v&&_!==d.value)&&W(t,"value",_,d.value,!1),"checked"in p&&void 0!==(_=p.checked)&&_!==t.checked&&W(t,"checked",_,d.checked,!1))}return t}(n.__e,e,n,i,o,a,c,u,h);(f=l.diffed)&&f(e)}function X(t,e,n){for(var i=0;i<n.length;i++)G(n[i],n[++i],n[++i]);l.__c&&l.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){l.__e(t,e.__v)}}))}function G(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){l.__e(t,n)}}function J(t,e,n){var i,r;if(l.unmount&&l.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||G(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){l.__e(t,e)}i.base=i.__P=null,t.__c=void 0}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&J(i[r],e,n||"function"!=typeof t.type);n||null==t.__e||A(t.__e),t.__=t.__e=t.__d=void 0}function Z(t,e,n){return this.constructor(t,n)}function K(t,e,n){var i,o,a,c;l.__&&l.__(t,e),o=(i="function"==typeof n)?null:n&&n.__k||e.__k,a=[],c=[],$(e,t=(!i&&n||e).__k=O(M,null,[t]),o||C,C,void 0!==e.ownerSVGElement,!i&&n?[n]:o?null:e.firstChild?r.call(e.childNodes):null,a,!i&&n?n:o?o.__e:e.firstChild,i,c),X(a,t,c)}r=N.slice,l={__e:function(t,e,n,i){for(var r,o,a;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(t)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,i||{}),a=r.__d),a)return r.__E=r}catch(e){t=e}throw t}},f=0,_=function(t){return null!=t&&void 0===t.constructor},I.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=S({},this.state),"function"==typeof t&&(t=t(S({},n),this.props)),t&&S(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),P(this))},I.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),P(this))},I.prototype.render=M,g=[],w="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,x=function(t,e){return t.__v.__b-e.__v.__b},H.__r=0,k=0;function Q(t,e,n,i,r){var o="".concat(t,"-").concat(e);return n&&(o+="-".concat(n)),i&&(o+="__".concat(i)),r&&(o+="--".concat(r)),o}var tt=function(){function t(e,n){v(this,t),y(this,"namespace",void 0),this.block=e,this.namespace=n||"ibiz"}return m(t,[{key:"b",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Q(this.namespace,this.block,t,"","")}},{key:"e",value:function(t){return t?Q(this.namespace,this.block,"",t,""):""}},{key:"m",value:function(t){return t?Q(this.namespace,this.block,"","",t):""}},{key:"be",value:function(t,e){return t&&e?Q(this.namespace,this.block,t,e,""):""}},{key:"em",value:function(t,e){return t&&e?Q(this.namespace,this.block,"",t,e):""}},{key:"bm",value:function(t,e){return t&&e?Q(this.namespace,this.block,t,"",e):""}},{key:"bem",value:function(t,e,n){return t&&e&&n?Q(this.namespace,this.block,t,e,n):""}},{key:"is",value:function(t,e){return t&&e?"".concat("is-").concat(t):""}},{key:"cssVar",value:function(t){var e={};for(var n in t)t[n]&&(e[this.cssVarName(n)]=t[n]);return e}},{key:"cssVarBlock",value:function(t){var e={};for(var n in t)t[n]&&(e[this.cssVarBlockName(n)]=t[n]);return e}},{key:"cssVarName",value:function(t){return"--".concat(this.namespace,"-").concat(t)}},{key:"cssVarBlockName",value:function(t){return"--".concat(this.namespace,"-").concat(this.block,"-").concat(t)}}]),t}();function et(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function nt(t,e){for(var n,i="",r=0,o=-1,a=0,c=0;c<=t.length;++c){if(c<t.length)n=t.charCodeAt(c);else{if(47===n)break;n=47}if(47===n){if(o===c-1||1===a);else if(o!==c-1&&2===a){if(i.length<2||2!==r||46!==i.charCodeAt(i.length-1)||46!==i.charCodeAt(i.length-2))if(i.length>2){var s=i.lastIndexOf("/");if(s!==i.length-1){-1===s?(i="",r=0):r=(i=i.slice(0,s)).length-1-i.lastIndexOf("/"),o=c,a=0;continue}}else if(2===i.length||1===i.length){i="",r=0,o=c,a=0;continue}e&&(i.length>0?i+="/..":i="..",r=2)}else i.length>0?i+="/"+t.slice(o+1,c):i=t.slice(o+1,c),r=c-o-1;o=c,a=0}else 46===n&&-1!==a?++a:a=-1}return i}var it={resolve:function(){for(var t,e="",n=!1,i=arguments.length-1;i>=-1&&!n;i--){var r;i>=0?r=arguments[i]:(void 0===t&&(t=process.cwd()),r=t),et(r),0!==r.length&&(e=r+"/"+e,n=47===r.charCodeAt(0))}return e=nt(e,!n),n?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(et(t),0===t.length)return".";var e=47===t.charCodeAt(0),n=47===t.charCodeAt(t.length-1);return 0!==(t=nt(t,!e)).length||e||(t="."),t.length>0&&n&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return et(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var n=arguments[e];et(n),n.length>0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":it.normalize(t)},relative:function(t,e){if(et(t),et(e),t===e)return"";if((t=it.resolve(t))===(e=it.resolve(e)))return"";for(var n=1;n<t.length&&47===t.charCodeAt(n);++n);for(var i=t.length,r=i-n,o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var a=e.length-o,c=r<a?r:a,s=-1,l=0;l<=c;++l){if(l===c){if(a>c){if(47===e.charCodeAt(o+l))return e.slice(o+l+1);if(0===l)return e.slice(o+l)}else r>c&&(47===t.charCodeAt(n+l)?s=l:0===l&&(s=0));break}var u=t.charCodeAt(n+l);if(u!==e.charCodeAt(o+l))break;47===u&&(s=l)}var h="";for(l=n+s+1;l<=i;++l)l!==i&&47!==t.charCodeAt(l)||(0===h.length?h+="..":h+="/..");return h.length>0?h+e.slice(o+s):(o+=s,47===e.charCodeAt(o)&&++o,e.slice(o))},_makeLong:function(t){return t},dirname:function(t){if(et(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,i=-1,r=!0,o=t.length-1;o>=1;--o)if(47===(e=t.charCodeAt(o))){if(!r){i=o;break}}else r=!1;return-1===i?n?"/":".":n&&1===i?"//":t.slice(0,i)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');et(t);var n,i=0,r=-1,o=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,c=-1;for(n=t.length-1;n>=0;--n){var s=t.charCodeAt(n);if(47===s){if(!o){i=n+1;break}}else-1===c&&(o=!1,c=n+1),a>=0&&(s===e.charCodeAt(a)?-1==--a&&(r=n):(a=-1,r=c))}return i===r?r=c:-1===r&&(r=t.length),t.slice(i,r)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!o){i=n+1;break}}else-1===r&&(o=!1,r=n+1);return-1===r?"":t.slice(i,r)},extname:function(t){et(t);for(var e=-1,n=0,i=-1,r=!0,o=0,a=t.length-1;a>=0;--a){var c=t.charCodeAt(a);if(47!==c)-1===i&&(r=!1,i=a+1),46===c?-1===e?e=a:1!==o&&(o=1):-1!==e&&(o=-1);else if(!r){n=a+1;break}}return-1===e||-1===i||0===o||1===o&&e===i-1&&e===n+1?"":t.slice(e,i)},format:function(t){if(null===t||"object"!==p(t))throw new TypeError('The "pathObject" argument must be of type Object. Received type '+p(t));return function(t,e){var n=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return n?n===e.root?n+i:n+t+i:i}("/",t)},parse:function(t){et(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,i=t.charCodeAt(0),r=47===i;r?(e.root="/",n=1):n=0;for(var o=-1,a=0,c=-1,s=!0,l=t.length-1,u=0;l>=n;--l)if(47!==(i=t.charCodeAt(l)))-1===c&&(s=!1,c=l+1),46===i?-1===o?o=l:1!==u&&(u=1):-1!==o&&(u=-1);else if(!s){a=l+1;break}return-1===o||-1===c||0===u||1===u&&o===c-1&&o===a+1?-1!==c&&(e.base=e.name=0===a&&r?t.slice(1,c):t.slice(a,c)):(0===a&&r?(e.name=t.slice(1,o),e.base=t.slice(1,c)):(e.name=t.slice(a,o),e.base=t.slice(a,c)),e.ext=t.slice(o,c)),a>0?e.dir=t.slice(0,a-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};function rt(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function ot(){return"".concat(rt()+rt(),"-").concat(rt(),"-").concat(rt(),"-").concat(rt(),"-").concat(rt()).concat(rt()).concat(rt())}it.posix=it;var at=function(){function t(){v(this,t)}return m(t,null,[{key:"copy",value:function(t){return this.inputElement||(this.inputElement=document.createElement("input"),this.inputElement.style.position="absolute",this.inputElement.style.left="-9999px",document.body.appendChild(this.inputElement)),this.inputElement.value=t,this.inputElement.select(),document.execCommand("copy")}}]),t}();y(at,"inputElement",null);var ct=function(){function t(){v(this,t)}var e,n,i,r,o,a,c,s,l,u;return m(t,null,[{key:"checkDataBaseExists",value:(u=d(h().mark((function t(e){var n;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,indexedDB.databases();case 3:return n=t.sent,t.abrupt("return",n.some((function(t){return t.name===e})));case 7:return t.prev=7,t.t0=t.catch(0),console.error("检查数据库是否存在时出错:",t.t0),t.abrupt("return",!1);case 11:case"end":return t.stop()}}),t,null,[[0,7]])}))),function(t){return u.apply(this,arguments)})},{key:"deleteDatabase",value:(l=d(h().mark((function e(n){var i,r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.lastLink&&(null===(i=(r=t.lastLink).close)||void 0===i||i.call(r)),e.abrupt("return",new Promise((function(t,e){var i=indexedDB.deleteDatabase(n);i.onsuccess=function(){t(!0)},i.onerror=function(){t(!1)},i.onblocked=function(){console.warn("删除数据库 ".concat(n," 被阻塞,可能有其他连接正在使用该数据库。")),e(new Error("删除数据库 ".concat(n," 被阻塞")))}})));case 2:case"end":return e.stop()}}),e)}))),function(t){return l.apply(this,arguments)})},{key:"checkTableExists",value:(s=d(h().mark((function e(n,i){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.checkDataBaseExists(n);case 2:if(e.sent){e.next=5;break}return e.abrupt("return",!1);case 5:return e.abrupt("return",new Promise((function(e,r){var o=indexedDB.open(n);o.onupgradeneeded=function(e){t.db=e.target.result,t.version=t.db.version},o.onsuccess=function(n){t.db=n.target.result,t.lastLink=o.result;var r=t.db.objectStoreNames.contains(i);o.result.close(),e(r)},o.onerror=function(t){r(t.target.error)}})));case 6:case"end":return e.stop()}}),e)}))),function(t,e){return s.apply(this,arguments)})},{key:"createTable",value:(c=d(h().mark((function e(n,i,r){var o,a=arguments;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=a.length>3&&void 0!==a[3]&&a[3],e.abrupt("return",new Promise((function(e){var a,c;t.version+=1,t.lastLink&&(null===(a=(c=t.lastLink).close)||void 0===a||a.call(c));var s=indexedDB.open(n,t.version);s.onupgradeneeded=function(e){if(t.db=e.target.result,!t.db.objectStoreNames.contains(i)){var n={};r?n.keyPath=r:o&&(n.autoIncrement=!0),t.db.createObjectStore(i,n)}},s.onsuccess=function(){t.lastLink=s.result,s.result.close(),e(!0)},s.onerror=function(){e(!1)}})));case 2:case"end":return e.stop()}}),e)}))),function(t,e,n){return c.apply(this,arguments)})},{key:"deleteTable",value:(a=d(h().mark((function e(n,i){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var r,o;t.version+=1,t.lastLink&&(null===(r=(o=t.lastLink).close)||void 0===r||r.call(o));var a=indexedDB.open(n,t.version);a.onupgradeneeded=function(e){t.db=e.target.result,t.lastLink=a.result,t.db.objectStoreNames.contains(i)&&t.db.deleteObjectStore(i)},a.onsuccess=function(n){t.db=n.target.result,t.lastLink=a.result,a.result.close(),e(!0)},a.onerror=function(){a.result.close(),e(!1)}})));case 1:case"end":return e.stop()}}),e)}))),function(t,e){return a.apply(this,arguments)})},{key:"addData",value:(o=d(h().mark((function e(n,i,r){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=indexedDB.open(n);a.onsuccess=function(n){if(t.db=n.target.result,t.lastLink=a.result,t.db.objectStoreNames.contains(i)){var o=t.db.transaction([i],"readwrite").objectStore(i).add(r);o.onsuccess=function(t){e(r)},o.onerror=function(){e(null)}}a.result.close()},a.onerror=function(){a.result.close(),o()}})));case 1:case"end":return e.stop()}}),e)}))),function(t,e,n){return o.apply(this,arguments)})},{key:"deleteData",value:(r=d(h().mark((function e(n,i,r){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=indexedDB.open(n);a.onsuccess=function(n){if(t.db=n.target.result,t.lastLink=a.result,t.db.objectStoreNames.contains(i)){var o=t.db.transaction([i],"readwrite").objectStore(i).delete(r);o.onsuccess=function(t){e(!0)},o.onerror=function(){e(!1)}}a.result.close()},a.onerror=function(){a.result.close(),o()}})));case 1:case"end":return e.stop()}}),e)}))),function(t,e,n){return r.apply(this,arguments)})},{key:"updateData",value:(i=d(h().mark((function e(n,i,r){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=indexedDB.open(n);a.onsuccess=function(n){if(t.db=n.target.result,t.lastLink=a.result,t.db.objectStoreNames.contains(i)){var o=t.db.transaction([i],"readwrite").objectStore(i).put(r);o.onsuccess=function(t){e(r)},o.onerror=function(){e(r)}}a.result.close()},a.onerror=function(){a.result.close(),o()}})));case 1:case"end":return e.stop()}}),e)}))),function(t,e,n){return i.apply(this,arguments)})},{key:"getData",value:(n=d(h().mark((function e(n,i,r){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=indexedDB.open(n);a.onsuccess=function(n){if(t.db=n.target.result,t.lastLink=a.result,t.db.objectStoreNames.contains(i)){var c=t.db.transaction([i],"readonly").objectStore(i).get(r);c.onsuccess=function(t){e(c.result)},c.onerror=function(){o(new Error("未找到数据".concat(r)))}}a.result.close()},a.onerror=function(){a.result.close(),o()}})));case 1:case"end":return e.stop()}}),e)}))),function(t,e,i){return n.apply(this,arguments)})},{key:"getAllData",value:(e=d(h().mark((function e(n,i){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var o=indexedDB.open(n);o.onsuccess=function(n){if(t.db=n.target.result,t.lastLink=o.result,t.db.objectStoreNames.contains(i)){var r=t.db.transaction([i],"readonly").objectStore(i).getAll();r.onsuccess=function(t){e(r.result)},r.onerror=function(){e([])}}o.result.close()},o.onerror=function(){o.result.close(),r()}})));case 1:case"end":return e.stop()}}),e)}))),function(t,n){return e.apply(this,arguments)})}]),t}();y(ct,"version",1),y(ct,"db",null),y(ct,"lastLink",void 0);var st,lt,ut,ht,ft=function(){function t(e){v(this,t),y(this,"options",void 0),this.options=u({multiple:!0,accept:"*/*",maxSize:5242880},e)}var e,n;return m(t,[{key:"openFilePicker",value:function(){var t=this,e=document.createElement("input");e.type="file",e.multiple=this.options.multiple,e.accept=this.options.accept||"",e.onchange=function(e){var n=Array.from(e.target.files||[]);t.handleFiles(n)},e.click()}},{key:"handleFiles",value:(n=d(h().mark((function t(e){var n,i,r,o=this;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==e.length){t.next=2;break}return t.abrupt("return");case 2:return r=e.filter((function(t){var e,n;return!(o.options.maxSize&&t.size>o.options.maxSize&&(null===(e=(n=o.options).onError)||void 0===e||e.call(n,new Error("文件大小超过限制 (".concat(o.formatSize(t.size)," > ").concat(o.formatSize(o.options.maxSize),")")),t),1))})),null===(n=(i=this.options).onSelect)||void 0===n||n.call(i,r),t.next=6,Promise.all(r.map((function(t){return o.processFile(t)})));case 6:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"processFile",value:(e=d(h().mark((function t(e){var n,i,r,o,a,c,s,l,u=this;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,a=function(t){var n,i;null===(n=(i=u.options).onProgress)||void 0===n||n.call(i,e,t)},t.next=4,this.options.onUpload(e,a);case 4:c=t.sent,null===(n=(i=this.options).onProgress)||void 0===n||n.call(i,e,100),null===(r=(o=this.options).onSuccess)||void 0===r||r.call(o,c,e),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),null===(s=(l=this.options).onError)||void 0===s||s.call(l,t.t0 instanceof Error?t.t0:new Error("上传失败"),e);case 12:case"end":return t.stop()}}),t,this,[[0,9]])}))),function(t){return e.apply(this,arguments)})},{key:"formatSize",value:function(t){if(0===t)return"0 B";var e=Math.floor(Math.log(t)/Math.log(1024));return"".concat((t/Math.pow(1024,e)).toFixed(2)," ").concat(["B","KB","MB","GB"][e])}}]),t}(),dt=function(){function t(){v(this,t)}return m(t,null,[{key:"getCdataContent",value:function(t){if(!t)return null;var e=Array.from(t.childNodes).find((function(t){return t.nodeType===t.CDATA_SECTION_NODE}));return(null==e?void 0:e.nodeValue)||t.textContent}},{key:"parse",value:function(t){var e=this,n=(new DOMParser).parseFromString(t,"text/xml");return Array.from(n.querySelectorAll("resource")).map((function(t){var n=t.getAttribute("type")||"",i=t.querySelector("data"),r=t.querySelector("metadata");try{var o=e.getCdataContent(i),a=e.getCdataContent(r),c=o?JSON.parse(o):{},s=a?JSON.parse(a):{};return{id:c.id,type:n,data:c,metadata:s}}catch(On){throw new Error("XML 解析错误: ".concat(On.message))}}))}},{key:"parseMixedContent",value:function(t){var e=/<resources\b[^>]*>[\s\S]*?<\/resources>/i.exec(t);if(!e)return{resources:[],remainingText:t,hasResources:!1};var n=a(e,1)[0],i=e.index,r=i+n.length,o=(t.slice(0,i)+t.slice(r)).replace(/\n/g,"");try{return{resources:this.parse(n),remainingText:o,hasResources:!0}}catch(c){return{resources:[],remainingText:o,hasResources:!0,error:"资源解析失败: ".concat(c.message)}}}},{key:"stringify",value:function(t){var e=document.implementation.createDocument(null,null,null),n=e.createElement("resources");n.setAttribute("version","1.0");var i=function(t){return"\n".concat(" ".repeat(t))};return t.forEach((function(t){n.appendChild(e.createTextNode(i(1)));var r=e.createElement("resource");r.setAttribute("type",t.type),r.setAttribute("version","1.0");var o=function(t,n){var r=e.createElement(t);r.appendChild(e.createTextNode(i(2)));var o=e.createCDATASection(JSON.stringify(n));return r.appendChild(o),r.appendChild(e.createTextNode(i(1))),r};r.appendChild(e.createTextNode(i(2))),r.appendChild(o("data",t.data)),r.appendChild(e.createTextNode(i(2))),r.appendChild(o("metadata",t.metadata)),r.appendChild(e.createTextNode(i(1))),n.appendChild(r)})),n.appendChild(e.createTextNode("\n")),e.appendChild(n),(new XMLSerializer).serializeToString(e).replace(/></g,">\n<")}}]),t}(),pt=0,vt=[],_t=[],mt=l.__b,yt=l.__r,gt=l.diffed,bt=l.__c,wt=l.unmount;function xt(t,e){l.__h&&l.__h(lt,t,pt||e),pt=0;var n=lt.__H||(lt.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({__V:_t}),n.__[t]}function kt(t){return pt=1,function(t,e,n){var i=xt(st++,2);if(i.t=t,!i.__c&&(i.__=[n?n(e):Lt(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],n=i.t(e,t);e!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=lt,!lt.u)){var r=function(t,e,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(t){return t.__c}));if(r.every((function(t){return!t.__N})))return!o||o.call(this,t,e,n);var a=!1;return r.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(a=!0)}})),!(!a&&i.__c.props===t)&&(!o||o.call(this,t,e,n))};lt.u=!0;var o=lt.shouldComponentUpdate,a=lt.componentWillUpdate;lt.componentWillUpdate=function(t,e,n){if(this.__e){var i=o;o=void 0,r(t,e,n),o=i}a&&a.call(this,t,e,n)},lt.shouldComponentUpdate=r}return i.__N||i.__}(Lt,t)}function Ct(t,e){var n=xt(st++,3);!l.__s&&It(n.__H,e)&&(n.__=t,n.i=e,lt.__H.__h.push(n))}function Nt(t){return pt=5,Et((function(){return{current:t}}),[])}function Et(t,e){var n=xt(st++,7);return It(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function Tt(t,e){return pt=8,Et((function(){return t}),e)}function St(){for(var t;t=vt.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(zt),t.__H.__h.forEach(Mt),t.__H.__h=[]}catch(In){t.__H.__h=[],l.__e(In,t.__v)}}l.__b=function(t){lt=null,mt&&mt(t)},l.__r=function(t){yt&&yt(t),st=0;var e=(lt=t.__c).__H;e&&(ut===lt?(e.__h=[],lt.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=_t,t.__N=t.i=void 0}))):(e.__h.forEach(zt),e.__h.forEach(Mt),e.__h=[],st=0)),ut=lt},l.diffed=function(t){gt&&gt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==vt.push(e)&&ht===l.requestAnimationFrame||((ht=l.requestAnimationFrame)||Ot)(St)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==_t&&(t.__=t.__V),t.i=void 0,t.__V=_t}))),ut=lt=null},l.__c=function(t,e){e.some((function(t){try{t.__h.forEach(zt),t.__h=t.__h.filter((function(t){return!t.__||Mt(t)}))}catch(Wt){e.some((function(t){t.__h&&(t.__h=[])})),e=[],l.__e(Wt,t.__v)}})),bt&&bt(t,e)},l.unmount=function(t){wt&&wt(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{zt(t)}catch(t){e=t}})),n.__H=void 0,e&&l.__e(e,n.__v))};var At="function"==typeof requestAnimationFrame;function Ot(t){var e,n=function(){clearTimeout(i),At&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);At&&(e=requestAnimationFrame(n))}function zt(t){var e=lt,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),lt=e}function Mt(t){var e=lt;t.__c=t.__(),lt=e}function It(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function Lt(t,e){return"function"==typeof e?e(t):e}function Dt(){throw new Error("Cycle detected")}var Pt=Symbol.for("preact-signals");function Ht(){if(Ut>1)Ut--;else{for(var t,e=!1;void 0!==Ft;){var n=Ft;for(Ft=void 0,Vt++;void 0!==n;){var i=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Xt(n))try{n.c()}catch(n){e||(t=n,e=!0)}n=i}}if(Vt=0,Ut--,e)throw t}}var jt,Bt,Rt=void 0,Ft=void 0,Ut=0,Vt=0,Wt=0;function qt(t){if(void 0!==Rt){var e=t.n;if(void 0===e||e.t!==Rt)return e={i:0,S:t,p:Rt.s,n:void 0,t:Rt,e:void 0,x:void 0,r:e},void 0!==Rt.s&&(Rt.s.n=e),Rt.s=e,t.n=e,32&Rt.f&&t.S(e),e;if(-1===e.i)return e.i=0,void 0!==e.n&&(e.n.p=e.p,void 0!==e.p&&(e.p.n=e.n),e.p=Rt.s,e.n=void 0,Rt.s.n=e,Rt.s=e),e}}function Yt(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}function $t(t){return new Yt(t)}function Xt(t){for(var e=t.s;void 0!==e;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function Gt(t){for(var e=t.s;void 0!==e;e=e.n){var n=e.S.n;if(void 0!==n&&(e.r=n),e.S.n=e,e.i=-1,void 0===e.n){t.s=e;break}}}function Jt(t){for(var e=t.s,n=void 0;void 0!==e;){var i=e.p;-1===e.i?(e.S.U(e),void 0!==i&&(i.n=e.n),void 0!==e.n&&(e.n.p=i)):n=e,e.S.n=e.r,void 0!==e.r&&(e.r=void 0),e=i}t.s=n}function Zt(t){Yt.call(this,void 0),this.x=t,this.s=void 0,this.g=Wt-1,this.f=4}function Kt(t){return new Zt(t)}function Qt(t){var e=t.u;if(t.u=void 0,"function"==typeof e){Ut++;var n=Rt;Rt=void 0;try{e()}catch(e){throw t.f&=-2,t.f|=8,te(t),e}finally{Rt=n,Ht()}}}function te(t){for(var e=t.s;void 0!==e;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,Qt(t)}function ee(t){if(Rt!==this)throw new Error("Out-of-order effect");Jt(this),Rt=t,this.f&=-2,8&this.f&&te(this),Ht()}function ne(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function ie(t){var e=new ne(t);try{e.c()}catch(t){throw e.d(),t}return e.d.bind(e)}function re(t,e){l[t]=e.bind(null,l[t]||function(){})}function oe(t){Bt&&Bt(),Bt=t&&t.S()}function ae(t){var e=this,n=t.data,i=se(n);i.value=n;var r=Et((function(){for(var t=e.__v;t=t.__;)if(t.__c){t.__c.__$f|=4;break}return e.__$u.c=function(){var t;_(r.peek())||3!==(null==(t=e.base)?void 0:t.nodeType)?(e.__$f|=1,e.setState({})):e.base.data=r.peek()},Kt((function(){var t=i.value.value;return 0===t?0:!0===t?"":t||""}))}),[]);return r.value}function ce(t,e,n,i){var r=e in t&&void 0===t.ownerSVGElement,o=$t(n);return{o:function(t,e){o.value=t,i=e},d:ie((function(){var n=o.value.value;i[e]!==n&&(i[e]=n,r?t[e]=n:n?t.setAttribute(e,n):t.removeAttribute(e))}))}}function se(t){return Et((function(){return $t(t)}),[])}function le(t){var e=Nt(t);return e.current=t,jt.__$f|=4,Et((function(){return Kt((function(){return e.current()}))}),[])}Yt.prototype.brand=Pt,Yt.prototype.h=function(){return!0},Yt.prototype.S=function(t){this.t!==t&&void 0===t.e&&(t.x=this.t,void 0!==this.t&&(this.t.e=t),this.t=t)},Yt.prototype.U=function(t){if(void 0!==this.t){var e=t.e,n=t.x;void 0!==e&&(e.x=n,t.e=void 0),void 0!==n&&(n.e=e,t.x=void 0),t===this.t&&(this.t=n)}},Yt.prototype.subscribe=function(t){var e=this;return ie((function(){var n=e.value,i=32&this.f;this.f&=-33;try{t(n)}finally{this.f|=i}}))},Yt.prototype.valueOf=function(){return this.value},Yt.prototype.toString=function(){return this.value+""},Yt.prototype.toJSON=function(){return this.value},Yt.prototype.peek=function(){return this.v},Object.defineProperty(Yt.prototype,"value",{get:function(){var t=qt(this);return void 0!==t&&(t.i=this.i),this.v},set:function(t){if(Rt instanceof Zt&&function(){throw new Error("Computed cannot have side-effects")}(),t!==this.v){Vt>100&&Dt(),this.v=t,this.i++,Wt++,Ut++;try{for(var e=this.t;void 0!==e;e=e.x)e.t.N()}finally{Ht()}}}}),(Zt.prototype=new Yt).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===Wt)return!0;if(this.g=Wt,this.f|=1,this.i>0&&!Xt(this))return this.f&=-2,!0;var t=Rt;try{Gt(this),Rt=this;var e=this.x();(16&this.f||this.v!==e||0===this.i)&&(this.v=e,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return Rt=t,Jt(this),this.f&=-2,!0},Zt.prototype.S=function(t){if(void 0===this.t){this.f|=36;for(var e=this.s;void 0!==e;e=e.n)e.S.S(e)}Yt.prototype.S.call(this,t)},Zt.prototype.U=function(t){if(void 0!==this.t&&(Yt.prototype.U.call(this,t),void 0===this.t)){this.f&=-33;for(var e=this.s;void 0!==e;e=e.n)e.S.U(e)}},Zt.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;void 0!==t;t=t.x)t.t.N()}},Zt.prototype.peek=function(){if(this.h()||Dt(),16&this.f)throw this.v;return this.v},Object.defineProperty(Zt.prototype,"value",{get:function(){1&this.f&&Dt();var t=qt(this);if(this.h(),void 0!==t&&(t.i=this.i),16&this.f)throw this.v;return this.v}}),ne.prototype.c=function(){var t=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var e=this.x();"function"==typeof e&&(this.u=e)}finally{t()}},ne.prototype.S=function(){1&this.f&&Dt(),this.f|=1,this.f&=-9,Qt(this),Gt(this),Ut++;var t=Rt;return Rt=this,ee.bind(this,t)},ne.prototype.N=function(){2&this.f||(this.f|=2,this.o=Ft,Ft=this)},ne.prototype.d=function(){this.f|=8,1&this.f||te(this)},ae.displayName="_st",Object.defineProperties(Yt.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:ae},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),re("__b",(function(t,e){if("string"==typeof e.type){var n,i=e.props;for(var r in i)if("children"!==r){var o=i[r];o instanceof Yt&&(n||(e.__np=n={}),n[r]=o,i[r]=o.peek())}}t(e)})),re("__r",(function(t,e){oe();var n,i=e.__c;i&&(i.__$f&=-2,void 0===(n=i.__$u)&&(i.__$u=n=function(t){var e;return ie((function(){e=this})),e.c=function(){i.__$f|=1,i.setState({})},e}())),jt=i,oe(n),t(e)})),re("__e",(function(t,e,n,i){oe(),jt=void 0,t(e,n,i)})),re("diffed",(function(t,e){var n;if(oe(),jt=void 0,"string"==typeof e.type&&(n=e.__e)){var i=e.__np,r=e.props;if(i){var o=n.U;if(o)for(var a in o){var c=o[a];void 0===c||a in i||(c.d(),o[a]=void 0)}else n.U=o={};for(var s in i){var l=o[s],u=i[s];void 0===l?(l=ce(n,s,u,r),o[s]=l):l.o(u,r)}}}t(e)})),re("unmount",(function(t,e){if("string"==typeof e.type){var n=e.__e;if(n){var i=n.U;if(i)for(var r in n.U=void 0,i){var o=i[r];o&&o.d()}}}else{var a=e.__c;if(a){var c=a.__$u;c&&(a.__$u=void 0,c.d())}}t(e)})),re("__h",(function(t,e,n,i){(i<3||9===i)&&(e.__$f|=2),t(e,n,i)})),I.prototype.shouldComponentUpdate=function(t,e){var n=this.__$u;if(!(n&&void 0!==n.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var i in e)return!0;for(var r in t)if("__source"!==r&&t[r]!==this.props[r])return!0;for(var o in this.props)if(!(o in t))return!0;return!1};var ue=0;function he(t,e,n,i,r,o){var a,c,s={};for(c in e)"ref"==c?a=e[c]:s[c]=e[c];var u={type:t,props:s,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--ue,__source:r,__self:o};if("function"==typeof t&&(a=t.defaultProps))for(c in a)void 0===s[c]&&(s[c]=a[c]);return l.vnode&&l.vnode(u),u}var fe=function(){return he("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:he("path",{d:"M843.904 783.573333 783.573333 843.904 512.042667 572.373333 240.512 843.904 180.181333 783.573333 451.712 512.042667 180.181333 240.512 240.512 180.181333 512.042667 451.712 783.573333 180.181333 843.904 240.512 572.373333 512.042667 843.904 783.573333Z"})})},de=function(){return he("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:he("path",{d:"M900.64 379.808l-263.072-256.032c-36.448-35.328-105.76-35.392-142.304 0.096l-327.04 319.904c-56.416 54.72-70.72 76.704-70.72 150.976l0 143.936c0 132.768 26.976 192 186.912 192l131.872 0c81.12 0 128.448-46.656 193.952-111.264l290.016-297.696c18.592-17.984 29.248-43.968 29.248-71.264C929.504 423.36 918.976 397.6 900.64 379.808zM323.008 786.752c-52.928 0-96-43.072-96-96s43.072-96 96-96 96 43.072 96 96S375.936 786.752 323.008 786.752z"})})},pe=function(){return he("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:he("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-0.9 3.7-0.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 0.7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-0.8 4.2-2.6 5-5 1.4-4.2-0.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})})},ve=function(){return he("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:he("path",{d:"M962 197.61H747v-60c0-55.14-44.86-100-100-100H377c-55.14 0-100 44.86-100 100v60H62c-11.05 0-20 8.95-20 20s8.95 20 20 20h60v630.57c0 66.17 53.83 120 120 120h540c66.17 0 120-53.83 120-120V237.61h60c11.05 0 20-8.95 20-20s-8.95-20-20-20zM637.34 457.66v260c0 12.01-10.72 21.63-23.06 19.77-9.84-1.48-16.94-10.25-16.94-20.2V458.09c0-9.95 7.1-18.72 16.94-20.2 12.34-1.86 23.06 7.76 23.06 19.77z m-210.68 0v260c0 11-9 20-20 20s-20-9-20-20v-260c0-11 9-20 20-20s20 9 20 20zM317 137.61c0-33.08 26.92-60 60-60h270c33.08 0 60 26.92 60 60v60H317v-60z"})})},_e=function(){return he("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:he("path",{d:"M511.582491 63.413262C265.134543 63.413262 64.62588 263.921925 64.62588 510.369873s200.508663 446.957635 446.957635 446.957635 446.957635-200.508663 446.957635-446.957635S758.031463 63.413262 511.582491 63.413262zM509.001713 751.859903c-98.517781 0-182.467775-62.623269-214.771505-150.056598l0.327458-0.134053c-2.007727-4.036943-3.38305-8.422833-3.38305-13.237489 0-16.647145 13.494339-30.142507 30.142507-30.142507 13.389962 0 24.358781 8.877181 28.2893 20.955264l0.422625-0.172939c23.269983 65.442478 85.645612 112.503307 158.972665 112.503307 93.106538 0 168.845523-75.738985 168.845523-168.845523s-75.738985-168.845523-168.845523-168.845523c-20.432355 0-39.874149 3.980661-58.013275 10.66899l21.248953 40.742936c2.486634 2.677992 4.0175 6.2831 4.0175 10.243295 0 8.417717-8.404414 14.921851-15.365966 15.07023-0.102331 0-0.206708 0-0.309038 0-0.220011 0-0.427742 0-0.647753-0.013303l-150.579507-6.463202c-5.372358-0.234337-10.229992-3.310396-12.716626-8.093329-2.486634-4.76963-2.236947-10.509355 0.647753-15.055904l80.890308-127.179564c2.8847-4.533246 8.006348-7.151887 13.365402-6.960529 5.372358 0.234337 10.227945 3.312442 12.71458 8.095375l18.580171 35.625382c26.629497-10.855232 55.683207-16.963347 86.168522-16.963347 126.338407 0 229.130537 102.791108 229.130537 229.130537S635.340119 751.859903 509.001713 751.859903z"})})},me=function(){return he("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:he("path",{d:"M891.072 822.144V167.36a34.432 34.432 0 0 0-34.432-34.432H201.856C201.856 94.848 232.704 64 270.784 64h620.288C929.152 64 960 94.848 960 132.928v620.288c0 38.08-30.848 68.928-68.928 68.928z m-68.928-551.36v620.288c0 38.08-30.848 68.928-68.928 68.928H132.928A68.928 68.928 0 0 1 64 891.072V270.784c0-38.08 30.848-68.928 68.928-68.928h620.288c38.08 0 68.928 30.848 68.928 68.928z m-137.856 137.856H201.856a34.432 34.432 0 0 0 0 68.864h482.432a34.432 34.432 0 0 0 0-68.864z m0 206.72H201.856a34.432 34.432 0 0 0 0 68.864h482.432a34.432 34.432 0 0 0 0-68.864z"})})},ye=function(){return he("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:he("path",{d:"M547.4 197.4v46l200.3 0.1L546.1 444l32.4 32.6 201.9-200.7v200.9h46V197.5zM471.4 584.4l-32.6-32.6L243.6 747V547.9h-46v278.7h279v-46H275z"})})},ge=function(){return he("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:he("path",{d:"M544 480V282.944h52.224l0.064 107.968L763.072 224l36.928 36.928-166.976 166.976 108.032-0.128V480H544zM260.928 800l-36.928-36.928 166.912-166.784-107.968-0.064V544H480v197.056h-52.224l0.064-107.968L260.928 800z"})})},be=function(){return he("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:he("path",{d:"M960 544H64a32 32 0 1 1 0-64h896a32 32 0 1 1 0 64"})})},we=function(){return he("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[he("path",{d:"M481.0752 263.3728l50.9952 1.024 1.8432-105.8816-50.9952-0.8192z"}),he("path",{d:"M486.441426 180.895362a66.56 66.56 0 1 0 42.091944-126.290153 66.56 66.56 0 1 0-42.091944 126.290153Z"}),he("path",{d:"M138.8544 664.3712c-52.8384 0-95.8464-43.008-95.8464-95.8464s43.008-95.8464 95.8464-95.8464M880.0256 472.6784c52.8384 0 95.8464 43.008 95.8464 95.8464s-43.008 95.8464-95.8464 95.8464"}),he("path",{d:"M507.4944 220.5696c-220.16 0-398.7456 162.816-398.7456 363.7248s178.5856 363.7248 398.7456 363.7248 398.7456-162.816 398.7456-363.7248-178.5856-363.7248-398.7456-363.7248z m0 559.9232c-166.2976 0-301.2608-100.5568-301.2608-224.4608s134.9632-224.4608 301.2608-224.4608S808.7552 432.128 808.7552 556.032 673.792 780.4928 507.4944 780.4928z"}),he("path",{d:"M319.6928 556.032a47.9232 38.912 90 1 0 77.824 0 47.9232 38.912 90 1 0-77.824 0Z"}),he("path",{d:"M617.472 556.032a47.9232 38.912 90 1 0 77.824 0 47.9232 38.912 90 1 0-77.824 0Z"})]})},xe=function(){return he("svg",{viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[he("path",{d:"M5.856 17.121a.979.979 0 0 1-.327-.06.839.839 0 0 1-.283-.177.739.739 0 0 1-.187-.255.724.724 0 0 1-.07-.303l-.02-1.609a4.663 4.663 0 0 1-1.446-.455 4.252 4.252 0 0 1-.637-.401c-.199-.146-.385-.31-.553-.492a4.442 4.442 0 0 1-.45-.577 4.303 4.303 0 0 1-.327-.637 3.823 3.823 0 0 1-.206-.686 3.729 3.729 0 0 1-.064-.704V6.478c0-.261.025-.516.077-.771a4.43 4.43 0 0 1 .244-.747 4.062 4.062 0 0 1 .932-1.28c.2-.183.418-.347.65-.493.23-.145.482-.267.739-.364a4.21 4.21 0 0 1 .81-.225c.27-.054.553-.078.835-.078H8.55c.103 0 .2.018.29.054a.7.7 0 0 1 .411.376.667.667 0 0 1-.161.766.736.736 0 0 1-.25.151.764.764 0 0 1-.29.055H5.573c-.186 0-.366.012-.54.049-.18.03-.353.079-.52.145-.167.061-.328.14-.482.237-.148.091-.29.2-.418.316a2.897 2.897 0 0 0-.347.388c-.097.14-.187.286-.257.444a2.473 2.473 0 0 0-.206.977v4.287c0 .17.013.333.051.503a2.549 2.549 0 0 0 .772 1.33 2.721 2.721 0 0 0 .913.559c.167.066.347.115.527.152.18.03.36.048.546.048a.904.904 0 0 1 .61.23.848.848 0 0 1 .194.262.84.84 0 0 1 .07.303l.007.99 1.915-1.293a2.877 2.877 0 0 1 1.64-.492h2.372c.186 0 .366-.018.54-.048.18-.03.353-.08.52-.146.168-.067.329-.146.483-.237.148-.091.29-.2.418-.316.128-.121.244-.249.347-.388a2.8 2.8 0 0 0 .257-.444 2.47 2.47 0 0 0 .206-.977V8.585a.646.646 0 0 1 .225-.492.679.679 0 0 1 .244-.152.814.814 0 0 1 .585 0c.09.03.174.085.244.152a.657.657 0 0 1 .225.492V10.8c0 .261-.032.516-.083.771a4.192 4.192 0 0 1-.245.74c-.109.244-.244.468-.398.687a3.735 3.735 0 0 1-.534.6c-.2.183-.418.347-.65.493a4.134 4.134 0 0 1-.738.364 4.7 4.7 0 0 1-.81.225c-.27.054-.553.079-.836.079h-1.877c-.604 0-1.144.164-1.633.491l-2.54 1.713a.913.913 0 0 1-.514.157z",fill:"currentColor"}),he("path",{d:"M15.866 4.125h-4.174c-.41 0-.741.313-.741.7 0 .387.332.7.741.7h4.174c.41 0 .742-.313.742-.7 0-.387-.332-.7-.742-.7z",fill:"currentColor"}),he("path",{d:"M14.537 2.932c0-.396-.34-.717-.759-.717s-.758.32-.758.717v3.786c0 .396.34.717.758.717.42 0 .76-.321.76-.717V2.932z",fill:"currentColor"})]})},ke=function(){return he("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:he("path",{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"})})},Ce=function(){var t=1e3,e=140,n=250,i=.8;return he("svg",{fill:"currentColor",viewBox:"0 0 ".concat(t," ").concat(t),xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:Array.from({length:4}).map((function(t,r){return he("rect",{fill:"currentColor",rx:70,ry:70,height:n,width:e,x:286.66666666666663*r,y:375,children:[he("animate",{attributeName:"height",values:"".concat(n,"; ").concat(500,"; ").concat(n),keyTimes:"0; 0.5; 1",dur:"".concat(i,"s"),begin:"".concat(.2*r,"s"),repeatCount:"indefinite"}),he("animate",{attributeName:"y",values:"".concat(375,"; ").concat(250,"; ").concat(375),keyTimes:"0; 0.5; 1",dur:"".concat(i,"s"),begin:"".concat(.2*r,"s"),repeatCount:"indefinite"})]},r)}))})},Ne=function(t){return he("svg",{className:t.className,onClick:t.onClick,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:he("path",{d:"M128 384a128 128 0 1 1 0 256 128 128 0 0 1 0-256z m768 0a128 128 0 1 1 0 256 128 128 0 0 1 0-256z m-372.4288 0a128 128 0 1 1 0 256 128 128 0 0 1 0-256z"})})},Ee=function(t){return he("svg",{className:t.className,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:he("path",{d:"M498.33984 607.8464c-10.99776-32.9728-50.09408-73.5232-82.6368-85.74976L150.9376 422.8096c-38.54336-14.4384-36.98688-69.46816 2.27328-81.73568L844.92288 124.90752c33.30048-10.40384 64.57344 20.8896 54.1696 54.1696L682.92608 870.78912a43.2128 43.2128 0 0 1-81.36704 3.25632 121682.5344 121682.5344 0 0 1-103.2192-266.19904z"})})},Te=function(t){return he("svg",{xmlns:"http://www.w3.org/2000/svg",className:t.className,viewBox:"0 0 512 512",children:he("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 184l144 144 144-144"})})},Se=function(t){return he("svg",{xmlns:"http://www.w3.org/2000/svg",className:"".concat(t.className," icon"),viewBox:"0 0 512 512",children:he("path",{d:"M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm108.25 138.29l-134.4 160a16 16 0 01-12 5.71h-.27a16 16 0 01-11.89-5.3l-57.6-64a16 16 0 1123.78-21.4l45.29 50.32 122.59-145.91a16 16 0 0124.5 20.58z"})})},Ae=function(t){return he("svg",{className:t.className,width:"16",height:"16",viewBox:"0 0 50 50",xmlns:"http://www.w3.org/2000/svg",children:he("circle",{cx:"25",cy:"25",r:"20",stroke:"currentColor",strokeWidth:"5",fill:"none",strokeDasharray:"31.415, 31.415",strokeLinecap:"round",children:he("animateTransform",{attributeName:"transform",type:"rotate",from:"0 25 25",to:"360 25 25",dur:"1s",repeatCount:"indefinite"})})})},Oe=function(){return he("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:he("path",{d:"M704 256v490.666667a170.666667 170.666667 0 0 1-170.666667 170.666666 170.666667 170.666667 0 0 1-170.666666-170.666666V213.333333A106.666667 106.666667 0 0 1 469.333333 106.666667 106.666667 106.666667 0 0 1 576 213.333333v448a42.666667 42.666667 0 0 1-42.666667 42.666667 42.666667 42.666667 0 0 1-42.666666-42.666667V256H426.666667v405.333333a106.666667 106.666667 0 0 0 106.666666 106.666667 106.666667 106.666667 0 0 0 106.666667-106.666667V213.333333a170.666667 170.666667 0 0 0-170.666667-170.666666 170.666667 170.666667 0 0 0-170.666666 170.666666v533.333334a234.666667 234.666667 0 0 0 234.666666 234.666666 234.666667 234.666667 0 0 0 234.666667-234.666666V256h-64z"})})},ze=function(){return he("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:[he("path",{d:"M842.666667 285.866667l-187.733334-187.733334c-14.933333-14.933333-32-21.333333-53.333333-21.333333H234.666667C194.133333 74.666667 160 108.8 160 149.333333v725.333334c0 40.533333 34.133333 74.666667 74.666667 74.666666h554.666666c40.533333 0 74.666667-34.133333 74.666667-74.666666V337.066667c0-19.2-8.533333-38.4-21.333333-51.2z m-44.8 44.8c-2.133333 2.133333-4.266667 0-8.533334 0h-170.666666c-6.4 0-10.666667-4.266667-10.666667-10.666667V149.333333c0-2.133333 0-6.4-2.133333-8.533333 0 0 2.133333 0 2.133333 2.133333l189.866667 187.733334z m-8.533334 554.666666H234.666667c-6.4 0-10.666667-4.266667-10.666667-10.666666V149.333333c0-6.4 4.266667-10.666667 10.666667-10.666666h311.466666c-2.133333 4.266667-2.133333 6.4-2.133333 10.666666v170.666667c0 40.533333 34.133333 74.666667 74.666667 74.666667h170.666666c4.266667 0 6.4 0 10.666667-2.133334V874.666667c0 6.4-4.266667 10.666667-10.666667 10.666666z",fill:"currentColor"}),he("path",{d:"M640 693.333333H341.333333c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h298.666667c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM640 522.666667H341.333333c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h298.666667c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM341.333333 416h85.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32h-85.333334c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32z",fill:"currentColor"})]})},Me=function(){return he("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:he("path",{d:"M557.248 511.68l135.776-135.744-45.248-45.28L512 466.432l-135.776-135.776-45.248 45.28 135.776 135.744-135.776 135.776 45.248 45.248L512 556.928l135.776 135.776 45.248-45.248-135.776-135.776zM512 64c247.136 0 448 200.864 448 448s-200.864 448-448 448S64 759.136 64 512 264.864 64 512 64z",fill:"currentColor"})})},Ie=function(){return he("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:he("path",{d:"M512.43945313 904.51953125c-6.06445313 0-12.12890625-1.58203125-17.57812501-4.74609375L136.70703125 689.71484375c-10.63476563-6.24023438-17.13867188-17.66601563-17.13867188-29.97070313s6.50390625-23.73046875 17.13867188-29.97070312l76.37695313-44.91210938L136.97070312 540.125c-10.63476563-6.24023438-17.13867188-17.66601563-17.13867187-29.97070313s6.50390625-23.73046875 17.13867188-29.97070312l73.38867187-43.15429688-73.125-42.890625C126.51171875 387.81054687 120.0078125 376.38476562 120.0078125 364.08007812c0-12.3046875 6.50390625-23.73046875 17.13867188-29.97070312L495.828125 122.99609375c10.8984375-6.41601563 24.34570313-6.41601563 35.24414063 0l358.15429687 210.05859375c10.63476563 6.24023438 17.13867188 17.66601563 17.13867188 29.97070313s-6.50390625 23.73046875-17.13867188 29.97070312l-73.38867188 43.15429688 73.12500001 42.890625c10.63476563 6.24023438 17.13867188 17.66601563 17.13867187 29.97070312s-6.50390625 23.73046875-17.13867187 29.97070313L812.5859375 583.89453125l76.11328125 44.6484375c10.63476563 6.24023438 17.13867188 17.66601563 17.13867188 29.97070313s-6.50390625 23.73046875-17.13867188 29.97070312l-358.59375 211.2890625c-5.44921875 3.1640625-11.6015625 4.74609375-17.66601563 4.74609375zM223.015625 659.65625l289.42382813 169.8046875 290.12695312-170.77148438-58.44726563-34.27734374L530.28125 750.18359375a34.67285156 34.67285156 0 0 1-35.24414063 0L281.7265625 625.02734375 223.015625 659.65625z m76.90429688-104.58984375l212.69531249 124.8046875 290.12695313-170.77148438-55.546875-32.60742187-216.65039063 127.6171875a34.67285156 34.67285156 0 0 1-35.24414062 0L279.00195312 477.28320312l-55.81054687 32.78320313 75.49804688 44.296875c0.43945313 0.26367188 0.79101563 0.52734375 1.23046874 0.703125z m-2.81250001-147.83203125l215.68359376 126.5625 216.12304687-127.17773438c0.3515625-0.26367188 0.703125-0.43945313 1.0546875-0.61523437l72.86132813-42.890625-289.33593751-169.8046875-290.12695312 170.68359375 72.59765625 42.62695313c0.43945313 0.17578125 0.79101563 0.43945313 1.14257813 0.61523437z"})})},Le=function(t){var e=t.items,n=se([]),i=new tt("chat-thought-chain"),r=se([]);Ct((function(){r.value=e.filter((function(t){return t.description})),r.value.length>0&&r.value.forEach((function(t,e){t.done&&(n.value=[].concat(o(n.value),[e]))}))}),[e]);return 0===r.value.length?null:he("div",{className:"".concat(i.b()," ").concat(i.is("single",1===r.value.length)),children:r.value.map((function(t,e){if(t.description){var r=n.value.includes(e);return he("div",{className:"".concat(i.e("item")," ").concat(i.is("collapsed",r)),children:[he("div",{className:i.e("item-icon"),children:t.icon||he("span",{children:e})}),he("div",{className:i.e("item-content"),children:[he("div",{className:i.e("item-title"),onClick:function(){return function(t){n.value.includes(t)?n.value=n.value.filter((function(e){return e!==t})):n.value=[].concat(o(n.value),[t])}(e)},children:[t.title,he(Te,{className:i.e("icon")})]}),he("div",{className:i.e("item-description"),children:t.description})]})]},e)}}))})},De=new tt("markdown-message"),Pe=function(t){var e=t.message,n=t.size,i=se(ot()),r=se(null),o=Et((function(){return 20===e.state&&!0!==e.completed}),[e.state,e.completed]),a=Et((function(){return 20===e.state&&!0===e.completed}),[e.state,e.completed]),c=se({title:"思考过程",description:"",icon:he(Ae,{})}),l=function(t){var e=t.indexOf("<think>"),n=t.indexOf("</think>"),i="",r="",o=!1;return-1===n?(o=!1,i=t.slice(e+7),r=""):(o=!0,i=t.slice(e+7,n),r=t.slice(n+8)),{isThoughtCompleted:o,thoughtContent:i,answerContent:r}};return Ct((function(){if(n>=0&&r.value)if(-1!==e.content.indexOf("<think>")){var t=l(e.content),i=t.isThoughtCompleted,o=t.thoughtContent,a=t.answerContent;i&&(c.value.icon=he(i?Se:Ae,{})),o&&(c.value.description=o),a&&r.value.setMarkdown(a)}else r.value.setMarkdown(e.content)}),[e,n]),Ct((function(){var t="";if(-1!==e.content.indexOf("<think>")){var n=l(e.content),o=n.isThoughtCompleted,a=n.thoughtContent,u=n.answerContent;c.value={title:"思考过程",description:a||"",icon:he(o?Se:Ae,{})},u&&(t=u)}else t=e.content;r.value=new s({id:i,value:t||"",editor:{defaultModel:"previewOnly"}})}),[]),he("div",{className:"".concat(De.b()," ").concat(De.is("loading",o)),children:[he("div",{className:De.b("header"),children:[he("div",{className:De.be("header","caption"),children:"AI "}),t.children,a?he("div",{className:De.be("header","timeout"),children:"请求超时"}):null]}),he("div",{className:"".concat(De.b("content")," pre-wrap-container"),children:[he(Le,{items:[c.value]}),he("div",{id:i})]}),he("div",{className:De.b("footer")})]})},He=new tt("ossfile-material"),je=function(t){var e=le((function(){return t.material.data.name})),n=le((function(){return t.material.metadata.size})),i=le((function(){var e=t.material.metadata.state;return"successed"===e?"上传成功":"uploading"===e?"上传中":"failed"===e?"上传失败":"未知状态"})),r=le((function(){switch(t.material.metadata.state){case"successed":return"#1890ff";case"uploading":return"#52c41a";default:return"#ff4d4f"}}));return he("div",{className:He.b(),children:[he("div",{className:He.b("left"),children:he(ze,{})}),he("div",{className:He.b("right"),children:[he("div",{className:He.e("name"),title:e,children:e}),he("div",{className:He.e("metadata"),children:[he("div",{children:[n,"B"]}),he("div",{style:{color:r.value},children:i})]})]})]})},Be=new tt("common-material"),Re=function(t){var e,n=null===(e=t.controller.opts.questionToolbarItems)||void 0===e?void 0:e.find((function(e){return e.id===t.material.metadata.actionId})),i=le((function(){return t.material.metadata.name}));return he("div",{className:Be.b(),children:[he("div",{className:Be.b("left"),children:n&&n.icon?"function"==typeof n.icon?n.icon(O):n.icon:he(Ie,{})}),he("div",{className:Be.b("right"),children:[he("div",{className:Be.e("name"),title:i,children:i}),he("div",{className:Be.e("metadata"),children:he("div",{children:(null==n?void 0:n.label)||"素材资源"})})]})]})},Fe=new tt("chat-input-material-item"),Ue=function(t){var e=t.material,n=null;if("ossfile"===e.type)n=je;else n=Re;return he("div",{className:"".concat(Fe.b()," ").concat(Fe.is("disabled",t.disabled)),children:[he("div",{className:Fe.e("icon"),onClick:function(){t.controller.deleteMaterial(e)},children:he(Me,{})}),O(n,{material:e,controller:t.controller})]})},Ve=new tt("user-message-question"),We=function(t){var e=le((function(){return t.message.content})),n=le((function(){return dt.parseMixedContent(e.value)}));return he("div",{className:Ve.b(),children:[he("div",{className:Ve.e("user-header"),children:[t.children,he("div",{className:Ve.e("user"),children:"我"})]}),he("div",{className:Ve.e("content"),children:he("div",{dir:"auto",className:Ve.em("content","body"),children:[he("p",{dir:"auto",className:Ve.em("content","material"),children:n.value.hasResources&&n.value.resources.map((function(e){return he(Ue,{material:e,disabled:!0,controller:t.controller},e.id)}))}),he("p",{dir:"auto",className:"pre-wrap-container",children:n.value.remainingText})]})})]})},qe=new tt("error-message"),Ye=function(t){var e=le((function(){return t.message.content}));return he("div",{className:qe.b(),children:[he("div",{className:qe.b("header"),children:[he("div",{className:qe.be("header","caption"),children:"AI "}),t.children]}),he("div",{className:"".concat(qe.e("content")," pre-wrap-container"),children:he("span",{children:e})})]})},$e=new tt("unknown-message"),Xe=function(t){return he("div",{className:$e.b(),children:he("span",{className:"".concat($e.e("content")," pre-wrap-container"),children:["暂未支持的消息类型: ",t.message.type]})})},Ge=new tt("chat-message-item"),Je=function(t){var e=t.message,n=t.size,i=null;switch(e.type){case"DEFAULT":i="ASSISTANT"===e.role?Pe:We;break;case"ERROR":i=Ye;break;default:i=Xe}return he("div",{className:Ge.b(),children:O(i,{size:n,message:e,controller:t.controller,children:t.children})})},Ze=new tt("chat-toolbar"),Ke=function(t){var e=t.controller,n=t.items,i=void 0===n?[]:n,r=t.data,a=t.type,c=t.className,s=[],l="default",u=[{label:"新建对话",title:"新建对话",icon:he(xe,{}),onClick:function(){e.newDialogue()}}],h=[{label:"回填",title:"回填",icon:he(de,{}),onClick:function(){e.backfill(r)}},{label:"刷新",title:"刷新",icon:he(_e,{}),onClick:function(){e.refreshMessage(r)}},{label:"删除",title:"删除",icon:he(ve,{}),onClick:function(){e.deleteMessage(r)}},{label:"复制",title:"复制",icon:he(me,{}),onClick:function(){e.copyMessage(r)}}],f=[{label:"刷新",title:"刷新",icon:he(_e,{}),onClick:function(){e.refreshMessage(r,!0)}}];if("content"===a)switch(l="circle",r.type){case"DEFAULT":s="ASSISTANT"===r.role?[].concat(h,o(i)):[].concat(f);break;case"ERROR":s=[].concat(h,o(i))}else s=[].concat(u,o(i));var d=function(t){return"function"==typeof t.disabled?t.disabled(r):!0===t.disabled},p=Et((function(){return"content"===a&&20===(null==r?void 0:r.state)&&!0!==(null==r?void 0:r.completed)}),[null==r?void 0:r.state,null==r?void 0:r.completed]);return he("div",{className:"".concat(Ze.b()," ").concat(Ze.e(l)," ").concat(c||""),children:s.map((function(t,n){if(!function(t){return"function"==typeof t.hidden?t.hidden(r):!0===t.hidden}(t))return he("div",{className:"".concat(Ze.e("item")," ").concat(Ze.is("disabled",d(t)||p)," ").concat(c||""),title:t.title,onClick:function(n){return function(t,n){var i;d(n)||null===(i=n.onClick)||void 0===i||i.call(n,t,e.context,e.params,r)}(n,t)},children:[he("div",{className:"".concat(Ze.em("item","icon")),children:"function"==typeof t.icon?t.icon(O):t.icon}),he("div",{className:"".concat(Ze.em("item","label")),children:"function"==typeof t.label?t.label(O):t.label})]},n)}))})},Qe=new tt("chat-messages"),tn=function(t){var e=Nt(null),n=t.controller.messages;return function(t){var e=Nt(t);e.current=t,Ct((function(){return ie((function(){return e.current()}))}),[])}((function(){e.current&&n.value.length>0&&(e.current.scrollTop=e.current.scrollHeight)})),he("div",{ref:e,className:Qe.b(),children:n.value.map((function(e){var n,i=(null===(n=e.content)||void 0===n?void 0:n.length)||0;return he(Je,{size:i,message:e,controller:t.controller,children:he(Ke,{data:e,type:"content",items:t.toolbarItems,controller:t.controller})},e.messageid)}))})};function en(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var i in e)if("__source"!==i&&t[i]!==e[i])return!0;return!1}function nn(t){this.props=t}(nn.prototype=new I).isPureReactComponent=!0,nn.prototype.shouldComponentUpdate=function(t,e){return en(this.props,t)||en(this.state,e)};var rn=l.__b;l.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),rn&&rn(t)};var on=l.__e;l.__e=function(t,e,n,i){if(t.then)for(var r,o=e;o=o.__;)if((r=o.__c)&&r.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),r.__c(t,e);on(t,e,n,i)};var an=l.unmount;function cn(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),t.__c.__H=null),null!=(t=function(t,e){for(var n in e)t[n]=e[n];return t}({},t)).__c&&(t.__c.__P===n&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return cn(t,e,n)}))),t}function sn(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return sn(t,e,n)})),t.__c&&t.__c.__P===e&&(t.__e&&n.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=n)),t}function ln(){this.__u=0,this.t=null,this.__b=null}function un(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function hn(){this.u=null,this.o=null}l.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&!0===t.__h&&(t.type=null),an&&an(t)},(ln.prototype=new I).__c=function(t,e){var n=e.__c,i=this;null==i.t&&(i.t=[]),i.t.push(n);var r=un(i.__v),o=!1,a=function(){o||(o=!0,n.__R=null,r?r(c):c())};n.__R=a;var c=function(){if(! --i.__u){if(i.state.__a){var t=i.state.__a;i.__v.__k[0]=sn(t,t.__c.__P,t.__c.__O)}var e;for(i.setState({__a:i.__b=null});e=i.t.pop();)e.forceUpdate()}},s=!0===e.__h;i.__u++||s||i.setState({__a:i.__b=i.__v.__k[0]}),t.then(a,a)},ln.prototype.componentWillUnmount=function(){this.t=[]},ln.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=cn(this.__b,n,i.__O=i.__P)}this.__b=null}var r=e.__a&&O(M,null,t.fallback);return r&&(r.__h=null),[O(M,null,e.__a?null:t.children),r]};var fn=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};function dn(t){return this.getChildContext=function(){return t.context},t.children}function pn(t){var e=this,n=t.i;e.componentWillUnmount=function(){K(null,e.l),e.l=null,e.i=null},e.i&&e.i!==n&&e.componentWillUnmount(),e.l||(e.i=n,e.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(t){this.childNodes.push(t),e.i.appendChild(t)},insertBefore:function(t,n){this.childNodes.push(t),e.i.appendChild(t)},removeChild:function(t){this.childNodes.splice(this.childNodes.indexOf(t)>>>1,1),e.i.removeChild(t)}}),K(O(dn,{context:e.context},t.__v),e.l)}function vn(t,e){var n=O(pn,{__v:t,i:e});return n.containerInfo=e,n}(hn.prototype=new I).__a=function(t){var e=this,n=un(e.__v),i=e.o.get(t);return i[0]++,function(r){var o=function(){e.props.revealOrder?(i.push(r),fn(e,t,i)):r()};n?n(o):o()}},hn.prototype.render=function(t){this.u=null,this.o=new Map;var e=R(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},hn.prototype.componentDidUpdate=hn.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){fn(t,n,e)}))};var _n="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,mn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,yn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,gn=/[A-Z0-9]/g,bn="undefined"!=typeof document,wn=function(t){return("undefined"!=typeof Symbol&&"symbol"==p(Symbol())?/fil|che|rad/:/fil|che|ra/).test(t)};I.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(I.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var xn=l.event;function kn(){}function Cn(){return this.cancelBubble}function Nn(){return this.defaultPrevented}l.event=function(t){return xn&&(t=xn(t)),t.persist=kn,t.isPropagationStopped=Cn,t.isDefaultPrevented=Nn,t.nativeEvent=t};var En={enumerable:!1,configurable:!0,get:function(){return this.class}},Tn=l.vnode;l.vnode=function(t){"string"==typeof t.type&&function(t){var e=t.props,n=t.type,i={};for(var r in e){var o=e[r];if(!("value"===r&&"defaultValue"in e&&null==o||bn&&"children"===r&&"noscript"===n||"class"===r||"className"===r)){var a=r.toLowerCase();"defaultValue"===r&&"value"in e&&null==e.value?r="value":"download"===r&&!0===o?o="":"ondoubleclick"===a?r="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||wn(e.type)?"onfocus"===a?r="onfocusin":"onblur"===a?r="onfocusout":yn.test(r)?r=a:-1===n.indexOf("-")&&mn.test(r)?r=r.replace(gn,"-$&").toLowerCase():null===o&&(o=void 0):a=r="oninput","oninput"===a&&i[r=a]&&(r="oninputCapture"),i[r]=o}}"select"==n&&i.multiple&&Array.isArray(i.value)&&(i.value=R(e.children).forEach((function(t){t.props.selected=-1!=i.value.indexOf(t.props.value)}))),"select"==n&&null!=i.defaultValue&&(i.value=R(e.children).forEach((function(t){t.props.selected=i.multiple?-1!=i.defaultValue.indexOf(t.props.value):i.defaultValue==t.props.value}))),e.class&&!e.className?(i.class=e.class,Object.defineProperty(i,"className",En)):(e.className&&!e.class||e.class&&e.className)&&(i.class=i.className=e.className),t.props=i}(t),t.$$typeof=_n,Tn&&Tn(t)};var Sn=l.__r;l.__r=function(t){Sn&&Sn(t),t.__c};var An=l.diffed;l.diffed=function(t){An&&An(t);var e=t.props,n=t.__e;null!=n&&"textarea"===t.type&&"value"in e&&e.value!==n.value&&(n.value=null==e.value?"":e.value)};var On=new Map;function zn(t){var e=On.get(t);e&&e.destroy()}function Mn(t){var e=On.get(t);e&&e.update()}var In=null;"undefined"==typeof window?((In=function(t){return t}).destroy=function(t){return t},In.update=function(t){return t}):((In=function(t,e){return t&&Array.prototype.forEach.call(t.length?t:[t],(function(t){return function(t){if(t&&t.nodeName&&"TEXTAREA"===t.nodeName&&!On.has(t)){var e,n=null,i=window.getComputedStyle(t),r=(e=t.value,function(){a({testForHeightReduction:""===e||!t.value.startsWith(e),restoreTextAlign:null}),e=t.value}),o=function(e){t.removeEventListener("autosize:destroy",o),t.removeEventListener("autosize:update",c),t.removeEventListener("input",r),window.removeEventListener("resize",c),Object.keys(e).forEach((function(n){return t.style[n]=e[n]})),On.delete(t)}.bind(t,{height:t.style.height,resize:t.style.resize,textAlign:t.style.textAlign,overflowY:t.style.overflowY,overflowX:t.style.overflowX,wordWrap:t.style.wordWrap});t.addEventListener("autosize:destroy",o),t.addEventListener("autosize:update",c),t.addEventListener("input",r),window.addEventListener("resize",c),t.style.overflowX="hidden",t.style.wordWrap="break-word",On.set(t,{destroy:o,update:c}),c()}function a(e){var r,o,c=e.restoreTextAlign,s=void 0===c?null:c,l=e.testForHeightReduction,u=void 0===l||l,h=i.overflowY;if(0!==t.scrollHeight&&("vertical"===i.resize?t.style.resize="none":"both"===i.resize&&(t.style.resize="horizontal"),u&&(r=function(t){for(var e=[];t&&t.parentNode&&t.parentNode instanceof Element;)t.parentNode.scrollTop&&e.push([t.parentNode,t.parentNode.scrollTop]),t=t.parentNode;return function(){return e.forEach((function(t){var e=t[0],n=t[1];e.style.scrollBehavior="auto",e.scrollTop=n,e.style.scrollBehavior=null}))}}(t),t.style.height=""),o="content-box"===i.boxSizing?t.scrollHeight-(parseFloat(i.paddingTop)+parseFloat(i.paddingBottom)):t.scrollHeight+parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth),"none"!==i.maxHeight&&o>parseFloat(i.maxHeight)?("hidden"===i.overflowY&&(t.style.overflow="scroll"),o=parseFloat(i.maxHeight)):"hidden"!==i.overflowY&&(t.style.overflow="hidden"),t.style.height=o+"px",s&&(t.style.textAlign=s),r&&r(),n!==o&&(t.dispatchEvent(new Event("autosize:resized",{bubbles:!0})),n=o),h!==i.overflow&&!s)){var f=i.textAlign;"hidden"===i.overflow&&(t.style.textAlign="start"===f?"end":"start"),a({restoreTextAlign:f,testForHeightReduction:!0})}}function c(){a({testForHeightReduction:!0,restoreTextAlign:null})}}(t)})),t}).destroy=function(t){return t&&Array.prototype.forEach.call(t.length?t:[t],zn),t},In.update=function(t){return t&&Array.prototype.forEach.call(t.length?t:[t],Mn),t});var Ln=In,Dn=function(){function t(e){v(this,t),this.msg=e}return m(t,[{key:"messageid",get:function(){return this.msg.messageid}},{key:"state",get:function(){return this.msg.state}},{key:"role",get:function(){return this.msg.role}},{key:"type",get:function(){return this.msg.type}},{key:"content",get:function(){return this.msg.content}},{key:"completed",get:function(){return this.msg.completed}},{key:"_origin",get:function(){return this.msg}},{key:"update",value:function(t){t.content||(t.content=""),this.msg.content+=t.content}},{key:"updateCompleted",value:function(t){this.msg.completed=t}}]),t}(),Pn=function(){function t(e){v(this,t),this.data=e}return m(t,[{key:"appid",get:function(){return this.data.appid}},{key:"id",get:function(){return this.data.id}},{key:"type",get:function(){return this.data.type}},{key:"caption",get:function(){return this.data.caption}},{key:"url",get:function(){return this.data.url}},{key:"aiChat",get:function(){return this.data.aiChat}}]),t}(),Hn=function(){function t(e){v(this,t),this.material=e}return m(t,[{key:"id",get:function(){return this.material.id}},{key:"type",get:function(){return this.material.type}},{key:"metadata",get:function(){return this.material.metadata}},{key:"data",get:function(){return this.material.data}}]),t}(),jn=function(t){return t.STYLE_CACHE="ai-chat-style-cache",t.MINIMIZE_STYLY_CHCHE="ai-chat-minimize-style-cache",t.DATA_BASE_NAME="ibiz-chat",t.DATA_TABLE_NAME="history-message",t.DATA_TABLE_KEY_NAME="id",t}(jn||{}),Bn=function(){function t(e){v(this,t),y(this,"messages",$t([])),y(this,"materials",$t([])),y(this,"input",$t("")),y(this,"context",void 0),y(this,"params",void 0),y(this,"appDataEntityId",void 0),y(this,"topicId",void 0),this.opts=e,this.context=e.context,this.params=e.params,this.appDataEntityId=e.appDataEntityId,this.topicId=e.topicId,this.fecthHistory()}var e,n,i,r,a;return m(t,[{key:"fecthHistory",value:(a=d(h().mark((function t(){var e,n=this;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.topicId){t.next=7;break}return t.next=3,ct.getData(jn.DATA_BASE_NAME,jn.DATA_TABLE_NAME,this.topicId);case 3:if(!((e=t.sent)&&e.data&&e.data.length>0)){t.next=7;break}return e.data.forEach((function(t){var e={messageid:t.messageid,state:t.state,type:t.type,role:t.role,content:t.content,completed:!0};n.addMessage(e)})),t.abrupt("return",!0);case 7:return t.abrupt("return",this.opts.history(this.context,this.params,{appDataEntityId:this.appDataEntityId}));case 8:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"asyncToIndexDB",value:(r=d(h().mark((function t(){var e;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.topicId){t.next=2;break}return t.abrupt("return");case 2:return e={id:this.topicId,data:this.messages.value.map((function(t){return t._origin})),timestamp:(new Date).getTime()},t.next=5,ct.updateData(jn.DATA_BASE_NAME,jn.DATA_TABLE_NAME,e);case 5:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"setInput",value:function(t){this.input.value=t||""}},{key:"addMessage",value:function(t){var e=this.messages.value.find((function(e){return e.messageid===t.messageid}));e?(e.update(t),this.messages.value=o(this.messages.value)):this.messages.value=[].concat(o(this.messages.value),[new Dn(t)]),this.asyncToIndexDB()}},{key:"completeMessage",value:function(t,e){var n=this.messages.value.find((function(e){return e.messageid===t}));n&&(n.updateCompleted(e),this.messages.value=o(this.messages.value),this.asyncToIndexDB())}},{key:"replaceMessage",value:function(t){var e=this.messages.value.findIndex((function(e){return e.messageid===t.messageid}));-1!==e?(this.messages.value[e]=new Dn(t),this.messages.value=o(this.messages.value)):this.messages.value=[].concat(o(this.messages.value),[new Dn(t)]),this.asyncToIndexDB()}},{key:"stringlyMaterialResource",value:function(){var t="",e=[];return this.materials.value&&this.materials.value.length>0&&(this.materials.value.forEach((function(t){if("ossfile"===t.type){var n=t.metadata;n.state&&"successed"===n.state&&e.push(t)}else e.push(t)})),this.materials.value=[]),e&&e.length>0&&(t=dt.stringify(e)),t}},{key:"question",value:(i=d(h().mark((function t(e){var n;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(n=this.stringlyMaterialResource())?n+="\n".concat(e):n=e,this.addMessage({state:30,messageid:ot(),role:"USER",type:"DEFAULT",content:n}),t.next=5,this.opts.question(this.context,this.params,{appDataEntityId:this.appDataEntityId},this.messages.value.filter((function(t){return"ERROR"!==t.type})).map((function(t){return t._origin})));case 5:this.opts.action&&this.opts.action("question",e);case 6:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"backfill",value:function(t){this.opts.action&&this.opts.action("backfill",t)}},{key:"deleteMessage",value:function(t){var e=this.messages.value.findIndex((function(e){return e.messageid===t.messageid}));-1!==e&&(this.messages.value.splice(e,1),this.messages.value=o(this.messages.value)),this.asyncToIndexDB(),this.opts.action&&this.opts.action("deletemsg",t)}},{key:"refreshMessage",value:(n=d(h().mark((function t(e){var n,i,r,a=arguments;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=a.length>1&&void 0!==a[1]&&a[1],i=this.messages.value.findIndex((function(t){return t.messageid===e.messageid})),!n){t.next=9;break}return this.messages.value.splice(i+1,this.messages.value.length-i-1),this.messages.value=o(this.messages.value),t.next=7,this.opts.question(this.context,this.params,{appDataEntityId:this.appDataEntityId},this.messages.value.filter((function(t){return"ERROR"!==t.type})).map((function(t){return t._origin})));case 7:t.next=19;break;case 9:if(i!==this.messages.value.length-1){t.next=16;break}return this.messages.value.pop(),this.messages.value=o(this.messages.value),t.next=14,this.opts.question(this.context,this.params,{appDataEntityId:this.appDataEntityId},this.messages.value.filter((function(t){return"ERROR"!==t.type})).map((function(t){return t._origin})));case 14:t.next=19;break;case 16:r=this.messages.value[i-1].content,this.messages.value.splice(i-1,2),this.question(r);case 19:this.asyncToIndexDB(),this.opts.action&&this.opts.action("refreshmsg",e);case 21:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"copyMessage",value:function(t){var e=t.content;at.copy(e),this.opts.action&&this.opts.action("copymsg",t)}},{key:"newDialogue",value:(e=d(h().mark((function t(){return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.messages.value.length=0,!this.topicId){t.next=4;break}return t.next=4,ct.deleteData(jn.DATA_BASE_NAME,jn.DATA_TABLE_NAME,this.topicId);case 4:this.opts.history(this.context,this.params,{appDataEntityId:this.appDataEntityId});case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"addMaterial",value:function(t){var e=this.materials.value.find((function(e){return e.id===t.id}));this.materials.value=e?o(this.materials.value):[].concat(o(this.materials.value),[new Hn(t)])}},{key:"replaceMaterial",value:function(t,e){var n=this.materials.value.findIndex((function(e){return e.id===t}));-1!==n?(this.materials.value[n]=new Hn(e),this.materials.value=o(this.materials.value)):this.materials.value=[].concat(o(this.materials.value),[new Hn(e)])}},{key:"deleteMaterial",value:function(t){var e=this.materials.value.findIndex((function(e){return e.id===t.id}));-1!==e&&(this.materials.value.splice(e,1),this.materials.value=o(this.materials.value))}}]),t}(),Rn=function(){function t(e){v(this,t),y(this,"topics",$t([])),y(this,"activedTopic",$t(null)),y(this,"currentTopicOptions",void 0),this.chat=e}var e,n,i,r;return m(t,[{key:"fetchHistory",value:(r=d(h().mark((function t(e){var n,i,r=this;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.configService(e.appid,"aitopics",e.type),t.next=3,n.load();case 3:(i=t.sent)&&i.length>0&&i.forEach((function(t){r.topics.value=[].concat(o(r.topics.value),[new Pn(t)])}));case 5:case"end":return t.stop()}}),t)}))),function(t){return r.apply(this,arguments)})},{key:"updateCurrentTopic",value:(i=d(h().mark((function t(e){var n,i,r,a;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.currentTopicOptions=e,n=this.topics.value.findIndex((function(t){return t.id===e.id})),i=new Pn(e),-1!==n?this.topics.value.splice(n,1,new Pn(e)):this.topics.value=[].concat(o(this.topics.value),[new Pn(e)]),r=this.topics.value.map((function(t){return{appid:t.appid,id:t.id,type:t.type,caption:t.caption,url:t.url,aiChat:t.aiChat}})),a=e.configService(e.appid,"aitopics",e.type),t.next=8,null==a?void 0:a.save(r);case 8:this.activedTopic.value=i;case 9:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"removeTopic",value:(n=d(h().mark((function t(e,n,i,r,a){var c,s,l,u,f;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=!0,!e.beforeDelete){t.next=5;break}return t.next=4,e.beforeDelete(n,i,r,a);case 4:s=t.sent;case 5:if(s){t.next=7;break}return t.abrupt("return");case 7:return-1!==(l=this.topics.value.findIndex((function(t){return t.id===r.id})))&&(this.topics.value.splice(l,1),this.topics.value=o(this.topics.value)),u=this.topics.value.map((function(t){return{appid:t.appid,id:t.id,type:t.type,caption:t.caption,url:t.url,aiChat:t.aiChat}})),f=e.configService(e.appid,"aitopics",e.type),t.next=13,null==f?void 0:f.save(u);case 13:return t.next=15,ct.deleteData(jn.DATA_BASE_NAME,jn.DATA_TABLE_NAME,r.id);case 15:this.topics.value.length>0&&r.id===(null===(c=this.activedTopic.value)||void 0===c?void 0:c.id)&&this.handleTopicChange(this.topics.value[0]);case 16:case"end":return t.stop()}}),t,this)}))),function(t,e,i,r,o){return n.apply(this,arguments)})},{key:"handleTopicChange",value:function(t){var e;(null===(e=this.activedTopic.value)||void 0===e?void 0:e.id)!==t.id&&(this.activedTopic.value=t,this.chat.switchAiChatController(t))}},{key:"handleTopicAction",value:(e=d(h().mark((function t(e,n,i){var r,o,a,c,s,l;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.topics.value.find((function(t){return t.id===n.id})),!(this.currentTopicOptions&&r&&r.aiChat)){t.next=7;break}if(c=r.aiChat,s=c.context,l=c.params,"DELETE"!==e){t.next=6;break}return t.next=6,this.removeTopic(this.currentTopicOptions,s,l,r,i);case 6:null===(o=(a=this.currentTopicOptions).action)||void 0===o||o.call(a,e,s,l,n,i);case 7:case"end":return t.stop()}}),t,this)}))),function(t,n,i){return e.apply(this,arguments)})}]),t}(),Fn=m((function t(e){v(this,t),this.aiChat=e})),Un=function(e){t(o,e);var i,r=n(o);function o(){return v(this,o),r.apply(this,arguments)}return m(o,[{key:"excuteAction",value:(i=d(h().mark((function t(e,n){var i,r,o;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n||!n.onClick){t.next=5;break}return t.next=3,n.onClick(e,this.aiChat.context,this.aiChat.params);case 3:(i=t.sent)&&i.data&&i.data.length>0&&(r=i.data[0],o={id:r.id,type:r.type,data:r.data||{},metadata:r.metadata||{}},n.id&&Object.assign(o.metadata,{actionId:n.id}),this.aiChat.addMaterial(o));case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return i.apply(this,arguments)})}]),o}(Fn),Vn=function(e){t(o,e);var i,r=n(o);function o(){return v(this,o),r.apply(this,arguments)}return m(o,[{key:"excuteAction",value:(i=d(h().mark((function t(e,n){var i,r,o,a,c,s,l,u,f,p,v=this;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=this.aiChat.opts.uploader,r=i.multiple,o=i.accept,a=i.maxSize,c=i.onSelect,s=i.onUpload,l=i.onSuccess,u=i.onError,f=i.onProgress,p={multiple:r||!0,accept:o||"*/*",maxSize:a||5242880,onSelect:function(t){null==c||c(t),t.length>0&&t.forEach((function(t){var e=v.buildMaterialObject(t);Object.assign(e.metadata,{state:"uploading"}),v.aiChat.addMaterial(e)}))},onUpload:function(){var t=d(h().mark((function t(e,n){return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",s(e,n,{context:v.aiChat.context,params:v.aiChat.params}));case 1:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),onSuccess:function(t,e){var n={id:t.id,type:"ossfile",data:{id:t.id,name:t.name},metadata:{ext:t.ext,fileext:t.fileext,fileid:t.fileid,filename:t.filename,size:t.size,filesize:t.filesize,state:"successed"}};v.aiChat.replaceMaterial(e.name,n),null==l||l(t,e)},onError:function(t,e){var n=v.buildMaterialObject(e);Object.assign(n.metadata,{state:"failed"}),v.aiChat.replaceMaterial(e.name,n),null==u||u(t,e)},onProgress:function(t,e){null==f||f(t,e)}},new ft(p).openFilePicker();case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return i.apply(this,arguments)})},{key:"buildMaterialObject",value:function(t){return{id:t.name,type:"ossfile",data:{name:t.name,id:t.name},metadata:{size:t.size,type:t.type,lastModified:t.lastModified}}}}]),o}(Fn),Wn=function(){function t(){v(this,t)}return m(t,null,[{key:"getMaterialHelper",value:function(t,e){return"ossfile"===t?new Vn(e):new Un(e)}}]),t}(),qn=function(){function t(){v(this,t),y(this,"container",void 0),y(this,"mode","DEFAULT"),y(this,"isMountedAiTopic",!1),y(this,"backupChatOptions",void 0),y(this,"aiTopic",void 0),y(this,"aiChat",void 0),this.aiTopic=new Rn(this)}var e,n;return m(t,[{key:"initIndexDB",value:(n=d(h().mark((function t(){return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ct.checkTableExists(jn.DATA_BASE_NAME,jn.DATA_TABLE_NAME);case 2:if(t.sent){t.next=6;break}return t.next=6,ct.createTable(jn.DATA_BASE_NAME,jn.DATA_TABLE_NAME,jn.DATA_TABLE_KEY_NAME,!1);case 6:case"end":return t.stop()}}),t)}))),function(){return n.apply(this,arguments)})},{key:"create",value:(e=d(h().mark((function t(e){var n,i,r,o=this;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.initIndexDB();case 2:if(this.backupChatOptions=e,this.close(),this.container=document.createElement("div"),this.container.classList.add("ibiz-ai-chat"),document.body.appendChild(this.container),i=e.chatOptions,!e.mode||"TOPIC"!==e.mode){t.next=17;break}if(this.isMountedAiTopic){t.next=13;break}return t.next=12,this.aiTopic.fetchHistory(e.topicOptions);case 12:this.isMountedAiTopic=!0;case 13:return r=e.topicOptions,Object.assign(r,{aiChat:{caption:i.caption,context:i.context,params:i.params,appDataEntityId:i.appDataEntityId,contentToolbarItems:i.contentToolbarItems,footerToolbarItems:i.footerToolbarItems,questionToolbarItems:i.questionToolbarItems}}),t.next=17,this.aiTopic.updateCurrentTopic(r);case 17:return Object.assign(i,{topicId:null===(n=r)||void 0===n?void 0:n.id}),this.aiChat=new Bn(i),K(O(ii,{aiTopic:this.aiTopic,aiChat:this.aiChat,mode:e.mode?e.mode:"DEFAULT",containerOptions:e.containerOptions,caption:e.mode&&"TOPIC"===e.mode?"AI助手":i.caption,contentToolbarItems:i.contentToolbarItems,footerToolbarItems:i.footerToolbarItems,questionToolbarItems:i.questionToolbarItems,close:function(){o.close(),i.closed&&i.closed(i.context,i.params)},fullscreen:function(t){i.fullscreen&&i.fullscreen(t,i.context,i.params)},minimize:function(t){i.minimize&&i.minimize(t,i.context,i.params)}}),this.container),t.abrupt("return",this.aiChat);case 21:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"switchAiChatController",value:function(t){var e,n,i,r=this,o=u({},this.backupChatOptions.chatOptions);(t.aiChat&&Object.assign(o,{caption:t.aiChat.caption,context:t.aiChat.context,params:t.aiChat.params,contentToolbarItems:t.aiChat.contentToolbarItems,footerToolbarItems:t.aiChat.footerToolbarItems,questionToolbarItems:t.aiChat.questionToolbarItems,appDataEntityId:t.aiChat.appDataEntityId,topicId:t.id}),this.aiChat=new Bn(o),this.container)&&(K(null,this.container),K(O(ii,{aiTopic:this.aiTopic,aiChat:this.aiChat,mode:null!==(e=this.backupChatOptions)&&void 0!==e&&e.mode?this.backupChatOptions.mode:"DEFAULT",containerOptions:null===(n=this.backupChatOptions)||void 0===n?void 0:n.containerOptions,caption:null!==(i=this.backupChatOptions)&&void 0!==i&&i.mode&&"TOPIC"===this.backupChatOptions.mode?"AI助手":o.caption,contentToolbarItems:o.contentToolbarItems,footerToolbarItems:o.footerToolbarItems,questionToolbarItems:o.questionToolbarItems,close:function(){r.close(),o.closed&&o.closed(o.context,o.params)},fullscreen:function(t){o.fullscreen&&o.fullscreen(t,o.context,o.params)},minimize:function(t){o.minimize&&o.minimize(t,o.context,o.params)}}),this.container))}},{key:"hidden",value:function(){this.container&&(this.container.style.display="none")}},{key:"show",value:function(){this.container&&(this.container.style.display="flex")}},{key:"close",value:function(){this.container&&(K(null,this.container),this.container.remove(),this.container=void 0)}}]),t}(),Yn=(e("chat",new qn),new tt("chat-input-material")),$n=function(t){var e=t.controller.materials;return he("div",{className:Yn.b(),children:e.value.map((function(e){return he(Ue,{material:e,disabled:!1,controller:t.controller},e.id)}))})},Xn=function(t){var e=t.children,n=t.actions,i=t.content,r=t.position,o=void 0===r?"bottom":r,c=t.isOpen,s=t.onToggleOpen,l=t.onAction,h=new tt("pop"),f=function(t){var e=lt.context[t.__c],n=xt(st++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(lt)),e.props.value):t.__}(ni),d=a(kt(c||!1),2),p=d[0],v=d[1],_=Nt(null),m=Nt(null);Ct((function(){void 0!==c&&v(c)}),[c]),Ct((function(){return m.current||(m.current=document.createElement("div"),m.current.className=h.b("content-container"),document.body.appendChild(m.current)),function(){m.current&&document.body.removeChild(m.current)}}),[]),Ct((function(){var t=function(t){!_.current||_.current.contains(t.target)||t.target.closest(".".concat(h.b("content")))||t.target.closest(".ibiz-quick-edit")||t.target.closest(".ibiz-picker__transfer")||(v(!1),null==s||s(!1))};return p&&document.addEventListener("mousedown",t),function(){document.removeEventListener("mousedown",t)}}),[p,s]);return he("span",{className:"".concat(h.b("trigger-container")),children:[he("span",{className:"".concat(h.b("trigger-element")),ref:_,onClick:function(t){t.stopPropagation();var e=!p;v(e),null==s||s(e)},children:e}),p&&m.current&&vn(he("div",{className:"".concat(h.b("content")," pop-").concat(o),style:function(){if(!_.current)return{};var t=_.current.getBoundingClientRect(),e={position:"absolute",zIndex:f.zIndex+1},n={bottom:{top:t.bottom+window.scrollY,left:t.left+window.scrollX},top:{bottom:window.innerHeight-t.top+window.scrollY,left:t.left+window.scrollX},left:{top:t.top+window.scrollY,right:window.innerWidth-t.left+window.scrollX},right:{top:t.top+window.scrollY,left:t.right+window.scrollX},"top-left":{bottom:window.innerHeight-t.top+window.scrollY,right:window.innerWidth-t.left+window.scrollX}};return u(u({},e),n[o])}(),children:i||(null==n?void 0:n.map((function(t){return he("div",{className:h.b("content-item"),onMouseDown:function(e){e.stopPropagation(),null==l||l(t.id,e)},children:[t.icon&&he("img",{className:h.b("content-item__icon"),src:t.icon,alt:t.caption}),he("div",{className:h.b("content-item__caption"),children:t.caption})]},t.id)})))}),m.current)]})},Gn=new tt("chat-input"),Jn=window.SpeechRecognition||window.webkitSpeechRecognition,Zn=function(t){var e,n=a(kt(!1),2),i=n[0],r=n[1],o=Nt(null),c=t.controller.input,s=se(!1),l=se(!1),u=Nt();Jn&&!u.current&&(u.current=new Jn,u.current.onstart=function(){l.value=!0},u.current.onend=function(){l.value=!1},u.current.onresult=function(t){var e,n=null===(e=t.results)||void 0===e||null===(e=e[0])||void 0===e||null===(e=e[0])||void 0===e?void 0:e.transcript;n&&(c.value="".concat(c.value).concat(n))});var f=Tt((function(t){c.value=t.target.value}),[c]),p=le((function(){return c.value.length<=0||!0===s.value}));Ct((function(){return o.current&&Ln(o.current),function(){o.current&&Ln.destroy(o.current)}}),[o]);var v=Tt(d(h().mark((function e(){var n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.value=!0,e.prev=1,n=c.value,c.value="",e.next=6,t.controller.question(n);case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),console.error(e.t0);case 11:return e.prev=11,s.value=!1,e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[1,8,11,14]])}))),[c,s]),_=function(){var e=d(h().mark((function e(n){var i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Wn.getMaterialHelper("ossfile",t.controller),e.next=3,i.excuteAction(n);case 3:r(!1);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),m=function(){var e=d(h().mark((function e(n,i){var o;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=Wn.getMaterialHelper("common",t.controller),e.next=3,o.excuteAction(n,i);case 3:r(!1);case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return he("div",{className:Gn.b("wrapper"),children:[he("div",{className:Gn.b("material-wrapper"),children:he($n,{controller:t.controller})}),he("div",{className:Gn.b("main-wrapper"),children:[he("textarea",{className:Gn.e("textarea"),type:"text",rows:6,autoCorrect:"off",autoCapitalize:"off",autoComplete:"off",value:c,onInput:f,onKeyDown:function(t){"Enter"===t.code&&(t.stopPropagation(),!1===t.shiftKey&&v())},ref:o,disabled:s}),he("div",{className:Gn.b("action-wrapper"),children:[he("div",{className:"".concat(Gn.be("action-wrapper","action-item")),children:he(Xn,{content:he("div",{className:Gn.b("pop-actions"),children:[he("div",{className:Gn.b("pop-action-item"),onClick:function(t){_(t)},children:[he("span",{className:Gn.b("pop-action-item-icon"),children:he(ze,{})}),he("span",{className:Gn.b("pop-action-item-title"),children:"文件资料"})]}),null===(e=t.questionToolbarItems)||void 0===e?void 0:e.map((function(t){return he("div",{className:Gn.b("pop-action-item"),onClick:function(e){m(e,t)},children:[he("span",{className:Gn.b("pop-action-item-icon"),children:"function"==typeof t.icon?t.icon(O):t.icon}),he("span",{className:Gn.b("pop-action-item-title"),children:"function"==typeof t.label?t.label(O):t.label})]},t.id)}))]}),position:"top-left",isOpen:i,onToggleOpen:r,children:he(Oe,{})})}),he("div",{title:l.value?"语音输入中...":"语音输入",className:"".concat(Gn.be("action-wrapper","action-item")),onClick:function(){u.current&&!l.value&&u.current.start()},children:l.value?he(Ce,{}):he(ke,{})}),he("div",{title:s.value?"思考中...":"发送消息",className:"".concat(Gn.be("action-wrapper","action-item")," ").concat(Gn.is("disabled",p.value)," ").concat(Gn.is("loading",s.value)),onClick:v,disabled:p,children:he(pe,{})})]})]})]})},Kn=new tt("chat-topic-item"),Qn=function(t){var e=t.controller,n=t.topic,i=t.onClick,r=t.onAction,o=le((function(){var t;return(null===(t=e.activedTopic.value)||void 0===t?void 0:t.id)===n.id})),c=a(kt(!1),2),s=c[0],l=c[1];return he("div",{className:"".concat(Kn.b()," ").concat(Kn.is("active",o.value)),onClick:i.bind(void 0),children:[he("div",{className:Kn.b("caption"),title:n.caption,children:n.caption}),he("div",{className:Kn.b("icon"),children:[he("span",{className:Kn.be("icon","item"),title:"跳转主视图",onClick:function(t){t.stopPropagation(),r("LINK",t)}.bind(void 0),children:he(Ee,{className:Kn.b("link-icon")})}),o.value?null:he(Xn,{actions:[{id:"DELETE",caption:"删除话题"}],position:"bottom",isOpen:s,onToggleOpen:l,onAction:function(t,e){"DELETE"===t&&r("DELETE",e),l(!1)}.bind(void 0),children:he("span",{className:Kn.be("icon","item"),title:"更多",children:he(Ne,{className:Kn.b("more-icon")})})})]})]})},ti=new tt("chat-topics"),ei=function(t){var e=t.controller.topics;return he("div",{className:ti.b(),children:e.value.map((function(e){return he(Qn,{topic:e,controller:t.controller,onClick:function(){return function(e){t.controller.handleTopicChange(e)}(e)},onAction:function(n,i){return function(e,n,i){t.controller.handleTopicAction(e,n,i)}(n,e,i)}},e.id)}))})},ni=function(t,e){var n={__c:e="__cC"+k++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,i;return this.getChildContext||(n=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some((function(t){t.__e=!0,P(t)}))},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}({zIndex:10}),ii=function(e){t(o,e);var r=n(o);function o(t){var e,n;return v(this,o),y(i(n=r.call(this,t)),"ns",new tt("chat-container")),y(i(n),"containerRef",{current:null}),y(i(n),"dragHandle",{current:null}),y(i(n),"minimizeRef",{current:null}),y(i(n),"data",{x:window.innerWidth-600,y:0,width:600,height:window.innerHeight,minWidth:500,minHeight:300}),y(i(n),"minimizeData",{x:window.innerWidth-86,y:window.innerHeight-86}),y(i(n),"disabled",!1),y(i(n),"isDragging",!1),y(i(n),"containerContext",{zIndex:(null===(e=n.props.containerOptions)||void 0===e?void 0:e.zIndex)||10}),n.state={isFullScreen:!1,isMinimize:!1},n}return m(o,[{key:"calcWindowStyle",value:function(){var t;return{left:"".concat(this.data.x/window.innerWidth*100,"%"),top:"".concat(this.data.y/window.innerHeight*100,"%"),width:"".concat(this.data.width/window.innerWidth*100,"%"),height:"".concat(this.data.height/window.innerHeight*100,"%"),minWidth:"".concat(this.data.minWidth,"px"),minHeight:"".concat(this.data.minHeight,"px"),"z-index":(null===(t=this.props.containerOptions)||void 0===t||null===(t=t.zIndex)||void 0===t?void 0:t.toString())||"10"}}},{key:"calcMinimizeStyle",value:function(){return{left:"".concat(this.minimizeData.x/window.innerWidth*100,"%"),top:"".concat(this.minimizeData.y/window.innerHeight*100,"%"),"z-index":"99999"}}},{key:"setStyle",value:function(){Object.assign(this.containerRef.current.style,this.calcWindowStyle()),Object.assign(this.minimizeRef.current.style,this.calcMinimizeStyle())}},{key:"componentDidMount",value:function(){var t=this,e=localStorage.getItem(jn.MINIMIZE_STYLY_CHCHE);e&&(this.minimizeData=JSON.parse(e));var n=localStorage.getItem(jn.STYLE_CACHE);n&&(this.data=JSON.parse(n),this.data.x>window.innerWidth&&(this.data.x=window.innerWidth-100),this.data.y>window.innerHeight&&(this.data.y=window.innerHeight-100)),this.setStyle();var i=this.data;this.minimizeRef.current.onmousedown=function(e){document.body.style.userSelect="none";var n=e.clientX-t.minimizeRef.current.offsetLeft,i=e.clientY-t.minimizeRef.current.offsetTop,r=Date.now(),o=function(e){t.minimizeData.x=e.clientX-n,t.minimizeData.y=e.clientY-i,t.setStyle()};document.addEventListener("mousemove",o),document.addEventListener("mouseup",(function e(){var n=Date.now();t.isDragging=n-r>300,document.body.style.userSelect="",document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",e)}))},this.dragHandle.current.onmousedown=function(e){if(!t.disabled&&!t.state.isFullScreen){document.body.style.userSelect="none";var n=e.clientX-t.containerRef.current.offsetLeft,r=e.clientY-t.containerRef.current.offsetTop,o=function(e){i.x=e.clientX-n,i.y=e.clientY-r,t.setStyle()};document.addEventListener("mousemove",o),document.addEventListener("mouseup",(function t(){document.body.style.userSelect="",document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",t)}))}},c(this.containerRef.current).resizable({edges:{top:!0,right:!0,bottom:!0,left:!0},margin:6,modifiers:[c.modifiers.restrictEdges({outer:document.body}),c.modifiers.restrictSize({min:{width:i.minWidth,height:i.minHeight}})],inertia:!0,listeners:{move:function(e){t.state.isFullScreen||(i.x=e.rect.left,i.y=e.rect.top,i.width=e.rect.width,i.height=e.rect.height,t.setStyle())},start:function(){t.disabled=!0,document.body.style.userSelect="none"},end:function(){t.disabled=!1,document.body.style.userSelect=""}}})}},{key:"componentWillUnmount",value:function(){localStorage.setItem(jn.STYLE_CACHE,JSON.stringify(this.data)),localStorage.setItem(jn.MINIMIZE_STYLY_CHCHE,JSON.stringify(this.minimizeData))}},{key:"close",value:function(){this.props.close()}},{key:"fullScreen",value:function(){var t=this.containerRef.current;t&&(t.requestFullscreen(),this.setState({isFullScreen:!0}),this.props.fullscreen(!0))}},{key:"closeFullScreen",value:function(){var t;this.state.isFullScreen&&(null===(t=document)||void 0===t||t.exitFullscreen(),this.setState({isFullScreen:!1}),this.props.fullscreen(!1),this.setStyle())}},{key:"minimize",value:function(){this.closeFullScreen(),this.setState({isMinimize:!0}),this.props.minimize(!0)}},{key:"exitMinimize",value:function(){this.isDragging||(this.setState({isMinimize:!1}),this.props.minimize(!1))}},{key:"stopPropagation",value:function(t){t.stopPropagation()}},{key:"render",value:function(){return he(ni.Provider,{value:this.containerContext,children:he("div",{className:"".concat(this.ns.b()),children:[he("div",{className:"".concat(this.ns.e("dialog")," ").concat(this.ns.is("full-screen",this.state.isFullScreen)," ").concat(this.ns.is("hidden",this.state.isMinimize)),ref:this.containerRef,children:[he("div",{ref:this.dragHandle,className:this.ns.b("header"),children:[he("div",{className:this.ns.b("header-caption"),children:this.props.caption||"AI助手"}),he("div",{className:this.ns.b("header-action-wrapper"),children:[he("div",{title:"最小化",className:"".concat(this.ns.be("header-action-wrapper","action-item")," ").concat(this.ns.be("header-action-wrapper","minimize")),onMouseDown:this.stopPropagation.bind(this),onClick:this.minimize.bind(this),children:he(be,{})}),this.state.isFullScreen?he("div",{title:"退出全屏",className:"".concat(this.ns.be("header-action-wrapper","action-item")," ").concat(this.ns.be("header-action-wrapper","close-full-screen")),onMouseDown:this.stopPropagation.bind(this),onClick:this.closeFullScreen.bind(this),children:he(ge,{})}):he("div",{title:"全屏",className:"".concat(this.ns.be("header-action-wrapper","action-item")," ").concat(this.ns.be("header-action-wrapper","full-screen")),onMouseDown:this.stopPropagation.bind(this),onClick:this.fullScreen.bind(this),children:he(ye,{})}),he("div",{title:"关闭",className:"".concat(this.ns.be("header-action-wrapper","action-item")," ").concat(this.ns.be("header-action-wrapper","action-close")),onMouseDown:this.stopPropagation.bind(this),onClick:this.close.bind(this),children:he(fe,{})})]})]}),"TOPIC"===this.props.mode?he("div",{className:"".concat(this.ns.b("main")),children:[he("div",{className:"".concat(this.ns.be("main","left")),children:he(ei,{controller:this.props.aiTopic})}),he("div",{className:"".concat(this.ns.be("main","right")),children:[he("div",{className:this.ns.b("content"),children:he(tn,{controller:this.props.aiChat,toolbarItems:this.props.contentToolbarItems})}),he(Ke,{data:this.props.aiTopic.activedTopic.value,type:"footer",className:this.ns.e("toolbar"),controller:this.props.aiChat,items:this.props.footerToolbarItems}),he("div",{className:this.ns.b("footer"),children:he(Zn,{controller:this.props.aiChat,questionToolbarItems:this.props.questionToolbarItems})})]})]}):he("div",{className:"".concat(this.ns.be("main","default")),children:[he("div",{className:this.ns.b("content"),children:he(tn,{controller:this.props.aiChat,toolbarItems:this.props.contentToolbarItems})}),he(Ke,{data:this.props.aiTopic.activedTopic.value,type:"footer",className:this.ns.e("toolbar"),controller:this.props.aiChat,items:this.props.footerToolbarItems}),he("div",{className:this.ns.b("footer"),children:he(Zn,{controller:this.props.aiChat,questionToolbarItems:this.props.questionToolbarItems})})]})]}),he("div",{title:"AI助手",ref:this.minimizeRef,className:"".concat(this.ns.e("minimize")," ").concat(this.ns.is("hidden",!this.state.isMinimize)),onClick:this.exitMinimize.bind(this),children:he(we,{})})]})})}}]),o}(I);e("ChatContainer",ii)}}}))}();
1
+ !function(){function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&e(t,n)}function e(t,n){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},e(t,n)}function n(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,o=r(t);if(e){var a=r(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return function(t,e){if(e&&("object"===p(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return i(t)}(this,n)}}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function r(t){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},r(t)}function o(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||c(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,a,c=[],s=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;s=!1}else for(;!(s=(i=o.call(n)).done)&&(c.push(i.value),c.length!==e);s=!0);}catch(t){l=!0,r=t}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw r}}return c}}(t,e)||c(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e){if(t){if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){g(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function h(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */h=function(){return e};var t,e={},n=Object.prototype,i=n.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function u(t,e,n,i){var o=e&&e.prototype instanceof y?e:y,a=Object.create(o.prototype),c=new z(i||[]);return r(a,"_invoke",{value:S(t,n,c)}),a}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var f="suspendedStart",v="suspendedYield",m="executing",_="completed",g={};function y(){}function b(){}function w(){}var k={};l(k,a,(function(){return this}));var x=Object.getPrototypeOf,C=x&&x(x(L([])));C&&C!==n&&i.call(C,a)&&(k=C);var N=w.prototype=y.prototype=Object.create(k);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function n(r,o,a,c){var s=d(t[r],t,o);if("throw"!==s.type){var l=s.arg,u=l.value;return u&&"object"==p(u)&&i.call(u,"__await")?e.resolve(u.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(u).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;r(this,"_invoke",{value:function(t,i){function r(){return new e((function(e,r){n(t,i,e,r)}))}return o=o?o.then(r,r):r()}})}function S(e,n,i){var r=f;return function(o,a){if(r===m)throw new Error("Generator is already running");if(r===_){if("throw"===o)throw a;return{value:t,done:!0}}for(i.method=o,i.arg=a;;){var c=i.delegate;if(c){var s=A(c,i);if(s){if(s===g)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===f)throw r=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=m;var l=d(e,n,i);if("normal"===l.type){if(r=i.done?_:v,l.arg===g)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(r=_,i.method="throw",i.arg=l.arg)}}}function A(e,n){var i=n.method,r=e.iterator[i];if(r===t)return n.delegate=null,"throw"===i&&e.iterator.return&&(n.method="return",n.arg=t,A(e,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+i+"' method")),g;var o=d(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function M(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function z(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function n(){for(;++r<e.length;)if(i.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(p(e)+" is not iterable")}return b.prototype=w,r(N,"constructor",{value:w,configurable:!0}),r(w,"constructor",{value:b,configurable:!0}),b.displayName=l(w,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,s,"GeneratorFunction")),t.prototype=Object.create(N),t},e.awrap=function(t){return{__await:t}},E(T.prototype),l(T.prototype,c,(function(){return this})),e.AsyncIterator=T,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var a=new T(u(t,n,i,r),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(N),l(N,s,"Generator"),l(N,a,(function(){return this})),l(N,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var i in e)n.push(i);return n.reverse(),function t(){for(;n.length;){var i=n.pop();if(i in e)return t.value=i,t.done=!1,t}return t.done=!0,t}},e.values=L,z.prototype={constructor:z,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(i,r){return c.type="throw",c.arg=e,n.next=i,r&&(n.method="next",n.arg=t),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(s&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;O(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:L(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),g}},e}function d(t,e,n,i,r,o,a){try{var c=t[o](a),s=c.value}catch(l){return void n(l)}c.done?e(s):Promise.resolve(s).then(i,r)}function f(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function a(t){d(o,i,r,a,c,"next",t)}function c(t){d(o,i,r,a,c,"throw",t)}a(void 0)}))}}function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function v(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,y(i.key),i)}}function _(t,e,n){return e&&m(t.prototype,e),n&&m(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function g(t,e,n){return(e=y(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y(t){var e=function(t,e){if("object"!==p(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==p(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===p(e)?e:String(e)}System.register(["interactjs","cherry-markdown"],(function(e,r){"use strict";var c,s;return{setters:[function(t){c=t.default},function(t){s=t.default}],execute:function(){var r,l,d,m,y,b,w,k,x,C={},N=[],E=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,T=Array.isArray;function S(t,e){for(var n in e)t[n]=e[n];return t}function A(t){var e=t.parentNode;e&&e.removeChild(t)}function M(t,e,n){var i,o,a,c={};for(a in e)"key"==a?i=e[a]:"ref"==a?o=e[a]:c[a]=e[a];if(arguments.length>2&&(c.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(a in t.defaultProps)void 0===c[a]&&(c[a]=t.defaultProps[a]);return O(t,c,i,o,null)}function O(t,e,n,i,r){var o={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++d:r};return null==r&&null!=l.vnode&&l.vnode(o),o}function z(t){return t.children}function L(t,e){this.props=t,this.context=e}function D(t,e){if(null==e)return t.__?D(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__d||n.__e;return"function"==typeof t.type?D(t):null}function I(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return I(t)}}function P(t){(!t.__d&&(t.__d=!0)&&y.push(t)&&!B.__r++||b!==l.debounceRendering)&&((b=l.debounceRendering)||w)(B)}function B(){var t,e,n,i,r,o,a,c,s;for(y.sort(k);t=y.shift();)t.__d&&(e=y.length,i=void 0,r=void 0,o=void 0,c=(a=(n=t).__v).__e,(s=n.__P)&&(i=[],r=[],(o=S({},a)).__v=a.__v+1,$(s,a,o,n.__n,void 0!==s.ownerSVGElement,null!=a.__h?[c]:null,i,null==c?D(a):c,a.__h,r),X(i,a,r),a.__e!=c&&I(a)),y.length>e&&y.sort(k));B.__r=0}function H(t,e,n,i,r,o,a,c,s,l,u){var h,d,f,p,v,m,_,g,y,b=0,w=i&&i.__k||N,k=w.length,x=k,E=e.length;for(n.__k=[],h=0;h<E;h++)null!=(p=n.__k[h]=null==(p=e[h])||"boolean"==typeof p||"function"==typeof p?null:"string"==typeof p||"number"==typeof p||"bigint"==typeof p?O(null,p,null,null,p):T(p)?O(z,{children:p},null,null,null):p.__b>0?O(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)?(p.__=n,p.__b=n.__b+1,-1===(g=U(p,w,_=h+b,x))?f=C:(f=w[g]||C,w[g]=void 0,x--),$(t,p,f,r,o,a,c,s,l,u),v=p.__e,(d=p.ref)&&f.ref!=d&&(f.ref&&G(f.ref,null,p),u.push(d,p.__c||v,p)),null!=v&&(null==m&&(m=v),(y=f===C||null===f.__v)?-1==g&&b--:g!==_&&(g===_+1?b++:g>_?x>E-_?b+=g-_:b--:b=g<_&&g==_-1?g-_:0),_=h+b,"function"!=typeof p.type||g===_&&f.__k!==p.__k?"function"==typeof p.type||g===_&&!y?void 0!==p.__d?(s=p.__d,p.__d=void 0):s=v.nextSibling:s=R(t,v,s):s=j(p,s,t),"function"==typeof n.type&&(n.__d=s))):(f=w[h])&&null==f.key&&f.__e&&(f.__e==s&&(f.__=i,s=D(f)),J(f,f,!1),w[h]=null);for(n.__e=m,h=k;h--;)null!=w[h]&&("function"==typeof n.type&&null!=w[h].__e&&w[h].__e==n.__d&&(n.__d=w[h].__e.nextSibling),J(w[h],w[h]))}function j(t,e,n){for(var i,r=t.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=t,e="function"==typeof i.type?j(i,e,n):R(n,i.__e,e));return e}function F(t,e){return e=e||[],null==t||"boolean"==typeof t||(T(t)?t.some((function(t){F(t,e)})):e.push(t)),e}function R(t,e,n){return null==n||n.parentNode!==t?t.insertBefore(e,null):e==n&&null!=e.parentNode||t.insertBefore(e,n),e.nextSibling}function U(t,e,n,i){var r=t.key,o=t.type,a=n-1,c=n+1,s=e[n];if(null===s||s&&r==s.key&&o===s.type)return n;if(i>(null!=s?1:0))for(;a>=0||c<e.length;){if(a>=0){if((s=e[a])&&r==s.key&&o===s.type)return a;a--}if(c<e.length){if((s=e[c])&&r==s.key&&o===s.type)return c;c++}}return-1}function W(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||E.test(e)?n:n+"px"}function V(t,e,n,i,r){var o;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||W(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||W(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i?n.u=i.u:(n.u=Date.now(),t.addEventListener(e,o?Y:q,o)):t.removeEventListener(e,o?Y:q,o);else if("dangerouslySetInnerHTML"!==e){if(r)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&"role"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function q(t){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(l.event?l.event(t):t)}function Y(t){return this.l[t.type+!0](l.event?l.event(t):t)}function $(t,e,n,i,o,a,c,s,u,h){var d,f,p,v,m,_,g,y,b,w,k,x,N,E,M,O=e.type;if(void 0!==e.constructor)return null;null!=n.__h&&(u=n.__h,s=e.__e=n.__e,e.__h=null,a=[s]),(d=l.__b)&&d(e);t:if("function"==typeof O)try{if(y=e.props,b=(d=O.contextType)&&i[d.__c],w=d?b?b.props.value:d.__:i,n.__c?g=(f=e.__c=n.__c).__=f.__E:("prototype"in O&&O.prototype.render?e.__c=f=new O(y,w):(e.__c=f=new L(y,w),f.constructor=O,f.render=Z),b&&b.sub(f),f.props=y,f.state||(f.state={}),f.context=w,f.__n=i,p=f.__d=!0,f.__h=[],f._sb=[]),null==f.__s&&(f.__s=f.state),null!=O.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=S({},f.__s)),S(f.__s,O.getDerivedStateFromProps(y,f.__s))),v=f.props,m=f.state,f.__v=e,p)null==O.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(null==O.getDerivedStateFromProps&&y!==v&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(y,w),!f.__e&&(null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(y,f.__s,w)||e.__v===n.__v)){for(e.__v!==n.__v&&(f.props=y,f.state=f.__s,f.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),k=0;k<f._sb.length;k++)f.__h.push(f._sb[k]);f._sb=[],f.__h.length&&c.push(f);break t}null!=f.componentWillUpdate&&f.componentWillUpdate(y,f.__s,w),null!=f.componentDidUpdate&&f.__h.push((function(){f.componentDidUpdate(v,m,_)}))}if(f.context=w,f.props=y,f.__P=t,f.__e=!1,x=l.__r,N=0,"prototype"in O&&O.prototype.render){for(f.state=f.__s,f.__d=!1,x&&x(e),d=f.render(f.props,f.state,f.context),E=0;E<f._sb.length;E++)f.__h.push(f._sb[E]);f._sb=[]}else do{f.__d=!1,x&&x(e),d=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&++N<25);f.state=f.__s,null!=f.getChildContext&&(i=S(S({},i),f.getChildContext())),p||null==f.getSnapshotBeforeUpdate||(_=f.getSnapshotBeforeUpdate(v,m)),H(t,T(M=null!=d&&d.type===z&&null==d.key?d.props.children:d)?M:[M],e,n,i,o,a,c,s,u,h),f.base=e.__e,e.__h=null,f.__h.length&&c.push(f),g&&(f.__E=f.__=null)}catch(t){e.__v=null,(u||null!=a)&&(e.__e=s,e.__h=!!u,a[a.indexOf(s)]=null),l.__e(t,e,n)}else null==a&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=function(t,e,n,i,o,a,c,s,l){var u,h,d,f=n.props,p=e.props,v=e.type,m=0;if("svg"===v&&(o=!0),null!=a)for(;m<a.length;m++)if((u=a[m])&&"setAttribute"in u==!!v&&(v?u.localName===v:3===u.nodeType)){t=u,a[m]=null;break}if(null==t){if(null===v)return document.createTextNode(p);t=o?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,p.is&&p),a=null,s=!1}if(null===v)f===p||s&&t.data===p||(t.data=p);else{if(a=a&&r.call(t.childNodes),h=(f=n.props||C).dangerouslySetInnerHTML,d=p.dangerouslySetInnerHTML,!s){if(null!=a)for(f={},m=0;m<t.attributes.length;m++)f[t.attributes[m].name]=t.attributes[m].value;(d||h)&&(d&&(h&&d.__html==h.__html||d.__html===t.innerHTML)||(t.innerHTML=d&&d.__html||""))}if(function(t,e,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in e||V(t,o,null,n[o],i);for(o in e)r&&"function"!=typeof e[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===e[o]||V(t,o,e[o],n[o],i)}(t,p,f,o,s),d)e.__k=[];else if(H(t,T(m=e.props.children)?m:[m],e,n,i,o&&"foreignObject"!==v,a,c,a?a[0]:n.__k&&D(n,0),s,l),null!=a)for(m=a.length;m--;)null!=a[m]&&A(a[m]);s||("value"in p&&void 0!==(m=p.value)&&(m!==t.value||"progress"===v&&!m||"option"===v&&m!==f.value)&&V(t,"value",m,f.value,!1),"checked"in p&&void 0!==(m=p.checked)&&m!==t.checked&&V(t,"checked",m,f.checked,!1))}return t}(n.__e,e,n,i,o,a,c,u,h);(d=l.diffed)&&d(e)}function X(t,e,n){for(var i=0;i<n.length;i++)G(n[i],n[++i],n[++i]);l.__c&&l.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){l.__e(t,e.__v)}}))}function G(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){l.__e(t,n)}}function J(t,e,n){var i,r;if(l.unmount&&l.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||G(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){l.__e(t,e)}i.base=i.__P=null,t.__c=void 0}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&J(i[r],e,n||"function"!=typeof t.type);n||null==t.__e||A(t.__e),t.__=t.__e=t.__d=void 0}function Z(t,e,n){return this.constructor(t,n)}function K(t,e,n){var i,o,a,c;l.__&&l.__(t,e),o=(i="function"==typeof n)?null:n&&n.__k||e.__k,a=[],c=[],$(e,t=(!i&&n||e).__k=M(z,null,[t]),o||C,C,void 0!==e.ownerSVGElement,!i&&n?[n]:o?null:e.firstChild?r.call(e.childNodes):null,a,!i&&n?n:o?o.__e:e.firstChild,i,c),X(a,t,c)}r=N.slice,l={__e:function(t,e,n,i){for(var r,o,a;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(t)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,i||{}),a=r.__d),a)return r.__E=r}catch(e){t=e}throw t}},d=0,m=function(t){return null!=t&&void 0===t.constructor},L.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=S({},this.state),"function"==typeof t&&(t=t(S({},n),this.props)),t&&S(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),P(this))},L.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),P(this))},L.prototype.render=z,y=[],w="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,k=function(t,e){return t.__v.__b-e.__v.__b},B.__r=0,x=0;function Q(t,e,n,i,r){var o="".concat(t,"-").concat(e);return n&&(o+="-".concat(n)),i&&(o+="__".concat(i)),r&&(o+="--".concat(r)),o}var tt=function(){function t(e,n){v(this,t),g(this,"namespace",void 0),this.block=e,this.namespace=n||"ibiz"}return _(t,[{key:"b",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Q(this.namespace,this.block,t,"","")}},{key:"e",value:function(t){return t?Q(this.namespace,this.block,"",t,""):""}},{key:"m",value:function(t){return t?Q(this.namespace,this.block,"","",t):""}},{key:"be",value:function(t,e){return t&&e?Q(this.namespace,this.block,t,e,""):""}},{key:"em",value:function(t,e){return t&&e?Q(this.namespace,this.block,"",t,e):""}},{key:"bm",value:function(t,e){return t&&e?Q(this.namespace,this.block,t,"",e):""}},{key:"bem",value:function(t,e,n){return t&&e&&n?Q(this.namespace,this.block,t,e,n):""}},{key:"is",value:function(t,e){return t&&e?"".concat("is-").concat(t):""}},{key:"cssVar",value:function(t){var e={};for(var n in t)t[n]&&(e[this.cssVarName(n)]=t[n]);return e}},{key:"cssVarBlock",value:function(t){var e={};for(var n in t)t[n]&&(e[this.cssVarBlockName(n)]=t[n]);return e}},{key:"cssVarName",value:function(t){return"--".concat(this.namespace,"-").concat(t)}},{key:"cssVarBlockName",value:function(t){return"--".concat(this.namespace,"-").concat(this.block,"-").concat(t)}}]),t}();function et(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function nt(t,e){for(var n,i="",r=0,o=-1,a=0,c=0;c<=t.length;++c){if(c<t.length)n=t.charCodeAt(c);else{if(47===n)break;n=47}if(47===n){if(o===c-1||1===a);else if(o!==c-1&&2===a){if(i.length<2||2!==r||46!==i.charCodeAt(i.length-1)||46!==i.charCodeAt(i.length-2))if(i.length>2){var s=i.lastIndexOf("/");if(s!==i.length-1){-1===s?(i="",r=0):r=(i=i.slice(0,s)).length-1-i.lastIndexOf("/"),o=c,a=0;continue}}else if(2===i.length||1===i.length){i="",r=0,o=c,a=0;continue}e&&(i.length>0?i+="/..":i="..",r=2)}else i.length>0?i+="/"+t.slice(o+1,c):i=t.slice(o+1,c),r=c-o-1;o=c,a=0}else 46===n&&-1!==a?++a:a=-1}return i}var it={resolve:function(){for(var t,e="",n=!1,i=arguments.length-1;i>=-1&&!n;i--){var r;i>=0?r=arguments[i]:(void 0===t&&(t=process.cwd()),r=t),et(r),0!==r.length&&(e=r+"/"+e,n=47===r.charCodeAt(0))}return e=nt(e,!n),n?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(et(t),0===t.length)return".";var e=47===t.charCodeAt(0),n=47===t.charCodeAt(t.length-1);return 0!==(t=nt(t,!e)).length||e||(t="."),t.length>0&&n&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return et(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var n=arguments[e];et(n),n.length>0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":it.normalize(t)},relative:function(t,e){if(et(t),et(e),t===e)return"";if((t=it.resolve(t))===(e=it.resolve(e)))return"";for(var n=1;n<t.length&&47===t.charCodeAt(n);++n);for(var i=t.length,r=i-n,o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var a=e.length-o,c=r<a?r:a,s=-1,l=0;l<=c;++l){if(l===c){if(a>c){if(47===e.charCodeAt(o+l))return e.slice(o+l+1);if(0===l)return e.slice(o+l)}else r>c&&(47===t.charCodeAt(n+l)?s=l:0===l&&(s=0));break}var u=t.charCodeAt(n+l);if(u!==e.charCodeAt(o+l))break;47===u&&(s=l)}var h="";for(l=n+s+1;l<=i;++l)l!==i&&47!==t.charCodeAt(l)||(0===h.length?h+="..":h+="/..");return h.length>0?h+e.slice(o+s):(o+=s,47===e.charCodeAt(o)&&++o,e.slice(o))},_makeLong:function(t){return t},dirname:function(t){if(et(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,i=-1,r=!0,o=t.length-1;o>=1;--o)if(47===(e=t.charCodeAt(o))){if(!r){i=o;break}}else r=!1;return-1===i?n?"/":".":n&&1===i?"//":t.slice(0,i)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');et(t);var n,i=0,r=-1,o=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,c=-1;for(n=t.length-1;n>=0;--n){var s=t.charCodeAt(n);if(47===s){if(!o){i=n+1;break}}else-1===c&&(o=!1,c=n+1),a>=0&&(s===e.charCodeAt(a)?-1==--a&&(r=n):(a=-1,r=c))}return i===r?r=c:-1===r&&(r=t.length),t.slice(i,r)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!o){i=n+1;break}}else-1===r&&(o=!1,r=n+1);return-1===r?"":t.slice(i,r)},extname:function(t){et(t);for(var e=-1,n=0,i=-1,r=!0,o=0,a=t.length-1;a>=0;--a){var c=t.charCodeAt(a);if(47!==c)-1===i&&(r=!1,i=a+1),46===c?-1===e?e=a:1!==o&&(o=1):-1!==e&&(o=-1);else if(!r){n=a+1;break}}return-1===e||-1===i||0===o||1===o&&e===i-1&&e===n+1?"":t.slice(e,i)},format:function(t){if(null===t||"object"!==p(t))throw new TypeError('The "pathObject" argument must be of type Object. Received type '+p(t));return function(t,e){var n=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return n?n===e.root?n+i:n+t+i:i}("/",t)},parse:function(t){et(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,i=t.charCodeAt(0),r=47===i;r?(e.root="/",n=1):n=0;for(var o=-1,a=0,c=-1,s=!0,l=t.length-1,u=0;l>=n;--l)if(47!==(i=t.charCodeAt(l)))-1===c&&(s=!1,c=l+1),46===i?-1===o?o=l:1!==u&&(u=1):-1!==o&&(u=-1);else if(!s){a=l+1;break}return-1===o||-1===c||0===u||1===u&&o===c-1&&o===a+1?-1!==c&&(e.base=e.name=0===a&&r?t.slice(1,c):t.slice(a,c)):(0===a&&r?(e.name=t.slice(1,o),e.base=t.slice(1,c)):(e.name=t.slice(a,o),e.base=t.slice(a,c)),e.ext=t.slice(o,c)),a>0?e.dir=t.slice(0,a-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};function rt(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function ot(){return"".concat(rt()+rt(),"-").concat(rt(),"-").concat(rt(),"-").concat(rt(),"-").concat(rt()).concat(rt()).concat(rt())}it.posix=it;var at=function(){function t(){v(this,t)}return _(t,null,[{key:"copy",value:function(t){return this.inputElement||(this.inputElement=document.createElement("input"),this.inputElement.style.position="absolute",this.inputElement.style.left="-9999px",document.body.appendChild(this.inputElement)),this.inputElement.value=t,this.inputElement.select(),document.execCommand("copy")}}]),t}();g(at,"inputElement",null);var ct=function(){function t(){v(this,t)}var e,n,i,r,o,a,c,s,l,u;return _(t,null,[{key:"checkDataBaseExists",value:(u=f(h().mark((function t(e){var n;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,indexedDB.databases();case 3:return n=t.sent,t.abrupt("return",n.some((function(t){return t.name===e})));case 7:return t.prev=7,t.t0=t.catch(0),console.error("检查数据库是否存在时出错:",t.t0),t.abrupt("return",!1);case 11:case"end":return t.stop()}}),t,null,[[0,7]])}))),function(t){return u.apply(this,arguments)})},{key:"deleteDatabase",value:(l=f(h().mark((function e(n){var i,r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.lastLink&&(null===(i=(r=t.lastLink).close)||void 0===i||i.call(r)),e.abrupt("return",new Promise((function(t,e){var i=indexedDB.deleteDatabase(n);i.onsuccess=function(){t(!0)},i.onerror=function(){t(!1)},i.onblocked=function(){console.warn("删除数据库 ".concat(n," 被阻塞,可能有其他连接正在使用该数据库。")),e(new Error("删除数据库 ".concat(n," 被阻塞")))}})));case 2:case"end":return e.stop()}}),e)}))),function(t){return l.apply(this,arguments)})},{key:"checkTableExists",value:(s=f(h().mark((function e(n,i){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.checkDataBaseExists(n);case 2:if(e.sent){e.next=5;break}return e.abrupt("return",!1);case 5:return e.abrupt("return",new Promise((function(e,r){var o=indexedDB.open(n);o.onupgradeneeded=function(e){t.db=e.target.result,t.version=t.db.version},o.onsuccess=function(n){t.db=n.target.result,t.lastLink=o.result;var r=t.db.objectStoreNames.contains(i);o.result.close(),e(r)},o.onerror=function(t){r(t.target.error)}})));case 6:case"end":return e.stop()}}),e)}))),function(t,e){return s.apply(this,arguments)})},{key:"createTable",value:(c=f(h().mark((function e(n,i,r){var o,a=arguments;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=a.length>3&&void 0!==a[3]&&a[3],e.abrupt("return",new Promise((function(e){var a,c;t.version+=1,t.lastLink&&(null===(a=(c=t.lastLink).close)||void 0===a||a.call(c));var s=indexedDB.open(n,t.version);s.onupgradeneeded=function(e){if(t.db=e.target.result,!t.db.objectStoreNames.contains(i)){var n={};r?n.keyPath=r:o&&(n.autoIncrement=!0),t.db.createObjectStore(i,n)}},s.onsuccess=function(){t.lastLink=s.result,s.result.close(),e(!0)},s.onerror=function(){e(!1)}})));case 2:case"end":return e.stop()}}),e)}))),function(t,e,n){return c.apply(this,arguments)})},{key:"deleteTable",value:(a=f(h().mark((function e(n,i){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var r,o;t.version+=1,t.lastLink&&(null===(r=(o=t.lastLink).close)||void 0===r||r.call(o));var a=indexedDB.open(n,t.version);a.onupgradeneeded=function(e){t.db=e.target.result,t.lastLink=a.result,t.db.objectStoreNames.contains(i)&&t.db.deleteObjectStore(i)},a.onsuccess=function(n){t.db=n.target.result,t.lastLink=a.result,a.result.close(),e(!0)},a.onerror=function(){a.result.close(),e(!1)}})));case 1:case"end":return e.stop()}}),e)}))),function(t,e){return a.apply(this,arguments)})},{key:"addData",value:(o=f(h().mark((function e(n,i,r){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=indexedDB.open(n);a.onsuccess=function(n){if(t.db=n.target.result,t.lastLink=a.result,t.db.objectStoreNames.contains(i)){var o=t.db.transaction([i],"readwrite").objectStore(i).add(r);o.onsuccess=function(t){e(r)},o.onerror=function(){e(null)}}a.result.close()},a.onerror=function(){a.result.close(),o()}})));case 1:case"end":return e.stop()}}),e)}))),function(t,e,n){return o.apply(this,arguments)})},{key:"deleteData",value:(r=f(h().mark((function e(n,i,r){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=indexedDB.open(n);a.onsuccess=function(n){if(t.db=n.target.result,t.lastLink=a.result,t.db.objectStoreNames.contains(i)){var o=t.db.transaction([i],"readwrite").objectStore(i).delete(r);o.onsuccess=function(t){e(!0)},o.onerror=function(){e(!1)}}a.result.close()},a.onerror=function(){a.result.close(),o()}})));case 1:case"end":return e.stop()}}),e)}))),function(t,e,n){return r.apply(this,arguments)})},{key:"updateData",value:(i=f(h().mark((function e(n,i,r){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=indexedDB.open(n);a.onsuccess=function(n){if(t.db=n.target.result,t.lastLink=a.result,t.db.objectStoreNames.contains(i)){var o=t.db.transaction([i],"readwrite").objectStore(i).put(r);o.onsuccess=function(t){e(r)},o.onerror=function(){e(r)}}a.result.close()},a.onerror=function(){a.result.close(),o()}})));case 1:case"end":return e.stop()}}),e)}))),function(t,e,n){return i.apply(this,arguments)})},{key:"getData",value:(n=f(h().mark((function e(n,i,r){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=indexedDB.open(n);a.onsuccess=function(n){if(t.db=n.target.result,t.lastLink=a.result,t.db.objectStoreNames.contains(i)){var c=t.db.transaction([i],"readonly").objectStore(i).get(r);c.onsuccess=function(t){e(c.result)},c.onerror=function(){o(new Error("未找到数据".concat(r)))}}a.result.close()},a.onerror=function(){a.result.close(),o()}})));case 1:case"end":return e.stop()}}),e)}))),function(t,e,i){return n.apply(this,arguments)})},{key:"getAllData",value:(e=f(h().mark((function e(n,i){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var o=indexedDB.open(n);o.onsuccess=function(n){if(t.db=n.target.result,t.lastLink=o.result,t.db.objectStoreNames.contains(i)){var r=t.db.transaction([i],"readonly").objectStore(i).getAll();r.onsuccess=function(t){e(r.result)},r.onerror=function(){e([])}}o.result.close()},o.onerror=function(){o.result.close(),r()}})));case 1:case"end":return e.stop()}}),e)}))),function(t,n){return e.apply(this,arguments)})}]),t}();g(ct,"version",1),g(ct,"db",null),g(ct,"lastLink",void 0);var st,lt,ut,ht,dt=function(){function t(e){v(this,t),g(this,"options",void 0),this.options=u({multiple:!0,accept:"*/*",maxSize:5242880},e)}var e,n;return _(t,[{key:"openFilePicker",value:function(){var t=this,e=document.createElement("input");e.type="file",e.multiple=this.options.multiple,e.accept=this.options.accept||"",e.onchange=function(e){var n=Array.from(e.target.files||[]);t.handleFiles(n)},e.click()}},{key:"handleFiles",value:(n=f(h().mark((function t(e){var n,i,r,o=this;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==e.length){t.next=2;break}return t.abrupt("return");case 2:return r=e.filter((function(t){var e,n;return!(o.options.maxSize&&t.size>o.options.maxSize&&(null===(e=(n=o.options).onError)||void 0===e||e.call(n,new Error("文件大小超过限制 (".concat(o.formatSize(t.size)," > ").concat(o.formatSize(o.options.maxSize),")")),t),1))})),null===(n=(i=this.options).onSelect)||void 0===n||n.call(i,r),t.next=6,Promise.all(r.map((function(t){return o.processFile(t)})));case 6:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"processFile",value:(e=f(h().mark((function t(e){var n,i,r,o,a,c,s,l,u=this;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,a=function(t){var n,i;null===(n=(i=u.options).onProgress)||void 0===n||n.call(i,e,t)},t.next=4,this.options.onUpload(e,a);case 4:c=t.sent,null===(n=(i=this.options).onProgress)||void 0===n||n.call(i,e,100),null===(r=(o=this.options).onSuccess)||void 0===r||r.call(o,c,e),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),null===(s=(l=this.options).onError)||void 0===s||s.call(l,t.t0 instanceof Error?t.t0:new Error("上传失败"),e);case 12:case"end":return t.stop()}}),t,this,[[0,9]])}))),function(t){return e.apply(this,arguments)})},{key:"formatSize",value:function(t){if(0===t)return"0 B";var e=Math.floor(Math.log(t)/Math.log(1024));return"".concat((t/Math.pow(1024,e)).toFixed(2)," ").concat(["B","KB","MB","GB"][e])}}]),t}(),ft=function(){function t(){v(this,t)}return _(t,null,[{key:"getCdataContent",value:function(t){if(!t)return null;var e=Array.from(t.childNodes).find((function(t){return t.nodeType===t.CDATA_SECTION_NODE}));return(null==e?void 0:e.nodeValue)||t.textContent}},{key:"parse",value:function(t){var e=this,n=(new DOMParser).parseFromString(t,"text/xml");return Array.from(n.querySelectorAll("resource")).map((function(t){var n=t.getAttribute("type")||"",i=t.querySelector("data"),r=t.querySelector("metadata");try{var o=e.getCdataContent(i),a=e.getCdataContent(r),c=o?JSON.parse(o):{},s=a?JSON.parse(a):{};return{id:c.id,type:n,data:c,metadata:s}}catch(Dn){throw new Error("XML 解析错误: ".concat(Dn.message))}}))}},{key:"parseMixedContent",value:function(t){var e=/<resources\b[^>]*>[\s\S]*?<\/resources>/i.exec(t);if(!e)return{resources:[],remainingText:t,hasResources:!1};var n=a(e,1)[0],i=e.index,r=i+n.length,o=(t.slice(0,i)+t.slice(r)).replace(/\n/g,"");try{return{resources:this.parse(n),remainingText:o,hasResources:!0}}catch(c){return{resources:[],remainingText:o,hasResources:!0,error:"资源解析失败: ".concat(c.message)}}}},{key:"stringify",value:function(t){var e=document.implementation.createDocument(null,null,null),n=e.createElement("resources");n.setAttribute("version","1.0");var i=function(t){return"\n".concat(" ".repeat(t))};return t.forEach((function(t){n.appendChild(e.createTextNode(i(1)));var r=e.createElement("resource");r.setAttribute("type",t.type),r.setAttribute("version","1.0");var o=function(t,n){var r=e.createElement(t);r.appendChild(e.createTextNode(i(2)));var o=e.createCDATASection(JSON.stringify(n));return r.appendChild(o),r.appendChild(e.createTextNode(i(1))),r};r.appendChild(e.createTextNode(i(2))),r.appendChild(o("data",t.data)),r.appendChild(e.createTextNode(i(2))),r.appendChild(o("metadata",t.metadata)),r.appendChild(e.createTextNode(i(1))),n.appendChild(r)})),n.appendChild(e.createTextNode("\n")),e.appendChild(n),(new XMLSerializer).serializeToString(e).replace(/></g,">\n<")}}]),t}(),pt=0,vt=[],mt=[],_t=l.__b,gt=l.__r,yt=l.diffed,bt=l.__c,wt=l.unmount;function kt(t,e){l.__h&&l.__h(lt,t,pt||e),pt=0;var n=lt.__H||(lt.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({__V:mt}),n.__[t]}function xt(t){return pt=1,function(t,e,n){var i=kt(st++,2);if(i.t=t,!i.__c&&(i.__=[n?n(e):It(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],n=i.t(e,t);e!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=lt,!lt.u)){var r=function(t,e,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(t){return t.__c}));if(r.every((function(t){return!t.__N})))return!o||o.call(this,t,e,n);var a=!1;return r.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(a=!0)}})),!(!a&&i.__c.props===t)&&(!o||o.call(this,t,e,n))};lt.u=!0;var o=lt.shouldComponentUpdate,a=lt.componentWillUpdate;lt.componentWillUpdate=function(t,e,n){if(this.__e){var i=o;o=void 0,r(t,e,n),o=i}a&&a.call(this,t,e,n)},lt.shouldComponentUpdate=r}return i.__N||i.__}(It,t)}function Ct(t,e){var n=kt(st++,3);!l.__s&&Dt(n.__H,e)&&(n.__=t,n.i=e,lt.__H.__h.push(n))}function Nt(t){return pt=5,Et((function(){return{current:t}}),[])}function Et(t,e){var n=kt(st++,7);return Dt(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function Tt(t,e){return pt=8,Et((function(){return t}),e)}function St(t){var e=lt.context[t.__c],n=kt(st++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(lt)),e.props.value):t.__}function At(){for(var t;t=vt.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(zt),t.__H.__h.forEach(Lt),t.__H.__h=[]}catch(Bn){t.__H.__h=[],l.__e(Bn,t.__v)}}l.__b=function(t){lt=null,_t&&_t(t)},l.__r=function(t){gt&&gt(t),st=0;var e=(lt=t.__c).__H;e&&(ut===lt?(e.__h=[],lt.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=mt,t.__N=t.i=void 0}))):(e.__h.forEach(zt),e.__h.forEach(Lt),e.__h=[],st=0)),ut=lt},l.diffed=function(t){yt&&yt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==vt.push(e)&&ht===l.requestAnimationFrame||((ht=l.requestAnimationFrame)||Ot)(At)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==mt&&(t.__=t.__V),t.i=void 0,t.__V=mt}))),ut=lt=null},l.__c=function(t,e){e.some((function(t){try{t.__h.forEach(zt),t.__h=t.__h.filter((function(t){return!t.__||Lt(t)}))}catch(qt){e.some((function(t){t.__h&&(t.__h=[])})),e=[],l.__e(qt,t.__v)}})),bt&&bt(t,e)},l.unmount=function(t){wt&&wt(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{zt(t)}catch(t){e=t}})),n.__H=void 0,e&&l.__e(e,n.__v))};var Mt="function"==typeof requestAnimationFrame;function Ot(t){var e,n=function(){clearTimeout(i),Mt&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);Mt&&(e=requestAnimationFrame(n))}function zt(t){var e=lt,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),lt=e}function Lt(t){var e=lt;t.__c=t.__(),lt=e}function Dt(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function It(t,e){return"function"==typeof e?e(t):e}function Pt(){throw new Error("Cycle detected")}var Bt=Symbol.for("preact-signals");function Ht(){if(Wt>1)Wt--;else{for(var t,e=!1;void 0!==Ut;){var n=Ut;for(Ut=void 0,Vt++;void 0!==n;){var i=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Gt(n))try{n.c()}catch(n){e||(t=n,e=!0)}n=i}}if(Vt=0,Wt--,e)throw t}}var jt,Ft,Rt=void 0,Ut=void 0,Wt=0,Vt=0,qt=0;function Yt(t){if(void 0!==Rt){var e=t.n;if(void 0===e||e.t!==Rt)return e={i:0,S:t,p:Rt.s,n:void 0,t:Rt,e:void 0,x:void 0,r:e},void 0!==Rt.s&&(Rt.s.n=e),Rt.s=e,t.n=e,32&Rt.f&&t.S(e),e;if(-1===e.i)return e.i=0,void 0!==e.n&&(e.n.p=e.p,void 0!==e.p&&(e.p.n=e.n),e.p=Rt.s,e.n=void 0,Rt.s.n=e,Rt.s=e),e}}function $t(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}function Xt(t){return new $t(t)}function Gt(t){for(var e=t.s;void 0!==e;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function Jt(t){for(var e=t.s;void 0!==e;e=e.n){var n=e.S.n;if(void 0!==n&&(e.r=n),e.S.n=e,e.i=-1,void 0===e.n){t.s=e;break}}}function Zt(t){for(var e=t.s,n=void 0;void 0!==e;){var i=e.p;-1===e.i?(e.S.U(e),void 0!==i&&(i.n=e.n),void 0!==e.n&&(e.n.p=i)):n=e,e.S.n=e.r,void 0!==e.r&&(e.r=void 0),e=i}t.s=n}function Kt(t){$t.call(this,void 0),this.x=t,this.s=void 0,this.g=qt-1,this.f=4}function Qt(t){return new Kt(t)}function te(t){var e=t.u;if(t.u=void 0,"function"==typeof e){Wt++;var n=Rt;Rt=void 0;try{e()}catch(e){throw t.f&=-2,t.f|=8,ee(t),e}finally{Rt=n,Ht()}}}function ee(t){for(var e=t.s;void 0!==e;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,te(t)}function ne(t){if(Rt!==this)throw new Error("Out-of-order effect");Zt(this),Rt=t,this.f&=-2,8&this.f&&ee(this),Ht()}function ie(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function re(t){var e=new ie(t);try{e.c()}catch(t){throw e.d(),t}return e.d.bind(e)}function oe(t,e){l[t]=e.bind(null,l[t]||function(){})}function ae(t){Ft&&Ft(),Ft=t&&t.S()}function ce(t){var e=this,n=t.data,i=le(n);i.value=n;var r=Et((function(){for(var t=e.__v;t=t.__;)if(t.__c){t.__c.__$f|=4;break}return e.__$u.c=function(){var t;m(r.peek())||3!==(null==(t=e.base)?void 0:t.nodeType)?(e.__$f|=1,e.setState({})):e.base.data=r.peek()},Qt((function(){var t=i.value.value;return 0===t?0:!0===t?"":t||""}))}),[]);return r.value}function se(t,e,n,i){var r=e in t&&void 0===t.ownerSVGElement,o=Xt(n);return{o:function(t,e){o.value=t,i=e},d:re((function(){var n=o.value.value;i[e]!==n&&(i[e]=n,r?t[e]=n:n?t.setAttribute(e,n):t.removeAttribute(e))}))}}function le(t){return Et((function(){return Xt(t)}),[])}function ue(t){var e=Nt(t);return e.current=t,jt.__$f|=4,Et((function(){return Qt((function(){return e.current()}))}),[])}$t.prototype.brand=Bt,$t.prototype.h=function(){return!0},$t.prototype.S=function(t){this.t!==t&&void 0===t.e&&(t.x=this.t,void 0!==this.t&&(this.t.e=t),this.t=t)},$t.prototype.U=function(t){if(void 0!==this.t){var e=t.e,n=t.x;void 0!==e&&(e.x=n,t.e=void 0),void 0!==n&&(n.e=e,t.x=void 0),t===this.t&&(this.t=n)}},$t.prototype.subscribe=function(t){var e=this;return re((function(){var n=e.value,i=32&this.f;this.f&=-33;try{t(n)}finally{this.f|=i}}))},$t.prototype.valueOf=function(){return this.value},$t.prototype.toString=function(){return this.value+""},$t.prototype.toJSON=function(){return this.value},$t.prototype.peek=function(){return this.v},Object.defineProperty($t.prototype,"value",{get:function(){var t=Yt(this);return void 0!==t&&(t.i=this.i),this.v},set:function(t){if(Rt instanceof Kt&&function(){throw new Error("Computed cannot have side-effects")}(),t!==this.v){Vt>100&&Pt(),this.v=t,this.i++,qt++,Wt++;try{for(var e=this.t;void 0!==e;e=e.x)e.t.N()}finally{Ht()}}}}),(Kt.prototype=new $t).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===qt)return!0;if(this.g=qt,this.f|=1,this.i>0&&!Gt(this))return this.f&=-2,!0;var t=Rt;try{Jt(this),Rt=this;var e=this.x();(16&this.f||this.v!==e||0===this.i)&&(this.v=e,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return Rt=t,Zt(this),this.f&=-2,!0},Kt.prototype.S=function(t){if(void 0===this.t){this.f|=36;for(var e=this.s;void 0!==e;e=e.n)e.S.S(e)}$t.prototype.S.call(this,t)},Kt.prototype.U=function(t){if(void 0!==this.t&&($t.prototype.U.call(this,t),void 0===this.t)){this.f&=-33;for(var e=this.s;void 0!==e;e=e.n)e.S.U(e)}},Kt.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;void 0!==t;t=t.x)t.t.N()}},Kt.prototype.peek=function(){if(this.h()||Pt(),16&this.f)throw this.v;return this.v},Object.defineProperty(Kt.prototype,"value",{get:function(){1&this.f&&Pt();var t=Yt(this);if(this.h(),void 0!==t&&(t.i=this.i),16&this.f)throw this.v;return this.v}}),ie.prototype.c=function(){var t=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var e=this.x();"function"==typeof e&&(this.u=e)}finally{t()}},ie.prototype.S=function(){1&this.f&&Pt(),this.f|=1,this.f&=-9,te(this),Jt(this),Wt++;var t=Rt;return Rt=this,ne.bind(this,t)},ie.prototype.N=function(){2&this.f||(this.f|=2,this.o=Ut,Ut=this)},ie.prototype.d=function(){this.f|=8,1&this.f||ee(this)},ce.displayName="_st",Object.defineProperties($t.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:ce},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),oe("__b",(function(t,e){if("string"==typeof e.type){var n,i=e.props;for(var r in i)if("children"!==r){var o=i[r];o instanceof $t&&(n||(e.__np=n={}),n[r]=o,i[r]=o.peek())}}t(e)})),oe("__r",(function(t,e){ae();var n,i=e.__c;i&&(i.__$f&=-2,void 0===(n=i.__$u)&&(i.__$u=n=function(t){var e;return re((function(){e=this})),e.c=function(){i.__$f|=1,i.setState({})},e}())),jt=i,ae(n),t(e)})),oe("__e",(function(t,e,n,i){ae(),jt=void 0,t(e,n,i)})),oe("diffed",(function(t,e){var n;if(ae(),jt=void 0,"string"==typeof e.type&&(n=e.__e)){var i=e.__np,r=e.props;if(i){var o=n.U;if(o)for(var a in o){var c=o[a];void 0===c||a in i||(c.d(),o[a]=void 0)}else n.U=o={};for(var s in i){var l=o[s],u=i[s];void 0===l?(l=se(n,s,u,r),o[s]=l):l.o(u,r)}}}t(e)})),oe("unmount",(function(t,e){if("string"==typeof e.type){var n=e.__e;if(n){var i=n.U;if(i)for(var r in n.U=void 0,i){var o=i[r];o&&o.d()}}}else{var a=e.__c;if(a){var c=a.__$u;c&&(a.__$u=void 0,c.d())}}t(e)})),oe("__h",(function(t,e,n,i){(i<3||9===i)&&(e.__$f|=2),t(e,n,i)})),L.prototype.shouldComponentUpdate=function(t,e){var n=this.__$u;if(!(n&&void 0!==n.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var i in e)return!0;for(var r in t)if("__source"!==r&&t[r]!==this.props[r])return!0;for(var o in this.props)if(!(o in t))return!0;return!1};var he=0;function de(t,e,n,i,r,o){var a,c,s={};for(c in e)"ref"==c?a=e[c]:s[c]=e[c];var u={type:t,props:s,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--he,__source:r,__self:o};if("function"==typeof t&&(a=t.defaultProps))for(c in a)void 0===s[c]&&(s[c]=a[c]);return l.vnode&&l.vnode(u),u}var fe=function(){return de("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:de("path",{d:"M843.904 783.573333 783.573333 843.904 512.042667 572.373333 240.512 843.904 180.181333 783.573333 451.712 512.042667 180.181333 240.512 240.512 180.181333 512.042667 451.712 783.573333 180.181333 843.904 240.512 572.373333 512.042667 843.904 783.573333Z"})})},pe=function(){return de("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:de("path",{d:"M900.64 379.808l-263.072-256.032c-36.448-35.328-105.76-35.392-142.304 0.096l-327.04 319.904c-56.416 54.72-70.72 76.704-70.72 150.976l0 143.936c0 132.768 26.976 192 186.912 192l131.872 0c81.12 0 128.448-46.656 193.952-111.264l290.016-297.696c18.592-17.984 29.248-43.968 29.248-71.264C929.504 423.36 918.976 397.6 900.64 379.808zM323.008 786.752c-52.928 0-96-43.072-96-96s43.072-96 96-96 96 43.072 96 96S375.936 786.752 323.008 786.752z"})})},ve=function(t){return de("svg",{viewBox:"0 0 1024 1024",id:"send",className:t.className,version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:de("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-0.9 3.7-0.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 0.7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-0.8 4.2-2.6 5-5 1.4-4.2-0.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})})},me=function(){return de("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:de("path",{d:"M962 197.61H747v-60c0-55.14-44.86-100-100-100H377c-55.14 0-100 44.86-100 100v60H62c-11.05 0-20 8.95-20 20s8.95 20 20 20h60v630.57c0 66.17 53.83 120 120 120h540c66.17 0 120-53.83 120-120V237.61h60c11.05 0 20-8.95 20-20s-8.95-20-20-20zM637.34 457.66v260c0 12.01-10.72 21.63-23.06 19.77-9.84-1.48-16.94-10.25-16.94-20.2V458.09c0-9.95 7.1-18.72 16.94-20.2 12.34-1.86 23.06 7.76 23.06 19.77z m-210.68 0v260c0 11-9 20-20 20s-20-9-20-20v-260c0-11 9-20 20-20s20 9 20 20zM317 137.61c0-33.08 26.92-60 60-60h270c33.08 0 60 26.92 60 60v60H317v-60z"})})},_e=function(){return de("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:de("path",{d:"M511.582491 63.413262C265.134543 63.413262 64.62588 263.921925 64.62588 510.369873s200.508663 446.957635 446.957635 446.957635 446.957635-200.508663 446.957635-446.957635S758.031463 63.413262 511.582491 63.413262zM509.001713 751.859903c-98.517781 0-182.467775-62.623269-214.771505-150.056598l0.327458-0.134053c-2.007727-4.036943-3.38305-8.422833-3.38305-13.237489 0-16.647145 13.494339-30.142507 30.142507-30.142507 13.389962 0 24.358781 8.877181 28.2893 20.955264l0.422625-0.172939c23.269983 65.442478 85.645612 112.503307 158.972665 112.503307 93.106538 0 168.845523-75.738985 168.845523-168.845523s-75.738985-168.845523-168.845523-168.845523c-20.432355 0-39.874149 3.980661-58.013275 10.66899l21.248953 40.742936c2.486634 2.677992 4.0175 6.2831 4.0175 10.243295 0 8.417717-8.404414 14.921851-15.365966 15.07023-0.102331 0-0.206708 0-0.309038 0-0.220011 0-0.427742 0-0.647753-0.013303l-150.579507-6.463202c-5.372358-0.234337-10.229992-3.310396-12.716626-8.093329-2.486634-4.76963-2.236947-10.509355 0.647753-15.055904l80.890308-127.179564c2.8847-4.533246 8.006348-7.151887 13.365402-6.960529 5.372358 0.234337 10.227945 3.312442 12.71458 8.095375l18.580171 35.625382c26.629497-10.855232 55.683207-16.963347 86.168522-16.963347 126.338407 0 229.130537 102.791108 229.130537 229.130537S635.340119 751.859903 509.001713 751.859903z"})})},ge=function(){return de("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:de("path",{d:"M891.072 822.144V167.36a34.432 34.432 0 0 0-34.432-34.432H201.856C201.856 94.848 232.704 64 270.784 64h620.288C929.152 64 960 94.848 960 132.928v620.288c0 38.08-30.848 68.928-68.928 68.928z m-68.928-551.36v620.288c0 38.08-30.848 68.928-68.928 68.928H132.928A68.928 68.928 0 0 1 64 891.072V270.784c0-38.08 30.848-68.928 68.928-68.928h620.288c38.08 0 68.928 30.848 68.928 68.928z m-137.856 137.856H201.856a34.432 34.432 0 0 0 0 68.864h482.432a34.432 34.432 0 0 0 0-68.864z m0 206.72H201.856a34.432 34.432 0 0 0 0 68.864h482.432a34.432 34.432 0 0 0 0-68.864z"})})},ye=function(){return de("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:de("path",{d:"M547.4 197.4v46l200.3 0.1L546.1 444l32.4 32.6 201.9-200.7v200.9h46V197.5zM471.4 584.4l-32.6-32.6L243.6 747V547.9h-46v278.7h279v-46H275z"})})},be=function(){return de("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:de("path",{d:"M544 480V282.944h52.224l0.064 107.968L763.072 224l36.928 36.928-166.976 166.976 108.032-0.128V480H544zM260.928 800l-36.928-36.928 166.912-166.784-107.968-0.064V544H480v197.056h-52.224l0.064-107.968L260.928 800z"})})},we=function(){return de("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:de("path",{d:"M960 544H64a32 32 0 1 1 0-64h896a32 32 0 1 1 0 64"})})},ke=function(){return de("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[de("path",{d:"M481.0752 263.3728l50.9952 1.024 1.8432-105.8816-50.9952-0.8192z"}),de("path",{d:"M486.441426 180.895362a66.56 66.56 0 1 0 42.091944-126.290153 66.56 66.56 0 1 0-42.091944 126.290153Z"}),de("path",{d:"M138.8544 664.3712c-52.8384 0-95.8464-43.008-95.8464-95.8464s43.008-95.8464 95.8464-95.8464M880.0256 472.6784c52.8384 0 95.8464 43.008 95.8464 95.8464s-43.008 95.8464-95.8464 95.8464"}),de("path",{d:"M507.4944 220.5696c-220.16 0-398.7456 162.816-398.7456 363.7248s178.5856 363.7248 398.7456 363.7248 398.7456-162.816 398.7456-363.7248-178.5856-363.7248-398.7456-363.7248z m0 559.9232c-166.2976 0-301.2608-100.5568-301.2608-224.4608s134.9632-224.4608 301.2608-224.4608S808.7552 432.128 808.7552 556.032 673.792 780.4928 507.4944 780.4928z"}),de("path",{d:"M319.6928 556.032a47.9232 38.912 90 1 0 77.824 0 47.9232 38.912 90 1 0-77.824 0Z"}),de("path",{d:"M617.472 556.032a47.9232 38.912 90 1 0 77.824 0 47.9232 38.912 90 1 0-77.824 0Z"})]})},xe=function(){return de("svg",{viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[de("path",{d:"M5.856 17.121a.979.979 0 0 1-.327-.06.839.839 0 0 1-.283-.177.739.739 0 0 1-.187-.255.724.724 0 0 1-.07-.303l-.02-1.609a4.663 4.663 0 0 1-1.446-.455 4.252 4.252 0 0 1-.637-.401c-.199-.146-.385-.31-.553-.492a4.442 4.442 0 0 1-.45-.577 4.303 4.303 0 0 1-.327-.637 3.823 3.823 0 0 1-.206-.686 3.729 3.729 0 0 1-.064-.704V6.478c0-.261.025-.516.077-.771a4.43 4.43 0 0 1 .244-.747 4.062 4.062 0 0 1 .932-1.28c.2-.183.418-.347.65-.493.23-.145.482-.267.739-.364a4.21 4.21 0 0 1 .81-.225c.27-.054.553-.078.835-.078H8.55c.103 0 .2.018.29.054a.7.7 0 0 1 .411.376.667.667 0 0 1-.161.766.736.736 0 0 1-.25.151.764.764 0 0 1-.29.055H5.573c-.186 0-.366.012-.54.049-.18.03-.353.079-.52.145-.167.061-.328.14-.482.237-.148.091-.29.2-.418.316a2.897 2.897 0 0 0-.347.388c-.097.14-.187.286-.257.444a2.473 2.473 0 0 0-.206.977v4.287c0 .17.013.333.051.503a2.549 2.549 0 0 0 .772 1.33 2.721 2.721 0 0 0 .913.559c.167.066.347.115.527.152.18.03.36.048.546.048a.904.904 0 0 1 .61.23.848.848 0 0 1 .194.262.84.84 0 0 1 .07.303l.007.99 1.915-1.293a2.877 2.877 0 0 1 1.64-.492h2.372c.186 0 .366-.018.54-.048.18-.03.353-.08.52-.146.168-.067.329-.146.483-.237.148-.091.29-.2.418-.316.128-.121.244-.249.347-.388a2.8 2.8 0 0 0 .257-.444 2.47 2.47 0 0 0 .206-.977V8.585a.646.646 0 0 1 .225-.492.679.679 0 0 1 .244-.152.814.814 0 0 1 .585 0c.09.03.174.085.244.152a.657.657 0 0 1 .225.492V10.8c0 .261-.032.516-.083.771a4.192 4.192 0 0 1-.245.74c-.109.244-.244.468-.398.687a3.735 3.735 0 0 1-.534.6c-.2.183-.418.347-.65.493a4.134 4.134 0 0 1-.738.364 4.7 4.7 0 0 1-.81.225c-.27.054-.553.079-.836.079h-1.877c-.604 0-1.144.164-1.633.491l-2.54 1.713a.913.913 0 0 1-.514.157z",fill:"currentColor"}),de("path",{d:"M15.866 4.125h-4.174c-.41 0-.741.313-.741.7 0 .387.332.7.741.7h4.174c.41 0 .742-.313.742-.7 0-.387-.332-.7-.742-.7z",fill:"currentColor"}),de("path",{d:"M14.537 2.932c0-.396-.34-.717-.759-.717s-.758.32-.758.717v3.786c0 .396.34.717.758.717.42 0 .76-.321.76-.717V2.932z",fill:"currentColor"})]})},Ce=function(){return de("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:de("path",{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"})})},Ne=function(){var t=1e3,e=140,n=250,i=.8;return de("svg",{fill:"currentColor",viewBox:"0 0 ".concat(t," ").concat(t),xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:Array.from({length:4}).map((function(t,r){return de("rect",{fill:"currentColor",rx:70,ry:70,height:n,width:e,x:286.66666666666663*r,y:375,children:[de("animate",{attributeName:"height",values:"".concat(n,"; ").concat(500,"; ").concat(n),keyTimes:"0; 0.5; 1",dur:"".concat(i,"s"),begin:"".concat(.2*r,"s"),repeatCount:"indefinite"}),de("animate",{attributeName:"y",values:"".concat(375,"; ").concat(250,"; ").concat(375),keyTimes:"0; 0.5; 1",dur:"".concat(i,"s"),begin:"".concat(.2*r,"s"),repeatCount:"indefinite"})]},r)}))})},Ee=function(t){return de("svg",{className:t.className,onClick:t.onClick,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:de("path",{d:"M128 384a128 128 0 1 1 0 256 128 128 0 0 1 0-256z m768 0a128 128 0 1 1 0 256 128 128 0 0 1 0-256z m-372.4288 0a128 128 0 1 1 0 256 128 128 0 0 1 0-256z"})})},Te=function(t){return de("svg",{className:t.className,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:de("path",{d:"M498.33984 607.8464c-10.99776-32.9728-50.09408-73.5232-82.6368-85.74976L150.9376 422.8096c-38.54336-14.4384-36.98688-69.46816 2.27328-81.73568L844.92288 124.90752c33.30048-10.40384 64.57344 20.8896 54.1696 54.1696L682.92608 870.78912a43.2128 43.2128 0 0 1-81.36704 3.25632 121682.5344 121682.5344 0 0 1-103.2192-266.19904z"})})},Se=function(t){return de("svg",{xmlns:"http://www.w3.org/2000/svg",className:t.className,viewBox:"0 0 512 512",children:de("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 184l144 144 144-144"})})},Ae=function(t){return de("svg",{xmlns:"http://www.w3.org/2000/svg",className:"".concat(t.className," icon"),viewBox:"0 0 512 512",children:de("path",{d:"M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm108.25 138.29l-134.4 160a16 16 0 01-12 5.71h-.27a16 16 0 01-11.89-5.3l-57.6-64a16 16 0 1123.78-21.4l45.29 50.32 122.59-145.91a16 16 0 0124.5 20.58z"})})},Me=function(t){return de("svg",{className:t.className,width:"16",height:"16",viewBox:"0 0 50 50",xmlns:"http://www.w3.org/2000/svg",children:de("circle",{cx:"25",cy:"25",r:"20",stroke:"currentColor",strokeWidth:"5",fill:"none",strokeDasharray:"31.415, 31.415",strokeLinecap:"round",children:de("animateTransform",{attributeName:"transform",type:"rotate",from:"0 25 25",to:"360 25 25",dur:"1s",repeatCount:"indefinite"})})})},Oe=function(){return de("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:de("path",{d:"M704 256v490.666667a170.666667 170.666667 0 0 1-170.666667 170.666666 170.666667 170.666667 0 0 1-170.666666-170.666666V213.333333A106.666667 106.666667 0 0 1 469.333333 106.666667 106.666667 106.666667 0 0 1 576 213.333333v448a42.666667 42.666667 0 0 1-42.666667 42.666667 42.666667 42.666667 0 0 1-42.666666-42.666667V256H426.666667v405.333333a106.666667 106.666667 0 0 0 106.666666 106.666667 106.666667 106.666667 0 0 0 106.666667-106.666667V213.333333a170.666667 170.666667 0 0 0-170.666667-170.666666 170.666667 170.666667 0 0 0-170.666666 170.666666v533.333334a234.666667 234.666667 0 0 0 234.666666 234.666666 234.666667 234.666667 0 0 0 234.666667-234.666666V256h-64z"})})},ze=function(){return de("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:[de("path",{d:"M842.666667 285.866667l-187.733334-187.733334c-14.933333-14.933333-32-21.333333-53.333333-21.333333H234.666667C194.133333 74.666667 160 108.8 160 149.333333v725.333334c0 40.533333 34.133333 74.666667 74.666667 74.666666h554.666666c40.533333 0 74.666667-34.133333 74.666667-74.666666V337.066667c0-19.2-8.533333-38.4-21.333333-51.2z m-44.8 44.8c-2.133333 2.133333-4.266667 0-8.533334 0h-170.666666c-6.4 0-10.666667-4.266667-10.666667-10.666667V149.333333c0-2.133333 0-6.4-2.133333-8.533333 0 0 2.133333 0 2.133333 2.133333l189.866667 187.733334z m-8.533334 554.666666H234.666667c-6.4 0-10.666667-4.266667-10.666667-10.666666V149.333333c0-6.4 4.266667-10.666667 10.666667-10.666666h311.466666c-2.133333 4.266667-2.133333 6.4-2.133333 10.666666v170.666667c0 40.533333 34.133333 74.666667 74.666667 74.666667h170.666666c4.266667 0 6.4 0 10.666667-2.133334V874.666667c0 6.4-4.266667 10.666667-10.666667 10.666666z",fill:"currentColor"}),de("path",{d:"M640 693.333333H341.333333c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h298.666667c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM640 522.666667H341.333333c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h298.666667c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM341.333333 416h85.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32h-85.333334c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32z",fill:"currentColor"})]})},Le=function(){return de("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:de("path",{d:"M557.248 511.68l135.776-135.744-45.248-45.28L512 466.432l-135.776-135.776-45.248 45.28 135.776 135.744-135.776 135.776 45.248 45.248L512 556.928l135.776 135.776 45.248-45.248-135.776-135.776zM512 64c247.136 0 448 200.864 448 448s-200.864 448-448 448S64 759.136 64 512 264.864 64 512 64z",fill:"currentColor"})})},De=function(){return de("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:de("path",{d:"M512.43945313 904.51953125c-6.06445313 0-12.12890625-1.58203125-17.57812501-4.74609375L136.70703125 689.71484375c-10.63476563-6.24023438-17.13867188-17.66601563-17.13867188-29.97070313s6.50390625-23.73046875 17.13867188-29.97070312l76.37695313-44.91210938L136.97070312 540.125c-10.63476563-6.24023438-17.13867188-17.66601563-17.13867187-29.97070313s6.50390625-23.73046875 17.13867188-29.97070312l73.38867187-43.15429688-73.125-42.890625C126.51171875 387.81054687 120.0078125 376.38476562 120.0078125 364.08007812c0-12.3046875 6.50390625-23.73046875 17.13867188-29.97070312L495.828125 122.99609375c10.8984375-6.41601563 24.34570313-6.41601563 35.24414063 0l358.15429687 210.05859375c10.63476563 6.24023438 17.13867188 17.66601563 17.13867188 29.97070313s-6.50390625 23.73046875-17.13867188 29.97070312l-73.38867188 43.15429688 73.12500001 42.890625c10.63476563 6.24023438 17.13867188 17.66601563 17.13867187 29.97070312s-6.50390625 23.73046875-17.13867187 29.97070313L812.5859375 583.89453125l76.11328125 44.6484375c10.63476563 6.24023438 17.13867188 17.66601563 17.13867188 29.97070313s-6.50390625 23.73046875-17.13867188 29.97070312l-358.59375 211.2890625c-5.44921875 3.1640625-11.6015625 4.74609375-17.66601563 4.74609375zM223.015625 659.65625l289.42382813 169.8046875 290.12695312-170.77148438-58.44726563-34.27734374L530.28125 750.18359375a34.67285156 34.67285156 0 0 1-35.24414063 0L281.7265625 625.02734375 223.015625 659.65625z m76.90429688-104.58984375l212.69531249 124.8046875 290.12695313-170.77148438-55.546875-32.60742187-216.65039063 127.6171875a34.67285156 34.67285156 0 0 1-35.24414062 0L279.00195312 477.28320312l-55.81054687 32.78320313 75.49804688 44.296875c0.43945313 0.26367188 0.79101563 0.52734375 1.23046874 0.703125z m-2.81250001-147.83203125l215.68359376 126.5625 216.12304687-127.17773438c0.3515625-0.26367188 0.703125-0.43945313 1.0546875-0.61523437l72.86132813-42.890625-289.33593751-169.8046875-290.12695312 170.68359375 72.59765625 42.62695313c0.43945313 0.17578125 0.79101563 0.43945313 1.14257813 0.61523437z"})})},Ie=function(t){return de("svg",{className:t.className,id:"stop",viewBox:"0 0 1025 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:[de("path",{d:"M512.268258 1022.835842c-68.658678 0-135.399619-13.564433-198.369591-40.316509-60.752236-25.809077-115.373446-62.712976-162.346233-109.685763-46.971763-46.971763-83.875662-101.592974-109.685763-162.346233C15.115619 647.517366 1.551186 580.777449 1.551186 512.118771S15.115619 376.719151 41.866671 313.74918c25.810101-60.752236 62.714-115.373446 109.685763-162.346233 46.972787-46.971763 101.593997-83.875662 162.346233-109.685763 62.969971-26.751052 129.710912-40.315485 198.369591-40.315485s135.398595 13.564433 198.368567 40.315485c60.752236 25.810101 115.373446 62.714 162.346233 109.685763 46.971763 46.972787 83.875662 101.593997 109.685763 162.346233 26.752076 62.969971 40.316509 129.710912 40.316509 198.369591s-13.564433 135.398595-40.316509 198.368567c-25.809077 60.75326-62.712976 115.37447-109.685763 162.346233-46.971763 46.972787-101.592974 83.876686-162.346233 109.685763C647.666853 1009.27141 580.925912 1022.835842 512.268258 1022.835842zM512.268258 50.548195c-62.018782 0-122.293887 12.247716-179.152287 36.403219-54.923257 23.333323-104.317532 56.709936-146.810821 99.204249s-75.870926 91.888588-99.204249 146.810821c-24.155503 56.8584-36.403219 117.133505-36.403219 179.152287 0 62.017758 12.247716 122.292863 36.403219 179.152287 23.333323 54.923257 56.709936 104.317532 99.204249 146.811845 42.493289 42.493289 91.888588 75.870926 146.810821 99.204249 56.8584 24.155503 117.133505 36.403219 179.152287 36.403219 62.017758 0 122.292863-12.247716 179.152287-36.403219 54.923257-23.333323 104.317532-56.71096 146.811845-99.204249 42.493289-42.494313 75.870926-91.888588 99.204249-146.811845 24.155503-56.8584 36.403219-117.133505 36.403219-179.152287s-12.247716-122.293887-36.403219-179.152287c-23.334347-54.923257-56.71096-104.317532-99.205273-146.810821-42.493289-42.493289-91.887565-75.870926-146.810821-99.204249C634.561121 62.795911 574.286016 50.548195 512.268258 50.548195z",fill:"currentColor"}),de("path",{d:"M655.434047 694.244421 367.12637 694.244421c-21.046987 0-38.170445-17.123458-38.170445-38.170445L328.955925 367.766298c0-21.046987 17.123458-38.170445 38.170445-38.170445l288.307678 0c21.048011 0 38.170445 17.123458 38.170445 38.170445l0 288.307678C693.604492 677.120962 676.482058 694.244421 655.434047 694.244421zM380.150191 643.050154l262.260035 0L642.410226 380.79012 380.150191 380.79012 380.150191 643.050154z",fill:"currentColor"})]})},Pe=function(t){return de("svg",{xmlns:"http://www.w3.org/2000/svg",className:t.className,viewBox:"0 0 512 512",children:de("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})})},Be=function(t){var e=t.items,n=le([]),i=new tt("chat-thought-chain"),r=le([]);Ct((function(){r.value=e.filter((function(t){return t.description})),r.value.length>0&&r.value.forEach((function(t,e){t.done&&(n.value=[].concat(o(n.value),[e]))}))}),[e]);return 0===r.value.length?null:de("div",{className:"".concat(i.b()," ").concat(i.is("single",1===r.value.length)),children:r.value.map((function(t,e){if(t.description){var r=n.value.includes(e);return de("div",{className:"".concat(i.e("item")," ").concat(i.is("collapsed",r)),children:[de("div",{className:i.e("item-icon"),children:t.icon||de("span",{children:e})}),de("div",{className:i.e("item-content"),children:[de("div",{className:i.e("item-title"),onClick:function(){return function(t){n.value.includes(t)?n.value=n.value.filter((function(e){return e!==t})):n.value=[].concat(o(n.value),[t])}(e)},children:[t.title,de(Se,{className:i.e("icon")})]}),de("div",{className:i.e("item-description"),children:t.description})]})]},e)}}))})},He=new tt("markdown-message"),je=function(t){var e=t.message,n=t.size,i=le(ot()),r=le(null),o=Et((function(){return 20===e.state&&!0!==e.completed}),[e.state,e.completed]),a=Et((function(){return 20===e.state&&!0===e.completed}),[e.state,e.completed]),c=le({title:"",description:"",icon:de(Me,{})}),l=function(t){var e=t.indexOf("<think>"),n=t.indexOf("</think>"),i="",r="",o=!1;return-1===n?(o=!1,i=t.slice(e+7),r=""):(o=!0,i=t.slice(e+7,n),r=t.slice(n+8)),{isThoughtCompleted:o,thoughtContent:i,answerContent:r}};return Ct((function(){if(n>=0&&r.value)if(-1!==e.content.indexOf("<think>")){var t=l(e.content),i=t.isThoughtCompleted,o=t.thoughtContent,a=t.answerContent;i?(c.value.icon=de(Ae,{}),c.value.title="思考完成"):!0===e.completed?(c.value.icon=de(Ae,{}),c.value.title="思考已停止"):(c.value.icon=de(Me,{}),c.value.title="思考中..."),o&&(c.value.description=o),a&&r.value.setMarkdown(a)}else r.value.setMarkdown(e.content)}),[e,n]),Ct((function(){var t="";if(-1!==e.content.indexOf("<think>")){var n=l(e.content),o=n.isThoughtCompleted,a=n.thoughtContent,u=n.answerContent;c.value={title:o?"思考完成":!0===e.completed?"思考已停止":"思考中...",description:a||"",icon:o||!0===e.completed?de(Ae,{}):de(Me,{})},u&&(t=u)}else t=e.content;r.value=new s({id:i,value:t||"",editor:{defaultModel:"previewOnly"}})}),[]),de("div",{className:"".concat(He.b()," ").concat(He.is("loading",o)),children:[de("div",{className:He.b("header"),children:[de("div",{className:He.be("header","caption"),children:"AI "}),t.children,a?de("div",{className:He.be("header","timeout"),children:"请求超时"}):null]}),de("div",{className:"".concat(He.b("content")," pre-wrap-container"),children:[de(Be,{items:[c.value]}),de("div",{id:i})]}),de("div",{className:He.b("footer")})]})},Fe=new tt("ossfile-material"),Re=function(t){var e=ue((function(){return t.material.data.name})),n=ue((function(){return t.material.metadata.size})),i=ue((function(){var e=t.material.metadata.state;return"successed"===e?"上传成功":"uploading"===e?"上传中":"failed"===e?"上传失败":"未知状态"})),r=ue((function(){switch(t.material.metadata.state){case"successed":return"#1890ff";case"uploading":return"#52c41a";default:return"#ff4d4f"}}));return de("div",{className:Fe.b(),children:[de("div",{className:Fe.b("left"),children:de(ze,{})}),de("div",{className:Fe.b("right"),children:[de("div",{className:Fe.e("name"),title:e,children:e}),de("div",{className:Fe.e("metadata"),children:[de("div",{children:[n,"B"]}),de("div",{style:{color:r.value},children:i})]})]})]})},Ue=new tt("common-material"),We=function(t){var e,n=null===(e=t.controller.opts.questionToolbarItems)||void 0===e?void 0:e.find((function(e){return e.id===t.material.metadata.actionId})),i=ue((function(){return t.material.metadata.name}));return de("div",{className:Ue.b(),children:[de("div",{className:Ue.b("left"),children:n&&n.icon?"function"==typeof n.icon?n.icon(M):n.icon:de(De,{})}),de("div",{className:Ue.b("right"),children:[de("div",{className:Ue.e("name"),title:i,children:i}),de("div",{className:Ue.e("metadata"),children:de("div",{children:(null==n?void 0:n.label)||"素材资源"})})]})]})},Ve=new tt("chat-input-material-item"),qe=function(t){var e=t.material,n=null;if("ossfile"===e.type)n=Re;else n=We;return de("div",{className:"".concat(Ve.b()," ").concat(Ve.is("disabled",t.disabled)),children:[de("div",{className:Ve.e("icon"),onClick:function(){t.controller.deleteMaterial(e)},children:de(Le,{})}),M(n,{material:e,controller:t.controller})]})},Ye=new tt("user-message-question"),$e=function(t){var e=ue((function(){return t.message.content})),n=ue((function(){return ft.parseMixedContent(e.value)}));return de("div",{className:Ye.b(),children:[de("div",{className:Ye.e("user-header"),children:[t.children,de("div",{className:Ye.e("user"),children:"我"})]}),de("div",{className:Ye.e("content"),children:de("div",{dir:"auto",className:Ye.em("content","body"),children:[de("p",{dir:"auto",className:Ye.em("content","material"),children:n.value.hasResources&&n.value.resources.map((function(e){return de(qe,{material:e,disabled:!0,controller:t.controller},e.id)}))}),de("p",{dir:"auto",className:"pre-wrap-container",children:n.value.remainingText})]})})]})},Xe=new tt("error-message"),Ge=function(t){var e=ue((function(){return t.message.content}));return de("div",{className:Xe.b(),children:[de("div",{className:Xe.b("header"),children:[de("div",{className:Xe.be("header","caption"),children:"AI "}),t.children]}),de("div",{className:"".concat(Xe.e("content")," pre-wrap-container"),children:de("span",{children:e})})]})},Je=new tt("unknown-message"),Ze=function(t){return de("div",{className:Je.b(),children:de("span",{className:"".concat(Je.e("content")," pre-wrap-container"),children:["暂未支持的消息类型: ",t.message.type]})})},Ke=new tt("chat-message-item"),Qe=function(t){var e=t.message,n=t.size,i=null;switch(e.type){case"DEFAULT":i="ASSISTANT"===e.role?je:$e;break;case"ERROR":i=Ge;break;default:i=Ze}return de("div",{className:Ke.b(),children:M(i,{size:n,message:e,controller:t.controller,children:t.children})})},tn=new tt("chat-toolbar"),en=function(t){var e=t.controller,n=t.items,i=void 0===n?[]:n,r=t.data,a=t.type,c=t.className,s=[],l="default",h=[{label:"新建对话",title:"新建对话",icon:de(xe,{}),onClick:function(){e.newDialogue()}}],d=[{label:"刷新",title:"刷新",icon:de(_e,{}),onClick:function(){e.refreshMessage(r)}},{label:"删除",title:"删除",icon:de(me,{}),onClick:function(){e.deleteMessage(r)}},{label:"复制",title:"复制",icon:de(ge,{}),onClick:function(){e.copyMessage(r)}}];St(ai).enableBackFill&&d.unshift.apply(d,[{label:"回填",title:"回填",icon:de(pe,{}),onClick:function(){e.backfill(r)}}]);var f=[{label:"刷新",title:"刷新",icon:de(_e,{}),onClick:function(){e.refreshMessage(r,!0)}}];if("content"===a)switch(l="circle",r.type){case"DEFAULT":s="ASSISTANT"===r.role?[].concat(d,o(i)):[].concat(f);break;case"ERROR":s=[].concat(d,o(i))}else s=[].concat(h,o(i));var p=function(t){return"function"==typeof t.disabled?t.disabled(r):!0===t.disabled},v=Et((function(){return"content"===a&&20===(null==r?void 0:r.state)&&!0!==(null==r?void 0:r.completed)}),[null==r?void 0:r.state,null==r?void 0:r.completed]);return de("div",{className:"".concat(tn.b()," ").concat(tn.e(l)," ").concat(c||""),children:s.map((function(t,n){if(!function(t){return"function"==typeof t.hidden?t.hidden(r):!0===t.hidden}(t))return de("div",{className:"".concat(tn.e("item")," ").concat(tn.is("disabled",p(t)||v)," ").concat(c||""),title:t.title,onClick:function(n){return function(t,n){var i;if(!p(n)){var o=u(u({},r),{},{topic:e.topic});o.msg.realcontent=r.realcontent,null===(i=n.onClick)||void 0===i||i.call(n,t,e.context,e.params,o)}}(n,t)},children:[de("div",{className:"".concat(tn.em("item","icon")),children:"function"==typeof t.icon?t.icon(M):t.icon}),de("div",{className:"".concat(tn.em("item","label")),children:"function"==typeof t.label?t.label(M):t.label})]},n)}))})};var nn=function(t){var e,n,i,r=le(!1),o=le({}),a=new tt("chat-back-bottom"),c=le(null),s=function(){if(c.value){var e=t.visibilityHeight||200,n=c.value.scrollHeight-c.value.scrollTop-c.value.offsetHeight;r.value=n>=e}},l=(e=s,n=300,i=null,function(){for(var t=this,r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];i||(i=setTimeout((function(){e.apply(t,o),i=null}),n))});return Et((function(){o.value={right:"".concat(t.right,"px"),bottom:"".concat(t.bottom,"px")}}),[t.right,t.bottom]),Ct((function(){if(t.target){var e,n=null!==(e=document.querySelector(t.target))&&void 0!==e?e:void 0;n&&(c.value=n,n.addEventListener("scroll",l),s())}}),[]),de("div",{className:"".concat(a.b()," ").concat(a.is("visible",r.value)),style:o.value,onClick:function(){c.value&&c.value.scrollTo({top:c.value.scrollHeight,behavior:"smooth"})},children:de(Pe,{className:a.e("icon")})})},rn=new tt("chat-messages"),on=function(t){var e=Nt(null),n=t.controller.messages;return function(t){var e=Nt(t);e.current=t,Ct((function(){return re((function(){return e.current()}))}),[])}((function(){e.current&&n.value.length>0&&(e.current.scrollTop=e.current.scrollHeight)})),de("div",{ref:e,className:rn.b(),children:[n.value.map((function(e){var n,i=(null===(n=e.content)||void 0===n?void 0:n.length)||0;return de(Qe,{size:i,message:e,controller:t.controller,children:de(en,{data:e,type:"content",items:t.toolbarItems,controller:t.controller})},e.messageid)})),de(nn,{right:20,bottom:14,target:".".concat(rn.b())})]})};function an(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var i in e)if("__source"!==i&&t[i]!==e[i])return!0;return!1}function cn(t){this.props=t}(cn.prototype=new L).isPureReactComponent=!0,cn.prototype.shouldComponentUpdate=function(t,e){return an(this.props,t)||an(this.state,e)};var sn=l.__b;l.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),sn&&sn(t)};var ln=l.__e;l.__e=function(t,e,n,i){if(t.then)for(var r,o=e;o=o.__;)if((r=o.__c)&&r.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),r.__c(t,e);ln(t,e,n,i)};var un=l.unmount;function hn(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),t.__c.__H=null),null!=(t=function(t,e){for(var n in e)t[n]=e[n];return t}({},t)).__c&&(t.__c.__P===n&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return hn(t,e,n)}))),t}function dn(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return dn(t,e,n)})),t.__c&&t.__c.__P===e&&(t.__e&&n.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=n)),t}function fn(){this.__u=0,this.t=null,this.__b=null}function pn(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function vn(){this.u=null,this.o=null}l.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&!0===t.__h&&(t.type=null),un&&un(t)},(fn.prototype=new L).__c=function(t,e){var n=e.__c,i=this;null==i.t&&(i.t=[]),i.t.push(n);var r=pn(i.__v),o=!1,a=function(){o||(o=!0,n.__R=null,r?r(c):c())};n.__R=a;var c=function(){if(! --i.__u){if(i.state.__a){var t=i.state.__a;i.__v.__k[0]=dn(t,t.__c.__P,t.__c.__O)}var e;for(i.setState({__a:i.__b=null});e=i.t.pop();)e.forceUpdate()}},s=!0===e.__h;i.__u++||s||i.setState({__a:i.__b=i.__v.__k[0]}),t.then(a,a)},fn.prototype.componentWillUnmount=function(){this.t=[]},fn.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=hn(this.__b,n,i.__O=i.__P)}this.__b=null}var r=e.__a&&M(z,null,t.fallback);return r&&(r.__h=null),[M(z,null,e.__a?null:t.children),r]};var mn=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};function _n(t){return this.getChildContext=function(){return t.context},t.children}function gn(t){var e=this,n=t.i;e.componentWillUnmount=function(){K(null,e.l),e.l=null,e.i=null},e.i&&e.i!==n&&e.componentWillUnmount(),e.l||(e.i=n,e.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(t){this.childNodes.push(t),e.i.appendChild(t)},insertBefore:function(t,n){this.childNodes.push(t),e.i.appendChild(t)},removeChild:function(t){this.childNodes.splice(this.childNodes.indexOf(t)>>>1,1),e.i.removeChild(t)}}),K(M(_n,{context:e.context},t.__v),e.l)}function yn(t,e){var n=M(gn,{__v:t,i:e});return n.containerInfo=e,n}(vn.prototype=new L).__a=function(t){var e=this,n=pn(e.__v),i=e.o.get(t);return i[0]++,function(r){var o=function(){e.props.revealOrder?(i.push(r),mn(e,t,i)):r()};n?n(o):o()}},vn.prototype.render=function(t){this.u=null,this.o=new Map;var e=F(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},vn.prototype.componentDidUpdate=vn.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){mn(t,n,e)}))};var bn="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,wn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,kn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,xn=/[A-Z0-9]/g,Cn="undefined"!=typeof document,Nn=function(t){return("undefined"!=typeof Symbol&&"symbol"==p(Symbol())?/fil|che|rad/:/fil|che|ra/).test(t)};L.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(L.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var En=l.event;function Tn(){}function Sn(){return this.cancelBubble}function An(){return this.defaultPrevented}l.event=function(t){return En&&(t=En(t)),t.persist=Tn,t.isPropagationStopped=Sn,t.isDefaultPrevented=An,t.nativeEvent=t};var Mn={enumerable:!1,configurable:!0,get:function(){return this.class}},On=l.vnode;l.vnode=function(t){"string"==typeof t.type&&function(t){var e=t.props,n=t.type,i={};for(var r in e){var o=e[r];if(!("value"===r&&"defaultValue"in e&&null==o||Cn&&"children"===r&&"noscript"===n||"class"===r||"className"===r)){var a=r.toLowerCase();"defaultValue"===r&&"value"in e&&null==e.value?r="value":"download"===r&&!0===o?o="":"ondoubleclick"===a?r="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||Nn(e.type)?"onfocus"===a?r="onfocusin":"onblur"===a?r="onfocusout":kn.test(r)?r=a:-1===n.indexOf("-")&&wn.test(r)?r=r.replace(xn,"-$&").toLowerCase():null===o&&(o=void 0):a=r="oninput","oninput"===a&&i[r=a]&&(r="oninputCapture"),i[r]=o}}"select"==n&&i.multiple&&Array.isArray(i.value)&&(i.value=F(e.children).forEach((function(t){t.props.selected=-1!=i.value.indexOf(t.props.value)}))),"select"==n&&null!=i.defaultValue&&(i.value=F(e.children).forEach((function(t){t.props.selected=i.multiple?-1!=i.defaultValue.indexOf(t.props.value):i.defaultValue==t.props.value}))),e.class&&!e.className?(i.class=e.class,Object.defineProperty(i,"className",Mn)):(e.className&&!e.class||e.class&&e.className)&&(i.class=i.className=e.className),t.props=i}(t),t.$$typeof=bn,On&&On(t)};var zn=l.__r;l.__r=function(t){zn&&zn(t),t.__c};var Ln=l.diffed;l.diffed=function(t){Ln&&Ln(t);var e=t.props,n=t.__e;null!=n&&"textarea"===t.type&&"value"in e&&e.value!==n.value&&(n.value=null==e.value?"":e.value)};var Dn=new Map;function In(t){var e=Dn.get(t);e&&e.destroy()}function Pn(t){var e=Dn.get(t);e&&e.update()}var Bn=null;"undefined"==typeof window?((Bn=function(t){return t}).destroy=function(t){return t},Bn.update=function(t){return t}):((Bn=function(t,e){return t&&Array.prototype.forEach.call(t.length?t:[t],(function(t){return function(t){if(t&&t.nodeName&&"TEXTAREA"===t.nodeName&&!Dn.has(t)){var e,n=null,i=window.getComputedStyle(t),r=(e=t.value,function(){a({testForHeightReduction:""===e||!t.value.startsWith(e),restoreTextAlign:null}),e=t.value}),o=function(e){t.removeEventListener("autosize:destroy",o),t.removeEventListener("autosize:update",c),t.removeEventListener("input",r),window.removeEventListener("resize",c),Object.keys(e).forEach((function(n){return t.style[n]=e[n]})),Dn.delete(t)}.bind(t,{height:t.style.height,resize:t.style.resize,textAlign:t.style.textAlign,overflowY:t.style.overflowY,overflowX:t.style.overflowX,wordWrap:t.style.wordWrap});t.addEventListener("autosize:destroy",o),t.addEventListener("autosize:update",c),t.addEventListener("input",r),window.addEventListener("resize",c),t.style.overflowX="hidden",t.style.wordWrap="break-word",Dn.set(t,{destroy:o,update:c}),c()}function a(e){var r,o,c=e.restoreTextAlign,s=void 0===c?null:c,l=e.testForHeightReduction,u=void 0===l||l,h=i.overflowY;if(0!==t.scrollHeight&&("vertical"===i.resize?t.style.resize="none":"both"===i.resize&&(t.style.resize="horizontal"),u&&(r=function(t){for(var e=[];t&&t.parentNode&&t.parentNode instanceof Element;)t.parentNode.scrollTop&&e.push([t.parentNode,t.parentNode.scrollTop]),t=t.parentNode;return function(){return e.forEach((function(t){var e=t[0],n=t[1];e.style.scrollBehavior="auto",e.scrollTop=n,e.style.scrollBehavior=null}))}}(t),t.style.height=""),o="content-box"===i.boxSizing?t.scrollHeight-(parseFloat(i.paddingTop)+parseFloat(i.paddingBottom)):t.scrollHeight+parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth),"none"!==i.maxHeight&&o>parseFloat(i.maxHeight)?("hidden"===i.overflowY&&(t.style.overflow="scroll"),o=parseFloat(i.maxHeight)):"hidden"!==i.overflowY&&(t.style.overflow="hidden"),t.style.height=o+"px",s&&(t.style.textAlign=s),r&&r(),n!==o&&(t.dispatchEvent(new Event("autosize:resized",{bubbles:!0})),n=o),h!==i.overflow&&!s)){var d=i.textAlign;"hidden"===i.overflow&&(t.style.textAlign="start"===d?"end":"start"),a({restoreTextAlign:d,testForHeightReduction:!0})}}function c(){a({testForHeightReduction:!0,restoreTextAlign:null})}}(t)})),t}).destroy=function(t){return t&&Array.prototype.forEach.call(t.length?t:[t],In),t},Bn.update=function(t){return t&&Array.prototype.forEach.call(t.length?t:[t],Pn),t});var Hn=Bn,jn=function(){function t(e){v(this,t),this.msg=e}return _(t,[{key:"messageid",get:function(){return this.msg.messageid}},{key:"state",get:function(){return this.msg.state}},{key:"role",get:function(){return this.msg.role}},{key:"type",get:function(){return this.msg.type}},{key:"realcontent",get:function(){var t=this.msg.content;if(-1!==t.indexOf("<think>")&&-1===t.indexOf("</think>"))return"";if(-1!==(t=t.replace(/<think>[^]*?<\/think>/g,"").trim()).indexOf("<resources>")&&-1===t.indexOf("</resources>"))return"";var e=(t=t.replace(/<resources>[^]*?<\/resources>/g,"").trim()).indexOf("<suggestions>");return-1!==e&&(t=t.substring(0,e).trim()),t}},{key:"content",get:function(){return this.msg.content}},{key:"completed",get:function(){return this.msg.completed}},{key:"_origin",get:function(){return this.msg}},{key:"update",value:function(t){t.content||(t.content=""),this.msg.content+=t.content}},{key:"updateCompleted",value:function(t){this.msg.completed=t}}]),t}(),Fn=function(){function t(e){v(this,t),this.data=e}return _(t,[{key:"appid",get:function(){return this.data.appid}},{key:"id",get:function(){return this.data.id}},{key:"type",get:function(){return this.data.type}},{key:"caption",get:function(){return this.data.caption}},{key:"url",get:function(){return this.data.url}},{key:"aiChat",get:function(){return this.data.aiChat}}]),t}(),Rn=function(){function t(e){v(this,t),this.material=e}return _(t,[{key:"id",get:function(){return this.material.id}},{key:"type",get:function(){return this.material.type}},{key:"metadata",get:function(){return this.material.metadata}},{key:"data",get:function(){return this.material.data}}]),t}(),Un=function(t){return t.STYLE_CACHE="ai-chat-style-cache",t.MINIMIZE_STYLY_CHCHE="ai-chat-minimize-style-cache",t.DATA_BASE_NAME="ibiz-chat",t.DATA_TABLE_NAME="history-message",t.DATA_TABLE_KEY_NAME="id",t}(Un||{}),Wn=function(){function t(e){v(this,t),g(this,"messages",Xt([])),g(this,"materials",Xt([])),g(this,"input",Xt("")),g(this,"isLoading",Xt(!1)),g(this,"context",void 0),g(this,"params",void 0),g(this,"appDataEntityId",void 0),g(this,"topicId",void 0),g(this,"topic",void 0),this.opts=e,this.context=e.context,this.params=e.params,this.appDataEntityId=e.appDataEntityId,this.topicId=e.topicId,this.topic=e.topic,this.fecthHistory()}var e,n,i,r,a;return _(t,[{key:"fecthHistory",value:(a=f(h().mark((function t(){var e,n=this;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.topicId){t.next=7;break}return t.next=3,ct.getData(Un.DATA_BASE_NAME,Un.DATA_TABLE_NAME,this.topicId);case 3:if(!((e=t.sent)&&e.data&&e.data.length>0)){t.next=7;break}return e.data.forEach((function(t){var e={messageid:t.messageid,state:t.state,type:t.type,role:t.role,content:t.content,completed:!0};n.addMessage(e)})),t.abrupt("return",!0);case 7:return t.abrupt("return",this.opts.history(this.context,this.params,{appDataEntityId:this.appDataEntityId}));case 8:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"asyncToIndexDB",value:(r=f(h().mark((function t(){var e;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.topicId){t.next=2;break}return t.abrupt("return");case 2:return e={id:this.topicId,data:this.messages.value.map((function(t){return t._origin})),timestamp:(new Date).getTime()},t.next=5,ct.updateData(Un.DATA_BASE_NAME,Un.DATA_TABLE_NAME,e);case 5:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"setInput",value:function(t){this.input.value=t||""}},{key:"addMessage",value:function(t){var e=this.messages.value.find((function(e){return e.messageid===t.messageid}));e?(e.update(t),this.messages.value=o(this.messages.value)):this.messages.value=[].concat(o(this.messages.value),[new jn(t)]),this.asyncToIndexDB()}},{key:"completeMessage",value:function(t,e){var n=this.messages.value.find((function(e){return e.messageid===t}));n&&(n.updateCompleted(e),this.messages.value=o(this.messages.value),this.asyncToIndexDB())}},{key:"replaceMessage",value:function(t){var e=this.messages.value.findIndex((function(e){return e.messageid===t.messageid}));-1!==e?(this.messages.value[e]=new jn(t),this.messages.value=o(this.messages.value)):this.messages.value=[].concat(o(this.messages.value),[new jn(t)]),this.asyncToIndexDB()}},{key:"stopMessage",value:function(t){var e=this.messages.value.findIndex((function(e){return e.messageid===t.messageid}));if(-1!==e){var n=this.messages.value[e];t.content=n.content,this.messages.value[e]=new jn(t),this.messages.value=o(this.messages.value)}else this.messages.value=[].concat(o(this.messages.value),[new jn(t)]);this.asyncToIndexDB()}},{key:"stringlyMaterialResource",value:function(){var t="",e=[];return this.materials.value&&this.materials.value.length>0&&(this.materials.value.forEach((function(t){if("ossfile"===t.type){var n=t.metadata;n.state&&"successed"===n.state&&e.push(t)}else e.push(t)})),this.materials.value=[]),e&&e.length>0&&(t=ft.stringify(e)),t}},{key:"question",value:(i=f(h().mark((function t(e){var n;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this.isLoading.value=!0,(n=this.stringlyMaterialResource())?n+="\n".concat(e):n=e,this.addMessage({state:30,messageid:ot(),role:"USER",type:"DEFAULT",content:n}),t.next=7,this.opts.question(this,this.context,this.params,{appDataEntityId:this.appDataEntityId},this.messages.value.filter((function(t){return"ERROR"!==t.type})).map((function(t){return t._origin})));case 7:this.opts.action&&this.opts.action("question",e),this.isLoading.value=!1;case 9:return t.prev=9,this.isLoading.value=!1,t.finish(9);case 12:case"end":return t.stop()}}),t,this,[[0,,9,12]])}))),function(t){return i.apply(this,arguments)})},{key:"abortQuestion",value:function(){try{this.opts.abortQuestion(this)}finally{this.isLoading.value=!1}}},{key:"backfill",value:function(t){this.opts.action&&this.opts.action("backfill",t)}},{key:"deleteMessage",value:function(t){var e=this.messages.value.findIndex((function(e){return e.messageid===t.messageid}));-1!==e&&(this.messages.value.splice(e,1),this.messages.value=o(this.messages.value)),this.asyncToIndexDB(),this.opts.action&&this.opts.action("deletemsg",t)}},{key:"refreshMessage",value:(n=f(h().mark((function t(e){var n,i,r,a=arguments;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=a.length>1&&void 0!==a[1]&&a[1],this.isLoading.value=!0,t.prev=2,i=this.messages.value.findIndex((function(t){return t.messageid===e.messageid})),!n){t.next=11;break}return this.messages.value.splice(i+1,this.messages.value.length-i-1),this.messages.value=o(this.messages.value),t.next=9,this.opts.question(this,this.context,this.params,{appDataEntityId:this.appDataEntityId},this.messages.value.filter((function(t){return"ERROR"!==t.type})).map((function(t){return t._origin})));case 9:t.next=21;break;case 11:if(i!==this.messages.value.length-1){t.next=18;break}return this.messages.value.pop(),this.messages.value=o(this.messages.value),t.next=16,this.opts.question(this,this.context,this.params,{appDataEntityId:this.appDataEntityId},this.messages.value.filter((function(t){return"ERROR"!==t.type})).map((function(t){return t._origin})));case 16:t.next=21;break;case 18:r=this.messages.value[i-1].content,this.messages.value.splice(i-1,2),this.question(r);case 21:this.asyncToIndexDB(),this.opts.action&&this.opts.action("refreshmsg",e);case 23:return t.prev=23,this.isLoading.value=!1,t.finish(23);case 26:case"end":return t.stop()}}),t,this,[[2,,23,26]])}))),function(t){return n.apply(this,arguments)})},{key:"copyMessage",value:function(t){var e=t.realcontent;at.copy(e),this.opts.action&&this.opts.action("copymsg",t)}},{key:"newDialogue",value:(e=f(h().mark((function t(){return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.messages.value.length=0,!this.topicId){t.next=4;break}return t.next=4,ct.deleteData(Un.DATA_BASE_NAME,Un.DATA_TABLE_NAME,this.topicId);case 4:this.opts.history(this.context,this.params,{appDataEntityId:this.appDataEntityId});case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"addMaterial",value:function(t){var e=this.materials.value.find((function(e){return e.id===t.id}));this.materials.value=e?o(this.materials.value):[].concat(o(this.materials.value),[new Rn(t)])}},{key:"replaceMaterial",value:function(t,e){var n=this.materials.value.findIndex((function(e){return e.id===t}));-1!==n?(this.materials.value[n]=new Rn(e),this.materials.value=o(this.materials.value)):this.materials.value=[].concat(o(this.materials.value),[new Rn(e)])}},{key:"deleteMaterial",value:function(t){var e=this.materials.value.findIndex((function(e){return e.id===t.id}));-1!==e&&(this.materials.value.splice(e,1),this.materials.value=o(this.materials.value))}}]),t}(),Vn=function(){function t(e){v(this,t),g(this,"topics",Xt([])),g(this,"activedTopic",Xt(null)),g(this,"currentTopicOptions",void 0),this.chat=e}var e,n,i,r;return _(t,[{key:"fetchHistory",value:(r=f(h().mark((function t(e){var n,i,r=this;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.configService(e.appid,"aitopics",e.type),t.next=3,n.load();case 3:(i=t.sent)&&i.length>0&&i.forEach((function(t){r.topics.value=[].concat(o(r.topics.value),[new Fn(t)])}));case 5:case"end":return t.stop()}}),t)}))),function(t){return r.apply(this,arguments)})},{key:"updateCurrentTopic",value:(i=f(h().mark((function t(e){var n,i,r,a;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.currentTopicOptions=e,n=this.topics.value.findIndex((function(t){return t.id===e.id})),i=new Fn(e),-1!==n?this.topics.value.splice(n,1,new Fn(e)):this.topics.value=[].concat(o(this.topics.value),[new Fn(e)]),r=this.topics.value.map((function(t){return{appid:t.appid,id:t.id,type:t.type,caption:t.caption,url:t.url,aiChat:t.aiChat}})),a=e.configService(e.appid,"aitopics",e.type),t.next=8,null==a?void 0:a.save(r);case 8:this.activedTopic.value=i;case 9:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"removeTopic",value:(n=f(h().mark((function t(e,n,i,r,a){var c,s,l,u,d;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=!0,!e.beforeDelete){t.next=5;break}return t.next=4,e.beforeDelete(n,i,r,a);case 4:s=t.sent;case 5:if(s){t.next=7;break}return t.abrupt("return");case 7:return-1!==(l=this.topics.value.findIndex((function(t){return t.id===r.id})))&&(this.topics.value.splice(l,1),this.topics.value=o(this.topics.value)),u=this.topics.value.map((function(t){return{appid:t.appid,id:t.id,type:t.type,caption:t.caption,url:t.url,aiChat:t.aiChat}})),d=e.configService(e.appid,"aitopics",e.type),t.next=13,null==d?void 0:d.save(u);case 13:return t.next=15,ct.deleteData(Un.DATA_BASE_NAME,Un.DATA_TABLE_NAME,r.id);case 15:this.topics.value.length>0&&r.id===(null===(c=this.activedTopic.value)||void 0===c?void 0:c.id)&&this.handleTopicChange(this.topics.value[0]);case 16:case"end":return t.stop()}}),t,this)}))),function(t,e,i,r,o){return n.apply(this,arguments)})},{key:"handleTopicChange",value:function(t){var e;(null===(e=this.activedTopic.value)||void 0===e?void 0:e.id)!==t.id&&(this.activedTopic.value=t,this.chat.switchAiChatController(t))}},{key:"handleTopicAction",value:(e=f(h().mark((function t(e,n,i){var r,o,a,c,s,l;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.topics.value.find((function(t){return t.id===n.id})),!(this.currentTopicOptions&&r&&r.aiChat)){t.next=7;break}if(c=r.aiChat,s=c.context,l=c.params,"DELETE"!==e){t.next=6;break}return t.next=6,this.removeTopic(this.currentTopicOptions,s,l,r,i);case 6:null===(o=(a=this.currentTopicOptions).action)||void 0===o||o.call(a,e,s,l,n,i);case 7:case"end":return t.stop()}}),t,this)}))),function(t,n,i){return e.apply(this,arguments)})}]),t}(),qn=_((function t(e){v(this,t),this.aiChat=e})),Yn=function(e){t(o,e);var i,r=n(o);function o(){return v(this,o),r.apply(this,arguments)}return _(o,[{key:"excuteAction",value:(i=f(h().mark((function t(e,n){var i,r,o;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n||!n.onClick){t.next=5;break}return t.next=3,n.onClick(e,this.aiChat.context,this.aiChat.params);case 3:(i=t.sent)&&i.data&&i.data.length>0&&(r=i.data[0],o={id:r.id,type:r.type,data:r.data||{},metadata:r.metadata||{}},n.id&&Object.assign(o.metadata,{actionId:n.id}),this.aiChat.addMaterial(o));case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return i.apply(this,arguments)})}]),o}(qn),$n=function(e){t(o,e);var i,r=n(o);function o(){return v(this,o),r.apply(this,arguments)}return _(o,[{key:"excuteAction",value:(i=f(h().mark((function t(e,n){var i,r,o,a,c,s,l,u,d,p,v=this;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=this.aiChat.opts.uploader,r=i.multiple,o=i.accept,a=i.maxSize,c=i.onSelect,s=i.onUpload,l=i.onSuccess,u=i.onError,d=i.onProgress,p={multiple:r||!0,accept:o||"*/*",maxSize:a||5242880,onSelect:function(t){null==c||c(t),t.length>0&&t.forEach((function(t){var e=v.buildMaterialObject(t);Object.assign(e.metadata,{state:"uploading"}),v.aiChat.addMaterial(e)}))},onUpload:function(){var t=f(h().mark((function t(e,n){return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",s(e,n,{context:v.aiChat.context,params:v.aiChat.params}));case 1:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),onSuccess:function(t,e){var n={id:t.id,type:"ossfile",data:{id:t.id,name:t.name},metadata:{ext:t.ext,fileext:t.fileext,fileid:t.fileid,filename:t.filename,size:t.size,filesize:t.filesize,state:"successed"}};v.aiChat.replaceMaterial(e.name,n),null==l||l(t,e)},onError:function(t,e){var n=v.buildMaterialObject(e);Object.assign(n.metadata,{state:"failed"}),v.aiChat.replaceMaterial(e.name,n),null==u||u(t,e)},onProgress:function(t,e){null==d||d(t,e)}},new dt(p).openFilePicker();case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return i.apply(this,arguments)})},{key:"buildMaterialObject",value:function(t){return{id:t.name,type:"ossfile",data:{name:t.name,id:t.name},metadata:{size:t.size,type:t.type,lastModified:t.lastModified}}}}]),o}(qn),Xn=function(){function t(){v(this,t)}return _(t,null,[{key:"getMaterialHelper",value:function(t,e){return"ossfile"===t?new $n(e):new Yn(e)}}]),t}(),Gn=function(){function t(){v(this,t),g(this,"container",void 0),g(this,"mode","DEFAULT"),g(this,"isMountedAiTopic",!1),g(this,"backupChatOptions",void 0),g(this,"aiTopic",void 0),g(this,"aiTopicMap",new Map),this.aiTopic=new Vn(this)}var e,n;return _(t,[{key:"aiChat",get:function(){var t;return this.aiTopicMap.get("".concat(null===(t=this.aiTopic.activedTopic.value)||void 0===t?void 0:t.id))}},{key:"initIndexDB",value:(n=f(h().mark((function t(){return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ct.checkTableExists(Un.DATA_BASE_NAME,Un.DATA_TABLE_NAME);case 2:if(t.sent){t.next=6;break}return t.next=6,ct.createTable(Un.DATA_BASE_NAME,Un.DATA_TABLE_NAME,Un.DATA_TABLE_KEY_NAME,!1);case 6:case"end":return t.stop()}}),t)}))),function(){return n.apply(this,arguments)})},{key:"create",value:(e=f(h().mark((function t(e){var n,i,r,o,a,c,s=this;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.initIndexDB();case 2:if(this.backupChatOptions=e,this.close(),this.container=document.createElement("div"),this.container.classList.add("ibiz-ai-chat"),document.body.appendChild(this.container),o=e.chatOptions,!e.mode||"TOPIC"!==e.mode){t.next=17;break}if(this.isMountedAiTopic){t.next=13;break}return t.next=12,this.aiTopic.fetchHistory(e.topicOptions);case 12:this.isMountedAiTopic=!0;case 13:return a=e.topicOptions,Object.assign(a,{aiChat:{caption:o.caption,context:o.context,params:o.params,appDataEntityId:o.appDataEntityId,contentToolbarItems:o.contentToolbarItems,footerToolbarItems:o.footerToolbarItems,questionToolbarItems:o.questionToolbarItems}}),t.next=17,this.aiTopic.updateCurrentTopic(a);case 17:return Object.assign(o,{topicId:null===(n=a)||void 0===n?void 0:n.id,topic:a}),c=new Wn(o),this.aiTopicMap.set("".concat(null===(i=a)||void 0===i?void 0:i.id),c),K(M(ci,{aiChat:c,aiTopic:this.aiTopic,mode:e.mode?e.mode:"DEFAULT",containerOptions:e.containerOptions,caption:e.mode&&"TOPIC"===e.mode?"AI助手":o.caption,enableBackFill:null===(r=e.containerOptions)||void 0===r?void 0:r.enableBackFill,contentToolbarItems:o.contentToolbarItems,footerToolbarItems:o.footerToolbarItems,questionToolbarItems:o.questionToolbarItems,close:function(){s.close(),o.closed&&o.closed(o.context,o.params)},fullscreen:function(t){o.fullscreen&&o.fullscreen(t,o.context,o.params)},minimize:function(t){o.minimize&&o.minimize(t,o.context,o.params)}}),this.container),t.abrupt("return",c);case 22:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"switchAiChatController",value:function(t){var e,n,i,r,o,a=this,c=u({},this.backupChatOptions.chatOptions);(t.aiChat&&Object.assign(c,{caption:t.aiChat.caption,context:t.aiChat.context,params:t.aiChat.params,contentToolbarItems:t.aiChat.contentToolbarItems,footerToolbarItems:t.aiChat.footerToolbarItems,questionToolbarItems:t.aiChat.questionToolbarItems,appDataEntityId:t.aiChat.appDataEntityId,topicId:t.id,topic:t}),this.aiTopicMap.has("".concat(t.id))?e=this.aiTopicMap.get("".concat(t.id)):(e=new Wn(c),this.aiTopicMap.set("".concat(t.id),e)),this.container)&&(K(null,this.container),K(M(ci,{aiChat:e,aiTopic:this.aiTopic,mode:null!==(n=this.backupChatOptions)&&void 0!==n&&n.mode?this.backupChatOptions.mode:"DEFAULT",containerOptions:null===(i=this.backupChatOptions)||void 0===i?void 0:i.containerOptions,caption:null!==(r=this.backupChatOptions)&&void 0!==r&&r.mode&&"TOPIC"===this.backupChatOptions.mode?"AI助手":c.caption,enableBackFill:null===(o=this.backupChatOptions)||void 0===o||null===(o=o.containerOptions)||void 0===o?void 0:o.enableBackFill,contentToolbarItems:c.contentToolbarItems,footerToolbarItems:c.footerToolbarItems,questionToolbarItems:c.questionToolbarItems,close:function(){a.close(),c.closed&&c.closed(c.context,c.params)},fullscreen:function(t){c.fullscreen&&c.fullscreen(t,c.context,c.params)},minimize:function(t){c.minimize&&c.minimize(t,c.context,c.params)}}),this.container))}},{key:"hidden",value:function(){this.container&&(this.container.style.display="none")}},{key:"show",value:function(){this.container&&(this.container.style.display="flex")}},{key:"close",value:function(){this.container&&(K(null,this.container),this.container.remove(),this.container=void 0)}}]),t}(),Jn=(e("chat",new Gn),new tt("chat-input-material")),Zn=function(t){var e=t.controller.materials;return de("div",{className:Jn.b(),children:e.value.map((function(e){return de(qe,{material:e,disabled:!1,controller:t.controller},e.id)}))})},Kn=function(t){var e=t.children,n=t.actions,i=t.content,r=t.position,o=void 0===r?"bottom":r,c=t.isOpen,s=t.onToggleOpen,l=t.onAction,h=new tt("pop"),d=St(ai),f=a(xt(c||!1),2),p=f[0],v=f[1],m=Nt(null),_=Nt(null);Ct((function(){void 0!==c&&v(c)}),[c]),Ct((function(){return _.current||(_.current=document.createElement("div"),_.current.className=h.b("content-container"),document.body.appendChild(_.current)),function(){_.current&&document.body.removeChild(_.current)}}),[]),Ct((function(){var t=function(t){!m.current||m.current.contains(t.target)||t.target.closest(".".concat(h.b("content")))||t.target.closest(".ibiz-quick-edit")||t.target.closest(".ibiz-picker__transfer")||(v(!1),null==s||s(!1))};return p&&document.addEventListener("mousedown",t),function(){document.removeEventListener("mousedown",t)}}),[p,s]);return de("span",{className:"".concat(h.b("trigger-container")),children:[de("span",{className:"".concat(h.b("trigger-element")),ref:m,onClick:function(t){t.stopPropagation();var e=!p;v(e),null==s||s(e)},children:e}),p&&_.current&&yn(de("div",{className:"".concat(h.b("content")," pop-").concat(o),style:function(){if(!m.current)return{};var t=m.current.getBoundingClientRect(),e={position:"absolute",zIndex:d.zIndex+1},n={bottom:{top:t.bottom+window.scrollY,left:t.left+window.scrollX},top:{bottom:window.innerHeight-t.top+window.scrollY,left:t.left+window.scrollX},left:{top:t.top+window.scrollY,right:window.innerWidth-t.left+window.scrollX},right:{top:t.top+window.scrollY,left:t.right+window.scrollX},"top-left":{bottom:window.innerHeight-t.top+window.scrollY,right:window.innerWidth-t.left+window.scrollX}};return u(u({},e),n[o])}(),children:i||(null==n?void 0:n.map((function(t){return de("div",{className:h.b("content-item"),onMouseDown:function(e){e.stopPropagation(),null==l||l(t.id,e)},children:[t.icon&&de("img",{className:h.b("content-item__icon"),src:t.icon,alt:t.caption}),de("div",{className:h.b("content-item__caption"),children:t.caption})]},t.id)})))}),_.current)]})},Qn=new tt("chat-input"),ti=window.SpeechRecognition||window.webkitSpeechRecognition,ei=function(t){var e,n=a(xt(!1),2),i=n[0],r=n[1],o=Nt(null),c=t.controller.input,s=le(!1),l=Nt();ti&&!l.current&&(l.current=new ti,l.current.onstart=function(){s.value=!0},l.current.onend=function(){s.value=!1},l.current.onresult=function(t){var e,n=null===(e=t.results)||void 0===e||null===(e=e[0])||void 0===e||null===(e=e[0])||void 0===e?void 0:e.transcript;n&&(c.value="".concat(c.value).concat(n))});var u=Tt((function(t){c.value=t.target.value}),[c]),d=ue((function(){return c.value.length<=0}));Ct((function(){return o.current&&Hn(o.current),function(){o.current&&Hn.destroy(o.current)}}),[o]);var p=Tt(f(h().mark((function e(){var n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=c.value,c.value="",e.next=5,t.controller.question(n);case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))),[c]),v=Tt(f(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{t.controller.abortQuestion()}catch(n){console.error(n)}case 1:case"end":return e.stop()}}),e)}))),[c]),m=function(){var e=f(h().mark((function e(n){var i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Xn.getMaterialHelper("ossfile",t.controller),e.next=3,i.excuteAction(n);case 3:r(!1);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),_=function(){var e=f(h().mark((function e(n,i){var o;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=Xn.getMaterialHelper("common",t.controller),e.next=3,o.excuteAction(n,i);case 3:r(!1);case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return de("div",{className:Qn.b("wrapper"),children:[de("div",{className:Qn.b("material-wrapper"),children:de(Zn,{controller:t.controller})}),de("div",{className:Qn.b("main-wrapper"),children:[de("textarea",{className:Qn.e("textarea"),type:"text",rows:6,autoCorrect:"off",autoCapitalize:"off",autoComplete:"off",value:c,onInput:u,onKeyDown:function(t){"Enter"!==t.code||t.isComposing||(t.stopPropagation(),!1===t.shiftKey&&p())},ref:o,disabled:t.controller.isLoading.value}),de("div",{className:Qn.b("action-wrapper"),children:[de("div",{className:"".concat(Qn.be("action-wrapper","action-item")),children:de(Kn,{content:de("div",{className:Qn.b("pop-actions"),children:[de("div",{className:Qn.b("pop-action-item"),onClick:function(t){m(t)},children:[de("span",{className:Qn.b("pop-action-item-icon"),children:de(ze,{})}),de("span",{className:Qn.b("pop-action-item-title"),children:"文件资料"})]}),null===(e=t.questionToolbarItems)||void 0===e?void 0:e.map((function(t){return de("div",{className:Qn.b("pop-action-item"),onClick:function(e){_(e,t)},children:[de("span",{className:Qn.b("pop-action-item-icon"),children:"function"==typeof t.icon?t.icon(M):t.icon}),de("span",{className:Qn.b("pop-action-item-title"),children:"function"==typeof t.label?t.label(M):t.label})]},t.id)}))]}),position:"top-left",isOpen:i,onToggleOpen:r,children:de(Oe,{})})}),de("div",{title:s.value?"语音输入中...":"语音输入",className:"".concat(Qn.be("action-wrapper","action-item")),onClick:function(){l.current&&!s.value&&l.current.start()},children:s.value?de(Ne,{}):de(Ce,{})}),t.controller.isLoading.value?de("div",{title:"停止生成",className:"".concat(Qn.be("action-wrapper","action-item")),onClick:v,children:de(Ie,{})}):de("div",{title:"发送消息",className:"".concat(Qn.be("action-wrapper","action-item")),onClick:p,children:de(ve,{className:"".concat(Qn.is("disabled",d.value))})})]})]})]})},ni=new tt("chat-topic-item"),ii=function(t){var e=t.controller,n=t.topic,i=t.onClick,r=t.onAction,o=ue((function(){var t;return(null===(t=e.activedTopic.value)||void 0===t?void 0:t.id)===n.id})),c=a(xt(!1),2),s=c[0],l=c[1];return de("div",{className:"".concat(ni.b()," ").concat(ni.is("active",o.value)),onClick:i.bind(void 0),children:[de("div",{className:ni.b("caption"),title:n.caption,children:n.caption}),de("div",{className:ni.b("icon"),children:[de("span",{className:ni.be("icon","item"),title:"跳转主视图",onClick:function(t){t.stopPropagation(),r("LINK",t)}.bind(void 0),children:de(Te,{className:ni.b("link-icon")})}),o.value?null:de(Kn,{actions:[{id:"DELETE",caption:"删除话题"}],position:"bottom",isOpen:s,onToggleOpen:l,onAction:function(t,e){"DELETE"===t&&r("DELETE",e),l(!1)}.bind(void 0),children:de("span",{className:ni.be("icon","item"),title:"更多",children:de(Ee,{className:ni.b("more-icon")})})})]})]})},ri=new tt("chat-topics"),oi=function(t){var e=t.controller.topics;return de("div",{className:ri.b(),children:e.value.map((function(e){return de(ii,{topic:e,controller:t.controller,onClick:function(){return function(e){t.controller.handleTopicChange(e)}(e)},onAction:function(n,i){return function(e,n,i){t.controller.handleTopicAction(e,n,i)}(n,e,i)}},e.id)}))})},ai=function(t,e){var n={__c:e="__cC"+x++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,i;return this.getChildContext||(n=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some((function(t){t.__e=!0,P(t)}))},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}({zIndex:10,enableBackFill:!0}),ci=function(e){t(o,e);var r=n(o);function o(t){var e,n,a,c,s;return v(this,o),g(i(s=r.call(this,t)),"ns",new tt("chat-container")),g(i(s),"containerRef",{current:null}),g(i(s),"dragHandle",{current:null}),g(i(s),"minimizeRef",{current:null}),g(i(s),"data",{y:0,height:1,width:600/window.innerWidth,x:(window.innerWidth-600)/window.innerWidth,minWidth:500,minHeight:300}),g(i(s),"minimizeData",{x:(window.innerWidth-86)/window.innerWidth,y:(window.innerHeight-86)/window.innerHeight}),g(i(s),"disabled",!1),g(i(s),"isDragging",!1),g(i(s),"containerContext",{zIndex:(null===(e=s.props.containerOptions)||void 0===e?void 0:e.zIndex)||10,enableBackFill:void 0===(null===(n=s.props)||void 0===n?void 0:n.enableBackFill)||null===(null===(a=s.props)||void 0===a?void 0:a.enableBackFill)||(null===(c=s.props)||void 0===c?void 0:c.enableBackFill)}),s.state={isFullScreen:!1,isMinimize:!1},s}return _(o,[{key:"calcWindowStyle",value:function(){var t;return{left:"".concat(100*this.data.x,"%"),top:"".concat(100*this.data.y,"%"),width:"".concat(100*this.data.width,"%"),height:"".concat(100*this.data.height,"%"),minWidth:"".concat(this.data.minWidth,"px"),minHeight:"".concat(this.data.minHeight,"px"),"z-index":(null===(t=this.props.containerOptions)||void 0===t||null===(t=t.zIndex)||void 0===t?void 0:t.toString())||"10"}}},{key:"calcMinimizeStyle",value:function(){return{left:"".concat(100*this.minimizeData.x,"%"),top:"".concat(100*this.minimizeData.y,"%"),"z-index":"99999"}}},{key:"setStyle",value:function(){Object.assign(this.containerRef.current.style,this.calcWindowStyle()),Object.assign(this.minimizeRef.current.style,this.calcMinimizeStyle())}},{key:"isWithinBounds",value:function(t){return t.x>=0&&t.x<=1&&t.y>=0&&t.y<=1}},{key:"snapToEdge",value:function(){var t=20/window.innerWidth,e=20/window.innerHeight;this.data.x<t&&(this.data.x=0),this.data.x+this.data.width>1-t&&(this.data.x=1-this.data.width),this.data.y<e&&(this.data.y=0),this.data.y+this.data.height>1-e&&(this.data.y=1-this.data.height),this.setStyle()}},{key:"limitDraggable",value:function(t,e,n,i){var r=t/window.innerWidth,o=e/window.innerHeight;return{x:Math.max(0,Math.min(r,1-n)),y:Math.max(0,Math.min(o,1-i))}}},{key:"registerDragMinmize",value:function(){var t=this;this.minimizeRef.current.onmousedown=function(e){document.body.style.userSelect="none";var n=e.clientX-t.minimizeRef.current.offsetLeft,i=e.clientY-t.minimizeRef.current.offsetTop,r=Date.now(),o=function(e){var r=56/window.innerWidth,o=56/window.innerHeight,a=t.limitDraggable(e.clientX-n,e.clientY-i,r,o),c=a.x,s=a.y;Object.assign(t.minimizeData,{x:c,y:s}),t.setStyle()};document.addEventListener("mousemove",o),document.addEventListener("mouseup",(function e(){var n=Date.now();t.isDragging=n-r>300,document.body.style.userSelect="",document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",e)}))}}},{key:"registerDragDialog",value:function(){var t=this;this.dragHandle.current.onmousedown=function(e){if(!t.state.isFullScreen){document.body.style.userSelect="none";var n=e.clientX-t.containerRef.current.offsetLeft,i=e.clientY-t.containerRef.current.offsetTop,r=function(e){if(!t.disabled){var r=t.limitDraggable(e.clientX-n,e.clientY-i,t.data.width,t.data.height),o=r.x,a=r.y;Object.assign(t.data,{x:o,y:a}),t.setStyle()}};document.addEventListener("mousemove",r),document.addEventListener("mouseup",(function e(){document.body.style.userSelect="",document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",e),t.disabled||t.snapToEdge()}))}}}},{key:"registerDragDialogBorder",value:function(){var t=this;c(this.containerRef.current).resizable({edges:{top:!0,right:!0,bottom:!0,left:!0},margin:6,modifiers:[c.modifiers.restrictEdges({outer:document.body}),c.modifiers.restrictSize({min:{width:this.data.minWidth,height:this.data.minHeight}})],inertia:!0,listeners:{move:function(e){t.state.isFullScreen||(t.data.x=e.rect.left/window.innerWidth,t.data.y=e.rect.top/window.innerHeight,t.data.width=e.rect.width/window.innerWidth,t.data.height=e.rect.height/window.innerHeight,t.setStyle())},start:function(){t.disabled=!0,document.body.style.userSelect="none"},end:function(){t.disabled=!1,document.body.style.userSelect=""}}})}},{key:"componentDidMount",value:function(){var t=localStorage.getItem(Un.MINIMIZE_STYLY_CHCHE);if(t){var e=JSON.parse(t);this.isWithinBounds(e)&&(this.minimizeData=e)}var n=localStorage.getItem(Un.STYLE_CACHE);if(n){var i=JSON.parse(n);this.isWithinBounds(i)&&(this.data=i)}this.setStyle(),this.registerDragDialog(),this.registerDragDialogBorder(),this.registerDragMinmize()}},{key:"componentWillUnmount",value:function(){localStorage.setItem(Un.STYLE_CACHE,JSON.stringify(this.data)),localStorage.setItem(Un.MINIMIZE_STYLY_CHCHE,JSON.stringify(this.minimizeData))}},{key:"close",value:function(){this.props.close()}},{key:"fullScreen",value:function(){var t=this.containerRef.current;t&&(t.requestFullscreen(),this.setState({isFullScreen:!0}),this.props.fullscreen(!0))}},{key:"closeFullScreen",value:function(){var t;this.state.isFullScreen&&(null===(t=document)||void 0===t||t.exitFullscreen(),this.setState({isFullScreen:!1}),this.props.fullscreen(!1),this.setStyle())}},{key:"minimize",value:function(){this.closeFullScreen(),this.setState({isMinimize:!0}),this.props.minimize(!0)}},{key:"exitMinimize",value:function(){this.isDragging||(this.setState({isMinimize:!1}),this.props.minimize(!1))}},{key:"stopPropagation",value:function(t){t.stopPropagation()}},{key:"render",value:function(){return de(ai.Provider,{value:this.containerContext,children:de("div",{className:"".concat(this.ns.b()),children:[de("div",{className:"".concat(this.ns.e("dialog")," ").concat(this.ns.is("full-screen",this.state.isFullScreen)," ").concat(this.ns.is("hidden",this.state.isMinimize)),ref:this.containerRef,children:[de("div",{ref:this.dragHandle,className:this.ns.b("header"),children:[de("div",{className:this.ns.b("header-caption"),children:this.props.caption||"AI助手"}),de("div",{className:this.ns.b("header-action-wrapper"),children:[de("div",{title:"最小化",className:"".concat(this.ns.be("header-action-wrapper","action-item")," ").concat(this.ns.be("header-action-wrapper","minimize")),onMouseDown:this.stopPropagation.bind(this),onClick:this.minimize.bind(this),children:de(we,{})}),this.state.isFullScreen?de("div",{title:"退出全屏",className:"".concat(this.ns.be("header-action-wrapper","action-item")," ").concat(this.ns.be("header-action-wrapper","close-full-screen")),onMouseDown:this.stopPropagation.bind(this),onClick:this.closeFullScreen.bind(this),children:de(be,{})}):de("div",{title:"全屏",className:"".concat(this.ns.be("header-action-wrapper","action-item")," ").concat(this.ns.be("header-action-wrapper","full-screen")),onMouseDown:this.stopPropagation.bind(this),onClick:this.fullScreen.bind(this),children:de(ye,{})}),de("div",{title:"关闭",className:"".concat(this.ns.be("header-action-wrapper","action-item")," ").concat(this.ns.be("header-action-wrapper","action-close")),onMouseDown:this.stopPropagation.bind(this),onClick:this.close.bind(this),children:de(fe,{})})]})]}),"TOPIC"===this.props.mode?de("div",{className:"".concat(this.ns.b("main")),children:[de("div",{className:"".concat(this.ns.be("main","left")),children:de(oi,{controller:this.props.aiTopic})}),de("div",{className:"".concat(this.ns.be("main","right")),children:[de("div",{className:this.ns.b("content"),children:de(on,{controller:this.props.aiChat,toolbarItems:this.props.contentToolbarItems})}),de(en,{data:this.props.aiTopic.activedTopic.value,type:"footer",className:this.ns.e("toolbar"),controller:this.props.aiChat,items:this.props.footerToolbarItems}),de("div",{className:this.ns.b("footer"),children:de(ei,{controller:this.props.aiChat,questionToolbarItems:this.props.questionToolbarItems})})]})]}):de("div",{className:"".concat(this.ns.be("main","default")),children:[de("div",{className:this.ns.b("content"),children:de(on,{controller:this.props.aiChat,toolbarItems:this.props.contentToolbarItems})}),de(en,{data:this.props.aiTopic.activedTopic.value,type:"footer",className:this.ns.e("toolbar"),controller:this.props.aiChat,items:this.props.footerToolbarItems}),de("div",{className:this.ns.b("footer"),children:de(ei,{controller:this.props.aiChat,questionToolbarItems:this.props.questionToolbarItems})})]})]}),de("div",{title:"AI助手",ref:this.minimizeRef,className:"".concat(this.ns.e("minimize")," ").concat(this.ns.is("hidden",!this.state.isMinimize)),onClick:this.exitMinimize.bind(this),children:de(ke,{})})]})})}}]),o}(L);e("ChatContainer",ci)}}}))}();