@boltic/swirl 1.0.2-sit.51 → 1.0.2-sit.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/swirl.es.js CHANGED
@@ -117970,7 +117970,9 @@ const pWe = /* @__PURE__ */ Si(fWe), hWe = Hr((e, t) => {
117970
117970
  const $ = j.map((Q) => I.current.find((K) => K.id === Q)).filter(Boolean);
117971
117971
  $.length && P(
117972
117972
  "properties.events",
117973
- $.map((Q) => ({ slug: `${Q.event_name}/${Q.event_type}` }))
117973
+ $.map((Q) => ({
117974
+ slug: `${Q.event_category}/${Q.event_name}/${Q.event_type}/v${Q.version}`
117975
+ }))
117974
117976
  );
117975
117977
  }, [h]);
117976
117978
  const X = (j) => Tt(j) ? [] : M.event_details?.event_category === "application" ? Object.keys(j.application).map(($) => ({
@@ -117983,7 +117985,8 @@ const pWe = /* @__PURE__ */ Si(fWe), hWe = Hr((e, t) => {
117983
117985
  title: j.event_type,
117984
117986
  value: j.id,
117985
117987
  event_name: j.event_name,
117986
- event_type: j.event_type
117988
+ event_type: j.event_type,
117989
+ event_category: j.event_category
117987
117990
  })) : [];
117988
117991
  return /* @__PURE__ */ f.jsxs(le, { gap: 2.5, children: [
117989
117992
  /* @__PURE__ */ f.jsx(Vo, { children: /* @__PURE__ */ f.jsx(
@@ -118154,17 +118157,19 @@ const pWe = /* @__PURE__ */ Si(fWe), hWe = Hr((e, t) => {
118154
118157
  multiple: !0,
118155
118158
  placeholder: "Select Events",
118156
118159
  handleChange: (j) => {
118157
- const { value: $ } = j, Q = $.map((Y) => {
118158
- const ae = z.find(
118159
- (G) => G.value === Y
118160
+ const { value: $ } = j, Q = M.version, K = $.map((ae) => {
118161
+ const G = z.find(
118162
+ (re) => re.value === ae
118160
118163
  );
118161
- return { slug: `${ae?.event_name}/${ae?.event_type}` };
118164
+ return {
118165
+ slug: `${G?.event_category}/${G?.event_name}/${G?.event_type}/v${Q}`
118166
+ };
118162
118167
  });
118163
- P("properties.events", Q);
118164
- const K = z.find(
118165
- (Y) => Y.value === $?.[0]
118168
+ P("properties.events", K);
118169
+ const Y = z.find(
118170
+ (ae) => ae.value === $?.[0]
118166
118171
  );
118167
- P("properties.event_details.event_type", K?.title);
118172
+ P("properties.event_details.event_type", Y?.title);
118168
118173
  },
118169
118174
  getSelectedValue: (j) => j.map(
118170
118175
  ($) => z.find(
package/dist/swirl.umd.js CHANGED
@@ -519,7 +519,7 @@ Expecting `+K.join(", ")+", got '"+(this.terminals_[P]||P)+"'":F="Parse error on
519
519
  `))):X=R.stylize("[Circular]","special")),P(U)){if(H&&q.match(/^\d+$/))return X;U=JSON.stringify(""+q),U.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(U=U.substr(1,U.length-2),U=R.stylize(U,"name")):(U=U.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),U=R.stylize(U,"string"))}return U+": "+X}function T(R,$,j){var Y=R.reduce(function(q,H){return H.indexOf(`
520
520
  `)>=0,q+H.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Y>60?j[0]+($===""?"":$+`
521
521
  `)+" "+R.join(`,
522
- `)+" "+j[1]:j[0]+$+" "+R.join(", ")+" "+j[1]}function v(R){return Array.isArray(R)}i.isArray=v;function _(R){return typeof R=="boolean"}i.isBoolean=_;function x(R){return R===null}i.isNull=x;function b(R){return R==null}i.isNullOrUndefined=b;function w(R){return typeof R=="number"}i.isNumber=w;function D(R){return typeof R=="string"}i.isString=D;function I(R){return typeof R=="symbol"}i.isSymbol=I;function P(R){return R===void 0}i.isUndefined=P;function k(R){return N(R)&&Q(R)==="[object RegExp]"}i.isRegExp=k;function N(R){return typeof R=="object"&&R!==null}i.isObject=N;function L(R){return N(R)&&Q(R)==="[object Date]"}i.isDate=L;function M(R){return N(R)&&(Q(R)==="[object Error]"||R instanceof Error)}i.isError=M;function B(R){return typeof R=="function"}i.isFunction=B;function G(R){return R===null||typeof R=="boolean"||typeof R=="number"||typeof R=="string"||typeof R=="symbol"||typeof R>"u"}i.isPrimitive=G,i.isBuffer=n("./support/isBuffer");function Q(R){return Object.prototype.toString.call(R)}function K(R){return R<10?"0"+R.toString(10):R.toString(10)}var F=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V(){var R=new Date,$=[K(R.getHours()),K(R.getMinutes()),K(R.getSeconds())].join(":");return[R.getDate(),F[R.getMonth()],$].join(" ")}i.log=function(){},i.inherits=n("inherits"),i._extend=function(R,$){if(!$||!N($))return R;for(var j=Object.keys($),Y=j.length;Y--;)R[j[Y]]=$[j[Y]];return R};function W(R,$){return Object.prototype.hasOwnProperty.call(R,$)}}).call(this,n("_process"),typeof jn<"u"?jn:typeof self<"u"?self:typeof window<"u"?window:{})},{"./support/isBuffer":10,_process:14,inherits:9}],12:[function(n,r,i){},{}],13:[function(n,r,i){(function(o){function s(c,d){for(var p=0,h=c.length-1;h>=0;h--){var A=c[h];A==="."?c.splice(h,1):A===".."?(c.splice(h,1),p++):p&&(c.splice(h,1),p--)}if(d)for(;p--;p)c.unshift("..");return c}i.resolve=function(){for(var c="",d=!1,p=arguments.length-1;p>=-1&&!d;p--){var h=p>=0?arguments[p]:o.cwd();if(typeof h!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!h)continue;c=h+"/"+c,d=h.charAt(0)==="/"}return c=s(l(c.split("/"),function(A){return!!A}),!d).join("/"),(d?"/":"")+c||"."},i.normalize=function(c){var d=i.isAbsolute(c),p=u(c,-1)==="/";return c=s(l(c.split("/"),function(h){return!!h}),!d).join("/"),!c&&!d&&(c="."),c&&p&&(c+="/"),(d?"/":"")+c},i.isAbsolute=function(c){return c.charAt(0)==="/"},i.join=function(){var c=Array.prototype.slice.call(arguments,0);return i.normalize(l(c,function(d,p){if(typeof d!="string")throw new TypeError("Arguments to path.join must be strings");return d}).join("/"))},i.relative=function(c,d){c=i.resolve(c).substr(1),d=i.resolve(d).substr(1);function p(T){for(var v=0;v<T.length&&T[v]==="";v++);for(var _=T.length-1;_>=0&&T[_]==="";_--);return v>_?[]:T.slice(v,_-v+1)}for(var h=p(c.split("/")),A=p(d.split("/")),g=Math.min(h.length,A.length),m=g,E=0;E<g;E++)if(h[E]!==A[E]){m=E;break}for(var y=[],E=m;E<h.length;E++)y.push("..");return y=y.concat(A.slice(m)),y.join("/")},i.sep="/",i.delimiter=":",i.dirname=function(c){if(typeof c!="string"&&(c=c+""),c.length===0)return".";for(var d=c.charCodeAt(0),p=d===47,h=-1,A=!0,g=c.length-1;g>=1;--g)if(d=c.charCodeAt(g),d===47){if(!A){h=g;break}}else A=!1;return h===-1?p?"/":".":p&&h===1?"/":c.slice(0,h)};function a(c){typeof c!="string"&&(c=c+"");var d=0,p=-1,h=!0,A;for(A=c.length-1;A>=0;--A)if(c.charCodeAt(A)===47){if(!h){d=A+1;break}}else p===-1&&(h=!1,p=A+1);return p===-1?"":c.slice(d,p)}i.basename=function(c,d){var p=a(c);return d&&p.substr(-1*d.length)===d&&(p=p.substr(0,p.length-d.length)),p},i.extname=function(c){typeof c!="string"&&(c=c+"");for(var d=-1,p=0,h=-1,A=!0,g=0,m=c.length-1;m>=0;--m){var E=c.charCodeAt(m);if(E===47){if(!A){p=m+1;break}continue}h===-1&&(A=!1,h=m+1),E===46?d===-1?d=m:g!==1&&(g=1):d!==-1&&(g=-1)}return d===-1||h===-1||g===0||g===1&&d===h-1&&d===p+1?"":c.slice(d,h)};function l(c,d){if(c.filter)return c.filter(d);for(var p=[],h=0;h<c.length;h++)d(c[h],h,c)&&p.push(c[h]);return p}var u="ab".substr(-1)==="b"?function(c,d,p){return c.substr(d,p)}:function(c,d,p){return d<0&&(d=c.length+d),c.substr(d,p)}}).call(this,n("_process"))},{_process:14}],14:[function(n,r,i){var o=r.exports={},s,a;function l(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?s=setTimeout:s=l}catch{s=l}try{typeof clearTimeout=="function"?a=clearTimeout:a=u}catch{a=u}})();function c(v){if(s===setTimeout)return setTimeout(v,0);if((s===l||!s)&&setTimeout)return s=setTimeout,setTimeout(v,0);try{return s(v,0)}catch{try{return s.call(null,v,0)}catch{return s.call(this,v,0)}}}function d(v){if(a===clearTimeout)return clearTimeout(v);if((a===u||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(v);try{return a(v)}catch{try{return a.call(null,v)}catch{return a.call(this,v)}}}var p=[],h=!1,A,g=-1;function m(){!h||!A||(h=!1,A.length?p=A.concat(p):g=-1,p.length&&E())}function E(){if(!h){var v=c(m);h=!0;for(var _=p.length;_;){for(A=p,p=[];++g<_;)A&&A[g].run();g=-1,_=p.length}A=null,h=!1,d(v)}}o.nextTick=function(v){var _=new Array(arguments.length-1);if(arguments.length>1)for(var x=1;x<arguments.length;x++)_[x-1]=arguments[x];p.push(new y(v,_)),p.length===1&&!h&&c(E)};function y(v,_){this.fun=v,this.array=_}y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={};function T(){}o.on=T,o.addListener=T,o.once=T,o.off=T,o.removeListener=T,o.removeAllListeners=T,o.emit=T,o.prependListener=T,o.prependOnceListener=T,o.listeners=function(v){return[]},o.binding=function(v){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(v){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],15:[function(n,r,i){var o=n("escodegen").generate;r.exports=function(a,l,u){u||(u={});var c=!u.allowAccessToMethodsOnFunctions;l||(l={});var d={},p=(function h(A,g){if(A.type==="Literal")return A.value;if(A.type==="UnaryExpression"){var m=h(A.argument,g);return A.operator==="+"?+m:A.operator==="-"?-m:A.operator==="~"?~m:A.operator==="!"?!m:d}else if(A.type==="ArrayExpression"){for(var E=[],y=0,T=A.elements.length;y<T;y++){var v=h(A.elements[y],g);if(v===d)return d;E.push(v)}return E}else if(A.type==="ObjectExpression"){for(var _={},y=0;y<A.properties.length;y++){var x=A.properties[y],b=x.value===null?x.value:h(x.value,g);if(b===d)return d;_[x.key.value||x.key.name]=b}return _}else if(A.type==="BinaryExpression"||A.type==="LogicalExpression"){var w=A.operator;if(w==="&&"){var T=h(A.left);if(T===d)return d;if(!T)return T;var D=h(A.right);return D===d?d:D}else if(w==="||"){var T=h(A.left);if(T===d)return d;if(T)return T;var D=h(A.right);return D===d?d:D}var T=h(A.left,g);if(T===d)return d;var D=h(A.right,g);return D===d?d:w==="=="?T==D:w==="==="?T===D:w==="!="?T!=D:w==="!=="?T!==D:w==="+"?T+D:w==="-"?T-D:w==="*"?T*D:w==="/"?T/D:w==="%"?T%D:w==="<"?T<D:w==="<="?T<=D:w===">"?T>D:w===">="?T>=D:w==="|"?T|D:w==="&"?T&D:w==="^"?T^D:d}else{if(A.type==="Identifier")return{}.hasOwnProperty.call(l,A.name)?l[A.name]:d;if(A.type==="ThisExpression")return{}.hasOwnProperty.call(l,"this")?l.this:d;if(A.type==="CallExpression"){var I=h(A.callee,g);if(I===d||typeof I!="function")return d;var P=A.callee.object?h(A.callee.object,g):d;P===d&&(P=null);for(var k=[],y=0,T=A.arguments.length;y<T;y++){var v=h(A.arguments[y],g);if(v===d)return d;k.push(v)}return g?void 0:I.apply(P,k)}else if(A.type==="MemberExpression"){var _=h(A.object,g);if(_===d||typeof _=="function"&&c)return d;if(A.property.type==="Identifier"&&!A.computed)return s(A.property.name)?d:_[A.property.name];var x=h(A.property,g);return x===null||x===d||s(x)?d:_[x]}else if(A.type==="ConditionalExpression"){var m=h(A.test,g);return m===d?d:m?h(A.consequent):h(A.alternate,g)}else if(A.type==="ExpressionStatement"){var m=h(A.expression,g);return m===d?d:m}else{if(A.type==="ReturnStatement")return h(A.argument,g);if(A.type==="FunctionExpression"){var N=A.body.body,L={};Object.keys(l).forEach(function(R){L[R]=l[R]});for(var y=0;y<A.params.length;y++){var M=A.params[y];if(M.type=="Identifier")l[M.name]=null;else return d}for(var y in N)if(h(N[y],!0)===d)return d;l=L;var B=Object.keys(l),G=B.map(function(R){return l[R]});return Function(B.join(", "),"return "+o(A)).apply(null,G)}else if(A.type==="TemplateLiteral"){for(var Q="",y=0;y<A.expressions.length;y++)Q+=h(A.quasis[y],g),Q+=h(A.expressions[y],g);return Q+=h(A.quasis[y],g),Q}else if(A.type==="TaggedTemplateExpression"){var K=h(A.tag,g),F=A.quasi,V=F.quasis.map(h),W=F.expressions.map(h);return K.apply(null,[V].concat(W))}else return A.type==="TemplateElement"?A.value.cooked:d}}})(a);return p===d?void 0:p};function s(a){return a==="constructor"||a==="__proto__"}},{escodegen:12}],jsonpath:[function(n,r,i){r.exports=n("./lib/index")},{"./lib/index":5}]},{},["jsonpath"])("jsonpath")})})(RN)),RN.exports}var B$e=F$e();const $$e=ii(B$e),j$e=e=>{try{return M$e(e),!0}catch(t){return t}},U$e=e=>{try{return $$e.query({},e),!0}catch(t){return t}},H$e=C.forwardRef((e,t)=>{const{type:n,isLoop:r,suggestionsData:i,id:o,viewOnly:s=!1}=e,{loopSuggestionsData:a={}}=pt.useSelector(m=>m.loopActivity),{watch:l,control:u,setValue:c,formState:{errors:d}}=Vn(),p=l("properties.from_type"),h=l("properties.to_type"),A=tue.filter(m=>!!m.visibleKey.find(E=>E===p)),g=m=>m==="json"?"json":m==="xml"?"xml":"html";return C.useEffect(()=>{h===""&&c("properties.query","")},[h]),f.jsx(qr,{children:f.jsxs(O.Grid,{container:!0,gap:1.5,children:[f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{name:"properties.from_type",control:u,meta:{options:eue,displayName:"Convert from",searchFieldPlaceholder:"Search",description:"Choose the type of data you are starting with.",placeholder:"Select Convert from"},validationRules:{required:"Convert from is required"},handleChange:()=>{c("properties.to_type","")},viewOnly:s,required:!0})}),p&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.data",control:u,rules:{required:"Data is required"},render:({field:m})=>f.jsx(_o,{...m,label:"Data",showSuggestions:!0,suggestionsData:r?a:i,id:`${n}-data`,size:"md",suggestionLabel:"Data",viewOnly:s,language:g(p?.toLowerCase()),showHtmlPreview:p?.toLowerCase()?.includes("html"),placeholder:"Enter the input data to be converted.",handleChange:E=>m.onChange(E),showExpandOption:!0,error:!!d.properties?.data?.message,errorMsg:d.properties?.data?.message,helperText:"Paste or enter the input data to be converted.",required:!0})})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{name:"properties.to_type",control:u,meta:{options:A,displayName:"Convert to",searchFieldPlaceholder:"Search",description:"Choose the type you want to convert the data into.",placeholder:"Select Convert to"},validationRules:{required:"Convert to is required"},viewOnly:s,required:!0})}),h==="jsonata"&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.query",control:u,rules:{validate:m=>m&&j$e(m)!==!0?"Error in JSONata expression. Please check the expression's syntax.":!0},render:({field:m})=>f.jsx(_o,{...m,language:"javascript",suggestionLabel:"Query",placeholder:"Enter a JSONata / JSONPath query to transform the data",size:"md",suggestionsData:r?a:i,id:`${n}-query2`,showSuggestions:!0,viewOnly:s,handleChange:E=>{Et(E)||m.onChange(E)},label:"Query",helperText:"To know more about how to use jsonata, visit https://docs.jsonata.org/overview.html.",showExpandOption:!0,error:!!d.properties?.query?.message,errorMsg:d.properties?.query?.message})})}),h==="jsonpath"&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.query",control:u,rules:{validate:m=>m&&U$e(m)!==!0?"Error in JSONPath expression. Please check the expression's syntax.":!0},render:({field:m})=>f.jsx(_o,{...m,language:"javascript",placeholder:"Enter a JSONata / JSONPath query to transform the data",size:"md",suggestionsData:r?a:i,id:`${n}-query`,showSuggestions:!0,viewOnly:s,handleChange:E=>{Et(E)||m.onChange(E)},suggestionLabel:"Query",label:"Query",helperText:"To know more about how to use JSONPath, visit https://goessner.net/articles/JsonPath/",error:!!d.properties?.query?.message,errorMsg:d.properties?.query?.message,showExpandOption:!0})})}),h==="graphql"&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(Wn,{id:o,name:"properties.query_options",control:u,meta:{displayName:"Query Options",description:"Provide GraphQL-specific options if your query needs them.",placeholder:"Specify Query Options"},viewOnly:s,editorId:`${n}-query_options`})}),!r&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(qi,{viewOnly:s,type:n})})]})})}),V$e=Go(H$e,"");var os=(e=>(e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.OBJECT="object",e.ARRAY="array",e.NULL="null",e))(os||{});const CY={string:"",boolean:!0,number:0,object:{},array:[],null:[]},_Y=e=>e?.jsonGui??Pb.colors.jsonGui,PN=e=>{const t=_Y(e);return[{value:"string",label:"abc",color:t.string,icon:"ic_string",name:"String"},{value:"number",label:"123",color:t.number,icon:"ic_number",name:"Number"},{value:"boolean",label:"true",color:t.boolean,icon:"ic_boolean",name:"Boolean"},{value:"array",label:"[]",color:t.array,icon:"ic_array",name:"Array"},{value:"object",label:"{}",color:t.object,icon:"ic_object",name:"Object"},{value:"null",label:"null",color:t.null,icon:"ic_null",name:"Null"}]},wY=e=>{const t=_Y(e);return[{value:"string",label:"abc",color:t.string,icon:"ic_string",name:"String"},{value:"number",label:"123",color:t.number,icon:"ic_number",name:"Number"},{value:"boolean",label:"true",color:t.boolean,icon:"ic_boolean",name:"Boolean"},{value:"null",label:"null",color:t.null,icon:"ic_null",name:"Null"}]};PN(null),wY(null);const OS=e=>Object.prototype.toString.call(e).match(/\w+/g)?.[1].toLowerCase(),IY=(e,t,n)=>{const r=e.shift(),i=Object.keys(t);if(e.length)return IY(e,t[i[r]],n);t[i[r]]=n},DY=(e,t,n)=>(IY(t,n,e),n),RY=e=>e.split("-").slice(1),G$e=e=>e&&typeof e=="object",qg=C.createContext(null),NN=e=>{const{setEditObject:t,editObject:n,setTempData:r}=C.useContext(qg),i=O.useTheme(),o=PN(i.palette),{uniqueKey:s,sourceData:a,id:l,showSuggestions:u,excludePayloadSuggestions:c=!1,onChange:d,setIsEditing:p}=e,h=Array.isArray(a),[A,g]=C.useState({}),[m,E]=C.useState({}),[y,T]=C.useState(""),v={fontSize:"18px",marginRight:"5px"},_=(N,L)=>{m[N]=L,A[N]={},T(""),g({...A}),E({...m}),p?.(!0),r(L?M=>({...M,"":""}):M=>{const B={...M};return delete B[""],B})},x=()=>{g({}),E({}),T("")};C.useEffect(()=>{x()},[h]);const b=(N,L)=>{const M=N.target.value.trim();A[L].key=M,g({...A});const B=TN(M,a);T(B)},w=(N,L)=>{A[N].value=L,g({...A})},D=(N,L)=>{A[N].type=L,A[N].value=CY[L],g({...A})},I=(N,L)=>{switch(L){case os.NULL:return null;case os.BOOLEAN:return typeof N=="string"?N==="true":!!N;case os.NUMBER:return Number(N);case os.STRING:return String(N||"");default:return N||""}},P=(N,L)=>{const M=A[N];if(!M)return;const{key:B,value:G,type:Q}=M,F=Q===os.OBJECT||Q===os.ARRAY?Q===os.ARRAY?[]:{}:I(G,Q);if(!h){const V=TN(B,L);if(V){T(V);return}}h?L.push(F):L[B]=F,t({...n}),x(),r?.({...n}),p?.(!1)},k=N=>{switch(N){case os.STRING:return f.jsx(O.Stack,{width:"150px",children:f.jsx(bo,{viewOnly:e.viewOnly,fullWidth:!0,onChange:L=>w(s,L.target.value),showSuggestion:u,id:l,placeholder:"value",editorId:`${l}-${N}-${s}`,"data-testid":`${l}-${N}-${s}`,excludePayloadSuggestions:c})});case os.NUMBER:return f.jsx(O.Stack,{width:"150px",ml:-1.5,children:f.jsx(bo,{viewOnly:e.viewOnly,fullWidth:!0,type:"number",placeholder:"value",autoComplete:"off",onChange:L=>w(s,+L.target.value),"data-testid":`${l}-${N}-${s}`,excludePayloadSuggestions:c})});case os.BOOLEAN:return f.jsx(O.Stack,{width:"150px",ml:-1.5,children:f.jsxs(O.Select,{disabled:e.viewOnly,size:"small",value:A[s]?.value!==!1,"data-testid":`${l}-${N}-${s}`,sx:{".MuiInputBase-inputSizeSmall":{height:"auto !important"}},onChange:L=>{const M=L.target.value==="true";w(s,M)},children:[f.jsx(O.MenuItem,{value:"true",children:"true"}),f.jsx(O.MenuItem,{value:"false",children:"false"})]})});default:return null}};return f.jsx(O.Box,{className:"addItem",width:"100%",children:m[s]?f.jsxs(O.Stack,{direction:"row",alignItems:y?"flex-start":"center",width:"100%",children:[!h&&f.jsxs(O.Stack,{sx:{position:"relative"},children:[f.jsx(bo,{viewOnly:e.viewOnly,fullWidth:!0,onChange:N=>b(N,s),showSuggestion:u,id:l,sx:{width:"130px"},placeholder:"key",editorId:`key-${s}`,"data-testid":`key-${s}`,error:!!y,excludePayloadSuggestions:c}),y&&f.jsx(O.Box,{sx:{position:"absolute",top:38,left:0,color:i.palette.error.main,fontSize:"0.75rem",lineHeight:1},children:f.jsx(O.FormHelperText,{"data-testid":`errorMsg-${s}`,error:!0,children:y})})]}),f.jsx(O.Select,{size:"small","data-testid":`select-type-${s}`,disabled:e.viewOnly,sx:{mx:1,mr:2.1,".MuiSelect-select":{padding:"10px 38px 10px 14px",fontSize:10},".MuiInputBase-inputSizeSmall":{height:"auto !important"},".MuiOutlinedInput-notchedOutline":{p:0,width:"120px"}},MenuProps:{PaperProps:{sx:{minWidth:"120px !important",marginLeft:"4px !important"}}},onChange:N=>D(s,N.target.value),value:A[s]?.type||os.STRING,renderValue:N=>{const L=o.find(M=>M.value===N);return f.jsxs(O.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,children:[f.jsx(Fe,{src:L?.icon,width:14,height:14,sx:{marginRight:8,color:L?.color}}),f.jsx(O.Typography,{variant:"smMedium",color:"text.secondary",children:L?.name})]})},children:o.map(N=>f.jsxs(O.MenuItem,{value:N.value,sx:{...Ff,minHeight:"40px !important","@media (min-width: 600px)":{minHeight:"40px !important"}},children:[f.jsx(Fe,{src:N.icon,width:18,height:18,sx:{color:N.color}}),f.jsx(O.Typography,{variant:"smMedium",color:"text.secondary",children:N.name})]},N.value))}),f.jsx("span",{className:"jsonValue",children:k(A[s]?.type||os.STRING)}),f.jsxs(O.Stack,{direction:"row",spacing:1,ml:Et(n)?1:0,children:[f.jsx(O.IconButton,{size:"small",color:"primary",onClick:()=>{P(s,a),d&&d(n)},sx:{minWidth:0},"data-testid":`confirm-${s}`,disabled:!!y||e?.viewOnly,children:f.jsx(Fe,{src:"ic_done",width:16,height:16})}),f.jsx(O.IconButton,{"data-testid":`close-btn-${s}`,size:"small",onClick:()=>{_(s,!1),p?.(!1)},disabled:e?.viewOnly,sx:{minWidth:0},children:f.jsx(Fe,{width:16,height:16,src:"ic_close"})})]})]}):f.jsxs(O.Button,{variant:"text",disabled:e.viewOnly,"data-testid":"json-gui-add-btn",sx:{color:N=>N.palette.primary[60],mt:Et(n)?0:2,"&:hover":{backgroundColor:"transparent",color:N=>N.palette.primary[50],"& .MuiTypography-root":{color:N=>N.palette.primary[50]},"& svg path":{fill:N=>N.palette.primary[50]}}},disableFocusRipple:!0,disableTouchRipple:!0,disableRipple:!0,disableElevation:!0,onClick:()=>_(s,!0),children:[f.jsx(Fe,{src:"ic_plus",sx:{...v,path:{fill:"currentColor"}}}),f.jsx(O.Typography,{variant:"smNormal",sx:{alignItems:"center"},children:"Add"})]})},s)},LN={base:{transformOrigin:"center",transition:"transform 0.2s cubic-bezier(0.4, 0, 0.2, 1)",mr:.5},right:{transform:"rotate(0deg)"},down:{transform:"rotate(90deg)"}};function kN({fieldValue:e,uniqueKey:t}){const{onChangeAllow:n,allowMap:r}=C.useContext(qg);if(!G$e(e))return f.jsx("span",{});const i=r[t];return f.jsx(O.IconButton,{onClick:()=>n(t),"data-testid":`collapse-${t}`,sx:{...LN.base,...i?LN.right:LN.down},children:f.jsx(Fe,{src:"ic_right_arrow"})})}function PY(e){const t=O.useTheme(),n=PN(t.palette);return f.jsx(qg.Consumer,{children:({onChangeType:r})=>f.jsx(O.Select,{size:"small","data-testid":`select-type-${e.uniqueKey}`,disabled:e.viewOnly,sx:{".MuiSelect-select":{fontSize:10},".MuiInputBase-inputSizeSmall":{height:"auto !important"},".MuiOutlinedInput-notchedOutline":{p:0}},onChange:i=>r(i.target.value,e.uniqueKey),value:OS(e.fieldValue),renderValue:i=>{const o=n.find(s=>s.value===i);return f.jsxs(O.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,children:[f.jsx(Fe,{src:o?.icon,width:14,height:14,sx:{marginRight:8,color:o?.color}}),f.jsx(O.Typography,{variant:"smMedium",color:"text.secondary",children:o?.name})]})},children:n.map(i=>f.jsxs(O.MenuItem,{value:i.value,sx:{...Ff},children:[f.jsx(Fe,{src:i.icon,width:18,height:18,sx:{color:i.color}}),f.jsx(O.Typography,{variant:"smMedium",color:"text.secondary",children:i.name})]},i.value))})})}function W$e(e){const{setIsEditing:t,fieldValue:n,parentUniqueKey:r,viewOnly:i,getValue:o,deepLevel:s,id:a,showSuggestions:l,excludePayloadSuggestions:u,onClickDelete:c,onChange:d}=e,{allowMap:p}=C.useContext(qg);return f.jsxs(O.Box,{className:"arrayContent",children:[f.jsx(O.Box,{sx:{marginTop:"10px"},"data-testid":"arrayContent",children:n.map((h,A)=>{const g=`${r}-${A}`,m=OS(h);return f.jsxs(O.Stack,{className:"indexLine",direction:"row",alignItems:"center",gap:1,justifyContent:"flex-start",flexWrap:["object","array"].includes(m)?"wrap":"nowrap",sx:{"& .jsonValue":{flex:["object","array"].includes(m)?"1 1 100%":"0 0 auto",width:["object","array"].includes(m)?"100%":"auto",minWidth:["object","array"].includes(m)?"auto":"150px"}},children:[["object","array"].includes(m)&&f.jsx(kN,{uniqueKey:g,fieldValue:h}),f.jsx(PY,{viewOnly:i,uniqueKey:g,fieldValue:h,fieldKey:`${A}`,sourceData:n,"data-testid":`tools-${g}`,type:"array"}),!p[g]&&f.jsx("span",{className:"jsonValue",children:o(h,A,n,s+1,g)}),f.jsx(O.Stack,{ml:1,alignItems:"center",direction:"row","data-testid":`delete-${g}`,sx:["object","array"].includes(m)?{position:"absolute",right:260,top:4}:{position:"relative",ml:1},children:f.jsx(O.IconButton,{disabled:i,onClick:()=>c(A,n),sx:{ml:.5,"&:hover":{backgroundColor:"transparent"}},children:f.jsx(Fe,{src:"ic_delete"})})})]},g)})}),f.jsx(O.Box,{children:f.jsx(NN,{viewOnly:i,uniqueKey:r,deepLevel:s,sourceData:n,id:a,showSuggestions:l,excludePayloadSuggestions:u,setIsEditing:t,onChange:d},r)})]})}function NY(e){const t=O.useTheme(),{editObject:n,setEditObject:r,id:i,showSuggestions:o,setTempData:s,tempData:a,excludePayloadSuggestions:l=!1,viewOnly:u=!1,onChange:c,setIsEditing:d}=e,[p,h]=C.useState({}),[A,g]=C.useState({}),[m,E]=C.useState(!0),[y,T]=C.useState(!1),v=G=>{r({...G}),c?.(G),s&&s({...G})};C.useEffect(()=>{const G=setTimeout(()=>{E(!1)},500);return()=>clearTimeout(G)},[]);const _=(G,Q)=>{Array.isArray(Q)?(Q.splice(+G,1),c&&c(Q)):(Reflect.deleteProperty(Q,G),c&&c(Q)),v(n)},x=(G,Q)=>{const K=G===os.NULL?null:CY[G],F=DY(K,RY(Q),n);v(F)},b=(G,Q,K,F)=>{const V=G.target.value.trim();if(Q!==V){const j=TN(V,F);if(g(Y=>({...Y,[K]:j})),j)return}const W={};for(const j in F)Object.prototype.hasOwnProperty.call(F,j)&&(j===Q?W[G.target.value]=F[j]:W[j]=F[j]);g(j=>{const Y={...j};return delete Y[K],Y});const R=RY(K);if(R.length===1)v(W);else{R.pop();const j=DY(W,R,n);v(j)}},w=(G,Q,K,F="")=>{K[Q]=F==="number"?Number(G):G,v(n)},D=G=>!!(typeof G!="object"||G===null||Array.isArray(G)||Object.keys(G).length===0),I={position:"absolute",left:-4,width:"2px",height:"calc(100% - 22px)",borderLeft:`1px solid ${t.palette.grey.outlined.border}`,"&::after":{content:'""',position:"absolute",bottom:0,width:"20px",height:"1px",backgroundColor:t.palette.grey.outlined.border},zIndex:1},P={position:"absolute",left:8,width:"2px",height:"calc(100% - 76px)",borderLeft:`1px solid ${t.palette.grey.outlined.border}`,zIndex:0,"&::after":{content:'""',position:"absolute",bottom:0,width:"30px",height:"1px",backgroundColor:t.palette.grey.outlined.border}},k=(G,Q,K,F,V)=>{const W=OS(G),R={autoComplete:"off",onChange:Y=>w(Y.target.value,Q,K),value:G},$={position:"relative",paddingLeft:0},j=D(G);switch(W){case os.ARRAY:return f.jsxs(O.Stack,{sx:$,children:[f.jsx(O.Box,{sx:{...I,height:"calc(100% - 17px)"}}),f.jsx(W$e,{viewOnly:u,fieldValue:G,fieldKey:Q,sourceData:K,deepLevel:F,parentUniqueKey:V,getValue:k,id:i,showSuggestions:o,onClickDelete:_,"data-testid":`array-${Q}`,excludePayloadSuggestions:l,setIsEditing:d,onChange:v})]});case os.OBJECT:return f.jsxs(O.Stack,{sx:$,"data-testid":`object-${Q}`,children:[f.jsx(O.Box,{sx:{...I,height:j?"calc(100% - 10px)":I.height}}),f.jsx("span",{children:B(G,F+1,V)})]});case os.STRING:return f.jsx(bo,{"data-testid":`text-string-${Q}`,sx:{width:"140px"},size:"xs",disabled:u,id:i,showSuggestions:o,excludePayloadSuggestions:l,...R,placeholder:"value"});case os.NUMBER:return f.jsx(bo,{id:i,size:"xs",disabled:u,type:"number",placeholder:G,autoComplete:"off",showSuggestions:o,excludePayloadSuggestions:l,value:G,sx:{width:"140px"},"data-testid":`text-number-${Q}`,onBlur:Y=>w(+Y.target.value,Q,K),onChange:Y=>w(Y.target.value===""?"":+Y.target.value,Q,K,"number")});case os.BOOLEAN:return f.jsxs(O.Select,{disabled:u,size:"small",sx:{width:"140px","& .MuiSelect-select":{display:"flex",alignItems:"center",paddingTop:"6px",paddingBottom:"6px"},"& .MuiOutlinedInput-input":{display:"flex",alignItems:"center"}},value:G?"true":"false","data-testid":`text-boolean-${Q}`,onChange:Y=>w(Y.target.value==="true",Q,K),children:[f.jsx(O.MenuItem,{value:"true",children:"true"}),f.jsx(O.MenuItem,{value:"false",children:"false"})]})}},N=G=>{p[G]=!p[G],h({...p})},L=()=>{T(!y)},M=1,B=(G,Q=M,K=`${Q}`)=>{const F=Object.keys(G);return F.length?f.jsxs(O.Stack,{className:"objectContent","data-testid":"objectContent",sx:{marginLeft:M===Q?"15px":"10px",py:1.5},onClick:V=>V.stopPropagation(),children:[f.jsx(O.Box,{children:F.map((V,W)=>{const R=`${K}-${W}`,$=G[V],j=OS($);return f.jsxs(O.Stack,{className:"indexLine",direction:"row",alignItems:A[R]?"flex-start":"center",gap:1,justifyContent:"flex-start",flexWrap:["object","array"].includes(j)?"wrap":"nowrap",sx:{"& .jsonValue":{flex:["object","array"].includes(j)?"1 1 100%":"0 0 auto",width:["object","array"].includes(j)?"100%":"auto",minWidth:["object","array"].includes(j)?"auto":"150px"},"& .jsonKey":{flex:"0 0 auto",minWidth:"auto"}},children:[["object","array"].includes(j)&&f.jsx(O.Box,{sx:{width:M===Q?"18px":"",display:"inline-block"},children:f.jsx(kN,{uniqueKey:R,fieldValue:$})}),f.jsxs(O.Stack,{direction:"row",alignItems:A[R]?"flex-start":"center",justifyContent:"flex-start",className:"jsonKey",gap:1,children:[f.jsx(bo,{disabled:u,size:"xs",sx:{width:"130px"},id:i,placeholder:"key",value:V||"",tabIndex:W+1,onChange:Y=>b(Y,V,R,G),"data-testid":`text-key-${V}`,error:!!A[R],errorMsg:A[R],helperText:A[R]}),f.jsx(PY,{viewOnly:u,uniqueKey:R,fieldValue:$,fieldKey:V,sourceData:G,"data-testid":`tools-${V}`,type:"object"})]}),!p[R]&&f.jsx("span",{className:j!=="number"&&j!=="boolean"?"jsonValue":"",children:k($,V,G,Q,R)}),f.jsx("span",{children:f.jsx(O.Stack,{ml:1,alignItems:"center",direction:"row",sx:{position:"absolute",right:j==="array"||j==="object"?150:30,top:4},"data-testid":`delete-${V}`,children:f.jsx(O.IconButton,{disabled:u,onClick:()=>_(V,G),sx:{"& path":{fill:t.palette.neutral.solid.bg},"&:hover":{backgroundColor:"transparent","& path":{fill:t.palette.error[60]}}},children:f.jsx(Fe,{src:"ic_delete",sx:{"& path":{fill:t.palette.neutral.solid.bg}}})})})})]},R)})}),f.jsx(O.Box,{"data-testid":`addItem-button-${K}`,ml:M===Q?4.5:2,children:f.jsx(NN,{viewOnly:u,uniqueKey:K,deepLevel:Q,sourceData:G,id:i,showSuggestions:o,excludePayloadSuggestions:l,onChange:V=>{c&&c(V)},setIsEditing:d},K)})]}):f.jsx(O.Box,{"data-testid":`addItem-${K}`,mt:Et(n)?0:"9px",ml:Et(n)?0:3,children:f.jsx(NN,{viewOnly:u,uniqueKey:`${K}`,deepLevel:Q,sourceData:G,id:i,showSuggestions:o,excludePayloadSuggestions:l,onChange:V=>{c&&c(V)},setIsEditing:d})})};return f.jsx(qg.Provider,{value:{editObject:n,setEditObject:r,setTempData:s,onChangeType:x,onClickDelete:_,onChangeAllow:N,allowMap:p},children:m?f.jsx(O.Box,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",minHeight:"300px",children:f.jsx(O.CircularProgress,{})}):f.jsxs(O.Box,{sx:{width:"100%",position:"relative",minHeight:y||Et(a)?0:"100px",paddingTop:"2rem"},"data-testid":"root-collapsible-json",children:[!Et(n)&&f.jsx(O.Box,{onClick:L,"data-testid":"root-collapse-part",children:f.jsx(kN,{uniqueKey:"ROOT_KEY",fieldValue:n})}),!y&&!Et(n)&&f.jsx(O.Box,{sx:P}),!y&&B(n,1,"ROOT_KEY")]})})}const Q$e=C.forwardRef(({data:e={},label:t,infoVisible:n=!1,viewOnly:r=!1,helperText:i,required:o=!1,suggestionsData:s,showSuggestions:a=!1,errorMsg:l="",id:u,excludePayloadSuggestions:c=!1,onChange:d,title:p="",isDynamic:h=!1,fullScreen:A=!1,handleValidate:g,name:m},E)=>{const[y,T]=C.useState("GUI"),[v,_]=C.useState("GUI"),[x,b]=C.useState("Static"),[w,D]=C.useState({}),[I,P]=C.useState(!0),[k,N]=C.useState(!0),[L,M]=C.useState(!1),[B,G]=C.useState({}),[Q,K]=C.useState(""),[F,V]=C.useState({}),W=O.useTheme(),[R,$]=C.useState(!1),[j,Y]=C.useState(!1),[q,H]=C.useState([]),U=C.useRef(!1),X=C.useCallback(Ee=>{const pe=Ee.trim();return/^\{\{[^}]+\}\}$/.test(pe)},[]),ee=C.useMemo(()=>typeof w=="string"&&X(w),[w,X]),Z=[{title:"GUI",disabled:j||ee},{title:"Raw",disabled:j}],le=C.useCallback(Ee=>{if(Ee==null||Ee==="")return{};if(typeof Ee=="string"){if(X(Ee))return Ee;try{return JSON.parse(Ee)}catch{return{}}}return Zo(Ee)},[X]);C.useEffect(()=>{const Ee=le(e);if(D(Ee),G(Ee),V(Ee),typeof Ee=="string"&&X(Ee))K(Ee),U.current=!1,P(!1),N(!1),T("Raw"),_("Raw");else{const pe=JSON.stringify(Ee,null,2);pe==="{}"&&U.current?(K(""),U.current=!1):(K(pe),U.current=!1)}},[e,le,X]);const z=C.useMemo(()=>LA(B),[B]),ie=C.useCallback(()=>{if(!z){if(H([]),g&&g([]),I)typeof F=="string"&&X(F)?K(F):K(JSON.stringify(F,null,2));else if(X(Q))V(Q),D(Q),G(Q);else try{const Ee=JSON.parse(Q);V(Ee),D(Ee),G(Ee)}catch{}P(Ee=>!Ee)}},[z,I,F,Q,g,X]),de=C.useCallback(()=>{if(H([]),g&&g([]),k)typeof w=="string"&&X(w)?K(w):K(JSON.stringify(w,null,2));else if(X(Q))D(Q),G(Q),V(Q);else try{const Ee=JSON.parse(Q);D(Ee),G(Ee),V(Ee)}catch{}N(Ee=>!Ee)},[k,w,Q,g,X]),Ae=()=>{G(Ee=>{const pe={...Ee};return delete pe[""],pe}),M(!L)},te=C.useCallback(Ee=>{const pe=le(Ee);D(pe),G(pe),V(pe)},[le]),J=C.useCallback(Ee=>{U.current=Ee.trim()==="",K(Ee)},[]),ae=C.useCallback(Ee=>{try{if(!Ee||Ee.trim()===""){te({}),d&&d({});return}if(X(Ee)){d&&d(Ee.trim());return}let pe;if(typeof Ee=="string")try{pe=JSON.parse(Ee)}catch{return}else pe=Ee;te(pe),d&&d(pe)}catch{}},[te,d,X]),ne=C.useCallback(()=>{kd(JSON.stringify(w,null,2),"Copied to clipboard"),$(!0),setTimeout(()=>$(!1),2e3)},[w]),se=C.useCallback(Ee=>{if(Ee&&Ee.length>0){const pe=Ee.map(me=>me.message);H(pe)}else H([]);g&&g(Ee)},[g]),ue={border:"1px solid",borderColor:l?W.palette.error.main:W.palette.grey.outlined.border,borderRadius:2};return f.jsxs(O.Stack,{spacing:1,"data-testid":"json-gui",ref:E,children:[n&&f.jsx(z$e,{"data-testid":"json-info-msg",message:"We recommend you expand this editor to full view for the best experience."}),f.jsx($o,{open:L,"data-testid":"json-gui-fullscreen-popup",handleClose:Ae,title:t||"Global variables",content:f.jsxs(O.Stack,{sx:{width:"100%",height:"80vh"},children:[f.jsx(Hs,{variant:"normal",tabs:[{title:"GUI"},{title:"Raw"}],selectedTab:v,sx:{height:24,width:"fit-content",ml:"auto",mb:1},setSelectedTab:()=>{de(),_(v==="GUI"?"Raw":"GUI")}}),f.jsxs(O.Box,{sx:{overflow:"auto",position:"relative",height:"100%",background:W.palette.background.paper,...k?{borderRadius:"4px",border:`1px solid ${W.palette.grey[200]}`,p:1}:{}},children:[k?f.jsx(O.Stack,{"data-testid":"json-gui-builder",sx:{"& .MuiPaper-root":{width:"100% !important",borderRadius:"8px !important"}},children:f.jsx(O.Stack,{sx:{width:"100%",height:"auto",position:"relative",top:"unset",left:"unset",zIndex:"auto",maxWidth:"1200px",overflow:typeof w=="object"&&Object.keys(w).length===0?"visible":"auto"},p:1,children:f.jsx(O.Stack,{children:f.jsx(O.Stack,{minHeight:typeof B=="object"&&Object.keys(B).length===1?50:"auto",children:typeof w=="object"&&typeof B=="object"&&f.jsx(NY,{viewOnly:r,editObject:w,setEditObject:D,setTempData:G,id:u,showSuggestions:a,tempData:B,excludePayloadSuggestions:c,onChange:Ee=>{V(Ee),d&&d(Ee)},setIsEditing:Y})})})})}):f.jsx(O.Box,{sx:{height:"100%",overflowY:r?"visible":"auto"},children:f.jsx(_o,{size:"lg",language:"json",viewOnly:r,handleChange:J,handleBlur:ae,value:Q,id:"code-editor-gui-full",suggestionsData:s,required:o,enableJsonGuiValidation:!0,handleValidate:se,"data-testid":"json-gui-code-editor-full",sx:{border:"none"},height:"75vh",allowArrayAtRoot:!!(m&&m.endsWith("payload"))||!!(m&&m.includes(".payload"))})}),f.jsx(O.Stack,{onClick:ne,sx:{position:"absolute",top:6,right:6,cursor:"pointer"},children:f.jsx(O.Tooltip,{"data-testid":"json-copy-tooltip",title:R?"Copied!":"Copy JSON",children:f.jsx(O.IconButton,{"data-testid":"json-gui-copy",onClick:ne,size:"small",children:f.jsx(Fe,{src:"ic_copy",width:15,height:15,sx:{path:{fill:W.palette.common.black}}})})})})]})]})}),f.jsxs(O.Stack,{children:[f.jsxs(O.Stack,{direction:"row",alignItems:"flex-end",justifyContent:"space-between",children:[f.jsx(Nr,{label:t||"",required:o,description:i}),h&&f.jsx(Hs,{variant:"normal",tabs:[{title:"Static"},{title:"Dynamic"}],selectedTab:x,sx:{height:24},setSelectedTab:()=>{b(x==="Static"?"Dynamic":"Static")}})]}),I?f.jsxs(O.Stack,{children:[f.jsxs(O.Stack,{"data-testid":"json-gui-builder",sx:{...ue},children:[f.jsxs(O.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,p:1.5,children:[f.jsx(O.Typography,{variant:"smNormal",children:p}),f.jsxs(O.Stack,{direction:"row",position:"relative",alignItems:"center",children:[f.jsx(Hs,{variant:"normal",tabs:Z,selectedTab:y,sx:{height:24},setSelectedTab:()=>{ie(),T(y==="GUI"?"Raw":"GUI")}}),A&&f.jsx(O.IconButton,{"data-testid":"json-gui-fullscreen-button",onClick:Ae,sx:{ml:1,position:"absolute",top:44,right:0,zIndex:999},children:f.jsx(Fe,{src:"ic_maximize"})})]})]}),f.jsx(O.Divider,{}),f.jsx(O.Stack,{sx:{width:"100%",height:"auto",position:"relative",maxWidth:"600px",maxHeight:"calc(80vh - 306px)",overflow:"auto"},p:1,children:f.jsx(O.Stack,{children:typeof w=="object"&&typeof B=="object"&&f.jsx(NY,{viewOnly:r,editObject:w,setEditObject:D,setTempData:G,id:u,showSuggestions:a,tempData:B,excludePayloadSuggestions:c,onChange:Ee=>{V(Ee),d&&d(Ee)},setIsEditing:Y})})})]}),q.length>0?f.jsx(O.Box,{sx:{mt:1},children:q.map((Ee,pe)=>f.jsx(O.FormHelperText,{error:!0,children:Ee},`validation-error-${Ee}-${pe}`))}):l?f.jsx(O.FormHelperText,{error:!0,children:l}):null,i&&f.jsx(O.FormHelperText,{children:i})]}):f.jsxs(O.Box,{children:[f.jsxs(O.Box,{sx:{...ue,opacity:r?.6:1},children:[f.jsxs(O.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,p:1.5,children:[f.jsx(O.Typography,{variant:"smNormal",children:p}),f.jsxs(O.Stack,{direction:"row",alignItems:"center",position:"relative",children:[f.jsx(Hs,{variant:"normal",tabs:Z,selectedTab:y,sx:{height:24},setSelectedTab:()=>{ie(),T(x==="GUI"?"Raw":"GUI")}}),A&&f.jsx(O.IconButton,{"data-testid":"json-gui-fullscreen-button",onClick:Ae,sx:{ml:1,position:"absolute",top:44,right:0,zIndex:999},children:f.jsx(Fe,{src:"ic_maximize"})})]})]}),f.jsx(O.Divider,{}),f.jsx(O.Box,{sx:{height:"100%",overflowY:r?"visible":"auto"},children:f.jsx(_o,{size:"lg",language:"json",viewOnly:r,handleChange:J,handleBlur:ae,value:Q,id:`code-editor-gui-${u}`,suggestionsData:s,error:!!l,required:o,enableJsonGuiValidation:!0,handleValidate:se,"data-testid":"json-gui-code-editor",showSuggestions:a,codeEditorStyles:{border:"none"},allowArrayAtRoot:!!(m&&m.endsWith("payload"))||!!(m&&m.includes(".payload"))})})]}),q.length>0?f.jsx(O.Box,{sx:{mt:1},children:q.map((Ee,pe)=>f.jsx(O.FormHelperText,{error:!0,children:Ee},`validation-error-${Ee}-${pe}`))}):l?f.jsx(O.FormHelperText,{error:!0,children:l}):null,i&&f.jsx(O.FormHelperText,{children:i})]})]})]})}),z$e=({message:e})=>{const t=O.useTheme();return f.jsxs(O.Stack,{alignItems:"center",spacing:1,direction:"row",sx:{background:t.palette.success[10],borderRadius:2,border:"1px solid",borderColor:t.palette.success[40]},p:1,children:[f.jsx(Fe,{src:"ic_success",sx:{path:{fill:t.palette.success.main}}}),f.jsx(O.Typography,{variant:"xsMedium",children:e})]})},LY=Go(Q$e),hc=e=>{const{name:t,label:n,viewOnly:r=!1,validationRules:i={},required:o=!1,id:s,description:a,error:l,suggestionsData:u,...c}=e,{trigger:d,control:p}=Vn(),h=C.useRef(null),A=C.useRef([]),g=C.useCallback(y=>{const T=y?.length>0?y.map(v=>v.message):[];A.current=T,d(t)},[t,d]),m=C.useCallback(async y=>{if(i.validate){const v=typeof i.validate=="function"?await i.validate(y):!0;if(v!==!0)return v}const T=A.current;return T.length>0?T[0]:!0},[i.validate]),E=C.useMemo(()=>({...i,validate:m}),[i,m]);return f.jsx(xn,{name:t,control:p,rules:E,render:({field:y,fieldState:{error:T}})=>f.jsx(LY,{...y,ref:h,label:n,data:y.value,viewOnly:r,suggestionsData:u,helperText:a,errorMsg:T?.message||l?.errorMsg,required:o,id:s,showSuggestions:!0,handleValidate:g,onChange:v=>{d(t),y.onChange(v)},...c})})},X$e=C.forwardRef((e,t)=>{const n=pt.useDispatch(),{type:r,openIntegrationDrawer:i,TESSERACT_MAIN_URL:o,ENTITY_ID:s,FRONTEND_URL:a,INTEGRATION_DATA:l,viewOnly:u=!1,id:c}=e,[d,p]=C.useState([]),[h,A]=C.useState(!1),{control:g,watch:m,setValue:E,resetField:y}=Vn(),T=m("properties.auth_type"),v=()=>{A(!0);const _={page_size:999,current_page:1,type:"SOURCE"},x=Zt(o,"/v1/integrations/entity/AUTHENTICATION");Kt.get(x,{params:_}).then(({data:b})=>{const w=hs(b.data,["integration_meta"]),D=sS(w);p(aS(D))}).catch(b=>{An(b,n)}).finally(()=>{A(!1)})};return C.useEffect(()=>{v()},[]),C.useEffect(()=>{l?._id&&l?.meta?.entity==="AUTHENTICATION"&&(v(),E("properties.auth_id",l._id,{shouldValidate:!0}))},[l]),C.useEffect(()=>{!Et(T)&&T!==Jl.NONE?v():y("properties.auth_id")},[T]),f.jsxs(O.Stack,{gap:2.5,children:[f.jsx(Eo,{children:f.jsxs(O.Grid,{container:!0,gap:1.5,children:[f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{name:"properties.auth_type",control:g,meta:{options:h1,displayName:"Authentication Type",searchFieldPlaceholder:"Search authentication type",placeholder:"Select Authentication Type"},validationRules:{required:"Auth type is required"},id:"auth_type",viewOnly:u,required:!0,onChange:_=>{E("properties.auth_type",_.target.value),E("properties.auth_id","")}})}),T&&T!==Jl.NONE&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.auth_id",control:g,meta:{options:Jr(d),displayProps:{loading:h},displayName:"Authentication",value:"",htmlProps:{showAddNew:!0},TESSERACT_MAIN_URL:o,FRONTEND_URL:a,ENTITY_ID:s,openIntegrationDrawer:i,addNewButtonText:"Add new",searchFieldPlaceholder:"Search authentication",authType:"AUTHENTICATION",placeholder:"Select Authentication"},validationRules:{required:"Authentication is required"},viewOnly:u,id:r,groupBy:"integration_meta.auth_type"})})]})}),f.jsx(O.Divider,{}),f.jsx(qr,{children:f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(hc,{name:"properties.test_payload",control:g,label:"Test Trigger Payload",viewOnly:u,showSuggestions:!0,excludePayloadSuggestions:!0,id:c})})})]})}),q$e=C.forwardRef(({placeholder:e="",onChange:t,value:n,height:r="100%",width:i="100%",label:o="",required:s=!1,errorMsg:a,helperText:l="",nodeId:u="",name:c,isLoop:d,viewOnly:p=!1,hideLabel:h=!1},A)=>{const g=O.useTheme(),{MCP_INTEGRATION_FORM:m}=_a(),{getNodes:E}=Pt.useReactFlow(),{selectedActivityId:y,aiGeneratedFieldMap:T}=pt.useSelector(W=>W.canvas),v=es(l),[_,x]=C.useState(""),b=C.useRef(null),w=C.useRef(null),[D,I]=C.useState(""),P=W=>{x(W.target.value)},k=()=>{if(_.trim()!==""){const R=[...Array.isArray(n)?n:[],_.trim().split(",")[0]],$=new Set(R);t([...$]),x("")}},N=W=>{W.preventDefault();const{keyCode:R}=W;[13,32,188].includes(R)&&k()},L=W=>()=>{typeof n=="object"&&Array.isArray(n)&&t(n.filter(R=>R!==W))},M=(W,R)=>{W?.stopPropagation?.(),W?.preventDefault?.(),Array.isArray(n)&&t(n.filter($=>$!==R))},B=W=>{W.keyCode===8&&_.trim()===""?Array.isArray(n)&&n.length>0&&L(n[n.length-1])():W.key==="Enter"&&W.preventDefault()},G=()=>{b.current?.focus()},Q=W=>{W.stopPropagation()};C.useEffect(()=>(document.addEventListener("mousedown",Q),()=>{document.removeEventListener("mousedown",Q)}),[]),C.useEffect(()=>{I(typeof n=="string"?"Dynamic":"Static")},[n]);const K=(()=>{const W=E()||[],R=String(u||""),$=W.find(U=>U?.selected),j=W.find(U=>String(U?.id)===R)||W.find(U=>String(U?.id)===String(y))||$,Y=String(j?.id||""),H=(T||{})[Y]||(T||{})[String(y||"")]||(T||{})[R];return H&&typeof H=="object"?H:{}})(),F=String(c||"").replace(/^properties\./,""),V=!!F&&F in K&&n!==void 0&&n!==null&&(typeof n!="string"||n.trim()!=="")&&(!Array.isArray(n)||n.length>0);return f.jsx(O.FormControl,{fullWidth:!0,children:f.jsxs(O.Stack,{children:[o&&!h&&f.jsxs(O.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-end",children:[f.jsx(Nr,{required:s,label:o,description:v}),!p&&!m&&f.jsx(O.Stack,{pb:.5,children:f.jsx(Hs,{variant:"normal",tabs:[{title:"Static"},{title:"Dynamic"}],selectedTab:D,setSelectedTab:()=>{D==="Static"?(t(""),I("Dynamic")):(t([]),I("Static"))}})})]}),typeof n=="object"&&Array.isArray(n)?f.jsxs(f.Fragment,{children:[f.jsxs(O.Stack,{spacing:1,border:1,sx:{position:"relative",borderColor:a?g.palette.error.main:g.palette.grey[300],":focus-within":{border:`1px solid ${g.palette.neutral.plain}`,transition:"all 100ms ease-in"}},height:r,width:i,borderRadius:2,px:1,py:0,maxHeight:"20rem",overflow:"auto",onClick:G,children:[V&&f.jsx(O.Stack,{sx:{position:"absolute",right:"1px",top:1,bottom:1,width:"15%",minWidth:64,maxWidth:96,borderTopRightRadius:8,borderBottomRightRadius:8,pointerEvents:"none",zIndex:0,background:`linear-gradient(90deg, ${O.alpha(g.palette.primary[5],0)} 0%, ${O.alpha(g.palette.primary[5],.35)} 62%, ${O.alpha(g.palette.primary[5],.9)} 100%)`}}),V&&f.jsx(O.Stack,{sx:{position:"absolute",right:12,top:11,zIndex:3,pointerEvents:"none",width:18,height:18,alignItems:"center",justifyContent:"center"},children:f.jsx(Fe,{src:"ic_AI",width:18,height:18,sx:{display:"block","& svg path":{fill:`${g.palette.primary.main} !important`,fillOpacity:"1 !important"}}})}),f.jsxs(O.Stack,{direction:"row",flexWrap:"nowrap",gap:1,alignItems:"center",ref:w,sx:{maxWidth:"100%",overflow:"hidden",minHeight:40,pr:V?4.75:0,position:"relative",zIndex:1},children:[(()=>{if(!n||!Array.isArray(n)||n.length===0)return null;const{visible:W,extra:R,hiddenSelections:$}=tC(n||[],w);return f.jsxs(f.Fragment,{children:[W.map((j,Y)=>f.jsx(O.Chip,{label:j,disabled:p,deleteIcon:f.jsx(Fe,{sx:{"& svg":{width:16,height:16}},src:"ic_close"}),onDelete:L(j),sx:{flex:"0 0 auto",minWidth:"40px"}},`input-chip-${j}-${Y}`)),R>0&&f.jsx(bI,{hiddenSelections:$,extra:R,handleChipDelete:M})]})})(),f.jsx(O.InputBase,{ref:A,fullWidth:!0,autoComplete:"off",placeholder:e,value:_,onChange:P,inputRef:b,onKeyUp:N,readOnly:p,disabled:p,onKeyDown:B,onBlur:()=>k(),sx:{"&.MuiInput-root":{border:"none",flex:1},"& .MuiInputBase-input":{padding:"4px"},":focus":{border:"none"},":focus-within":{border:"none",transition:"none",boxShadow:"none"},":active":{backgroundColor:"transparent"}}})]})]}),a&&f.jsx(O.FormHelperText,{error:!0,children:a})]}):f.jsx(bo,{id:u,language:"plaintext",required:!0,value:n,isLoop:d,viewOnly:p,editorId:`${u}-${c}`,showSuggestions:!0,placeholder:e,handleChange:W=>{t(W)},errorMsg:a,loading:null})]})})}),Ed=zc(q$e),kY=({field:e,type:t,nodeId:n,isLoop:r,viewOnly:i})=>{const o=O.useTheme(),{watch:s,control:a,setValue:l}=Vn(),u=s(e),c=p=>{l(e,u.filter((h,A)=>p!==A))},d=C.useMemo(()=>u?.map((p,h)=>`${n}-${t}-${Date.now()}-${h}`),[n,t,u?.length]);return f.jsx(f.Fragment,{children:u&&u?.map((p,h)=>f.jsxs(O.Grid,{container:!0,sx:{mb:1,py:1},alignItems:"flex-end",justifyContent:"space-between",children:[f.jsx(O.Grid,{item:!0,xs:11,children:f.jsx(Wn,{autoFocus:!0,id:n,name:`${e}.${h}`,control:a,meta:{displayName:`Attachment ${h+1}`,description:jr(t,"attachments"),placeholder:`Attachment ${h+1}`},editorId:`${t}-attachment_${h}`,isLoop:r,viewOnly:i})}),f.jsx(O.Grid,{item:!0,xs:.5,sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:u.length>0&&f.jsx(O.IconButton,{sx:{p:.75,width:28,height:28,"& path":{fill:o.palette.neutral.solid.bg},"&:hover path":{fill:o.palette.error[60]},"&:hover":{backgroundColor:"transparent"}},disabled:i,onClick:()=>c(h),children:f.jsx(Fe,{src:"ic_delete",width:20,height:20})})})]},d[h]))})},Y$e=e=>{const{field:t,viewOnly:n}=e,{watch:r,setValue:i,unregister:o}=Vn(),{setFieldControlState:s}=_a(),a=r(t),[l,u]=C.useState("BOLTIC_AI"),c=C.useRef([]);C.useEffect(()=>{a==="BOLTIC_AI"||a==="BOLTIC_AI_IGNORE"?u(a):Array.isArray(a)&&u("specific")},[a]);const d=p=>{const h=p.target.value;if(u(h),s(t,h),h==="specific"){const A=Array.isArray(a)&&a.length>0?a:c.current.length>0?c.current:[""];i(t,A)}else Array.isArray(a)&&(c.current=a,a.forEach((A,g)=>{o?.(`${t}.${g}`)}),o?.(t)),i(t,h)};return f.jsxs(O.Stack,{spacing:1.5,mt:.5,children:[f.jsx(O.FormControl,{fullWidth:!0,disabled:n,children:f.jsxs(O.Select,{value:l,onChange:d,children:[f.jsx(O.MenuItem,{sx:{py:.8},value:"BOLTIC_AI",children:"Have AI generate a value for this field"}),f.jsx(O.MenuItem,{sx:{py:.8},value:"BOLTIC_AI_IGNORE",children:"Do not include a value for this field"}),f.jsx(O.MenuItem,{sx:{py:.8},value:"specific",children:"Set a specific value for this field"})]})}),l==="specific"&&f.jsx(kY,{...e})]})},MN=e=>{const{MCP_INTEGRATION_FORM:t}=_a();return t?f.jsx(Y$e,{...e}):f.jsx(kY,{...e})},K$e=C.forwardRef((e,t)=>{const{VORTEX_MAIN_URL:n,ENTITY_ID:r,TESSERACT_MAIN_URL:i,WORKFLOW_URLS:o,type:s,id:a,isLoop:l,FRONTEND_URL:u,suggestionsData:c,INTEGRATION_DATA:d,viewOnly:p=!1,openIntegrationDrawer:h}=e,A=pt.useDispatch(),g=O.useTheme(),{control:m,setValue:E,watch:y,getValues:T,formState:{errors:v}}=Vn(),{BOLTIC_EMAIL_DOMAIN:_}=o,x=y("properties"),[b,w]=C.useState([]),[D,I]=C.useState(!1),{loopSuggestionsData:P={}}=pt.useSelector(K=>K.loopActivity),k=C.useCallback(()=>{I(!0);const K={page_size:999,current_page:1,type:"DESTINATION"},F=Zt(i,"/v1/integrations/entity/EMAIL");Kt.get(F,{params:K}).then(({data:V})=>{w(hs(V.data))}).catch(V=>{An(V,A)}).finally(()=>{I(!1)})},[]),N=_?.split(",").map(K=>({title:`@${K.trim()}`,value:`@${K.trim()}`})),[L,M]=C.useState(()=>x.from?`@${x.from?.split("@")[1]}`:N[0]?.value),[B,G]=C.useState(()=>x.from?.split("@")[0]||"");C.useEffect(()=>{k()},[]),C.useEffect(()=>{d?._id&&d?.meta?.entity==="EMAIL"&&(k(),E("properties.email_auth_id",d._id,{shouldValidate:!0}))},[d]);const Q=K=>{E(`properties.${K}`,[...T(`properties.${K}`)||[],""])};return f.jsxs(O.Stack,{gap:2.5,children:[f.jsx(Eo,{children:f.jsx(O.Grid,{container:!0,gap:1.5,children:f.jsx(O.Grid,{item:!0,xs:12,children:x.integration_slug==="blt-int.boltic-email"?f.jsxs(O.Stack,{direction:"row",children:[f.jsx(O.Box,{sx:{width:"60%"},children:f.jsx(Wn,{id:a,name:"properties.from",control:m,meta:{displayName:"From",description:jr(s,"from"),renderFieldValue:()=>B},viewOnly:p,editorId:`${s}-from`,showSuggestions:!0,isLoop:l,handleChange:K=>{const{value:F}=K;E("properties.from",`${F}${L}`),G(F)},sx:{"& .MuiPaper-root":{borderTopRightRadius:0,borderBottomRightRadius:0,borderRight:"none"}}})}),f.jsx(O.Box,{sx:{width:"40%"},children:f.jsx(en,{name:"properties.from",control:m,meta:{options:N,displayName:"Domain",searchFieldPlaceholder:"Search Domain"},viewOnly:p,id:s,renderFieldValue:()=>L,handleChange:K=>{const{value:F}=K;E("properties.from",`${B}${F}`),M(F)},sx:{"& .MuiOutlinedInput-notchedOutline":{borderTopLeftRadius:0,borderBottomLeftRadius:0}}})})]}):f.jsx(en,{required:!0,name:"properties.email_auth_id",control:m,meta:{options:Jr(b),displayProps:{loading:D},displayName:"Email Account",value:"",htmlProps:{showAddNew:!0},TESSERACT_MAIN_URL:i,FRONTEND_URL:u,ENTITY_ID:r,openIntegrationDrawer:h,addNewButtonText:"Add new account",searchFieldPlaceholder:"Search email account",authType:"EMAIL",description:"Select Email secret here.",placeholder:"Select Email Account"},validationRules:{required:"Email account is required"},viewOnly:p,id:s})})})}),(x.email_auth_id||x.integration_slug==="blt-int.boltic-email")&&f.jsx(O.Divider,{}),(x.email_auth_id||x.integration_slug==="blt-int.boltic-email")&&f.jsx(qr,{children:f.jsxs(O.Grid,{container:!0,gap:1.5,children:[f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(Wn,{required:!0,id:a,name:"properties.subject",control:m,meta:{displayName:"Subject",description:"Enter the subject to send in the email.",placeholder:"Type or add suggestion"},validationRules:{required:"Subject is required"},viewOnly:p,editorId:`${s}-subject-${l}`,showSuggestions:!0,isLoop:l})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.to",control:m,rules:{required:"To is required",validate:K=>Array.isArray(K)&&!K.every(V=>Pu(V))?"To must have all the valid emails":!0},render:({field:K})=>f.jsx(Ed,{...K,required:!0,nodeId:a,label:"To",name:"to",viewOnly:p,isLoop:l,placeholder:"Enter email",onChange:F=>{K.onChange(typeof F=="string"?F:[...F])},errorMsg:v.properties?.to?.message})})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.email_template",control:m,rules:{required:"Email body is required"},render:({field:K})=>f.jsx(_o,{...K,label:"Email body",suggestionLabel:"Email body",id:`${s}-email_template`,activityType:s,VORTEX_MAIN_URL:n,ENTITY_ID:r,size:"md",viewOnly:p,showSuggestions:!0,language:"html",suggestionsData:l?P:c,showExpandOption:!0,showHtmlPreview:!0,errorMsg:v.properties?.email_template?.message,error:!!v.properties?.email_template?.message,handleChange:F=>{K.onChange(F)},required:!0})})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.cc",control:m,rules:{validate:K=>Array.isArray(K)&&!K.every(V=>Pu(V))?"Cc must have all the valid emails":!0},render:({field:K})=>f.jsx(Ed,{...K,nodeId:a,label:"Cc",name:"cc",viewOnly:p,placeholder:"Enter email",isLoop:l,onChange:F=>{K.onChange(typeof F=="string"?F:[...F])},errorMsg:v.properties?.cc?.message})})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.bcc",control:m,rules:{validate:K=>Array.isArray(K)&&!K.every(V=>Pu(V))?"Bcc must have all the valid emails":!0},render:({field:K})=>f.jsx(Ed,{...K,nodeId:a,label:"Bcc",name:"bcc",isLoop:l,viewOnly:p,placeholder:"Enter email",onChange:F=>{K.onChange(typeof F=="string"?F:[...F])},errorMsg:v.properties?.bcc?.message})})}),f.jsxs(O.Grid,{item:!0,xs:12,children:[f.jsxs(O.Box,{sx:{display:"flex",alignItems:"center"},children:[f.jsx(O.FormControl,{fullWidth:!0,sx:{"& > .MuiStack-root > .MuiStack-root":{pb:0}},children:f.jsx(Nr,{label:"Attachments",description:"The maximum attachment limit is 25Mb"})}),f.jsx(O.IconButton,{disabled:p,onClick:()=>Q("attachments"),sx:{float:"right",p:.75,border:K=>`1px solid ${K.palette.grey.brainstem}`,fontSize:K=>K.typography.mdNormal.fontSize},color:"primary",children:f.jsx(Fe,{src:"ic_plus",width:g.icons.md,height:g.icons.md,sx:{svg:{path:{fill:g.palette.primary.main}}}})})]}),f.jsx(MN,{nodeId:a,type:s,isLoop:l,viewOnly:p,field:"properties.attachments"})]}),!l&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(qi,{viewOnly:p,type:s})})]})})]})}),Z$e=Go(K$e),J$e=C.forwardRef((e,t)=>{const{workflow:n}=pt.useSelector(x=>x.workflows),r=pt.useDispatch(),{type:i,VORTEX_MAIN_URL:o,ENTITY_ID:s,suggestionsData:a,viewOnly:l=!1,id:u}=e,[c,d]=C.useState([]),[p,h]=C.useState(!1),{control:A,setValue:g,watch:m}=Vn(),E=m("properties"),y=O.useTheme(),T=m("properties.child_workflow_id"),v=m("properties.child_workflow_name"),_=async(x="")=>{h(!0);const b={include:["scheduled","published"],limit:100,page:1,name:x};n&&(b.draft_id=n?.id);const w=Zt(o,`/v1.0/${s}/workflows`);Kt.get(w,{params:b}).then(({data:D})=>{d(()=>T&&!D.data.find(I=>I.id===T)?[{id:T,name:v,version:E.version},...D.data]:D.data)}).catch(D=>{An(D,r)}).finally(()=>{h(!1)})};return C.useEffect(()=>{_()},[]),C.useEffect(()=>{if(!T)g("properties",{...E,child_workflow_id:"",version:"",child_workflow_name:""});else{const x=c.find(b=>b.id===T);g("properties",{...E,version:x?.version,child_workflow_name:x?.name})}},[T]),f.jsxs(O.Stack,{gap:2.5,children:[f.jsx(Eo,{children:f.jsx(O.Grid,{container:!0,gap:1.5,children:f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.child_workflow_id",control:A,meta:{options:Jr(c),displayName:"Workflow",searchFieldPlaceholder:"Search workflow",description:"Select the child workflow that you want to run",displayProps:{loading:p},placeholder:"Select Workflow"},validationRules:{required:"Workflow is required"},viewOnly:l,id:"child_workflow_id",handleChange:x=>{const{value:b}=x;if(b===""){const w=m("properties");g("properties",{...w,child_workflow_id:"",child_workflow_name:"",version:""})}},renderValueUi:x=>{if(!x)return f.jsx(O.Typography,{sx:{fontSize:"14px",color:y.palette.neutral.solid.bg,fontFamily:"inherit",":hover":{color:y.palette.neutral.main}},children:"Select Workflow"});const b=Jr(c)?.find(w=>w?.value===x);return f.jsxs(O.Stack,{direction:"row",gap:1,children:[f.jsx(O.Typography,{sx:{fontSize:"14px",color:y.palette.text.primary,fontFamily:"inherit",...Iu,maxWidth:"95%"},children:b?.title}),f.jsx(O.Chip,{sx:{fontSize:11},size:"small",label:`v${b?.version}`})]})},renderOption:(x,b)=>{const{title:w,value:D,version:I}=b;return f.jsx(O.MenuItem,{value:D,sx:{p:"8px !important",mx:1,height:"auto","&.Mui-selected":{"& .MuiTypography-root":{color:y.palette.primary.main}}},children:f.jsxs(O.Stack,{width:"100%",direction:"row",flexWrap:"wrap",sx:{...Ff,gap:1},children:[f.jsx(O.Typography,{sx:{fontSize:"1rem",fontWeight:400,color:y.palette.text.primary,whiteSpace:"normal",wordBreak:"break-word",maxWidth:"88%"},children:w}),f.jsx(O.Chip,{sx:{fontSize:11},size:"small",label:`v${I}`})]})},D)}})})})}),E.child_workflow_id&&f.jsx(O.Divider,{}),E.child_workflow_id&&f.jsx(qr,{children:f.jsxs(O.Grid,{container:!0,gap:1.5,children:[f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(hc,{name:"properties.payload",label:"Payload",viewOnly:l,id:u,suggestionsData:a,fullScreen:!0,showSuggestions:!0,helperText:"Provide the data needed for the child workflow, which will be available under the 'payload' property in the child workflow. This should always be an object. If you provide an array, only the first element will be used.",validationRules:{required:"Payload is required"}})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(qi,{viewOnly:l,type:i})})]})})]})}),eje=Go(J$e,"");var Yg={exports:{}};Yg.exports;var MY;function tje(){return MY||(MY=1,(function(e,t){var n=200,r="Expected a function",i="__lodash_hash_undefined__",o=1,s=2,a=9007199254740991,l="[object Arguments]",u="[object Array]",c="[object Boolean]",d="[object Date]",p="[object Error]",h="[object Function]",A="[object GeneratorFunction]",g="[object Map]",m="[object Number]",E="[object Object]",y="[object Promise]",T="[object RegExp]",v="[object Set]",_="[object String]",x="[object Symbol]",b="[object WeakMap]",w="[object ArrayBuffer]",D="[object DataView]",I="[object Float32Array]",P="[object Float64Array]",k="[object Int8Array]",N="[object Int16Array]",L="[object Int32Array]",M="[object Uint8Array]",B="[object Uint8ClampedArray]",G="[object Uint16Array]",Q="[object Uint32Array]",K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,F=/^\w*$/,V=/^\./,W=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,R=/[\\^$.*+?()[\]{}|]/g,$=/\\(\\)?/g,j=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,q={};q[I]=q[P]=q[k]=q[N]=q[L]=q[M]=q[B]=q[G]=q[Q]=!0,q[l]=q[u]=q[w]=q[c]=q[D]=q[d]=q[p]=q[h]=q[g]=q[m]=q[E]=q[T]=q[v]=q[_]=q[b]=!1;var H=typeof jn=="object"&&jn&&jn.Object===Object&&jn,U=typeof self=="object"&&self&&self.Object===Object&&self,X=H||U||Function("return this")(),ee=t&&!t.nodeType&&t,Z=ee&&!0&&e&&!e.nodeType&&e,le=Z&&Z.exports===ee,z=le&&H.process,ie=(function(){try{return z&&z.binding("util")}catch{}})(),de=ie&&ie.isTypedArray;function Ae(Se,Xe,yt,zt){for(var bn=-1,fn=Se?Se.length:0;++bn<fn;){var Bn=Se[bn];Xe(zt,Bn,yt(Bn),Se)}return zt}function te(Se,Xe){for(var yt=-1,zt=Se?Se.length:0;++yt<zt;)if(Xe(Se[yt],yt,Se))return!0;return!1}function J(Se){return function(Xe){return Xe?.[Se]}}function ae(Se,Xe){for(var yt=-1,zt=Array(Se);++yt<Se;)zt[yt]=Xe(yt);return zt}function ne(Se){return function(Xe){return Se(Xe)}}function se(Se,Xe){return Se?.[Xe]}function ue(Se){var Xe=!1;if(Se!=null&&typeof Se.toString!="function")try{Xe=!!(Se+"")}catch{}return Xe}function Ee(Se){var Xe=-1,yt=Array(Se.size);return Se.forEach(function(zt,bn){yt[++Xe]=[bn,zt]}),yt}function pe(Se,Xe){return function(yt){return Se(Xe(yt))}}function me(Se){var Xe=-1,yt=Array(Se.size);return Se.forEach(function(zt){yt[++Xe]=zt}),yt}var xe=Array.prototype,ge=Function.prototype,Oe=Object.prototype,$e=X["__core-js_shared__"],Ve=(function(){var Se=/[^.]+$/.exec($e&&$e.keys&&$e.keys.IE_PROTO||"");return Se?"Symbol(src)_1."+Se:""})(),Be=ge.toString,tt=Oe.hasOwnProperty,je=Oe.toString,qe=RegExp("^"+Be.call(tt).replace(R,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Le=X.Symbol,Ye=X.Uint8Array,Ke=Oe.propertyIsEnumerable,Te=xe.splice,_e=pe(Object.keys,Object),we=Br(X,"DataView"),re=Br(X,"Map"),he=Br(X,"Promise"),be=Br(X,"Set"),Ue=Br(X,"WeakMap"),Pe=Br(Object,"create"),Ge=Me(we),mt=Me(re),_t=Me(he),Ce=Me(be),ot=Me(Ue),At=Le?Le.prototype:void 0,wt=At?At.valueOf:void 0,Ft=At?At.toString:void 0;function Dt(Se){var Xe=-1,yt=Se?Se.length:0;for(this.clear();++Xe<yt;){var zt=Se[Xe];this.set(zt[0],zt[1])}}function Bt(){this.__data__=Pe?Pe(null):{}}function Re(Se){return this.has(Se)&&delete this.__data__[Se]}function nt(Se){var Xe=this.__data__;if(Pe){var yt=Xe[Se];return yt===i?void 0:yt}return tt.call(Xe,Se)?Xe[Se]:void 0}function Qe(Se){var Xe=this.__data__;return Pe?Xe[Se]!==void 0:tt.call(Xe,Se)}function st(Se,Xe){var yt=this.__data__;return yt[Se]=Pe&&Xe===void 0?i:Xe,this}Dt.prototype.clear=Bt,Dt.prototype.delete=Re,Dt.prototype.get=nt,Dt.prototype.has=Qe,Dt.prototype.set=st;function Ot(Se){var Xe=-1,yt=Se?Se.length:0;for(this.clear();++Xe<yt;){var zt=Se[Xe];this.set(zt[0],zt[1])}}function Tt(){this.__data__=[]}function Ut(Se){var Xe=this.__data__,yt=En(Xe,Se);if(yt<0)return!1;var zt=Xe.length-1;return yt==zt?Xe.pop():Te.call(Xe,yt,1),!0}function De(Se){var Xe=this.__data__,yt=En(Xe,Se);return yt<0?void 0:Xe[yt][1]}function rt(Se){return En(this.__data__,Se)>-1}function Je(Se,Xe){var yt=this.__data__,zt=En(yt,Se);return zt<0?yt.push([Se,Xe]):yt[zt][1]=Xe,this}Ot.prototype.clear=Tt,Ot.prototype.delete=Ut,Ot.prototype.get=De,Ot.prototype.has=rt,Ot.prototype.set=Je;function Ie(Se){var Xe=-1,yt=Se?Se.length:0;for(this.clear();++Xe<yt;){var zt=Se[Xe];this.set(zt[0],zt[1])}}function at(){this.__data__={hash:new Dt,map:new(re||Ot),string:new Dt}}function gt(Se){return Ar(this,Se).delete(Se)}function Xt(Se){return Ar(this,Se).get(Se)}function pn(Se){return Ar(this,Se).has(Se)}function $n(Se,Xe){return Ar(this,Se).set(Se,Xe),this}Ie.prototype.clear=at,Ie.prototype.delete=gt,Ie.prototype.get=Xt,Ie.prototype.has=pn,Ie.prototype.set=$n;function dr(Se){var Xe=-1,yt=Se?Se.length:0;for(this.__data__=new Ie;++Xe<yt;)this.add(Se[Xe])}function tr(Se){return this.__data__.set(Se,i),this}function rr(Se){return this.__data__.has(Se)}dr.prototype.add=dr.prototype.push=tr,dr.prototype.has=rr;function un(Se){this.__data__=new Ot(Se)}function kn(){this.__data__=new Ot}function kr(Se){return this.__data__.delete(Se)}function $t(Se){return this.__data__.get(Se)}function Jt(Se){return this.__data__.has(Se)}function zn(Se,Xe){var yt=this.__data__;if(yt instanceof Ot){var zt=yt.__data__;if(!re||zt.length<n-1)return zt.push([Se,Xe]),this;yt=this.__data__=new Ie(zt)}return yt.set(Se,Xe),this}un.prototype.clear=kn,un.prototype.delete=kr,un.prototype.get=$t,un.prototype.has=Jt,un.prototype.set=zn;function Rn(Se,Xe){var yt=fr(Se)||Dn(Se)?ae(Se.length,String):[],zt=yt.length,bn=!!zt;for(var fn in Se)tt.call(Se,fn)&&!(bn&&(fn=="length"||Zs(fn,zt)))&&yt.push(fn);return yt}function En(Se,Xe){for(var yt=Se.length;yt--;)if(nr(Se[yt][0],Xe))return yt;return-1}function Fn(Se,Xe,yt,zt){return Kn(Se,function(bn,fn,Bn){Xe(zt,bn,yt(bn),Bn)}),zt}var Kn=Ms(Gr),Hn=Ks();function Gr(Se,Xe){return Se&&Hn(Se,Xe,Mt)}function Rr(Se,Xe){Xe=Fs(Xe,Se)?[Xe]:ci(Xe);for(var yt=0,zt=Xe.length;Se!=null&&yt<zt;)Se=Se[fe(Xe[yt++])];return yt&&yt==zt?Se:void 0}function ei(Se){return je.call(Se)}function wi(Se,Xe){return Se!=null&&Xe in Object(Se)}function Zi(Se,Xe,yt,zt,bn){return Se===Xe?!0:Se==null||Xe==null||!yo(Se)&&!Oi(Xe)?Se!==Se&&Xe!==Xe:ir(Se,Xe,Zi,yt,zt,bn)}function ir(Se,Xe,yt,zt,bn,fn){var Bn=fr(Se),$r=fr(Xe),Kr=u,yi=u;Bn||(Kr=di(Se),Kr=Kr==l?E:Kr),$r||(yi=di(Xe),yi=yi==l?E:yi);var io=Kr==E&&!ue(Se),eo=yi==E&&!ue(Xe),oo=Kr==yi;if(oo&&!io)return fn||(fn=new un),Bn||To(Se)?us(Se,Xe,yt,zt,bn,fn):Wr(Se,Xe,Kr,yt,zt,bn,fn);if(!(bn&s)){var Bs=io&&tt.call(Se,"__wrapped__"),qo=eo&&tt.call(Xe,"__wrapped__");if(Bs||qo){var Aa=Bs?Se.value():Se,Yl=qo?Xe.value():Xe;return fn||(fn=new un),yt(Aa,Yl,zt,bn,fn)}}return oo?(fn||(fn=new un),Wa(Se,Xe,yt,zt,bn,fn)):!1}function Oo(Se,Xe,yt,zt){var bn=yt.length,fn=bn;if(Se==null)return!fn;for(Se=Object(Se);bn--;){var Bn=yt[bn];if(Bn[2]?Bn[1]!==Se[Bn[0]]:!(Bn[0]in Se))return!1}for(;++bn<fn;){Bn=yt[bn];var $r=Bn[0],Kr=Se[$r],yi=Bn[1];if(Bn[2]){if(Kr===void 0&&!($r in Se))return!1}else{var io=new un,eo;if(!(eo===void 0?Zi(yi,Kr,zt,o|s,io):eo))return!1}}return!0}function oe(Se){if(!yo(Se)||cs(Se))return!1;var Xe=Qr(Se)||ue(Se)?qe:j;return Xe.test(Me(Se))}function ve(Se){return Oi(Se)&&po(Se.length)&&!!q[je.call(Se)]}function He(Se){return typeof Se=="function"?Se:Se==null?sn:typeof Se=="object"?fr(Se)?nn(Se[0],Se[1]):Rt(Se):er(Se)}function lt(Se){if(!Js(Se))return _e(Se);var Xe=[];for(var yt in Object(Se))tt.call(Se,yt)&&yt!="constructor"&&Xe.push(yt);return Xe}function Rt(Se){var Xe=li(Se);return Xe.length==1&&Xe[0][2]?ql(Xe[0][0],Xe[0][1]):function(yt){return yt===Se||Oo(yt,Se,Xe)}}function nn(Se,Xe){return Fs(Se)&&Qa(Xe)?ql(fe(Se),Xe):function(yt){var zt=Ne(yt,Se);return zt===void 0&&zt===Xe?et(yt,Se):Zi(Xe,zt,void 0,o|s)}}function or(Se){return function(Xe){return Rr(Xe,Se)}}function Jn(Se){if(typeof Se=="string")return Se;if(ho(Se))return Ft?Ft.call(Se):"";var Xe=Se+"";return Xe=="0"&&1/Se==-1/0?"-0":Xe}function ci(Se){return fr(Se)?Se:wd(Se)}function Mr(Se,Xe){return function(yt,zt){var bn=fr(yt)?Ae:Fn,fn={};return bn(yt,Se,He(zt),fn)}}function Ms(Se,Xe){return function(yt,zt){if(yt==null)return yt;if(!xr(yt))return Se(yt,zt);for(var bn=yt.length,fn=-1,Bn=Object(yt);++fn<bn&&zt(Bn[fn],fn,Bn)!==!1;);return yt}}function Ks(Se){return function(Xe,yt,zt){for(var bn=-1,fn=Object(Xe),Bn=zt(Xe),$r=Bn.length;$r--;){var Kr=Bn[++bn];if(yt(fn[Kr],Kr,fn)===!1)break}return Xe}}function us(Se,Xe,yt,zt,bn,fn){var Bn=bn&s,$r=Se.length,Kr=Xe.length;if($r!=Kr&&!(Bn&&Kr>$r))return!1;var yi=fn.get(Se);if(yi&&fn.get(Xe))return yi==Xe;var io=-1,eo=!0,oo=bn&o?new dr:void 0;for(fn.set(Se,Xe),fn.set(Xe,Se);++io<$r;){var Bs=Se[io],qo=Xe[io];if(zt)var Aa=Bn?zt(qo,Bs,io,Xe,Se,fn):zt(Bs,qo,io,Se,Xe,fn);if(Aa!==void 0){if(Aa)continue;eo=!1;break}if(oo){if(!te(Xe,function(Yl,Id){if(!oo.has(Id)&&(Bs===Yl||yt(Bs,Yl,zt,bn,fn)))return oo.add(Id)})){eo=!1;break}}else if(!(Bs===qo||yt(Bs,qo,zt,bn,fn))){eo=!1;break}}return fn.delete(Se),fn.delete(Xe),eo}function Wr(Se,Xe,yt,zt,bn,fn,Bn){switch(yt){case D:if(Se.byteLength!=Xe.byteLength||Se.byteOffset!=Xe.byteOffset)return!1;Se=Se.buffer,Xe=Xe.buffer;case w:return!(Se.byteLength!=Xe.byteLength||!zt(new Ye(Se),new Ye(Xe)));case c:case d:case m:return nr(+Se,+Xe);case p:return Se.name==Xe.name&&Se.message==Xe.message;case T:case _:return Se==Xe+"";case g:var $r=Ee;case v:var Kr=fn&s;if($r||($r=me),Se.size!=Xe.size&&!Kr)return!1;var yi=Bn.get(Se);if(yi)return yi==Xe;fn|=o,Bn.set(Se,Xe);var io=us($r(Se),$r(Xe),zt,bn,fn,Bn);return Bn.delete(Se),io;case x:if(wt)return wt.call(Se)==wt.call(Xe)}return!1}function Wa(Se,Xe,yt,zt,bn,fn){var Bn=bn&s,$r=Mt(Se),Kr=$r.length,yi=Mt(Xe),io=yi.length;if(Kr!=io&&!Bn)return!1;for(var eo=Kr;eo--;){var oo=$r[eo];if(!(Bn?oo in Xe:tt.call(Xe,oo)))return!1}var Bs=fn.get(Se);if(Bs&&fn.get(Xe))return Bs==Xe;var qo=!0;fn.set(Se,Xe),fn.set(Xe,Se);for(var Aa=Bn;++eo<Kr;){oo=$r[eo];var Yl=Se[oo],Id=Xe[oo];if(zt)var We=Bn?zt(Id,Yl,oo,Xe,Se,fn):zt(Yl,Id,oo,Se,Xe,fn);if(!(We===void 0?Yl===Id||yt(Yl,Id,zt,bn,fn):We)){qo=!1;break}Aa||(Aa=oo=="constructor")}if(qo&&!Aa){var ut=Se.constructor,ft=Xe.constructor;ut!=ft&&"constructor"in Se&&"constructor"in Xe&&!(typeof ut=="function"&&ut instanceof ut&&typeof ft=="function"&&ft instanceof ft)&&(qo=!1)}return fn.delete(Se),fn.delete(Xe),qo}function Ar(Se,Xe){var yt=Se.__data__;return _c(Xe)?yt[typeof Xe=="string"?"string":"hash"]:yt.map}function li(Se){for(var Xe=Mt(Se),yt=Xe.length;yt--;){var zt=Xe[yt],bn=Se[zt];Xe[yt]=[zt,bn,Qa(bn)]}return Xe}function Br(Se,Xe){var yt=se(Se,Xe);return oe(yt)?yt:void 0}var di=ei;(we&&di(new we(new ArrayBuffer(1)))!=D||re&&di(new re)!=g||he&&di(he.resolve())!=y||be&&di(new be)!=v||Ue&&di(new Ue)!=b)&&(di=function(Se){var Xe=je.call(Se),yt=Xe==E?Se.constructor:void 0,zt=yt?Me(yt):void 0;if(zt)switch(zt){case Ge:return D;case mt:return g;case _t:return y;case Ce:return v;case ot:return b}return Xe});function vs(Se,Xe,yt){Xe=Fs(Xe,Se)?[Xe]:ci(Xe);for(var zt,bn=-1,Bn=Xe.length;++bn<Bn;){var fn=fe(Xe[bn]);if(!(zt=Se!=null&&yt(Se,fn)))break;Se=Se[fn]}if(zt)return zt;var Bn=Se?Se.length:0;return!!Bn&&po(Bn)&&Zs(fn,Bn)&&(fr(Se)||Dn(Se))}function Zs(Se,Xe){return Xe=Xe??a,!!Xe&&(typeof Se=="number"||Y.test(Se))&&Se>-1&&Se%1==0&&Se<Xe}function Fs(Se,Xe){if(fr(Se))return!1;var yt=typeof Se;return yt=="number"||yt=="symbol"||yt=="boolean"||Se==null||ho(Se)?!0:F.test(Se)||!K.test(Se)||Xe!=null&&Se in Object(Xe)}function _c(Se){var Xe=typeof Se;return Xe=="string"||Xe=="number"||Xe=="symbol"||Xe=="boolean"?Se!=="__proto__":Se===null}function cs(Se){return!!Ve&&Ve in Se}function Js(Se){var Xe=Se&&Se.constructor,yt=typeof Xe=="function"&&Xe.prototype||Oe;return Se===yt}function Qa(Se){return Se===Se&&!yo(Se)}function ql(Se,Xe){return function(yt){return yt==null?!1:yt[Se]===Xe&&(Xe!==void 0||Se in Object(yt))}}var wd=kt(function(Se){Se=za(Se);var Xe=[];return V.test(Se)&&Xe.push(""),Se.replace(W,function(yt,zt,bn,fn){Xe.push(bn?fn.replace($,"$1"):zt||yt)}),Xe});function fe(Se){if(typeof Se=="string"||ho(Se))return Se;var Xe=Se+"";return Xe=="0"&&1/Se==-1/0?"-0":Xe}function Me(Se){if(Se!=null){try{return Be.call(Se)}catch{}try{return Se+""}catch{}}return""}var it=Mr(function(Se,Xe,yt){tt.call(Se,yt)?Se[yt].push(Xe):Se[yt]=[Xe]});function kt(Se,Xe){if(typeof Se!="function"||Xe&&typeof Xe!="function")throw new TypeError(r);var yt=function(){var zt=arguments,bn=Xe?Xe.apply(this,zt):zt[0],fn=yt.cache;if(fn.has(bn))return fn.get(bn);var Bn=Se.apply(this,zt);return yt.cache=fn.set(bn,Bn),Bn};return yt.cache=new(kt.Cache||Ie),yt}kt.Cache=Ie;function nr(Se,Xe){return Se===Xe||Se!==Se&&Xe!==Xe}function Dn(Se){return Ji(Se)&&tt.call(Se,"callee")&&(!Ke.call(Se,"callee")||je.call(Se)==l)}var fr=Array.isArray;function xr(Se){return Se!=null&&po(Se.length)&&!Qr(Se)}function Ji(Se){return Oi(Se)&&xr(Se)}function Qr(Se){var Xe=yo(Se)?je.call(Se):"";return Xe==h||Xe==A}function po(Se){return typeof Se=="number"&&Se>-1&&Se%1==0&&Se<=a}function yo(Se){var Xe=typeof Se;return!!Se&&(Xe=="object"||Xe=="function")}function Oi(Se){return!!Se&&typeof Se=="object"}function ho(Se){return typeof Se=="symbol"||Oi(Se)&&je.call(Se)==x}var To=de?ne(de):ve;function za(Se){return Se==null?"":Jn(Se)}function Ne(Se,Xe,yt){var zt=Se==null?void 0:Rr(Se,Xe);return zt===void 0?yt:zt}function et(Se,Xe){return Se!=null&&vs(Se,Xe,wi)}function Mt(Se){return xr(Se)?Rn(Se):lt(Se)}function sn(Se){return Se}function er(Se){return Fs(Se)?J(fe(Se)):or(Se)}e.exports=it})(Yg,Yg.exports)),Yg.exports}var nje=tje();const FN=ii(nje);var Kg={exports:{}};Kg.exports;var FY;function rje(){return FY||(FY=1,(function(e,t){var n=200,r="Expected a function",i="__lodash_hash_undefined__",o=1,s=2,a=9007199254740991,l="[object Arguments]",u="[object Array]",c="[object Boolean]",d="[object Date]",p="[object Error]",h="[object Function]",A="[object GeneratorFunction]",g="[object Map]",m="[object Number]",E="[object Object]",y="[object Promise]",T="[object RegExp]",v="[object Set]",_="[object String]",x="[object Symbol]",b="[object WeakMap]",w="[object ArrayBuffer]",D="[object DataView]",I="[object Float32Array]",P="[object Float64Array]",k="[object Int8Array]",N="[object Int16Array]",L="[object Int32Array]",M="[object Uint8Array]",B="[object Uint8ClampedArray]",G="[object Uint16Array]",Q="[object Uint32Array]",K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,F=/^\w*$/,V=/^\./,W=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,R=/[\\^$.*+?()[\]{}|]/g,$=/\\(\\)?/g,j=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,q={};q[I]=q[P]=q[k]=q[N]=q[L]=q[M]=q[B]=q[G]=q[Q]=!0,q[l]=q[u]=q[w]=q[c]=q[D]=q[d]=q[p]=q[h]=q[g]=q[m]=q[E]=q[T]=q[v]=q[_]=q[b]=!1;var H=typeof jn=="object"&&jn&&jn.Object===Object&&jn,U=typeof self=="object"&&self&&self.Object===Object&&self,X=H||U||Function("return this")(),ee=t&&!t.nodeType&&t,Z=ee&&!0&&e&&!e.nodeType&&e,le=Z&&Z.exports===ee,z=le&&H.process,ie=(function(){try{return z&&z.binding("util")}catch{}})(),de=ie&&ie.isTypedArray;function Ae(Ne,et){for(var Mt=-1,sn=Ne?Ne.length:0;++Mt<sn;)if(et(Ne[Mt],Mt,Ne))return!0;return!1}function te(Ne){return function(et){return et?.[Ne]}}function J(Ne,et){for(var Mt=-1,sn=Array(Ne);++Mt<Ne;)sn[Mt]=et(Mt);return sn}function ae(Ne){return function(et){return Ne(et)}}function ne(Ne,et){return Ne?.[et]}function se(Ne){var et=!1;if(Ne!=null&&typeof Ne.toString!="function")try{et=!!(Ne+"")}catch{}return et}function ue(Ne){var et=-1,Mt=Array(Ne.size);return Ne.forEach(function(sn,er){Mt[++et]=[er,sn]}),Mt}function Ee(Ne,et){return function(Mt){return Ne(et(Mt))}}function pe(Ne){var et=-1,Mt=Array(Ne.size);return Ne.forEach(function(sn){Mt[++et]=sn}),Mt}var me=Array.prototype,xe=Function.prototype,ge=Object.prototype,Oe=X["__core-js_shared__"],$e=(function(){var Ne=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||"");return Ne?"Symbol(src)_1."+Ne:""})(),Ve=xe.toString,Be=ge.hasOwnProperty,tt=ge.toString,je=RegExp("^"+Ve.call(Be).replace(R,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qe=X.Symbol,Le=X.Uint8Array,Ye=ge.propertyIsEnumerable,Ke=me.splice,Te=Ee(Object.keys,Object),_e=us(X,"DataView"),we=us(X,"Map"),re=us(X,"Promise"),he=us(X,"Set"),be=us(X,"WeakMap"),Ue=us(Object,"create"),Pe=Js(_e),Ge=Js(we),mt=Js(re),_t=Js(he),Ce=Js(be),ot=qe?qe.prototype:void 0,At=ot?ot.valueOf:void 0,wt=ot?ot.toString:void 0;function Ft(Ne){var et=-1,Mt=Ne?Ne.length:0;for(this.clear();++et<Mt;){var sn=Ne[et];this.set(sn[0],sn[1])}}function Dt(){this.__data__=Ue?Ue(null):{}}function Bt(Ne){return this.has(Ne)&&delete this.__data__[Ne]}function Re(Ne){var et=this.__data__;if(Ue){var Mt=et[Ne];return Mt===i?void 0:Mt}return Be.call(et,Ne)?et[Ne]:void 0}function nt(Ne){var et=this.__data__;return Ue?et[Ne]!==void 0:Be.call(et,Ne)}function Qe(Ne,et){var Mt=this.__data__;return Mt[Ne]=Ue&&et===void 0?i:et,this}Ft.prototype.clear=Dt,Ft.prototype.delete=Bt,Ft.prototype.get=Re,Ft.prototype.has=nt,Ft.prototype.set=Qe;function st(Ne){var et=-1,Mt=Ne?Ne.length:0;for(this.clear();++et<Mt;){var sn=Ne[et];this.set(sn[0],sn[1])}}function Ot(){this.__data__=[]}function Tt(Ne){var et=this.__data__,Mt=Rn(et,Ne);if(Mt<0)return!1;var sn=et.length-1;return Mt==sn?et.pop():Ke.call(et,Mt,1),!0}function Ut(Ne){var et=this.__data__,Mt=Rn(et,Ne);return Mt<0?void 0:et[Mt][1]}function De(Ne){return Rn(this.__data__,Ne)>-1}function rt(Ne,et){var Mt=this.__data__,sn=Rn(Mt,Ne);return sn<0?Mt.push([Ne,et]):Mt[sn][1]=et,this}st.prototype.clear=Ot,st.prototype.delete=Tt,st.prototype.get=Ut,st.prototype.has=De,st.prototype.set=rt;function Je(Ne){var et=-1,Mt=Ne?Ne.length:0;for(this.clear();++et<Mt;){var sn=Ne[et];this.set(sn[0],sn[1])}}function Ie(){this.__data__={hash:new Ft,map:new(we||st),string:new Ft}}function at(Ne){return Ms(this,Ne).delete(Ne)}function gt(Ne){return Ms(this,Ne).get(Ne)}function Xt(Ne){return Ms(this,Ne).has(Ne)}function pn(Ne,et){return Ms(this,Ne).set(Ne,et),this}Je.prototype.clear=Ie,Je.prototype.delete=at,Je.prototype.get=gt,Je.prototype.has=Xt,Je.prototype.set=pn;function $n(Ne){var et=-1,Mt=Ne?Ne.length:0;for(this.__data__=new Je;++et<Mt;)this.add(Ne[et])}function dr(Ne){return this.__data__.set(Ne,i),this}function tr(Ne){return this.__data__.has(Ne)}$n.prototype.add=$n.prototype.push=dr,$n.prototype.has=tr;function rr(Ne){this.__data__=new st(Ne)}function un(){this.__data__=new st}function kn(Ne){return this.__data__.delete(Ne)}function kr(Ne){return this.__data__.get(Ne)}function $t(Ne){return this.__data__.has(Ne)}function Jt(Ne,et){var Mt=this.__data__;if(Mt instanceof st){var sn=Mt.__data__;if(!we||sn.length<n-1)return sn.push([Ne,et]),this;Mt=this.__data__=new Je(sn)}return Mt.set(Ne,et),this}rr.prototype.clear=un,rr.prototype.delete=kn,rr.prototype.get=kr,rr.prototype.has=$t,rr.prototype.set=Jt;function zn(Ne,et){var Mt=fe(Ne)||wd(Ne)?J(Ne.length,String):[],sn=Mt.length,er=!!sn;for(var Se in Ne)Be.call(Ne,Se)&&!(er&&(Se=="length"||Ar(Se,sn)))&&Mt.push(Se);return Mt}function Rn(Ne,et){for(var Mt=Ne.length;Mt--;)if(ql(Ne[Mt][0],et))return Mt;return-1}var En=or();function Fn(Ne,et){return Ne&&En(Ne,et,Oi)}function Kn(Ne,et){et=li(et,Ne)?[et]:nn(et);for(var Mt=0,sn=et.length;Ne!=null&&Mt<sn;)Ne=Ne[cs(et[Mt++])];return Mt&&Mt==sn?Ne:void 0}function Hn(Ne){return tt.call(Ne)}function Gr(Ne,et){return Ne!=null&&et in Object(Ne)}function Rr(Ne,et,Mt,sn,er){return Ne===et?!0:Ne==null||et==null||!Dn(Ne)&&!fr(et)?Ne!==Ne&&et!==et:ei(Ne,et,Rr,Mt,sn,er)}function ei(Ne,et,Mt,sn,er,Se){var Xe=fe(Ne),yt=fe(et),zt=u,bn=u;Xe||(zt=Wr(Ne),zt=zt==l?E:zt),yt||(bn=Wr(et),bn=bn==l?E:bn);var fn=zt==E&&!se(Ne),Bn=bn==E&&!se(et),$r=zt==bn;if($r&&!fn)return Se||(Se=new rr),Xe||Ji(Ne)?Jn(Ne,et,Mt,sn,er,Se):ci(Ne,et,zt,Mt,sn,er,Se);if(!(er&s)){var Kr=fn&&Be.call(Ne,"__wrapped__"),yi=Bn&&Be.call(et,"__wrapped__");if(Kr||yi){var io=Kr?Ne.value():Ne,eo=yi?et.value():et;return Se||(Se=new rr),Mt(io,eo,sn,er,Se)}}return $r?(Se||(Se=new rr),Mr(Ne,et,Mt,sn,er,Se)):!1}function wi(Ne,et,Mt,sn){var er=Mt.length,Se=er;if(Ne==null)return!Se;for(Ne=Object(Ne);er--;){var Xe=Mt[er];if(Xe[2]?Xe[1]!==Ne[Xe[0]]:!(Xe[0]in Ne))return!1}for(;++er<Se;){Xe=Mt[er];var yt=Xe[0],zt=Ne[yt],bn=Xe[1];if(Xe[2]){if(zt===void 0&&!(yt in Ne))return!1}else{var fn=new rr,Bn;if(!(Bn===void 0?Rr(bn,zt,sn,o|s,fn):Bn))return!1}}return!0}function Zi(Ne){if(!Dn(Ne)||di(Ne))return!1;var et=kt(Ne)||se(Ne)?je:j;return et.test(Js(Ne))}function ir(Ne){return fr(Ne)&&nr(Ne.length)&&!!q[tt.call(Ne)]}function Oo(Ne){return typeof Ne=="function"?Ne:Ne==null?To:typeof Ne=="object"?fe(Ne)?He(Ne[0],Ne[1]):ve(Ne):za(Ne)}function oe(Ne){if(!vs(Ne))return Te(Ne);var et=[];for(var Mt in Object(Ne))Be.call(Ne,Mt)&&Mt!="constructor"&&et.push(Mt);return et}function ve(Ne){var et=Ks(Ne);return et.length==1&&et[0][2]?Fs(et[0][0],et[0][1]):function(Mt){return Mt===Ne||wi(Mt,Ne,et)}}function He(Ne,et){return li(Ne)&&Zs(et)?Fs(cs(Ne),et):function(Mt){var sn=po(Mt,Ne);return sn===void 0&&sn===et?yo(Mt,Ne):Rr(et,sn,void 0,o|s)}}function lt(Ne){return function(et){return Kn(et,Ne)}}function Rt(Ne){if(typeof Ne=="string")return Ne;if(xr(Ne))return wt?wt.call(Ne):"";var et=Ne+"";return et=="0"&&1/Ne==-1/0?"-0":et}function nn(Ne){return fe(Ne)?Ne:_c(Ne)}function or(Ne){return function(et,Mt,sn){for(var er=-1,Se=Object(et),Xe=sn(et),yt=Xe.length;yt--;){var zt=Xe[++er];if(Mt(Se[zt],zt,Se)===!1)break}return et}}function Jn(Ne,et,Mt,sn,er,Se){var Xe=er&s,yt=Ne.length,zt=et.length;if(yt!=zt&&!(Xe&&zt>yt))return!1;var bn=Se.get(Ne);if(bn&&Se.get(et))return bn==et;var fn=-1,Bn=!0,$r=er&o?new $n:void 0;for(Se.set(Ne,et),Se.set(et,Ne);++fn<yt;){var Kr=Ne[fn],yi=et[fn];if(sn)var io=Xe?sn(yi,Kr,fn,et,Ne,Se):sn(Kr,yi,fn,Ne,et,Se);if(io!==void 0){if(io)continue;Bn=!1;break}if($r){if(!Ae(et,function(eo,oo){if(!$r.has(oo)&&(Kr===eo||Mt(Kr,eo,sn,er,Se)))return $r.add(oo)})){Bn=!1;break}}else if(!(Kr===yi||Mt(Kr,yi,sn,er,Se))){Bn=!1;break}}return Se.delete(Ne),Se.delete(et),Bn}function ci(Ne,et,Mt,sn,er,Se,Xe){switch(Mt){case D:if(Ne.byteLength!=et.byteLength||Ne.byteOffset!=et.byteOffset)return!1;Ne=Ne.buffer,et=et.buffer;case w:return!(Ne.byteLength!=et.byteLength||!sn(new Le(Ne),new Le(et)));case c:case d:case m:return ql(+Ne,+et);case p:return Ne.name==et.name&&Ne.message==et.message;case T:case _:return Ne==et+"";case g:var yt=ue;case v:var zt=Se&s;if(yt||(yt=pe),Ne.size!=et.size&&!zt)return!1;var bn=Xe.get(Ne);if(bn)return bn==et;Se|=o,Xe.set(Ne,et);var fn=Jn(yt(Ne),yt(et),sn,er,Se,Xe);return Xe.delete(Ne),fn;case x:if(At)return At.call(Ne)==At.call(et)}return!1}function Mr(Ne,et,Mt,sn,er,Se){var Xe=er&s,yt=Oi(Ne),zt=yt.length,bn=Oi(et),fn=bn.length;if(zt!=fn&&!Xe)return!1;for(var Bn=zt;Bn--;){var $r=yt[Bn];if(!(Xe?$r in et:Be.call(et,$r)))return!1}var Kr=Se.get(Ne);if(Kr&&Se.get(et))return Kr==et;var yi=!0;Se.set(Ne,et),Se.set(et,Ne);for(var io=Xe;++Bn<zt;){$r=yt[Bn];var eo=Ne[$r],oo=et[$r];if(sn)var Bs=Xe?sn(oo,eo,$r,et,Ne,Se):sn(eo,oo,$r,Ne,et,Se);if(!(Bs===void 0?eo===oo||Mt(eo,oo,sn,er,Se):Bs)){yi=!1;break}io||(io=$r=="constructor")}if(yi&&!io){var qo=Ne.constructor,Aa=et.constructor;qo!=Aa&&"constructor"in Ne&&"constructor"in et&&!(typeof qo=="function"&&qo instanceof qo&&typeof Aa=="function"&&Aa instanceof Aa)&&(yi=!1)}return Se.delete(Ne),Se.delete(et),yi}function Ms(Ne,et){var Mt=Ne.__data__;return Br(et)?Mt[typeof et=="string"?"string":"hash"]:Mt.map}function Ks(Ne){for(var et=Oi(Ne),Mt=et.length;Mt--;){var sn=et[Mt],er=Ne[sn];et[Mt]=[sn,er,Zs(er)]}return et}function us(Ne,et){var Mt=ne(Ne,et);return Zi(Mt)?Mt:void 0}var Wr=Hn;(_e&&Wr(new _e(new ArrayBuffer(1)))!=D||we&&Wr(new we)!=g||re&&Wr(re.resolve())!=y||he&&Wr(new he)!=v||be&&Wr(new be)!=b)&&(Wr=function(Ne){var et=tt.call(Ne),Mt=et==E?Ne.constructor:void 0,sn=Mt?Js(Mt):void 0;if(sn)switch(sn){case Pe:return D;case Ge:return g;case mt:return y;case _t:return v;case Ce:return b}return et});function Wa(Ne,et,Mt){et=li(et,Ne)?[et]:nn(et);for(var sn,er=-1,Xe=et.length;++er<Xe;){var Se=cs(et[er]);if(!(sn=Ne!=null&&Mt(Ne,Se)))break;Ne=Ne[Se]}if(sn)return sn;var Xe=Ne?Ne.length:0;return!!Xe&&nr(Xe)&&Ar(Se,Xe)&&(fe(Ne)||wd(Ne))}function Ar(Ne,et){return et=et??a,!!et&&(typeof Ne=="number"||Y.test(Ne))&&Ne>-1&&Ne%1==0&&Ne<et}function li(Ne,et){if(fe(Ne))return!1;var Mt=typeof Ne;return Mt=="number"||Mt=="symbol"||Mt=="boolean"||Ne==null||xr(Ne)?!0:F.test(Ne)||!K.test(Ne)||et!=null&&Ne in Object(et)}function Br(Ne){var et=typeof Ne;return et=="string"||et=="number"||et=="symbol"||et=="boolean"?Ne!=="__proto__":Ne===null}function di(Ne){return!!$e&&$e in Ne}function vs(Ne){var et=Ne&&Ne.constructor,Mt=typeof et=="function"&&et.prototype||ge;return Ne===Mt}function Zs(Ne){return Ne===Ne&&!Dn(Ne)}function Fs(Ne,et){return function(Mt){return Mt==null?!1:Mt[Ne]===et&&(et!==void 0||Ne in Object(Mt))}}var _c=Qa(function(Ne){Ne=Qr(Ne);var et=[];return V.test(Ne)&&et.push(""),Ne.replace(W,function(Mt,sn,er,Se){et.push(er?Se.replace($,"$1"):sn||Mt)}),et});function cs(Ne){if(typeof Ne=="string"||xr(Ne))return Ne;var et=Ne+"";return et=="0"&&1/Ne==-1/0?"-0":et}function Js(Ne){if(Ne!=null){try{return Ve.call(Ne)}catch{}try{return Ne+""}catch{}}return""}function Qa(Ne,et){if(typeof Ne!="function"||et&&typeof et!="function")throw new TypeError(r);var Mt=function(){var sn=arguments,er=et?et.apply(this,sn):sn[0],Se=Mt.cache;if(Se.has(er))return Se.get(er);var Xe=Ne.apply(this,sn);return Mt.cache=Se.set(er,Xe),Xe};return Mt.cache=new(Qa.Cache||Je),Mt}Qa.Cache=Je;function ql(Ne,et){return Ne===et||Ne!==Ne&&et!==et}function wd(Ne){return it(Ne)&&Be.call(Ne,"callee")&&(!Ye.call(Ne,"callee")||tt.call(Ne)==l)}var fe=Array.isArray;function Me(Ne){return Ne!=null&&nr(Ne.length)&&!kt(Ne)}function it(Ne){return fr(Ne)&&Me(Ne)}function kt(Ne){var et=Dn(Ne)?tt.call(Ne):"";return et==h||et==A}function nr(Ne){return typeof Ne=="number"&&Ne>-1&&Ne%1==0&&Ne<=a}function Dn(Ne){var et=typeof Ne;return!!Ne&&(et=="object"||et=="function")}function fr(Ne){return!!Ne&&typeof Ne=="object"}function xr(Ne){return typeof Ne=="symbol"||fr(Ne)&&tt.call(Ne)==x}var Ji=de?ae(de):ir;function Qr(Ne){return Ne==null?"":Rt(Ne)}function po(Ne,et,Mt){var sn=Ne==null?void 0:Kn(Ne,et);return sn===void 0?Mt:sn}function yo(Ne,et){return Ne!=null&&Wa(Ne,et,Gr)}function Oi(Ne){return Me(Ne)?zn(Ne):oe(Ne)}function ho(Ne,et){var Mt={};return et=Oo(et),Fn(Ne,function(sn,er,Se){Mt[er]=et(sn,er,Se)}),Mt}function To(Ne){return Ne}function za(Ne){return li(Ne)?te(cs(Ne)):lt(Ne)}e.exports=ho})(Kg,Kg.exports)),Kg.exports}var ije=rje();const oje=ii(ije);var BN,BY;function sje(){if(BY)return BN;BY=1;var e=200,t="__lodash_hash_undefined__",n=9007199254740991,r="[object Arguments]",i="[object Function]",o="[object GeneratorFunction]",s="[object Symbol]",a=/[\\^$.*+?()[\]{}|]/g,l=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,c=typeof jn=="object"&&jn&&jn.Object===Object&&jn,d=typeof self=="object"&&self&&self.Object===Object&&self,p=c||d||Function("return this")();function h(De,rt,Je){switch(Je.length){case 0:return De.call(rt);case 1:return De.call(rt,Je[0]);case 2:return De.call(rt,Je[0],Je[1]);case 3:return De.call(rt,Je[0],Je[1],Je[2])}return De.apply(rt,Je)}function A(De,rt){var Je=De?De.length:0;return!!Je&&y(De,rt,0)>-1}function g(De,rt){for(var Je=-1,Ie=De?De.length:0,at=Array(Ie);++Je<Ie;)at[Je]=rt(De[Je],Je,De);return at}function m(De,rt){for(var Je=-1,Ie=rt.length,at=De.length;++Je<Ie;)De[at+Je]=rt[Je];return De}function E(De,rt,Je,Ie){for(var at=De.length,gt=Je+-1;++gt<at;)if(rt(De[gt],gt,De))return gt;return-1}function y(De,rt,Je){if(rt!==rt)return E(De,T,Je);for(var Ie=Je-1,at=De.length;++Ie<at;)if(De[Ie]===rt)return Ie;return-1}function T(De){return De!==De}function v(De,rt){for(var Je=-1,Ie=Array(De);++Je<De;)Ie[Je]=rt(Je);return Ie}function _(De,rt){return De.has(rt)}function x(De,rt){return De?.[rt]}function b(De){var rt=!1;if(De!=null&&typeof De.toString!="function")try{rt=!!(De+"")}catch{}return rt}function w(De,rt){return function(Je){return De(rt(Je))}}var D=Array.prototype,I=Function.prototype,P=Object.prototype,k=p["__core-js_shared__"],N=(function(){var De=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||"");return De?"Symbol(src)_1."+De:""})(),L=I.toString,M=P.hasOwnProperty,B=P.toString,G=RegExp("^"+L.call(M).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Q=p.Symbol,K=w(Object.getPrototypeOf,Object),F=P.propertyIsEnumerable,V=D.splice,W=Q?Q.isConcatSpreadable:void 0,R=Object.getOwnPropertySymbols,$=Math.max,j=_e(p,"Map"),Y=_e(Object,"create");function q(De){var rt=-1,Je=De?De.length:0;for(this.clear();++rt<Je;){var Ie=De[rt];this.set(Ie[0],Ie[1])}}function H(){this.__data__=Y?Y(null):{}}function U(De){return this.has(De)&&delete this.__data__[De]}function X(De){var rt=this.__data__;if(Y){var Je=rt[De];return Je===t?void 0:Je}return M.call(rt,De)?rt[De]:void 0}function ee(De){var rt=this.__data__;return Y?rt[De]!==void 0:M.call(rt,De)}function Z(De,rt){var Je=this.__data__;return Je[De]=Y&&rt===void 0?t:rt,this}q.prototype.clear=H,q.prototype.delete=U,q.prototype.get=X,q.prototype.has=ee,q.prototype.set=Z;function le(De){var rt=-1,Je=De?De.length:0;for(this.clear();++rt<Je;){var Ie=De[rt];this.set(Ie[0],Ie[1])}}function z(){this.__data__=[]}function ie(De){var rt=this.__data__,Je=Oe(rt,De);if(Je<0)return!1;var Ie=rt.length-1;return Je==Ie?rt.pop():V.call(rt,Je,1),!0}function de(De){var rt=this.__data__,Je=Oe(rt,De);return Je<0?void 0:rt[Je][1]}function Ae(De){return Oe(this.__data__,De)>-1}function te(De,rt){var Je=this.__data__,Ie=Oe(Je,De);return Ie<0?Je.push([De,rt]):Je[Ie][1]=rt,this}le.prototype.clear=z,le.prototype.delete=ie,le.prototype.get=de,le.prototype.has=Ae,le.prototype.set=te;function J(De){var rt=-1,Je=De?De.length:0;for(this.clear();++rt<Je;){var Ie=De[rt];this.set(Ie[0],Ie[1])}}function ae(){this.__data__={hash:new q,map:new(j||le),string:new q}}function ne(De){return Te(this,De).delete(De)}function se(De){return Te(this,De).get(De)}function ue(De){return Te(this,De).has(De)}function Ee(De,rt){return Te(this,De).set(De,rt),this}J.prototype.clear=ae,J.prototype.delete=ne,J.prototype.get=se,J.prototype.has=ue,J.prototype.set=Ee;function pe(De){var rt=-1,Je=De?De.length:0;for(this.__data__=new J;++rt<Je;)this.add(De[rt])}function me(De){return this.__data__.set(De,t),this}function xe(De){return this.__data__.has(De)}pe.prototype.add=pe.prototype.push=me,pe.prototype.has=xe;function ge(De,rt){var Je=wt(De)||At(De)?v(De.length,String):[],Ie=Je.length,at=!!Ie;for(var gt in De)at&&(gt=="length"||be(gt,Ie))||Je.push(gt);return Je}function Oe(De,rt){for(var Je=De.length;Je--;)if(ot(De[Je][0],rt))return Je;return-1}function $e(De,rt,Je,Ie){var at=-1,gt=A,Xt=!0,pn=De.length,$n=[],dr=rt.length;if(!pn)return $n;rt.length>=e&&(gt=_,Xt=!1,rt=new pe(rt));e:for(;++at<pn;){var tr=De[at],rr=tr;if(tr=tr!==0?tr:0,Xt&&rr===rr){for(var un=dr;un--;)if(rt[un]===rr)continue e;$n.push(tr)}else gt(rt,rr,Ie)||$n.push(tr)}return $n}function Ve(De,rt,Je,Ie,at){var gt=-1,Xt=De.length;for(Je||(Je=he),at||(at=[]);++gt<Xt;){var pn=De[gt];Je(pn)?m(at,pn):at[at.length]=pn}return at}function Be(De,rt,Je){var Ie=rt(De);return wt(De)?Ie:m(Ie,Je(De))}function tt(De){if(!nt(De)||Pe(De))return!1;var rt=Bt(De)||b(De)?G:l;return rt.test(Ce(De))}function je(De){if(!nt(De))return mt(De);var rt=Ge(De),Je=[];for(var Ie in De)Ie=="constructor"&&(rt||!M.call(De,Ie))||Je.push(Ie);return Je}function qe(De,rt){return De=Object(De),Le(De,rt,function(Je,Ie){return Ie in De})}function Le(De,rt,Je){for(var Ie=-1,at=rt.length,gt={};++Ie<at;){var Xt=rt[Ie],pn=De[Xt];Je(pn,Xt)&&(gt[Xt]=pn)}return gt}function Ye(De,rt){return rt=$(rt===void 0?De.length-1:rt,0),function(){for(var Je=arguments,Ie=-1,at=$(Je.length-rt,0),gt=Array(at);++Ie<at;)gt[Ie]=Je[rt+Ie];Ie=-1;for(var Xt=Array(rt+1);++Ie<rt;)Xt[Ie]=Je[Ie];return Xt[rt]=gt,h(De,this,Xt)}}function Ke(De){return Be(De,Ot,re)}function Te(De,rt){var Je=De.__data__;return Ue(rt)?Je[typeof rt=="string"?"string":"hash"]:Je.map}function _e(De,rt){var Je=x(De,rt);return tt(Je)?Je:void 0}var we=R?w(R,Object):Ut,re=R?function(De){for(var rt=[];De;)m(rt,we(De)),De=K(De);return rt}:Ut;function he(De){return wt(De)||At(De)||!!(W&&De&&De[W])}function be(De,rt){return rt=rt??n,!!rt&&(typeof De=="number"||u.test(De))&&De>-1&&De%1==0&&De<rt}function Ue(De){var rt=typeof De;return rt=="string"||rt=="number"||rt=="symbol"||rt=="boolean"?De!=="__proto__":De===null}function Pe(De){return!!N&&N in De}function Ge(De){var rt=De&&De.constructor,Je=typeof rt=="function"&&rt.prototype||P;return De===Je}function mt(De){var rt=[];if(De!=null)for(var Je in Object(De))rt.push(Je);return rt}function _t(De){if(typeof De=="string"||st(De))return De;var rt=De+"";return rt=="0"&&1/De==-1/0?"-0":rt}function Ce(De){if(De!=null){try{return L.call(De)}catch{}try{return De+""}catch{}}return""}function ot(De,rt){return De===rt||De!==De&&rt!==rt}function At(De){return Dt(De)&&M.call(De,"callee")&&(!F.call(De,"callee")||B.call(De)==r)}var wt=Array.isArray;function Ft(De){return De!=null&&Re(De.length)&&!Bt(De)}function Dt(De){return Qe(De)&&Ft(De)}function Bt(De){var rt=nt(De)?B.call(De):"";return rt==i||rt==o}function Re(De){return typeof De=="number"&&De>-1&&De%1==0&&De<=n}function nt(De){var rt=typeof De;return!!De&&(rt=="object"||rt=="function")}function Qe(De){return!!De&&typeof De=="object"}function st(De){return typeof De=="symbol"||Qe(De)&&B.call(De)==s}function Ot(De){return Ft(De)?ge(De):je(De)}var Tt=Ye(function(De,rt){return De==null?{}:(rt=g(Ve(rt),_t),qe(De,$e(Ke(De),rt)))});function Ut(){return[]}return BN=Tt,BN}var aje=sje();const lje=ii(aje),uje=C.forwardRef((e,t)=>{const{type:n,VORTEX_MAIN_URL:r,ENTITY_ID:i,TESSERACT_MAIN_URL:o,FRONTEND_URL:s,INTEGRATION_DATA:a,viewOnly:l=!1,openIntegrationDrawer:u}=e,c=pt.useDispatch(),{workflow:d}=pt.useSelector(H=>H.workflows),{source:p=""}=d,[h,A]=C.useState({}),[g,m]=C.useState([]),[E,y]=C.useState([]),[T,v]=C.useState(!1),[_,x]=C.useState(!1),[b,w]=C.useState(!1),[D,I]=C.useState(null),P=C.useRef([]),{control:k,watch:N,setValue:L,trigger:M}=Vn(),B=p?.includes("commerce_"),G=p?.split("_"),Q=G&&G.length>1?G[1]:null,K=G&&G.length>2?G.slice(2).join("_"):Q,F=N("properties"),V=N("properties.fp_auth_id"),W=async()=>{if(B)m([{name:K,id:p?.toLowerCase()||""}]),L("properties.fp_auth_id",p?.toLowerCase()||"",{shouldValidate:!0});else{v(!0);try{const{data:H}=await Kt.get(Zt(o,"/v1/integrations/entity/FYND_PLATFORM?get_form_data=true"),{params:{page_size:999,current_page:1,type:"BOTH"}});m(hs(H.data))}catch(H){An(H,c)}finally{v(!1)}}},R=async H=>{w(!0);try{const U=Zt(r,`/v1.0/${i}`,"/utility/events-config"),X=H?{id:H}:{},{data:ee}=await Kt.get(U,{params:X});P.current=ee.data.event_configs;const Z=ee.data.event_configs.map(ie=>({...ie,display_name:`${ie.display_name}_${ie.event_category}`})),le=FN(Z,"event_category"),z={application:$(le.application),company:$(le.company)};A(z)}catch(U){An(U,c)}finally{w(!1)}},$=H=>{if(!H)return{};const U={},X=FN(H,"event_name");return Object.keys(X).forEach(ee=>{const Z=FN(X[ee],"version");U[ee]=oje(Z,le=>le.map(z=>lje(z,"version"))),U[ee].versions=Object.keys(Z).map(le=>({text:`V${le}`,value:le}))}),U},j=async H=>{x(!0);try{const U=Zt(r,`/v1.0/${i}`,`/utility/applications?id=${H}`),{data:X}=await Kt.get(U);y(X?.data?.map(ee=>({id:ee.id,name:ee.name})))}catch(U){An(U,c)}finally{x(!1)}};C.useEffect(()=>{const{fp_auth_id:H}=F;H&&(p?.includes("commerce_")?R(""):R(H))},[]),C.useEffect(()=>{W()},[]),C.useEffect(()=>{a?._id&&a?.meta?.entity==="FYND_PLATFORM"&&(W(),L("properties.fp_auth_id",a._id,{shouldValidate:!0}))},[a]),C.useEffect(()=>{const{fp_auth_id:H}=F;F?.event_details?.event_category==="application"&&j(H)},[V,F?.event_details?.event_category]),C.useEffect(()=>{if(!Et(F?.event_details?.event_name)&&!Et(F?.event_details?.event_category)&&!Et(h)){const{event_name:H,event_category:U}=F?.event_details;I(h[U][H])}},[h]),C.useEffect(()=>{const H=F?.event_id;if(!H?.length||!P.current.length||F?.events?.length>0)return;const U=H.map(X=>P.current.find(ee=>ee.id===X)).filter(Boolean);U.length&&L("properties.events",U.map(X=>({slug:`${X.event_name}/${X.event_type}`})))},[h]);const Y=H=>Et(H)?[]:F.event_details?.event_category==="application"?Object.keys(H.application).map(U=>({title:U,value:U})):F.event_details?.event_category==="company"?Object.keys(H.company).map(U=>({title:U,value:U})):[],q=N("properties.version")&&!Et(D)&&D[parseFloat(N("properties.version"))]?D[parseFloat(N("properties.version"))].map(H=>({title:H.event_type,value:H.id,event_name:H.event_name,event_type:H.event_type})):[];return f.jsxs(O.Stack,{gap:2.5,children:[f.jsx(Eo,{children:f.jsx(en,{required:!0,name:"properties.fp_auth_id",control:k,meta:{options:Jr(g),displayProps:{loading:T},displayName:"Fynd Platform Account",value:"",htmlProps:{showAddNew:!0},TESSERACT_MAIN_URL:o,FRONTEND_URL:s,ENTITY_ID:i,openIntegrationDrawer:u,addNewButtonText:"Add new account",searchFieldPlaceholder:"Search Fynd Platform account",authType:"FYND_PLATFORM",description:"Fynd Platform is a secure partner with Boltic. Your credentials are encrypted & can be removed at any time.",placeholder:"Select Fynd Platform Account"},validationRules:{required:"Fynd platform account is required"},id:n,viewOnly:l||B,handleChange:H=>{const{value:U}=H;U&&(p?.includes("commerce_")?R(""):R(U))}})}),F.fp_auth_id&&f.jsx(O.Divider,{}),F.fp_auth_id&&f.jsx(qr,{children:f.jsxs(O.Grid,{container:!0,gap:1.5,children:[f.jsx(O.Grid,{item:!0,xs:12,children:f.jsxs(O.Grid,{container:!0,gap:1.5,children:[f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.event_details.event_category",control:k,meta:{options:Zle,displayName:"Event Category",searchFieldPlaceholder:"Search",placeholder:"Select Event Category",displayProps:{loading:b}},validationRules:{required:"Event category is required"},viewOnly:l,id:n,handleChange:H=>{const{value:U}=H,X=U.split("_").pop();L("properties",{...F,event_details:{...F.event_details,event_category:X,event_name:""},event_id:[],events:[],application_id:[],version:[]}),I([])}})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.event_details.event_name",control:k,meta:{options:Y(h),displayName:"Event Name",searchFieldPlaceholder:"Search",placeholder:"Select Event Name",displayProps:{loading:b}},validationRules:{required:"Event name is required"},viewOnly:l,id:n,handleChange:H=>{const{value:U}=H,X=F.event_details.event_category,ee=h[X][U].versions.length;L("properties",{...F,event_id:[],events:[],application_id:[],version:h[X][U].versions[ee-1].value}),M("properties.event_details"),I(h[X][U])}})})]})}),!Et(D?.versions)&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.version",control:k,meta:{options:D.versions.map(H=>({title:H.text,value:H.value})),displayName:"Version",searchFieldPlaceholder:"Search",placeholder:"Select Version",displayProps:{loading:b}},validationRules:{required:"Version is required"},viewOnly:l,handleChange:H=>{const{value:U}=H;L("properties",{...F,event_id:[],events:[],version:U,application_id:[]})}})}),!Et(q)&&!Et(F.event_details)&&!Et(F.version)&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.event_id",control:k,meta:{options:q,displayProps:{loading:b},displayName:"Events",searchFieldPlaceholder:"Search",placeholder:"Select Events"},renderFieldValue:H=>H.map(U=>U),validationRules:{validate:H=>H.length===0?"Events is required":!0},viewOnly:l,id:n,multiple:!0,placeholder:"Select Events",handleChange:H=>{const{value:U}=H,X=U.map(Z=>{const le=q.find(z=>z.value===Z);return{slug:`${le?.event_name}/${le?.event_type}`}});L("properties.events",X);const ee=q.find(Z=>Z.value===U?.[0]);L("properties.event_details.event_type",ee?.title)},getSelectedValue:H=>H.map(U=>q.find(X=>X.value===U)).filter(U=>U?.title)})}),F?.event_details?.event_category==="application"&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{name:"properties.application_id",control:k,meta:{options:Jr(E),displayName:"Applications",searchFieldPlaceholder:"Search",displayProps:{loading:_},placeholder:"Select Applications"},validationRules:{validate:H=>H.length===0?"Application is required":!0},multiple:!0,renderFieldValue:H=>H.map(U=>U),viewOnly:l,getSelectedValue:H=>H.map(U=>Jr(E).find(X=>X.value===U)).filter(U=>U?.title),required:!0})})]})})]})}),cje=C.forwardRef((e,t)=>{const{VORTEX_MAIN_URL:n,ENTITY_ID:r,type:i,id:o,isLoop:s=!1,suggestionsData:a,WORKFLOW_URLS:l,viewOnly:u=!1}=e,{GYRATE_MAIN_URL:c}=l,{control:d,watch:p,setValue:h,formState:{errors:A}}=Vn(),g=p("properties");return f.jsx(qr,{children:f.jsxs(O.Grid,{container:!0,gap:1.5,children:[f.jsxs(O.Grid,{item:!0,xs:12,children:[f.jsx(Nr,{required:!0,label:"Input Data"}),f.jsx(ka,{id:o,field:"input_data",type:"functionActivity",title:"Input Data",viewOnly:u,isLoop:s,hideLabel:!0,name:"properties.input_data"})]}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.language",control:d,meta:{options:Jle,displayName:"Language",searchFieldPlaceholder:"Search language",description:jr(i,"method"),placeholder:"Select language"},handleChange:()=>{h("properties.func",'return { "hello": "world" }')},validationRules:{required:"Language is required"},viewOnly:u,id:i})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.func",control:d,rules:{required:"Error: Function is required. Please review your function syntax."},render:({field:m})=>f.jsx(O.FormControl,{fullWidth:!0,children:f.jsx(_o,{...m,required:!0,suggestionLabel:"Code",id:`${i}-${g.language}-func`,activityType:i,size:"xl",viewOnly:u,showSuggestions:!0,VORTEX_MAIN_URL:n,ENTITY_ID:r,language:g.language,suggestionsData:a,showExpandOption:!0,label:"Code",helperText:f.jsxs(O.Box,{children:["Need help? Refer to the",f.jsx(O.Link,{href:g.language==="python"?`${c}/integrations/Helpers/function/#python`:`${c}/integrations/Helpers/function/#javascript`,target:"_blank",children:f.jsx("span",{children:" Function Documentation "})}),"for examples, guidelines, and troubleshooting tips to write Javascript in your workflow."]}),error:!!A.properties?.func?.message,errorMsg:A.properties?.func?.message,handleChange:m.onChange})})})}),!s&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(qi,{viewOnly:u,type:i})})]})})}),dje=Go(cje,""),fje=C.forwardRef((e,t)=>{const{control:n,watch:r,setValue:i,getValues:o}=Vn(),s=r("properties"),{TESSERACT_MAIN_URL:a,ENTITY_ID:l,VORTEX_MAIN_URL:u,FRONTEND_URL:c,type:d,openIntegrationDrawer:p,INTEGRATION_DATA:h,viewOnly:A=!1}=e,g=pt.useDispatch(),[m,E]=C.useState([]),[y,T]=C.useState([]),[v,_]=C.useState(!1),[x,b]=C.useState(!1),w=Jr(m),{isTokenRevoked:D,setTokenRevoked:I,handleReconnect:P}=Fp({credentialId:s?.secret||"",TESSERACT_MAIN_URL:a,FRONTEND_URL:c,ENTITY_ID:l,openIntegrationDrawer:p}),k=()=>{_(!0);const L={page_size:999,current_page:1,type:"SOURCE"},M=Zt(a,"/v1/integrations/entity/GMAIL");Kt.get(M,{params:L}).then(({data:B})=>{E(hs(B.data))}).catch(B=>{An(B,g)}).finally(()=>{_(!1)})};C.useEffect(()=>{k()},[]),C.useEffect(()=>{h?._id&&h?.meta?.entity==="GMAIL"&&(h?.meta?.auth_status==="ACTIVE"&&I(!1),k(),i("properties.secret",h._id,{shouldValidate:!0}))},[h]);const N=()=>{b(!0);const L=Zt(u,`/v1.0/${l}`,"/implementations/choices");Kt.post(L,{data:{secret:o("properties.secret"),operation:"get",input_field_id:"label",selected_api:"gmailAPI"}}).then(M=>{const B=M.data.data.filter(G=>G.id!=="CHAT");T(B)}).catch(M=>{An(M,g)}).finally(()=>{b(!1)})};return r("properties.label_id")&&!y.length&&T([{name:r("form.properties.label_name"),id:r("properties.label_id")}]),C.useEffect(()=>{s.secret&&s.operation&&N()},[s.secret,s.operation]),f.jsxs(O.Stack,{gap:2.5,children:[f.jsx(Eo,{children:f.jsxs(O.Grid,{container:!0,gap:1.5,children:[f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.secret",control:n,renderValueUi:L=>{const M=w.find(B=>B.value===L);return f.jsx(Mp,{isTokenRevoked:D,onReconnect:P,disabled:A,optionTitle:M?.title})},meta:{options:w,displayProps:{loading:v},displayName:"Google Account",value:"",htmlProps:{showAddNew:!0},description:"Google is a secure partner with Boltic. Your credentials are encrypted & can be removed at any time.",TESSERACT_MAIN_URL:a,FRONTEND_URL:c,ENTITY_ID:l,openIntegrationDrawer:p,addNewButtonText:"Add new account",searchFieldPlaceholder:"Search Google account",authType:"GMAIL",placeholder:"Select Google Account"},validationRules:{required:"Google account is required"},handleChange:L=>{const{field:M,value:B}=L;i("properties.label_id",""),i("properties.label_name",""),i("properties.operation",""),i(M,Et(B)?"":B),T([]),B&&I(!1)},viewOnly:A,id:"secret"})}),r("properties.secret")&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.operation",control:n,meta:{options:[{title:"New Attachment",value:"attachment"},{title:"New Email",value:"new_email"},{title:"New Starred Email",value:"starred_email"},{title:"New Thread",value:"new_thread"}],displayName:"Operation",searchFieldPlaceholder:"Search operation",description:"Select the operation that will trigger this workflow",placeholder:"Select a operation"},validationRules:{required:"Operation is required"},viewOnly:A,handleChange:L=>{const{field:M,value:B}=L;i("properties.label_id",""),i("properties.label_name",""),i("properties.filter_by",""),i("properties.filter_value",""),i(M,B)}})})]})}),f.jsx(O.Divider,{}),f.jsxs(qr,{children:[f.jsx(O.Grid,{container:!0,gap:1.5,children:f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.label_id",control:n,meta:{options:Jr(y),displayName:"Label",searchFieldPlaceholder:"Search",description:"Select inbox or all labels",displayProps:{loading:x},placeholder:"Select Label"},validationRules:{required:"Label is required"},viewOnly:A,id:d,handleChange:L=>{const{field:M,value:B}=L,G=y.find(Q=>Q.id===B);i("properties.label_name",G?.name||""),i("properties.filter_by",""),i("properties.filter_value",""),i(M,B)},onOpen:N})})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{name:"properties.filter_by",control:n,meta:{options:[{title:"From Sender",value:"from_sender"},{title:"Search Keywords",value:"search_keywords"}],displayName:"Filter by",searchFieldPlaceholder:"Search",description:"Select the field to filter by",placeholder:"Select Filter by"},viewOnly:A,id:d,handleChange:L=>{const{field:M,value:B}=L;i(M,B),i("properties.filter_value","")}})}),s.filter_by&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(Wn,{name:"properties.filter_value",control:n,meta:{displayName:s.filter_by==="from_sender"?"From Sender":"Search Keywords",description:s.filter_by==="from_sender"?"Enter the recipient email to filter by":f.jsxs(f.Fragment,{children:["Enter the search keywords to filter by. For advanced, visit"," ",f.jsx(O.Link,{href:"https://support.google.com/mail/answer/7190?hl=en",target:"_blank",rel:"noopener noreferrer",underline:"hover",children:"search operators"}),"."]}),placeholder:s.filter_by==="from_sender"?"Enter the recipient email":"Enter the search keywords"},viewOnly:A,id:d,handleChange:L=>{const{field:M,value:B}=L;i(M,B)}})})]})]})}),Bp=C.forwardRef(({id:e,type:t,isLoop:n=!1,viewOnly:r=!1,customSelectedTab:i,setCustomSelectedTab:o},s)=>{const{control:a,watch:l,setValue:u}=Vn(),{MCP_INTEGRATION_FORM:c}=_a(),d=l("properties.custom"),p=l("properties.custom.headers"),h=l("properties.custom.query_params"),A=l("properties.custom.state_params"),g=l("properties.custom.method");return C.useEffect(()=>{d&&(p&&!Array.isArray(p)&&typeof p=="object"&&u("properties.custom.headers",$c(p),{shouldValidate:!1,shouldDirty:!1}),h&&!Array.isArray(h)&&typeof h=="object"&&u("properties.custom.query_params",$c(h),{shouldValidate:!1,shouldDirty:!1}),A&&!Array.isArray(A)&&typeof A=="object"&&u("properties.custom.state_params",$c(A),{shouldValidate:!1,shouldDirty:!1}))},[d,p,h,A,u]),C.useEffect(()=>{if(c&&(g==="BOLTIC_AI"||g==="BOLTIC_AI_IGNORE"))return;const m=(p1||[]).map(T=>T.value),E=typeof g=="string"&&g.length?String(g).toLowerCase():"",y=E&&m.includes(E)?E:p1?.[0]?.value||"get";g!==y&&u("properties.custom.method",y,{shouldValidate:!1,shouldDirty:!1})},[g,u]),f.jsxs(f.Fragment,{children:[f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.custom.method",control:a,meta:{options:p1,displayName:"Method",searchFieldPlaceholder:"Search Method",placeholder:"Select Method"},validationRules:{required:"Method is required",validate:m=>m!=null&&String(m).trim()!==""?!0:"Method is required"},viewOnly:r,id:t})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(Wn,{required:!0,id:e,name:"properties.custom.endpoint",control:a,meta:{displayName:"URL",placeholder:khe(t)},validationRules:{required:"URL is required"},viewOnly:r,editorId:`${t}-custom-url-${n}`,showSuggestions:!0})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(Hs,{variant:"full-width",tabs:Cle,selectedTab:i,setSelectedTab:o})}),i==="Query Params"&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(ka,{id:e,name:"properties.custom.query_params",field:"query_params",type:t,title:"Query Params",viewOnly:r,isLoop:n})}),i==="State Params"&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(ka,{id:e,name:"properties.custom.state_params",field:"state_params",type:t,title:"State Params",viewOnly:r,isLoop:n})}),i==="Headers"&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(ka,{id:e,name:"properties.custom.headers",field:"headers",type:t,title:"Headers",viewOnly:r,isLoop:n})}),i==="Body"&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(ka,{id:e,name:"properties.custom.body",field:"body",type:t,title:"Body",viewOnly:r,isLoop:n,showKeyValuePair:!1})})]})});Bp.displayName="CustomApiSection";const $Y=t6,FA=(e,t,n={},r=ps.CUSTOM)=>{const i=e("properties")||{},o=i?.event===r||i?.operation===r||i?.mode===r,s=()=>{if(!o)return;const m=i?.custom||{},E={...$Y,...n,...m,headers:Array.isArray(m.headers)?m.headers:$c(m.headers||{}),query_params:Array.isArray(m.query_params)?m.query_params:$c(m.query_params||{}),state_params:Array.isArray(m.state_params)?m.state_params:$c(m.state_params||{})};JSON.stringify(m)!==JSON.stringify(E)&&t("properties.custom",E,{shouldValidate:!1,shouldDirty:!0})};C.useEffect(()=>{if(!o)return;const m=i?.custom||{};if(m.headers&&!Array.isArray(m.headers)||m.query_params&&!Array.isArray(m.query_params)||m.state_params&&!Array.isArray(m.state_params)||!m.method&&!m.endpoint){const y={...$Y,...n,...m,headers:Array.isArray(m.headers)?m.headers:$c(m.headers||{}),query_params:Array.isArray(m.query_params)?m.query_params:$c(m.query_params||{}),state_params:Array.isArray(m.state_params)?m.state_params:$c(m.state_params||{})};t("properties.custom",y,{shouldValidate:!1,shouldDirty:!0})}},[o,t,JSON.stringify(n||{}),JSON.stringify(i?.custom||{})]);const a=(m,E)=>{const T={...i?.custom||{},[m]:E};t("properties.custom",T,{shouldValidate:!1,shouldDirty:!0})};return{isCustom:o,properties:i,ensureDefaults:s,setMethod:m=>a("method",m),setEndpoint:m=>a("endpoint",m),setHeaders:m=>a("headers",m),setQueryParams:m=>a("query_params",m),setStateParams:m=>a("state_params",m),setBody:m=>a("body",m),getApiData:()=>{const m=i?.custom||{};return{...m,headers:Bc(m.headers||[]),query_params:Bc(m.query_params||[]),state_params:Bc(m.state_params||[])}},convertToApiFormat:()=>{const m=i?.custom||{},E={...m,headers:Bc(m.headers||[]),query_params:Bc(m.query_params||[]),state_params:Bc(m.state_params||[])};t("properties.custom",E,{shouldValidate:!1,shouldDirty:!0})}}},pje=C.forwardRef((e,t)=>{const n=pt.useDispatch(),r=O.useTheme(),{control:i,watch:o,setValue:s,getValues:a,formState:{errors:l}}=Vn(),u=o("properties");FA(o,s,{},"custom");const{ENTITY_ID:c,TESSERACT_MAIN_URL:d,FRONTEND_URL:p,type:h,id:A,isLoop:g=!1,suggestionsData:m,INTEGRATION_DATA:E,VORTEX_MAIN_URL:y,viewOnly:T=!1,openIntegrationDrawer:v,MCP_INTEGRATION_FORM:_=!1}=e,{loopSuggestionsData:x={}}=pt.useSelector(F=>F.loopActivity),[b,w]=C.useState([]),[D,I]=C.useState(!1),[P,k]=C.useState("Query Params"),N=Jr(b),{isTokenRevoked:L,setTokenRevoked:M,handleReconnect:B}=Fp({credentialId:u?.gmail_config_id||"",TESSERACT_MAIN_URL:d,FRONTEND_URL:p,ENTITY_ID:c,openIntegrationDrawer:v}),G=()=>{I(!0);const F={page_size:999,current_page:1,type:"BOTH"},V=Zt(d,"/v1/integrations/entity/GMAIL");Kt.get(V,{params:F}).then(({data:W})=>{w(hs(W.data))}).catch(W=>{An(W,n)}).finally(()=>{I(!1)})};C.useEffect(()=>{G()},[]),C.useEffect(()=>{E?._id&&E?.meta?.entity==="GMAIL"&&(E?.meta?.auth_status==="ACTIVE"&&M(!1),G(),s("properties.gmail_config_id",E._id,{shouldValidate:!0}))},[E]);const Q=F=>{s(`properties.${F}`,[...a(`properties.${F}`)||[],""])},K=u?.attachments==="BOLTIC_AI_IGNORE"||u?.attachments==="BOLTIC_AI";return f.jsxs(O.Stack,{gap:2.5,children:[f.jsx(Eo,{children:f.jsxs(O.Grid,{container:!0,gap:1.5,children:[f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.gmail_config_id",control:i,renderValueUi:F=>{const V=N.find(W=>W.value===F);return f.jsx(Mp,{isTokenRevoked:L,onReconnect:B,disabled:T,optionTitle:V?.title})},meta:{options:N,displayProps:{loading:D},displayName:"Google Account",value:"",htmlProps:{showAddNew:!0},TESSERACT_MAIN_URL:d,FRONTEND_URL:p,ENTITY_ID:c,openIntegrationDrawer:v,addNewButtonText:"Add new account",searchFieldPlaceholder:"Search Google account",authType:"GMAIL",description:"Google is a secure partner with Boltic. Your credentials are encrypted & can be removed at any time.",placeholder:"Select Google Account"},validationRules:{required:"Google account is required"},handleChange:F=>{F.value&&M(!1)},viewOnly:T,id:h})}),u.gmail_config_id&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(O.FormControl,{fullWidth:!0,children:f.jsx(en,{name:"properties.operation",control:i,meta:{options:pue,displayName:"Operation",searchFieldPlaceholder:"Search operation",description:"Select operation to be performed",placeholder:"Select a operation"},validationRules:{required:"Operation is required"},viewOnly:T,required:!0})})})]})}),u.gmail_config_id&&u.operation&&f.jsx(O.Divider,{}),u.gmail_config_id&&u.operation&&f.jsx(qr,{children:f.jsxs(O.Grid,{container:!0,gap:1.5,children:[u.operation!=="custom"&&f.jsxs(f.Fragment,{children:[f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(Wn,{required:!0,id:A,name:"properties.subject",control:i,meta:{displayName:"Subject",placeholder:"Type or add suggestion",description:"Enter the subject to send in the email."},validationRules:{required:"Subject is required"},viewOnly:T,editorId:`${h}-subject-${g}`,showSuggestions:!0,isLoop:g})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.email_template",control:i,rules:{required:"Email body is required"},render:({field:F})=>f.jsx(_o,{...F,label:"Email body",suggestionLabel:"Email body",id:`${h}-gmail_template`,activityType:h,VORTEX_MAIN_URL:y,ENTITY_ID:c,viewOnly:T,size:"md",showSuggestions:!0,language:"html",suggestionsData:g?x:m,showExpandOption:!0,showHtmlPreview:!0,helperText:f.jsxs(O.Box,{children:["Enter body to send in the email. Create dynamic web templates easily using Nunjucks. see",f.jsx(O.Link,{href:"https://mozilla.github.io/nunjucks/",target:"_blank",children:" Nunjucks Docs"})]}),errorMsg:l.properties?.email_template?.message,error:!!l.properties?.email_template?.message,handleChange:V=>{F.onChange(V)},required:!0})})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.to",control:i,rules:{required:_?!1:"To is required",validate:F=>_&&dm(F)?!0:Array.isArray(F)&&!F.every(W=>Pu(W))?"To must have all the valid emails":!0},render:({field:F})=>f.jsx(Ed,{...F,required:!0,nodeId:A,label:"To",isLoop:g,viewOnly:T,name:"properties.to",placeholder:"Enter email",onChange:V=>{F.onChange(typeof V=="string"?V:[...V])},errorMsg:l.properties?.to?.message})})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.cc",control:i,rules:{validate:F=>_&&dm(F)?!0:Array.isArray(F)&&!F.every(W=>Pu(W))?"Cc must have all the valid emails":!0},render:({field:F})=>f.jsx(Ed,{...F,nodeId:A,label:"Cc",name:"properties.cc",isLoop:g,viewOnly:T,placeholder:"Enter email",onChange:V=>{F.onChange(typeof V=="string"?V:[...V])}})})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.bcc",control:i,rules:{validate:F=>_&&dm(F)?!0:Array.isArray(F)&&!F.every(W=>Pu(W))?"Bcc must have all the valid emails":!0},render:({field:F})=>f.jsx(Ed,{...F,nodeId:A,label:"Bcc",isLoop:g,name:"properties.bcc",placeholder:"Enter email",viewOnly:T,onChange:V=>{F.onChange(typeof V=="string"?V:[...V])},errorMsg:l.properties?.bcc?.message})})}),f.jsxs(O.Grid,{item:!0,xs:12,children:[f.jsxs(O.Box,{sx:{...Di,"& > .MuiStack-root > .MuiStack-root":{pb:0}},children:[f.jsx(Nr,{label:"Attachments",description:"The maximum attachment limit is 25Mb"}),!K&&f.jsx(O.IconButton,{onClick:()=>Q("attachments"),sx:{float:"right",p:.75,border:F=>`1px solid ${F.palette.grey.brainstem}`,fontSize:F=>F.typography.mdNormal.fontSize},color:"primary",children:f.jsx(Fe,{src:"ic_plus",sx:{path:{fill:r.palette.primary.main}}})})]}),f.jsx(MN,{nodeId:A,type:h,isLoop:g,field:"properties.attachments"})]})]}),u.operation==="custom"&&f.jsx(Bp,{id:A,type:h,isLoop:g,viewOnly:T,customSelectedTab:P,setCustomSelectedTab:k}),!_&&!g&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(qi,{viewOnly:T,type:h})})]})})]})}),hje=Go(pje,"");process.env.NODE_ENV!=="production"&&(S.node,S.object.isRequired);function Yr(e){return Kfe(e)}function Aje(e){return _n("MuiDivider",e)}const jY=vn("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),mje=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],gje=e=>{const{absolute:t,children:n,classes:r,flexItem:i,light:o,orientation:s,textAlign:a,variant:l}=e;return wn({root:["root",t&&"absolute",l,o&&"light",s==="vertical"&&"vertical",i&&"flexItem",n&&"withChildren",n&&s==="vertical"&&"withChildrenVertical",a==="right"&&s!=="vertical"&&"textAlignRight",a==="left"&&s!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",s==="vertical"&&"wrapperVertical"]},Aje,r)},Eje=St("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,n.orientation==="vertical"&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&n.orientation==="vertical"&&t.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&t.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&t.textAlignLeft]}})(({theme:e,ownerState:t})=>ce({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin"},t.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},t.light&&{borderColor:e.vars?`rgba(${e.vars.palette.dividerChannel} / 0.08)`:hi.alpha(e.palette.divider,.08)},t.variant==="inset"&&{marginLeft:72},t.variant==="middle"&&t.orientation==="horizontal"&&{marginLeft:e.spacing(2),marginRight:e.spacing(2)},t.variant==="middle"&&t.orientation==="vertical"&&{marginTop:e.spacing(1),marginBottom:e.spacing(1)},t.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},t.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:e})=>ce({},e.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:e,ownerState:t})=>ce({},t.children&&t.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:"inherit"}}),({theme:e,ownerState:t})=>ce({},t.children&&t.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:"inherit"}}),({ownerState:e})=>ce({},e.textAlign==="right"&&e.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},e.textAlign==="left"&&e.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),Oje=St("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.wrapper,n.orientation==="vertical"&&t.wrapperVertical]}})(({theme:e,ownerState:t})=>ce({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`},t.orientation==="vertical"&&{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`})),yS=ye.forwardRef(function(t,n){const r=Yr({props:t,name:"MuiDivider"}),{absolute:i=!1,children:o,className:s,component:a=o?"div":"hr",flexItem:l=!1,light:u=!1,orientation:c="horizontal",role:d=a!=="hr"?"separator":void 0,textAlign:p="center",variant:h="fullWidth"}=r,A=Ct(r,mje),g=ce({},r,{absolute:i,component:a,flexItem:l,light:u,orientation:c,role:d,textAlign:p,variant:h}),m=gje(g);return f.jsx(Eje,ce({as:a,className:tn(m.root,s),role:d,ref:n,ownerState:g},A,{children:o?f.jsx(Oje,{className:m.wrapper,ownerState:g,children:o}):null}))});yS.muiSkipListHighlight=!0,process.env.NODE_ENV!=="production"&&(yS.propTypes={absolute:S.bool,children:S.node,classes:S.object,className:S.string,component:S.elementType,flexItem:S.bool,light:S.bool,orientation:S.oneOf(["horizontal","vertical"]),role:S.string,sx:S.oneOfType([S.arrayOf(S.oneOfType([S.func,S.object,S.bool])),S.func,S.object]),textAlign:S.oneOf(["center","left","right"]),variant:S.oneOfType([S.oneOf(["fullWidth","inset","middle"]),S.string])});const Ac=(e,t)=>e.length!==t.length?!1:t.every(n=>e.includes(n)),yje=({openTo:e,defaultOpenTo:t,views:n,defaultViews:r})=>{const i=n??r;let o;if(e!=null)o=e;else if(i.includes(t))o=t;else if(i.length>0)o=i[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:i,openTo:o}},TS=(e,t,n)=>{let r=t;return r=e.setHours(r,e.getHours(n)),r=e.setMinutes(r,e.getMinutes(n)),r=e.setSeconds(r,e.getSeconds(n)),r=e.setMilliseconds(r,e.getMilliseconds(n)),r},Zg=({date:e,disableFuture:t,disablePast:n,maxDate:r,minDate:i,isDateDisabled:o,utils:s,timezone:a})=>{const l=TS(s,s.date(void 0,a),e);n&&s.isBefore(i,l)&&(i=l),t&&s.isAfter(r,l)&&(r=l);let u=e,c=e;for(s.isBefore(e,i)&&(u=i,c=null),s.isAfter(e,r)&&(c&&(c=r),u=null);u||c;){if(u&&s.isAfter(u,r)&&(u=null),c&&s.isBefore(c,i)&&(c=null),u){if(!o(u))return u;u=s.addDays(u,1)}if(c){if(!o(c))return c;c=s.addDays(c,-1)}}return null},Tje=(e,t)=>t==null||!e.isValid(t)?null:t,$l=(e,t,n)=>t==null||!e.isValid(t)?n:t,vje=(e,t,n)=>!e.isValid(t)&&t!=null&&!e.isValid(n)&&n!=null?!0:e.isEqual(t,n),$N=(e,t)=>{const r=[e.startOfYear(t)];for(;r.length<12;){const i=r[r.length-1];r.push(e.addMonths(i,1))}return r},jN=(e,t,n)=>n==="date"?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),Od=(e,t)=>{const n=e.setHours(e.date(),t==="am"?2:14);return e.format(n,"meridiem")},Sje=["year","month","day"],BA=e=>Sje.includes(e),UY=(e,{format:t,views:n},r)=>{if(t!=null)return t;const i=e.formats;return Ac(n,["year"])?i.year:Ac(n,["month"])?i.month:Ac(n,["day"])?i.dayOfMonth:Ac(n,["month","year"])?`${i.month} ${i.year}`:Ac(n,["day","month"])?`${i.month} ${i.dayOfMonth}`:i.keyboardDate},xje=(e,t)=>{const n=e.startOfWeek(t);return[0,1,2,3,4,5,6].map(r=>e.addDays(n,r))},HY=["hours","minutes","seconds"],$A=e=>HY.includes(e),Jg=e=>HY.includes(e)||e==="meridiem",bje=(e,t)=>e?t.getHours(e)>=12?"pm":"am":null,eE=(e,t,n)=>n&&(e>=12?"pm":"am")!==t?t==="am"?e-12:e+12:e,Cje=(e,t,n,r)=>{const i=eE(r.getHours(e),t,n);return r.setHours(e,i)},VY=(e,t)=>t.getHours(e)*3600+t.getMinutes(e)*60+t.getSeconds(e),tE=(e,t)=>(n,r)=>e?t.isAfter(n,r):VY(n,t)>VY(r,t),GY=(e,{format:t,views:n,ampm:r})=>{if(t!=null)return t;const i=e.formats;return Ac(n,["hours"])?r?`${i.hours12h} ${i.meridiem}`:i.hours24h:Ac(n,["minutes"])?i.minutes:Ac(n,["seconds"])?i.seconds:Ac(n,["minutes","seconds"])?`${i.minutes}:${i.seconds}`:Ac(n,["hours","minutes","seconds"])?r?`${i.hours12h}:${i.minutes}:${i.seconds} ${i.meridiem}`:`${i.hours24h}:${i.minutes}:${i.seconds}`:r?`${i.hours12h}:${i.minutes} ${i.meridiem}`:`${i.hours24h}:${i.minutes}`},yu={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},_je=e=>Math.max(...e.map(t=>yu[t.type]??1)),nE=(e,t,n)=>{if(t===yu.year)return e.startOfYear(n);if(t===yu.month)return e.startOfMonth(n);if(t===yu.day)return e.startOfDay(n);let r=n;return t<yu.minutes&&(r=e.setMinutes(r,0)),t<yu.seconds&&(r=e.setSeconds(r,0)),t<yu.milliseconds&&(r=e.setMilliseconds(r,0)),r},wje=({props:e,utils:t,granularity:n,timezone:r,getTodayDate:i})=>{let o=i?i():nE(t,n,jN(t,r));e.minDate!=null&&t.isAfterDay(e.minDate,o)&&(o=nE(t,n,e.minDate)),e.maxDate!=null&&t.isBeforeDay(e.maxDate,o)&&(o=nE(t,n,e.maxDate));const s=tE(e.disableIgnoringDatePartForTimeValidation??!1,t);return e.minTime!=null&&s(e.minTime,o)&&(o=nE(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:TS(t,o,e.minTime))),e.maxTime!=null&&s(o,e.maxTime)&&(o=nE(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:TS(t,o,e.maxTime))),o},UN=(e,t)=>{const n=e.formatTokenMap[t];if(n==null)throw new Error([`MUI X: The token "${t}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(`
522
+ `)+" "+j[1]:j[0]+$+" "+R.join(", ")+" "+j[1]}function v(R){return Array.isArray(R)}i.isArray=v;function _(R){return typeof R=="boolean"}i.isBoolean=_;function x(R){return R===null}i.isNull=x;function b(R){return R==null}i.isNullOrUndefined=b;function w(R){return typeof R=="number"}i.isNumber=w;function D(R){return typeof R=="string"}i.isString=D;function I(R){return typeof R=="symbol"}i.isSymbol=I;function P(R){return R===void 0}i.isUndefined=P;function k(R){return N(R)&&Q(R)==="[object RegExp]"}i.isRegExp=k;function N(R){return typeof R=="object"&&R!==null}i.isObject=N;function L(R){return N(R)&&Q(R)==="[object Date]"}i.isDate=L;function M(R){return N(R)&&(Q(R)==="[object Error]"||R instanceof Error)}i.isError=M;function B(R){return typeof R=="function"}i.isFunction=B;function G(R){return R===null||typeof R=="boolean"||typeof R=="number"||typeof R=="string"||typeof R=="symbol"||typeof R>"u"}i.isPrimitive=G,i.isBuffer=n("./support/isBuffer");function Q(R){return Object.prototype.toString.call(R)}function K(R){return R<10?"0"+R.toString(10):R.toString(10)}var F=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V(){var R=new Date,$=[K(R.getHours()),K(R.getMinutes()),K(R.getSeconds())].join(":");return[R.getDate(),F[R.getMonth()],$].join(" ")}i.log=function(){},i.inherits=n("inherits"),i._extend=function(R,$){if(!$||!N($))return R;for(var j=Object.keys($),Y=j.length;Y--;)R[j[Y]]=$[j[Y]];return R};function W(R,$){return Object.prototype.hasOwnProperty.call(R,$)}}).call(this,n("_process"),typeof jn<"u"?jn:typeof self<"u"?self:typeof window<"u"?window:{})},{"./support/isBuffer":10,_process:14,inherits:9}],12:[function(n,r,i){},{}],13:[function(n,r,i){(function(o){function s(c,d){for(var p=0,h=c.length-1;h>=0;h--){var A=c[h];A==="."?c.splice(h,1):A===".."?(c.splice(h,1),p++):p&&(c.splice(h,1),p--)}if(d)for(;p--;p)c.unshift("..");return c}i.resolve=function(){for(var c="",d=!1,p=arguments.length-1;p>=-1&&!d;p--){var h=p>=0?arguments[p]:o.cwd();if(typeof h!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!h)continue;c=h+"/"+c,d=h.charAt(0)==="/"}return c=s(l(c.split("/"),function(A){return!!A}),!d).join("/"),(d?"/":"")+c||"."},i.normalize=function(c){var d=i.isAbsolute(c),p=u(c,-1)==="/";return c=s(l(c.split("/"),function(h){return!!h}),!d).join("/"),!c&&!d&&(c="."),c&&p&&(c+="/"),(d?"/":"")+c},i.isAbsolute=function(c){return c.charAt(0)==="/"},i.join=function(){var c=Array.prototype.slice.call(arguments,0);return i.normalize(l(c,function(d,p){if(typeof d!="string")throw new TypeError("Arguments to path.join must be strings");return d}).join("/"))},i.relative=function(c,d){c=i.resolve(c).substr(1),d=i.resolve(d).substr(1);function p(T){for(var v=0;v<T.length&&T[v]==="";v++);for(var _=T.length-1;_>=0&&T[_]==="";_--);return v>_?[]:T.slice(v,_-v+1)}for(var h=p(c.split("/")),A=p(d.split("/")),g=Math.min(h.length,A.length),m=g,E=0;E<g;E++)if(h[E]!==A[E]){m=E;break}for(var y=[],E=m;E<h.length;E++)y.push("..");return y=y.concat(A.slice(m)),y.join("/")},i.sep="/",i.delimiter=":",i.dirname=function(c){if(typeof c!="string"&&(c=c+""),c.length===0)return".";for(var d=c.charCodeAt(0),p=d===47,h=-1,A=!0,g=c.length-1;g>=1;--g)if(d=c.charCodeAt(g),d===47){if(!A){h=g;break}}else A=!1;return h===-1?p?"/":".":p&&h===1?"/":c.slice(0,h)};function a(c){typeof c!="string"&&(c=c+"");var d=0,p=-1,h=!0,A;for(A=c.length-1;A>=0;--A)if(c.charCodeAt(A)===47){if(!h){d=A+1;break}}else p===-1&&(h=!1,p=A+1);return p===-1?"":c.slice(d,p)}i.basename=function(c,d){var p=a(c);return d&&p.substr(-1*d.length)===d&&(p=p.substr(0,p.length-d.length)),p},i.extname=function(c){typeof c!="string"&&(c=c+"");for(var d=-1,p=0,h=-1,A=!0,g=0,m=c.length-1;m>=0;--m){var E=c.charCodeAt(m);if(E===47){if(!A){p=m+1;break}continue}h===-1&&(A=!1,h=m+1),E===46?d===-1?d=m:g!==1&&(g=1):d!==-1&&(g=-1)}return d===-1||h===-1||g===0||g===1&&d===h-1&&d===p+1?"":c.slice(d,h)};function l(c,d){if(c.filter)return c.filter(d);for(var p=[],h=0;h<c.length;h++)d(c[h],h,c)&&p.push(c[h]);return p}var u="ab".substr(-1)==="b"?function(c,d,p){return c.substr(d,p)}:function(c,d,p){return d<0&&(d=c.length+d),c.substr(d,p)}}).call(this,n("_process"))},{_process:14}],14:[function(n,r,i){var o=r.exports={},s,a;function l(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?s=setTimeout:s=l}catch{s=l}try{typeof clearTimeout=="function"?a=clearTimeout:a=u}catch{a=u}})();function c(v){if(s===setTimeout)return setTimeout(v,0);if((s===l||!s)&&setTimeout)return s=setTimeout,setTimeout(v,0);try{return s(v,0)}catch{try{return s.call(null,v,0)}catch{return s.call(this,v,0)}}}function d(v){if(a===clearTimeout)return clearTimeout(v);if((a===u||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(v);try{return a(v)}catch{try{return a.call(null,v)}catch{return a.call(this,v)}}}var p=[],h=!1,A,g=-1;function m(){!h||!A||(h=!1,A.length?p=A.concat(p):g=-1,p.length&&E())}function E(){if(!h){var v=c(m);h=!0;for(var _=p.length;_;){for(A=p,p=[];++g<_;)A&&A[g].run();g=-1,_=p.length}A=null,h=!1,d(v)}}o.nextTick=function(v){var _=new Array(arguments.length-1);if(arguments.length>1)for(var x=1;x<arguments.length;x++)_[x-1]=arguments[x];p.push(new y(v,_)),p.length===1&&!h&&c(E)};function y(v,_){this.fun=v,this.array=_}y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={};function T(){}o.on=T,o.addListener=T,o.once=T,o.off=T,o.removeListener=T,o.removeAllListeners=T,o.emit=T,o.prependListener=T,o.prependOnceListener=T,o.listeners=function(v){return[]},o.binding=function(v){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(v){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],15:[function(n,r,i){var o=n("escodegen").generate;r.exports=function(a,l,u){u||(u={});var c=!u.allowAccessToMethodsOnFunctions;l||(l={});var d={},p=(function h(A,g){if(A.type==="Literal")return A.value;if(A.type==="UnaryExpression"){var m=h(A.argument,g);return A.operator==="+"?+m:A.operator==="-"?-m:A.operator==="~"?~m:A.operator==="!"?!m:d}else if(A.type==="ArrayExpression"){for(var E=[],y=0,T=A.elements.length;y<T;y++){var v=h(A.elements[y],g);if(v===d)return d;E.push(v)}return E}else if(A.type==="ObjectExpression"){for(var _={},y=0;y<A.properties.length;y++){var x=A.properties[y],b=x.value===null?x.value:h(x.value,g);if(b===d)return d;_[x.key.value||x.key.name]=b}return _}else if(A.type==="BinaryExpression"||A.type==="LogicalExpression"){var w=A.operator;if(w==="&&"){var T=h(A.left);if(T===d)return d;if(!T)return T;var D=h(A.right);return D===d?d:D}else if(w==="||"){var T=h(A.left);if(T===d)return d;if(T)return T;var D=h(A.right);return D===d?d:D}var T=h(A.left,g);if(T===d)return d;var D=h(A.right,g);return D===d?d:w==="=="?T==D:w==="==="?T===D:w==="!="?T!=D:w==="!=="?T!==D:w==="+"?T+D:w==="-"?T-D:w==="*"?T*D:w==="/"?T/D:w==="%"?T%D:w==="<"?T<D:w==="<="?T<=D:w===">"?T>D:w===">="?T>=D:w==="|"?T|D:w==="&"?T&D:w==="^"?T^D:d}else{if(A.type==="Identifier")return{}.hasOwnProperty.call(l,A.name)?l[A.name]:d;if(A.type==="ThisExpression")return{}.hasOwnProperty.call(l,"this")?l.this:d;if(A.type==="CallExpression"){var I=h(A.callee,g);if(I===d||typeof I!="function")return d;var P=A.callee.object?h(A.callee.object,g):d;P===d&&(P=null);for(var k=[],y=0,T=A.arguments.length;y<T;y++){var v=h(A.arguments[y],g);if(v===d)return d;k.push(v)}return g?void 0:I.apply(P,k)}else if(A.type==="MemberExpression"){var _=h(A.object,g);if(_===d||typeof _=="function"&&c)return d;if(A.property.type==="Identifier"&&!A.computed)return s(A.property.name)?d:_[A.property.name];var x=h(A.property,g);return x===null||x===d||s(x)?d:_[x]}else if(A.type==="ConditionalExpression"){var m=h(A.test,g);return m===d?d:m?h(A.consequent):h(A.alternate,g)}else if(A.type==="ExpressionStatement"){var m=h(A.expression,g);return m===d?d:m}else{if(A.type==="ReturnStatement")return h(A.argument,g);if(A.type==="FunctionExpression"){var N=A.body.body,L={};Object.keys(l).forEach(function(R){L[R]=l[R]});for(var y=0;y<A.params.length;y++){var M=A.params[y];if(M.type=="Identifier")l[M.name]=null;else return d}for(var y in N)if(h(N[y],!0)===d)return d;l=L;var B=Object.keys(l),G=B.map(function(R){return l[R]});return Function(B.join(", "),"return "+o(A)).apply(null,G)}else if(A.type==="TemplateLiteral"){for(var Q="",y=0;y<A.expressions.length;y++)Q+=h(A.quasis[y],g),Q+=h(A.expressions[y],g);return Q+=h(A.quasis[y],g),Q}else if(A.type==="TaggedTemplateExpression"){var K=h(A.tag,g),F=A.quasi,V=F.quasis.map(h),W=F.expressions.map(h);return K.apply(null,[V].concat(W))}else return A.type==="TemplateElement"?A.value.cooked:d}}})(a);return p===d?void 0:p};function s(a){return a==="constructor"||a==="__proto__"}},{escodegen:12}],jsonpath:[function(n,r,i){r.exports=n("./lib/index")},{"./lib/index":5}]},{},["jsonpath"])("jsonpath")})})(RN)),RN.exports}var B$e=F$e();const $$e=ii(B$e),j$e=e=>{try{return M$e(e),!0}catch(t){return t}},U$e=e=>{try{return $$e.query({},e),!0}catch(t){return t}},H$e=C.forwardRef((e,t)=>{const{type:n,isLoop:r,suggestionsData:i,id:o,viewOnly:s=!1}=e,{loopSuggestionsData:a={}}=pt.useSelector(m=>m.loopActivity),{watch:l,control:u,setValue:c,formState:{errors:d}}=Vn(),p=l("properties.from_type"),h=l("properties.to_type"),A=tue.filter(m=>!!m.visibleKey.find(E=>E===p)),g=m=>m==="json"?"json":m==="xml"?"xml":"html";return C.useEffect(()=>{h===""&&c("properties.query","")},[h]),f.jsx(qr,{children:f.jsxs(O.Grid,{container:!0,gap:1.5,children:[f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{name:"properties.from_type",control:u,meta:{options:eue,displayName:"Convert from",searchFieldPlaceholder:"Search",description:"Choose the type of data you are starting with.",placeholder:"Select Convert from"},validationRules:{required:"Convert from is required"},handleChange:()=>{c("properties.to_type","")},viewOnly:s,required:!0})}),p&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.data",control:u,rules:{required:"Data is required"},render:({field:m})=>f.jsx(_o,{...m,label:"Data",showSuggestions:!0,suggestionsData:r?a:i,id:`${n}-data`,size:"md",suggestionLabel:"Data",viewOnly:s,language:g(p?.toLowerCase()),showHtmlPreview:p?.toLowerCase()?.includes("html"),placeholder:"Enter the input data to be converted.",handleChange:E=>m.onChange(E),showExpandOption:!0,error:!!d.properties?.data?.message,errorMsg:d.properties?.data?.message,helperText:"Paste or enter the input data to be converted.",required:!0})})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{name:"properties.to_type",control:u,meta:{options:A,displayName:"Convert to",searchFieldPlaceholder:"Search",description:"Choose the type you want to convert the data into.",placeholder:"Select Convert to"},validationRules:{required:"Convert to is required"},viewOnly:s,required:!0})}),h==="jsonata"&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.query",control:u,rules:{validate:m=>m&&j$e(m)!==!0?"Error in JSONata expression. Please check the expression's syntax.":!0},render:({field:m})=>f.jsx(_o,{...m,language:"javascript",suggestionLabel:"Query",placeholder:"Enter a JSONata / JSONPath query to transform the data",size:"md",suggestionsData:r?a:i,id:`${n}-query2`,showSuggestions:!0,viewOnly:s,handleChange:E=>{Et(E)||m.onChange(E)},label:"Query",helperText:"To know more about how to use jsonata, visit https://docs.jsonata.org/overview.html.",showExpandOption:!0,error:!!d.properties?.query?.message,errorMsg:d.properties?.query?.message})})}),h==="jsonpath"&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.query",control:u,rules:{validate:m=>m&&U$e(m)!==!0?"Error in JSONPath expression. Please check the expression's syntax.":!0},render:({field:m})=>f.jsx(_o,{...m,language:"javascript",placeholder:"Enter a JSONata / JSONPath query to transform the data",size:"md",suggestionsData:r?a:i,id:`${n}-query`,showSuggestions:!0,viewOnly:s,handleChange:E=>{Et(E)||m.onChange(E)},suggestionLabel:"Query",label:"Query",helperText:"To know more about how to use JSONPath, visit https://goessner.net/articles/JsonPath/",error:!!d.properties?.query?.message,errorMsg:d.properties?.query?.message,showExpandOption:!0})})}),h==="graphql"&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(Wn,{id:o,name:"properties.query_options",control:u,meta:{displayName:"Query Options",description:"Provide GraphQL-specific options if your query needs them.",placeholder:"Specify Query Options"},viewOnly:s,editorId:`${n}-query_options`})}),!r&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(qi,{viewOnly:s,type:n})})]})})}),V$e=Go(H$e,"");var os=(e=>(e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.OBJECT="object",e.ARRAY="array",e.NULL="null",e))(os||{});const CY={string:"",boolean:!0,number:0,object:{},array:[],null:[]},_Y=e=>e?.jsonGui??Pb.colors.jsonGui,PN=e=>{const t=_Y(e);return[{value:"string",label:"abc",color:t.string,icon:"ic_string",name:"String"},{value:"number",label:"123",color:t.number,icon:"ic_number",name:"Number"},{value:"boolean",label:"true",color:t.boolean,icon:"ic_boolean",name:"Boolean"},{value:"array",label:"[]",color:t.array,icon:"ic_array",name:"Array"},{value:"object",label:"{}",color:t.object,icon:"ic_object",name:"Object"},{value:"null",label:"null",color:t.null,icon:"ic_null",name:"Null"}]},wY=e=>{const t=_Y(e);return[{value:"string",label:"abc",color:t.string,icon:"ic_string",name:"String"},{value:"number",label:"123",color:t.number,icon:"ic_number",name:"Number"},{value:"boolean",label:"true",color:t.boolean,icon:"ic_boolean",name:"Boolean"},{value:"null",label:"null",color:t.null,icon:"ic_null",name:"Null"}]};PN(null),wY(null);const OS=e=>Object.prototype.toString.call(e).match(/\w+/g)?.[1].toLowerCase(),IY=(e,t,n)=>{const r=e.shift(),i=Object.keys(t);if(e.length)return IY(e,t[i[r]],n);t[i[r]]=n},DY=(e,t,n)=>(IY(t,n,e),n),RY=e=>e.split("-").slice(1),G$e=e=>e&&typeof e=="object",qg=C.createContext(null),NN=e=>{const{setEditObject:t,editObject:n,setTempData:r}=C.useContext(qg),i=O.useTheme(),o=PN(i.palette),{uniqueKey:s,sourceData:a,id:l,showSuggestions:u,excludePayloadSuggestions:c=!1,onChange:d,setIsEditing:p}=e,h=Array.isArray(a),[A,g]=C.useState({}),[m,E]=C.useState({}),[y,T]=C.useState(""),v={fontSize:"18px",marginRight:"5px"},_=(N,L)=>{m[N]=L,A[N]={},T(""),g({...A}),E({...m}),p?.(!0),r(L?M=>({...M,"":""}):M=>{const B={...M};return delete B[""],B})},x=()=>{g({}),E({}),T("")};C.useEffect(()=>{x()},[h]);const b=(N,L)=>{const M=N.target.value.trim();A[L].key=M,g({...A});const B=TN(M,a);T(B)},w=(N,L)=>{A[N].value=L,g({...A})},D=(N,L)=>{A[N].type=L,A[N].value=CY[L],g({...A})},I=(N,L)=>{switch(L){case os.NULL:return null;case os.BOOLEAN:return typeof N=="string"?N==="true":!!N;case os.NUMBER:return Number(N);case os.STRING:return String(N||"");default:return N||""}},P=(N,L)=>{const M=A[N];if(!M)return;const{key:B,value:G,type:Q}=M,F=Q===os.OBJECT||Q===os.ARRAY?Q===os.ARRAY?[]:{}:I(G,Q);if(!h){const V=TN(B,L);if(V){T(V);return}}h?L.push(F):L[B]=F,t({...n}),x(),r?.({...n}),p?.(!1)},k=N=>{switch(N){case os.STRING:return f.jsx(O.Stack,{width:"150px",children:f.jsx(bo,{viewOnly:e.viewOnly,fullWidth:!0,onChange:L=>w(s,L.target.value),showSuggestion:u,id:l,placeholder:"value",editorId:`${l}-${N}-${s}`,"data-testid":`${l}-${N}-${s}`,excludePayloadSuggestions:c})});case os.NUMBER:return f.jsx(O.Stack,{width:"150px",ml:-1.5,children:f.jsx(bo,{viewOnly:e.viewOnly,fullWidth:!0,type:"number",placeholder:"value",autoComplete:"off",onChange:L=>w(s,+L.target.value),"data-testid":`${l}-${N}-${s}`,excludePayloadSuggestions:c})});case os.BOOLEAN:return f.jsx(O.Stack,{width:"150px",ml:-1.5,children:f.jsxs(O.Select,{disabled:e.viewOnly,size:"small",value:A[s]?.value!==!1,"data-testid":`${l}-${N}-${s}`,sx:{".MuiInputBase-inputSizeSmall":{height:"auto !important"}},onChange:L=>{const M=L.target.value==="true";w(s,M)},children:[f.jsx(O.MenuItem,{value:"true",children:"true"}),f.jsx(O.MenuItem,{value:"false",children:"false"})]})});default:return null}};return f.jsx(O.Box,{className:"addItem",width:"100%",children:m[s]?f.jsxs(O.Stack,{direction:"row",alignItems:y?"flex-start":"center",width:"100%",children:[!h&&f.jsxs(O.Stack,{sx:{position:"relative"},children:[f.jsx(bo,{viewOnly:e.viewOnly,fullWidth:!0,onChange:N=>b(N,s),showSuggestion:u,id:l,sx:{width:"130px"},placeholder:"key",editorId:`key-${s}`,"data-testid":`key-${s}`,error:!!y,excludePayloadSuggestions:c}),y&&f.jsx(O.Box,{sx:{position:"absolute",top:38,left:0,color:i.palette.error.main,fontSize:"0.75rem",lineHeight:1},children:f.jsx(O.FormHelperText,{"data-testid":`errorMsg-${s}`,error:!0,children:y})})]}),f.jsx(O.Select,{size:"small","data-testid":`select-type-${s}`,disabled:e.viewOnly,sx:{mx:1,mr:2.1,".MuiSelect-select":{padding:"10px 38px 10px 14px",fontSize:10},".MuiInputBase-inputSizeSmall":{height:"auto !important"},".MuiOutlinedInput-notchedOutline":{p:0,width:"120px"}},MenuProps:{PaperProps:{sx:{minWidth:"120px !important",marginLeft:"4px !important"}}},onChange:N=>D(s,N.target.value),value:A[s]?.type||os.STRING,renderValue:N=>{const L=o.find(M=>M.value===N);return f.jsxs(O.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,children:[f.jsx(Fe,{src:L?.icon,width:14,height:14,sx:{marginRight:8,color:L?.color}}),f.jsx(O.Typography,{variant:"smMedium",color:"text.secondary",children:L?.name})]})},children:o.map(N=>f.jsxs(O.MenuItem,{value:N.value,sx:{...Ff,minHeight:"40px !important","@media (min-width: 600px)":{minHeight:"40px !important"}},children:[f.jsx(Fe,{src:N.icon,width:18,height:18,sx:{color:N.color}}),f.jsx(O.Typography,{variant:"smMedium",color:"text.secondary",children:N.name})]},N.value))}),f.jsx("span",{className:"jsonValue",children:k(A[s]?.type||os.STRING)}),f.jsxs(O.Stack,{direction:"row",spacing:1,ml:Et(n)?1:0,children:[f.jsx(O.IconButton,{size:"small",color:"primary",onClick:()=>{P(s,a),d&&d(n)},sx:{minWidth:0},"data-testid":`confirm-${s}`,disabled:!!y||e?.viewOnly,children:f.jsx(Fe,{src:"ic_done",width:16,height:16})}),f.jsx(O.IconButton,{"data-testid":`close-btn-${s}`,size:"small",onClick:()=>{_(s,!1),p?.(!1)},disabled:e?.viewOnly,sx:{minWidth:0},children:f.jsx(Fe,{width:16,height:16,src:"ic_close"})})]})]}):f.jsxs(O.Button,{variant:"text",disabled:e.viewOnly,"data-testid":"json-gui-add-btn",sx:{color:N=>N.palette.primary[60],mt:Et(n)?0:2,"&:hover":{backgroundColor:"transparent",color:N=>N.palette.primary[50],"& .MuiTypography-root":{color:N=>N.palette.primary[50]},"& svg path":{fill:N=>N.palette.primary[50]}}},disableFocusRipple:!0,disableTouchRipple:!0,disableRipple:!0,disableElevation:!0,onClick:()=>_(s,!0),children:[f.jsx(Fe,{src:"ic_plus",sx:{...v,path:{fill:"currentColor"}}}),f.jsx(O.Typography,{variant:"smNormal",sx:{alignItems:"center"},children:"Add"})]})},s)},LN={base:{transformOrigin:"center",transition:"transform 0.2s cubic-bezier(0.4, 0, 0.2, 1)",mr:.5},right:{transform:"rotate(0deg)"},down:{transform:"rotate(90deg)"}};function kN({fieldValue:e,uniqueKey:t}){const{onChangeAllow:n,allowMap:r}=C.useContext(qg);if(!G$e(e))return f.jsx("span",{});const i=r[t];return f.jsx(O.IconButton,{onClick:()=>n(t),"data-testid":`collapse-${t}`,sx:{...LN.base,...i?LN.right:LN.down},children:f.jsx(Fe,{src:"ic_right_arrow"})})}function PY(e){const t=O.useTheme(),n=PN(t.palette);return f.jsx(qg.Consumer,{children:({onChangeType:r})=>f.jsx(O.Select,{size:"small","data-testid":`select-type-${e.uniqueKey}`,disabled:e.viewOnly,sx:{".MuiSelect-select":{fontSize:10},".MuiInputBase-inputSizeSmall":{height:"auto !important"},".MuiOutlinedInput-notchedOutline":{p:0}},onChange:i=>r(i.target.value,e.uniqueKey),value:OS(e.fieldValue),renderValue:i=>{const o=n.find(s=>s.value===i);return f.jsxs(O.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,children:[f.jsx(Fe,{src:o?.icon,width:14,height:14,sx:{marginRight:8,color:o?.color}}),f.jsx(O.Typography,{variant:"smMedium",color:"text.secondary",children:o?.name})]})},children:n.map(i=>f.jsxs(O.MenuItem,{value:i.value,sx:{...Ff},children:[f.jsx(Fe,{src:i.icon,width:18,height:18,sx:{color:i.color}}),f.jsx(O.Typography,{variant:"smMedium",color:"text.secondary",children:i.name})]},i.value))})})}function W$e(e){const{setIsEditing:t,fieldValue:n,parentUniqueKey:r,viewOnly:i,getValue:o,deepLevel:s,id:a,showSuggestions:l,excludePayloadSuggestions:u,onClickDelete:c,onChange:d}=e,{allowMap:p}=C.useContext(qg);return f.jsxs(O.Box,{className:"arrayContent",children:[f.jsx(O.Box,{sx:{marginTop:"10px"},"data-testid":"arrayContent",children:n.map((h,A)=>{const g=`${r}-${A}`,m=OS(h);return f.jsxs(O.Stack,{className:"indexLine",direction:"row",alignItems:"center",gap:1,justifyContent:"flex-start",flexWrap:["object","array"].includes(m)?"wrap":"nowrap",sx:{"& .jsonValue":{flex:["object","array"].includes(m)?"1 1 100%":"0 0 auto",width:["object","array"].includes(m)?"100%":"auto",minWidth:["object","array"].includes(m)?"auto":"150px"}},children:[["object","array"].includes(m)&&f.jsx(kN,{uniqueKey:g,fieldValue:h}),f.jsx(PY,{viewOnly:i,uniqueKey:g,fieldValue:h,fieldKey:`${A}`,sourceData:n,"data-testid":`tools-${g}`,type:"array"}),!p[g]&&f.jsx("span",{className:"jsonValue",children:o(h,A,n,s+1,g)}),f.jsx(O.Stack,{ml:1,alignItems:"center",direction:"row","data-testid":`delete-${g}`,sx:["object","array"].includes(m)?{position:"absolute",right:260,top:4}:{position:"relative",ml:1},children:f.jsx(O.IconButton,{disabled:i,onClick:()=>c(A,n),sx:{ml:.5,"&:hover":{backgroundColor:"transparent"}},children:f.jsx(Fe,{src:"ic_delete"})})})]},g)})}),f.jsx(O.Box,{children:f.jsx(NN,{viewOnly:i,uniqueKey:r,deepLevel:s,sourceData:n,id:a,showSuggestions:l,excludePayloadSuggestions:u,setIsEditing:t,onChange:d},r)})]})}function NY(e){const t=O.useTheme(),{editObject:n,setEditObject:r,id:i,showSuggestions:o,setTempData:s,tempData:a,excludePayloadSuggestions:l=!1,viewOnly:u=!1,onChange:c,setIsEditing:d}=e,[p,h]=C.useState({}),[A,g]=C.useState({}),[m,E]=C.useState(!0),[y,T]=C.useState(!1),v=G=>{r({...G}),c?.(G),s&&s({...G})};C.useEffect(()=>{const G=setTimeout(()=>{E(!1)},500);return()=>clearTimeout(G)},[]);const _=(G,Q)=>{Array.isArray(Q)?(Q.splice(+G,1),c&&c(Q)):(Reflect.deleteProperty(Q,G),c&&c(Q)),v(n)},x=(G,Q)=>{const K=G===os.NULL?null:CY[G],F=DY(K,RY(Q),n);v(F)},b=(G,Q,K,F)=>{const V=G.target.value.trim();if(Q!==V){const j=TN(V,F);if(g(Y=>({...Y,[K]:j})),j)return}const W={};for(const j in F)Object.prototype.hasOwnProperty.call(F,j)&&(j===Q?W[G.target.value]=F[j]:W[j]=F[j]);g(j=>{const Y={...j};return delete Y[K],Y});const R=RY(K);if(R.length===1)v(W);else{R.pop();const j=DY(W,R,n);v(j)}},w=(G,Q,K,F="")=>{K[Q]=F==="number"?Number(G):G,v(n)},D=G=>!!(typeof G!="object"||G===null||Array.isArray(G)||Object.keys(G).length===0),I={position:"absolute",left:-4,width:"2px",height:"calc(100% - 22px)",borderLeft:`1px solid ${t.palette.grey.outlined.border}`,"&::after":{content:'""',position:"absolute",bottom:0,width:"20px",height:"1px",backgroundColor:t.palette.grey.outlined.border},zIndex:1},P={position:"absolute",left:8,width:"2px",height:"calc(100% - 76px)",borderLeft:`1px solid ${t.palette.grey.outlined.border}`,zIndex:0,"&::after":{content:'""',position:"absolute",bottom:0,width:"30px",height:"1px",backgroundColor:t.palette.grey.outlined.border}},k=(G,Q,K,F,V)=>{const W=OS(G),R={autoComplete:"off",onChange:Y=>w(Y.target.value,Q,K),value:G},$={position:"relative",paddingLeft:0},j=D(G);switch(W){case os.ARRAY:return f.jsxs(O.Stack,{sx:$,children:[f.jsx(O.Box,{sx:{...I,height:"calc(100% - 17px)"}}),f.jsx(W$e,{viewOnly:u,fieldValue:G,fieldKey:Q,sourceData:K,deepLevel:F,parentUniqueKey:V,getValue:k,id:i,showSuggestions:o,onClickDelete:_,"data-testid":`array-${Q}`,excludePayloadSuggestions:l,setIsEditing:d,onChange:v})]});case os.OBJECT:return f.jsxs(O.Stack,{sx:$,"data-testid":`object-${Q}`,children:[f.jsx(O.Box,{sx:{...I,height:j?"calc(100% - 10px)":I.height}}),f.jsx("span",{children:B(G,F+1,V)})]});case os.STRING:return f.jsx(bo,{"data-testid":`text-string-${Q}`,sx:{width:"140px"},size:"xs",disabled:u,id:i,showSuggestions:o,excludePayloadSuggestions:l,...R,placeholder:"value"});case os.NUMBER:return f.jsx(bo,{id:i,size:"xs",disabled:u,type:"number",placeholder:G,autoComplete:"off",showSuggestions:o,excludePayloadSuggestions:l,value:G,sx:{width:"140px"},"data-testid":`text-number-${Q}`,onBlur:Y=>w(+Y.target.value,Q,K),onChange:Y=>w(Y.target.value===""?"":+Y.target.value,Q,K,"number")});case os.BOOLEAN:return f.jsxs(O.Select,{disabled:u,size:"small",sx:{width:"140px","& .MuiSelect-select":{display:"flex",alignItems:"center",paddingTop:"6px",paddingBottom:"6px"},"& .MuiOutlinedInput-input":{display:"flex",alignItems:"center"}},value:G?"true":"false","data-testid":`text-boolean-${Q}`,onChange:Y=>w(Y.target.value==="true",Q,K),children:[f.jsx(O.MenuItem,{value:"true",children:"true"}),f.jsx(O.MenuItem,{value:"false",children:"false"})]})}},N=G=>{p[G]=!p[G],h({...p})},L=()=>{T(!y)},M=1,B=(G,Q=M,K=`${Q}`)=>{const F=Object.keys(G);return F.length?f.jsxs(O.Stack,{className:"objectContent","data-testid":"objectContent",sx:{marginLeft:M===Q?"15px":"10px",py:1.5},onClick:V=>V.stopPropagation(),children:[f.jsx(O.Box,{children:F.map((V,W)=>{const R=`${K}-${W}`,$=G[V],j=OS($);return f.jsxs(O.Stack,{className:"indexLine",direction:"row",alignItems:A[R]?"flex-start":"center",gap:1,justifyContent:"flex-start",flexWrap:["object","array"].includes(j)?"wrap":"nowrap",sx:{"& .jsonValue":{flex:["object","array"].includes(j)?"1 1 100%":"0 0 auto",width:["object","array"].includes(j)?"100%":"auto",minWidth:["object","array"].includes(j)?"auto":"150px"},"& .jsonKey":{flex:"0 0 auto",minWidth:"auto"}},children:[["object","array"].includes(j)&&f.jsx(O.Box,{sx:{width:M===Q?"18px":"",display:"inline-block"},children:f.jsx(kN,{uniqueKey:R,fieldValue:$})}),f.jsxs(O.Stack,{direction:"row",alignItems:A[R]?"flex-start":"center",justifyContent:"flex-start",className:"jsonKey",gap:1,children:[f.jsx(bo,{disabled:u,size:"xs",sx:{width:"130px"},id:i,placeholder:"key",value:V||"",tabIndex:W+1,onChange:Y=>b(Y,V,R,G),"data-testid":`text-key-${V}`,error:!!A[R],errorMsg:A[R],helperText:A[R]}),f.jsx(PY,{viewOnly:u,uniqueKey:R,fieldValue:$,fieldKey:V,sourceData:G,"data-testid":`tools-${V}`,type:"object"})]}),!p[R]&&f.jsx("span",{className:j!=="number"&&j!=="boolean"?"jsonValue":"",children:k($,V,G,Q,R)}),f.jsx("span",{children:f.jsx(O.Stack,{ml:1,alignItems:"center",direction:"row",sx:{position:"absolute",right:j==="array"||j==="object"?150:30,top:4},"data-testid":`delete-${V}`,children:f.jsx(O.IconButton,{disabled:u,onClick:()=>_(V,G),sx:{"& path":{fill:t.palette.neutral.solid.bg},"&:hover":{backgroundColor:"transparent","& path":{fill:t.palette.error[60]}}},children:f.jsx(Fe,{src:"ic_delete",sx:{"& path":{fill:t.palette.neutral.solid.bg}}})})})})]},R)})}),f.jsx(O.Box,{"data-testid":`addItem-button-${K}`,ml:M===Q?4.5:2,children:f.jsx(NN,{viewOnly:u,uniqueKey:K,deepLevel:Q,sourceData:G,id:i,showSuggestions:o,excludePayloadSuggestions:l,onChange:V=>{c&&c(V)},setIsEditing:d},K)})]}):f.jsx(O.Box,{"data-testid":`addItem-${K}`,mt:Et(n)?0:"9px",ml:Et(n)?0:3,children:f.jsx(NN,{viewOnly:u,uniqueKey:`${K}`,deepLevel:Q,sourceData:G,id:i,showSuggestions:o,excludePayloadSuggestions:l,onChange:V=>{c&&c(V)},setIsEditing:d})})};return f.jsx(qg.Provider,{value:{editObject:n,setEditObject:r,setTempData:s,onChangeType:x,onClickDelete:_,onChangeAllow:N,allowMap:p},children:m?f.jsx(O.Box,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",minHeight:"300px",children:f.jsx(O.CircularProgress,{})}):f.jsxs(O.Box,{sx:{width:"100%",position:"relative",minHeight:y||Et(a)?0:"100px",paddingTop:"2rem"},"data-testid":"root-collapsible-json",children:[!Et(n)&&f.jsx(O.Box,{onClick:L,"data-testid":"root-collapse-part",children:f.jsx(kN,{uniqueKey:"ROOT_KEY",fieldValue:n})}),!y&&!Et(n)&&f.jsx(O.Box,{sx:P}),!y&&B(n,1,"ROOT_KEY")]})})}const Q$e=C.forwardRef(({data:e={},label:t,infoVisible:n=!1,viewOnly:r=!1,helperText:i,required:o=!1,suggestionsData:s,showSuggestions:a=!1,errorMsg:l="",id:u,excludePayloadSuggestions:c=!1,onChange:d,title:p="",isDynamic:h=!1,fullScreen:A=!1,handleValidate:g,name:m},E)=>{const[y,T]=C.useState("GUI"),[v,_]=C.useState("GUI"),[x,b]=C.useState("Static"),[w,D]=C.useState({}),[I,P]=C.useState(!0),[k,N]=C.useState(!0),[L,M]=C.useState(!1),[B,G]=C.useState({}),[Q,K]=C.useState(""),[F,V]=C.useState({}),W=O.useTheme(),[R,$]=C.useState(!1),[j,Y]=C.useState(!1),[q,H]=C.useState([]),U=C.useRef(!1),X=C.useCallback(Ee=>{const pe=Ee.trim();return/^\{\{[^}]+\}\}$/.test(pe)},[]),ee=C.useMemo(()=>typeof w=="string"&&X(w),[w,X]),Z=[{title:"GUI",disabled:j||ee},{title:"Raw",disabled:j}],le=C.useCallback(Ee=>{if(Ee==null||Ee==="")return{};if(typeof Ee=="string"){if(X(Ee))return Ee;try{return JSON.parse(Ee)}catch{return{}}}return Zo(Ee)},[X]);C.useEffect(()=>{const Ee=le(e);if(D(Ee),G(Ee),V(Ee),typeof Ee=="string"&&X(Ee))K(Ee),U.current=!1,P(!1),N(!1),T("Raw"),_("Raw");else{const pe=JSON.stringify(Ee,null,2);pe==="{}"&&U.current?(K(""),U.current=!1):(K(pe),U.current=!1)}},[e,le,X]);const z=C.useMemo(()=>LA(B),[B]),ie=C.useCallback(()=>{if(!z){if(H([]),g&&g([]),I)typeof F=="string"&&X(F)?K(F):K(JSON.stringify(F,null,2));else if(X(Q))V(Q),D(Q),G(Q);else try{const Ee=JSON.parse(Q);V(Ee),D(Ee),G(Ee)}catch{}P(Ee=>!Ee)}},[z,I,F,Q,g,X]),de=C.useCallback(()=>{if(H([]),g&&g([]),k)typeof w=="string"&&X(w)?K(w):K(JSON.stringify(w,null,2));else if(X(Q))D(Q),G(Q),V(Q);else try{const Ee=JSON.parse(Q);D(Ee),G(Ee),V(Ee)}catch{}N(Ee=>!Ee)},[k,w,Q,g,X]),Ae=()=>{G(Ee=>{const pe={...Ee};return delete pe[""],pe}),M(!L)},te=C.useCallback(Ee=>{const pe=le(Ee);D(pe),G(pe),V(pe)},[le]),J=C.useCallback(Ee=>{U.current=Ee.trim()==="",K(Ee)},[]),ae=C.useCallback(Ee=>{try{if(!Ee||Ee.trim()===""){te({}),d&&d({});return}if(X(Ee)){d&&d(Ee.trim());return}let pe;if(typeof Ee=="string")try{pe=JSON.parse(Ee)}catch{return}else pe=Ee;te(pe),d&&d(pe)}catch{}},[te,d,X]),ne=C.useCallback(()=>{kd(JSON.stringify(w,null,2),"Copied to clipboard"),$(!0),setTimeout(()=>$(!1),2e3)},[w]),se=C.useCallback(Ee=>{if(Ee&&Ee.length>0){const pe=Ee.map(me=>me.message);H(pe)}else H([]);g&&g(Ee)},[g]),ue={border:"1px solid",borderColor:l?W.palette.error.main:W.palette.grey.outlined.border,borderRadius:2};return f.jsxs(O.Stack,{spacing:1,"data-testid":"json-gui",ref:E,children:[n&&f.jsx(z$e,{"data-testid":"json-info-msg",message:"We recommend you expand this editor to full view for the best experience."}),f.jsx($o,{open:L,"data-testid":"json-gui-fullscreen-popup",handleClose:Ae,title:t||"Global variables",content:f.jsxs(O.Stack,{sx:{width:"100%",height:"80vh"},children:[f.jsx(Hs,{variant:"normal",tabs:[{title:"GUI"},{title:"Raw"}],selectedTab:v,sx:{height:24,width:"fit-content",ml:"auto",mb:1},setSelectedTab:()=>{de(),_(v==="GUI"?"Raw":"GUI")}}),f.jsxs(O.Box,{sx:{overflow:"auto",position:"relative",height:"100%",background:W.palette.background.paper,...k?{borderRadius:"4px",border:`1px solid ${W.palette.grey[200]}`,p:1}:{}},children:[k?f.jsx(O.Stack,{"data-testid":"json-gui-builder",sx:{"& .MuiPaper-root":{width:"100% !important",borderRadius:"8px !important"}},children:f.jsx(O.Stack,{sx:{width:"100%",height:"auto",position:"relative",top:"unset",left:"unset",zIndex:"auto",maxWidth:"1200px",overflow:typeof w=="object"&&Object.keys(w).length===0?"visible":"auto"},p:1,children:f.jsx(O.Stack,{children:f.jsx(O.Stack,{minHeight:typeof B=="object"&&Object.keys(B).length===1?50:"auto",children:typeof w=="object"&&typeof B=="object"&&f.jsx(NY,{viewOnly:r,editObject:w,setEditObject:D,setTempData:G,id:u,showSuggestions:a,tempData:B,excludePayloadSuggestions:c,onChange:Ee=>{V(Ee),d&&d(Ee)},setIsEditing:Y})})})})}):f.jsx(O.Box,{sx:{height:"100%",overflowY:r?"visible":"auto"},children:f.jsx(_o,{size:"lg",language:"json",viewOnly:r,handleChange:J,handleBlur:ae,value:Q,id:"code-editor-gui-full",suggestionsData:s,required:o,enableJsonGuiValidation:!0,handleValidate:se,"data-testid":"json-gui-code-editor-full",sx:{border:"none"},height:"75vh",allowArrayAtRoot:!!(m&&m.endsWith("payload"))||!!(m&&m.includes(".payload"))})}),f.jsx(O.Stack,{onClick:ne,sx:{position:"absolute",top:6,right:6,cursor:"pointer"},children:f.jsx(O.Tooltip,{"data-testid":"json-copy-tooltip",title:R?"Copied!":"Copy JSON",children:f.jsx(O.IconButton,{"data-testid":"json-gui-copy",onClick:ne,size:"small",children:f.jsx(Fe,{src:"ic_copy",width:15,height:15,sx:{path:{fill:W.palette.common.black}}})})})})]})]})}),f.jsxs(O.Stack,{children:[f.jsxs(O.Stack,{direction:"row",alignItems:"flex-end",justifyContent:"space-between",children:[f.jsx(Nr,{label:t||"",required:o,description:i}),h&&f.jsx(Hs,{variant:"normal",tabs:[{title:"Static"},{title:"Dynamic"}],selectedTab:x,sx:{height:24},setSelectedTab:()=>{b(x==="Static"?"Dynamic":"Static")}})]}),I?f.jsxs(O.Stack,{children:[f.jsxs(O.Stack,{"data-testid":"json-gui-builder",sx:{...ue},children:[f.jsxs(O.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,p:1.5,children:[f.jsx(O.Typography,{variant:"smNormal",children:p}),f.jsxs(O.Stack,{direction:"row",position:"relative",alignItems:"center",children:[f.jsx(Hs,{variant:"normal",tabs:Z,selectedTab:y,sx:{height:24},setSelectedTab:()=>{ie(),T(y==="GUI"?"Raw":"GUI")}}),A&&f.jsx(O.IconButton,{"data-testid":"json-gui-fullscreen-button",onClick:Ae,sx:{ml:1,position:"absolute",top:44,right:0,zIndex:999},children:f.jsx(Fe,{src:"ic_maximize"})})]})]}),f.jsx(O.Divider,{}),f.jsx(O.Stack,{sx:{width:"100%",height:"auto",position:"relative",maxWidth:"600px",maxHeight:"calc(80vh - 306px)",overflow:"auto"},p:1,children:f.jsx(O.Stack,{children:typeof w=="object"&&typeof B=="object"&&f.jsx(NY,{viewOnly:r,editObject:w,setEditObject:D,setTempData:G,id:u,showSuggestions:a,tempData:B,excludePayloadSuggestions:c,onChange:Ee=>{V(Ee),d&&d(Ee)},setIsEditing:Y})})})]}),q.length>0?f.jsx(O.Box,{sx:{mt:1},children:q.map((Ee,pe)=>f.jsx(O.FormHelperText,{error:!0,children:Ee},`validation-error-${Ee}-${pe}`))}):l?f.jsx(O.FormHelperText,{error:!0,children:l}):null,i&&f.jsx(O.FormHelperText,{children:i})]}):f.jsxs(O.Box,{children:[f.jsxs(O.Box,{sx:{...ue,opacity:r?.6:1},children:[f.jsxs(O.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,p:1.5,children:[f.jsx(O.Typography,{variant:"smNormal",children:p}),f.jsxs(O.Stack,{direction:"row",alignItems:"center",position:"relative",children:[f.jsx(Hs,{variant:"normal",tabs:Z,selectedTab:y,sx:{height:24},setSelectedTab:()=>{ie(),T(x==="GUI"?"Raw":"GUI")}}),A&&f.jsx(O.IconButton,{"data-testid":"json-gui-fullscreen-button",onClick:Ae,sx:{ml:1,position:"absolute",top:44,right:0,zIndex:999},children:f.jsx(Fe,{src:"ic_maximize"})})]})]}),f.jsx(O.Divider,{}),f.jsx(O.Box,{sx:{height:"100%",overflowY:r?"visible":"auto"},children:f.jsx(_o,{size:"lg",language:"json",viewOnly:r,handleChange:J,handleBlur:ae,value:Q,id:`code-editor-gui-${u}`,suggestionsData:s,error:!!l,required:o,enableJsonGuiValidation:!0,handleValidate:se,"data-testid":"json-gui-code-editor",showSuggestions:a,codeEditorStyles:{border:"none"},allowArrayAtRoot:!!(m&&m.endsWith("payload"))||!!(m&&m.includes(".payload"))})})]}),q.length>0?f.jsx(O.Box,{sx:{mt:1},children:q.map((Ee,pe)=>f.jsx(O.FormHelperText,{error:!0,children:Ee},`validation-error-${Ee}-${pe}`))}):l?f.jsx(O.FormHelperText,{error:!0,children:l}):null,i&&f.jsx(O.FormHelperText,{children:i})]})]})]})}),z$e=({message:e})=>{const t=O.useTheme();return f.jsxs(O.Stack,{alignItems:"center",spacing:1,direction:"row",sx:{background:t.palette.success[10],borderRadius:2,border:"1px solid",borderColor:t.palette.success[40]},p:1,children:[f.jsx(Fe,{src:"ic_success",sx:{path:{fill:t.palette.success.main}}}),f.jsx(O.Typography,{variant:"xsMedium",children:e})]})},LY=Go(Q$e),hc=e=>{const{name:t,label:n,viewOnly:r=!1,validationRules:i={},required:o=!1,id:s,description:a,error:l,suggestionsData:u,...c}=e,{trigger:d,control:p}=Vn(),h=C.useRef(null),A=C.useRef([]),g=C.useCallback(y=>{const T=y?.length>0?y.map(v=>v.message):[];A.current=T,d(t)},[t,d]),m=C.useCallback(async y=>{if(i.validate){const v=typeof i.validate=="function"?await i.validate(y):!0;if(v!==!0)return v}const T=A.current;return T.length>0?T[0]:!0},[i.validate]),E=C.useMemo(()=>({...i,validate:m}),[i,m]);return f.jsx(xn,{name:t,control:p,rules:E,render:({field:y,fieldState:{error:T}})=>f.jsx(LY,{...y,ref:h,label:n,data:y.value,viewOnly:r,suggestionsData:u,helperText:a,errorMsg:T?.message||l?.errorMsg,required:o,id:s,showSuggestions:!0,handleValidate:g,onChange:v=>{d(t),y.onChange(v)},...c})})},X$e=C.forwardRef((e,t)=>{const n=pt.useDispatch(),{type:r,openIntegrationDrawer:i,TESSERACT_MAIN_URL:o,ENTITY_ID:s,FRONTEND_URL:a,INTEGRATION_DATA:l,viewOnly:u=!1,id:c}=e,[d,p]=C.useState([]),[h,A]=C.useState(!1),{control:g,watch:m,setValue:E,resetField:y}=Vn(),T=m("properties.auth_type"),v=()=>{A(!0);const _={page_size:999,current_page:1,type:"SOURCE"},x=Zt(o,"/v1/integrations/entity/AUTHENTICATION");Kt.get(x,{params:_}).then(({data:b})=>{const w=hs(b.data,["integration_meta"]),D=sS(w);p(aS(D))}).catch(b=>{An(b,n)}).finally(()=>{A(!1)})};return C.useEffect(()=>{v()},[]),C.useEffect(()=>{l?._id&&l?.meta?.entity==="AUTHENTICATION"&&(v(),E("properties.auth_id",l._id,{shouldValidate:!0}))},[l]),C.useEffect(()=>{!Et(T)&&T!==Jl.NONE?v():y("properties.auth_id")},[T]),f.jsxs(O.Stack,{gap:2.5,children:[f.jsx(Eo,{children:f.jsxs(O.Grid,{container:!0,gap:1.5,children:[f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{name:"properties.auth_type",control:g,meta:{options:h1,displayName:"Authentication Type",searchFieldPlaceholder:"Search authentication type",placeholder:"Select Authentication Type"},validationRules:{required:"Auth type is required"},id:"auth_type",viewOnly:u,required:!0,onChange:_=>{E("properties.auth_type",_.target.value),E("properties.auth_id","")}})}),T&&T!==Jl.NONE&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.auth_id",control:g,meta:{options:Jr(d),displayProps:{loading:h},displayName:"Authentication",value:"",htmlProps:{showAddNew:!0},TESSERACT_MAIN_URL:o,FRONTEND_URL:a,ENTITY_ID:s,openIntegrationDrawer:i,addNewButtonText:"Add new",searchFieldPlaceholder:"Search authentication",authType:"AUTHENTICATION",placeholder:"Select Authentication"},validationRules:{required:"Authentication is required"},viewOnly:u,id:r,groupBy:"integration_meta.auth_type"})})]})}),f.jsx(O.Divider,{}),f.jsx(qr,{children:f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(hc,{name:"properties.test_payload",control:g,label:"Test Trigger Payload",viewOnly:u,showSuggestions:!0,excludePayloadSuggestions:!0,id:c})})})]})}),q$e=C.forwardRef(({placeholder:e="",onChange:t,value:n,height:r="100%",width:i="100%",label:o="",required:s=!1,errorMsg:a,helperText:l="",nodeId:u="",name:c,isLoop:d,viewOnly:p=!1,hideLabel:h=!1},A)=>{const g=O.useTheme(),{MCP_INTEGRATION_FORM:m}=_a(),{getNodes:E}=Pt.useReactFlow(),{selectedActivityId:y,aiGeneratedFieldMap:T}=pt.useSelector(W=>W.canvas),v=es(l),[_,x]=C.useState(""),b=C.useRef(null),w=C.useRef(null),[D,I]=C.useState(""),P=W=>{x(W.target.value)},k=()=>{if(_.trim()!==""){const R=[...Array.isArray(n)?n:[],_.trim().split(",")[0]],$=new Set(R);t([...$]),x("")}},N=W=>{W.preventDefault();const{keyCode:R}=W;[13,32,188].includes(R)&&k()},L=W=>()=>{typeof n=="object"&&Array.isArray(n)&&t(n.filter(R=>R!==W))},M=(W,R)=>{W?.stopPropagation?.(),W?.preventDefault?.(),Array.isArray(n)&&t(n.filter($=>$!==R))},B=W=>{W.keyCode===8&&_.trim()===""?Array.isArray(n)&&n.length>0&&L(n[n.length-1])():W.key==="Enter"&&W.preventDefault()},G=()=>{b.current?.focus()},Q=W=>{W.stopPropagation()};C.useEffect(()=>(document.addEventListener("mousedown",Q),()=>{document.removeEventListener("mousedown",Q)}),[]),C.useEffect(()=>{I(typeof n=="string"?"Dynamic":"Static")},[n]);const K=(()=>{const W=E()||[],R=String(u||""),$=W.find(U=>U?.selected),j=W.find(U=>String(U?.id)===R)||W.find(U=>String(U?.id)===String(y))||$,Y=String(j?.id||""),H=(T||{})[Y]||(T||{})[String(y||"")]||(T||{})[R];return H&&typeof H=="object"?H:{}})(),F=String(c||"").replace(/^properties\./,""),V=!!F&&F in K&&n!==void 0&&n!==null&&(typeof n!="string"||n.trim()!=="")&&(!Array.isArray(n)||n.length>0);return f.jsx(O.FormControl,{fullWidth:!0,children:f.jsxs(O.Stack,{children:[o&&!h&&f.jsxs(O.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-end",children:[f.jsx(Nr,{required:s,label:o,description:v}),!p&&!m&&f.jsx(O.Stack,{pb:.5,children:f.jsx(Hs,{variant:"normal",tabs:[{title:"Static"},{title:"Dynamic"}],selectedTab:D,setSelectedTab:()=>{D==="Static"?(t(""),I("Dynamic")):(t([]),I("Static"))}})})]}),typeof n=="object"&&Array.isArray(n)?f.jsxs(f.Fragment,{children:[f.jsxs(O.Stack,{spacing:1,border:1,sx:{position:"relative",borderColor:a?g.palette.error.main:g.palette.grey[300],":focus-within":{border:`1px solid ${g.palette.neutral.plain}`,transition:"all 100ms ease-in"}},height:r,width:i,borderRadius:2,px:1,py:0,maxHeight:"20rem",overflow:"auto",onClick:G,children:[V&&f.jsx(O.Stack,{sx:{position:"absolute",right:"1px",top:1,bottom:1,width:"15%",minWidth:64,maxWidth:96,borderTopRightRadius:8,borderBottomRightRadius:8,pointerEvents:"none",zIndex:0,background:`linear-gradient(90deg, ${O.alpha(g.palette.primary[5],0)} 0%, ${O.alpha(g.palette.primary[5],.35)} 62%, ${O.alpha(g.palette.primary[5],.9)} 100%)`}}),V&&f.jsx(O.Stack,{sx:{position:"absolute",right:12,top:11,zIndex:3,pointerEvents:"none",width:18,height:18,alignItems:"center",justifyContent:"center"},children:f.jsx(Fe,{src:"ic_AI",width:18,height:18,sx:{display:"block","& svg path":{fill:`${g.palette.primary.main} !important`,fillOpacity:"1 !important"}}})}),f.jsxs(O.Stack,{direction:"row",flexWrap:"nowrap",gap:1,alignItems:"center",ref:w,sx:{maxWidth:"100%",overflow:"hidden",minHeight:40,pr:V?4.75:0,position:"relative",zIndex:1},children:[(()=>{if(!n||!Array.isArray(n)||n.length===0)return null;const{visible:W,extra:R,hiddenSelections:$}=tC(n||[],w);return f.jsxs(f.Fragment,{children:[W.map((j,Y)=>f.jsx(O.Chip,{label:j,disabled:p,deleteIcon:f.jsx(Fe,{sx:{"& svg":{width:16,height:16}},src:"ic_close"}),onDelete:L(j),sx:{flex:"0 0 auto",minWidth:"40px"}},`input-chip-${j}-${Y}`)),R>0&&f.jsx(bI,{hiddenSelections:$,extra:R,handleChipDelete:M})]})})(),f.jsx(O.InputBase,{ref:A,fullWidth:!0,autoComplete:"off",placeholder:e,value:_,onChange:P,inputRef:b,onKeyUp:N,readOnly:p,disabled:p,onKeyDown:B,onBlur:()=>k(),sx:{"&.MuiInput-root":{border:"none",flex:1},"& .MuiInputBase-input":{padding:"4px"},":focus":{border:"none"},":focus-within":{border:"none",transition:"none",boxShadow:"none"},":active":{backgroundColor:"transparent"}}})]})]}),a&&f.jsx(O.FormHelperText,{error:!0,children:a})]}):f.jsx(bo,{id:u,language:"plaintext",required:!0,value:n,isLoop:d,viewOnly:p,editorId:`${u}-${c}`,showSuggestions:!0,placeholder:e,handleChange:W=>{t(W)},errorMsg:a,loading:null})]})})}),Ed=zc(q$e),kY=({field:e,type:t,nodeId:n,isLoop:r,viewOnly:i})=>{const o=O.useTheme(),{watch:s,control:a,setValue:l}=Vn(),u=s(e),c=p=>{l(e,u.filter((h,A)=>p!==A))},d=C.useMemo(()=>u?.map((p,h)=>`${n}-${t}-${Date.now()}-${h}`),[n,t,u?.length]);return f.jsx(f.Fragment,{children:u&&u?.map((p,h)=>f.jsxs(O.Grid,{container:!0,sx:{mb:1,py:1},alignItems:"flex-end",justifyContent:"space-between",children:[f.jsx(O.Grid,{item:!0,xs:11,children:f.jsx(Wn,{autoFocus:!0,id:n,name:`${e}.${h}`,control:a,meta:{displayName:`Attachment ${h+1}`,description:jr(t,"attachments"),placeholder:`Attachment ${h+1}`},editorId:`${t}-attachment_${h}`,isLoop:r,viewOnly:i})}),f.jsx(O.Grid,{item:!0,xs:.5,sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:u.length>0&&f.jsx(O.IconButton,{sx:{p:.75,width:28,height:28,"& path":{fill:o.palette.neutral.solid.bg},"&:hover path":{fill:o.palette.error[60]},"&:hover":{backgroundColor:"transparent"}},disabled:i,onClick:()=>c(h),children:f.jsx(Fe,{src:"ic_delete",width:20,height:20})})})]},d[h]))})},Y$e=e=>{const{field:t,viewOnly:n}=e,{watch:r,setValue:i,unregister:o}=Vn(),{setFieldControlState:s}=_a(),a=r(t),[l,u]=C.useState("BOLTIC_AI"),c=C.useRef([]);C.useEffect(()=>{a==="BOLTIC_AI"||a==="BOLTIC_AI_IGNORE"?u(a):Array.isArray(a)&&u("specific")},[a]);const d=p=>{const h=p.target.value;if(u(h),s(t,h),h==="specific"){const A=Array.isArray(a)&&a.length>0?a:c.current.length>0?c.current:[""];i(t,A)}else Array.isArray(a)&&(c.current=a,a.forEach((A,g)=>{o?.(`${t}.${g}`)}),o?.(t)),i(t,h)};return f.jsxs(O.Stack,{spacing:1.5,mt:.5,children:[f.jsx(O.FormControl,{fullWidth:!0,disabled:n,children:f.jsxs(O.Select,{value:l,onChange:d,children:[f.jsx(O.MenuItem,{sx:{py:.8},value:"BOLTIC_AI",children:"Have AI generate a value for this field"}),f.jsx(O.MenuItem,{sx:{py:.8},value:"BOLTIC_AI_IGNORE",children:"Do not include a value for this field"}),f.jsx(O.MenuItem,{sx:{py:.8},value:"specific",children:"Set a specific value for this field"})]})}),l==="specific"&&f.jsx(kY,{...e})]})},MN=e=>{const{MCP_INTEGRATION_FORM:t}=_a();return t?f.jsx(Y$e,{...e}):f.jsx(kY,{...e})},K$e=C.forwardRef((e,t)=>{const{VORTEX_MAIN_URL:n,ENTITY_ID:r,TESSERACT_MAIN_URL:i,WORKFLOW_URLS:o,type:s,id:a,isLoop:l,FRONTEND_URL:u,suggestionsData:c,INTEGRATION_DATA:d,viewOnly:p=!1,openIntegrationDrawer:h}=e,A=pt.useDispatch(),g=O.useTheme(),{control:m,setValue:E,watch:y,getValues:T,formState:{errors:v}}=Vn(),{BOLTIC_EMAIL_DOMAIN:_}=o,x=y("properties"),[b,w]=C.useState([]),[D,I]=C.useState(!1),{loopSuggestionsData:P={}}=pt.useSelector(K=>K.loopActivity),k=C.useCallback(()=>{I(!0);const K={page_size:999,current_page:1,type:"DESTINATION"},F=Zt(i,"/v1/integrations/entity/EMAIL");Kt.get(F,{params:K}).then(({data:V})=>{w(hs(V.data))}).catch(V=>{An(V,A)}).finally(()=>{I(!1)})},[]),N=_?.split(",").map(K=>({title:`@${K.trim()}`,value:`@${K.trim()}`})),[L,M]=C.useState(()=>x.from?`@${x.from?.split("@")[1]}`:N[0]?.value),[B,G]=C.useState(()=>x.from?.split("@")[0]||"");C.useEffect(()=>{k()},[]),C.useEffect(()=>{d?._id&&d?.meta?.entity==="EMAIL"&&(k(),E("properties.email_auth_id",d._id,{shouldValidate:!0}))},[d]);const Q=K=>{E(`properties.${K}`,[...T(`properties.${K}`)||[],""])};return f.jsxs(O.Stack,{gap:2.5,children:[f.jsx(Eo,{children:f.jsx(O.Grid,{container:!0,gap:1.5,children:f.jsx(O.Grid,{item:!0,xs:12,children:x.integration_slug==="blt-int.boltic-email"?f.jsxs(O.Stack,{direction:"row",children:[f.jsx(O.Box,{sx:{width:"60%"},children:f.jsx(Wn,{id:a,name:"properties.from",control:m,meta:{displayName:"From",description:jr(s,"from"),renderFieldValue:()=>B},viewOnly:p,editorId:`${s}-from`,showSuggestions:!0,isLoop:l,handleChange:K=>{const{value:F}=K;E("properties.from",`${F}${L}`),G(F)},sx:{"& .MuiPaper-root":{borderTopRightRadius:0,borderBottomRightRadius:0,borderRight:"none"}}})}),f.jsx(O.Box,{sx:{width:"40%"},children:f.jsx(en,{name:"properties.from",control:m,meta:{options:N,displayName:"Domain",searchFieldPlaceholder:"Search Domain"},viewOnly:p,id:s,renderFieldValue:()=>L,handleChange:K=>{const{value:F}=K;E("properties.from",`${B}${F}`),M(F)},sx:{"& .MuiOutlinedInput-notchedOutline":{borderTopLeftRadius:0,borderBottomLeftRadius:0}}})})]}):f.jsx(en,{required:!0,name:"properties.email_auth_id",control:m,meta:{options:Jr(b),displayProps:{loading:D},displayName:"Email Account",value:"",htmlProps:{showAddNew:!0},TESSERACT_MAIN_URL:i,FRONTEND_URL:u,ENTITY_ID:r,openIntegrationDrawer:h,addNewButtonText:"Add new account",searchFieldPlaceholder:"Search email account",authType:"EMAIL",description:"Select Email secret here.",placeholder:"Select Email Account"},validationRules:{required:"Email account is required"},viewOnly:p,id:s})})})}),(x.email_auth_id||x.integration_slug==="blt-int.boltic-email")&&f.jsx(O.Divider,{}),(x.email_auth_id||x.integration_slug==="blt-int.boltic-email")&&f.jsx(qr,{children:f.jsxs(O.Grid,{container:!0,gap:1.5,children:[f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(Wn,{required:!0,id:a,name:"properties.subject",control:m,meta:{displayName:"Subject",description:"Enter the subject to send in the email.",placeholder:"Type or add suggestion"},validationRules:{required:"Subject is required"},viewOnly:p,editorId:`${s}-subject-${l}`,showSuggestions:!0,isLoop:l})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.to",control:m,rules:{required:"To is required",validate:K=>Array.isArray(K)&&!K.every(V=>Pu(V))?"To must have all the valid emails":!0},render:({field:K})=>f.jsx(Ed,{...K,required:!0,nodeId:a,label:"To",name:"to",viewOnly:p,isLoop:l,placeholder:"Enter email",onChange:F=>{K.onChange(typeof F=="string"?F:[...F])},errorMsg:v.properties?.to?.message})})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.email_template",control:m,rules:{required:"Email body is required"},render:({field:K})=>f.jsx(_o,{...K,label:"Email body",suggestionLabel:"Email body",id:`${s}-email_template`,activityType:s,VORTEX_MAIN_URL:n,ENTITY_ID:r,size:"md",viewOnly:p,showSuggestions:!0,language:"html",suggestionsData:l?P:c,showExpandOption:!0,showHtmlPreview:!0,errorMsg:v.properties?.email_template?.message,error:!!v.properties?.email_template?.message,handleChange:F=>{K.onChange(F)},required:!0})})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.cc",control:m,rules:{validate:K=>Array.isArray(K)&&!K.every(V=>Pu(V))?"Cc must have all the valid emails":!0},render:({field:K})=>f.jsx(Ed,{...K,nodeId:a,label:"Cc",name:"cc",viewOnly:p,placeholder:"Enter email",isLoop:l,onChange:F=>{K.onChange(typeof F=="string"?F:[...F])},errorMsg:v.properties?.cc?.message})})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.bcc",control:m,rules:{validate:K=>Array.isArray(K)&&!K.every(V=>Pu(V))?"Bcc must have all the valid emails":!0},render:({field:K})=>f.jsx(Ed,{...K,nodeId:a,label:"Bcc",name:"bcc",isLoop:l,viewOnly:p,placeholder:"Enter email",onChange:F=>{K.onChange(typeof F=="string"?F:[...F])},errorMsg:v.properties?.bcc?.message})})}),f.jsxs(O.Grid,{item:!0,xs:12,children:[f.jsxs(O.Box,{sx:{display:"flex",alignItems:"center"},children:[f.jsx(O.FormControl,{fullWidth:!0,sx:{"& > .MuiStack-root > .MuiStack-root":{pb:0}},children:f.jsx(Nr,{label:"Attachments",description:"The maximum attachment limit is 25Mb"})}),f.jsx(O.IconButton,{disabled:p,onClick:()=>Q("attachments"),sx:{float:"right",p:.75,border:K=>`1px solid ${K.palette.grey.brainstem}`,fontSize:K=>K.typography.mdNormal.fontSize},color:"primary",children:f.jsx(Fe,{src:"ic_plus",width:g.icons.md,height:g.icons.md,sx:{svg:{path:{fill:g.palette.primary.main}}}})})]}),f.jsx(MN,{nodeId:a,type:s,isLoop:l,viewOnly:p,field:"properties.attachments"})]}),!l&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(qi,{viewOnly:p,type:s})})]})})]})}),Z$e=Go(K$e),J$e=C.forwardRef((e,t)=>{const{workflow:n}=pt.useSelector(x=>x.workflows),r=pt.useDispatch(),{type:i,VORTEX_MAIN_URL:o,ENTITY_ID:s,suggestionsData:a,viewOnly:l=!1,id:u}=e,[c,d]=C.useState([]),[p,h]=C.useState(!1),{control:A,setValue:g,watch:m}=Vn(),E=m("properties"),y=O.useTheme(),T=m("properties.child_workflow_id"),v=m("properties.child_workflow_name"),_=async(x="")=>{h(!0);const b={include:["scheduled","published"],limit:100,page:1,name:x};n&&(b.draft_id=n?.id);const w=Zt(o,`/v1.0/${s}/workflows`);Kt.get(w,{params:b}).then(({data:D})=>{d(()=>T&&!D.data.find(I=>I.id===T)?[{id:T,name:v,version:E.version},...D.data]:D.data)}).catch(D=>{An(D,r)}).finally(()=>{h(!1)})};return C.useEffect(()=>{_()},[]),C.useEffect(()=>{if(!T)g("properties",{...E,child_workflow_id:"",version:"",child_workflow_name:""});else{const x=c.find(b=>b.id===T);g("properties",{...E,version:x?.version,child_workflow_name:x?.name})}},[T]),f.jsxs(O.Stack,{gap:2.5,children:[f.jsx(Eo,{children:f.jsx(O.Grid,{container:!0,gap:1.5,children:f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.child_workflow_id",control:A,meta:{options:Jr(c),displayName:"Workflow",searchFieldPlaceholder:"Search workflow",description:"Select the child workflow that you want to run",displayProps:{loading:p},placeholder:"Select Workflow"},validationRules:{required:"Workflow is required"},viewOnly:l,id:"child_workflow_id",handleChange:x=>{const{value:b}=x;if(b===""){const w=m("properties");g("properties",{...w,child_workflow_id:"",child_workflow_name:"",version:""})}},renderValueUi:x=>{if(!x)return f.jsx(O.Typography,{sx:{fontSize:"14px",color:y.palette.neutral.solid.bg,fontFamily:"inherit",":hover":{color:y.palette.neutral.main}},children:"Select Workflow"});const b=Jr(c)?.find(w=>w?.value===x);return f.jsxs(O.Stack,{direction:"row",gap:1,children:[f.jsx(O.Typography,{sx:{fontSize:"14px",color:y.palette.text.primary,fontFamily:"inherit",...Iu,maxWidth:"95%"},children:b?.title}),f.jsx(O.Chip,{sx:{fontSize:11},size:"small",label:`v${b?.version}`})]})},renderOption:(x,b)=>{const{title:w,value:D,version:I}=b;return f.jsx(O.MenuItem,{value:D,sx:{p:"8px !important",mx:1,height:"auto","&.Mui-selected":{"& .MuiTypography-root":{color:y.palette.primary.main}}},children:f.jsxs(O.Stack,{width:"100%",direction:"row",flexWrap:"wrap",sx:{...Ff,gap:1},children:[f.jsx(O.Typography,{sx:{fontSize:"1rem",fontWeight:400,color:y.palette.text.primary,whiteSpace:"normal",wordBreak:"break-word",maxWidth:"88%"},children:w}),f.jsx(O.Chip,{sx:{fontSize:11},size:"small",label:`v${I}`})]})},D)}})})})}),E.child_workflow_id&&f.jsx(O.Divider,{}),E.child_workflow_id&&f.jsx(qr,{children:f.jsxs(O.Grid,{container:!0,gap:1.5,children:[f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(hc,{name:"properties.payload",label:"Payload",viewOnly:l,id:u,suggestionsData:a,fullScreen:!0,showSuggestions:!0,helperText:"Provide the data needed for the child workflow, which will be available under the 'payload' property in the child workflow. This should always be an object. If you provide an array, only the first element will be used.",validationRules:{required:"Payload is required"}})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(qi,{viewOnly:l,type:i})})]})})]})}),eje=Go(J$e,"");var Yg={exports:{}};Yg.exports;var MY;function tje(){return MY||(MY=1,(function(e,t){var n=200,r="Expected a function",i="__lodash_hash_undefined__",o=1,s=2,a=9007199254740991,l="[object Arguments]",u="[object Array]",c="[object Boolean]",d="[object Date]",p="[object Error]",h="[object Function]",A="[object GeneratorFunction]",g="[object Map]",m="[object Number]",E="[object Object]",y="[object Promise]",T="[object RegExp]",v="[object Set]",_="[object String]",x="[object Symbol]",b="[object WeakMap]",w="[object ArrayBuffer]",D="[object DataView]",I="[object Float32Array]",P="[object Float64Array]",k="[object Int8Array]",N="[object Int16Array]",L="[object Int32Array]",M="[object Uint8Array]",B="[object Uint8ClampedArray]",G="[object Uint16Array]",Q="[object Uint32Array]",K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,F=/^\w*$/,V=/^\./,W=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,R=/[\\^$.*+?()[\]{}|]/g,$=/\\(\\)?/g,j=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,q={};q[I]=q[P]=q[k]=q[N]=q[L]=q[M]=q[B]=q[G]=q[Q]=!0,q[l]=q[u]=q[w]=q[c]=q[D]=q[d]=q[p]=q[h]=q[g]=q[m]=q[E]=q[T]=q[v]=q[_]=q[b]=!1;var H=typeof jn=="object"&&jn&&jn.Object===Object&&jn,U=typeof self=="object"&&self&&self.Object===Object&&self,X=H||U||Function("return this")(),ee=t&&!t.nodeType&&t,Z=ee&&!0&&e&&!e.nodeType&&e,le=Z&&Z.exports===ee,z=le&&H.process,ie=(function(){try{return z&&z.binding("util")}catch{}})(),de=ie&&ie.isTypedArray;function Ae(Se,Xe,yt,zt){for(var bn=-1,fn=Se?Se.length:0;++bn<fn;){var Bn=Se[bn];Xe(zt,Bn,yt(Bn),Se)}return zt}function te(Se,Xe){for(var yt=-1,zt=Se?Se.length:0;++yt<zt;)if(Xe(Se[yt],yt,Se))return!0;return!1}function J(Se){return function(Xe){return Xe?.[Se]}}function ae(Se,Xe){for(var yt=-1,zt=Array(Se);++yt<Se;)zt[yt]=Xe(yt);return zt}function ne(Se){return function(Xe){return Se(Xe)}}function se(Se,Xe){return Se?.[Xe]}function ue(Se){var Xe=!1;if(Se!=null&&typeof Se.toString!="function")try{Xe=!!(Se+"")}catch{}return Xe}function Ee(Se){var Xe=-1,yt=Array(Se.size);return Se.forEach(function(zt,bn){yt[++Xe]=[bn,zt]}),yt}function pe(Se,Xe){return function(yt){return Se(Xe(yt))}}function me(Se){var Xe=-1,yt=Array(Se.size);return Se.forEach(function(zt){yt[++Xe]=zt}),yt}var xe=Array.prototype,ge=Function.prototype,Oe=Object.prototype,$e=X["__core-js_shared__"],Ve=(function(){var Se=/[^.]+$/.exec($e&&$e.keys&&$e.keys.IE_PROTO||"");return Se?"Symbol(src)_1."+Se:""})(),Be=ge.toString,tt=Oe.hasOwnProperty,je=Oe.toString,qe=RegExp("^"+Be.call(tt).replace(R,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Le=X.Symbol,Ye=X.Uint8Array,Ke=Oe.propertyIsEnumerable,Te=xe.splice,_e=pe(Object.keys,Object),we=Br(X,"DataView"),re=Br(X,"Map"),he=Br(X,"Promise"),be=Br(X,"Set"),Ue=Br(X,"WeakMap"),Pe=Br(Object,"create"),Ge=Me(we),mt=Me(re),_t=Me(he),Ce=Me(be),ot=Me(Ue),At=Le?Le.prototype:void 0,wt=At?At.valueOf:void 0,Ft=At?At.toString:void 0;function Dt(Se){var Xe=-1,yt=Se?Se.length:0;for(this.clear();++Xe<yt;){var zt=Se[Xe];this.set(zt[0],zt[1])}}function Bt(){this.__data__=Pe?Pe(null):{}}function Re(Se){return this.has(Se)&&delete this.__data__[Se]}function nt(Se){var Xe=this.__data__;if(Pe){var yt=Xe[Se];return yt===i?void 0:yt}return tt.call(Xe,Se)?Xe[Se]:void 0}function Qe(Se){var Xe=this.__data__;return Pe?Xe[Se]!==void 0:tt.call(Xe,Se)}function st(Se,Xe){var yt=this.__data__;return yt[Se]=Pe&&Xe===void 0?i:Xe,this}Dt.prototype.clear=Bt,Dt.prototype.delete=Re,Dt.prototype.get=nt,Dt.prototype.has=Qe,Dt.prototype.set=st;function Ot(Se){var Xe=-1,yt=Se?Se.length:0;for(this.clear();++Xe<yt;){var zt=Se[Xe];this.set(zt[0],zt[1])}}function Tt(){this.__data__=[]}function Ut(Se){var Xe=this.__data__,yt=En(Xe,Se);if(yt<0)return!1;var zt=Xe.length-1;return yt==zt?Xe.pop():Te.call(Xe,yt,1),!0}function De(Se){var Xe=this.__data__,yt=En(Xe,Se);return yt<0?void 0:Xe[yt][1]}function rt(Se){return En(this.__data__,Se)>-1}function Je(Se,Xe){var yt=this.__data__,zt=En(yt,Se);return zt<0?yt.push([Se,Xe]):yt[zt][1]=Xe,this}Ot.prototype.clear=Tt,Ot.prototype.delete=Ut,Ot.prototype.get=De,Ot.prototype.has=rt,Ot.prototype.set=Je;function Ie(Se){var Xe=-1,yt=Se?Se.length:0;for(this.clear();++Xe<yt;){var zt=Se[Xe];this.set(zt[0],zt[1])}}function at(){this.__data__={hash:new Dt,map:new(re||Ot),string:new Dt}}function gt(Se){return Ar(this,Se).delete(Se)}function Xt(Se){return Ar(this,Se).get(Se)}function pn(Se){return Ar(this,Se).has(Se)}function $n(Se,Xe){return Ar(this,Se).set(Se,Xe),this}Ie.prototype.clear=at,Ie.prototype.delete=gt,Ie.prototype.get=Xt,Ie.prototype.has=pn,Ie.prototype.set=$n;function dr(Se){var Xe=-1,yt=Se?Se.length:0;for(this.__data__=new Ie;++Xe<yt;)this.add(Se[Xe])}function tr(Se){return this.__data__.set(Se,i),this}function rr(Se){return this.__data__.has(Se)}dr.prototype.add=dr.prototype.push=tr,dr.prototype.has=rr;function un(Se){this.__data__=new Ot(Se)}function kn(){this.__data__=new Ot}function kr(Se){return this.__data__.delete(Se)}function $t(Se){return this.__data__.get(Se)}function Jt(Se){return this.__data__.has(Se)}function zn(Se,Xe){var yt=this.__data__;if(yt instanceof Ot){var zt=yt.__data__;if(!re||zt.length<n-1)return zt.push([Se,Xe]),this;yt=this.__data__=new Ie(zt)}return yt.set(Se,Xe),this}un.prototype.clear=kn,un.prototype.delete=kr,un.prototype.get=$t,un.prototype.has=Jt,un.prototype.set=zn;function Rn(Se,Xe){var yt=fr(Se)||Dn(Se)?ae(Se.length,String):[],zt=yt.length,bn=!!zt;for(var fn in Se)tt.call(Se,fn)&&!(bn&&(fn=="length"||Zs(fn,zt)))&&yt.push(fn);return yt}function En(Se,Xe){for(var yt=Se.length;yt--;)if(nr(Se[yt][0],Xe))return yt;return-1}function Fn(Se,Xe,yt,zt){return Kn(Se,function(bn,fn,Bn){Xe(zt,bn,yt(bn),Bn)}),zt}var Kn=Ms(Gr),Hn=Ks();function Gr(Se,Xe){return Se&&Hn(Se,Xe,Mt)}function Rr(Se,Xe){Xe=Fs(Xe,Se)?[Xe]:ci(Xe);for(var yt=0,zt=Xe.length;Se!=null&&yt<zt;)Se=Se[fe(Xe[yt++])];return yt&&yt==zt?Se:void 0}function ei(Se){return je.call(Se)}function wi(Se,Xe){return Se!=null&&Xe in Object(Se)}function Zi(Se,Xe,yt,zt,bn){return Se===Xe?!0:Se==null||Xe==null||!yo(Se)&&!Oi(Xe)?Se!==Se&&Xe!==Xe:ir(Se,Xe,Zi,yt,zt,bn)}function ir(Se,Xe,yt,zt,bn,fn){var Bn=fr(Se),$r=fr(Xe),Kr=u,yi=u;Bn||(Kr=di(Se),Kr=Kr==l?E:Kr),$r||(yi=di(Xe),yi=yi==l?E:yi);var io=Kr==E&&!ue(Se),eo=yi==E&&!ue(Xe),oo=Kr==yi;if(oo&&!io)return fn||(fn=new un),Bn||To(Se)?us(Se,Xe,yt,zt,bn,fn):Wr(Se,Xe,Kr,yt,zt,bn,fn);if(!(bn&s)){var Bs=io&&tt.call(Se,"__wrapped__"),qo=eo&&tt.call(Xe,"__wrapped__");if(Bs||qo){var Aa=Bs?Se.value():Se,Yl=qo?Xe.value():Xe;return fn||(fn=new un),yt(Aa,Yl,zt,bn,fn)}}return oo?(fn||(fn=new un),Wa(Se,Xe,yt,zt,bn,fn)):!1}function Oo(Se,Xe,yt,zt){var bn=yt.length,fn=bn;if(Se==null)return!fn;for(Se=Object(Se);bn--;){var Bn=yt[bn];if(Bn[2]?Bn[1]!==Se[Bn[0]]:!(Bn[0]in Se))return!1}for(;++bn<fn;){Bn=yt[bn];var $r=Bn[0],Kr=Se[$r],yi=Bn[1];if(Bn[2]){if(Kr===void 0&&!($r in Se))return!1}else{var io=new un,eo;if(!(eo===void 0?Zi(yi,Kr,zt,o|s,io):eo))return!1}}return!0}function oe(Se){if(!yo(Se)||cs(Se))return!1;var Xe=Qr(Se)||ue(Se)?qe:j;return Xe.test(Me(Se))}function ve(Se){return Oi(Se)&&po(Se.length)&&!!q[je.call(Se)]}function He(Se){return typeof Se=="function"?Se:Se==null?sn:typeof Se=="object"?fr(Se)?nn(Se[0],Se[1]):Rt(Se):er(Se)}function lt(Se){if(!Js(Se))return _e(Se);var Xe=[];for(var yt in Object(Se))tt.call(Se,yt)&&yt!="constructor"&&Xe.push(yt);return Xe}function Rt(Se){var Xe=li(Se);return Xe.length==1&&Xe[0][2]?ql(Xe[0][0],Xe[0][1]):function(yt){return yt===Se||Oo(yt,Se,Xe)}}function nn(Se,Xe){return Fs(Se)&&Qa(Xe)?ql(fe(Se),Xe):function(yt){var zt=Ne(yt,Se);return zt===void 0&&zt===Xe?et(yt,Se):Zi(Xe,zt,void 0,o|s)}}function or(Se){return function(Xe){return Rr(Xe,Se)}}function Jn(Se){if(typeof Se=="string")return Se;if(ho(Se))return Ft?Ft.call(Se):"";var Xe=Se+"";return Xe=="0"&&1/Se==-1/0?"-0":Xe}function ci(Se){return fr(Se)?Se:wd(Se)}function Mr(Se,Xe){return function(yt,zt){var bn=fr(yt)?Ae:Fn,fn={};return bn(yt,Se,He(zt),fn)}}function Ms(Se,Xe){return function(yt,zt){if(yt==null)return yt;if(!xr(yt))return Se(yt,zt);for(var bn=yt.length,fn=-1,Bn=Object(yt);++fn<bn&&zt(Bn[fn],fn,Bn)!==!1;);return yt}}function Ks(Se){return function(Xe,yt,zt){for(var bn=-1,fn=Object(Xe),Bn=zt(Xe),$r=Bn.length;$r--;){var Kr=Bn[++bn];if(yt(fn[Kr],Kr,fn)===!1)break}return Xe}}function us(Se,Xe,yt,zt,bn,fn){var Bn=bn&s,$r=Se.length,Kr=Xe.length;if($r!=Kr&&!(Bn&&Kr>$r))return!1;var yi=fn.get(Se);if(yi&&fn.get(Xe))return yi==Xe;var io=-1,eo=!0,oo=bn&o?new dr:void 0;for(fn.set(Se,Xe),fn.set(Xe,Se);++io<$r;){var Bs=Se[io],qo=Xe[io];if(zt)var Aa=Bn?zt(qo,Bs,io,Xe,Se,fn):zt(Bs,qo,io,Se,Xe,fn);if(Aa!==void 0){if(Aa)continue;eo=!1;break}if(oo){if(!te(Xe,function(Yl,Id){if(!oo.has(Id)&&(Bs===Yl||yt(Bs,Yl,zt,bn,fn)))return oo.add(Id)})){eo=!1;break}}else if(!(Bs===qo||yt(Bs,qo,zt,bn,fn))){eo=!1;break}}return fn.delete(Se),fn.delete(Xe),eo}function Wr(Se,Xe,yt,zt,bn,fn,Bn){switch(yt){case D:if(Se.byteLength!=Xe.byteLength||Se.byteOffset!=Xe.byteOffset)return!1;Se=Se.buffer,Xe=Xe.buffer;case w:return!(Se.byteLength!=Xe.byteLength||!zt(new Ye(Se),new Ye(Xe)));case c:case d:case m:return nr(+Se,+Xe);case p:return Se.name==Xe.name&&Se.message==Xe.message;case T:case _:return Se==Xe+"";case g:var $r=Ee;case v:var Kr=fn&s;if($r||($r=me),Se.size!=Xe.size&&!Kr)return!1;var yi=Bn.get(Se);if(yi)return yi==Xe;fn|=o,Bn.set(Se,Xe);var io=us($r(Se),$r(Xe),zt,bn,fn,Bn);return Bn.delete(Se),io;case x:if(wt)return wt.call(Se)==wt.call(Xe)}return!1}function Wa(Se,Xe,yt,zt,bn,fn){var Bn=bn&s,$r=Mt(Se),Kr=$r.length,yi=Mt(Xe),io=yi.length;if(Kr!=io&&!Bn)return!1;for(var eo=Kr;eo--;){var oo=$r[eo];if(!(Bn?oo in Xe:tt.call(Xe,oo)))return!1}var Bs=fn.get(Se);if(Bs&&fn.get(Xe))return Bs==Xe;var qo=!0;fn.set(Se,Xe),fn.set(Xe,Se);for(var Aa=Bn;++eo<Kr;){oo=$r[eo];var Yl=Se[oo],Id=Xe[oo];if(zt)var We=Bn?zt(Id,Yl,oo,Xe,Se,fn):zt(Yl,Id,oo,Se,Xe,fn);if(!(We===void 0?Yl===Id||yt(Yl,Id,zt,bn,fn):We)){qo=!1;break}Aa||(Aa=oo=="constructor")}if(qo&&!Aa){var ut=Se.constructor,ft=Xe.constructor;ut!=ft&&"constructor"in Se&&"constructor"in Xe&&!(typeof ut=="function"&&ut instanceof ut&&typeof ft=="function"&&ft instanceof ft)&&(qo=!1)}return fn.delete(Se),fn.delete(Xe),qo}function Ar(Se,Xe){var yt=Se.__data__;return _c(Xe)?yt[typeof Xe=="string"?"string":"hash"]:yt.map}function li(Se){for(var Xe=Mt(Se),yt=Xe.length;yt--;){var zt=Xe[yt],bn=Se[zt];Xe[yt]=[zt,bn,Qa(bn)]}return Xe}function Br(Se,Xe){var yt=se(Se,Xe);return oe(yt)?yt:void 0}var di=ei;(we&&di(new we(new ArrayBuffer(1)))!=D||re&&di(new re)!=g||he&&di(he.resolve())!=y||be&&di(new be)!=v||Ue&&di(new Ue)!=b)&&(di=function(Se){var Xe=je.call(Se),yt=Xe==E?Se.constructor:void 0,zt=yt?Me(yt):void 0;if(zt)switch(zt){case Ge:return D;case mt:return g;case _t:return y;case Ce:return v;case ot:return b}return Xe});function vs(Se,Xe,yt){Xe=Fs(Xe,Se)?[Xe]:ci(Xe);for(var zt,bn=-1,Bn=Xe.length;++bn<Bn;){var fn=fe(Xe[bn]);if(!(zt=Se!=null&&yt(Se,fn)))break;Se=Se[fn]}if(zt)return zt;var Bn=Se?Se.length:0;return!!Bn&&po(Bn)&&Zs(fn,Bn)&&(fr(Se)||Dn(Se))}function Zs(Se,Xe){return Xe=Xe??a,!!Xe&&(typeof Se=="number"||Y.test(Se))&&Se>-1&&Se%1==0&&Se<Xe}function Fs(Se,Xe){if(fr(Se))return!1;var yt=typeof Se;return yt=="number"||yt=="symbol"||yt=="boolean"||Se==null||ho(Se)?!0:F.test(Se)||!K.test(Se)||Xe!=null&&Se in Object(Xe)}function _c(Se){var Xe=typeof Se;return Xe=="string"||Xe=="number"||Xe=="symbol"||Xe=="boolean"?Se!=="__proto__":Se===null}function cs(Se){return!!Ve&&Ve in Se}function Js(Se){var Xe=Se&&Se.constructor,yt=typeof Xe=="function"&&Xe.prototype||Oe;return Se===yt}function Qa(Se){return Se===Se&&!yo(Se)}function ql(Se,Xe){return function(yt){return yt==null?!1:yt[Se]===Xe&&(Xe!==void 0||Se in Object(yt))}}var wd=kt(function(Se){Se=za(Se);var Xe=[];return V.test(Se)&&Xe.push(""),Se.replace(W,function(yt,zt,bn,fn){Xe.push(bn?fn.replace($,"$1"):zt||yt)}),Xe});function fe(Se){if(typeof Se=="string"||ho(Se))return Se;var Xe=Se+"";return Xe=="0"&&1/Se==-1/0?"-0":Xe}function Me(Se){if(Se!=null){try{return Be.call(Se)}catch{}try{return Se+""}catch{}}return""}var it=Mr(function(Se,Xe,yt){tt.call(Se,yt)?Se[yt].push(Xe):Se[yt]=[Xe]});function kt(Se,Xe){if(typeof Se!="function"||Xe&&typeof Xe!="function")throw new TypeError(r);var yt=function(){var zt=arguments,bn=Xe?Xe.apply(this,zt):zt[0],fn=yt.cache;if(fn.has(bn))return fn.get(bn);var Bn=Se.apply(this,zt);return yt.cache=fn.set(bn,Bn),Bn};return yt.cache=new(kt.Cache||Ie),yt}kt.Cache=Ie;function nr(Se,Xe){return Se===Xe||Se!==Se&&Xe!==Xe}function Dn(Se){return Ji(Se)&&tt.call(Se,"callee")&&(!Ke.call(Se,"callee")||je.call(Se)==l)}var fr=Array.isArray;function xr(Se){return Se!=null&&po(Se.length)&&!Qr(Se)}function Ji(Se){return Oi(Se)&&xr(Se)}function Qr(Se){var Xe=yo(Se)?je.call(Se):"";return Xe==h||Xe==A}function po(Se){return typeof Se=="number"&&Se>-1&&Se%1==0&&Se<=a}function yo(Se){var Xe=typeof Se;return!!Se&&(Xe=="object"||Xe=="function")}function Oi(Se){return!!Se&&typeof Se=="object"}function ho(Se){return typeof Se=="symbol"||Oi(Se)&&je.call(Se)==x}var To=de?ne(de):ve;function za(Se){return Se==null?"":Jn(Se)}function Ne(Se,Xe,yt){var zt=Se==null?void 0:Rr(Se,Xe);return zt===void 0?yt:zt}function et(Se,Xe){return Se!=null&&vs(Se,Xe,wi)}function Mt(Se){return xr(Se)?Rn(Se):lt(Se)}function sn(Se){return Se}function er(Se){return Fs(Se)?J(fe(Se)):or(Se)}e.exports=it})(Yg,Yg.exports)),Yg.exports}var nje=tje();const FN=ii(nje);var Kg={exports:{}};Kg.exports;var FY;function rje(){return FY||(FY=1,(function(e,t){var n=200,r="Expected a function",i="__lodash_hash_undefined__",o=1,s=2,a=9007199254740991,l="[object Arguments]",u="[object Array]",c="[object Boolean]",d="[object Date]",p="[object Error]",h="[object Function]",A="[object GeneratorFunction]",g="[object Map]",m="[object Number]",E="[object Object]",y="[object Promise]",T="[object RegExp]",v="[object Set]",_="[object String]",x="[object Symbol]",b="[object WeakMap]",w="[object ArrayBuffer]",D="[object DataView]",I="[object Float32Array]",P="[object Float64Array]",k="[object Int8Array]",N="[object Int16Array]",L="[object Int32Array]",M="[object Uint8Array]",B="[object Uint8ClampedArray]",G="[object Uint16Array]",Q="[object Uint32Array]",K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,F=/^\w*$/,V=/^\./,W=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,R=/[\\^$.*+?()[\]{}|]/g,$=/\\(\\)?/g,j=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,q={};q[I]=q[P]=q[k]=q[N]=q[L]=q[M]=q[B]=q[G]=q[Q]=!0,q[l]=q[u]=q[w]=q[c]=q[D]=q[d]=q[p]=q[h]=q[g]=q[m]=q[E]=q[T]=q[v]=q[_]=q[b]=!1;var H=typeof jn=="object"&&jn&&jn.Object===Object&&jn,U=typeof self=="object"&&self&&self.Object===Object&&self,X=H||U||Function("return this")(),ee=t&&!t.nodeType&&t,Z=ee&&!0&&e&&!e.nodeType&&e,le=Z&&Z.exports===ee,z=le&&H.process,ie=(function(){try{return z&&z.binding("util")}catch{}})(),de=ie&&ie.isTypedArray;function Ae(Ne,et){for(var Mt=-1,sn=Ne?Ne.length:0;++Mt<sn;)if(et(Ne[Mt],Mt,Ne))return!0;return!1}function te(Ne){return function(et){return et?.[Ne]}}function J(Ne,et){for(var Mt=-1,sn=Array(Ne);++Mt<Ne;)sn[Mt]=et(Mt);return sn}function ae(Ne){return function(et){return Ne(et)}}function ne(Ne,et){return Ne?.[et]}function se(Ne){var et=!1;if(Ne!=null&&typeof Ne.toString!="function")try{et=!!(Ne+"")}catch{}return et}function ue(Ne){var et=-1,Mt=Array(Ne.size);return Ne.forEach(function(sn,er){Mt[++et]=[er,sn]}),Mt}function Ee(Ne,et){return function(Mt){return Ne(et(Mt))}}function pe(Ne){var et=-1,Mt=Array(Ne.size);return Ne.forEach(function(sn){Mt[++et]=sn}),Mt}var me=Array.prototype,xe=Function.prototype,ge=Object.prototype,Oe=X["__core-js_shared__"],$e=(function(){var Ne=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||"");return Ne?"Symbol(src)_1."+Ne:""})(),Ve=xe.toString,Be=ge.hasOwnProperty,tt=ge.toString,je=RegExp("^"+Ve.call(Be).replace(R,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qe=X.Symbol,Le=X.Uint8Array,Ye=ge.propertyIsEnumerable,Ke=me.splice,Te=Ee(Object.keys,Object),_e=us(X,"DataView"),we=us(X,"Map"),re=us(X,"Promise"),he=us(X,"Set"),be=us(X,"WeakMap"),Ue=us(Object,"create"),Pe=Js(_e),Ge=Js(we),mt=Js(re),_t=Js(he),Ce=Js(be),ot=qe?qe.prototype:void 0,At=ot?ot.valueOf:void 0,wt=ot?ot.toString:void 0;function Ft(Ne){var et=-1,Mt=Ne?Ne.length:0;for(this.clear();++et<Mt;){var sn=Ne[et];this.set(sn[0],sn[1])}}function Dt(){this.__data__=Ue?Ue(null):{}}function Bt(Ne){return this.has(Ne)&&delete this.__data__[Ne]}function Re(Ne){var et=this.__data__;if(Ue){var Mt=et[Ne];return Mt===i?void 0:Mt}return Be.call(et,Ne)?et[Ne]:void 0}function nt(Ne){var et=this.__data__;return Ue?et[Ne]!==void 0:Be.call(et,Ne)}function Qe(Ne,et){var Mt=this.__data__;return Mt[Ne]=Ue&&et===void 0?i:et,this}Ft.prototype.clear=Dt,Ft.prototype.delete=Bt,Ft.prototype.get=Re,Ft.prototype.has=nt,Ft.prototype.set=Qe;function st(Ne){var et=-1,Mt=Ne?Ne.length:0;for(this.clear();++et<Mt;){var sn=Ne[et];this.set(sn[0],sn[1])}}function Ot(){this.__data__=[]}function Tt(Ne){var et=this.__data__,Mt=Rn(et,Ne);if(Mt<0)return!1;var sn=et.length-1;return Mt==sn?et.pop():Ke.call(et,Mt,1),!0}function Ut(Ne){var et=this.__data__,Mt=Rn(et,Ne);return Mt<0?void 0:et[Mt][1]}function De(Ne){return Rn(this.__data__,Ne)>-1}function rt(Ne,et){var Mt=this.__data__,sn=Rn(Mt,Ne);return sn<0?Mt.push([Ne,et]):Mt[sn][1]=et,this}st.prototype.clear=Ot,st.prototype.delete=Tt,st.prototype.get=Ut,st.prototype.has=De,st.prototype.set=rt;function Je(Ne){var et=-1,Mt=Ne?Ne.length:0;for(this.clear();++et<Mt;){var sn=Ne[et];this.set(sn[0],sn[1])}}function Ie(){this.__data__={hash:new Ft,map:new(we||st),string:new Ft}}function at(Ne){return Ms(this,Ne).delete(Ne)}function gt(Ne){return Ms(this,Ne).get(Ne)}function Xt(Ne){return Ms(this,Ne).has(Ne)}function pn(Ne,et){return Ms(this,Ne).set(Ne,et),this}Je.prototype.clear=Ie,Je.prototype.delete=at,Je.prototype.get=gt,Je.prototype.has=Xt,Je.prototype.set=pn;function $n(Ne){var et=-1,Mt=Ne?Ne.length:0;for(this.__data__=new Je;++et<Mt;)this.add(Ne[et])}function dr(Ne){return this.__data__.set(Ne,i),this}function tr(Ne){return this.__data__.has(Ne)}$n.prototype.add=$n.prototype.push=dr,$n.prototype.has=tr;function rr(Ne){this.__data__=new st(Ne)}function un(){this.__data__=new st}function kn(Ne){return this.__data__.delete(Ne)}function kr(Ne){return this.__data__.get(Ne)}function $t(Ne){return this.__data__.has(Ne)}function Jt(Ne,et){var Mt=this.__data__;if(Mt instanceof st){var sn=Mt.__data__;if(!we||sn.length<n-1)return sn.push([Ne,et]),this;Mt=this.__data__=new Je(sn)}return Mt.set(Ne,et),this}rr.prototype.clear=un,rr.prototype.delete=kn,rr.prototype.get=kr,rr.prototype.has=$t,rr.prototype.set=Jt;function zn(Ne,et){var Mt=fe(Ne)||wd(Ne)?J(Ne.length,String):[],sn=Mt.length,er=!!sn;for(var Se in Ne)Be.call(Ne,Se)&&!(er&&(Se=="length"||Ar(Se,sn)))&&Mt.push(Se);return Mt}function Rn(Ne,et){for(var Mt=Ne.length;Mt--;)if(ql(Ne[Mt][0],et))return Mt;return-1}var En=or();function Fn(Ne,et){return Ne&&En(Ne,et,Oi)}function Kn(Ne,et){et=li(et,Ne)?[et]:nn(et);for(var Mt=0,sn=et.length;Ne!=null&&Mt<sn;)Ne=Ne[cs(et[Mt++])];return Mt&&Mt==sn?Ne:void 0}function Hn(Ne){return tt.call(Ne)}function Gr(Ne,et){return Ne!=null&&et in Object(Ne)}function Rr(Ne,et,Mt,sn,er){return Ne===et?!0:Ne==null||et==null||!Dn(Ne)&&!fr(et)?Ne!==Ne&&et!==et:ei(Ne,et,Rr,Mt,sn,er)}function ei(Ne,et,Mt,sn,er,Se){var Xe=fe(Ne),yt=fe(et),zt=u,bn=u;Xe||(zt=Wr(Ne),zt=zt==l?E:zt),yt||(bn=Wr(et),bn=bn==l?E:bn);var fn=zt==E&&!se(Ne),Bn=bn==E&&!se(et),$r=zt==bn;if($r&&!fn)return Se||(Se=new rr),Xe||Ji(Ne)?Jn(Ne,et,Mt,sn,er,Se):ci(Ne,et,zt,Mt,sn,er,Se);if(!(er&s)){var Kr=fn&&Be.call(Ne,"__wrapped__"),yi=Bn&&Be.call(et,"__wrapped__");if(Kr||yi){var io=Kr?Ne.value():Ne,eo=yi?et.value():et;return Se||(Se=new rr),Mt(io,eo,sn,er,Se)}}return $r?(Se||(Se=new rr),Mr(Ne,et,Mt,sn,er,Se)):!1}function wi(Ne,et,Mt,sn){var er=Mt.length,Se=er;if(Ne==null)return!Se;for(Ne=Object(Ne);er--;){var Xe=Mt[er];if(Xe[2]?Xe[1]!==Ne[Xe[0]]:!(Xe[0]in Ne))return!1}for(;++er<Se;){Xe=Mt[er];var yt=Xe[0],zt=Ne[yt],bn=Xe[1];if(Xe[2]){if(zt===void 0&&!(yt in Ne))return!1}else{var fn=new rr,Bn;if(!(Bn===void 0?Rr(bn,zt,sn,o|s,fn):Bn))return!1}}return!0}function Zi(Ne){if(!Dn(Ne)||di(Ne))return!1;var et=kt(Ne)||se(Ne)?je:j;return et.test(Js(Ne))}function ir(Ne){return fr(Ne)&&nr(Ne.length)&&!!q[tt.call(Ne)]}function Oo(Ne){return typeof Ne=="function"?Ne:Ne==null?To:typeof Ne=="object"?fe(Ne)?He(Ne[0],Ne[1]):ve(Ne):za(Ne)}function oe(Ne){if(!vs(Ne))return Te(Ne);var et=[];for(var Mt in Object(Ne))Be.call(Ne,Mt)&&Mt!="constructor"&&et.push(Mt);return et}function ve(Ne){var et=Ks(Ne);return et.length==1&&et[0][2]?Fs(et[0][0],et[0][1]):function(Mt){return Mt===Ne||wi(Mt,Ne,et)}}function He(Ne,et){return li(Ne)&&Zs(et)?Fs(cs(Ne),et):function(Mt){var sn=po(Mt,Ne);return sn===void 0&&sn===et?yo(Mt,Ne):Rr(et,sn,void 0,o|s)}}function lt(Ne){return function(et){return Kn(et,Ne)}}function Rt(Ne){if(typeof Ne=="string")return Ne;if(xr(Ne))return wt?wt.call(Ne):"";var et=Ne+"";return et=="0"&&1/Ne==-1/0?"-0":et}function nn(Ne){return fe(Ne)?Ne:_c(Ne)}function or(Ne){return function(et,Mt,sn){for(var er=-1,Se=Object(et),Xe=sn(et),yt=Xe.length;yt--;){var zt=Xe[++er];if(Mt(Se[zt],zt,Se)===!1)break}return et}}function Jn(Ne,et,Mt,sn,er,Se){var Xe=er&s,yt=Ne.length,zt=et.length;if(yt!=zt&&!(Xe&&zt>yt))return!1;var bn=Se.get(Ne);if(bn&&Se.get(et))return bn==et;var fn=-1,Bn=!0,$r=er&o?new $n:void 0;for(Se.set(Ne,et),Se.set(et,Ne);++fn<yt;){var Kr=Ne[fn],yi=et[fn];if(sn)var io=Xe?sn(yi,Kr,fn,et,Ne,Se):sn(Kr,yi,fn,Ne,et,Se);if(io!==void 0){if(io)continue;Bn=!1;break}if($r){if(!Ae(et,function(eo,oo){if(!$r.has(oo)&&(Kr===eo||Mt(Kr,eo,sn,er,Se)))return $r.add(oo)})){Bn=!1;break}}else if(!(Kr===yi||Mt(Kr,yi,sn,er,Se))){Bn=!1;break}}return Se.delete(Ne),Se.delete(et),Bn}function ci(Ne,et,Mt,sn,er,Se,Xe){switch(Mt){case D:if(Ne.byteLength!=et.byteLength||Ne.byteOffset!=et.byteOffset)return!1;Ne=Ne.buffer,et=et.buffer;case w:return!(Ne.byteLength!=et.byteLength||!sn(new Le(Ne),new Le(et)));case c:case d:case m:return ql(+Ne,+et);case p:return Ne.name==et.name&&Ne.message==et.message;case T:case _:return Ne==et+"";case g:var yt=ue;case v:var zt=Se&s;if(yt||(yt=pe),Ne.size!=et.size&&!zt)return!1;var bn=Xe.get(Ne);if(bn)return bn==et;Se|=o,Xe.set(Ne,et);var fn=Jn(yt(Ne),yt(et),sn,er,Se,Xe);return Xe.delete(Ne),fn;case x:if(At)return At.call(Ne)==At.call(et)}return!1}function Mr(Ne,et,Mt,sn,er,Se){var Xe=er&s,yt=Oi(Ne),zt=yt.length,bn=Oi(et),fn=bn.length;if(zt!=fn&&!Xe)return!1;for(var Bn=zt;Bn--;){var $r=yt[Bn];if(!(Xe?$r in et:Be.call(et,$r)))return!1}var Kr=Se.get(Ne);if(Kr&&Se.get(et))return Kr==et;var yi=!0;Se.set(Ne,et),Se.set(et,Ne);for(var io=Xe;++Bn<zt;){$r=yt[Bn];var eo=Ne[$r],oo=et[$r];if(sn)var Bs=Xe?sn(oo,eo,$r,et,Ne,Se):sn(eo,oo,$r,Ne,et,Se);if(!(Bs===void 0?eo===oo||Mt(eo,oo,sn,er,Se):Bs)){yi=!1;break}io||(io=$r=="constructor")}if(yi&&!io){var qo=Ne.constructor,Aa=et.constructor;qo!=Aa&&"constructor"in Ne&&"constructor"in et&&!(typeof qo=="function"&&qo instanceof qo&&typeof Aa=="function"&&Aa instanceof Aa)&&(yi=!1)}return Se.delete(Ne),Se.delete(et),yi}function Ms(Ne,et){var Mt=Ne.__data__;return Br(et)?Mt[typeof et=="string"?"string":"hash"]:Mt.map}function Ks(Ne){for(var et=Oi(Ne),Mt=et.length;Mt--;){var sn=et[Mt],er=Ne[sn];et[Mt]=[sn,er,Zs(er)]}return et}function us(Ne,et){var Mt=ne(Ne,et);return Zi(Mt)?Mt:void 0}var Wr=Hn;(_e&&Wr(new _e(new ArrayBuffer(1)))!=D||we&&Wr(new we)!=g||re&&Wr(re.resolve())!=y||he&&Wr(new he)!=v||be&&Wr(new be)!=b)&&(Wr=function(Ne){var et=tt.call(Ne),Mt=et==E?Ne.constructor:void 0,sn=Mt?Js(Mt):void 0;if(sn)switch(sn){case Pe:return D;case Ge:return g;case mt:return y;case _t:return v;case Ce:return b}return et});function Wa(Ne,et,Mt){et=li(et,Ne)?[et]:nn(et);for(var sn,er=-1,Xe=et.length;++er<Xe;){var Se=cs(et[er]);if(!(sn=Ne!=null&&Mt(Ne,Se)))break;Ne=Ne[Se]}if(sn)return sn;var Xe=Ne?Ne.length:0;return!!Xe&&nr(Xe)&&Ar(Se,Xe)&&(fe(Ne)||wd(Ne))}function Ar(Ne,et){return et=et??a,!!et&&(typeof Ne=="number"||Y.test(Ne))&&Ne>-1&&Ne%1==0&&Ne<et}function li(Ne,et){if(fe(Ne))return!1;var Mt=typeof Ne;return Mt=="number"||Mt=="symbol"||Mt=="boolean"||Ne==null||xr(Ne)?!0:F.test(Ne)||!K.test(Ne)||et!=null&&Ne in Object(et)}function Br(Ne){var et=typeof Ne;return et=="string"||et=="number"||et=="symbol"||et=="boolean"?Ne!=="__proto__":Ne===null}function di(Ne){return!!$e&&$e in Ne}function vs(Ne){var et=Ne&&Ne.constructor,Mt=typeof et=="function"&&et.prototype||ge;return Ne===Mt}function Zs(Ne){return Ne===Ne&&!Dn(Ne)}function Fs(Ne,et){return function(Mt){return Mt==null?!1:Mt[Ne]===et&&(et!==void 0||Ne in Object(Mt))}}var _c=Qa(function(Ne){Ne=Qr(Ne);var et=[];return V.test(Ne)&&et.push(""),Ne.replace(W,function(Mt,sn,er,Se){et.push(er?Se.replace($,"$1"):sn||Mt)}),et});function cs(Ne){if(typeof Ne=="string"||xr(Ne))return Ne;var et=Ne+"";return et=="0"&&1/Ne==-1/0?"-0":et}function Js(Ne){if(Ne!=null){try{return Ve.call(Ne)}catch{}try{return Ne+""}catch{}}return""}function Qa(Ne,et){if(typeof Ne!="function"||et&&typeof et!="function")throw new TypeError(r);var Mt=function(){var sn=arguments,er=et?et.apply(this,sn):sn[0],Se=Mt.cache;if(Se.has(er))return Se.get(er);var Xe=Ne.apply(this,sn);return Mt.cache=Se.set(er,Xe),Xe};return Mt.cache=new(Qa.Cache||Je),Mt}Qa.Cache=Je;function ql(Ne,et){return Ne===et||Ne!==Ne&&et!==et}function wd(Ne){return it(Ne)&&Be.call(Ne,"callee")&&(!Ye.call(Ne,"callee")||tt.call(Ne)==l)}var fe=Array.isArray;function Me(Ne){return Ne!=null&&nr(Ne.length)&&!kt(Ne)}function it(Ne){return fr(Ne)&&Me(Ne)}function kt(Ne){var et=Dn(Ne)?tt.call(Ne):"";return et==h||et==A}function nr(Ne){return typeof Ne=="number"&&Ne>-1&&Ne%1==0&&Ne<=a}function Dn(Ne){var et=typeof Ne;return!!Ne&&(et=="object"||et=="function")}function fr(Ne){return!!Ne&&typeof Ne=="object"}function xr(Ne){return typeof Ne=="symbol"||fr(Ne)&&tt.call(Ne)==x}var Ji=de?ae(de):ir;function Qr(Ne){return Ne==null?"":Rt(Ne)}function po(Ne,et,Mt){var sn=Ne==null?void 0:Kn(Ne,et);return sn===void 0?Mt:sn}function yo(Ne,et){return Ne!=null&&Wa(Ne,et,Gr)}function Oi(Ne){return Me(Ne)?zn(Ne):oe(Ne)}function ho(Ne,et){var Mt={};return et=Oo(et),Fn(Ne,function(sn,er,Se){Mt[er]=et(sn,er,Se)}),Mt}function To(Ne){return Ne}function za(Ne){return li(Ne)?te(cs(Ne)):lt(Ne)}e.exports=ho})(Kg,Kg.exports)),Kg.exports}var ije=rje();const oje=ii(ije);var BN,BY;function sje(){if(BY)return BN;BY=1;var e=200,t="__lodash_hash_undefined__",n=9007199254740991,r="[object Arguments]",i="[object Function]",o="[object GeneratorFunction]",s="[object Symbol]",a=/[\\^$.*+?()[\]{}|]/g,l=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,c=typeof jn=="object"&&jn&&jn.Object===Object&&jn,d=typeof self=="object"&&self&&self.Object===Object&&self,p=c||d||Function("return this")();function h(De,rt,Je){switch(Je.length){case 0:return De.call(rt);case 1:return De.call(rt,Je[0]);case 2:return De.call(rt,Je[0],Je[1]);case 3:return De.call(rt,Je[0],Je[1],Je[2])}return De.apply(rt,Je)}function A(De,rt){var Je=De?De.length:0;return!!Je&&y(De,rt,0)>-1}function g(De,rt){for(var Je=-1,Ie=De?De.length:0,at=Array(Ie);++Je<Ie;)at[Je]=rt(De[Je],Je,De);return at}function m(De,rt){for(var Je=-1,Ie=rt.length,at=De.length;++Je<Ie;)De[at+Je]=rt[Je];return De}function E(De,rt,Je,Ie){for(var at=De.length,gt=Je+-1;++gt<at;)if(rt(De[gt],gt,De))return gt;return-1}function y(De,rt,Je){if(rt!==rt)return E(De,T,Je);for(var Ie=Je-1,at=De.length;++Ie<at;)if(De[Ie]===rt)return Ie;return-1}function T(De){return De!==De}function v(De,rt){for(var Je=-1,Ie=Array(De);++Je<De;)Ie[Je]=rt(Je);return Ie}function _(De,rt){return De.has(rt)}function x(De,rt){return De?.[rt]}function b(De){var rt=!1;if(De!=null&&typeof De.toString!="function")try{rt=!!(De+"")}catch{}return rt}function w(De,rt){return function(Je){return De(rt(Je))}}var D=Array.prototype,I=Function.prototype,P=Object.prototype,k=p["__core-js_shared__"],N=(function(){var De=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||"");return De?"Symbol(src)_1."+De:""})(),L=I.toString,M=P.hasOwnProperty,B=P.toString,G=RegExp("^"+L.call(M).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Q=p.Symbol,K=w(Object.getPrototypeOf,Object),F=P.propertyIsEnumerable,V=D.splice,W=Q?Q.isConcatSpreadable:void 0,R=Object.getOwnPropertySymbols,$=Math.max,j=_e(p,"Map"),Y=_e(Object,"create");function q(De){var rt=-1,Je=De?De.length:0;for(this.clear();++rt<Je;){var Ie=De[rt];this.set(Ie[0],Ie[1])}}function H(){this.__data__=Y?Y(null):{}}function U(De){return this.has(De)&&delete this.__data__[De]}function X(De){var rt=this.__data__;if(Y){var Je=rt[De];return Je===t?void 0:Je}return M.call(rt,De)?rt[De]:void 0}function ee(De){var rt=this.__data__;return Y?rt[De]!==void 0:M.call(rt,De)}function Z(De,rt){var Je=this.__data__;return Je[De]=Y&&rt===void 0?t:rt,this}q.prototype.clear=H,q.prototype.delete=U,q.prototype.get=X,q.prototype.has=ee,q.prototype.set=Z;function le(De){var rt=-1,Je=De?De.length:0;for(this.clear();++rt<Je;){var Ie=De[rt];this.set(Ie[0],Ie[1])}}function z(){this.__data__=[]}function ie(De){var rt=this.__data__,Je=Oe(rt,De);if(Je<0)return!1;var Ie=rt.length-1;return Je==Ie?rt.pop():V.call(rt,Je,1),!0}function de(De){var rt=this.__data__,Je=Oe(rt,De);return Je<0?void 0:rt[Je][1]}function Ae(De){return Oe(this.__data__,De)>-1}function te(De,rt){var Je=this.__data__,Ie=Oe(Je,De);return Ie<0?Je.push([De,rt]):Je[Ie][1]=rt,this}le.prototype.clear=z,le.prototype.delete=ie,le.prototype.get=de,le.prototype.has=Ae,le.prototype.set=te;function J(De){var rt=-1,Je=De?De.length:0;for(this.clear();++rt<Je;){var Ie=De[rt];this.set(Ie[0],Ie[1])}}function ae(){this.__data__={hash:new q,map:new(j||le),string:new q}}function ne(De){return Te(this,De).delete(De)}function se(De){return Te(this,De).get(De)}function ue(De){return Te(this,De).has(De)}function Ee(De,rt){return Te(this,De).set(De,rt),this}J.prototype.clear=ae,J.prototype.delete=ne,J.prototype.get=se,J.prototype.has=ue,J.prototype.set=Ee;function pe(De){var rt=-1,Je=De?De.length:0;for(this.__data__=new J;++rt<Je;)this.add(De[rt])}function me(De){return this.__data__.set(De,t),this}function xe(De){return this.__data__.has(De)}pe.prototype.add=pe.prototype.push=me,pe.prototype.has=xe;function ge(De,rt){var Je=wt(De)||At(De)?v(De.length,String):[],Ie=Je.length,at=!!Ie;for(var gt in De)at&&(gt=="length"||be(gt,Ie))||Je.push(gt);return Je}function Oe(De,rt){for(var Je=De.length;Je--;)if(ot(De[Je][0],rt))return Je;return-1}function $e(De,rt,Je,Ie){var at=-1,gt=A,Xt=!0,pn=De.length,$n=[],dr=rt.length;if(!pn)return $n;rt.length>=e&&(gt=_,Xt=!1,rt=new pe(rt));e:for(;++at<pn;){var tr=De[at],rr=tr;if(tr=tr!==0?tr:0,Xt&&rr===rr){for(var un=dr;un--;)if(rt[un]===rr)continue e;$n.push(tr)}else gt(rt,rr,Ie)||$n.push(tr)}return $n}function Ve(De,rt,Je,Ie,at){var gt=-1,Xt=De.length;for(Je||(Je=he),at||(at=[]);++gt<Xt;){var pn=De[gt];Je(pn)?m(at,pn):at[at.length]=pn}return at}function Be(De,rt,Je){var Ie=rt(De);return wt(De)?Ie:m(Ie,Je(De))}function tt(De){if(!nt(De)||Pe(De))return!1;var rt=Bt(De)||b(De)?G:l;return rt.test(Ce(De))}function je(De){if(!nt(De))return mt(De);var rt=Ge(De),Je=[];for(var Ie in De)Ie=="constructor"&&(rt||!M.call(De,Ie))||Je.push(Ie);return Je}function qe(De,rt){return De=Object(De),Le(De,rt,function(Je,Ie){return Ie in De})}function Le(De,rt,Je){for(var Ie=-1,at=rt.length,gt={};++Ie<at;){var Xt=rt[Ie],pn=De[Xt];Je(pn,Xt)&&(gt[Xt]=pn)}return gt}function Ye(De,rt){return rt=$(rt===void 0?De.length-1:rt,0),function(){for(var Je=arguments,Ie=-1,at=$(Je.length-rt,0),gt=Array(at);++Ie<at;)gt[Ie]=Je[rt+Ie];Ie=-1;for(var Xt=Array(rt+1);++Ie<rt;)Xt[Ie]=Je[Ie];return Xt[rt]=gt,h(De,this,Xt)}}function Ke(De){return Be(De,Ot,re)}function Te(De,rt){var Je=De.__data__;return Ue(rt)?Je[typeof rt=="string"?"string":"hash"]:Je.map}function _e(De,rt){var Je=x(De,rt);return tt(Je)?Je:void 0}var we=R?w(R,Object):Ut,re=R?function(De){for(var rt=[];De;)m(rt,we(De)),De=K(De);return rt}:Ut;function he(De){return wt(De)||At(De)||!!(W&&De&&De[W])}function be(De,rt){return rt=rt??n,!!rt&&(typeof De=="number"||u.test(De))&&De>-1&&De%1==0&&De<rt}function Ue(De){var rt=typeof De;return rt=="string"||rt=="number"||rt=="symbol"||rt=="boolean"?De!=="__proto__":De===null}function Pe(De){return!!N&&N in De}function Ge(De){var rt=De&&De.constructor,Je=typeof rt=="function"&&rt.prototype||P;return De===Je}function mt(De){var rt=[];if(De!=null)for(var Je in Object(De))rt.push(Je);return rt}function _t(De){if(typeof De=="string"||st(De))return De;var rt=De+"";return rt=="0"&&1/De==-1/0?"-0":rt}function Ce(De){if(De!=null){try{return L.call(De)}catch{}try{return De+""}catch{}}return""}function ot(De,rt){return De===rt||De!==De&&rt!==rt}function At(De){return Dt(De)&&M.call(De,"callee")&&(!F.call(De,"callee")||B.call(De)==r)}var wt=Array.isArray;function Ft(De){return De!=null&&Re(De.length)&&!Bt(De)}function Dt(De){return Qe(De)&&Ft(De)}function Bt(De){var rt=nt(De)?B.call(De):"";return rt==i||rt==o}function Re(De){return typeof De=="number"&&De>-1&&De%1==0&&De<=n}function nt(De){var rt=typeof De;return!!De&&(rt=="object"||rt=="function")}function Qe(De){return!!De&&typeof De=="object"}function st(De){return typeof De=="symbol"||Qe(De)&&B.call(De)==s}function Ot(De){return Ft(De)?ge(De):je(De)}var Tt=Ye(function(De,rt){return De==null?{}:(rt=g(Ve(rt),_t),qe(De,$e(Ke(De),rt)))});function Ut(){return[]}return BN=Tt,BN}var aje=sje();const lje=ii(aje),uje=C.forwardRef((e,t)=>{const{type:n,VORTEX_MAIN_URL:r,ENTITY_ID:i,TESSERACT_MAIN_URL:o,FRONTEND_URL:s,INTEGRATION_DATA:a,viewOnly:l=!1,openIntegrationDrawer:u}=e,c=pt.useDispatch(),{workflow:d}=pt.useSelector(H=>H.workflows),{source:p=""}=d,[h,A]=C.useState({}),[g,m]=C.useState([]),[E,y]=C.useState([]),[T,v]=C.useState(!1),[_,x]=C.useState(!1),[b,w]=C.useState(!1),[D,I]=C.useState(null),P=C.useRef([]),{control:k,watch:N,setValue:L,trigger:M}=Vn(),B=p?.includes("commerce_"),G=p?.split("_"),Q=G&&G.length>1?G[1]:null,K=G&&G.length>2?G.slice(2).join("_"):Q,F=N("properties"),V=N("properties.fp_auth_id"),W=async()=>{if(B)m([{name:K,id:p?.toLowerCase()||""}]),L("properties.fp_auth_id",p?.toLowerCase()||"",{shouldValidate:!0});else{v(!0);try{const{data:H}=await Kt.get(Zt(o,"/v1/integrations/entity/FYND_PLATFORM?get_form_data=true"),{params:{page_size:999,current_page:1,type:"BOTH"}});m(hs(H.data))}catch(H){An(H,c)}finally{v(!1)}}},R=async H=>{w(!0);try{const U=Zt(r,`/v1.0/${i}`,"/utility/events-config"),X=H?{id:H}:{},{data:ee}=await Kt.get(U,{params:X});P.current=ee.data.event_configs;const Z=ee.data.event_configs.map(ie=>({...ie,display_name:`${ie.display_name}_${ie.event_category}`})),le=FN(Z,"event_category"),z={application:$(le.application),company:$(le.company)};A(z)}catch(U){An(U,c)}finally{w(!1)}},$=H=>{if(!H)return{};const U={},X=FN(H,"event_name");return Object.keys(X).forEach(ee=>{const Z=FN(X[ee],"version");U[ee]=oje(Z,le=>le.map(z=>lje(z,"version"))),U[ee].versions=Object.keys(Z).map(le=>({text:`V${le}`,value:le}))}),U},j=async H=>{x(!0);try{const U=Zt(r,`/v1.0/${i}`,`/utility/applications?id=${H}`),{data:X}=await Kt.get(U);y(X?.data?.map(ee=>({id:ee.id,name:ee.name})))}catch(U){An(U,c)}finally{x(!1)}};C.useEffect(()=>{const{fp_auth_id:H}=F;H&&(p?.includes("commerce_")?R(""):R(H))},[]),C.useEffect(()=>{W()},[]),C.useEffect(()=>{a?._id&&a?.meta?.entity==="FYND_PLATFORM"&&(W(),L("properties.fp_auth_id",a._id,{shouldValidate:!0}))},[a]),C.useEffect(()=>{const{fp_auth_id:H}=F;F?.event_details?.event_category==="application"&&j(H)},[V,F?.event_details?.event_category]),C.useEffect(()=>{if(!Et(F?.event_details?.event_name)&&!Et(F?.event_details?.event_category)&&!Et(h)){const{event_name:H,event_category:U}=F?.event_details;I(h[U][H])}},[h]),C.useEffect(()=>{const H=F?.event_id;if(!H?.length||!P.current.length||F?.events?.length>0)return;const U=H.map(X=>P.current.find(ee=>ee.id===X)).filter(Boolean);U.length&&L("properties.events",U.map(X=>({slug:`${X.event_category}/${X.event_name}/${X.event_type}/v${X.version}`})))},[h]);const Y=H=>Et(H)?[]:F.event_details?.event_category==="application"?Object.keys(H.application).map(U=>({title:U,value:U})):F.event_details?.event_category==="company"?Object.keys(H.company).map(U=>({title:U,value:U})):[],q=N("properties.version")&&!Et(D)&&D[parseFloat(N("properties.version"))]?D[parseFloat(N("properties.version"))].map(H=>({title:H.event_type,value:H.id,event_name:H.event_name,event_type:H.event_type,event_category:H.event_category})):[];return f.jsxs(O.Stack,{gap:2.5,children:[f.jsx(Eo,{children:f.jsx(en,{required:!0,name:"properties.fp_auth_id",control:k,meta:{options:Jr(g),displayProps:{loading:T},displayName:"Fynd Platform Account",value:"",htmlProps:{showAddNew:!0},TESSERACT_MAIN_URL:o,FRONTEND_URL:s,ENTITY_ID:i,openIntegrationDrawer:u,addNewButtonText:"Add new account",searchFieldPlaceholder:"Search Fynd Platform account",authType:"FYND_PLATFORM",description:"Fynd Platform is a secure partner with Boltic. Your credentials are encrypted & can be removed at any time.",placeholder:"Select Fynd Platform Account"},validationRules:{required:"Fynd platform account is required"},id:n,viewOnly:l||B,handleChange:H=>{const{value:U}=H;U&&(p?.includes("commerce_")?R(""):R(U))}})}),F.fp_auth_id&&f.jsx(O.Divider,{}),F.fp_auth_id&&f.jsx(qr,{children:f.jsxs(O.Grid,{container:!0,gap:1.5,children:[f.jsx(O.Grid,{item:!0,xs:12,children:f.jsxs(O.Grid,{container:!0,gap:1.5,children:[f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.event_details.event_category",control:k,meta:{options:Zle,displayName:"Event Category",searchFieldPlaceholder:"Search",placeholder:"Select Event Category",displayProps:{loading:b}},validationRules:{required:"Event category is required"},viewOnly:l,id:n,handleChange:H=>{const{value:U}=H,X=U.split("_").pop();L("properties",{...F,event_details:{...F.event_details,event_category:X,event_name:""},event_id:[],events:[],application_id:[],version:[]}),I([])}})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.event_details.event_name",control:k,meta:{options:Y(h),displayName:"Event Name",searchFieldPlaceholder:"Search",placeholder:"Select Event Name",displayProps:{loading:b}},validationRules:{required:"Event name is required"},viewOnly:l,id:n,handleChange:H=>{const{value:U}=H,X=F.event_details.event_category,ee=h[X][U].versions.length;L("properties",{...F,event_id:[],events:[],application_id:[],version:h[X][U].versions[ee-1].value}),M("properties.event_details"),I(h[X][U])}})})]})}),!Et(D?.versions)&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.version",control:k,meta:{options:D.versions.map(H=>({title:H.text,value:H.value})),displayName:"Version",searchFieldPlaceholder:"Search",placeholder:"Select Version",displayProps:{loading:b}},validationRules:{required:"Version is required"},viewOnly:l,handleChange:H=>{const{value:U}=H;L("properties",{...F,event_id:[],events:[],version:U,application_id:[]})}})}),!Et(q)&&!Et(F.event_details)&&!Et(F.version)&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.event_id",control:k,meta:{options:q,displayProps:{loading:b},displayName:"Events",searchFieldPlaceholder:"Search",placeholder:"Select Events"},renderFieldValue:H=>H.map(U=>U),validationRules:{validate:H=>H.length===0?"Events is required":!0},viewOnly:l,id:n,multiple:!0,placeholder:"Select Events",handleChange:H=>{const{value:U}=H,X=F.version,ee=U.map(le=>{const z=q.find(ie=>ie.value===le);return{slug:`${z?.event_category}/${z?.event_name}/${z?.event_type}/v${X}`}});L("properties.events",ee);const Z=q.find(le=>le.value===U?.[0]);L("properties.event_details.event_type",Z?.title)},getSelectedValue:H=>H.map(U=>q.find(X=>X.value===U)).filter(U=>U?.title)})}),F?.event_details?.event_category==="application"&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{name:"properties.application_id",control:k,meta:{options:Jr(E),displayName:"Applications",searchFieldPlaceholder:"Search",displayProps:{loading:_},placeholder:"Select Applications"},validationRules:{validate:H=>H.length===0?"Application is required":!0},multiple:!0,renderFieldValue:H=>H.map(U=>U),viewOnly:l,getSelectedValue:H=>H.map(U=>Jr(E).find(X=>X.value===U)).filter(U=>U?.title),required:!0})})]})})]})}),cje=C.forwardRef((e,t)=>{const{VORTEX_MAIN_URL:n,ENTITY_ID:r,type:i,id:o,isLoop:s=!1,suggestionsData:a,WORKFLOW_URLS:l,viewOnly:u=!1}=e,{GYRATE_MAIN_URL:c}=l,{control:d,watch:p,setValue:h,formState:{errors:A}}=Vn(),g=p("properties");return f.jsx(qr,{children:f.jsxs(O.Grid,{container:!0,gap:1.5,children:[f.jsxs(O.Grid,{item:!0,xs:12,children:[f.jsx(Nr,{required:!0,label:"Input Data"}),f.jsx(ka,{id:o,field:"input_data",type:"functionActivity",title:"Input Data",viewOnly:u,isLoop:s,hideLabel:!0,name:"properties.input_data"})]}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.language",control:d,meta:{options:Jle,displayName:"Language",searchFieldPlaceholder:"Search language",description:jr(i,"method"),placeholder:"Select language"},handleChange:()=>{h("properties.func",'return { "hello": "world" }')},validationRules:{required:"Language is required"},viewOnly:u,id:i})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.func",control:d,rules:{required:"Error: Function is required. Please review your function syntax."},render:({field:m})=>f.jsx(O.FormControl,{fullWidth:!0,children:f.jsx(_o,{...m,required:!0,suggestionLabel:"Code",id:`${i}-${g.language}-func`,activityType:i,size:"xl",viewOnly:u,showSuggestions:!0,VORTEX_MAIN_URL:n,ENTITY_ID:r,language:g.language,suggestionsData:a,showExpandOption:!0,label:"Code",helperText:f.jsxs(O.Box,{children:["Need help? Refer to the",f.jsx(O.Link,{href:g.language==="python"?`${c}/integrations/Helpers/function/#python`:`${c}/integrations/Helpers/function/#javascript`,target:"_blank",children:f.jsx("span",{children:" Function Documentation "})}),"for examples, guidelines, and troubleshooting tips to write Javascript in your workflow."]}),error:!!A.properties?.func?.message,errorMsg:A.properties?.func?.message,handleChange:m.onChange})})})}),!s&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(qi,{viewOnly:u,type:i})})]})})}),dje=Go(cje,""),fje=C.forwardRef((e,t)=>{const{control:n,watch:r,setValue:i,getValues:o}=Vn(),s=r("properties"),{TESSERACT_MAIN_URL:a,ENTITY_ID:l,VORTEX_MAIN_URL:u,FRONTEND_URL:c,type:d,openIntegrationDrawer:p,INTEGRATION_DATA:h,viewOnly:A=!1}=e,g=pt.useDispatch(),[m,E]=C.useState([]),[y,T]=C.useState([]),[v,_]=C.useState(!1),[x,b]=C.useState(!1),w=Jr(m),{isTokenRevoked:D,setTokenRevoked:I,handleReconnect:P}=Fp({credentialId:s?.secret||"",TESSERACT_MAIN_URL:a,FRONTEND_URL:c,ENTITY_ID:l,openIntegrationDrawer:p}),k=()=>{_(!0);const L={page_size:999,current_page:1,type:"SOURCE"},M=Zt(a,"/v1/integrations/entity/GMAIL");Kt.get(M,{params:L}).then(({data:B})=>{E(hs(B.data))}).catch(B=>{An(B,g)}).finally(()=>{_(!1)})};C.useEffect(()=>{k()},[]),C.useEffect(()=>{h?._id&&h?.meta?.entity==="GMAIL"&&(h?.meta?.auth_status==="ACTIVE"&&I(!1),k(),i("properties.secret",h._id,{shouldValidate:!0}))},[h]);const N=()=>{b(!0);const L=Zt(u,`/v1.0/${l}`,"/implementations/choices");Kt.post(L,{data:{secret:o("properties.secret"),operation:"get",input_field_id:"label",selected_api:"gmailAPI"}}).then(M=>{const B=M.data.data.filter(G=>G.id!=="CHAT");T(B)}).catch(M=>{An(M,g)}).finally(()=>{b(!1)})};return r("properties.label_id")&&!y.length&&T([{name:r("form.properties.label_name"),id:r("properties.label_id")}]),C.useEffect(()=>{s.secret&&s.operation&&N()},[s.secret,s.operation]),f.jsxs(O.Stack,{gap:2.5,children:[f.jsx(Eo,{children:f.jsxs(O.Grid,{container:!0,gap:1.5,children:[f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.secret",control:n,renderValueUi:L=>{const M=w.find(B=>B.value===L);return f.jsx(Mp,{isTokenRevoked:D,onReconnect:P,disabled:A,optionTitle:M?.title})},meta:{options:w,displayProps:{loading:v},displayName:"Google Account",value:"",htmlProps:{showAddNew:!0},description:"Google is a secure partner with Boltic. Your credentials are encrypted & can be removed at any time.",TESSERACT_MAIN_URL:a,FRONTEND_URL:c,ENTITY_ID:l,openIntegrationDrawer:p,addNewButtonText:"Add new account",searchFieldPlaceholder:"Search Google account",authType:"GMAIL",placeholder:"Select Google Account"},validationRules:{required:"Google account is required"},handleChange:L=>{const{field:M,value:B}=L;i("properties.label_id",""),i("properties.label_name",""),i("properties.operation",""),i(M,Et(B)?"":B),T([]),B&&I(!1)},viewOnly:A,id:"secret"})}),r("properties.secret")&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.operation",control:n,meta:{options:[{title:"New Attachment",value:"attachment"},{title:"New Email",value:"new_email"},{title:"New Starred Email",value:"starred_email"},{title:"New Thread",value:"new_thread"}],displayName:"Operation",searchFieldPlaceholder:"Search operation",description:"Select the operation that will trigger this workflow",placeholder:"Select a operation"},validationRules:{required:"Operation is required"},viewOnly:A,handleChange:L=>{const{field:M,value:B}=L;i("properties.label_id",""),i("properties.label_name",""),i("properties.filter_by",""),i("properties.filter_value",""),i(M,B)}})})]})}),f.jsx(O.Divider,{}),f.jsxs(qr,{children:[f.jsx(O.Grid,{container:!0,gap:1.5,children:f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.label_id",control:n,meta:{options:Jr(y),displayName:"Label",searchFieldPlaceholder:"Search",description:"Select inbox or all labels",displayProps:{loading:x},placeholder:"Select Label"},validationRules:{required:"Label is required"},viewOnly:A,id:d,handleChange:L=>{const{field:M,value:B}=L,G=y.find(Q=>Q.id===B);i("properties.label_name",G?.name||""),i("properties.filter_by",""),i("properties.filter_value",""),i(M,B)},onOpen:N})})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{name:"properties.filter_by",control:n,meta:{options:[{title:"From Sender",value:"from_sender"},{title:"Search Keywords",value:"search_keywords"}],displayName:"Filter by",searchFieldPlaceholder:"Search",description:"Select the field to filter by",placeholder:"Select Filter by"},viewOnly:A,id:d,handleChange:L=>{const{field:M,value:B}=L;i(M,B),i("properties.filter_value","")}})}),s.filter_by&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(Wn,{name:"properties.filter_value",control:n,meta:{displayName:s.filter_by==="from_sender"?"From Sender":"Search Keywords",description:s.filter_by==="from_sender"?"Enter the recipient email to filter by":f.jsxs(f.Fragment,{children:["Enter the search keywords to filter by. For advanced, visit"," ",f.jsx(O.Link,{href:"https://support.google.com/mail/answer/7190?hl=en",target:"_blank",rel:"noopener noreferrer",underline:"hover",children:"search operators"}),"."]}),placeholder:s.filter_by==="from_sender"?"Enter the recipient email":"Enter the search keywords"},viewOnly:A,id:d,handleChange:L=>{const{field:M,value:B}=L;i(M,B)}})})]})]})}),Bp=C.forwardRef(({id:e,type:t,isLoop:n=!1,viewOnly:r=!1,customSelectedTab:i,setCustomSelectedTab:o},s)=>{const{control:a,watch:l,setValue:u}=Vn(),{MCP_INTEGRATION_FORM:c}=_a(),d=l("properties.custom"),p=l("properties.custom.headers"),h=l("properties.custom.query_params"),A=l("properties.custom.state_params"),g=l("properties.custom.method");return C.useEffect(()=>{d&&(p&&!Array.isArray(p)&&typeof p=="object"&&u("properties.custom.headers",$c(p),{shouldValidate:!1,shouldDirty:!1}),h&&!Array.isArray(h)&&typeof h=="object"&&u("properties.custom.query_params",$c(h),{shouldValidate:!1,shouldDirty:!1}),A&&!Array.isArray(A)&&typeof A=="object"&&u("properties.custom.state_params",$c(A),{shouldValidate:!1,shouldDirty:!1}))},[d,p,h,A,u]),C.useEffect(()=>{if(c&&(g==="BOLTIC_AI"||g==="BOLTIC_AI_IGNORE"))return;const m=(p1||[]).map(T=>T.value),E=typeof g=="string"&&g.length?String(g).toLowerCase():"",y=E&&m.includes(E)?E:p1?.[0]?.value||"get";g!==y&&u("properties.custom.method",y,{shouldValidate:!1,shouldDirty:!1})},[g,u]),f.jsxs(f.Fragment,{children:[f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.custom.method",control:a,meta:{options:p1,displayName:"Method",searchFieldPlaceholder:"Search Method",placeholder:"Select Method"},validationRules:{required:"Method is required",validate:m=>m!=null&&String(m).trim()!==""?!0:"Method is required"},viewOnly:r,id:t})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(Wn,{required:!0,id:e,name:"properties.custom.endpoint",control:a,meta:{displayName:"URL",placeholder:khe(t)},validationRules:{required:"URL is required"},viewOnly:r,editorId:`${t}-custom-url-${n}`,showSuggestions:!0})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(Hs,{variant:"full-width",tabs:Cle,selectedTab:i,setSelectedTab:o})}),i==="Query Params"&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(ka,{id:e,name:"properties.custom.query_params",field:"query_params",type:t,title:"Query Params",viewOnly:r,isLoop:n})}),i==="State Params"&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(ka,{id:e,name:"properties.custom.state_params",field:"state_params",type:t,title:"State Params",viewOnly:r,isLoop:n})}),i==="Headers"&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(ka,{id:e,name:"properties.custom.headers",field:"headers",type:t,title:"Headers",viewOnly:r,isLoop:n})}),i==="Body"&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(ka,{id:e,name:"properties.custom.body",field:"body",type:t,title:"Body",viewOnly:r,isLoop:n,showKeyValuePair:!1})})]})});Bp.displayName="CustomApiSection";const $Y=t6,FA=(e,t,n={},r=ps.CUSTOM)=>{const i=e("properties")||{},o=i?.event===r||i?.operation===r||i?.mode===r,s=()=>{if(!o)return;const m=i?.custom||{},E={...$Y,...n,...m,headers:Array.isArray(m.headers)?m.headers:$c(m.headers||{}),query_params:Array.isArray(m.query_params)?m.query_params:$c(m.query_params||{}),state_params:Array.isArray(m.state_params)?m.state_params:$c(m.state_params||{})};JSON.stringify(m)!==JSON.stringify(E)&&t("properties.custom",E,{shouldValidate:!1,shouldDirty:!0})};C.useEffect(()=>{if(!o)return;const m=i?.custom||{};if(m.headers&&!Array.isArray(m.headers)||m.query_params&&!Array.isArray(m.query_params)||m.state_params&&!Array.isArray(m.state_params)||!m.method&&!m.endpoint){const y={...$Y,...n,...m,headers:Array.isArray(m.headers)?m.headers:$c(m.headers||{}),query_params:Array.isArray(m.query_params)?m.query_params:$c(m.query_params||{}),state_params:Array.isArray(m.state_params)?m.state_params:$c(m.state_params||{})};t("properties.custom",y,{shouldValidate:!1,shouldDirty:!0})}},[o,t,JSON.stringify(n||{}),JSON.stringify(i?.custom||{})]);const a=(m,E)=>{const T={...i?.custom||{},[m]:E};t("properties.custom",T,{shouldValidate:!1,shouldDirty:!0})};return{isCustom:o,properties:i,ensureDefaults:s,setMethod:m=>a("method",m),setEndpoint:m=>a("endpoint",m),setHeaders:m=>a("headers",m),setQueryParams:m=>a("query_params",m),setStateParams:m=>a("state_params",m),setBody:m=>a("body",m),getApiData:()=>{const m=i?.custom||{};return{...m,headers:Bc(m.headers||[]),query_params:Bc(m.query_params||[]),state_params:Bc(m.state_params||[])}},convertToApiFormat:()=>{const m=i?.custom||{},E={...m,headers:Bc(m.headers||[]),query_params:Bc(m.query_params||[]),state_params:Bc(m.state_params||[])};t("properties.custom",E,{shouldValidate:!1,shouldDirty:!0})}}},pje=C.forwardRef((e,t)=>{const n=pt.useDispatch(),r=O.useTheme(),{control:i,watch:o,setValue:s,getValues:a,formState:{errors:l}}=Vn(),u=o("properties");FA(o,s,{},"custom");const{ENTITY_ID:c,TESSERACT_MAIN_URL:d,FRONTEND_URL:p,type:h,id:A,isLoop:g=!1,suggestionsData:m,INTEGRATION_DATA:E,VORTEX_MAIN_URL:y,viewOnly:T=!1,openIntegrationDrawer:v,MCP_INTEGRATION_FORM:_=!1}=e,{loopSuggestionsData:x={}}=pt.useSelector(F=>F.loopActivity),[b,w]=C.useState([]),[D,I]=C.useState(!1),[P,k]=C.useState("Query Params"),N=Jr(b),{isTokenRevoked:L,setTokenRevoked:M,handleReconnect:B}=Fp({credentialId:u?.gmail_config_id||"",TESSERACT_MAIN_URL:d,FRONTEND_URL:p,ENTITY_ID:c,openIntegrationDrawer:v}),G=()=>{I(!0);const F={page_size:999,current_page:1,type:"BOTH"},V=Zt(d,"/v1/integrations/entity/GMAIL");Kt.get(V,{params:F}).then(({data:W})=>{w(hs(W.data))}).catch(W=>{An(W,n)}).finally(()=>{I(!1)})};C.useEffect(()=>{G()},[]),C.useEffect(()=>{E?._id&&E?.meta?.entity==="GMAIL"&&(E?.meta?.auth_status==="ACTIVE"&&M(!1),G(),s("properties.gmail_config_id",E._id,{shouldValidate:!0}))},[E]);const Q=F=>{s(`properties.${F}`,[...a(`properties.${F}`)||[],""])},K=u?.attachments==="BOLTIC_AI_IGNORE"||u?.attachments==="BOLTIC_AI";return f.jsxs(O.Stack,{gap:2.5,children:[f.jsx(Eo,{children:f.jsxs(O.Grid,{container:!0,gap:1.5,children:[f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(en,{required:!0,name:"properties.gmail_config_id",control:i,renderValueUi:F=>{const V=N.find(W=>W.value===F);return f.jsx(Mp,{isTokenRevoked:L,onReconnect:B,disabled:T,optionTitle:V?.title})},meta:{options:N,displayProps:{loading:D},displayName:"Google Account",value:"",htmlProps:{showAddNew:!0},TESSERACT_MAIN_URL:d,FRONTEND_URL:p,ENTITY_ID:c,openIntegrationDrawer:v,addNewButtonText:"Add new account",searchFieldPlaceholder:"Search Google account",authType:"GMAIL",description:"Google is a secure partner with Boltic. Your credentials are encrypted & can be removed at any time.",placeholder:"Select Google Account"},validationRules:{required:"Google account is required"},handleChange:F=>{F.value&&M(!1)},viewOnly:T,id:h})}),u.gmail_config_id&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(O.FormControl,{fullWidth:!0,children:f.jsx(en,{name:"properties.operation",control:i,meta:{options:pue,displayName:"Operation",searchFieldPlaceholder:"Search operation",description:"Select operation to be performed",placeholder:"Select a operation"},validationRules:{required:"Operation is required"},viewOnly:T,required:!0})})})]})}),u.gmail_config_id&&u.operation&&f.jsx(O.Divider,{}),u.gmail_config_id&&u.operation&&f.jsx(qr,{children:f.jsxs(O.Grid,{container:!0,gap:1.5,children:[u.operation!=="custom"&&f.jsxs(f.Fragment,{children:[f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(Wn,{required:!0,id:A,name:"properties.subject",control:i,meta:{displayName:"Subject",placeholder:"Type or add suggestion",description:"Enter the subject to send in the email."},validationRules:{required:"Subject is required"},viewOnly:T,editorId:`${h}-subject-${g}`,showSuggestions:!0,isLoop:g})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.email_template",control:i,rules:{required:"Email body is required"},render:({field:F})=>f.jsx(_o,{...F,label:"Email body",suggestionLabel:"Email body",id:`${h}-gmail_template`,activityType:h,VORTEX_MAIN_URL:y,ENTITY_ID:c,viewOnly:T,size:"md",showSuggestions:!0,language:"html",suggestionsData:g?x:m,showExpandOption:!0,showHtmlPreview:!0,helperText:f.jsxs(O.Box,{children:["Enter body to send in the email. Create dynamic web templates easily using Nunjucks. see",f.jsx(O.Link,{href:"https://mozilla.github.io/nunjucks/",target:"_blank",children:" Nunjucks Docs"})]}),errorMsg:l.properties?.email_template?.message,error:!!l.properties?.email_template?.message,handleChange:V=>{F.onChange(V)},required:!0})})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.to",control:i,rules:{required:_?!1:"To is required",validate:F=>_&&dm(F)?!0:Array.isArray(F)&&!F.every(W=>Pu(W))?"To must have all the valid emails":!0},render:({field:F})=>f.jsx(Ed,{...F,required:!0,nodeId:A,label:"To",isLoop:g,viewOnly:T,name:"properties.to",placeholder:"Enter email",onChange:V=>{F.onChange(typeof V=="string"?V:[...V])},errorMsg:l.properties?.to?.message})})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.cc",control:i,rules:{validate:F=>_&&dm(F)?!0:Array.isArray(F)&&!F.every(W=>Pu(W))?"Cc must have all the valid emails":!0},render:({field:F})=>f.jsx(Ed,{...F,nodeId:A,label:"Cc",name:"properties.cc",isLoop:g,viewOnly:T,placeholder:"Enter email",onChange:V=>{F.onChange(typeof V=="string"?V:[...V])}})})}),f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(xn,{name:"properties.bcc",control:i,rules:{validate:F=>_&&dm(F)?!0:Array.isArray(F)&&!F.every(W=>Pu(W))?"Bcc must have all the valid emails":!0},render:({field:F})=>f.jsx(Ed,{...F,nodeId:A,label:"Bcc",isLoop:g,name:"properties.bcc",placeholder:"Enter email",viewOnly:T,onChange:V=>{F.onChange(typeof V=="string"?V:[...V])},errorMsg:l.properties?.bcc?.message})})}),f.jsxs(O.Grid,{item:!0,xs:12,children:[f.jsxs(O.Box,{sx:{...Di,"& > .MuiStack-root > .MuiStack-root":{pb:0}},children:[f.jsx(Nr,{label:"Attachments",description:"The maximum attachment limit is 25Mb"}),!K&&f.jsx(O.IconButton,{onClick:()=>Q("attachments"),sx:{float:"right",p:.75,border:F=>`1px solid ${F.palette.grey.brainstem}`,fontSize:F=>F.typography.mdNormal.fontSize},color:"primary",children:f.jsx(Fe,{src:"ic_plus",sx:{path:{fill:r.palette.primary.main}}})})]}),f.jsx(MN,{nodeId:A,type:h,isLoop:g,field:"properties.attachments"})]})]}),u.operation==="custom"&&f.jsx(Bp,{id:A,type:h,isLoop:g,viewOnly:T,customSelectedTab:P,setCustomSelectedTab:k}),!_&&!g&&f.jsx(O.Grid,{item:!0,xs:12,children:f.jsx(qi,{viewOnly:T,type:h})})]})})]})}),hje=Go(pje,"");process.env.NODE_ENV!=="production"&&(S.node,S.object.isRequired);function Yr(e){return Kfe(e)}function Aje(e){return _n("MuiDivider",e)}const jY=vn("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),mje=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],gje=e=>{const{absolute:t,children:n,classes:r,flexItem:i,light:o,orientation:s,textAlign:a,variant:l}=e;return wn({root:["root",t&&"absolute",l,o&&"light",s==="vertical"&&"vertical",i&&"flexItem",n&&"withChildren",n&&s==="vertical"&&"withChildrenVertical",a==="right"&&s!=="vertical"&&"textAlignRight",a==="left"&&s!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",s==="vertical"&&"wrapperVertical"]},Aje,r)},Eje=St("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,n.orientation==="vertical"&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&n.orientation==="vertical"&&t.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&t.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&t.textAlignLeft]}})(({theme:e,ownerState:t})=>ce({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin"},t.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},t.light&&{borderColor:e.vars?`rgba(${e.vars.palette.dividerChannel} / 0.08)`:hi.alpha(e.palette.divider,.08)},t.variant==="inset"&&{marginLeft:72},t.variant==="middle"&&t.orientation==="horizontal"&&{marginLeft:e.spacing(2),marginRight:e.spacing(2)},t.variant==="middle"&&t.orientation==="vertical"&&{marginTop:e.spacing(1),marginBottom:e.spacing(1)},t.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},t.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:e})=>ce({},e.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:e,ownerState:t})=>ce({},t.children&&t.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:"inherit"}}),({theme:e,ownerState:t})=>ce({},t.children&&t.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:"inherit"}}),({ownerState:e})=>ce({},e.textAlign==="right"&&e.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},e.textAlign==="left"&&e.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),Oje=St("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.wrapper,n.orientation==="vertical"&&t.wrapperVertical]}})(({theme:e,ownerState:t})=>ce({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`},t.orientation==="vertical"&&{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`})),yS=ye.forwardRef(function(t,n){const r=Yr({props:t,name:"MuiDivider"}),{absolute:i=!1,children:o,className:s,component:a=o?"div":"hr",flexItem:l=!1,light:u=!1,orientation:c="horizontal",role:d=a!=="hr"?"separator":void 0,textAlign:p="center",variant:h="fullWidth"}=r,A=Ct(r,mje),g=ce({},r,{absolute:i,component:a,flexItem:l,light:u,orientation:c,role:d,textAlign:p,variant:h}),m=gje(g);return f.jsx(Eje,ce({as:a,className:tn(m.root,s),role:d,ref:n,ownerState:g},A,{children:o?f.jsx(Oje,{className:m.wrapper,ownerState:g,children:o}):null}))});yS.muiSkipListHighlight=!0,process.env.NODE_ENV!=="production"&&(yS.propTypes={absolute:S.bool,children:S.node,classes:S.object,className:S.string,component:S.elementType,flexItem:S.bool,light:S.bool,orientation:S.oneOf(["horizontal","vertical"]),role:S.string,sx:S.oneOfType([S.arrayOf(S.oneOfType([S.func,S.object,S.bool])),S.func,S.object]),textAlign:S.oneOf(["center","left","right"]),variant:S.oneOfType([S.oneOf(["fullWidth","inset","middle"]),S.string])});const Ac=(e,t)=>e.length!==t.length?!1:t.every(n=>e.includes(n)),yje=({openTo:e,defaultOpenTo:t,views:n,defaultViews:r})=>{const i=n??r;let o;if(e!=null)o=e;else if(i.includes(t))o=t;else if(i.length>0)o=i[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:i,openTo:o}},TS=(e,t,n)=>{let r=t;return r=e.setHours(r,e.getHours(n)),r=e.setMinutes(r,e.getMinutes(n)),r=e.setSeconds(r,e.getSeconds(n)),r=e.setMilliseconds(r,e.getMilliseconds(n)),r},Zg=({date:e,disableFuture:t,disablePast:n,maxDate:r,minDate:i,isDateDisabled:o,utils:s,timezone:a})=>{const l=TS(s,s.date(void 0,a),e);n&&s.isBefore(i,l)&&(i=l),t&&s.isAfter(r,l)&&(r=l);let u=e,c=e;for(s.isBefore(e,i)&&(u=i,c=null),s.isAfter(e,r)&&(c&&(c=r),u=null);u||c;){if(u&&s.isAfter(u,r)&&(u=null),c&&s.isBefore(c,i)&&(c=null),u){if(!o(u))return u;u=s.addDays(u,1)}if(c){if(!o(c))return c;c=s.addDays(c,-1)}}return null},Tje=(e,t)=>t==null||!e.isValid(t)?null:t,$l=(e,t,n)=>t==null||!e.isValid(t)?n:t,vje=(e,t,n)=>!e.isValid(t)&&t!=null&&!e.isValid(n)&&n!=null?!0:e.isEqual(t,n),$N=(e,t)=>{const r=[e.startOfYear(t)];for(;r.length<12;){const i=r[r.length-1];r.push(e.addMonths(i,1))}return r},jN=(e,t,n)=>n==="date"?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),Od=(e,t)=>{const n=e.setHours(e.date(),t==="am"?2:14);return e.format(n,"meridiem")},Sje=["year","month","day"],BA=e=>Sje.includes(e),UY=(e,{format:t,views:n},r)=>{if(t!=null)return t;const i=e.formats;return Ac(n,["year"])?i.year:Ac(n,["month"])?i.month:Ac(n,["day"])?i.dayOfMonth:Ac(n,["month","year"])?`${i.month} ${i.year}`:Ac(n,["day","month"])?`${i.month} ${i.dayOfMonth}`:i.keyboardDate},xje=(e,t)=>{const n=e.startOfWeek(t);return[0,1,2,3,4,5,6].map(r=>e.addDays(n,r))},HY=["hours","minutes","seconds"],$A=e=>HY.includes(e),Jg=e=>HY.includes(e)||e==="meridiem",bje=(e,t)=>e?t.getHours(e)>=12?"pm":"am":null,eE=(e,t,n)=>n&&(e>=12?"pm":"am")!==t?t==="am"?e-12:e+12:e,Cje=(e,t,n,r)=>{const i=eE(r.getHours(e),t,n);return r.setHours(e,i)},VY=(e,t)=>t.getHours(e)*3600+t.getMinutes(e)*60+t.getSeconds(e),tE=(e,t)=>(n,r)=>e?t.isAfter(n,r):VY(n,t)>VY(r,t),GY=(e,{format:t,views:n,ampm:r})=>{if(t!=null)return t;const i=e.formats;return Ac(n,["hours"])?r?`${i.hours12h} ${i.meridiem}`:i.hours24h:Ac(n,["minutes"])?i.minutes:Ac(n,["seconds"])?i.seconds:Ac(n,["minutes","seconds"])?`${i.minutes}:${i.seconds}`:Ac(n,["hours","minutes","seconds"])?r?`${i.hours12h}:${i.minutes}:${i.seconds} ${i.meridiem}`:`${i.hours24h}:${i.minutes}:${i.seconds}`:r?`${i.hours12h}:${i.minutes} ${i.meridiem}`:`${i.hours24h}:${i.minutes}`},yu={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},_je=e=>Math.max(...e.map(t=>yu[t.type]??1)),nE=(e,t,n)=>{if(t===yu.year)return e.startOfYear(n);if(t===yu.month)return e.startOfMonth(n);if(t===yu.day)return e.startOfDay(n);let r=n;return t<yu.minutes&&(r=e.setMinutes(r,0)),t<yu.seconds&&(r=e.setSeconds(r,0)),t<yu.milliseconds&&(r=e.setMilliseconds(r,0)),r},wje=({props:e,utils:t,granularity:n,timezone:r,getTodayDate:i})=>{let o=i?i():nE(t,n,jN(t,r));e.minDate!=null&&t.isAfterDay(e.minDate,o)&&(o=nE(t,n,e.minDate)),e.maxDate!=null&&t.isBeforeDay(e.maxDate,o)&&(o=nE(t,n,e.maxDate));const s=tE(e.disableIgnoringDatePartForTimeValidation??!1,t);return e.minTime!=null&&s(e.minTime,o)&&(o=nE(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:TS(t,o,e.minTime))),e.maxTime!=null&&s(o,e.maxTime)&&(o=nE(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:TS(t,o,e.maxTime))),o},UN=(e,t)=>{const n=e.formatTokenMap[t];if(n==null)throw new Error([`MUI X: The token "${t}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(`
523
523
  `));return typeof n=="string"?{type:n,contentType:n==="meridiem"?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},Ije=e=>{switch(e){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}},vS=(e,t)=>{const n=[],r=e.date(void 0,"default"),i=e.startOfWeek(r),o=e.endOfWeek(r);let s=i;for(;e.isBefore(s,o);)n.push(s),s=e.addDays(s,1);return n.map(a=>e.formatByString(a,t))},WY=(e,t,n,r)=>{switch(n){case"month":return $N(e,e.date(void 0,t)).map(i=>e.formatByString(i,r));case"weekDay":return vS(e,r);case"meridiem":{const i=e.date(void 0,t);return[e.startOfDay(i),e.endOfDay(i)].map(o=>e.formatByString(o,r))}default:return[]}},QY="s",Dje=["0","1","2","3","4","5","6","7","8","9"],Rje=e=>{const t=e.date(void 0);return e.formatByString(e.setSeconds(t,0),QY)==="0"?Dje:Array.from({length:10}).map((r,i)=>e.formatByString(e.setSeconds(t,i),QY))},$p=(e,t)=>{if(t[0]==="0")return e;const n=[];let r="";for(let i=0;i<e.length;i+=1){r+=e[i];const o=t.indexOf(r);o>-1&&(n.push(o.toString()),r="")}return n.join("")},HN=(e,t)=>t[0]==="0"?e:e.split("").map(n=>t[Number(n)]).join(""),zY=(e,t)=>{const n=$p(e,t);return n!==" "&&!Number.isNaN(Number(n))},XY=(e,t)=>{let n=e;for(n=Number(n).toString();n.length<t;)n=`0${n}`;return n},qY=(e,t,n,r,i)=>{if(process.env.NODE_ENV!=="production"&&i.type!=="day"&&i.contentType==="digit-with-letter")throw new Error([`MUI X: The token "${i.format}" is a digit format with letter in it.'
524
524
  This type of format is only supported for 'day' sections`].join(`
525
525
  `));if(i.type==="day"&&i.contentType==="digit-with-letter"){const s=e.setDate(n.longestMonth,t);return e.formatByString(s,i.format)}let o=t.toString();return i.hasLeadingZerosInInput&&(o=XY(o,i.maxLength)),HN(o,r)},Pje=(e,t,n,r,i,o,s,a)=>{const l=Ije(r),u=r==="Home",c=r==="End",d=n.value===""||u||c,p=()=>{const A=i[n.type]({currentDate:s,format:n.format,contentType:n.contentType}),g=y=>qY(e,y,A,o,n),m=n.type==="minutes"&&a?.minutesStep?a.minutesStep:1;let E;if(d){if(n.type==="year"&&!c&&!u)return e.formatByString(e.date(void 0,t),n.format);l>0||u?E=A.minimum:E=A.maximum}else E=parseInt($p(n.value,o),10)+l*m;return E%m!==0&&((l<0||u)&&(E+=m-(m+E)%m),(l>0||c)&&(E-=E%m)),E>A.maximum?g(A.minimum+(E-A.maximum-1)%(A.maximum-A.minimum+1)):E<A.minimum?g(A.maximum-(A.minimum-E-1)%(A.maximum-A.minimum+1)):g(E)},h=()=>{const A=WY(e,t,n.type,n.format);if(A.length===0)return n.value;if(d)return l>0||u?A[0]:A[A.length-1];const E=((A.indexOf(n.value)+l)%A.length+A.length)%A.length;return A[E]};return n.contentType==="digit"||n.contentType==="digit-with-letter"?p():h()},VN=(e,t,n)=>{let r=e.value||e.placeholder;const i=t==="non-input"?e.hasLeadingZerosInFormat:e.hasLeadingZerosInInput;return t==="non-input"&&e.hasLeadingZerosInInput&&!e.hasLeadingZerosInFormat&&(r=Number($p(r,n)).toString()),["input-rtl","input-ltr"].includes(t)&&e.contentType==="digit"&&!i&&r.length===1&&(r=`${r}‎`),t==="input-rtl"&&(r=`⁨${r}⁩`),r},YY=(e,t,n,r)=>{if(process.env.NODE_ENV!=="production"&&UN(e,n).type==="weekDay")throw new Error("changeSectionValueFormat doesn't support week day formats");return e.formatByString(e.parse(t,n),r)},Nje=(e,t)=>e.formatByString(e.date(void 0,"system"),t).length===4,KY=(e,t,n,r)=>{if(t!=="digit")return!1;const i=e.date(void 0,"default");switch(n){case"year":return e.lib==="dayjs"&&r==="YY"?!0:e.formatByString(e.setYear(i,1),r).startsWith("0");case"month":return e.formatByString(e.startOfYear(i),r).length>1;case"day":return e.formatByString(e.startOfMonth(i),r).length>1;case"weekDay":return e.formatByString(e.startOfWeek(i),r).length>1;case"hours":return e.formatByString(e.setHours(i,1),r).length>1;case"minutes":return e.formatByString(e.setMinutes(i,1),r).length>1;case"seconds":return e.formatByString(e.setSeconds(i,1),r).length>1;default:throw new Error("Invalid section type")}},Lje=(e,t,n)=>{const r=t.some(l=>l.type==="day"),i=[],o=[];for(let l=0;l<t.length;l+=1){const u=t[l];r&&u.type==="weekDay"||(i.push(u.format),o.push(VN(u,"non-input",n)))}const s=i.join(" "),a=o.join(" ");return e.parse(a,s)},kje=e=>e.map(t=>`${t.startSeparator}${t.value||t.placeholder}${t.endSeparator}`).join(""),Mje=(e,t,n)=>{const i=e.map(o=>{const s=VN(o,n?"input-rtl":"input-ltr",t);return`${o.startSeparator}${s}${o.endSeparator}`}).join("");return n?`⁦${i}⁩`:i},Fje=(e,t,n)=>{const r=e.date(void 0,n),i=e.endOfYear(r),o=e.endOfDay(r),{maxDaysInMonth:s,longestMonth:a}=$N(e,r).reduce((l,u)=>{const c=e.getDaysInMonth(u);return c>l.maxDaysInMonth?{maxDaysInMonth:c,longestMonth:u}:l},{maxDaysInMonth:0,longestMonth:null});return{year:({format:l})=>({minimum:0,maximum:Nje(e,l)?9999:99}),month:()=>({minimum:1,maximum:e.getMonth(i)+1}),day:({currentDate:l})=>({minimum:1,maximum:l!=null&&e.isValid(l)?e.getDaysInMonth(l):s,longestMonth:a}),weekDay:({format:l,contentType:u})=>{if(u==="digit"){const c=vS(e,l).map(Number);return{minimum:Math.min(...c),maximum:Math.max(...c)}}return{minimum:1,maximum:7}},hours:({format:l})=>{const u=e.getHours(o);return $p(e.formatByString(e.endOfDay(r),l),t)!==u.toString()?{minimum:1,maximum:Number($p(e.formatByString(e.startOfDay(r),l),t))}:{minimum:0,maximum:u}},minutes:()=>({minimum:0,maximum:e.getMinutes(o)}),seconds:()=>({minimum:0,maximum:e.getSeconds(o)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}};let ZY=!1;const JY=(e,t)=>{if(process.env.NODE_ENV!=="production"&&!ZY){const n=["empty"];["date","date-time"].includes(t)&&n.push("weekDay","day","month","year"),["time","date-time"].includes(t)&&n.push("hours","minutes","seconds","meridiem"),e.find(i=>!n.includes(i.type))&&(ZY=!0)}},Bje=(e,t,n,r)=>{switch(t.type){case"year":return e.setYear(r,e.getYear(n));case"month":return e.setMonth(r,e.getMonth(n));case"weekDay":{const i=vS(e,t.format),o=e.formatByString(n,t.format),s=i.indexOf(o),l=i.indexOf(t.value)-s;return e.addDays(n,l)}case"day":return e.setDate(r,e.getDate(n));case"meridiem":{const i=e.getHours(n)<12,o=e.getHours(r);return i&&o>=12?e.addHours(r,-12):!i&&o<12?e.addHours(r,12):r}case"hours":return e.setHours(r,e.getHours(n));case"minutes":return e.setMinutes(r,e.getMinutes(n));case"seconds":return e.setSeconds(r,e.getSeconds(n));default:return r}},eK={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},tK=(e,t,n,r,i)=>[...n].sort((o,s)=>eK[o.type]-eK[s.type]).reduce((o,s)=>!i||s.modified?Bje(e,s,t,o):o,r),$je=()=>navigator.userAgent.toLowerCase().includes("android"),jje=(e,t)=>{const n={};if(!t)return e.forEach((l,u)=>{const c=u===0?null:u-1,d=u===e.length-1?null:u+1;n[u]={leftIndex:c,rightIndex:d}}),{neighbors:n,startIndex:0,endIndex:e.length-1};const r={},i={};let o=0,s=0,a=e.length-1;for(;a>=0;){s=e.findIndex((l,u)=>u>=o&&l.endSeparator?.includes(" ")&&l.endSeparator!==" / "),s===-1&&(s=e.length-1);for(let l=s;l>=o;l-=1)i[l]=a,r[a]=l,a-=1;o=s+1}return e.forEach((l,u)=>{const c=i[u],d=c===0?null:r[c-1],p=c===e.length-1?null:r[c+1];n[u]={leftIndex:d,rightIndex:p}}),{neighbors:n,startIndex:r[0],endIndex:r[e.length-1]}},GN=(e,t)=>{if(e==null)return null;if(e==="all")return"all";if(typeof e=="string"){const n=t.findIndex(r=>r.type===e);return n===-1?null:n}return e},Uje=(e,t)=>{if(e.value)switch(e.type){case"month":{if(e.contentType==="digit")return t.format(t.setMonth(t.date(),Number(e.value)-1),"month");const n=t.parse(e.value,e.format);return n?t.format(n,"month"):void 0}case"day":return e.contentType==="digit"?t.format(t.setDate(t.startOfYear(t.date()),Number(e.value)),"dayOfMonthFull"):e.value;case"weekDay":return;default:return}},Hje=(e,t)=>{if(e.value)switch(e.type){case"weekDay":return e.contentType==="letter"?void 0:Number(e.value);case"meridiem":{const n=t.parse(`01:00 ${e.value}`,`${t.formats.hours12h}:${t.formats.minutes} ${e.format}`);return n?t.getHours(n)>=12?1:0:void 0}case"day":return e.contentType==="digit-with-letter"?parseInt(e.value,10):Number(e.value);case"month":{if(e.contentType==="digit")return Number(e.value);const n=t.parse(e.value,e.format);return n?t.getMonth(n)+1:void 0}default:return e.contentType!=="letter"?Number(e.value):void 0}},Vje=["value","referenceDate"],zs={emptyValue:null,getTodayValue:jN,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,r=Ct(e,Vje);return t!=null&&r.utils.isValid(t)?t:n??wje(r)},cleanValue:Tje,areValuesEqual:vje,isSameError:(e,t)=>e===t,hasError:e=>e!=null,defaultErrorState:null,getTimezone:(e,t)=>t==null||!e.isValid(t)?null:e.getTimezone(t),setTimezone:(e,t,n)=>n==null?null:e.setTimezone(n,t)},Gje={updateReferenceValue:(e,t,n)=>t==null||!e.isValid(t)?n:t,getSectionsFromValue:(e,t,n,r)=>!e.isValid(t)&&!!n?n:r(t),getV7HiddenInputValueFromSections:kje,getV6InputValueFromSections:Mje,getActiveDateManager:(e,t)=>({date:t.value,referenceDate:t.referenceValue,getSections:n=>n,getNewValuesFromNewActiveDate:n=>({value:n,referenceValue:n==null||!e.isValid(n)?t.referenceValue:n})}),parseValueStr:(e,t,n)=>n(e.trim(),t)},Wje=["onChange","maxRows","minRows","style","value"];function SS(e){return parseInt(e,10)||0}const Qje={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function zje(e){for(const t in e)return!1;return!0}function nK(e){return zje(e)||e.outerHeightStyle===0&&!e.overflowing}const rK=ye.forwardRef(function(t,n){const{onChange:r,maxRows:i,minRows:o=1,style:s,value:a}=t,l=Ct(t,Wje),{current:u}=ye.useRef(a!=null),c=ye.useRef(null),d=ai(n,c),p=ye.useRef(null),h=ye.useRef(null),A=ye.useCallback(()=>{const T=c.current,v=h.current;if(!T||!v)return;const x=kc(T).getComputedStyle(T);if(x.width==="0px")return{outerHeightStyle:0,overflowing:!1};v.style.width=x.width,v.value=T.value||t.placeholder||"x",v.value.slice(-1)===`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boltic/swirl",
3
- "version": "1.0.2-sit.51",
3
+ "version": "1.0.2-sit.52",
4
4
  "description": "Visual workflow builder library for React — drag-and-drop automation with React Flow and Material-UI",
5
5
  "type": "commonjs",
6
6
  "main": "dist/swirl.umd.js",