You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
56 KiB
2 lines
56 KiB
(self.webpackChunk_coze_studio_app=self.webpackChunk_coze_studio_app||[]).push([["6237"],{570943:function(e,t,n){var o="Expected a function",i=0/0,r=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt,u="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,d="object"==typeof self&&self&&self.Object===Object&&self,f=u||d||Function("return this")(),p=Object.prototype.toString,h=Math.max,m=Math.min,v=function(){return f.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||(n=t)&&"object"==typeof n&&"[object Symbol]"==p.call(t))return i;if(g(e)){var t,n,o="function"==typeof e.valueOf?e.valueOf():e;e=g(o)?o+"":o}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var u=s.test(e);return u||l.test(e)?c(e.slice(2),u?2:8):a.test(e)?i:+e}e.exports=function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw TypeError(o);return g(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),function(e,t,n){var i,r,a,s,l,c,u=0,d=!1,f=!1,p=!0;if("function"!=typeof e)throw TypeError(o);function b(t){var n=i,o=r;return i=r=void 0,u=t,s=e.apply(o,n)}t=y(t)||0,g(n)&&(d=!!n.leading,a=(f="maxWait"in n)?h(y(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p);function _(e){var n=e-c,o=e-u;return void 0===c||n>=t||n<0||f&&o>=a}function w(){var e,n,o,i,r=v();if(_(r))return x(r);l=setTimeout(w,(n=(e=r)-c,o=e-u,i=t-n,f?m(i,a-o):i))}function x(e){return(l=void 0,p&&i)?b(e):(i=r=void 0,s)}function j(){var e,n=v(),o=_(n);if(i=arguments,r=this,c=n,o){if(void 0===l){;return u=e=c,l=setTimeout(w,t),d?b(e):s}if(f)return l=setTimeout(w,t),b(c)}return void 0===l&&(l=setTimeout(w,t)),s}return j.cancel=function(){void 0!==l&&clearTimeout(l),u=0,i=c=r=l=void 0},j.flush=function(){return void 0===l?s:x(v())},j}(e,t,{leading:i,maxWait:t,trailing:r})}},270555:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=a(n(455069)),r=a(n(28166));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(){return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"render",value:function(){return i.default.createElement("button",this.props,this.props.children)}}]),t}(i.default.Component);t.default=(0,r.default)(s)},227714:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=l(n(455069)),a=l(n(422336)),s=l(n(274325));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"render",value:function(){var e=this,t=o({},this.props);return delete t.name,t.parentBindings&&delete t.parentBindings,r.default.createElement("div",o({},t,{ref:function(t){e.props.parentBindings.domNode=t}}),this.props.children)}}]),t}(r.default.Component);c.propTypes={name:s.default.string,id:s.default.string},t.default=(0,a.default)(c)},129541:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(455069)),i=r(n(28166));function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var s=function(e){function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);for(var e,n,i,r=arguments.length,s=Array(r),l=0;l<r;l++)s[l]=arguments[l];return n=i=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),i.render=function(){return o.default.createElement("a",i.props,i.props.children)},a(i,n)}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(o.default.Component);t.default=(0,i.default)(s)},655522:function(e,t,n){"use strict";t.scroller=t.Element=void 0;var o,i=h(n(129541)),r=h(n(270555)),a=h(n(227714)),s=h(n(268801)),l=h(n(117672)),c=h(n(823776)),u=h(n(898572)),d=h(n(28166)),f=h(n(422336)),p=h(n(524781));function h(e){return e&&e.__esModule?e:{default:e}}i.default,r.default,t.Element=a.default,t.scroller=s.default,l.default,c.default,u.default,d.default,f.default,p.default,i.default,r.default,a.default,s.default,l.default,c.default,u.default,d.default,f.default,p.default},524781:function(e,t,n){"use strict";var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}();function r(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function s(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=n(455069);n(921463),n(958495);var c=n(823776),u=n(268801),d=n(274325),f=n(559708),p={to:d.string.isRequired,containerId:d.string,container:d.object,activeClass:d.string,spy:d.bool,smooth:d.oneOfType([d.bool,d.string]),offset:d.number,delay:d.number,isDynamic:d.bool,onClick:d.func,duration:d.oneOfType([d.number,d.func]),absolute:d.bool,onSetActive:d.func,onSetInactive:d.func,ignoreCancelEvents:d.bool,hashSpy:d.bool,spyThrottle:d.number};e.exports={Scroll:function(e,t){console.warn("Helpers.Scroll is deprecated since v1.7.0");var n=t||u,d=function(t){function u(e){r(this,u);var t=a(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,e));return h.call(t),t.state={active:!1},t}return s(u,t),i(u,[{key:"getScrollSpyContainer",value:function(){var e=this.props.containerId,t=this.props.container;return e?document.getElementById(e):t&&t.nodeType?t:document}},{key:"componentDidMount",value:function(){if(this.props.spy||this.props.hashSpy){var e=this.getScrollSpyContainer();!c.isMounted(e)&&c.mount(e,this.props.spyThrottle),this.props.hashSpy&&(!f.isMounted()&&f.mount(n),f.mapContainer(this.props.to,e)),this.props.spy&&c.addStateHandler(this.stateHandler),c.addSpyHandler(this.spyHandler,e),this.setState({container:e})}}},{key:"componentWillUnmount",value:function(){c.unmount(this.stateHandler,this.spyHandler)}},{key:"render",value:function(){var t="";t=this.state&&this.state.active?((this.props.className||"")+" "+(this.props.activeClass||"active")).trim():this.props.className;var n=o({},this.props);for(var i in p)n.hasOwnProperty(i)&&delete n[i];return n.className=t,n.onClick=this.handleClick,l.createElement(e,n)}}]),u}(l.Component),h=function(){var e=this;this.scrollTo=function(t,i){n.scrollTo(t,o({},e.state,i))},this.handleClick=function(t){e.props.onClick&&e.props.onClick(t),t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),e.scrollTo(e.props.to,e.props)},this.stateHandler=function(){n.getActiveLink()!==e.props.to&&(null!==e.state&&e.state.active&&e.props.onSetInactive&&e.props.onSetInactive(),e.setState({active:!1}))},this.spyHandler=function(t){var o=e.getScrollSpyContainer();if(!f.isMounted()||!!f.isInitialized()){var i=e.props.to,r=null,a=0,s=0,l=0;if(o.getBoundingClientRect&&(l=o.getBoundingClientRect().top),!r||e.props.isDynamic){if(!(r=n.get(i)))return;var u=r.getBoundingClientRect();s=(a=u.top-l+t)+u.height}var d=t-e.props.offset,p=d>=Math.floor(a)&&d<Math.floor(s),h=d<Math.floor(a)||d>=Math.floor(s),m=n.getActiveLink();return h?(i===m&&n.setActiveLink(void 0),e.props.hashSpy&&f.getHash()===i&&f.changeHash(),e.props.spy&&e.state.active&&(e.setState({active:!1}),e.props.onSetInactive&&e.props.onSetInactive()),c.updateStates()):p&&m!==i?(n.setActiveLink(i),e.props.hashSpy&&f.changeHash(i),e.props.spy&&(e.setState({active:!0}),e.props.onSetActive&&e.props.onSetActive(i)),c.updateStates()):void 0}}};return d.propTypes=p,d.defaultProps={offset:0},d},Element:function(e){console.warn("Helpers.Element is deprecated since v1.7.0");var t=function(t){function n(e){r(this,n);var t=a(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.childBindings={domNode:null},t}return s(n,t),i(n,[{key:"componentDidMount",value:function(){if("undefined"==typeof window)return!1;this.registerElems(this.props.name)}},{key:"componentDidUpdate",value:function(e){this.props.name!==e.name&&this.registerElems(this.props.name)}},{key:"componentWillUnmount",value:function(){if("undefined"==typeof window)return!1;u.unregister(this.props.name)}},{key:"registerElems",value:function(e){u.register(e,this.childBindings.domNode)}},{key:"render",value:function(){return l.createElement(e,o({},this.props,{parentBindings:this.childBindings}))}}]),n}(l.Component);return t.propTypes={name:d.string,id:d.string},t}}},898572:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e};s(n(958495));var i=s(n(331900)),r=s(n(685670)),a=s(n(117672));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e){return i.default[e.smooth]||i.default.defaultEasing},c=function(){if("undefined"!=typeof window)return window.requestAnimationFrame||window.webkitRequestAnimationFrame},u=c()||function(e,t,n){window.setTimeout(e,n||1e3/60,new Date().getTime())},d=function(){return{currentPosition:0,startPosition:0,targetPosition:0,progress:0,duration:0,cancel:!1,target:null,containerElement:null,to:null,start:null,delta:null,percent:null,delayTimeout:null}},f=function(e){var t=e.data.containerElement;if(t&&t!==document&&t!==document.body)return t.scrollLeft;var n=void 0!==window.pageXOffset,o="CSS1Compat"===(document.compatMode||"");return n?window.pageXOffset:o?document.documentElement.scrollLeft:document.body.scrollLeft},p=function(e){var t=e.data.containerElement;if(t&&t!==document&&t!==document.body)return t.scrollTop;var n=void 0!==window.pageXOffset,o="CSS1Compat"===(document.compatMode||"");return n?window.pageYOffset:o?document.documentElement.scrollTop:document.body.scrollTop},h=function(e){var t=e.data.containerElement;if(t&&t!==document&&t!==document.body)return t.scrollWidth-t.offsetWidth;var n=document.body,o=document.documentElement;return Math.max(n.scrollWidth,n.offsetWidth,o.clientWidth,o.scrollWidth,o.offsetWidth)},m=function(e){var t=e.data.containerElement;if(t&&t!==document&&t!==document.body)return t.scrollHeight-t.offsetHeight;var n=document.body,o=document.documentElement;return Math.max(n.scrollHeight,n.offsetHeight,o.clientHeight,o.scrollHeight,o.offsetHeight)},v=function e(t,n,o){var i=n.data;if(!n.ignoreCancelEvents&&i.cancel){a.default.registered.end&&a.default.registered.end(i.to,i.target,i.currentPositionY);return}if(i.delta=Math.round(i.targetPosition-i.startPosition),null===i.start&&(i.start=o),i.progress=o-i.start,i.percent=i.progress>=i.duration?1:t(i.progress/i.duration),i.currentPosition=i.startPosition+Math.ceil(i.delta*i.percent),i.containerElement&&i.containerElement!==document&&i.containerElement!==document.body?n.horizontal?i.containerElement.scrollLeft=i.currentPosition:i.containerElement.scrollTop=i.currentPosition:n.horizontal?window.scrollTo(i.currentPosition,0):window.scrollTo(0,i.currentPosition),i.percent<1){var r=e.bind(null,t,n);u.call(window,r);return}a.default.registered.end&&a.default.registered.end(i.to,i.target,i.currentPosition)},g=function(e){e.data.containerElement=e?e.containerId?document.getElementById(e.containerId):e.container&&e.container.nodeType?e.container:document:null},y=function(e,t,n,o){t.data=t.data||d(),window.clearTimeout(t.data.delayTimeout);if(r.default.subscribe(function(){t.data.cancel=!0}),g(t),t.data.start=null,t.data.cancel=!1,t.data.startPosition=t.horizontal?f(t):p(t),t.data.targetPosition=t.absolute?e:e+t.data.startPosition,t.data.startPosition===t.data.targetPosition){a.default.registered.end&&a.default.registered.end(t.data.to,t.data.target,t.data.currentPosition);return}t.data.delta=Math.round(t.data.targetPosition-t.data.startPosition),t.data.duration=("function"==typeof(i=t.duration)?i:function(){return i})(t.data.delta),t.data.duration=isNaN(parseFloat(t.data.duration))?1e3:parseFloat(t.data.duration),t.data.to=n,t.data.target=o;var i,s=l(t),c=v.bind(null,s,t);if(t&&t.delay>0){t.data.delayTimeout=window.setTimeout(function(){a.default.registered.begin&&a.default.registered.begin(t.data.to,t.data.target),u.call(window,c)},t.delay);return}a.default.registered.begin&&a.default.registered.begin(t.data.to,t.data.target),u.call(window,c)},b=function(e){return(e=o({},e)).data=e.data||d(),e.absolute=!0,e};t.default={animateTopScroll:y,getAnimationType:l,scrollToTop:function(e){y(0,b(e))},scrollToBottom:function(e){g(e=b(e)),y(e.horizontal?h(e):m(e),e)},scrollTo:function(e,t){y(e,b(t))},scrollMore:function(e,t){g(t=b(t)),y(e+(t.horizontal?f(t):p(t)),t)}}},685670:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(173274),i=["mousedown","wheel","touchmove","keydown"];t.default={subscribe:function(e){return"undefined"!=typeof document&&i.forEach(function(t){return(0,o.addPassiveEventListener)(document,t,e)})}}},173274:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addPassiveEventListener=function(e,t,o){var i=o.name;!i&&(i=t,console.warn("Listener must be a named function.")),!n.has(t)&&n.set(t,new Set);var r=n.get(t);if(!r.has(i)){var a=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t)}catch(e){}return e}();e.addEventListener(t,o,!!a&&{passive:!0}),r.add(i)}},t.removePassiveEventListener=function(e,t,o){e.removeEventListener(t,o),n.get(t).delete(o.name||t)};var n=new Map},422336:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=l(n(455069));l(n(921463));var a=l(n(268801)),s=l(n(274325));function l(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=function(t){function n(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.childBindings={domNode:null},t}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,t),i(n,[{key:"componentDidMount",value:function(){if("undefined"==typeof window)return!1;this.registerElems(this.props.name)}},{key:"componentDidUpdate",value:function(e){this.props.name!==e.name&&this.registerElems(this.props.name)}},{key:"componentWillUnmount",value:function(){if("undefined"==typeof window)return!1;a.default.unregister(this.props.name)}},{key:"registerElems",value:function(e){a.default.register(e,this.childBindings.domNode)}},{key:"render",value:function(){return r.default.createElement(e,o({},this.props,{parentBindings:this.childBindings}))}}]),n}(r.default.Component);return t.propTypes={name:s.default.string,id:s.default.string},t}},117672:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={registered:{},scrollEvent:{register:function(e,t){n.registered[e]=t},remove:function(e){n.registered[e]=null}}};t.default=n},559708:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(173274);var o=function(e){return e&&e.__esModule?e:{default:e}}(n(958495));t.default={mountFlag:!1,initialized:!1,scroller:null,containers:{},mount:function(e){this.scroller=e,this.handleHashChange=this.handleHashChange.bind(this),window.addEventListener("hashchange",this.handleHashChange),this.initStateFromHash(),this.mountFlag=!0},mapContainer:function(e,t){this.containers[e]=t},isMounted:function(){return this.mountFlag},isInitialized:function(){return this.initialized},initStateFromHash:function(){var e=this,t=this.getHash();t?window.setTimeout(function(){e.scrollTo(t,!0),e.initialized=!0},10):this.initialized=!0},scrollTo:function(e,t){var n=this.scroller;if(n.get(e)&&(t||e!==n.getActiveLink())){var o=this.containers[e]||document;n.scrollTo(e,{container:o})}},getHash:function(){return o.default.getHash()},changeHash:function(e,t){this.isInitialized()&&o.default.getHash()!==e&&o.default.updateHash(e,t)},handleHashChange:function(){this.scrollTo(this.getHash())},unmount:function(){this.scroller=null,this.containers=null,window.removeEventListener("hashchange",this.handleHashChange)}}},28166:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=u(n(455069)),a=u(n(823776)),s=u(n(268801)),l=u(n(274325)),c=u(n(559708));function u(e){return e&&e.__esModule?e:{default:e}}var d={to:l.default.string.isRequired,containerId:l.default.string,container:l.default.object,activeClass:l.default.string,activeStyle:l.default.object,spy:l.default.bool,horizontal:l.default.bool,smooth:l.default.oneOfType([l.default.bool,l.default.string]),offset:l.default.number,delay:l.default.number,isDynamic:l.default.bool,onClick:l.default.func,duration:l.default.oneOfType([l.default.number,l.default.func]),absolute:l.default.bool,onSetActive:l.default.func,onSetInactive:l.default.func,ignoreCancelEvents:l.default.bool,hashSpy:l.default.bool,saveHashHistory:l.default.bool,spyThrottle:l.default.number};t.default=function(e,t){var n=t||s.default,l=function(t){function s(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,s);var t=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,e));return u.call(t),t.state={active:!1},t.beforeUnmountCallbacks=[],t}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(s,t),i(s,[{key:"getScrollSpyContainer",value:function(){var e=this.props.containerId,t=this.props.container;return e&&!t?document.getElementById(e):t&&t.nodeType?t:document}},{key:"componentDidMount",value:function(){if(this.props.spy||this.props.hashSpy){var e=this.getScrollSpyContainer();if(!a.default.isMounted(e)){var t=a.default.mount(e,this.props.spyThrottle);this.beforeUnmountCallbacks.push(t)}this.props.hashSpy&&(!c.default.isMounted()&&c.default.mount(n),c.default.mapContainer(this.props.to,e)),a.default.addSpyHandler(this.spyHandler,e),this.setState({container:e})}}},{key:"componentWillUnmount",value:function(){a.default.unmount(this.stateHandler,this.spyHandler),this.beforeUnmountCallbacks.forEach(function(e){return e()})}},{key:"render",value:function(){var t="";t=this.state&&this.state.active?((this.props.className||"")+" "+(this.props.activeClass||"active")).trim():this.props.className;var n={};n=this.state&&this.state.active?o({},this.props.style,this.props.activeStyle):o({},this.props.style);var i=o({},this.props);for(var a in d)i.hasOwnProperty(a)&&delete i[a];return i.className=t,i.style=n,i.onClick=this.handleClick,r.default.createElement(e,i)}}]),s}(r.default.PureComponent),u=function(){var e=this;this.scrollTo=function(t,i){n.scrollTo(t,o({},e.state,i))},this.handleClick=function(t){e.props.onClick&&e.props.onClick(t),t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),e.scrollTo(e.props.to,e.props)},this.spyHandler=function(t,o){var i=e.getScrollSpyContainer();if(!c.default.isMounted()||!!c.default.isInitialized()){var r=e.props.horizontal,a=e.props.to,s=null,l=void 0,u=void 0;if(r){var d=0,f=0,p=0;if(i.getBoundingClientRect&&(p=i.getBoundingClientRect().left),!s||e.props.isDynamic){if(!(s=n.get(a)))return;var h=s.getBoundingClientRect();f=(d=h.left-p+t)+h.width}var m=t-e.props.offset;l=m>=Math.floor(d)&&m<Math.floor(f),u=m<Math.floor(d)||m>=Math.floor(f)}else{var v=0,g=0,y=0;if(i.getBoundingClientRect&&(y=i.getBoundingClientRect().top),!s||e.props.isDynamic){if(!(s=n.get(a)))return;var b=s.getBoundingClientRect();g=(v=b.top-y+o)+b.height}var _=o-e.props.offset;l=_>=Math.floor(v)&&_<Math.floor(g),u=_<Math.floor(v)||_>=Math.floor(g)}var w=n.getActiveLink();if(u){if(a===w&&n.setActiveLink(void 0),e.props.hashSpy&&c.default.getHash()===a){var x=e.props.saveHashHistory;c.default.changeHash("",void 0!==x&&x)}e.props.spy&&e.state.active&&(e.setState({active:!1}),e.props.onSetInactive&&e.props.onSetInactive(a,s))}if(l&&(w!==a||!1===e.state.active)){n.setActiveLink(a);var j=e.props.saveHashHistory;e.props.hashSpy&&c.default.changeHash(a,void 0!==j&&j),e.props.spy&&(e.setState({active:!0}),e.props.onSetActive&&e.props.onSetActive(a,s))}}}};return l.propTypes=d,l.defaultProps={offset:0},l}},823776:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){return e&&e.__esModule?e:{default:e}}(n(570943)),i=n(173274),r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:66;return(0,o.default)(e,t)},a={spyCallbacks:[],spySetState:[],scrollSpyContainers:[],mount:function(e,t){if(e){var n=r(function(t){a.scrollHandler(e)},t);return a.scrollSpyContainers.push(e),(0,i.addPassiveEventListener)(e,"scroll",n),function(){(0,i.removePassiveEventListener)(e,"scroll",n),a.scrollSpyContainers.splice(a.scrollSpyContainers.indexOf(e),1)}}return function(){}},isMounted:function(e){return -1!==a.scrollSpyContainers.indexOf(e)},currentPositionX:function(e){if(e!==document)return e.scrollLeft;var t=void 0!==window.scrollY,n="CSS1Compat"===(document.compatMode||"");return t?window.scrollX:n?document.documentElement.scrollLeft:document.body.scrollLeft},currentPositionY:function(e){if(e!==document)return e.scrollTop;var t=void 0!==window.scrollX,n="CSS1Compat"===(document.compatMode||"");return t?window.scrollY:n?document.documentElement.scrollTop:document.body.scrollTop},scrollHandler:function(e){(a.scrollSpyContainers[a.scrollSpyContainers.indexOf(e)].spyCallbacks||[]).forEach(function(t){return t(a.currentPositionX(e),a.currentPositionY(e))})},addStateHandler:function(e){a.spySetState.push(e)},addSpyHandler:function(e,t){var n=a.scrollSpyContainers[a.scrollSpyContainers.indexOf(t)];!n.spyCallbacks&&(n.spyCallbacks=[]),n.spyCallbacks.push(e)},updateStates:function(){a.spySetState.forEach(function(e){return e()})},unmount:function(e,t){a.scrollSpyContainers.forEach(function(e){return e.spyCallbacks&&e.spyCallbacks.length&&e.spyCallbacks.indexOf(t)>-1&&e.spyCallbacks.splice(e.spyCallbacks.indexOf(t),1)}),a.spySetState&&a.spySetState.length&&a.spySetState.indexOf(e)>-1&&a.spySetState.splice(a.spySetState.indexOf(e),1),document.removeEventListener("scroll",a.scrollHandler)},update:function(){return a.scrollSpyContainers.forEach(function(e){return a.scrollHandler(e)})}};t.default=a},268801:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},i=s(n(958495)),r=s(n(898572)),a=s(n(117672));function s(e){return e&&e.__esModule?e:{default:e}}var l={},c=void 0;t.default={unmount:function(){l={}},register:function(e,t){l[e]=t},unregister:function(e){delete l[e]},get:function(e){return l[e]||document.getElementById(e)||document.getElementsByName(e)[0]||document.getElementsByClassName(e)[0]},setActiveLink:function(e){return c=e},getActiveLink:function(){return c},scrollTo:function(e,t){var n=this.get(e);if(!n){console.warn("target Element not found");return}var s=(t=o({},t,{absolute:!1})).containerId,l=t.container,c=void 0;c=s?document.getElementById(s):l&&l.nodeType?l:document,t.absolute=!0;var u=t.horizontal,d=i.default.scrollOffset(c,n,u)+(t.offset||0);if(!t.smooth){a.default.registered.begin&&a.default.registered.begin(e,n),c===document?t.horizontal?window.scrollTo(d,0):window.scrollTo(0,d):c.scrollTop=d,a.default.registered.end&&a.default.registered.end(e,n);return}r.default.animateTopScroll(d,t,e,n)}}},331900:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={defaultEasing:function(e){return e<.5?Math.pow(2*e,2)/2:1-Math.pow((1-e)*2,2)/2},linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:-1+(4-2*e)*e},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}}},958495:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){for(var n=e.offsetTop,o=e.offsetParent;o&&!t(o);)n+=o.offsetTop,o=o.offsetParent;return{offsetTop:n,offsetParent:o}};t.default={updateHash:function(e,t){var n=0===e.indexOf("#")?e.substring(1):e,o=n?"#"+n:"",i=window&&window.location,r=o?i.pathname+i.search+o:i.pathname+i.search;t?history.pushState(history.state,"",r):history.replaceState(history.state,"",r)},getHash:function(){return window.location.hash.replace(/^#/,"")},filterElementInContainer:function(e){return function(t){return e.contains?e!=t&&e.contains(t):!!(16&e.compareDocumentPosition(t))}},scrollOffset:function(e,t,o){if(o)return e===document?t.getBoundingClientRect().left+(window.scrollX||window.pageXOffset):"static"!==getComputedStyle(e).position?t.offsetLeft:t.offsetLeft-e.offsetLeft;if(e===document)return t.getBoundingClientRect().top+(window.scrollY||window.pageYOffset);if("static"!==getComputedStyle(e).position){if(t.offsetParent!==e){var i=n(t,function(t){return t===e||t===document}),r=i.offsetTop;if(i.offsetParent!==e)throw Error("Seems containerElement is not an ancestor of the Element");return r}return t.offsetTop}if(t.offsetParent===e.offsetParent)return t.offsetTop-e.offsetTop;var a=function(e){return e===document};return n(t,a).offsetTop-n(e,a).offsetTop}}},832687:function(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>eE});var o,i=n("151064"),r=n("455069"),a=n("659596"),s=n("942185"),l=n("149528"),c=n("825955"),u=n("808549"),d=n("120454"),f=n("336205"),p=n("873183"),h=n("382534");var m=((o={}).DUPLICATE="duplicate",o.EXCEED_MAX_LENGTH="exceed-max-length",o),v="_10000010",g={connectorId:v,connectorName:f.o.t("workflow_saved_database")},y="10000010",b=[y,"10000122","10000129"],_=[y,"1024","999"],w=n("407821"),x=n.n(w),j=n("472772"),k=n.n(j),C=n("395245"),P=n.n(C),S=n("297998"),O=n.n(S),E=n("646576"),T=n.n(E),H=n("606121"),I=n.n(H),N=n("239496"),z={};z.styleTagTransform=I(),z.setAttributes=O(),z.insert=P().bind(null,"head"),z.domAPI=k(),z.insertStyleElement=T(),x()(N.Z,z);var A=N.Z&&N.Z.locals?N.Z.locals:void 0,{Text:M}=a.ZT,R=e=>{var t,n,{staticList:o,manualRefresh:s,setActivateChat:m}=e,{spaceId:v,projectId:g}=(0,l.zu)(e=>({spaceId:e.spaceId,projectId:e.projectId})),[y,b]=(0,r.useState)(!1),[_,w]=(0,r.useState)(!1),[x,j]=(0,r.useState)([]),[k,C]=(0,r.useState)(void 0),[P,S]=(0,r.useState)({}),O=o.filter(e=>e.unique_id!==(null==k?void 0:k.unique_id)).map(e=>({label:(0,i.jsx)(M,{style:{width:"100%"},ellipsis:{showTooltip:!0},children:e.conversation_name}),value:e.unique_id,conversationId:e.conversation_id}));var E=(t=(0,c._)(function*(e){C(e);var t=yield h.OH.DeleteProjectConversationDef({space_id:v,project_id:g,check_only:!0,unique_id:(null==e?void 0:e.unique_id)||""});if(t.need_replace){j(t.need_replace);var n={};t.need_replace.forEach(e=>{e.workflow_id&&(n[e.workflow_id]="Default")}),S(n)}else j([]);b(!0)}),function(e){return t.apply(this,arguments)});var T=(n=(0,c._)(function*(){w(!0);try{(yield h.OH.DeleteProjectConversationDef({space_id:v,project_id:g,unique_id:(null==k?void 0:k.unique_id)||"",replace:P})).success?(j([]),b(!1),a.FN.success(f.o.t("wf_chatflow_112")),s(),m(void 0)):a.FN.error(f.o.t("wf_chatflow_151"))}finally{w(!1)}}),function(){return n.apply(this,arguments)}),H=(e,t)=>{e&&t&&S((0,d._)((0,u._)({},P),{[e]:t}))};return{handleDelete:E,modalDom:(0,r.useMemo)(()=>{var e=(0,i.jsxs)("div",{className:A["rebind-chat"],children:[(0,i.jsx)("div",{className:A["rebind-title"],children:f.o.t("wf_chatflow_53")}),(0,i.jsx)("div",{className:A["rebind-desc"],children:f.o.t("wf_chatflow_54")}),x.map(e=>{var{name:t}=e;return(0,i.jsxs)("div",{className:A["rebind-item"],children:[(0,i.jsx)(p.TLD,{className:A["rebind-icon"]}),(0,i.jsx)(M,{ellipsis:{showTooltip:!0},className:A["rebind-text"],children:t}),(0,i.jsx)(a.Ph,{dropdownClassName:A["rebind-select"],style:{width:"50%"},dropdownStyle:{width:220},size:"small",defaultValue:"0",optionList:O,onChange:t=>{var n=o.find(e=>e.unique_id===t);H(e.workflow_id,null==n?void 0:n.conversation_name)}})]})})]});return(0,i.jsx)(a.u_,{visible:y,width:480,type:"dialog",title:f.o.t("wf_chatflow_51"),className:A.modal,okText:f.o.t("wf_chatflow_55"),cancelText:f.o.t("wf_chatflow_56"),onCancel:()=>b(!1),okButtonColor:"red",okButtonProps:{loading:_},onOk:T,children:(0,i.jsxs)("div",{className:A["content-container"],children:[(0,i.jsx)("div",{className:A["content-text"],children:f.o.t("wf_chatflow_52")}),(null==x?void 0:x.length)?e:null]})})},[k,x,y,O])}},Z=e=>{var t,{manualRefresh:n}=e,{spaceId:o,projectId:i}=(0,l.zu)(e=>({spaceId:e.spaceId,projectId:e.projectId})),[a,s]=(0,r.useState)(!1);return{loading:a,handleUpdateChat:(t=(0,c._)(function*(e,t){try{s(!0),yield h.OH.UpdateProjectConversationDef({space_id:o,project_id:i,unique_id:e,conversation_name:t}),n()}finally{s(!1)}}),function(e,n){return t.apply(this,arguments)})}},D=e=>{var t,{manualRefresh:n}=e,{spaceId:o,projectId:i}=(0,l.zu)(e=>({spaceId:e.spaceId,projectId:e.projectId})),[s,u]=(0,r.useState)(!1);return{loading:s,handleCreateChat:(t=(0,c._)(function*(e){try{u(!0);var t=yield h.OH.CreateProjectConversationDef({space_id:o,project_id:i,conversation_name:e});(null==t?void 0:t.code)===0?(a.FN.success(f.o.t("wf_chatflow_111")),n()):a.FN.error(f.o.t("wf_chatflow_112"))}finally{u(!1)}}),function(e){return t.apply(this,arguments)})}},B=n("567282"),L=e=>{var t,{spaceId:n,projectId:o,version:i}=(0,l.zu)(e=>({spaceId:e.spaceId,projectId:e.projectId,version:e.version})),[a,s]=(0,r.useState)([]);return{list:a,fetch:(t=(0,c._)(function*(){s((yield h.OH.ListProjectConversationDef((0,u._)({space_id:n,project_id:o,project_version:i,create_method:B.nS.ManualCreate,create_env:B.Af.Release,limit:1e3},e))).data||[])}),function(){return t.apply(this,arguments)})}},V=e=>{var{list:t,fetch:n}=L((0,u._)({create_method:B.nS.ManualCreate},e)),{list:o,fetch:i}=L((0,u._)({create_method:B.nS.NodeCreate},e));return{staticList:t,dynamicList:o,fetch:()=>{n(),i()}}},q=n("537845"),U=()=>{var e,t=(0,l.vp)(),[n,o]=(0,r.useState)([g]),[i,a]=(0,r.useState)(v),s=(0,r.useMemo)(()=>i===v?B.Af.Draft:B.Af.Release,[i]);var u=(e=(0,c._)(function*(){var e=(yield h.sD.GetProjectPublishedConnector({project_id:t})).data||[],n=!0;o([g,...e.reduce((e,t)=>t.id?(b.includes(t.id)?n&&(e.push({connectorId:y,connectorName:f.o.t("platform_name")}),n=!1):e.push({connectorId:t.id,connectorName:t.name}),e):e,[]).filter(e=>_.includes(e.connectorId))])}),function(){return e.apply(this,arguments)}),d=(0,q.Z)(e=>{var t;"tab"===e.name&&(null===(t=e.data)||void 0===t?void 0:t.value)==="testrun"&&a(v)});return(0,l.yg)(l.B6,d),(0,r.useEffect)(()=>{u()},[]),{connectorList:n,activeKey:i,createEnv:s,onTabChange:e=>{a(e)}}},F=e=>{var t,{spaceId:n,projectId:o}=(0,l.zu)(e=>({spaceId:e.spaceId,projectId:e.projectId}));return{batchDelete:(t=(0,c._)(function*(t){var i=e.createEnv===B.Af.Draft;(yield h.OH.BatchDeleteProjectConversation({space_id:n,project_id:o,unique_id_list:t,draft_mode:i,connector_id:i?"":e.connectorId})).Success?(a.FN.success(f.o.t("wf_chatflow_112")),e.manualRefresh(),e.setActivateChat(void 0)):a.FN.error(f.o.t("wf_chatflow_151"))}),function(e){return t.apply(this,arguments)})}},X=n("655522"),Q=n("157728"),G=n("252237"),W=n.n(G),K=n("933734"),J={};J.styleTagTransform=I(),J.setAttributes=O(),J.insert=P().bind(null,"head"),J.domAPI=k(),J.insertStyleElement=T(),x()(K.Z,J);var Y=K.Z&&K.Z.locals?K.Z.locals:void 0,$=e=>{var{title:t,tooltip:n,extra:o,className:r,onClick:s}=e;return(0,i.jsxs)("div",{className:W()(Y["title-container"],r),onClick:s,children:[(0,i.jsxs)("div",{className:Y["title-with-tip"],children:[t,(0,i.jsx)(a.u,{content:n,children:(0,i.jsx)(p.L03,{})})]}),(0,i.jsx)("div",{className:Y.extra,onClick:e=>e.stopPropagation(),children:o})]})},ee=n("986007"),et={};et.styleTagTransform=I(),et.setAttributes=O(),et.insert=P().bind(null,"head"),et.domAPI=k(),et.insertStyleElement=T(),x()(ee.Z,et);var en=ee.Z&&ee.Z.locals?ee.Z.locals:void 0,eo=e=>{var{ref:t,defaultValue:n,loading:o,onBlur:s,onValidate:l}=e,[c,u]=(0,r.useState)(n),[d,h]=(0,r.useState)(void 0),v=()=>{null==s||s(c,d),u("")},g=(0,r.useMemo)(()=>d===m.DUPLICATE?f.o.t("wf_chatflow_109"):d===m.EXCEED_MAX_LENGTH?f.o.t("wf_chatflow_116"):void 0,[d]);return(0,i.jsx)(a.II,{ref:t,className:en.input,size:"small",loading:o,autoFocus:!0,onChange:e=>{u(e);var t=null==l?void 0:l(e);t?h(t):h(void 0)},placeholder:"Please enter",defaultValue:n,error:!!d,suffix:d?(0,i.jsx)(a.u,{content:g,position:"right",children:(0,i.jsx)(p.wR2,{className:"coz-fg-hglt-red absolute right-1 text-[13px]"})}):null,onBlur:v,onEnterPress:v})},ei=n("483252"),er={};er.styleTagTransform=I(),er.setAttributes=O(),er.insert=P().bind(null,"head"),er.domAPI=k(),er.insertStyleElement=T(),x()(ei.Z,er);var ea=ei.Z&&ei.Z.locals?ei.Z.locals:void 0,{Text:es}=a.ZT,el=e=>{var t,n,o,{canEdit:s,list:l,activateChat:c,updateLoading:u,onUpdate:d,onDelete:h,onValidate:m,onSelectChat:v,renderCreateInput:g,handleCreateInput:y}=e,[b,_]=(0,r.useState)(""),w=(e,t)=>{!t&&d(b,e||""),_("")},x=e=>{_(e||"")};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($,{className:ea.title,title:f.o.t("project_conversation_list_static_title"),tooltip:f.o.t("wf_chatflow_104"),extra:s&&(0,i.jsx)(a.hU,{icon:(0,i.jsx)(p.PwN,{}),color:"highlight",size:"small",onClick:y}),onClick:()=>X.scroller.scrollTo("static",{duration:200,smooth:!0,containerId:"conversation-list"})}),(0,i.jsxs)("div",{className:ea["list-container"],children:[(0,i.jsx)("div",{className:W()(en["chat-item"],(null==c?void 0:c.unique_id)===(null===(t=l[0])||void 0===t?void 0:t.unique_id)&&en["chat-item-activate"]),onClick:()=>v(l[0]),children:(0,i.jsx)(es,{ellipsis:{showTooltip:!0},children:null===(n=l[0])||void 0===n?void 0:n.conversation_name})},null===(o=l[0])||void 0===o?void 0:o.unique_id),g(),l.slice(1).map(e=>(0,i.jsxs)("div",{className:W()(en["chat-item"],(null==c?void 0:c.unique_id)===e.unique_id&&en["chat-item-activate"],b===e.unique_id&&en["chat-item-editing"]),onClick:()=>v(e),children:[b===e.unique_id?(0,i.jsx)(eo,{loading:u,defaultValue:e.conversation_name,onBlur:w,onValidate:m}):(0,i.jsx)(es,{ellipsis:{showTooltip:!0},children:e.conversation_name}),b!==e.unique_id&&"0"!==e.unique_id&&s?(0,i.jsxs)("div",{className:en.icons,children:[(0,i.jsx)(a.hU,{size:"small",color:"secondary",icon:(0,i.jsx)(p.JAz,{}),onClick:t=>{t.stopPropagation(),x(e.unique_id)}}),(0,i.jsx)(a.hU,{size:"small",color:"secondary",icon:(0,i.jsx)(p.dVD,{}),onClick:t=>{t.stopPropagation(),h(e)}})]}):null]},e.unique_id))]})]})},ec=n("584466"),eu=n("189284"),ed=n("224701"),ef={};ef.styleTagTransform=I(),ef.setAttributes=O(),ef.insert=P().bind(null,"head"),ef.domAPI=k(),ef.insertStyleElement=T(),x()(ed.Z,ef);var ep=ed.Z&&ed.Z.locals?ed.Z.locals:void 0,{Text:eh}=a.ZT,em=e=>{var{chat:t,isActivate:n,isInBatch:o,isInBatchSelected:r,canEdit:s,onBatchSelectChange:l,onActivate:c,onDelete:u}=e,d=s&&!o;return(0,i.jsxs)("div",{className:W()(en["chat-item"],n&&!o&&en["chat-item-activate"],r&&ep["is-batch-selected"]),onClick:()=>{o?l(t):c(t)},children:[o?(0,i.jsx)(a.XZ,{checked:r}):null,(0,i.jsx)(eh,{ellipsis:{showTooltip:!0},children:t.conversation_name}),d?(0,i.jsx)("div",{className:en.icons,children:(0,i.jsx)(a.hU,{size:"small",color:"secondary",icon:(0,i.jsx)(p.dVD,{}),onClick:e=>{e.stopPropagation(),u(t)}})}):null]})},ev=e=>{var t,{canEdit:n,list:o,activateChat:s,onDelete:l,onBatchDelete:h,onSelectChat:m}=e,[v]=(0,eu.V)(),[g,y]=(0,r.useState)(!1),[b,_]=(0,r.useState)({}),w=(0,r.useRef)(null),[x]=(0,ec.Z)(w),j=(0,r.useMemo)(()=>Object.values(b).filter(e=>!!e),[b]),k=!!n&&!!(null==o?void 0:o.length)&&!g&&v["bot.automation.conversation_batch_delete"],C=()=>{y(!1),_({})},P=e=>{var t=b[e.unique_id||""]?void 0:e;_((0,d._)((0,u._)({},b),{[e.unique_id||""]:t}))};var S=(t=(0,c._)(function*(e){var t=e.map(e=>e.unique_id).filter(e=>!!e);yield h(t),C()}),function(e){return t.apply(this,arguments)});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($,{className:W()(ep.title,!x&&ep["is-bottom"]),title:f.o.t("project_conversation_list_dynamic_title"),tooltip:f.o.t("wf_chatflow_44"),extra:k&&(0,i.jsx)(a.u,{content:f.o.t("project_conversation_list_operate_batch_tooltip"),children:(0,i.jsx)(a.hU,{icon:(0,i.jsx)(p.UWM,{}),size:"small",color:"secondary",onClick:()=>y(!0)})}),onClick:()=>X.scroller.scrollTo("dynamic",{duration:200,smooth:!0,containerId:"conversation-list"})}),(0,i.jsx)("div",{ref:w}),(0,i.jsxs)("div",{className:W()(ep["list-container"],g&&ep["in-batch"]),children:[(null==o?void 0:o.length)?o.map(e=>(0,i.jsx)(em,{chat:e,canEdit:n,isActivate:e.unique_id===(null==s?void 0:s.unique_id),isInBatch:g,isInBatchSelected:!!b[e.unique_id||""],onBatchSelectChange:P,onActivate:m,onDelete:l})):(0,i.jsx)("div",{className:ep["empty-container"],children:(0,i.jsx)(a.ub,{size:"default",icon:(0,i.jsx)(p.nL$,{}),title:f.o.t("wf_chatflow_41"),description:f.o.t("wf_chatflow_42")})}),g?(0,i.jsxs)("div",{className:ep["batch-wrap"],children:[(0,i.jsx)(a.gn,{title:f.o.t("project_conversation_list_batch_delete_tooltip"),okText:f.o.t("delete_title"),cancelText:f.o.t("cancel"),content:f.o.t("project_conversation_list_batch_delete_tooltip_context",{len:j.length}),onConfirm:()=>{S(j)},children:(0,i.jsx)(a.zx,{size:"small",disabled:!j.length,children:f.o.t("project_conversation_list_batch_delete_btn",{len:j.length})})}),(0,i.jsx)(a.gn,{title:f.o.t("filebox_0040"),okText:f.o.t("filebox_0040"),cancelText:f.o.t("cancel"),content:f.o.t("project_conversation_list_delete_all_tooltip_context"),okButtonColor:"red",onConfirm:()=>{S(o)},children:(0,i.jsx)(a.zx,{size:"small",color:"redhglt",children:f.o.t("url_add_008")})}),(0,i.jsx)(a.hU,{size:"small",color:"secondary",icon:(0,i.jsx)(p.rmE,{}),onClick:C})]}):null]})]})},eg=n("287487"),ey=n("794800"),eb=n("699155"),e_={};e_.styleTagTransform=I(),e_.setAttributes=O(),e_.insert=P().bind(null,"head"),e_.domAPI=k(),e_.insertStyleElement=T(),x()(eb.Z,e_);var ew=eb.Z&&eb.Z.locals?eb.Z.locals:void 0,ex=()=>(0,r.useCallback)(()=>(0,i.jsx)(a.Od,{style:{width:"100%",height:"100%"},placeholder:(0,i.jsxs)("div",{className:ew["skeleton-container"],children:[(0,i.jsxs)("div",{className:ew["skeleton-item"],children:[(0,i.jsx)(a.Od.Avatar,{className:ew["skeleton-avatar"]}),(0,i.jsxs)("div",{className:ew["skeleton-column"],children:[(0,i.jsx)(a.Od.Title,{className:ew["skeleton-name"]}),(0,i.jsx)(a.Od.Image,{className:ew["skeleton-content"]})]})]}),(0,i.jsxs)("div",{className:ew["skeleton-item"],children:[(0,i.jsx)(a.Od.Avatar,{className:ew["skeleton-avatar"]}),(0,i.jsx)(a.Od.Image,{className:ew["skeleton-content-mini"]})]}),(0,i.jsxs)("div",{className:ew["skeleton-item"],children:[(0,i.jsx)(a.Od.Avatar,{className:ew["skeleton-avatar"]}),(0,i.jsxs)("div",{className:ew["skeleton-column"],children:[(0,i.jsx)(a.Od.Title,{className:ew["skeleton-name"]}),(0,i.jsx)(a.Od.Image,{className:ew["skeleton-content"]})]})]})]}),active:!0,loading:!0}),[]),ej=(0,r.lazy)((0,c._)(function*(){var{BuilderChat:e}=yield n.e("5238").then(n.bind(n,200376));return{default:e}})),ek=e=>{var{conversationId:t,conversationName:n,connectorId:o,createEnv:s}=e,c=eg.Z.getUserInfo(),u=ex(),d=(0,l.zu)(e=>{var t;return null===(t=e.projectInfo)||void 0===t?void 0:t.projectInfo}),p=(0,r.useMemo)(()=>({id:(null==d?void 0:d.id)||"",conversationId:t,connectorId:o,conversationName:n,name:n||(null==d?void 0:d.name),iconUrl:null==d?void 0:d.icon_url,type:"app",mode:s===B.Af.Draft?"draft":"release",caller:s===B.Af.Draft?"CANVAS":void 0}),[d,t,o,n,s]),h={id:(null==c?void 0:c.user_id_str)||"",name:(null==c?void 0:c.name)||"",avatar:(null==c?void 0:c.avatar_url)||""};return p.id&&n&&("0"!==t||s===B.Af.Draft)?(0,i.jsx)(r.Suspense,{fallback:null,children:(0,i.jsx)(ej,{workflow:{},project:p,areaUi:{isDisabled:!0,isNeedClearContext:!1,input:{isShow:!1},renderLoading:u,uiTheme:"chatFlow"},userInfo:h,auth:{type:"internal"}})}):(0,i.jsx)(a.ub,{size:"full_screen",icon:(0,i.jsx)(ey.YC,{}),title:f.o.t("wf_chatflow_61"),description:f.o.t("wf_chatflow_62")})},eC=e=>{var t,{connectorId:n,createEnv:o,canEdit:a}=e,s=(0,r.useRef)(null),[u,d]=(0,r.useState)(!1),[p,h]=(0,r.useState)(),{pathname:v}=(0,Q.useLocation)(),{staticList:g,dynamicList:y,fetch:b}=V({connector_id:n,create_env:o}),{loading:_,handleCreateChat:w}=D({manualRefresh:()=>b()}),{handleUpdateChat:x,loading:j}=Z({manualRefresh:()=>b()}),{handleDelete:k,modalDom:C}=R({staticList:g,manualRefresh:()=>b(),setActivateChat:h}),P=(0,r.useCallback)(e=>{h(e)},[]),{batchDelete:S}=F({connectorId:n,createEnv:o,manualRefresh:()=>b(),setActivateChat:h});(0,r.useEffect)(()=>{!p&&(null==g?void 0:g.length)&&P(g[0])},[g]);var O=(0,r.useCallback)(()=>{d(!0)},[]),E=e=>(null==e?void 0:e.length)>200?m.EXCEED_MAX_LENGTH:g.some(t=>t.conversation_name===e)?m.DUPLICATE:void 0;var T=(t=(0,c._)(function*(e,t){if(!e){d(!1);return}!t&&(yield w(e)),d(!1)}),function(e,n){return t.apply(this,arguments)}),H=(0,r.useMemo)(()=>o!==B.Af.Draft&&(null==p?void 0:p.release_conversation_name)?null==p?void 0:p.release_conversation_name:(null==p?void 0:p.conversation_name)||"",[o,p]);return(0,r.useEffect)(()=>{if(u){var e;null===(e=s.current)||void 0===e||e.scrollIntoView()}},[u]),(0,r.useEffect)(()=>{var e=(0,l.qj)(v);e&&l.B6.displayName===e&&b()},[v]),(0,r.useEffect)(()=>{b(),h(void 0)},[n,o]),(0,i.jsxs)("div",{className:en["page-container"],children:[(0,i.jsxs)("div",{className:en["chat-list-container"],children:[(0,i.jsx)("div",{className:en.title,children:f.o.t("wf_chatflow_101")}),(0,i.jsx)("div",{className:en.description,children:o===B.Af.Release?f.o.t("wf_chatflow_102"):f.o.t("workflow_chatflow_testrun_conversation_des")}),(0,i.jsxs)("div",{className:en["new-list"],id:"conversation-list",children:[(0,i.jsx)(X.Element,{name:"static"}),(0,i.jsx)(el,{canEdit:a,list:g,activateChat:p,updateLoading:j,onUpdate:x,onDelete:k,onValidate:E,onSelectChat:P,renderCreateInput:()=>u?(0,i.jsx)(eo,{ref:s,loading:_,onBlur:T,onValidate:E}):null,handleCreateInput:O}),(0,i.jsx)(X.Element,{name:"dynamic"}),(0,i.jsx)(ev,{list:y,canEdit:a,activateChat:p,onDelete:k,onBatchDelete:S,onSelectChat:P})]})]}),(0,i.jsx)("div",{className:en["chat-area"],children:(0,i.jsx)(ek,{createEnv:o,connectorId:n,conversationId:null==p?void 0:p.conversation_id,conversationName:H})}),C]})},eP=n("925971"),eS={};eS.styleTagTransform=I(),eS.setAttributes=O(),eS.insert=P().bind(null,"head"),eS.domAPI=k(),eS.insertStyleElement=T(),x()(eP.Z,eS);var eO=eP.Z&&eP.Z.locals?eP.Z.locals:void 0,eE=()=>{var e=(0,l.vp)(),{version:t}=(0,l.jo)(),{widget:n}=(0,l.BX)(),{connectorList:o,activeKey:c,createEnv:u,onTabChange:d}=U(),f=(0,s.kc)(e),p=!(null==f?void 0:f.length)||!!t;return(0,r.useEffect)(()=>{n.setUIState("normal")},[]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.nj,{type:"text",mode:"select",className:eO["connector-tab"],activeKey:c,onTabClick:d,children:o.map(e=>(0,i.jsx)(a.nj.TabPanel,{tab:e.connectorName,itemKey:e.connectorId}))}),(0,i.jsx)(eC,{canEdit:!p,connectorId:c===v?y:c,createEnv:u})]})}},699155:function(e,t,n){"use strict";var o=n(125161),i=n.n(o),r=n(404442),a=n.n(r)()(i());a.push([e.id,".skeleton-container-P8uPHK{flex-direction:column;align-items:center;row-gap:16px;width:100%;height:100%;padding:28px 97px;display:flex}.skeleton-container-P8uPHK .skeleton-item-PkUcl5{-moz-column-gap:12px;column-gap:12px;width:100%;display:flex}.skeleton-container-P8uPHK .skeleton-item-PkUcl5 .skeleton-column-h8XfQR{flex-direction:column;flex:1;row-gap:8px;display:flex}.skeleton-container-P8uPHK .skeleton-item-PkUcl5 .skeleton-avatar-wR0Lk7{flex-shrink:0;width:32px;height:32px}.skeleton-container-P8uPHK .skeleton-item-PkUcl5 .skeleton-name-qmeHyb{border-radius:12px;width:64px;height:13px}.skeleton-container-P8uPHK .skeleton-item-PkUcl5 .skeleton-content-UPj8fQ{border-radius:12px;flex-shrink:0;width:100%;height:102px}.skeleton-container-P8uPHK .skeleton-item-PkUcl5 .skeleton-content-mini-p1fppR{border-radius:12px;flex-shrink:0;width:50%;height:60px}",""]),a.locals={"skeleton-container":"skeleton-container-P8uPHK",skeletonContainer:"skeleton-container-P8uPHK","skeleton-item":"skeleton-item-PkUcl5",skeletonItem:"skeleton-item-PkUcl5","skeleton-column":"skeleton-column-h8XfQR",skeletonColumn:"skeleton-column-h8XfQR","skeleton-avatar":"skeleton-avatar-wR0Lk7",skeletonAvatar:"skeleton-avatar-wR0Lk7","skeleton-name":"skeleton-name-qmeHyb",skeletonName:"skeleton-name-qmeHyb","skeleton-content":"skeleton-content-UPj8fQ",skeletonContent:"skeleton-content-UPj8fQ","skeleton-content-mini":"skeleton-content-mini-p1fppR",skeletonContentMini:"skeleton-content-mini-p1fppR"},t.Z=a},986007:function(e,t,n){"use strict";var o=n(125161),i=n.n(o),r=n(404442),a=n.n(r)()(i());a.push([e.id,".page-container-hpVSHR{background:var(--coz-bg-plus);border-radius:0 0 8px 8px;width:100%;height:calc(100% - 54px);display:flex}.page-container-hpVSHR .chat-list-container-PnG35O{border-right:1px solid var(--coz-stroke-primary);flex-direction:column;flex-shrink:0;width:260px;height:100%;display:flex;position:relative;overflow:hidden}.page-container-hpVSHR .chat-list-container-PnG35O .test-run-title-container-QHFZPq{justify-content:space-between;align-items:center;margin-bottom:12px;padding-left:8px;display:flex}.page-container-hpVSHR .chat-list-container-PnG35O .title-QYcXTC{color:var(--coz-fg-plus);margin-bottom:4px;padding:12px 12px 0;font-size:14px;font-weight:500;line-height:20px}.page-container-hpVSHR .chat-list-container-PnG35O .description-Xp6ZGE{color:var(--coz-fg-secondary);margin-bottom:12px;padding:0 12px;font-size:12px;line-height:16px}.page-container-hpVSHR .chat-list-container-PnG35O .new-chat-button-cruq_b{margin-bottom:12px}.page-container-hpVSHR .chat-list-container-PnG35O .chat-item-srfw4p{cursor:pointer;-moz-column-gap:4px;width:100%;height:28px;color:var(--coz-fg-secondary);border-radius:6px;flex-shrink:0;align-items:center;column-gap:4px;margin-bottom:2px;padding:4px 8px;font-size:12px;font-weight:500;line-height:16px;display:flex;overflow:hidden}.page-container-hpVSHR .chat-list-container-PnG35O .chat-item-srfw4p .icons-bxfZA3{-moz-column-gap:4px;flex-grow:1;justify-content:flex-end;align-items:center;column-gap:4px;width:0;display:none}.page-container-hpVSHR .chat-list-container-PnG35O .chat-item-srfw4p:hover{background-color:var(--coz-mg-primary)}.page-container-hpVSHR .chat-list-container-PnG35O .chat-item-srfw4p:hover .icons-bxfZA3{display:flex}.page-container-hpVSHR .chat-list-container-PnG35O .chat-item-activate-qhwARF{background-color:var(--coz-mg-primary)}.page-container-hpVSHR .chat-list-container-PnG35O .chat-item-editing-e2bvUo{padding:2px}.page-container-hpVSHR .chat-area-E_V0_C{flex:1;justify-content:center;align-items:center;width:100%;height:100%;display:flex}.input-DCBJsH{background-color:#fff!important}.input-DCBJsH .semi-input{padding:0 4px}.new-list-OhaDEt{flex-grow:1;height:0;overflow-y:auto}",""]),a.locals={"page-container":"page-container-hpVSHR",pageContainer:"page-container-hpVSHR","chat-list-container":"chat-list-container-PnG35O",chatListContainer:"chat-list-container-PnG35O","test-run-title-container":"test-run-title-container-QHFZPq",testRunTitleContainer:"test-run-title-container-QHFZPq",title:"title-QYcXTC",description:"description-Xp6ZGE","new-chat-button":"new-chat-button-cruq_b",newChatButton:"new-chat-button-cruq_b","chat-item":"chat-item-srfw4p",chatItem:"chat-item-srfw4p",icons:"icons-bxfZA3","chat-item-activate":"chat-item-activate-qhwARF",chatItemActivate:"chat-item-activate-qhwARF","chat-item-editing":"chat-item-editing-e2bvUo",chatItemEditing:"chat-item-editing-e2bvUo","chat-area":"chat-area-E_V0_C",chatArea:"chat-area-E_V0_C",input:"input-DCBJsH","new-list":"new-list-OhaDEt",newList:"new-list-OhaDEt"},t.Z=a},224701:function(e,t,n){"use strict";var o=n(125161),i=n.n(o),r=n(404442),a=n.n(r)()(i());a.push([e.id,".list-container-_tKwRF{padding:0 12px}.list-container-_tKwRF .empty-container-n_4ryQ{justify-content:center;align-items:center;width:100%;height:300px;display:flex}.list-container-_tKwRF.in-batch-m6aREK{padding-bottom:56px}.title-BihmcF{top:28px;bottom:0}.title-BihmcF.is-bottom-uXJUis{border-top:1px solid var(--coz-stroke-primary)}.batch-wrap-TywW8z{z-index:2;-moz-column-gap:5px;background-color:var(--coz-bg-max);border:1px solid var(--coz-stroke-primary);box-shadow:var(--coz-shadow-default);border-radius:10px;align-items:center;column-gap:5px;padding:5px;display:flex;position:absolute;bottom:16px;left:50%;transform:translate(-50%)}.is-batch-selected-Jo36b3{background-color:var(--coz-mg-hglt-secondary)!important}",""]),a.locals={"list-container":"list-container-_tKwRF",listContainer:"list-container-_tKwRF","empty-container":"empty-container-n_4ryQ",emptyContainer:"empty-container-n_4ryQ","in-batch":"in-batch-m6aREK",inBatch:"in-batch-m6aREK",title:"title-BihmcF","is-bottom":"is-bottom-uXJUis",isBottom:"is-bottom-uXJUis","batch-wrap":"batch-wrap-TywW8z",batchWrap:"batch-wrap-TywW8z","is-batch-selected":"is-batch-selected-Jo36b3",isBatchSelected:"is-batch-selected-Jo36b3"},t.Z=a},239496:function(e,t,n){"use strict";var o=n(125161),i=n.n(o),r=n(404442),a=n.n(r)()(i());a.push([e.id,".modal-Bgg1xp .semi-modal .semi-modal-footer{margin-top:32px}.modal-Bgg1xp .semi-modal .semi-modal-content{padding:24px}.content-container-wZPVrv{flex-direction:column;display:flex}.content-container-wZPVrv .content-text-LlcOoa{color:var(--coz-fg-secondary);margin-top:16px;font-size:14px;line-height:20px}.content-container-wZPVrv .rebind-chat-S7G8nD{margin-top:24px}.content-container-wZPVrv .rebind-chat-S7G8nD .rebind-title-xQiyVN{color:var(--coz-fg-primary);margin-bottom:4px;font-size:14px;font-weight:500;line-height:20px}.content-container-wZPVrv .rebind-chat-S7G8nD .rebind-icon-XbOeAV{margin-right:2px}.content-container-wZPVrv .rebind-chat-S7G8nD .rebind-text-P7XnGE{width:50%}.content-container-wZPVrv .rebind-chat-S7G8nD .rebind-desc-FKoNw1{color:var(--coz-fg-secondary);margin-bottom:18px;font-size:12px;line-height:16px}.content-container-wZPVrv .rebind-chat-S7G8nD .rebind-item-mFCAJ6{justify-content:space-between;align-items:center;margin-top:6px;display:flex}.rebind-select-A5EgZ4 .option-text-wrapper-wLqQQ4{overflow:hidden}.rebind-select-A5EgZ4 .option-text-wrapper{overflow:hidden}",""]),a.locals={modal:"modal-Bgg1xp","content-container":"content-container-wZPVrv",contentContainer:"content-container-wZPVrv","content-text":"content-text-LlcOoa",contentText:"content-text-LlcOoa","rebind-chat":"rebind-chat-S7G8nD",rebindChat:"rebind-chat-S7G8nD","rebind-title":"rebind-title-xQiyVN",rebindTitle:"rebind-title-xQiyVN","rebind-icon":"rebind-icon-XbOeAV",rebindIcon:"rebind-icon-XbOeAV","rebind-text":"rebind-text-P7XnGE",rebindText:"rebind-text-P7XnGE","rebind-desc":"rebind-desc-FKoNw1",rebindDesc:"rebind-desc-FKoNw1","rebind-item":"rebind-item-mFCAJ6",rebindItem:"rebind-item-mFCAJ6","rebind-select":"rebind-select-A5EgZ4",rebindSelect:"rebind-select-A5EgZ4","option-text-wrapper":"option-text-wrapper-wLqQQ4",optionTextWrapper:"option-text-wrapper-wLqQQ4"},t.Z=a},925971:function(e,t,n){"use strict";var o=n(125161),i=n.n(o),r=n(404442),a=n.n(r)()(i());a.push([e.id,".connector-tab-n0OwAE{background:var(--coz-bg-plus);border-bottom:1px solid var(--coz-stroke-primary);align-items:center;height:54px;padding:0 12px;display:flex}",""]),a.locals={"connector-tab":"connector-tab-n0OwAE",connectorTab:"connector-tab-n0OwAE"},t.Z=a},483252:function(e,t,n){"use strict";var o=n(125161),i=n.n(o),r=n(404442),a=n.n(r)()(i());a.push([e.id,".list-container-W1vpSm{padding:0 12px}.title-gz12ME{top:0}",""]),a.locals={"list-container":"list-container-W1vpSm",listContainer:"list-container-W1vpSm",title:"title-gz12ME"},t.Z=a},933734:function(e,t,n){"use strict";var o=n(125161),i=n.n(o),r=n(404442),a=n.n(r)()(i());a.push([e.id,".title-container-Ct_mWe{cursor:pointer;z-index:1;height:28px;color:var(--coz-fg-secondary);background-color:var(--coz-bg-plus);justify-content:space-between;align-items:center;margin-bottom:2px;padding:0 8px;font-size:14px;font-style:normal;font-weight:500;line-height:20px;display:flex;position:-webkit-sticky;position:sticky}.title-container-Ct_mWe .title-with-tip-ZKRHVX,.extra-n9hy9b{-moz-column-gap:4px;align-items:center;column-gap:4px;display:flex}",""]),a.locals={"title-container":"title-container-Ct_mWe",titleContainer:"title-container-Ct_mWe","title-with-tip":"title-with-tip-ZKRHVX",titleWithTip:"title-with-tip-ZKRHVX",extra:"extra-n9hy9b"},t.Z=a}}]);
|
|
//# sourceMappingURL=6237.e2348ad0.js.map
|