(function($,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("@easy-coder/sdk/flow"),require("react"),require("@arco-design/web-react"),require("@easy-coder/sdk/helper"),require("@easy-coder/sdk/store"),require("@easy-coder/sdk/variable")):typeof define=="function"&&define.amd?define(["exports","@easy-coder/sdk/flow","react","@arco-design/web-react","@easy-coder/sdk/helper","@easy-coder/sdk/store","@easy-coder/sdk/variable"],g):($=typeof globalThis<"u"?globalThis:$||self,g($.index={},$.flow,$.React,$.webReact,$.helper,$.store,$.variable))})(this,function($,g,x,y,M,A,O){"use strict";const an="",on="",ln="",cn="",un="",fn="",dn="",pn="";function _r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ae={exports:{}},H={};/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ye;function Pr(){if(ye)return H;ye=1;var e=x,r=Symbol.for("react.element"),n=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function l(c,f,m){var p,h={},b=null,_=null;m!==void 0&&(b=""+m),f.key!==void 0&&(b=""+f.key),f.ref!==void 0&&(_=f.ref);for(p in f)s.call(f,p)&&!o.hasOwnProperty(p)&&(h[p]=f[p]);if(c&&c.defaultProps)for(p in f=c.defaultProps,f)h[p]===void 0&&(h[p]=f[p]);return{$$typeof:r,type:c,key:b,ref:_,props:h,_owner:i.current}}return H.Fragment=n,H.jsx=l,H.jsxs=l,H}var q={};/**
 * @license React
 * react-jsx-runtime.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var je;function Fr(){return je||(je=1,process.env.NODE_ENV!=="production"&&function(){var e=x,r=Symbol.for("react.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),_=Symbol.for("react.offscreen"),I=Symbol.iterator,E="@@iterator";function k(t){if(t===null||typeof t!="object")return null;var u=I&&t[I]||t[E];return typeof u=="function"?u:null}var N=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function P(t){{for(var u=arguments.length,d=new Array(u>1?u-1:0),v=1;v<u;v++)d[v-1]=arguments[v];St("error",t,d)}}function St(t,u,d){{var v=N.ReactDebugCurrentFrame,S=v.getStackAddendum();S!==""&&(u+="%s",d=d.concat([S]));var C=d.map(function(w){return String(w)});C.unshift("Warning: "+u),Function.prototype.apply.call(console[t],console,C)}}var Nt=!1,Ot=!1,Ct=!1,_t=!1,Pt=!1,sr;sr=Symbol.for("react.module.reference");function Ft(t){return!!(typeof t=="string"||typeof t=="function"||t===s||t===o||Pt||t===i||t===m||t===p||_t||t===_||Nt||Ot||Ct||typeof t=="object"&&t!==null&&(t.$$typeof===b||t.$$typeof===h||t.$$typeof===l||t.$$typeof===c||t.$$typeof===f||t.$$typeof===sr||t.getModuleId!==void 0))}function Tt(t,u,d){var v=t.displayName;if(v)return v;var S=u.displayName||u.name||"";return S!==""?d+"("+S+")":d}function ar(t){return t.displayName||"Context"}function L(t){if(t==null)return null;if(typeof t.tag=="number"&&P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case s:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case m:return"Suspense";case p:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case c:var u=t;return ar(u)+".Consumer";case l:var d=t;return ar(d._context)+".Provider";case f:return Tt(t,t.render,"ForwardRef");case h:var v=t.displayName||null;return v!==null?v:L(t.type)||"Memo";case b:{var S=t,C=S._payload,w=S._init;try{return L(w(C))}catch{return null}}}return null}var W=Object.assign,J=0,or,ir,lr,cr,ur,fr,dr;function pr(){}pr.__reactDisabledLog=!0;function kt(){{if(J===0){or=console.log,ir=console.info,lr=console.warn,cr=console.error,ur=console.group,fr=console.groupCollapsed,dr=console.groupEnd;var t={configurable:!0,enumerable:!0,value:pr,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}J++}}function It(){{if(J--,J===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:W({},t,{value:or}),info:W({},t,{value:ir}),warn:W({},t,{value:lr}),error:W({},t,{value:cr}),group:W({},t,{value:ur}),groupCollapsed:W({},t,{value:fr}),groupEnd:W({},t,{value:dr})})}J<0&&P("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ue=N.ReactCurrentDispatcher,fe;function re(t,u,d){{if(fe===void 0)try{throw Error()}catch(S){var v=S.stack.trim().match(/\n( *(at )?)/);fe=v&&v[1]||""}return`
`+fe+t}}var de=!1,te;{var Dt=typeof WeakMap=="function"?WeakMap:Map;te=new Dt}function mr(t,u){if(!t||de)return"";{var d=te.get(t);if(d!==void 0)return d}var v;de=!0;var S=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var C;C=ue.current,ue.current=null,kt();try{if(u){var w=function(){throw Error()};if(Object.defineProperty(w.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(w,[])}catch(V){v=V}Reflect.construct(t,[],w)}else{try{w.call()}catch(V){v=V}t.call(w.prototype)}}else{try{throw Error()}catch(V){v=V}t()}}catch(V){if(V&&v&&typeof V.stack=="string"){for(var j=V.stack.split(`
`),D=v.stack.split(`
`),F=j.length-1,T=D.length-1;F>=1&&T>=0&&j[F]!==D[T];)T--;for(;F>=1&&T>=0;F--,T--)if(j[F]!==D[T]){if(F!==1||T!==1)do if(F--,T--,T<0||j[F]!==D[T]){var R=`
`+j[F].replace(" at new "," at ");return t.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",t.displayName)),typeof t=="function"&&te.set(t,R),R}while(F>=1&&T>=0);break}}}finally{de=!1,ue.current=C,It(),Error.prepareStackTrace=S}var U=t?t.displayName||t.name:"",z=U?re(U):"";return typeof t=="function"&&te.set(t,z),z}function $t(t,u,d){return mr(t,!1)}function Vt(t){var u=t.prototype;return!!(u&&u.isReactComponent)}function ne(t,u,d){if(t==null)return"";if(typeof t=="function")return mr(t,Vt(t));if(typeof t=="string")return re(t);switch(t){case m:return re("Suspense");case p:return re("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case f:return $t(t.render);case h:return ne(t.type,u,d);case b:{var v=t,S=v._payload,C=v._init;try{return ne(C(S),u,d)}catch{}}}return""}var X=Object.prototype.hasOwnProperty,hr={},xr=N.ReactDebugCurrentFrame;function se(t){if(t){var u=t._owner,d=ne(t.type,t._source,u?u.type:null);xr.setExtraStackFrame(d)}else xr.setExtraStackFrame(null)}function Rt(t,u,d,v,S){{var C=Function.call.bind(X);for(var w in t)if(C(t,w)){var j=void 0;try{if(typeof t[w]!="function"){var D=Error((v||"React class")+": "+d+" type `"+w+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[w]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw D.name="Invariant Violation",D}j=t[w](u,w,v,d,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(F){j=F}j&&!(j instanceof Error)&&(se(S),P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",v||"React class",d,w,typeof j),se(null)),j instanceof Error&&!(j.message in hr)&&(hr[j.message]=!0,se(S),P("Failed %s type: %s",d,j.message),se(null))}}}var Mt=Array.isArray;function pe(t){return Mt(t)}function At(t){{var u=typeof Symbol=="function"&&Symbol.toStringTag,d=u&&t[Symbol.toStringTag]||t.constructor.name||"Object";return d}}function Lt(t){try{return br(t),!1}catch{return!0}}function br(t){return""+t}function vr(t){if(Lt(t))return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",At(t)),br(t)}var Z=N.ReactCurrentOwner,Wt={key:!0,ref:!0,__self:!0,__source:!0},yr,jr,me;me={};function zt(t){if(X.call(t,"ref")){var u=Object.getOwnPropertyDescriptor(t,"ref").get;if(u&&u.isReactWarning)return!1}return t.ref!==void 0}function Gt(t){if(X.call(t,"key")){var u=Object.getOwnPropertyDescriptor(t,"key").get;if(u&&u.isReactWarning)return!1}return t.key!==void 0}function Bt(t,u){if(typeof t.ref=="string"&&Z.current&&u&&Z.current.stateNode!==u){var d=L(Z.current.type);me[d]||(P('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',L(Z.current.type),t.ref),me[d]=!0)}}function Yt(t,u){{var d=function(){yr||(yr=!0,P("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",u))};d.isReactWarning=!0,Object.defineProperty(t,"key",{get:d,configurable:!0})}}function Ut(t,u){{var d=function(){jr||(jr=!0,P("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",u))};d.isReactWarning=!0,Object.defineProperty(t,"ref",{get:d,configurable:!0})}}var Ht=function(t,u,d,v,S,C,w){var j={$$typeof:r,type:t,key:u,ref:d,props:w,_owner:C};return j._store={},Object.defineProperty(j._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(j,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(j,"_source",{configurable:!1,enumerable:!1,writable:!1,value:S}),Object.freeze&&(Object.freeze(j.props),Object.freeze(j)),j};function qt(t,u,d,v,S){{var C,w={},j=null,D=null;d!==void 0&&(vr(d),j=""+d),Gt(u)&&(vr(u.key),j=""+u.key),zt(u)&&(D=u.ref,Bt(u,S));for(C in u)X.call(u,C)&&!Wt.hasOwnProperty(C)&&(w[C]=u[C]);if(t&&t.defaultProps){var F=t.defaultProps;for(C in F)w[C]===void 0&&(w[C]=F[C])}if(j||D){var T=typeof t=="function"?t.displayName||t.name||"Unknown":t;j&&Yt(w,T),D&&Ut(w,T)}return Ht(t,j,D,S,v,Z.current,w)}}var he=N.ReactCurrentOwner,gr=N.ReactDebugCurrentFrame;function Y(t){if(t){var u=t._owner,d=ne(t.type,t._source,u?u.type:null);gr.setExtraStackFrame(d)}else gr.setExtraStackFrame(null)}var xe;xe=!1;function be(t){return typeof t=="object"&&t!==null&&t.$$typeof===r}function wr(){{if(he.current){var t=L(he.current.type);if(t)return`

Check the render method of \``+t+"`."}return""}}function Kt(t){{if(t!==void 0){var u=t.fileName.replace(/^.*[\\\/]/,""),d=t.lineNumber;return`

Check your code at `+u+":"+d+"."}return""}}var Er={};function Jt(t){{var u=wr();if(!u){var d=typeof t=="string"?t:t.displayName||t.name;d&&(u=`

Check the top-level render call using <`+d+">.")}return u}}function Sr(t,u){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var d=Jt(u);if(Er[d])return;Er[d]=!0;var v="";t&&t._owner&&t._owner!==he.current&&(v=" It was passed a child from "+L(t._owner.type)+"."),Y(t),P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',d,v),Y(null)}}function Nr(t,u){{if(typeof t!="object")return;if(pe(t))for(var d=0;d<t.length;d++){var v=t[d];be(v)&&Sr(v,u)}else if(be(t))t._store&&(t._store.validated=!0);else if(t){var S=k(t);if(typeof S=="function"&&S!==t.entries)for(var C=S.call(t),w;!(w=C.next()).done;)be(w.value)&&Sr(w.value,u)}}}function Xt(t){{var u=t.type;if(u==null||typeof u=="string")return;var d;if(typeof u=="function")d=u.propTypes;else if(typeof u=="object"&&(u.$$typeof===f||u.$$typeof===h))d=u.propTypes;else return;if(d){var v=L(u);Rt(d,t.props,"prop",v,t)}else if(u.PropTypes!==void 0&&!xe){xe=!0;var S=L(u);P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",S||"Unknown")}typeof u.getDefaultProps=="function"&&!u.getDefaultProps.isReactClassApproved&&P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Zt(t){{for(var u=Object.keys(t.props),d=0;d<u.length;d++){var v=u[d];if(v!=="children"&&v!=="key"){Y(t),P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),Y(null);break}}t.ref!==null&&(Y(t),P("Invalid attribute `ref` supplied to `React.Fragment`."),Y(null))}}var Or={};function Cr(t,u,d,v,S,C){{var w=Ft(t);if(!w){var j="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(j+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var D=Kt(S);D?j+=D:j+=wr();var F;t===null?F="null":pe(t)?F="array":t!==void 0&&t.$$typeof===r?(F="<"+(L(t.type)||"Unknown")+" />",j=" Did you accidentally export a JSX literal instead of a component?"):F=typeof t,P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",F,j)}var T=qt(t,u,d,S,C);if(T==null)return T;if(w){var R=u.children;if(R!==void 0)if(v)if(pe(R)){for(var U=0;U<R.length;U++)Nr(R[U],t);Object.freeze&&Object.freeze(R)}else P("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Nr(R,t)}if(X.call(u,"key")){var z=L(t),V=Object.keys(u).filter(function(sn){return sn!=="key"}),ve=V.length>0?"{key: someKey, "+V.join(": ..., ")+": ...}":"{key: someKey}";if(!Or[z+ve]){var nn=V.length>0?"{"+V.join(": ..., ")+": ...}":"{}";P(`A props object containing a "key" prop is being spread into JSX:
  let props = %s;
  <%s {...props} />
React keys must be passed directly to JSX without using spread:
  let props = %s;
  <%s key={someKey} {...props} />`,ve,z,nn,z),Or[z+ve]=!0}}return t===s?Zt(T):Xt(T),T}}function Qt(t,u,d){return Cr(t,u,d,!0)}function en(t,u,d){return Cr(t,u,d,!1)}var rn=en,tn=Qt;q.Fragment=s,q.jsx=rn,q.jsxs=tn}()),q}process.env.NODE_ENV==="production"?ae.exports=Pr():ae.exports=Fr();var a=ae.exports;function ge(e){return a.jsx(y.Icon,{...e,viewBox:"0 0 1024 1024",children:a.jsx("path",{d:"M893.456 553.048a60.648 60.648 0 0 1 77.912 15.872 75.048 75.048 0 0 1-4.248 84.304c-22.776 27.016-52.408 29.64-84.304 25.016a138.944 138.944 0 0 1-21.256-5.264c-20.016-10.624-32.264-1.488-44.024 13.264l-3.312 4.104c-23.656 29.28-24.184 29.928-12.576 69.56a1348.28 1348.28 0 0 0 28.024 93.8c14.88 44.024 40.264 57.656 85.784 47.024a196.32 196.32 0 0 1 12.864-3.576 250.64 250.64 0 0 0 12.152-3.304c1.504 25.008-4.248 33.52-27.016 42.904-38.64 14.888-77.792 27.016-120.68 22.888a88.8 88.8 0 0 1-80.048-61.16c-4.952-14.088-8.896-28.76-13.064-44.208-2.56-9.504-5.2-19.312-8.2-29.456-3.104 3.832-5.336 7.136-7.344 10.104a192.32 192.32 0 0 1-2.16 3.152 1738.376 1738.376 0 0 0-19.376 27.84c-13.32 19.416-26.8 39.056-42.16 57.96a104.688 104.688 0 0 1-37.512 29.64 64.552 64.552 0 0 1-80.544-16.008 70.544 70.544 0 0 1 6.872-85.672c22.768-27.016 53.52-28.136 85.808-22.896a152.08 152.08 0 0 1 22.752 5.384 25 25 0 0 0 36.024-10.624 211.216 211.216 0 0 0 21.264-28.152c3.952-5.92 5.472-13.12 4.24-20.136-10.624-37.52-21.248-75.032-32.256-112.56-14.88-50.016-41.4-62.528-91.176-50.016-6.64 0.552-13.2 1.832-19.56 3.808-2.376-27.744 12.712-39.76 36.192-46.584 37.52-12.512 75.04-22.768 114.936-18.512a87.52 87.52 0 0 1 75.04 57.656 480.76 480.76 0 0 1 21.264 73.664c3.152-3.984 5.4-7.28 7.44-10.248 0.704-1.04 1.384-2.04 2.072-3.016a928.288 928.288 0 0 1 58.896-83.168 128.56 128.56 0 0 1 41.28-33.384zM480 56c231.168 0 419.912 181.552 431.44 409.848-19.6 1.848-40.088 8.088-61.608 19.824-17.376 9.76-33.264 21.992-48.768 35.584h-1.536a167.368 167.368 0 0 0-104.128-49.32c-50.664-5.28-98.656 5.816-146.56 21.68-30.984 9.28-53.64 24.888-68.984 44.904-12.104 15.8-20.352 34.56-22.152 55.392-1.52 17.736 1.416 37.312 12.256 58.232l29.176 56.28 14.096 15.136v31.216c-23.48 7.96-44.88 22.024-63.744 43.824a141.6 141.6 0 0 0-2.704 3.104l-0.016-280.48-132.216 0.032c0.936 21.264 2.728 41.96 5.32 61.96l2.056 14.848 2.576 15.84c17.904 102.336 56.56 182.472 102.032 218.64a150.56 150.56 0 0 0-15.032 54.552 144.856 144.856 0 0 0 0.36 27.56C205.64 881.984 48 703.416 48 488 48 249.4 241.4 56 480 56zM248.024 521.256h-132.08l0.4 4.176c13.464 132.2 97.392 243.608 213.632 296.008-22.976-35.6-41.92-79.36-55.832-128.8l-3.144-11.52-3.656-14.72-3.36-15.016-1.88-9.192a773.08 773.08 0 0 1-14.08-120.936zM329.976 154.56l-2.968 1.328-3.656 1.712c-114.04 54.184-195.544 165.648-207.408 297.168h132.08l0.392-8.664a778.648 778.648 0 0 1 12.768-107.8l2.8-13.688 3.36-15.024 3.656-14.728 1.664-6.224c14.064-51.584 33.52-97.224 57.312-134.08z m116.8-24.032c-52.664 25.56-99.36 109.968-120.68 222.84l-1.6 8.736-2.56 15.816a728.056 728.056 0 0 0-7.384 76.848h132.216z m183.248 24.056l2.656 4.192 2.816 4.56c20.456 33.824 37.472 74.32 50.24 119.584l3.264 11.968 3.656 14.704 3.36 15.024 1.704 8.192c7.696 38.416 12.576 79.384 14.256 121.96h132.08l-0.4-4.184c-13.44-132.216-97.368-243.624-213.632-296z m-116.768-24.056l-0.024 324.24H645.44a734.28 734.28 0 0 0-5.544-63.736l-1.84-13.12-2.56-15.808c-20.52-117.216-68.24-205.328-122.248-231.576z"})})}function Tr({id:e,node:r}){const n=x.useMemo(()=>Se(r.params),[r.params]);return a.jsx(g.FlowNodeRender,{showActions:["delete","open"],node:r,isComplete:n,defaultLabel:r.label,icon:a.jsx(ge,{className:"node-icon"}),MainRender:kr})}function kr({node:e}){var c,f,m;const{flowManager:r,readonly:n}=g.useFlow(),s=A.useGlobalVariable(),i=g.useFlowVariables(),o=M.useEffectCallback((p,h)=>{const b={...e.params,[p]:h};r.updateNode(e.name,{label:e.label,params:b,result:e.result})},[e]),l=x.useMemo(()=>{const p=[];for(const h in s)p.push({value:h,label:s[h].define.label});return p},[s]);return a.jsxs(y.Grid.Row,{className:"panel-row",gutter:8,children:[a.jsx(y.Grid.Col,{flex:"120px",children:a.jsx(y.Select,{size:"mini",disabled:n,options:l,value:(c=e.params)==null?void 0:c.id,onChange:p=>o("id",p)})}),a.jsx(y.Grid.Col,{flex:"auto",children:((f=e.params)==null?void 0:f.id)&&a.jsx(O.SetterVariable,{disabled:n,useFx:!0,size:"mini",variables:i,define:s[e.params.id].define,value:(m=e.params)==null?void 0:m.value,onChange:p=>o("value",p),showLabel:!1})})]})}function Ir(){return a.jsxs("div",{className:"flow-create-display",children:[a.jsx(ge,{className:"node-icon"}),a.jsx("span",{style:{fontSize:"0.55rem"},children:we})]})}const we="赋值页面变量",Ee="setGlobalVariable",Dr={type:Ee,RenderWhenFlowNode:Tr,RenderWhenCreate:Ir,onBeforeInsert(e,r){return{label:we}},checkComplete:Se,onCreateUi:g.singleNodeCreateUi,onComputedLog:()=>{}};g.FlowManager.UseNode(Dr);function Se(e){return!!(e!=null&&e.id)}let Ne=class extends g.FlowNodeManager{constructor(r){super(r)}async _execute(){if(!this.option.node.params)return;const r=this.option.node.params,n=O.isFxValue(r.value)?await O.computedFormula({context:this.option.flow.context,contextDefine:this.option.flow.contextDefine,code:r.value.code}):r.value;this.option.flow.getExtra("store").variableStore.updateValueByPath([...A.GLOBAL_VARIABLE_PREFIX,r.id],n)}};Ne.Type=Ee,g.FlowNodeManager.AddNode(Ne);function G(e,r){if(!r)return;let n=r;for(let i=0;i<e.length-1;i++){const o=n[e[i]];if((o==null?void 0:o.type)!=="path")return;n=o.children}const s=n[e[e.length-1]];if(s.type==="event")return s}function Oe(e,r){if(!r)return;let n=r;for(let i=0;i<e.length-1;i++){const o=n[e[i]];if(typeof r!="object")return;n=o}const s=n[e[e.length-1]];if(typeof s=="function")return s}function $r(e,r,n){var s;return r.type==="flow"?!!r.id:r.type==="method"?!(!((s=r.eventPath)!=null&&s.length)||!G(r.eventPath,n.methods)):r.type==="setGlobalVariable"?!!r.id:r.type==="openLink"?!!r.url:!1}const mn="";function Ce({value:e,methods:r,onChange:n,...s}){const i=x.useMemo(()=>_e(r),[r]);return a.jsx(y.Cascader,{...s,showSearch:!0,options:i,value:e,onChange:o=>n==null?void 0:n(o)})}function _e(e){const r=[];for(const n in e){const s=e[n];s.type==="path"?r.push({value:n,label:s.label,checked:!1,children:_e(s.children)}):r.push({value:n,label:s.label})}return r}function Pe({disabled:e,value:r,variables:n,params:s,onChange:i}){const[o,l]=M.useHold(r,i),c=x.useCallback((f,m)=>{l(p=>{const h=p?[...p]:[];for(let b=0;b<Math.max(f,h.length);b++)h[b]===void 0&&(h[b]=void 0);return h[f]=m,h})},[]);return s==null?void 0:s.map((f,m)=>a.jsxs("div",{className:"event-row",children:[a.jsx("label",{className:"label",children:f.label}),a.jsx(O.SetterVariable,{useFx:!0,disabled:e,showLabel:!1,size:"mini",define:f,value:o==null?void 0:o[m],variables:n,onChange:p=>c(m,p)})]},m))}function Fe(e){return a.jsx(y.Icon,{...e,viewBox:"0 0 1024 1024",children:a.jsx("path",{d:"M546.368 562.048L908.8 682.88l-180.224 61.824-61.44 179.776-120.768-362.432zM482.496 128a341.76 341.76 0 0 1 324.416 449.408l-4.032 11.392-53.376-19.84a284.8 284.8 0 1 0-211.072 179.968l10.88-2.368 13.312 55.424A341.76 341.76 0 1 1 482.56 128v-0.064z"})})}function Vr({id:e,node:r}){const n=x.useMemo(()=>Ie(r.params),[r.params]);return a.jsx(g.FlowNodeRender,{showActions:["delete","open"],node:r,isComplete:n,defaultLabel:r.label,icon:a.jsx(Fe,{className:"node-icon"}),MainRender:Rr})}function Rr({node:e}){var c,f,m,p;const{flowManager:r,readonly:n}=g.useFlow(),s=g.useFlowVariables(),i=A.useEventDefine(),o=M.useEffectCallback((h,b)=>{const _={...e.params,[h]:b};let I=e.result;if(h==="eventPath"){const E=G(b,i);if(!E)return;E.return?I={_return:{...E.return,label:"执行结果",apiName:"_return"}}:I=void 0}r.updateNode(e.name,{label:e.label,params:_,result:I})},[e,i]),l=x.useMemo(()=>{var h,b;if((h=e.params)!=null&&h.eventPath)return G((b=e.params)==null?void 0:b.eventPath,i)},[(c=e.params)==null?void 0:c.eventPath,i]);return a.jsxs(a.Fragment,{children:[a.jsxs(y.Grid.Row,{className:"panel-row",children:[a.jsx(y.Grid.Col,{flex:"120px",children:a.jsx("label",{className:"panel-label is-require",children:"选择方法"})}),a.jsx(y.Grid.Col,{flex:"auto",children:a.jsx(Ce,{size:"mini",methods:i,disabled:n,value:(f=e.params)==null?void 0:f.eventPath,onChange:h=>o("eventPath",h)})})]}),((m=l==null?void 0:l.params)==null?void 0:m.length)&&a.jsxs(y.Grid.Row,{className:"panel-row",align:"center",children:[a.jsx(y.Grid.Col,{flex:"120px",children:a.jsx("label",{className:"panel-label",children:"方法入参"})}),a.jsx(y.Grid.Col,{flex:"auto",children:a.jsx(Pe,{disabled:n,variables:s,params:l==null?void 0:l.params,value:(p=e.params)==null?void 0:p.paramsSetting,onChange:h=>o("paramsSetting",h)})})]})]})}function Mr(){return a.jsxs("div",{className:"flow-create-display",children:[a.jsx(Fe,{className:"node-icon"}),a.jsx("span",{children:Te})]})}const Te="调用函数",ke="triggerMethod",Ar={type:ke,RenderWhenFlowNode:Vr,RenderWhenCreate:Mr,onBeforeInsert(e,r){return{label:Te}},checkComplete:Ie,onCreateUi:g.singleNodeCreateUi,onComputedLog:()=>{}};g.FlowManager.UseNode(Ar);function Ie(e){var r;return!!((r=e==null?void 0:e.eventPath)!=null&&r.length)}class De extends g.FlowNodeManager{constructor(r){super(r)}async _execute(){var m,p;if(!this.option.node.params)return;const r=this.option.node.params;if(!((m=r.eventPath)!=null&&m.length))throw new Error("未定义方法的路径");const n=this.option.flow.getExtra("store"),s=n.eventDefine.getValue(),i=G(r.eventPath,s);if(!i)throw new Error(`未定义方法: ${r.eventPath.join(".")}`);const o=Oe(r.eventPath,A.getMethodFromStore(n));if(!o)throw new Error(`未找到方法: ${r.eventPath.join(".")}`);const l=[],c=i.params||[];for(let h=0;h<c.length;h++){const b=(p=r.paramsSetting)==null?void 0:p[h];O.isFxValue(b)?l.push(await O.computedFormula({context:this.option.flow.context,contextDefine:this.option.flow.contextDefine,code:b.code})):l.push(b)}const f=await o(...l);this.option.flow.context[this.option.node.name]={_return:f}}}De.Type=ke,g.FlowNodeManager.AddNode(De);function $e({value:e,eventFlows:r,onChange:n,...s}){const i=x.useMemo(()=>{const o=[];for(const l in r)o.push({value:l,label:r[l].label});return o},[r]);return a.jsx(y.Select,{...s,options:i,value:e,onChange:n})}function Ve({disabled:e,value:r,variables:n,params:s,onChange:i}){var f;const[o,l]=M.useHold(r,i),c=x.useCallback((m,p)=>{l(h=>({...h,[m]:p}))},[]);return(f=Object.entries(s||{}))==null?void 0:f.map(([m,p])=>a.jsxs("div",{className:"event-row",children:[a.jsx("label",{className:"label",children:p.label}),a.jsx(O.SetterVariable,{useFx:!0,disabled:e,showLabel:!1,size:"mini",define:p,value:o==null?void 0:o[m],variables:n,onChange:h=>c(m,h)})]},m))}function Re(e){return a.jsx(y.Icon,{...e,viewBox:"0 0 1024 1024",children:a.jsx("path",{d:"M832 128a64 64 0 0 1 64 64v128a64 64 0 0 1-64 64H480a64 64 0 0 1-64-64V192a64 64 0 0 1 64-64h352zM544 640a64 64 0 0 1 64 64v128a64 64 0 0 1-64 64H192a64 64 0 0 1-64-64v-128a64 64 0 0 1 64-64h352zM416 224.96v64H194.4l-1.44 190.656h703.136v320.928H608v-64l224.096-0.032v-192.896H128.448l2.432-318.624zM526.176 413.152l90.528 90.528-90.528 90.496-90.496-90.496z"})})}function Lr({id:e,node:r}){const n=x.useMemo(()=>Le(r.params),[r.params]);return a.jsx(g.FlowNodeRender,{showActions:["delete","open"],node:r,isComplete:n,defaultLabel:r.label,icon:a.jsx(Re,{className:"node-icon"}),MainRender:Wr})}function Wr({node:e}){var c,f,m,p,h;const{flowManager:r,readonly:n}=g.useFlow(),s=g.useFlowVariables(),i=A.useEventFlow(),o=M.useEffectCallback((b,_)=>{const I={...e.params,[b]:_};let E=e.result;if(b==="id"){const k=i[_];if(!k)return;if(E={_code:{type:"number",label:"状态码",apiName:"_code"},_msg:{type:"string",label:"提示信息",apiName:"_msg"}},k.result){const N={type:"object",label:"执行结果",apiName:"_return",prototype:{}};for(const P in k.result)N.prototype[P]=k.result[P].desc;Object.keys(N.prototype).length>0&&(E._return=N)}}r.updateNode(e.name,{label:e.label,params:I,result:E})},[e,i]),l=x.useMemo(()=>{var b;if((b=e.params)!=null&&b.id)return i[e.params.id]},[i,(c=e.params)==null?void 0:c.id]);return a.jsxs(a.Fragment,{children:[a.jsxs(y.Grid.Row,{className:"panel-row",children:[a.jsx(y.Grid.Col,{flex:"120px",children:a.jsx("label",{className:"panel-label is-require",children:"选择事件流"})}),a.jsx(y.Grid.Col,{flex:"auto",children:a.jsx($e,{size:"mini",eventFlows:i,disabled:n,value:(f=e.params)==null?void 0:f.id,onChange:b=>o("id",b)})})]}),Object.keys(((m=l==null?void 0:l.params)==null?void 0:m.input)||{}).length>0&&a.jsxs(y.Grid.Row,{className:"panel-row",align:"center",children:[a.jsx(y.Grid.Col,{flex:"120px",children:a.jsx("label",{className:"panel-label",children:"流程入参"})}),a.jsx(y.Grid.Col,{flex:"auto",children:a.jsx(Ve,{disabled:n,variables:s,params:(p=l==null?void 0:l.params)==null?void 0:p.input,value:(h=e.params)==null?void 0:h.paramsSetting,onChange:b=>o("paramsSetting",b)})})]})]})}function zr(){return a.jsxs("div",{className:"flow-create-display",children:[a.jsx(Re,{className:"node-icon"}),a.jsx("span",{style:{fontSize:"0.7rem"},children:Me})]})}const Me="调用事件流",Ae="eventFlow",Gr={type:Ae,RenderWhenFlowNode:Lr,RenderWhenCreate:zr,onBeforeInsert(e,r){return{label:Me}},checkComplete:Le,onCreateUi:g.singleNodeCreateUi,onComputedLog:()=>{}};g.FlowManager.UseNode(Gr);function Le(e){return!!(e!=null&&e.id)}class We extends g.FlowNodeManager{constructor(r){super(r)}async _execute(){var f,m;if(!this.option.node.params)return;const r=this.option.node.params;if(!r.id)throw new Error("未定义方法的路径");const n=this.option.flow.getExtra("store"),s=n.eventFlow.getValue(),i=s==null?void 0:s[r.id];if(!i)throw new Error(`未找到事件流: ${r.id}`);const o={};for(const p in(f=i.params)==null?void 0:f.input){const h=(m=r.paramsSetting)==null?void 0:m[p];O.isFxValue(h)?o[p]=await O.computedFormula({context:this.option.flow.context,contextDefine:this.option.flow.contextDefine,code:h.code}):o[p]=h}const l=g.getFlowInstance(i);l.addExtra("store",n);const c=await l.execute(o);this.option.flow.context[this.option.node.name]={_return:c.data,_code:c.code,_msg:c.msg}}}We.Type=Ae,g.FlowNodeManager.AddNode(We);const hn="";function ze(e){return a.jsx(y.Icon,{...e,viewBox:"0 0 1024 1024",children:a.jsx("path",{d:"M597.15264 384c11.84 0 23.04 4.48 31.488 12.736 100.16 92.8 107.584 244.48 17.024 345.92l-216.448 216.32c-92.992 93.12-250.88 85.184-351.552-17.088-97.216-92.736-104-241.472-15.488-341.952l78.08-78.72 0.064 0.128a45.696 45.696 0 0 1 60.8 0.448 41.28 41.28 0 0 1 3.2 58.24l-77.44 77.952a162.688 162.688 0 0 0 17.024 228.224c67.2 67.008 166.4 72.96 222.464 16.64l216.128-217.6a162.688 162.688 0 0 0-17.024-228.288 41.6 41.6 0 0 1-9.408-46.528A44.8 44.8 0 0 1 597.15264 384z m349.056-301.632a246.208 246.208 0 0 1 15.744 343.04l-77.952 78.784h-0.128a45.632 45.632 0 0 1-62.72 1.28 41.536 41.536 0 0 1-1.344-60.288l77.44-77.76a163.456 163.456 0 0 0-16.896-228.992c-67.2-67.2-166.528-73.216-222.592-16.64L441.63264 339.84a163.328 163.328 0 0 0 17.024 228.928 41.6 41.6 0 0 1-1.984 58.688 45.888 45.888 0 0 1-61.12 1.6C295.32864 536 287.84064 384 378.40064 282.24l216.32-216.96c93.12-93.44 251.072-85.504 351.488 17.088z"})})}function Br({id:e,node:r}){const n=x.useMemo(()=>Ye(r.params),[r.params]);return a.jsx(g.FlowNodeRender,{showActions:["delete","open"],node:r,isComplete:n,defaultLabel:r.label,icon:a.jsx(ze,{className:"node-icon"}),MainRender:Ur})}const Yr={type:"string",apiName:"url",label:"地址"};function Ur({node:e}){var o,l;const{flowManager:r,readonly:n}=g.useFlow(),s=g.useFlowVariables(),i=M.useEffectCallback((c,f)=>{const m={...e.params,[c]:f};r.updateNode(e.name,{label:e.label,params:m,result:e.result})},[e]);return a.jsxs(a.Fragment,{children:[a.jsxs(y.Grid.Row,{className:"panel-row",gutter:8,children:[a.jsx(y.Grid.Col,{flex:"120px",children:a.jsx("label",{className:"panel-label is-require",children:"地址"})}),a.jsx(y.Grid.Col,{flex:"auto",children:a.jsx(O.SetterVariable,{disabled:n,useFx:!0,size:"mini",variables:s,define:Yr,value:(o=e.params)==null?void 0:o.url,onChange:c=>i("url",c),showLabel:!1})})]}),a.jsxs(y.Grid.Row,{className:"panel-row",gutter:8,children:[a.jsx(y.Grid.Col,{flex:"120px",children:a.jsx("label",{className:"panel-label",children:"在当前页面打开"})}),a.jsx(y.Grid.Col,{flex:"auto",children:a.jsx(y.Switch,{size:"small",checked:(l=e.params)==null?void 0:l.openInSelf,onChange:c=>i("openInSelf",c)})})]})]})}function Hr(){return a.jsxs("div",{className:"flow-create-display",children:[a.jsx(ze,{className:"node-icon"}),a.jsx("span",{children:Ge})]})}const Ge="打开链接",Be="openLink",qr={type:Be,RenderWhenFlowNode:Br,RenderWhenCreate:Hr,onBeforeInsert(e,r){return{label:Ge}},checkComplete:Ye,onCreateUi:g.singleNodeCreateUi,onComputedLog:()=>{}};g.FlowManager.UseNode(qr);function Ye(e){return!!(e!=null&&e.url)}class Ue extends g.FlowNodeManager{constructor(r){super(r)}async _execute(){if(!this.option.node.params)return;const r=this.option.node.params,n=O.isFxValue(r.url)?await O.computedFormula({context:this.option.flow.context,contextDefine:this.option.flow.contextDefine,code:r.url.code}):r.url;window.open(n,r.openInSelf?"_self":"blank")}}Ue.Type=Be,g.FlowNodeManager.AddNode(Ue);const xn="",bn="",vn="",yn="",jn="",gn="",wn="";function B(){return B=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},B.apply(this,arguments)}function K(e){"@babel/helpers - typeof";return K=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},K(e)}function Kr(e,r){if(K(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,r||"default");if(K(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Jr(e){var r=Kr(e,"string");return K(r)=="symbol"?r:r+""}function Q(e,r,n){return r=Jr(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var ee=x.createContext({prefixCls:"arco"});function He(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,s)}return n}function qe(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?He(Object(n),!0).forEach(function(s){Q(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):He(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function Xr(e,r){var n=x.useContext(ee),s=n.prefixCls,i=s===void 0?"arco":s,o=e.spin,l=e.className,c=qe(qe({"aria-hidden":!0,focusable:!1,ref:r},e),{},{className:"".concat(l?l+" ":"").concat(i,"-icon ").concat(i,"-icon-plus")});return o&&(c.className="".concat(c.className," ").concat(i,"-icon-loading")),delete c.spin,delete c.isIcon,x.createElement("svg",B({fill:"none",stroke:"currentColor",strokeWidth:"4",viewBox:"0 0 48 48"},c),x.createElement("path",{d:"M5 24h38M24 5v38"}))}var oe=x.forwardRef(Xr);oe.defaultProps={isIcon:!0},oe.displayName="IconPlus";const Zr=oe;function Ke(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,s)}return n}function Je(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Ke(Object(n),!0).forEach(function(s){Q(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ke(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function Qr(e,r){var n=x.useContext(ee),s=n.prefixCls,i=s===void 0?"arco":s,o=e.spin,l=e.className,c=Je(Je({"aria-hidden":!0,focusable:!1,ref:r},e),{},{className:"".concat(l?l+" ":"").concat(i,"-icon ").concat(i,"-icon-search")});return o&&(c.className="".concat(c.className," ").concat(i,"-icon-loading")),delete c.spin,delete c.isIcon,x.createElement("svg",B({fill:"none",stroke:"currentColor",strokeWidth:"4",viewBox:"0 0 48 48"},c),x.createElement("path",{d:"M33.072 33.071c6.248-6.248 6.248-16.379 0-22.627-6.249-6.249-16.38-6.249-22.628 0-6.248 6.248-6.248 16.379 0 22.627 6.248 6.248 16.38 6.248 22.628 0Zm0 0 8.485 8.485"}))}var ie=x.forwardRef(Qr);ie.defaultProps={isIcon:!0},ie.displayName="IconSearch";const et=ie;function Xe(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,s)}return n}function Ze(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Xe(Object(n),!0).forEach(function(s){Q(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xe(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function rt(e,r){var n=x.useContext(ee),s=n.prefixCls,i=s===void 0?"arco":s,o=e.spin,l=e.className,c=Ze(Ze({"aria-hidden":!0,focusable:!1,ref:r},e),{},{className:"".concat(l?l+" ":"").concat(i,"-icon ").concat(i,"-icon-delete")});return o&&(c.className="".concat(c.className," ").concat(i,"-icon-loading")),delete c.spin,delete c.isIcon,x.createElement("svg",B({fill:"none",stroke:"currentColor",strokeWidth:"4",viewBox:"0 0 48 48"},c),x.createElement("path",{d:"M5 11h5.5m0 0v29a1 1 0 0 0 1 1h25a1 1 0 0 0 1-1V11m-27 0H16m21.5 0H43m-5.5 0H32m-16 0V7h16v4m-16 0h16M20 18v15m8-15v15"}))}var le=x.forwardRef(rt);le.defaultProps={isIcon:!0},le.displayName="IconDelete";const tt=le;function Qe(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,s)}return n}function er(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Qe(Object(n),!0).forEach(function(s){Q(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qe(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function nt(e,r){var n=x.useContext(ee),s=n.prefixCls,i=s===void 0?"arco":s,o=e.spin,l=e.className,c=er(er({"aria-hidden":!0,focusable:!1,ref:r},e),{},{className:"".concat(l?l+" ":"").concat(i,"-icon ").concat(i,"-icon-edit")});return o&&(c.className="".concat(c.className," ").concat(i,"-icon-loading")),delete c.spin,delete c.isIcon,x.createElement("svg",B({fill:"none",stroke:"currentColor",strokeWidth:"4",viewBox:"0 0 48 48"},c),x.createElement("path",{d:"m30.48 19.038 5.733-5.734a1 1 0 0 0 0-1.414l-5.586-5.586a1 1 0 0 0-1.414 0l-5.734 5.734m7 7L15.763 33.754a1 1 0 0 1-.59.286l-6.048.708a1 1 0 0 1-1.113-1.069l.477-6.31a1 1 0 0 1 .29-.631l14.7-14.7m7 7-7-7M6 42h36"}))}var ce=x.forwardRef(nt);ce.defaultProps={isIcon:!0},ce.displayName="IconEdit";const st=ce,En="";var rr={exports:{}};/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/(function(e){(function(){var r={}.hasOwnProperty;function n(){for(var o="",l=0;l<arguments.length;l++){var c=arguments[l];c&&(o=i(o,s(c)))}return o}function s(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var l="";for(var c in o)r.call(o,c)&&o[c]&&(l=i(l,c));return l}function i(o,l){return l?o?o+" "+l:o+l:o}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(rr);var at=rr.exports;const tr=_r(at);function ot({visible:e,eventFlow:r,disabledNodes:n,modalProps:s,onClose:i,onUpdate:o}){const[l,c]=x.useState(!1),f=x.useRef(null),m=M.useEffectCallback(p=>{r&&(o==null||o({...r,label:p}))},[r,o]);return a.jsx(y.Modal,{...s,wrapClassName:tr("event-flow-editor-modal",s==null?void 0:s.wrapClassName),visible:e,footer:null,title:r&&a.jsxs("div",{style:{paddingRight:"1.5rem",display:"flex",alignItems:"center",gap:8},children:[a.jsx(y.Input,{size:"small",value:r==null?void 0:r.label,onChange:m}),a.jsx(y.Button,{size:"mini",type:"primary",onClick:()=>c(!0),children:"流程变量"})]}),onCancel:i,children:a.jsx("div",{ref:f,style:{height:"100%"},children:e&&r&&a.jsx(g.FlowEditor,{disabledNodes:n,flow:r,onChangeFlow:p=>o==null?void 0:o({...p,label:r.label,apiName:r.apiName}),flowVariableProps:{visible:l,onHidden:()=>c(!1),getPopupContainer:()=>f.current||document.body,modalProps:{getPopupContainer:()=>f.current||document.body,wrapStyle:{position:"absolute"},maskStyle:{position:"absolute"}}}})})})}const Sn="";function it({modalProps:e,disabledNodes:r,eventFlows:n,onChange:s}){const[i,o]=M.useHold(n,s),[l,c]=x.useState(""),[f,m]=x.useState(),p=x.useMemo(()=>{var k;const E=[];for(const N in i)(k=i[N].label)!=null&&k.includes(l)&&E.push({id:N,eventFlow:i[N]});return E},[i,l]),h=x.useCallback(()=>{const E=M.generateId("event_flow");o(k=>({...k,[E]:{label:"事件流",apiName:E,type:"pageEvent"}})),m(E)},[]),b=x.useCallback((E,k)=>{o(N=>{if(!(N!=null&&N[E]))return;const P={...N[E],label:k};return{...N,[E]:P}})},[]),_=x.useCallback((E,k)=>{o(N=>{if(N!=null&&N[E])return{...N,[E]:k}})},[]),I=x.useCallback(E=>{o(k=>{const N={...k};return delete N[E],N})},[]);return a.jsxs("div",{className:"event-flow-setter-wrapper",children:[a.jsxs("div",{className:"event-flow-setter-top",children:[a.jsx(y.Input,{prefix:a.jsx(et,{}),size:"mini",placeholder:"请输入关键词",value:l,onChange:c}),a.jsx(y.Button,{type:"primary",size:"mini",icon:a.jsx(Zr,{}),onClick:h,children:"添加"})]}),a.jsx(y.List,{size:"small",dataSource:p,pagination:{pageSize:6,hideOnSinglePage:!0},render:E=>a.jsx(y.List.Item,{className:"event-flow-setter-item",actions:[a.jsx(y.Popover,{trigger:"hover",position:"top",content:"编辑流程",children:a.jsx(st,{className:"event-flow-setter-edit-icon",onClick:()=>m(E.id)})}),a.jsx(y.Popover,{trigger:"hover",position:"top",content:"删除流程",children:a.jsx(tt,{className:"event-flow-setter-delete-icon",onClick:()=>I(E.id)})})],children:a.jsx(y.Input,{size:"mini",value:E.eventFlow.label,onChange:k=>b(E.id,k)})},E.id)}),a.jsx(ot,{modalProps:e,disabledNodes:r,visible:!!f,eventFlow:i==null?void 0:i[f||""],onClose:()=>m(void 0),onUpdate:E=>f&&_(f,E)})]})}const lt=[{value:"flow",label:"调用事件流"},{value:"method",label:"调用方法"},{value:"setGlobalVariable",label:"赋值页面变量"},{value:"openLink",label:"打开链接"}];function ct({value:e,onChange:r,...n}){return a.jsx(y.Select,{...n,options:lt,value:e,onChange:r})}function nr({define:e,variables:r,value:n,onChange:s}){return e?a.jsxs("div",{className:"event-row",children:[a.jsx("label",{className:"label",children:"返回值"}),a.jsx(O.SetterVariable,{useFx:!0,showLabel:!1,size:"mini",define:e,value:n,variables:r,onChange:s})]}):null}function ut({value:e,triggerMethod:r,variables:n,eventFlows:s,onChange:i}){var c,f;const o=x.useMemo(()=>{if((e==null?void 0:e.type)==="flow"&&e.id)return s==null?void 0:s[e.id]},[e,s]),l=x.useMemo(()=>{if(o!=null&&o.result){const m={type:"object",label:"执行结果",apiName:"_return",prototype:{}};for(const p in o.result)m.prototype[p]=o.result[p].desc;if(Object.keys(m.prototype).length>0)return{...n,_return:m}}return n},[o,n]);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"event-row",children:[a.jsx("label",{className:"label",children:"事件流"}),a.jsx($e,{value:e.id,size:"mini",eventFlows:s,onChange:m=>i==null?void 0:i({type:e.type,id:m})})]}),Object.keys(((c=o==null?void 0:o.params)==null?void 0:c.input)||{}).length>0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"event-line"}),a.jsx(Ve,{value:e.paramsSetting,variables:n,params:(f=o==null?void 0:o.params)==null?void 0:f.input,onChange:m=>i==null?void 0:i({...e,paramsSetting:m})})]}),r.return&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"event-line"}),a.jsx(nr,{define:r.return,variables:l,value:e==null?void 0:e.resultSetting,onChange:m=>i==null?void 0:i({...e,resultSetting:m})})]})]})}function ft({value:e,triggerMethod:r,variables:n,methods:s,onChange:i}){var c;const o=x.useMemo(()=>{var f;if((e==null?void 0:e.type)==="method"&&(f=e.eventPath)!=null&&f.length)return G(e.eventPath,s)},[e,s]),l=x.useMemo(()=>o!=null&&o.return?{...n,_return:{...o.return,label:"执行结果",apiName:"_return"}}:n,[o,n]);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"event-row",children:[a.jsx("label",{className:"label",children:"方法"}),a.jsx(Ce,{value:e.eventPath,size:"mini",methods:s,onChange:f=>i==null?void 0:i({type:e.type,eventPath:f||[]})})]}),((c=o==null?void 0:o.params)==null?void 0:c.length)&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"event-line"}),a.jsx(Pe,{variables:n,params:o==null?void 0:o.params,value:e.paramsSetting,onChange:f=>i==null?void 0:i({...e,paramsSetting:f})})]}),r.return&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"event-line"}),a.jsx(nr,{define:r.return,variables:l,value:e==null?void 0:e.resultSetting,onChange:f=>i==null?void 0:i({...e,resultSetting:f})})]})]})}function dt({value:e,variables:r,onChange:n}){const s=A.useGlobalVariable(),i=x.useMemo(()=>{if((e==null?void 0:e.type)==="setGlobalVariable"&&e.id)return s==null?void 0:s[e.id]},[e,s]),o=x.useMemo(()=>{const l=[];for(const c in s)l.push({value:c,label:s[c].define.label});return l},[s]);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"event-row",children:[a.jsx("label",{className:"label",children:"选择变量"}),a.jsx(y.Select,{size:"mini",options:o,value:e==null?void 0:e.id,onChange:l=>n==null?void 0:n({...e,id:l})})]}),i&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"event-line"}),a.jsxs("div",{className:"event-row",children:[a.jsx("label",{className:"label",children:"新值"}),a.jsx(O.SetterVariable,{useFx:!0,size:"mini",variables:r,define:i.define,value:e==null?void 0:e.value,onChange:l=>n==null?void 0:n({...e,value:l}),showLabel:!1})]})]})]})}const pt={type:"string",apiName:"url",label:"地址"};function mt({value:e,variables:r,onChange:n}){return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"event-row",children:[a.jsx("label",{className:"label",children:"地址"}),a.jsx(O.SetterVariable,{useFx:!0,size:"mini",variables:r,define:pt,value:e==null?void 0:e.url,onChange:s=>n==null?void 0:n({...e,url:s}),showLabel:!1})]}),a.jsxs("div",{className:"event-row",children:[a.jsx("label",{className:"label",children:"在当前页面打开"}),a.jsx(y.Switch,{size:"small",checked:e.openInSelf,onChange:s=>n==null?void 0:n({...e,openInSelf:s})})]})]})}const Nn="";function ht({variables:e,triggerMethod:r,value:n,onChange:s}){const i=A.useEventFlow(),o=A.useEventDefine(),[l,c]=M.useHold(n,s),f=x.useMemo(()=>l?$r(r,l,{eventFlows:i,methods:o}):!0,[l,r,i,o]),m=x.useMemo(()=>{var h;if(!((h=r==null?void 0:r.params)!=null&&h.length))return e;const p={type:"object",label:"函数入参",prototype:{},apiName:"_params"};return r.params.forEach((b,_)=>{p.prototype[_]=b}),{...e,_params:p}},[e,r]);return a.jsxs("div",{className:tr("event-setter-wrapper",!f&&"not-complete"),children:[a.jsx("div",{className:"event-label",children:r.label}),a.jsxs("div",{className:"event-row",children:[a.jsx("label",{className:"label",children:"事件类型"}),a.jsx(ct,{allowClear:!0,value:l==null?void 0:l.type,size:"mini",onChange:p=>c(p?{type:p}:void 0)})]}),(l==null?void 0:l.type)==="flow"&&a.jsx(ut,{value:l,triggerMethod:r,variables:m,eventFlows:i,onChange:c}),(l==null?void 0:l.type)==="method"&&a.jsx(ft,{value:l,triggerMethod:r,variables:m,methods:o,onChange:c}),(l==null?void 0:l.type)==="setGlobalVariable"&&a.jsx(dt,{value:l,variables:m,onChange:c}),(l==null?void 0:l.type)==="openLink"&&a.jsx(mt,{value:l,variables:m,onChange:c})]})}async function xt({value:e,triggerMethod:r,withTriggerParamsVariable:n,withTriggerParamsContext:s,methodContext:i,methods:o}){var h,b;if(!((h=e.eventPath)!=null&&h.length))throw new Error("未定义方法的路径");const l=G(e.eventPath,o);if(!l)throw new Error(`未定义方法: ${e.eventPath.join(".")}`);const c=Oe(e.eventPath,i);if(!c)throw new Error(`未找到方法: ${e.eventPath.join(".")}`);const f=[],m=l.params||[];for(let _=0;_<m.length;_++){const I=(b=e.paramsSetting)==null?void 0:b[_];O.isFxValue(I)?f.push(await O.computedFormula({context:s,contextDefine:n,code:I.code})):f.push(I)}const p=await c(...f);if(r.return){if(O.isFxValue(e.resultSetting)){const{withTriggerReturnContext:_,withTriggerReturnVariable:I}=bt(l,n,s,p);return await O.computedFormula({context:_,contextDefine:I,code:e.resultSetting.code})}return e.resultSetting}}function bt(e,r,n,s){const i={...r},o={...n};return e.return&&(i._return={...e.return,label:"执行结果",apiName:"_return"},o._return=s),{withTriggerReturnVariable:i,withTriggerReturnContext:o}}async function vt({withTriggerParamsContext:e,withTriggerParamsVariable:r,eventFlows:n,store:s,value:i,triggerMethod:o}){var p,h;if(!i.id)throw new Error("未定义方法的路径");const l=n==null?void 0:n[i.id];if(!l)throw new Error(`未找到事件流: ${i.id}`);const c={};for(const b in(p=l.params)==null?void 0:p.input){const _=(h=i.paramsSetting)==null?void 0:h[b];O.isFxValue(_)?c[b]=await O.computedFormula({context:e,contextDefine:r,code:_.code}):c[b]=_}const f=g.getFlowInstance(l);f.addExtra("store",s);const m=await f.execute(c);if(m.code!==0){console.error(m.msg);return}if(o.return){if(O.isFxValue(i.resultSetting)){const{withTriggerReturnContext:b,withTriggerReturnVariable:_}=yt(l,r,e,m.data);return await O.computedFormula({context:b,contextDefine:_,code:i.resultSetting.code})}return i.resultSetting}}function yt(e,r,n,s){const i={...r},o={...n};if(e.result){const l={type:"object",label:"执行结果",apiName:"_return",prototype:{}};for(const c in e.result)l.prototype[c]=e.result[c].desc;i._return=l,o._return=s}return{withTriggerReturnVariable:i,withTriggerReturnContext:o}}async function jt({withTriggerParamsContext:e,withTriggerParamsVariable:r,value:n,store:s}){if(!n.id)throw new Error("未选择页面变量");const i=O.isFxValue(n.value)?await O.computedFormula({context:e,contextDefine:r,code:n.value.code}):n.value;s.variableStore.updateValueByPath([...A.GLOBAL_VARIABLE_PREFIX,n.id],i)}async function gt({withTriggerParamsContext:e,withTriggerParamsVariable:r,value:n}){if(!n.url)throw new Error("未填写页面地址");const s=O.isFxValue(n.url)?await O.computedFormula({context:e,contextDefine:r,code:n.url.code}):n.url;window.open(s,n.openInSelf?"_self":"blank")}async function wt({value:e,triggerMethod:r,triggerParams:n,variables:s,variableContext:i,store:o}){const{withTriggerParamsContext:l,withTriggerParamsVariable:c}=Et(r,s,i,n);if(e.type==="flow")return await vt({withTriggerParamsVariable:c,withTriggerParamsContext:l,eventFlows:o.eventFlow.getValue(),store:o,value:e,triggerMethod:r});if(e.type==="method")return await xt({withTriggerParamsVariable:c,withTriggerParamsContext:l,methods:o.eventDefine.getValue(),methodContext:A.getMethodFromStore(o),value:e,triggerMethod:r});if(e.type==="setGlobalVariable"){await jt({withTriggerParamsVariable:c,withTriggerParamsContext:l,store:o,value:e});return}if(e.type==="openLink"){await gt({withTriggerParamsVariable:c,withTriggerParamsContext:l,value:e});return}}function Et(e,r,n,s){var l;const i={...r},o={...n};if((l=e==null?void 0:e.params)!=null&&l.length){const c={type:"object",label:"函数入参",prototype:{},apiName:"_params"},f={};e.params.forEach((m,p)=>{c.prototype[p]=m,f[p]=s==null?void 0:s[p]}),i._params=c,o._params=f}return{withTriggerParamsVariable:i,withTriggerParamsContext:o}}$.EventFlowSetter=it,$.EventSetter=ht,$.executeEvent=wt,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
