pixel-react 1.19.1 → 1.19.3

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/lib/index.js CHANGED
@@ -16,7 +16,7 @@ import{jsx as e,Fragment as t,jsxs as n}from"react/jsx-runtime";import*as r from
16
16
  object-assign
17
17
  (c) Sindre Sorhus
18
18
  @license MIT
19
- */function Ph(){if(Hh)return kh;Hh=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return kh=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(r,i){for(var o,a,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),s=1;s<arguments.length;s++){for(var c in o=Object(arguments[s]))t.call(o,c)&&(l[c]=o[c]);if(e){a=e(o);for(var d=0;d<a.length;d++)n.call(o,a[d])&&(l[a[d]]=o[a[d]])}}return l},kh}function Fh(){if(_h)return Sh;_h=1;return Sh="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Uh(){return Oh?Vh:(Oh=1,Vh=Function.call.bind(Object.prototype.hasOwnProperty))}function qh(){if(Nh)return zh;Nh=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=Fh(),n={},r=Uh();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function i(i,o,a,l,s){if("production"!==process.env.NODE_ENV)for(var c in i)if(r(i,c)){var d;try{if("function"!=typeof i[c]){var u=Error((l||"React class")+": "+a+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}d=i[c](o,c,l,a,null,t)}catch(e){d=e}if(!d||d instanceof Error||e((l||"React class")+": type specification of "+a+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var f=s?s():"";e("Failed "+a+" type: "+d.message+(null!=f?f:""))}}}return i.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},zh=i}function Wh(){if(Ih)return Th;Ih=1;var e=Bh(),t=Ph(),n=Fh(),r=Uh(),i=qh(),o=function(){};function a(){return null}return"production"!==process.env.NODE_ENV&&(o=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),Th=function(l,s){var c="function"==typeof Symbol&&Symbol.iterator;var d="<<anonymous>>",u={array:C("array"),bigint:C("bigint"),bool:C("boolean"),func:C("function"),number:C("number"),object:C("object"),string:C("string"),symbol:C("symbol"),any:p(a),arrayOf:function(e){return p(function(t,r,i,o,a){if("function"!=typeof e)return new h("Property `"+a+"` of component `"+i+"` has invalid PropType notation inside arrayOf.");var l=t[r];if(!Array.isArray(l))return new h("Invalid "+o+" `"+a+"` of type `"+v(l)+"` supplied to `"+i+"`, expected an array.");for(var s=0;s<l.length;s++){var c=e(l,s,i,o,a+"["+s+"]",n);if(c instanceof Error)return c}return null})},element:p(function(e,t,n,r,i){var o=e[t];return l(o)?null:new h("Invalid "+r+" `"+i+"` of type `"+v(o)+"` supplied to `"+n+"`, expected a single ReactElement.")}),elementType:p(function(t,n,r,i,o){var a=t[n];return e.isValidElementType(a)?null:new h("Invalid "+i+" `"+o+"` of type `"+v(a)+"` supplied to `"+r+"`, expected a single ReactElement type.")}),instanceOf:function(e){return p(function(t,n,r,i,o){if(!(t[n]instanceof e)){var a=e.name||d;return new h("Invalid "+i+" `"+o+"` of type `"+(((l=t[n]).constructor&&l.constructor.name?l.constructor.name:d)+"` supplied to `")+r+"`, expected instance of `"+a+"`.")}var l;return null})},node:p(function(e,t,n,r,i){return g(e[t])?null:new h("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return p(function(t,i,o,a,l){if("function"!=typeof e)return new h("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var s=t[i],c=v(s);if("object"!==c)return new h("Invalid "+a+" `"+l+"` of type `"+c+"` supplied to `"+o+"`, expected an object.");for(var d in s)if(r(s,d)){var u=e(s,d,o,a,l+"."+d,n);if(u instanceof Error)return u}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&o(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),a;return p(function(t,n,r,i,o){for(var a=t[n],l=0;l<e.length;l++)if(f(a,e[l]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===y(t)?String(t):t});return new h("Invalid "+i+" `"+o+"` of value `"+String(a)+"` supplied to `"+r+"`, expected one of "+s+".")})},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&o("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var t=0;t<e.length;t++){var i=e[t];if("function"!=typeof i)return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+w(i)+" at index "+t+"."),a}return p(function(t,i,o,a,l){for(var s=[],c=0;c<e.length;c++){var d=(0,e[c])(t,i,o,a,l,n);if(null==d)return null;d.data&&r(d.data,"expectedType")&&s.push(d.data.expectedType)}return new h("Invalid "+a+" `"+l+"` supplied to `"+o+"`"+(s.length>0?", expected one of type ["+s.join(", ")+"]":"")+".")})},shape:function(e){return p(function(t,r,i,o,a){var l=t[r],s=v(l);if("object"!==s)return new h("Invalid "+o+" `"+a+"` of type `"+s+"` supplied to `"+i+"`, expected `object`.");for(var c in e){var d=e[c];if("function"!=typeof d)return m(i,o,a,c,y(d));var u=d(l,c,i,o,a+"."+c,n);if(u)return u}return null})},exact:function(e){return p(function(i,o,a,l,s){var c=i[o],d=v(c);if("object"!==d)return new h("Invalid "+l+" `"+s+"` of type `"+d+"` supplied to `"+a+"`, expected `object`.");var u=t({},i[o],e);for(var f in u){var p=e[f];if(r(e,f)&&"function"!=typeof p)return m(a,l,s,f,y(p));if(!p)return new h("Invalid "+l+" `"+s+"` key `"+f+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(i[o],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var C=p(c,f,a,l,s+"."+f,n);if(C)return C}return null})}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function h(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function p(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function i(i,a,l,c,u,f,p){if(c=c||d,f=f||l,p!==n){if(s){var C=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw C.name="Invariant Violation",C}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var m=c+":"+l;!t[m]&&r<3&&(o("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+c+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[m]=!0,r++)}}return null==a[l]?i?null===a[l]?new h("The "+u+" `"+f+"` is marked as required in `"+c+"`, but its value is `null`."):new h("The "+u+" `"+f+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(a,l,c,u,f)}var a=i.bind(null,!1);return a.isRequired=i.bind(null,!0),a}function C(e){return p(function(t,n,r,i,o,a){var l=t[n];return v(l)!==e?new h("Invalid "+i+" `"+o+"` of type `"+y(l)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null})}function m(e,t,n,r,i){return new h((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+i+"`.")}function g(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(g);if(null===e||l(e))return!0;var t=function(e){var t=e&&(c&&e[c]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!g(n.value))return!1}else for(;!(n=r.next()).done;){var i=n.value;if(i&&!g(i[1]))return!1}return!0;default:return!1}}function v(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function y(e){if(null==e)return""+e;var t=v(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function w(e){var t=y(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return h.prototype=Error.prototype,u.checkPropTypes=i,u.resetWarningCache=i.resetWarningCache,u.PropTypes=u,u},Th}function Qh(){if(Zh)return Dh;Zh=1;var e=Fh();function t(){}function n(){}return n.resetWarningCache=t,Dh=function(){function r(t,n,r,i,o,a){if(a!==e){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function i(){return r}r.isRequired=r;var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o}}function Kh(){if(jh)return Eh.exports;if(jh=1,"production"!==process.env.NODE_ENV){var e=Bh();Eh.exports=Wh()(e.isElement,true)}else Eh.exports=Qh()();return Eh.exports}var Gh=H(Kh()),Yh=["sitekey","onChange","theme","type","tabindex","onExpired","onErrored","size","stoken","grecaptcha","badge","hl","isolated"];function Xh(){return Xh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xh.apply(this,arguments)}function Jh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $h(e,t){return $h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$h(e,t)}var ep,tp,np=function(e){var t,n;function i(){var t;return(t=e.call(this)||this).handleExpired=t.handleExpired.bind(Jh(t)),t.handleErrored=t.handleErrored.bind(Jh(t)),t.handleChange=t.handleChange.bind(Jh(t)),t.handleRecaptchaRef=t.handleRecaptchaRef.bind(Jh(t)),t}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,$h(t,n);var o=i.prototype;return o.getCaptchaFunction=function(e){return this.props.grecaptcha?this.props.grecaptcha.enterprise?this.props.grecaptcha.enterprise[e]:this.props.grecaptcha[e]:null},o.getValue=function(){var e=this.getCaptchaFunction("getResponse");return e&&void 0!==this._widgetId?e(this._widgetId):null},o.getWidgetId=function(){return this.props.grecaptcha&&void 0!==this._widgetId?this._widgetId:null},o.execute=function(){var e=this.getCaptchaFunction("execute");if(e&&void 0!==this._widgetId)return e(this._widgetId);this._executeRequested=!0},o.executeAsync=function(){var e=this;return new Promise(function(t,n){e.executionResolve=t,e.executionReject=n,e.execute()})},o.reset=function(){var e=this.getCaptchaFunction("reset");e&&void 0!==this._widgetId&&e(this._widgetId)},o.forceReset=function(){var e=this.getCaptchaFunction("reset");e&&e()},o.handleExpired=function(){this.props.onExpired?this.props.onExpired():this.handleChange(null)},o.handleErrored=function(){this.props.onErrored&&this.props.onErrored(),this.executionReject&&(this.executionReject(),delete this.executionResolve,delete this.executionReject)},o.handleChange=function(e){this.props.onChange&&this.props.onChange(e),this.executionResolve&&(this.executionResolve(e),delete this.executionReject,delete this.executionResolve)},o.explicitRender=function(){var e=this.getCaptchaFunction("render");if(e&&void 0===this._widgetId){var t=document.createElement("div");this._widgetId=e(t,{sitekey:this.props.sitekey,callback:this.handleChange,theme:this.props.theme,type:this.props.type,tabindex:this.props.tabindex,"expired-callback":this.handleExpired,"error-callback":this.handleErrored,size:this.props.size,stoken:this.props.stoken,hl:this.props.hl,badge:this.props.badge,isolated:this.props.isolated}),this.captcha.appendChild(t)}this._executeRequested&&this.props.grecaptcha&&void 0!==this._widgetId&&(this._executeRequested=!1,this.execute())},o.componentDidMount=function(){this.explicitRender()},o.componentDidUpdate=function(){this.explicitRender()},o.handleRecaptchaRef=function(e){this.captcha=e},o.render=function(){var e=this.props;e.sitekey,e.onChange,e.theme,e.type,e.tabindex,e.onExpired,e.onErrored,e.size,e.stoken,e.grecaptcha,e.badge,e.hl,e.isolated;var t=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,Yh);return r.createElement("div",Xh({},t,{ref:this.handleRecaptchaRef}))},i}(r.Component);np.displayName="ReCAPTCHA",np.propTypes={sitekey:Gh.string.isRequired,onChange:Gh.func,grecaptcha:Gh.object,theme:Gh.oneOf(["dark","light"]),type:Gh.oneOf(["image","audio"]),tabindex:Gh.number,onExpired:Gh.func,onErrored:Gh.func,size:Gh.oneOf(["compact","normal","invisible"]),stoken:Gh.string,hl:Gh.string,badge:Gh.oneOf(["bottomright","bottomleft","inline"]),isolated:Gh.bool},np.defaultProps={onChange:function(){},theme:"light",type:"image",tabindex:0,size:"normal",badge:"bottomright"};var rp=function(){if(tp)return ep;tp=1;var e=Bh(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},i={};function o(n){return e.isMemo(n)?r:i[n.$$typeof]||t}i[e.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i[e.Memo]=r;var a=Object.defineProperty,l=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,c=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,u=Object.prototype;return ep=function e(t,r,i){if("string"!=typeof r){if(u){var f=d(r);f&&f!==u&&e(t,f,i)}var h=l(r);s&&(h=h.concat(s(r)));for(var p=o(t),C=o(r),m=0;m<h.length;++m){var g=h[m];if(!(n[g]||i&&i[g]||C&&C[g]||p&&p[g])){var v=c(r,g);try{a(t,g,v)}catch(e){}}}}return t},ep}(),ip=H(rp);function op(){return op=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},op.apply(this,arguments)}var ap={},lp=0;var sp="onloadcallback";function cp(){return"undefined"!=typeof window&&window.recaptchaOptions||{}}var dp=function(e,t){return t=t||{},function(n){var r=n.displayName||n.name||"Component",i=function(r){var i,o;function a(e,t){var n;return(n=r.call(this,e,t)||this).state={},n.__scriptURL="",n}o=r,(i=a).prototype=Object.create(o.prototype),i.prototype.constructor=i,i.__proto__=o;var l=a.prototype;return l.asyncScriptLoaderGetScriptLoaderID=function(){return this.__scriptLoaderID||(this.__scriptLoaderID="async-script-loader-"+lp++),this.__scriptLoaderID},l.setupScriptURL=function(){return this.__scriptURL="function"==typeof e?e():e,this.__scriptURL},l.asyncScriptLoaderHandleLoad=function(e){var t=this;this.setState(e,function(){return t.props.asyncScriptOnLoad&&t.props.asyncScriptOnLoad(t.state)})},l.asyncScriptLoaderTriggerOnScriptLoaded=function(){var e=ap[this.__scriptURL];if(!e||!e.loaded)throw new Error("Script is not loaded.");for(var n in e.observers)e.observers[n](e);delete window[t.callbackName]},l.componentDidMount=function(){var e=this,n=this.setupScriptURL(),r=this.asyncScriptLoaderGetScriptLoaderID(),i=t,o=i.globalName,a=i.callbackName,l=i.scriptId;if(o&&void 0!==window[o]&&(ap[n]={loaded:!0,observers:{}}),ap[n]){var s=ap[n];return s&&(s.loaded||s.errored)?void this.asyncScriptLoaderHandleLoad(s):void(s.observers[r]=function(t){return e.asyncScriptLoaderHandleLoad(t)})}var c={};c[r]=function(t){return e.asyncScriptLoaderHandleLoad(t)},ap[n]={loaded:!1,observers:c};var d=document.createElement("script");for(var u in d.src=n,d.async=!0,t.attributes)d.setAttribute(u,t.attributes[u]);l&&(d.id=l);var f=function(e){if(ap[n]){var t=ap[n].observers;for(var r in t)e(t[r])&&delete t[r]}};a&&"undefined"!=typeof window&&(window[a]=function(){return e.asyncScriptLoaderTriggerOnScriptLoaded()}),d.onload=function(){var e=ap[n];e&&(e.loaded=!0,f(function(t){return!a&&(t(e),!0)}))},d.onerror=function(){var e=ap[n];e&&(e.errored=!0,f(function(t){return t(e),!0}))},document.body.appendChild(d)},l.componentWillUnmount=function(){var e=this.__scriptURL;if(!0===t.removeOnUnmount)for(var n=document.getElementsByTagName("script"),r=0;r<n.length;r+=1)n[r].src.indexOf(e)>-1&&n[r].parentNode&&n[r].parentNode.removeChild(n[r]);var i=ap[e];i&&(delete i.observers[this.asyncScriptLoaderGetScriptLoaderID()],!0===t.removeOnUnmount&&delete ap[e])},l.render=function(){var e=t.globalName,r=this.props;r.asyncScriptOnLoad;var i=r.forwardedRef,o=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(r,["asyncScriptOnLoad","forwardedRef"]);return e&&"undefined"!=typeof window&&(o[e]=void 0!==window[e]?window[e]:void 0),o.ref=i,C(n,o)},a}(E),a=o(function(e,t){return C(i,op({},e,{forwardedRef:t}))});return a.displayName="AsyncScriptLoader("+r+")",a.propTypes={asyncScriptOnLoad:Gh.func},ip(a,n)}}(function(){var e=cp(),t=e.useRecaptchaNet?"recaptcha.net":"www.google.com";return e.enterprise?"https://"+t+"/recaptcha/enterprise.js?onload="+sp+"&render=explicit":"https://"+t+"/recaptcha/api.js?onload="+sp+"&render=explicit"},{callbackName:sp,globalName:"grecaptcha",attributes:cp().nonce?{nonce:cp().nonce}:{}})(np);const up=dp,fp=o(({onVerify:t,className:r="",error:i,sitekey:o,...a},l)=>{const[s,d]=c(null),u=i||s;return n("div",{className:z("ff-recaptcha-wrapper",r),children:[e(up,{ref:l,sitekey:o,onChange:e=>{e?(d(null),t(e)):d("Please complete the CAPTCHA")},...a}),u&&e("div",{className:"ff-recaptcha-error",children:e(F,{fontSize:12,children:u})})]})}),hp={margin:6,optionHeight:32,selectInputHeight:38,dropDownWrapperPadding:0},pp=({onSelectBlur:r,onSelectOptionSelector:i,dropdownPosition:o,options:s=[],optionZIndex:u=100,inputRef:f,webServiceClick:h=()=>{},containerWidth:p,loadMoreOptions:C,chipRef:m,isWebservice:g=!0,dropDownMessage:v=""})=>{const[y,w]=c(null),[b,E]=c(""),M=d(W),A=M?.currentTheme,x=a(null),[L,k]=c(-1);Y(x,r,[f,m]);const{positionX:H,positionY:S,width:_,fromBottom:V}=o,{margin:O,optionHeight:N,selectInputHeight:T,dropDownWrapperPadding:I}=hp,D=e=>{let t="",n="";return"NLP"===e?(t="NLP",n="ff-nlp"):"STEP_GROUP"===e?(t="SG",n="ff-sg"):"PROGRAM_ELEMENTS"===e?(t="PE",n="ff-pe"):"WORKBENCH_REQUEST"===e?(t="WS",n="ff-ws"):(t="--",n="nlp-default"),{label:t,className:n}},Z=({platform:n,nlpType:r})=>"NLP"===r?e(P,"Web"===n?{name:"web_icon",height:10,width:10}:"Android"===n?{name:"android_icon",height:10,width:10}:"iOS"===n?{name:"ios_icon",height:10,width:10,color:"var(--dotted-border-color)"}:"Generic"===n?{name:"mobile_icon",height:10,width:10}:{name:"common_nlp",height:10,width:10}):"WORKBENCH_REQUEST"===r&&"Webservice"===n?e(P,{name:"web_service_icon",height:8,width:8}):e(t,{});se(["ff-nlp-dropdown-pagination"],{root:document.getElementById("ff-nlp-dropdown-options-wrapper"),rootMargin:"0px",threshold:.1,onIntersect:(e,t)=>{e.isIntersecting&&C&&C()}}),l(()=>{if(L>=0&&L<s.length){const e=s[L];w(e),E("show")}else L>=s.length&&(w(null),E(""),k(-1));const e=e=>{if(s.length)switch(e.key){case"ArrowDown":e.preventDefault(),k(e=>e<s.length-1?e+1:0);break;case"ArrowUp":e.preventDefault(),k(e=>e>0?e-1:s.length-1);break;case"Enter":L>=0&&s[L]&&i(s[L])}};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[s,L]),l(()=>{if(L<0)return;const e=document.getElementById(`ff-nlp-option-${L}`);e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})},[L]),l(()=>{if(!s?.length)return;const e=x.current;if(!e)return;const t=t=>{e.contains(t.target)||(t.stopPropagation(),t.preventDefault())};return document.body.addEventListener("wheel",t,{passive:!1}),document.body.addEventListener("touchmove",t,{passive:!1}),()=>{document.body.removeEventListener("wheel",t),document.body.removeEventListener("touchmove",t)}},[s]);const j=e=>e?.searchName||e?.displayName||e?.desc||e?.name||e?.nlpName||"---";return e("div",{className:"ff-nlp-dropdown-wrapper",children:n("div",{ref:x,style:{...(()=>{let e;return e=K(s)||s.length>0?5*N+2*I:s.length*N+2*I,V>e+O+80?{left:H,top:S,width:_,zIndex:u}:{zIndex:u,left:H,width:_,top:S-T-92-e-O}})(),width:p},className:z("ff-nlp-options-wrapper",A),onMouseLeave:()=>E("hide"),children:[n("div",{className:"ff-nlp-options-wrapper-main",children:[e("div",{className:"ff-nlp-options-primary-wrapper",id:"ff-nlp-dropdown-options-wrapper",children:K(s)?e(F,{textAlign:"center",lineHeight:"32px",as:"p",color:"var(--ff-nlp-text-color)",className:"ff-nlp-no-option",children:K(v)?"No Results Found":v}):n(t,{children:[s.map((t,r)=>e("div",{onMouseEnter:()=>{w(t),E("show")},id:`ff-nlp-option-${r}`,children:e("div",{onMouseEnter:()=>k(r),onClick:()=>i(t),onKeyDown:e=>{"Enter"===e.key&&i(t)},children:n(F,{as:"div",lineHeight:"30px",fontSize:12,className:z("ff-nlp-option",A,{"ff-nlp-option--selected":L===r}),children:[e(G,{title:t.platform,children:e("span",{children:e(F,{className:`nlp-categories ${D(t.nlpType).className}`,fontWeight:"regular",fontSize:8,lineHeight:"32px",children:D(t.nlpType).label})})}),e("span",{children:Z(t)}),j(t)]})})},`ff-nlp-option-${r}`)),e("div",{id:"ff-nlp-dropdown-pagination"})]})}),g&&e("div",{children:e("div",{className:"show"===b?"ff-nlp-web-service-div":"ff-nlp-primary-web-service-div",children:e(eh,{iconName:"plus_user_icon",label:"Web Service",onClick:()=>{r(),h()}})})})]}),e("div",{className:"show"===b?"ff-nlp-data-show":"ff-nlp-data-hide",children:n("div",{className:"ff-nlp-data-side-menu",children:[y?.videoSrc&&n(F,{className:"nlp-details-header",fontWeight:"semi-bold",fontSize:10,children:["Video",e("div",{className:"nlp-details ",children:e("video",{src:y.videoSrc,controls:!0,className:"nlp-video-player",width:"100%",children:"Your browser does not support the video tag."})})]}),n(F,{className:"nlp-details-header",fontWeight:"semi-bold",fontSize:12,children:["NLP Details",e(F,{className:"nlp-details",fontWeight:"regular",fontSize:12,children:j(y)})]}),n(F,{className:"nlp-details-header",fontWeight:"semi-bold",fontSize:12,children:["Description",e(F,{className:"nlp-details",fontWeight:"regular",fontSize:12,children:y?.description||"--"})]}),"STEP_GROUP"===y?.nlpType&&e(t,{children:n(F,{className:"nlp-details-header",fontWeight:"semi-bold",fontSize:12,children:["Path",e(F,{className:"nlp-details",fontWeight:"regular",fontSize:12,children:y?.path?y?.path:"---"})]})}),e(F,{className:"nlp-details-header",fontWeight:"semi-bold",fontSize:12,children:"Inputs"}),y?.stepInputs?.length?y.stepInputs.map((t,r)=>{const i=t.type?t?.type?.split(".")?.pop():"--";return e("div",{children:n(F,{className:"nlp-details-header",fontWeight:"semi-bold",fontSize:12,children:["Input",r+1,n(F,{className:"nlp-details",fontWeight:"regular",fontSize:12,children:["type: ",i]}),n(F,{className:"nlp-details",fontWeight:"regular",fontSize:12,children:["name: ",t.name||"--"]})]})},r)}):e("div",{className:"nlp-details",children:"--"}),n(F,{className:"nlp-details-header",fontWeight:"semi-bold",fontSize:12,children:["Output",e(F,{className:"nlp-details ",fontWeight:"regular",fontSize:12,children:y?.returnType||"--"})]})]})})]})})},Cp=o(({chipOptionList:t,selectedChips:r,optionZIndex:i=0,inputRef:o,ChipsAccordionWidth:s},d)=>{const[f,h]=c([]),[p,C]=c(!1),[m,g]=c({left:0,top:0}),[v,y]=c("down"),w=a(null);b(d,()=>w.current);const E=ar(w,p);l(()=>{K(t)||h(t)},[t]);const M=a(null),x=()=>{M.current};l(()=>{x()},[f]),u(()=>{const e=()=>{if(!o?.current)return;const{positionX:e,positionY:t,width:n,fromBottom:r}=E(o);y(r<160?"up":"down"),g({left:e+n,top:t})};e();const t=new ResizeObserver(()=>e());return o?.current&&t.observe(o.current),window.addEventListener("scroll",e,!0),()=>{o?.current&&t.unobserve(o.current),t.disconnect(),window.removeEventListener("scroll",e,!0)}},[E,o]);return l(()=>{const e=()=>{x()};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),A(n("div",{className:"ff-chips-accordion",style:{left:m.left,top:m.top,zIndex:i+100,transform:"up"===v?"translateY(calc(-100% + 33px))":"none",width:s,position:"absolute"},ref:w,children:[e("div",{ref:M,className:"ff-chips-row "+(p?"expanded":""),style:{maxHeight:p?"280px":"20px"},children:e("div",{className:"chips-container "+(p?"chips-container-scroll":""),children:f?.map(({name:t,isSelected:n},i)=>e("div",{className:"chip "+(n?"selected-chip":""),onClick:()=>(e=>{const t=f.map((t,n)=>n===e?{...t,isSelected:!t.isSelected}:t);if(h(t),r){const e=t.filter(e=>e.isSelected);r(e)}})(i),children:e(F,{as:"div",className:"chip-text",children:t,fontSize:10,lineHeight:"15px"})},i))})}),e("div",{className:"ff-arrow-icon-container",children:e("div",{className:"ff-icon-wrapper "+(p?"expanded":""),role:"button","aria-expanded":p,children:e(P,{name:"down"===v?"arrows_down_icon":"arrows_top_icon",height:8,width:8,onClick:()=>{C(e=>!e),p&&document.querySelector(".ff-chips-row")?.scrollTo({top:0})}})})})]}),document.body)}),mp=(e,t)=>{switch(t.type){case"FOCUS_INPUT":return{...e,isInputFocused:!0,isIconClick:!0,showOptions:!0};case"BLUR_INPUT":return{...e,isInputFocused:!1,option:t.payload.option,isIconClick:!1,showOptions:!1,dropdownPosition:{positionX:0,positionY:0,width:0,fromBottom:0}};case"UPDATE_DROPDOWN_POSITION":const{positionX:n,positionY:r,width:i,fromBottom:o}=t.payload||{};return{...e,dropdownPosition:{positionX:n,positionY:r,width:i,fromBottom:o}};case"UPDATE_OPTION":return{...e,option:t.payload};case"SHOW_ERROR":return{...e,isInputFocused:!0,isIconClick:!1,showOptions:!1,option:t.payload.option,dropdownPosition:{positionX:0,positionY:0,width:0,fromBottom:0}};default:return e}},gp=({label:t="",leftIcon:r,rightIcon:i,rightIconColor:o,showLabel:s=!0,onHelpIconClick:d=()=>{},aiIconClick:f=()=>{},webServiceClick:h=()=>{},containerWidth:p="",optionsList:C=[],selectedOption:m={displayName:"",projectId:"",nlpType:"",platform:""},onChange:g=()=>{},errorMsg:y="",className:w="",optionZIndex:b=100,disabled:E=!1,borderRadius:M=!0,showBorder:x=!0,required:L=!1,value:k="",onSelect:H=()=>{},chipOptionList:S,selectedChips:_,loadMoreOptions:V=()=>{},isWebservice:O=!0,closeInputOnOutsideClick:N=()=>{},tooltipText:T="Help",ChipsAccordionWidth:I="27.8%",dropDownMessage:D=""})=>{const Z={isInputFocused:!1,isIconClick:!1,showOptions:!1,option:K(m)&&"string"==typeof m?.displayName?m.displayName:"",dropdownPosition:{positionX:0,positionY:0,width:0,fromBottom:0}},[j,R]=v(mp,Z),[B,U]=c(m),[q,W]=c({}),Q=a(!1);l(()=>{const e="string"==typeof m.displayName?m.displayName:String(m.displayName??"");e!==B.displayName&&U({...m,displayName:e})},[m]),l(()=>{k&&ie("FOCUS_INPUT")},[k]);const G=a(null),Y=a(null),X=a(null),{isInputFocused:J,isIconClick:$,showOptions:ee,dropdownPosition:te,option:ne}=j,re=ar(G,ee),ie=e=>{E||R("SHOW_ERROR"===e||"BLUR_INPUT"===e?{type:e,payload:{option:"string"==typeof m.displayName?m.displayName:String(m.displayName??"")}}:{type:e})},oe=()=>{if(!ee||!G?.current||E)return;const{positionX:e,positionY:t,width:n,fromBottom:r}=re(G);R({type:"UPDATE_DROPDOWN_POSITION",payload:{positionX:e,positionY:t,width:n,fromBottom:r}})},ae=e=>{const t=window.innerWidth-document.body.clientWidth;document.body.style.paddingRight=e?"":`${t}px`,document.body.style.overflow=e?"":"hidden"};u(()=>{if(E)return;ee&&ae(!ee),oe();const e=()=>oe();return window.addEventListener("resize",e),window.addEventListener("scroll",e),()=>{ae(!0),window.removeEventListener("resize",e),window.removeEventListener("scroll",e)}},[ee]),l(()=>{y&&ie("SHOW_ERROR")},[]),l(()=>{ie("FOCUS_INPUT")},[]);const le=!J&&Boolean(ne);return l(()=>{const e=Y.current;if(!e)return;let t=e.parentElement;for(;t&&t!==document.body;){const e=getComputedStyle(t);if(["scroll","auto"].includes(e.overflowY))break;t=t.parentElement}if(!t)return;const n=t.style.overflow,r=ee||S;return t.style.overflow=r?"hidden":n||"auto",()=>{t.style.overflow=n||"auto"}},[ee,S]),n("section",{className:"main-section",children:[n("div",{className:z(`ff-nlp-input-wrapper ${w}`),children:[n("div",{className:"ff-nlp-input",children:[e("input",{type:"text",className:z("ff-nlp-input-container",{"ff-nlp-input-container--default":!J,"ff-nlp-input-container--active":le,"ff-nlp-input-container--no-label":!s,"ff-nlp-input-container--error":y&&!J&&!Boolean(ne),"ff-nlp-input-container--border-radius":!M,"ff-nlp-input-container--disable":E,"ff-nlp-input-container--no-border":!x}),style:{zIndex:b,paddingLeft:"32px"},onFocus:()=>ie("FOCUS_INPUT"),onChange:e=>{E||g(e)},value:k,disabled:E,autoComplete:"off",spellCheck:"false",ref:Y,autoFocus:!0}),n("div",{className:"ff-nlp-icon-container",children:[e(P,{name:r||"ai_search",className:"ff-nlp-help_icon",width:16,height:16,onClick:f}),e(F,{className:"icon-label",fontSize:10,children:"Search With Ai"})]}),s&&n("div",{className:z("ff-nlp-input-label","ff-nlp-input-label--default",{"ff-nlp-input-label--active":k||Boolean(ne),"ff-nlp-input-label--error":y}),children:[L&&e(F,{color:"var(--$error-light)",className:"ff-nlp-input-label--required",children:"*"}),t]}),n("div",{className:"help-icon-container",onMouseDown:()=>Q.current=!0,style:{zIndex:b},children:[e("span",{className:z("ff-nlp-input-arrow",{"ff-nlp-input-arrow--down":!$,"ff-nlp-input-arrow--no-label":!s}),onMouseEnter:e=>{const t=e.target.getBoundingClientRect();W({top:t.top+window.scrollY-20+"px",left:`${t.left+window.scrollX+.5*t.width}px`,visibility:"visible",opacity:1,transitionDelay:"0s"})},onMouseLeave:()=>W(e=>({...e,visibility:"hidden",opacity:0})),children:e(P,{name:i||"",height:16,width:16,onClick:d,color:o})}),A(e(F,{className:"help-icon-label",fontSize:10,style:q,children:T}),document.body)]}),e("fieldset",{className:z("ff-nlp-input-fieldset",{"ff-nlp-input-fieldset--no-label":!s,"ff-nlp-input-fieldset--default":!J,"ff-nlp-input-fieldset--active":J,"ff-nlp-input-fieldset--option":le,"ff-nlp-input-fieldset--error":y,"ff-nlp-input-fieldset--border-radius":!M,"ff-nlp-input-fieldset--no-border":!x})})]}),y&&e(F,{className:"ff-nlp-input-wrapper-error-text",fontSize:8,color:"var(--error-light)",children:y}),e("div",{ref:G,children:ee&&A(e(pp,{onSelectBlur:()=>{E||(Q.current?Q.current=!1:y?ie("SHOW_ERROR"):(ie("BLUR_INPUT"),N()))},onSelectOptionSelector:e=>{H(e)},dropdownPosition:te,options:C,optionZIndex:b,inputRef:Y,webServiceClick:h,containerWidth:p,loadMoreOptions:V,chipRef:X,isWebservice:O,dropDownMessage:D}),document.body)})]}),e("div",{className:"chips-accordion-content",children:S&&S.length>0&&e(Cp,{chipOptionList:S,selectedChips:_,optionZIndex:b,ref:X,inputRef:Y,ChipsAccordionWidth:I})})]})},vp=({items:t,onButtonClick:r,selectedValue:i=null,onChange:o,className:a=""})=>{const[s,d]=c(i);l(()=>{i!==s&&d(i)},[i,s]);return n("div",{className:z("ff-icon-radio-group",a),children:[t.map(t=>e("div",{className:z("ff-icon-radio-button",{selected:s===t.iconName,disabled:t.disabled}),onClick:()=>(e=>{if(e.disabled)return;const t=e.iconName;d(t),o&&o(t),r(e)})(t),children:e(G,{title:t.iconLabel,children:e("div",{className:z("icon-container",{selected:s===t.iconName}),children:e(P,{name:t.iconName,hoverEffect:!1,color:s===t.iconName?"var(--drawer-footer-bg)":"var(--brand-color)"})})})},t.iconName)),e("div",{className:"line-connector"})]})},yp=({width:t="100%",options:r=[],runCount:i=0,className:o="",contentReverse:a=!1,onClick:l=()=>{},modalId:s="",scriptType:c="",readOnly:d=!1})=>{const u={local:"local",browserstack:"browserstack_icon",saucelabs:"sause_lab_icon",lambdatest:"lambda_icon",fireflink:"fireflink_platform_logo",mac:"mac_icon",mac_icon:"mac_icon",android:"android_icon",linux:"linux","google chrome":"chrome_icon","mozilla firefox":"fire_fox","microsoft edge":"edge","internet explorer":"internet_explorer",safari:"safari_icon",opera:"opera",windows:"windows",edge:"edge",firefox:"fire_fox",chrome:"chrome_icon",explorer:"internet_explorer",ios:"mac_icon",comet:"comet_icon"},f="manual"===c.toLowerCase();return n("div",{id:s,style:{width:t},className:z("ff-machine-input-field-wrapper",o,{"cursor-event-none":1!==i&&"Automation"==c}),onClick:()=>{d||l()},children:[!f&&n(F,{as:"span",color:"var(--ff-machine-input-field-text-color)",fontSize:8,textAlign:"center",className:"ff-machine-input-label",children:["Run ",i]}),e("div",{className:z("ff-machine-input-field",{"ff-machine-input-field-reverse":a}),children:r.map(({label:t,type:r,version:i})=>n("div",{className:z("ff-machine-icon-text-wrapper",{"ff-machine-icon-text-wrapper-reverse":a}),children:[e(P,{name:u[r?.toLowerCase()]||"",className:"ff-machine-icon"}),e(G,{title:t,children:e(F,{className:z("ff-machine-text",{"ff-machine-text-reverse":a}),color:"var(--ff-machine-input-field-text-color)",children:oe(t,10)?ie(t,10):t})}),f&&!K(i)&&e(G,{title:i,children:n(F,{className:z("ff-machine-text",{"ff-machine-text-reverse":a}),color:"var(--ff-machine-input-field-text-color)",children:[" -"," ",oe(i??"",10)?ie(i??"",10):i]})})]},r))})]})};yp.displayName="MachineInputField";const wp=({datSetToolTip:{globalVariableSetName:r="",peVariableSetName:i="",testDataSetName:o=""}})=>{const a={"Project Environment Set":i,"Global Variable Set":r,"Test Data Set":o};return e(t,{children:Object.entries(a).map(([t,r],i)=>e("div",{className:"ff-dataSetList-container",children:n("div",{children:[e(F,{as:"div",fontSize:10,lineHeight:"15px",color:"var(--details-page-value-color)",className:"ff-dataSetList-items",children:t}),e(F,{as:"div",lineHeight:"18px",color:"var(--base-bg-color)",children:r})]})},i))})},bp=e=>"object"==typeof e&&0===Object.keys(e).length,Ep=s(null),Mp=({machineInstances:r,rowIndex:i,machineColumnCount:o,nextRowMachineInstance:a,previousRowMachineInstance:l,onAddBrowser:s,onDeleteBrowser:c,onAddRunBrowser:u,onUpdateDataSetList:f,onUpdateAddBrowserInstance:h,addInstanceLabel:p="",scriptType:C="",projectType:m="",readOnly:g,maxRunCount:v})=>{const y=i%2==0,w=K(r[o-1]),b=d(Ep),{testDataSetMap:E={},globalVariableMap:M={},projectVariableMap:A={}}=b||{},x=(e,t)=>e&&t&&"machineInstanceId"in e&&"machineInstanceId"in t&&e.machineInstanceId===t.machineInstanceId?"dashed":"solid",L=e=>r.length-1!==e&&o>1,k=(e="",t)=>{const{executionEnv:n,browserName:r,browserVersion:i,machineInfo:{osVersion:o,iconName:a,osName:l,hostName:s},deviceInfo:c,fireCloudProjectName:d=""}=t,u=[{label:"FireFlink Device Farm"===n?d:n,type:((e="")=>"local"===e.toLowerCase()?"local":e.toLowerCase().includes("browserstack")?"Browserstack":e.toLowerCase().includes("lambdatest")?"LambdaTest":e.toLowerCase().includes("saucelabs")?"SauceLabs":e.toLowerCase().includes("fireflink device farm")?"fireflink":"")(n)}];"manual"===C.toLowerCase()&&u.push({label:s||"",type:"local"===n?.toLowerCase()?"local":""});const f=[{label:o,type:a||l},{label:i,type:r}],h=c?.reduce((e,t)=>(t&&e.push({label:t?.name,type:"manual"===C.toLowerCase()?"android":t?.platform,version:"manual"===C?.toLowerCase()?t?.version:""}),e),[]);switch(e.toLowerCase()){case"web":case"web service":return[...u,...f];case"web & mobile":case"ms dynamics":case"salesforce":return[...u,...f,...h];case"mobile":return[...u,...h];default:return[]}},H="manual"!==C.toLowerCase(),S=e=>!K(e)||(bp(e)||void 0!==a);return n("div",{className:z({"ff-connecting-branch-grid":y,"ff-connecting-branch-grid-reverse":!y}),style:{gridTemplateColumns:1===o?"24px minmax(min-content, auto) 24px":`24px minmax(min-content, auto) repeat(${o-1}, 40px minmax(min-content, auto)) 24px`},children:[n("div",{className:"ff-connecting-branch-start-wrapper",children:[e("div",{className:z({"ff-connecting-branch-arrow":y,"ff-connecting-branch-arrow-reverse":!y})}),e("div",{className:z({"ff-connecting-branch-container":y,"ff-connecting-branch-container-reverse":!y}),style:{border:`1px ${x(r[0],l)} var(--ff-connecting-branch-color)`,borderTop:"none",borderLeft:`${!y&&"none"}`,borderRight:`${y&&"none"}`}})]}),r?.map((i,o)=>{const{runCount:a=("runCount"in i?i.runCount:0),numberOfRuns:l=0,machineInstanceId:d="",peVariableSetId:w="",globalVariableSetId:b="",testDataSetId:_="",testDataSetName:V="",peVariableSetName:O="",globalVariableSetName:N=""}=i;return n(t,{children:[K(i)?!g&&e("div",{className:"ff-connecting-branch-browser-button",children:e(U,{id:`ff-sequential-branch-add-${d}`,variant:"secondary",label:p,onClick:()=>{g||s(`ff-sequential-branch-add-${d}`)}})}):n("div",{children:[n("div",{className:"ff-connecting-branch-input-point-wrapper",children:[S(r[o+1])&&e("div",{className:z({"ff-connecting-branch-point":y,"ff-connecting-branch-point-reverse":!y})}),e(yp,{runCount:a,options:k(m,i),contentReverse:!y,modalId:`${d}-runCount-${a-1}`,onClick:()=>1==a||"Automation"!==C?h(`${d}-runCount-0`,i):null,scriptType:C,readOnly:g},Wt())]}),n("div",{className:z({"ff-connecting-branch-datalist":y,"ff-connecting-branch-datalist-reverse":!y}),children:[H&&n(t,{children:[e("div",{id:`ff-sequential-branch-dataset-${d}-${a}`,className:"ff-dataset-list-branch",onClick:()=>{g||f(`ff-sequential-branch-dataset-${d}-${a}`,{peVariableSetId:w,globalVariableSetId:b,testDataSetId:_,testDataSetName:V,globalVariableSetName:N,peVariableSetName:O},!0,l,d)},children:n(G,{placement:"bottom",title:e(t,{children:e(wp,{datSetToolTip:{peVariableSetName:A[w]||"",globalVariableSetName:M[b]||"",testDataSetName:E[_]||""}})}),style:{display:"flex",alignItems:"center"},children:[e(P,{name:"datalist_icon",className:"ff-connecting-icon",hoverEffect:!0}),e(F,{className:"ff-connecting-text",color:"var(--ff-connecting-branch-color)",children:"Data Set List"})]})}),!g&&e(t,{children:e(G,{placement:"bottom",title:l>=v?`Maximum ${v} runs are allowed.`:"",children:n("div",{className:"ff-environment-run-container",onClick:l>=v?void 0:()=>u(d),children:[e(P,{name:"plus_icon",className:"ff-connecting-run-icon",color:"var(--ff-connecting-branch-color)",hoverEffect:!0,disabled:l>=v}),e(F,{className:"ff-connecting-run-text",color:"var(--ff-connecting-branch-color)",style:{opacity:l>=v?.5:1},children:"Run"})]})})})]}),!g&&e(G,{title:"Delete",children:e(P,{name:"delete",className:"ff-connecting-delete-icon",onClick:()=>c(d,a),color:"var(--ff-connecting-branch-delete-color)",hoverEffect:!0})})]})]}),L(o)&&e("div",{className:"ff-connecting-branch-middle-arrow",style:{borderTop:`1px ${x(i,r[o+1])} var(--ff-connecting-branch-color)`},children:e("div",{className:z({"ff-connecting-branch-arrow":y,"ff-connecting-branch-arrow-reverse":!y})})})]},Wt())}),(g?!w&&!K(a):!w)&&e("div",{className:z({"ff-connecting-branch-end-arrow":y,"ff-connecting-branch-end-arrow-reverse":!y}),style:{border:`1px ${x(r[o-1],a)} var(--ff-connecting-branch-color)`,borderBottom:"none",borderLeft:`${y&&"none"}`,borderRight:`${!y&&"none"}`}})]})},Ap=({machineBranchInstances:n,machineColumnCount:r,machineColumnWidth:i,onAddBrowser:o,onDeleteBrowser:a,onAddRunBrowser:s,onUpdateDataSetList:d,onUpdateAddBrowserInstance:u,addInstanceLabel:f="",scriptType:h="",projectType:p="Web",readOnly:C=!1,maxRunCount:m})=>{const[g,v]=c(n);l(()=>{v(n)},[n]);const y=((e,t)=>{const n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n})(g,r);return e("div",{className:"ff-connecting-branch-grid-wrapper",children:y.map((n,l)=>e(t,{children:e(Mp,{machineInstances:n,rowIndex:l,machineColumnCount:r,machineColumnWidth:i,onAddBrowser:o,onDeleteBrowser:a,onAddRunBrowser:s,nextRowMachineInstance:y[l+1]?.[0],previousRowMachineInstance:y[l-1]?.[r-1],onUpdateDataSetList:d,onUpdateAddBrowserInstance:u,addInstanceLabel:f,scriptType:h,projectType:p,readOnly:C,maxRunCount:m})},Wt()))})},xp=({machineInstances:r=[],machineColumnWidth:i=180,machineColumnCount:o=1,selectedMachine:s={},machineOptionsList:d=[],onHandleSelect:u=()=>{},onAddBrowserInstance:f=()=>{},onAddRunBrowserInstance:h=()=>{},onDeleteBrowserInstance:p=()=>{},onUpdateDataSetList:C=()=>{},onDeleteMachineInstance:m=()=>{},dataSetValues:g={testDataSetId:"",globalVariableSetId:"",peVariableSetId:"",globalVariableSetName:"",peVariableSetName:"",testDataSetName:""},onUpdateAddBrowserInstance:v=()=>{},addInstanceLabel:y="Add Environment",placeholder:w="Choose Machine",scriptType:b="Automation",projectType:E="Web",readOnly:M=!1,zIndex:A=99999,maxRunCount:x=35,environmentVariableMaps:L,isRequired:k=!1})=>{const[H,S]=c({}),_=a(null),V=Math.max(o,1),O=Math.max(i,180),[N,T]=c([]),I=K(r);let D=K(s.value?.clientId);"Manual"===b&&(D=K(s.value));l(()=>{S(s)},[s]),l(()=>{T(M?r:[...r,{}])},[r]);const Z="manual"!==b.toLowerCase(),j=(R=g,B="Id",Object.fromEntries(Object.entries(R).filter(([e])=>!e.includes(B))));var R,B;const q=M&&!I||!M&&I||!M&&!I;return e(Ep.Provider,{value:L,children:n("div",{className:"ff-sequential-connecting-branch-wrapper",children:[n("div",{className:"ff-connecting-select-branch-wrapper",children:[n("div",{className:"ff-select-branch-wrapper",children:[e(lr,{onChange:u,optionsList:d,label:w,required:k,showLabel:!0,className:"ff-sequential-select-branch",width:"240px",selectedOption:H,valueAccessor:"name",optionsRequired:!M,disableInput:M,optionZIndex:A}),!D&&n("div",{className:z({"ff-select-branch-arrow":I,"ff-select-branch-arrow-down":!I}),children:[q&&e("div",{className:"ff-select-branch-point"}),n("div",{className:"ff-select-branch-arrow",children:[!M&&e("div",{className:"ff-branch-arrow-wrapper",children:I&&e("div",{className:"ff-branch-arrow"})}),I&&!M&&e(t,{children:e(U,{variant:"tertiary",label:"Manual"===b?"+ Machine":"+ Environment",size:"small",className:"branch-button",ref:_,onClick:()=>f("ff-sequential-branch-button"),id:"ff-sequential-branch-button"})})]})]})]}),!D&&n("div",{className:"ff-select-scope-datalist",children:[e("div",{className:"ff-scope-wrapper",children:e(F,{as:"span",color:((e="")=>e.toLowerCase().includes("inactive")?"var(--ff-machine-inactive-status-color)":e.toLowerCase().includes("running")?"var(--ff-machine-running-status-color)":e.toLowerCase().includes("active")?"var(--ff-machine-active-status-color)":"var(--ff-machine-active-status-color))")(s.value?.status),className:"ff-scope-text",children:s.value?.status})}),n("div",{className:"ff-datalist-wrapper",children:[Z&&e("div",{id:"ff-sequential-machine-datalist",onClick:()=>{M||C("ff-sequential-machine-datalist",g)},children:n(G,{placement:"bottom",title:e("div",{children:e(wp,{datSetToolTip:j})}),style:{display:"flex",alignItems:"center"},children:[e(P,{name:"datalist_icon",className:"ff-dataset-icon",hoverEffect:!0}),e(F,{as:"span",color:"var(--ff-connecting-branch-color)",className:"ff-datalist-text",children:"Data Set List"})]})}),!M&&e(G,{title:"Delete",placement:"bottom",children:e(P,{name:"delete",className:"ff-run-delete-icon",color:"var(--ff-connecting-branch-delete-color)",onClick:m,hoverEffect:!0})})]})]})]}),e("div",{className:"ff-sequential-branches-wrapper",children:!I&&e(Ap,{machineBranchInstances:N,machineColumnCount:V,machineColumnWidth:O,onAddBrowser:f,onDeleteBrowser:p,onAddRunBrowser:h,onUpdateDataSetList:C,onUpdateAddBrowserInstance:v,addInstanceLabel:y,scriptType:b,projectType:E,readOnly:M,maxRunCount:x})})]})})},Lp=({label:t,selectedFiles:r,onFilesChange:i,disabled:o=!1,buttonDisplayType:l="attachment",iconName:s="plus_icon",maxFileSizeMB:d,maxFiles:u,buttonLabel:f="Select Files",showSelectedFiles:h=!0,buttonVariant:p="primary",deleteButton:C=!0,multiple:m=!0,addAttachmentButton:g=!0,isInfoIconRequired:v=!0,onFileListClick:y,types:w=[],attachmentInfoTooltip:b="",selectedFileMessage:E="This file is already selected",required:M=!1,errorMessage:A,truncateMaxLimit:x=1/0,onClickAttachmentButton:L=()=>{}})=>{const k=a(null),[H,S]=c(""),_={image:["image/jpeg","image/png","image/svg+xml"],video:["video/mp4","video/mpeg","video/quicktime"],audio:["audio/mpeg","audio/wav","audio/ogg"],document:["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],archive:["application/zip","application/x-rar-compressed","application/x-7z-compressed"],spreadsheet:["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],excel:["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],dat:[".dat","application/octet-stream"],trg:[".trg","application/octet-stream"]},V=w.flatMap(e=>_[e]||[]).join(","),O=()=>{L(),S(""),k.current?.click()};return n("div",{children:[v&&n("div",{className:"ff-label-icon",children:[e(F,{fontWeight:"semi-bold",lineHeight:"18px",as:"span",required:M,children:t}),e(G,{title:b||(()=>{if(0===w.length)return"Any files are allowed.";const t=w.flatMap(e=>_[e]||[]).map(e=>e.split("/")[1]),r=t.pop();return n("span",{children:[t.join(", ")," and ",r," files are allowed.",e("br",{}),"Max size: ",d," MB"]})})(),placement:"bottom-start",children:e(P,{name:"info",hoverEffect:!0})})]}),(!h||0===r.length)&&("attachment"===l?e(U,{variant:p,label:f,size:"medium",onClick:O,disabled:o}):"icon"===l?e(eh,{label:f,iconName:s,onClick:O,isDisable:o}):null),e("input",{type:"file",ref:k,className:"ff-input-field",onChange:()=>{if(S(""),k.current?.files){const e=Array.from(k.current.files);if(e.length>5)return S("Maximum file(s) can be uploaded: 5"),void(k.current.value="");const t=e.filter(e=>!r.some(t=>t.name===e.name));if(0===t.length)return S(E),void(k.current.value="");if("number"==typeof u&&r.length+t.length>u)return S(`You can only select up to ${u} files.`),void(k.current.value="");if("number"==typeof d){const e=1024*d*1024;if(t.filter(t=>t.size>e).length>0)return S(`Maximum file(s) size allowed: ${d} MB.`),void(k.current.value="")}i([...r,...t],t,"ADD"),k.current.value=""}},multiple:m,accept:V,required:M}),H&&e(Xt,{isOpen:!!H,variant:"info",toastTitle:"Info",toastMessage:H,zIndex:1e7}),h&&r.map((t,o)=>n("div",{className:"ff-attachment-files",onClick:y,children:[e(F,{color:"var(--brand-color)",children:e(cn,{title:t.name,width:x})}),C&&e(G,{title:"Delete",children:e(P,{name:"delete",hoverEffect:!0,color:"var(--ff-delete-button-attachment)",variant:"danger",onClick:()=>(e=>{const t=[...r],n=t.splice(e,1);i(t,n,"DELETE")})(o)})}),o===r.length-1&&g&&e(G,{title:""+("number"==typeof u&&r.length>=u?`Maximum files can be uploaded: ${u}`:"Add File"),children:e(P,{name:"add_file",hoverEffect:!0,onClick:O,disabled:"number"==typeof u&&!(r.length<u)})})]},t.name)),M&&e(F,{children:A,fontSize:10,className:"error-text"})]})},kp=({selected:t="text",firstButton:r="File",secondButton:i="File",handleClick:o})=>n("div",{className:"toggle-container",children:[e("button",{className:"toggle-button "+(t===r?"active":""),onClick:()=>o(r),children:r}),e("button",{className:"toggle-button "+(t===i?"active":""),onClick:()=>o(i),children:i})]}),Hp=({variant:t="small",iconName:n,iconColor:r="var(--avatar-icon-color)",customAvatarSize:i,customIconSize:o,backgroundColor:a,label:l,labelFontSize:s})=>{const c=l?.slice(0,2);return e("div",{className:`ff-avatar ff-avatar--${t}`,style:{height:`${i}px`,width:`${i}px`,backgroundColor:a},children:l?e("span",{className:"ff-avatar-label",style:{fontSize:s||"14px",color:r},children:c}):e(P,{name:n,height:o,width:o,color:r})})},Sp=({logo:t,overlay:r=!1})=>e("div",{className:`overlay-loader ${r&&"overlay"}`,children:n("div",{className:"loader-container ",children:[t&&e(t,{}),e("div",{className:"line_loader"})]})}),_p=({contentHeader:t,data:r,maxHeight:i=""})=>{const o=`scrollable-${(e=>{const t=parseInt(e);if(isNaN(t))return"default";const n=100*Math.round(t/100);return Math.min(Math.max(100,n),1e3)})(i)}`;return n("div",{className:"ff-content-card-container",children:[e("div",{className:"ff-content-card-nav",children:e(F,{as:"div",fontWeight:"semi-bold",lineHeight:"35px",children:t})}),e("div",{className:`ff-content-card-body scrollable ${o}`,children:Object.entries(r).map(([t,r],i)=>n("div",{className:"ff-content-card-row",children:[n(F,{fontWeight:"semi-bold",children:[t,":"]}),e(F,{className:"ff-content-card-value",children:r})]},i+t))})]})},Vp=({label:t,placeholder:r,text:i,showText:o=!0,highlightText:s,customError:d,confirmIcon:u,customErrorCondition:f,cancelIcon:h,variant:p="textField",onInputChange:C,dropdownData:m=[],className:g,height:v,isOpen:y=!1,confirmAction:w,onClick:b,tooltip:E,onDoubleClick:M,disableEditing:A=!1})=>{const[x,L]=c(y??!1),[k,H]=c(i??""),[S,_]=c(m[0]?.value??""),[V,O]=c(""),[z,N]=c(!0),[T,I]=c(!1),D=!(!V||!x),Z=a(null),j=a(null),[R,B]=c(null),U=q("Escape");l(()=>()=>{R&&clearTimeout(R)},[R]);const W=()=>{let e="";0===k.length||0===k.trim().length?e="Please type any text.":k.length<3?e="Please enter at least 3 characters.":f&&(e=d??"Invalid input."),e?O(e):(L(!1),O(""),w&&w(k,S)),u?.onClick?.()},Q=()=>{H(i??""),_(m[0]?.value??""),L(!1),O(""),I(!1),h?.onClick?.()},K=e=>{const t=e.target.value;H(t),N(!1),0===t.length||0===t.trim().length?O("Input is required"):t.length<3?O("Input cannot be less than 3 characters"):t.length>250?O("Input cannot be more than 250 characters"):Ve.test(t)?O("Space is not allowed at starting and at the end"):O(f?d??"Invalid input.":""),I(t!==i),C&&C(t)},Y=e=>{if(Z.current&&!Z.current.contains(e.target)&&j.current!==e.target){const e=((e,t)=>e===t?"No changes were made.":e?e.length<3?"Please enter at least 3 characters.":"":"Text is required")(k,i??"");e&&x?O(e):(L(!1),O(""))}};return l(()=>(document.addEventListener("click",Y),()=>{document.removeEventListener("click",Y)}),[k]),U(Q),ce([{key:"Enter",action:()=>{W()}}],Z),n("div",{className:"ff-label-edit-text-field",ref:Z,children:[x?n("div",{className:"ff-label-text-field",children:["textFieldWithDropdown"===p?n("div",{className:"ff-label-text-field-with-dropdown "+(x?"open":""),style:{height:v},children:[e(rn,{name:"input",type:"text",label:t||"",disabled:!1,error:D,placeholder:r||"",value:k,onChange:K,className:`${g} \n \n ${T?"modified":""}`}),e(lr,{label:"",optionsList:m,selectedOption:{value:S,label:S},onChange:e=>_(e.value)})]}):e("div",{className:"ff-label-text-field-without-dropdown",children:e(rn,{name:"input",type:"text",label:t||"",disabled:!1,error:D,placeholder:r||"",value:k,onChange:K,className:`${g} \n \n ${T?"modified":""}`})}),n("div",{className:"ff-icon-container",children:[u&&e(G,{title:"Confirm",placement:"bottom",children:e(P,{color:"var(--label-edit-confirm-icon)",height:20,width:20,name:u.name,disabled:z,className:""+(z?"disabled-confirm-icon":"confirm-icon"),onClick:W})}),h&&e(G,{title:"Cancel",placement:"bottom",children:e(P,{color:"var(--label-edit-cancel-icon)",height:12,width:20,name:h.name,className:"cancel-icon",onClick:Q,ref:j})})]})]}):e(G,{title:E?.tooltipTitle?E?.tooltipTitle:"",placement:"bottom",children:o&&e("span",{className:"display-text",onDoubleClick:()=>{A||(R&&(clearTimeout(R),B(null)),M&&M(),L(!0),O(""))},role:"button",onClick:()=>{if(A)return;R&&(clearTimeout(R),B(null));const e=window.setTimeout(()=>{b&&b(),B(null)},1e3);B(e)},children:e(J,{text:k,highlight:s})})}),V&&x&&e(F,{as:"p",fontSize:8,className:"error-text",children:V})]})},Op=e=>e?e.charAt(0)?.toUpperCase()+e?.slice(1)?.toLowerCase():"",zp=({label:t,text:r,highlightText:i,customError:o,customErrorCondition:l=!1,confirmIcon:s,cancelIcon:d,editIcon:u,dropdownData:f=[],isOpen:h=!1,confirmAction:p,onClick:C,nameTooltipTitle:m})=>{const[g,v]=c(h??!1),[y,w]=c(r),[b,E]=c(!0),[M,A]=c(f[0]?.value??""),[x,L]=c(""),[k,H]=c(!1),S=!(!x||!g),_=a(null),V=a(null),O=()=>{const e=((e,t,n,r)=>e===t?"No changes were made.":e?e.length<3?"Please enter at least 3 characters.":r?n??"":"":"Text is required")(y,r,o,l);e&&g?L(e):(v(!1),L(""),p&&p(y,M))},z=()=>{w(r),A(f[0]?.value??""),v(!1),L(""),H(!1)};function N(e){"Enter"===e&&O(),"Escape"===e&&z()}return ce([{key:"Enter",action:()=>N("Enter")},{key:"Escape",action:()=>N("Escape")}],_),n("div",{className:"ff-label-edit-text-field",ref:_,children:[n("div",g?{className:"ff-label-text-field",children:[e("div",{className:"ff-label-text-field-without-dropdown",children:e(rn,{name:"input",label:t||"",disabled:!1,error:S,placeholder:"Enter your name",value:y,onChange:e=>{w(e.target.value),H(!0),L(""),E(!1)},className:"\n \n "+(k?"modified":""),type:"text"})}),n("div",{className:"ff-icon-container",children:[s&&e(G,{title:"confirm",placement:"bottom",children:e(P,{color:s?.color??"var(--default-confirm-icon-color)",height:s?.height??20,disabled:b,width:s?.width??20,name:s?.name??"default-confirm-icon",className:`${s?.className??"default-confirm-class"} ${b?"disabled-confirm-icon":"confirm-icon"}`,onClick:O})}),d&&e(G,{title:"cancel",placement:"bottom",children:e(P,{color:d?.color??"var(--label-edit-cancel-icon)",height:d?.height??12,width:d?.width??20,name:d?.name??"default-cancel-icon",className:d?.className??"cancel-icon",onClick:z,ref:V})})]})]}:{className:"display-text-container",children:[m?e(G,{title:m,children:e("span",{className:"display-text",onClick:C,children:e(J,{text:y,highlight:i})})}):e("span",{className:"display-text",onClick:C,children:e(J,{text:y,highlight:i})}),e(G,{title:Op(u?.name??"Edit"),children:e(P,{color:u?.color??"var(--label-edit-cancel-icon)",height:u?.height??20,width:u?.width??20,name:u?.name??"edit",className:u?.className??"edit-icon",onClick:()=>{v(!0),L("")}})})]}),x&&g&&e(F,{as:"p",fontSize:8,className:"error-text",children:x})]})},Np="SET_DATA",Tp="SET_CREATE_FORMULA_PARSER",Ip="SELECT_ENTIRE_ROW",Dp="SELECT_ENTIRE_COLUMN",Zp="SELECT_ENTIRE_WORKSHEET",jp="SET_SELECTION",Rp="SELECT",Bp="ACTIVATE",Pp="SET_CELL_DATA",Fp="SET_CELL_DIMENSIONS",Up="COPY",qp="CUT",Wp="PASTE",Qp="EDIT",Kp="VIEW",Gp="BLUR",Yp="KEY_PRESS",Xp="KEY_DOWN",Jp="DRAG_START",$p="DRAG_END",eC="COMMIT",tC="BOLD",nC="ITALIC",rC="UNDERLINE_TYPE",iC="FONT_FAMILY",oC="FONT_SIZE",aC="TEXT_ALIGN",lC="BORDER_TYPE",sC="COLOR",cC="BACKGROUND_COLOR",dC="FORMATE_PAINTER",uC="ADD_ROW_TOP",fC="ADD_ROW_BOTTOM",hC="ADD_COLUMN_LEFT",pC="ADD_COLUMN_RIGHT",CC="DELETE_ROW",mC="DELETE_COLUMN",gC="SET_ROW_HEIGHT",vC="SET_COLUMN_POSITION",yC="SET_AUTO_FILL",wC="UPDATE_COLUMN_DIMENSIONS",bC="SET_EDITABLE",EC="ON_MOUSE_UP";function MC(e){return{type:EC,payload:{point:e}}}function AC(e){return{type:bC,payload:{editable:e}}}function xC(e,t){return{type:gC,payload:{row:e,height:t}}}function LC(e,t){return{type:vC,payload:{column:e,width:t}}}function kC(e){return{type:tC,payload:{data:e}}}function HC(e){return{type:nC,payload:{data:e}}}function SC(e,t,n){return{type:lC,payload:{data:e,value:t,color:n}}}function _C(e){return{type:rC,payload:{data:e}}}function VC(e,t){return{type:oC,payload:{data:e,value:t}}}function OC(e,t){return{type:iC,payload:{data:e,value:t}}}function zC(e,t){return{type:aC,payload:{data:e,value:t}}}function NC(e,t){return{type:sC,payload:{data:e,value:t}}}function TC(e,t){return{type:cC,payload:{data:e,value:t}}}function IC(e){return{type:dC,payload:{data:e}}}function DC(e){return{type:uC,row:e}}function ZC(e){return{type:fC,row:e}}function jC(e,t){return{type:hC,columnWidth:e,column:t}}function RC(e,t){return{type:pC,columnWidth:e,column:t}}function BC(e){return{type:CC,row:e}}function PC(e){return{type:mC,column:e}}function FC(e){return{type:Yp,payload:{event:e}}}function UC(e){return{type:Np,payload:{data:e}}}function qC(e){return{type:Tp,payload:{createFormulaParser:e}}}function WC(e){return{type:jp,payload:{selection:e}}}function QC(e){return{type:Bp,payload:{point:e}}}function KC(e,t){return{type:Pp,payload:{active:e,data:t}}}function GC(e,t){return{type:Fp,payload:{point:e,dimensions:t}}}function YC(e){return{type:Wp,payload:{data:e}}}function XC(e){return{type:Xp,payload:{event:e}}}function JC(){return{type:Jp}}function $C(){return{type:$p}}function em(){return{type:Up}}function tm(){return{type:qp}}function nm(){return{type:Gp}}function rm(e,t){const n=t[e.row];if(void 0!==n)return n[e.column]}function im(e,t,n){const r=[...n],i=[...n[0]??[]];i.length<=e.column&&(i.length=e.column+1),r[0]=i;const o=[...n[e.row]??[]];return o[e.column]=t,r[e.row]=o,r}function om(e,t,n){let r=n[0];r||(r=[],n[0]=r);let i=n[e.row];i||(i=[],n[e.row]=i),r.length<=e.column&&(r.length=e.column+1),i[e.column]=t}const am={value:"",inputType:{type:"text"},readOnly:!1,style:{color:"#000000",backgroundColor:"#ffffff",borderColor:"#c9c9c9",textDecoration:"normal",borderRight:"1px solid var(--excel-header-border)",borderLeft:"1px solid var(--excel-header-border)",borderTop:"1px solid var(--excel-header-border)",borderBottom:"1px solid var(--excel-header-border)",fontSize:""+(lm=9,1.33*lm+"px"),fontWeight:"normal",fontStyle:"normal",fontFamily:"Poppins",textAlign:"left"}};var lm;function sm(e,t){if(!dm(e,t))return t;const n=[...t],r=t[e.row];if(r){const t=[...r];t[e.column]=am,n[e.row]=t}return n}function*cm(e){for(const[t,n]of e.entries())for(const[e,r]of n.entries()){const n={row:t,column:e};yield[n,r]}}function dm(e,t){const n=t[0];return!!n&&(e.row>=0&&e.column>=0&&Number.isInteger(e.row)&&Number.isInteger(e.column)&&e.column<n.length&&e.row<t.length)}function um(e){return{columns:hm(e),rows:fm(e)}}function fm(e){return e.length}function hm(e){const t=e[0];return t?t.length:0}function pm(e){const t=um(e);return{row:t.rows-1,column:t.columns-1}}class Cm{start;end;constructor(e,t){this.start={row:Math.min(e.row,t.row),column:Math.min(e.column,t.column)},this.end={row:Math.max(e.row,t.row),column:Math.max(e.column,t.column)}}*[Symbol.iterator](){for(let e=this.start.row;e<=this.end.row;e++)for(let t=this.start.column;t<=this.end.column;t++)yield{row:e,column:t}}size(){return(this.end.row+1-this.start.row)*(this.end.column+1-this.start.column)}has(e){return e.row>=this.start.row&&e.column>=this.start.column&&e.row<=this.end.row&&e.column<=this.end.column}mask(e){return new Cm({row:e.start.row>this.start.row?e.start.row:this.start.row,column:e.start.column>this.start.column?e.start.column:this.start.column},{row:e.end.row<this.end.row?e.end.row:this.end.row,column:e.end.column<this.end.column?e.end.column:this.end.column})}equals(e){return this.start.row===e.start.row&&this.start.column===e.start.column&&this.end.row===e.end.row&&this.end.column===e.end.column}}const mm={row:0,column:0};class gm{}class vm extends gm{toRange(e){return null}normalizeTo(e){return this}hasEntireRow(){return!1}hasEntireColumn(){return!1}size(){return 0}has(){return!1}equals(e){return e instanceof vm}}class ym extends gm{range;constructor(e){super(),this.range=e}toRange(e){return this.range}normalizeTo(e){const t=xm(e);return new ym(this.range.mask(t))}hasEntireRow(){return!1}hasEntireColumn(){return!1}size(e){const t=this.toRange(e);return t?t.size():0}has(e,t){const n=this.toRange(e);return null!==n&&n.has(t)}equals(e){return e instanceof ym&&this.range.equals(e.range)}}class wm extends gm{}class bm extends wm{toRange(e){return xm(e)}normalizeTo(){return this}hasEntireColumn(){return!0}hasEntireRow(){return!0}size(e){return hm(e)*fm(e)}has(){return!0}equals(e){return e instanceof bm}}class Em extends wm{start;end;constructor(e,t){if(!Lm(e))throw new km("start");if(!Lm(t))throw new km("end");super(),this.start=Math.min(e,t),this.end=Math.max(e,t)}equals(e){return e instanceof Em&&this.constructor===e.constructor&&this.start===e.start&&this.end===e.end}}class Mm extends Em{toRange(e){const t=pm(e);return new Cm({row:this.start,column:0},{row:this.end,column:t.column})}normalizeTo(e){const t=fm(e);return new Mm(Math.max(this.start,0),Math.min(this.end,t-1))}hasEntireRow(e){return e>=this.start&&e<=this.end}hasEntireColumn(){return!1}size(e){return(this.end-this.start+1)*hm(e)}has(e,t){return t.row>=this.start&&t.row<=this.end}}class Am extends Em{toRange(e){const t=pm(e);return new Cm({row:0,column:this.start},{row:t.row,column:this.end})}normalizeTo(e){const t=hm(e);return new Am(Math.max(this.start,0),Math.min(this.end,t-1))}hasEntireRow(){return!1}hasEntireColumn(e){return e>=this.start&&e<=this.end}size(e){return(this.end-this.start+1)*fm(e)}has(e,t){return t.column>=this.start&&t.column<=this.end}}function xm(e){const t=pm(e);return new Cm(mm,t)}function Lm(e){return Number.isInteger(e)&&e>=0}class km extends Error{constructor(e){super(`${e} is not a valid index. It must be 0 or a positive integer`)}}const Hm="text/plain";function Sm(e,t=0,n=1){const r=[];if(-1===Math.sign(e-t)){for(let i=t;i>e;i-=n)r.push(i);return r}for(let i=t;i<e;i+=n)r.push(i);return r}function _m(e,t){return Boolean(e&&(r=e,(n=t).column===r.column&&n.row===r.row));var n,r}function Vm(e){return{width:e.offsetWidth,height:e.offsetHeight,left:e.offsetLeft,top:e.offsetTop}}function Om(e){return Object.keys(e).map(e=>Number(e)).sort((e,t)=>e-t)}function zm(e,t,n){const r={},i=Om(e);let o=0,a=!1;for(let l=0;l<i.length;l++){if(l===t){const e=r[l-1],t=e?e.left+e.width:0;r[l]={left:t,width:n},o=n,a=!0}const s=i[l];if(void 0===s)continue;const c=e[s];if(!c)continue;const d=a?l+1:l,u=a?c.left+o:c.left;r[d]={...c,left:u}}if(!a){const e=i.length>0?i[i.length-1]:void 0,o=void 0!==e?r[e]:void 0,a=o?o.left+o.width:0;r[t]={left:a,width:n}}return r}function Nm(e,t,n){const r={},i=Om(e);let o=0,a=!1;for(let l=0;l<i.length;l++){if(l===t){const e=r[l-1],t=e?e.top+e.height:0;r[l]={top:t,height:n},o=n,a=!0}const s=i[l];if(void 0===s)continue;const c=e[s];if(!c)continue;const d=a?l+1:l,u=a?c.top+o:c.top;r[d]={...c,top:u}}if(!a){const e=i.length>0?i[i.length-1]:void 0,o=void 0!==e?r[e]:void 0,a=o?o.top+o.height:0;r[t]={top:a,height:n}}return r}function Tm(e,t){const n={},r=Om(e);let i=0;for(let o=0,a=0;o<r.length;o++){if(r[o]===t)continue;const l=r[o];if(void 0===l)continue;const s=e[l];s&&(n[a]={top:0===i?s.top:i,height:s.height},"number"==typeof n[a]?.top&&(i=(n[a]?.top??0)+s.height),a++)}return n}function Im(e,t){const n={},r=Om(e);let i=0;for(let o=0,a=0;o<r.length;o++){if(r[o]===t)continue;const l=r[o];if(void 0===l)continue;const s=e[l];s&&(n[a]={left:0===i?s.left:i,width:s.width},"number"==typeof n[a]?.left&&(i=(n[a]?.left??0)+s.width),a++)}return n}function Dm(e,t,n){const r=100;let i=32;for(let n=0;n<e.row;n++)i+=(t?.[n]?t?.[n]?.height:32)||32;const o=(t?.[e.row]?t?.[e.row]?.height:32)||32;let a=60;for(let t=0;t<e.column;t++)a+=(n?.[t]?n?.[t]?.width:r)||r;return{top:i,height:o,left:a,width:(n?.[e.column]?n?.[e.column]?.width:r)||r}}function Zm(e,t,n){const r=Dm(n.start,e,t);let i=Dm(n.end,e,t);return void 0===i&&(i=function(e,t,n){const r=100;let i=4032;for(let n=0;n<e.row;n++)i+=(t?.[n]?t?.[n]?.height:32)||32;const o=(t?.[e.row]?t?.[e.row]?.height:32)||32;let a=60;for(let t=0;t<e.column;t++)a+=(n?.[t]?n?.[t]?.width:r)||r;return{top:i,height:o,left:a,width:(n?.[e.column]?n?.[e.column]?.width:r)||r}}(n.end,e,t)),r&&i&&{width:i.left+i.width-r.left,height:i.top+i.height-r.top,top:r.top+1,left:r.left+1}}function jm(e,t,n,r){const i=r.toRange(n);return i?Zm(e,t,i):void 0}function Rm(e){return function(e,t){const n=[];for(const[r,i]of cm(t))om(r,e(i,r),n);return n}(e=>e?.value||"",e).map(e=>e.map(e=>{const t=String(e).replace(/"/g,'""');return Rt.test(t)?`"${t}"`:t}).join("\t")).join("\n")}function Bm(e,t){return null!==e&&"view"===t&&Pm(e)}function Pm(e){return e.matches(":focus-within")}function Fm(e){return"string"==typeof e&&e.includes("\n")}const Um=e=>`${1.33*e}px`,qm=e=>parseFloat(e.replace("px",""))/1.33,Wm={value:"",inputType:{type:"text"},readOnly:!1,style:{color:"#000000",backgroundColor:"#ffffff",borderColor:"#c9c9c9",textDecoration:"normal",borderRight:"1px solid var(--excel-header-border)",borderLeft:"1px solid var(--excel-header-border)",borderTop:"1px solid var(--excel-header-border)",borderBottom:"1px solid var(--excel-header-border)",fontSize:`${Um(9)}`,fontWeight:"normal",fontStyle:"normal",fontFamily:"Poppins",textAlign:"left"}},Qm=[{label:"Times New Roman",value:"Times New Roman"},{label:"Arial",value:"Arial"},{label:"fantasy",value:"fantasy"},{label:"cursive",value:"cursive"},{label:"Poppins",value:"Poppins"},{label:"Courier New",value:"Courier New"},{label:"Verdana",value:"Verdana"},{label:"Tahoma",value:"Tahoma"},{label:"Trebuchet MS",value:"Trebuchet MS"},{label:"Comic Sans MS",value:"Comic Sans MS"},{label:"Impact",value:"Impact"},{label:"Arial Black",value:"Arial Black"},{label:"Lucida Console",value:"Lucida Console"},{label:"Lucida Sans Unicode",value:"Lucida Sans Unicode"},{label:"Courier",value:"Courier"},{label:"Arial Rounded MT Bold",value:"Arial Rounded MT Bold"},{label:"Georgia",value:"Georgia"},{label:"sans-serif",value:"sans-serif"},{label:"serif",value:"serif"},{label:"monospace",value:"monospace"}],Km=[5,6,8,9,10,12,14,16,18,20,22,24,26,28,32,36,40,48,56,72],Gm=e=>["dropDown","text"].includes(e?.inputType?.type??"text")&&!e?.readOnly;function Ym(e){return{rowCount:e?.length??0,columnCount:e?.[0]?.length??0}}function Xm(e){return"string"==typeof e&&e.startsWith("=")&&e.length>1}function Jm(e){return e}function $m(e){return`${e.row},${e.column}`}function eg(e){const[t,n]=e.split(",");return{row:Number(t),column:Number(n)}}class tg{set;constructor(e){this.set=e}static from(e){const t=new Set;for(const n of e)t.add($m(n));return new tg(t)}has(e){return this.set.has($m(e))}get size(){return this.set.size}add(e){const t=new Set(this.set);return t.add($m(e)),new tg(t)}delete(e){const t=new Set(this.set);return t.delete($m(e))?new tg(t):this}difference(e){let t=this;for(const n of e)t=t.delete(n);return t}union(e){let t=this;for(const n of e)t=t.add(n);return t}*[Symbol.iterator](){for(const e of this.set)yield eg(e)}}class ng{forwards;constructor(e=new Map){this.forwards=e}static from(e){const t=new Map;for(const[n,r]of e)t.set($m(n),r);return new ng(t)}set(e,t){const n=new ng(new Map(this.forwards));return 0===t.size?(n.forwards.delete($m(e)),n):(n.forwards.set($m(e),t),n)}get(e){return this.forwards.get($m(e))||tg.from([])}getBackwards(e){let t=tg.from([]);for(const[n,r]of this.forwards)r.has(e)&&(t=t.add(eg(n)));return t}getBackwardsRecursive(e,t=tg.from([])){let n=this.getBackwards(e),r=t;for(const e of n)r.has(e)||(r=r.add(e),n=n.union(this.getBackwardsRecursive(e,r)));return n}hasCircularDependency(e){let t=tg.from([]);const n=[e];for(;n.length>0;){const e=n.pop();if(!e)continue;if(t.has(e))return!0;t=t.add(e);const r=this.get(e);if(r)for(const e of r)n.push(e)}return!1}*[Symbol.iterator](){const e=new Set;for(const[t,n]of this.forwards){const r=eg(t);e.add(t),yield[r,n];for(const t of n){const n=$m(t);e.has(n)||this.forwards.has(n)||(e.add(n),yield[t,tg.from([])])}}}*traverseBFSBackwards(){let e=tg.from([]);const t=[];for(const[n,r]of this)0===r.size&&(e=e.add(n),t.push(n));for(;t.length>0;){const n=t.shift();if(!n)continue;yield n;const r=this.getBackwards(n);if(0!==r.size)for(const n of r)e.has(n)||0!==this.get(n).difference(e).size||(t.push(n),e=e.add(n))}}}class rg{data;evaluatedData;referenceGraph;createFormulaParser;constructor(e,t,n,r){this.createFormulaParser=e,this.data=t,this.referenceGraph=n||function(){const e=[];return ng.from(e)}(),this.evaluatedData=r||function(e,t){let n=e;for(const r of t.traverseBFSBackwards()){const t=rm(r,e);if(t&&Xm(t.value)){const e=og();n=im(r,{...t,value:e},n)}}return n}(t,this.referenceGraph)}}function ig(e,t,n){const r=im(t,n,e.data),i=(Xm(n.value),e.referenceGraph),o=function(e,t,n,r,i){if(n.hasCircularDependency(r)){let o=tg.from([r]),a=im(r,{...i,value:"TODO"},e);for(const e of n.getBackwardsRecursive(r)){if(o.has(e))break;o=o.add(e);const n=rm(e,t);n&&(a=im(e,{...n,value:"TODO"},a))}return a}let o=e;const a=Xm(i.value)?"TODO":i.value,l={...i,value:a};o=im(r,l,o);for(const e of n.getBackwardsRecursive(r)){const n=rm(e,t);if(!n)continue;const r=Xm(n.value)?og():n.value;o=im(e,{...n,value:r},o)}return o}(e.evaluatedData,r,i,t,n);return new rg(e.createFormulaParser,r,i,o)}function og(){return"TODO"}function ag(e){if(6!==e.length)return!1;for(let t=1;t<e.length;t++)if(!"0123456789ABCDEFabcdef".includes(e[t]))return!1;return!0}function lg(e){return Ag(e)||!e.editable?e:{...e,mode:"edit"}}const sg=e=>(e=>e&&!e.readOnly)(e)&&"file"!==e?.inputType?.type?{...e,value:"",style:e?.style}:e,cg=e=>{if(e)return{...e,value:(e.value||"")+"\n",style:e.style}};function dg(e){if(!e.active)return e;const t=e.selected.toRange(e.model.data),n=[];let r=e.model.data;for(const i of t||[]){const t=rm(i,e.model.data),o=sg(t);n.push({prevCell:t||null,nextCell:o||null}),r=im(i,o,r)}return{...e,model:new rg(Jm,r),...pg(n)}}function ug(e){if(!e.active)return e;const t=e.selected.toRange(e.model.data),n=[];let r=e.model.data;for(const i of t||[]){const t=rm(i,e.model.data),o=cg(t);n.push({prevCell:t||null,nextCell:o||null}),r=im(i,o,r)}return{...e,mode:"edit",model:new rg(Jm,r),...pg(n)}}function fg(e){return{...e,active:null,copied:null,formattedStyle:{open:!1,style:void 0},selected:new vm}}function hg(e){return{...e,mode:"view"}}function pg(e){return{lastCommit:e}}const Cg=(e,t)=>n=>{if(!n.active)return;const r=um(n.model.data),i=n.active.column+t>=r.columns,o={row:n.active.row+e+(i?1:0),column:(n.active.column+t)%r.columns};return dm(o,n.model.data)?{...n,active:o,selected:new ym(new Cm(o,o)),mode:"view"}:{...n,mode:"view"}},mg={ArrowUp:Cg(-1,0),ArrowDown:Cg(1,0),ArrowLeft:Cg(0,-1),ArrowRight:Cg(0,1),Tab:Cg(0,1),Enter:lg,Backspace:function(e){if(!e.active)return e;if("view"===e.mode){return dg(e)}{const t=[];let n=e.model.data;const r=rm(e.active,e.model.data),i=sg(r);return t.push({prevCell:r||null,nextCell:i||null}),n=im(e.active,i,n),{...e,mode:"edit",model:new rg(Jm,n),...pg(t)}}},Delete:dg,Escape:fg},gg={Escape:hg,Tab:mg.Tab,Enter:mg.ArrowDown,Delete:dg},vg={Tab:Cg(0,-1)};var yg;!function(e){e.Left="Left",e.Right="Right",e.Top="Top",e.Bottom="Bottom"}(yg||(yg={}));const wg={ArrowUp:e=>({...e,selected:xg(e.selected,e.active,e.model.data,yg.Top)}),ArrowDown:e=>({...e,selected:xg(e.selected,e.active,e.model.data,yg.Bottom)}),ArrowLeft:e=>({...e,selected:xg(e.selected,e.active,e.model.data,yg.Left)}),ArrowRight:e=>({...e,selected:xg(e.selected,e.active,e.model.data,yg.Right)}),Tab:Cg(0,-1)},bg={},Eg={};function Mg(e,t){const{key:n}=t;let r;if("edit"===e.mode)if(t.shiftKey&&"Enter"===n)r=mg;else{if(t.altKey&&"Enter"===n)return ug;r=t.shiftKey?vg:gg}else r=t.shiftKey&&t.metaKey?bg:t.shiftKey?wg:t.metaKey?Eg:mg;return r[n]}function Ag(e){const t=function(e){const t=e.active&&rm(e.active,e.model.data);return t||null}(e);return Boolean(t?.readOnly)}function xg(e,t,n,r){if(!t)return e;if(e instanceof ym){const i=function(e,t,n,r){const i=r===yg.Left||r===yg.Right?"column":"row",o=r===yg.Left||r===yg.Top?"start":"end",a="start"===o?-1:1,l=e.range.has({...t,[i]:t[i]+-1*a}),s=l?"start"===o?"end":"start":o,c=new Cm(e.range.start,e.range.end);c[s][i]+=a;const d=new ym(c).normalizeTo(n);return d}(e,t,n,r);return i}return e instanceof Am?function(e,t,n,r){if(r===yg.Top||r===yg.Bottom)return e;const i=r===yg.Left?-1:1,o=r===yg.Left?"start":"end",a="start"===o?"end":"start",l={...e};(r===yg.Left?e.end>t.row:e.start<t.row)?l[a]=e[a]+i:l[o]=e[o]+i;return new Am(Math.max(l.start,0),Math.max(l.end,0)).normalizeTo(n)}(e,t,n,r):e instanceof Mm?function(e,t,n,r){if(r===yg.Left||r===yg.Right)return e;const i=r===yg.Top?-1:1,o=r===yg.Top?"start":"end",a="start"===o?"end":"start",l={...e};(r===yg.Top?e.end>t.row:e.start<t.row)?l[a]=e[a]+i:l[o]=e[o]+i;return new Mm(Math.max(l.start,0),Math.max(l.end,0)).normalizeTo(n)}(e,t,n,r):e}const Lg=(e,t={},n)=>{const{selectedRow:r,selectedColumn:i,model:o,columnDimensions:a}=e,{column:l,columnWidth:s=100}=t,c=l??i;if(K(c))return e;const d="LEFT"===n?c:c+1,u=o.data.map(e=>{const t=[...e],n=e[c];return t.splice(d,0,(e=>{if("object"!=typeof e||null===e)return e;const{contextDisable:t,...n}=e;return{...n,value:"",readOnly:!1,style:{...e.style,borderBottom:"",borderLeft:"",borderRight:"",borderTop:""}}})(n)),t}),f=new rg(o.createFormulaParser,u),h=r??0;return{...e,model:f,selectedRow:h,selectedColumn:d,active:{row:h,column:d},selected:new Am(d,d),columnDimensions:zm(a,d,s)}},kg=(e,t={},n)=>{const{selectedRow:r,selectedColumn:i,model:o,rowDimensions:a}=e,{row:l}=t,s=l??r;if(K(s))return e;const c="TOP"===n?s:s+1,d=[...o.data],u=((e,t)=>e?e?.map(e=>"object"==typeof e&&null!==e?{...e,value:"",readOnly:!1,contextDisable:void 0,style:{...e.style,borderBottom:"",borderLeft:"",borderRight:"",borderTop:""}}:e):Array(t||0).fill(Wm))(o.data[s]||[],d[0]?.length);d.splice(c,0,u??[]);const f=new rg(o.createFormulaParser,d),h=i??0;return{...e,model:f,selectedRow:c,selectedColumn:h,active:{row:c,column:h},selected:new Mm(c,c),rowDimensions:Nm(a,c,32)}},Hg={active:null,mode:"view",rowDimensions:{},columnDimensions:{},lastChanged:null,hasPasted:!1,cut:!1,autoFill:{open:!1,cellValue:{value:"",style:{}}},dragging:!1,model:new rg(Jm,[]),selected:new vm,copied:null,lastCommit:null,selectedColumn:null,selectedRow:null,formattedStyle:{open:!1,style:void 0},editable:!1,ctrl:!0};function Sg(e,t){switch(t.type){case wC:{const{minimumColumnWidth:n}=t.payload,r={...e.columnDimensions};return Object.keys(r).forEach(e=>{const t=parseInt(e);(r[t]?.width||0)!==n&&(r[t]={left:r[t]?.left||0,width:n})}),{...e,columnDimensions:r}}case bC:{const{editable:n}=t.payload;return{...e,editable:n}}case yC:{const{autofill:n}=t.payload,r=e.active;let i=Wm;return r&&(i=rm({row:r.row,column:r.column},e.model.data)||i),{...e,autoFill:{open:n,cellValue:i}}}case uC:return kg(e,t,"TOP");case fC:return kg(e,t,"BOTTOM");case hC:return Lg(e,t,"LEFT");case pC:return Lg(e,t,"RIGHT");case CC:{let{selectedRow:n,selectedColumn:r,model:i,rowDimensions:o,copied:a}=e;const{row:l}=t;if(K(n))return e;const s=l??n;let c=[...i.data];c.splice(s,1);const d=new rg(i.createFormulaParser,c);let u=s>0?s-1:0;const f=null!==r?r:0,h=c.length>0?{row:u,column:f}:null,p=c.length>0?new Mm(u,u):new vm;let C=a;return a&&a.start.row<=s&&a.end.row>=s&&(C=null),{...e,model:d,selectedRow:u,selectedColumn:f,selected:p,active:h,copied:C,rowDimensions:Tm(o,s)}}case mC:{const{selectedRow:n,selectedColumn:r,model:i,columnDimensions:o,copied:a}=e,{column:l}=t;if(K(l??r))return e;const s=l??r,c=i.data.map(e=>e.filter((e,t)=>t!==s)),d=new rg(i.createFormulaParser,c),u=null!==n?n:0,f=s>0?s-1:0,h=c.length>0?{row:u,column:f}:null,p=c.length>0?new Am(f,f):new vm;let C=a;return a&&a.start.column<=s&&a.end.column>=s&&(C=null),{...e,model:d,selectedRow:u,selectedColumn:f,selected:p,active:h,copied:C,columnDimensions:Im(o,s)}}case tC:{const t=e.selected.toRange(e.model.data),n=function(e,t,n){if(!t)return e;const{start:r,end:i}=t;let o=e,a=!1;for(let e=r.row;e<=i.row;e++){for(let t=r.column;t<=i.column;t++){const r=rm({row:e,column:t},o);if(r&&n&&!r.readOnly&&"bold"===r.style?.fontWeight){a=!0;break}}if(a)break}for(let e=r.row;e<=i.row;e++)for(let t=r.column;t<=i.column;t++){const r=rm({row:e,column:t},o);r&&n&&(r.readOnly||(o=im({row:e,column:t},{...r,style:{...r.style,fontWeight:a?"normal":"bold"}},o)))}return o}(e.model.data,t,e.editable);return{...e,model:new rg(e.model.createFormulaParser,n)}}case nC:{const t=e.selected.toRange(e.model.data),n=function(e,t,n){if(!t)return e;const{start:r,end:i}=t;let o=e,a=!1;for(let e=r.row;e<=i.row;e++){for(let t=r.column;t<=i.column;t++){const r=rm({row:e,column:t},o);if(r&&n&&!r.readOnly&&"italic"===r.style?.fontStyle){a=!0;break}}if(a)break}for(let e=r.row;e<=i.row;e++)for(let t=r.column;t<=i.column;t++){const r=rm({row:e,column:t},o);r&&n&&(r.readOnly||(o=im({row:e,column:t},{...r,style:{...r.style,fontStyle:a?"normal":"italic"}},o)))}return o}(e.model.data,t,e.editable);return{...e,model:new rg(e.model.createFormulaParser,n)}}case lC:{const{value:n,color:r}=t.payload,i=e.selected.toRange(e.model.data),o=function(e,t,n,r,i){if(!t)return e;let o=e;const{start:a,end:l}=t,s=(e,t)=>rm({row:e,column:t},o),c=(e,t,n)=>{o=im({row:e,column:t},n,o)};for(let e=a.row;e<=l.row;e++)for(let t=a.column;t<=l.column;t++){const o=s(e,t);if(!o||!i||o.readOnly)continue;const a={...o,style:{...o.style}},l=s(e-1,t),d=s(e+1,t),u=s(e,t-1),f=s(e,t+1),h=`2px solid ${r}`,p="1px solid var(--excel-header-border)",C=e=>{switch(e){case"borderTop":l&&l.style?.borderBottom===h?a.style.borderTop="none":a.style.borderTop=h;break;case"borderBottom":d&&d.style?.borderTop===h?a.style.borderBottom="none":a.style.borderBottom=h;break;case"borderLeft":u&&u.style?.borderRight===h?a.style.borderLeft="none":a.style.borderLeft=h;break;case"borderRight":f&&f.style?.borderLeft===h?a.style.borderRight="none":a.style.borderRight=h}};switch(n){case"border-all-sides":C("borderTop"),C("borderBottom"),C("borderLeft"),C("borderRight");break;case"border-none":if(a.style={...a.style,borderRight:p,borderLeft:p,borderTop:p,borderBottom:p},l){const n={...l,style:{...l.style}};"none"===n.style.borderBottom&&(n.style.borderBottom=h,c(e-1,t,n))}if(d){const n={...d,style:{...d.style}};"none"===n.style.borderTop&&(n.style.borderTop=h,c(e+1,t,n))}if(u){const n={...u,style:{...u.style}};"none"===n.style.borderRight&&(n.style.borderRight=h,c(e,t-1,n))}if(f){const n={...f,style:{...f.style}};"none"===n.style.borderLeft&&(n.style.borderLeft=h,c(e,t+1,n))}break;case"border-right":C("borderRight");break;case"border-left":C("borderLeft");break;case"border-top":C("borderTop");break;case"border-bottom":C("borderBottom")}c(e,t,a)}return o}(e.model.data,i,n,r,e.editable);return{...e,model:new rg(e.model.createFormulaParser,o)}}case rC:{const t=e.selected.toRange(e.model.data),n=function(e,t,n){if(!t)return e;const{start:r,end:i}=t;let o=e,a=!1;for(let e=r.row;e<=i.row;e++){for(let t=r.column;t<=i.column;t++){const r=rm({row:e,column:t},o);if(r&&n&&!r.readOnly&&"underline"===r.style?.textDecoration){a=!0;break}}if(a)break}for(let e=r.row;e<=i.row;e++)for(let t=r.column;t<=i.column;t++){const r=rm({row:e,column:t},o);r&&n&&(r.readOnly||(o=im({row:e,column:t},{...r,style:{...r.style,textDecoration:a?"none":"underline"}},o)))}return o}(e.model.data,t,e.editable);return{...e,model:new rg(e.model.createFormulaParser,n)}}case oC:{const{value:n}=t.payload,r=e.selected.toRange(e.model.data),i=function(e,t,n,r){if(!t)return e;const i=Number(n);if(isNaN(i))return e;const o=Um(i),{start:a,end:l}=t;let s=e;for(let e=a.row;e<=l.row;e++)for(let t=a.column;t<=l.column;t++){const n=rm({row:e,column:t},s);n&&r&&(n.readOnly||(s=im({row:e,column:t},{...n,style:{...n.style,fontSize:o}},s)))}return s}(e.model.data,r,n,e.editable),o=new rg(e.model.createFormulaParser,i);let a={...e.rowDimensions};if(("edit"!==e.mode||!e.active)&&r)for(let e=r?.start?.row??0;e<=r?.end?.row;e++){const t=i[e];if(!t)continue;let n=32;t.forEach((e,t)=>{if(e&&e.value){const t=e.style?.fontSize?parseInt(e.style.fontSize.toString().replace("px","")):9,r=Math.max(1.2*t,18);let i=0;["file","dropDown"].includes(e?.inputType?.type??"")||(i=String(e.value).split(" ").length),i+=String(e.value).split("\n").length-1;const o=r*i;n=Math.max(n,o)}}),a[e]={...a[e]||{top:0,height:32},height:n}}return{...e,model:o,rowDimensions:a}}case iC:{const{value:n}=t.payload,r=e.selected.toRange(e.model.data),i=function(e,t,n,r){if(!t)return e;const{start:i,end:o}=t;let a=e;for(let e=i.row;e<=o.row;e++)for(let t=i.column;t<=o.column;t++){const i=rm({row:e,column:t},a);i&&r&&(i.readOnly||(a=im({row:e,column:t},{...i,style:{...i.style,fontFamily:n}},a)))}return a}(e.model.data,r,n,e.editable);return{...e,model:new rg(e.model.createFormulaParser,i)}}case aC:{const{value:n}=t.payload,r=e.selected.toRange(e.model.data),i=function(e,t,n,r){if(!t)return e;const{start:i,end:o}=t;let a=e;for(let e=i.row;e<=o.row;e++)for(let t=i.column;t<=o.column;t++){const i=rm({row:e,column:t},a);i&&r&&(i.readOnly||(a=im({row:e,column:t},{...i,style:{...i.style,textAlign:n}},a)))}return a}(e.model.data,r,n,e.editable);return{...e,model:new rg(e.model.createFormulaParser,i)}}case sC:{const{value:n}=t.payload,r=e.selected.toRange(e.model.data),i=function(e,t,n,r){if(!t)return e;const{start:i,end:o}=t;let a=e;const l=ag(n)?`#${n}`:n;for(let e=i.row;e<=o.row;e++)for(let t=i.column;t<=o.column;t++){const n=rm({row:e,column:t},a);n&&r&&(n.readOnly||(a=im({row:e,column:t},{...n,style:{...n.style,color:l}},a)))}return a}(e.model.data,r,n,e.editable);return{...e,model:new rg(e.model.createFormulaParser,i)}}case cC:{const{value:n}=t.payload,r=e.selected.toRange(e.model.data),i=function(e,t,n,r){if(!t)return e;if(t){const{start:i,end:o}=t;let a=e;const l=ag(n)?`#${n}`:n;for(let e=i.row;e<=o.row;e++)for(let t=i.column;t<=o.column;t++){const n=rm({row:e,column:t},a);n&&r&&(n.readOnly||(a=im({row:e,column:t},{...n,style:{...n.style,backgroundColor:l}},a)))}return a}return e}(e.model.data,r,n,e.editable);return{...e,model:new rg(e.model.createFormulaParser,i)}}case dC:{if(!e.editable)return e;const t=function(e,t){if(!t)return;const{row:n,column:r}=t,i=rm({row:n,column:r},{...e});return i&&i.style?i.style:void 0}(e.model.data,e.active),n=e.selected.toRange(e.model.data);return e.formattedStyle.open?{...e,selected:new vm,active:e.copied?.start||null,copied:null,formattedStyle:{open:!1,style:void 0}}:{...e,selected:new vm,active:null,copied:n,formattedStyle:{open:!0,style:t}}}case Np:{const{data:n}=t.payload,r=e.active&&dm(e.active,n)?e.active:null,i=e.selected.normalizeTo(n);return{...e,model:new rg(e.model.createFormulaParser,n),active:r,selected:i}}case Tp:{const{createFormulaParser:n}=t.payload;return{...e,model:new rg(n,e.model.data)}}case Ip:{const{row:n,extend:r}=t.payload,{active:i}=e,o=new Mm(r&&i?i.row:n,n),a=r&&i?i:{...mm,row:n};return{...e,selected:o,active:a,mode:"view",selectedColumn:null,selectedRow:n}}case Dp:{const{column:n,extend:r}=t.payload,{active:i}=e,o=new Am(r&&i?i.column:n,n),a=r&&i?i:{...mm,column:n};return{...e,selected:o,active:a,mode:"view",selectedColumn:n,selectedRow:null}}case Zp:return{...e,selected:new bm,active:mm,mode:"view"};case jp:{const{selection:n}=t.payload,r=n.toRange(e.model.data),i=e.active&&n.has(e.model.data,e.active)?e.active:r?.start;return{...e,selected:n,active:i||null,mode:"view"}}case Rp:{const{point:n}=t.payload;return e.active&&!_m(e.active,n)?{...e,selected:new ym(new Cm(n,e.active)),mode:"view"}:e}case Bp:{const{point:n}=t.payload;return{...e,selected:new ym(new Cm(n,n)),active:n,mode:_m(e.active,n)&&e.editable?"edit":"view"}}case Pp:{const{active:n,data:r}=t.payload;return Ag(e)||!e.editable?e:{...e,model:ig(e.model,n,r),lastChanged:n}}case Fp:{const{point:n,dimensions:r}=t.payload,i=e.rowDimensions[n.row],o=e.columnDimensions[n.column];return i&&o&&i.top===r.top&&i.height===r.height&&o.left===r.left&&o.width===r.width?e:{...e,rowDimensions:{...e.rowDimensions,[n.row]:{top:r.top,height:r.height}},columnDimensions:{...e.columnDimensions,[n.column]:{left:r.left,width:r.width}}}}case Up:case qp:{const n=e.selected.toRange(e.model.data);return{...e,copied:n,cut:t.type===qp,hasPasted:!1}}case Wp:{const{data:n}=t.payload,{active:r}=e;if(!r||!e.editable)return e;const i=function(e,t,n="\t",r=/\r\n|\n|\r/){return e.replace(/"([^"]*?)"/g,(e,t)=>t.replace(/\n/g,"\\n")).split(r).map(e=>e.split(n).map(e=>e.replace(/\\n/g,"\n")).map(t))}(n,e=>({value:e})),o=um(i),a=e.selected.toRange(e.model.data);if(a&&1===o.rows&&1===o.columns){const t=rm({row:0,column:0},i);let n=e.cut&&e.copied?sm(e.copied.start,e.model.data):e.model.data;const r=[];for(const i of a||[]){const o=rm(i,e.model.data)||null,a={...o,value:t?.value};r.push({prevCell:o||Wm,nextCell:Wm}),Gm(o)&&(n=im(i,a,n))}return{...e,model:new rg(Jm,n),copied:null,cut:!1,hasPasted:!0,mode:"view",lastCommit:r}}const l={rows:r.row+o.rows,columns:r.column+o.columns},s=function(e,t){const{rows:n,columns:r}=um(e);if(n>=t.rows&&r>=t.columns)return e;const i={rows:t.rows>n?t.rows:n,columns:t.columns>r?t.columns:r};let o=[...e];if(i.columns>r){const e=i.columns-r;o=o.map(t=>[...t,...Array(e).fill(am)])}if(i.rows>n){const e=i.rows-n,t=Array(i.columns).fill(am);o=[...o,...Array(e).fill(t)]}return o}(e.model.data,l);let c={data:s,commit:[]};for(const[t,n]of cm(i)){let i=c.commit||[];const o={row:t.row+r.row,column:t.column+r.column};let a=c.data;if(e.cut){if(e.copied){a=sm({row:t.row+e.copied.start.row,column:t.column+e.copied.start.column},c.data)}i=[...i,{prevCell:n||null,nextCell:null}]}dm(o,s)||(c={data:a,commit:i});const l=rm(o,a)||null;i=[...i,{prevCell:l,nextCell:n||null}],Gm(l)&&(c.data=im(o,{...l,value:n?.value??""},a),c.commit=i)}return{...e,model:new rg(Jm,c.data),selected:new ym(new Cm(r,{row:r.row+o.rows-1,column:r.column+o.columns-1})),copied:null,cut:!1,hasPasted:!0,mode:"view",lastCommit:c.commit}}case Qp:return lg(e);case Kp:return hg(e);case"CLEAR":return dg(e);case Gp:return fg(e);case Yp:{const{event:n}=t.payload;if(Ag(e)||n.metaKey||!e.editable)return e;if("view"===e.mode&&e.active){const t=e.selected.toRange(e.model.data);return 1===t?.size()?lg(dg(e)):lg(e)}return e}case Xp:{const{event:n}=t.payload;if(n.ctrlKey)return{...e,ctrl:!e.ctrl};if(Ag(e)||n.metaKey||!e.editable)return e;const r=Mg(e,n);return r?{...e,...r(e,n)}:e}case gC:{const{row:n,height:r}=t.payload,i=e.rowDimensions[n]||{top:0};return{...e,rowDimensions:{...e.rowDimensions,[n]:{top:i.top,height:r}}}}case vC:{const{column:n,width:r}=t.payload,i=e.columnDimensions[n]||{left:0};return{...e,columnDimensions:{...e.columnDimensions,[n]:{left:i.left,width:r}}}}case Jp:return{...e,dragging:!0};case EC:{const{point:n}=t.payload;let r=e.model.data;return!e.dragging&&e.formattedStyle.open&&(r=function(e,t,n){if(!n||!t.open)return e;let r=e;const i=rm(n,r);i&&!i.readOnly&&(r=im(n,{...i,style:t.style},r));return r}(e.model.data,e.formattedStyle,e.active)),{...e,copied:null,model:new rg(e.model.createFormulaParser,r),formattedStyle:{open:!1,style:void 0},active:n}}case $p:{const t=e.selected.toRange(e.model.data),n=e.active;let r=e.model.data;if(e.formattedStyle.open&&(r=function(e,t,n){if(!t||!n.open)return e;const{start:r,end:i}=t;let o=e;for(let e=r.row;e<=i.row;e++)for(let t=r.column;t<=i.column;t++){const r=rm({row:e,column:t},o);r&&(r.readOnly||(o=im({row:e,column:t},{...r,style:n.style},o)))}return o}(e.model.data,t,e.formattedStyle)),e.autoFill.open&&e.editable&&t){r=function(e,t,n,r,i){if(!t)return e;const{start:o,end:a}=t,l=o.row-a.row,s=o.column-a.column;let c={row:0,column:0},d={row:0,column:0};Math.abs(l)>Math.abs(s)?(c={row:Math.min(o.row,a.row),column:r?.column??o.column},d={row:Math.max(o.row,a.row),column:r?.column??o.column}):(c={row:r?.row??o.row,column:Math.min(o.column,a.column)},d={row:r?.row??o.row,column:Math.max(o.column,a.column)});let u=e;const f=String(n.value??""),h=[...f.matchAll(/(-?\d+)/g)],p=["dropDown"].includes(n?.inputType?.type||"");for(let e=c.row;e<=d.row;e++)for(let t=c.column;t<=d.column;t++){const o=rm({row:e,column:t},u);if(!o||o.readOnly)continue;const a=["file","dropDown"].includes(o?.inputType?.type||""),d=["file"].includes(o?.inputType?.type||"");if(!p&&a)continue;if(p&&d)continue;let C=f;if(!i&&h.length>0){let n=0;n=Math.abs(l)>Math.abs(s)?e-(r?.row??c.row):t-(r?.column??c.column);let i=0;C=C.replace(/(-?\d+)/g,()=>{const e=h[i++];return e?(parseInt(e?.[1]??"",10)+n).toString():""})}u=im({row:e,column:t},{...o,style:n.style,value:C,inputType:n.inputType},u)}return u}(e.model.data,t,e.autoFill.cellValue,n,e.ctrl);let{start:i,end:o}=t;const a=i.row-o.row,l=i.column-o.column;let s={row:0,column:0},c={row:0,column:0};return Math.abs(a)>Math.abs(l)?(s={row:Math.min(i.row,o.row),column:n?.column??0},c={row:Math.max(i.row,o.row),column:n?.column??0}):(s={row:n?.row??0,column:Math.min(i.column,o.column)},c={row:n?.row??0,column:Math.max(i.column,o.column)}),{...e,dragging:!1,autoFill:{open:!1,cellValue:{value:"",style:{}}},formattedStyle:{open:!1,style:void 0},model:new rg(e.model.createFormulaParser,r),selected:new ym(new Cm(s,c))}}return{...e,dragging:!1,autoFill:{open:!1,cellValue:{value:"",style:{}}},formattedStyle:{open:!1,style:void 0},model:new rg(e.model.createFormulaParser,r)}}case eC:{const{changes:n}=t.payload;return{...e,...pg(n)}}default:throw new Error("Unknown action")}}var _g,Vg={exports:{}},Og={};var zg,Ng,Tg={};
19
+ */function Ph(){if(Hh)return kh;Hh=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return kh=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(r,i){for(var o,a,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),s=1;s<arguments.length;s++){for(var c in o=Object(arguments[s]))t.call(o,c)&&(l[c]=o[c]);if(e){a=e(o);for(var d=0;d<a.length;d++)n.call(o,a[d])&&(l[a[d]]=o[a[d]])}}return l},kh}function Fh(){if(_h)return Sh;_h=1;return Sh="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Uh(){return Oh?Vh:(Oh=1,Vh=Function.call.bind(Object.prototype.hasOwnProperty))}function qh(){if(Nh)return zh;Nh=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=Fh(),n={},r=Uh();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function i(i,o,a,l,s){if("production"!==process.env.NODE_ENV)for(var c in i)if(r(i,c)){var d;try{if("function"!=typeof i[c]){var u=Error((l||"React class")+": "+a+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}d=i[c](o,c,l,a,null,t)}catch(e){d=e}if(!d||d instanceof Error||e((l||"React class")+": type specification of "+a+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var f=s?s():"";e("Failed "+a+" type: "+d.message+(null!=f?f:""))}}}return i.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},zh=i}function Wh(){if(Ih)return Th;Ih=1;var e=Bh(),t=Ph(),n=Fh(),r=Uh(),i=qh(),o=function(){};function a(){return null}return"production"!==process.env.NODE_ENV&&(o=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),Th=function(l,s){var c="function"==typeof Symbol&&Symbol.iterator;var d="<<anonymous>>",u={array:C("array"),bigint:C("bigint"),bool:C("boolean"),func:C("function"),number:C("number"),object:C("object"),string:C("string"),symbol:C("symbol"),any:p(a),arrayOf:function(e){return p(function(t,r,i,o,a){if("function"!=typeof e)return new h("Property `"+a+"` of component `"+i+"` has invalid PropType notation inside arrayOf.");var l=t[r];if(!Array.isArray(l))return new h("Invalid "+o+" `"+a+"` of type `"+v(l)+"` supplied to `"+i+"`, expected an array.");for(var s=0;s<l.length;s++){var c=e(l,s,i,o,a+"["+s+"]",n);if(c instanceof Error)return c}return null})},element:p(function(e,t,n,r,i){var o=e[t];return l(o)?null:new h("Invalid "+r+" `"+i+"` of type `"+v(o)+"` supplied to `"+n+"`, expected a single ReactElement.")}),elementType:p(function(t,n,r,i,o){var a=t[n];return e.isValidElementType(a)?null:new h("Invalid "+i+" `"+o+"` of type `"+v(a)+"` supplied to `"+r+"`, expected a single ReactElement type.")}),instanceOf:function(e){return p(function(t,n,r,i,o){if(!(t[n]instanceof e)){var a=e.name||d;return new h("Invalid "+i+" `"+o+"` of type `"+(((l=t[n]).constructor&&l.constructor.name?l.constructor.name:d)+"` supplied to `")+r+"`, expected instance of `"+a+"`.")}var l;return null})},node:p(function(e,t,n,r,i){return g(e[t])?null:new h("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return p(function(t,i,o,a,l){if("function"!=typeof e)return new h("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var s=t[i],c=v(s);if("object"!==c)return new h("Invalid "+a+" `"+l+"` of type `"+c+"` supplied to `"+o+"`, expected an object.");for(var d in s)if(r(s,d)){var u=e(s,d,o,a,l+"."+d,n);if(u instanceof Error)return u}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&o(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),a;return p(function(t,n,r,i,o){for(var a=t[n],l=0;l<e.length;l++)if(f(a,e[l]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===y(t)?String(t):t});return new h("Invalid "+i+" `"+o+"` of value `"+String(a)+"` supplied to `"+r+"`, expected one of "+s+".")})},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&o("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var t=0;t<e.length;t++){var i=e[t];if("function"!=typeof i)return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+w(i)+" at index "+t+"."),a}return p(function(t,i,o,a,l){for(var s=[],c=0;c<e.length;c++){var d=(0,e[c])(t,i,o,a,l,n);if(null==d)return null;d.data&&r(d.data,"expectedType")&&s.push(d.data.expectedType)}return new h("Invalid "+a+" `"+l+"` supplied to `"+o+"`"+(s.length>0?", expected one of type ["+s.join(", ")+"]":"")+".")})},shape:function(e){return p(function(t,r,i,o,a){var l=t[r],s=v(l);if("object"!==s)return new h("Invalid "+o+" `"+a+"` of type `"+s+"` supplied to `"+i+"`, expected `object`.");for(var c in e){var d=e[c];if("function"!=typeof d)return m(i,o,a,c,y(d));var u=d(l,c,i,o,a+"."+c,n);if(u)return u}return null})},exact:function(e){return p(function(i,o,a,l,s){var c=i[o],d=v(c);if("object"!==d)return new h("Invalid "+l+" `"+s+"` of type `"+d+"` supplied to `"+a+"`, expected `object`.");var u=t({},i[o],e);for(var f in u){var p=e[f];if(r(e,f)&&"function"!=typeof p)return m(a,l,s,f,y(p));if(!p)return new h("Invalid "+l+" `"+s+"` key `"+f+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(i[o],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var C=p(c,f,a,l,s+"."+f,n);if(C)return C}return null})}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function h(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function p(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function i(i,a,l,c,u,f,p){if(c=c||d,f=f||l,p!==n){if(s){var C=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw C.name="Invariant Violation",C}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var m=c+":"+l;!t[m]&&r<3&&(o("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+c+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[m]=!0,r++)}}return null==a[l]?i?null===a[l]?new h("The "+u+" `"+f+"` is marked as required in `"+c+"`, but its value is `null`."):new h("The "+u+" `"+f+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(a,l,c,u,f)}var a=i.bind(null,!1);return a.isRequired=i.bind(null,!0),a}function C(e){return p(function(t,n,r,i,o,a){var l=t[n];return v(l)!==e?new h("Invalid "+i+" `"+o+"` of type `"+y(l)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null})}function m(e,t,n,r,i){return new h((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+i+"`.")}function g(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(g);if(null===e||l(e))return!0;var t=function(e){var t=e&&(c&&e[c]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!g(n.value))return!1}else for(;!(n=r.next()).done;){var i=n.value;if(i&&!g(i[1]))return!1}return!0;default:return!1}}function v(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function y(e){if(null==e)return""+e;var t=v(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function w(e){var t=y(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return h.prototype=Error.prototype,u.checkPropTypes=i,u.resetWarningCache=i.resetWarningCache,u.PropTypes=u,u},Th}function Qh(){if(Zh)return Dh;Zh=1;var e=Fh();function t(){}function n(){}return n.resetWarningCache=t,Dh=function(){function r(t,n,r,i,o,a){if(a!==e){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function i(){return r}r.isRequired=r;var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o}}function Kh(){if(jh)return Eh.exports;if(jh=1,"production"!==process.env.NODE_ENV){var e=Bh();Eh.exports=Wh()(e.isElement,true)}else Eh.exports=Qh()();return Eh.exports}var Gh=H(Kh()),Yh=["sitekey","onChange","theme","type","tabindex","onExpired","onErrored","size","stoken","grecaptcha","badge","hl","isolated"];function Xh(){return Xh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xh.apply(this,arguments)}function Jh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $h(e,t){return $h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$h(e,t)}var ep,tp,np=function(e){var t,n;function i(){var t;return(t=e.call(this)||this).handleExpired=t.handleExpired.bind(Jh(t)),t.handleErrored=t.handleErrored.bind(Jh(t)),t.handleChange=t.handleChange.bind(Jh(t)),t.handleRecaptchaRef=t.handleRecaptchaRef.bind(Jh(t)),t}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,$h(t,n);var o=i.prototype;return o.getCaptchaFunction=function(e){return this.props.grecaptcha?this.props.grecaptcha.enterprise?this.props.grecaptcha.enterprise[e]:this.props.grecaptcha[e]:null},o.getValue=function(){var e=this.getCaptchaFunction("getResponse");return e&&void 0!==this._widgetId?e(this._widgetId):null},o.getWidgetId=function(){return this.props.grecaptcha&&void 0!==this._widgetId?this._widgetId:null},o.execute=function(){var e=this.getCaptchaFunction("execute");if(e&&void 0!==this._widgetId)return e(this._widgetId);this._executeRequested=!0},o.executeAsync=function(){var e=this;return new Promise(function(t,n){e.executionResolve=t,e.executionReject=n,e.execute()})},o.reset=function(){var e=this.getCaptchaFunction("reset");e&&void 0!==this._widgetId&&e(this._widgetId)},o.forceReset=function(){var e=this.getCaptchaFunction("reset");e&&e()},o.handleExpired=function(){this.props.onExpired?this.props.onExpired():this.handleChange(null)},o.handleErrored=function(){this.props.onErrored&&this.props.onErrored(),this.executionReject&&(this.executionReject(),delete this.executionResolve,delete this.executionReject)},o.handleChange=function(e){this.props.onChange&&this.props.onChange(e),this.executionResolve&&(this.executionResolve(e),delete this.executionReject,delete this.executionResolve)},o.explicitRender=function(){var e=this.getCaptchaFunction("render");if(e&&void 0===this._widgetId){var t=document.createElement("div");this._widgetId=e(t,{sitekey:this.props.sitekey,callback:this.handleChange,theme:this.props.theme,type:this.props.type,tabindex:this.props.tabindex,"expired-callback":this.handleExpired,"error-callback":this.handleErrored,size:this.props.size,stoken:this.props.stoken,hl:this.props.hl,badge:this.props.badge,isolated:this.props.isolated}),this.captcha.appendChild(t)}this._executeRequested&&this.props.grecaptcha&&void 0!==this._widgetId&&(this._executeRequested=!1,this.execute())},o.componentDidMount=function(){this.explicitRender()},o.componentDidUpdate=function(){this.explicitRender()},o.handleRecaptchaRef=function(e){this.captcha=e},o.render=function(){var e=this.props;e.sitekey,e.onChange,e.theme,e.type,e.tabindex,e.onExpired,e.onErrored,e.size,e.stoken,e.grecaptcha,e.badge,e.hl,e.isolated;var t=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,Yh);return r.createElement("div",Xh({},t,{ref:this.handleRecaptchaRef}))},i}(r.Component);np.displayName="ReCAPTCHA",np.propTypes={sitekey:Gh.string.isRequired,onChange:Gh.func,grecaptcha:Gh.object,theme:Gh.oneOf(["dark","light"]),type:Gh.oneOf(["image","audio"]),tabindex:Gh.number,onExpired:Gh.func,onErrored:Gh.func,size:Gh.oneOf(["compact","normal","invisible"]),stoken:Gh.string,hl:Gh.string,badge:Gh.oneOf(["bottomright","bottomleft","inline"]),isolated:Gh.bool},np.defaultProps={onChange:function(){},theme:"light",type:"image",tabindex:0,size:"normal",badge:"bottomright"};var rp=function(){if(tp)return ep;tp=1;var e=Bh(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},i={};function o(n){return e.isMemo(n)?r:i[n.$$typeof]||t}i[e.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i[e.Memo]=r;var a=Object.defineProperty,l=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,c=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,u=Object.prototype;return ep=function e(t,r,i){if("string"!=typeof r){if(u){var f=d(r);f&&f!==u&&e(t,f,i)}var h=l(r);s&&(h=h.concat(s(r)));for(var p=o(t),C=o(r),m=0;m<h.length;++m){var g=h[m];if(!(n[g]||i&&i[g]||C&&C[g]||p&&p[g])){var v=c(r,g);try{a(t,g,v)}catch(e){}}}}return t},ep}(),ip=H(rp);function op(){return op=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},op.apply(this,arguments)}var ap={},lp=0;var sp="onloadcallback";function cp(){return"undefined"!=typeof window&&window.recaptchaOptions||{}}var dp=function(e,t){return t=t||{},function(n){var r=n.displayName||n.name||"Component",i=function(r){var i,o;function a(e,t){var n;return(n=r.call(this,e,t)||this).state={},n.__scriptURL="",n}o=r,(i=a).prototype=Object.create(o.prototype),i.prototype.constructor=i,i.__proto__=o;var l=a.prototype;return l.asyncScriptLoaderGetScriptLoaderID=function(){return this.__scriptLoaderID||(this.__scriptLoaderID="async-script-loader-"+lp++),this.__scriptLoaderID},l.setupScriptURL=function(){return this.__scriptURL="function"==typeof e?e():e,this.__scriptURL},l.asyncScriptLoaderHandleLoad=function(e){var t=this;this.setState(e,function(){return t.props.asyncScriptOnLoad&&t.props.asyncScriptOnLoad(t.state)})},l.asyncScriptLoaderTriggerOnScriptLoaded=function(){var e=ap[this.__scriptURL];if(!e||!e.loaded)throw new Error("Script is not loaded.");for(var n in e.observers)e.observers[n](e);delete window[t.callbackName]},l.componentDidMount=function(){var e=this,n=this.setupScriptURL(),r=this.asyncScriptLoaderGetScriptLoaderID(),i=t,o=i.globalName,a=i.callbackName,l=i.scriptId;if(o&&void 0!==window[o]&&(ap[n]={loaded:!0,observers:{}}),ap[n]){var s=ap[n];return s&&(s.loaded||s.errored)?void this.asyncScriptLoaderHandleLoad(s):void(s.observers[r]=function(t){return e.asyncScriptLoaderHandleLoad(t)})}var c={};c[r]=function(t){return e.asyncScriptLoaderHandleLoad(t)},ap[n]={loaded:!1,observers:c};var d=document.createElement("script");for(var u in d.src=n,d.async=!0,t.attributes)d.setAttribute(u,t.attributes[u]);l&&(d.id=l);var f=function(e){if(ap[n]){var t=ap[n].observers;for(var r in t)e(t[r])&&delete t[r]}};a&&"undefined"!=typeof window&&(window[a]=function(){return e.asyncScriptLoaderTriggerOnScriptLoaded()}),d.onload=function(){var e=ap[n];e&&(e.loaded=!0,f(function(t){return!a&&(t(e),!0)}))},d.onerror=function(){var e=ap[n];e&&(e.errored=!0,f(function(t){return t(e),!0}))},document.body.appendChild(d)},l.componentWillUnmount=function(){var e=this.__scriptURL;if(!0===t.removeOnUnmount)for(var n=document.getElementsByTagName("script"),r=0;r<n.length;r+=1)n[r].src.indexOf(e)>-1&&n[r].parentNode&&n[r].parentNode.removeChild(n[r]);var i=ap[e];i&&(delete i.observers[this.asyncScriptLoaderGetScriptLoaderID()],!0===t.removeOnUnmount&&delete ap[e])},l.render=function(){var e=t.globalName,r=this.props;r.asyncScriptOnLoad;var i=r.forwardedRef,o=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(r,["asyncScriptOnLoad","forwardedRef"]);return e&&"undefined"!=typeof window&&(o[e]=void 0!==window[e]?window[e]:void 0),o.ref=i,C(n,o)},a}(E),a=o(function(e,t){return C(i,op({},e,{forwardedRef:t}))});return a.displayName="AsyncScriptLoader("+r+")",a.propTypes={asyncScriptOnLoad:Gh.func},ip(a,n)}}(function(){var e=cp(),t=e.useRecaptchaNet?"recaptcha.net":"www.google.com";return e.enterprise?"https://"+t+"/recaptcha/enterprise.js?onload="+sp+"&render=explicit":"https://"+t+"/recaptcha/api.js?onload="+sp+"&render=explicit"},{callbackName:sp,globalName:"grecaptcha",attributes:cp().nonce?{nonce:cp().nonce}:{}})(np);const up=dp,fp=o(({onVerify:t,className:r="",error:i,sitekey:o,...a},l)=>{const[s,d]=c(null),u=i||s;return n("div",{className:z("ff-recaptcha-wrapper",r),children:[e(up,{ref:l,sitekey:o,onChange:e=>{e?(d(null),t(e)):d("Please complete the CAPTCHA")},...a}),u&&e("div",{className:"ff-recaptcha-error",children:e(F,{fontSize:12,children:u})})]})}),hp={margin:6,optionHeight:32,selectInputHeight:38,dropDownWrapperPadding:0},pp=({onSelectBlur:r,onSelectOptionSelector:i,dropdownPosition:o,options:s=[],optionZIndex:u=100,inputRef:f,webServiceClick:h=()=>{},containerWidth:p,loadMoreOptions:C,chipRef:m,isWebservice:g=!0,dropDownMessage:v=""})=>{const[y,w]=c(null),[b,E]=c(""),M=d(W),A=M?.currentTheme,x=a(null),[L,k]=c(-1);Y(x,r,[f,m]);const{positionX:H,positionY:S,width:_,fromBottom:V}=o,{margin:O,optionHeight:N,selectInputHeight:T,dropDownWrapperPadding:I}=hp,D=e=>{let t="",n="";return"NLP"===e?(t="NLP",n="ff-nlp"):"STEP_GROUP"===e?(t="SG",n="ff-sg"):"PROGRAM_ELEMENTS"===e?(t="PE",n="ff-pe"):"WORKBENCH_REQUEST"===e?(t="WS",n="ff-ws"):(t="--",n="nlp-default"),{label:t,className:n}},Z=({platform:n,nlpType:r})=>"NLP"===r?e(P,"Web"===n?{name:"web_icon",height:10,width:10}:"Android"===n?{name:"android_icon",height:10,width:10}:"iOS"===n?{name:"ios_icon",height:10,width:10,color:"var(--dotted-border-color)"}:"Generic"===n?{name:"mobile_icon",height:10,width:10}:{name:"common_nlp",height:10,width:10}):"WORKBENCH_REQUEST"===r&&"Webservice"===n?e(P,{name:"web_service_icon",height:8,width:8}):e(t,{});se(["ff-nlp-dropdown-pagination"],{root:document.getElementById("ff-nlp-dropdown-options-wrapper"),rootMargin:"0px",threshold:.1,onIntersect:(e,t)=>{e.isIntersecting&&C&&C()}}),l(()=>{if(L>=0&&L<s.length){const e=s[L];w(e),E("show")}else L>=s.length&&(w(null),E(""),k(-1));const e=e=>{if(s.length)switch(e.key){case"ArrowDown":e.preventDefault(),k(e=>e<s.length-1?e+1:0);break;case"ArrowUp":e.preventDefault(),k(e=>e>0?e-1:s.length-1);break;case"Enter":L>=0&&s[L]&&i(s[L])}};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[s,L]),l(()=>{if(L<0)return;const e=document.getElementById(`ff-nlp-option-${L}`);e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})},[L]),l(()=>{if(!s?.length)return;const e=x.current;if(!e)return;const t=t=>{e.contains(t.target)||(t.stopPropagation(),t.preventDefault())};return document.body.addEventListener("wheel",t,{passive:!1}),document.body.addEventListener("touchmove",t,{passive:!1}),()=>{document.body.removeEventListener("wheel",t),document.body.removeEventListener("touchmove",t)}},[s]);const j=e=>e?.searchName||e?.displayName||e?.desc||e?.name||e?.nlpName||"---";return e("div",{className:"ff-nlp-dropdown-wrapper",children:n("div",{ref:x,style:{...(()=>{let e;return e=K(s)||s.length>0?5*N+2*I:s.length*N+2*I,V>e+O+80?{left:H,top:S,width:_,zIndex:u}:{zIndex:u,left:H,width:_,top:S-T-92-e-O}})(),width:p},className:z("ff-nlp-options-wrapper",A),onMouseLeave:()=>E("hide"),children:[n("div",{className:"ff-nlp-options-wrapper-main",children:[e("div",{className:"ff-nlp-options-primary-wrapper",id:"ff-nlp-dropdown-options-wrapper",children:K(s)?e(F,{textAlign:"center",lineHeight:"32px",as:"p",color:"var(--ff-nlp-text-color)",className:"ff-nlp-no-option",children:K(v)?"No Results Found":v}):n(t,{children:[s.map((t,r)=>e("div",{onMouseEnter:()=>{w(t),E("show")},id:`ff-nlp-option-${r}`,children:e("div",{onMouseEnter:()=>k(r),onClick:()=>i(t),onKeyDown:e=>{"Enter"===e.key&&i(t)},children:n(F,{as:"div",lineHeight:"30px",fontSize:12,className:z("ff-nlp-option",A,{"ff-nlp-option--selected":L===r}),children:[e(G,{title:t.platform,children:e("span",{children:e(F,{className:`nlp-categories ${D(t.nlpType).className}`,fontWeight:"regular",fontSize:8,lineHeight:"32px",children:D(t.nlpType).label})})}),e("span",{children:Z(t)}),j(t)]})})},`ff-nlp-option-${r}`)),e("div",{id:"ff-nlp-dropdown-pagination"})]})}),g&&e("div",{children:e("div",{className:"show"===b?"ff-nlp-web-service-div":"ff-nlp-primary-web-service-div",children:e(eh,{iconName:"plus_user_icon",label:"Web Service",onClick:()=>{r(),h()}})})})]}),e("div",{className:"show"===b?"ff-nlp-data-show":"ff-nlp-data-hide",children:n("div",{className:"ff-nlp-data-side-menu",children:[y?.videoSrc&&n(F,{className:"nlp-details-header",fontWeight:"semi-bold",fontSize:10,children:["Video",e("div",{className:"nlp-details ",children:e("video",{src:y.videoSrc,controls:!0,className:"nlp-video-player",width:"100%",children:"Your browser does not support the video tag."})})]}),n(F,{className:"nlp-details-header",fontWeight:"semi-bold",fontSize:12,children:["NLP Details",e(F,{className:"nlp-details",fontWeight:"regular",fontSize:12,children:j(y)})]}),n(F,{className:"nlp-details-header",fontWeight:"semi-bold",fontSize:12,children:["Description",e(F,{className:"nlp-details",fontWeight:"regular",fontSize:12,children:y?.description||"--"})]}),"STEP_GROUP"===y?.nlpType&&e(t,{children:n(F,{className:"nlp-details-header",fontWeight:"semi-bold",fontSize:12,children:["Path",e(F,{className:"nlp-details",fontWeight:"regular",fontSize:12,children:y?.path?y?.path:"---"})]})}),e(F,{className:"nlp-details-header",fontWeight:"semi-bold",fontSize:12,children:"Inputs"}),y?.stepInputs?.length?y.stepInputs.map((t,r)=>{const i=t.type?t?.type?.split(".")?.pop():"--";return e("div",{children:n(F,{className:"nlp-details-header",fontWeight:"semi-bold",fontSize:12,children:["Input",r+1,n(F,{className:"nlp-details",fontWeight:"regular",fontSize:12,children:["type: ",i]}),n(F,{className:"nlp-details",fontWeight:"regular",fontSize:12,children:["name: ",t.name||"--"]})]})},r)}):e("div",{className:"nlp-details",children:"--"}),n(F,{className:"nlp-details-header",fontWeight:"semi-bold",fontSize:12,children:["Output",e(F,{className:"nlp-details ",fontWeight:"regular",fontSize:12,children:y?.returnType||"--"})]})]})})]})})},Cp=o(({chipOptionList:t,selectedChips:r,optionZIndex:i=0,inputRef:o,ChipsAccordionWidth:s},d)=>{const[f,h]=c([]),[p,C]=c(!1),[m,g]=c({left:0,top:0}),[v,y]=c("down"),w=a(null);b(d,()=>w.current);const E=ar(w,p);l(()=>{K(t)||h(t)},[t]);const M=a(null),x=()=>{M.current};l(()=>{x()},[f]),u(()=>{const e=()=>{if(!o?.current)return;const{positionX:e,positionY:t,width:n,fromBottom:r}=E(o);y(r<160?"up":"down"),g({left:e+n,top:t})};e();const t=new ResizeObserver(()=>e());return o?.current&&t.observe(o.current),window.addEventListener("scroll",e,!0),()=>{o?.current&&t.unobserve(o.current),t.disconnect(),window.removeEventListener("scroll",e,!0)}},[E,o]);return l(()=>{const e=()=>{x()};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),A(n("div",{className:"ff-chips-accordion",style:{left:m.left,top:m.top,zIndex:i+100,transform:"up"===v?"translateY(calc(-100% + 33px))":"none",width:s,position:"absolute"},ref:w,children:[e("div",{ref:M,className:"ff-chips-row "+(p?"expanded":""),style:{maxHeight:p?"280px":"20px"},children:e("div",{className:"chips-container "+(p?"chips-container-scroll":""),children:f?.map(({name:t,isSelected:n},i)=>e("div",{className:"chip "+(n?"selected-chip":""),onClick:()=>(e=>{const t=f.map((t,n)=>n===e?{...t,isSelected:!t.isSelected}:t);if(h(t),r){const e=t.filter(e=>e.isSelected);r(e)}})(i),children:e(F,{as:"div",className:"chip-text",children:t,fontSize:10,lineHeight:"15px"})},i))})}),e("div",{className:"ff-arrow-icon-container",children:e("div",{className:"ff-icon-wrapper "+(p?"expanded":""),role:"button","aria-expanded":p,children:e(P,{name:"down"===v?"arrows_down_icon":"arrows_top_icon",height:8,width:8,onClick:()=>{C(e=>!e),p&&document.querySelector(".ff-chips-row")?.scrollTo({top:0})}})})})]}),document.body)}),mp=(e,t)=>{switch(t.type){case"FOCUS_INPUT":return{...e,isInputFocused:!0,isIconClick:!0,showOptions:!0};case"BLUR_INPUT":return{...e,isInputFocused:!1,option:t.payload.option,isIconClick:!1,showOptions:!1,dropdownPosition:{positionX:0,positionY:0,width:0,fromBottom:0}};case"UPDATE_DROPDOWN_POSITION":const{positionX:n,positionY:r,width:i,fromBottom:o}=t.payload||{};return{...e,dropdownPosition:{positionX:n,positionY:r,width:i,fromBottom:o}};case"UPDATE_OPTION":return{...e,option:t.payload};case"SHOW_ERROR":return{...e,isInputFocused:!0,isIconClick:!1,showOptions:!1,option:t.payload.option,dropdownPosition:{positionX:0,positionY:0,width:0,fromBottom:0}};default:return e}},gp=({label:t="",leftIcon:r,rightIcon:i,rightIconColor:o,showLabel:s=!0,onHelpIconClick:d=()=>{},aiIconClick:f=()=>{},webServiceClick:h=()=>{},containerWidth:p="",optionsList:C=[],selectedOption:m={displayName:"",projectId:"",nlpType:"",platform:""},onChange:g=()=>{},errorMsg:y="",className:w="",optionZIndex:b=100,disabled:E=!1,borderRadius:M=!0,showBorder:x=!0,required:L=!1,value:k="",onSelect:H=()=>{},chipOptionList:S,selectedChips:_,loadMoreOptions:V=()=>{},isWebservice:O=!0,closeInputOnOutsideClick:N=()=>{},tooltipText:T="Help",ChipsAccordionWidth:I="27.8%",dropDownMessage:D=""})=>{const Z={isInputFocused:!1,isIconClick:!1,showOptions:!1,option:K(m)&&"string"==typeof m?.displayName?m.displayName:"",dropdownPosition:{positionX:0,positionY:0,width:0,fromBottom:0}},[j,R]=v(mp,Z),[B,U]=c(m),[q,W]=c({}),Q=a(!1);l(()=>{const e="string"==typeof m.displayName?m.displayName:String(m.displayName??"");e!==B.displayName&&U({...m,displayName:e})},[m]),l(()=>{k&&ie("FOCUS_INPUT")},[k]);const G=a(null),Y=a(null),X=a(null),{isInputFocused:J,isIconClick:$,showOptions:ee,dropdownPosition:te,option:ne}=j,re=ar(G,ee),ie=e=>{E||R("SHOW_ERROR"===e||"BLUR_INPUT"===e?{type:e,payload:{option:"string"==typeof m.displayName?m.displayName:String(m.displayName??"")}}:{type:e})},oe=()=>{if(!ee||!G?.current||E)return;const{positionX:e,positionY:t,width:n,fromBottom:r}=re(G);R({type:"UPDATE_DROPDOWN_POSITION",payload:{positionX:e,positionY:t,width:n,fromBottom:r}})},ae=e=>{const t=window.innerWidth-document.body.clientWidth;document.body.style.paddingRight=e?"":`${t}px`,document.body.style.overflow=e?"":"hidden"};u(()=>{if(E)return;ee&&ae(!ee),oe();const e=()=>oe();return window.addEventListener("resize",e),window.addEventListener("scroll",e),()=>{ae(!0),window.removeEventListener("resize",e),window.removeEventListener("scroll",e)}},[ee]),l(()=>{y&&ie("SHOW_ERROR")},[]),l(()=>{ie("FOCUS_INPUT")},[]);const le=!J&&Boolean(ne);return l(()=>{const e=Y.current;if(!e)return;let t=e.parentElement;for(;t&&t!==document.body;){const e=getComputedStyle(t);if(["scroll","auto"].includes(e.overflowY))break;t=t.parentElement}if(!t)return;const n=t.style.overflow,r=ee||S;return t.style.overflow=r?"hidden":n||"auto",()=>{t.style.overflow=n||"auto"}},[ee,S]),n("section",{className:"main-section",children:[n("div",{className:z(`ff-nlp-input-wrapper ${w}`),children:[n("div",{className:"ff-nlp-input",children:[e("input",{type:"text",className:z("ff-nlp-input-container",{"ff-nlp-input-container--default":!J,"ff-nlp-input-container--active":le,"ff-nlp-input-container--no-label":!s,"ff-nlp-input-container--error":y&&!J&&!Boolean(ne),"ff-nlp-input-container--border-radius":!M,"ff-nlp-input-container--disable":E,"ff-nlp-input-container--no-border":!x}),style:{zIndex:b,paddingLeft:"32px"},onFocus:()=>ie("FOCUS_INPUT"),onChange:e=>{E||g(e)},value:k,disabled:E,autoComplete:"off",spellCheck:"false",ref:Y,autoFocus:!0}),n("div",{className:"ff-nlp-icon-container",children:[e(P,{name:r||"ai_search",className:"ff-nlp-help_icon",width:16,height:16,onClick:f}),e(F,{className:"icon-label",fontSize:10,children:"Search With Ai"})]}),s&&n("div",{className:z("ff-nlp-input-label","ff-nlp-input-label--default",{"ff-nlp-input-label--active":k||Boolean(ne),"ff-nlp-input-label--error":y}),children:[L&&e(F,{color:"var(--$error-light)",className:"ff-nlp-input-label--required",children:"*"}),t]}),n("div",{className:"help-icon-container",onMouseDown:()=>Q.current=!0,style:{zIndex:b},children:[e("span",{className:z("ff-nlp-input-arrow",{"ff-nlp-input-arrow--down":!$,"ff-nlp-input-arrow--no-label":!s}),onMouseEnter:e=>{const t=e.target.getBoundingClientRect();W({top:t.top+window.scrollY-20+"px",left:`${t.left+window.scrollX+.5*t.width}px`,visibility:"visible",opacity:1,transitionDelay:"0s"})},onMouseLeave:()=>W(e=>({...e,visibility:"hidden",opacity:0})),children:e(P,{name:i||"",height:16,width:16,onClick:d,color:o})}),A(e(F,{className:"help-icon-label",fontSize:10,style:q,children:T}),document.body)]}),e("fieldset",{className:z("ff-nlp-input-fieldset",{"ff-nlp-input-fieldset--no-label":!s,"ff-nlp-input-fieldset--default":!J,"ff-nlp-input-fieldset--active":J,"ff-nlp-input-fieldset--option":le,"ff-nlp-input-fieldset--error":y,"ff-nlp-input-fieldset--border-radius":!M,"ff-nlp-input-fieldset--no-border":!x})})]}),y&&e(F,{className:"ff-nlp-input-wrapper-error-text",fontSize:8,color:"var(--error-light)",children:y}),e("div",{ref:G,children:ee&&A(e(pp,{onSelectBlur:()=>{E||(Q.current?Q.current=!1:y?ie("SHOW_ERROR"):(ie("BLUR_INPUT"),N()))},onSelectOptionSelector:e=>{H(e)},dropdownPosition:te,options:C,optionZIndex:b,inputRef:Y,webServiceClick:h,containerWidth:p,loadMoreOptions:V,chipRef:X,isWebservice:O,dropDownMessage:D}),document.body)})]}),e("div",{className:"chips-accordion-content",children:S&&S.length>0&&e(Cp,{chipOptionList:S,selectedChips:_,optionZIndex:b,ref:X,inputRef:Y,ChipsAccordionWidth:I})})]})},vp=({items:t,onButtonClick:r,selectedValue:i=null,onChange:o,className:a=""})=>{const[s,d]=c(i);l(()=>{i!==s&&d(i)},[i,s]);return n("div",{className:z("ff-icon-radio-group",a),children:[t.map(t=>e("div",{className:z("ff-icon-radio-button",{selected:s===t.iconName,disabled:t.disabled}),onClick:()=>(e=>{if(e.disabled)return;const t=e.iconName;d(t),o&&o(t),r(e)})(t),children:e(G,{title:t.iconLabel,children:e("div",{className:z("icon-container",{selected:s===t.iconName}),children:e(P,{name:t.iconName,hoverEffect:!1,color:s===t.iconName?"var(--drawer-footer-bg)":"var(--brand-color)"})})})},t.iconName)),e("div",{className:"line-connector"})]})},yp=({width:t="100%",options:r=[],runCount:i=0,className:o="",contentReverse:a=!1,onClick:l=()=>{},modalId:s="",scriptType:c="",readOnly:d=!1})=>{const u={local:"local",browserstack:"browserstack_icon",saucelabs:"sause_lab_icon",lambdatest:"lambda_icon",fireflink:"fireflink_platform_logo",mac:"mac_icon",mac_icon:"mac_icon",android:"android_icon",linux:"linux","google chrome":"chrome_icon","mozilla firefox":"fire_fox","microsoft edge":"edge","internet explorer":"internet_explorer",safari:"safari_icon",opera:"opera",windows:"windows",edge:"edge",firefox:"fire_fox",chrome:"chrome_icon",explorer:"internet_explorer",ios:"mac_icon",comet:"comet_icon"},f="manual"===c.toLowerCase();return n("div",{id:s,style:{width:t},className:z("ff-machine-input-field-wrapper",o,{"cursor-event-none":1!==i&&"Automation"==c}),onClick:()=>{d||l()},children:[!f&&n(F,{as:"span",color:"var(--ff-machine-input-field-text-color)",fontSize:8,textAlign:"center",className:"ff-machine-input-label",children:["Run ",i]}),e("div",{className:z("ff-machine-input-field",{"ff-machine-input-field-reverse":a}),children:r.map(({label:t,type:r,version:i})=>n("div",{className:z("ff-machine-icon-text-wrapper",{"ff-machine-icon-text-wrapper-reverse":a}),children:[e(P,{name:u[r?.toLowerCase()]||"",className:"ff-machine-icon"}),e(G,{title:t,children:e(F,{className:z("ff-machine-text",{"ff-machine-text-reverse":a}),color:"var(--ff-machine-input-field-text-color)",children:oe(t,10)?ie(t,10):t})}),f&&!K(i)&&e(G,{title:i,children:n(F,{className:z("ff-machine-text",{"ff-machine-text-reverse":a}),color:"var(--ff-machine-input-field-text-color)",children:[" -"," ",oe(i??"",10)?ie(i??"",10):i]})})]},r))})]})};yp.displayName="MachineInputField";const wp=({datSetToolTip:{globalVariableSetName:r="",peVariableSetName:i="",testDataSetName:o=""}})=>{const a={"Project Environment Set":i,"Global Variable Set":r,"Test Data Set":o};return e(t,{children:Object.entries(a).map(([t,r],i)=>e("div",{className:"ff-dataSetList-container",children:n("div",{children:[e(F,{as:"div",fontSize:10,lineHeight:"15px",color:"var(--details-page-value-color)",className:"ff-dataSetList-items",children:t}),e(F,{as:"div",lineHeight:"18px",color:"var(--base-bg-color)",children:r})]})},i))})},bp=e=>"object"==typeof e&&0===Object.keys(e).length,Ep=s(null),Mp=({machineInstances:r,rowIndex:i,machineColumnCount:o,nextRowMachineInstance:a,previousRowMachineInstance:l,onAddBrowser:s,onDeleteBrowser:c,onAddRunBrowser:u,onUpdateDataSetList:f,onUpdateAddBrowserInstance:h,addInstanceLabel:p="",scriptType:C="",projectType:m="",readOnly:g,maxRunCount:v})=>{const y=i%2==0,w=K(r[o-1]),b=d(Ep),{testDataSetMap:E={},globalVariableMap:M={},projectVariableMap:A={}}=b||{},x=(e,t)=>e&&t&&"machineInstanceId"in e&&"machineInstanceId"in t&&e.machineInstanceId===t.machineInstanceId?"dashed":"solid",L=e=>r.length-1!==e&&o>1,k=(e="",t)=>{const{executionEnv:n,browserName:r,browserVersion:i,machineInfo:{osVersion:o,iconName:a,osName:l,hostName:s},deviceInfo:c,fireCloudProjectName:d=""}=t,u=[{label:"FireFlink Device Farm"===n?d:n,type:((e="")=>"local"===e.toLowerCase()?"local":e.toLowerCase().includes("browserstack")?"Browserstack":e.toLowerCase().includes("lambdatest")?"LambdaTest":e.toLowerCase().includes("saucelabs")?"SauceLabs":e.toLowerCase().includes("fireflink device farm")?"fireflink":"")(n)}];"manual"===C.toLowerCase()&&u.push({label:s||"",type:"local"===n?.toLowerCase()?"local":""});const f=[{label:o,type:a||l},{label:i,type:r}],h=c?.reduce((e,t)=>(t&&e.push({label:t?.name,type:"manual"===C.toLowerCase()?"android":t?.platform,version:"manual"===C?.toLowerCase()?t?.version:""}),e),[]);switch(e.toLowerCase()){case"web":case"web service":return[...u,...f];case"web & mobile":case"ms dynamics":case"salesforce":return[...u,...f,...h];case"mobile":return[...u,...h];default:return[]}},H="manual"!==C.toLowerCase(),S=e=>!K(e)||(bp(e)||void 0!==a);return n("div",{className:z({"ff-connecting-branch-grid":y,"ff-connecting-branch-grid-reverse":!y}),style:{gridTemplateColumns:1===o?"24px minmax(min-content, auto) 24px":`24px minmax(min-content, auto) repeat(${o-1}, 40px minmax(min-content, auto)) 24px`},children:[n("div",{className:"ff-connecting-branch-start-wrapper",children:[e("div",{className:z({"ff-connecting-branch-arrow":y,"ff-connecting-branch-arrow-reverse":!y})}),e("div",{className:z({"ff-connecting-branch-container":y,"ff-connecting-branch-container-reverse":!y}),style:{border:`1px ${x(r[0],l)} var(--ff-connecting-branch-color)`,borderTop:"none",borderLeft:`${!y&&"none"}`,borderRight:`${y&&"none"}`}})]}),r?.map((i,o)=>{const{runCount:a=("runCount"in i?i.runCount:0),numberOfRuns:l=0,machineInstanceId:d="",peVariableSetId:w="",globalVariableSetId:b="",testDataSetId:_="",testDataSetName:V="",peVariableSetName:O="",globalVariableSetName:N=""}=i;return n(t,{children:[K(i)?!g&&e("div",{className:"ff-connecting-branch-browser-button",children:e(U,{id:`ff-sequential-branch-add-${d}`,variant:"secondary",label:p,onClick:()=>{g||s(`ff-sequential-branch-add-${d}`)}})}):n("div",{children:[n("div",{className:"ff-connecting-branch-input-point-wrapper",children:[S(r[o+1])&&e("div",{className:z({"ff-connecting-branch-point":y,"ff-connecting-branch-point-reverse":!y})}),e(yp,{runCount:a,options:k(m,i),contentReverse:!y,modalId:`${d}-runCount-${a-1}`,onClick:()=>1==a||"Automation"!==C?h(`${d}-runCount-0`,i):null,scriptType:C,readOnly:g},Wt())]}),n("div",{className:z({"ff-connecting-branch-datalist":y,"ff-connecting-branch-datalist-reverse":!y}),children:[H&&n(t,{children:[e("div",{id:`ff-sequential-branch-dataset-${d}-${a}`,className:"ff-dataset-list-branch",onClick:()=>{g||f(`ff-sequential-branch-dataset-${d}-${a}`,{peVariableSetId:w,globalVariableSetId:b,testDataSetId:_,testDataSetName:V,globalVariableSetName:N,peVariableSetName:O},!0,l,d)},children:n(G,{placement:"bottom",title:e(t,{children:e(wp,{datSetToolTip:{peVariableSetName:A[w]||"",globalVariableSetName:M[b]||"",testDataSetName:E[_]||""}})}),style:{display:"flex",alignItems:"center"},children:[e(P,{name:"datalist_icon",className:"ff-connecting-icon",hoverEffect:!0}),e(F,{className:"ff-connecting-text",color:"var(--ff-connecting-branch-color)",children:"Data Set List"})]})}),!g&&e(t,{children:e(G,{placement:"bottom",title:l>=v?`Maximum ${v} runs are allowed.`:"",children:n("div",{className:"ff-environment-run-container",onClick:l>=v?void 0:()=>u(d),children:[e(P,{name:"plus_icon",className:"ff-connecting-run-icon",color:"var(--ff-connecting-branch-color)",hoverEffect:!0,disabled:l>=v}),e(F,{className:"ff-connecting-run-text",color:"var(--ff-connecting-branch-color)",style:{opacity:l>=v?.5:1},children:"Run"})]})})})]}),!g&&e(G,{title:"Delete",children:e(P,{name:"delete",className:"ff-connecting-delete-icon",onClick:()=>c(d,a),color:"var(--ff-connecting-branch-delete-color)",hoverEffect:!0})})]})]}),L(o)&&e("div",{className:"ff-connecting-branch-middle-arrow",style:{borderTop:`1px ${x(i,r[o+1])} var(--ff-connecting-branch-color)`},children:e("div",{className:z({"ff-connecting-branch-arrow":y,"ff-connecting-branch-arrow-reverse":!y})})})]},Wt())}),(g?!w&&!K(a):!w)&&e("div",{className:z({"ff-connecting-branch-end-arrow":y,"ff-connecting-branch-end-arrow-reverse":!y}),style:{border:`1px ${x(r[o-1],a)} var(--ff-connecting-branch-color)`,borderBottom:"none",borderLeft:`${y&&"none"}`,borderRight:`${!y&&"none"}`}})]})},Ap=({machineBranchInstances:n,machineColumnCount:r,machineColumnWidth:i,onAddBrowser:o,onDeleteBrowser:a,onAddRunBrowser:s,onUpdateDataSetList:d,onUpdateAddBrowserInstance:u,addInstanceLabel:f="",scriptType:h="",projectType:p="Web",readOnly:C=!1,maxRunCount:m})=>{const[g,v]=c(n);l(()=>{v(n)},[n]);const y=((e,t)=>{const n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n})(g,r);return e("div",{className:"ff-connecting-branch-grid-wrapper",children:y.map((n,l)=>e(t,{children:e(Mp,{machineInstances:n,rowIndex:l,machineColumnCount:r,machineColumnWidth:i,onAddBrowser:o,onDeleteBrowser:a,onAddRunBrowser:s,nextRowMachineInstance:y[l+1]?.[0],previousRowMachineInstance:y[l-1]?.[r-1],onUpdateDataSetList:d,onUpdateAddBrowserInstance:u,addInstanceLabel:f,scriptType:h,projectType:p,readOnly:C,maxRunCount:m})},Wt()))})},xp=({machineInstances:r=[],machineColumnWidth:i=180,machineColumnCount:o=1,selectedMachine:s={},machineOptionsList:d=[],onHandleSelect:u=()=>{},onAddBrowserInstance:f=()=>{},onAddRunBrowserInstance:h=()=>{},onDeleteBrowserInstance:p=()=>{},onUpdateDataSetList:C=()=>{},onDeleteMachineInstance:m=()=>{},dataSetValues:g={testDataSetId:"",globalVariableSetId:"",peVariableSetId:"",globalVariableSetName:"",peVariableSetName:"",testDataSetName:""},onUpdateAddBrowserInstance:v=()=>{},addInstanceLabel:y="Add Environment",placeholder:w="Choose Machine",scriptType:b="Automation",projectType:E="Web",readOnly:M=!1,zIndex:A=99999,maxRunCount:x=35,environmentVariableMaps:L,isRequired:k=!1})=>{const[H,S]=c({}),_=a(null),V=Math.max(o,1),O=Math.max(i,180),[N,T]=c([]),I=K(r);let D=K(s.value?.clientId);"Manual"===b&&(D=K(s.value));l(()=>{S(s)},[s]),l(()=>{T(M?r:[...r,{}])},[r]);const Z="manual"!==b.toLowerCase(),j=(R=g,B="Id",Object.fromEntries(Object.entries(R).filter(([e])=>!e.includes(B))));var R,B;const q=M&&!I||!M&&I||!M&&!I;return e(Ep.Provider,{value:L,children:n("div",{className:"ff-sequential-connecting-branch-wrapper",children:[n("div",{className:"ff-connecting-select-branch-wrapper",children:[n("div",{className:"ff-select-branch-wrapper",children:[e(lr,{onChange:u,optionsList:d,label:w,required:k,showLabel:!0,className:"ff-sequential-select-branch",width:"240px",selectedOption:H,valueAccessor:"name",optionsRequired:!M,disableInput:M,optionZIndex:A}),!D&&n("div",{className:z({"ff-select-branch-arrow":I,"ff-select-branch-arrow-down":!I}),children:[q&&e("div",{className:"ff-select-branch-point"}),n("div",{className:"ff-select-branch-arrow",children:[!M&&e("div",{className:"ff-branch-arrow-wrapper",children:I&&e("div",{className:"ff-branch-arrow"})}),I&&!M&&e(t,{children:e(U,{variant:"tertiary",label:"Manual"===b?"+ Machine":"+ Environment",size:"small",className:"branch-button",ref:_,onClick:()=>f("ff-sequential-branch-button"),id:"ff-sequential-branch-button"})})]})]})]}),!D&&n("div",{className:"ff-select-scope-datalist",children:[e("div",{className:"ff-scope-wrapper",children:e(F,{as:"span",color:((e="")=>e.toLowerCase().includes("inactive")?"var(--ff-machine-inactive-status-color)":e.toLowerCase().includes("running")?"var(--ff-machine-running-status-color)":e.toLowerCase().includes("active")?"var(--ff-machine-active-status-color)":"var(--ff-machine-active-status-color))")(s.value?.status),className:"ff-scope-text",children:s.value?.status})}),n("div",{className:"ff-datalist-wrapper",children:[Z&&e("div",{id:"ff-sequential-machine-datalist",onClick:()=>{M||C("ff-sequential-machine-datalist",g)},children:n(G,{placement:"bottom",title:e("div",{children:e(wp,{datSetToolTip:j})}),style:{display:"flex",alignItems:"center"},children:[e(P,{name:"datalist_icon",className:"ff-dataset-icon",hoverEffect:!0}),e(F,{as:"span",color:"var(--ff-connecting-branch-color)",className:"ff-datalist-text",children:"Data Set List"})]})}),!M&&e(G,{title:"Delete",placement:"bottom",children:e(P,{name:"delete",className:"ff-run-delete-icon",color:"var(--ff-connecting-branch-delete-color)",onClick:m,hoverEffect:!0})})]})]})]}),e("div",{className:"ff-sequential-branches-wrapper",children:!I&&e(Ap,{machineBranchInstances:N,machineColumnCount:V,machineColumnWidth:O,onAddBrowser:f,onDeleteBrowser:p,onAddRunBrowser:h,onUpdateDataSetList:C,onUpdateAddBrowserInstance:v,addInstanceLabel:y,scriptType:b,projectType:E,readOnly:M,maxRunCount:x})})]})})},Lp=({label:t,selectedFiles:r,onFilesChange:i,disabled:o=!1,buttonDisplayType:l="attachment",iconName:s="plus_icon",maxFileSizeMB:d,maxFiles:u,buttonLabel:f="Select Files",showSelectedFiles:h=!0,buttonVariant:p="primary",deleteButton:C=!0,multiple:m=!0,addAttachmentButton:g=!0,isInfoIconRequired:v=!0,onFileListClick:y,types:w=[],attachmentInfoTooltip:b="",selectedFileMessage:E="This file is already selected",required:M=!1,errorMessage:A,truncateMaxLimit:x=1/0,onClickAttachmentButton:L=()=>{}})=>{const k=a(null),[H,S]=c(""),_={image:["image/jpeg","image/png","image/svg+xml"],video:["video/mp4","video/mpeg","video/quicktime"],audio:["audio/mpeg","audio/wav","audio/ogg"],document:["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],archive:["application/zip","application/x-rar-compressed","application/x-7z-compressed"],spreadsheet:["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],excel:["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],dat:[".dat","application/octet-stream"],trg:[".trg","application/octet-stream"]},V=w.flatMap(e=>_[e]||[]).join(","),O=()=>{L(),S(""),k.current?.click()};return n("div",{children:[v&&n("div",{className:"ff-label-icon",children:[e(F,{fontWeight:"semi-bold",lineHeight:"18px",as:"span",required:M,children:t}),e(G,{title:b||(()=>{if(0===w.length)return"Any files are allowed.";const t=w.flatMap(e=>_[e]||[]).map(e=>e.split("/")[1]),r=t.pop();return n("span",{children:[t.join(", ")," and ",r," files are allowed.",e("br",{}),"Max size: ",d," MB"]})})(),placement:"bottom-start",children:e(P,{name:"info",hoverEffect:!0})})]}),(!h||0===r.length)&&("attachment"===l?e(U,{variant:p,label:f,size:"medium",onClick:O,disabled:o}):"icon"===l?e(eh,{label:f,iconName:s,onClick:O,isDisable:o}):null),e("input",{type:"file",ref:k,className:"ff-input-field",onChange:()=>{if(S(""),k.current?.files){const e=Array.from(k.current.files);if(e.length>5)return S("Maximum file(s) can be uploaded: 5"),void(k.current.value="");const t=e.filter(e=>!r.some(t=>t.name===e.name));if(0===t.length)return S(E),void(k.current.value="");if("number"==typeof u&&r.length+t.length>u)return S(`You can only select up to ${u} files.`),void(k.current.value="");if("number"==typeof d){const e=1024*d*1024;if(t.filter(t=>t.size>e).length>0)return S(`Maximum file(s) size allowed: ${d} MB.`),void(k.current.value="")}i([...r,...t],t,"ADD"),k.current.value=""}},multiple:m,accept:V,required:M}),H&&e(Xt,{isOpen:!!H,variant:"info",toastTitle:"Info",toastMessage:H,zIndex:1e7}),h&&r.map((t,o)=>n("div",{className:"ff-attachment-files",onClick:y,children:[e(F,{color:"var(--brand-color)",children:e(cn,{title:t.name,width:x})}),C&&e(G,{title:"Delete",children:e(P,{name:"delete",hoverEffect:!0,color:"var(--ff-delete-button-attachment)",variant:"danger",onClick:()=>(e=>{const t=[...r],n=t.splice(e,1);i(t,n,"DELETE")})(o)})}),o===r.length-1&&g&&e(G,{title:""+("number"==typeof u&&r.length>=u?`Maximum files can be uploaded: ${u}`:"Add File"),children:e(P,{name:"add_file",hoverEffect:!0,onClick:O,disabled:"number"==typeof u&&!(r.length<u)})})]},t.name)),M&&e(F,{children:A,fontSize:10,className:"error-text"})]})},kp=({selected:t="text",firstButton:r="File",secondButton:i="File",handleClick:o})=>n("div",{className:"toggle-container",children:[e("button",{className:"toggle-button "+(t===r?"active":""),onClick:()=>o(r),children:r}),e("button",{className:"toggle-button "+(t===i?"active":""),onClick:()=>o(i),children:i})]}),Hp=({variant:t="small",iconName:n,iconColor:r="var(--avatar-icon-color)",customAvatarSize:i,customIconSize:o,backgroundColor:a,label:l,labelFontSize:s})=>{const c=l?.slice(0,2);return e("div",{className:`ff-avatar ff-avatar--${t}`,style:{height:`${i}px`,width:`${i}px`,backgroundColor:a},children:l?e("span",{className:"ff-avatar-label",style:{fontSize:s||"14px",color:r},children:c}):e(P,{name:n,height:o,width:o,color:r})})},Sp=({logo:t,overlay:r=!1})=>e("div",{className:`overlay-loader ${r&&"overlay"}`,children:n("div",{className:"loader-container ",children:[t&&e(t,{}),e("div",{className:"line_loader"})]})}),_p=({contentHeader:t,data:r,maxHeight:i=""})=>{const o=`scrollable-${(e=>{const t=parseInt(e);if(isNaN(t))return"default";const n=100*Math.round(t/100);return Math.min(Math.max(100,n),1e3)})(i)}`;return n("div",{className:"ff-content-card-container",children:[e("div",{className:"ff-content-card-nav",children:e(F,{as:"div",fontWeight:"semi-bold",lineHeight:"35px",children:t})}),e("div",{className:`ff-content-card-body scrollable ${o}`,children:Object.entries(r).map(([t,r],i)=>n("div",{className:"ff-content-card-row",children:[n(F,{fontWeight:"semi-bold",children:[t,":"]}),e(F,{className:"ff-content-card-value",children:r})]},i+t))})]})},Vp=({label:t,placeholder:r,text:i,showText:o=!0,highlightText:s,customError:d,confirmIcon:u,customErrorCondition:f,cancelIcon:h,variant:p="textField",onInputChange:C,dropdownData:m=[],className:g,height:v,isOpen:y=!1,confirmAction:w,onClick:b,tooltip:E,onDoubleClick:M,disableEditing:A=!1})=>{const[x,L]=c(y??!1),[k,H]=c(i??""),[S,_]=c(m[0]?.value??""),[V,O]=c(""),[z,N]=c(!0),[T,I]=c(!1),D=!(!V||!x),Z=a(null),j=a(null),[R,B]=c(null),U=q("Escape");l(()=>()=>{R&&clearTimeout(R)},[R]);const W=()=>{let e="";0===k.length||0===k.trim().length?e="Please type any text.":k.length<3?e="Please enter at least 3 characters.":f&&(e=d??"Invalid input."),e?O(e):(L(!1),O(""),w&&w(k,S)),u?.onClick?.()},Q=()=>{H(i??""),_(m[0]?.value??""),L(!1),O(""),I(!1),h?.onClick?.()},K=e=>{const t=e.target.value;H(t),N(!1),0===t.length||0===t.trim().length?O("Input is required"):t.length<3?O("Input cannot be less than 3 characters"):t.length>250?O("Input cannot be more than 250 characters"):Ve.test(t)?O("Space is not allowed at starting and at the end"):O(f?d??"Invalid input.":""),I(t!==i),C&&C(t)},Y=e=>{if(Z.current&&!Z.current.contains(e.target)&&j.current!==e.target){const e=((e,t)=>e===t?"No changes were made.":e?e.length<3?"Please enter at least 3 characters.":"":"Text is required")(k,i??"");e&&x?O(e):(L(!1),O(""))}};return l(()=>(document.addEventListener("click",Y),()=>{document.removeEventListener("click",Y)}),[k]),U(Q),ce([{key:"Enter",action:()=>{W()}}],Z),n("div",{className:"ff-label-edit-text-field",ref:Z,children:[x?n("div",{className:"ff-label-text-field",children:["textFieldWithDropdown"===p?n("div",{className:"ff-label-text-field-with-dropdown "+(x?"open":""),style:{height:v},children:[e(rn,{name:"input",type:"text",label:t||"",disabled:!1,error:D,placeholder:r||"",value:k,onChange:K,className:`${g} \n \n ${T?"modified":""}`}),e(lr,{label:"",optionsList:m,selectedOption:{value:S,label:S},onChange:e=>_(e.value)})]}):e("div",{className:"ff-label-text-field-without-dropdown",children:e(rn,{name:"input",type:"text",label:t||"",disabled:!1,error:D,placeholder:r||"",value:k,onChange:K,className:`${g} \n \n ${T?"modified":""}`})}),n("div",{className:"ff-icon-container",children:[u&&e(G,{title:"Confirm",placement:"bottom",children:e(P,{color:"var(--label-edit-confirm-icon)",height:20,width:20,name:u.name,disabled:z,className:""+(z?"disabled-confirm-icon":"confirm-icon"),onClick:W})}),h&&e(G,{title:"Cancel",placement:"bottom",children:e(P,{color:"var(--label-edit-cancel-icon)",height:12,width:20,name:h.name,className:"cancel-icon",onClick:Q,ref:j})})]})]}):e(G,{title:E?.tooltipTitle?E?.tooltipTitle:"",placement:"bottom",children:o&&e("span",{className:"display-text",onDoubleClick:()=>{A||(R&&(clearTimeout(R),B(null)),M&&M(),L(!0),O(""))},role:"button",onClick:()=>{if(A)return;R&&(clearTimeout(R),B(null));const e=window.setTimeout(()=>{b&&b(),B(null)},1e3);B(e)},children:e(J,{text:k,highlight:s})})}),V&&x&&e(F,{as:"p",fontSize:8,className:"error-text",children:V})]})},Op=e=>e?e.charAt(0)?.toUpperCase()+e?.slice(1)?.toLowerCase():"",zp=({label:t,text:r,highlightText:i,customError:o,customErrorCondition:l=!1,confirmIcon:s,cancelIcon:d,editIcon:u,dropdownData:f=[],isOpen:h=!1,confirmAction:p,onClick:C,nameTooltipTitle:m})=>{const[g,v]=c(h??!1),[y,w]=c(r),[b,E]=c(!0),[M,A]=c(f[0]?.value??""),[x,L]=c(""),[k,H]=c(!1),S=!(!x||!g),_=a(null),V=a(null),O=()=>{const e=((e,t,n,r)=>e===t?"No changes were made.":e?e.length<3?"Please enter at least 3 characters.":r?n??"":"":"Text is required")(y,r,o,l);e&&g?L(e):(v(!1),L(""),p&&p(y,M))},z=()=>{w(r),A(f[0]?.value??""),v(!1),L(""),H(!1)};function N(e){"Enter"===e&&O(),"Escape"===e&&z()}return ce([{key:"Enter",action:()=>N("Enter")},{key:"Escape",action:()=>N("Escape")}],_),n("div",{className:"ff-label-edit-text-field",ref:_,children:[n("div",g?{className:"ff-label-text-field",children:[e("div",{className:"ff-label-text-field-without-dropdown",children:e(rn,{name:"input",label:t||"",disabled:!1,error:S,placeholder:"Enter your name",value:y,onChange:e=>{w(e.target.value),H(!0),L(""),E(!1)},className:"\n \n "+(k?"modified":""),type:"text"})}),n("div",{className:"ff-icon-container",children:[s&&e(G,{title:"confirm",placement:"bottom",children:e(P,{color:s?.color??"var(--default-confirm-icon-color)",height:s?.height??20,disabled:b,width:s?.width??20,name:s?.name??"default-confirm-icon",className:`${s?.className??"default-confirm-class"} ${b?"disabled-confirm-icon":"confirm-icon"}`,onClick:O})}),d&&e(G,{title:"cancel",placement:"bottom",children:e(P,{color:d?.color??"var(--label-edit-cancel-icon)",height:d?.height??12,width:d?.width??20,name:d?.name??"default-cancel-icon",className:d?.className??"cancel-icon",onClick:z,ref:V})})]})]}:{className:"display-text-container",children:[m?e(G,{title:m,children:e("span",{className:"display-text",onClick:C,children:e(J,{text:y,highlight:i})})}):e("span",{className:"display-text",onClick:C,children:e(J,{text:y,highlight:i})}),e(G,{title:Op(u?.name??"Edit"),children:e(P,{color:u?.color??"var(--label-edit-cancel-icon)",height:u?.height??20,width:u?.width??20,name:u?.name??"edit",className:u?.className??"edit-icon",onClick:()=>{v(!0),L("")}})})]}),x&&g&&e(F,{as:"p",fontSize:8,className:"error-text",children:x})]})},Np="SET_DATA",Tp="SET_CREATE_FORMULA_PARSER",Ip="SELECT_ENTIRE_ROW",Dp="SELECT_ENTIRE_COLUMN",Zp="SELECT_ENTIRE_WORKSHEET",jp="SET_SELECTION",Rp="SELECT",Bp="ACTIVATE",Pp="SET_CELL_DATA",Fp="SET_CELL_DIMENSIONS",Up="COPY",qp="CUT",Wp="PASTE",Qp="EDIT",Kp="VIEW",Gp="BLUR",Yp="KEY_PRESS",Xp="KEY_DOWN",Jp="DRAG_START",$p="DRAG_END",eC="COMMIT",tC="BOLD",nC="ITALIC",rC="UNDERLINE_TYPE",iC="FONT_FAMILY",oC="FONT_SIZE",aC="TEXT_ALIGN",lC="BORDER_TYPE",sC="COLOR",cC="BACKGROUND_COLOR",dC="FORMATE_PAINTER",uC="ADD_ROW_TOP",fC="ADD_ROW_BOTTOM",hC="ADD_COLUMN_LEFT",pC="ADD_COLUMN_RIGHT",CC="DELETE_ROW",mC="DELETE_COLUMN",gC="SET_ROW_HEIGHT",vC="SET_COLUMN_POSITION",yC="SET_AUTO_FILL",wC="UPDATE_COLUMN_DIMENSIONS",bC="SET_EDITABLE",EC="ON_MOUSE_UP";function MC(e){return{type:EC,payload:{point:e}}}function AC(e){return{type:bC,payload:{editable:e}}}function xC(e,t){return{type:gC,payload:{row:e,height:t}}}function LC(e,t){return{type:vC,payload:{column:e,width:t}}}function kC(e){return{type:tC,payload:{data:e}}}function HC(e){return{type:nC,payload:{data:e}}}function SC(e,t,n){return{type:lC,payload:{data:e,value:t,color:n}}}function _C(e){return{type:rC,payload:{data:e}}}function VC(e,t){return{type:oC,payload:{data:e,value:t}}}function OC(e,t){return{type:iC,payload:{data:e,value:t}}}function zC(e,t){return{type:aC,payload:{data:e,value:t}}}function NC(e,t){return{type:sC,payload:{data:e,value:t}}}function TC(e,t){return{type:cC,payload:{data:e,value:t}}}function IC(e){return{type:dC,payload:{data:e}}}function DC(e){return{type:uC,row:e}}function ZC(e){return{type:fC,row:e}}function jC(e,t){return{type:hC,columnWidth:e,column:t}}function RC(e,t){return{type:pC,columnWidth:e,column:t}}function BC(e){return{type:CC,row:e}}function PC(e){return{type:mC,column:e}}function FC(e){return{type:Yp,payload:{event:e}}}function UC(e){return{type:Np,payload:{data:e}}}function qC(e){return{type:Tp,payload:{createFormulaParser:e}}}function WC(e){return{type:jp,payload:{selection:e}}}function QC(e){return{type:Bp,payload:{point:e}}}function KC(e,t){return{type:Pp,payload:{active:e,data:t}}}function GC(e,t){return{type:Fp,payload:{point:e,dimensions:t}}}function YC(e){return{type:Wp,payload:{data:e}}}function XC(e){return{type:Xp,payload:{event:e}}}function JC(){return{type:Jp}}function $C(){return{type:$p}}function em(){return{type:Up}}function tm(){return{type:qp}}function nm(){return{type:Gp}}function rm(e,t){const n=t[e.row];if(void 0!==n)return n[e.column]}function im(e,t,n){const r=[...n],i=[...n[0]??[]];i.length<=e.column&&(i.length=e.column+1),r[0]=i;const o=[...n[e.row]??[]];return o[e.column]=t,r[e.row]=o,r}function om(e,t,n){let r=n[0];r||(r=[],n[0]=r);let i=n[e.row];i||(i=[],n[e.row]=i),r.length<=e.column&&(r.length=e.column+1),i[e.column]=t}const am={value:"",inputType:{type:"text"},readOnly:!1,style:{color:"#000000",backgroundColor:"#ffffff",borderColor:"#c9c9c9",textDecoration:"normal",borderRight:"1px solid var(--excel-header-border)",borderLeft:"1px solid var(--excel-header-border)",borderTop:"1px solid var(--excel-header-border)",borderBottom:"1px solid var(--excel-header-border)",fontSize:""+(lm=9,1.33*lm+"px"),fontWeight:"normal",fontStyle:"normal",fontFamily:"Poppins",textAlign:"left"}};var lm;function sm(e,t){if(!dm(e,t))return t;const n=[...t],r=t[e.row];if(r){const t=[...r];t[e.column]=am,n[e.row]=t}return n}function*cm(e){for(const[t,n]of e.entries())for(const[e,r]of n.entries()){const n={row:t,column:e};yield[n,r]}}function dm(e,t){const n=t[0];return!!n&&(e.row>=0&&e.column>=0&&Number.isInteger(e.row)&&Number.isInteger(e.column)&&e.column<n.length&&e.row<t.length)}function um(e){return{columns:hm(e),rows:fm(e)}}function fm(e){return e.length}function hm(e){const t=e[0];return t?t.length:0}function pm(e){const t=um(e);return{row:t.rows-1,column:t.columns-1}}class Cm{start;end;constructor(e,t){this.start={row:Math.min(e.row,t.row),column:Math.min(e.column,t.column)},this.end={row:Math.max(e.row,t.row),column:Math.max(e.column,t.column)}}*[Symbol.iterator](){for(let e=this.start.row;e<=this.end.row;e++)for(let t=this.start.column;t<=this.end.column;t++)yield{row:e,column:t}}size(){return(this.end.row+1-this.start.row)*(this.end.column+1-this.start.column)}has(e){return e.row>=this.start.row&&e.column>=this.start.column&&e.row<=this.end.row&&e.column<=this.end.column}mask(e){return new Cm({row:e.start.row>this.start.row?e.start.row:this.start.row,column:e.start.column>this.start.column?e.start.column:this.start.column},{row:e.end.row<this.end.row?e.end.row:this.end.row,column:e.end.column<this.end.column?e.end.column:this.end.column})}equals(e){return this.start.row===e.start.row&&this.start.column===e.start.column&&this.end.row===e.end.row&&this.end.column===e.end.column}}const mm={row:0,column:0};class gm{}class vm extends gm{toRange(e){return null}normalizeTo(e){return this}hasEntireRow(){return!1}hasEntireColumn(){return!1}size(){return 0}has(){return!1}equals(e){return e instanceof vm}}class ym extends gm{range;constructor(e){super(),this.range=e}toRange(e){return this.range}normalizeTo(e){const t=xm(e);return new ym(this.range.mask(t))}hasEntireRow(){return!1}hasEntireColumn(){return!1}size(e){const t=this.toRange(e);return t?t.size():0}has(e,t){const n=this.toRange(e);return null!==n&&n.has(t)}equals(e){return e instanceof ym&&this.range.equals(e.range)}}class wm extends gm{}class bm extends wm{toRange(e){return xm(e)}normalizeTo(){return this}hasEntireColumn(){return!0}hasEntireRow(){return!0}size(e){return hm(e)*fm(e)}has(){return!0}equals(e){return e instanceof bm}}class Em extends wm{start;end;constructor(e,t){if(!Lm(e))throw new km("start");if(!Lm(t))throw new km("end");super(),this.start=Math.min(e,t),this.end=Math.max(e,t)}equals(e){return e instanceof Em&&this.constructor===e.constructor&&this.start===e.start&&this.end===e.end}}class Mm extends Em{toRange(e){const t=pm(e);return new Cm({row:this.start,column:0},{row:this.end,column:t.column})}normalizeTo(e){const t=fm(e);return new Mm(Math.max(this.start,0),Math.min(this.end,t-1))}hasEntireRow(e){return e>=this.start&&e<=this.end}hasEntireColumn(){return!1}size(e){return(this.end-this.start+1)*hm(e)}has(e,t){return t.row>=this.start&&t.row<=this.end}}class Am extends Em{toRange(e){const t=pm(e);return new Cm({row:0,column:this.start},{row:t.row,column:this.end})}normalizeTo(e){const t=hm(e);return new Am(Math.max(this.start,0),Math.min(this.end,t-1))}hasEntireRow(){return!1}hasEntireColumn(e){return e>=this.start&&e<=this.end}size(e){return(this.end-this.start+1)*fm(e)}has(e,t){return t.column>=this.start&&t.column<=this.end}}function xm(e){const t=pm(e);return new Cm(mm,t)}function Lm(e){return Number.isInteger(e)&&e>=0}class km extends Error{constructor(e){super(`${e} is not a valid index. It must be 0 or a positive integer`)}}const Hm="text/plain";function Sm(e,t=0,n=1){const r=[];if(-1===Math.sign(e-t)){for(let i=t;i>e;i-=n)r.push(i);return r}for(let i=t;i<e;i+=n)r.push(i);return r}function _m(e,t){return Boolean(e&&(r=e,(n=t).column===r.column&&n.row===r.row));var n,r}function Vm(e){return{width:e.offsetWidth,height:e.offsetHeight,left:e.offsetLeft,top:e.offsetTop}}function Om(e){return Object.keys(e).map(e=>Number(e)).sort((e,t)=>e-t)}function zm(e,t,n){const r={},i=Om(e);let o=0,a=!1;for(let l=0;l<i.length;l++){if(l===t){const e=r[l-1],t=e?e.left+e.width:0;r[l]={left:t,width:n},o=n,a=!0}const s=i[l];if(void 0===s)continue;const c=e[s];if(!c)continue;const d=a?l+1:l,u=a?c.left+o:c.left;r[d]={...c,left:u}}if(!a){const e=i.length>0?i[i.length-1]:void 0,o=void 0!==e?r[e]:void 0,a=o?o.left+o.width:0;r[t]={left:a,width:n}}return r}function Nm(e,t,n){const r={},i=Om(e);let o=0,a=!1;for(let l=0;l<i.length;l++){if(l===t){const e=r[l-1],t=e?e.top+e.height:0;r[l]={top:t,height:n},o=n,a=!0}const s=i[l];if(void 0===s)continue;const c=e[s];if(!c)continue;const d=a?l+1:l,u=a?c.top+o:c.top;r[d]={...c,top:u}}if(!a){const e=i.length>0?i[i.length-1]:void 0,o=void 0!==e?r[e]:void 0,a=o?o.top+o.height:0;r[t]={top:a,height:n}}return r}function Tm(e,t){const n={},r=Om(e);let i=0;for(let o=0,a=0;o<r.length;o++){if(r[o]===t)continue;const l=r[o];if(void 0===l)continue;const s=e[l];s&&(n[a]={top:0===i?s.top:i,height:s.height},"number"==typeof n[a]?.top&&(i=(n[a]?.top??0)+s.height),a++)}return n}function Im(e,t){const n={},r=Om(e);let i=0;for(let o=0,a=0;o<r.length;o++){if(r[o]===t)continue;const l=r[o];if(void 0===l)continue;const s=e[l];s&&(n[a]={left:0===i?s.left:i,width:s.width},"number"==typeof n[a]?.left&&(i=(n[a]?.left??0)+s.width),a++)}return n}function Dm(e,t,n){const r=100;let i=32;for(let n=0;n<e.row;n++)i+=(t?.[n]?t?.[n]?.height:32)||32;const o=(t?.[e.row]?t?.[e.row]?.height:32)||32;let a=60;for(let t=0;t<e.column;t++)a+=(n?.[t]?n?.[t]?.width:r)||r;return{top:i,height:o,left:a,width:(n?.[e.column]?n?.[e.column]?.width:r)||r}}function Zm(e,t,n){const r=Dm(n.start,e,t);let i=Dm(n.end,e,t);return void 0===i&&(i=function(e,t,n){const r=100;let i=4032;for(let n=0;n<e.row;n++)i+=(t?.[n]?t?.[n]?.height:32)||32;const o=(t?.[e.row]?t?.[e.row]?.height:32)||32;let a=60;for(let t=0;t<e.column;t++)a+=(n?.[t]?n?.[t]?.width:r)||r;return{top:i,height:o,left:a,width:(n?.[e.column]?n?.[e.column]?.width:r)||r}}(n.end,e,t)),r&&i&&{width:i.left+i.width-r.left,height:i.top+i.height-r.top,top:r.top+1,left:r.left+1}}function jm(e,t,n,r){const i=r.toRange(n);return i?Zm(e,t,i):void 0}function Rm(e){return function(e,t){const n=[];for(const[r,i]of cm(t))om(r,e(i,r),n);return n}(e=>e?.value||"",e).map(e=>e.map(e=>{const t=String(e).replace(/"/g,'""');return Rt.test(t)?`"${t}"`:t}).join("\t")).join("\n")}function Bm(e,t){return null!==e&&"view"===t&&Pm(e)}function Pm(e){return e.matches(":focus-within")}function Fm(e){return"string"==typeof e&&e.includes("\n")}const Um=e=>`${1.33*e}px`,qm=e=>parseFloat(e.replace("px",""))/1.33,Wm={value:"",inputType:{type:"text"},readOnly:!1,style:{color:"#000000",backgroundColor:"#ffffff",borderColor:"#c9c9c9",textDecoration:"normal",borderRight:"1px solid var(--excel-header-border)",borderLeft:"1px solid var(--excel-header-border)",borderTop:"1px solid var(--excel-header-border)",borderBottom:"1px solid var(--excel-header-border)",fontSize:`${Um(9)}`,fontWeight:"normal",fontStyle:"normal",fontFamily:"Poppins",textAlign:"left"}},Qm=[{label:"Times New Roman",value:"Times New Roman"},{label:"Arial",value:"Arial"},{label:"fantasy",value:"fantasy"},{label:"cursive",value:"cursive"},{label:"Poppins",value:"Poppins"},{label:"Courier New",value:"Courier New"},{label:"Verdana",value:"Verdana"},{label:"Tahoma",value:"Tahoma"},{label:"Trebuchet MS",value:"Trebuchet MS"},{label:"Comic Sans MS",value:"Comic Sans MS"},{label:"Impact",value:"Impact"},{label:"Arial Black",value:"Arial Black"},{label:"Lucida Console",value:"Lucida Console"},{label:"Lucida Sans Unicode",value:"Lucida Sans Unicode"},{label:"Courier",value:"Courier"},{label:"Arial Rounded MT Bold",value:"Arial Rounded MT Bold"},{label:"Georgia",value:"Georgia"},{label:"sans-serif",value:"sans-serif"},{label:"serif",value:"serif"},{label:"monospace",value:"monospace"}],Km=[5,6,8,9,10,12,14,16,18,20,22,24,26,28,32,36,40,48,56,72],Gm=e=>["dropDown","text"].includes(e?.inputType?.type??"text")&&!e?.readOnly;function Ym(e){return{rowCount:e?.length??0,columnCount:e?.[0]?.length??0}}function Xm(e){return"string"==typeof e&&e.startsWith("=")&&e.length>1}function Jm(e){return e}function $m(e){return`${e.row},${e.column}`}function eg(e){const[t,n]=e.split(",");return{row:Number(t),column:Number(n)}}class tg{set;constructor(e){this.set=e}static from(e){const t=new Set;for(const n of e)t.add($m(n));return new tg(t)}has(e){return this.set.has($m(e))}get size(){return this.set.size}add(e){const t=new Set(this.set);return t.add($m(e)),new tg(t)}delete(e){const t=new Set(this.set);return t.delete($m(e))?new tg(t):this}difference(e){let t=this;for(const n of e)t=t.delete(n);return t}union(e){let t=this;for(const n of e)t=t.add(n);return t}*[Symbol.iterator](){for(const e of this.set)yield eg(e)}}class ng{forwards;constructor(e=new Map){this.forwards=e}static from(e){const t=new Map;for(const[n,r]of e)t.set($m(n),r);return new ng(t)}set(e,t){const n=new ng(new Map(this.forwards));return 0===t.size?(n.forwards.delete($m(e)),n):(n.forwards.set($m(e),t),n)}get(e){return this.forwards.get($m(e))||tg.from([])}getBackwards(e){let t=tg.from([]);for(const[n,r]of this.forwards)r.has(e)&&(t=t.add(eg(n)));return t}getBackwardsRecursive(e,t=tg.from([])){let n=this.getBackwards(e),r=t;for(const e of n)r.has(e)||(r=r.add(e),n=n.union(this.getBackwardsRecursive(e,r)));return n}hasCircularDependency(e){let t=tg.from([]);const n=[e];for(;n.length>0;){const e=n.pop();if(!e)continue;if(t.has(e))return!0;t=t.add(e);const r=this.get(e);if(r)for(const e of r)n.push(e)}return!1}*[Symbol.iterator](){const e=new Set;for(const[t,n]of this.forwards){const r=eg(t);e.add(t),yield[r,n];for(const t of n){const n=$m(t);e.has(n)||this.forwards.has(n)||(e.add(n),yield[t,tg.from([])])}}}*traverseBFSBackwards(){let e=tg.from([]);const t=[];for(const[n,r]of this)0===r.size&&(e=e.add(n),t.push(n));for(;t.length>0;){const n=t.shift();if(!n)continue;yield n;const r=this.getBackwards(n);if(0!==r.size)for(const n of r)e.has(n)||0!==this.get(n).difference(e).size||(t.push(n),e=e.add(n))}}}class rg{data;evaluatedData;referenceGraph;createFormulaParser;constructor(e,t,n,r){this.createFormulaParser=e,this.data=t,this.referenceGraph=n||function(){const e=[];return ng.from(e)}(),this.evaluatedData=r||function(e,t){let n=e;for(const r of t.traverseBFSBackwards()){const t=rm(r,e);if(t&&Xm(t.value)){const e=og();n=im(r,{...t,value:e},n)}}return n}(t,this.referenceGraph)}}function ig(e,t,n){const r=im(t,n,e.data),i=(Xm(n.value),e.referenceGraph),o=function(e,t,n,r,i){if(n.hasCircularDependency(r)){let o=tg.from([r]),a=im(r,{...i,value:"TODO"},e);for(const e of n.getBackwardsRecursive(r)){if(o.has(e))break;o=o.add(e);const n=rm(e,t);n&&(a=im(e,{...n,value:"TODO"},a))}return a}let o=e;const a=Xm(i.value)?"TODO":i.value,l={...i,value:a};o=im(r,l,o);for(const e of n.getBackwardsRecursive(r)){const n=rm(e,t);if(!n)continue;const r=Xm(n.value)?og():n.value;o=im(e,{...n,value:r},o)}return o}(e.evaluatedData,r,i,t,n);return new rg(e.createFormulaParser,r,i,o)}function og(){return"TODO"}function ag(e){if(6!==e.length)return!1;for(let t=1;t<e.length;t++)if(!"0123456789ABCDEFabcdef".includes(e[t]))return!1;return!0}function lg(e){return Ag(e)||!e.editable?e:{...e,mode:"edit"}}const sg=e=>(e=>e&&!e.readOnly)(e)&&"file"!==e?.inputType?.type?{...e,value:"",style:e?.style}:e,cg=e=>{if(e)return{...e,value:(e.value||"")+"\n",style:e.style}};function dg(e){if(!e.active)return e;const t=e.selected.toRange(e.model.data),n=[];let r=e.model.data;for(const i of t||[]){const t=rm(i,e.model.data),o=sg(t);n.push({prevCell:t||null,nextCell:o||null}),r=im(i,o,r)}return{...e,model:new rg(Jm,r),...pg(n)}}function ug(e){if(!e.active)return e;const t=e.selected.toRange(e.model.data),n=[];let r=e.model.data;for(const i of t||[]){const t=rm(i,e.model.data),o=cg(t);n.push({prevCell:t||null,nextCell:o||null}),r=im(i,o,r)}return{...e,mode:"edit",model:new rg(Jm,r),...pg(n)}}function fg(e){return{...e,active:null,copied:null,formattedStyle:{open:!1,style:void 0},selected:new vm}}function hg(e){return{...e,mode:"view"}}function pg(e){return{lastCommit:e}}const Cg=(e,t)=>n=>{if(!n.active)return;const r=um(n.model.data),i=n.active.column+t>=r.columns,o={row:n.active.row+e+(i?1:0),column:(n.active.column+t)%r.columns};return dm(o,n.model.data)?{...n,active:o,selected:new ym(new Cm(o,o)),mode:"view"}:{...n,mode:"view"}},mg={ArrowUp:Cg(-1,0),ArrowDown:Cg(1,0),ArrowLeft:Cg(0,-1),ArrowRight:Cg(0,1),Tab:Cg(0,1),Enter:lg,Backspace:function(e){if(!e.active)return e;if("view"===e.mode){return dg(e)}{const t=[];let n=e.model.data;const r=rm(e.active,e.model.data),i=sg(r);return t.push({prevCell:r||null,nextCell:i||null}),n=im(e.active,i,n),{...e,mode:"edit",model:new rg(Jm,n),...pg(t)}}},Delete:dg,Escape:fg},gg={Escape:hg,Tab:mg.Tab,Enter:mg.ArrowDown,Delete:dg},vg={Tab:Cg(0,-1)};var yg;!function(e){e.Left="Left",e.Right="Right",e.Top="Top",e.Bottom="Bottom"}(yg||(yg={}));const wg={ArrowUp:e=>({...e,selected:xg(e.selected,e.active,e.model.data,yg.Top)}),ArrowDown:e=>({...e,selected:xg(e.selected,e.active,e.model.data,yg.Bottom)}),ArrowLeft:e=>({...e,selected:xg(e.selected,e.active,e.model.data,yg.Left)}),ArrowRight:e=>({...e,selected:xg(e.selected,e.active,e.model.data,yg.Right)}),Tab:Cg(0,-1)},bg={},Eg={};function Mg(e,t){const{key:n}=t;let r;if("edit"===e.mode)if(t.shiftKey&&"Enter"===n)r=mg;else{if(t.altKey&&"Enter"===n)return ug;r=t.shiftKey?vg:gg}else r=t.shiftKey&&t.metaKey?bg:t.shiftKey?wg:t.metaKey?Eg:mg;return r[n]}function Ag(e){const t=function(e){const t=e.active&&rm(e.active,e.model.data);return t||null}(e);return Boolean(t?.readOnly)}function xg(e,t,n,r){if(!t)return e;if(e instanceof ym){const i=function(e,t,n,r){const i=r===yg.Left||r===yg.Right?"column":"row",o=r===yg.Left||r===yg.Top?"start":"end",a="start"===o?-1:1,l=e.range.has({...t,[i]:t[i]+-1*a}),s=l?"start"===o?"end":"start":o,c=new Cm(e.range.start,e.range.end);c[s][i]+=a;const d=new ym(c).normalizeTo(n);return d}(e,t,n,r);return i}return e instanceof Am?function(e,t,n,r){if(r===yg.Top||r===yg.Bottom)return e;const i=r===yg.Left?-1:1,o=r===yg.Left?"start":"end",a="start"===o?"end":"start",l={...e};(r===yg.Left?e.end>t.row:e.start<t.row)?l[a]=e[a]+i:l[o]=e[o]+i;return new Am(Math.max(l.start,0),Math.max(l.end,0)).normalizeTo(n)}(e,t,n,r):e instanceof Mm?function(e,t,n,r){if(r===yg.Left||r===yg.Right)return e;const i=r===yg.Top?-1:1,o=r===yg.Top?"start":"end",a="start"===o?"end":"start",l={...e};(r===yg.Top?e.end>t.row:e.start<t.row)?l[a]=e[a]+i:l[o]=e[o]+i;return new Mm(Math.max(l.start,0),Math.max(l.end,0)).normalizeTo(n)}(e,t,n,r):e}const Lg=(e,t={},n)=>{const{selectedRow:r,selectedColumn:i,model:o,columnDimensions:a}=e,{column:l,columnWidth:s=100}=t,c=l??i;if(K(c))return e;const d="LEFT"===n?c:c+1,u=o.data.map(e=>{const t=[...e],n=e[c];return t.splice(d,0,(e=>{if("object"!=typeof e||null===e)return e;const{contextDisable:t,...n}=e;return{...n,value:"",readOnly:!1,style:{...e.style,borderBottom:"",borderLeft:"",borderRight:"",borderTop:""}}})(n)),t}),f=new rg(o.createFormulaParser,u),h=r??0;return{...e,model:f,selectedRow:h,selectedColumn:d,active:{row:h,column:d},selected:new Am(d,d),columnDimensions:zm(a,d,s)}},kg=(e,t={},n)=>{const{selectedRow:r,selectedColumn:i,model:o,rowDimensions:a}=e,{row:l}=t,s=l??r;if(K(s))return e;const c="TOP"===n?s:s+1,d=[...o.data],u=((e,t)=>e?e?.map(e=>"object"==typeof e&&null!==e?{...e,value:"",readOnly:!1,contextDisable:void 0,style:{...e.style,borderBottom:"",borderLeft:"",borderRight:"",borderTop:""}}:e):Array(t||0).fill(Wm))(o.data[s]||[],d[0]?.length);d.splice(c,0,u??[]);const f=new rg(o.createFormulaParser,d),h=i??0;return{...e,model:f,selectedRow:c,selectedColumn:h,active:{row:c,column:h},selected:new Mm(c,c),rowDimensions:Nm(a,c,32)}},Hg={active:null,mode:"view",rowDimensions:{},columnDimensions:{},lastChanged:null,hasPasted:!1,cut:!1,autoFill:{open:!1,cellValue:{value:"",style:{}}},dragging:!1,model:new rg(Jm,[]),selected:new vm,copied:null,lastCommit:null,selectedColumn:null,selectedRow:null,formattedStyle:{open:!1,style:void 0},editable:!1,ctrl:!0};function Sg(e,t){switch(t.type){case wC:{const{minimumColumnWidth:n}=t.payload,r={...e.columnDimensions};return Object.keys(r).forEach(e=>{const t=parseInt(e);(r[t]?.width||0)!==n&&(r[t]={left:r[t]?.left||0,width:n})}),{...e,columnDimensions:r}}case bC:{const{editable:n}=t.payload;return{...e,editable:n}}case yC:{const{autofill:n}=t.payload,r=e.active;let i=Wm;return r&&(i=rm({row:r.row,column:r.column},e.model.data)||i),{...e,autoFill:{open:n,cellValue:i}}}case uC:return kg(e,t,"TOP");case fC:return kg(e,t,"BOTTOM");case hC:return Lg(e,t,"LEFT");case pC:return Lg(e,t,"RIGHT");case CC:{let{selectedRow:n,selectedColumn:r,model:i,rowDimensions:o,copied:a}=e;const{row:l}=t;if(K(n))return e;const s=l??n;let c=[...i.data];c.splice(s,1);const d=new rg(i.createFormulaParser,c);let u=s>0?s-1:0;const f=null!==r?r:0,h=c.length>0?{row:u,column:f}:null,p=c.length>0?new Mm(u,u):new vm;let C=a;return a&&a.start.row<=s&&a.end.row>=s&&(C=null),{...e,model:d,selectedRow:u,selectedColumn:f,selected:p,active:h,copied:C,rowDimensions:Tm(o,s)}}case mC:{const{selectedRow:n,selectedColumn:r,model:i,columnDimensions:o,copied:a}=e,{column:l}=t;if(K(l??r))return e;const s=l??r,c=i.data.map(e=>e.filter((e,t)=>t!==s)),d=new rg(i.createFormulaParser,c),u=null!==n?n:0,f=s>0?s-1:0,h=c.length>0?{row:u,column:f}:null,p=c.length>0?new Am(f,f):new vm;let C=a;return a&&a.start.column<=s&&a.end.column>=s&&(C=null),{...e,model:d,selectedRow:u,selectedColumn:f,selected:p,active:h,copied:C,columnDimensions:Im(o,s)}}case tC:{const t=e.selected.toRange(e.model.data),n=function(e,t,n){if(!t)return e;const{start:r,end:i}=t;let o=e,a=!1;for(let e=r.row;e<=i.row;e++){for(let t=r.column;t<=i.column;t++){const r=rm({row:e,column:t},o);if(r&&n&&!r.readOnly&&"bold"===r.style?.fontWeight){a=!0;break}}if(a)break}for(let e=r.row;e<=i.row;e++)for(let t=r.column;t<=i.column;t++){const r=rm({row:e,column:t},o);r&&n&&(r.readOnly||(o=im({row:e,column:t},{...r,style:{...r.style,fontWeight:a?"normal":"bold"}},o)))}return o}(e.model.data,t,e.editable);return{...e,model:new rg(e.model.createFormulaParser,n)}}case nC:{const t=e.selected.toRange(e.model.data),n=function(e,t,n){if(!t)return e;const{start:r,end:i}=t;let o=e,a=!1;for(let e=r.row;e<=i.row;e++){for(let t=r.column;t<=i.column;t++){const r=rm({row:e,column:t},o);if(r&&n&&!r.readOnly&&"italic"===r.style?.fontStyle){a=!0;break}}if(a)break}for(let e=r.row;e<=i.row;e++)for(let t=r.column;t<=i.column;t++){const r=rm({row:e,column:t},o);r&&n&&(r.readOnly||(o=im({row:e,column:t},{...r,style:{...r.style,fontStyle:a?"normal":"italic"}},o)))}return o}(e.model.data,t,e.editable);return{...e,model:new rg(e.model.createFormulaParser,n)}}case lC:{const{value:n,color:r}=t.payload,i=e.selected.toRange(e.model.data),o=function(e,t,n,r,i){if(!t)return e;let o=e;const{start:a,end:l}=t,s=(e,t)=>rm({row:e,column:t},o),c=(e,t,n)=>{o=im({row:e,column:t},n,o)};for(let e=a.row;e<=l.row;e++)for(let t=a.column;t<=l.column;t++){const o=s(e,t);if(!o||!i||o.readOnly)continue;const a={...o,style:{...o.style}},l=s(e-1,t),d=s(e+1,t),u=s(e,t-1),f=s(e,t+1),h=`2px solid ${r}`,p="1px solid var(--excel-header-border)",C=e=>{switch(e){case"borderTop":l&&l.style?.borderBottom===h?a.style.borderTop="none":a.style.borderTop=h;break;case"borderBottom":d&&d.style?.borderTop===h?a.style.borderBottom="none":a.style.borderBottom=h;break;case"borderLeft":u&&u.style?.borderRight===h?a.style.borderLeft="none":a.style.borderLeft=h;break;case"borderRight":f&&f.style?.borderLeft===h?a.style.borderRight="none":a.style.borderRight=h}};switch(n){case"border-all-sides":C("borderTop"),C("borderBottom"),C("borderLeft"),C("borderRight");break;case"border-none":if(a.style={...a.style,borderRight:p,borderLeft:p,borderTop:p,borderBottom:p},l){const n={...l,style:{...l.style}};"none"===n.style.borderBottom&&(n.style.borderBottom=h,c(e-1,t,n))}if(d){const n={...d,style:{...d.style}};"none"===n.style.borderTop&&(n.style.borderTop=h,c(e+1,t,n))}if(u){const n={...u,style:{...u.style}};"none"===n.style.borderRight&&(n.style.borderRight=h,c(e,t-1,n))}if(f){const n={...f,style:{...f.style}};"none"===n.style.borderLeft&&(n.style.borderLeft=h,c(e,t+1,n))}break;case"border-right":C("borderRight");break;case"border-left":C("borderLeft");break;case"border-top":C("borderTop");break;case"border-bottom":C("borderBottom")}c(e,t,a)}return o}(e.model.data,i,n,r,e.editable);return{...e,model:new rg(e.model.createFormulaParser,o)}}case rC:{const t=e.selected.toRange(e.model.data),n=function(e,t,n){if(!t)return e;const{start:r,end:i}=t;let o=e,a=!1;for(let e=r.row;e<=i.row;e++){for(let t=r.column;t<=i.column;t++){const r=rm({row:e,column:t},o);if(r&&n&&!r.readOnly&&"underline"===r.style?.textDecoration){a=!0;break}}if(a)break}for(let e=r.row;e<=i.row;e++)for(let t=r.column;t<=i.column;t++){const r=rm({row:e,column:t},o);r&&n&&(r.readOnly||(o=im({row:e,column:t},{...r,style:{...r.style,textDecoration:a?"none":"underline"}},o)))}return o}(e.model.data,t,e.editable);return{...e,model:new rg(e.model.createFormulaParser,n)}}case oC:{const{value:n}=t.payload,r=e.selected.toRange(e.model.data),i=function(e,t,n,r){if(!t)return e;const i=Number(n);if(isNaN(i))return e;const o=Um(i),{start:a,end:l}=t;let s=e;for(let e=a.row;e<=l.row;e++)for(let t=a.column;t<=l.column;t++){const n=rm({row:e,column:t},s);n&&r&&(n.readOnly||(s=im({row:e,column:t},{...n,style:{...n.style,fontSize:o}},s)))}return s}(e.model.data,r,n,e.editable),o=new rg(e.model.createFormulaParser,i);let a={...e.rowDimensions};if(("edit"!==e.mode||!e.active)&&r)for(let e=r?.start?.row??0;e<=r?.end?.row;e++){const t=i[e];if(!t)continue;let n=32;t.forEach((e,t)=>{if(e&&e.value){const t=e.style?.fontSize?parseInt(e.style.fontSize.toString().replace("px","")):9,r=Math.max(1.2*t,18);let i=0;["file","dropDown"].includes(e?.inputType?.type??"")||(i=String(e.value).split(" ").length),i+=String(e.value).split("\n").length-1;const o=r*i;n=Math.max(n,o)}}),a[e]={...a[e]||{top:0,height:32},height:n}}return{...e,model:o,rowDimensions:a}}case iC:{const{value:n}=t.payload,r=e.selected.toRange(e.model.data),i=function(e,t,n,r){if(!t)return e;const{start:i,end:o}=t;let a=e;for(let e=i.row;e<=o.row;e++)for(let t=i.column;t<=o.column;t++){const i=rm({row:e,column:t},a);i&&r&&(i.readOnly||(a=im({row:e,column:t},{...i,style:{...i.style,fontFamily:n}},a)))}return a}(e.model.data,r,n,e.editable);return{...e,model:new rg(e.model.createFormulaParser,i)}}case aC:{const{value:n}=t.payload,r=e.selected.toRange(e.model.data),i=function(e,t,n,r){if(!t)return e;const{start:i,end:o}=t;let a=e;for(let e=i.row;e<=o.row;e++)for(let t=i.column;t<=o.column;t++){const i=rm({row:e,column:t},a);i&&r&&(i.readOnly||(a=im({row:e,column:t},{...i,style:{...i.style,textAlign:n}},a)))}return a}(e.model.data,r,n,e.editable);return{...e,model:new rg(e.model.createFormulaParser,i)}}case sC:{const{value:n}=t.payload,r=e.selected.toRange(e.model.data),i=function(e,t,n,r){if(!t)return e;const{start:i,end:o}=t;let a=e;const l=ag(n)?`#${n}`:n;for(let e=i.row;e<=o.row;e++)for(let t=i.column;t<=o.column;t++){const n=rm({row:e,column:t},a);n&&r&&(n.readOnly||(a=im({row:e,column:t},{...n,style:{...n.style,color:l}},a)))}return a}(e.model.data,r,n,e.editable);return{...e,model:new rg(e.model.createFormulaParser,i)}}case cC:{const{value:n}=t.payload,r=e.selected.toRange(e.model.data),i=function(e,t,n,r){if(!t)return e;if(t){const{start:i,end:o}=t;let a=e;const l=ag(n)?`#${n}`:n;for(let e=i.row;e<=o.row;e++)for(let t=i.column;t<=o.column;t++){const n=rm({row:e,column:t},a);n&&r&&(n.readOnly||(a=im({row:e,column:t},{...n,style:{...n.style,backgroundColor:l}},a)))}return a}return e}(e.model.data,r,n,e.editable);return{...e,model:new rg(e.model.createFormulaParser,i)}}case dC:{if(!e.editable)return e;const t=function(e,t){if(!t)return;const{row:n,column:r}=t,i=rm({row:n,column:r},{...e});return i&&i.style?i.style:void 0}(e.model.data,e.active),n=e.selected.toRange(e.model.data);return e.formattedStyle.open?{...e,selected:new vm,active:e.copied?.start||null,copied:null,formattedStyle:{open:!1,style:void 0}}:{...e,selected:new vm,active:null,copied:n,formattedStyle:{open:!0,style:t}}}case Np:{const{data:n}=t.payload,r=e.active&&dm(e.active,n)?e.active:null,i=e.selected.normalizeTo(n);return{...e,model:new rg(e.model.createFormulaParser,n),active:r,selected:i}}case Tp:{const{createFormulaParser:n}=t.payload;return{...e,model:new rg(n,e.model.data)}}case Ip:{const{row:n,extend:r}=t.payload,{active:i}=e,o=new Mm(r&&i?i.row:n,n),a=r&&i?i:{...mm,row:n};return{...e,selected:o,active:a,mode:"view",selectedColumn:null,selectedRow:n}}case Dp:{const{column:n,extend:r}=t.payload,{active:i}=e,o=new Am(r&&i?i.column:n,n),a=r&&i?i:{...mm,column:n};return{...e,selected:o,active:a,mode:"view",selectedColumn:n,selectedRow:null}}case Zp:return{...e,selected:new bm,active:mm,mode:"view"};case jp:{const{selection:n}=t.payload,r=n.toRange(e.model.data),i=e.active&&n.has(e.model.data,e.active)?e.active:r?.start;return{...e,selected:n,active:i||null,mode:"view"}}case Rp:{const{point:n}=t.payload;return e.active&&!_m(e.active,n)?{...e,selected:new ym(new Cm(n,e.active)),mode:"view"}:e}case Bp:{const{point:n}=t.payload;return{...e,selected:new ym(new Cm(n,n)),active:n,mode:_m(e.active,n)&&e.editable?"edit":"view"}}case Pp:{const{active:n,data:r}=t.payload;return Ag(e)||!e.editable?e:{...e,model:ig(e.model,n,r),lastChanged:n}}case Fp:{const{point:n,dimensions:r}=t.payload,i=e.rowDimensions[n.row],o=e.columnDimensions[n.column];return i&&o&&i.top===r.top&&i.height===r.height&&o.left===r.left&&o.width===r.width?e:{...e,rowDimensions:{...e.rowDimensions,[n.row]:{top:r.top,height:r.height}},columnDimensions:{...e.columnDimensions,[n.column]:{left:r.left,width:r.width}}}}case Up:case qp:{const n=e.selected.toRange(e.model.data);return{...e,copied:n,cut:t.type===qp,hasPasted:!1}}case Wp:{const{data:n}=t.payload,{active:r}=e;if(!r||!e.editable)return e;const i=function(e,t,n="\t",r=/\r\n|\n|\r/){return e.replace(/"([^"]*?)"/g,(e,t)=>t.replace(/\n/g,"\\n")).split(r).map(e=>e.split(n).map(e=>e.replace(/\\n/g,"\n")).map(t))}(n,e=>({value:e})),o=um(i),a=e.selected.toRange(e.model.data);let l=null;e.cut&&e.copied&&(l=new Cm(r,{row:r.row+o.rows-1,column:r.column+o.columns-1}));const s=e=>!!l&&(e.row>=l.start.row&&e.row<=l.end.row&&e.column>=l.start.column&&e.column<=l.end.column);if(a&&1===o.rows&&1===o.columns){const t=rm({row:0,column:0},i);let n=e.model.data;if(e.cut&&e.copied)for(const t of e.copied)s(t)||(n=sm(t,n));const r=[];for(const i of a||[]){const o=rm(i,e.model.data)||null,a={...o,value:t?.value};r.push({prevCell:o||Wm,nextCell:Wm}),Gm(o)&&(n=im(i,a,n))}return{...e,model:new rg(Jm,n),copied:null,cut:!1,hasPasted:!0,mode:"view",lastCommit:r}}const c={rows:r.row+o.rows,columns:r.column+o.columns},d=function(e,t){const{rows:n,columns:r}=um(e);if(n>=t.rows&&r>=t.columns)return e;const i={rows:t.rows>n?t.rows:n,columns:t.columns>r?t.columns:r};let o=[...e];if(i.columns>r){const e=i.columns-r;o=o.map(t=>[...t,...Array(e).fill(am)])}if(i.rows>n){const e=i.rows-n,t=Array(i.columns).fill(am);o=[...o,...Array(e).fill(t)]}return o}(e.model.data,c);let u={data:d,commit:[]};for(const[t,n]of cm(i)){let i=u.commit||[];const o={row:t.row+r.row,column:t.column+r.column};let a=u.data;if(e.cut&&e.copied){const r={row:t.row+e.copied.start.row,column:t.column+e.copied.start.column};s(r)||(a=sm(r,u.data)),i=[...i,{prevCell:n||null,nextCell:null}]}dm(o,d)||(u={data:a,commit:i});const l=rm(o,a)||null;i=[...i,{prevCell:l,nextCell:n||null}],Gm(l)&&(u.data=im(o,{...l,value:n?.value??""},a),u.commit=i)}return{...e,model:new rg(Jm,u.data),selected:new ym(new Cm(r,{row:r.row+o.rows-1,column:r.column+o.columns-1})),copied:null,cut:!1,hasPasted:!0,mode:"view",lastCommit:u.commit}}case Qp:return lg(e);case Kp:return hg(e);case"CLEAR":return dg(e);case Gp:return fg(e);case Yp:{const{event:n}=t.payload;if(Ag(e)||n.metaKey||!e.editable)return e;if("view"===e.mode&&e.active){const t=e.selected.toRange(e.model.data);return 1===t?.size()?lg(dg(e)):lg(e)}return e}case Xp:{const{event:n}=t.payload;if(n.ctrlKey)return{...e,ctrl:!e.ctrl};if(Ag(e)||n.metaKey||!e.editable)return e;const r=Mg(e,n);return r?{...e,...r(e,n)}:e}case gC:{const{row:n,height:r}=t.payload,i=e.rowDimensions[n]||{top:0};return{...e,rowDimensions:{...e.rowDimensions,[n]:{top:i.top,height:r}}}}case vC:{const{column:n,width:r}=t.payload,i=e.columnDimensions[n]||{left:0};return{...e,columnDimensions:{...e.columnDimensions,[n]:{left:i.left,width:r}}}}case Jp:return{...e,dragging:!0};case EC:{const{point:n}=t.payload;let r=e.model.data;return!e.dragging&&e.formattedStyle.open&&(r=function(e,t,n){if(!n||!t.open)return e;let r=e;const i=rm(n,r);i&&!i.readOnly&&(r=im(n,{...i,style:t.style},r));return r}(e.model.data,e.formattedStyle,e.active)),{...e,copied:null,model:new rg(e.model.createFormulaParser,r),formattedStyle:{open:!1,style:void 0},active:n}}case $p:{const t=e.selected.toRange(e.model.data),n=e.active;let r=e.model.data;if(e.formattedStyle.open&&(r=function(e,t,n){if(!t||!n.open)return e;const{start:r,end:i}=t;let o=e;for(let e=r.row;e<=i.row;e++)for(let t=r.column;t<=i.column;t++){const r=rm({row:e,column:t},o);r&&(r.readOnly||(o=im({row:e,column:t},{...r,style:n.style},o)))}return o}(e.model.data,t,e.formattedStyle)),e.autoFill.open&&e.editable&&t){r=function(e,t,n,r,i){if(!t)return e;const{start:o,end:a}=t,l=o.row-a.row,s=o.column-a.column;let c={row:0,column:0},d={row:0,column:0};Math.abs(l)>Math.abs(s)?(c={row:Math.min(o.row,a.row),column:r?.column??o.column},d={row:Math.max(o.row,a.row),column:r?.column??o.column}):(c={row:r?.row??o.row,column:Math.min(o.column,a.column)},d={row:r?.row??o.row,column:Math.max(o.column,a.column)});let u=e;const f=String(n.value??""),h=[...f.matchAll(/(-?\d+)/g)],p=["dropDown"].includes(n?.inputType?.type||"");for(let e=c.row;e<=d.row;e++)for(let t=c.column;t<=d.column;t++){const o=rm({row:e,column:t},u);if(!o||o.readOnly)continue;const a=["file","dropDown"].includes(o?.inputType?.type||""),d=["file"].includes(o?.inputType?.type||"");if(!p&&a)continue;if(p&&d)continue;let C=f;if(!i&&h.length>0){let n=0;n=Math.abs(l)>Math.abs(s)?e-(r?.row??c.row):t-(r?.column??c.column);let i=0;C=C.replace(/(-?\d+)/g,()=>{const e=h[i++];return e?(parseInt(e?.[1]??"",10)+n).toString():""})}u=im({row:e,column:t},{...o,style:n.style,value:C,inputType:n.inputType},u)}return u}(e.model.data,t,e.autoFill.cellValue,n,e.ctrl);let{start:i,end:o}=t;const a=i.row-o.row,l=i.column-o.column;let s={row:0,column:0},c={row:0,column:0};return Math.abs(a)>Math.abs(l)?(s={row:Math.min(i.row,o.row),column:n?.column??0},c={row:Math.max(i.row,o.row),column:n?.column??0}):(s={row:n?.row??0,column:Math.min(i.column,o.column)},c={row:n?.row??0,column:Math.max(i.column,o.column)}),{...e,dragging:!1,autoFill:{open:!1,cellValue:{value:"",style:{}}},formattedStyle:{open:!1,style:void 0},model:new rg(e.model.createFormulaParser,r),selected:new ym(new Cm(s,c))}}return{...e,dragging:!1,autoFill:{open:!1,cellValue:{value:"",style:{}}},formattedStyle:{open:!1,style:void 0},model:new rg(e.model.createFormulaParser,r)}}case eC:{const{changes:n}=t.payload;return{...e,...pg(n)}}default:throw new Error("Unknown action")}}var _g,Vg={exports:{}},Og={};var zg,Ng,Tg={};
20
20
  /**
21
21
  * @license React
22
22
  * scheduler.development.js