pixel-react 1.21.6 → 1.21.7

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
@@ -25,7 +25,7 @@ object-assign
25
25
  *
26
26
  * This source code is licensed under the MIT license found in the
27
27
  * LICENSE file in the root directory of this source tree.
28
- */function cy(){return ay||(ay=1,e=sy,"production"!==process.env.NODE_ENV&&function(){function t(e,t){var n=e.length;e.push(t),function(e,t,n){for(var r=n;r>0;){var o=r-1>>>1,a=e[o];if(!(i(a,t)>0))return;e[o]=t,e[r]=a,r=o}}(e,t,n)}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();return n!==t&&(e[0]=n,function(e,t,n){for(var r=n,o=e.length,a=o>>>1;r<a;){var l=2*(r+1)-1,s=e[l],c=l+1,d=e[c];if(i(s,t)<0)c<o&&i(d,s)<0?(e[r]=d,e[c]=t,r=c):(e[r]=s,e[l]=t,r=l);else{if(!(c<o&&i(d,t)<0))return;e[r]=d,e[c]=t,r=c}}}(e,n,0)),t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error),"object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var s=[],c=[],d=1,u=null,f=3,h=!1,C=!1,p=!1,m="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function A(e){for(var i=n(c);null!==i;){if(null===i.callback)r(c);else{if(!(i.startTime<=e))return;r(c),i.sortIndex=i.expirationTime,t(s,i)}i=n(c)}}function y(e){if(p=!1,A(e),!C)if(null!==n(s))C=!0,O(w);else{var t=n(c);null!==t&&N(y,t.startTime-e)}}function w(t,i){C=!1,p&&(p=!1,D()),h=!0;var o=f;try{return function(t,i){var o=i;for(A(o),u=n(s);null!==u&&(!(u.expirationTime>o)||t&&!H());){var a=u.callback;if("function"==typeof a){u.callback=null,f=u.priorityLevel;var l=a(u.expirationTime<=o);o=e.unstable_now(),"function"==typeof l?u.callback=l:u===n(s)&&r(s),A(o)}else r(s);u=n(s)}if(null!==u)return!0;var d=n(c);return null!==d&&N(y,d.startTime-o),!1}(t,i)}finally{u=null,f=o,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var b=!1,E=null,M=-1,x=5,L=-1;function H(){return!(e.unstable_now()-L<x)}var k,V=function(){if(null!==E){var t=e.unstable_now();L=t;var n=!0;try{n=E(!0,t)}finally{n?k():(b=!1,E=null)}}else b=!1};if("function"==typeof v)k=function(){v(V)};else if("undefined"!=typeof MessageChannel){var S=new MessageChannel,z=S.port2;S.port1.onmessage=V,k=function(){z.postMessage(null)}}else k=function(){m(V,0)};function O(e){E=e,b||(b=!0,k())}function N(t,n){M=m(function(){t(e.unstable_now())},n)}function D(){g(M),M=-1}var T=function(){};e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){C||h||(C=!0,O(w))},e.unstable_forceFrameRate=function(e){e<0||e>125?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):x=e>0?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(e){var t;switch(f){case 1:case 2:case 3:t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=T,e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,o){var a,l,u=e.unstable_now();if("object"==typeof o&&null!==o){var f=o.delay;a="number"==typeof f&&f>0?u+f:u}else a=u;switch(r){case 1:l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}var m=a+l,g={id:d++,callback:i,priorityLevel:r,startTime:a,expirationTime:m,sortIndex:-1};return a>u?(g.sortIndex=a,t(c,g),null===n(s)&&g===n(c)&&(p?D():p=!0,N(y,a-u))):(g.sortIndex=m,t(s,g),C||h||(C=!0,O(w))),g},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),sy;var e}var dy=(ly||(ly=1,"production"===process.env.NODE_ENV?iy.exports=(ry||(ry=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<i(o,t)))break e;e[r]=t,e[n]=o,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,a=o>>>1;r<a;){var l=2*(r+1)-1,s=e[l],c=l+1,d=e[c];if(0>i(s,n))c<o&&0>i(d,s)?(e[r]=d,e[c]=n,r=c):(e[r]=s,e[l]=n,r=l);else{if(!(c<o&&0>i(d,n)))break e;e[r]=d,e[c]=n,r=c}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var s=[],c=[],d=1,u=null,f=3,h=!1,C=!1,p=!1,m="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function A(e){for(var i=n(c);null!==i;){if(null===i.callback)r(c);else{if(!(i.startTime<=e))break;r(c),i.sortIndex=i.expirationTime,t(s,i)}i=n(c)}}function y(e){if(p=!1,A(e),!C)if(null!==n(s))C=!0,O(w);else{var t=n(c);null!==t&&N(y,t.startTime-e)}}function w(t,i){C=!1,p&&(p=!1,g(x),x=-1),h=!0;var o=f;try{for(A(i),u=n(s);null!==u&&(!(u.expirationTime>i)||t&&!k());){var a=u.callback;if("function"==typeof a){u.callback=null,f=u.priorityLevel;var l=a(u.expirationTime<=i);i=e.unstable_now(),"function"==typeof l?u.callback=l:u===n(s)&&r(s),A(i)}else r(s);u=n(s)}if(null!==u)var d=!0;else{var m=n(c);null!==m&&N(y,m.startTime-i),d=!1}return d}finally{u=null,f=o,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var b,E=!1,M=null,x=-1,L=5,H=-1;function k(){return!(e.unstable_now()-H<L)}function V(){if(null!==M){var t=e.unstable_now();H=t;var n=!0;try{n=M(!0,t)}finally{n?b():(E=!1,M=null)}}else E=!1}if("function"==typeof v)b=function(){v(V)};else if("undefined"!=typeof MessageChannel){var S=new MessageChannel,z=S.port2;S.port1.onmessage=V,b=function(){z.postMessage(null)}}else b=function(){m(V,0)};function O(e){M=e,E||(E=!0,b())}function N(t,n){x=m(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){C||h||(C=!0,O(w))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,o){var a=e.unstable_now();switch(o="object"==typeof o&&null!==o&&"number"==typeof(o=o.delay)&&0<o?a+o:a,r){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return r={id:d++,callback:i,priorityLevel:r,startTime:o,expirationTime:l=o+l,sortIndex:-1},o>a?(r.sortIndex=o,t(c,r),null===n(s)&&r===n(c)&&(p?(g(x),x=-1):p=!0,N(y,o-a))):(r.sortIndex=l,t(s,r),C||h||(C=!0,O(w))),r},e.unstable_shouldYield=k,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(oy)),oy):iy.exports=cy()),iy.exports);const uy=Symbol(),fy=Symbol(),hy="undefined"==typeof window||/ServerSideRendering/.test(window.navigator&&window.navigator.userAgent)?l:u,Cy=dy.unstable_runWithPriority?e=>{try{dy.unstable_runWithPriority(dy.unstable_NormalPriority,e)}catch(t){if("Not implemented."!==t.message)throw t;e()}}:e=>e();function py(e,t){const n=d(e)[uy];if("object"==typeof process&&"production"!==process.env.NODE_ENV&&!n)throw new Error("useContextSelector requires special context");const{v:{current:r},n:{current:i},l:o}=n,a=t(r),[l,s]=v((e,n)=>{if(!n)return[r,a];if("p"in n)throw n.p;if(n.n===i)return Object.is(e[1],a)?e:[r,a];try{if("v"in n){if(Object.is(e[0],n.v))return e;const r=t(n.v);return Object.is(e[1],r)?e:[n.v,r]}}catch(e){}return[...e]},[r,a]);return Object.is(l[1],a)||s(),hy(()=>(o.add(s),()=>{o.delete(s)}),[o]),l[1]}const my=function(e){const t=s({[uy]:{v:{current:e},n:{current:-1},l:new Set,u:e=>e()}});var n;return t[fy]=t.Provider,t.Provider=(n=t.Provider,({value:e,children:t})=>{const r=a(e),i=a(0),[o,l]=c(null);o&&(o(e),l(null));const s=a();if(!s.current){const e=new Set,t=(t,n)=>{i.current+=1;const r={n:i.current};(null==n?void 0:n.suspense)&&(r.n*=-1,r.p=new Promise(e=>{l(()=>t=>{r.v=t,delete r.p,e(t)})})),e.forEach(e=>e(r)),t()};s.current={[uy]:{v:r,n:i,l:e,u:t}}}return hy(()=>{r.current=e,i.current+=1,Cy(()=>{s.current[uy].l.forEach(t=>{t({n:i.current,v:e})})})},[e]),p(n,{value:s.current},t)}),delete t.Consumer,t}([ty,()=>{}]),gy=({children:t,useTableRef:n,totalWidth:r})=>{const i=a(null);return l(()=>{n&&i.current&&n(i)},[n]),e("table",{className:"ff-spreadsheet-table",ref:i,style:{minWidth:`${60+r}px`,tableLayout:"fixed"},children:t})},vy=t=>e("tr",{...t}),Ay=t=>e("tr",{className:"ff-spreadsheet-row-header",...t});function yy(){return py(my,([,e])=>e)}function wy(e){return py(my,([t])=>e(t))}const by=({selected:t,onSelect:n})=>{const i=r.useCallback(()=>{n()},[n]);return e("th",{className:"ff-spreadsheet-corner-header",onClick:i,tabIndex:0,children:e("div",{className:D("corner-header",{"ff-spreadsheet-header--selected":t}),children:e(F,{variant:t?"dark":"light",color:t?"var(--hover-color)":"var(--text-color)",name:"excel_corner_menu"})})})},Ey=t=>function(n){const i=yy(),o=r.useCallback(()=>i({type:dg}),[i]),a=wy(e=>e.selected instanceof Qv);return e(t,{...n,selected:a,onSelect:o})},My=t=>function(n){const i=yy(),o=r.useCallback((e,t)=>i(function(e,t){return{type:cg,payload:{column:e,extend:t}}}(e,t)),[i]),a=wy(e=>e.selected.hasEntireColumn(n.column)),l=wy(e=>e.selectedColumn??void 0),s=wy(e=>e.active?Sv(e.active,e.model.data):void 0);return e(t,{...n,cell:s,selected:a,selectedColumn:l,onSelect:o,scrollToColumn:n.scrollToColumn})},xy=My(({column:t,label:i,selected:o,onSelect:a,setContextMenu:l,deleteColumn:s,addColumnLeft:c,addColumnRight:d,columnContextEnable:u,cell:f,selectedColumn:C,minimumColumnWidth:p,maxColLimit:m,disableDeleteOption:g,contextMenu:v,onAddColumn:A,onDeleteColumn:y,setVisibleRange:w,scrollToColumn:b})=>{const E=yy(),M=wy(e=>e.model.data),x=wy(e=>e.columnDimensions[t]?.width??p),L=wy(e=>e.model.data),{columnCount:H}=EA(L),k=e=>{w(t=>{const n={...t,end:"increment"===e?t.end+1:t.end-1};return C&&b(C),n})},V=h(()=>[{label:"Add Column Left",value:"Add Column Left",iconName:"plus_icon",action:()=>{k("increment"),c(p),A?.(C??t,!0)},disableTooltip:"Column limit reached",visible:f?.contextDisable?.["Add Column Left"]??!1,disable:H>=m},{label:"Add Column Right",value:"Add Column Right",iconName:"plus_icon",action:()=>{k("increment"),d(p),A?.(C??t,!1)},disableTooltip:"Column limit reached",visible:f?.contextDisable?.["Add Column Right"]??!1,disable:H>=m},...g?[]:[{label:"Delete Column",value:"Delete Column",iconName:"delete",action:()=>{k("decrement"),s(),y?.(C??t)},disableTooltip:"",visible:f?.contextDisable?.["Delete Column"]??!1,disable:!1}]],[C,t,M]),S=r.useCallback((e,n)=>{const r=n?t-1:t,i=Math.max(r,0);a(i,e.shiftKey);const o=e.clientX,l=Number(x),s=e=>{const t=e.clientX-o,n=Math.max(p,l+t);E(function(e,t){return{type:qg,payload:{column:e,width:t}}}(i,n))},c=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",c),E(Lv())};document.addEventListener("mousemove",s),document.addEventListener("mouseup",c),E(xv())},[t,x]),z=r.useCallback(e=>E(yv(e)),[E]),O=r.useCallback(e=>{a(t,e.shiftKey)},[a,t]),N=r.useCallback(e=>{e.preventDefault(),a(t,e.shiftKey),l({open:u,contextType:"column",options:V})},[t,C,u,V]);return r.useEffect(()=>{void 0!==C&&"column"===v?.contextType&&l(e=>({open:e.open,contextType:"column",options:V}))},[t,C,u,V,"column"===v?.contextType]),n("th",{className:D("ff-spreadsheet-header",{"ff-spreadsheet-header--selected":o}),style:{width:`${x}px`,minWidth:"100px"},onClick:O,onContextMenu:N,tabIndex:0,children:[e(q,{fontWeight:"medium",children:i??Ly(t)}),e("div",{className:"drag-column-selector drag-column-left",onMouseDown:e=>S(e,!1),onDoubleClick:()=>E($g(t,x)),onClick:()=>z({row:-1,column:t})}),e("div",{className:"drag-column-selector drag-column-right",onMouseDown:e=>S(e,!0),onDoubleClick:()=>E($g(t,x)),onClick:()=>z({row:-1,column:t})})]},t)});function Ly(e){let t="",n=e;for(;n>=0;)t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26)-1;return t}const Hy=({row:t,label:i,selected:o,onSelect:a,setContextMenu:l,addRowTop:s,addRowBottom:c,deleteRow:d,rowContextEnable:u,selectedRow:f,cell:h,maxRowLimit:C,disableDeleteOption:p,contextMenu:m,setVisibleRange:g,scrollToRow:v})=>{const A=yy(),y=wy(e=>e.rowDimensions[t]?.height||32),w=wy(e=>e.model.data),{rowCount:b}=EA(w),E=e=>{g(t=>{const n={...t,end:"increment"===e?t.end+1:t.end-1};return f&&v(f),n})},M=r.useMemo(()=>[{label:"Add Row Top",value:"Add Row Top",iconName:"plus_icon",action:()=>{E("increment"),s()},disableTooltip:"Row limit reached",visible:h?.contextDisable?.["Add Row Top"]??!1,disable:b>=C},{label:"Add Row Bottom",value:"Add Row Bottom",iconName:"plus_icon",action:()=>{E("increment"),c()},disableTooltip:"Row limit reached",visible:h?.contextDisable?.["Add Row Bottom"]??!1,disable:b>=C},...p?[]:[{label:"Delete Row",value:"Delete Row",iconName:"delete",action:()=>{E("decrement"),d()},disableTooltip:"",visible:h?.contextDisable?.["Delete Row"]??!1,disable:!1}]],[f,t]),x=r.useCallback((e,n)=>{const r=n?t:t-1,i=Math.max(r,0);a(i,e.shiftKey);const o=e.clientY,l=y,s=e=>{const t=e.clientY-o,n=Math.max(32,l+t);A(Jg(i,n))},c=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",c),A(Lv())};document.addEventListener("mousemove",s),document.addEventListener("mouseup",c)},[y,t]),L=r.useCallback(e=>A(yv(e)),[A]),H=r.useCallback(e=>{a(t,e.shiftKey)},[t]),k=r.useCallback(e=>{e.preventDefault(),a(t,e.shiftKey),l({open:u,contextType:"row",options:M})},[t,u,M,f]);return r.useEffect(()=>{void 0!==f&&"row"===m?.contextType&&l(e=>({open:e.open,contextType:"row",options:M}))},[t,u,M,f,"row"===m?.contextType]),n("th",{className:D("ff-spreadsheet-header",{"ff-spreadsheet-header--selected":o}),style:{height:`${y}px`,minHeight:"32px"},onClick:H,onContextMenu:k,tabIndex:0,children:[e(q,{fontWeight:"medium",children:void 0!==i?i:t+1}),e("div",{className:"drag-row-selector drag-row-down",onMouseDown:e=>x(e,!0),onDoubleClick:()=>A(Jg(t,y)),onClick:()=>L({row:t,column:-1})}),e("div",{className:"drag-row-selector drag-row-up",onMouseDown:e=>x(e,!1),onDoubleClick:()=>A(Jg(t,y)),onClick:()=>L({row:t,column:-1})})]})},ky=t=>function(n){const i=yy(),o=wy(e=>e.selected.hasEntireRow(n.row)),a=wy(e=>e.active?Sv(e.active,e.model.data):void 0),l=wy(e=>e.selectedRow??void 0),s=r.useCallback((e,t)=>i(function(e,t){return{type:sg,payload:{row:e,extend:t}}}(e,t)),[i]);return e(t,{...n,selected:o,cell:a,selectedRow:l,onSelect:s,scrollToRow:n.scrollToRow})},Vy=r.memo(({row:t,column:n,DataViewer:i,active:o,dragging:a,mode:l,data:s,evaluatedData:c,select:d,activate:u,setCellDimensions:f,setCellData:h})=>{const C=r.useRef(null),p=r.useMemo(()=>({row:t,column:n}),[t,n]),m=r.useCallback(e=>{e.preventDefault(),window.getSelection()?.removeAllRanges(),"view"===l&&(f(p,iA(e.currentTarget)),e.shiftKey?d(p):u(p))},[l,f,p,d,u]),g=r.useCallback(e=>{a&&(f(p,iA(e.currentTarget)),d(p))},[f,d,a,p]);return r.useEffect(()=>{const e=C.current;if(!e)return;const t=()=>{a||f(p,iA(e))};t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[f,p,a]),s&&s.DataViewer&&(i=s.DataViewer),e("td",{ref:C,style:{...s?.style,..."dropDown"===s?.inputType?.type&&{fontSize:"12px"},textDecoration:"underline"===s?.style?.textDecoration?s?.style?.textDecoration:"none"},className:D("ff-spreadsheet-cell",s?.className,{"ff-spreadsheet-active-cell":o||a}),onMouseEnter:g,onMouseDown:m,tabIndex:0,children:e(i,{row:t,column:n,cell:s,active:o,evaluatedCell:c,setCellData:h,inputValue:()=>null})})}),Sy=t=>function(n){const{row:i,column:o}=n,a=yy(),l=r.useMemo(()=>({row:i,column:o}),[i,o]),s=r.useCallback(e=>a(wv(l,e)),[a,l]),c=r.useCallback(e=>a(function(e){return{type:fg,payload:{point:e}}}(e)),[a]),d=r.useCallback(e=>a(yv(e)),[a]),u=r.useCallback((e,t)=>a(bv(e,t)),[a]),f=wy(e=>rA(e.active,l)),h=wy(e=>f?e.mode:"view"),C=wy(e=>Sv(l,e.model.data)),p=wy(e=>Sv(l,e.model.evaluatedData)),m=wy(e=>e.dragging),g=wy(e=>e.copied?.has(l)||!1);return e(t,{...n,active:f,copied:g,dragging:m,mode:h,evaluatedData:p,data:C,select:c,activate:d,setCellDimensions:u,setCellData:s})},zy=({cell:r,evaluatedCell:i,active:o})=>{const a=function(e,t){const n=t?.value??e?.value;if(n&&"object"==typeof n)return n.toString();return n}(r,i);return e("span","boolean"==typeof a?{className:"ff-spreadsheet-data-viewer ff-spreadsheet-data-viewer--boolean",children:Oy(a)}:{className:D("ff-spreadsheet-data-viewer",{"ff-spreadsheet-data-viewer--preserve-breaks":mA(a)}),children:o||"dropDown"!==r?.inputType?.type?o||"file"!==r?.inputType?.type?!o&&a:e(t,{children:G(r?.value)?n("div",{className:"ff-spreadsheet-data-viewer--without-fileType",children:[e(F,{name:"attachment_icon"})," Attachment"]}):(n=>{if(G(n))return e(t,{});return JSON.parse(n).map(t=>e("div",{className:"ff-spreadsheet-data-viewer--fileType",children:e(Si,{width:r?.style?.width??100,title:t?.name?.split("*")?.[0]??""})},t.name))})(a)}):n("div",{className:"ff-spreadsheet-data-viewer--dropdownType",children:[a,e(F,{name:"arrow_down",height:8,className:"dropdownType-icon"})]})})};function Oy(e){return e?"TRUE":"FALSE"}const Ny=i.forwardRef(({initialValue:t="",onChange:n,className:r="",style:o={}},s)=>{const c=a(null);i.useImperativeHandle(s,()=>c.current),l(()=>{if(c.current&&document.activeElement!==c.current){const e=String(t)?.endsWith("\n")?`${t}\n`:t;e!==c.current.innerText&&(c.current.innerText=e)}},[t]);return e("div",{style:o,children:e("div",{ref:c,className:`editable-cell ${r}`,contentEditable:!0,suppressContentEditableWarning:!0,onKeyDown:e=>{if("Enter"===e.key){if(e.altKey||e.shiftKey)return e.preventDefault(),void document.execCommand("insertLineBreak");c.current?.blur()}"Delete"!==e.key&&"Backspace"!==e.key||e.stopPropagation()},onInput:()=>{if(c.current){let e=c.current.innerText;e.endsWith("\n")&&(e=e.slice(0,-1)),n?.(e)}},onPaste:e=>{e.preventDefault();const t=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,t)},spellCheck:!1,autoCorrect:"off",autoCapitalize:"off",style:{outline:"none",transition:"border 0.2s",whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:"inherit",fontSize:"inherit",lineHeight:"normal",minHeight:"24px",verticalAlign:"middle",caretColor:"black",height:"inherit",maxHeight:"inherit",display:"block",position:"relative",paddingBottom:"2px"}})})}),Dy=({onChange:t,cell:n})=>{const i=r.useRef(null),o=r.useCallback(e=>{const{contextDisable:r,...i}=n;t({...i,value:e,inputType:i.inputType??{type:"text"}})},[t,n]);r.useEffect(()=>{i.current&&function(e){if(e)if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)e.selectionStart=e.selectionEnd=e.value.length;else if(e.isContentEditable){const t=document.createRange(),n=window.getSelection();t.selectNodeContents(e),t.collapse(!1),n?.removeAllRanges(),n?.addRange(t)}}(i.current)},[]);return e("div",{className:"ff-spreadsheet-data-editor",children:e(Ny,{ref:i,initialValue:n?.value??"",onChange:o,className:"ff-spreadsheet-cell-textarea",style:{...n?.style,width:"100%",height:"100%",borderTop:"",borderBottom:"",borderLeft:"",borderRight:""}})})},Ty=t=>{const i=r.useRef(null),o=r.useRef(null),a=yy(),l=r.useCallback((e,t)=>a(wv(e,t)),[a]),s=r.useCallback(e=>a(yv(e)),[a]),c=r.useCallback(()=>a({type:Ag}),[a]),d=r.useCallback(e=>a({type:Wg,payload:{autofill:e}}),[a]),u=r.useCallback(e=>a(function(e){return{type:Lg,payload:{changes:e}}}(e)),[a]),f=r.useCallback(()=>{a({type:yg})},[a]),h=wy(e=>e.rowDimensions),C=wy(e=>e.active),p=wy(e=>e.mode),m=wy(e=>e.active?Sv(e.active,e.model.data):void 0),g=wy(e=>e.selected),v=wy(e=>g&&fA(e.rowDimensions,e.columnDimensions,e.model.data,e.selected)),A=wy(e=>{let t=C?dA(C,e.rowDimensions,e.columnDimensions):void 0;return t={top:t?.top?t?.top:0,height:t?.height?t?.height:0,left:t?.left?t?.left:0,width:t?.width?t?.width:0},t}),y=r.useMemo(()=>!C||!A||C.row<t.visibleRowRange.start||C.row>=t.visibleRowRange.end||C.column<t.visibleColRange.start||C.column>=t.visibleColRange.end,[C,A,t.visibleRowRange,t.visibleColRange]),w=r.useRef(void 0),b=r.useRef(null),E=r.useRef(void 0),M=r.useCallback(e=>{C&&l(C,e)},[l,C]),[x,L]=r.useState({value:"",name:""}),[H,k]=r.useState(!1),[V,S]=r.useState(),[z,O]=r.useState([]);r.useEffect(()=>{m&&C&&t.getActiveCell({value:m.value,active:C});const n=i.current;if(!y&&n&&(n.focus({preventScroll:!0}),"dropDown"===m?.inputType?.type)){L({value:m?.value,name:m?.value}),k(e=>!e);const t=m?.inputType?.options?.map(t=>({disable:t.disable,label:e("span",{style:{color:t.color},children:t.label}),value:t.value}));S(t)}},[i,y,C?.row,C?.column]),r.useEffect(()=>{if("file"===m?.inputType?.type&&m?.value)try{const e=JSON.parse(m.value).map(e=>new File([new Blob],e.name.split("*")[0]??"default"));O(e)}catch(e){console.error("Error parsing cell value for files:",e),O([])}else O([])},[m?.inputType?.type,m?.value]),r.useEffect(()=>{"dropDown"===m?.inputType?.type&&m?.value!==x.value&&L({value:m?.value,name:m?.value})},[m?.value,m?.inputType?.type,x.value]),r.useEffect(()=>{const e=b.current,t=E.current;if(b.current=C,E.current=m,!e||!t)return;const n=C?.row!==e.row||C?.column!==e.column;if(n||"edit"!==p){const e=w.current;t!==e?u([{prevCell:e||null,nextCell:t}]):n||m===t||u([{prevCell:t,nextCell:m||null}]),w.current=m}});const N=m&&m.DataEditor||t.DataEditor,T=m&&m.readOnly,I=r.useCallback(e=>{if(!C)return;const t=e.currentTarget.closest(".ff-excel-spreadsheet");if(!t)return void e.preventDefault();e.stopPropagation();const n=document.body.style.userSelect,r=document.body.style.overflow;document.body.style.userSelect="none",document.body.style.overflow="hidden";let i=null;const o=()=>{i&&(cancelAnimationFrame(i),i=null)},a=e=>{const n=t.getBoundingClientRect();let r=0,a=0;e.clientY<n.top+50?a=-12:e.clientY>n.bottom-50&&(a=12),e.clientX<n.left+50?r=-12:e.clientX>n.right-50&&(r=12),0!==r||0!==a?(e=>{o();const n=()=>{const{x:r,y:o}=e;0!==r&&(t.scrollLeft+=r),0!==o&&(t.scrollTop+=o),i=requestAnimationFrame(n)};i=requestAnimationFrame(n)})({x:r,y:a}):o()},l=()=>{o(),document.body.style.userSelect=n,document.body.style.overflow=r,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",l),d(!0)},[s,d,C]),Z=r.useCallback(e=>{e.preventDefault(),t.setContextMenu({open:t.contextOption?.open??!1,contextType:t.contextOption?.contextType??null,options:t.contextOption?.options||[]})},[t]),R=v?.height!==A?.height||v?.width!==A?.width,j=r.useCallback(e=>{C&&R&&(bv(C,iA(e.currentTarget)),s(C))},[C,R]),B=t.isAtRight?t.maxWidth-(A?.left-t.scrollPos.left)+100:t.maxWidth,P=t.isAtBottom?t.maxHeight-(A?.top-t.scrollPos.top)+64:t.maxHeight,_=["file","dropDown"].includes(m?.inputType?.type||"");return n("div",{ref:i,className:D("ff-spreadsheet-active-cell",`ff-spreadsheet-active-cell--${p}`,{"ff-spreadsheet-active-cell--hidden":y,"ff-spreadsheet-active-cell--dragging":R&&"text"!==m?.inputType?.type}),onMouseDown:j,style:{...A,backgroundColor:m?.style?.backgroundColor,..._?{display:"flex",alignItems:m?.style?.alignContent,justifyContent:m?.style?.textAlign}:{},..."edit"===p&&C?{minWidth:Math.min(A?.width,t.maxWidth),minHeight:Math.min(A?.height,t.maxHeight),height:"auto",maxWidth:`${B}px`,maxHeight:`${P}px`,overflow:"auto",..."dropDown"===m?.inputType?.type?{}:{padding:"2px 4px 0px 4px",width:"max-content"}}:{}},onContextMenu:Z,onClick:"view"!==p||T?void 0:c,tabIndex:0,children:[e("div",{className:_?"":"active-cell-main",children:"dropDown"===m?.inputType?.type?e(Vo,{...m?.inputType?.inputProps,dropDownRef:o,showOptions:{open:!("edit"!==p||!C),toggle:H},selectedOption:x,optionsList:V||[],height:26,showLabel:!1,disabled:!t.editable,showBorder:!1,optionZIndex:5e3,onChange:e=>{L({value:e.value,name:e.label}),M({...m,value:e.value,style:m?.style,inputType:m?.inputType})}}):"file"===m?.inputType?.type?e(Jm,{...m?.inputType?.inputProps,label:"",onFileListClick:e=>{const n=e.target.closest(".ff-attachment-files"),r=e.target.closest(".ff-icon-container, .ff-icon-click, .ff-icon-danger");if(n&&!r&&m?.value&&t.attachmentAction?.viewAttachment)try{const e=JSON.parse(m.value),r=n.parentElement?.querySelectorAll(".ff-attachment-files")||[],i=Array.from(r).indexOf(n);if(-1===i||!e[i])return void console.error("File index not found or invalid");const o=e[i];t.attachmentAction.viewAttachment(o.id,o.name?.split("*")[0]??"default")}catch(e){console.error("Error parsing cell value:",e)}else console.warn("Missing file element, icon click, cell value, or viewAttachment action")},selectedFiles:z,onFilesChange:async(e,n,r)=>{try{if("ADD"===r&&"file"===m?.inputType?.type){let n=[];try{m?.value&&(n=JSON.parse(m.value))}catch(e){console.error("Error parsing cell.value:",e)}let r=0;const i=e.filter((e,t,i)=>{const o=e.name.split("*")[0],a=i.findIndex(e=>e.name.split("*")[0]===o)!==t,l=n.some(e=>e.name.split("*")[0]===o);return!a&&!l||(r++,!1)});if(n.length+i.length>5)return void oc.info("Cannot upload more than 5 files.");if(t.attachmentAction?.addAttachment&&i.length>0)try{let e=0,r=0,o=0;const l=z?.length+i?.length,s=l>0?25*l:1,c=[...n],d=i?.map(async e=>{try{if(e.name.includes("*"))return{file:e,status:"existing",data:{name:e.name}};const n=await(t?.attachmentAction?.addAttachment(e));if(!n||"string"==typeof n&&0===n.trim().length)return{file:e,status:"failed",reason:"no response"};if("string"==typeof n)try{const t=JSON.parse(n);return 507===t.responseCode?{file:e,status:"memory_full",reason:"no memory"}:400===t.responseCode?{file:e,status:"failed",reason:"invalid file"}:t?.id&&t?.name?{file:e,status:"success",data:t}:(console.error(`Invalid response structure for ${e.name}:`,t),{file:e,status:"failed",reason:"invalid response"})}catch(t){return console.error(`Parse error for ${e.name}:`,t),{file:e,status:"failed",reason:"parse error"}}if("object"==typeof n&&null!==n){const t=n;return t?.id&&t?.name?{file:e,status:"success",data:t}:(console.error(`Invalid response structure for ${e.name}:`,n),{file:e,status:"failed",reason:"invalid response"})}return console.error(`Unknown response for ${e.name}:`,n),{file:e,status:"failed",reason:"unknown"}}catch(t){return console.error(`Upload failed for ${e.name}:`,t),{file:e,status:"failed",reason:"upload error"}}});if((await Promise.allSettled(d)).forEach(t=>{if("fulfilled"===t.status&&t.value){const{status:n,data:i}=t.value;"success"===n&&i?.id&&i?.name?(c.push(i),e++):"existing"===n&&i?.name?c.push(i):"memory_full"===n?o++:r++}else r++}),e>0||c.length>n.length){const e=c.length>0?JSON.stringify(c):"";M({...m,value:e,style:m?.style,inputType:m?.inputType}),a(Jg(C?.row||0,Math.max(s,h?.[C.row]?.height||s))),O(c.map(e=>new File([new Blob],e.name?.split("*")[0]??"default")))}o>0&&oc.info("No memory available to add the file"),e>0&&oc.success(`${e} file${e>1?"s":""} uploaded successfully`),r>0&&oc.info(`${r} unsupported ${r>1?"files":"file"}. Please check the file formats.`)}catch(e){console.error("Upload operation failed:",e),oc.error("Operation failed")}}else if("DELETE"===r&&"file"===m?.inputType?.type)try{let e=[...m&&JSON.parse(m.value)],r=0;for(const i of n||[]){const n=e.findIndex(e=>e.name.split("*")[0]===i.name.split("*")[0]),o=e[n]?.id;if(-1!==n&&o&&t.attachmentAction?.deleteAttachment)try{const a=await t.attachmentAction.deleteAttachment(o);"SUCCESS"===a||"object"==typeof a&&null!==a&&("status"in a&&"SUCCESS"===a.status||"responseCode"in a&&200===a.responseCode)?(e.splice(n,1),r++):console.error(`Delete failed for ${i.name}: Invalid response`,a)}catch(e){console.error(`Delete error for ${i.name}:`,e),oc.error("Error deleting file")}else console.error(`Cannot delete ${i.name}: Invalid fileId or no match`,{index:n,fileId:o,hasDeleteAttachment:!!t.attachmentAction?.deleteAttachment}),oc.error("Failed to delete file: Invalid file data")}if(r>0){const t=e.length>0?JSON.stringify(e):"";M({...m,value:t,style:m?.style,inputType:m?.inputType}),O(e?.map(e=>new File([new Blob],e.name.split("*")[0]))),oc.success(`${r} file${r>1?"s":""} deleted successfully`)}else if(n?.length){const t=e?.filter(e=>e.id&&e.name);if(t.length<e.length){const e=t.length>0?JSON.stringify(t):"";M({...m,value:e,style:m?.style,inputType:m?.inputType}),O(t.map(e=>new File([new Blob],e.name.split("*")[0]))),oc.error("Failed to delete file(s). Invalid file data detected.")}else oc.error("Failed to delete file(s). No valid files removed.")}}catch(e){console.error("Delete operation failed:",e),oc.error("Delete operation failed")}}catch(e){console.error("handleFilesChange error:",e),oc.error("Operation failed")}},disabled:!t.editable,maxFiles:5,buttonLabel:"+ Attachments",buttonVariant:"tertiary",deleteButton:t.editable,selectedFileMessage:"Duplicate attachments not allowed within the same row",addAttachmentButton:t.editable,isInfoIconRequired:!1,truncateMaxLimit:(A?.width??0)-60}):"edit"===p&&C&&t.editable?e(N,{row:C.row,column:C.column,cell:m,onChange:M,exitEditMode:f}):e(Ny,{initialValue:m?.value,onChange:()=>{},className:"ff-spreadsheet-cell-textarea",style:{...m?.style,height:"100%",width:"100%",textDecoration:"underline"===m?.style?.textDecoration?"underline":"none",backgroundColor:R?"#1e161f00":m?.style?.backgroundColor,pointerEvents:"none",borderTop:"",borderBottom:"",borderLeft:"",borderRight:""}})}),!["file"].includes(m?.inputType?.type??"")&&("edit"===p||C&&e("div",{onMouseDown:I,className:"select_dot"}))]},`${C?.row}-${C?.column}`)},Iy=({dimensions:t,dragging:n,hidden:r,variant:i})=>{const o=wy(e=>e.active),a=wy(e=>e.autoFill),l=wy(e=>o?dA(o,e.rowDimensions,e.columnDimensions):void 0),{width:s,height:c,top:d,left:u}=t||{};let f=l?.height??0,h=l?.width??0,C=s,p=c;return a.open&&s&&c&&l&&(s-h>c-f?(C=s,p=l.height):(p=c,C=l.width)),e("div",{className:D("ff-spreadsheet-floating-rect",{[`ff-spreadsheet-floating-rect--${i}`]:i,"ff-spreadsheet-floating-rect--dragging":n,"ff-spreadsheet-floating-rect--hidden":r}),style:{width:(C??0)+1,height:(p??0)+1,top:d,left:u}})},Zy=({scrollPos:t={top:0,left:0}})=>{const n=wy(e=>e.selected),i=wy(e=>e.dragging),o=wy(e=>e.selected.size(e.model.data)<2),a=wy(e=>n&&fA(e.rowDimensions,e.columnDimensions,e.model.data,e.selected)),l=r.useMemo(()=>{if(a)return{...a,top:a.top-1,left:a.left-1,height:a.height-1,width:a.width-1}},[a,t]);return e(Iy,{variant:"selected",dimensions:l,dragging:i,hidden:o||!a})},Ry=({scrollPos:t={top:0,left:0}})=>{const n=wy(e=>e.copied),i=null===n,o=wy(e=>n&&uA(e.rowDimensions,e.columnDimensions,n)),a=r.useMemo(()=>{if(o)return{...o,top:o.top-1,left:o.left-1,height:o.height-1,width:o.width-1}},[o,t]);return e(Iy,{variant:"copied",dimensions:a,hidden:i||!o,dragging:!1})},jy=i.forwardRef(({getColorValue:t,disabled:n,initialColor:r},o)=>{const l=a(null);i.useImperativeHandle(o,()=>l.current);const[s,d]=c(r);return e("div",{className:D("ff-excel-color-selector",{"color-selector-disabled":n}),style:{backgroundColor:s},onClick:()=>{l.current&&!n&&l.current.click()},children:e("input",{type:"color",disabled:n,className:D("ff-excel-color-selector-picker",{"color-selector-disabled":n}),ref:l,onChange:e=>{d(e.target.value),t(e.target.value.replace("#",""))}})})});jy.displayName="ColorBarSelector";const By=e=>{switch(e.toUpperCase()){case"LEFT":default:return"left";case"RIGHT":return"right";case"CENTER":return"center";case"JUSTIFY":return"justify";case"BOTTOM":return"end";case"TOP":return"start"}},Py=e=>{switch(e){case"left":return"LEFT";case"right":return"RIGHT";case"center":return"CENTER";case"justify":return"JUSTIFY";case"end":default:return"BOTTOM";case"start":return"TOP"}},_y=e=>wA.reduce((t,n)=>Math.abs(n-parseFloat(e))<Math.abs(t-parseFloat(e))?n:t);function Fy(e,t=100){const{border:n}=e;let r="",i="",o="",a="";return"THIN"!==n.top&&(r="MEDIUM"===n.top?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==n.right&&(i="MEDIUM"===n.right?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==n.bottom&&(o="MEDIUM"===n.bottom?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==n.left&&(a="MEDIUM"===n.left?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),{fontSize:gA(_y(String(e.size))),fontFamily:(l=e.name,yA.some(e=>e.label===l)?l:"Poppins"),color:`#${e.color}`,backgroundColor:`#${e.backgroundColor}`,fontWeight:e.bold?"bold":"normal",fontStyle:e.italic?"italic":"normal",textDecoration:e.underline?"underline":"normal",borderTop:r,borderRight:i,borderBottom:o,borderLeft:a,textAlign:By(e.alignment.horizontal),alignContent:By(e.alignment.vertical),height:e.height??32,width:e.width??t};var l}const qy=e=>{if(!e||"none"===e)return"THIN";if(e.includes("solid")||e.includes("dashed")||e.includes("dotted")){if(e.includes("2px")||e.includes("medium"))return"MEDIUM";if(e.includes("3px")||e.includes("medium"))return"THICK"}return"THIN"},Uy=(e,t=100)=>({name:e.fontFamily||"Arial",size:vA(e.fontSize?.toString()||"12"),bold:"bold"===e.fontWeight,italic:"italic"===e.fontStyle,underline:"underline"===e.textDecoration,color:e.color?.replace("#","")||"000000",backgroundColor:e.backgroundColor?.replace("#","")||"FFFFFF",borderColor:"F2F2F2",border:{top:qy(e.borderTop?e.borderTop.toString():void 0),right:qy(e.borderRight?e.borderRight.toString():void 0),bottom:qy(e.borderBottom?e.borderBottom.toString():void 0),left:qy(e.borderLeft?e.borderLeft.toString():void 0)},alignment:{horizontal:Py(e.textAlign),vertical:Py(e.alignContent),wrapText:!1},width:e.width||t,height:e.height||32}),Wy=({toolbar:t="show",editable:r,onBold:i,onItalic:o,setUnderlineType:s,setColor:d,setFontSize:u,setFontFamily:f,setTextAlign:h,setBackgroundColor:C,setBorderType:p,setFormatePainter:m})=>{const g=wy(e=>e.selected instanceof Qv),[v,A]=c("disable"===t||!r),y=wy(e=>e.active?Sv(e.active,e.model.data):null),w=wy(e=>e.model.data),b=wy(e=>e.formattedStyle.open),E={...AA.style,color:"#1e161f",backgroundColor:"#ffffff",borderColor:"#1e161f"},[M,x]=c(y?.style||E),L=a(null);l(()=>{y?.style&&JSON.stringify(y.style)!==JSON.stringify(M)&&x(y?.style||E),g?A(!r):y&&"boolean"==typeof y.readOnly&&A(y.readOnly||"disable"===t||!r||"dropDown"===y?.inputType?.type)},[y,r]);const H=Uy(M),[k,V]=c("border-none"),[S,z]=c({label:"",value:""}),[O,N]=c({label:"",value:""}),[D,T]=c({color:E.color,backgroundColor:E.backgroundColor,borderColor:E.borderColor}),I=[{value:"border-all-sides",label:"All Border",icon:"all_borders"},{value:"border-bottom",label:"Border Bottom",icon:"border_bottom"},{value:"border-left",label:"Border Left",icon:"border_left"},{value:"border-right",label:"Border Right",icon:"border_right"},{value:"border-top",label:"Border Top",icon:"border_top"},{value:"border-none",label:"No Border",icon:"no_border"}],Z=wA.map(e=>({label:e,value:e})),R=a(null),j=a(null);l(()=>{let e=setTimeout(()=>{d(w,D.color)},0);return()=>{clearTimeout(e)}},[D.color]),l(()=>{let e=setTimeout(()=>{C(w,D.backgroundColor)},0);return()=>{clearTimeout(e)}},[D.backgroundColor]);return l(()=>{const e=M.fontFamily,t=`${vA(M.fontSize)}`;z({label:e??"Times New Roman",value:e??"Times New Roman"}),N({label:t??"11",value:t??"11"})},[M]),n("div",{className:"ff-excel-toolbar",children:[n("div",{className:"ff-excel-toolbar-font ",children:[e("div",{className:"ff-excel-toolbar-font-family",children:e(Vo,{disabled:v,height:24,tooltip:!0,showToolTip:!0,showLabel:!1,optionZIndex:2e3,onChange:e=>{z({label:e.label,value:e.label}),f(w,e.value)},required:!1,optionsList:yA,selectedOption:S})}),e("div",{className:"ff-excel-toolbar-font-size",children:e(Vo,{disabled:v,height:24,showLabel:!1,optionZIndex:2e3,required:!1,onChange:e=>{N({label:e.label,value:e.value}),u(w,e.value)},optionsList:Z,selectedOption:O})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-icon",children:[e(Y,{placement:"top",title:"Text Left",children:e(F,{disabled:v,variant:"left"===M.textAlign?"dark":"light",hoverEffect:"left"!==M.textAlign,onClick:()=>h(w,"left"),name:"text_align_left"})}),e(Y,{placement:"top",title:"Text Center",children:e(F,{disabled:v,variant:"center"===M.textAlign?"dark":"light",hoverEffect:"center"!==M.textAlign,onClick:()=>h(w,"center"),name:"text_align_center"})}),e(Y,{placement:"top",title:"Text Right",children:e(F,{disabled:v,variant:"right"===M.textAlign?"dark":"light",hoverEffect:"right"!==M.textAlign,onClick:()=>h(w,"right"),name:"text_align_right"})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-text",children:[e(Y,{placement:"top",title:"Bold",children:e(F,{disabled:v,variant:H.bold?"dark":"light",hoverEffect:!H.bold,onClick:()=>i(w),name:"bold"})}),e(Y,{placement:"top",title:"Italic",children:e(F,{disabled:v,variant:H.italic?"dark":"light",hoverEffect:!H.italic,onClick:()=>o(w),name:"italic"})}),e(Y,{placement:"top",title:"Underline",children:e("div",{className:"ff-excel-toolbar-icon-underline",children:e(F,{disabled:v,variant:"underline"===M.textDecoration?"dark":"light",hoverEffect:"underline"!==M.textDecoration,onClick:()=>s(w),name:"underline"})})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-icon",children:[e(Y,{placement:"top",title:"Format Painter",children:e(F,{disabled:v,variant:b?"dark":"light",hoverEffect:!b,onClick:()=>{m(w)},name:"formate_painter"})}),e(Y,{placement:"top",title:"Text Color",children:n("div",{className:"ff-excel-toolbar-icon-color",children:[e(F,{disabled:v,hoverEffect:!0,width:12,height:10,onClick:()=>{d(w,D.color),R.current?.click()},name:"text_color"}),e(jy,{ref:R,disabled:v,getColorValue:e=>{T(t=>({...t,color:e}))},initialColor:D.color})]})}),e(Y,{placement:"top",title:"Background Color",children:n("div",{className:"ff-excel-toolbar-icon-color",children:[e(F,{disabled:v,hoverEffect:!0,width:12,height:10,onClick:()=>{C(w,D.backgroundColor),j.current?.click()},name:"fill_color"}),e(jy,{ref:j,disabled:v,getColorValue:e=>{T(t=>({...t,backgroundColor:e}))},initialColor:D.backgroundColor})]})})]}),e("div",{className:"ff-excel-toolbar-divider"}),e("div",{className:"ff-excel-toolbar-menu",children:n("div",{className:"ff-excel-toolbar-menu-option",children:[e(Y,{placement:"top",title:"Border Type",children:e(F,{hoverEffect:!0,disabled:v,onClick:()=>p(w,k,"var(--input-hover-border-color)"),name:(()=>{const e=I.find(e=>e.value===k);return e?e.icon:""})()})}),e("span",{ref:L,children:e(To,{disabled:v,iconName:"arrow_down",targetRef:L,iconSize:12,zIndex:2e3,options:I,tooltipTitle:"Border Type",tooltipPlacement:"top",onOptionClick:e=>{let t=e.value;p(w,t,"var(--input-hover-border-color)"),V(t)}})})]})})]})},Xy=(e,t)=>{let n,r=null;const i=function(...i){const o=this;null===r||Date.now()-r>=t?(e.apply(o,i),r=Date.now()):(n&&clearTimeout(n),n=setTimeout(()=>{e.apply(o,i),r=Date.now()},t-(Date.now()-r)))};return i.cancel=()=>{n&&clearTimeout(n),n=null,r=null},i},Qy=r.forwardRef(function(t,i){const{className:o,columnLabels:a=[],rowLabels:l=[],toolbar:s,editable:c,onKeyDown:d,Table:u=gy,Row:f=vy,sheetHeight:h,HeaderRow:C=Ay,DataEditor:p=Dy,DataViewer:m=zy,onSelect:g=()=>{},onActivate:v=()=>{},onEvaluatedDataChange:A=()=>{},contextOption:y,attachmentAction:w,workRef:b,minimumColumnWidth:E,setContextMenu:M,maxRowLimit:x,maxColLimit:L,disableDeleteOption:H,contextMenu:k,getActiveCell:V,onAddColumn:S,onDeleteColumn:z}=t,O=32,N=E||100,T=r.useRef(!1),I=wy(e=>e.model.data),[Z,R]=r.useState(!1),[j,B]=r.useState(0),[P,_]=r.useState(0),[F,q]=r.useState({top:0,left:0}),[U,W]=r.useState(!1),[X,Q]=r.useState(!1),G=r.useMemo(()=>{const e=t.createFormulaParser||xA,n=new SA(e,t.data);let r={},i={};t.data.forEach((e,t)=>{let n=O;e.forEach(e=>{if(e){const t=parseFloat(String(e.style?.height).replace("px",""))||O;n=Math.max(n,t)}}),r[t]={top:0,height:n}});const o=t.data[0]?t.data[0].length:0;for(let e=0;e<o;e++){let n=N;t.data.forEach(t=>{const r=t[e];if(r){const e=parseFloat(String(r.style?.width).replace("px",""))||N;n=Math.max(n,e)}}),i[e]={left:0,width:n}}return R(e=>!e),{...ty,model:n,selected:t.selected||ty.selected,rowDimensions:r,columnDimensions:i}},[t.createFormulaParser,t.data,t.selected]),Y=r.useReducer(ny,G),[K,J]=Y,$=r.useMemo(()=>function(e,t,n){const{columns:r,rows:i}=Rv(e);return{rows:t?Math.max(i,t.length):i,columns:n?Math.max(r,n.length):r}}(K.model.data,l,a),[K.model.data,l,a]),[ee,te]=r.useState({start:0,end:Math.min(20,$.rows)}),[ne,re]=r.useState({start:0,end:Math.min(15,$.columns)}),ie=r.useCallback(e=>{let t=0;for(let n=0;n<e;n++)t+=K.rowDimensions[n]?.height||O;return t},[K.rowDimensions,O]),oe=r.useCallback(e=>{let t=0;for(let n=0;n<e;n++)t+=K.columnDimensions[n]?.width||N;return t},[K.columnDimensions,N]),ae=r.useRef(!0);r.useEffect(()=>{ae.current?ae.current=!1:J(function(e){return{type:Xg,payload:{minimumColumnWidth:e}}}(E))},[E]);const le=ie($.rows),se=oe($.columns),ce=ie(ee.start),de=le-ie(ee.end),ue=oe(ne.start),fe=se-oe(ne.end),he=K.mode,Ce=r.useRef(null),pe=e=>r.useCallback((...t)=>J(e(...t)),[e]),me=pe(Kg),ge=pe(kv),ve=pe(Hv),Ae=pe(Vv),ye=pe(Ev),we=pe(Mv),be=pe(mv),Ee=pe(xv),Me=pe(Lv),xe=pe(gv),Le=pe(vv),He=pe(Av),ke=pe(ev),Ve=pe(tv),Se=pe(rv),ze=pe(av),Oe=pe(iv),Ne=pe(ov),De=pe(nv),Te=pe(lv),Ie=pe(sv),Ze=pe(cv),Re=pe(Yg),je=pe(dv),Be=pe(uv),Pe=pe(fv),_e=pe(hv),Fe=pe(Cv),qe=pe(pv);r.useImperativeHandle(i,()=>({removeSelect:Ae}));const Ue=r.useRef(K.active);r.useEffect(()=>{if(K.active!==Ue.current)if(K.active)v(K.active);else{const e=b.current;e&&pA(e)&&document.activeElement&&document.activeElement.blur()}Ue.current=K.active},[v,K.active]);const We=r.useRef(K.model.evaluatedData);r.useEffect(()=>{K?.model?.evaluatedData!==We?.current&&A(K?.model?.evaluatedData),We.current=K.model.evaluatedData},[K?.model?.evaluatedData,A]);const Xe=r.useRef(K.selected);r.useEffect(()=>{K.selected.equals(Xe.current)||t.selected&&K.selected.equals(t.selected)||g(K.selected),Xe.current=K.selected},[K.selected,g,t.selected]);const Qe=r.useRef(t.selected);r.useEffect(()=>{t.selected&&Qe.current&&!t.selected.equals(Qe.current)&&He(t.selected),Qe.current=t.selected},[t.selected,He]);let Ge=r.useRef();r.useEffect(()=>{me(c),void 0!==Ge.current&&t.data!==Ge.current&&xe(t.data),Ge.current=t.data},[t.data,xe,c]);const Ye=r.useRef(t.createFormulaParser);r.useEffect(()=>{t.createFormulaParser!==Ye.current&&t.createFormulaParser&&Le(t.createFormulaParser),Ye.current=t.createFormulaParser},[t.createFormulaParser,Le]);const Ke=r.useCallback(e=>{const{model:t,selected:n}=K,{data:r}=t,i=n.toRange(r);if(i){!function(e,t){e.clipboardData?.setData(tA,t)}(e,hA(function(e,t,n){const r=[],i=t.column-e.column;for(let o=e.row;o<=t.row;o++){const a=o-e.row;r[a]=r[a]||Array(i);for(let i=e.column;i<=t.column;i++)r[a][i-e.column]=Sv({row:o,column:i},n)}return r}(i.start,i.end,r)))}},[K]),Je=r.useCallback(e=>{CA(Ce.current,he)&&(e.preventDefault(),e.stopPropagation(),Ke(e),ge())},[he,Ke,ge]),$e=r.useCallback(e=>{CA(Ce.current,he)&&(e.preventDefault(),e.stopPropagation(),Ke(e),ve())},[he,Ke,ve]),et=r.useCallback(e=>{if(CA(Ce.current,he)&&(e.preventDefault(),e.stopPropagation(),e.clipboardData)){const t=function(e){return window.clipboardData&&window.clipboardData.getData?window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?e.clipboardData.getData(tA):""}(e);ye(t)}},[he,ye]),tt=r.useCallback(e=>{e.persist();const t=e.ctrlKey||e.metaKey,n=e.key.toLowerCase();t&&"b"===n?(e.preventDefault(),ke(I)):t&&"i"===n?(e.preventDefault(),Ve(I)):t&&"u"===n&&(e.preventDefault(),Se(I)),d&&d(e),e.defaultPrevented||(function(e,t){return void 0!==YA(e,t)}(K,e)&&e.nativeEvent.preventDefault(),we(e))},[K,d,we]),nt=r.useCallback(()=>{K.formattedStyle.open&&K.active&&Re(K.active)},[K]),rt=r.useCallback(()=>{Me(),document.removeEventListener("mouseup",rt)},[Me]),it=r.useCallback(e=>{K.dragging||1!==e.buttons||"view"!==he||(Ee(),document.addEventListener("mouseup",rt))},[K,Ee,rt,he]),ot=r.useMemo(()=>Sy(t.Cell||Vy),[t.Cell,Z,c]),at=r.useMemo(()=>Ey(t.CornerIndicator||by),[t.CornerIndicator,Z]),lt=r.useMemo(()=>ky(t.RowIndicator||Hy),[t.RowIndicator,Z]),st=r.useMemo(()=>My(t.ColumnIndicator||xy),[t.ColumnIndicator,Z]);r.useEffect(()=>(document.addEventListener("cut",Je),document.addEventListener("copy",$e),document.addEventListener("paste",et),()=>{document.removeEventListener("cut",Je),document.removeEventListener("copy",$e),document.removeEventListener("paste",et)}),[Je,$e,et]);const ct=e=>{const t=new ResizeObserver(e=>{const t=e[0];if(t&&Ce.current){const e=t.target;if(e){const{clientWidth:t,clientHeight:n}=e;_(Math.min(Ce.current.clientHeight,n)),B(Math.min(Ce.current.clientWidth,t))}}}),n=e.current;n&&t.observe(n)},dt=r.useCallback(e=>{const t=e.target,{scrollTop:n,clientHeight:r,scrollLeft:i,clientWidth:o}=t;q({top:n,left:i});let a=0;for(;a<$.rows&&ie(a)<n;)a++;let l=a;for(;l<$.rows&&ie(l)<n+r;)l++;a=Math.max(0,a-10),l=Math.min($.rows,l+10),te({start:a,end:l});const s=l===$.rows;W(s);let c=0;for(;c<$.columns&&oe(c)<i;)c++;let d=c;for(;d<$.columns&&oe(d)<i+o;)d++;c=Math.max(0,c-10),d=Math.min($.columns,d+10),re({start:c,end:d});const u=d===$.columns;Q(u),k.open&&M({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]})},[$.rows,$.columns,ie,oe]),ut=r.useMemo(()=>Xy(dt,16),[dt]),ft=e=>{T.current=!0,requestAnimationFrame(()=>{let t=0;for(let n=0;n<=e;n++)t+=K.rowDimensions?.[n]?.height||O;requestAnimationFrame(()=>{Ce.current&&e>=$.rows-1&&Ce?.current?.scrollTo({top:t+O,behavior:"smooth"})})})},ht=e=>{T.current=!0,requestAnimationFrame(()=>{let t=0;for(let n=0;n<=e;n++)t+=K.columnDimensions?.[n]?.width||N;requestAnimationFrame(()=>{Ce.current&&e>=$.columns-1&&Ce.current.scrollTo({left:t+60,behavior:"smooth"})})})};r.useEffect(()=>{T.current||(te({start:0,end:Math.min(20,$.rows)}),re({start:0,end:Math.min(15,$.columns)}))},[$.rows,$.columns,T.current]);const Ct=nA(ee.end,ee.start),pt=nA(ne.end,ne.start),mt=n("colgroup",{children:[e("col",{style:{width:"60px"}},"row-indicator")," ",e("col",{style:{width:`${ue}px`}},"left-spacer")," ",pt.map(t=>e("col",{style:{width:`${K.columnDimensions[t]?.width||N}px`}},t)),e("col",{style:{width:`${fe}px`}},"right-spacer")," "]}),gt=r.useMemo(()=>n(u,{useTableRef:ct,totalWidth:se,children:[mt,n("tbody",{children:[n(C,{children:[e(at,{}),e("div",{className:"spacer left"}),pt.map(n=>e(st,{column:n,minimumColumnWidth:E,setContextMenu:t.setContextMenu,label:n in a?a[n]:void 0,deleteColumn:qe,addColumnLeft:Pe,addColumnRight:_e,columnContextEnable:t.columnContextEnable,maxColLimit:L,disableDeleteOption:H,contextMenu:k,onAddColumn:S,onDeleteColumn:z,setVisibleRange:re,scrollToColumn:ht},n)),e("div",{className:"spacer right"})]}),e("tr",{style:{height:`${ce}px`}}),Ct.map(r=>n(f,{row:r,children:[e(lt,{label:r in l?l?.[r]:void 0,row:r,addRowTop:je,addRowBottom:Be,deleteRow:Fe,setContextMenu:t.setContextMenu,rowContextEnable:t.rowContextEnable,maxRowLimit:x,disableDeleteOption:H,contextMenu:k,setVisibleRange:te,scrollToRow:ft},r),e("div",{className:"spacer left"}),pt.map(t=>e(ot,{row:r,column:t,DataViewer:m},`${r}-${t}`)),e("div",{className:"spacer right"})]},r)),e("tr",{style:{height:`${de}px`}})]})]}),[u,$.rows,$.columns,f,C,at,a,st,l,lt,ot,m,ee,ne,ce,de,ue,fe,K.rowDimensions,K.columnDimensions]),vt=r.useMemo(()=>e(Ty,{attachmentAction:w,contextOption:y,getActiveCell:V,setContextMenu:t.setContextMenu,DataEditor:p,visibleRowRange:ee,visibleColRange:ne,maxHeight:P-64,maxWidth:j-E,totalHeight:le,totalWidth:se,isAtBottom:U,isAtRight:X,scrollPos:F,editable:c},K.active?`${K.active.row}-${K.active.column}`:"no-active"),[p,ee,ne,K.active,P,j,le,se,U,X,c]),At=r.useMemo(()=>n("div",{className:"ff-excel-spreadsheet-container",children:[e("div",{style:{width:`${j}px`},className:D("ff-excel-header-column-hider",{"ff-excel-header-extend":["show","disable"].includes(s||""),"ff-excel-header-hider":"hide"===s})}),e("div",{style:{height:`${P}px`},className:D("ff-excel-header-column-hider",{"ff-excel-header-extend":["show","disable"].includes(s||""),"ff-excel-header-hider":"hide"===s})}),"hide"!==s&&e("div",{className:"ff-excel-toolbar-container",children:e(Wy,{editable:c,toolbar:s,onBold:ke,onItalic:Ve,setUnderlineType:Se,setColor:Te,setBorderType:De,setFontSize:Oe,setFontFamily:Ne,setTextAlign:ze,setBackgroundColor:Ie,setFormatePainter:Ze})}),n("div",{ref:Ce,style:{height:h},className:D("ff-excel-spreadsheet",o),onKeyPress:be,onKeyDown:tt,onClick:nt,onMouseMove:it,onScroll:e=>ut(e),children:[gt,vt,e(Zy,{scrollPos:F}),e(Ry,{scrollPos:F})]})]}),[o,be,tt,it,gt,vt,j]);return e(my.Provider,{value:Y,children:At})}),Gy=({contextMenu:t,position:r,editable:i})=>{if(!t.open)return null;return i&&e("div",{onContextMenu:e=>{e.preventDefault(),e.stopPropagation()},className:"ff-excel-menu",style:{left:r.x,top:r.y,position:"absolute",zIndex:9999999999},children:t.options.map(t=>{if(!t.visible){const i=t.disable;return e(Y,{title:i?t.disableTooltip:"",children:n("div",{className:"ff-excel-menu-options "+(i?"disabled":""),onClick:()=>{i||t.action()},children:[t.iconName&&e(F,{name:t.iconName,height:16,width:16,color:(r=t.label,r.includes("Delete")?"var(--label-edit-error-text)":"var(--brand-color)"),disabled:i}),e(q,{as:"label",children:t.label})]})},t.label)}var r;return null})})},Yy=({excelData:r,contextOption:o,toolbar:s="show",sheetBar:d="show",rowCount:u=26,colCount:f=26,sheetHeight:h="100%",editable:C=!0,contextHeightPositioning:p=0,contextWidthPositioning:m=0,onSave:g=()=>Promise.resolve(),onSaveInfoChange:v,attachmentAction:A={addAttachment:()=>Promise.resolve(""),deleteAttachment:()=>Promise.resolve(""),viewAttachment:()=>Promise.resolve()},onSaveDelay:y=3e3,scroller:w=!1,columnContextEnable:b=!0,rowContextEnable:E=!0,sheetBarContextEnable:M=!0,minimumColumnWidth:x=100,disableDeleteOption:L=!1,maxRowLimit:H=1/0,maxColLimit:k=1/0,maxSheetLimit:V=1/0,getActiveCell:S=()=>{}})=>{const z=a(null),[O,N]=c([]),[T,I]=c(""),[Z,R]=i.useState({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",disable:!1,visible:!1}]}),[j,B]=c({name:"defaultSheet",index:0}),[P,_]=c({defaultSheet:[[AA]]}),[U,W]=c([[AA]]),[X,Q]=c((g.length,{})),[K,J]=c({x:0,y:0}),$=a(""),ee=a(null),te=a(null),ne=a(null);l(()=>{const e=r;if(e){const t=e.map(e=>e.sheetName);N(t),G(t.length)||($.current=t[0]||"",B({name:t[0]||"",index:0}));const n={},r={};e.forEach(e=>{const t=e.sheetName,i=e.data,o=Math.max(u,i.length),a=Math.max(f,Math.max(...i.map(e=>e.length)));let l=Array.from({length:o},()=>Array(a).fill({value:"",style:AA.style,readOnly:!1,inputType:void 0}));i.forEach((e,t)=>{e.forEach((e,n)=>{var r;t<o&&n<a&&(l[t]||(l[t]=[]),l[t][n]={value:(r=e.value,null==r?null:r),style:G(e?.style)?AA.style:Fy(e?.style,x),readOnly:!!e?.readOnly&&e?.readOnly,inputType:e?.inputType??void 0,contextDisable:e.contextDisable})})});const s=new Set([...e?.rows?.readOnly?e.rows.readOnly.map(e=>`r${e}`):[],...e?.columns?.readOnly?e.columns.readOnly.map(e=>`c${e}`):[],...e?.cells?.readOnly?e.cells.readOnly.map(([e,t])=>`${e},${t}`):[]]);if(l.forEach((t,n)=>{t.forEach((t,r)=>{l[n]||(l[n]=[]);const i=s.has(`r${n+1}`)||s.has(`c${r+1}`)||s.has(`${n+1},${r+1}`),o=((t,n,r)=>r?.inputType?r.inputType:e?.rows?.inputType?.[t+1]||e?.columns?.inputType?.[n+1]||e?.cells?.inputType?.[`${t+1},${n+1}`]||{type:"text"})(n,r,t||AA);l[n][r]={...t,value:t?.value??"",readOnly:t?.readOnly?t.readOnly:i,inputType:o,contextDisable:t?.contextDisable}})}),n[t]=l,g.length>1){const e=i[0]||[];r[t]=Array.from({length:a},(t,n)=>({newData:"",oldData:e[n]?.value||""}))}}),_(n),g.length>1&&Q(r);const i=Object.keys(n)[0];i&&void 0!==n[i]&&W(n[i])}},[r]),l(()=>{v&&v(T),"File saved"===T&&setTimeout(()=>{I("")},2e3)},[T]),l(()=>{I("Saving..."),re(oe())},[P,$.current]);const re=i.useCallback(Xs(e=>{if(g.length>1){const t={...X};O.forEach((n,r)=>{const i=(e[r].data[0]||[]).map(e=>e?.value||"");t[n]=(t[n]||[]).map((e,t)=>({...e,newData:i[t]||""}))}),Q(t);const n=O.map(e=>({sheetName:e,headers:t[e]||[]}));g(e,n)}else g(e);I("File saved")},y),[g,X,O]),ie=i.useCallback(e=>{e.ctrlKey&&"s"===e.key&&(e.preventDefault(),e.stopPropagation(),re(oe()))},[g]);i.useEffect(()=>(document.addEventListener("keydown",ie),()=>{document.removeEventListener("keydown",ie)}),[ie]);const oe=()=>O.map(e=>{const t=P[e]?.map(e=>{const t=e.reduce((e,t,n)=>""!==String(t?.value??"").trim()?n:e,-1),n=e.map((e,n)=>e&&e.style&&n<=t?{value:e.value,style:Uy(e.style,x),readOnly:e.readOnly,inputType:e.inputType,contextDisable:e.contextDisable}:null).filter(e=>null!==e);return n.length>0?n:[]})||[],n=t.filter((e,n)=>{const r=t.slice(n+1).some(e=>e.length>0);return e.length>0||r});return{sheetName:e,data:G(n.length)?[[]]:n}}),[ae,le]=c(null),se=()=>O.length>=V,ce=()=>{if(se())return;const e=((e,t)=>{const n=t.map(e=>e.toLowerCase());let r=`${e}1`,i=2;for(;n.includes(r.toLowerCase());)r=`${e}${i}`,i++;return r})("Sheet",O),t=Array.from({length:u},()=>Array.from({length:f},()=>AA));N(t=>[...t,e]),B({index:O?.length,name:e}),_({...P,[e]:t}),W(t),g.length>1&&Q(t=>({...t,[e]:Array.from({length:f},()=>({newData:"",oldData:""}))})),$.current=e},de=(e=[[AA]])=>{W(e)},ue=(e,t,n)=>{const r=e.target;if(!r||r?.textContent?.trim()===n?.trim())return void le(null);const i=(r.textContent||"").trim();if(!i)return oc.warning("Sheet name cannot be empty."),r.textContent=j.name,void le(null);if(i.length>50)return oc.warning("The sheet name cannot be greater than 50 characters"),r.textContent=j.name,void le(null);if(O.map(e=>e.toLowerCase()).includes(i.toLowerCase())&&n.trim()?.toLowerCase()!==i?.toLowerCase())return oc.warning("Sheet name already exists"),r.textContent=j.name,void le(null);let o=O;de(P?.[n]),o.splice(t,1,i);const a=function(e,t,n){if(!(t in e))throw new Error(`Key "${t}" not found in object`);const{[t]:r,...i}=e;return{...i,[n]:r??[]}}(P,n,i);$.current=i,B(e=>({...e,name:i})),_(a),g.length>1&&Q(e=>{const t={...e},r=t[n];return delete t[n],t[i]=r??[],t}),le(null)};const fe=(e,t)=>{e!==j.name&&t!==j.index&&(B({index:t,name:e}),N(n=>{const r=[...n];return r[t]=e,r}),de(P[e]),$.current=e)},he=i.useCallback((e,t=!1)=>{const n=e.target;(!n.closest(".ff-excel-tab-list")&&!n.closest(".ff-excel-sheet")||t)&&Z.open&&(R({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]}),t||(e.preventDefault(),e.stopPropagation()))},[Z.open]);i.useEffect(()=>(document.addEventListener("contextmenu",he),document.addEventListener("click",e=>he(e,!0)),()=>{document.removeEventListener("contextmenu",he),document.removeEventListener("click",e=>he(e,!0))}),[he]);const Ce=(e,t,n)=>{e.preventDefault();const r=[{label:"Add Sheet",value:"Add Sheet",iconName:"plus_icon",action:()=>ce(),disableTooltip:"Sheet limit reached",visible:!1,disable:se()},...L?[]:[{label:"Delete Sheet",value:"Delete Sheet",iconName:"delete",action:()=>((e,t)=>{if(O.length>1){let n=O.slice();n.splice(t,1);const r={...P};delete r[e];const i=Math.min(t,n.length-1);N(n),_(r),g.length>1&&Q(t=>{const n={...t};return delete n[e],n});const o=n[i]?n[i]:"";B({index:i,name:o}),de(r?.[o]),$.current=o}else oc.warning("Cannot delete the last sheet.")})(t,n),disableTooltip:"",visible:!1,disable:!1}]];R(e=>({...e,open:!0,contextType:"sheet",options:r}))};l(()=>{ne.current?.removeSelect()},[j.name]);return e(t,{children:O.length>0&&n("div",{ref:ee,className:"ff-excel",onContextMenu:e=>{e.preventDefault();const t=te.current?.parentElement?.getBoundingClientRect(),n=window.scrollX,r=window.scrollY;let i=e.clientX-(t?.left||0)+n,o=e.clientY-(t?.top||0)+r;const a=300,l=window.innerWidth,s=window.innerHeight,c=l-e.clientX,d=e.clientX,u=s-e.clientY,f=e.clientY;c<a&&d>=a?i=e.clientX-(t?.left||0)+n-150:i+=2,u<200&&f>=200?o=e.clientY-(t?.top||0)+r-20:o+=2,e.target.classList.contains("ff-excel-tab-list")?J({x:i,y:o-(L?32:65)}):(i+a>l&&(i=l-a-2),i<0&&(i=2),J({x:i+m,y:o+p}))},onClick:e=>{e.stopPropagation(),Z.open&&R({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]})},children:[e("div",{ref:te,className:"ff-excel-sheet",children:e(Qy,{ref:ne,editable:C,attachmentAction:A,toolbar:s,sheetHeight:h,setContextMenu:R,contextOption:o,data:U,columnContextEnable:b,rowContextEnable:E,minimumColumnWidth:x,onEvaluatedDataChange:e=>{_(t=>({...t,[$.current]:e}))},workRef:ee,scroller:w,maxRowLimit:H,maxColLimit:k,disableDeleteOption:L,contextMenu:Z,getActiveCell:S,onAddColumn:(e,t)=>{g.length>1&&Q(n=>{const r=j.name,i=[...n[r]||[]],o=t?e:e+1;return i.splice(o,0,{newData:"",oldData:""}),{...n,[r]:i}})},onDeleteColumn:e=>{g.length>1&&Q(t=>{const n=j.name,r=[...t[n]||[]];return r.splice(e,1),{...t,[n]:r}})}},j.name)}),"hide"!==d&&n("div",{className:"ff-excel-sheet-bar",children:["show"===d&&n("div",{className:"ff-excel-add-sheet-set",children:[e(Y,{title:se()?"Sheet limit reached":"Add Sheet",placement:"top",children:e(F,{disabled:!C||se(),className:"ff-excel-add-sheet-icon",hoverEffect:!0,onClick:ce,name:"plus_icon",height:20,width:20})}),e(To,{options:(t=>t.map((t,r)=>({label:n("div",{style:{display:"flex",gap:"8px"},children:[j?.name===t?e(F,{height:16,width:16,name:"tick"}):e("div",{style:{height:"16px",width:"24px"}}),e(Y,{title:Ln(t,20,"count")?t:"",children:e(q,{children:xn(t,20,"count")})})]}),name:r,value:t})))(O),targetRef:z,onOptionClick:e=>{const{value:t,name:n=""}=e;fe(t,parseInt(n))},dropdownPlacement:"top",iconName:"show_script",tooltipTitle:"All Sheets",tooltipPlacement:"top",dropdownHeight:215,selectedValue:j.name})]}),e("div",{className:"ff-excel-tab-container",children:O.map((t,n)=>e(q,{lineHeight:"16px",children:e("div",{onContextMenu:e=>{fe(t,n),M&&Ce(e,t,n)},className:D("ff-excel-tab-list",{active:t===j.name}),onClick:()=>{fe(t,n)},suppressContentEditableWarning:ae===n,onDoubleClick:e=>{"show"===d&&(le(n),null===ae&&setTimeout(()=>(e=>{const t=document.createRange(),n=window.getSelection();t.selectNodeContents(e),t.collapse(!1),n?.removeAllRanges(),n?.addRange(t)})(e.target),0))},contentEditable:C&&ae===n,onBlur:e=>{ue(e,n,t)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),ue(e,n,t))},children:t})},t))})]}),Z.open&&e(Gy,{contextMenu:Z,position:K,editable:C}),e(ic,{})]})})},Ky=({label:t="",isActive:n=!0,onClick:r=()=>{},isFilterChip:i=!1})=>{const o=i?"filter":"module";return e("div",{className:D("ff-module-chip",{"ff-filter-chip":i,[`ff-${o}-chip--active`]:n,[`ff-${o}-chip--hover`]:!n}),onClick:r,children:e(q,{lineHeight:"18px",className:"module-typography",children:t})})},Jy=({x:e,y:t,radius:n,startAngle:r,endAngle:i})=>{const o=e+n*Math.cos(r),a=t+n*Math.sin(r),l=e+n*Math.cos(i),s=t+n*Math.sin(i),c=i-r>Math.PI?1:0;return i-r>=2*Math.PI?`\n M ${e+n} ${t}\n A ${n} ${n} 0 1 1 ${e-n} ${t} \n A ${n} ${n} 0 1 1 ${e+n} ${t}\n `:`M ${o} ${a} A ${n} ${n} 0 ${c} 1 ${l} ${s}`},$y=({radius:t=15,lineWidth:r=5,label:i,percentageValue:o,icon:l,fontSize:s=10,labelColor:d="",arcColor:u="var(--brand-color)",backgroundArcColor:f="var(--ff-select-scroll-thumb-color)",isSelectedArch:h=!1,onSelect:C})=>{const[p,m]=c({x:0,y:0}),[g,v]=c(!1),A=a(null);let y=-Math.PI/2;const w=2*(t+r),{backgroundArcPath:b,foregroundArcPath:E}=((e,t,n)=>{const r=t,i=r+Math.max(0,Math.min(e,100))/100*2*Math.PI;return{backgroundArcPath:Jy({x:0,y:0,radius:n,startAngle:0,endAngle:2*Math.PI}),foregroundArcPath:Jy({x:0,y:0,radius:n,startAngle:r,endAngle:i})}})(o,y,t),M=()=>{v(!0)},x=()=>{m({x:0,y:0}),v(!1)},L=e=>{if(A.current){const t=A.current.getBoundingClientRect();m({x:e.clientX-t.left,y:e.clientY-t.top})}};return n("div",{ref:A,className:"ff-icon-radial-chart-container",style:{"--fontSize":`${s}px`},onClick:C,children:[e("svg",{width:w,height:w,viewBox:`0 0 ${w} ${w}`,role:"img",children:n("g",{transform:`translate(${t+r}, ${t+r})`,children:[e("path",{d:b,fill:"none",stroke:f,strokeWidth:r,onMouseEnter:M,onMouseLeave:x,onMouseMove:L}),e("path",{d:E,fill:"none",stroke:u,strokeWidth:r,onMouseEnter:M,onMouseLeave:x,onMouseMove:L}),h&&e("path",{d:E,fill:"none",stroke:"var(--dotted-border-color)",strokeOpacity:"0.4",strokeWidth:r,onMouseEnter:M,onMouseLeave:x,onMouseMove:L}),l?e("foreignObject",{x:"-10",y:"-10",width:"20",height:"20",children:e(F,{className:"ff-radial-chart-icon-padding",name:l,height:20,width:20})}):e("text",{x:"0",y:"0",fill:d||u,textAnchor:"middle",dominantBaseline:"central",children:`${Math.round(o)}%`})]})}),g&&n("div",{className:"ff-icon-radial-chart-tooltip",style:{position:"absolute",left:`${p.x+15}px`,top:p.y-5+"px"},children:[e(q,{children:`${i} : `}),n(q,{children:[o,"%"]})]})]})},ew=({mediaSrc:t,fileId:r,onExpandClick:i,onDeleteClick:o,onDownloadClick:a,height:l="75px",width:s="79px",fileName:c,thumbnailMediaSrc:d,isDelete:u})=>e("div",{className:"ff-attach-media-container",style:{height:l,width:s},children:n("div",{className:"ff-media-wrapper",style:{height:l,width:s},children:[e("img",{src:d||t,alt:"Attached"}),n("div",{className:"ff-hover-icons",children:[n("div",{className:"ff-top-icons",children:[e("div",{className:"ff-icon-container",children:e(Y,{title:"Download File",placement:"bottom",children:e(F,{name:"download_file_icon",height:10,width:10,onClick:a,color:"var(--icons-default-color)"})})}),u&&e("div",{className:"ff-icon-container",children:e(Y,{title:"Delete",placement:"bottom",children:e(F,{name:"delete",height:10,width:10,color:"var(--ff-delete-button-attachment)",onClick:()=>{o&&o(r)}})})})]}),e("div",{className:"ff-expand-icon-container",children:e(Y,{title:"Maximize",placement:"bottom",children:e(F,{name:"expand_icon",height:16,width:16,onClick:i})})})]}),e(q,{color:"var(--text-area-default-color)",fontWeight:"medium",className:"ff-media-text",children:c})]})}),tw=({icon:r,status:i,count:o,text:a,style:s={width:"196.4px"},resetToggle:d,onSelectedStatus:u=e=>{}})=>{const[f,h]=c(!1),C=["total defects","defect density","open defects","closed defects","quality score"],p=C.includes(i.toLowerCase()),m=C.includes(i.toLowerCase());l(()=>{h(!d)},[d]);return n("div",{className:`ff-card-container ${i.toLowerCase()} ${f?"toggled":""}`,style:s,onClick:()=>(e=>{C.includes(e.toLowerCase())||(h(!0),u(e))})(i),children:[n("div",{className:"ff-status-bar",children:[e("div",{children:e(F,{name:r,height:20,width:20,hoverEffect:!1})}),!C.includes(i.toLowerCase())&&e(q,{fontWeight:"semi-bold",fontSize:"10px",textAlign:"center",lineHeight:"15px",className:"ff-status-text",as:"div",children:i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()})]}),e("div",{className:"ff-content "+(m?"red-background":""),children:n(t,p?{children:[e(q,{fontWeight:"semi-bold",fontSize:"10px",className:"ff-text",lineHeight:"15px",color:"var(--ff-chip-text-color)",children:a}),e(q,{fontWeight:"semi-bold",fontSize:"24px",className:"ff-number",lineHeight:"36px",children:"defect density"===i.toLowerCase()?n(t,{children:[o.toString().padStart(2,"0"),e(q,{fontSize:"15px",fontWeight:"semi-bold",children:"/ Modules"})]}):"quality score"===i.toLowerCase()?`${parseFloat(o.toString()).toFixed(2)}%`:o.toString().padStart(2,"0")})]}:{children:[e(q,{fontWeight:"semi-bold",fontSize:"24px",className:"ff-number",lineHeight:"24px",color:f?"var(--base-bg-color)":"",children:o.toString().padStart(2,"0")}),e(q,{className:"ff-text",lineHeight:"18px",color:f?"var(--base-bg-color)":"var(--ff-chip-text-color)",children:a})]})})]})},nw=({option:t})=>{const r=a(null),[i,o]=c(!1);l(()=>{const e=r.current;if(!e)return;const t=()=>{o(e.scrollWidth>e.clientWidth)},n=requestAnimationFrame(t);return window.addEventListener("resize",t),()=>{cancelAnimationFrame(n),window.removeEventListener("resize",t)}},[t]);const s={LOCAL:"local_variable_icon",GLOBAL:"global_variable_icon",PROJECT_ENVIRONMENT:"project_env_variable_icon"},d=e=>"_startforloop"===e?.type?`FLV_for:${e?.name}`:"DATAPROVIDER"===e?.type?`${e?.dpName}:${e?.varname}`:e?.name;return n("div",{style:{width:"-webkit-fill-available"},className:"ff-variable-option ff-variable-data",children:[e(Y,{title:i?d(t):"",style:{width:"calc(100% - 32px)"},children:e("span",{ref:r,className:"ff-truncated_text",children:d(t)})}),e(F,{name:(e=>{if(!e)return"";const t=e._id||e.id;return t?.startsWith("PARAMETER")?"step_group_parameter":"LOCAL"===e.type&&"STEPGROUP"===e?.parentVariableType?"step_group_variable":"_startforloop"===e.type?"for_loop_variable":"DATAPROVIDER"===e.type?"data_provider_variable":s[e.type||""]||""})(t),height:24,width:24,hoverEffect:!0})]})};function rw(e){return()=>e}function iw(e){e()}function ow(e,t){return n=>e(t(n))}function aw(e,t){return()=>e(t)}function lw(e){return void 0!==e}function sw(){}function cw(e,t){return t(e),e}function dw(e,t){return t(e)}function uw(...e){return e}function fw(e,t){return e(1,t)}function hw(e,t){e(0,t)}function Cw(e){e(2)}function pw(e){return e(4)}function mw(e,t){return fw(e,function(e,t){return n=>e(t,n)}(t,0))}function gw(e,t){const n=e(1,e=>{n(),t(e)});return n}function vw(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function Aw(e,t){return e===t}function yw(e=Aw){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function ww(e){return t=>n=>{e(n)&&t(n)}}function bw(e){return t=>ow(t,e)}function Ew(e){return t=>()=>{t(e)}}function Mw(e,...t){const n=function(...e){return t=>e.reduceRight(dw,t)}(...t);return(t,r)=>{switch(t){case 2:return void Cw(e);case 1:return fw(e,n(r))}}}function xw(e,t){return n=>r=>{n(t=e(t,r))}}function Lw(e){return t=>n=>{e>0?e--:t(n)}}function Hw(e){let t,n=null;return r=>i=>{n=i,!t&&(t=setTimeout(()=>{t=void 0,r(n)},e))}}function kw(...e){const t=new Array(e.length);let n=0,r=null;const i=2**e.length-1;return e.forEach((e,o)=>{const a=2**o;fw(e,e=>{const l=n;n|=a,t[o]=e,l!==i&&n===i&&r&&(r(),r=null)})}),e=>o=>{const a=()=>{e([o].concat(t))};n===i?a():r=a}}function Vw(e){let t=e;const n=zw();return(e,r)=>{switch(e){case 0:t=r;break;case 1:r(t);break;case 4:return t}return n(e,r)}}function Sw(e,t){return cw(Vw(t),t=>mw(e,t))}function zw(){const e=[];return(t,n)=>{switch(t){case 0:return void e.slice().forEach(e=>{e(n)});case 2:return void e.splice(0,e.length);case 1:return e.push(n),()=>{const t=e.indexOf(n);t>-1&&e.splice(t,1)}}}}function Ow(e){return cw(zw(),t=>mw(e,t))}function Nw(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:Dw(),singleton:n}}const Dw=()=>Symbol();function Tw(...e){const t=zw(),n=new Array(e.length);let r=0;const i=2**e.length-1;return e.forEach((e,o)=>{const a=2**o;fw(e,e=>{n[o]=e,r|=a,r===i&&hw(t,n)})}),function(e,o){switch(e){case 2:return void Cw(t);case 1:return r===i&&o(n),fw(t,o)}}}function Iw(e,t=Aw){return Mw(e,yw(t))}function Zw(...e){return function(t,n){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(iw)}}(...e.map(e=>fw(e,n)))}}}const Rw=0,jw=1,Bw=2,Pw=3,_w={[Rw]:"debug",[Pw]:"error",[jw]:"log",[Bw]:"warn"},Fw=Nw(()=>{const e=Vw(Pw);return{log:Vw((t,n,r=jw)=>{r>=((typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL??pw(e))&&console[_w[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0}),qw=new WeakMap;function Uw(e){return"self"in e?e.document.documentElement:e}function Ww(e){qw.delete(Uw(e))}function Xw(e,t){return function(e){const t=Uw(e),n=qw.get(t);if(void 0!==n)return n;const r="rtl"===t.ownerDocument.defaultView.getComputedStyle(t).direction;return qw.set(t,r),r}(e)?-t:t}const Qw=Xw;function Gw(e,t){return Xw(e,t)}function Yw(e,t,n){return Kw(e,t,n).callbackRef}function Kw(e,t,n){const r=i.useRef(null);let o=e=>{};const a=i.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(t=>{const r=()=>{const n=t[0].target;null!==n.offsetParent&&e(n)};n?r():requestAnimationFrame(r)}):null,[e,n]);return o=e=>{e&&t?(a?.observe(e),r.current=e):(r.current&&a?.unobserve(r.current),r.current=null)},{callbackRef:o,ref:r}}function Jw(e,t,n,r,o,a,l,s,c){const d=i.useCallback(n=>{const i=function(e,t,n,r){const i=e.length;if(0===i)return null;const o=[];for(let a=0;a<i;a++){const i=e.item(a);if(void 0===i.dataset.index)continue;const l=parseInt(i.dataset.index),s=parseFloat(i.dataset.knownSize),c=t(i,n);if(0===c&&r("Zero-sized element, this should not happen",{child:i},Pw),c===s)continue;const d=o[o.length-1];0===o.length||d.size!==c||d.endIndex!==l-1?o.push({endIndex:l,size:c,startIndex:l}):o[o.length-1].endIndex++}return o}(n.children,t,s?"offsetWidth":"offsetHeight",o);let c=n.parentElement;for(;void 0===c.dataset.virtuosoScroller;)c=c.parentElement;const d="window"===c.lastElementChild.dataset.viewportType;let u;d&&(u=c.ownerDocument.defaultView);const f=l?s?l.scrollWidth:l.scrollHeight:d?s?u.document.documentElement.scrollWidth:u.document.documentElement.scrollHeight:s?c.scrollWidth:c.scrollHeight,h=l?s?l.offsetWidth:l.offsetHeight:d?s?u.innerWidth:u.innerHeight:s?c.offsetWidth:c.offsetHeight,C=l?s?Qw(l,l.scrollLeft):l.scrollTop:d?s?Qw(u,u.scrollX||u.document.documentElement.scrollLeft):u.scrollY||u.document.documentElement.scrollTop:s?Qw(c,c.scrollLeft):c.scrollTop;r({scrollHeight:f,scrollTop:Math.max(C,0),viewportHeight:h}),a?.(s?$w("column-gap",getComputedStyle(n).columnGap,o):$w("row-gap",getComputedStyle(n).rowGap,o)),null!==i&&e(i)},[e,t,o,a,l,r,s]);return Kw(d,n,c)}function $w(e,t,n){return"normal"!==t&&!0!==t?.endsWith("px")&&n(`${e} was not resolved to pixel value correctly`,t,Bw),"normal"===t?0:parseInt(t??"0",10)}function eb(e,t,n){const r=i.useRef(null),o=i.useCallback(n=>{if(!n?.offsetParent)return;const i=n.getBoundingClientRect(),o=i.width;let a,s;if(t){const e=t.getBoundingClientRect(),n=i.top-e.top;s=e.height-Math.max(0,n),a=n+t.scrollTop}else{const e=l.current.ownerDocument.defaultView;s=e.innerHeight-Math.max(0,i.top),a=i.top+e.scrollY}r.current={listHeight:i.height,offsetTop:a,visibleHeight:s,visibleWidth:o},e(r.current)},[e,t]),{callbackRef:a,ref:l}=Kw(o,!0,n),s=i.useCallback(()=>{o(l.current)},[o,l]);return i.useEffect(()=>{if(t){t.addEventListener("scroll",s);const e=new ResizeObserver(()=>{requestAnimationFrame(s)});return e.observe(t),()=>{t.removeEventListener("scroll",s),e.unobserve(t)}}const e=l.current?.ownerDocument.defaultView;return e?.addEventListener("scroll",s),e?.addEventListener("resize",s),()=>{e?.removeEventListener("scroll",s),e?.removeEventListener("resize",s)}},[s,t,l]),a}const tb=Nw(()=>{const e=zw(),t=zw(),n=Vw(0),r=zw(),i=Vw(0),o=zw(),a=zw(),l=Vw(0),s=Vw(0),c=Vw(0),d=Vw(0),u=zw(),f=zw(),h=Vw(!1),C=Vw(!1),p=Vw(!1);return mw(Mw(e,bw(({scrollTop:e})=>e)),t),mw(Mw(e,bw(({scrollHeight:e})=>e)),a),mw(t,i),{deviation:n,fixedFooterHeight:c,fixedHeaderHeight:s,footerHeight:d,headerHeight:l,horizontalDirection:C,scrollBy:f,scrollContainerState:e,scrollHeight:a,scrollingInProgress:h,scrollTo:u,scrollTop:t,skipAnimationFrameInResizeObserver:p,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:o}},[],{singleton:!0}),nb={lvl:0};function rb(e,t){const n=e.length;if(0===n)return[];let{index:r,value:i}=t(e[0]);const o=[];for(let a=1;a<n;a++){const{index:n,value:l}=t(e[a]);o.push({end:n-1,start:r,value:i}),r=n,i=l}return o.push({end:1/0,start:r,value:i}),o}function ib(e){return e===nb}function ob(e,t){if(!ib(e))return t===e.k?e.v:t<e.k?ob(e.l,t):ob(e.r,t)}function ab(e,t,n="k"){if(ib(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=ab(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return ab(e.l,t,n)}function lb(e,t,n){return ib(e)?vb(t,n,1):t===e.k?Cb(e,{k:t,v:n}):t<e.k?Ab(Cb(e,{l:lb(e.l,t,n)})):Ab(Cb(e,{r:lb(e.r,t,n)}))}function sb(){return nb}function cb(e,t,n){if(ib(e))return[];return function(e){return rb(e,({k:e,v:t})=>({index:e,value:t}))}(fb(e,ab(e,t)[0],n))}function db(e,t){if(ib(e))return nb;const{k:n,l:r,r:i}=e;if(t===n){if(ib(r))return i;if(ib(i))return r;const[t,n]=gb(r);return hb(Cb(e,{k:t,l:pb(r),v:n}))}return hb(Cb(e,t<n?{l:db(r,t)}:{r:db(i,t)}))}function ub(e){return ib(e)?[]:[...ub(e.l),{k:e.k,v:e.v},...ub(e.r)]}function fb(e,t,n){if(ib(e))return[];const{k:r,l:i,r:o,v:a}=e;let l=[];return r>t&&(l=l.concat(fb(i,t,n))),r>=t&&r<=n&&l.push({k:r,v:a}),r<=n&&(l=l.concat(fb(o,t,n))),l}function hb(e){const{l:t,lvl:n,r:r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(mb(t))return yb(Cb(e,{lvl:n-1}));if(!ib(t)&&!ib(t.r))return Cb(t.r,{l:Cb(t,{r:t.r.l}),lvl:n,r:Cb(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(mb(e))return wb(Cb(e,{lvl:n-1}));if(!ib(r)&&!ib(r.l)){const t=r.l,i=mb(t)?r.lvl-1:r.lvl;return Cb(t,{l:Cb(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:wb(Cb(r,{l:t.r,lvl:i}))})}throw new Error("Unexpected empty nodes")}function Cb(e,t){return vb(void 0!==t.k?t.k:e.k,void 0!==t.v?t.v:e.v,void 0!==t.lvl?t.lvl:e.lvl,void 0!==t.l?t.l:e.l,void 0!==t.r?t.r:e.r)}function pb(e){return ib(e.r)?e.l:hb(Cb(e,{r:pb(e.r)}))}function mb(e){return ib(e)||e.lvl>e.r.lvl}function gb(e){return ib(e.r)?[e.k,e.v]:gb(e.r)}function vb(e,t,n,r=nb,i=nb){return{k:e,l:r,lvl:n,r:i,v:t}}function Ab(e){return wb(yb(e))}function yb(e){const{l:t}=e;return ib(t)||t.lvl!==e.lvl?e:Cb(t,{r:Cb(e,{l:t.r})})}function wb(e){const{lvl:t,r:n}=e;return ib(n)||ib(n.r)||n.lvl!==t||n.r.lvl!==t?e:Cb(n,{l:Cb(e,{r:n.l}),lvl:t+1})}function bb(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}function Eb(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}const Mb=Nw(()=>({recalcInProgress:Vw(!1)}),[],{singleton:!0});function xb(e,t,n){return e[Lb(e,t,n)]}function Lb(e,t,n,r=0){let i=e.length-1;for(;r<=i;){const o=Math.floor((r+i)/2),a=n(e[o],t);if(0===a)return o;if(-1===a){if(i-r<2)return o-1;i=o-1}else{if(i===r)return o;r=o+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function Hb(e,t){return Math.round(e.getBoundingClientRect()[t])}function kb(e){return!ib(e.groupOffsetTree)}function Vb({index:e},t){return t===e?0:t<e?-1:1}function Sb({offset:e},t){return t===e?0:t<e?-1:1}function zb(e,t,n){if(0===t.length)return 0;const{index:r,offset:i,size:o}=xb(t,e,Vb),a=e-r,l=o*a+(a-1)*n+i;return l>0?l+n:l}function Ob(e,t){if(!kb(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function Nb(e,t,n){if(function(e){return typeof e.groupIndex<"u"}(e))return t.groupIndices[e.groupIndex]+1;let r=Ob("LAST"===e.index?n:e.index,t);return r=Math.max(0,r,Math.min(n,r)),r}function Db(e,t,n,r=0){return r>0&&(t=Math.max(t,xb(e,r,Vb).offset)),rb(function(e,t,n,r){const i=Lb(e,t,r),o=Lb(e,n,r,i);return e.slice(i,o+1)}(e,t,n,Sb),Rb)}function Tb(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,Rw);const o=e.sizeTree;let a=o,l=0;if(n.length>0&&ib(o)&&2===t.length){const e=t[0].size,r=t[1].size;a=n.reduce((t,n)=>lb(lb(t,n,e),n+1,r),a)}else[a,l]=function(e,t){let n=ib(e)?0:1/0;for(const r of t){const{endIndex:t,size:i,startIndex:o}=r;if(n=Math.min(n,o),ib(e)){e=lb(e,0,i);continue}const a=cb(e,o-1,t+1);if(a.some(jb(r)))continue;let l=!1,s=!1;for(const{end:n,start:r,value:o}of a)l?(t>=r||i===o)&&(e=db(e,r)):(s=o!==i,l=!0),n>t&&t>=r&&o!==i&&(e=lb(e,t+1,o));s&&(e=lb(e,o,i))}return[e,n]}(a,t);if(a===o)return e;const{lastIndex:s,lastOffset:c,lastSize:d,offsetTree:u}=Zb(e.offsetTree,l,a,i);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>lb(e,t,zb(t,u,i)),sb()),lastIndex:s,lastOffset:c,lastSize:d,offsetTree:u,sizeTree:a}}function Ib(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function Zb(e,t,n,r){let i=e,o=0,a=0,l=0,s=0;if(0!==t){s=Lb(i,t-1,Vb),l=i[s].offset;const e=ab(n,t-1);o=e[0],a=e[1],i.length&&i[s].size===ab(n,t)[1]&&(s-=1),i=i.slice(0,s+1)}else i=[];for(const{start:e,value:s}of cb(n,t,1/0)){const t=e-o,n=t*a+l+t*r;i.push({index:e,offset:n,size:s}),o=e,l=n,a=s}return{lastIndex:o,lastOffset:l,lastSize:a,offsetTree:i}}function Rb(e){return{index:e.index,value:e}}function jb(e){const{endIndex:t,size:n,startIndex:r}=e;return e=>e.start===r&&(e.end===t||e.end===1/0)&&e.value===n}const Bb={offsetHeight:"height",offsetWidth:"width"},Pb=Nw(([{log:e},{recalcInProgress:t}])=>{const n=zw(),r=zw(),i=Sw(r,0),o=zw(),a=zw(),l=Vw(0),s=Vw([]),c=Vw(void 0),d=Vw(void 0),u=Vw(void 0),f=Vw(void 0),h=Vw((e,t)=>Hb(e,Bb[t])),C=Vw(void 0),p=Vw(0),m={groupIndices:[],groupOffsetTree:sb(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:sb()},g=Sw(Mw(n,kw(s,e,p),xw(Tb,m),yw()),m),v=Sw(Mw(s,yw(),xw((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),bw(({prev:e})=>e)),[]);mw(Mw(s,ww(e=>e.length>0),kw(g,p),bw(([e,t,n])=>{const r=e.reduce((e,r,i)=>lb(e,r,zb(r,t.offsetTree,n)||i),sb());return{...t,groupIndices:e,groupOffsetTree:r}})),g),mw(Mw(r,kw(g),ww(([e,{lastIndex:t}])=>e<t),bw(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),mw(c,d);const A=Sw(Mw(c,bw(e=>void 0===e)),!0);mw(Mw(d,ww(e=>void 0!==e&&ib(pw(g).sizeTree)),bw(e=>{const t=pw(u),n=pw(s).length>0;return void 0!==t&&0!==t?n?[{endIndex:0,size:t,startIndex:0},{endIndex:1,size:e,startIndex:1}]:[]:[{endIndex:0,size:e,startIndex:0}]})),n),mw(Mw(f,ww(e=>void 0!==e&&e.length>0&&ib(pw(g).sizeTree)),bw(e=>{const t=[];let n=e[0],r=0;for(let i=1;i<e.length;i++){const o=e[i];o!==n&&(t.push({endIndex:i-1,size:n,startIndex:r}),n=o,r=i)}return t.push({endIndex:e.length-1,size:n,startIndex:r}),t})),n),mw(Mw(s,kw(u,d),ww(([,e,t])=>void 0!==e&&void 0!==t),bw(([e,t,n])=>{const r=[];for(let i=0;i<e.length;i++){const o=e[i],a=e[i+1];r.push({startIndex:o,endIndex:o,size:t}),void 0!==a&&r.push({startIndex:o+1,endIndex:a-1,size:n})}return r})),n);const y=Ow(Mw(n,kw(g),xw(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:m}),bw(e=>e.changed)));fw(Mw(l,xw((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),bw(e=>e.diff)),e=>{const{groupIndices:n}=pw(g);if(e>0)hw(t,!0),hw(o,e+Ib(e,n));else if(e<0){const t=pw(v);t.length>0&&(e-=Ib(-e,t)),hw(a,e)}}),fw(Mw(l,kw(e)),([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:l},Pw)});const w=Ow(o);mw(Mw(o,kw(g),bw(([e,t])=>{const n=t.groupIndices.length>0,r=[],i=t.lastSize;if(n){const n=ob(t.sizeTree,0);let o=0,a=0;for(;o<e;){const e=t.groupIndices[a],l=t.groupIndices.length===a+1?1/0:t.groupIndices[a+1]-e-1;r.push({endIndex:e,size:n,startIndex:e}),r.push({endIndex:e+1+l-1,size:i,startIndex:e+1}),a++,o+=l+1}const l=ub(t.sizeTree);return o!==e&&l.shift(),l.reduce((t,{k:n,v:r})=>{let i=t.ranges;return 0!==t.prevSize&&(i=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:r,ranges:i}},{prevIndex:e,prevSize:0,ranges:r}).ranges}return ub(t.sizeTree).reduce((t,{k:n,v:r})=>({prevIndex:n+e,prevSize:r,ranges:[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]}),{prevIndex:0,prevSize:i,ranges:[]}).ranges})),n);const b=Ow(Mw(a,kw(g,p),bw(([e,{offsetTree:t},n])=>zb(-e,t,n))));return mw(Mw(a,kw(g,p),bw(([e,t,n])=>{if(t.groupIndices.length>0){if(ib(t.sizeTree))return t;let r=sb();const i=pw(v);let o=0,a=0,l=0;for(;o<-e;){l=i[a];const e=i[a+1]-l-1;a++,o+=e+1}if(r=ub(t.sizeTree).reduce((t,{k:n,v:r})=>lb(t,Math.max(0,n+e),r),r),o!==-e){r=lb(r,0,ob(t.sizeTree,l));r=lb(r,1,ab(t.sizeTree,1-e)[1])}return{...t,sizeTree:r,...Zb(t.offsetTree,0,r,n)}}const r=ub(t.sizeTree).reduce((t,{k:n,v:r})=>lb(t,Math.max(0,n+e),r),sb());return{...t,sizeTree:r,...Zb(t.offsetTree,0,r,n)}})),g),{beforeUnshiftWith:w,data:C,defaultItemSize:d,firstItemIndex:l,fixedItemSize:c,fixedGroupSize:u,gap:p,groupIndices:s,heightEstimates:f,itemSize:h,listRefresh:y,shiftWith:a,shiftWithOffset:b,sizeRanges:n,sizes:g,statefulTotalCount:i,totalCount:r,trackItemSizes:A,unshiftWith:o}},uw(Fw,Mb),{singleton:!0});function _b(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}const Fb=Nw(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:i}])=>{const o=zw(),a=zw(),l=Ow(Mw(o,bw(_b)));return mw(Mw(l,bw(e=>e.totalCount)),n),mw(Mw(l,bw(e=>e.groupIndices)),e),mw(Mw(Tw(i,t,r),ww(([e,t])=>kb(t)),bw(([e,t,n])=>ab(t.groupOffsetTree,Math.max(e-n,0),"v")[0]),yw(),bw(e=>[e])),a),{groupCounts:o,topItemsIndexes:a}},uw(Pb,tb)),qb=Nw(([{log:e}])=>{const t=Vw(!1),n=Ow(Mw(t,ww(e=>e),yw()));return fw(t,t=>{t&&pw(e)("props updated",{},Rw)}),{didMount:n,propsReady:t}},uw(Fw),{singleton:!0}),Ub=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Wb(e){const t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!Ub)&&(t.behavior="auto"),void 0===t.offset&&(t.offset=0),t}const Xb=Nw(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:o,footerHeight:a,headerHeight:l,scrollingInProgress:s,scrollTo:c,smoothScrollTargetReached:d,viewportHeight:u},{log:f}])=>{const h=zw(),C=zw(),p=Vw(0);let m=null,g=null,v=null;function A(){null!==m&&(m(),m=null),null!==v&&(v(),v=null),g&&(clearTimeout(g),g=null),hw(s,!1)}return mw(Mw(h,kw(n,u,r,p,l,a,f),kw(e,o,i),bw(([[e,n,r,i,o,a,l,c],u,f,p])=>{const y=Wb(e),{align:w,behavior:b,offset:E}=y,M=i-1,x=Nb(y,n,M);let L=zb(x,n.offsetTree,u)+a;"end"===w?(L+=f+ab(n.sizeTree,x)[1]-r+p,x===M&&(L+=l)):"center"===w?L+=(f+ab(n.sizeTree,x)[1]-r+p)/2:L-=o,void 0!==E&&0!==E&&(L+=E);const H=t=>{A(),t?(c("retrying to scroll to",{location:e},Rw),hw(h,e)):(hw(C,!0),c("list did not change, scroll successful",{},Rw))};if(A(),"smooth"===b){let e=!1;v=fw(t,t=>{e=e||t}),m=gw(d,()=>{H(e)})}else m=gw(Mw(t,function(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return e=>{e&&(t(!0),clearTimeout(n))}}}(150)),H);return g=setTimeout(()=>{A()},1200),hw(s,!0),c("scrolling from index to",{behavior:b,index:x,top:L},Rw),{behavior:b,top:L}})),c),{scrollTargetReached:C,scrollToIndex:h,topListHeight:p}},uw(Pb,tb,Fw),{singleton:!0});function Qb(e,t){0===e?t():requestAnimationFrame(()=>{Qb(e-1,t)})}function Gb(e,t){const n=t-1;return"number"==typeof e?e:"LAST"===e.index?n:e.index}const Yb=Nw(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:o},{didMount:a}])=>{const l=Vw(!0),s=Vw(0),c=Vw(!0);return mw(Mw(a,kw(s),ww(([e,t])=>0!==t),Ew(!1)),l),mw(Mw(a,kw(s),ww(([e,t])=>0!==t),Ew(!1)),c),fw(Mw(Tw(t,a),kw(l,n,e,c),ww(([[,e],t,{sizeTree:n},r,i])=>e&&(!ib(n)||lw(r))&&!t&&!i),kw(s)),([,e])=>{gw(i,()=>{hw(c,!0)}),Qb(4,()=>{gw(r,()=>{hw(l,!0)}),hw(o,e)})}),{initialItemFinalLocationReached:c,initialTopMostItemIndex:s,scrolledToInitialItem:l}},uw(Pb,tb,Xb,qb),{singleton:!0});function Kb(e,t){return Math.abs(e-t)<1.01}const Jb="up",$b="down",eE={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},tE=Nw(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:o}])=>{const a=Vw(!1),l=Vw(!0),s=zw(),c=zw(),d=Vw(4),u=Vw(0),f=Sw(Mw(Zw(Mw(Iw(i),Lw(1),Ew(!0)),Mw(Iw(i),Lw(1),Ew(!1),vw(100))),yw()),!1),h=Sw(Mw(Zw(Mw(n,Ew(!0)),Mw(n,Ew(!1),vw(200))),yw()),!1);mw(Mw(Tw(Iw(i),Iw(u)),bw(([e,t])=>e<=t),yw()),l),mw(Mw(l,Hw(50)),c);const C=Ow(Mw(Tw(r,Iw(o),Iw(t),Iw(e),Iw(d)),xw((e,[{scrollHeight:t,scrollTop:n},r,i,o,a])=>{const l={scrollHeight:t,scrollTop:n,viewportHeight:r};if(n+r-t>-a){let t,r;return n>e.state.scrollTop?(t="SCROLLED_DOWN",r=e.state.scrollTop-n):(t="SIZE_DECREASED",r=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:l}}let s;return s=l.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":r<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":n<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:s,state:l}},eE),yw((e,t)=>void 0!==e&&e.atBottom===t.atBottom))),p=Sw(Mw(r,xw((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(!Kb(e.scrollHeight,t)){const i=t-(n+r)<1;return e.scrollTop!==n&&i?{changed:!0,jump:e.scrollTop-n,scrollHeight:t,scrollTop:n}:{changed:!0,jump:0,scrollHeight:t,scrollTop:n}}return{changed:!1,jump:0,scrollHeight:t,scrollTop:n}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),ww(e=>e.changed),bw(e=>e.jump)),0);mw(Mw(C,bw(e=>e.atBottom)),a),mw(Mw(a,Hw(50)),s);const m=Vw($b);mw(Mw(r,bw(({scrollTop:e})=>e),yw(),xw((e,t)=>pw(h)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?Jb:$b,prevScrollTop:t},{direction:$b,prevScrollTop:0}),bw(e=>e.direction)),m),mw(Mw(r,Hw(50),Ew("none")),m);const g=Vw(0);return mw(Mw(f,ww(e=>!e),Ew(0)),g),mw(Mw(i,Hw(100),kw(f),ww(([e,t])=>t),xw(([e,t],[n])=>[t,n],[0,0]),bw(([e,t])=>t-e)),g),{atBottomState:C,atBottomStateChange:s,atBottomThreshold:d,atTopStateChange:c,atTopThreshold:u,isAtBottom:a,isAtTop:l,isScrolling:f,lastJumpDueToItemResize:p,scrollDirection:m,scrollVelocity:g}},uw(tb)),nE="top",rE="bottom",iE="none";function oE(e,t,n){return"number"==typeof e?n===Jb&&t===nE||n===$b&&t===rE?e:0:n===Jb?t===nE?e.main:e.reverse:t===rE?e.main:e.reverse}function aE(e,t){return"number"==typeof e?e:e[t]??0}const lE=Nw(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{const o=zw(),a=Vw(0),l=Vw(0),s=Vw(0);return{increaseViewportBy:l,listBoundary:o,overscan:s,topListHeight:a,visibleRange:Sw(Mw(Tw(Iw(r),Iw(i),Iw(n),Iw(o,Eb),Iw(s),Iw(a),Iw(t),Iw(e),Iw(l)),bw(([e,t,n,[r,i],o,a,l,s,c])=>{const d=e-s,u=a+l,f=Math.max(n-d,0);let h=iE;const C=aE(c,nE),p=aE(c,rE);return r-=s,i+=n+l,(r+=n+l)>e+u-C&&(h=Jb),(i-=s)<e-f+t+p&&(h=$b),h!==iE?[Math.max(d-n-oE(o,nE,h)-C,0),d-f-l+t+oE(o,rE,h)+p]:null}),ww(e=>null!==e),yw(Eb)),[0,0])}},uw(tb),{singleton:!0});const sE={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function cE(e,t,n,r,i,o){const{lastIndex:a,lastOffset:l,lastSize:s}=i;let c=0,d=0;if(e.length>0){c=e[0].offset;const t=e[e.length-1];d=t.offset+t.size}const u=n-a,f=c,h=l+u*s+(u-1)*r-d;return{bottom:d,firstItemIndex:o,items:uE(e,i,o),offsetBottom:h,offsetTop:c,top:f,topItems:uE(t,i,o),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function dE(e,t,n,r,i,o){let a=0;if(n.groupIndices.length>0)for(const t of n.groupIndices){if(t-a>=e)break;a++}const l=e+a,s=Gb(t,l);return cE(Array.from({length:l}).map((e,t)=>({data:o[t+s],index:t+s,offset:0,size:0})),[],l,i,n,r)}function uE(e,t,n){if(0===e.length)return[];if(!kb(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));const r=e[0].index,i=e[e.length-1].index,o=[],a=cb(t.groupOffsetTree,r,i);let l,s=0;for(const r of e){let e;(!l||l.end<r.index)&&(l=a.shift(),s=t.groupIndices.indexOf(l.start)),e=r.index===l.start?{index:s,type:"group"}:{groupIndex:s,index:r.index-(s+1)+n},o.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return o}function fE(e,t){return void 0===e?0:"number"==typeof e?e:e[t]??0}const hE=Nw(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:i},o,{listBoundary:a,topListHeight:l,visibleRange:s},{initialTopMostItemIndex:c,scrolledToInitialItem:d},{topListHeight:u},f,{didMount:h},{recalcInProgress:C}])=>{const p=Vw([]),m=Vw(0),g=zw(),v=Vw(0);mw(o.topItemsIndexes,p);const A=Sw(Mw(Tw(h,C,Iw(s,Eb),Iw(i),Iw(r),Iw(c),d,Iw(p),Iw(t),Iw(n),Iw(v),e),ww(([e,t,,n,,,,,,,,r])=>{const i=void 0!==r&&r.length!==n;return e&&!t&&!i}),bw(([,,[e,t],n,r,i,o,a,l,s,c,d])=>{const u=r,{offsetTree:f,sizeTree:h}=u,C=pw(m);if(0===n)return{...sE,totalCount:n};if(0===e&&0===t)return 0===C?{...sE,totalCount:n}:dE(C,i,r,l,s,d||[]);if(ib(h))return C>0?null:cE(function(e,t,n){if(kb(t)){const r=Ob(e,t);return[{index:ab(t.groupOffsetTree,r)[0],offset:0,size:0},{data:n?.[0],index:r,offset:0,size:0}]}return[{data:n?.[0],index:e,offset:0,size:0}]}(Gb(i,n),u,d),[],n,s,u,l);const p=[];if(a.length>0){const e=a[0],t=a[a.length-1];let n=0;for(const r of cb(h,e,t)){const i=r.value,o=Math.max(r.start,e),a=Math.min(r.end,t);for(let e=o;e<=a;e++)p.push({data:d?.[e],index:e,offset:n,size:i}),n+=i}}if(!o)return cE([],p,n,s,u,l);const g=a.length>0?a[a.length-1]+1:0,v=Db(f,e,t,g);if(0===v.length)return null;const A=n-1,y=cw([],n=>{for(const r of v){const i=r.value;let o=i.offset,a=r.start;const l=i.size;if(i.offset<e){a+=Math.floor((e-i.offset+s)/(l+s));const t=a-r.start;o+=t*l+t*s}a<g&&(o+=(g-a)*l,a=g);const c=Math.min(r.end,A);for(let e=a;e<=c&&!(o>=t);e++)n.push({data:d?.[e],index:e,offset:o,size:l}),o+=l+s}}),w=fE(c,nE),b=fE(c,rE);if(y.length>0&&(w>0||b>0)){const e=y[0],t=y[y.length-1];if(w>0&&e.index>g){const t=Math.min(w,e.index-g),n=[];let r=e.offset;for(let i=e.index-1;i>=e.index-t;i--){const t=cb(h,i,i)[0]?.value??e.size;r-=t+s,n.unshift({data:d?.[i],index:i,offset:r,size:t})}y.unshift(...n)}if(b>0&&t.index<A){const e=Math.min(b,A-t.index);let n=t.offset+t.size+s;for(let r=t.index+1;r<=t.index+e;r++){const e=cb(h,r,r)[0]?.value??t.size;y.push({data:d?.[r],index:r,offset:n,size:e}),n+=e+s}}}return cE(y,p,n,s,u,l)}),ww(e=>null!==e),yw()),sE);mw(Mw(e,ww(lw),bw(e=>e?.length)),i),mw(Mw(A,bw(e=>e.topListHeight)),u),mw(u,l),mw(Mw(A,bw(e=>[e.top,e.bottom])),a),mw(Mw(A,bw(e=>e.items)),g);const y=Ow(Mw(A,ww(({items:e})=>e.length>0),kw(i,e),ww(([{items:e},t])=>e[e.length-1].originalIndex===t-1),bw(([,e,t])=>[e-1,t]),yw(Eb),bw(([e])=>e))),w=Ow(Mw(A,Hw(200),ww(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),bw(({items:e})=>e[0].index),yw())),b=Ow(Mw(A,ww(({items:e})=>e.length>0),bw(({items:e})=>{let t=0,n=e.length-1;for(;"group"===e[t].type&&t<n;)t++;for(;"group"===e[n].type&&n>t;)n--;return{endIndex:e[n].index,startIndex:e[t].index}}),yw(bb)));return{endReached:y,initialItemCount:m,itemsRendered:g,listState:A,minOverscanItemCount:v,rangeChanged:b,startReached:w,topItemsIndexes:p,...f}},uw(Pb,Fb,lE,Yb,Xb,tE,qb,Mb),{singleton:!0}),CE=Nw(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:i}])=>{const o=zw(),a=Sw(Mw(Tw(n,e,r,t,i),bw(([e,t,n,r,i])=>e+t+n+r+i.offsetBottom+i.bottom)),0);return mw(Iw(a),o),{totalListHeight:a,totalListHeightChanged:o}},uw(tb,hE),{singleton:!0}),pE=Nw(([{viewportHeight:e},{totalListHeight:t}])=>{const n=Vw(!1);return{alignToBottom:n,paddingTopAddition:Sw(Mw(Tw(n,e,t),ww(([e])=>e),bw(([,e,t])=>Math.max(0,e-t)),Hw(0),yw()),0)}},uw(tb,CE),{singleton:!0}),mE=Nw(()=>({context:Vw(null)})),gE=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...i},viewportBottom:o,viewportTop:a})=>t<a?{...i,align:n??"start",...void 0!==r?{behavior:r}:{}}:e>o?{...i,align:n??"end",...void 0!==r?{behavior:r}:{}}:null,vE=Nw(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:o,scrollingInProgress:a,scrollTop:l,viewportHeight:s},{scrollToIndex:c}])=>{const d=zw();return mw(Mw(d,kw(t,s,n,o,i,r,l),kw(e),bw(([[e,t,n,r,i,o,l,s],c])=>{const{calculateViewLocation:d=gE,done:u,...f}=e,h=Nb(e,t,r-1),C=zb(h,t.offsetTree,c)+i+o,p=d({itemBottom:C+ab(t.sizeTree,h)[1],itemTop:C,locationParams:f,viewportBottom:s+n-l,viewportTop:s+o});return null!==p?u&&gw(Mw(a,ww(e=>!e),Lw(pw(a)?1:2)),u):u?.(),p}),ww(e=>null!==e)),c),{scrollIntoView:d}},uw(Pb,tb,Xb,hE,Fw),{singleton:!0});function AE(e){return!1!==e&&("smooth"===e?"smooth":"auto")}const yE=Nw(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:r},{atBottomState:i,isAtBottom:o},{scrollToIndex:a},{scrolledToInitialItem:l},{didMount:s,propsReady:c},{log:d},{scrollingInProgress:u},{context:f},{scrollIntoView:h}])=>{const C=Vw(!1),p=zw();let m=null;function g(e){hw(a,{align:"end",behavior:e,index:"LAST"})}function v(e){const t=gw(i,t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&null===m&&(pw(d)("scrolling to bottom due to increased size",{},Rw),g("auto"))});setTimeout(t,100)}fw(Mw(Tw(Mw(Iw(t),Lw(1)),s),kw(Iw(C),o,l,u),bw(([[e,t],n,r,i,o])=>{let a=t&&i,l="auto";return a&&(l=((e,t)=>"function"==typeof e?AE(e(t)):t&&AE(e))(n,r||o),a=a&&!1!==l),{followOutputBehavior:l,shouldFollow:a,totalCount:e}}),ww(({shouldFollow:e})=>e)),({followOutputBehavior:t,totalCount:r})=>{null!==m&&(m(),m=null),void 0!==pw(n)?requestAnimationFrame(()=>{pw(d)("following output to ",{totalCount:r},Rw),g(t)}):m=gw(e,()=>{pw(d)("following output to ",{totalCount:r},Rw),g(t),m=null})}),fw(Mw(Tw(Iw(C),t,c),ww(([e,,t])=>!1!==e&&t),xw(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),ww(({refreshed:e})=>e),kw(C,t)),([,e])=>{pw(l)&&v(!1!==e)}),fw(p,()=>{v(!1!==pw(C))}),fw(Tw(Iw(C),i),([e,t])=>{!1!==e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&g("auto")});const A=Vw(null),y=zw();return mw(Zw(Mw(Iw(r),bw(e=>e?.length??0)),Mw(Iw(t))),y),fw(Mw(Tw(Mw(y,Lw(1)),s),kw(Iw(A),l,u,f),bw(([[e,t],n,r,i,o])=>t&&r&&n?.({context:o,totalCount:e,scrollingInProgress:i})),ww(e=>!!e),Hw(0)),t=>{null!==m&&(m(),m=null),void 0!==pw(n)?requestAnimationFrame(()=>{pw(d)("scrolling into view",{}),hw(h,t)}):m=gw(e,()=>{pw(d)("scrolling into view",{}),hw(h,t),m=null})}),{autoscrollToBottom:p,followOutput:C,scrollIntoViewOnChange:A}},uw(Pb,tE,Xb,Yb,qb,Fw,tb,mE,vE)),wE=Nw(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:o,listState:a},{didMount:l}])=>(mw(Mw(l,kw(o),ww(([,e])=>0!==e),kw(i,r,t,n,e),bw(([[,e],t,n,r,i,o=[]])=>dE(e,t,n,r,i,o))),a),{}),uw(Pb,Yb,hE,qb),{singleton:!0}),bE=Nw(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=Vw(0);return fw(Mw(e,kw(r),ww(([,e])=>0!==e),bw(([,e])=>({top:e}))),e=>{gw(Mw(n,Lw(1),ww(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{hw(t,e)})})}),{initialScrollTop:r}},uw(qb,tb,hE),{singleton:!0}),EE=Nw(([{scrollVelocity:e}])=>{const t=Vw(!1),n=zw(),r=Vw(!1);return mw(Mw(e,kw(r,t,n),ww(([e,t])=>!1!==t&&void 0!==t),bw(([e,t,n,r])=>{const{enter:i,exit:o}=t;if(n){if(o(e,r))return!1}else if(i(e,r))return!0;return n}),yw()),t),fw(Mw(Tw(t,e,n),kw(r)),([[e,t,n],r])=>{e&&!1!==r&&void 0!==r&&r.change&&r.change(t,n)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},uw(tE),{singleton:!0}),ME=Nw(([{scrollContainerState:e,scrollTo:t}])=>{const n=zw(),r=zw(),i=zw(),o=Vw(!1),a=Vw(void 0);return mw(Mw(Tw(n,r),bw(([{scrollTop:e,viewportHeight:t},{offsetTop:n,listHeight:r}])=>({scrollHeight:r,scrollTop:Math.max(0,e-n),viewportHeight:t}))),e),mw(Mw(t,kw(r),bw(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),i),{customScrollParent:a,useWindowScroll:o,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},uw(tb)),xE=Nw(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:o},{useWindowScroll:a,windowScrollContainerState:l,windowViewportRect:s}])=>{const c=zw(),d=Vw(void 0),u=Vw(null),f=Vw(null);return mw(l,u),mw(s,f),fw(Mw(c,kw(t,r,a,u,f,n)),([e,t,n,r,i,o,a])=>{const l=function(e){return ub(e).map(({k:e,v:t},n,r)=>{const i=r[n+1];return{endIndex:void 0!==i?i.k-1:1/0,size:t,startIndex:e}})}(t.sizeTree);r&&null!==i&&null!==o&&(n=i.scrollTop-o.offsetTop),e({ranges:l,scrollTop:n-=a})}),mw(Mw(d,ww(lw),bw(LE)),i),mw(Mw(o,kw(d),ww(([,e])=>void 0!==e),yw(),bw(([,e])=>e.ranges)),e),{getState:c,restoreStateFrom:d}},uw(Pb,tb,Yb,qb,ME));function LE(e){return{align:"start",index:0,offset:e.scrollTop}}const HE=Nw(([{topItemsIndexes:e}])=>{const t=Vw(0);return mw(Mw(t,ww(e=>e>=0),bw(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},uw(hE));function kE(e){let t,n=!1;return()=>(n||(n=!0,t=e()),t)}const VE=kE(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),SE=Nw(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:o,lastJumpDueToItemResize:a,scrollDirection:l},{listState:s},{beforeUnshiftWith:c,gap:d,shiftWithOffset:u,sizes:f},{log:h},{recalcInProgress:C}])=>{const p=Ow(Mw(s,kw(a),xw(([,e,t,n],[{bottom:r,items:i,offsetBottom:o,totalCount:a},l])=>{const s=r+o;let c=0;return t===a&&e.length>0&&i.length>0&&(0===i[0].originalIndex&&0===e[0].originalIndex||(c=s-n,0!==c&&(c+=l))),[c,i,a,s]},[0,[],0,0]),ww(([e])=>0!==e),kw(r,l,n,i,h,C),ww(([,e,t,n,,,r])=>!r&&!n&&0!==e&&t===Jb),bw(([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},Rw),e))));function m(n){n>0?(hw(t,{behavior:"auto",top:-n}),hw(e,0)):(hw(e,0),hw(t,{behavior:"auto",top:-n}))}return fw(Mw(p,kw(e,o)),([t,n,r])=>{r&&VE()?hw(e,n-t):m(-t)}),fw(Mw(Tw(Sw(o,!1),e,C),ww(([e,t,n])=>!e&&!n&&0!==t),bw(([e,t])=>t),Hw(1)),m),mw(Mw(u,bw(e=>({top:-e}))),t),fw(Mw(c,kw(f,d),bw(([e,{groupIndices:t,lastSize:n,sizeTree:r},i])=>{function o(e){return e*(n+i)}if(0===t.length)return o(e);let a=0;const l=ob(r,0);let s=0,c=0;for(;s<e;){s++,a+=l;let n=t.length===c+1?1/0:t[c+1]-t[c]-1;s+n>e&&(a-=l,n=e-s+1),s+=n,a+=o(n),c++}return a})),n=>{hw(e,n),requestAnimationFrame(()=>{hw(t,{top:n}),requestAnimationFrame(()=>{hw(e,0),hw(C,!1)})})}),{deviation:e}},uw(tb,tE,hE,Pb,Fw,Mb)),zE=Nw(([e,t,n,r,i,o,a,l,s,c,d])=>({...e,...t,...n,...r,...i,...o,...a,...l,...s,...c,...d}),uw(lE,wE,qb,EE,CE,bE,pE,ME,vE,Fw,mE)),OE=Nw(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,fixedGroupSize:i,gap:o,groupIndices:a,heightEstimates:l,itemSize:s,sizeRanges:c,sizes:d,statefulTotalCount:u,totalCount:f,trackItemSizes:h},{initialItemFinalLocationReached:C,initialTopMostItemIndex:p,scrolledToInitialItem:m},g,v,A,y,{scrollToIndex:w},b,{topItemCount:E},{groupCounts:M},x])=>{const{listState:L,minOverscanItemCount:H,topItemsIndexes:k,rangeChanged:V,...S}=y;return mw(V,x.scrollSeekRangeChanged),mw(Mw(x.windowViewportRect,bw(e=>e.visibleHeight)),g.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,fixedGroupHeight:i,gap:o,groupCounts:M,heightEstimates:l,initialItemFinalLocationReached:C,initialTopMostItemIndex:p,scrolledToInitialItem:m,sizeRanges:c,topItemCount:E,topItemsIndexes:k,totalCount:f,...A,groupIndices:a,itemSize:s,listState:L,minOverscanItemCount:H,scrollToIndex:w,statefulTotalCount:u,trackItemSizes:h,rangeChanged:V,...S,...x,...g,sizes:d,...v}},uw(Pb,Yb,tb,xE,yE,hE,Xb,SE,HE,Fb,zE));function NE(e,t){const n={},r={};let i=0;const o=e.length;for(;i<o;)r[e[i]]=1,i+=1;for(const e in t)Object.hasOwn(r,e)||(n[e]=t[e]);return n}const DE=typeof document<"u"?i.useLayoutEffect:i.useEffect;function TE(t,n,r){const o=Object.keys(n.required||{}),a=Object.keys(n.optional||{}),l=Object.keys(n.methods||{}),s=Object.keys(n.events||{}),c=i.createContext({});function d(e,t){void 0!==e.propsReady&&hw(e.propsReady,!1);for(const r of o){hw(e[n.required[r]],t[r])}for(const r of a)if(r in t){hw(e[n.optional[r]],t[r])}void 0!==e.propsReady&&hw(e.propsReady,!0)}function u(e){return s.reduce((t,r)=>(t[r]=function(e){let t,n;const r=()=>t?.();return function(i,o){switch(i){case 1:return o?n===o?void 0:(r(),n=o,t=fw(e,o),t):(r(),sw);case 2:return r(),void(n=null)}}}(e[n.events[r]]),t),{})}const f=i.forwardRef(function(f,h){const{children:C,...p}=f,[m]=i.useState(()=>cw(function(e){const t=new Map,n=({constructor:e,dependencies:r,id:i,singleton:o})=>{if(o&&t.has(i))return t.get(i);const a=e(r.map(e=>n(e)));return o&&t.set(i,a),a};return n(e)}(t),e=>{d(e,p)})),[g]=i.useState(aw(u,m));var v;DE(()=>{for(const e of s)e in p&&fw(g[e],p[e]);return()=>{Object.values(g).map(Cw)}},[p,g,m]),DE(()=>{d(m,p)}),i.useImperativeHandle(h,rw((v=m,l.reduce((e,t)=>(e[t]=e=>{hw(v[n.methods[t]],e)},e),{}))));const A=r;return e(c.Provider,{value:m,children:void 0!==r?e(A,{...NE([...o,...a,...s],p),children:C}):C})});return{Component:f,useEmitter:(e,t)=>{const n=i.useContext(c)[e];DE(()=>fw(n,t),[t,n])},useEmitterValue:parseInt(i.version)>=18?e=>{const t=i.useContext(c)[e],n=i.useCallback(e=>fw(t,e),[t]);return i.useSyncExternalStore(n,()=>pw(t),()=>pw(t))}:e=>{const t=i.useContext(c)[e],[n,r]=i.useState(aw(pw,t));return DE(()=>fw(t,e=>{e!==n&&r(rw(e))}),[t,n]),n},usePublisher:e=>{const t=i.useContext(c);return i.useCallback(n=>{hw(t[e],n)},[t,e])}}}const IE=i.createContext(void 0),ZE=i.createContext(void 0),RE="-webkit-sticky",jE="sticky",BE=kE(()=>{if(typeof document>"u")return jE;const e=document.createElement("div");return e.style.position=RE,e.style.position===RE?RE:jE}),PE=typeof document<"u"?i.useLayoutEffect:i.useEffect;function _E(e){return"self"in e}function FE(e,t,n,r=sw,o,a){const l=i.useRef(null),s=i.useRef(null),c=i.useRef(null),d=i.useCallback(n=>{let r,i,o;const l=n.target;if(function(e){return"body"in e}(l)||_E(l)){const e=_E(l)?l:l.defaultView;o=!0===a?Qw(e,e.scrollX):e.scrollY,r=!0===a?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,i=!0===a?e.innerWidth:e.innerHeight}else o=!0===a?Qw(l,l.scrollLeft):l.scrollTop,r=!0===a?l.scrollWidth:l.scrollHeight,i=!0===a?l.offsetWidth:l.offsetHeight;const d=()=>{e({scrollHeight:r,scrollTop:Math.max(o,0),viewportHeight:i})};!0===n.suppressFlushSync?d():E.flushSync(d),null!==s.current&&(o===s.current||o<=0||o===r-i)&&(s.current=null,t(!0),c.current&&(clearTimeout(c.current),c.current=null))},[e,t,a]);return i.useEffect(()=>{const e=o||l.current;return Ww(e),r(o||l.current),d({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",d,{passive:!0}),()=>{Ww(e),r(null),e.removeEventListener("scroll",d)}},[l,d,n,r,o]),{scrollByCallback:function(e){!0===a&&(e={...void 0!==e.behavior?{behavior:e.behavior}:{},...void 0!==e.top?{left:Gw(l.current,e.top)}:{}}),l.current.scrollBy(e)},scrollerRef:l,scrollToCallback:function(n){const r=l.current;if(!r||(!0===a?"offsetWidth"in r&&0===r.offsetWidth:"offsetHeight"in r&&0===r.offsetHeight))return;const i="smooth"===n.behavior;let o,d,u;_E(r)?(d=Math.max(Hb(r.document.documentElement,!0===a?"width":"height"),!0===a?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),o=!0===a?r.innerWidth:r.innerHeight,u=!0===a?Qw(r,r.scrollX):r.scrollY):(d=r[!0===a?"scrollWidth":"scrollHeight"],o=Hb(r,!0===a?"width":"height"),u=!0===a?Qw(r,r.scrollLeft):r.scrollTop);const f=d-o;if(void 0===n.top)return void r.scrollTo(n);const h=Math.ceil(Math.max(Math.min(f,n.top),0));if(n.top=h,Kb(o,d)||h===u)return e({scrollHeight:d,scrollTop:u,viewportHeight:o}),void(i&&t(!0));i?(s.current=h,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,s.current=null,t(!0)},1e3)):s.current=null,!0===a&&(n={...void 0!==n.behavior?{behavior:n.behavior}:{},left:Gw(r,h)}),r.scrollTo(n)}}}function qE(e){return e}const UE=Nw(()=>{const e=Vw(e=>`Item ${e}`),t=Vw(e=>`Group ${e}`),n=Vw({}),r=Vw(qE),i=Vw("div"),o=Vw(sw),a=(e,t=null)=>Sw(Mw(n,bw(t=>t[e]),yw()),t);return{components:n,computeItemKey:r,EmptyPlaceholder:a("EmptyPlaceholder"),FooterComponent:a("Footer"),GroupComponent:a("Group","div"),groupContent:t,HeaderComponent:a("Header"),HeaderFooterTag:i,ItemComponent:a("Item","div"),itemContent:e,ListComponent:a("List","div"),ScrollerComponent:a("Scroller","div"),scrollerRef:o,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),TopItemListComponent:a("TopItemList")}}),WE=Nw(([e,t])=>({...e,...t}),uw(OE,UE)),XE=({height:t})=>e("div",{style:{height:t}}),QE={overflowAnchor:"none",position:BE(),zIndex:1},GE={overflowAnchor:"none"},YE={...GE,display:"inline-block",height:"100%"},KE=i.memo(function({showTopList:t=!1}){const n=pM("listState"),r=mM("sizeRanges"),o=pM("useWindowScroll"),a=pM("customScrollParent"),l=mM("windowScrollContainerState"),s=mM("scrollContainerState"),c=a||o?l:s,d=pM("itemContent"),u=pM("context"),f=pM("groupContent"),h=pM("trackItemSizes"),C=pM("itemSize"),m=pM("log"),g=mM("gap"),v=pM("horizontalDirection"),{callbackRef:A}=Jw(r,C,h,t?sw:c,m,g,a,v,pM("skipAnimationFrameInResizeObserver")),[y,w]=i.useState(0);CM("deviation",e=>{y!==e&&w(e)});const b=pM("EmptyPlaceholder"),E=pM("ScrollSeekPlaceholder")??XE,M=pM("ListComponent"),x=pM("ItemComponent"),L=pM("GroupComponent"),H=pM("computeItemKey"),k=pM("isSeeking"),V=pM("groupIndices").length>0,S=pM("alignToBottom"),z=pM("initialItemFinalLocationReached"),O=t?{}:{boxSizing:"border-box",...v?{display:"inline-block",height:"100%",marginInlineStart:0!==y?y:S?"auto":0,paddingInlineEnd:n.offsetBottom,paddingInlineStart:n.offsetTop,whiteSpace:"nowrap"}:{marginTop:0!==y?y:S?"auto":0,paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},...z?{}:{visibility:"hidden"}};return t||0!==n.totalCount||null==b?e(M,{...rM(M,u),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:A,style:O,children:(t?n.topItems:n.items).map(e=>{const t=e.originalIndex,r=H(t+n.firstItemIndex,e.data,u);return k?p(E,{...rM(E,u),height:e.size,index:e.index,key:r,type:e.type||"item",..."group"===e.type?{}:{groupIndex:e.groupIndex}}):"group"===e.type?p(L,{...rM(L,u),"data-index":t,"data-item-index":e.index,"data-known-size":e.size,key:r,style:QE},f(e.index,u)):p(x,{...rM(x,u),...iM(x,e.data),"data-index":t,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:r,style:v?YE:GE},V?d(e.index,e.groupIndex,e.data,u):d(e.index,e.data,u))})}):e(b,{...rM(b,u)})}),JE={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},$E={outline:"none",overflowX:"auto",position:"relative"},eM=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:void 0}),tM=(e,t,n=0)=>({...eM(e),position:t?"relative":"absolute",top:t?-n:0}),nM={position:BE(),top:0,width:"100%",zIndex:1};function rM(e,t){if("string"!=typeof e)return{context:t}}function iM(e,t){return{item:"string"==typeof e?void 0:t}}const oM=i.memo(function(){const t=pM("HeaderComponent"),n=mM("headerHeight"),r=pM("HeaderFooterTag"),o=Yw(i.useMemo(()=>e=>{n(Hb(e,"height"))},[n]),!0,pM("skipAnimationFrameInResizeObserver")),a=pM("context");return null!=t?e(r,{ref:o,children:e(t,{...rM(t,a)})}):null}),aM=i.memo(function(){const t=pM("FooterComponent"),n=mM("footerHeight"),r=pM("HeaderFooterTag"),o=Yw(i.useMemo(()=>e=>{n(Hb(e,"height"))},[n]),!0,pM("skipAnimationFrameInResizeObserver")),a=pM("context");return null!=t?e(r,{ref:o,children:e(t,{...rM(t,a)})}):null});function lM({useEmitter:t,useEmitterValue:n,usePublisher:r}){return i.memo(function({children:i,style:o,context:a,...l}){const s=r("scrollContainerState"),c=n("ScrollerComponent"),d=r("smoothScrollTargetReached"),u=n("scrollerRef"),f=n("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:C,scrollToCallback:p}=FE(s,d,c,u,void 0,f);return t("scrollTo",p),t("scrollBy",h),e(c,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:C,style:{...f?$E:JE,...o},tabIndex:0,...l,...rM(c,a),children:i})})}function sM({useEmitter:t,useEmitterValue:n,usePublisher:r}){return i.memo(function({children:o,style:a,context:l,...s}){const c=r("windowScrollContainerState"),d=n("ScrollerComponent"),u=r("smoothScrollTargetReached"),f=n("totalListHeight"),h=n("deviation"),C=n("customScrollParent"),p=i.useRef(null),m=n("scrollerRef"),{scrollByCallback:g,scrollerRef:v,scrollToCallback:A}=FE(c,u,d,m,C);return PE(()=>(v.current=C||p.current?.ownerDocument.defaultView,()=>{v.current=null}),[v,C]),t("windowScrollTo",A),t("scrollBy",g),e(d,{ref:p,"data-virtuoso-scroller":!0,style:{position:"relative",...a,...0!==f?{height:f+h}:void 0},...s,...rM(d,l),children:o})})}const cM=({children:t})=>{const n=i.useContext(IE),r=mM("viewportHeight"),o=mM("fixedItemHeight"),a=pM("alignToBottom"),l=pM("horizontalDirection"),s=Yw(i.useMemo(()=>ow(r,e=>Hb(e,l?"width":"height")),[r,l]),!0,pM("skipAnimationFrameInResizeObserver"));return i.useEffect(()=>{n&&(r(n.viewportHeight),o(n.itemHeight))},[n,r,o]),e("div",{"data-viewport-type":"element",ref:s,style:eM(a),children:t})},dM=({children:t})=>{const n=i.useContext(IE),r=mM("windowViewportRect"),o=mM("fixedItemHeight"),a=pM("customScrollParent"),l=pM("useWindowScroll"),s=pM("topListHeight"),c=eb(r,a,pM("skipAnimationFrameInResizeObserver")),d=pM("alignToBottom");return i.useEffect(()=>{n&&(o(n.itemHeight),r({listHeight:0,offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:100}))},[n,r,o]),e("div",{"data-viewport-type":"window",ref:c,style:tM(d,l,s),children:t})},uM=({children:t})=>{const n=pM("TopItemListComponent")??"div",r=pM("headerHeight"),i={...nM,marginTop:`${r}px`},o=pM("context");return e(n,{style:i,...rM(n,o),children:t})},fM=i.memo(function(t){const r=pM("useWindowScroll"),i=pM("topItemsIndexes").length>0,o=pM("customScrollParent"),a=pM("context");return n(o||r?vM:gM,{...t,context:a,children:[i&&e(uM,{children:e(KE,{showTopList:!0})}),n(o||r?dM:cM,{children:[e(oM,{}),e(KE,{}),e(aM,{})]})]})}),{Component:hM,useEmitter:CM,useEmitterValue:pM,usePublisher:mM}=TE(WE,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},fM),gM=lM({useEmitter:CM,useEmitterValue:pM,usePublisher:mM}),vM=sM({useEmitter:CM,useEmitterValue:pM,usePublisher:mM}),AM=hM,yM=Nw(()=>{const e=Vw(e=>n("td",{children:["Item $",e]})),t=Vw(null),r=Vw(e=>n("td",{colSpan:1e3,children:["Group ",e]})),i=Vw(null),o=Vw(null),a=Vw({}),l=Vw(qE),s=Vw(sw),c=(e,t=null)=>Sw(Mw(a,bw(t=>t[e]),yw()),t);return{components:a,computeItemKey:l,context:t,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:o,fixedHeaderContent:i,itemContent:e,groupContent:r,ScrollerComponent:c("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),TableBodyComponent:c("TableBody","tbody"),TableComponent:c("Table","table"),TableFooterComponent:c("TableFoot","tfoot"),TableHeadComponent:c("TableHead","thead"),TableRowComponent:c("TableRow","tr"),GroupComponent:c("Group","tr")}});uw(OE,yM),BE();const wM={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},bM={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:EM,floor:MM,max:xM,min:LM,round:HM}=Math;function kM(e,t,n){return Array.from({length:t-e+1}).map((t,r)=>({data:null===n?null:n[r+e],index:r+e}))}function VM(e,t){return void 0!==e&&e.width===t.width&&e.height===t.height}function SM(e,t){return void 0!==e&&e.column===t.column&&e.row===t.row}const zM=Nw(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:o,scrollBy:a,scrollContainerState:l,scrollTo:s,scrollTop:c,smoothScrollTargetReached:d,viewportHeight:u},f,h,{didMount:C,propsReady:p},{customScrollParent:m,useWindowScroll:g,windowScrollContainerState:v,windowScrollTo:A,windowViewportRect:y},w])=>{const b=Vw(0),E=Vw(0),M=Vw(wM),x=Vw({height:0,width:0}),L=Vw({height:0,width:0}),H=zw(),k=zw(),V=Vw(0),S=Vw(null),z=Vw({column:0,row:0}),O=zw(),N=zw(),D=Vw(!1),T=Vw(0),I=Vw(!0),Z=Vw(!1),R=Vw(!1);fw(Mw(C,kw(T),ww(([e,t])=>0!==t)),()=>{hw(I,!1)}),fw(Mw(Tw(C,I,L,x,T,Z),ww(([e,t,n,r,,i])=>e&&!t&&0!==n.height&&0!==r.height&&!i)),([,,,,e])=>{hw(Z,!0),Qb(1,()=>{hw(H,e)}),gw(Mw(c),()=>{hw(t,[0,0]),hw(I,!0)})}),mw(Mw(N,ww(e=>null!=e&&e.scrollTop>0),Ew(0)),E),fw(Mw(C,kw(N),ww(([,e])=>null!=e)),([,e])=>{e&&(hw(x,e.viewport),hw(L,e.item),hw(z,e.gap),e.scrollTop>0&&(hw(D,!0),gw(Mw(c,Lw(1)),e=>{hw(D,!1)}),hw(s,{top:e.scrollTop})))}),mw(Mw(x,bw(({height:e})=>e)),u),mw(Mw(Tw(Iw(x,VM),Iw(L,VM),Iw(z,(e,t)=>void 0!==e&&e.column===t.column&&e.row===t.row),Iw(c)),bw(([e,t,n,r])=>({gap:n,item:t,scrollTop:r,viewport:e}))),O),mw(Mw(Tw(Iw(b),r,Iw(z,SM),Iw(L,VM),Iw(x,VM),Iw(S),Iw(E),Iw(D),Iw(I),Iw(T)),ww(([,,,,,,,e])=>!e),bw(([e,[t,n],r,i,o,a,l,,s,c])=>{const{column:d,row:u}=r,{height:f,width:h}=i,{width:C}=o;if(0===l&&(0===e||0===C))return wM;if(0===h){const t=Gb(c,e);return function(e){return{...bM,items:e}}(kM(t,t+Math.max(l-1,0),a))}const p=OM(C,h,d);let m,g;s?0===t&&0===n&&l>0?(m=0,g=l-1):(m=p*MM((t+u)/(f+u)),g=p*EM((n+u)/(f+u))-1,g=LM(e-1,xM(g,p-1)),m=LM(g,xM(0,m))):(m=0,g=-1);const v=kM(m,g,a),{bottom:A,top:y}=NM(o,r,i,v),w=EM(e/p);return{bottom:A,itemHeight:f,items:v,itemWidth:h,offsetBottom:w*f+(w-1)*u-A,offsetTop:y,top:y}})),M),mw(Mw(S,ww(e=>null!==e),bw(e=>e.length)),b),mw(Mw(Tw(x,L,M,z),ww(([e,t,{items:n}])=>n.length>0&&0!==t.height&&0!==e.height),bw(([e,t,{items:n},r])=>{const{bottom:i,top:o}=NM(e,r,t,n);return[o,i]}),yw(Eb)),t);const j=Vw(!1);mw(Mw(c,kw(j),bw(([e,t])=>t||0!==e)),j);const B=Ow(Mw(Tw(M,b),ww(([{items:e}])=>e.length>0),kw(j),ww(([[e,t],n])=>{const r=e.items[e.items.length-1].index===t-1;return(n||e.bottom>0&&e.itemHeight>0&&0===e.offsetBottom&&e.items.length===t)&&r}),bw(([[,e]])=>e-1),yw())),P=Ow(Mw(Iw(M),ww(({items:e})=>e.length>0&&0===e[0].index),Ew(0),yw())),_=Ow(Mw(Iw(M),kw(D),ww(([{items:e},t])=>e.length>0&&!t),bw(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),yw(bb),Hw(0)));mw(_,h.scrollSeekRangeChanged),mw(Mw(H,kw(x,L,b,z),bw(([e,t,n,r,i])=>{const o=Wb(e),{align:a,behavior:l,offset:s}=o;let c=o.index;"LAST"===c&&(c=r-1),c=xM(0,c,LM(r-1,c));let d=DM(t,i,n,c);return"end"===a?d=HM(d-t.height+n.height):"center"===a&&(d=HM(d-t.height/2+n.height/2)),void 0!==s&&0!==s&&(d+=s),{behavior:l,top:d}})),s);const F=Sw(Mw(M,bw(e=>e.offsetBottom+e.bottom)),0);return mw(Mw(y,bw(e=>({height:e.visibleHeight,width:e.visibleWidth}))),x),{customScrollParent:m,data:S,deviation:V,footerHeight:i,gap:z,headerHeight:o,increaseViewportBy:e,initialItemCount:E,itemDimensions:L,overscan:n,restoreStateFrom:N,scrollBy:a,scrollContainerState:l,scrollHeight:k,scrollTo:s,scrollToIndex:H,scrollTop:c,smoothScrollTargetReached:d,totalCount:b,useWindowScroll:g,viewportDimensions:x,windowScrollContainerState:v,windowScrollTo:A,windowViewportRect:y,...h,gridState:M,horizontalDirection:R,initialTopMostItemIndex:T,totalListHeight:F,...f,endReached:B,propsReady:p,rangeChanged:_,startReached:P,stateChanged:O,stateRestoreInProgress:D,...w}},uw(lE,tb,tE,EE,qb,ME,Fw));function OM(e,t,n){return xM(1,MM((e+n)/(MM(t)+n)))}function NM(e,t,n,r){const{height:i}=n;if(void 0===i||0===r.length)return{bottom:0,top:0};const o=DM(e,t,n,r[0].index);return{bottom:DM(e,t,n,r[r.length-1].index)+i,top:o}}function DM(e,t,n,r){const i=OM(e.width,n.width,t.column),o=MM(r/i),a=o*n.height+xM(0,o-1)*t.row;return a>0?a+t.row:a}const TM=Nw(()=>{const e=Vw(e=>`Item ${e}`),t=Vw({}),n=Vw(null),r=Vw("virtuoso-grid-item"),i=Vw("virtuoso-grid-list"),o=Vw(qE),a=Vw("div"),l=Vw(sw),s=(e,n=null)=>Sw(Mw(t,bw(t=>t[e]),yw()),n),c=Vw(!1),d=Vw(!1);return mw(Iw(d),c),{components:t,computeItemKey:o,context:n,FooterComponent:s("Footer"),HeaderComponent:s("Header"),headerFooterTag:a,itemClassName:r,ItemComponent:s("Item","div"),itemContent:e,listClassName:i,ListComponent:s("List","div"),readyStateChanged:c,reportReadyState:d,ScrollerComponent:s("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder","div")}}),IM=Nw(([e,t])=>({...e,...t}),uw(zM,TM)),ZM=i.memo(function(){const t=qM("gridState"),n=qM("listClassName"),r=qM("itemClassName"),o=qM("itemContent"),a=qM("computeItemKey"),l=qM("isSeeking"),s=UM("scrollHeight"),c=qM("ItemComponent"),d=qM("ListComponent"),u=qM("ScrollSeekPlaceholder"),f=qM("context"),h=UM("itemDimensions"),C=UM("gap"),m=qM("log"),g=qM("stateRestoreInProgress"),v=UM("reportReadyState"),A=Yw(i.useMemo(()=>e=>{const t=e.parentElement.parentElement.scrollHeight;s(t);const n=e.firstChild;if(null!==n){const{height:e,width:t}=n.getBoundingClientRect();h({height:e,width:t})}C({column:QM("column-gap",getComputedStyle(e).columnGap,m),row:QM("row-gap",getComputedStyle(e).rowGap,m)})},[s,h,C,m]),!0,!1);return PE(()=>{t.itemHeight>0&&t.itemWidth>0&&v(!0)},[t]),g?null:e(d,{className:n,ref:A,...rM(d,f),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(n=>{const i=a(n.index,n.data,f);return l?e(u,{...rM(u,f),height:t.itemHeight,index:n.index,width:t.itemWidth},i):p(c,{...rM(c,f),className:r,"data-index":n.index,key:i},o(n.index,n.data,f))})})}),RM=i.memo(function(){const t=qM("HeaderComponent"),n=UM("headerHeight"),r=qM("headerFooterTag"),o=Yw(i.useMemo(()=>e=>{n(Hb(e,"height"))},[n]),!0,!1),a=qM("context");return null!=t?e(r,{ref:o,children:e(t,{...rM(t,a)})}):null}),jM=i.memo(function(){const t=qM("FooterComponent"),n=UM("footerHeight"),r=qM("headerFooterTag"),o=Yw(i.useMemo(()=>e=>{n(Hb(e,"height"))},[n]),!0,!1),a=qM("context");return null!=t?e(r,{ref:o,children:e(t,{...rM(t,a)})}):null}),BM=({children:t})=>{const n=i.useContext(ZE),r=UM("itemDimensions"),o=UM("viewportDimensions"),a=Yw(i.useMemo(()=>e=>{o(e.getBoundingClientRect())},[o]),!0,!1);return i.useEffect(()=>{n&&(o({height:n.viewportHeight,width:n.viewportWidth}),r({height:n.itemHeight,width:n.itemWidth}))},[n,o,r]),e("div",{ref:a,style:eM(!1),children:t})},PM=({children:t})=>{const n=i.useContext(ZE),r=UM("windowViewportRect"),o=UM("itemDimensions"),a=qM("customScrollParent"),l=qM("useWindowScroll"),s=eb(r,a,!1);return i.useEffect(()=>{n&&(o({height:n.itemHeight,width:n.itemWidth}),r({listHeight:0,offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:n.viewportWidth}))},[n,r,o]),e("div",{ref:s,style:tM(!1,l),children:t})},_M=i.memo(function({...t}){const r=qM("useWindowScroll"),i=qM("customScrollParent"),o=i||r?XM:WM,a=i||r?PM:BM,l=qM("context");return e(o,{...t,...rM(o,l),children:n(a,{children:[e(RM,{}),e(ZM,{}),e(jM,{})]})})}),{useEmitter:FM,useEmitterValue:qM,usePublisher:UM}=TE(IM,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},_M),WM=lM({useEmitter:FM,useEmitterValue:qM,usePublisher:UM}),XM=sM({useEmitter:FM,useEmitterValue:qM,usePublisher:UM});function QM(e,t,n){return"normal"!==t&&!0!==t?.endsWith("px")&&n(`${e} was not resolved to pixel value correctly`,t,Bw),"normal"===t?0:parseInt(t??"0",10)}const GM=({optionsList:r=[],onSelectVariable:i,dropdownPosition:o,position:s="relative",width:c,height:d="160px",zIndex:u=9999,highlightedIndex:f})=>{const h={LOCAL:"local_variable_icon",GLOBAL:"global_variable_icon",PROJECT_ENVIRONMENT:"project_env_variable_icon"},C=e=>{if(!e)return"";const t=e._id||e.id;return t?.startsWith("PARAMETER")?"step_group_parameter":"STEPGROUP"!==e?.parentVariableType||"LOCAL"!==e.type&&"STEPGROUP"!==e?.type?"_startforloop"===e.type?"for_loop_variable":"DATAPROVIDER"===e.type?"data_provider_variable":h[e.type||""]||"":"step_group_variable"},p=e=>"_startforloop"===e?.type?`FLV_for:${e?.name}`:"DATAPROVIDER"===e?.type?`${e?.dpName}:${e?.varname}`:e?.name;function m(e){if(e.endsWith("px")){const t=parseInt(e.slice(0,-2),10);return isNaN(t)?212:t-66}return 212}const g=a(null);l(()=>{void 0!==f&&f>=0&&requestAnimationFrame(()=>{g.current?.scrollToIndex({index:f,behavior:"auto",align:"center"})})},[f,r]);return e("div",{className:D("ff-variable-dropdown",s),style:o?{top:o.top+30,left:o.left-30,width:c,height:d,zIndex:u}:{width:c,height:d,zIndex:u},children:G(r)?e("div",{className:"ff-variable-option ff-variable-option-no-data",children:e(q,{as:"span",fontSize:12,children:"No Option"})}):e(AM,{totalCount:r.length,ref:g,data:r,itemContent:o=>{const a=r[o];return a?e("div",{className:D("ff-variable-data",{"ff-variable-data--highlighted":f===o}),onMouseDown:()=>i(a),children:c.endsWith("px")?n(t,{children:[e(Y,{title:Ln(p(a),m(c),"pixel")?p(a):"",style:{width:`${m(c)}px`},children:e(q,{as:"span",fontSize:12,className:"ff-truncated_text",children:p(a)})}),e(F,{name:C(a),height:24,width:24,hoverEffect:!0})]}):e(nw,{option:a})},`${a.id}-${o}`):null},style:{height:d,fontSize:"12px"},overscan:10,fixedItemHeight:32})})},YM=({data:r=[],width:i,height:o,lineChartWidth:a,yAxisLabel:s,xAxisLabel:d,yAxisValueColor:u,xAxisColor:f,yAxisColor:h,yAxisLabelColor:C,textSize:p,fontWeight:m,numberSize:g,chartName:v,shouldCenterSinglePoint:A,xAxisLabelGap:y=16,isLeftOverflow:w=!1})=>{const b=40,E=i-80,M=o-80,[x,L]=c(!1),[H,k]=c({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null});l(()=>{const e=()=>{L(!1),k(e=>({...e,tooltip:{...e.tooltip,visible:!1}}))};return window.addEventListener("scroll",e,!0),()=>window.removeEventListener("scroll",e,!0)},[]);if(!(r&&r.length>0&&r?.some(e=>Array.isArray(e?.data)&&e?.data?.length>0))){const t=[];for(let e=6;e>=0;e--){const n=new Date;n.setDate(n.getDate()-e);const r=n?.toLocaleDateString("en-US",{day:"numeric",month:"short"});t.push(r)}const r=1024,a=6,l=7;return n("div",{className:"ff-line-chart-text",style:{width:i+20+y,gap:y},children:[e("div",{className:"ff-line-chart-yAxisLabel-warpper",style:{height:o},children:e(q,{className:"ff-line-chart-yAxisLabel",fontSize:p,fontWeight:"semi-bold",children:s})}),e("div",{className:"ff-line-chart-svg",children:e("svg",{height:o,width:i,className:"ff-line-chart-svg",children:n("g",{transform:"translate(40, 40)",children:[e("line",{x1:0,y1:M,x2:E,y2:M,stroke:f,strokeWidth:1}),e("text",{x:E/2.1,y:M+b/1.2,textAnchor:"middle",fill:C,className:"ff-line-chart-x-axis-label",style:{fontSize:p,fontWeight:m},children:d}),t.map((t,n)=>e("text",{x:n*(E/(l-1)),y:M+15,textAnchor:0===n?"start":n===l-1?"end":"middle",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:t},t)),Array.from({length:a}).map((t,n)=>{const i=n*r/(a-1),o=i/1024;return e("text",{x:-10,y:M-i*M/r,textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:o?.toFixed(1)},`y-${n}`)})]})})})]})}function V(e){if(!isNaN(e))return parseFloat(e);const t=Hr,n=e.match(t);if(!n)throw new Error("Invalid input format. Use '<value> <unit>' format (e.g., '10.9580078125 KB') or just a number.");const r=parseFloat(n[1]);switch(n[2]?n[2].toUpperCase():null){case"GB":return parseFloat((1024*r).toFixed(2));case"MB":return parseFloat(r.toFixed(2));case"KB":return parseFloat((r/1024).toFixed(2));default:throw new Error("Invalid unit. Supported units are GB, MB, and KB.")}}const S=r?.[0]?.data?.[0]?.hasOwnProperty("date")&&r?.[0]?.data?.[0]?.hasOwnProperty("totalMemory"),z="date",O=S?"totalMemory":"value",N=e=>{const t=r?.[0]?.data?.length;if(1===t)return A?E/2:E;const n=r[0].data.findIndex(t=>t[z]===e);return-1===n?0:n/(t-1)*E},D=Math.max(...r?.flatMap(e=>e?.data?.map(e=>V(e[O]))),5),T=e=>{if("memory"===v){const t=Math.max(...r?.flatMap(e=>e?.data?.map(e=>V(e[O]))));return M-e*M/(t>1024?t:1024)}return M-e*M/(0===D?1024:D)},I=e=>{if(1===e?.length){const t=e?.[0],n=N(t[z]),r=T(V(t[O]));return`M 0 ${T(0)} L ${n} ${r}`}return e?.reduce((t,n,r)=>{const i=N(n[z]),o=T(V(n[O]));if(0===r)return`M ${i} ${o}`;const a=e[r-1],l=a?N(a[z]):0;return`${t} C ${l+(i-l)/2} ${a?T(V(a[O])):0}, ${i-(i-l)/2} ${o}, ${i} ${o}`},"")},Z=r[0].data;return n("div",{className:"ff-line-chart-text",style:{width:i+20+y,gap:y},children:[e("div",{className:"ff-line-chart-yAxisLabel-warpper",style:{height:o},children:e(q,{className:"ff-line-chart-yAxisLabel",fontSize:p,fontWeight:"semi-bold",children:s})}),n("div",{className:"ff-line-chart-svg",children:[e("svg",{height:o,width:i,onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left-b;if(e.clientY-t.top-b>M)return L(!1),void k({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null});let i={hoverValues:{},dotPositions:{}},o=null;r.forEach((e,t)=>{const r=e.data.reduce((e,t)=>{const r=Math.abs(n-N(t[z]));return r<e.distance?{point:t,distance:r}:e},{point:null,distance:1/0}).point;r&&(o=r[z],i.hoverValues[t]=((e,t=2)=>{let n="";if("string"==typeof e){const t=e.match(Mr),r=e.match(xr);t&&(e=parseFloat(t[0])),r&&(n=r[0])}const r=Math.pow(10,t);return`${Math.ceil(e*r)/r} ${n}`.trim()})(r[O]),i.dotPositions[t]={x:N(r[z]),y:T(V(r[O]))})}),L(!0),k({cursorX:n,hoverValues:i.hoverValues,dotPositions:i.dotPositions,currentXValue:o,tooltip:o?{visible:!0,left:e.clientX+10,top:e.clientY-20}:{visible:!1,left:0,top:0}})},onMouseLeave:()=>k({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null}),className:"ff-line-chart-svg",children:n("g",{transform:"translate(40, 40)",children:[e("line",{x1:0,y1:0,x2:0,y2:M,strokeWidth:2}),e("line",{x1:0,y1:M,x2:E,y2:M,stroke:f,strokeWidth:1}),e("text",{x:E/2.1,y:M+b/1.2,textAnchor:"middle",fill:C,className:"ff-line-chart-x-axis-label",style:{fontSize:p,fontWeight:m},children:d}),r.map((r,i)=>{return!1!==r.show?n("g",{children:[e("path",{d:I(r.data),fill:"none",stroke:r.color,strokeWidth:a,opacity:(o=r.data,o.every(e=>0===V(e[O]))?.5:1)}),H.dotPositions[i]&&n(t,{children:[e("line",{x1:H.dotPositions[i].x,y1:0,x2:H.dotPositions[i].x,y2:M,stroke:"gray",strokeWidth:.5,strokeDasharray:"4"}),e("circle",{cx:H.dotPositions[i].x,cy:H.dotPositions[i].y,r:5,fill:"white",stroke:r.color,strokeWidth:a,style:{transition:"cx 0.1s, cy 0.1s"}}),e("line",{x1:0,y1:H.dotPositions[i].y,x2:E,y2:H.dotPositions[i].y,stroke:"gray",strokeWidth:.5,strokeDasharray:"4"})]})]},i):null;var o}),(()=>{if(1===Z.length){const t=Z?.[0];return e("text",{x:A?E/2:E,y:M+15,textAnchor:A?"middle":"end",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=t[z]?String(t[z]):""},String(t[z]))}if(Z.length<7)return Z.map(t=>e("text",{x:N(t[z]),y:M+15,textAnchor:"middle",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=t[z]?String(t[z]):""},String(t[z])));{const t=(i-80-7*9.2)/6;return Array.from({length:7}).map((n,r)=>{const i=Math.floor(r*(Z?.length-1)/6),o=Z[i];return e("text",{x:r*t,y:M+15,fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=o?.[z]?String(o?.[z]):""},String(o?.[z]))})}})(),(()=>{if("memory"===v){const t=Math.max(D,1024);return Array.from({length:6}).map((n,r)=>{const i=r*t/5,o=i/1024;return e("text",{x:-10,y:T(i),textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:o.toFixed(1)},`y-${r}`)})}return Array.from({length:6}).map((t,n)=>{const r=n*D/5;return e("text",{x:-10,y:T(r),textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:r.toFixed(0)},`y-${n}`)})})()]})}),x&&H.tooltip.visible&&n("div",{className:"ff-line-chart-tooltip",style:{left:w&&H.tooltip.left/2>i/1.75?H.tooltip.left-180:H.tooltip.left,top:H.tooltip.top},children:[e("div",{className:"ff-line-chart-date",children:H.currentXValue}),Object.entries(H.hoverValues).map(([t,i])=>!1!==r[Number(t)]?.show&&n("div",{className:"ff-line-chart-inner-tooltip",children:["default"!==r[Number(t)]?.name&&e("div",{className:"ff-line-chart-status-dot",style:{backgroundColor:r[Number(t)]?.color}}),r[Number(t)]?.name,": ",i]},t))]})]})]})},KM=({onClose:t,top:r="100px",left:i="0px",className:o,description:a="Download and Install the fireflink client to run the script",onClick:s=()=>{},optionZIndex:c=10000001})=>{l(()=>{const e=e=>{"Escape"===e.key&&t?.()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[t]);return n("div",{className:`ff-download-client-wrapper ${o}`,style:{top:r,left:i,zIndex:c},children:[n("div",{className:"ff-download-client-header-wrapper",children:[e("div",{className:"ff-download-client-hollow-triangle"}),e(q,{fontWeight:"semi-bold",lineHeight:"32px",className:"ff-download-client-header-text",children:"Download client"}),e(F,{name:"close",color:"var(--brand-color)",className:"ff-download-client-close-icon",height:12,width:12})]}),n("div",{className:"ff-download-client-content-text",children:[e(q,{as:"div",color:"var(--download-client-content-text-color)",fontWeight:"semi-bold",textAlign:"center",lineHeight:"26px",children:a}),e(q,{as:"div",className:"ff-download-client-description-text",textAlign:"center",fontWeight:"medium",lineHeight:"26px",children:"Choose OS to Download"}),e("div",{className:"ff-download-client-os-wrapper",children:["windows","mac_icon","linux"]?.map(t=>e("div",{className:"ff-os-version-wrapper",onClick:()=>{s("mac_icon"===t?"mac":t)},children:e(F,{name:t,height:36,width:36})},t))})]})]})},JM=({legendName:t,height:r,width:i,children:o})=>e("div",{className:"ff_fieldSet_container",children:n("fieldset",{className:"ff_fieldSet",style:{height:r,width:i},children:[e("legend",{className:"ff_legend_container",children:e(q,{color:"var(--license_header_text_color)",fontSize:8,lineHeight:"12px",children:t})}),e("div",{className:"ff_children_container",children:o})]})}),$M=({onSelectVariable:t,dropdownPosition:n,filteredOptions:r=[],position:i="relative",width:o="100%",zIndex:s,truncateTextValue:c=34,highlightedIndex:d})=>{const u=a(null);return l(()=>{u.current?.scrollIntoView({block:"nearest"})},[d]),e("div",{className:D(`ff-variable-dropdown-container ${i}`),style:n?{top:n.top+30,left:n.left-30,width:o,zIndex:s}:{width:o,zIndex:s},children:G(r)?e("div",{className:"ff-variable-option no-data",children:e(q,{as:"div",children:"No Option",fontSize:14})}):r?.map((n,r)=>e("div",{className:D("ff-variable-option",{"ff-variable-option--highlighted":d===r}),onMouseDown:()=>t(n),ref:d===r?u:null,children:e(Y,{title:Ln(n?.name,c,"pixel")?n?.name:"",children:e(q,{children:xn(n?.name,c,"pixel")})})},n?.id))})},ex=o(({label:t="",hashInputValue:r="",setHashInputValue:i,variableList:o=[],placeholder:s="Enter text",onChange:d,onPaste:u,onCreateVariableClick:f,handleClearInput:h,value:C="",dropdownWidth:p="100%",dropdownHeight:m="160px",isHash:g=!1,isOnlyHash:v=!1,dataFiles:A=[],showAddVariableIcon:y=!0,helperText:b="",error:E,autoComplete:M="off",required:x=!1,zIndex:L=9999,truncateTextValue:H=34,formProps:k={},getSelectedVariable:V=()=>{},symbol:S="$",type:z="text",clearIcon:O=!0,inputTitle:N="",onBlur:T,helperTextWidth:I,iconProps:Z={isShowIcon:!1,iconName:"",iconToolTipTitle:"",isIconDisable:!1,iconColor:"",onIconClick:()=>{}},...R},j)=>{const[B,P]=c(!1),[_,U]=c(!1),[W,X]=c(0),[Q,K]=c(!1),[J,$]=c(null),[ee,te]=c(0),[ne,re]=c(!1),[ie,oe]=c([]),ae=a(null),le=a(null),[se,ce]=c("auto"),de=Z?.isShowIcon;l(()=>{const e=le.current?.querySelector(".ff-input-container");if(!e)return;const t=new ResizeObserver(e=>{for(let t of e){const e=`${t.contentRect.width}px`;ce(e)}});return t.observe(e),()=>{t.disconnect()}},[]),w(j,()=>ae.current),l(()=>{null!==J&&ae.current&&(ae.current.setSelectionRange(J,J),ae.current.focus())},[J]),l(()=>{g&&P(C.startsWith("#"));const e=A?.find(e=>e.name===C),t=o?.find(e=>e?.name===C);if(C.startsWith("#")&&g){const e=C.slice(1).toLowerCase(),t=A.filter(t=>t.name.toLowerCase().includes(e));oe(t),P(!0)}const n=null!==e&&C.startsWith("#"),r=null!==t&&C.startsWith("$"),i=C.length>(t?.name.length||0),a=C.length>0&&!r||C.startsWith("#");v?re(!1):r||n||C.includes("$")||C.includes("#")?(re(!1),a&&re(!0)):i&&!C.includes("$")&&re(!0)},[C]);const ue=()=>{ae.current&&te(ae.current.selectionStart||0)},fe=ue,he=ue;l(()=>{ae.current&&te(ae.current.selectionStart||0)},[C]);const Ce=e=>{if(ae.current){const{selectionStart:t,selectionEnd:n}=ae.current,r=`${e.name}`;let o;if(o=g&&"#"===C[0]?e.name+C.slice(n||1):e.name,d){d({target:{value:o}},e),V(e.name)}ae.current.value=o,i?.(e),$((t||0)+r.length),P(!1),U(!0)}};const pe=function(e,t,n){let r=!1,i="";const o="}"===C[t-1];if(t<0||t>e.length)return{showDropdown:r,searchString:i};const a=e.lastIndexOf(S,t-1),l=e.indexOf(S,t);if(-1!==a&&(v&&"$"===e[a]?r=!1:t===a+1?(r=!0,i=""):(i=e.slice(a+1,-1===l?void 0:l),t>a+1&&(i=e.slice(a+1,t)),r=!0),_&&o&&(r=!1),(/[{}]/.test(i)||0===t)&&(r=!1,i=""),i)){n.some(e=>e.name.toLowerCase().includes(i.toLowerCase()))||(n=[])}return{showDropdown:r,searchString:i}}(C,ee,o),me=()=>o?.filter(e=>e?.name?.toLowerCase()?.includes(pe?.searchString?.toLowerCase())),ge=C.startsWith("#"),ve=ge?ie:me();l(()=>{X(0)},[g,pe?.showDropdown]);const Ae=Boolean(pe?.showDropdown&&Q),ye=Boolean(B&&g&&Q),we=Boolean((ge?ye:Ae)&&ve.length);return n("div",{className:"ff-add-variable-container",children:[n("div",{className:"ff-add-variable-input",ref:le,children:[e(Y,{title:N,style:{width:"100%"},children:e(xi,{...R,name:"add_variable",ref:ae,type:z,className:D("ff-variable-input-container",{"ff-variable-input-container--show-icon":de}),value:C,onKeyDown:e=>{switch(e.key){case"ArrowDown":if(!we)return;e.preventDefault(),e.stopPropagation(),X(e=>e<ve.length-1?e+1:e);break;case"ArrowUp":if(!we)return;e.preventDefault(),e.stopPropagation(),X(e=>e>0?e-1:0);break;case"Enter":{if(!we)return;e.preventDefault(),e.stopPropagation();const t=ve[W];t&&Ce(t);break}case"Escape":if(!we)return;e.preventDefault(),e.stopPropagation(),P(!1),K(!1),X(0)}},onChange:d,onPaste:()=>{re(!0)},variant:"primary",label:t,placeholder:s,onClick:fe,onKeyUp:he,onFocus:()=>K(!0),onBlur:e=>{(e=>{e.relatedTarget&&e.relatedTarget.closest(".dropdown-container")||K(!1)})(e),T?.(e)},autoComplete:M,helperText:b,error:E,required:x,helperTextWidth:I,...k})}),!G(C)&&ne&&y&&e("div",{className:"ff-create-variable-container",onClick:f,children:e(q,{fontWeight:"regular",fontSize:"10px",color:"var(--brand-color)",cursor:"pointer",children:"Create Variable"})}),!G(C)&&!v&&e("div",{className:D("ff-cancel-icon-container",{"ff-cancel-icon-container--show-icon":de}),children:O&&e(Y,{title:"Cancel",style:{zIndex:99999},children:e(F,{onClick:h,name:"close",height:16,width:16,hoverEffect:!0})})}),de&&e("div",{className:"ff-info-icon-container",children:e(Y,{title:de&&!Z?.isIconDisable?Z?.iconToolTipTitle:"",children:e(F,{name:Z?.iconName||"",hoverEffect:!1,height:16,width:16,color:Z?.iconColor||"var(--text-area-default-color)",onClick:e=>{Z?.onIconClick&&Z?.onIconClick(e)},disabled:Z?.isIconDisable,cursorType:"pointer"})})})]}),pe?.showDropdown&&Q&&e(GM,{position:"absolute",zIndex:L,truncateTextValue:H,width:se,height:G(me())?"auto":m,optionsList:ve,onSelectVariable:Ce,highlightedIndex:W}),B&&g&&Q&&e($M,{position:"relative",zIndex:L,truncateTextValue:H,width:se,filteredOptions:ve,onSelectVariable:Ce,highlightedIndex:W})]})}),tx=({isOpen:t,variableTypesList:r=[],onClose:i,onNameChange:o,onValueChange:a,variableName:s,variableValue:d,onVariableTypeChange:u,selectedVariableType:f,hideValue:h=!1,onHideChange:C,handleSubmit:p,mode:m="create",disabled:g,dataFiles:v=[],truncateTextValue:A=34,isEnterKeySubmit:y=!1,showHideValueOption:w=!0})=>{const[b,E]=c(!1),[M,x]=c(""),[L,H]=c(),[k,V]=c(!1),[S,z]=c(!1),[O,N]=c({name:"",value:"",isChecked:!1});l(()=>{t&&"edit"===m&&N({name:s,value:d,isChecked:h})},[]);const D=e=>e&&0!==e.length?" "===e[0]||" "===e[e.length-1]?"Space is not allowed at starting and at the end":Fn.test(e)?e.length<3?"Name should contain at least 3 characters":e.length>25?"Name can contain at most 25 characters":"":"Name should be alphanumeric":"Variable Name is required";function T(e){const t=!!e,n=Fn.test(e),r=Jr.test(e),i=e.length>=3&&e.length<=25;return t&&n&&r&&i}l(()=>{const e=D(s);E(!!e),x(e)},[s]),l(()=>{if("edit"!==m)return;const{name:e,value:t,isChecked:n}=O;z(s!==e||d!==t||h!==n)},[m,s,d,h,O]);const I=()=>{!k&&T(s)&&(V(!0),p())};l(()=>{if(!y)return;const e=e=>{if("Enter"===e.key){e.preventDefault();!T(s)||k||"edit"===m&&!S||I()}};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[y,s,d,h,k,m,S,f]);return e(vn,{zIndex:1350,onClose:i,isOpen:t,title:"create"===m?"Create Variable":"Edit Variable",width:"284px",height:w?"280px":"250px",top:"30%",right:8,isFooterRequired:!0,overlay:!0,footerContent:e(()=>n("div",{className:"ff-create-slider-footer",children:[e(U,{onClick:i,label:"Cancel",variant:"tertiary"}),e(U,{variant:"primary",label:"create"===m?"Create":"Update",type:"submit",onClick:I,disabled:!T(s)||k||"edit"===m&&!S})]}),{}),children:n("div",{className:"ff-create-variable-slider",children:[e("div",{className:"ff-create-variable-slider-input",children:e(xi,{label:"Variable Name",required:!0,type:"text",name:"variableName",value:s||"",onChange:e=>{V(!1),o(e.target.value)},error:b,helperText:M,onBlur:e=>{const t=e.target.value,n=D(t);E(!!n),x(n)}})}),e(Vo,{label:"Variable Type",required:!0,onChange:e=>{u(e),V(!1)},selectedOption:f,optionsList:r,optionZIndex:99999,valueAccessor:"label",disabled:"edit"===m}),e(ex,{label:"Variable Value",placeholder:"Enter Variable value or select path using #",isHash:!0,isOnlyHash:!0,zIndex:99999,truncateTextValue:A,dataFiles:v,dropdownWidth:"100%",setHashInputValue:H,hashInputValue:L||{},value:d||"",type:h?"password":"text",onChange:(e,t)=>{const n=e.target.value;a(n,t)},showAddVariableIcon:!1}),w&&n("div",{className:"ff-hide-value-content",children:[e(bn,{onChange:e=>C(e.target.checked),name:"hideValue",label:"Hide Value",checked:h,disabled:g}),e(Y,{title:"Once the value is hidden, it cannot be undone",children:e(F,{name:"info",width:12,height:12})})]})]})})},nx=({highlightText:t="",tableMeta:r=[],tableData:i=[],accordionType:o="row",noDataContent:a,height:l="100%",withFixedHeader:s=!1,headerType:d,TableAccordionStateIconWidth:u=4,TableAccordionStateIconHeight:f=8})=>{const[h,C]=c(-1),p=(e,t)=>{let n=e[t.accessor];return t.cell?t.cell({value:n,row:e,column:t.accessor}):t.accessor||n&&"object"!=typeof n?n:"--"},m=t=>t.map((t,n)=>e("table",{className:"ff-accordion-table",cellSpacing:0,children:e("tbody",{className:"ff-table-body",children:e("tr",{className:"ff-table-row",children:r.map((n,r)=>e("td",{className:"ff-table-cell",style:{width:n.width},children:"column"===o&&0===r?"":e(q,{children:p(t,n)})},n.accessor+r))},t.id||n)})},`accordion-table-${n}`));return n("div",{style:{height:l},className:D("ff-accordion-table-container",{"ff-accordion-fixed-header-table":s}),children:[e("table",{cellSpacing:0,className:D("ff-accordion-table",{"ff-accordion-fixed-header":s}),children:e("thead",{children:e("tr",{className:"ff-table-row",children:r.map(t=>e("th",{style:{width:t.width},className:D("ff-table-header",d&&`ff-accordion-table--${d}-bg`),children:e("div",{children:e(q,{fontWeight:"semi-bold",fontSize:12,children:t.header})})},`header-${t.header}`))})})}),"row"===o&&i.map((n,r)=>e(yn,{highlightText:t,headerTitle:n.title,color:"var(--text-color)",accordionContent:m(n.data),disable:n.disable,disableInfoMessage:n.disableInfoMessage,accordionStateIconName:"arrows_down_icon",AccordionStateIconWidth:u,AccordionStateIconHeight:f},`accordion-row-${r}`)),"column"===o&&i.map((i,o)=>n("div",{className:"column-table-accordion",children:[e("div",{className:"ff-display-flex",children:e(Y,{title:i.disable?i?.disableInfoMessage:"string"==typeof i.title&&Ln(i.title,r[0]?.width,"pixel")?i.title:"",placement:"bottom-start",children:n("div",{className:`accordion-header ${i.disable&&"accordion-header--disabled"}`,children:[e("div",{className:"header-title",children:e("span",{children:e(q,{children:e(An,{text:xn(i.title,r[0]?.width,"pixel"),highlight:t})})})}),e("div",{className:"accordion-arrow",onClick:()=>{!i.disable&&(e=>{C(e===h?-1:e)})(o)},children:e(F,{name:h===o?"arrows_down_icon":"arrows_right_icon",color:"var(--table-with-accordion-icon-color)",width:u,height:f,hoverEffect:!1})})]})})}),h===o&&e("div",{children:m(i.data)})]},`column-accordion-${o}`)),i.length<=0&&e("div",{className:"no-data-content",style:{height:`calc(${l} - 50px)`},children:a})]})},rx=({progressPercentage:t,totalMemory:r,usedMemory:i,color:o="var(--brand-color)",trackColor:a="#f0f0f0",height:l=10,label:s,labelFontSize:c=12,labelTextColor:d="var(--ff-card-status-text-color)",showPercentage:u=!1,percentageFontSize:f=10,percentageTextColor:h="var(--tooltip-text-color)",progressBarWidth:C="200px"})=>{const p=e=>{const t=e.trim().toLowerCase();if("0"===t)return 0;const n=t.match(/^(\d+(?:\.\d+)?)\s*(kb|mb|gb)$/);if(!n||!n[1])return 0;const r=parseFloat(n[1]),i=n[2];return"gb"===i?1024*r:"kb"===i?r/1024:r};let m=0,g=s;if(void 0!==r&&void 0!==i){const e=p(i),t=p(r);t>0?(m=e/t*100,g=s||i):(m=0,g="0MB")}else m=t||0;const v=Math.max(0,Math.min(m,100));return n("div",{className:"ff-progress-bar-container "+(g?"ff-has-label":""),style:{width:C},children:[e("div",{className:"ff-progress-bar-track",style:{backgroundColor:a,height:`${l}px`},children:e("div",{className:"ff-progress-bar",style:{width:`${v}%`,backgroundColor:o,height:`${l}px`},children:u&&e(q,{className:"ff-progress-bar-percentage",fontSize:f,color:h,children:`${Math.round(v)}%`})})}),g&&e("div",{className:"ff-progress-bar-label",children:e(q,{fontSize:c,color:d,children:e(Y,{title:Ln(g,10,"count")?g:"",children:xn(g,10,"count")})})})]})},ix=({variant:t="primary",size:n="small",onClick:r,label:i="Choose File",disabled:o=!1,type:l="button",className:s="",style:d={},iconName:f,isChooseFile:h=!1,buttonWidth:C="auto",buttonHeight:p="auto",selectedFile:m={},handleCloseIcon:g,isMandatory:v=!1})=>{const A=a(null),[y,w]=c(0);u(()=>{A.current&&w(A.current.getBoundingClientRect().width-10)},[C]);const b=m?.name||i,E=y?xn(b,y,"pixel"):b,M=!!y&&Ln(b,y,"pixel");return e("div",{ref:A,style:{width:C},children:e(Y,{title:M?b:"",children:e(U,{variant:t,label:E,type:l,onClick:r,buttonWidth:C,buttonHeight:p,isChooseFile:h,size:n,disabled:o,className:s,iconName:f,style:d,iconPosition:"right",selectedFile:m,handleCloseIcon:g,isMandatory:v})})})},ox=({selected:t="text",handleClick:r,tabList:i})=>{const o=i?.includes("Automation"),a=i?.includes("Manual");return n("div",{className:"ff-script-switch-container",children:[e(Y,{title:o?"Automation":"Add Automation",zIndex:1e3,children:e("div",{className:"ff-script-switch-button "+("Automation"===t?"active":""),onClick:()=>r(o?"Automation":"Add Automation"),children:e(F,{name:o?"automation_testcase":"add_testcase",color:"Automation"===t?"var(--primary-button-text-color)":"var(--description-text)"})})}),e(Y,{title:a?"Manual":"Add Manual",zIndex:1e3,children:e("div",{className:"ff-script-switch-button "+("Manual"===t?"active":""),onClick:()=>r(a?"Manual":"Add Manual"),children:e(F,{name:a?"manual_testcase":"add_testcase",color:"Manual"===t?"var(--primary-button-text-color)":"var(--description-text)"})})})]})},ax=({selected:t,handleClick:n,tabList:r})=>e("div",{className:"ff-switch-container",children:r.map(r=>e(Y,{title:t===r.name?null:r.tooltip,zIndex:1e3,children:e("div",{className:"ff-switch-button "+(t===r.name?"active":""),onClick:()=>n(r.name),children:e(F,{name:r.icon,color:t===r.name?"var(--primary-button-text-color)":"var(--description-text)"})})},r.name))}),lx=({onModalClose:t,MediaSrc:r,fileName:o,onDeleteClick:a,mediaType:s,fileId:d,thumbnailMediaSrc:u,isDelete:f=!0,onExpandClick:h,onDownloadClick:C,isMediaIcon:p=!1,previewOnly:m=!1,iconName:g="video_preview",isDisabled:v=!1})=>{const[A,y]=c(!1),w=i.useRef(null),b=()=>{y(!0),h&&h(d)},E=()=>{t?.(),y(!1)},M=()=>{C&&C(d)};return l(()=>{m&&y(!0)},[m]),n("div",{children:[!m&&(p?e(F,{name:g,hoverEffect:!0,onClick:b,disabled:v}):e(ew,{mediaSrc:r,mediaType:s,onDownloadClick:M,onDeleteClick:()=>a?.(r),onExpandClick:b,fileName:o,fileId:d,thumbnailMediaSrc:u,isDelete:f})),A&&e(Hp,{isOpen:A,onClose:E,isFooterDisplayed:!1,isHeaderDisplayed:!1,customWidth:"1130px",customHeight:"570px",zIndex:1e4,children:n("div",{className:"media-wrapper",children:[n("div",{className:"ff-expand-icons",children:[e(Y,{title:"Download File",children:e(F,{name:"download_file_icon",onClick:M,color:"var(--icons-default-color)",className:"header-icons"})}),e(Y,{title:"Expand",children:e(F,{name:"expand",onClick:b,color:"var(--icons-default-color)",className:"header-icons"})}),e(Y,{title:"close",children:e(F,{name:"close",onClick:E,color:"var(--icons-default-color)",className:"header-icons"})})]}),"image"===s&&e("img",{src:r,alt:"fileName",height:"auto"}),"video"===s&&e("video",{src:r,controls:!0,controlsList:"nodownload",className:"ff-video-preview",ref:w,onCanPlay:()=>{if(w.current){const e=w.current.play();void 0!==e&&e.catch(e=>{console.error("Autoplay failed:",e)})}}})]})})]})},sx=({children:t,orientation:r="",navBarIcons:o=[],mobileHeight:a=448,mobileWidth:l=220,UtilityBar:s,tooltip:c={},background:d,navBarPosition:u="bottom"})=>{const f="portrait"===r,h=f?a:l,C=f?l:a,p=s&&"top"===u,m=s&&"bottom"===u,g=s&&"left"===u;return n("div",{className:["ff-mobileskin-wrapper",f?"portrait":"landscape",g?"ff-side-nav-left":"",p?"navbar-top":"",m?"navbar-bottom":""].filter(Boolean).join(" "),children:[p&&e("div",{className:"ff-nav-bar top-nav-bar",children:o.map(({title:t,name:n,className:r,...i},a)=>{const l=c?.[n]??a;return e(Y,{title:c?.[n]||"",placement:"top",children:e("div",{className:`ff-nav-bar-icon ${r||""} ${a===o.length-1?"last-icon":""} ${p?"navbar-top":""}`,children:e(F,{name:n,...i})})},l)})}),e("div",{className:"ff-mobileskin-container",style:{height:h+16,width:C+16},children:e("div",{className:"ff-mobile-container",style:{width:C,height:h,background:d||"transparent"},children:e("div",{className:"ff-mobile-image-container",children:i.isValidElement(t)?t:e("img",{src:t,alt:"Mobile content",style:{width:f?"100%":2.1*l+"px",height:f?"100%":.5*a+"px"}})})})}),s&&m&&e("div",{className:"ff-nav-bar",children:o?.map((t,n)=>{const{title:r,...i}=t;return e("div",{className:`ff-nav-bar-icon ${t?.className||""} ${n===o.length-1?"last-icon":""}`,children:e(Y,{title:r,children:e(F,{...i})})},n)})}),s&&g&&e("div",{className:"ff-side-nav-bar",children:o?.map((t,n)=>{const{title:r,...i}=t;return e("div",{className:`ff-sidebar ${t?.className||""} ${n===o.length-1?"last-icon":""}`,children:e(Y,{title:r,placement:"bottom",children:e(F,{...i})})},n)})})]})},cx=o(({width:t=300,height:r=40,iconHeight:i=16,iconWidth:o=16,placeholder:l="Enter text",iconName:s="right_arrow_filled_icon",iconPosition:c="left",borderRadius:d=4,autoFocus:u=!1,value:f="",iconColor:h="var(--brand-color)",tooltipTitle:C="send",submitPrompt:p,onPromptChange:m,onBlur:g,onFocus:v,disableInput:A,isAdditionalIcon:y=!1,additionalIconName:w,additionIconToolTip:b,onAdditionalIconClick:E},M)=>{const x=a(null);Sn([{key:"Enter",action:()=>L()}],x);const L=e=>{f&&p?.(f.trim())};return n("div",{className:D("ff-prompt-container",{"icon-left":"left"===c,"icon-right":"left"!==c}),style:{width:`${t}px`,height:`${r}px`,borderRadius:d},ref:x,children:[e(Y,{placement:"top",title:C,children:e(F,{name:s,className:"ff-prompt-icon",height:i,width:o,onClick:p,color:h,disabled:G(f)})}),e("input",{ref:M,className:"ff-prompt-input",type:"text",placeholder:l,autoFocus:u,onChange:m,onFocus:v,onBlur:g,value:f,readOnly:A}),y&&w&&e(Y,{placement:"top",title:b,children:e(F,{name:w,className:"ff-prompt-icon additional-icon",height:i,width:o,onClick:E})})]})}),dx=({content:t,isVisible:n,maxWidth:r=300,onClick:i,isClickable:o=!0,arrowPosition:a="left"})=>e("div",{onClick:i,style:{width:`${r}px`,"--triangle-position":r-4+"px"},className:D("ff-chat-msg-box",{visible:n,hidden:!n,pointer:o,default:!o,"chat-arrow-left":"left"===a,"chat-arrow-right":"left"!==a}),children:e("div",{className:D("content",`arrow-${a}`),children:e(q,{children:t})})}),ux=({iconName:r,iconPosition:{top:i,left:o,bottom:a,right:l},hoverIconPosition:{top:s,left:d,bottom:u,right:f},modalPosition:{top:h,left:C,bottom:p,right:m},modalWidth:g,modalHeight:v,headerContent:A="Header Content",footerContent:y="Footer Content",iconWidth:w,iconHeight:b,modalHeading:E="Ask Fia",children:x,onClearChat:L})=>{const[H,k]=c(!1),[V,S]=c(!1);return n(t,{children:[n("div",{style:{top:void 0!==i?`${i}px`:void 0,left:void 0!==o?`${o}px`:void 0,bottom:void 0!==a?`${a}px`:void 0,right:void 0!==l?`${l}px`:void 0},className:"ff-dynamic-icon-container",children:[e(F,{className:"ff-dynamic-icon",name:r,onClick:()=>{S(e=>!e),setTimeout(()=>k(e=>!e),10)},height:b,width:w}),e("div",{style:{top:void 0!==s?`${s}px`:void 0,left:void 0!==d?`${d}px`:void 0,bottom:void 0!==u?`${u}px`:void 0,right:void 0!==f?`${f}px`:void 0},className:"ff-chat-icon-hover",children:e(F,{name:"ask_fia_icon",height:32,width:82})})]}),V&&M(e("div",{className:D("ff-dynamic-modal",{open:H}),style:{top:void 0!==h?`${h}px`:void 0,left:void 0!==C?`${C}px`:void 0,bottom:void 0!==p?`${p}px`:void 0,right:void 0!==m?`${m}px`:void 0,position:"fixed",height:v,width:g},children:n("div",{className:"ff-dynamic-modal-content",children:[A&&e("div",{className:"ff-dynamic-modal-header",children:n("div",{className:"header-container",children:[n("div",{className:"header-left",children:[e(F,{height:16,width:16,name:"fia_icon"}),e(q,{fontWeight:"medium",children:E})]}),n("div",{className:"header-right",children:[e("span",{className:"action",children:e(Y,{title:"Clear chat",placement:"bottom",children:e(F,{height:16,width:16,name:"delete",color:"var(--tooltip-text-color)",onClick:L})})}),e("span",{className:"action",children:e(Y,{title:"Close",placement:"bottom",children:e(F,{height:16,width:16,name:"close",color:"var(--tooltip-text-color)",onClick:()=>(k(!1),void setTimeout(()=>S(!1),300))})})})]})]})}),e("div",{className:"ff-dynamic-modal-body",children:x}),y&&e("div",{className:"ff-dynamic-modal-footer",children:y})]})}),document.body)]})},fx=o(({iconName:r,hoverTitle:i,iconPosition:{top:o,left:a,bottom:l,right:s},hoverIconPosition:{top:c,left:d,bottom:u,right:f},modalPosition:{top:h,left:C,bottom:p,right:m},modalWidth:g,modalHeight:v,headerContent:A="Header Content",footerContent:y="Footer Content",iconWidth:b,iconHeight:E,children:x,isVisible:L,isOpen:H,onOpen:k,onClose:V,isIconVisible:S},z)=>(w(z,()=>({closeModal:V})),n(t,{children:[S&&n("div",{style:{top:void 0!==o?`${o}px`:void 0,left:void 0!==a?`${a}px`:void 0,bottom:void 0!==l?`${l}px`:void 0,right:void 0!==s?`${s}px`:void 0},className:"ff-ai-dynamic-icon-container",children:[e(F,{className:"ff-ai-dynamic-icon",name:r,onClick:k,height:E,width:b}),e("div",{style:{top:void 0!==c?`${c}px`:void 0,left:void 0!==d?`${d}px`:void 0,bottom:void 0!==u?`${u}px`:void 0,right:void 0!==f?`${f}px`:void 0},className:"ff-ai-chat-icon-hover",children:e("div",{className:"ai-hover-leaf",children:e(q,{fontWeight:"bold",fontSize:14,color:"var(--chatbot-leaf-text)",children:i})})})]}),L&&M(e("div",{className:D("ff-ai-dynamic-modal",{open:H}),style:{top:void 0!==h?`${h}px`:void 0,left:void 0!==C?`${C}px`:void 0,bottom:void 0!==p?`${p}px`:void 0,right:void 0!==m?`${m}px`:void 0,position:"fixed",height:v,width:g},children:n("div",{className:"ff-ai-dynamic-modal-content",children:[A&&e("div",{className:"ff-ai-dynamic-modal-header",children:A}),e("div",{className:"ff-ai-dynamic-modal-body",children:x}),y&&e("div",{className:"ff-ai-dynamic-modal-footer",children:y})]})}),document.body)]}))),hx=({variant:t,title:r,tabTitle:i,comment:o,profileShortName:a})=>n("div",{className:"ff-history-card",children:[e("div",{className:D("header",`header--${t}`),children:e(q,{fontWeight:"semi-bold",children:i})}),n("div",{className:"body",children:[e("div",{className:"title",children:n("div",{className:"profile",children:[e(q,{className:D("avatar",`avatar--${t}`),children:a}),e(q,{children:r})]})}),n("div",{className:"comment-container",children:[e(q,{fontWeight:"semi-bold",className:"heading",children:"Comments:"}),e(q,{color:"var(--details-page-value-color)",className:"comment",children:o})]})]})]}),Cx=({onChange:t,disabled:r,checked:i=!1,id:o="toggle",path:a})=>n("div",{className:"ff--ai-switch-container",children:[e("input",{className:"ff--ai-switch-checkbox",id:`ff-toggle-${o}`,type:"checkbox",disabled:!!r,onChange:e=>{t&&t(e)},checked:i}),e("label",{className:D("ff--ai-switch-label",{"ff--ai-switch-label--disabled":r}),htmlFor:`ff-toggle-${o}`,children:e("span",{className:"ff--ai-switch-content",children:n("span",{className:"ff--ai-switch-content",children:[e(q,{className:D("ff--ai-switch-typography",{left:i,right:!i}),as:"div",fontWeight:"bold",fontSize:18,color:i?"var(--base-bg-color)":"var(--ff-ai-toggle-text-color)",children:"AI"}),e("img",{className:"ff--ai-switch-image",src:a,alt:"AI image"})]})})})]}),px=o(({name:t,height:n=30,width:r=30,path:i="",onClick:o,color:s="var(--brand-color)",hoverEffect:c=!1,className:d="",disabled:u=!1,variant:f="light",isSelected:h=!1,x:C,y:p,tabIndex:m=-1,...g},v)=>{if(!_[t])return null;const A=a(null);l(()=>{A.current&&(void 0!==C&&A.current.setAttribute("x",String(C)),void 0!==p&&A.current.setAttribute("y",String(p)))},[C,p]);const y={ref:v,onClick:u?void 0:o,style:{height:`${n}px`,width:`${r}px`,cursor:u?"not-allowed":"pointer",opacity:u?.3:1},tabIndex:m,...g};return e("span",{...y,children:e("img",{height:n,width:r,src:i,alt:""})})}),mx=({id:r=0,serialNumber:i,activeId:o,setActiveId:s,children:d,onIconClick:u,numberChildren:f,onContainerClick:h,onNextClick:C,onPreviousClick:p,disabled:m,isEditAccess:g,versionsLength:v,count:A,hiddenActions:y=[]})=>{const[w,b]=c(!1),[E,M]=c(!1),x=a(null),L=Array.isArray(y)?y:y?[y]:[],H=(e,t)=>{e.stopPropagation(),t()};l(()=>{x.current&&(()=>{if(x.current){const e=getComputedStyle(x.current),t=1.2*parseFloat(e.fontSize)*6;x.current.scrollHeight>t&&M(!0)}})()},[]);const k=e=>{e.stopPropagation(),b(!w)};return n("div",{className:`ff-prompt-container-Block ${o===r?"active":"inactive"} `,onClick:()=>{s(r),h()},children:[e(q,{fontSize:8,className:"ff-prompt-number-bg-color",as:"span",children:`Test cases ${i}`}),n(t,{children:[n("div",{className:"ff-prompt-content "+(w?"expanded":""),ref:x,children:[d,w&&n(t,{children:[e("span",{role:"button","aria-label":"toggleExpand",onClick:k,className:"read-less-btn",children:e(q,{color:"var(--brand-color)",fontWeight:"semi-bold",className:"read-more-btn-text",children:"Read Less"})})," "]})]}),E&&!w&&e("div",{role:"button","aria-label":"toggleExpand",onClick:k,className:"read-more-btn",children:e(q,{color:"var(--brand-color)",fontWeight:"semi-bold",className:"read-more-btn-text",children:"Read More"})})]}),n("div",{className:"ff-prompt-icons",children:[e("div",{className:"ff-prompt-icons-leftside",children:[{action:"delete",title:"Delete",color:"var(--ff-delete-button-attachment)"},{action:"edit",title:"Edit",color:"var(--label-edit-text-label-color)"},{action:"regenerate",title:"Regenerate",color:"var(--label-edit-text-label-color)"}].filter(e=>!L.includes(e.action)).map((t,n)=>{const r=g&&"delete"===t?.action||"regenerate"===t?.action&&(v??0)>=3||m;return e(Y,{title:t.title,placement:"bottom",children:e(F,{disabled:r,name:t.action,color:t.color,hoverEffect:!0,onClick:e=>((e,t)=>{e.stopPropagation(),u(t)})(e,t.action)})},`${t?.title}-${n}`)})}),n("div",{className:"ff-prompt-icons-rightside",children:[e(F,{disabled:1===A,className:"ff-prompt-icons-style",name:"arrow_left_accordian",color:"var(--table-column-text-color)",width:18,height:18,onClick:e=>H(e,p),cursorType:"pointer"}),f,e(F,{disabled:A===v,className:"ff-prompt-icons-style",name:"arrow_right_icon",color:"var(--table-column-text-color)",width:18,height:18,onClick:e=>H(e,C),cursorType:"pointer"})]})]})]})},gx=o(({type:t="text",variant:r="primary",name:i="",label:o,disabled:a=!1,disableLinkIcon:l=!1,required:s=!1,placeholder:c="Attach Link",value:d,error:u,helperText:f,noBorder:h,className:C="",onChange:p,onBlur:m,onFocus:g,autoComplete:v="off",autoFocus:A=!1,minValue:y=-1/0,maxValue:w=1/0,transparentBackground:b=!1,size:E="small",isLabelRequired:M=!0,onClick:x,onKeyUp:L,isViewMode:H=!1,...k},V)=>{const S=!G(d);return n("fieldset",{className:D("ff-link-input-fieldset",{"ff-link-input-fieldset--disabled":a}),children:[n("div",{className:D("ff-link-input-container",{"ff-link-input-container--float":S,"ff-link-input-container--disabled":!!a}),children:[M&&n("label",{className:D(`ff-link-input-label-container ff-link-input-label-container--${E}`,{"ff-link-input-label-container--danger":!!u}),htmlFor:i,children:[s&&e("span",{className:"required-asterisk",children:"*"}),e("span",{className:D(`ff-link-input-label ff-link-input-label--${r}`,{"ff-link-input-label--no-hover":!!d,"ff-link-input-label--disabled":!!a,"ff-link-input-label--danger":!!u}),children:o})]}),e("input",{ref:V,name:i,value:d,type:t,spellCheck:!1,id:i,className:D(`ff-link-input ff-link-input-${r} default-input ff-link-input--${E}`,{"ff-link-input--transparentBackground":!!b,"ff-link-input--no-hover":!!d,"ff-link-input--disabled":!!a,"ff-link-input--danger":!!u,"ff-link-input--no-border":!!h,"ff-link-input--placeholder":!M},`${C}`),placeholder:c,disabled:H||a,onChange:p,onFocus:g,onBlur:m,autoComplete:v,autoFocus:A,min:y,max:w,onClick:x,onKeyUp:L,...k}),e("div",{className:"input-link-icon",children:l||u||!S?e(F,{name:"link",disabled:!0}):e(Y,{title:"Click here to navigate",children:e("span",{children:e(F,{name:"link",disabled:!1,onClick:()=>{d&&!u&&window.open(d,"_blank")}})})})})]}),f&&u&&e("span",{className:D("ff-link-input-message",{"ff-link-input-message--danger":!!u}),children:f})]})}),vx=({labelsList:r=[],height:i=""})=>{const o=Ci(),a=e("div",{className:"ff-chip-tooltip",children:r.filter((e,t)=>t>0).map((t,n)=>e(q,{as:"div",className:"ff-chip-tooltip-label",children:t},`label-${n}-${t}`))});return e(t,{children:!G(r)&&n("div",{className:"ff-chip-with-count-container",children:[e(q,{as:"div",fontWeight:"medium",className:"ff-chip-label",style:i?{height:i}:void 0,children:e(su,{children:r[0]||""})}),r.length>1&&n(t,{children:[n(q,{as:"div",className:"ff-chip-count","data-tooltip-id":`tooltip-${o}`,fontWeight:"medium",children:["+",r.length-1]}),e("div",{id:`tooltip-${o}`,className:"ff-chip-tooltip-template",children:e(q,{as:"div",children:a})})]})]})})};class Ax extends b{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t)}render(){return this.state.hasError?this.props.fallback:this.props.children}}const yx=({iconName:t="",onButtonClick:r,buttonLabel:i="Label",buttonText:o="To Add Group",disableButton:a=!1,stepCount:l=1,iconWidth:s=120,iconHeight:c=120,addContentLabel:d="step"})=>n("div",{className:"add-content-button "+(a?"disabled":""),children:[!G(t)&&e("div",{className:"icon-container",children:e(F,{name:t,width:s,height:c})}),n("div",{className:"typography-label-button",children:[n(q,{fontSize:"12px",fontWeight:"regular",lineHeight:"18px",children:[d+l," :"]}),e(q,{fontSize:"12px",fontWeight:"semi-bold",lineHeight:"18px",children:"Click"}),e(Lp,{label:i,onClick:r,iconName:"plus_user_icon",isDisable:a}),e(q,{fontSize:"12px",fontWeight:"semi-bold",lineHeight:"18px",children:o})]})]}),wx=({variant:t="default",tabsData:r,activeTabId:i,onTabClick:o,noBorder:a=!1,noPadding:l=!1,titleSize:s="12px"})=>{const[d,u]=c(0);return n("div",{className:"ff-tabs-slider-container",children:[n("div",{className:D(`ff-tab-row--${t} ff-tab-row-section`,{"ff-tab-row--no-border":a,"ff-tab-row--no-padding":l,"ff-tab-row--position":r.length>4}),children:[r.length>4&&e(F,{className:"ff-tab-icon ff-tab-icon--previous",name:""+(d?"arrow_left_accordian":""),onClick:()=>{d>0&&u(e=>e-1)},hoverEffect:!0}),e("div",{className:"ff-tab-row-carousel",children:e("div",{className:"carousel_inner",style:{transform:`translateX(-${100*d}%)`},children:r.map(r=>n("button",{onClick:()=>!r.disabled&&o(r.id),disabled:r.disabled,className:D(`ff-tab-button--${t}`,{disabled:r.disabled,active:i===r.id}),style:{flex:"0 0 25%"},children:[n("div",{className:"label-count-section",children:[e(Y,{title:r.label.length>9?r.label:"",children:e(q,{children:r.label.length>9?r.label.slice(0,9)+"...":r.label,fontSize:s,lineHeight:"18px",fontWeight:i===r.id?"semi-bold":"regular",color:i===r.id?"var(--tabs-label-active-color)":"var(--tabs-label-default-color)",className:D("ff-tab-label",{"ff-tab-label--active":i===r.id})})}),"default"===t&&r.count&&e("span",{className:D("tab-count",{"tab-count--active":i===r.id}),children:r.count})]}),e("div",{className:D("ff-tab-bar",{"ff-tab-bar--active":i===r.id})}),e("span",{className:"ff-defaultStatus "+("success"===r.status?"ff-successStatus":"error"===r.status?"ff-dangerStatus":"")})]},r.id))})}),r.length>4&&e(F,{className:"ff-tab-icon ff-tab-icon--next",name:""+(d<Math.ceil(r.length/4)-1?"arrow_right_icon":""),onClick:()=>{d<Math.ceil(r.length/4)-1&&u(e=>e+1)},hoverEffect:!0})]}),e("div",{className:"ff-tab-content",children:r.find(e=>e.id===i)?.component})]})},bx=o(({label:t="Status",iconName:r="update_icon",onClick:i,isDisable:o=!1,variant:a="default",backgroundColor:l=!1,border:s=!1},c)=>{const d={default:"var(--ff-avatar-background-color)",success:"var(--status-success-text-color)",danger:"var(--ff-delete-button-attachment)"};return e("button",{disabled:o,onClick:i,className:`\n ff-status-indicator\n ff-status-indicator--${a}\n ${l?`ff-status-indicator--with-bg ff-status-indicator--${a}-bg`:""}\n ${s?`ff-status-indicator--with-border ff-status-indicator--${a}-border`:""}\n `,ref:c,children:n("div",{className:"ff-status-indicator__content",children:[e(F,{name:"danger"===a?"close":r,color:d[a]||d.default,className:`ff-status-indicator__icon ff-status-indicator__icon--${a}`}),e(q,{as:"div",fontSize:12,className:`ff-status-indicator__label ff-status-indicator__label--${a}`,fontWeight:"medium",lineHeight:"20px",children:t})]})})}),Ex=({rootLabel:t,childrenLabels:r,align:i="center",direction:o="horizontal"})=>{const a=r.length;return n("div","vertical"===o?{className:"ff-os-tree-vertical",style:{"--child-count":a},children:[n("div",{className:`ff-os-tree-vertical__row ff-os-tree-vertical__row--${i}`,children:[e("div",{className:"ff-os-tree-vertical__root-label",children:t}),e("div",{className:"ff-os-tree-vertical__horizontal-line"})]}),n("div",{className:"ff-os-tree-vertical__vertical-line-wrapper",children:[e("div",{className:"ff-os-tree-vertical__vertical-line"}),r.map((t,r)=>n("div",{className:"ff-os-tree-vertical__child",children:[e("div",{className:"ff-os-tree-vertical__child-connector"}),e("div",{className:"ff-os-tree-vertical__child-label",children:t})]},r))]})]}:{className:`ff-os-tree ff-os-tree--${i}`,style:{"--child-count":a},children:[n("div",{className:"ff-os-tree__root-wrapper",children:[e("div",{className:"ff-os-tree__root-label",children:t}),e("div",{className:"ff-os-tree__vertical-root"})]}),e("div",{className:"ff-os-tree__horizontal-connector",children:r.map((t,n)=>e("div",{className:"ff-os-tree__vertical-child"},n))}),e("div",{className:"ff-os-tree__children",children:r.map((t,n)=>e("div",{className:"ff-os-tree__child-container",children:e("div",{className:"ff-os-tree__child-label",children:t})},n))})]})},Mx=({handleClose:t,handleResend:r,handleOtp:i,resendTimeout:o=30})=>{const[s,d]=c(Array(6).fill("")),[u,f]=c(o),[h,C]=c(!0),p=a(Array(6).fill(null));l(()=>{h||p.current[0]?.focus()},[h]),l(()=>{let e;return u>0&&(e=window.setInterval(()=>f(e=>e-1),1e3)),0===u&&C(!1),()=>clearInterval(e)},[u]);const m=e=>{e.preventDefault();const t=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,6),n=Array(6).fill("");t.split("").forEach((e,t)=>{n[t]=e}),d(n);const r=Math.min(t.length,5);p.current[r]?.focus()};return e(Hp,{isOpen:!0,onClose:t,isFooterDisplayed:!1,isHeaderDisplayed:!1,zIndex:999999,customWidth:"340px",children:n("div",{className:"ff-otp-popup",children:[n("div",{className:"ff-otp-header",children:[e(q,{fontSize:24,lineHeight:"36px",fontWeight:"semi-bold",children:"OTP Verification"}),e(F,{name:"close",height:16,width:16,onClick:t,className:"ff-close-icon"})]}),e("div",{className:"ff-otp-boxes",children:s.map((t,n)=>e("input",{type:"text",maxLength:1,className:`ff-otp-input ${t?"filled":""} ${n===s.findIndex(e=>""===e)?"active":""}`,value:t,onKeyDown:e=>((e,t)=>{const{key:n}=e;if(/^[0-9]$/.test(n)){e.preventDefault();const r=[...s];r[t]=n,d(r),t<5&&p.current[t+1]?.focus()}else if("Backspace"===n){e.preventDefault();const n=[...s];n[t]="",d(n),t>0&&p.current[t-1]?.focus()}})(e,n),onPaste:m,ref:e=>p.current[n]=e,readOnly:!0},n))}),e(U,{variant:"primary",label:"Submit",onClick:()=>i(s.join("")),disabled:s.includes(""),className:"ff-submit-btn"}),n("div",{className:"ff-resend "+(h?"disabled":""),onClick:h?void 0:()=>{f(o),C(!0),d(Array(6).fill("")),r()},children:["Re-send OTP",u>0?` (${u}s)`:""]})]})})},xx=({isOpen:t,onClose:r,isPlaying:i,onTogglePlay:o,mediaType:s,src:d,headerTitle:u,onDownload:f,onExpand:h,showHeader:p=!0,showDownload:m=!0,showExpand:g=!0,width:v="800px",height:A="432px",showControls:y=!0,customStyle:w,overlay:b=!0,children:E,showControlDownload:M=!1,showControlExpand:x=!1,isFullscreen:L=!1})=>{const H=a(null),k=a(null),[V,S]=c(0),[z,O]=c(0),[N,D]=c(!1),[T,I]=c(0);l(()=>{"video"===s&&H.current&&!E&&(i?H.current.play():H.current.pause())},[i,s,E]);const Z=C(()=>{if(H.current&&!N){const e=H.current.currentTime/H.current.duration*100;I(e||0),S(H.current.currentTime)}},[N]),R=C(()=>{H.current&&O(H.current.duration)},[]),j=C(()=>{S(0),I(0),o?.()},[o]),B=C(e=>`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`,[]),P=C(e=>{if(H.current){const t=e/100*H.current.duration;H.current.currentTime=t,I(e),S(t)}},[]),_=C(e=>{if(N||!k.current)return;const t=k.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));P(i)},[P,N]),U=C(e=>{if(!k.current)return;D(!0);const t=k.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));P(i)},[P]),W=C(e=>{if(!N||!k.current||!H.current)return;const t=k.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));P(i)},[N,P]),X=C(()=>{D(!1)},[]);return l(()=>{if(N)return document.addEventListener("mousemove",W),document.addEventListener("mouseup",X),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",X)}},[N,W,X]),t?e(eu,{isOpen:t,onClose:r,isMaximized:!1,showHeader:p,overlay:b,downloadHandler:()=>{},customStyle:w,header:n("div",{className:"ff-header-content",children:[e(F,{width:23,height:23,name:"automatic_locator"}),e(q,{children:e("span",{className:"ff-header-title",children:u})})]}),icons:e(Y,{title:"Close",children:e(F,{name:"close",onClick:r})}),width:v,height:A,zIndex:999,children:n("div",{className:"ff-video-wrapper",children:[E||("video"===s?e("video",{ref:H,src:d,className:"ff-media-video",onTimeUpdate:Z,onLoadedMetadata:R,onEnded:j}):e("img",{src:d,alt:"Preview",className:"ff-media-image"})),n("div",{className:"ff-top-right-icons",children:[m&&e(Y,{title:"Download",children:e(F,{name:"download_file",color:"white",onClick:f})}),g&&e(Y,{title:L?"Minimize":"Maximize",children:e(F,{name:L?"collapse_icon":"expand_icon",color:"white",onClick:h})})]}),"video"===s&&y&&!E&&n("div",{className:"ff-media-controls",children:[e("button",{onClick:o,className:"ff-play-pause-btn",children:e(Y,{title:i?"Pause":"Play",children:e(F,{width:35,height:35,name:i?"pause_button":"play_button",color:"white"})})}),n("div",{className:"ff-progress-bar",children:[e("span",{className:"ff-current-time",children:B(V)}),e("input",{type:"range",className:"ff-seek-bar",min:0,max:100,value:T,onChange:e=>P(parseFloat(e.target.value)),onClick:_,onMouseDown:U,ref:k}),e("span",{className:"ff-total-time",children:B(z)})]}),n("div",{className:"ff-control-icons",children:[M&&e(Y,{title:"Download",children:e(F,{name:"download_file",color:"white",onClick:f,cursorType:"pointer"})}),x&&e(Y,{title:L?"Minimize":"Maximize",children:e(F,{name:L?"collapse_icon":"expand_icon",color:"white",onClick:h,cursorType:"pointer"})})]})]})]})}):null},Lx=({header:r,secondaryHeader:i,primaryCount:o,secondaryCount:a,primaryItems:l,secondaryItems:s,width:c,activeTab:d="primary",activeTabId:u,onPrimaryTabClick:f,onSecondaryTabClick:h,onTabClick:C,actions:p,tabsData:m,notchPosition:g="top-left"})=>{const v=i&&"secondary"===d?s:l,A=a&&parseInt(a)>0,y=o&&parseInt(o)>0,w=i&&(y||A),{tooltip:b="Download",iconName:E="download_file",disabled:M=!1,onClick:x,className:L=""}=p?.download||{},{tooltip:H="Delete",iconName:k="delete_icon",disabled:V=!1,onClick:S,className:z=""}=p?.delete||{},O=()=>n("div",{className:"ff-dropdown-header-icons",children:[p?.download&&e(Y,{title:b,children:e(F,{name:E||"",className:`ff-dropdown-icon ff-download-icon ${L}`,onClick:x,width:18,height:20,disabled:M,hoverEffect:!0})}),p?.delete&&e(Y,{title:H,children:e(F,{name:k||"",className:`ff-dropdown-icon ff-delete-icon ${z}`,onClick:S,width:25,height:25,disabled:V,hoverEffect:!0})})]});return n("div",{className:"ff-resolution-dropdown",style:c?{minWidth:c}:{},children:[e("div",{className:"ff-dropdown-notch "+("bottom-center"===g?"bottom-center":"top-left")}),e("div",{className:"ff-dropdown-header",children:e("div",{className:"ff-dropdown-header-content",children:i&&m&&u?n(t,{children:[e(mu,{tabsData:m,activeTabId:u,onTabClick:e=>{C&&C(e),"tab-1"===e&&f?f():"tab-2"===e&&h&&h()}}),w&&O()]}):i&&w?n("div",{className:"ff-dropdown-header-dual",children:[n("div",{className:"ff-dropdown-header-item "+("primary"===d?"active":""),onClick:f,children:[e(q,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:r}),o&&e("span",{className:"ff-dropdown-count",children:o})]}),n("div",{className:"ff-dropdown-header-item "+("secondary"===d?"active":""),onClick:h,children:[e(q,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:i}),a&&e("span",{className:"ff-dropdown-count",children:a})]}),O()]}):i?n("div",{className:"ff-dropdown-header-dual",children:[n("div",{className:"ff-dropdown-header-item "+("primary"===d?"active":""),onClick:f,children:[e(q,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:r}),o&&e("span",{className:"ff-dropdown-count",children:o})]}),n("div",{className:"ff-dropdown-header-item "+("secondary"===d?"active":""),onClick:h,children:[e(q,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:i}),a&&e("span",{className:"ff-dropdown-count",children:a})]})]}):e(q,{fontSize:16,fontWeight:"semi-bold",children:r})})}),e("ul",{className:"ff-dropdown-list",children:v?.map((t,n)=>e("li",{className:"ff-dropdown-item",children:t},n))})]})},Hx=(e,t,n,r)=>{const i=e[t.accessor];if(t.cell){const o=e._id||e.id;return t.cell({value:i,row:e,column:t.accessor,index:n,tableType:r,...o&&{refId:o}})}return t.accessor||i&&"object"!=typeof i?i:"--"},kx=(t,n=[],r,i,o)=>{let a=n;const l=void 0!==i?!i:r;return G(n)&&(isNaN(t)||(a=Array(t).fill(!0))),e("div",{className:"tree-table-fn-space-container",children:a?.map((n,r)=>e("span",{className:`tree-table-fn-space-block tree-table-fn-space-block-${r} ${n?"":"no-lines"} ${l&&r===t-1?"last-node":""} ${o?"folder":""}`},r))})},Vx=i.memo(({treeRowRef:r,col:i,colIndex:o,columnMeta:a,node:l,selected:s,select:c,onCheckBoxChange:d,onToggleExpand:u,onAddConfirm:f,onAddCancel:h,handleEditFieldError:C,isExpanding:p,columnTextColor:m,hideOnDisable:g,addModuleInputWidth:v,addModuleSelectWidth:A,disableEditLabelConfirmIcon:y,isEditable:w,setIsEditable:b})=>{const E={color:`${m||"var(--ff-primary-text-color)"}`,width:a?.width??i?.width,position:a?.sticky?"sticky":void 0,left:a?.sticky?a.left:void 0,zIndex:a?.sticky?a.zIndex:void 0};return n("div",{className:`ff-table-tree-fn-td ${i.isTree&&l.container?"folder":""} ${a?.sticky?"sticky-tree-column":""}`,"data-col-index":o,style:E,children:[i.isTree&&kx(l.hierarchy,l.parentSiblings,l.lastChild,l.nextSibling,l.container),n("div",{className:"tree-fn-title-container",children:[i.isTree&&e("span",{className:`tree-table-fn-space-block last-tree-fn-block last-tree-fn-block tree-table-fn-space-block-${l.hierarchy} ${l?.expanded?"tree-fn-row-expanded":"tree-fn-row-collapsed"} ${l.container&&l.expandable?"":"no-tree-folder"}`,children:l.container&&l.expandable&&n("span",{onClick:()=>u(l),children:[" ",e(p?du:T,{})]})}),n("span",{className:"tree-table-fn-td-content "+(i.isTree&&l.container?"folder":""),children:[!l?.isNewNode&&n(t,{children:[i.isTree&&"checkbox"===c&&!(g&&l.unselectable)&&e("span",{className:"tree-table-fn-td-content-select",children:"none"===l.selectedStatus?e(Y,{title:l?.currentEnvId&&l?.envId&&l?.currentEnvId!==l?.envId?"This script is assigned to another environment. Selecting it will reassign it to the current environment.":void 0,children:e(bn,{checked:"completely"===l.selectedStatus,partial:"partially"===l.selectedStatus,onChange:e=>d(e,l),disabled:l.unselectable||"REVIEW"===l.state||!0===l?.isDisable,isDefaultHover:"none"===l.selectedStatus&&!!l.machine})}):e(bn,{checked:"completely"===l.selectedStatus,partial:"partially"===l.selectedStatus,onChange:e=>d(e,l),disabled:l.unselectable||"REVIEW"===l.state||!0===l?.isDisable})}),i.isTree&&"radio"===c&&!(g&&l.unselectable)&&e("span",{className:"tree-table-fn-td-content-select",children:e(lc,{name:l.key,checked:s.includes(l.key),value:l.key,onChange:e=>d(e,l),disabled:l.unselectable||"REVIEW"===l.state||!0===l?.isDisable})})]}),e("div",{className:"tree-table-cell-flex",children:l.isNewNode&&i.isTree?e(cu,{onCancel:h,onConfirm:f,value:l.value,label:l?.label,optionsList:l.options,selectedOption:l.selectedOption,withDropdown:"inputWithDropdown"===l.type,handleCustomError:C,inputFieldWidth:v,selectFieldWidth:A,confirmIconTooltip:l.confirmIconTooltip,cancelIconTooltip:l.cancelIconTooltip,isEditable:w,setIsEditable:b,isOnBlurTrue:!1,isDisable:{confirm:y},isTableTree:!0}):n(t,{children:[e("span",{className:"tree-table-fn-td-content-text",children:Hx(l,i)}),i.actions&&!l?.isNewNode&&e("div",{className:"table-tree-fn-row-action",children:i.actions(l,r)})]})})]})]})]})});Vx.displayName="TableCell";const Sx=i.memo(({node:t,columnsData:n,columnMeta:r,selected:i,select:o,onRowClick:l,onToggleExpand:s,onCheckBoxChange:c,onAddConfirm:d,onAddCancel:u,handleEditFieldError:f,isExpanding:h,index:C,selectedNode:p,hideOnDisable:m,addModuleInputWidth:g,addModuleSelectWidth:v,disableEditLabelConfirmIcon:A,isEditable:y,setIsEditable:w,style:b})=>{const E=a(null);return e("div",{"data-level":t.hierarchy,ref:E,className:"ff-table-tree-fn-row show-tree "+(p&&p===t.key?"fn-selected-node":""),onClick:e=>l(e,t),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||l(e,t)},role:"button",tabIndex:0,id:0===C?"table-fn-first-row":t.key,style:b,children:n.map((n,a)=>e(Vx,{treeRowRef:E,col:n,colIndex:a,node:t,selected:i,select:o,onCheckBoxChange:c,onToggleExpand:s,onAddConfirm:d,onAddCancel:u,handleEditFieldError:f,isExpanding:h,hideOnDisable:m,addModuleInputWidth:g,addModuleSelectWidth:v,disableEditLabelConfirmIcon:A,isEditable:y,setIsEditable:w,columnMeta:r?.[a]},n.name))})});Sx.displayName="TableRow";const zx=({flattenedTreeData:t,columnsData:n,columnMeta:r,rowHeight:i=32,startIndex:o=0,totalHeight:a=0,selected:l,select:s,onRowClick:c,onToggleExpand:d,onCheckBoxChange:u,onAddConfirm:f,onAddCancel:h,handleEditFieldError:C,expanding:p,selectedNode:m,hideOnDisable:g,addModuleInputWidth:v,addModuleSelectWidth:A,disableEditLabelConfirmIcon:y,isEditable:w,setIsEditable:b})=>e("div",{className:"ff-table-tree-fn-body",style:{height:`${a}px`,position:"relative"},children:t?.map((t,a)=>e(Sx,{node:t,columnsData:n,columnMeta:r,selected:l,select:s,onRowClick:c,onToggleExpand:d,onCheckBoxChange:u,onAddConfirm:f,onAddCancel:h,handleEditFieldError:C,isExpanding:t.key===p,index:o+a,selectedNode:m,hideOnDisable:g,addModuleInputWidth:v,addModuleSelectWidth:A,disableEditLabelConfirmIcon:y,isEditable:w,setIsEditable:b,style:{transform:`translateY(${(o+a)*i}px)`,height:`${i}px`,position:"absolute",top:0,left:0,right:0}},t.key))}),Ox=i.memo(({columnsData:t,columnMeta:r,totalWidth:i,rootNode:o,selected:s,onCheckBoxChange:d,selectedNode:u,tableHeaderBgColor:f,hideOnDisable:h,transparentHeader:C,showHeader:p=!0})=>{const m=a(null),[g,v]=c(!1);l(()=>{v(!0)},[]);const A=(e,t)=>{const n=r?.[e];return{width:n?.width??t,position:n?.sticky?"sticky":void 0,left:n?.sticky?n.left:void 0,zIndex:n?.sticky?n.zIndex:void 0}};return n("div",{className:"ff-table-tree-fn-head",children:[p&&e("div",{className:"ff-table-tree-fn-row no-hover",style:{minWidth:i},children:t.map(({name:t,width:n},i)=>e("div",{className:"ff-table-tree-fn-th "+(r?.[i]?.sticky?"sticky-tree-column":""),"data-col-index":i,style:{...A(i,n),backgroundColor:C?"transparent":f,pointerEvents:C?"none":"auto"},children:t},t))}),o&&e("div",{className:"ff-table-tree-fn-row show-tree "+(u&&u===o?.node?.key?"hover":""),ref:m,children:t.map((t,i)=>e("div",{className:"ff-table-tree-fn-td "+(r?.[i]?.sticky?"sticky-tree-column":""),"data-col-index":i,style:A(i,t.width),children:n("span",{className:"tree-table-fn-default-content "+(0===i?"ff-table-root-index-0":""),children:[0===i&&"checkbox"===o.select&&!(h&&o.node.isDisabled)&&e(bn,{checked:"partially"!==o?.node?.selectedStatus&&("completely"===o?.node?.selectedStatus||!1),partial:"partially"===o.node.selectedStatus,onChange:e=>d(e,o.node),disabled:o.node.isDisabled}),0===i&&"radio"===o.select&&!(h&&o.node.isDisabled)&&e(lc,{name:o.node.key,checked:s.includes(o.node.key),value:o.node.key,onChange:e=>d(e,o.node),disabled:o.node.isDisabled}),n("div",{className:"tree-table-cell-flex",children:[e(su,{children:"name"===t.accessor?o.node[t.accessor]:Hx(o.node,t)}),o.cell&&0===i&&e("span",{className:"table-tree--fn-root-cell",children:o.cell(o.node)}),o.actions&&0===i&&g&&m.current&&e("div",{className:"table-tree-fn-row-action",children:o.actions(o.node,m)})]})]})},i))})]})});Ox.displayName="TableHead";const Nx=32,Dx="__root__",Tx=(e,t)=>{if(!e?.length)return[];const n=new Map,r=new Map,i=new Map,o=new Map;t&&t.key&&n.set(t.key,t),e.forEach(e=>{n.set(e.key,e);const t=e.parentId??Dx;r.has(t)||(r.set(t,[]),o.set(t,{container:0,resource:0})),r.get(t)?.push(e);const i=o.get(t);i&&(e.container?i.container++:i.resource++)}),r.forEach(e=>{e.forEach((e,t)=>{i.set(e.key,t)})});const a=e=>{const t=e.parentId??Dx,a=r.get(t);if(!a||0===a.length)return!1;if((i.get(e.key)??0)<a.length-1)return!0;const l=n.get(t),s=o.get(t);if(l&&s){const t=a.filter(e=>e.container).reduce((e,t)=>e+(t.totalResourceCount??0),0),n=a.filter(e=>!e.container).length,r=Math.max(0,(l.totalResourceCount??0)-(t+n));if(e.container){return s.container<(l.subContainerCount??0)||r>0}return s.resource<r}return!1},l=e=>{if(void 0!==e.selectedStatus)return e.selectedStatus;let r=e;for(;r?.parentId;){const e=n.get(r.parentId);if(!e)break;if("completely"===e.selectedStatus)return"completely";if("none"===e.selectedStatus)return"none";r=e}return"completely"===t?.selectedStatus?"completely":"none"===t?.selectedStatus?"none":e.selectedStatus};return e.map(e=>{const t=e,r=t.parentSiblings&&t.parentSiblings.length>0?t.parentSiblings:(e=>{const t=e.hierarchy??0;if(t<=0)return[];const r=[];let i=e;for(;i&&(r.unshift(i),i.parentId);){const e=n.get(i.parentId);if(!e)break;i=e}const o=r.map(e=>a(e));return o.length===t?o:o.length>t?o.slice(o.length-t):new Array(t-o.length).fill(!1).concat(o)})(e);return{...e,lastChild:!a(e),parentSiblings:r,selectedStatus:l(e)}})},Ix=o(({treeData:t,columnsData:r,selected:i=[],select:o=null,onChange:s=()=>{},onClick:d=()=>{},onExpand:f=()=>{},loadMore:p=()=>{},tableBorder:m,height:g="calc(100vh - 134px)",newNode:v,onAddConfirm:A=()=>{},onAddCancel:y=()=>{},handleEditFieldError:w,loading:b=!1,rootNode:E,pagination:M=!0,selectedNode:x,tableHeaderBgColor:L="var(--border-color)",hideOnDisable:H=!1,freezeColumns:k,addModuleInputWidth:V=150,addModuleSelectWidth:S,onScroll:z,onScrollEnd:O,disableEditLabelConfirmIcon:N=!1,transparentHeader:D=!1,navigateTreeNode:T=null,handleRemoveNavigateTreeNode:I=()=>{},scrollThreshold:Z=128,showHeader:R=!0,resetScroll:j=!1,setResetScroll:B=()=>{}},P)=>{const[_,F]=c(null),[q,U]=c(null),[W,X]=c({start:0,end:20}),[Q,Y]=c(!1),K=a(null),J=a(null),$=a(0),ee=a(b),te=a(null),ne=a(null),re=a({lastScrollTop:0}),ie=a([]),oe=a(0),ae=a(null),le=a(null),se=a(null),ce=a({key:null,attempts:0}),de=a(null),ue=(e,t)=>{const n=String(e??t);return n.endsWith("%")?{value:parseFloat(n),unit:"%"}:{value:parseFloat(n)||0,unit:"px"}},fe=h(()=>{let e=0,t=0;return r.map((n,r)=>{const{value:i,unit:o}=ue(n.width,400),a=!!k&&r<k,l="%"===o?`${i}%`:`${i}px`,s=`calc(${e}px + ${t}%)`;return a&&("%"===o?t+=i:e+=i),{width:l,sticky:a,left:s,zIndex:a?100+(k??0)-r:1}})},[r,k]),he=h(()=>{let e=0,t=0;return r.forEach(n=>{const{value:r,unit:i}=ue(n.width,400);"%"===i?t+=r:e+=r}),`calc(${e}px + ${t}%)`},[r]),Ce=h(()=>{if(!k)return"0px";let e=0,t=0;return fe.slice(0,k).forEach(n=>{const r=parseFloat(n.width)||0;n.width.endsWith("%")?t+=r:e+=r}),`calc(${e}px + ${t}%)`},[fe,k]),pe=h(()=>((e,t,n)=>{if(!t?.sourceId||!t.action)return e;const{sourceId:r,action:i,value:o="",error:a="",label:l,type:s,options:c,selectedOption:d,confirmIconTooltip:u,cancelIconTooltip:f,payloadSourceId:h}=t,C=t?.parentId,p=t?.hierarchy,m=c?.map(e=>({label:e,value:e})),g=d?{label:d,value:d}:void 0,v=new Map;e.forEach(e=>v.set(e.key,e)),n&&v.set(n.key,n);const A=v.get(r);let y;h&&(y=v.get(h));let w=A??("addInside"===i?y:void 0);!w&&"addInside"===i&&C&&(w=v.get(C));const b="addInside"===i&&!w&&e.length>=0;if(!w&&!b)return e;const E=[...e],M=w?e.findIndex(e=>e.key===w.key):-1;let x=null,L=0,H=M+1;switch(i){case"addAbove":{const t=w;if(!t)return e;x=t.parentId,L=t.hierarchy;break}case"addBelow":{const t=w;if(!t)return e;x=y?.parentId??t.parentId,L=y?.hierarchy??t.hierarchy;break}case"addInside":{if(b){x=C??h??r??null,L=p??1,H=E.length;break}const t=y??w;if(!t)return e;x=t.key,L=(t.hierarchy??0)+1;const n=E.findIndex(e=>e.key===r);-1!==n&&(H=n+1);break}}const k={hierarchy:L,parentId:x,sourceId:w?.key??r??h??"new-node",isNewNode:!0,key:"new-node",value:o,error:a,label:l,type:s,options:m,selectedOption:g,confirmIconTooltip:u,cancelIconTooltip:f};switch(i){case"addAbove":E.splice(M,0,k);break;case"addBelow":E.splice(M+1,0,k);break;case"addInside":E.splice(Math.max(0,H),0,k)}return E})(t,v,E?.node),[t,v,E]),me=h(()=>Tx(pe,E?.node),[pe,E?.node]),ge=h(()=>me.filter(e=>!e.hide),[me]),ve=h(()=>{const e=new Map;return me.forEach(t=>e.set(t.key,t)),e},[me]),Ae=h(()=>{const e=new Map;return ge.forEach((t,n)=>e.set(t.key,n)),e},[ge]),ye=C(e=>{F(t=>t?e&&t!==e?t:null:t),e&&le.current?.key!==e||(le.current=null),se.current&&(clearTimeout(se.current),se.current=null)},[]);l(()=>{ee.current=b},[b]),l(()=>{te.current=q},[q]);const we=C(e=>{te.current=e,U(e)},[]),be=C(()=>{const e=K.current;if(!e)return;const t=$.current||0,n=Math.max(0,e.scrollTop-t),r=e.clientHeight-t;let i=Math.floor(n/Nx)-6,o=Math.ceil((n+r)/Nx)+6;i=Math.max(0,i),o=Math.min(ge.length,o),X(e=>e.start===i&&e.end===o?e:{start:i,end:o})},[ge.length]),Ee=C(()=>{null===ne.current&&(ne.current=requestAnimationFrame(()=>{ne.current=null,be()}))},[be]),Me=C(()=>{const e=K.current;if(!e)return;const n=e.scrollTop,r=n>re.current.lastScrollTop?"down":"up";if(re.current.lastScrollTop=n,Ee(),z?.(),ae.current?.(),!M||b||te.current||G(t))return;const i=e.scrollHeight,o=e.clientHeight;"down"===r&&i-(n+o)<Z&&!t[t.length-1]?.lastResource&&(we("below"),p("below"))},[t,M,b,q,Z,Ee,z,p,we]);l(()=>{if(b||!M||G(t))return;const e=t[0],n=!e?.lastResource,{totalSubContainerCount:r=0,totalResourceCount:i=0}=E?.node||{},o=r+i,a=ge.length<10&&ge.length<o;n&&a&&(we("above"),p("above"))},[b,M,t,ge.length,E,p,we]),u(()=>{const e=ie.current,t=ge,n=K.current;if(j&&n)return n.scrollTop=0,re.current.lastScrollTop=0,void B(!1);if(n&&e.length>0&&t.length>0&&!b){const r=re.current.lastScrollTop,i=Math.max(0,Math.floor(r/Nx));let o=-1,a=-1;for(let t=i;t<e.length;t++){const n=e[t]?.key,r=Ae.get(n??"");if(void 0!==r){o=t,a=r;break}}if(-1===o)for(let t=i-1;t>=0;t--){const n=e[t]?.key,r=Ae.get(n??"");if(void 0!==r){o=t,a=r;break}}if(-1!==o&&-1!==a){const e=a-o,t=Math.max(0,r+e*Nx);n.scrollTop!==t&&(n.scrollTop=t,re.current.lastScrollTop=n.scrollTop,be())}else if("above"===q)0!==n.scrollTop&&(n.scrollTop=0,re.current.lastScrollTop=0,be());else{const e=$.current||0,r=Math.max(0,t.length*Nx-(n.clientHeight-e));n.scrollTop>r&&(n.scrollTop=r,re.current.lastScrollTop=r,be())}q&&we(null)}ie.current=t},[b,q,Ae,ge,we,be,j,B]),l(()=>{const e=K.current;if(!e)return;const n=n=>{n.deltaY>=0||!M||G(t)||ee.current||te.current||e.scrollTop>1||t[0]?.lastResource||(we("above"),p("above"))};return e.addEventListener("wheel",n,{passive:!0}),()=>{e.removeEventListener("wheel",n)}},[M,t,p,we]),l(()=>{const e=K.current;if(e)return ae.current=O?Xs(()=>{O?.()},150):null,e.addEventListener("scroll",Me,{passive:!0}),()=>{e.removeEventListener("scroll",Me),ae.current?.cancel()}},[Me,O]),l(()=>{const e=K.current;if(!e)return;const t=e=>{Date.now()<oe.current&&e.stopImmediatePropagation()};return e.addEventListener("scroll",t,{passive:!0,capture:!0}),()=>{e.removeEventListener("scroll",t,!0)}},[]),l(()=>{const e=J.current;if(!e)return;const t=new ResizeObserver(()=>{$.current=e.getBoundingClientRect().height,be()});return t.observe(e),()=>t.disconnect()},[be]),u(()=>{if(!v||!K.current)return;const e=K.current,t=Ae.get("new-node");if(void 0===t)return;const n=$.current||0,r=e.clientHeight-n;if(r<=0)return;const i=t*Nx,o=i+Nx,a=Math.max(0,e.scrollTop-n);let l=a;i<a?l=i:o>a+r&&(l=Math.max(0,o-r)),l!==a&&(oe.current=Date.now()+300,e.scrollTop=l+n,re.current.lastScrollTop=e.scrollTop,be());const s=requestAnimationFrame(()=>{Y(!0)});return()=>cancelAnimationFrame(s)},[v,Ae,be]),l(()=>{v||Y(!1)},[v]),u(()=>{if(!_||b)return;const e=le.current;if(!e||e.key!==_){const e=requestAnimationFrame(()=>{ye(_)});return()=>cancelAnimationFrame(e)}const t=ve.get(e.key);if(!t){const t=requestAnimationFrame(()=>{ye(e.key)});return()=>cancelAnimationFrame(t)}if(Boolean(t.expanded)!==e.expanded)return;const n=requestAnimationFrame(()=>{ye(e.key)});return()=>cancelAnimationFrame(n)},[ve,_,b,ye]),l(()=>{ce.current.key!==T&&(ce.current={key:T,attempts:0}),!T&&de.current&&(clearTimeout(de.current),de.current=null)},[T]),u(()=>{if(!T||v)return;const e=K.current;if(!e)return;const n=Ae.get(T);if(void 0!==n){ce.current={key:T,attempts:0};const t=$.current||0,r=Math.max(Nx,e.clientHeight-t),i=n*Nx+16,o=Math.max(0,i-r/2)+t;return oe.current=Date.now()+400,e.scrollTo({top:o,behavior:"smooth"}),Ee(),de.current&&clearTimeout(de.current),void(de.current=setTimeout(()=>{I?.()},350))}if(b||q)return;const r=ce.current;if(r.key!==T&&(r.key=T,r.attempts=0),r.attempts+=1,!(r.attempts>30))return M&&!0!==t[0]?.lastResource?(we("above"),void p("above")):void(r.attempts>2&&I?.());I?.()},[T,v,Ae,b,q,M,t,p,Ee,I,we]);const xe=C(e=>{if(_)return;const t=!e?.expanded;F(e.key),le.current={key:e.key,expanded:t},se.current&&clearTimeout(se.current);const n=Date.now(),r=()=>{if(le.current?.key!==e.key)return;const t=ee.current,i=Date.now()-n>=2e3;!t||i?ye(e.key):se.current=setTimeout(r,1e3)};se.current=setTimeout(r,1e3),f?.(e)},[_,f,ye]),Le=C((e,t)=>{_||s?.(e,t)},[s,_]),He=C((e,t)=>{_||d?.(e,t)},[d,_]);l(()=>()=>{null!==ne.current&&(cancelAnimationFrame(ne.current),ne.current=null),se.current&&clearTimeout(se.current),de.current&&clearTimeout(de.current)},[]);const ke=ge.length*Nx,Ve=ge.slice(W.start,W.end);return e("div",{className:"tree-table-wrapper-container table-tree-fn",children:e("div",{className:"tree-table-fn-wrap",ref:P,children:e("div",{className:"table-fn-scrollable "+(ge.length?"":"table-fn-empty"),ref:K,style:{"--table-height":ge.length?g:"auto","--frozen-column-width":Ce,border:m},children:n("div",{className:"tree-table-fn",style:{width:he},children:[e("div",{ref:J,style:{position:"sticky",top:0,zIndex:98},children:e(Ox,{columnsData:r,columnMeta:fe,totalWidth:he,rootNode:E,onCheckBoxChange:Le,selected:i,selectedNode:x,tableHeaderBgColor:L,hideOnDisable:H,transparentHeader:D,showHeader:R})}),e(zx,{flattenedTreeData:Ve,columnsData:r,columnMeta:fe,totalWidth:he,rowHeight:Nx,startIndex:W.start,totalHeight:ke,selected:i,select:o,onRowClick:He,onToggleExpand:xe,onCheckBoxChange:Le,onAddConfirm:A,onAddCancel:y,handleEditFieldError:w,expanding:_,selectedNode:x,hideOnDisable:H,addModuleInputWidth:V,addModuleSelectWidth:S,disableEditLabelConfirmIcon:N,isEditable:v?Q:void 0,setIsEditable:v?e=>{Y(Boolean(e))}:void 0})]})})})})});Ix.displayName="TableTreeFn";const Zx=t=>e(tg,{logo:()=>"FireFlink"===t?.name?e(F,{height:100,width:100,name:"fire_flink_loader_logo"}):e("img",{src:t?.loaderName,width:100,height:100,alt:"loader"})}),Rx=({isVisible:t})=>t?n("div",{className:"no_data_message",children:[e(F,{name:"no_content",width:120,height:120}),e(q,{fontSize:"20px",lineHeight:"30px",fontWeight:"semi-bold",children:"No Data Available"})]}):null,jx=({text:t=" No Results Found",iconName:r="no_license_found",fontSize:i="24px",textAlign:o="left",direction:a="column",iconWidth:l=120,iconHeight:s=120,fontWeight:c="semi-bold"})=>e("article",{className:"no_results_container",children:n("div",{className:`no_results_container__${a}`,children:[e(F,{name:r,width:l,height:s}),e("div",{children:e(q,{as:"div",fontSize:i,lineHeight:"36px",fontWeight:c,color:"var(--text-color)",textAlign:o,children:t})})]})}),Bx=({drawerProps:n,showDrawer:r,children:i,zIndex:o=1200,top:a="56px"})=>r?e(vn,{isOpen:n?.isOpen??!0,...n,zIndex:o,top:a,children:i}):e(t,{children:i});const Px=({children:n,offlineContent:r,hasError:i=!1,onNetworkStatusChange:o,overlayClassName:a,overlayZIndex:s=99998,iconWidth:d=300,iconHeight:u=300})=>{const f=function(){const[e,t]=c(navigator.onLine);return l(()=>{const e=()=>{t(!0)},n=()=>{t(!1)};return window.addEventListener("online",e),window.addEventListener("offline",n),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}},[]),e}();return l(()=>{o&&o(f)},[f,o]),i||!f?e("div",{className:`offlineOverlay ${a??""}`,style:{zIndex:s},children:r||e(F,{name:"offline_404_icon",height:u,width:d})}):e(t,{children:n})};function _x(e,t,n,r,i,o="children"){return function e(a){for(let l=0;l<a.length;l++){const s=a[l];if(s&&s[t]===n){const e=[...a];return"replace"===i?e[l]=r:e.splice("above"===i?l:l+1,0,r),{updatedArray:e}}if(s&&s[o]&&Array.isArray(s[o])){const t=e(s[o]);if(t)return{updatedArray:a.map((e,n)=>n===l?{...e,[o]:t.updatedArray}:e)}}}return null}(e)}const Fx=(e,t)=>{if(e===t)return!0;if(null==e||null==t||"object"!=typeof e||"object"!=typeof t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=Array.isArray(e),r=Array.isArray(t);if(n!==r)return!1;const i=n?e:Object.keys(e),o=r?t:Object.keys(t);if(i.length!==o.length)return!1;if(n)return i.every((e,t)=>Fx(e,o[t]));{const n=new Set(o);return i.every(r=>n.has(r)&&Fx(e[r],t[r]))}},qx=(e,t)=>!(!Array.isArray(e)||!Array.isArray(t))&&(e.length===t.length&&e.every((e,n)=>{const r=t[n];return Fx(e,r)}));function Ux(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function Wx(e,t){return e&t}function Xx(e,t){return e|t}function Qx(e,t){return e^t}function Gx(e,t){return e&~t}function Yx(e){if(0==e)return-1;var t=0;return 65535&e||(e>>=16,t+=16),255&e||(e>>=8,t+=8),15&e||(e>>=4,t+=4),3&e||(e>>=2,t+=2),1&e||++t,t}function Kx(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var Jx,$x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function eL(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=$x.charAt(n>>6)+$x.charAt(63&n);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=$x.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=$x.charAt(n>>2)+$x.charAt((3&n)<<4));(3&r.length)>0;)r+="=";return r}function tL(e){var t,n="",r=0,i=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t){var o=$x.indexOf(e.charAt(t));o<0||(0==r?(n+=Ux(o>>2),i=3&o,r=1):1==r?(n+=Ux(i<<2|o>>4),i=15&o,r=2):2==r?(n+=Ux(i),n+=Ux(o>>2),i=3&o,r=3):(n+=Ux(i<<2|o>>4),n+=Ux(15&o),r=0))}return 1==r&&(n+=Ux(i<<2)),n}var nL,rL=function(e){var t;if(void 0===Jx){var n="0123456789ABCDEF",r=" \f\n\r\t \u2028\u2029";for(Jx={},t=0;t<16;++t)Jx[n.charAt(t)]=t;for(n=n.toLowerCase(),t=10;t<16;++t)Jx[n.charAt(t)]=t;for(t=0;t<8;++t)Jx[r.charAt(t)]=-1}var i=[],o=0,a=0;for(t=0;t<e.length;++t){var l=e.charAt(t);if("="==l)break;if(-1!=(l=Jx[l])){if(void 0===l)throw new Error("Illegal character at offset "+t);o|=l,++a>=2?(i[i.length]=o,o=0,a=0):o<<=4}}if(a)throw new Error("Hex encoding incomplete: 4 bits missing");return i},iL={decode:function(e){var t;if(void 0===nL){var n="= \f\n\r\t \u2028\u2029";for(nL=Object.create(null),t=0;t<64;++t)nL["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(nL["-"]=62,nL._=63,t=0;t<9;++t)nL[n.charAt(t)]=-1}var r=[],i=0,o=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if("="==a)break;if(-1!=(a=nL[a])){if(void 0===a)throw new Error("Illegal character at offset "+t);i|=a,++o>=4?(r[r.length]=i>>16,r[r.length]=i>>8&255,r[r.length]=255&i,i=0,o=0):i<<=6}}switch(o){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:r[r.length]=i>>10;break;case 3:r[r.length]=i>>16,r[r.length]=i>>8&255}return r},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(e){var t=iL.re.exec(e);if(t)if(t[1])e=t[1];else{if(!t[2])throw new Error("RegExp out of sync");e=t[2]}return iL.decode(e)}},oL=1e13,aL=function(){function e(e){this.buf=[+e||0]}return e.prototype.mulAdd=function(e,t){var n,r,i=this.buf,o=i.length;for(n=0;n<o;++n)(r=i[n]*e+t)<oL?t=0:r-=(t=0|r/oL)*oL,i[n]=r;t>0&&(i[n]=t)},e.prototype.sub=function(e){var t,n,r=this.buf,i=r.length;for(t=0;t<i;++t)(n=r[t]-e)<0?(n+=oL,e=1):e=0,r[t]=n;for(;0===r[r.length-1];)r.pop()},e.prototype.toString=function(e){if(10!=(e||10))throw new Error("only base 10 is supported");for(var t=this.buf,n=t[t.length-1].toString(),r=t.length-2;r>=0;--r)n+=(oL+t[r]).toString().substring(1);return n},e.prototype.valueOf=function(){for(var e=this.buf,t=0,n=e.length-1;n>=0;--n)t=t*oL+e[n];return t},e.prototype.simplify=function(){var e=this.buf;return 1==e.length?e[0]:this},e}(),lL=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,sL=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function cL(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}var dL,uL=function(){function e(t,n){this.hexDigits="0123456789ABCDEF",t instanceof e?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=n)}return e.prototype.get=function(e){if(void 0===e&&(e=this.pos++),e>=this.enc.length)throw new Error("Requesting byte offset ".concat(e," on a stream of length ").concat(this.enc.length));return"string"==typeof this.enc?this.enc.charCodeAt(e):this.enc[e]},e.prototype.hexByte=function(e){return this.hexDigits.charAt(e>>4&15)+this.hexDigits.charAt(15&e)},e.prototype.hexDump=function(e,t,n){for(var r="",i=e;i<t;++i)if(r+=this.hexByte(this.get(i)),!0!==n)switch(15&i){case 7:r+=" ";break;case 15:r+="\n";break;default:r+=" "}return r},e.prototype.isASCII=function(e,t){for(var n=e;n<t;++n){var r=this.get(n);if(r<32||r>176)return!1}return!0},e.prototype.parseStringISO=function(e,t){for(var n="",r=e;r<t;++r)n+=String.fromCharCode(this.get(r));return n},e.prototype.parseStringUTF=function(e,t){for(var n="",r=e;r<t;){var i=this.get(r++);n+=i<128?String.fromCharCode(i):i>191&&i<224?String.fromCharCode((31&i)<<6|63&this.get(r++)):String.fromCharCode((15&i)<<12|(63&this.get(r++))<<6|63&this.get(r++))}return n},e.prototype.parseStringBMP=function(e,t){for(var n,r,i="",o=e;o<t;)n=this.get(o++),r=this.get(o++),i+=String.fromCharCode(n<<8|r);return i},e.prototype.parseTime=function(e,t,n){var r=this.parseStringISO(e,t),i=(n?lL:sL).exec(r);return i?(n&&(i[1]=+i[1],i[1]+=+i[1]<70?2e3:1900),r=i[1]+"-"+i[2]+"-"+i[3]+" "+i[4],i[5]&&(r+=":"+i[5],i[6]&&(r+=":"+i[6],i[7]&&(r+="."+i[7]))),i[8]&&(r+=" UTC","Z"!=i[8]&&(r+=i[8],i[9]&&(r+=":"+i[9]))),r):"Unrecognized time: "+r},e.prototype.parseInteger=function(e,t){for(var n,r=this.get(e),i=r>127,o=i?255:0,a="";r==o&&++e<t;)r=this.get(e);if(0===(n=t-e))return i?-1:0;if(n>4){for(a=r,n<<=3;!(128&(+a^o));)a=+a<<1,--n;a="("+n+" bit)\n"}i&&(r-=256);for(var l=new aL(r),s=e+1;s<t;++s)l.mulAdd(256,this.get(s));return a+l.toString()},e.prototype.parseBitString=function(e,t,n){for(var r=this.get(e),i="("+((t-e-1<<3)-r)+" bit)\n",o="",a=e+1;a<t;++a){for(var l=this.get(a),s=a==t-1?r:0,c=7;c>=s;--c)o+=l>>c&1?"1":"0";if(o.length>n)return i+cL(o,n)}return i+o},e.prototype.parseOctetString=function(e,t,n){if(this.isASCII(e,t))return cL(this.parseStringISO(e,t),n);var r=t-e,i="("+r+" byte)\n";r>(n/=2)&&(t=e+n);for(var o=e;o<t;++o)i+=this.hexByte(this.get(o));return r>n&&(i+="…"),i},e.prototype.parseOID=function(e,t,n){for(var r="",i=new aL,o=0,a=e;a<t;++a){var l=this.get(a);if(i.mulAdd(128,127&l),o+=7,!(128&l)){if(""===r)if((i=i.simplify())instanceof aL)i.sub(80),r="2."+i.toString();else{var s=i<80?i<40?0:1:2;r=s+"."+(i-40*s)}else r+="."+i.toString();if(r.length>n)return cL(r,n);i=new aL,o=0}}return o>0&&(r+=".incomplete"),r},e}(),fL=function(){function e(e,t,n,r,i){if(!(r instanceof hL))throw new Error("Invalid tag value.");this.stream=e,this.header=t,this.length=n,this.tag=r,this.sub=i}return e.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},e.prototype.content=function(e){if(void 0===this.tag)return null;void 0===e&&(e=1/0);var t=this.posContent(),n=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+n,e);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(t)?"false":"true";case 2:return this.stream.parseInteger(t,t+n);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(t,t+n,e);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+n,e);case 6:return this.stream.parseOID(t,t+n,e);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return cL(this.stream.parseStringUTF(t,t+n),e);case 18:case 19:case 20:case 21:case 22:case 26:return cL(this.stream.parseStringISO(t,t+n),e);case 30:return cL(this.stream.parseStringBMP(t,t+n),e);case 23:case 24:return this.stream.parseTime(t,t+n,23==this.tag.tagNumber)}return null},e.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},e.prototype.toPrettyString=function(e){void 0===e&&(e="");var t=e+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(t+="+"),t+=this.length,this.tag.tagConstructed?t+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(t+=" (encapsulates)"),t+="\n",null!==this.sub){e+=" ";for(var n=0,r=this.sub.length;n<r;++n)t+=this.sub[n].toPrettyString(e)}return t},e.prototype.posStart=function(){return this.stream.pos},e.prototype.posContent=function(){return this.stream.pos+this.header},e.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},e.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},e.decodeLength=function(e){var t=e.get(),n=127&t;if(n==t)return n;if(n>6)throw new Error("Length over 48 bits not supported at position "+(e.pos-1));if(0===n)return null;t=0;for(var r=0;r<n;++r)t=256*t+e.get();return t},e.prototype.getHexStringValue=function(){var e=this.toHexString(),t=2*this.header,n=2*this.length;return e.substring(t,t+n)},e.decode=function(t){var n;n=t instanceof uL?t:new uL(t,0);var r=new uL(n),i=new hL(n),o=e.decodeLength(n),a=n.pos,l=a-r.pos,s=null,c=function(){var t=[];if(null!==o){for(var r=a+o;n.pos<r;)t[t.length]=e.decode(n);if(n.pos!=r)throw new Error("Content size is not correct for container starting at offset "+a)}else try{for(;;){var i=e.decode(n);if(i.tag.isEOC())break;t[t.length]=i}o=a-n.pos}catch(e){throw new Error("Exception while decoding undefined length content: "+e)}return t};if(i.tagConstructed)s=c();else if(i.isUniversal()&&(3==i.tagNumber||4==i.tagNumber))try{if(3==i.tagNumber&&0!=n.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");s=c();for(var d=0;d<s.length;++d)if(s[d].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(e){s=null}if(null===s){if(null===o)throw new Error("We can't skip over an invalid tag with undefined length at offset "+a);n.pos=a+Math.abs(o)}return new e(r,l,o,i,s)},e}(),hL=function(){function e(e){var t=e.get();if(this.tagClass=t>>6,this.tagConstructed=!!(32&t),this.tagNumber=31&t,31==this.tagNumber){var n=new aL;do{t=e.get(),n.mulAdd(128,127&t)}while(128&t);this.tagNumber=n.simplify()}}return e.prototype.isUniversal=function(){return 0===this.tagClass},e.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber},e}(),CL=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],pL=(1<<26)/CL[CL.length-1],mL=function(){function e(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}return e.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var n,r=(1<<t)-1,i=!1,o="",a=this.t,l=this.DB-a*this.DB%t;if(a-- >0)for(l<this.DB&&(n=this[a]>>l)>0&&(i=!0,o=Ux(n));a>=0;)l<t?(n=(this[a]&(1<<l)-1)<<t-l,n|=this[--a]>>(l+=this.DB-t)):(n=this[a]>>(l-=t)&r,l<=0&&(l+=this.DB,--a)),n>0&&(i=!0),i&&(o+=Ux(n));return i?o:"0"},e.prototype.negate=function(){var t=wL();return e.ZERO.subTo(this,t),t},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+VL(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var n=wL();return this.abs().divRemTo(t,null,n),this.s<0&&n.compareTo(e.ZERO)>0&&t.subTo(n,n),n},e.prototype.modPowInt=function(e,t){var n;return n=e<256||t.isEven()?new vL(t):new AL(t),this.exp(e,n)},e.prototype.clone=function(){var e=wL();return this.copyTo(e),e},e.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},e.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},e.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},e.prototype.toByteArray=function(){var e=this.t,t=[];t[0]=this.s;var n,r=this.DB-e*this.DB%8,i=0;if(e-- >0)for(r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[i++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),128&n&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(t[i++]=n);return t},e.prototype.equals=function(e){return 0==this.compareTo(e)},e.prototype.min=function(e){return this.compareTo(e)<0?this:e},e.prototype.max=function(e){return this.compareTo(e)>0?this:e},e.prototype.and=function(e){var t=wL();return this.bitwiseTo(e,Wx,t),t},e.prototype.or=function(e){var t=wL();return this.bitwiseTo(e,Xx,t),t},e.prototype.xor=function(e){var t=wL();return this.bitwiseTo(e,Qx,t),t},e.prototype.andNot=function(e){var t=wL();return this.bitwiseTo(e,Gx,t),t},e.prototype.not=function(){for(var e=wL(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},e.prototype.shiftLeft=function(e){var t=wL();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},e.prototype.shiftRight=function(e){var t=wL();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},e.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+Yx(this[e]);return this.s<0?this.t*this.DB:-1},e.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,n=0;n<this.t;++n)e+=Kx(this[n]^t);return e},e.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:!!(this[t]&1<<e%this.DB)},e.prototype.setBit=function(e){return this.changeBit(e,Xx)},e.prototype.clearBit=function(e){return this.changeBit(e,Gx)},e.prototype.flipBit=function(e){return this.changeBit(e,Qx)},e.prototype.add=function(e){var t=wL();return this.addTo(e,t),t},e.prototype.subtract=function(e){var t=wL();return this.subTo(e,t),t},e.prototype.multiply=function(e){var t=wL();return this.multiplyTo(e,t),t},e.prototype.divide=function(e){var t=wL();return this.divRemTo(e,t,null),t},e.prototype.remainder=function(e){var t=wL();return this.divRemTo(e,null,t),t},e.prototype.divideAndRemainder=function(e){var t=wL(),n=wL();return this.divRemTo(e,t,n),[t,n]},e.prototype.modPow=function(e,t){var n,r,i=e.bitLength(),o=kL(1);if(i<=0)return o;n=i<18?1:i<48?3:i<144?4:i<768?5:6,r=i<8?new vL(t):t.isEven()?new yL(t):new AL(t);var a=[],l=3,s=n-1,c=(1<<n)-1;if(a[1]=r.convert(this),n>1){var d=wL();for(r.sqrTo(a[1],d);l<=c;)a[l]=wL(),r.mulTo(d,a[l-2],a[l]),l+=2}var u,f,h=e.t-1,C=!0,p=wL();for(i=VL(e[h])-1;h>=0;){for(i>=s?u=e[h]>>i-s&c:(u=(e[h]&(1<<i+1)-1)<<s-i,h>0&&(u|=e[h-1]>>this.DB+i-s)),l=n;!(1&u);)u>>=1,--l;if((i-=l)<0&&(i+=this.DB,--h),C)a[u].copyTo(o),C=!1;else{for(;l>1;)r.sqrTo(o,p),r.sqrTo(p,o),l-=2;l>0?r.sqrTo(o,p):(f=o,o=p,p=f),r.mulTo(p,a[u],o)}for(;h>=0&&!(e[h]&1<<i);)r.sqrTo(o,p),f=o,o=p,p=f,--i<0&&(i=this.DB-1,--h)}return r.revert(o)},e.prototype.modInverse=function(t){var n=t.isEven();if(this.isEven()&&n||0==t.signum())return e.ZERO;for(var r=t.clone(),i=this.clone(),o=kL(1),a=kL(0),l=kL(0),s=kL(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),n?(o.isEven()&&a.isEven()||(o.addTo(this,o),a.subTo(t,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);for(;i.isEven();)i.rShiftTo(1,i),n?(l.isEven()&&s.isEven()||(l.addTo(this,l),s.subTo(t,s)),l.rShiftTo(1,l)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);r.compareTo(i)>=0?(r.subTo(i,r),n&&o.subTo(l,o),a.subTo(s,a)):(i.subTo(r,i),n&&l.subTo(o,l),s.subTo(a,s))}return 0!=i.compareTo(e.ONE)?e.ZERO:s.compareTo(t)>=0?s.subtract(t):s.signum()<0?(s.addTo(t,s),s.signum()<0?s.add(t):s):s},e.prototype.pow=function(e){return this.exp(e,new gL)},e.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var i=t.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return t;for(i<o&&(o=i),o>0&&(t.rShiftTo(o,t),n.rShiftTo(o,n));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},e.prototype.isProbablePrime=function(e){var t,n=this.abs();if(1==n.t&&n[0]<=CL[CL.length-1]){for(t=0;t<CL.length;++t)if(n[0]==CL[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<CL.length;){for(var r=CL[t],i=t+1;i<CL.length&&r<pL;)r*=CL[i++];for(r=n.modInt(r);t<i;)if(r%CL[t++]==0)return!1}return n.millerRabin(e)},e.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},e.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},e.prototype.fromString=function(t,n){var r;if(16==n)r=4;else if(8==n)r=3;else if(256==n)r=8;else if(2==n)r=1;else if(32==n)r=5;else{if(4!=n)return void this.fromRadix(t,n);r=2}this.t=0,this.s=0;for(var i=t.length,o=!1,a=0;--i>=0;){var l=8==r?255&+t[i]:HL(t,i);l<0?"-"==t.charAt(i)&&(o=!0):(o=!1,0==a?this[this.t++]=l:a+r>this.DB?(this[this.t-1]|=(l&(1<<this.DB-a)-1)<<a,this[this.t++]=l>>this.DB-a):this[this.t-1]|=l<<a,(a+=r)>=this.DB&&(a-=this.DB))}8==r&&128&+t[0]&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),o&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},e.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},e.prototype.drShiftTo=function(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s},e.prototype.lShiftTo=function(e,t){for(var n=e%this.DB,r=this.DB-n,i=(1<<r)-1,o=Math.floor(e/this.DB),a=this.s<<n&this.DM,l=this.t-1;l>=0;--l)t[l+o+1]=this[l]>>r|a,a=(this[l]&i)<<n;for(l=o-1;l>=0;--l)t[l]=0;t[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()},e.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,i=this.DB-r,o=(1<<r)-1;t[0]=this[n]>>r;for(var a=n+1;a<this.t;++a)t[a-n-1]|=(this[a]&o)<<i,t[a-n]=this[a]>>r;r>0&&(t[this.t-n-1]|=(this.s&o)<<i),t.t=this.t-n,t.clamp()}},e.prototype.subTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]-e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e[n],t[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()},e.prototype.multiplyTo=function(t,n){var r=this.abs(),i=t.abs(),o=r.t;for(n.t=o+i.t;--o>=0;)n[o]=0;for(o=0;o<i.t;++o)n[o+r.t]=r.am(0,i[o],n,o,0,r.t);n.s=0,n.clamp(),this.s!=t.s&&e.ZERO.subTo(n,n)},e.prototype.squareTo=function(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},e.prototype.divRemTo=function(t,n,r){var i=t.abs();if(!(i.t<=0)){var o=this.abs();if(o.t<i.t)return null!=n&&n.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=wL());var a=wL(),l=this.s,s=t.s,c=this.DB-VL(i[i.t-1]);c>0?(i.lShiftTo(c,a),o.lShiftTo(c,r)):(i.copyTo(a),o.copyTo(r));var d=a.t,u=a[d-1];if(0!=u){var f=u*(1<<this.F1)+(d>1?a[d-2]>>this.F2:0),h=this.FV/f,C=(1<<this.F1)/f,p=1<<this.F2,m=r.t,g=m-d,v=null==n?wL():n;for(a.dlShiftTo(g,v),r.compareTo(v)>=0&&(r[r.t++]=1,r.subTo(v,r)),e.ONE.dlShiftTo(d,v),v.subTo(a,a);a.t<d;)a[a.t++]=0;for(;--g>=0;){var A=r[--m]==u?this.DM:Math.floor(r[m]*h+(r[m-1]+p)*C);if((r[m]+=a.am(0,A,r,g,0,d))<A)for(a.dlShiftTo(g,v),r.subTo(v,r);r[m]<--A;)r.subTo(v,r)}null!=n&&(r.drShiftTo(d,n),l!=s&&e.ZERO.subTo(n,n)),r.t=d,r.clamp(),c>0&&r.rShiftTo(c,r),l<0&&e.ZERO.subTo(r,r)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},e.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},e.prototype.exp=function(t,n){if(t>4294967295||t<1)return e.ONE;var r=wL(),i=wL(),o=n.convert(this),a=VL(t)-1;for(o.copyTo(r);--a>=0;)if(n.sqrTo(r,i),(t&1<<a)>0)n.mulTo(i,o,r);else{var l=r;r=i,i=l}return n.revert(r)},e.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},e.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),r=kL(n),i=wL(),o=wL(),a="";for(this.divRemTo(r,i,o);i.signum()>0;)a=(n+o.intValue()).toString(e).substring(1)+a,i.divRemTo(r,i,o);return o.intValue().toString(e)+a},e.prototype.fromRadix=function(t,n){this.fromInt(0),null==n&&(n=10);for(var r=this.chunkSize(n),i=Math.pow(n,r),o=!1,a=0,l=0,s=0;s<t.length;++s){var c=HL(t,s);c<0?"-"==t.charAt(s)&&0==this.signum()&&(o=!0):(l=n*l+c,++a>=r&&(this.dMultiply(i),this.dAddOffset(l,0),a=0,l=0))}a>0&&(this.dMultiply(Math.pow(n,a)),this.dAddOffset(l,0)),o&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,n,r){if("number"==typeof n)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),Xx,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(n);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var i=[],o=7&t;i.length=1+(t>>3),n.nextBytes(i),o>0?i[0]&=(1<<o)-1:i[0]=0,this.fromString(i,256)}},e.prototype.bitwiseTo=function(e,t,n){var r,i,o=Math.min(e.t,this.t);for(r=0;r<o;++r)n[r]=t(this[r],e[r]);if(e.t<this.t){for(i=e.s&this.DM,r=o;r<this.t;++r)n[r]=t(this[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=o;r<e.t;++r)n[r]=t(i,e[r]);n.t=e.t}n.s=t(this.s,e.s),n.clamp()},e.prototype.changeBit=function(t,n){var r=e.ONE.shiftLeft(t);return this.bitwiseTo(r,n,r),r},e.prototype.addTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]+e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e[n],t[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()},e.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},e.prototype.multiplyLowerTo=function(e,t,n){var r=Math.min(this.t+e.t,t);for(n.s=0,n.t=r;r>0;)n[--r]=0;for(var i=n.t-this.t;r<i;++r)n[r+this.t]=this.am(0,e[r],n,r,0,this.t);for(i=Math.min(e.t,t);r<i;++r)this.am(0,e[r],n,r,0,t-r);n.clamp()},e.prototype.multiplyUpperTo=function(e,t,n){--t;var r=n.t=this.t+e.t-t;for(n.s=0;--r>=0;)n[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)n[this.t+r-t]=this.am(t-r,e[r],n,0,0,this.t+r-t);n.clamp(),n.drShiftTo(1,n)},e.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(0==t)n=this[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this[r])%e;return n},e.prototype.millerRabin=function(t){var n=this.subtract(e.ONE),r=n.getLowestSetBit();if(r<=0)return!1;var i=n.shiftRight(r);(t=t+1>>1)>CL.length&&(t=CL.length);for(var o=wL(),a=0;a<t;++a){o.fromInt(CL[Math.floor(Math.random()*CL.length)]);var l=o.modPow(i,this);if(0!=l.compareTo(e.ONE)&&0!=l.compareTo(n)){for(var s=1;s++<r&&0!=l.compareTo(n);)if(0==(l=l.modPowInt(2,this)).compareTo(e.ONE))return!1;if(0!=l.compareTo(n))return!1}}return!0},e.prototype.square=function(){var e=wL();return this.squareTo(e),e},e.prototype.gcda=function(e,t){var n=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(n.compareTo(r)<0){var i=n;n=r,r=i}var o=n.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)t(n);else{o<a&&(a=o),a>0&&(n.rShiftTo(a,n),r.rShiftTo(a,r));var l=function(){(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),n.compareTo(r)>=0?(n.subTo(r,n),n.rShiftTo(1,n)):(r.subTo(n,r),r.rShiftTo(1,r)),n.signum()>0?setTimeout(l,0):(a>0&&r.lShiftTo(a,r),setTimeout(function(){t(r)},0))};setTimeout(l,10)}},e.prototype.fromNumberAsync=function(t,n,r,i){if("number"==typeof n)if(t<2)this.fromInt(1);else{this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),Xx,this),this.isEven()&&this.dAddOffset(1,0);var o=this,a=function(){o.dAddOffset(2,0),o.bitLength()>t&&o.subTo(e.ONE.shiftLeft(t-1),o),o.isProbablePrime(n)?setTimeout(function(){i()},0):setTimeout(a,0)};setTimeout(a,0)}else{var l=[],s=7&t;l.length=1+(t>>3),n.nextBytes(l),s>0?l[0]&=(1<<s)-1:l[0]=0,this.fromString(l,256)}},e}(),gL=function(){function e(){}return e.prototype.convert=function(e){return e},e.prototype.revert=function(e){return e},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n)},e.prototype.sqrTo=function(e,t){e.squareTo(t)},e}(),vL=function(){function e(e){this.m=e}return e.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),AL=function(){function e(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}return e.prototype.convert=function(e){var t=wL();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(mL.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=wL();return e.copyTo(t),this.reduce(t),t},e.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=32767&e[t],r=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[n=t+this.m.t]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),yL=function(){function e(e){this.m=e,this.r2=wL(),this.q3=wL(),mL.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e)}return e.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=wL();return e.copyTo(t),this.reduce(t),t},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}();function wL(){return new mL(null)}function bL(e,t){return new mL(e,t)}var EL="undefined"!=typeof navigator;EL&&"Microsoft Internet Explorer"==navigator.appName?(mL.prototype.am=function(e,t,n,r,i,o){for(var a=32767&t,l=t>>15;--o>=0;){var s=32767&this[e],c=this[e++]>>15,d=l*s+c*a;i=((s=a*s+((32767&d)<<15)+n[r]+(1073741823&i))>>>30)+(d>>>15)+l*c+(i>>>30),n[r++]=1073741823&s}return i},dL=30):EL&&"Netscape"!=navigator.appName?(mL.prototype.am=function(e,t,n,r,i,o){for(;--o>=0;){var a=t*this[e++]+n[r]+i;i=Math.floor(a/67108864),n[r++]=67108863&a}return i},dL=26):(mL.prototype.am=function(e,t,n,r,i,o){for(var a=16383&t,l=t>>14;--o>=0;){var s=16383&this[e],c=this[e++]>>14,d=l*s+c*a;i=((s=a*s+((16383&d)<<14)+n[r]+i)>>28)+(d>>14)+l*c,n[r++]=268435455&s}return i},dL=28),mL.prototype.DB=dL,mL.prototype.DM=(1<<dL)-1,mL.prototype.DV=1<<dL;mL.prototype.FV=Math.pow(2,52),mL.prototype.F1=52-dL,mL.prototype.F2=2*dL-52;var ML,xL,LL=[];for(ML="0".charCodeAt(0),xL=0;xL<=9;++xL)LL[ML++]=xL;for(ML="a".charCodeAt(0),xL=10;xL<36;++xL)LL[ML++]=xL;for(ML="A".charCodeAt(0),xL=10;xL<36;++xL)LL[ML++]=xL;function HL(e,t){var n=LL[e.charCodeAt(t)];return null==n?-1:n}function kL(e){var t=wL();return t.fromInt(e),t}function VL(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}mL.ZERO=kL(0),mL.ONE=kL(1);var SL=function(){function e(){this.i=0,this.j=0,this.S=[]}return e.prototype.init=function(e){var t,n,r;for(t=0;t<256;++t)this.S[t]=t;for(n=0,t=0;t<256;++t)n=n+this.S[t]+e[t%e.length]&255,r=this.S[t],this.S[t]=this.S[n],this.S[n]=r;this.i=0,this.j=0},e.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]},e}();var zL,OL,NL=null;if(null==NL){NL=[],OL=0;var DL=void 0;if("undefined"!=typeof window&&self.crypto&&self.crypto.getRandomValues){var TL=new Uint32Array(256);for(self.crypto.getRandomValues(TL),DL=0;DL<TL.length;++DL)NL[OL++]=255&TL[DL]}var IL=0,ZL=function(e){if((IL=IL||0)>=256||OL>=256)self.removeEventListener?self.removeEventListener("mousemove",ZL,!1):self.detachEvent&&self.detachEvent("onmousemove",ZL);else try{var t=e.x+e.y;NL[OL++]=255&t,IL+=1}catch(e){}};"undefined"!=typeof window&&(self.addEventListener?self.addEventListener("mousemove",ZL,!1):self.attachEvent&&self.attachEvent("onmousemove",ZL))}function RL(){if(null==zL){for(zL=new SL;OL<256;){var e=Math.floor(65536*Math.random());NL[OL++]=255&e}for(zL.init(NL),OL=0;OL<NL.length;++OL)NL[OL]=0;OL=0}return zL.next()}var jL=function(){function e(){}return e.prototype.nextBytes=function(e){for(var t=0;t<e.length;++t)e[t]=RL()},e}();function BL(e){return function(e){for(var t="",n=0;n<32*e.length;n+=8)t+=String.fromCharCode(e[n>>5]>>>24-n%32&255);return t}(function(e,t){var n,r,i,o,a,l,s,c,d,u,f,h,C=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),p=new Array(64);for(e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t,d=0;d<e.length;d+=16){for(n=C[0],r=C[1],i=C[2],o=C[3],a=C[4],l=C[5],s=C[6],c=C[7],u=0;u<64;u++)p[u]=u<16?e[u+d]:KL(KL(KL(GL(p[u-2]),p[u-7]),QL(p[u-15])),p[u-16]),f=KL(KL(KL(KL(c,XL(a)),qL(a,l,s)),YL[u]),p[u]),h=KL(WL(n),UL(n,r,i)),c=s,s=l,l=a,a=KL(o,f),o=i,i=r,r=n,n=KL(f,h);C[0]=KL(n,C[0]),C[1]=KL(r,C[1]),C[2]=KL(i,C[2]),C[3]=KL(o,C[3]),C[4]=KL(a,C[4]),C[5]=KL(l,C[5]),C[6]=KL(s,C[6]),C[7]=KL(c,C[7])}return C}(function(e){for(var t=Array(e.length>>2),n=0;n<t.length;n++)t[n]=0;for(n=0;n<8*e.length;n+=8)t[n>>5]|=(255&e.charCodeAt(n/8))<<24-n%32;return t}(e),8*e.length))}function PL(e){for(var t="0123456789abcdef",n="",r=0;r<e.length;r++){var i=e.charCodeAt(r);n+=t.charAt(i>>>4&15)+t.charAt(15&i)}return n}function _L(e,t){return e>>>t|e<<32-t}function FL(e,t){return e>>>t}function qL(e,t,n){return e&t^~e&n}function UL(e,t,n){return e&t^e&n^t&n}function WL(e){return _L(e,2)^_L(e,13)^_L(e,22)}function XL(e){return _L(e,6)^_L(e,11)^_L(e,25)}function QL(e){return _L(e,7)^_L(e,18)^FL(e,3)}function GL(e){return _L(e,17)^_L(e,19)^FL(e,10)}var YL=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function KL(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function JL(e,t){if(t<e.length+11)return console.error("Message too long for RSA"),null;for(var n=[],r=e.length-1;r>=0&&t>0;){var i=e.charCodeAt(r--);i<128?n[--t]=i:i>127&&i<2048?(n[--t]=63&i|128,n[--t]=i>>6|192):(n[--t]=63&i|128,n[--t]=i>>6&63|128,n[--t]=i>>12|224)}n[--t]=0;for(var o=new jL,a=[];t>2;){for(a[0]=0;0==a[0];)o.nextBytes(a);n[--t]=a[0]}return n[--t]=2,n[--t]=0,new mL(n)}function $L(e,t,n){for(var r="",i=0;r.length<t;)r+=n(String.fromCharCode.apply(String,e.concat([(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i]))),i+=1;return r}function eH(e,t){var n=BL;if(e.length+64+2>t)throw"Message too long for RSA";var r,i="";for(r=0;r<t-e.length-64-2;r+=1)i+="\0";var o=n("")+i+""+e,a=new Array(32);(new jL).nextBytes(a);var l=$L(a,o.length,n),s=[];for(r=0;r<o.length;r+=1)s[r]=o.charCodeAt(r)^l.charCodeAt(r);var c=$L(s,a.length,n),d=[0];for(r=0;r<a.length;r+=1)d[r+1]=a[r]^c.charCodeAt(r);return new mL(d.concat(s))}var tH=function(){function e(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return e.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},e.prototype.doPrivate=function(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),n=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(n)<0;)t=t.add(this.p);return t.subtract(n).multiply(this.coeff).mod(this.p).multiply(this.q).add(n)},e.prototype.setPublic=function(e,t){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=bL(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")},e.prototype.encrypt=function(e,t){void 0===t&&(t=JL);var n=this.n.bitLength()+7>>3,r=t(e,n);if(null==r)return null;var i=this.doPublic(r);if(null==i)return null;for(var o=i.toString(16),a=o.length,l=0;l<2*n-a;l++)o="0"+o;return o},e.prototype.setPrivate=function(e,t,n){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=bL(e,16),this.e=parseInt(t,16),this.d=bL(n,16)):console.error("Invalid RSA private key")},e.prototype.setPrivateEx=function(e,t,n,r,i,o,a,l){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=bL(e,16),this.e=parseInt(t,16),this.d=bL(n,16),this.p=bL(r,16),this.q=bL(i,16),this.dmp1=bL(o,16),this.dmq1=bL(a,16),this.coeff=bL(l,16)):console.error("Invalid RSA private key")},e.prototype.generate=function(e,t){var n=new jL,r=e>>1;this.e=parseInt(t,16);for(var i=new mL(t,16);;){for(;this.p=new mL(e-r,1,n),0!=this.p.subtract(mL.ONE).gcd(i).compareTo(mL.ONE)||!this.p.isProbablePrime(10););for(;this.q=new mL(r,1,n),0!=this.q.subtract(mL.ONE).gcd(i).compareTo(mL.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var a=this.p.subtract(mL.ONE),l=this.q.subtract(mL.ONE),s=a.multiply(l);if(0==s.gcd(i).compareTo(mL.ONE)){this.n=this.p.multiply(this.q),this.d=i.modInverse(s),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(l),this.coeff=this.q.modInverse(this.p);break}}},e.prototype.decrypt=function(e){var t=bL(e,16),n=this.doPrivate(t);return null==n?null:function(e,t){var n=e.toByteArray(),r=0;for(;r<n.length&&0==n[r];)++r;if(n.length-r!=t-1||2!=n[r])return null;++r;for(;0!=n[r];)if(++r>=n.length)return null;var i="";for(;++r<n.length;){var o=255&n[r];o<128?i+=String.fromCharCode(o):o>191&&o<224?(i+=String.fromCharCode((31&o)<<6|63&n[r+1]),++r):(i+=String.fromCharCode((15&o)<<12|(63&n[r+1])<<6|63&n[r+2]),r+=2)}return i}(n,this.n.bitLength()+7>>3)},e.prototype.generateAsync=function(e,t,n){var r=new jL,i=e>>1;this.e=parseInt(t,16);var o=new mL(t,16),a=this,l=function(){var t=function(){if(a.p.compareTo(a.q)<=0){var e=a.p;a.p=a.q,a.q=e}var t=a.p.subtract(mL.ONE),r=a.q.subtract(mL.ONE),i=t.multiply(r);0==i.gcd(o).compareTo(mL.ONE)?(a.n=a.p.multiply(a.q),a.d=o.modInverse(i),a.dmp1=a.d.mod(t),a.dmq1=a.d.mod(r),a.coeff=a.q.modInverse(a.p),setTimeout(function(){n()},0)):setTimeout(l,0)},s=function(){a.q=wL(),a.q.fromNumberAsync(i,1,r,function(){a.q.subtract(mL.ONE).gcda(o,function(e){0==e.compareTo(mL.ONE)&&a.q.isProbablePrime(10)?setTimeout(t,0):setTimeout(s,0)})})},c=function(){a.p=wL(),a.p.fromNumberAsync(e-i,1,r,function(){a.p.subtract(mL.ONE).gcda(o,function(e){0==e.compareTo(mL.ONE)&&a.p.isProbablePrime(10)?setTimeout(s,0):setTimeout(c,0)})})};setTimeout(c,0)};setTimeout(l,0)},e.prototype.sign=function(e,t,n){var r=(nH[n]||"")+t(e).toString(),i=this.n.bitLength()/4,o=function(e,t){if(t<e.length+22)return console.error("Message too long for RSA"),null;for(var n=t-e.length-6,r="",i=0;i<n;i+=2)r+="ff";return bL("0001"+r+"00"+e,16)}(r,i);if(null==o)return null;var a=this.doPrivate(o);if(null==a)return null;for(var l=a.toString(16),s=l.length,c=0;c<i-s;c++)l="0"+l;return l},e.prototype.verify=function(e,t,n){var r=bL(t,16),i=this.doPublic(r);return null==i?null:function(e){for(var t in nH)if(nH.hasOwnProperty(t)){var n=nH[t],r=n.length;if(e.substring(0,r)==n)return e.substring(r)}return e}(i.toString(16).replace(/^1f+00/,""))==n(e).toString()},e}();var nH={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function rH(e,t,n){if(!t||!e)throw new Error("extend failed, please check that all dependencies are included.");var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t)}
28
+ */function cy(){return ay||(ay=1,e=sy,"production"!==process.env.NODE_ENV&&function(){function t(e,t){var n=e.length;e.push(t),function(e,t,n){for(var r=n;r>0;){var o=r-1>>>1,a=e[o];if(!(i(a,t)>0))return;e[o]=t,e[r]=a,r=o}}(e,t,n)}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();return n!==t&&(e[0]=n,function(e,t,n){for(var r=n,o=e.length,a=o>>>1;r<a;){var l=2*(r+1)-1,s=e[l],c=l+1,d=e[c];if(i(s,t)<0)c<o&&i(d,s)<0?(e[r]=d,e[c]=t,r=c):(e[r]=s,e[l]=t,r=l);else{if(!(c<o&&i(d,t)<0))return;e[r]=d,e[c]=t,r=c}}}(e,n,0)),t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error),"object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var s=[],c=[],d=1,u=null,f=3,h=!1,C=!1,p=!1,m="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function A(e){for(var i=n(c);null!==i;){if(null===i.callback)r(c);else{if(!(i.startTime<=e))return;r(c),i.sortIndex=i.expirationTime,t(s,i)}i=n(c)}}function y(e){if(p=!1,A(e),!C)if(null!==n(s))C=!0,O(w);else{var t=n(c);null!==t&&N(y,t.startTime-e)}}function w(t,i){C=!1,p&&(p=!1,D()),h=!0;var o=f;try{return function(t,i){var o=i;for(A(o),u=n(s);null!==u&&(!(u.expirationTime>o)||t&&!H());){var a=u.callback;if("function"==typeof a){u.callback=null,f=u.priorityLevel;var l=a(u.expirationTime<=o);o=e.unstable_now(),"function"==typeof l?u.callback=l:u===n(s)&&r(s),A(o)}else r(s);u=n(s)}if(null!==u)return!0;var d=n(c);return null!==d&&N(y,d.startTime-o),!1}(t,i)}finally{u=null,f=o,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var b=!1,E=null,M=-1,x=5,L=-1;function H(){return!(e.unstable_now()-L<x)}var k,V=function(){if(null!==E){var t=e.unstable_now();L=t;var n=!0;try{n=E(!0,t)}finally{n?k():(b=!1,E=null)}}else b=!1};if("function"==typeof v)k=function(){v(V)};else if("undefined"!=typeof MessageChannel){var S=new MessageChannel,z=S.port2;S.port1.onmessage=V,k=function(){z.postMessage(null)}}else k=function(){m(V,0)};function O(e){E=e,b||(b=!0,k())}function N(t,n){M=m(function(){t(e.unstable_now())},n)}function D(){g(M),M=-1}var T=function(){};e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){C||h||(C=!0,O(w))},e.unstable_forceFrameRate=function(e){e<0||e>125?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):x=e>0?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(e){var t;switch(f){case 1:case 2:case 3:t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=T,e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,o){var a,l,u=e.unstable_now();if("object"==typeof o&&null!==o){var f=o.delay;a="number"==typeof f&&f>0?u+f:u}else a=u;switch(r){case 1:l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}var m=a+l,g={id:d++,callback:i,priorityLevel:r,startTime:a,expirationTime:m,sortIndex:-1};return a>u?(g.sortIndex=a,t(c,g),null===n(s)&&g===n(c)&&(p?D():p=!0,N(y,a-u))):(g.sortIndex=m,t(s,g),C||h||(C=!0,O(w))),g},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),sy;var e}var dy=(ly||(ly=1,"production"===process.env.NODE_ENV?iy.exports=(ry||(ry=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<i(o,t)))break e;e[r]=t,e[n]=o,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,a=o>>>1;r<a;){var l=2*(r+1)-1,s=e[l],c=l+1,d=e[c];if(0>i(s,n))c<o&&0>i(d,s)?(e[r]=d,e[c]=n,r=c):(e[r]=s,e[l]=n,r=l);else{if(!(c<o&&0>i(d,n)))break e;e[r]=d,e[c]=n,r=c}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var s=[],c=[],d=1,u=null,f=3,h=!1,C=!1,p=!1,m="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function A(e){for(var i=n(c);null!==i;){if(null===i.callback)r(c);else{if(!(i.startTime<=e))break;r(c),i.sortIndex=i.expirationTime,t(s,i)}i=n(c)}}function y(e){if(p=!1,A(e),!C)if(null!==n(s))C=!0,O(w);else{var t=n(c);null!==t&&N(y,t.startTime-e)}}function w(t,i){C=!1,p&&(p=!1,g(x),x=-1),h=!0;var o=f;try{for(A(i),u=n(s);null!==u&&(!(u.expirationTime>i)||t&&!k());){var a=u.callback;if("function"==typeof a){u.callback=null,f=u.priorityLevel;var l=a(u.expirationTime<=i);i=e.unstable_now(),"function"==typeof l?u.callback=l:u===n(s)&&r(s),A(i)}else r(s);u=n(s)}if(null!==u)var d=!0;else{var m=n(c);null!==m&&N(y,m.startTime-i),d=!1}return d}finally{u=null,f=o,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var b,E=!1,M=null,x=-1,L=5,H=-1;function k(){return!(e.unstable_now()-H<L)}function V(){if(null!==M){var t=e.unstable_now();H=t;var n=!0;try{n=M(!0,t)}finally{n?b():(E=!1,M=null)}}else E=!1}if("function"==typeof v)b=function(){v(V)};else if("undefined"!=typeof MessageChannel){var S=new MessageChannel,z=S.port2;S.port1.onmessage=V,b=function(){z.postMessage(null)}}else b=function(){m(V,0)};function O(e){M=e,E||(E=!0,b())}function N(t,n){x=m(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){C||h||(C=!0,O(w))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,o){var a=e.unstable_now();switch(o="object"==typeof o&&null!==o&&"number"==typeof(o=o.delay)&&0<o?a+o:a,r){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return r={id:d++,callback:i,priorityLevel:r,startTime:o,expirationTime:l=o+l,sortIndex:-1},o>a?(r.sortIndex=o,t(c,r),null===n(s)&&r===n(c)&&(p?(g(x),x=-1):p=!0,N(y,o-a))):(r.sortIndex=l,t(s,r),C||h||(C=!0,O(w))),r},e.unstable_shouldYield=k,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(oy)),oy):iy.exports=cy()),iy.exports);const uy=Symbol(),fy=Symbol(),hy="undefined"==typeof window||/ServerSideRendering/.test(window.navigator&&window.navigator.userAgent)?l:u,Cy=dy.unstable_runWithPriority?e=>{try{dy.unstable_runWithPriority(dy.unstable_NormalPriority,e)}catch(t){if("Not implemented."!==t.message)throw t;e()}}:e=>e();function py(e,t){const n=d(e)[uy];if("object"==typeof process&&"production"!==process.env.NODE_ENV&&!n)throw new Error("useContextSelector requires special context");const{v:{current:r},n:{current:i},l:o}=n,a=t(r),[l,s]=v((e,n)=>{if(!n)return[r,a];if("p"in n)throw n.p;if(n.n===i)return Object.is(e[1],a)?e:[r,a];try{if("v"in n){if(Object.is(e[0],n.v))return e;const r=t(n.v);return Object.is(e[1],r)?e:[n.v,r]}}catch(e){}return[...e]},[r,a]);return Object.is(l[1],a)||s(),hy(()=>(o.add(s),()=>{o.delete(s)}),[o]),l[1]}const my=function(e){const t=s({[uy]:{v:{current:e},n:{current:-1},l:new Set,u:e=>e()}});var n;return t[fy]=t.Provider,t.Provider=(n=t.Provider,({value:e,children:t})=>{const r=a(e),i=a(0),[o,l]=c(null);o&&(o(e),l(null));const s=a();if(!s.current){const e=new Set,t=(t,n)=>{i.current+=1;const r={n:i.current};(null==n?void 0:n.suspense)&&(r.n*=-1,r.p=new Promise(e=>{l(()=>t=>{r.v=t,delete r.p,e(t)})})),e.forEach(e=>e(r)),t()};s.current={[uy]:{v:r,n:i,l:e,u:t}}}return hy(()=>{r.current=e,i.current+=1,Cy(()=>{s.current[uy].l.forEach(t=>{t({n:i.current,v:e})})})},[e]),p(n,{value:s.current},t)}),delete t.Consumer,t}([ty,()=>{}]),gy=({children:t,useTableRef:n,totalWidth:r})=>{const i=a(null);return l(()=>{n&&i.current&&n(i)},[n]),e("table",{className:"ff-spreadsheet-table",ref:i,style:{minWidth:`${60+r}px`,tableLayout:"fixed"},children:t})},vy=t=>e("tr",{...t}),Ay=t=>e("tr",{className:"ff-spreadsheet-row-header",...t});function yy(){return py(my,([,e])=>e)}function wy(e){return py(my,([t])=>e(t))}const by=({selected:t,onSelect:n})=>{const i=r.useCallback(()=>{n()},[n]);return e("th",{className:"ff-spreadsheet-corner-header",onClick:i,tabIndex:0,children:e("div",{className:D("corner-header",{"ff-spreadsheet-header--selected":t}),children:e(F,{variant:t?"dark":"light",color:t?"var(--hover-color)":"var(--text-color)",name:"excel_corner_menu"})})})},Ey=t=>function(n){const i=yy(),o=r.useCallback(()=>i({type:dg}),[i]),a=wy(e=>e.selected instanceof Qv);return e(t,{...n,selected:a,onSelect:o})},My=t=>function(n){const i=yy(),o=r.useCallback((e,t)=>i(function(e,t){return{type:cg,payload:{column:e,extend:t}}}(e,t)),[i]),a=wy(e=>e.selected.hasEntireColumn(n.column)),l=wy(e=>e.selectedColumn??void 0),s=wy(e=>e.active?Sv(e.active,e.model.data):void 0);return e(t,{...n,cell:s,selected:a,selectedColumn:l,onSelect:o,scrollToColumn:n.scrollToColumn})},xy=My(({column:t,label:i,selected:o,onSelect:a,setContextMenu:l,deleteColumn:s,addColumnLeft:c,addColumnRight:d,columnContextEnable:u,cell:f,selectedColumn:C,minimumColumnWidth:p,maxColLimit:m,disableDeleteOption:g,contextMenu:v,onAddColumn:A,onDeleteColumn:y,setVisibleRange:w,scrollToColumn:b})=>{const E=yy(),M=wy(e=>e.model.data),x=wy(e=>e.columnDimensions[t]?.width??p),L=wy(e=>e.model.data),{columnCount:H}=EA(L),k=e=>{w(t=>{const n={...t,end:"increment"===e?t.end+1:t.end-1};return C&&b(C),n})},V=h(()=>[{label:"Add Column Left",value:"Add Column Left",iconName:"plus_icon",action:()=>{k("increment"),c(p),A?.(C??t,!0)},disableTooltip:"Column limit reached",visible:f?.contextDisable?.["Add Column Left"]??!1,disable:H>=m},{label:"Add Column Right",value:"Add Column Right",iconName:"plus_icon",action:()=>{k("increment"),d(p),A?.(C??t,!1)},disableTooltip:"Column limit reached",visible:f?.contextDisable?.["Add Column Right"]??!1,disable:H>=m},...g?[]:[{label:"Delete Column",value:"Delete Column",iconName:"delete",action:()=>{k("decrement"),s(),y?.(C??t)},disableTooltip:"",visible:f?.contextDisable?.["Delete Column"]??!1,disable:!1}]],[C,t,M]),S=r.useCallback((e,n)=>{const r=n?t-1:t,i=Math.max(r,0);a(i,e.shiftKey);const o=e.clientX,l=Number(x),s=e=>{const t=e.clientX-o,n=Math.max(p,l+t);E(function(e,t){return{type:qg,payload:{column:e,width:t}}}(i,n))},c=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",c),E(Lv())};document.addEventListener("mousemove",s),document.addEventListener("mouseup",c),E(xv())},[t,x]),z=r.useCallback(e=>E(yv(e)),[E]),O=r.useCallback(e=>{a(t,e.shiftKey)},[a,t]),N=r.useCallback(e=>{e.preventDefault(),a(t,e.shiftKey),l({open:u,contextType:"column",options:V})},[t,C,u,V]);return r.useEffect(()=>{void 0!==C&&"column"===v?.contextType&&l(e=>({open:e.open,contextType:"column",options:V}))},[t,C,u,V,"column"===v?.contextType]),n("th",{className:D("ff-spreadsheet-header",{"ff-spreadsheet-header--selected":o}),style:{width:`${x}px`,minWidth:"100px"},onClick:O,onContextMenu:N,tabIndex:0,children:[e(q,{fontWeight:"medium",children:i??Ly(t)}),e("div",{className:"drag-column-selector drag-column-left",onMouseDown:e=>S(e,!1),onDoubleClick:()=>E($g(t,x)),onClick:()=>z({row:-1,column:t})}),e("div",{className:"drag-column-selector drag-column-right",onMouseDown:e=>S(e,!0),onDoubleClick:()=>E($g(t,x)),onClick:()=>z({row:-1,column:t})})]},t)});function Ly(e){let t="",n=e;for(;n>=0;)t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26)-1;return t}const Hy=({row:t,label:i,selected:o,onSelect:a,setContextMenu:l,addRowTop:s,addRowBottom:c,deleteRow:d,rowContextEnable:u,selectedRow:f,cell:h,maxRowLimit:C,disableDeleteOption:p,contextMenu:m,setVisibleRange:g,scrollToRow:v})=>{const A=yy(),y=wy(e=>e.rowDimensions[t]?.height||32),w=wy(e=>e.model.data),{rowCount:b}=EA(w),E=e=>{g(t=>{const n={...t,end:"increment"===e?t.end+1:t.end-1};return f&&v(f),n})},M=r.useMemo(()=>[{label:"Add Row Top",value:"Add Row Top",iconName:"plus_icon",action:()=>{E("increment"),s()},disableTooltip:"Row limit reached",visible:h?.contextDisable?.["Add Row Top"]??!1,disable:b>=C},{label:"Add Row Bottom",value:"Add Row Bottom",iconName:"plus_icon",action:()=>{E("increment"),c()},disableTooltip:"Row limit reached",visible:h?.contextDisable?.["Add Row Bottom"]??!1,disable:b>=C},...p?[]:[{label:"Delete Row",value:"Delete Row",iconName:"delete",action:()=>{E("decrement"),d()},disableTooltip:"",visible:h?.contextDisable?.["Delete Row"]??!1,disable:!1}]],[f,t]),x=r.useCallback((e,n)=>{const r=n?t:t-1,i=Math.max(r,0);a(i,e.shiftKey);const o=e.clientY,l=y,s=e=>{const t=e.clientY-o,n=Math.max(32,l+t);A(Jg(i,n))},c=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",c),A(Lv())};document.addEventListener("mousemove",s),document.addEventListener("mouseup",c)},[y,t]),L=r.useCallback(e=>A(yv(e)),[A]),H=r.useCallback(e=>{a(t,e.shiftKey)},[t]),k=r.useCallback(e=>{e.preventDefault(),a(t,e.shiftKey),l({open:u,contextType:"row",options:M})},[t,u,M,f]);return r.useEffect(()=>{void 0!==f&&"row"===m?.contextType&&l(e=>({open:e.open,contextType:"row",options:M}))},[t,u,M,f,"row"===m?.contextType]),n("th",{className:D("ff-spreadsheet-header",{"ff-spreadsheet-header--selected":o}),style:{height:`${y}px`,minHeight:"32px"},onClick:H,onContextMenu:k,tabIndex:0,children:[e(q,{fontWeight:"medium",children:void 0!==i?i:t+1}),e("div",{className:"drag-row-selector drag-row-down",onMouseDown:e=>x(e,!0),onDoubleClick:()=>A(Jg(t,y)),onClick:()=>L({row:t,column:-1})}),e("div",{className:"drag-row-selector drag-row-up",onMouseDown:e=>x(e,!1),onDoubleClick:()=>A(Jg(t,y)),onClick:()=>L({row:t,column:-1})})]})},ky=t=>function(n){const i=yy(),o=wy(e=>e.selected.hasEntireRow(n.row)),a=wy(e=>e.active?Sv(e.active,e.model.data):void 0),l=wy(e=>e.selectedRow??void 0),s=r.useCallback((e,t)=>i(function(e,t){return{type:sg,payload:{row:e,extend:t}}}(e,t)),[i]);return e(t,{...n,selected:o,cell:a,selectedRow:l,onSelect:s,scrollToRow:n.scrollToRow})},Vy=r.memo(({row:t,column:n,DataViewer:i,active:o,dragging:a,mode:l,data:s,evaluatedData:c,select:d,activate:u,setCellDimensions:f,setCellData:h})=>{const C=r.useRef(null),p=r.useMemo(()=>({row:t,column:n}),[t,n]),m=r.useCallback(e=>{e.preventDefault(),window.getSelection()?.removeAllRanges(),"view"===l&&(f(p,iA(e.currentTarget)),e.shiftKey?d(p):u(p))},[l,f,p,d,u]),g=r.useCallback(e=>{a&&(f(p,iA(e.currentTarget)),d(p))},[f,d,a,p]);return r.useEffect(()=>{const e=C.current;if(!e)return;const t=()=>{a||f(p,iA(e))};t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[f,p,a]),s&&s.DataViewer&&(i=s.DataViewer),e("td",{ref:C,style:{...s?.style,..."dropDown"===s?.inputType?.type&&{fontSize:"12px"},textDecoration:"underline"===s?.style?.textDecoration?s?.style?.textDecoration:"none"},className:D("ff-spreadsheet-cell",s?.className,{"ff-spreadsheet-active-cell":o||a}),onMouseEnter:g,onMouseDown:m,tabIndex:0,children:e(i,{row:t,column:n,cell:s,active:o,evaluatedCell:c,setCellData:h,inputValue:()=>null})})}),Sy=t=>function(n){const{row:i,column:o}=n,a=yy(),l=r.useMemo(()=>({row:i,column:o}),[i,o]),s=r.useCallback(e=>a(wv(l,e)),[a,l]),c=r.useCallback(e=>a(function(e){return{type:fg,payload:{point:e}}}(e)),[a]),d=r.useCallback(e=>a(yv(e)),[a]),u=r.useCallback((e,t)=>a(bv(e,t)),[a]),f=wy(e=>rA(e.active,l)),h=wy(e=>f?e.mode:"view"),C=wy(e=>Sv(l,e.model.data)),p=wy(e=>Sv(l,e.model.evaluatedData)),m=wy(e=>e.dragging),g=wy(e=>e.copied?.has(l)||!1);return e(t,{...n,active:f,copied:g,dragging:m,mode:h,evaluatedData:p,data:C,select:c,activate:d,setCellDimensions:u,setCellData:s})},zy=({cell:r,evaluatedCell:i,active:o})=>{const a=function(e,t){const n=t?.value??e?.value;if(n&&"object"==typeof n)return n.toString();return n}(r,i);return e("span","boolean"==typeof a?{className:"ff-spreadsheet-data-viewer ff-spreadsheet-data-viewer--boolean",children:Oy(a)}:{className:D("ff-spreadsheet-data-viewer",{"ff-spreadsheet-data-viewer--preserve-breaks":mA(a)}),children:o||"dropDown"!==r?.inputType?.type?o||"file"!==r?.inputType?.type?!o&&a:e(t,{children:G(r?.value)?n("div",{className:"ff-spreadsheet-data-viewer--without-fileType",children:[e(F,{name:"attachment_icon"})," Attachment"]}):(n=>{if(G(n))return e(t,{});return JSON.parse(n).map(t=>e("div",{className:"ff-spreadsheet-data-viewer--fileType",children:e(Si,{width:r?.style?.width??100,title:t?.name?.split("*")?.[0]??""})},t.name))})(a)}):n("div",{className:"ff-spreadsheet-data-viewer--dropdownType",children:[a,e(F,{name:"arrow_down",height:8,className:"dropdownType-icon"})]})})};function Oy(e){return e?"TRUE":"FALSE"}const Ny=i.forwardRef(({initialValue:t="",onChange:n,className:r="",style:o={}},s)=>{const c=a(null);i.useImperativeHandle(s,()=>c.current),l(()=>{if(c.current&&document.activeElement!==c.current){const e=String(t)?.endsWith("\n")?`${t}\n`:t;e!==c.current.innerText&&(c.current.innerText=e)}},[t]);return e("div",{style:o,children:e("div",{ref:c,className:`editable-cell ${r}`,contentEditable:!0,suppressContentEditableWarning:!0,onKeyDown:e=>{if("Enter"===e.key){if(e.altKey||e.shiftKey)return e.preventDefault(),void document.execCommand("insertLineBreak");c.current?.blur()}"Delete"!==e.key&&"Backspace"!==e.key||e.stopPropagation()},onInput:()=>{if(c.current){let e=c.current.innerText;e.endsWith("\n")&&(e=e.slice(0,-1)),n?.(e)}},onPaste:e=>{e.preventDefault();const t=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,t)},spellCheck:!1,autoCorrect:"off",autoCapitalize:"off",style:{outline:"none",transition:"border 0.2s",whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:"inherit",fontSize:"inherit",lineHeight:"normal",minHeight:"24px",verticalAlign:"middle",caretColor:"black",height:"inherit",maxHeight:"inherit",display:"block",position:"relative",paddingBottom:"2px"}})})}),Dy=({onChange:t,cell:n})=>{const i=r.useRef(null),o=r.useCallback(e=>{const{contextDisable:r,...i}=n;t({...i,value:e,inputType:i.inputType??{type:"text"}})},[t,n]);r.useEffect(()=>{i.current&&function(e){if(e)if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)e.selectionStart=e.selectionEnd=e.value.length;else if(e.isContentEditable){const t=document.createRange(),n=window.getSelection();t.selectNodeContents(e),t.collapse(!1),n?.removeAllRanges(),n?.addRange(t)}}(i.current)},[]);return e("div",{className:"ff-spreadsheet-data-editor",children:e(Ny,{ref:i,initialValue:n?.value??"",onChange:o,className:"ff-spreadsheet-cell-textarea",style:{...n?.style,width:"100%",height:"100%",borderTop:"",borderBottom:"",borderLeft:"",borderRight:""}})})},Ty=t=>{const i=r.useRef(null),o=r.useRef(null),a=yy(),l=r.useCallback((e,t)=>a(wv(e,t)),[a]),s=r.useCallback(e=>a(yv(e)),[a]),c=r.useCallback(()=>a({type:Ag}),[a]),d=r.useCallback(e=>a({type:Wg,payload:{autofill:e}}),[a]),u=r.useCallback(e=>a(function(e){return{type:Lg,payload:{changes:e}}}(e)),[a]),f=r.useCallback(()=>{a({type:yg})},[a]),h=wy(e=>e.rowDimensions),C=wy(e=>e.active),p=wy(e=>e.mode),m=wy(e=>e.active?Sv(e.active,e.model.data):void 0),g=wy(e=>e.selected),v=wy(e=>g&&fA(e.rowDimensions,e.columnDimensions,e.model.data,e.selected)),A=wy(e=>{let t=C?dA(C,e.rowDimensions,e.columnDimensions):void 0;return t={top:t?.top?t?.top:0,height:t?.height?t?.height:0,left:t?.left?t?.left:0,width:t?.width?t?.width:0},t}),y=r.useMemo(()=>!C||!A||C.row<t.visibleRowRange.start||C.row>=t.visibleRowRange.end||C.column<t.visibleColRange.start||C.column>=t.visibleColRange.end,[C,A,t.visibleRowRange,t.visibleColRange]),w=r.useRef(void 0),b=r.useRef(null),E=r.useRef(void 0),M=r.useCallback(e=>{C&&l(C,e)},[l,C]),[x,L]=r.useState({value:"",name:""}),[H,k]=r.useState(!1),[V,S]=r.useState(),[z,O]=r.useState([]);r.useEffect(()=>{m&&C&&t.getActiveCell({value:m.value,active:C});const n=i.current;if(!y&&n&&(n.focus({preventScroll:!0}),"dropDown"===m?.inputType?.type)){L({value:m?.value,name:m?.value}),k(e=>!e);const t=m?.inputType?.options?.map(t=>({disable:t.disable,label:e("span",{style:{color:t.color},children:t.label}),value:t.value}));S(t)}},[i,y,C?.row,C?.column]),r.useEffect(()=>{if("file"===m?.inputType?.type&&m?.value)try{const e=JSON.parse(m.value).map(e=>new File([new Blob],e.name.split("*")[0]??"default"));O(e)}catch(e){console.error("Error parsing cell value for files:",e),O([])}else O([])},[m?.inputType?.type,m?.value]),r.useEffect(()=>{"dropDown"===m?.inputType?.type&&m?.value!==x.value&&L({value:m?.value,name:m?.value})},[m?.value,m?.inputType?.type,x.value]),r.useEffect(()=>{const e=b.current,t=E.current;if(b.current=C,E.current=m,!e||!t)return;const n=C?.row!==e.row||C?.column!==e.column;if(n||"edit"!==p){const e=w.current;t!==e?u([{prevCell:e||null,nextCell:t}]):n||m===t||u([{prevCell:t,nextCell:m||null}]),w.current=m}});const N=m&&m.DataEditor||t.DataEditor,T=m&&m.readOnly,I=r.useCallback(e=>{if(!C)return;const t=e.currentTarget.closest(".ff-excel-spreadsheet");if(!t)return void e.preventDefault();e.stopPropagation();const n=document.body.style.userSelect,r=document.body.style.overflow;document.body.style.userSelect="none",document.body.style.overflow="hidden";let i=null;const o=()=>{i&&(cancelAnimationFrame(i),i=null)},a=e=>{const n=t.getBoundingClientRect();let r=0,a=0;e.clientY<n.top+50?a=-12:e.clientY>n.bottom-50&&(a=12),e.clientX<n.left+50?r=-12:e.clientX>n.right-50&&(r=12),0!==r||0!==a?(e=>{o();const n=()=>{const{x:r,y:o}=e;0!==r&&(t.scrollLeft+=r),0!==o&&(t.scrollTop+=o),i=requestAnimationFrame(n)};i=requestAnimationFrame(n)})({x:r,y:a}):o()},l=()=>{o(),document.body.style.userSelect=n,document.body.style.overflow=r,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",l),d(!0)},[s,d,C]),Z=r.useCallback(e=>{e.preventDefault(),t.setContextMenu({open:t.contextOption?.open??!1,contextType:t.contextOption?.contextType??null,options:t.contextOption?.options||[]})},[t]),R=v?.height!==A?.height||v?.width!==A?.width,j=r.useCallback(e=>{C&&R&&(bv(C,iA(e.currentTarget)),s(C))},[C,R]),B=t.isAtRight?t.maxWidth-(A?.left-t.scrollPos.left)+100:t.maxWidth,P=t.isAtBottom?t.maxHeight-(A?.top-t.scrollPos.top)+64:t.maxHeight,_=["file","dropDown"].includes(m?.inputType?.type||"");return n("div",{ref:i,className:D("ff-spreadsheet-active-cell",`ff-spreadsheet-active-cell--${p}`,{"ff-spreadsheet-active-cell--hidden":y,"ff-spreadsheet-active-cell--dragging":R&&"text"!==m?.inputType?.type}),onMouseDown:j,style:{...A,backgroundColor:m?.style?.backgroundColor,..._?{display:"flex",alignItems:m?.style?.alignContent,justifyContent:m?.style?.textAlign}:{},..."edit"===p&&C?{minWidth:Math.min(A?.width,t.maxWidth),minHeight:Math.min(A?.height,t.maxHeight),height:"auto",maxWidth:`${B}px`,maxHeight:`${P}px`,overflow:"auto",..."dropDown"===m?.inputType?.type?{}:{padding:"2px 4px 0px 4px",width:"max-content"}}:{}},onContextMenu:Z,onClick:"view"!==p||T?void 0:c,tabIndex:0,children:[e("div",{className:_?"":"active-cell-main",children:"dropDown"===m?.inputType?.type?e(Vo,{...m?.inputType?.inputProps,dropDownRef:o,showOptions:{open:!("edit"!==p||!C),toggle:H},selectedOption:x,optionsList:V||[],height:26,showLabel:!1,disabled:!t.editable,showBorder:!1,optionZIndex:5e3,onChange:e=>{L({value:e.value,name:e.label}),M({...m,value:e.value,style:m?.style,inputType:m?.inputType})}}):"file"===m?.inputType?.type?e(Jm,{...m?.inputType?.inputProps,label:"",onFileListClick:e=>{const n=e.target.closest(".ff-attachment-files"),r=e.target.closest(".ff-icon-container, .ff-icon-click, .ff-icon-danger");if(n&&!r&&m?.value&&t.attachmentAction?.viewAttachment)try{const e=JSON.parse(m.value),r=n.parentElement?.querySelectorAll(".ff-attachment-files")||[],i=Array.from(r).indexOf(n);if(-1===i||!e[i])return void console.error("File index not found or invalid");const o=e[i];t.attachmentAction.viewAttachment(o.id,o.name?.split("*")[0]??"default")}catch(e){console.error("Error parsing cell value:",e)}else console.warn("Missing file element, icon click, cell value, or viewAttachment action")},selectedFiles:z,onFilesChange:async(e,n,r)=>{try{if("ADD"===r&&"file"===m?.inputType?.type){let n=[];try{m?.value&&(n=JSON.parse(m.value))}catch(e){console.error("Error parsing cell.value:",e)}let r=0;const i=e.filter((e,t,i)=>{const o=e.name.split("*")[0],a=i.findIndex(e=>e.name.split("*")[0]===o)!==t,l=n.some(e=>e.name.split("*")[0]===o);return!a&&!l||(r++,!1)});if(n.length+i.length>5)return void oc.info("Cannot upload more than 5 files.");if(t.attachmentAction?.addAttachment&&i.length>0)try{let e=0,r=0,o=0;const l=z?.length+i?.length,s=l>0?25*l:1,c=[...n],d=i?.map(async e=>{try{if(e.name.includes("*"))return{file:e,status:"existing",data:{name:e.name}};const n=await(t?.attachmentAction?.addAttachment(e));if(!n||"string"==typeof n&&0===n.trim().length)return{file:e,status:"failed",reason:"no response"};if("string"==typeof n)try{const t=JSON.parse(n);return 507===t.responseCode?{file:e,status:"memory_full",reason:"no memory"}:400===t.responseCode?{file:e,status:"failed",reason:"invalid file"}:t?.id&&t?.name?{file:e,status:"success",data:t}:(console.error(`Invalid response structure for ${e.name}:`,t),{file:e,status:"failed",reason:"invalid response"})}catch(t){return console.error(`Parse error for ${e.name}:`,t),{file:e,status:"failed",reason:"parse error"}}if("object"==typeof n&&null!==n){const t=n;return t?.id&&t?.name?{file:e,status:"success",data:t}:(console.error(`Invalid response structure for ${e.name}:`,n),{file:e,status:"failed",reason:"invalid response"})}return console.error(`Unknown response for ${e.name}:`,n),{file:e,status:"failed",reason:"unknown"}}catch(t){return console.error(`Upload failed for ${e.name}:`,t),{file:e,status:"failed",reason:"upload error"}}});if((await Promise.allSettled(d)).forEach(t=>{if("fulfilled"===t.status&&t.value){const{status:n,data:i}=t.value;"success"===n&&i?.id&&i?.name?(c.push(i),e++):"existing"===n&&i?.name?c.push(i):"memory_full"===n?o++:r++}else r++}),e>0||c.length>n.length){const e=c.length>0?JSON.stringify(c):"";M({...m,value:e,style:m?.style,inputType:m?.inputType}),a(Jg(C?.row||0,Math.max(s,h?.[C.row]?.height||s))),O(c.map(e=>new File([new Blob],e.name?.split("*")[0]??"default")))}o>0&&oc.info("No memory available to add the file"),e>0&&oc.success(`${e} file${e>1?"s":""} uploaded successfully`),r>0&&oc.info(`${r} unsupported ${r>1?"files":"file"}. Please check the file formats.`)}catch(e){console.error("Upload operation failed:",e),oc.error("Operation failed")}}else if("DELETE"===r&&"file"===m?.inputType?.type)try{let e=[...m&&JSON.parse(m.value)],r=0;for(const i of n||[]){const n=e.findIndex(e=>e.name.split("*")[0]===i.name.split("*")[0]),o=e[n]?.id;if(-1!==n&&o&&t.attachmentAction?.deleteAttachment)try{const a=await t.attachmentAction.deleteAttachment(o);"SUCCESS"===a||"object"==typeof a&&null!==a&&("status"in a&&"SUCCESS"===a.status||"responseCode"in a&&200===a.responseCode)?(e.splice(n,1),r++):console.error(`Delete failed for ${i.name}: Invalid response`,a)}catch(e){console.error(`Delete error for ${i.name}:`,e),oc.error("Error deleting file")}else console.error(`Cannot delete ${i.name}: Invalid fileId or no match`,{index:n,fileId:o,hasDeleteAttachment:!!t.attachmentAction?.deleteAttachment}),oc.error("Failed to delete file: Invalid file data")}if(r>0){const t=e.length>0?JSON.stringify(e):"";M({...m,value:t,style:m?.style,inputType:m?.inputType}),O(e?.map(e=>new File([new Blob],e.name.split("*")[0]))),oc.success(`${r} file${r>1?"s":""} deleted successfully`)}else if(n?.length){const t=e?.filter(e=>e.id&&e.name);if(t.length<e.length){const e=t.length>0?JSON.stringify(t):"";M({...m,value:e,style:m?.style,inputType:m?.inputType}),O(t.map(e=>new File([new Blob],e.name.split("*")[0]))),oc.error("Failed to delete file(s). Invalid file data detected.")}else oc.error("Failed to delete file(s). No valid files removed.")}}catch(e){console.error("Delete operation failed:",e),oc.error("Delete operation failed")}}catch(e){console.error("handleFilesChange error:",e),oc.error("Operation failed")}},disabled:!t.editable,maxFiles:5,buttonLabel:"+ Attachments",buttonVariant:"tertiary",deleteButton:t.editable,selectedFileMessage:"Duplicate attachments not allowed within the same row",addAttachmentButton:t.editable,isInfoIconRequired:!1,truncateMaxLimit:(A?.width??0)-60}):"edit"===p&&C&&t.editable?e(N,{row:C.row,column:C.column,cell:m,onChange:M,exitEditMode:f}):e(Ny,{initialValue:m?.value,onChange:()=>{},className:"ff-spreadsheet-cell-textarea",style:{...m?.style,height:"100%",width:"100%",textDecoration:"underline"===m?.style?.textDecoration?"underline":"none",backgroundColor:R?"#1e161f00":m?.style?.backgroundColor,pointerEvents:"none",borderTop:"",borderBottom:"",borderLeft:"",borderRight:""}})}),!["file"].includes(m?.inputType?.type??"")&&("edit"===p||C&&e("div",{onMouseDown:I,className:"select_dot"}))]},`${C?.row}-${C?.column}`)},Iy=({dimensions:t,dragging:n,hidden:r,variant:i})=>{const o=wy(e=>e.active),a=wy(e=>e.autoFill),l=wy(e=>o?dA(o,e.rowDimensions,e.columnDimensions):void 0),{width:s,height:c,top:d,left:u}=t||{};let f=l?.height??0,h=l?.width??0,C=s,p=c;return a.open&&s&&c&&l&&(s-h>c-f?(C=s,p=l.height):(p=c,C=l.width)),e("div",{className:D("ff-spreadsheet-floating-rect",{[`ff-spreadsheet-floating-rect--${i}`]:i,"ff-spreadsheet-floating-rect--dragging":n,"ff-spreadsheet-floating-rect--hidden":r}),style:{width:(C??0)+1,height:(p??0)+1,top:d,left:u}})},Zy=({scrollPos:t={top:0,left:0}})=>{const n=wy(e=>e.selected),i=wy(e=>e.dragging),o=wy(e=>e.selected.size(e.model.data)<2),a=wy(e=>n&&fA(e.rowDimensions,e.columnDimensions,e.model.data,e.selected)),l=r.useMemo(()=>{if(a)return{...a,top:a.top-1,left:a.left-1,height:a.height-1,width:a.width-1}},[a,t]);return e(Iy,{variant:"selected",dimensions:l,dragging:i,hidden:o||!a})},Ry=({scrollPos:t={top:0,left:0}})=>{const n=wy(e=>e.copied),i=null===n,o=wy(e=>n&&uA(e.rowDimensions,e.columnDimensions,n)),a=r.useMemo(()=>{if(o)return{...o,top:o.top-1,left:o.left-1,height:o.height-1,width:o.width-1}},[o,t]);return e(Iy,{variant:"copied",dimensions:a,hidden:i||!o,dragging:!1})},jy=i.forwardRef(({getColorValue:t,disabled:n,initialColor:r},o)=>{const l=a(null);i.useImperativeHandle(o,()=>l.current);const[s,d]=c(r);return e("div",{className:D("ff-excel-color-selector",{"color-selector-disabled":n}),style:{backgroundColor:s},onClick:()=>{l.current&&!n&&l.current.click()},children:e("input",{type:"color",disabled:n,className:D("ff-excel-color-selector-picker",{"color-selector-disabled":n}),ref:l,onChange:e=>{d(e.target.value),t(e.target.value.replace("#",""))}})})});jy.displayName="ColorBarSelector";const By=e=>{switch(e.toUpperCase()){case"LEFT":default:return"left";case"RIGHT":return"right";case"CENTER":return"center";case"JUSTIFY":return"justify";case"BOTTOM":return"end";case"TOP":return"start"}},Py=e=>{switch(e){case"left":return"LEFT";case"right":return"RIGHT";case"center":return"CENTER";case"justify":return"JUSTIFY";case"end":default:return"BOTTOM";case"start":return"TOP"}},_y=e=>wA.reduce((t,n)=>Math.abs(n-parseFloat(e))<Math.abs(t-parseFloat(e))?n:t);function Fy(e,t=100){const{border:n}=e;let r="",i="",o="",a="";return"THIN"!==n.top&&(r="MEDIUM"===n.top?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==n.right&&(i="MEDIUM"===n.right?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==n.bottom&&(o="MEDIUM"===n.bottom?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==n.left&&(a="MEDIUM"===n.left?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),{fontSize:gA(_y(String(e.size))),fontFamily:(l=e.name,yA.some(e=>e.label===l)?l:"Poppins"),color:`#${e.color}`,backgroundColor:`#${e.backgroundColor}`,fontWeight:e.bold?"bold":"normal",fontStyle:e.italic?"italic":"normal",textDecoration:e.underline?"underline":"normal",borderTop:r,borderRight:i,borderBottom:o,borderLeft:a,textAlign:By(e.alignment.horizontal),alignContent:By(e.alignment.vertical),height:e.height??32,width:e.width??t};var l}const qy=e=>{if(!e||"none"===e)return"THIN";if(e.includes("solid")||e.includes("dashed")||e.includes("dotted")){if(e.includes("2px")||e.includes("medium"))return"MEDIUM";if(e.includes("3px")||e.includes("medium"))return"THICK"}return"THIN"},Uy=(e,t=100)=>({name:e.fontFamily||"Arial",size:vA(e.fontSize?.toString()||"12"),bold:"bold"===e.fontWeight,italic:"italic"===e.fontStyle,underline:"underline"===e.textDecoration,color:e.color?.replace("#","")||"000000",backgroundColor:e.backgroundColor?.replace("#","")||"FFFFFF",borderColor:"F2F2F2",border:{top:qy(e.borderTop?e.borderTop.toString():void 0),right:qy(e.borderRight?e.borderRight.toString():void 0),bottom:qy(e.borderBottom?e.borderBottom.toString():void 0),left:qy(e.borderLeft?e.borderLeft.toString():void 0)},alignment:{horizontal:Py(e.textAlign),vertical:Py(e.alignContent),wrapText:!1},width:e.width||t,height:e.height||32}),Wy=({toolbar:t="show",editable:r,onBold:i,onItalic:o,setUnderlineType:s,setColor:d,setFontSize:u,setFontFamily:f,setTextAlign:h,setBackgroundColor:C,setBorderType:p,setFormatePainter:m})=>{const g=wy(e=>e.selected instanceof Qv),[v,A]=c("disable"===t||!r),y=wy(e=>e.active?Sv(e.active,e.model.data):null),w=wy(e=>e.model.data),b=wy(e=>e.formattedStyle.open),E={...AA.style,color:"#1e161f",backgroundColor:"#ffffff",borderColor:"#1e161f"},[M,x]=c(y?.style||E),L=a(null);l(()=>{y?.style&&JSON.stringify(y.style)!==JSON.stringify(M)&&x(y?.style||E),g?A(!r):y&&"boolean"==typeof y.readOnly&&A(y.readOnly||"disable"===t||!r||"dropDown"===y?.inputType?.type)},[y,r]);const H=Uy(M),[k,V]=c("border-none"),[S,z]=c({label:"",value:""}),[O,N]=c({label:"",value:""}),[D,T]=c({color:E.color,backgroundColor:E.backgroundColor,borderColor:E.borderColor}),I=[{value:"border-all-sides",label:"All Border",icon:"all_borders"},{value:"border-bottom",label:"Border Bottom",icon:"border_bottom"},{value:"border-left",label:"Border Left",icon:"border_left"},{value:"border-right",label:"Border Right",icon:"border_right"},{value:"border-top",label:"Border Top",icon:"border_top"},{value:"border-none",label:"No Border",icon:"no_border"}],Z=wA.map(e=>({label:String(e),value:String(e)})),R=a(null),j=a(null);l(()=>{let e=setTimeout(()=>{d(w,D.color)},0);return()=>{clearTimeout(e)}},[D.color]),l(()=>{let e=setTimeout(()=>{C(w,D.backgroundColor)},0);return()=>{clearTimeout(e)}},[D.backgroundColor]);return l(()=>{const e=M.fontFamily,t=String(vA(M.fontSize));z({label:e??"Times New Roman",value:e??"Times New Roman"}),N({label:t??"11",value:t??"11"})},[M]),n("div",{className:"ff-excel-toolbar",children:[n("div",{className:"ff-excel-toolbar-font ",children:[e("div",{className:"ff-excel-toolbar-font-family",children:e(Vo,{disabled:v,height:24,tooltip:!0,showToolTip:!0,showLabel:!1,optionZIndex:2e3,onChange:e=>{z({label:e.label,value:e.label}),f(w,e.value)},required:!1,optionsList:yA,selectedOption:S})}),e("div",{className:"ff-excel-toolbar-font-size",children:e(Vo,{disabled:v,height:24,showLabel:!1,optionZIndex:2e3,required:!1,onChange:e=>{N({label:e.label,value:e.value}),u(w,gA(Number(e.value)))},optionsList:Z,selectedOption:O})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-icon",children:[e(Y,{placement:"top",title:"Text Left",children:e(F,{disabled:v,variant:"left"===M.textAlign?"dark":"light",hoverEffect:"left"!==M.textAlign,onClick:()=>h(w,"left"),name:"text_align_left"})}),e(Y,{placement:"top",title:"Text Center",children:e(F,{disabled:v,variant:"center"===M.textAlign?"dark":"light",hoverEffect:"center"!==M.textAlign,onClick:()=>h(w,"center"),name:"text_align_center"})}),e(Y,{placement:"top",title:"Text Right",children:e(F,{disabled:v,variant:"right"===M.textAlign?"dark":"light",hoverEffect:"right"!==M.textAlign,onClick:()=>h(w,"right"),name:"text_align_right"})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-text",children:[e(Y,{placement:"top",title:"Bold",children:e(F,{disabled:v,variant:H.bold?"dark":"light",hoverEffect:!H.bold,onClick:()=>i(w),name:"bold"})}),e(Y,{placement:"top",title:"Italic",children:e(F,{disabled:v,variant:H.italic?"dark":"light",hoverEffect:!H.italic,onClick:()=>o(w),name:"italic"})}),e(Y,{placement:"top",title:"Underline",children:e("div",{className:"ff-excel-toolbar-icon-underline",children:e(F,{disabled:v,variant:"underline"===M.textDecoration?"dark":"light",hoverEffect:"underline"!==M.textDecoration,onClick:()=>s(w),name:"underline"})})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-icon",children:[e(Y,{placement:"top",title:"Format Painter",children:e(F,{disabled:v,variant:b?"dark":"light",hoverEffect:!b,onClick:()=>{m(w)},name:"formate_painter"})}),e(Y,{placement:"top",title:"Text Color",children:n("div",{className:"ff-excel-toolbar-icon-color",children:[e(F,{disabled:v,hoverEffect:!0,width:12,height:10,onClick:()=>{d(w,D.color),R.current?.click()},name:"text_color"}),e(jy,{ref:R,disabled:v,getColorValue:e=>{T(t=>({...t,color:e}))},initialColor:D.color})]})}),e(Y,{placement:"top",title:"Background Color",children:n("div",{className:"ff-excel-toolbar-icon-color",children:[e(F,{disabled:v,hoverEffect:!0,width:12,height:10,onClick:()=>{C(w,D.backgroundColor),j.current?.click()},name:"fill_color"}),e(jy,{ref:j,disabled:v,getColorValue:e=>{T(t=>({...t,backgroundColor:e}))},initialColor:D.backgroundColor})]})})]}),e("div",{className:"ff-excel-toolbar-divider"}),e("div",{className:"ff-excel-toolbar-menu",children:n("div",{className:"ff-excel-toolbar-menu-option",children:[e(Y,{placement:"top",title:"Border Type",children:e(F,{hoverEffect:!0,disabled:v,onClick:()=>p(w,k,"var(--input-hover-border-color)"),name:(()=>{const e=I.find(e=>e.value===k);return e?e.icon:""})()})}),e("span",{ref:L,children:e(To,{disabled:v,iconName:"arrow_down",targetRef:L,iconSize:12,zIndex:2e3,options:I,tooltipTitle:"Border Type",tooltipPlacement:"top",onOptionClick:e=>{let t=e.value;p(w,t,"var(--input-hover-border-color)"),V(t)}})})]})})]})},Xy=(e,t)=>{let n,r=null;const i=function(...i){const o=this;null===r||Date.now()-r>=t?(e.apply(o,i),r=Date.now()):(n&&clearTimeout(n),n=setTimeout(()=>{e.apply(o,i),r=Date.now()},t-(Date.now()-r)))};return i.cancel=()=>{n&&clearTimeout(n),n=null,r=null},i},Qy=r.forwardRef(function(t,i){const{className:o,columnLabels:a=[],rowLabels:l=[],toolbar:s,editable:c,onKeyDown:d,Table:u=gy,Row:f=vy,sheetHeight:h,HeaderRow:C=Ay,DataEditor:p=Dy,DataViewer:m=zy,onSelect:g=()=>{},onActivate:v=()=>{},onEvaluatedDataChange:A=()=>{},contextOption:y,attachmentAction:w,workRef:b,minimumColumnWidth:E,setContextMenu:M,maxRowLimit:x,maxColLimit:L,disableDeleteOption:H,contextMenu:k,getActiveCell:V,onAddColumn:S,onDeleteColumn:z}=t,O=32,N=E||100,T=r.useRef(!1),I=wy(e=>e.model.data),[Z,R]=r.useState(!1),[j,B]=r.useState(0),[P,_]=r.useState(0),[F,q]=r.useState({top:0,left:0}),[U,W]=r.useState(!1),[X,Q]=r.useState(!1),G=r.useMemo(()=>{const e=t.createFormulaParser||xA,n=new SA(e,t.data);let r={},i={};t.data.forEach((e,t)=>{let n=O;e.forEach(e=>{if(e){const t=parseFloat(String(e.style?.height).replace("px",""))||O;n=Math.max(n,t)}}),r[t]={top:0,height:n}});const o=t.data[0]?t.data[0].length:0;for(let e=0;e<o;e++){let n=N;t.data.forEach(t=>{const r=t[e];if(r){const e=parseFloat(String(r.style?.width).replace("px",""))||N;n=Math.max(n,e)}}),i[e]={left:0,width:n}}return R(e=>!e),{...ty,model:n,selected:t.selected||ty.selected,rowDimensions:r,columnDimensions:i}},[t.createFormulaParser,t.data,t.selected]),Y=r.useReducer(ny,G),[K,J]=Y,$=r.useMemo(()=>function(e,t,n){const{columns:r,rows:i}=Rv(e);return{rows:t?Math.max(i,t.length):i,columns:n?Math.max(r,n.length):r}}(K.model.data,l,a),[K.model.data,l,a]),[ee,te]=r.useState({start:0,end:Math.min(20,$.rows)}),[ne,re]=r.useState({start:0,end:Math.min(15,$.columns)}),ie=r.useCallback(e=>{let t=0;for(let n=0;n<e;n++)t+=K.rowDimensions[n]?.height||O;return t},[K.rowDimensions,O]),oe=r.useCallback(e=>{let t=0;for(let n=0;n<e;n++)t+=K.columnDimensions[n]?.width||N;return t},[K.columnDimensions,N]),ae=r.useRef(!0);r.useEffect(()=>{ae.current?ae.current=!1:J(function(e){return{type:Xg,payload:{minimumColumnWidth:e}}}(E))},[E]);const le=ie($.rows),se=oe($.columns),ce=ie(ee.start),de=le-ie(ee.end),ue=oe(ne.start),fe=se-oe(ne.end),he=K.mode,Ce=r.useRef(null),pe=e=>r.useCallback((...t)=>J(e(...t)),[e]),me=pe(Kg),ge=pe(kv),ve=pe(Hv),Ae=pe(Vv),ye=pe(Ev),we=pe(Mv),be=pe(mv),Ee=pe(xv),Me=pe(Lv),xe=pe(gv),Le=pe(vv),He=pe(Av),ke=pe(ev),Ve=pe(tv),Se=pe(rv),ze=pe(av),Oe=pe(iv),Ne=pe(ov),De=pe(nv),Te=pe(lv),Ie=pe(sv),Ze=pe(cv),Re=pe(Yg),je=pe(dv),Be=pe(uv),Pe=pe(fv),_e=pe(hv),Fe=pe(Cv),qe=pe(pv);r.useImperativeHandle(i,()=>({removeSelect:Ae}));const Ue=r.useRef(K.active);r.useEffect(()=>{if(K.active!==Ue.current)if(K.active)v(K.active);else{const e=b.current;e&&pA(e)&&document.activeElement&&document.activeElement.blur()}Ue.current=K.active},[v,K.active]);const We=r.useRef(K.model.evaluatedData);r.useEffect(()=>{K?.model?.evaluatedData!==We?.current&&A(K?.model?.evaluatedData),We.current=K.model.evaluatedData},[K?.model?.evaluatedData,A]);const Xe=r.useRef(K.selected);r.useEffect(()=>{K.selected.equals(Xe.current)||t.selected&&K.selected.equals(t.selected)||g(K.selected),Xe.current=K.selected},[K.selected,g,t.selected]);const Qe=r.useRef(t.selected);r.useEffect(()=>{t.selected&&Qe.current&&!t.selected.equals(Qe.current)&&He(t.selected),Qe.current=t.selected},[t.selected,He]);let Ge=r.useRef();r.useEffect(()=>{me(c),void 0!==Ge.current&&t.data!==Ge.current&&xe(t.data),Ge.current=t.data},[t.data,xe,c]);const Ye=r.useRef(t.createFormulaParser);r.useEffect(()=>{t.createFormulaParser!==Ye.current&&t.createFormulaParser&&Le(t.createFormulaParser),Ye.current=t.createFormulaParser},[t.createFormulaParser,Le]);const Ke=r.useCallback(e=>{const{model:t,selected:n}=K,{data:r}=t,i=n.toRange(r);if(i){!function(e,t){e.clipboardData?.setData(tA,t)}(e,hA(function(e,t,n){const r=[],i=t.column-e.column;for(let o=e.row;o<=t.row;o++){const a=o-e.row;r[a]=r[a]||Array(i);for(let i=e.column;i<=t.column;i++)r[a][i-e.column]=Sv({row:o,column:i},n)}return r}(i.start,i.end,r)))}},[K]),Je=r.useCallback(e=>{CA(Ce.current,he)&&(e.preventDefault(),e.stopPropagation(),Ke(e),ge())},[he,Ke,ge]),$e=r.useCallback(e=>{CA(Ce.current,he)&&(e.preventDefault(),e.stopPropagation(),Ke(e),ve())},[he,Ke,ve]),et=r.useCallback(e=>{if(CA(Ce.current,he)&&(e.preventDefault(),e.stopPropagation(),e.clipboardData)){const t=function(e){return window.clipboardData&&window.clipboardData.getData?window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?e.clipboardData.getData(tA):""}(e);ye(t)}},[he,ye]),tt=r.useCallback(e=>{e.persist();const t=e.ctrlKey||e.metaKey,n=e.key.toLowerCase();t&&"b"===n?(e.preventDefault(),ke(I)):t&&"i"===n?(e.preventDefault(),Ve(I)):t&&"u"===n&&(e.preventDefault(),Se(I)),d&&d(e),e.defaultPrevented||(function(e,t){return void 0!==YA(e,t)}(K,e)&&e.nativeEvent.preventDefault(),we(e))},[K,d,we]),nt=r.useCallback(()=>{K.formattedStyle.open&&K.active&&Re(K.active)},[K]),rt=r.useCallback(()=>{Me(),document.removeEventListener("mouseup",rt)},[Me]),it=r.useCallback(e=>{K.dragging||1!==e.buttons||"view"!==he||(Ee(),document.addEventListener("mouseup",rt))},[K,Ee,rt,he]),ot=r.useMemo(()=>Sy(t.Cell||Vy),[t.Cell,Z,c]),at=r.useMemo(()=>Ey(t.CornerIndicator||by),[t.CornerIndicator,Z]),lt=r.useMemo(()=>ky(t.RowIndicator||Hy),[t.RowIndicator,Z]),st=r.useMemo(()=>My(t.ColumnIndicator||xy),[t.ColumnIndicator,Z]);r.useEffect(()=>(document.addEventListener("cut",Je),document.addEventListener("copy",$e),document.addEventListener("paste",et),()=>{document.removeEventListener("cut",Je),document.removeEventListener("copy",$e),document.removeEventListener("paste",et)}),[Je,$e,et]);const ct=e=>{const t=new ResizeObserver(e=>{const t=e[0];if(t&&Ce.current){const e=t.target;if(e){const{clientWidth:t,clientHeight:n}=e;_(Math.min(Ce.current.clientHeight,n)),B(Math.min(Ce.current.clientWidth,t))}}}),n=e.current;n&&t.observe(n)},dt=r.useCallback(e=>{const t=e.target,{scrollTop:n,clientHeight:r,scrollLeft:i,clientWidth:o}=t;q({top:n,left:i});let a=0;for(;a<$.rows&&ie(a)<n;)a++;let l=a;for(;l<$.rows&&ie(l)<n+r;)l++;a=Math.max(0,a-10),l=Math.min($.rows,l+10),te({start:a,end:l});const s=l===$.rows;W(s);let c=0;for(;c<$.columns&&oe(c)<i;)c++;let d=c;for(;d<$.columns&&oe(d)<i+o;)d++;c=Math.max(0,c-10),d=Math.min($.columns,d+10),re({start:c,end:d});const u=d===$.columns;Q(u),k.open&&M({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]})},[$.rows,$.columns,ie,oe]),ut=r.useMemo(()=>Xy(dt,16),[dt]),ft=e=>{T.current=!0,requestAnimationFrame(()=>{let t=0;for(let n=0;n<=e;n++)t+=K.rowDimensions?.[n]?.height||O;requestAnimationFrame(()=>{Ce.current&&e>=$.rows-1&&Ce?.current?.scrollTo({top:t+O,behavior:"smooth"})})})},ht=e=>{T.current=!0,requestAnimationFrame(()=>{let t=0;for(let n=0;n<=e;n++)t+=K.columnDimensions?.[n]?.width||N;requestAnimationFrame(()=>{Ce.current&&e>=$.columns-1&&Ce.current.scrollTo({left:t+60,behavior:"smooth"})})})};r.useEffect(()=>{T.current||(te({start:0,end:Math.min(20,$.rows)}),re({start:0,end:Math.min(15,$.columns)}))},[$.rows,$.columns,T.current]);const Ct=nA(ee.end,ee.start),pt=nA(ne.end,ne.start),mt=n("colgroup",{children:[e("col",{style:{width:"60px"}},"row-indicator")," ",e("col",{style:{width:`${ue}px`}},"left-spacer")," ",pt.map(t=>e("col",{style:{width:`${K.columnDimensions[t]?.width||N}px`}},t)),e("col",{style:{width:`${fe}px`}},"right-spacer")," "]}),gt=r.useMemo(()=>n(u,{useTableRef:ct,totalWidth:se,children:[mt,n("tbody",{children:[n(C,{children:[e(at,{}),e("div",{className:"spacer left"}),pt.map(n=>e(st,{column:n,minimumColumnWidth:E,setContextMenu:t.setContextMenu,label:n in a?a[n]:void 0,deleteColumn:qe,addColumnLeft:Pe,addColumnRight:_e,columnContextEnable:t.columnContextEnable,maxColLimit:L,disableDeleteOption:H,contextMenu:k,onAddColumn:S,onDeleteColumn:z,setVisibleRange:re,scrollToColumn:ht},n)),e("div",{className:"spacer right"})]}),e("tr",{style:{height:`${ce}px`}}),Ct.map(r=>n(f,{row:r,children:[e(lt,{label:r in l?l?.[r]:void 0,row:r,addRowTop:je,addRowBottom:Be,deleteRow:Fe,setContextMenu:t.setContextMenu,rowContextEnable:t.rowContextEnable,maxRowLimit:x,disableDeleteOption:H,contextMenu:k,setVisibleRange:te,scrollToRow:ft},r),e("div",{className:"spacer left"}),pt.map(t=>e(ot,{row:r,column:t,DataViewer:m},`${r}-${t}`)),e("div",{className:"spacer right"})]},r)),e("tr",{style:{height:`${de}px`}})]})]}),[u,$.rows,$.columns,f,C,at,a,st,l,lt,ot,m,ee,ne,ce,de,ue,fe,K.rowDimensions,K.columnDimensions]),vt=r.useMemo(()=>e(Ty,{attachmentAction:w,contextOption:y,getActiveCell:V,setContextMenu:t.setContextMenu,DataEditor:p,visibleRowRange:ee,visibleColRange:ne,maxHeight:P-64,maxWidth:j-E,totalHeight:le,totalWidth:se,isAtBottom:U,isAtRight:X,scrollPos:F,editable:c},K.active?`${K.active.row}-${K.active.column}`:"no-active"),[p,ee,ne,K.active,P,j,le,se,U,X,c]),At=r.useMemo(()=>n("div",{className:"ff-excel-spreadsheet-container",children:[e("div",{style:{width:`${j}px`},className:D("ff-excel-header-column-hider",{"ff-excel-header-extend":["show","disable"].includes(s||""),"ff-excel-header-hider":"hide"===s})}),e("div",{style:{height:`${P}px`},className:D("ff-excel-header-column-hider",{"ff-excel-header-extend":["show","disable"].includes(s||""),"ff-excel-header-hider":"hide"===s})}),"hide"!==s&&e("div",{className:"ff-excel-toolbar-container",children:e(Wy,{editable:c,toolbar:s,onBold:ke,onItalic:Ve,setUnderlineType:Se,setColor:Te,setBorderType:De,setFontSize:Oe,setFontFamily:Ne,setTextAlign:ze,setBackgroundColor:Ie,setFormatePainter:Ze})}),n("div",{ref:Ce,style:{height:h},className:D("ff-excel-spreadsheet",o),onKeyPress:be,onKeyDown:tt,onClick:nt,onMouseMove:it,onScroll:e=>ut(e),children:[gt,vt,e(Zy,{scrollPos:F}),e(Ry,{scrollPos:F})]})]}),[o,be,tt,it,gt,vt,j]);return e(my.Provider,{value:Y,children:At})}),Gy=({contextMenu:t,position:r,editable:i})=>{if(!t.open)return null;return i&&e("div",{onContextMenu:e=>{e.preventDefault(),e.stopPropagation()},className:"ff-excel-menu",style:{left:r.x,top:r.y,position:"absolute",zIndex:9999999999},children:t.options.map(t=>{if(!t.visible){const i=t.disable;return e(Y,{title:i?t.disableTooltip:"",children:n("div",{className:"ff-excel-menu-options "+(i?"disabled":""),onClick:()=>{i||t.action()},children:[t.iconName&&e(F,{name:t.iconName,height:16,width:16,color:(r=t.label,r.includes("Delete")?"var(--label-edit-error-text)":"var(--brand-color)"),disabled:i}),e(q,{as:"label",children:t.label})]})},t.label)}var r;return null})})},Yy=({excelData:r,contextOption:o,toolbar:s="show",sheetBar:d="show",rowCount:u=26,colCount:f=26,sheetHeight:h="100%",editable:C=!0,contextHeightPositioning:p=0,contextWidthPositioning:m=0,onSave:g=()=>Promise.resolve(),onSaveInfoChange:v,attachmentAction:A={addAttachment:()=>Promise.resolve(""),deleteAttachment:()=>Promise.resolve(""),viewAttachment:()=>Promise.resolve()},onSaveDelay:y=3e3,scroller:w=!1,columnContextEnable:b=!0,rowContextEnable:E=!0,sheetBarContextEnable:M=!0,minimumColumnWidth:x=100,disableDeleteOption:L=!1,maxRowLimit:H=1/0,maxColLimit:k=1/0,maxSheetLimit:V=1/0,getActiveCell:S=()=>{}})=>{const z=a(null),[O,N]=c([]),[T,I]=c(""),[Z,R]=i.useState({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",disable:!1,visible:!1}]}),[j,B]=c({name:"defaultSheet",index:0}),[P,_]=c({defaultSheet:[[AA]]}),[U,W]=c([[AA]]),[X,Q]=c((g.length,{})),[K,J]=c({x:0,y:0}),$=a(""),ee=a(null),te=a(null),ne=a(null);l(()=>{const e=r;if(e){const t=e.map(e=>e.sheetName);N(t),G(t.length)||($.current=t[0]||"",B({name:t[0]||"",index:0}));const n={},r={};e.forEach(e=>{const t=e.sheetName,i=e.data,o=Math.max(u,i.length),a=Math.max(f,Math.max(...i.map(e=>e.length)));let l=Array.from({length:o},()=>Array(a).fill({value:"",style:AA.style,readOnly:!1,inputType:void 0}));i.forEach((e,t)=>{e.forEach((e,n)=>{var r;t<o&&n<a&&(l[t]||(l[t]=[]),l[t][n]={value:(r=e.value,null==r?null:r),style:G(e?.style)?AA.style:Fy(e?.style,x),readOnly:!!e?.readOnly&&e?.readOnly,inputType:e?.inputType??void 0,contextDisable:e.contextDisable})})});const s=new Set([...e?.rows?.readOnly?e.rows.readOnly.map(e=>`r${e}`):[],...e?.columns?.readOnly?e.columns.readOnly.map(e=>`c${e}`):[],...e?.cells?.readOnly?e.cells.readOnly.map(([e,t])=>`${e},${t}`):[]]);if(l.forEach((t,n)=>{t.forEach((t,r)=>{l[n]||(l[n]=[]);const i=s.has(`r${n+1}`)||s.has(`c${r+1}`)||s.has(`${n+1},${r+1}`),o=((t,n,r)=>r?.inputType?r.inputType:e?.rows?.inputType?.[t+1]||e?.columns?.inputType?.[n+1]||e?.cells?.inputType?.[`${t+1},${n+1}`]||{type:"text"})(n,r,t||AA);l[n][r]={...t,value:t?.value??"",readOnly:t?.readOnly?t.readOnly:i,inputType:o,contextDisable:t?.contextDisable}})}),n[t]=l,g.length>1){const e=i[0]||[];r[t]=Array.from({length:a},(t,n)=>({newData:"",oldData:e[n]?.value||""}))}}),_(n),g.length>1&&Q(r);const i=Object.keys(n)[0];i&&void 0!==n[i]&&W(n[i])}},[r]),l(()=>{v&&v(T),"File saved"===T&&setTimeout(()=>{I("")},2e3)},[T]),l(()=>{I("Saving..."),re(oe())},[P,$.current]);const re=i.useCallback(Xs(e=>{if(g.length>1){const t={...X};O.forEach((n,r)=>{const i=(e[r].data[0]||[]).map(e=>e?.value||"");t[n]=(t[n]||[]).map((e,t)=>({...e,newData:i[t]||""}))}),Q(t);const n=O.map(e=>({sheetName:e,headers:t[e]||[]}));g(e,n)}else g(e);I("File saved")},y),[g,X,O]),ie=i.useCallback(e=>{e.ctrlKey&&"s"===e.key&&(e.preventDefault(),e.stopPropagation(),re(oe()))},[g]);i.useEffect(()=>(document.addEventListener("keydown",ie),()=>{document.removeEventListener("keydown",ie)}),[ie]);const oe=()=>O.map(e=>{const t=P[e]?.map(e=>{const t=e.reduce((e,t,n)=>""!==String(t?.value??"").trim()?n:e,-1),n=e.map((e,n)=>e&&e.style&&n<=t?{value:e.value,style:Uy(e.style,x),readOnly:e.readOnly,inputType:e.inputType,contextDisable:e.contextDisable}:null).filter(e=>null!==e);return n.length>0?n:[]})||[],n=t.filter((e,n)=>{const r=t.slice(n+1).some(e=>e.length>0);return e.length>0||r});return{sheetName:e,data:G(n.length)?[[]]:n}}),[ae,le]=c(null),se=()=>O.length>=V,ce=()=>{if(se())return;const e=((e,t)=>{const n=t.map(e=>e.toLowerCase());let r=`${e}1`,i=2;for(;n.includes(r.toLowerCase());)r=`${e}${i}`,i++;return r})("Sheet",O),t=Array.from({length:u},()=>Array.from({length:f},()=>AA));N(t=>[...t,e]),B({index:O?.length,name:e}),_({...P,[e]:t}),W(t),g.length>1&&Q(t=>({...t,[e]:Array.from({length:f},()=>({newData:"",oldData:""}))})),$.current=e},de=(e=[[AA]])=>{W(e)},ue=(e,t,n)=>{const r=e.target;if(!r||r?.textContent?.trim()===n?.trim())return void le(null);const i=(r.textContent||"").trim();if(!i)return oc.warning("Sheet name cannot be empty."),r.textContent=j.name,void le(null);if(i.length>50)return oc.warning("The sheet name cannot be greater than 50 characters"),r.textContent=j.name,void le(null);if(O.map(e=>e.toLowerCase()).includes(i.toLowerCase())&&n.trim()?.toLowerCase()!==i?.toLowerCase())return oc.warning("Sheet name already exists"),r.textContent=j.name,void le(null);let o=O;de(P?.[n]),o.splice(t,1,i);const a=function(e,t,n){if(!(t in e))throw new Error(`Key "${t}" not found in object`);const{[t]:r,...i}=e;return{...i,[n]:r??[]}}(P,n,i);$.current=i,B(e=>({...e,name:i})),_(a),g.length>1&&Q(e=>{const t={...e},r=t[n];return delete t[n],t[i]=r??[],t}),le(null)};const fe=(e,t)=>{e!==j.name&&t!==j.index&&(B({index:t,name:e}),N(n=>{const r=[...n];return r[t]=e,r}),de(P[e]),$.current=e)},he=i.useCallback((e,t=!1)=>{const n=e.target;(!n.closest(".ff-excel-tab-list")&&!n.closest(".ff-excel-sheet")||t)&&Z.open&&(R({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]}),t||(e.preventDefault(),e.stopPropagation()))},[Z.open]);i.useEffect(()=>(document.addEventListener("contextmenu",he),document.addEventListener("click",e=>he(e,!0)),()=>{document.removeEventListener("contextmenu",he),document.removeEventListener("click",e=>he(e,!0))}),[he]);const Ce=(e,t,n)=>{e.preventDefault();const r=[{label:"Add Sheet",value:"Add Sheet",iconName:"plus_icon",action:()=>ce(),disableTooltip:"Sheet limit reached",visible:!1,disable:se()},...L?[]:[{label:"Delete Sheet",value:"Delete Sheet",iconName:"delete",action:()=>((e,t)=>{if(O.length>1){let n=O.slice();n.splice(t,1);const r={...P};delete r[e];const i=Math.min(t,n.length-1);N(n),_(r),g.length>1&&Q(t=>{const n={...t};return delete n[e],n});const o=n[i]?n[i]:"";B({index:i,name:o}),de(r?.[o]),$.current=o}else oc.warning("Cannot delete the last sheet.")})(t,n),disableTooltip:"",visible:!1,disable:!1}]];R(e=>({...e,open:!0,contextType:"sheet",options:r}))};l(()=>{ne.current?.removeSelect()},[j.name]);return e(t,{children:O.length>0&&n("div",{ref:ee,className:"ff-excel",onContextMenu:e=>{e.preventDefault();const t=te.current?.parentElement?.getBoundingClientRect(),n=window.scrollX,r=window.scrollY;let i=e.clientX-(t?.left||0)+n,o=e.clientY-(t?.top||0)+r;const a=300,l=window.innerWidth,s=window.innerHeight,c=l-e.clientX,d=e.clientX,u=s-e.clientY,f=e.clientY;c<a&&d>=a?i=e.clientX-(t?.left||0)+n-150:i+=2,u<200&&f>=200?o=e.clientY-(t?.top||0)+r-20:o+=2,e.target.classList.contains("ff-excel-tab-list")?J({x:i,y:o-(L?32:65)}):(i+a>l&&(i=l-a-2),i<0&&(i=2),J({x:i+m,y:o+p}))},onClick:e=>{e.stopPropagation(),Z.open&&R({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]})},children:[e("div",{ref:te,className:"ff-excel-sheet",children:e(Qy,{ref:ne,editable:C,attachmentAction:A,toolbar:s,sheetHeight:h,setContextMenu:R,contextOption:o,data:U,columnContextEnable:b,rowContextEnable:E,minimumColumnWidth:x,onEvaluatedDataChange:e=>{_(t=>({...t,[$.current]:e}))},workRef:ee,scroller:w,maxRowLimit:H,maxColLimit:k,disableDeleteOption:L,contextMenu:Z,getActiveCell:S,onAddColumn:(e,t)=>{g.length>1&&Q(n=>{const r=j.name,i=[...n[r]||[]],o=t?e:e+1;return i.splice(o,0,{newData:"",oldData:""}),{...n,[r]:i}})},onDeleteColumn:e=>{g.length>1&&Q(t=>{const n=j.name,r=[...t[n]||[]];return r.splice(e,1),{...t,[n]:r}})}},j.name)}),"hide"!==d&&n("div",{className:"ff-excel-sheet-bar",children:["show"===d&&n("div",{className:"ff-excel-add-sheet-set",children:[e(Y,{title:se()?"Sheet limit reached":"Add Sheet",placement:"top",children:e(F,{disabled:!C||se(),className:"ff-excel-add-sheet-icon",hoverEffect:!0,onClick:ce,name:"plus_icon",height:20,width:20})}),e(To,{options:(t=>t.map((t,r)=>({label:n("div",{style:{display:"flex",gap:"8px"},children:[j?.name===t?e(F,{height:16,width:16,name:"tick"}):e("div",{style:{height:"16px",width:"24px"}}),e(Y,{title:Ln(t,20,"count")?t:"",children:e(q,{children:xn(t,20,"count")})})]}),name:r,value:t})))(O),targetRef:z,onOptionClick:e=>{const{value:t,name:n=""}=e;fe(t,parseInt(n))},dropdownPlacement:"top",iconName:"show_script",tooltipTitle:"All Sheets",tooltipPlacement:"top",dropdownHeight:215,selectedValue:j.name})]}),e("div",{className:"ff-excel-tab-container",children:O.map((t,n)=>e(q,{lineHeight:"16px",children:e("div",{onContextMenu:e=>{fe(t,n),M&&Ce(e,t,n)},className:D("ff-excel-tab-list",{active:t===j.name}),onClick:()=>{fe(t,n)},suppressContentEditableWarning:ae===n,onDoubleClick:e=>{"show"===d&&(le(n),null===ae&&setTimeout(()=>(e=>{const t=document.createRange(),n=window.getSelection();t.selectNodeContents(e),t.collapse(!1),n?.removeAllRanges(),n?.addRange(t)})(e.target),0))},contentEditable:C&&ae===n,onBlur:e=>{ue(e,n,t)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),ue(e,n,t))},children:t})},t))})]}),Z.open&&e(Gy,{contextMenu:Z,position:K,editable:C}),e(ic,{})]})})},Ky=({label:t="",isActive:n=!0,onClick:r=()=>{},isFilterChip:i=!1})=>{const o=i?"filter":"module";return e("div",{className:D("ff-module-chip",{"ff-filter-chip":i,[`ff-${o}-chip--active`]:n,[`ff-${o}-chip--hover`]:!n}),onClick:r,children:e(q,{lineHeight:"18px",className:"module-typography",children:t})})},Jy=({x:e,y:t,radius:n,startAngle:r,endAngle:i})=>{const o=e+n*Math.cos(r),a=t+n*Math.sin(r),l=e+n*Math.cos(i),s=t+n*Math.sin(i),c=i-r>Math.PI?1:0;return i-r>=2*Math.PI?`\n M ${e+n} ${t}\n A ${n} ${n} 0 1 1 ${e-n} ${t} \n A ${n} ${n} 0 1 1 ${e+n} ${t}\n `:`M ${o} ${a} A ${n} ${n} 0 ${c} 1 ${l} ${s}`},$y=({radius:t=15,lineWidth:r=5,label:i,percentageValue:o,icon:l,fontSize:s=10,labelColor:d="",arcColor:u="var(--brand-color)",backgroundArcColor:f="var(--ff-select-scroll-thumb-color)",isSelectedArch:h=!1,onSelect:C})=>{const[p,m]=c({x:0,y:0}),[g,v]=c(!1),A=a(null);let y=-Math.PI/2;const w=2*(t+r),{backgroundArcPath:b,foregroundArcPath:E}=((e,t,n)=>{const r=t,i=r+Math.max(0,Math.min(e,100))/100*2*Math.PI;return{backgroundArcPath:Jy({x:0,y:0,radius:n,startAngle:0,endAngle:2*Math.PI}),foregroundArcPath:Jy({x:0,y:0,radius:n,startAngle:r,endAngle:i})}})(o,y,t),M=()=>{v(!0)},x=()=>{m({x:0,y:0}),v(!1)},L=e=>{if(A.current){const t=A.current.getBoundingClientRect();m({x:e.clientX-t.left,y:e.clientY-t.top})}};return n("div",{ref:A,className:"ff-icon-radial-chart-container",style:{"--fontSize":`${s}px`},onClick:C,children:[e("svg",{width:w,height:w,viewBox:`0 0 ${w} ${w}`,role:"img",children:n("g",{transform:`translate(${t+r}, ${t+r})`,children:[e("path",{d:b,fill:"none",stroke:f,strokeWidth:r,onMouseEnter:M,onMouseLeave:x,onMouseMove:L}),e("path",{d:E,fill:"none",stroke:u,strokeWidth:r,onMouseEnter:M,onMouseLeave:x,onMouseMove:L}),h&&e("path",{d:E,fill:"none",stroke:"var(--dotted-border-color)",strokeOpacity:"0.4",strokeWidth:r,onMouseEnter:M,onMouseLeave:x,onMouseMove:L}),l?e("foreignObject",{x:"-10",y:"-10",width:"20",height:"20",children:e(F,{className:"ff-radial-chart-icon-padding",name:l,height:20,width:20})}):e("text",{x:"0",y:"0",fill:d||u,textAnchor:"middle",dominantBaseline:"central",children:`${Math.round(o)}%`})]})}),g&&n("div",{className:"ff-icon-radial-chart-tooltip",style:{position:"absolute",left:`${p.x+15}px`,top:p.y-5+"px"},children:[e(q,{children:`${i} : `}),n(q,{children:[o,"%"]})]})]})},ew=({mediaSrc:t,fileId:r,onExpandClick:i,onDeleteClick:o,onDownloadClick:a,height:l="75px",width:s="79px",fileName:c,thumbnailMediaSrc:d,isDelete:u})=>e("div",{className:"ff-attach-media-container",style:{height:l,width:s},children:n("div",{className:"ff-media-wrapper",style:{height:l,width:s},children:[e("img",{src:d||t,alt:"Attached"}),n("div",{className:"ff-hover-icons",children:[n("div",{className:"ff-top-icons",children:[e("div",{className:"ff-icon-container",children:e(Y,{title:"Download File",placement:"bottom",children:e(F,{name:"download_file_icon",height:10,width:10,onClick:a,color:"var(--icons-default-color)"})})}),u&&e("div",{className:"ff-icon-container",children:e(Y,{title:"Delete",placement:"bottom",children:e(F,{name:"delete",height:10,width:10,color:"var(--ff-delete-button-attachment)",onClick:()=>{o&&o(r)}})})})]}),e("div",{className:"ff-expand-icon-container",children:e(Y,{title:"Maximize",placement:"bottom",children:e(F,{name:"expand_icon",height:16,width:16,onClick:i})})})]}),e(q,{color:"var(--text-area-default-color)",fontWeight:"medium",className:"ff-media-text",children:c})]})}),tw=({icon:r,status:i,count:o,text:a,style:s={width:"196.4px"},resetToggle:d,onSelectedStatus:u=e=>{}})=>{const[f,h]=c(!1),C=["total defects","defect density","open defects","closed defects","quality score"],p=C.includes(i.toLowerCase()),m=C.includes(i.toLowerCase());l(()=>{h(!d)},[d]);return n("div",{className:`ff-card-container ${i.toLowerCase()} ${f?"toggled":""}`,style:s,onClick:()=>(e=>{C.includes(e.toLowerCase())||(h(!0),u(e))})(i),children:[n("div",{className:"ff-status-bar",children:[e("div",{children:e(F,{name:r,height:20,width:20,hoverEffect:!1})}),!C.includes(i.toLowerCase())&&e(q,{fontWeight:"semi-bold",fontSize:"10px",textAlign:"center",lineHeight:"15px",className:"ff-status-text",as:"div",children:i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()})]}),e("div",{className:"ff-content "+(m?"red-background":""),children:n(t,p?{children:[e(q,{fontWeight:"semi-bold",fontSize:"10px",className:"ff-text",lineHeight:"15px",color:"var(--ff-chip-text-color)",children:a}),e(q,{fontWeight:"semi-bold",fontSize:"24px",className:"ff-number",lineHeight:"36px",children:"defect density"===i.toLowerCase()?n(t,{children:[o.toString().padStart(2,"0"),e(q,{fontSize:"15px",fontWeight:"semi-bold",children:"/ Modules"})]}):"quality score"===i.toLowerCase()?`${parseFloat(o.toString()).toFixed(2)}%`:o.toString().padStart(2,"0")})]}:{children:[e(q,{fontWeight:"semi-bold",fontSize:"24px",className:"ff-number",lineHeight:"24px",color:f?"var(--base-bg-color)":"",children:o.toString().padStart(2,"0")}),e(q,{className:"ff-text",lineHeight:"18px",color:f?"var(--base-bg-color)":"var(--ff-chip-text-color)",children:a})]})})]})},nw=({option:t})=>{const r=a(null),[i,o]=c(!1);l(()=>{const e=r.current;if(!e)return;const t=()=>{o(e.scrollWidth>e.clientWidth)},n=requestAnimationFrame(t);return window.addEventListener("resize",t),()=>{cancelAnimationFrame(n),window.removeEventListener("resize",t)}},[t]);const s={LOCAL:"local_variable_icon",GLOBAL:"global_variable_icon",PROJECT_ENVIRONMENT:"project_env_variable_icon"},d=e=>"_startforloop"===e?.type?`FLV_for:${e?.name}`:"DATAPROVIDER"===e?.type?`${e?.dpName}:${e?.varname}`:e?.name;return n("div",{style:{width:"-webkit-fill-available"},className:"ff-variable-option ff-variable-data",children:[e(Y,{title:i?d(t):"",style:{width:"calc(100% - 32px)"},children:e("span",{ref:r,className:"ff-truncated_text",children:d(t)})}),e(F,{name:(e=>{if(!e)return"";const t=e._id||e.id;return t?.startsWith("PARAMETER")?"step_group_parameter":"LOCAL"===e.type&&"STEPGROUP"===e?.parentVariableType?"step_group_variable":"_startforloop"===e.type?"for_loop_variable":"DATAPROVIDER"===e.type?"data_provider_variable":s[e.type||""]||""})(t),height:24,width:24,hoverEffect:!0})]})};function rw(e){return()=>e}function iw(e){e()}function ow(e,t){return n=>e(t(n))}function aw(e,t){return()=>e(t)}function lw(e){return void 0!==e}function sw(){}function cw(e,t){return t(e),e}function dw(e,t){return t(e)}function uw(...e){return e}function fw(e,t){return e(1,t)}function hw(e,t){e(0,t)}function Cw(e){e(2)}function pw(e){return e(4)}function mw(e,t){return fw(e,function(e,t){return n=>e(t,n)}(t,0))}function gw(e,t){const n=e(1,e=>{n(),t(e)});return n}function vw(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function Aw(e,t){return e===t}function yw(e=Aw){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function ww(e){return t=>n=>{e(n)&&t(n)}}function bw(e){return t=>ow(t,e)}function Ew(e){return t=>()=>{t(e)}}function Mw(e,...t){const n=function(...e){return t=>e.reduceRight(dw,t)}(...t);return(t,r)=>{switch(t){case 2:return void Cw(e);case 1:return fw(e,n(r))}}}function xw(e,t){return n=>r=>{n(t=e(t,r))}}function Lw(e){return t=>n=>{e>0?e--:t(n)}}function Hw(e){let t,n=null;return r=>i=>{n=i,!t&&(t=setTimeout(()=>{t=void 0,r(n)},e))}}function kw(...e){const t=new Array(e.length);let n=0,r=null;const i=2**e.length-1;return e.forEach((e,o)=>{const a=2**o;fw(e,e=>{const l=n;n|=a,t[o]=e,l!==i&&n===i&&r&&(r(),r=null)})}),e=>o=>{const a=()=>{e([o].concat(t))};n===i?a():r=a}}function Vw(e){let t=e;const n=zw();return(e,r)=>{switch(e){case 0:t=r;break;case 1:r(t);break;case 4:return t}return n(e,r)}}function Sw(e,t){return cw(Vw(t),t=>mw(e,t))}function zw(){const e=[];return(t,n)=>{switch(t){case 0:return void e.slice().forEach(e=>{e(n)});case 2:return void e.splice(0,e.length);case 1:return e.push(n),()=>{const t=e.indexOf(n);t>-1&&e.splice(t,1)}}}}function Ow(e){return cw(zw(),t=>mw(e,t))}function Nw(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:Dw(),singleton:n}}const Dw=()=>Symbol();function Tw(...e){const t=zw(),n=new Array(e.length);let r=0;const i=2**e.length-1;return e.forEach((e,o)=>{const a=2**o;fw(e,e=>{n[o]=e,r|=a,r===i&&hw(t,n)})}),function(e,o){switch(e){case 2:return void Cw(t);case 1:return r===i&&o(n),fw(t,o)}}}function Iw(e,t=Aw){return Mw(e,yw(t))}function Zw(...e){return function(t,n){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(iw)}}(...e.map(e=>fw(e,n)))}}}const Rw=0,jw=1,Bw=2,Pw=3,_w={[Rw]:"debug",[Pw]:"error",[jw]:"log",[Bw]:"warn"},Fw=Nw(()=>{const e=Vw(Pw);return{log:Vw((t,n,r=jw)=>{r>=((typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL??pw(e))&&console[_w[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0}),qw=new WeakMap;function Uw(e){return"self"in e?e.document.documentElement:e}function Ww(e){qw.delete(Uw(e))}function Xw(e,t){return function(e){const t=Uw(e),n=qw.get(t);if(void 0!==n)return n;const r="rtl"===t.ownerDocument.defaultView.getComputedStyle(t).direction;return qw.set(t,r),r}(e)?-t:t}const Qw=Xw;function Gw(e,t){return Xw(e,t)}function Yw(e,t,n){return Kw(e,t,n).callbackRef}function Kw(e,t,n){const r=i.useRef(null);let o=e=>{};const a=i.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(t=>{const r=()=>{const n=t[0].target;null!==n.offsetParent&&e(n)};n?r():requestAnimationFrame(r)}):null,[e,n]);return o=e=>{e&&t?(a?.observe(e),r.current=e):(r.current&&a?.unobserve(r.current),r.current=null)},{callbackRef:o,ref:r}}function Jw(e,t,n,r,o,a,l,s,c){const d=i.useCallback(n=>{const i=function(e,t,n,r){const i=e.length;if(0===i)return null;const o=[];for(let a=0;a<i;a++){const i=e.item(a);if(void 0===i.dataset.index)continue;const l=parseInt(i.dataset.index),s=parseFloat(i.dataset.knownSize),c=t(i,n);if(0===c&&r("Zero-sized element, this should not happen",{child:i},Pw),c===s)continue;const d=o[o.length-1];0===o.length||d.size!==c||d.endIndex!==l-1?o.push({endIndex:l,size:c,startIndex:l}):o[o.length-1].endIndex++}return o}(n.children,t,s?"offsetWidth":"offsetHeight",o);let c=n.parentElement;for(;void 0===c.dataset.virtuosoScroller;)c=c.parentElement;const d="window"===c.lastElementChild.dataset.viewportType;let u;d&&(u=c.ownerDocument.defaultView);const f=l?s?l.scrollWidth:l.scrollHeight:d?s?u.document.documentElement.scrollWidth:u.document.documentElement.scrollHeight:s?c.scrollWidth:c.scrollHeight,h=l?s?l.offsetWidth:l.offsetHeight:d?s?u.innerWidth:u.innerHeight:s?c.offsetWidth:c.offsetHeight,C=l?s?Qw(l,l.scrollLeft):l.scrollTop:d?s?Qw(u,u.scrollX||u.document.documentElement.scrollLeft):u.scrollY||u.document.documentElement.scrollTop:s?Qw(c,c.scrollLeft):c.scrollTop;r({scrollHeight:f,scrollTop:Math.max(C,0),viewportHeight:h}),a?.(s?$w("column-gap",getComputedStyle(n).columnGap,o):$w("row-gap",getComputedStyle(n).rowGap,o)),null!==i&&e(i)},[e,t,o,a,l,r,s]);return Kw(d,n,c)}function $w(e,t,n){return"normal"!==t&&!0!==t?.endsWith("px")&&n(`${e} was not resolved to pixel value correctly`,t,Bw),"normal"===t?0:parseInt(t??"0",10)}function eb(e,t,n){const r=i.useRef(null),o=i.useCallback(n=>{if(!n?.offsetParent)return;const i=n.getBoundingClientRect(),o=i.width;let a,s;if(t){const e=t.getBoundingClientRect(),n=i.top-e.top;s=e.height-Math.max(0,n),a=n+t.scrollTop}else{const e=l.current.ownerDocument.defaultView;s=e.innerHeight-Math.max(0,i.top),a=i.top+e.scrollY}r.current={listHeight:i.height,offsetTop:a,visibleHeight:s,visibleWidth:o},e(r.current)},[e,t]),{callbackRef:a,ref:l}=Kw(o,!0,n),s=i.useCallback(()=>{o(l.current)},[o,l]);return i.useEffect(()=>{if(t){t.addEventListener("scroll",s);const e=new ResizeObserver(()=>{requestAnimationFrame(s)});return e.observe(t),()=>{t.removeEventListener("scroll",s),e.unobserve(t)}}const e=l.current?.ownerDocument.defaultView;return e?.addEventListener("scroll",s),e?.addEventListener("resize",s),()=>{e?.removeEventListener("scroll",s),e?.removeEventListener("resize",s)}},[s,t,l]),a}const tb=Nw(()=>{const e=zw(),t=zw(),n=Vw(0),r=zw(),i=Vw(0),o=zw(),a=zw(),l=Vw(0),s=Vw(0),c=Vw(0),d=Vw(0),u=zw(),f=zw(),h=Vw(!1),C=Vw(!1),p=Vw(!1);return mw(Mw(e,bw(({scrollTop:e})=>e)),t),mw(Mw(e,bw(({scrollHeight:e})=>e)),a),mw(t,i),{deviation:n,fixedFooterHeight:c,fixedHeaderHeight:s,footerHeight:d,headerHeight:l,horizontalDirection:C,scrollBy:f,scrollContainerState:e,scrollHeight:a,scrollingInProgress:h,scrollTo:u,scrollTop:t,skipAnimationFrameInResizeObserver:p,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:o}},[],{singleton:!0}),nb={lvl:0};function rb(e,t){const n=e.length;if(0===n)return[];let{index:r,value:i}=t(e[0]);const o=[];for(let a=1;a<n;a++){const{index:n,value:l}=t(e[a]);o.push({end:n-1,start:r,value:i}),r=n,i=l}return o.push({end:1/0,start:r,value:i}),o}function ib(e){return e===nb}function ob(e,t){if(!ib(e))return t===e.k?e.v:t<e.k?ob(e.l,t):ob(e.r,t)}function ab(e,t,n="k"){if(ib(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=ab(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return ab(e.l,t,n)}function lb(e,t,n){return ib(e)?vb(t,n,1):t===e.k?Cb(e,{k:t,v:n}):t<e.k?Ab(Cb(e,{l:lb(e.l,t,n)})):Ab(Cb(e,{r:lb(e.r,t,n)}))}function sb(){return nb}function cb(e,t,n){if(ib(e))return[];return function(e){return rb(e,({k:e,v:t})=>({index:e,value:t}))}(fb(e,ab(e,t)[0],n))}function db(e,t){if(ib(e))return nb;const{k:n,l:r,r:i}=e;if(t===n){if(ib(r))return i;if(ib(i))return r;const[t,n]=gb(r);return hb(Cb(e,{k:t,l:pb(r),v:n}))}return hb(Cb(e,t<n?{l:db(r,t)}:{r:db(i,t)}))}function ub(e){return ib(e)?[]:[...ub(e.l),{k:e.k,v:e.v},...ub(e.r)]}function fb(e,t,n){if(ib(e))return[];const{k:r,l:i,r:o,v:a}=e;let l=[];return r>t&&(l=l.concat(fb(i,t,n))),r>=t&&r<=n&&l.push({k:r,v:a}),r<=n&&(l=l.concat(fb(o,t,n))),l}function hb(e){const{l:t,lvl:n,r:r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(mb(t))return yb(Cb(e,{lvl:n-1}));if(!ib(t)&&!ib(t.r))return Cb(t.r,{l:Cb(t,{r:t.r.l}),lvl:n,r:Cb(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(mb(e))return wb(Cb(e,{lvl:n-1}));if(!ib(r)&&!ib(r.l)){const t=r.l,i=mb(t)?r.lvl-1:r.lvl;return Cb(t,{l:Cb(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:wb(Cb(r,{l:t.r,lvl:i}))})}throw new Error("Unexpected empty nodes")}function Cb(e,t){return vb(void 0!==t.k?t.k:e.k,void 0!==t.v?t.v:e.v,void 0!==t.lvl?t.lvl:e.lvl,void 0!==t.l?t.l:e.l,void 0!==t.r?t.r:e.r)}function pb(e){return ib(e.r)?e.l:hb(Cb(e,{r:pb(e.r)}))}function mb(e){return ib(e)||e.lvl>e.r.lvl}function gb(e){return ib(e.r)?[e.k,e.v]:gb(e.r)}function vb(e,t,n,r=nb,i=nb){return{k:e,l:r,lvl:n,r:i,v:t}}function Ab(e){return wb(yb(e))}function yb(e){const{l:t}=e;return ib(t)||t.lvl!==e.lvl?e:Cb(t,{r:Cb(e,{l:t.r})})}function wb(e){const{lvl:t,r:n}=e;return ib(n)||ib(n.r)||n.lvl!==t||n.r.lvl!==t?e:Cb(n,{l:Cb(e,{r:n.l}),lvl:t+1})}function bb(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}function Eb(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}const Mb=Nw(()=>({recalcInProgress:Vw(!1)}),[],{singleton:!0});function xb(e,t,n){return e[Lb(e,t,n)]}function Lb(e,t,n,r=0){let i=e.length-1;for(;r<=i;){const o=Math.floor((r+i)/2),a=n(e[o],t);if(0===a)return o;if(-1===a){if(i-r<2)return o-1;i=o-1}else{if(i===r)return o;r=o+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function Hb(e,t){return Math.round(e.getBoundingClientRect()[t])}function kb(e){return!ib(e.groupOffsetTree)}function Vb({index:e},t){return t===e?0:t<e?-1:1}function Sb({offset:e},t){return t===e?0:t<e?-1:1}function zb(e,t,n){if(0===t.length)return 0;const{index:r,offset:i,size:o}=xb(t,e,Vb),a=e-r,l=o*a+(a-1)*n+i;return l>0?l+n:l}function Ob(e,t){if(!kb(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function Nb(e,t,n){if(function(e){return typeof e.groupIndex<"u"}(e))return t.groupIndices[e.groupIndex]+1;let r=Ob("LAST"===e.index?n:e.index,t);return r=Math.max(0,r,Math.min(n,r)),r}function Db(e,t,n,r=0){return r>0&&(t=Math.max(t,xb(e,r,Vb).offset)),rb(function(e,t,n,r){const i=Lb(e,t,r),o=Lb(e,n,r,i);return e.slice(i,o+1)}(e,t,n,Sb),Rb)}function Tb(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,Rw);const o=e.sizeTree;let a=o,l=0;if(n.length>0&&ib(o)&&2===t.length){const e=t[0].size,r=t[1].size;a=n.reduce((t,n)=>lb(lb(t,n,e),n+1,r),a)}else[a,l]=function(e,t){let n=ib(e)?0:1/0;for(const r of t){const{endIndex:t,size:i,startIndex:o}=r;if(n=Math.min(n,o),ib(e)){e=lb(e,0,i);continue}const a=cb(e,o-1,t+1);if(a.some(jb(r)))continue;let l=!1,s=!1;for(const{end:n,start:r,value:o}of a)l?(t>=r||i===o)&&(e=db(e,r)):(s=o!==i,l=!0),n>t&&t>=r&&o!==i&&(e=lb(e,t+1,o));s&&(e=lb(e,o,i))}return[e,n]}(a,t);if(a===o)return e;const{lastIndex:s,lastOffset:c,lastSize:d,offsetTree:u}=Zb(e.offsetTree,l,a,i);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>lb(e,t,zb(t,u,i)),sb()),lastIndex:s,lastOffset:c,lastSize:d,offsetTree:u,sizeTree:a}}function Ib(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function Zb(e,t,n,r){let i=e,o=0,a=0,l=0,s=0;if(0!==t){s=Lb(i,t-1,Vb),l=i[s].offset;const e=ab(n,t-1);o=e[0],a=e[1],i.length&&i[s].size===ab(n,t)[1]&&(s-=1),i=i.slice(0,s+1)}else i=[];for(const{start:e,value:s}of cb(n,t,1/0)){const t=e-o,n=t*a+l+t*r;i.push({index:e,offset:n,size:s}),o=e,l=n,a=s}return{lastIndex:o,lastOffset:l,lastSize:a,offsetTree:i}}function Rb(e){return{index:e.index,value:e}}function jb(e){const{endIndex:t,size:n,startIndex:r}=e;return e=>e.start===r&&(e.end===t||e.end===1/0)&&e.value===n}const Bb={offsetHeight:"height",offsetWidth:"width"},Pb=Nw(([{log:e},{recalcInProgress:t}])=>{const n=zw(),r=zw(),i=Sw(r,0),o=zw(),a=zw(),l=Vw(0),s=Vw([]),c=Vw(void 0),d=Vw(void 0),u=Vw(void 0),f=Vw(void 0),h=Vw((e,t)=>Hb(e,Bb[t])),C=Vw(void 0),p=Vw(0),m={groupIndices:[],groupOffsetTree:sb(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:sb()},g=Sw(Mw(n,kw(s,e,p),xw(Tb,m),yw()),m),v=Sw(Mw(s,yw(),xw((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),bw(({prev:e})=>e)),[]);mw(Mw(s,ww(e=>e.length>0),kw(g,p),bw(([e,t,n])=>{const r=e.reduce((e,r,i)=>lb(e,r,zb(r,t.offsetTree,n)||i),sb());return{...t,groupIndices:e,groupOffsetTree:r}})),g),mw(Mw(r,kw(g),ww(([e,{lastIndex:t}])=>e<t),bw(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),mw(c,d);const A=Sw(Mw(c,bw(e=>void 0===e)),!0);mw(Mw(d,ww(e=>void 0!==e&&ib(pw(g).sizeTree)),bw(e=>{const t=pw(u),n=pw(s).length>0;return void 0!==t&&0!==t?n?[{endIndex:0,size:t,startIndex:0},{endIndex:1,size:e,startIndex:1}]:[]:[{endIndex:0,size:e,startIndex:0}]})),n),mw(Mw(f,ww(e=>void 0!==e&&e.length>0&&ib(pw(g).sizeTree)),bw(e=>{const t=[];let n=e[0],r=0;for(let i=1;i<e.length;i++){const o=e[i];o!==n&&(t.push({endIndex:i-1,size:n,startIndex:r}),n=o,r=i)}return t.push({endIndex:e.length-1,size:n,startIndex:r}),t})),n),mw(Mw(s,kw(u,d),ww(([,e,t])=>void 0!==e&&void 0!==t),bw(([e,t,n])=>{const r=[];for(let i=0;i<e.length;i++){const o=e[i],a=e[i+1];r.push({startIndex:o,endIndex:o,size:t}),void 0!==a&&r.push({startIndex:o+1,endIndex:a-1,size:n})}return r})),n);const y=Ow(Mw(n,kw(g),xw(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:m}),bw(e=>e.changed)));fw(Mw(l,xw((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),bw(e=>e.diff)),e=>{const{groupIndices:n}=pw(g);if(e>0)hw(t,!0),hw(o,e+Ib(e,n));else if(e<0){const t=pw(v);t.length>0&&(e-=Ib(-e,t)),hw(a,e)}}),fw(Mw(l,kw(e)),([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:l},Pw)});const w=Ow(o);mw(Mw(o,kw(g),bw(([e,t])=>{const n=t.groupIndices.length>0,r=[],i=t.lastSize;if(n){const n=ob(t.sizeTree,0);let o=0,a=0;for(;o<e;){const e=t.groupIndices[a],l=t.groupIndices.length===a+1?1/0:t.groupIndices[a+1]-e-1;r.push({endIndex:e,size:n,startIndex:e}),r.push({endIndex:e+1+l-1,size:i,startIndex:e+1}),a++,o+=l+1}const l=ub(t.sizeTree);return o!==e&&l.shift(),l.reduce((t,{k:n,v:r})=>{let i=t.ranges;return 0!==t.prevSize&&(i=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:r,ranges:i}},{prevIndex:e,prevSize:0,ranges:r}).ranges}return ub(t.sizeTree).reduce((t,{k:n,v:r})=>({prevIndex:n+e,prevSize:r,ranges:[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]}),{prevIndex:0,prevSize:i,ranges:[]}).ranges})),n);const b=Ow(Mw(a,kw(g,p),bw(([e,{offsetTree:t},n])=>zb(-e,t,n))));return mw(Mw(a,kw(g,p),bw(([e,t,n])=>{if(t.groupIndices.length>0){if(ib(t.sizeTree))return t;let r=sb();const i=pw(v);let o=0,a=0,l=0;for(;o<-e;){l=i[a];const e=i[a+1]-l-1;a++,o+=e+1}if(r=ub(t.sizeTree).reduce((t,{k:n,v:r})=>lb(t,Math.max(0,n+e),r),r),o!==-e){r=lb(r,0,ob(t.sizeTree,l));r=lb(r,1,ab(t.sizeTree,1-e)[1])}return{...t,sizeTree:r,...Zb(t.offsetTree,0,r,n)}}const r=ub(t.sizeTree).reduce((t,{k:n,v:r})=>lb(t,Math.max(0,n+e),r),sb());return{...t,sizeTree:r,...Zb(t.offsetTree,0,r,n)}})),g),{beforeUnshiftWith:w,data:C,defaultItemSize:d,firstItemIndex:l,fixedItemSize:c,fixedGroupSize:u,gap:p,groupIndices:s,heightEstimates:f,itemSize:h,listRefresh:y,shiftWith:a,shiftWithOffset:b,sizeRanges:n,sizes:g,statefulTotalCount:i,totalCount:r,trackItemSizes:A,unshiftWith:o}},uw(Fw,Mb),{singleton:!0});function _b(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}const Fb=Nw(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:i}])=>{const o=zw(),a=zw(),l=Ow(Mw(o,bw(_b)));return mw(Mw(l,bw(e=>e.totalCount)),n),mw(Mw(l,bw(e=>e.groupIndices)),e),mw(Mw(Tw(i,t,r),ww(([e,t])=>kb(t)),bw(([e,t,n])=>ab(t.groupOffsetTree,Math.max(e-n,0),"v")[0]),yw(),bw(e=>[e])),a),{groupCounts:o,topItemsIndexes:a}},uw(Pb,tb)),qb=Nw(([{log:e}])=>{const t=Vw(!1),n=Ow(Mw(t,ww(e=>e),yw()));return fw(t,t=>{t&&pw(e)("props updated",{},Rw)}),{didMount:n,propsReady:t}},uw(Fw),{singleton:!0}),Ub=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Wb(e){const t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!Ub)&&(t.behavior="auto"),void 0===t.offset&&(t.offset=0),t}const Xb=Nw(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:o,footerHeight:a,headerHeight:l,scrollingInProgress:s,scrollTo:c,smoothScrollTargetReached:d,viewportHeight:u},{log:f}])=>{const h=zw(),C=zw(),p=Vw(0);let m=null,g=null,v=null;function A(){null!==m&&(m(),m=null),null!==v&&(v(),v=null),g&&(clearTimeout(g),g=null),hw(s,!1)}return mw(Mw(h,kw(n,u,r,p,l,a,f),kw(e,o,i),bw(([[e,n,r,i,o,a,l,c],u,f,p])=>{const y=Wb(e),{align:w,behavior:b,offset:E}=y,M=i-1,x=Nb(y,n,M);let L=zb(x,n.offsetTree,u)+a;"end"===w?(L+=f+ab(n.sizeTree,x)[1]-r+p,x===M&&(L+=l)):"center"===w?L+=(f+ab(n.sizeTree,x)[1]-r+p)/2:L-=o,void 0!==E&&0!==E&&(L+=E);const H=t=>{A(),t?(c("retrying to scroll to",{location:e},Rw),hw(h,e)):(hw(C,!0),c("list did not change, scroll successful",{},Rw))};if(A(),"smooth"===b){let e=!1;v=fw(t,t=>{e=e||t}),m=gw(d,()=>{H(e)})}else m=gw(Mw(t,function(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return e=>{e&&(t(!0),clearTimeout(n))}}}(150)),H);return g=setTimeout(()=>{A()},1200),hw(s,!0),c("scrolling from index to",{behavior:b,index:x,top:L},Rw),{behavior:b,top:L}})),c),{scrollTargetReached:C,scrollToIndex:h,topListHeight:p}},uw(Pb,tb,Fw),{singleton:!0});function Qb(e,t){0===e?t():requestAnimationFrame(()=>{Qb(e-1,t)})}function Gb(e,t){const n=t-1;return"number"==typeof e?e:"LAST"===e.index?n:e.index}const Yb=Nw(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:o},{didMount:a}])=>{const l=Vw(!0),s=Vw(0),c=Vw(!0);return mw(Mw(a,kw(s),ww(([e,t])=>0!==t),Ew(!1)),l),mw(Mw(a,kw(s),ww(([e,t])=>0!==t),Ew(!1)),c),fw(Mw(Tw(t,a),kw(l,n,e,c),ww(([[,e],t,{sizeTree:n},r,i])=>e&&(!ib(n)||lw(r))&&!t&&!i),kw(s)),([,e])=>{gw(i,()=>{hw(c,!0)}),Qb(4,()=>{gw(r,()=>{hw(l,!0)}),hw(o,e)})}),{initialItemFinalLocationReached:c,initialTopMostItemIndex:s,scrolledToInitialItem:l}},uw(Pb,tb,Xb,qb),{singleton:!0});function Kb(e,t){return Math.abs(e-t)<1.01}const Jb="up",$b="down",eE={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},tE=Nw(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:o}])=>{const a=Vw(!1),l=Vw(!0),s=zw(),c=zw(),d=Vw(4),u=Vw(0),f=Sw(Mw(Zw(Mw(Iw(i),Lw(1),Ew(!0)),Mw(Iw(i),Lw(1),Ew(!1),vw(100))),yw()),!1),h=Sw(Mw(Zw(Mw(n,Ew(!0)),Mw(n,Ew(!1),vw(200))),yw()),!1);mw(Mw(Tw(Iw(i),Iw(u)),bw(([e,t])=>e<=t),yw()),l),mw(Mw(l,Hw(50)),c);const C=Ow(Mw(Tw(r,Iw(o),Iw(t),Iw(e),Iw(d)),xw((e,[{scrollHeight:t,scrollTop:n},r,i,o,a])=>{const l={scrollHeight:t,scrollTop:n,viewportHeight:r};if(n+r-t>-a){let t,r;return n>e.state.scrollTop?(t="SCROLLED_DOWN",r=e.state.scrollTop-n):(t="SIZE_DECREASED",r=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:l}}let s;return s=l.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":r<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":n<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:s,state:l}},eE),yw((e,t)=>void 0!==e&&e.atBottom===t.atBottom))),p=Sw(Mw(r,xw((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(!Kb(e.scrollHeight,t)){const i=t-(n+r)<1;return e.scrollTop!==n&&i?{changed:!0,jump:e.scrollTop-n,scrollHeight:t,scrollTop:n}:{changed:!0,jump:0,scrollHeight:t,scrollTop:n}}return{changed:!1,jump:0,scrollHeight:t,scrollTop:n}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),ww(e=>e.changed),bw(e=>e.jump)),0);mw(Mw(C,bw(e=>e.atBottom)),a),mw(Mw(a,Hw(50)),s);const m=Vw($b);mw(Mw(r,bw(({scrollTop:e})=>e),yw(),xw((e,t)=>pw(h)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?Jb:$b,prevScrollTop:t},{direction:$b,prevScrollTop:0}),bw(e=>e.direction)),m),mw(Mw(r,Hw(50),Ew("none")),m);const g=Vw(0);return mw(Mw(f,ww(e=>!e),Ew(0)),g),mw(Mw(i,Hw(100),kw(f),ww(([e,t])=>t),xw(([e,t],[n])=>[t,n],[0,0]),bw(([e,t])=>t-e)),g),{atBottomState:C,atBottomStateChange:s,atBottomThreshold:d,atTopStateChange:c,atTopThreshold:u,isAtBottom:a,isAtTop:l,isScrolling:f,lastJumpDueToItemResize:p,scrollDirection:m,scrollVelocity:g}},uw(tb)),nE="top",rE="bottom",iE="none";function oE(e,t,n){return"number"==typeof e?n===Jb&&t===nE||n===$b&&t===rE?e:0:n===Jb?t===nE?e.main:e.reverse:t===rE?e.main:e.reverse}function aE(e,t){return"number"==typeof e?e:e[t]??0}const lE=Nw(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{const o=zw(),a=Vw(0),l=Vw(0),s=Vw(0);return{increaseViewportBy:l,listBoundary:o,overscan:s,topListHeight:a,visibleRange:Sw(Mw(Tw(Iw(r),Iw(i),Iw(n),Iw(o,Eb),Iw(s),Iw(a),Iw(t),Iw(e),Iw(l)),bw(([e,t,n,[r,i],o,a,l,s,c])=>{const d=e-s,u=a+l,f=Math.max(n-d,0);let h=iE;const C=aE(c,nE),p=aE(c,rE);return r-=s,i+=n+l,(r+=n+l)>e+u-C&&(h=Jb),(i-=s)<e-f+t+p&&(h=$b),h!==iE?[Math.max(d-n-oE(o,nE,h)-C,0),d-f-l+t+oE(o,rE,h)+p]:null}),ww(e=>null!==e),yw(Eb)),[0,0])}},uw(tb),{singleton:!0});const sE={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function cE(e,t,n,r,i,o){const{lastIndex:a,lastOffset:l,lastSize:s}=i;let c=0,d=0;if(e.length>0){c=e[0].offset;const t=e[e.length-1];d=t.offset+t.size}const u=n-a,f=c,h=l+u*s+(u-1)*r-d;return{bottom:d,firstItemIndex:o,items:uE(e,i,o),offsetBottom:h,offsetTop:c,top:f,topItems:uE(t,i,o),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function dE(e,t,n,r,i,o){let a=0;if(n.groupIndices.length>0)for(const t of n.groupIndices){if(t-a>=e)break;a++}const l=e+a,s=Gb(t,l);return cE(Array.from({length:l}).map((e,t)=>({data:o[t+s],index:t+s,offset:0,size:0})),[],l,i,n,r)}function uE(e,t,n){if(0===e.length)return[];if(!kb(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));const r=e[0].index,i=e[e.length-1].index,o=[],a=cb(t.groupOffsetTree,r,i);let l,s=0;for(const r of e){let e;(!l||l.end<r.index)&&(l=a.shift(),s=t.groupIndices.indexOf(l.start)),e=r.index===l.start?{index:s,type:"group"}:{groupIndex:s,index:r.index-(s+1)+n},o.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return o}function fE(e,t){return void 0===e?0:"number"==typeof e?e:e[t]??0}const hE=Nw(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:i},o,{listBoundary:a,topListHeight:l,visibleRange:s},{initialTopMostItemIndex:c,scrolledToInitialItem:d},{topListHeight:u},f,{didMount:h},{recalcInProgress:C}])=>{const p=Vw([]),m=Vw(0),g=zw(),v=Vw(0);mw(o.topItemsIndexes,p);const A=Sw(Mw(Tw(h,C,Iw(s,Eb),Iw(i),Iw(r),Iw(c),d,Iw(p),Iw(t),Iw(n),Iw(v),e),ww(([e,t,,n,,,,,,,,r])=>{const i=void 0!==r&&r.length!==n;return e&&!t&&!i}),bw(([,,[e,t],n,r,i,o,a,l,s,c,d])=>{const u=r,{offsetTree:f,sizeTree:h}=u,C=pw(m);if(0===n)return{...sE,totalCount:n};if(0===e&&0===t)return 0===C?{...sE,totalCount:n}:dE(C,i,r,l,s,d||[]);if(ib(h))return C>0?null:cE(function(e,t,n){if(kb(t)){const r=Ob(e,t);return[{index:ab(t.groupOffsetTree,r)[0],offset:0,size:0},{data:n?.[0],index:r,offset:0,size:0}]}return[{data:n?.[0],index:e,offset:0,size:0}]}(Gb(i,n),u,d),[],n,s,u,l);const p=[];if(a.length>0){const e=a[0],t=a[a.length-1];let n=0;for(const r of cb(h,e,t)){const i=r.value,o=Math.max(r.start,e),a=Math.min(r.end,t);for(let e=o;e<=a;e++)p.push({data:d?.[e],index:e,offset:n,size:i}),n+=i}}if(!o)return cE([],p,n,s,u,l);const g=a.length>0?a[a.length-1]+1:0,v=Db(f,e,t,g);if(0===v.length)return null;const A=n-1,y=cw([],n=>{for(const r of v){const i=r.value;let o=i.offset,a=r.start;const l=i.size;if(i.offset<e){a+=Math.floor((e-i.offset+s)/(l+s));const t=a-r.start;o+=t*l+t*s}a<g&&(o+=(g-a)*l,a=g);const c=Math.min(r.end,A);for(let e=a;e<=c&&!(o>=t);e++)n.push({data:d?.[e],index:e,offset:o,size:l}),o+=l+s}}),w=fE(c,nE),b=fE(c,rE);if(y.length>0&&(w>0||b>0)){const e=y[0],t=y[y.length-1];if(w>0&&e.index>g){const t=Math.min(w,e.index-g),n=[];let r=e.offset;for(let i=e.index-1;i>=e.index-t;i--){const t=cb(h,i,i)[0]?.value??e.size;r-=t+s,n.unshift({data:d?.[i],index:i,offset:r,size:t})}y.unshift(...n)}if(b>0&&t.index<A){const e=Math.min(b,A-t.index);let n=t.offset+t.size+s;for(let r=t.index+1;r<=t.index+e;r++){const e=cb(h,r,r)[0]?.value??t.size;y.push({data:d?.[r],index:r,offset:n,size:e}),n+=e+s}}}return cE(y,p,n,s,u,l)}),ww(e=>null!==e),yw()),sE);mw(Mw(e,ww(lw),bw(e=>e?.length)),i),mw(Mw(A,bw(e=>e.topListHeight)),u),mw(u,l),mw(Mw(A,bw(e=>[e.top,e.bottom])),a),mw(Mw(A,bw(e=>e.items)),g);const y=Ow(Mw(A,ww(({items:e})=>e.length>0),kw(i,e),ww(([{items:e},t])=>e[e.length-1].originalIndex===t-1),bw(([,e,t])=>[e-1,t]),yw(Eb),bw(([e])=>e))),w=Ow(Mw(A,Hw(200),ww(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),bw(({items:e})=>e[0].index),yw())),b=Ow(Mw(A,ww(({items:e})=>e.length>0),bw(({items:e})=>{let t=0,n=e.length-1;for(;"group"===e[t].type&&t<n;)t++;for(;"group"===e[n].type&&n>t;)n--;return{endIndex:e[n].index,startIndex:e[t].index}}),yw(bb)));return{endReached:y,initialItemCount:m,itemsRendered:g,listState:A,minOverscanItemCount:v,rangeChanged:b,startReached:w,topItemsIndexes:p,...f}},uw(Pb,Fb,lE,Yb,Xb,tE,qb,Mb),{singleton:!0}),CE=Nw(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:i}])=>{const o=zw(),a=Sw(Mw(Tw(n,e,r,t,i),bw(([e,t,n,r,i])=>e+t+n+r+i.offsetBottom+i.bottom)),0);return mw(Iw(a),o),{totalListHeight:a,totalListHeightChanged:o}},uw(tb,hE),{singleton:!0}),pE=Nw(([{viewportHeight:e},{totalListHeight:t}])=>{const n=Vw(!1);return{alignToBottom:n,paddingTopAddition:Sw(Mw(Tw(n,e,t),ww(([e])=>e),bw(([,e,t])=>Math.max(0,e-t)),Hw(0),yw()),0)}},uw(tb,CE),{singleton:!0}),mE=Nw(()=>({context:Vw(null)})),gE=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...i},viewportBottom:o,viewportTop:a})=>t<a?{...i,align:n??"start",...void 0!==r?{behavior:r}:{}}:e>o?{...i,align:n??"end",...void 0!==r?{behavior:r}:{}}:null,vE=Nw(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:o,scrollingInProgress:a,scrollTop:l,viewportHeight:s},{scrollToIndex:c}])=>{const d=zw();return mw(Mw(d,kw(t,s,n,o,i,r,l),kw(e),bw(([[e,t,n,r,i,o,l,s],c])=>{const{calculateViewLocation:d=gE,done:u,...f}=e,h=Nb(e,t,r-1),C=zb(h,t.offsetTree,c)+i+o,p=d({itemBottom:C+ab(t.sizeTree,h)[1],itemTop:C,locationParams:f,viewportBottom:s+n-l,viewportTop:s+o});return null!==p?u&&gw(Mw(a,ww(e=>!e),Lw(pw(a)?1:2)),u):u?.(),p}),ww(e=>null!==e)),c),{scrollIntoView:d}},uw(Pb,tb,Xb,hE,Fw),{singleton:!0});function AE(e){return!1!==e&&("smooth"===e?"smooth":"auto")}const yE=Nw(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:r},{atBottomState:i,isAtBottom:o},{scrollToIndex:a},{scrolledToInitialItem:l},{didMount:s,propsReady:c},{log:d},{scrollingInProgress:u},{context:f},{scrollIntoView:h}])=>{const C=Vw(!1),p=zw();let m=null;function g(e){hw(a,{align:"end",behavior:e,index:"LAST"})}function v(e){const t=gw(i,t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&null===m&&(pw(d)("scrolling to bottom due to increased size",{},Rw),g("auto"))});setTimeout(t,100)}fw(Mw(Tw(Mw(Iw(t),Lw(1)),s),kw(Iw(C),o,l,u),bw(([[e,t],n,r,i,o])=>{let a=t&&i,l="auto";return a&&(l=((e,t)=>"function"==typeof e?AE(e(t)):t&&AE(e))(n,r||o),a=a&&!1!==l),{followOutputBehavior:l,shouldFollow:a,totalCount:e}}),ww(({shouldFollow:e})=>e)),({followOutputBehavior:t,totalCount:r})=>{null!==m&&(m(),m=null),void 0!==pw(n)?requestAnimationFrame(()=>{pw(d)("following output to ",{totalCount:r},Rw),g(t)}):m=gw(e,()=>{pw(d)("following output to ",{totalCount:r},Rw),g(t),m=null})}),fw(Mw(Tw(Iw(C),t,c),ww(([e,,t])=>!1!==e&&t),xw(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),ww(({refreshed:e})=>e),kw(C,t)),([,e])=>{pw(l)&&v(!1!==e)}),fw(p,()=>{v(!1!==pw(C))}),fw(Tw(Iw(C),i),([e,t])=>{!1!==e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&g("auto")});const A=Vw(null),y=zw();return mw(Zw(Mw(Iw(r),bw(e=>e?.length??0)),Mw(Iw(t))),y),fw(Mw(Tw(Mw(y,Lw(1)),s),kw(Iw(A),l,u,f),bw(([[e,t],n,r,i,o])=>t&&r&&n?.({context:o,totalCount:e,scrollingInProgress:i})),ww(e=>!!e),Hw(0)),t=>{null!==m&&(m(),m=null),void 0!==pw(n)?requestAnimationFrame(()=>{pw(d)("scrolling into view",{}),hw(h,t)}):m=gw(e,()=>{pw(d)("scrolling into view",{}),hw(h,t),m=null})}),{autoscrollToBottom:p,followOutput:C,scrollIntoViewOnChange:A}},uw(Pb,tE,Xb,Yb,qb,Fw,tb,mE,vE)),wE=Nw(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:o,listState:a},{didMount:l}])=>(mw(Mw(l,kw(o),ww(([,e])=>0!==e),kw(i,r,t,n,e),bw(([[,e],t,n,r,i,o=[]])=>dE(e,t,n,r,i,o))),a),{}),uw(Pb,Yb,hE,qb),{singleton:!0}),bE=Nw(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=Vw(0);return fw(Mw(e,kw(r),ww(([,e])=>0!==e),bw(([,e])=>({top:e}))),e=>{gw(Mw(n,Lw(1),ww(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{hw(t,e)})})}),{initialScrollTop:r}},uw(qb,tb,hE),{singleton:!0}),EE=Nw(([{scrollVelocity:e}])=>{const t=Vw(!1),n=zw(),r=Vw(!1);return mw(Mw(e,kw(r,t,n),ww(([e,t])=>!1!==t&&void 0!==t),bw(([e,t,n,r])=>{const{enter:i,exit:o}=t;if(n){if(o(e,r))return!1}else if(i(e,r))return!0;return n}),yw()),t),fw(Mw(Tw(t,e,n),kw(r)),([[e,t,n],r])=>{e&&!1!==r&&void 0!==r&&r.change&&r.change(t,n)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},uw(tE),{singleton:!0}),ME=Nw(([{scrollContainerState:e,scrollTo:t}])=>{const n=zw(),r=zw(),i=zw(),o=Vw(!1),a=Vw(void 0);return mw(Mw(Tw(n,r),bw(([{scrollTop:e,viewportHeight:t},{offsetTop:n,listHeight:r}])=>({scrollHeight:r,scrollTop:Math.max(0,e-n),viewportHeight:t}))),e),mw(Mw(t,kw(r),bw(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),i),{customScrollParent:a,useWindowScroll:o,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},uw(tb)),xE=Nw(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:o},{useWindowScroll:a,windowScrollContainerState:l,windowViewportRect:s}])=>{const c=zw(),d=Vw(void 0),u=Vw(null),f=Vw(null);return mw(l,u),mw(s,f),fw(Mw(c,kw(t,r,a,u,f,n)),([e,t,n,r,i,o,a])=>{const l=function(e){return ub(e).map(({k:e,v:t},n,r)=>{const i=r[n+1];return{endIndex:void 0!==i?i.k-1:1/0,size:t,startIndex:e}})}(t.sizeTree);r&&null!==i&&null!==o&&(n=i.scrollTop-o.offsetTop),e({ranges:l,scrollTop:n-=a})}),mw(Mw(d,ww(lw),bw(LE)),i),mw(Mw(o,kw(d),ww(([,e])=>void 0!==e),yw(),bw(([,e])=>e.ranges)),e),{getState:c,restoreStateFrom:d}},uw(Pb,tb,Yb,qb,ME));function LE(e){return{align:"start",index:0,offset:e.scrollTop}}const HE=Nw(([{topItemsIndexes:e}])=>{const t=Vw(0);return mw(Mw(t,ww(e=>e>=0),bw(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},uw(hE));function kE(e){let t,n=!1;return()=>(n||(n=!0,t=e()),t)}const VE=kE(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),SE=Nw(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:o,lastJumpDueToItemResize:a,scrollDirection:l},{listState:s},{beforeUnshiftWith:c,gap:d,shiftWithOffset:u,sizes:f},{log:h},{recalcInProgress:C}])=>{const p=Ow(Mw(s,kw(a),xw(([,e,t,n],[{bottom:r,items:i,offsetBottom:o,totalCount:a},l])=>{const s=r+o;let c=0;return t===a&&e.length>0&&i.length>0&&(0===i[0].originalIndex&&0===e[0].originalIndex||(c=s-n,0!==c&&(c+=l))),[c,i,a,s]},[0,[],0,0]),ww(([e])=>0!==e),kw(r,l,n,i,h,C),ww(([,e,t,n,,,r])=>!r&&!n&&0!==e&&t===Jb),bw(([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},Rw),e))));function m(n){n>0?(hw(t,{behavior:"auto",top:-n}),hw(e,0)):(hw(e,0),hw(t,{behavior:"auto",top:-n}))}return fw(Mw(p,kw(e,o)),([t,n,r])=>{r&&VE()?hw(e,n-t):m(-t)}),fw(Mw(Tw(Sw(o,!1),e,C),ww(([e,t,n])=>!e&&!n&&0!==t),bw(([e,t])=>t),Hw(1)),m),mw(Mw(u,bw(e=>({top:-e}))),t),fw(Mw(c,kw(f,d),bw(([e,{groupIndices:t,lastSize:n,sizeTree:r},i])=>{function o(e){return e*(n+i)}if(0===t.length)return o(e);let a=0;const l=ob(r,0);let s=0,c=0;for(;s<e;){s++,a+=l;let n=t.length===c+1?1/0:t[c+1]-t[c]-1;s+n>e&&(a-=l,n=e-s+1),s+=n,a+=o(n),c++}return a})),n=>{hw(e,n),requestAnimationFrame(()=>{hw(t,{top:n}),requestAnimationFrame(()=>{hw(e,0),hw(C,!1)})})}),{deviation:e}},uw(tb,tE,hE,Pb,Fw,Mb)),zE=Nw(([e,t,n,r,i,o,a,l,s,c,d])=>({...e,...t,...n,...r,...i,...o,...a,...l,...s,...c,...d}),uw(lE,wE,qb,EE,CE,bE,pE,ME,vE,Fw,mE)),OE=Nw(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,fixedGroupSize:i,gap:o,groupIndices:a,heightEstimates:l,itemSize:s,sizeRanges:c,sizes:d,statefulTotalCount:u,totalCount:f,trackItemSizes:h},{initialItemFinalLocationReached:C,initialTopMostItemIndex:p,scrolledToInitialItem:m},g,v,A,y,{scrollToIndex:w},b,{topItemCount:E},{groupCounts:M},x])=>{const{listState:L,minOverscanItemCount:H,topItemsIndexes:k,rangeChanged:V,...S}=y;return mw(V,x.scrollSeekRangeChanged),mw(Mw(x.windowViewportRect,bw(e=>e.visibleHeight)),g.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,fixedGroupHeight:i,gap:o,groupCounts:M,heightEstimates:l,initialItemFinalLocationReached:C,initialTopMostItemIndex:p,scrolledToInitialItem:m,sizeRanges:c,topItemCount:E,topItemsIndexes:k,totalCount:f,...A,groupIndices:a,itemSize:s,listState:L,minOverscanItemCount:H,scrollToIndex:w,statefulTotalCount:u,trackItemSizes:h,rangeChanged:V,...S,...x,...g,sizes:d,...v}},uw(Pb,Yb,tb,xE,yE,hE,Xb,SE,HE,Fb,zE));function NE(e,t){const n={},r={};let i=0;const o=e.length;for(;i<o;)r[e[i]]=1,i+=1;for(const e in t)Object.hasOwn(r,e)||(n[e]=t[e]);return n}const DE=typeof document<"u"?i.useLayoutEffect:i.useEffect;function TE(t,n,r){const o=Object.keys(n.required||{}),a=Object.keys(n.optional||{}),l=Object.keys(n.methods||{}),s=Object.keys(n.events||{}),c=i.createContext({});function d(e,t){void 0!==e.propsReady&&hw(e.propsReady,!1);for(const r of o){hw(e[n.required[r]],t[r])}for(const r of a)if(r in t){hw(e[n.optional[r]],t[r])}void 0!==e.propsReady&&hw(e.propsReady,!0)}function u(e){return s.reduce((t,r)=>(t[r]=function(e){let t,n;const r=()=>t?.();return function(i,o){switch(i){case 1:return o?n===o?void 0:(r(),n=o,t=fw(e,o),t):(r(),sw);case 2:return r(),void(n=null)}}}(e[n.events[r]]),t),{})}const f=i.forwardRef(function(f,h){const{children:C,...p}=f,[m]=i.useState(()=>cw(function(e){const t=new Map,n=({constructor:e,dependencies:r,id:i,singleton:o})=>{if(o&&t.has(i))return t.get(i);const a=e(r.map(e=>n(e)));return o&&t.set(i,a),a};return n(e)}(t),e=>{d(e,p)})),[g]=i.useState(aw(u,m));var v;DE(()=>{for(const e of s)e in p&&fw(g[e],p[e]);return()=>{Object.values(g).map(Cw)}},[p,g,m]),DE(()=>{d(m,p)}),i.useImperativeHandle(h,rw((v=m,l.reduce((e,t)=>(e[t]=e=>{hw(v[n.methods[t]],e)},e),{}))));const A=r;return e(c.Provider,{value:m,children:void 0!==r?e(A,{...NE([...o,...a,...s],p),children:C}):C})});return{Component:f,useEmitter:(e,t)=>{const n=i.useContext(c)[e];DE(()=>fw(n,t),[t,n])},useEmitterValue:parseInt(i.version)>=18?e=>{const t=i.useContext(c)[e],n=i.useCallback(e=>fw(t,e),[t]);return i.useSyncExternalStore(n,()=>pw(t),()=>pw(t))}:e=>{const t=i.useContext(c)[e],[n,r]=i.useState(aw(pw,t));return DE(()=>fw(t,e=>{e!==n&&r(rw(e))}),[t,n]),n},usePublisher:e=>{const t=i.useContext(c);return i.useCallback(n=>{hw(t[e],n)},[t,e])}}}const IE=i.createContext(void 0),ZE=i.createContext(void 0),RE="-webkit-sticky",jE="sticky",BE=kE(()=>{if(typeof document>"u")return jE;const e=document.createElement("div");return e.style.position=RE,e.style.position===RE?RE:jE}),PE=typeof document<"u"?i.useLayoutEffect:i.useEffect;function _E(e){return"self"in e}function FE(e,t,n,r=sw,o,a){const l=i.useRef(null),s=i.useRef(null),c=i.useRef(null),d=i.useCallback(n=>{let r,i,o;const l=n.target;if(function(e){return"body"in e}(l)||_E(l)){const e=_E(l)?l:l.defaultView;o=!0===a?Qw(e,e.scrollX):e.scrollY,r=!0===a?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,i=!0===a?e.innerWidth:e.innerHeight}else o=!0===a?Qw(l,l.scrollLeft):l.scrollTop,r=!0===a?l.scrollWidth:l.scrollHeight,i=!0===a?l.offsetWidth:l.offsetHeight;const d=()=>{e({scrollHeight:r,scrollTop:Math.max(o,0),viewportHeight:i})};!0===n.suppressFlushSync?d():E.flushSync(d),null!==s.current&&(o===s.current||o<=0||o===r-i)&&(s.current=null,t(!0),c.current&&(clearTimeout(c.current),c.current=null))},[e,t,a]);return i.useEffect(()=>{const e=o||l.current;return Ww(e),r(o||l.current),d({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",d,{passive:!0}),()=>{Ww(e),r(null),e.removeEventListener("scroll",d)}},[l,d,n,r,o]),{scrollByCallback:function(e){!0===a&&(e={...void 0!==e.behavior?{behavior:e.behavior}:{},...void 0!==e.top?{left:Gw(l.current,e.top)}:{}}),l.current.scrollBy(e)},scrollerRef:l,scrollToCallback:function(n){const r=l.current;if(!r||(!0===a?"offsetWidth"in r&&0===r.offsetWidth:"offsetHeight"in r&&0===r.offsetHeight))return;const i="smooth"===n.behavior;let o,d,u;_E(r)?(d=Math.max(Hb(r.document.documentElement,!0===a?"width":"height"),!0===a?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),o=!0===a?r.innerWidth:r.innerHeight,u=!0===a?Qw(r,r.scrollX):r.scrollY):(d=r[!0===a?"scrollWidth":"scrollHeight"],o=Hb(r,!0===a?"width":"height"),u=!0===a?Qw(r,r.scrollLeft):r.scrollTop);const f=d-o;if(void 0===n.top)return void r.scrollTo(n);const h=Math.ceil(Math.max(Math.min(f,n.top),0));if(n.top=h,Kb(o,d)||h===u)return e({scrollHeight:d,scrollTop:u,viewportHeight:o}),void(i&&t(!0));i?(s.current=h,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,s.current=null,t(!0)},1e3)):s.current=null,!0===a&&(n={...void 0!==n.behavior?{behavior:n.behavior}:{},left:Gw(r,h)}),r.scrollTo(n)}}}function qE(e){return e}const UE=Nw(()=>{const e=Vw(e=>`Item ${e}`),t=Vw(e=>`Group ${e}`),n=Vw({}),r=Vw(qE),i=Vw("div"),o=Vw(sw),a=(e,t=null)=>Sw(Mw(n,bw(t=>t[e]),yw()),t);return{components:n,computeItemKey:r,EmptyPlaceholder:a("EmptyPlaceholder"),FooterComponent:a("Footer"),GroupComponent:a("Group","div"),groupContent:t,HeaderComponent:a("Header"),HeaderFooterTag:i,ItemComponent:a("Item","div"),itemContent:e,ListComponent:a("List","div"),ScrollerComponent:a("Scroller","div"),scrollerRef:o,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),TopItemListComponent:a("TopItemList")}}),WE=Nw(([e,t])=>({...e,...t}),uw(OE,UE)),XE=({height:t})=>e("div",{style:{height:t}}),QE={overflowAnchor:"none",position:BE(),zIndex:1},GE={overflowAnchor:"none"},YE={...GE,display:"inline-block",height:"100%"},KE=i.memo(function({showTopList:t=!1}){const n=pM("listState"),r=mM("sizeRanges"),o=pM("useWindowScroll"),a=pM("customScrollParent"),l=mM("windowScrollContainerState"),s=mM("scrollContainerState"),c=a||o?l:s,d=pM("itemContent"),u=pM("context"),f=pM("groupContent"),h=pM("trackItemSizes"),C=pM("itemSize"),m=pM("log"),g=mM("gap"),v=pM("horizontalDirection"),{callbackRef:A}=Jw(r,C,h,t?sw:c,m,g,a,v,pM("skipAnimationFrameInResizeObserver")),[y,w]=i.useState(0);CM("deviation",e=>{y!==e&&w(e)});const b=pM("EmptyPlaceholder"),E=pM("ScrollSeekPlaceholder")??XE,M=pM("ListComponent"),x=pM("ItemComponent"),L=pM("GroupComponent"),H=pM("computeItemKey"),k=pM("isSeeking"),V=pM("groupIndices").length>0,S=pM("alignToBottom"),z=pM("initialItemFinalLocationReached"),O=t?{}:{boxSizing:"border-box",...v?{display:"inline-block",height:"100%",marginInlineStart:0!==y?y:S?"auto":0,paddingInlineEnd:n.offsetBottom,paddingInlineStart:n.offsetTop,whiteSpace:"nowrap"}:{marginTop:0!==y?y:S?"auto":0,paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},...z?{}:{visibility:"hidden"}};return t||0!==n.totalCount||null==b?e(M,{...rM(M,u),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:A,style:O,children:(t?n.topItems:n.items).map(e=>{const t=e.originalIndex,r=H(t+n.firstItemIndex,e.data,u);return k?p(E,{...rM(E,u),height:e.size,index:e.index,key:r,type:e.type||"item",..."group"===e.type?{}:{groupIndex:e.groupIndex}}):"group"===e.type?p(L,{...rM(L,u),"data-index":t,"data-item-index":e.index,"data-known-size":e.size,key:r,style:QE},f(e.index,u)):p(x,{...rM(x,u),...iM(x,e.data),"data-index":t,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:r,style:v?YE:GE},V?d(e.index,e.groupIndex,e.data,u):d(e.index,e.data,u))})}):e(b,{...rM(b,u)})}),JE={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},$E={outline:"none",overflowX:"auto",position:"relative"},eM=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:void 0}),tM=(e,t,n=0)=>({...eM(e),position:t?"relative":"absolute",top:t?-n:0}),nM={position:BE(),top:0,width:"100%",zIndex:1};function rM(e,t){if("string"!=typeof e)return{context:t}}function iM(e,t){return{item:"string"==typeof e?void 0:t}}const oM=i.memo(function(){const t=pM("HeaderComponent"),n=mM("headerHeight"),r=pM("HeaderFooterTag"),o=Yw(i.useMemo(()=>e=>{n(Hb(e,"height"))},[n]),!0,pM("skipAnimationFrameInResizeObserver")),a=pM("context");return null!=t?e(r,{ref:o,children:e(t,{...rM(t,a)})}):null}),aM=i.memo(function(){const t=pM("FooterComponent"),n=mM("footerHeight"),r=pM("HeaderFooterTag"),o=Yw(i.useMemo(()=>e=>{n(Hb(e,"height"))},[n]),!0,pM("skipAnimationFrameInResizeObserver")),a=pM("context");return null!=t?e(r,{ref:o,children:e(t,{...rM(t,a)})}):null});function lM({useEmitter:t,useEmitterValue:n,usePublisher:r}){return i.memo(function({children:i,style:o,context:a,...l}){const s=r("scrollContainerState"),c=n("ScrollerComponent"),d=r("smoothScrollTargetReached"),u=n("scrollerRef"),f=n("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:C,scrollToCallback:p}=FE(s,d,c,u,void 0,f);return t("scrollTo",p),t("scrollBy",h),e(c,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:C,style:{...f?$E:JE,...o},tabIndex:0,...l,...rM(c,a),children:i})})}function sM({useEmitter:t,useEmitterValue:n,usePublisher:r}){return i.memo(function({children:o,style:a,context:l,...s}){const c=r("windowScrollContainerState"),d=n("ScrollerComponent"),u=r("smoothScrollTargetReached"),f=n("totalListHeight"),h=n("deviation"),C=n("customScrollParent"),p=i.useRef(null),m=n("scrollerRef"),{scrollByCallback:g,scrollerRef:v,scrollToCallback:A}=FE(c,u,d,m,C);return PE(()=>(v.current=C||p.current?.ownerDocument.defaultView,()=>{v.current=null}),[v,C]),t("windowScrollTo",A),t("scrollBy",g),e(d,{ref:p,"data-virtuoso-scroller":!0,style:{position:"relative",...a,...0!==f?{height:f+h}:void 0},...s,...rM(d,l),children:o})})}const cM=({children:t})=>{const n=i.useContext(IE),r=mM("viewportHeight"),o=mM("fixedItemHeight"),a=pM("alignToBottom"),l=pM("horizontalDirection"),s=Yw(i.useMemo(()=>ow(r,e=>Hb(e,l?"width":"height")),[r,l]),!0,pM("skipAnimationFrameInResizeObserver"));return i.useEffect(()=>{n&&(r(n.viewportHeight),o(n.itemHeight))},[n,r,o]),e("div",{"data-viewport-type":"element",ref:s,style:eM(a),children:t})},dM=({children:t})=>{const n=i.useContext(IE),r=mM("windowViewportRect"),o=mM("fixedItemHeight"),a=pM("customScrollParent"),l=pM("useWindowScroll"),s=pM("topListHeight"),c=eb(r,a,pM("skipAnimationFrameInResizeObserver")),d=pM("alignToBottom");return i.useEffect(()=>{n&&(o(n.itemHeight),r({listHeight:0,offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:100}))},[n,r,o]),e("div",{"data-viewport-type":"window",ref:c,style:tM(d,l,s),children:t})},uM=({children:t})=>{const n=pM("TopItemListComponent")??"div",r=pM("headerHeight"),i={...nM,marginTop:`${r}px`},o=pM("context");return e(n,{style:i,...rM(n,o),children:t})},fM=i.memo(function(t){const r=pM("useWindowScroll"),i=pM("topItemsIndexes").length>0,o=pM("customScrollParent"),a=pM("context");return n(o||r?vM:gM,{...t,context:a,children:[i&&e(uM,{children:e(KE,{showTopList:!0})}),n(o||r?dM:cM,{children:[e(oM,{}),e(KE,{}),e(aM,{})]})]})}),{Component:hM,useEmitter:CM,useEmitterValue:pM,usePublisher:mM}=TE(WE,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},fM),gM=lM({useEmitter:CM,useEmitterValue:pM,usePublisher:mM}),vM=sM({useEmitter:CM,useEmitterValue:pM,usePublisher:mM}),AM=hM,yM=Nw(()=>{const e=Vw(e=>n("td",{children:["Item $",e]})),t=Vw(null),r=Vw(e=>n("td",{colSpan:1e3,children:["Group ",e]})),i=Vw(null),o=Vw(null),a=Vw({}),l=Vw(qE),s=Vw(sw),c=(e,t=null)=>Sw(Mw(a,bw(t=>t[e]),yw()),t);return{components:a,computeItemKey:l,context:t,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:o,fixedHeaderContent:i,itemContent:e,groupContent:r,ScrollerComponent:c("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),TableBodyComponent:c("TableBody","tbody"),TableComponent:c("Table","table"),TableFooterComponent:c("TableFoot","tfoot"),TableHeadComponent:c("TableHead","thead"),TableRowComponent:c("TableRow","tr"),GroupComponent:c("Group","tr")}});uw(OE,yM),BE();const wM={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},bM={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:EM,floor:MM,max:xM,min:LM,round:HM}=Math;function kM(e,t,n){return Array.from({length:t-e+1}).map((t,r)=>({data:null===n?null:n[r+e],index:r+e}))}function VM(e,t){return void 0!==e&&e.width===t.width&&e.height===t.height}function SM(e,t){return void 0!==e&&e.column===t.column&&e.row===t.row}const zM=Nw(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:o,scrollBy:a,scrollContainerState:l,scrollTo:s,scrollTop:c,smoothScrollTargetReached:d,viewportHeight:u},f,h,{didMount:C,propsReady:p},{customScrollParent:m,useWindowScroll:g,windowScrollContainerState:v,windowScrollTo:A,windowViewportRect:y},w])=>{const b=Vw(0),E=Vw(0),M=Vw(wM),x=Vw({height:0,width:0}),L=Vw({height:0,width:0}),H=zw(),k=zw(),V=Vw(0),S=Vw(null),z=Vw({column:0,row:0}),O=zw(),N=zw(),D=Vw(!1),T=Vw(0),I=Vw(!0),Z=Vw(!1),R=Vw(!1);fw(Mw(C,kw(T),ww(([e,t])=>0!==t)),()=>{hw(I,!1)}),fw(Mw(Tw(C,I,L,x,T,Z),ww(([e,t,n,r,,i])=>e&&!t&&0!==n.height&&0!==r.height&&!i)),([,,,,e])=>{hw(Z,!0),Qb(1,()=>{hw(H,e)}),gw(Mw(c),()=>{hw(t,[0,0]),hw(I,!0)})}),mw(Mw(N,ww(e=>null!=e&&e.scrollTop>0),Ew(0)),E),fw(Mw(C,kw(N),ww(([,e])=>null!=e)),([,e])=>{e&&(hw(x,e.viewport),hw(L,e.item),hw(z,e.gap),e.scrollTop>0&&(hw(D,!0),gw(Mw(c,Lw(1)),e=>{hw(D,!1)}),hw(s,{top:e.scrollTop})))}),mw(Mw(x,bw(({height:e})=>e)),u),mw(Mw(Tw(Iw(x,VM),Iw(L,VM),Iw(z,(e,t)=>void 0!==e&&e.column===t.column&&e.row===t.row),Iw(c)),bw(([e,t,n,r])=>({gap:n,item:t,scrollTop:r,viewport:e}))),O),mw(Mw(Tw(Iw(b),r,Iw(z,SM),Iw(L,VM),Iw(x,VM),Iw(S),Iw(E),Iw(D),Iw(I),Iw(T)),ww(([,,,,,,,e])=>!e),bw(([e,[t,n],r,i,o,a,l,,s,c])=>{const{column:d,row:u}=r,{height:f,width:h}=i,{width:C}=o;if(0===l&&(0===e||0===C))return wM;if(0===h){const t=Gb(c,e);return function(e){return{...bM,items:e}}(kM(t,t+Math.max(l-1,0),a))}const p=OM(C,h,d);let m,g;s?0===t&&0===n&&l>0?(m=0,g=l-1):(m=p*MM((t+u)/(f+u)),g=p*EM((n+u)/(f+u))-1,g=LM(e-1,xM(g,p-1)),m=LM(g,xM(0,m))):(m=0,g=-1);const v=kM(m,g,a),{bottom:A,top:y}=NM(o,r,i,v),w=EM(e/p);return{bottom:A,itemHeight:f,items:v,itemWidth:h,offsetBottom:w*f+(w-1)*u-A,offsetTop:y,top:y}})),M),mw(Mw(S,ww(e=>null!==e),bw(e=>e.length)),b),mw(Mw(Tw(x,L,M,z),ww(([e,t,{items:n}])=>n.length>0&&0!==t.height&&0!==e.height),bw(([e,t,{items:n},r])=>{const{bottom:i,top:o}=NM(e,r,t,n);return[o,i]}),yw(Eb)),t);const j=Vw(!1);mw(Mw(c,kw(j),bw(([e,t])=>t||0!==e)),j);const B=Ow(Mw(Tw(M,b),ww(([{items:e}])=>e.length>0),kw(j),ww(([[e,t],n])=>{const r=e.items[e.items.length-1].index===t-1;return(n||e.bottom>0&&e.itemHeight>0&&0===e.offsetBottom&&e.items.length===t)&&r}),bw(([[,e]])=>e-1),yw())),P=Ow(Mw(Iw(M),ww(({items:e})=>e.length>0&&0===e[0].index),Ew(0),yw())),_=Ow(Mw(Iw(M),kw(D),ww(([{items:e},t])=>e.length>0&&!t),bw(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),yw(bb),Hw(0)));mw(_,h.scrollSeekRangeChanged),mw(Mw(H,kw(x,L,b,z),bw(([e,t,n,r,i])=>{const o=Wb(e),{align:a,behavior:l,offset:s}=o;let c=o.index;"LAST"===c&&(c=r-1),c=xM(0,c,LM(r-1,c));let d=DM(t,i,n,c);return"end"===a?d=HM(d-t.height+n.height):"center"===a&&(d=HM(d-t.height/2+n.height/2)),void 0!==s&&0!==s&&(d+=s),{behavior:l,top:d}})),s);const F=Sw(Mw(M,bw(e=>e.offsetBottom+e.bottom)),0);return mw(Mw(y,bw(e=>({height:e.visibleHeight,width:e.visibleWidth}))),x),{customScrollParent:m,data:S,deviation:V,footerHeight:i,gap:z,headerHeight:o,increaseViewportBy:e,initialItemCount:E,itemDimensions:L,overscan:n,restoreStateFrom:N,scrollBy:a,scrollContainerState:l,scrollHeight:k,scrollTo:s,scrollToIndex:H,scrollTop:c,smoothScrollTargetReached:d,totalCount:b,useWindowScroll:g,viewportDimensions:x,windowScrollContainerState:v,windowScrollTo:A,windowViewportRect:y,...h,gridState:M,horizontalDirection:R,initialTopMostItemIndex:T,totalListHeight:F,...f,endReached:B,propsReady:p,rangeChanged:_,startReached:P,stateChanged:O,stateRestoreInProgress:D,...w}},uw(lE,tb,tE,EE,qb,ME,Fw));function OM(e,t,n){return xM(1,MM((e+n)/(MM(t)+n)))}function NM(e,t,n,r){const{height:i}=n;if(void 0===i||0===r.length)return{bottom:0,top:0};const o=DM(e,t,n,r[0].index);return{bottom:DM(e,t,n,r[r.length-1].index)+i,top:o}}function DM(e,t,n,r){const i=OM(e.width,n.width,t.column),o=MM(r/i),a=o*n.height+xM(0,o-1)*t.row;return a>0?a+t.row:a}const TM=Nw(()=>{const e=Vw(e=>`Item ${e}`),t=Vw({}),n=Vw(null),r=Vw("virtuoso-grid-item"),i=Vw("virtuoso-grid-list"),o=Vw(qE),a=Vw("div"),l=Vw(sw),s=(e,n=null)=>Sw(Mw(t,bw(t=>t[e]),yw()),n),c=Vw(!1),d=Vw(!1);return mw(Iw(d),c),{components:t,computeItemKey:o,context:n,FooterComponent:s("Footer"),HeaderComponent:s("Header"),headerFooterTag:a,itemClassName:r,ItemComponent:s("Item","div"),itemContent:e,listClassName:i,ListComponent:s("List","div"),readyStateChanged:c,reportReadyState:d,ScrollerComponent:s("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder","div")}}),IM=Nw(([e,t])=>({...e,...t}),uw(zM,TM)),ZM=i.memo(function(){const t=qM("gridState"),n=qM("listClassName"),r=qM("itemClassName"),o=qM("itemContent"),a=qM("computeItemKey"),l=qM("isSeeking"),s=UM("scrollHeight"),c=qM("ItemComponent"),d=qM("ListComponent"),u=qM("ScrollSeekPlaceholder"),f=qM("context"),h=UM("itemDimensions"),C=UM("gap"),m=qM("log"),g=qM("stateRestoreInProgress"),v=UM("reportReadyState"),A=Yw(i.useMemo(()=>e=>{const t=e.parentElement.parentElement.scrollHeight;s(t);const n=e.firstChild;if(null!==n){const{height:e,width:t}=n.getBoundingClientRect();h({height:e,width:t})}C({column:QM("column-gap",getComputedStyle(e).columnGap,m),row:QM("row-gap",getComputedStyle(e).rowGap,m)})},[s,h,C,m]),!0,!1);return PE(()=>{t.itemHeight>0&&t.itemWidth>0&&v(!0)},[t]),g?null:e(d,{className:n,ref:A,...rM(d,f),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(n=>{const i=a(n.index,n.data,f);return l?e(u,{...rM(u,f),height:t.itemHeight,index:n.index,width:t.itemWidth},i):p(c,{...rM(c,f),className:r,"data-index":n.index,key:i},o(n.index,n.data,f))})})}),RM=i.memo(function(){const t=qM("HeaderComponent"),n=UM("headerHeight"),r=qM("headerFooterTag"),o=Yw(i.useMemo(()=>e=>{n(Hb(e,"height"))},[n]),!0,!1),a=qM("context");return null!=t?e(r,{ref:o,children:e(t,{...rM(t,a)})}):null}),jM=i.memo(function(){const t=qM("FooterComponent"),n=UM("footerHeight"),r=qM("headerFooterTag"),o=Yw(i.useMemo(()=>e=>{n(Hb(e,"height"))},[n]),!0,!1),a=qM("context");return null!=t?e(r,{ref:o,children:e(t,{...rM(t,a)})}):null}),BM=({children:t})=>{const n=i.useContext(ZE),r=UM("itemDimensions"),o=UM("viewportDimensions"),a=Yw(i.useMemo(()=>e=>{o(e.getBoundingClientRect())},[o]),!0,!1);return i.useEffect(()=>{n&&(o({height:n.viewportHeight,width:n.viewportWidth}),r({height:n.itemHeight,width:n.itemWidth}))},[n,o,r]),e("div",{ref:a,style:eM(!1),children:t})},PM=({children:t})=>{const n=i.useContext(ZE),r=UM("windowViewportRect"),o=UM("itemDimensions"),a=qM("customScrollParent"),l=qM("useWindowScroll"),s=eb(r,a,!1);return i.useEffect(()=>{n&&(o({height:n.itemHeight,width:n.itemWidth}),r({listHeight:0,offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:n.viewportWidth}))},[n,r,o]),e("div",{ref:s,style:tM(!1,l),children:t})},_M=i.memo(function({...t}){const r=qM("useWindowScroll"),i=qM("customScrollParent"),o=i||r?XM:WM,a=i||r?PM:BM,l=qM("context");return e(o,{...t,...rM(o,l),children:n(a,{children:[e(RM,{}),e(ZM,{}),e(jM,{})]})})}),{useEmitter:FM,useEmitterValue:qM,usePublisher:UM}=TE(IM,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},_M),WM=lM({useEmitter:FM,useEmitterValue:qM,usePublisher:UM}),XM=sM({useEmitter:FM,useEmitterValue:qM,usePublisher:UM});function QM(e,t,n){return"normal"!==t&&!0!==t?.endsWith("px")&&n(`${e} was not resolved to pixel value correctly`,t,Bw),"normal"===t?0:parseInt(t??"0",10)}const GM=({optionsList:r=[],onSelectVariable:i,dropdownPosition:o,position:s="relative",width:c,height:d="160px",zIndex:u=9999,highlightedIndex:f})=>{const h={LOCAL:"local_variable_icon",GLOBAL:"global_variable_icon",PROJECT_ENVIRONMENT:"project_env_variable_icon"},C=e=>{if(!e)return"";const t=e._id||e.id;return t?.startsWith("PARAMETER")?"step_group_parameter":"STEPGROUP"!==e?.parentVariableType||"LOCAL"!==e.type&&"STEPGROUP"!==e?.type?"_startforloop"===e.type?"for_loop_variable":"DATAPROVIDER"===e.type?"data_provider_variable":h[e.type||""]||"":"step_group_variable"},p=e=>"_startforloop"===e?.type?`FLV_for:${e?.name}`:"DATAPROVIDER"===e?.type?`${e?.dpName}:${e?.varname}`:e?.name;function m(e){if(e.endsWith("px")){const t=parseInt(e.slice(0,-2),10);return isNaN(t)?212:t-66}return 212}const g=a(null);l(()=>{void 0!==f&&f>=0&&requestAnimationFrame(()=>{g.current?.scrollToIndex({index:f,behavior:"auto",align:"center"})})},[f,r]);return e("div",{className:D("ff-variable-dropdown",s),style:o?{top:o.top+30,left:o.left-30,width:c,height:d,zIndex:u}:{width:c,height:d,zIndex:u},children:G(r)?e("div",{className:"ff-variable-option ff-variable-option-no-data",children:e(q,{as:"span",fontSize:12,children:"No Option"})}):e(AM,{totalCount:r.length,ref:g,data:r,itemContent:o=>{const a=r[o];return a?e("div",{className:D("ff-variable-data",{"ff-variable-data--highlighted":f===o}),onMouseDown:()=>i(a),children:c.endsWith("px")?n(t,{children:[e(Y,{title:Ln(p(a),m(c),"pixel")?p(a):"",style:{width:`${m(c)}px`},children:e(q,{as:"span",fontSize:12,className:"ff-truncated_text",children:p(a)})}),e(F,{name:C(a),height:24,width:24,hoverEffect:!0})]}):e(nw,{option:a})},`${a.id}-${o}`):null},style:{height:d,fontSize:"12px"},overscan:10,fixedItemHeight:32})})},YM=({data:r=[],width:i,height:o,lineChartWidth:a,yAxisLabel:s,xAxisLabel:d,yAxisValueColor:u,xAxisColor:f,yAxisColor:h,yAxisLabelColor:C,textSize:p,fontWeight:m,numberSize:g,chartName:v,shouldCenterSinglePoint:A,xAxisLabelGap:y=16,isLeftOverflow:w=!1})=>{const b=40,E=i-80,M=o-80,[x,L]=c(!1),[H,k]=c({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null});l(()=>{const e=()=>{L(!1),k(e=>({...e,tooltip:{...e.tooltip,visible:!1}}))};return window.addEventListener("scroll",e,!0),()=>window.removeEventListener("scroll",e,!0)},[]);if(!(r&&r.length>0&&r?.some(e=>Array.isArray(e?.data)&&e?.data?.length>0))){const t=[];for(let e=6;e>=0;e--){const n=new Date;n.setDate(n.getDate()-e);const r=n?.toLocaleDateString("en-US",{day:"numeric",month:"short"});t.push(r)}const r=1024,a=6,l=7;return n("div",{className:"ff-line-chart-text",style:{width:i+20+y,gap:y},children:[e("div",{className:"ff-line-chart-yAxisLabel-warpper",style:{height:o},children:e(q,{className:"ff-line-chart-yAxisLabel",fontSize:p,fontWeight:"semi-bold",children:s})}),e("div",{className:"ff-line-chart-svg",children:e("svg",{height:o,width:i,className:"ff-line-chart-svg",children:n("g",{transform:"translate(40, 40)",children:[e("line",{x1:0,y1:M,x2:E,y2:M,stroke:f,strokeWidth:1}),e("text",{x:E/2.1,y:M+b/1.2,textAnchor:"middle",fill:C,className:"ff-line-chart-x-axis-label",style:{fontSize:p,fontWeight:m},children:d}),t.map((t,n)=>e("text",{x:n*(E/(l-1)),y:M+15,textAnchor:0===n?"start":n===l-1?"end":"middle",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:t},t)),Array.from({length:a}).map((t,n)=>{const i=n*r/(a-1),o=i/1024;return e("text",{x:-10,y:M-i*M/r,textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:o?.toFixed(1)},`y-${n}`)})]})})})]})}function V(e){if(!isNaN(e))return parseFloat(e);const t=Hr,n=e.match(t);if(!n)throw new Error("Invalid input format. Use '<value> <unit>' format (e.g., '10.9580078125 KB') or just a number.");const r=parseFloat(n[1]);switch(n[2]?n[2].toUpperCase():null){case"GB":return parseFloat((1024*r).toFixed(2));case"MB":return parseFloat(r.toFixed(2));case"KB":return parseFloat((r/1024).toFixed(2));default:throw new Error("Invalid unit. Supported units are GB, MB, and KB.")}}const S=r?.[0]?.data?.[0]?.hasOwnProperty("date")&&r?.[0]?.data?.[0]?.hasOwnProperty("totalMemory"),z="date",O=S?"totalMemory":"value",N=e=>{const t=r?.[0]?.data?.length;if(1===t)return A?E/2:E;const n=r[0].data.findIndex(t=>t[z]===e);return-1===n?0:n/(t-1)*E},D=Math.max(...r?.flatMap(e=>e?.data?.map(e=>V(e[O]))),5),T=e=>{if("memory"===v){const t=Math.max(...r?.flatMap(e=>e?.data?.map(e=>V(e[O]))));return M-e*M/(t>1024?t:1024)}return M-e*M/(0===D?1024:D)},I=e=>{if(1===e?.length){const t=e?.[0],n=N(t[z]),r=T(V(t[O]));return`M 0 ${T(0)} L ${n} ${r}`}return e?.reduce((t,n,r)=>{const i=N(n[z]),o=T(V(n[O]));if(0===r)return`M ${i} ${o}`;const a=e[r-1],l=a?N(a[z]):0;return`${t} C ${l+(i-l)/2} ${a?T(V(a[O])):0}, ${i-(i-l)/2} ${o}, ${i} ${o}`},"")},Z=r[0].data;return n("div",{className:"ff-line-chart-text",style:{width:i+20+y,gap:y},children:[e("div",{className:"ff-line-chart-yAxisLabel-warpper",style:{height:o},children:e(q,{className:"ff-line-chart-yAxisLabel",fontSize:p,fontWeight:"semi-bold",children:s})}),n("div",{className:"ff-line-chart-svg",children:[e("svg",{height:o,width:i,onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left-b;if(e.clientY-t.top-b>M)return L(!1),void k({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null});let i={hoverValues:{},dotPositions:{}},o=null;r.forEach((e,t)=>{const r=e.data.reduce((e,t)=>{const r=Math.abs(n-N(t[z]));return r<e.distance?{point:t,distance:r}:e},{point:null,distance:1/0}).point;r&&(o=r[z],i.hoverValues[t]=((e,t=2)=>{let n="";if("string"==typeof e){const t=e.match(Mr),r=e.match(xr);t&&(e=parseFloat(t[0])),r&&(n=r[0])}const r=Math.pow(10,t);return`${Math.ceil(e*r)/r} ${n}`.trim()})(r[O]),i.dotPositions[t]={x:N(r[z]),y:T(V(r[O]))})}),L(!0),k({cursorX:n,hoverValues:i.hoverValues,dotPositions:i.dotPositions,currentXValue:o,tooltip:o?{visible:!0,left:e.clientX+10,top:e.clientY-20}:{visible:!1,left:0,top:0}})},onMouseLeave:()=>k({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null}),className:"ff-line-chart-svg",children:n("g",{transform:"translate(40, 40)",children:[e("line",{x1:0,y1:0,x2:0,y2:M,strokeWidth:2}),e("line",{x1:0,y1:M,x2:E,y2:M,stroke:f,strokeWidth:1}),e("text",{x:E/2.1,y:M+b/1.2,textAnchor:"middle",fill:C,className:"ff-line-chart-x-axis-label",style:{fontSize:p,fontWeight:m},children:d}),r.map((r,i)=>{return!1!==r.show?n("g",{children:[e("path",{d:I(r.data),fill:"none",stroke:r.color,strokeWidth:a,opacity:(o=r.data,o.every(e=>0===V(e[O]))?.5:1)}),H.dotPositions[i]&&n(t,{children:[e("line",{x1:H.dotPositions[i].x,y1:0,x2:H.dotPositions[i].x,y2:M,stroke:"gray",strokeWidth:.5,strokeDasharray:"4"}),e("circle",{cx:H.dotPositions[i].x,cy:H.dotPositions[i].y,r:5,fill:"white",stroke:r.color,strokeWidth:a,style:{transition:"cx 0.1s, cy 0.1s"}}),e("line",{x1:0,y1:H.dotPositions[i].y,x2:E,y2:H.dotPositions[i].y,stroke:"gray",strokeWidth:.5,strokeDasharray:"4"})]})]},i):null;var o}),(()=>{if(1===Z.length){const t=Z?.[0];return e("text",{x:A?E/2:E,y:M+15,textAnchor:A?"middle":"end",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=t[z]?String(t[z]):""},String(t[z]))}if(Z.length<7)return Z.map(t=>e("text",{x:N(t[z]),y:M+15,textAnchor:"middle",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=t[z]?String(t[z]):""},String(t[z])));{const t=(i-80-7*9.2)/6;return Array.from({length:7}).map((n,r)=>{const i=Math.floor(r*(Z?.length-1)/6),o=Z[i];return e("text",{x:r*t,y:M+15,fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=o?.[z]?String(o?.[z]):""},String(o?.[z]))})}})(),(()=>{if("memory"===v){const t=Math.max(D,1024);return Array.from({length:6}).map((n,r)=>{const i=r*t/5,o=i/1024;return e("text",{x:-10,y:T(i),textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:o.toFixed(1)},`y-${r}`)})}return Array.from({length:6}).map((t,n)=>{const r=n*D/5;return e("text",{x:-10,y:T(r),textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:r.toFixed(0)},`y-${n}`)})})()]})}),x&&H.tooltip.visible&&n("div",{className:"ff-line-chart-tooltip",style:{left:w&&H.tooltip.left/2>i/1.75?H.tooltip.left-180:H.tooltip.left,top:H.tooltip.top},children:[e("div",{className:"ff-line-chart-date",children:H.currentXValue}),Object.entries(H.hoverValues).map(([t,i])=>!1!==r[Number(t)]?.show&&n("div",{className:"ff-line-chart-inner-tooltip",children:["default"!==r[Number(t)]?.name&&e("div",{className:"ff-line-chart-status-dot",style:{backgroundColor:r[Number(t)]?.color}}),r[Number(t)]?.name,": ",i]},t))]})]})]})},KM=({onClose:t,top:r="100px",left:i="0px",className:o,description:a="Download and Install the fireflink client to run the script",onClick:s=()=>{},optionZIndex:c=10000001})=>{l(()=>{const e=e=>{"Escape"===e.key&&t?.()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[t]);return n("div",{className:`ff-download-client-wrapper ${o}`,style:{top:r,left:i,zIndex:c},children:[n("div",{className:"ff-download-client-header-wrapper",children:[e("div",{className:"ff-download-client-hollow-triangle"}),e(q,{fontWeight:"semi-bold",lineHeight:"32px",className:"ff-download-client-header-text",children:"Download client"}),e(F,{name:"close",color:"var(--brand-color)",className:"ff-download-client-close-icon",height:12,width:12})]}),n("div",{className:"ff-download-client-content-text",children:[e(q,{as:"div",color:"var(--download-client-content-text-color)",fontWeight:"semi-bold",textAlign:"center",lineHeight:"26px",children:a}),e(q,{as:"div",className:"ff-download-client-description-text",textAlign:"center",fontWeight:"medium",lineHeight:"26px",children:"Choose OS to Download"}),e("div",{className:"ff-download-client-os-wrapper",children:["windows","mac_icon","linux"]?.map(t=>e("div",{className:"ff-os-version-wrapper",onClick:()=>{s("mac_icon"===t?"mac":t)},children:e(F,{name:t,height:36,width:36})},t))})]})]})},JM=({legendName:t,height:r,width:i,children:o})=>e("div",{className:"ff_fieldSet_container",children:n("fieldset",{className:"ff_fieldSet",style:{height:r,width:i},children:[e("legend",{className:"ff_legend_container",children:e(q,{color:"var(--license_header_text_color)",fontSize:8,lineHeight:"12px",children:t})}),e("div",{className:"ff_children_container",children:o})]})}),$M=({onSelectVariable:t,dropdownPosition:n,filteredOptions:r=[],position:i="relative",width:o="100%",zIndex:s,truncateTextValue:c=34,highlightedIndex:d})=>{const u=a(null);return l(()=>{u.current?.scrollIntoView({block:"nearest"})},[d]),e("div",{className:D(`ff-variable-dropdown-container ${i}`),style:n?{top:n.top+30,left:n.left-30,width:o,zIndex:s}:{width:o,zIndex:s},children:G(r)?e("div",{className:"ff-variable-option no-data",children:e(q,{as:"div",children:"No Option",fontSize:14})}):r?.map((n,r)=>e("div",{className:D("ff-variable-option",{"ff-variable-option--highlighted":d===r}),onMouseDown:()=>t(n),ref:d===r?u:null,children:e(Y,{title:Ln(n?.name,c,"pixel")?n?.name:"",children:e(q,{children:xn(n?.name,c,"pixel")})})},n?.id))})},ex=o(({label:t="",hashInputValue:r="",setHashInputValue:i,variableList:o=[],placeholder:s="Enter text",onChange:d,onPaste:u,onCreateVariableClick:f,handleClearInput:h,value:C="",dropdownWidth:p="100%",dropdownHeight:m="160px",isHash:g=!1,isOnlyHash:v=!1,dataFiles:A=[],showAddVariableIcon:y=!0,helperText:b="",error:E,autoComplete:M="off",required:x=!1,zIndex:L=9999,truncateTextValue:H=34,formProps:k={},getSelectedVariable:V=()=>{},symbol:S="$",type:z="text",clearIcon:O=!0,inputTitle:N="",onBlur:T,helperTextWidth:I,iconProps:Z={isShowIcon:!1,iconName:"",iconToolTipTitle:"",isIconDisable:!1,iconColor:"",onIconClick:()=>{}},...R},j)=>{const[B,P]=c(!1),[_,U]=c(!1),[W,X]=c(0),[Q,K]=c(!1),[J,$]=c(null),[ee,te]=c(0),[ne,re]=c(!1),[ie,oe]=c([]),ae=a(null),le=a(null),[se,ce]=c("auto"),de=Z?.isShowIcon;l(()=>{const e=le.current?.querySelector(".ff-input-container");if(!e)return;const t=new ResizeObserver(e=>{for(let t of e){const e=`${t.contentRect.width}px`;ce(e)}});return t.observe(e),()=>{t.disconnect()}},[]),w(j,()=>ae.current),l(()=>{null!==J&&ae.current&&(ae.current.setSelectionRange(J,J),ae.current.focus())},[J]),l(()=>{g&&P(C.startsWith("#"));const e=A?.find(e=>e.name===C),t=o?.find(e=>e?.name===C);if(C.startsWith("#")&&g){const e=C.slice(1).toLowerCase(),t=A.filter(t=>t.name.toLowerCase().includes(e));oe(t),P(!0)}const n=null!==e&&C.startsWith("#"),r=null!==t&&C.startsWith("$"),i=C.length>(t?.name.length||0),a=C.length>0&&!r||C.startsWith("#");v?re(!1):r||n||C.includes("$")||C.includes("#")?(re(!1),a&&re(!0)):i&&!C.includes("$")&&re(!0)},[C]);const ue=()=>{ae.current&&te(ae.current.selectionStart||0)},fe=ue,he=ue;l(()=>{ae.current&&te(ae.current.selectionStart||0)},[C]);const Ce=e=>{if(ae.current){const{selectionStart:t,selectionEnd:n}=ae.current,r=`${e.name}`;let o;if(o=g&&"#"===C[0]?e.name+C.slice(n||1):e.name,d){d({target:{value:o}},e),V(e.name)}ae.current.value=o,i?.(e),$((t||0)+r.length),P(!1),U(!0)}};const pe=function(e,t,n){let r=!1,i="";const o="}"===C[t-1];if(t<0||t>e.length)return{showDropdown:r,searchString:i};const a=e.lastIndexOf(S,t-1),l=e.indexOf(S,t);if(-1!==a&&(v&&"$"===e[a]?r=!1:t===a+1?(r=!0,i=""):(i=e.slice(a+1,-1===l?void 0:l),t>a+1&&(i=e.slice(a+1,t)),r=!0),_&&o&&(r=!1),(/[{}]/.test(i)||0===t)&&(r=!1,i=""),i)){n.some(e=>e.name.toLowerCase().includes(i.toLowerCase()))||(n=[])}return{showDropdown:r,searchString:i}}(C,ee,o),me=()=>o?.filter(e=>e?.name?.toLowerCase()?.includes(pe?.searchString?.toLowerCase())),ge=C.startsWith("#"),ve=ge?ie:me();l(()=>{X(0)},[g,pe?.showDropdown]);const Ae=Boolean(pe?.showDropdown&&Q),ye=Boolean(B&&g&&Q),we=Boolean((ge?ye:Ae)&&ve.length);return n("div",{className:"ff-add-variable-container",children:[n("div",{className:"ff-add-variable-input",ref:le,children:[e(Y,{title:N,style:{width:"100%"},children:e(xi,{...R,name:"add_variable",ref:ae,type:z,className:D("ff-variable-input-container",{"ff-variable-input-container--show-icon":de}),value:C,onKeyDown:e=>{switch(e.key){case"ArrowDown":if(!we)return;e.preventDefault(),e.stopPropagation(),X(e=>e<ve.length-1?e+1:e);break;case"ArrowUp":if(!we)return;e.preventDefault(),e.stopPropagation(),X(e=>e>0?e-1:0);break;case"Enter":{if(!we)return;e.preventDefault(),e.stopPropagation();const t=ve[W];t&&Ce(t);break}case"Escape":if(!we)return;e.preventDefault(),e.stopPropagation(),P(!1),K(!1),X(0)}},onChange:d,onPaste:()=>{re(!0)},variant:"primary",label:t,placeholder:s,onClick:fe,onKeyUp:he,onFocus:()=>K(!0),onBlur:e=>{(e=>{e.relatedTarget&&e.relatedTarget.closest(".dropdown-container")||K(!1)})(e),T?.(e)},autoComplete:M,helperText:b,error:E,required:x,helperTextWidth:I,...k})}),!G(C)&&ne&&y&&e("div",{className:"ff-create-variable-container",onClick:f,children:e(q,{fontWeight:"regular",fontSize:"10px",color:"var(--brand-color)",cursor:"pointer",children:"Create Variable"})}),!G(C)&&!v&&e("div",{className:D("ff-cancel-icon-container",{"ff-cancel-icon-container--show-icon":de}),children:O&&e(Y,{title:"Cancel",style:{zIndex:99999},children:e(F,{onClick:h,name:"close",height:16,width:16,hoverEffect:!0})})}),de&&e("div",{className:"ff-info-icon-container",children:e(Y,{title:de&&!Z?.isIconDisable?Z?.iconToolTipTitle:"",children:e(F,{name:Z?.iconName||"",hoverEffect:!1,height:16,width:16,color:Z?.iconColor||"var(--text-area-default-color)",onClick:e=>{Z?.onIconClick&&Z?.onIconClick(e)},disabled:Z?.isIconDisable,cursorType:"pointer"})})})]}),pe?.showDropdown&&Q&&e(GM,{position:"absolute",zIndex:L,truncateTextValue:H,width:se,height:G(me())?"auto":m,optionsList:ve,onSelectVariable:Ce,highlightedIndex:W}),B&&g&&Q&&e($M,{position:"relative",zIndex:L,truncateTextValue:H,width:se,filteredOptions:ve,onSelectVariable:Ce,highlightedIndex:W})]})}),tx=({isOpen:t,variableTypesList:r=[],onClose:i,onNameChange:o,onValueChange:a,variableName:s,variableValue:d,onVariableTypeChange:u,selectedVariableType:f,hideValue:h=!1,onHideChange:C,handleSubmit:p,mode:m="create",disabled:g,dataFiles:v=[],truncateTextValue:A=34,isEnterKeySubmit:y=!1,showHideValueOption:w=!0})=>{const[b,E]=c(!1),[M,x]=c(""),[L,H]=c(),[k,V]=c(!1),[S,z]=c(!1),[O,N]=c({name:"",value:"",isChecked:!1});l(()=>{t&&"edit"===m&&N({name:s,value:d,isChecked:h})},[]);const D=e=>e&&0!==e.length?" "===e[0]||" "===e[e.length-1]?"Space is not allowed at starting and at the end":Fn.test(e)?e.length<3?"Name should contain at least 3 characters":e.length>25?"Name can contain at most 25 characters":"":"Name should be alphanumeric":"Variable Name is required";function T(e){const t=!!e,n=Fn.test(e),r=Jr.test(e),i=e.length>=3&&e.length<=25;return t&&n&&r&&i}l(()=>{const e=D(s);E(!!e),x(e)},[s]),l(()=>{if("edit"!==m)return;const{name:e,value:t,isChecked:n}=O;z(s!==e||d!==t||h!==n)},[m,s,d,h,O]);const I=()=>{!k&&T(s)&&(V(!0),p())};l(()=>{if(!y)return;const e=e=>{if("Enter"===e.key){e.preventDefault();!T(s)||k||"edit"===m&&!S||I()}};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[y,s,d,h,k,m,S,f]);return e(vn,{zIndex:1350,onClose:i,isOpen:t,title:"create"===m?"Create Variable":"Edit Variable",width:"284px",height:w?"280px":"250px",top:"30%",right:8,isFooterRequired:!0,overlay:!0,footerContent:e(()=>n("div",{className:"ff-create-slider-footer",children:[e(U,{onClick:i,label:"Cancel",variant:"tertiary"}),e(U,{variant:"primary",label:"create"===m?"Create":"Update",type:"submit",onClick:I,disabled:!T(s)||k||"edit"===m&&!S})]}),{}),children:n("div",{className:"ff-create-variable-slider",children:[e("div",{className:"ff-create-variable-slider-input",children:e(xi,{label:"Variable Name",required:!0,type:"text",name:"variableName",value:s||"",onChange:e=>{V(!1),o(e.target.value)},error:b,helperText:M,onBlur:e=>{const t=e.target.value,n=D(t);E(!!n),x(n)}})}),e(Vo,{label:"Variable Type",required:!0,onChange:e=>{u(e),V(!1)},selectedOption:f,optionsList:r,optionZIndex:99999,valueAccessor:"label",disabled:"edit"===m}),e(ex,{label:"Variable Value",placeholder:"Enter Variable value or select path using #",isHash:!0,isOnlyHash:!0,zIndex:99999,truncateTextValue:A,dataFiles:v,dropdownWidth:"100%",setHashInputValue:H,hashInputValue:L||{},value:d||"",type:h?"password":"text",onChange:(e,t)=>{const n=e.target.value;a(n,t)},showAddVariableIcon:!1}),w&&n("div",{className:"ff-hide-value-content",children:[e(bn,{onChange:e=>C(e.target.checked),name:"hideValue",label:"Hide Value",checked:h,disabled:g}),e(Y,{title:"Once the value is hidden, it cannot be undone",children:e(F,{name:"info",width:12,height:12})})]})]})})},nx=({highlightText:t="",tableMeta:r=[],tableData:i=[],accordionType:o="row",noDataContent:a,height:l="100%",withFixedHeader:s=!1,headerType:d,TableAccordionStateIconWidth:u=4,TableAccordionStateIconHeight:f=8})=>{const[h,C]=c(-1),p=(e,t)=>{let n=e[t.accessor];return t.cell?t.cell({value:n,row:e,column:t.accessor}):t.accessor||n&&"object"!=typeof n?n:"--"},m=t=>t.map((t,n)=>e("table",{className:"ff-accordion-table",cellSpacing:0,children:e("tbody",{className:"ff-table-body",children:e("tr",{className:"ff-table-row",children:r.map((n,r)=>e("td",{className:"ff-table-cell",style:{width:n.width},children:"column"===o&&0===r?"":e(q,{children:p(t,n)})},n.accessor+r))},t.id||n)})},`accordion-table-${n}`));return n("div",{style:{height:l},className:D("ff-accordion-table-container",{"ff-accordion-fixed-header-table":s}),children:[e("table",{cellSpacing:0,className:D("ff-accordion-table",{"ff-accordion-fixed-header":s}),children:e("thead",{children:e("tr",{className:"ff-table-row",children:r.map(t=>e("th",{style:{width:t.width},className:D("ff-table-header",d&&`ff-accordion-table--${d}-bg`),children:e("div",{children:e(q,{fontWeight:"semi-bold",fontSize:12,children:t.header})})},`header-${t.header}`))})})}),"row"===o&&i.map((n,r)=>e(yn,{highlightText:t,headerTitle:n.title,color:"var(--text-color)",accordionContent:m(n.data),disable:n.disable,disableInfoMessage:n.disableInfoMessage,accordionStateIconName:"arrows_down_icon",AccordionStateIconWidth:u,AccordionStateIconHeight:f},`accordion-row-${r}`)),"column"===o&&i.map((i,o)=>n("div",{className:"column-table-accordion",children:[e("div",{className:"ff-display-flex",children:e(Y,{title:i.disable?i?.disableInfoMessage:"string"==typeof i.title&&Ln(i.title,r[0]?.width,"pixel")?i.title:"",placement:"bottom-start",children:n("div",{className:`accordion-header ${i.disable&&"accordion-header--disabled"}`,children:[e("div",{className:"header-title",children:e("span",{children:e(q,{children:e(An,{text:xn(i.title,r[0]?.width,"pixel"),highlight:t})})})}),e("div",{className:"accordion-arrow",onClick:()=>{!i.disable&&(e=>{C(e===h?-1:e)})(o)},children:e(F,{name:h===o?"arrows_down_icon":"arrows_right_icon",color:"var(--table-with-accordion-icon-color)",width:u,height:f,hoverEffect:!1})})]})})}),h===o&&e("div",{children:m(i.data)})]},`column-accordion-${o}`)),i.length<=0&&e("div",{className:"no-data-content",style:{height:`calc(${l} - 50px)`},children:a})]})},rx=({progressPercentage:t,totalMemory:r,usedMemory:i,color:o="var(--brand-color)",trackColor:a="#f0f0f0",height:l=10,label:s,labelFontSize:c=12,labelTextColor:d="var(--ff-card-status-text-color)",showPercentage:u=!1,percentageFontSize:f=10,percentageTextColor:h="var(--tooltip-text-color)",progressBarWidth:C="200px"})=>{const p=e=>{const t=e.trim().toLowerCase();if("0"===t)return 0;const n=t.match(/^(\d+(?:\.\d+)?)\s*(kb|mb|gb)$/);if(!n||!n[1])return 0;const r=parseFloat(n[1]),i=n[2];return"gb"===i?1024*r:"kb"===i?r/1024:r};let m=0,g=s;if(void 0!==r&&void 0!==i){const e=p(i),t=p(r);t>0?(m=e/t*100,g=s||i):(m=0,g="0MB")}else m=t||0;const v=Math.max(0,Math.min(m,100));return n("div",{className:"ff-progress-bar-container "+(g?"ff-has-label":""),style:{width:C},children:[e("div",{className:"ff-progress-bar-track",style:{backgroundColor:a,height:`${l}px`},children:e("div",{className:"ff-progress-bar",style:{width:`${v}%`,backgroundColor:o,height:`${l}px`},children:u&&e(q,{className:"ff-progress-bar-percentage",fontSize:f,color:h,children:`${Math.round(v)}%`})})}),g&&e("div",{className:"ff-progress-bar-label",children:e(q,{fontSize:c,color:d,children:e(Y,{title:Ln(g,10,"count")?g:"",children:xn(g,10,"count")})})})]})},ix=({variant:t="primary",size:n="small",onClick:r,label:i="Choose File",disabled:o=!1,type:l="button",className:s="",style:d={},iconName:f,isChooseFile:h=!1,buttonWidth:C="auto",buttonHeight:p="auto",selectedFile:m={},handleCloseIcon:g,isMandatory:v=!1})=>{const A=a(null),[y,w]=c(0);u(()=>{A.current&&w(A.current.getBoundingClientRect().width-10)},[C]);const b=m?.name||i,E=y?xn(b,y,"pixel"):b,M=!!y&&Ln(b,y,"pixel");return e("div",{ref:A,style:{width:C},children:e(Y,{title:M?b:"",children:e(U,{variant:t,label:E,type:l,onClick:r,buttonWidth:C,buttonHeight:p,isChooseFile:h,size:n,disabled:o,className:s,iconName:f,style:d,iconPosition:"right",selectedFile:m,handleCloseIcon:g,isMandatory:v})})})},ox=({selected:t="text",handleClick:r,tabList:i})=>{const o=i?.includes("Automation"),a=i?.includes("Manual");return n("div",{className:"ff-script-switch-container",children:[e(Y,{title:o?"Automation":"Add Automation",zIndex:1e3,children:e("div",{className:"ff-script-switch-button "+("Automation"===t?"active":""),onClick:()=>r(o?"Automation":"Add Automation"),children:e(F,{name:o?"automation_testcase":"add_testcase",color:"Automation"===t?"var(--primary-button-text-color)":"var(--description-text)"})})}),e(Y,{title:a?"Manual":"Add Manual",zIndex:1e3,children:e("div",{className:"ff-script-switch-button "+("Manual"===t?"active":""),onClick:()=>r(a?"Manual":"Add Manual"),children:e(F,{name:a?"manual_testcase":"add_testcase",color:"Manual"===t?"var(--primary-button-text-color)":"var(--description-text)"})})})]})},ax=({selected:t,handleClick:n,tabList:r})=>e("div",{className:"ff-switch-container",children:r.map(r=>e(Y,{title:t===r.name?null:r.tooltip,zIndex:1e3,children:e("div",{className:"ff-switch-button "+(t===r.name?"active":""),onClick:()=>n(r.name),children:e(F,{name:r.icon,color:t===r.name?"var(--primary-button-text-color)":"var(--description-text)"})})},r.name))}),lx=({onModalClose:t,MediaSrc:r,fileName:o,onDeleteClick:a,mediaType:s,fileId:d,thumbnailMediaSrc:u,isDelete:f=!0,onExpandClick:h,onDownloadClick:C,isMediaIcon:p=!1,previewOnly:m=!1,iconName:g="video_preview",isDisabled:v=!1})=>{const[A,y]=c(!1),w=i.useRef(null),b=()=>{y(!0),h&&h(d)},E=()=>{t?.(),y(!1)},M=()=>{C&&C(d)};return l(()=>{m&&y(!0)},[m]),n("div",{children:[!m&&(p?e(F,{name:g,hoverEffect:!0,onClick:b,disabled:v}):e(ew,{mediaSrc:r,mediaType:s,onDownloadClick:M,onDeleteClick:()=>a?.(r),onExpandClick:b,fileName:o,fileId:d,thumbnailMediaSrc:u,isDelete:f})),A&&e(Hp,{isOpen:A,onClose:E,isFooterDisplayed:!1,isHeaderDisplayed:!1,customWidth:"1130px",customHeight:"570px",zIndex:1e4,children:n("div",{className:"media-wrapper",children:[n("div",{className:"ff-expand-icons",children:[e(Y,{title:"Download File",children:e(F,{name:"download_file_icon",onClick:M,color:"var(--icons-default-color)",className:"header-icons"})}),e(Y,{title:"Expand",children:e(F,{name:"expand",onClick:b,color:"var(--icons-default-color)",className:"header-icons"})}),e(Y,{title:"close",children:e(F,{name:"close",onClick:E,color:"var(--icons-default-color)",className:"header-icons"})})]}),"image"===s&&e("img",{src:r,alt:"fileName",height:"auto"}),"video"===s&&e("video",{src:r,controls:!0,controlsList:"nodownload",className:"ff-video-preview",ref:w,onCanPlay:()=>{if(w.current){const e=w.current.play();void 0!==e&&e.catch(e=>{console.error("Autoplay failed:",e)})}}})]})})]})},sx=({children:t,orientation:r="",navBarIcons:o=[],mobileHeight:a=448,mobileWidth:l=220,UtilityBar:s,tooltip:c={},background:d,navBarPosition:u="bottom"})=>{const f="portrait"===r,h=f?a:l,C=f?l:a,p=s&&"top"===u,m=s&&"bottom"===u,g=s&&"left"===u;return n("div",{className:["ff-mobileskin-wrapper",f?"portrait":"landscape",g?"ff-side-nav-left":"",p?"navbar-top":"",m?"navbar-bottom":""].filter(Boolean).join(" "),children:[p&&e("div",{className:"ff-nav-bar top-nav-bar",children:o.map(({title:t,name:n,className:r,...i},a)=>{const l=c?.[n]??a;return e(Y,{title:c?.[n]||"",placement:"top",children:e("div",{className:`ff-nav-bar-icon ${r||""} ${a===o.length-1?"last-icon":""} ${p?"navbar-top":""}`,children:e(F,{name:n,...i})})},l)})}),e("div",{className:"ff-mobileskin-container",style:{height:h+16,width:C+16},children:e("div",{className:"ff-mobile-container",style:{width:C,height:h,background:d||"transparent"},children:e("div",{className:"ff-mobile-image-container",children:i.isValidElement(t)?t:e("img",{src:t,alt:"Mobile content",style:{width:f?"100%":2.1*l+"px",height:f?"100%":.5*a+"px"}})})})}),s&&m&&e("div",{className:"ff-nav-bar",children:o?.map((t,n)=>{const{title:r,...i}=t;return e("div",{className:`ff-nav-bar-icon ${t?.className||""} ${n===o.length-1?"last-icon":""}`,children:e(Y,{title:r,children:e(F,{...i})})},n)})}),s&&g&&e("div",{className:"ff-side-nav-bar",children:o?.map((t,n)=>{const{title:r,...i}=t;return e("div",{className:`ff-sidebar ${t?.className||""} ${n===o.length-1?"last-icon":""}`,children:e(Y,{title:r,placement:"bottom",children:e(F,{...i})})},n)})})]})},cx=o(({width:t=300,height:r=40,iconHeight:i=16,iconWidth:o=16,placeholder:l="Enter text",iconName:s="right_arrow_filled_icon",iconPosition:c="left",borderRadius:d=4,autoFocus:u=!1,value:f="",iconColor:h="var(--brand-color)",tooltipTitle:C="send",submitPrompt:p,onPromptChange:m,onBlur:g,onFocus:v,disableInput:A,isAdditionalIcon:y=!1,additionalIconName:w,additionIconToolTip:b,onAdditionalIconClick:E},M)=>{const x=a(null);Sn([{key:"Enter",action:()=>L()}],x);const L=e=>{f&&p?.(f.trim())};return n("div",{className:D("ff-prompt-container",{"icon-left":"left"===c,"icon-right":"left"!==c}),style:{width:`${t}px`,height:`${r}px`,borderRadius:d},ref:x,children:[e(Y,{placement:"top",title:C,children:e(F,{name:s,className:"ff-prompt-icon",height:i,width:o,onClick:p,color:h,disabled:G(f)})}),e("input",{ref:M,className:"ff-prompt-input",type:"text",placeholder:l,autoFocus:u,onChange:m,onFocus:v,onBlur:g,value:f,readOnly:A}),y&&w&&e(Y,{placement:"top",title:b,children:e(F,{name:w,className:"ff-prompt-icon additional-icon",height:i,width:o,onClick:E})})]})}),dx=({content:t,isVisible:n,maxWidth:r=300,onClick:i,isClickable:o=!0,arrowPosition:a="left"})=>e("div",{onClick:i,style:{width:`${r}px`,"--triangle-position":r-4+"px"},className:D("ff-chat-msg-box",{visible:n,hidden:!n,pointer:o,default:!o,"chat-arrow-left":"left"===a,"chat-arrow-right":"left"!==a}),children:e("div",{className:D("content",`arrow-${a}`),children:e(q,{children:t})})}),ux=({iconName:r,iconPosition:{top:i,left:o,bottom:a,right:l},hoverIconPosition:{top:s,left:d,bottom:u,right:f},modalPosition:{top:h,left:C,bottom:p,right:m},modalWidth:g,modalHeight:v,headerContent:A="Header Content",footerContent:y="Footer Content",iconWidth:w,iconHeight:b,modalHeading:E="Ask Fia",children:x,onClearChat:L})=>{const[H,k]=c(!1),[V,S]=c(!1);return n(t,{children:[n("div",{style:{top:void 0!==i?`${i}px`:void 0,left:void 0!==o?`${o}px`:void 0,bottom:void 0!==a?`${a}px`:void 0,right:void 0!==l?`${l}px`:void 0},className:"ff-dynamic-icon-container",children:[e(F,{className:"ff-dynamic-icon",name:r,onClick:()=>{S(e=>!e),setTimeout(()=>k(e=>!e),10)},height:b,width:w}),e("div",{style:{top:void 0!==s?`${s}px`:void 0,left:void 0!==d?`${d}px`:void 0,bottom:void 0!==u?`${u}px`:void 0,right:void 0!==f?`${f}px`:void 0},className:"ff-chat-icon-hover",children:e(F,{name:"ask_fia_icon",height:32,width:82})})]}),V&&M(e("div",{className:D("ff-dynamic-modal",{open:H}),style:{top:void 0!==h?`${h}px`:void 0,left:void 0!==C?`${C}px`:void 0,bottom:void 0!==p?`${p}px`:void 0,right:void 0!==m?`${m}px`:void 0,position:"fixed",height:v,width:g},children:n("div",{className:"ff-dynamic-modal-content",children:[A&&e("div",{className:"ff-dynamic-modal-header",children:n("div",{className:"header-container",children:[n("div",{className:"header-left",children:[e(F,{height:16,width:16,name:"fia_icon"}),e(q,{fontWeight:"medium",children:E})]}),n("div",{className:"header-right",children:[e("span",{className:"action",children:e(Y,{title:"Clear chat",placement:"bottom",children:e(F,{height:16,width:16,name:"delete",color:"var(--tooltip-text-color)",onClick:L})})}),e("span",{className:"action",children:e(Y,{title:"Close",placement:"bottom",children:e(F,{height:16,width:16,name:"close",color:"var(--tooltip-text-color)",onClick:()=>(k(!1),void setTimeout(()=>S(!1),300))})})})]})]})}),e("div",{className:"ff-dynamic-modal-body",children:x}),y&&e("div",{className:"ff-dynamic-modal-footer",children:y})]})}),document.body)]})},fx=o(({iconName:r,hoverTitle:i,iconPosition:{top:o,left:a,bottom:l,right:s},hoverIconPosition:{top:c,left:d,bottom:u,right:f},modalPosition:{top:h,left:C,bottom:p,right:m},modalWidth:g,modalHeight:v,headerContent:A="Header Content",footerContent:y="Footer Content",iconWidth:b,iconHeight:E,children:x,isVisible:L,isOpen:H,onOpen:k,onClose:V,isIconVisible:S},z)=>(w(z,()=>({closeModal:V})),n(t,{children:[S&&n("div",{style:{top:void 0!==o?`${o}px`:void 0,left:void 0!==a?`${a}px`:void 0,bottom:void 0!==l?`${l}px`:void 0,right:void 0!==s?`${s}px`:void 0},className:"ff-ai-dynamic-icon-container",children:[e(F,{className:"ff-ai-dynamic-icon",name:r,onClick:k,height:E,width:b}),e("div",{style:{top:void 0!==c?`${c}px`:void 0,left:void 0!==d?`${d}px`:void 0,bottom:void 0!==u?`${u}px`:void 0,right:void 0!==f?`${f}px`:void 0},className:"ff-ai-chat-icon-hover",children:e("div",{className:"ai-hover-leaf",children:e(q,{fontWeight:"bold",fontSize:14,color:"var(--chatbot-leaf-text)",children:i})})})]}),L&&M(e("div",{className:D("ff-ai-dynamic-modal",{open:H}),style:{top:void 0!==h?`${h}px`:void 0,left:void 0!==C?`${C}px`:void 0,bottom:void 0!==p?`${p}px`:void 0,right:void 0!==m?`${m}px`:void 0,position:"fixed",height:v,width:g},children:n("div",{className:"ff-ai-dynamic-modal-content",children:[A&&e("div",{className:"ff-ai-dynamic-modal-header",children:A}),e("div",{className:"ff-ai-dynamic-modal-body",children:x}),y&&e("div",{className:"ff-ai-dynamic-modal-footer",children:y})]})}),document.body)]}))),hx=({variant:t,title:r,tabTitle:i,comment:o,profileShortName:a})=>n("div",{className:"ff-history-card",children:[e("div",{className:D("header",`header--${t}`),children:e(q,{fontWeight:"semi-bold",children:i})}),n("div",{className:"body",children:[e("div",{className:"title",children:n("div",{className:"profile",children:[e(q,{className:D("avatar",`avatar--${t}`),children:a}),e(q,{children:r})]})}),n("div",{className:"comment-container",children:[e(q,{fontWeight:"semi-bold",className:"heading",children:"Comments:"}),e(q,{color:"var(--details-page-value-color)",className:"comment",children:o})]})]})]}),Cx=({onChange:t,disabled:r,checked:i=!1,id:o="toggle",path:a})=>n("div",{className:"ff--ai-switch-container",children:[e("input",{className:"ff--ai-switch-checkbox",id:`ff-toggle-${o}`,type:"checkbox",disabled:!!r,onChange:e=>{t&&t(e)},checked:i}),e("label",{className:D("ff--ai-switch-label",{"ff--ai-switch-label--disabled":r}),htmlFor:`ff-toggle-${o}`,children:e("span",{className:"ff--ai-switch-content",children:n("span",{className:"ff--ai-switch-content",children:[e(q,{className:D("ff--ai-switch-typography",{left:i,right:!i}),as:"div",fontWeight:"bold",fontSize:18,color:i?"var(--base-bg-color)":"var(--ff-ai-toggle-text-color)",children:"AI"}),e("img",{className:"ff--ai-switch-image",src:a,alt:"AI image"})]})})})]}),px=o(({name:t,height:n=30,width:r=30,path:i="",onClick:o,color:s="var(--brand-color)",hoverEffect:c=!1,className:d="",disabled:u=!1,variant:f="light",isSelected:h=!1,x:C,y:p,tabIndex:m=-1,...g},v)=>{if(!_[t])return null;const A=a(null);l(()=>{A.current&&(void 0!==C&&A.current.setAttribute("x",String(C)),void 0!==p&&A.current.setAttribute("y",String(p)))},[C,p]);const y={ref:v,onClick:u?void 0:o,style:{height:`${n}px`,width:`${r}px`,cursor:u?"not-allowed":"pointer",opacity:u?.3:1},tabIndex:m,...g};return e("span",{...y,children:e("img",{height:n,width:r,src:i,alt:""})})}),mx=({id:r=0,serialNumber:i,activeId:o,setActiveId:s,children:d,onIconClick:u,numberChildren:f,onContainerClick:h,onNextClick:C,onPreviousClick:p,disabled:m,isEditAccess:g,versionsLength:v,count:A,hiddenActions:y=[]})=>{const[w,b]=c(!1),[E,M]=c(!1),x=a(null),L=Array.isArray(y)?y:y?[y]:[],H=(e,t)=>{e.stopPropagation(),t()};l(()=>{x.current&&(()=>{if(x.current){const e=getComputedStyle(x.current),t=1.2*parseFloat(e.fontSize)*6;x.current.scrollHeight>t&&M(!0)}})()},[]);const k=e=>{e.stopPropagation(),b(!w)};return n("div",{className:`ff-prompt-container-Block ${o===r?"active":"inactive"} `,onClick:()=>{s(r),h()},children:[e(q,{fontSize:8,className:"ff-prompt-number-bg-color",as:"span",children:`Test cases ${i}`}),n(t,{children:[n("div",{className:"ff-prompt-content "+(w?"expanded":""),ref:x,children:[d,w&&n(t,{children:[e("span",{role:"button","aria-label":"toggleExpand",onClick:k,className:"read-less-btn",children:e(q,{color:"var(--brand-color)",fontWeight:"semi-bold",className:"read-more-btn-text",children:"Read Less"})})," "]})]}),E&&!w&&e("div",{role:"button","aria-label":"toggleExpand",onClick:k,className:"read-more-btn",children:e(q,{color:"var(--brand-color)",fontWeight:"semi-bold",className:"read-more-btn-text",children:"Read More"})})]}),n("div",{className:"ff-prompt-icons",children:[e("div",{className:"ff-prompt-icons-leftside",children:[{action:"delete",title:"Delete",color:"var(--ff-delete-button-attachment)"},{action:"edit",title:"Edit",color:"var(--label-edit-text-label-color)"},{action:"regenerate",title:"Regenerate",color:"var(--label-edit-text-label-color)"}].filter(e=>!L.includes(e.action)).map((t,n)=>{const r=g&&"delete"===t?.action||"regenerate"===t?.action&&(v??0)>=3||m;return e(Y,{title:t.title,placement:"bottom",children:e(F,{disabled:r,name:t.action,color:t.color,hoverEffect:!0,onClick:e=>((e,t)=>{e.stopPropagation(),u(t)})(e,t.action)})},`${t?.title}-${n}`)})}),n("div",{className:"ff-prompt-icons-rightside",children:[e(F,{disabled:1===A,className:"ff-prompt-icons-style",name:"arrow_left_accordian",color:"var(--table-column-text-color)",width:18,height:18,onClick:e=>H(e,p),cursorType:"pointer"}),f,e(F,{disabled:A===v,className:"ff-prompt-icons-style",name:"arrow_right_icon",color:"var(--table-column-text-color)",width:18,height:18,onClick:e=>H(e,C),cursorType:"pointer"})]})]})]})},gx=o(({type:t="text",variant:r="primary",name:i="",label:o,disabled:a=!1,disableLinkIcon:l=!1,required:s=!1,placeholder:c="Attach Link",value:d,error:u,helperText:f,noBorder:h,className:C="",onChange:p,onBlur:m,onFocus:g,autoComplete:v="off",autoFocus:A=!1,minValue:y=-1/0,maxValue:w=1/0,transparentBackground:b=!1,size:E="small",isLabelRequired:M=!0,onClick:x,onKeyUp:L,isViewMode:H=!1,...k},V)=>{const S=!G(d);return n("fieldset",{className:D("ff-link-input-fieldset",{"ff-link-input-fieldset--disabled":a}),children:[n("div",{className:D("ff-link-input-container",{"ff-link-input-container--float":S,"ff-link-input-container--disabled":!!a}),children:[M&&n("label",{className:D(`ff-link-input-label-container ff-link-input-label-container--${E}`,{"ff-link-input-label-container--danger":!!u}),htmlFor:i,children:[s&&e("span",{className:"required-asterisk",children:"*"}),e("span",{className:D(`ff-link-input-label ff-link-input-label--${r}`,{"ff-link-input-label--no-hover":!!d,"ff-link-input-label--disabled":!!a,"ff-link-input-label--danger":!!u}),children:o})]}),e("input",{ref:V,name:i,value:d,type:t,spellCheck:!1,id:i,className:D(`ff-link-input ff-link-input-${r} default-input ff-link-input--${E}`,{"ff-link-input--transparentBackground":!!b,"ff-link-input--no-hover":!!d,"ff-link-input--disabled":!!a,"ff-link-input--danger":!!u,"ff-link-input--no-border":!!h,"ff-link-input--placeholder":!M},`${C}`),placeholder:c,disabled:H||a,onChange:p,onFocus:g,onBlur:m,autoComplete:v,autoFocus:A,min:y,max:w,onClick:x,onKeyUp:L,...k}),e("div",{className:"input-link-icon",children:l||u||!S?e(F,{name:"link",disabled:!0}):e(Y,{title:"Click here to navigate",children:e("span",{children:e(F,{name:"link",disabled:!1,onClick:()=>{d&&!u&&window.open(d,"_blank")}})})})})]}),f&&u&&e("span",{className:D("ff-link-input-message",{"ff-link-input-message--danger":!!u}),children:f})]})}),vx=({labelsList:r=[],height:i=""})=>{const o=Ci(),a=e("div",{className:"ff-chip-tooltip",children:r.filter((e,t)=>t>0).map((t,n)=>e(q,{as:"div",className:"ff-chip-tooltip-label",children:t},`label-${n}-${t}`))});return e(t,{children:!G(r)&&n("div",{className:"ff-chip-with-count-container",children:[e(q,{as:"div",fontWeight:"medium",className:"ff-chip-label",style:i?{height:i}:void 0,children:e(su,{children:r[0]||""})}),r.length>1&&n(t,{children:[n(q,{as:"div",className:"ff-chip-count","data-tooltip-id":`tooltip-${o}`,fontWeight:"medium",children:["+",r.length-1]}),e("div",{id:`tooltip-${o}`,className:"ff-chip-tooltip-template",children:e(q,{as:"div",children:a})})]})]})})};class Ax extends b{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t)}render(){return this.state.hasError?this.props.fallback:this.props.children}}const yx=({iconName:t="",onButtonClick:r,buttonLabel:i="Label",buttonText:o="To Add Group",disableButton:a=!1,stepCount:l=1,iconWidth:s=120,iconHeight:c=120,addContentLabel:d="step"})=>n("div",{className:"add-content-button "+(a?"disabled":""),children:[!G(t)&&e("div",{className:"icon-container",children:e(F,{name:t,width:s,height:c})}),n("div",{className:"typography-label-button",children:[n(q,{fontSize:"12px",fontWeight:"regular",lineHeight:"18px",children:[d+l," :"]}),e(q,{fontSize:"12px",fontWeight:"semi-bold",lineHeight:"18px",children:"Click"}),e(Lp,{label:i,onClick:r,iconName:"plus_user_icon",isDisable:a}),e(q,{fontSize:"12px",fontWeight:"semi-bold",lineHeight:"18px",children:o})]})]}),wx=({variant:t="default",tabsData:r,activeTabId:i,onTabClick:o,noBorder:a=!1,noPadding:l=!1,titleSize:s="12px"})=>{const[d,u]=c(0);return n("div",{className:"ff-tabs-slider-container",children:[n("div",{className:D(`ff-tab-row--${t} ff-tab-row-section`,{"ff-tab-row--no-border":a,"ff-tab-row--no-padding":l,"ff-tab-row--position":r.length>4}),children:[r.length>4&&e(F,{className:"ff-tab-icon ff-tab-icon--previous",name:""+(d?"arrow_left_accordian":""),onClick:()=>{d>0&&u(e=>e-1)},hoverEffect:!0}),e("div",{className:"ff-tab-row-carousel",children:e("div",{className:"carousel_inner",style:{transform:`translateX(-${100*d}%)`},children:r.map(r=>n("button",{onClick:()=>!r.disabled&&o(r.id),disabled:r.disabled,className:D(`ff-tab-button--${t}`,{disabled:r.disabled,active:i===r.id}),style:{flex:"0 0 25%"},children:[n("div",{className:"label-count-section",children:[e(Y,{title:r.label.length>9?r.label:"",children:e(q,{children:r.label.length>9?r.label.slice(0,9)+"...":r.label,fontSize:s,lineHeight:"18px",fontWeight:i===r.id?"semi-bold":"regular",color:i===r.id?"var(--tabs-label-active-color)":"var(--tabs-label-default-color)",className:D("ff-tab-label",{"ff-tab-label--active":i===r.id})})}),"default"===t&&r.count&&e("span",{className:D("tab-count",{"tab-count--active":i===r.id}),children:r.count})]}),e("div",{className:D("ff-tab-bar",{"ff-tab-bar--active":i===r.id})}),e("span",{className:"ff-defaultStatus "+("success"===r.status?"ff-successStatus":"error"===r.status?"ff-dangerStatus":"")})]},r.id))})}),r.length>4&&e(F,{className:"ff-tab-icon ff-tab-icon--next",name:""+(d<Math.ceil(r.length/4)-1?"arrow_right_icon":""),onClick:()=>{d<Math.ceil(r.length/4)-1&&u(e=>e+1)},hoverEffect:!0})]}),e("div",{className:"ff-tab-content",children:r.find(e=>e.id===i)?.component})]})},bx=o(({label:t="Status",iconName:r="update_icon",onClick:i,isDisable:o=!1,variant:a="default",backgroundColor:l=!1,border:s=!1},c)=>{const d={default:"var(--ff-avatar-background-color)",success:"var(--status-success-text-color)",danger:"var(--ff-delete-button-attachment)"};return e("button",{disabled:o,onClick:i,className:`\n ff-status-indicator\n ff-status-indicator--${a}\n ${l?`ff-status-indicator--with-bg ff-status-indicator--${a}-bg`:""}\n ${s?`ff-status-indicator--with-border ff-status-indicator--${a}-border`:""}\n `,ref:c,children:n("div",{className:"ff-status-indicator__content",children:[e(F,{name:"danger"===a?"close":r,color:d[a]||d.default,className:`ff-status-indicator__icon ff-status-indicator__icon--${a}`}),e(q,{as:"div",fontSize:12,className:`ff-status-indicator__label ff-status-indicator__label--${a}`,fontWeight:"medium",lineHeight:"20px",children:t})]})})}),Ex=({rootLabel:t,childrenLabels:r,align:i="center",direction:o="horizontal"})=>{const a=r.length;return n("div","vertical"===o?{className:"ff-os-tree-vertical",style:{"--child-count":a},children:[n("div",{className:`ff-os-tree-vertical__row ff-os-tree-vertical__row--${i}`,children:[e("div",{className:"ff-os-tree-vertical__root-label",children:t}),e("div",{className:"ff-os-tree-vertical__horizontal-line"})]}),n("div",{className:"ff-os-tree-vertical__vertical-line-wrapper",children:[e("div",{className:"ff-os-tree-vertical__vertical-line"}),r.map((t,r)=>n("div",{className:"ff-os-tree-vertical__child",children:[e("div",{className:"ff-os-tree-vertical__child-connector"}),e("div",{className:"ff-os-tree-vertical__child-label",children:t})]},r))]})]}:{className:`ff-os-tree ff-os-tree--${i}`,style:{"--child-count":a},children:[n("div",{className:"ff-os-tree__root-wrapper",children:[e("div",{className:"ff-os-tree__root-label",children:t}),e("div",{className:"ff-os-tree__vertical-root"})]}),e("div",{className:"ff-os-tree__horizontal-connector",children:r.map((t,n)=>e("div",{className:"ff-os-tree__vertical-child"},n))}),e("div",{className:"ff-os-tree__children",children:r.map((t,n)=>e("div",{className:"ff-os-tree__child-container",children:e("div",{className:"ff-os-tree__child-label",children:t})},n))})]})},Mx=({handleClose:t,handleResend:r,handleOtp:i,resendTimeout:o=30})=>{const[s,d]=c(Array(6).fill("")),[u,f]=c(o),[h,C]=c(!0),p=a(Array(6).fill(null));l(()=>{h||p.current[0]?.focus()},[h]),l(()=>{let e;return u>0&&(e=window.setInterval(()=>f(e=>e-1),1e3)),0===u&&C(!1),()=>clearInterval(e)},[u]);const m=e=>{e.preventDefault();const t=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,6),n=Array(6).fill("");t.split("").forEach((e,t)=>{n[t]=e}),d(n);const r=Math.min(t.length,5);p.current[r]?.focus()};return e(Hp,{isOpen:!0,onClose:t,isFooterDisplayed:!1,isHeaderDisplayed:!1,zIndex:999999,customWidth:"340px",children:n("div",{className:"ff-otp-popup",children:[n("div",{className:"ff-otp-header",children:[e(q,{fontSize:24,lineHeight:"36px",fontWeight:"semi-bold",children:"OTP Verification"}),e(F,{name:"close",height:16,width:16,onClick:t,className:"ff-close-icon"})]}),e("div",{className:"ff-otp-boxes",children:s.map((t,n)=>e("input",{type:"text",maxLength:1,className:`ff-otp-input ${t?"filled":""} ${n===s.findIndex(e=>""===e)?"active":""}`,value:t,onKeyDown:e=>((e,t)=>{const{key:n}=e;if(/^[0-9]$/.test(n)){e.preventDefault();const r=[...s];r[t]=n,d(r),t<5&&p.current[t+1]?.focus()}else if("Backspace"===n){e.preventDefault();const n=[...s];n[t]="",d(n),t>0&&p.current[t-1]?.focus()}})(e,n),onPaste:m,ref:e=>p.current[n]=e,readOnly:!0},n))}),e(U,{variant:"primary",label:"Submit",onClick:()=>i(s.join("")),disabled:s.includes(""),className:"ff-submit-btn"}),n("div",{className:"ff-resend "+(h?"disabled":""),onClick:h?void 0:()=>{f(o),C(!0),d(Array(6).fill("")),r()},children:["Re-send OTP",u>0?` (${u}s)`:""]})]})})},xx=({isOpen:t,onClose:r,isPlaying:i,onTogglePlay:o,mediaType:s,src:d,headerTitle:u,onDownload:f,onExpand:h,showHeader:p=!0,showDownload:m=!0,showExpand:g=!0,width:v="800px",height:A="432px",showControls:y=!0,customStyle:w,overlay:b=!0,children:E,showControlDownload:M=!1,showControlExpand:x=!1,isFullscreen:L=!1})=>{const H=a(null),k=a(null),[V,S]=c(0),[z,O]=c(0),[N,D]=c(!1),[T,I]=c(0);l(()=>{"video"===s&&H.current&&!E&&(i?H.current.play():H.current.pause())},[i,s,E]);const Z=C(()=>{if(H.current&&!N){const e=H.current.currentTime/H.current.duration*100;I(e||0),S(H.current.currentTime)}},[N]),R=C(()=>{H.current&&O(H.current.duration)},[]),j=C(()=>{S(0),I(0),o?.()},[o]),B=C(e=>`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`,[]),P=C(e=>{if(H.current){const t=e/100*H.current.duration;H.current.currentTime=t,I(e),S(t)}},[]),_=C(e=>{if(N||!k.current)return;const t=k.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));P(i)},[P,N]),U=C(e=>{if(!k.current)return;D(!0);const t=k.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));P(i)},[P]),W=C(e=>{if(!N||!k.current||!H.current)return;const t=k.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));P(i)},[N,P]),X=C(()=>{D(!1)},[]);return l(()=>{if(N)return document.addEventListener("mousemove",W),document.addEventListener("mouseup",X),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",X)}},[N,W,X]),t?e(eu,{isOpen:t,onClose:r,isMaximized:!1,showHeader:p,overlay:b,downloadHandler:()=>{},customStyle:w,header:n("div",{className:"ff-header-content",children:[e(F,{width:23,height:23,name:"automatic_locator"}),e(q,{children:e("span",{className:"ff-header-title",children:u})})]}),icons:e(Y,{title:"Close",children:e(F,{name:"close",onClick:r})}),width:v,height:A,zIndex:999,children:n("div",{className:"ff-video-wrapper",children:[E||("video"===s?e("video",{ref:H,src:d,className:"ff-media-video",onTimeUpdate:Z,onLoadedMetadata:R,onEnded:j}):e("img",{src:d,alt:"Preview",className:"ff-media-image"})),n("div",{className:"ff-top-right-icons",children:[m&&e(Y,{title:"Download",children:e(F,{name:"download_file",color:"white",onClick:f})}),g&&e(Y,{title:L?"Minimize":"Maximize",children:e(F,{name:L?"collapse_icon":"expand_icon",color:"white",onClick:h})})]}),"video"===s&&y&&!E&&n("div",{className:"ff-media-controls",children:[e("button",{onClick:o,className:"ff-play-pause-btn",children:e(Y,{title:i?"Pause":"Play",children:e(F,{width:35,height:35,name:i?"pause_button":"play_button",color:"white"})})}),n("div",{className:"ff-progress-bar",children:[e("span",{className:"ff-current-time",children:B(V)}),e("input",{type:"range",className:"ff-seek-bar",min:0,max:100,value:T,onChange:e=>P(parseFloat(e.target.value)),onClick:_,onMouseDown:U,ref:k}),e("span",{className:"ff-total-time",children:B(z)})]}),n("div",{className:"ff-control-icons",children:[M&&e(Y,{title:"Download",children:e(F,{name:"download_file",color:"white",onClick:f,cursorType:"pointer"})}),x&&e(Y,{title:L?"Minimize":"Maximize",children:e(F,{name:L?"collapse_icon":"expand_icon",color:"white",onClick:h,cursorType:"pointer"})})]})]})]})}):null},Lx=({header:r,secondaryHeader:i,primaryCount:o,secondaryCount:a,primaryItems:l,secondaryItems:s,width:c,activeTab:d="primary",activeTabId:u,onPrimaryTabClick:f,onSecondaryTabClick:h,onTabClick:C,actions:p,tabsData:m,notchPosition:g="top-left"})=>{const v=i&&"secondary"===d?s:l,A=a&&parseInt(a)>0,y=o&&parseInt(o)>0,w=i&&(y||A),{tooltip:b="Download",iconName:E="download_file",disabled:M=!1,onClick:x,className:L=""}=p?.download||{},{tooltip:H="Delete",iconName:k="delete_icon",disabled:V=!1,onClick:S,className:z=""}=p?.delete||{},O=()=>n("div",{className:"ff-dropdown-header-icons",children:[p?.download&&e(Y,{title:b,children:e(F,{name:E||"",className:`ff-dropdown-icon ff-download-icon ${L}`,onClick:x,width:18,height:20,disabled:M,hoverEffect:!0})}),p?.delete&&e(Y,{title:H,children:e(F,{name:k||"",className:`ff-dropdown-icon ff-delete-icon ${z}`,onClick:S,width:25,height:25,disabled:V,hoverEffect:!0})})]});return n("div",{className:"ff-resolution-dropdown",style:c?{minWidth:c}:{},children:[e("div",{className:"ff-dropdown-notch "+("bottom-center"===g?"bottom-center":"top-left")}),e("div",{className:"ff-dropdown-header",children:e("div",{className:"ff-dropdown-header-content",children:i&&m&&u?n(t,{children:[e(mu,{tabsData:m,activeTabId:u,onTabClick:e=>{C&&C(e),"tab-1"===e&&f?f():"tab-2"===e&&h&&h()}}),w&&O()]}):i&&w?n("div",{className:"ff-dropdown-header-dual",children:[n("div",{className:"ff-dropdown-header-item "+("primary"===d?"active":""),onClick:f,children:[e(q,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:r}),o&&e("span",{className:"ff-dropdown-count",children:o})]}),n("div",{className:"ff-dropdown-header-item "+("secondary"===d?"active":""),onClick:h,children:[e(q,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:i}),a&&e("span",{className:"ff-dropdown-count",children:a})]}),O()]}):i?n("div",{className:"ff-dropdown-header-dual",children:[n("div",{className:"ff-dropdown-header-item "+("primary"===d?"active":""),onClick:f,children:[e(q,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:r}),o&&e("span",{className:"ff-dropdown-count",children:o})]}),n("div",{className:"ff-dropdown-header-item "+("secondary"===d?"active":""),onClick:h,children:[e(q,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:i}),a&&e("span",{className:"ff-dropdown-count",children:a})]})]}):e(q,{fontSize:16,fontWeight:"semi-bold",children:r})})}),e("ul",{className:"ff-dropdown-list",children:v?.map((t,n)=>e("li",{className:"ff-dropdown-item",children:t},n))})]})},Hx=(e,t,n,r)=>{const i=e[t.accessor];if(t.cell){const o=e._id||e.id;return t.cell({value:i,row:e,column:t.accessor,index:n,tableType:r,...o&&{refId:o}})}return t.accessor||i&&"object"!=typeof i?i:"--"},kx=(t,n=[],r,i,o)=>{let a=n;const l=void 0!==i?!i:r;return G(n)&&(isNaN(t)||(a=Array(t).fill(!0))),e("div",{className:"tree-table-fn-space-container",children:a?.map((n,r)=>e("span",{className:`tree-table-fn-space-block tree-table-fn-space-block-${r} ${n?"":"no-lines"} ${l&&r===t-1?"last-node":""} ${o?"folder":""}`},r))})},Vx=i.memo(({treeRowRef:r,col:i,colIndex:o,columnMeta:a,node:l,selected:s,select:c,onCheckBoxChange:d,onToggleExpand:u,onAddConfirm:f,onAddCancel:h,handleEditFieldError:C,isExpanding:p,columnTextColor:m,hideOnDisable:g,addModuleInputWidth:v,addModuleSelectWidth:A,disableEditLabelConfirmIcon:y,isEditable:w,setIsEditable:b})=>{const E={color:`${m||"var(--ff-primary-text-color)"}`,width:a?.width??i?.width,position:a?.sticky?"sticky":void 0,left:a?.sticky?a.left:void 0,zIndex:a?.sticky?a.zIndex:void 0};return n("div",{className:`ff-table-tree-fn-td ${i.isTree&&l.container?"folder":""} ${a?.sticky?"sticky-tree-column":""}`,"data-col-index":o,style:E,children:[i.isTree&&kx(l.hierarchy,l.parentSiblings,l.lastChild,l.nextSibling,l.container),n("div",{className:"tree-fn-title-container",children:[i.isTree&&e("span",{className:`tree-table-fn-space-block last-tree-fn-block last-tree-fn-block tree-table-fn-space-block-${l.hierarchy} ${l?.expanded?"tree-fn-row-expanded":"tree-fn-row-collapsed"} ${l.container&&l.expandable?"":"no-tree-folder"}`,children:l.container&&l.expandable&&n("span",{onClick:()=>u(l),children:[" ",e(p?du:T,{})]})}),n("span",{className:"tree-table-fn-td-content "+(i.isTree&&l.container?"folder":""),children:[!l?.isNewNode&&n(t,{children:[i.isTree&&"checkbox"===c&&!(g&&l.unselectable)&&e("span",{className:"tree-table-fn-td-content-select",children:"none"===l.selectedStatus?e(Y,{title:l?.currentEnvId&&l?.envId&&l?.currentEnvId!==l?.envId?"This script is assigned to another environment. Selecting it will reassign it to the current environment.":void 0,children:e(bn,{checked:"completely"===l.selectedStatus,partial:"partially"===l.selectedStatus,onChange:e=>d(e,l),disabled:l.unselectable||"REVIEW"===l.state||!0===l?.isDisable,isDefaultHover:"none"===l.selectedStatus&&!!l.machine})}):e(bn,{checked:"completely"===l.selectedStatus,partial:"partially"===l.selectedStatus,onChange:e=>d(e,l),disabled:l.unselectable||"REVIEW"===l.state||!0===l?.isDisable})}),i.isTree&&"radio"===c&&!(g&&l.unselectable)&&e("span",{className:"tree-table-fn-td-content-select",children:e(lc,{name:l.key,checked:s.includes(l.key),value:l.key,onChange:e=>d(e,l),disabled:l.unselectable||"REVIEW"===l.state||!0===l?.isDisable})})]}),e("div",{className:"tree-table-cell-flex",children:l.isNewNode&&i.isTree?e(cu,{onCancel:h,onConfirm:f,value:l.value,label:l?.label,optionsList:l.options,selectedOption:l.selectedOption,withDropdown:"inputWithDropdown"===l.type,handleCustomError:C,inputFieldWidth:v,selectFieldWidth:A,confirmIconTooltip:l.confirmIconTooltip,cancelIconTooltip:l.cancelIconTooltip,isEditable:w,setIsEditable:b,isOnBlurTrue:!1,isDisable:{confirm:y},isTableTree:!0}):n(t,{children:[e("span",{className:"tree-table-fn-td-content-text",children:Hx(l,i)}),i.actions&&!l?.isNewNode&&e("div",{className:"table-tree-fn-row-action",children:i.actions(l,r)})]})})]})]})]})});Vx.displayName="TableCell";const Sx=i.memo(({node:t,columnsData:n,columnMeta:r,selected:i,select:o,onRowClick:l,onToggleExpand:s,onCheckBoxChange:c,onAddConfirm:d,onAddCancel:u,handleEditFieldError:f,isExpanding:h,index:C,selectedNode:p,hideOnDisable:m,addModuleInputWidth:g,addModuleSelectWidth:v,disableEditLabelConfirmIcon:A,isEditable:y,setIsEditable:w,style:b})=>{const E=a(null);return e("div",{"data-level":t.hierarchy,ref:E,className:"ff-table-tree-fn-row show-tree "+(p&&p===t.key?"fn-selected-node":""),onClick:e=>l(e,t),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||l(e,t)},role:"button",tabIndex:0,id:0===C?"table-fn-first-row":t.key,style:b,children:n.map((n,a)=>e(Vx,{treeRowRef:E,col:n,colIndex:a,node:t,selected:i,select:o,onCheckBoxChange:c,onToggleExpand:s,onAddConfirm:d,onAddCancel:u,handleEditFieldError:f,isExpanding:h,hideOnDisable:m,addModuleInputWidth:g,addModuleSelectWidth:v,disableEditLabelConfirmIcon:A,isEditable:y,setIsEditable:w,columnMeta:r?.[a]},n.name))})});Sx.displayName="TableRow";const zx=({flattenedTreeData:t,columnsData:n,columnMeta:r,rowHeight:i=32,startIndex:o=0,totalHeight:a=0,selected:l,select:s,onRowClick:c,onToggleExpand:d,onCheckBoxChange:u,onAddConfirm:f,onAddCancel:h,handleEditFieldError:C,expanding:p,selectedNode:m,hideOnDisable:g,addModuleInputWidth:v,addModuleSelectWidth:A,disableEditLabelConfirmIcon:y,isEditable:w,setIsEditable:b})=>e("div",{className:"ff-table-tree-fn-body",style:{height:`${a}px`,position:"relative"},children:t?.map((t,a)=>e(Sx,{node:t,columnsData:n,columnMeta:r,selected:l,select:s,onRowClick:c,onToggleExpand:d,onCheckBoxChange:u,onAddConfirm:f,onAddCancel:h,handleEditFieldError:C,isExpanding:t.key===p,index:o+a,selectedNode:m,hideOnDisable:g,addModuleInputWidth:v,addModuleSelectWidth:A,disableEditLabelConfirmIcon:y,isEditable:w,setIsEditable:b,style:{transform:`translateY(${(o+a)*i}px)`,height:`${i}px`,position:"absolute",top:0,left:0,right:0}},t.key))}),Ox=i.memo(({columnsData:t,columnMeta:r,totalWidth:i,rootNode:o,selected:s,onCheckBoxChange:d,selectedNode:u,tableHeaderBgColor:f,hideOnDisable:h,transparentHeader:C,showHeader:p=!0})=>{const m=a(null),[g,v]=c(!1);l(()=>{v(!0)},[]);const A=(e,t)=>{const n=r?.[e];return{width:n?.width??t,position:n?.sticky?"sticky":void 0,left:n?.sticky?n.left:void 0,zIndex:n?.sticky?n.zIndex:void 0}};return n("div",{className:"ff-table-tree-fn-head",children:[p&&e("div",{className:"ff-table-tree-fn-row no-hover",style:{minWidth:i},children:t.map(({name:t,width:n},i)=>e("div",{className:"ff-table-tree-fn-th "+(r?.[i]?.sticky?"sticky-tree-column":""),"data-col-index":i,style:{...A(i,n),backgroundColor:C?"transparent":f,pointerEvents:C?"none":"auto"},children:t},t))}),o&&e("div",{className:"ff-table-tree-fn-row show-tree "+(u&&u===o?.node?.key?"hover":""),ref:m,children:t.map((t,i)=>e("div",{className:"ff-table-tree-fn-td "+(r?.[i]?.sticky?"sticky-tree-column":""),"data-col-index":i,style:A(i,t.width),children:n("span",{className:"tree-table-fn-default-content "+(0===i?"ff-table-root-index-0":""),children:[0===i&&"checkbox"===o.select&&!(h&&o.node.isDisabled)&&e(bn,{checked:"partially"!==o?.node?.selectedStatus&&("completely"===o?.node?.selectedStatus||!1),partial:"partially"===o.node.selectedStatus,onChange:e=>d(e,o.node),disabled:o.node.isDisabled}),0===i&&"radio"===o.select&&!(h&&o.node.isDisabled)&&e(lc,{name:o.node.key,checked:s.includes(o.node.key),value:o.node.key,onChange:e=>d(e,o.node),disabled:o.node.isDisabled}),n("div",{className:"tree-table-cell-flex",children:[e(su,{children:"name"===t.accessor?o.node[t.accessor]:Hx(o.node,t)}),o.cell&&0===i&&e("span",{className:"table-tree--fn-root-cell",children:o.cell(o.node)}),o.actions&&0===i&&g&&m.current&&e("div",{className:"table-tree-fn-row-action",children:o.actions(o.node,m)})]})]})},i))})]})});Ox.displayName="TableHead";const Nx=32,Dx="__root__",Tx=(e,t)=>{if(!e?.length)return[];const n=new Map,r=new Map,i=new Map,o=new Map;t&&t.key&&n.set(t.key,t),e.forEach(e=>{n.set(e.key,e);const t=e.parentId??Dx;r.has(t)||(r.set(t,[]),o.set(t,{container:0,resource:0})),r.get(t)?.push(e);const i=o.get(t);i&&(e.container?i.container++:i.resource++)}),r.forEach(e=>{e.forEach((e,t)=>{i.set(e.key,t)})});const a=e=>{const t=e.parentId??Dx,a=r.get(t);if(!a||0===a.length)return!1;if((i.get(e.key)??0)<a.length-1)return!0;const l=n.get(t),s=o.get(t);if(l&&s){const t=a.filter(e=>e.container).reduce((e,t)=>e+(t.totalResourceCount??0),0),n=a.filter(e=>!e.container).length,r=Math.max(0,(l.totalResourceCount??0)-(t+n));if(e.container){return s.container<(l.subContainerCount??0)||r>0}return s.resource<r}return!1},l=e=>{if(void 0!==e.selectedStatus)return e.selectedStatus;let r=e;for(;r?.parentId;){const e=n.get(r.parentId);if(!e)break;if("completely"===e.selectedStatus)return"completely";if("none"===e.selectedStatus)return"none";r=e}return"completely"===t?.selectedStatus?"completely":"none"===t?.selectedStatus?"none":e.selectedStatus};return e.map(e=>{const t=e,r=t.parentSiblings&&t.parentSiblings.length>0?t.parentSiblings:(e=>{const t=e.hierarchy??0;if(t<=0)return[];const r=[];let i=e;for(;i&&(r.unshift(i),i.parentId);){const e=n.get(i.parentId);if(!e)break;i=e}const o=r.map(e=>a(e));return o.length===t?o:o.length>t?o.slice(o.length-t):new Array(t-o.length).fill(!1).concat(o)})(e);return{...e,lastChild:!a(e),parentSiblings:r,selectedStatus:l(e)}})},Ix=o(({treeData:t,columnsData:r,selected:i=[],select:o=null,onChange:s=()=>{},onClick:d=()=>{},onExpand:f=()=>{},loadMore:p=()=>{},tableBorder:m,height:g="calc(100vh - 134px)",newNode:v,onAddConfirm:A=()=>{},onAddCancel:y=()=>{},handleEditFieldError:w,loading:b=!1,rootNode:E,pagination:M=!0,selectedNode:x,tableHeaderBgColor:L="var(--border-color)",hideOnDisable:H=!1,freezeColumns:k,addModuleInputWidth:V=150,addModuleSelectWidth:S,onScroll:z,onScrollEnd:O,disableEditLabelConfirmIcon:N=!1,transparentHeader:D=!1,navigateTreeNode:T=null,handleRemoveNavigateTreeNode:I=()=>{},scrollThreshold:Z=128,showHeader:R=!0,resetScroll:j=!1,setResetScroll:B=()=>{}},P)=>{const[_,F]=c(null),[q,U]=c(null),[W,X]=c({start:0,end:20}),[Q,Y]=c(!1),K=a(null),J=a(null),$=a(0),ee=a(b),te=a(null),ne=a(null),re=a({lastScrollTop:0}),ie=a([]),oe=a(0),ae=a(null),le=a(null),se=a(null),ce=a({key:null,attempts:0}),de=a(null),ue=(e,t)=>{const n=String(e??t);return n.endsWith("%")?{value:parseFloat(n),unit:"%"}:{value:parseFloat(n)||0,unit:"px"}},fe=h(()=>{let e=0,t=0;return r.map((n,r)=>{const{value:i,unit:o}=ue(n.width,400),a=!!k&&r<k,l="%"===o?`${i}%`:`${i}px`,s=`calc(${e}px + ${t}%)`;return a&&("%"===o?t+=i:e+=i),{width:l,sticky:a,left:s,zIndex:a?100+(k??0)-r:1}})},[r,k]),he=h(()=>{let e=0,t=0;return r.forEach(n=>{const{value:r,unit:i}=ue(n.width,400);"%"===i?t+=r:e+=r}),`calc(${e}px + ${t}%)`},[r]),Ce=h(()=>{if(!k)return"0px";let e=0,t=0;return fe.slice(0,k).forEach(n=>{const r=parseFloat(n.width)||0;n.width.endsWith("%")?t+=r:e+=r}),`calc(${e}px + ${t}%)`},[fe,k]),pe=h(()=>((e,t,n)=>{if(!t?.sourceId||!t.action)return e;const{sourceId:r,action:i,value:o="",error:a="",label:l,type:s,options:c,selectedOption:d,confirmIconTooltip:u,cancelIconTooltip:f,payloadSourceId:h}=t,C=t?.parentId,p=t?.hierarchy,m=c?.map(e=>({label:e,value:e})),g=d?{label:d,value:d}:void 0,v=new Map;e.forEach(e=>v.set(e.key,e)),n&&v.set(n.key,n);const A=v.get(r);let y;h&&(y=v.get(h));let w=A??("addInside"===i?y:void 0);!w&&"addInside"===i&&C&&(w=v.get(C));const b="addInside"===i&&!w&&e.length>=0;if(!w&&!b)return e;const E=[...e],M=w?e.findIndex(e=>e.key===w.key):-1;let x=null,L=0,H=M+1;switch(i){case"addAbove":{const t=w;if(!t)return e;x=t.parentId,L=t.hierarchy;break}case"addBelow":{const t=w;if(!t)return e;x=y?.parentId??t.parentId,L=y?.hierarchy??t.hierarchy;break}case"addInside":{if(b){x=C??h??r??null,L=p??1,H=E.length;break}const t=y??w;if(!t)return e;x=t.key,L=(t.hierarchy??0)+1;const n=E.findIndex(e=>e.key===r);-1!==n&&(H=n+1);break}}const k={hierarchy:L,parentId:x,sourceId:w?.key??r??h??"new-node",isNewNode:!0,key:"new-node",value:o,error:a,label:l,type:s,options:m,selectedOption:g,confirmIconTooltip:u,cancelIconTooltip:f};switch(i){case"addAbove":E.splice(M,0,k);break;case"addBelow":E.splice(M+1,0,k);break;case"addInside":E.splice(Math.max(0,H),0,k)}return E})(t,v,E?.node),[t,v,E]),me=h(()=>Tx(pe,E?.node),[pe,E?.node]),ge=h(()=>me.filter(e=>!e.hide),[me]),ve=h(()=>{const e=new Map;return me.forEach(t=>e.set(t.key,t)),e},[me]),Ae=h(()=>{const e=new Map;return ge.forEach((t,n)=>e.set(t.key,n)),e},[ge]),ye=C(e=>{F(t=>t?e&&t!==e?t:null:t),e&&le.current?.key!==e||(le.current=null),se.current&&(clearTimeout(se.current),se.current=null)},[]);l(()=>{ee.current=b},[b]),l(()=>{te.current=q},[q]);const we=C(e=>{te.current=e,U(e)},[]),be=C(()=>{const e=K.current;if(!e)return;const t=$.current||0,n=Math.max(0,e.scrollTop-t),r=e.clientHeight-t;let i=Math.floor(n/Nx)-6,o=Math.ceil((n+r)/Nx)+6;i=Math.max(0,i),o=Math.min(ge.length,o),X(e=>e.start===i&&e.end===o?e:{start:i,end:o})},[ge.length]),Ee=C(()=>{null===ne.current&&(ne.current=requestAnimationFrame(()=>{ne.current=null,be()}))},[be]),Me=C(()=>{const e=K.current;if(!e)return;const n=e.scrollTop,r=n>re.current.lastScrollTop?"down":"up";if(re.current.lastScrollTop=n,Ee(),z?.(),ae.current?.(),!M||b||te.current||G(t))return;const i=e.scrollHeight,o=e.clientHeight;"down"===r&&i-(n+o)<Z&&!t[t.length-1]?.lastResource&&(we("below"),p("below"))},[t,M,b,q,Z,Ee,z,p,we]);l(()=>{if(b||!M||G(t))return;const e=t[0],n=!e?.lastResource,{totalSubContainerCount:r=0,totalResourceCount:i=0}=E?.node||{},o=r+i,a=ge.length<10&&ge.length<o;n&&a&&(we("above"),p("above"))},[b,M,t,ge.length,E,p,we]),u(()=>{const e=ie.current,t=ge,n=K.current;if(j&&n)return n.scrollTop=0,re.current.lastScrollTop=0,void B(!1);if(n&&e.length>0&&t.length>0&&!b){const r=re.current.lastScrollTop,i=Math.max(0,Math.floor(r/Nx));let o=-1,a=-1;for(let t=i;t<e.length;t++){const n=e[t]?.key,r=Ae.get(n??"");if(void 0!==r){o=t,a=r;break}}if(-1===o)for(let t=i-1;t>=0;t--){const n=e[t]?.key,r=Ae.get(n??"");if(void 0!==r){o=t,a=r;break}}if(-1!==o&&-1!==a){const e=a-o,t=Math.max(0,r+e*Nx);n.scrollTop!==t&&(n.scrollTop=t,re.current.lastScrollTop=n.scrollTop,be())}else if("above"===q)0!==n.scrollTop&&(n.scrollTop=0,re.current.lastScrollTop=0,be());else{const e=$.current||0,r=Math.max(0,t.length*Nx-(n.clientHeight-e));n.scrollTop>r&&(n.scrollTop=r,re.current.lastScrollTop=r,be())}q&&we(null)}ie.current=t},[b,q,Ae,ge,we,be,j,B]),l(()=>{const e=K.current;if(!e)return;const n=n=>{n.deltaY>=0||!M||G(t)||ee.current||te.current||e.scrollTop>1||t[0]?.lastResource||(we("above"),p("above"))};return e.addEventListener("wheel",n,{passive:!0}),()=>{e.removeEventListener("wheel",n)}},[M,t,p,we]),l(()=>{const e=K.current;if(e)return ae.current=O?Xs(()=>{O?.()},150):null,e.addEventListener("scroll",Me,{passive:!0}),()=>{e.removeEventListener("scroll",Me),ae.current?.cancel()}},[Me,O]),l(()=>{const e=K.current;if(!e)return;const t=e=>{Date.now()<oe.current&&e.stopImmediatePropagation()};return e.addEventListener("scroll",t,{passive:!0,capture:!0}),()=>{e.removeEventListener("scroll",t,!0)}},[]),l(()=>{const e=J.current;if(!e)return;const t=new ResizeObserver(()=>{$.current=e.getBoundingClientRect().height,be()});return t.observe(e),()=>t.disconnect()},[be]),u(()=>{if(!v||!K.current)return;const e=K.current,t=Ae.get("new-node");if(void 0===t)return;const n=$.current||0,r=e.clientHeight-n;if(r<=0)return;const i=t*Nx,o=i+Nx,a=Math.max(0,e.scrollTop-n);let l=a;i<a?l=i:o>a+r&&(l=Math.max(0,o-r)),l!==a&&(oe.current=Date.now()+300,e.scrollTop=l+n,re.current.lastScrollTop=e.scrollTop,be());const s=requestAnimationFrame(()=>{Y(!0)});return()=>cancelAnimationFrame(s)},[v,Ae,be]),l(()=>{v||Y(!1)},[v]),u(()=>{if(!_||b)return;const e=le.current;if(!e||e.key!==_){const e=requestAnimationFrame(()=>{ye(_)});return()=>cancelAnimationFrame(e)}const t=ve.get(e.key);if(!t){const t=requestAnimationFrame(()=>{ye(e.key)});return()=>cancelAnimationFrame(t)}if(Boolean(t.expanded)!==e.expanded)return;const n=requestAnimationFrame(()=>{ye(e.key)});return()=>cancelAnimationFrame(n)},[ve,_,b,ye]),l(()=>{ce.current.key!==T&&(ce.current={key:T,attempts:0}),!T&&de.current&&(clearTimeout(de.current),de.current=null)},[T]),u(()=>{if(!T||v)return;const e=K.current;if(!e)return;const n=Ae.get(T);if(void 0!==n){ce.current={key:T,attempts:0};const t=$.current||0,r=Math.max(Nx,e.clientHeight-t),i=n*Nx+16,o=Math.max(0,i-r/2)+t;return oe.current=Date.now()+400,e.scrollTo({top:o,behavior:"smooth"}),Ee(),de.current&&clearTimeout(de.current),void(de.current=setTimeout(()=>{I?.()},350))}if(b||q)return;const r=ce.current;if(r.key!==T&&(r.key=T,r.attempts=0),r.attempts+=1,!(r.attempts>30))return M&&!0!==t[0]?.lastResource?(we("above"),void p("above")):void(r.attempts>2&&I?.());I?.()},[T,v,Ae,b,q,M,t,p,Ee,I,we]);const xe=C(e=>{if(_)return;const t=!e?.expanded;F(e.key),le.current={key:e.key,expanded:t},se.current&&clearTimeout(se.current);const n=Date.now(),r=()=>{if(le.current?.key!==e.key)return;const t=ee.current,i=Date.now()-n>=2e3;!t||i?ye(e.key):se.current=setTimeout(r,1e3)};se.current=setTimeout(r,1e3),f?.(e)},[_,f,ye]),Le=C((e,t)=>{_||s?.(e,t)},[s,_]),He=C((e,t)=>{_||d?.(e,t)},[d,_]);l(()=>()=>{null!==ne.current&&(cancelAnimationFrame(ne.current),ne.current=null),se.current&&clearTimeout(se.current),de.current&&clearTimeout(de.current)},[]);const ke=ge.length*Nx,Ve=ge.slice(W.start,W.end);return e("div",{className:"tree-table-wrapper-container table-tree-fn",children:e("div",{className:"tree-table-fn-wrap",ref:P,children:e("div",{className:"table-fn-scrollable "+(ge.length?"":"table-fn-empty"),ref:K,style:{"--table-height":ge.length?g:"auto","--frozen-column-width":Ce,border:m},children:n("div",{className:"tree-table-fn",style:{width:he},children:[e("div",{ref:J,style:{position:"sticky",top:0,zIndex:98},children:e(Ox,{columnsData:r,columnMeta:fe,totalWidth:he,rootNode:E,onCheckBoxChange:Le,selected:i,selectedNode:x,tableHeaderBgColor:L,hideOnDisable:H,transparentHeader:D,showHeader:R})}),e(zx,{flattenedTreeData:Ve,columnsData:r,columnMeta:fe,totalWidth:he,rowHeight:Nx,startIndex:W.start,totalHeight:ke,selected:i,select:o,onRowClick:He,onToggleExpand:xe,onCheckBoxChange:Le,onAddConfirm:A,onAddCancel:y,handleEditFieldError:w,expanding:_,selectedNode:x,hideOnDisable:H,addModuleInputWidth:V,addModuleSelectWidth:S,disableEditLabelConfirmIcon:N,isEditable:v?Q:void 0,setIsEditable:v?e=>{Y(Boolean(e))}:void 0})]})})})})});Ix.displayName="TableTreeFn";const Zx=t=>e(tg,{logo:()=>"FireFlink"===t?.name?e(F,{height:100,width:100,name:"fire_flink_loader_logo"}):e("img",{src:t?.loaderName,width:100,height:100,alt:"loader"})}),Rx=({isVisible:t})=>t?n("div",{className:"no_data_message",children:[e(F,{name:"no_content",width:120,height:120}),e(q,{fontSize:"20px",lineHeight:"30px",fontWeight:"semi-bold",children:"No Data Available"})]}):null,jx=({text:t=" No Results Found",iconName:r="no_license_found",fontSize:i="24px",textAlign:o="left",direction:a="column",iconWidth:l=120,iconHeight:s=120,fontWeight:c="semi-bold"})=>e("article",{className:"no_results_container",children:n("div",{className:`no_results_container__${a}`,children:[e(F,{name:r,width:l,height:s}),e("div",{children:e(q,{as:"div",fontSize:i,lineHeight:"36px",fontWeight:c,color:"var(--text-color)",textAlign:o,children:t})})]})}),Bx=({drawerProps:n,showDrawer:r,children:i,zIndex:o=1200,top:a="56px"})=>r?e(vn,{isOpen:n?.isOpen??!0,...n,zIndex:o,top:a,children:i}):e(t,{children:i});const Px=({children:n,offlineContent:r,hasError:i=!1,onNetworkStatusChange:o,overlayClassName:a,overlayZIndex:s=99998,iconWidth:d=300,iconHeight:u=300})=>{const f=function(){const[e,t]=c(navigator.onLine);return l(()=>{const e=()=>{t(!0)},n=()=>{t(!1)};return window.addEventListener("online",e),window.addEventListener("offline",n),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}},[]),e}();return l(()=>{o&&o(f)},[f,o]),i||!f?e("div",{className:`offlineOverlay ${a??""}`,style:{zIndex:s},children:r||e(F,{name:"offline_404_icon",height:u,width:d})}):e(t,{children:n})};function _x(e,t,n,r,i,o="children"){return function e(a){for(let l=0;l<a.length;l++){const s=a[l];if(s&&s[t]===n){const e=[...a];return"replace"===i?e[l]=r:e.splice("above"===i?l:l+1,0,r),{updatedArray:e}}if(s&&s[o]&&Array.isArray(s[o])){const t=e(s[o]);if(t)return{updatedArray:a.map((e,n)=>n===l?{...e,[o]:t.updatedArray}:e)}}}return null}(e)}const Fx=(e,t)=>{if(e===t)return!0;if(null==e||null==t||"object"!=typeof e||"object"!=typeof t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=Array.isArray(e),r=Array.isArray(t);if(n!==r)return!1;const i=n?e:Object.keys(e),o=r?t:Object.keys(t);if(i.length!==o.length)return!1;if(n)return i.every((e,t)=>Fx(e,o[t]));{const n=new Set(o);return i.every(r=>n.has(r)&&Fx(e[r],t[r]))}},qx=(e,t)=>!(!Array.isArray(e)||!Array.isArray(t))&&(e.length===t.length&&e.every((e,n)=>{const r=t[n];return Fx(e,r)}));function Ux(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function Wx(e,t){return e&t}function Xx(e,t){return e|t}function Qx(e,t){return e^t}function Gx(e,t){return e&~t}function Yx(e){if(0==e)return-1;var t=0;return 65535&e||(e>>=16,t+=16),255&e||(e>>=8,t+=8),15&e||(e>>=4,t+=4),3&e||(e>>=2,t+=2),1&e||++t,t}function Kx(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var Jx,$x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function eL(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=$x.charAt(n>>6)+$x.charAt(63&n);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=$x.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=$x.charAt(n>>2)+$x.charAt((3&n)<<4));(3&r.length)>0;)r+="=";return r}function tL(e){var t,n="",r=0,i=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t){var o=$x.indexOf(e.charAt(t));o<0||(0==r?(n+=Ux(o>>2),i=3&o,r=1):1==r?(n+=Ux(i<<2|o>>4),i=15&o,r=2):2==r?(n+=Ux(i),n+=Ux(o>>2),i=3&o,r=3):(n+=Ux(i<<2|o>>4),n+=Ux(15&o),r=0))}return 1==r&&(n+=Ux(i<<2)),n}var nL,rL=function(e){var t;if(void 0===Jx){var n="0123456789ABCDEF",r=" \f\n\r\t \u2028\u2029";for(Jx={},t=0;t<16;++t)Jx[n.charAt(t)]=t;for(n=n.toLowerCase(),t=10;t<16;++t)Jx[n.charAt(t)]=t;for(t=0;t<8;++t)Jx[r.charAt(t)]=-1}var i=[],o=0,a=0;for(t=0;t<e.length;++t){var l=e.charAt(t);if("="==l)break;if(-1!=(l=Jx[l])){if(void 0===l)throw new Error("Illegal character at offset "+t);o|=l,++a>=2?(i[i.length]=o,o=0,a=0):o<<=4}}if(a)throw new Error("Hex encoding incomplete: 4 bits missing");return i},iL={decode:function(e){var t;if(void 0===nL){var n="= \f\n\r\t \u2028\u2029";for(nL=Object.create(null),t=0;t<64;++t)nL["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(nL["-"]=62,nL._=63,t=0;t<9;++t)nL[n.charAt(t)]=-1}var r=[],i=0,o=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if("="==a)break;if(-1!=(a=nL[a])){if(void 0===a)throw new Error("Illegal character at offset "+t);i|=a,++o>=4?(r[r.length]=i>>16,r[r.length]=i>>8&255,r[r.length]=255&i,i=0,o=0):i<<=6}}switch(o){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:r[r.length]=i>>10;break;case 3:r[r.length]=i>>16,r[r.length]=i>>8&255}return r},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(e){var t=iL.re.exec(e);if(t)if(t[1])e=t[1];else{if(!t[2])throw new Error("RegExp out of sync");e=t[2]}return iL.decode(e)}},oL=1e13,aL=function(){function e(e){this.buf=[+e||0]}return e.prototype.mulAdd=function(e,t){var n,r,i=this.buf,o=i.length;for(n=0;n<o;++n)(r=i[n]*e+t)<oL?t=0:r-=(t=0|r/oL)*oL,i[n]=r;t>0&&(i[n]=t)},e.prototype.sub=function(e){var t,n,r=this.buf,i=r.length;for(t=0;t<i;++t)(n=r[t]-e)<0?(n+=oL,e=1):e=0,r[t]=n;for(;0===r[r.length-1];)r.pop()},e.prototype.toString=function(e){if(10!=(e||10))throw new Error("only base 10 is supported");for(var t=this.buf,n=t[t.length-1].toString(),r=t.length-2;r>=0;--r)n+=(oL+t[r]).toString().substring(1);return n},e.prototype.valueOf=function(){for(var e=this.buf,t=0,n=e.length-1;n>=0;--n)t=t*oL+e[n];return t},e.prototype.simplify=function(){var e=this.buf;return 1==e.length?e[0]:this},e}(),lL=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,sL=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function cL(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}var dL,uL=function(){function e(t,n){this.hexDigits="0123456789ABCDEF",t instanceof e?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=n)}return e.prototype.get=function(e){if(void 0===e&&(e=this.pos++),e>=this.enc.length)throw new Error("Requesting byte offset ".concat(e," on a stream of length ").concat(this.enc.length));return"string"==typeof this.enc?this.enc.charCodeAt(e):this.enc[e]},e.prototype.hexByte=function(e){return this.hexDigits.charAt(e>>4&15)+this.hexDigits.charAt(15&e)},e.prototype.hexDump=function(e,t,n){for(var r="",i=e;i<t;++i)if(r+=this.hexByte(this.get(i)),!0!==n)switch(15&i){case 7:r+=" ";break;case 15:r+="\n";break;default:r+=" "}return r},e.prototype.isASCII=function(e,t){for(var n=e;n<t;++n){var r=this.get(n);if(r<32||r>176)return!1}return!0},e.prototype.parseStringISO=function(e,t){for(var n="",r=e;r<t;++r)n+=String.fromCharCode(this.get(r));return n},e.prototype.parseStringUTF=function(e,t){for(var n="",r=e;r<t;){var i=this.get(r++);n+=i<128?String.fromCharCode(i):i>191&&i<224?String.fromCharCode((31&i)<<6|63&this.get(r++)):String.fromCharCode((15&i)<<12|(63&this.get(r++))<<6|63&this.get(r++))}return n},e.prototype.parseStringBMP=function(e,t){for(var n,r,i="",o=e;o<t;)n=this.get(o++),r=this.get(o++),i+=String.fromCharCode(n<<8|r);return i},e.prototype.parseTime=function(e,t,n){var r=this.parseStringISO(e,t),i=(n?lL:sL).exec(r);return i?(n&&(i[1]=+i[1],i[1]+=+i[1]<70?2e3:1900),r=i[1]+"-"+i[2]+"-"+i[3]+" "+i[4],i[5]&&(r+=":"+i[5],i[6]&&(r+=":"+i[6],i[7]&&(r+="."+i[7]))),i[8]&&(r+=" UTC","Z"!=i[8]&&(r+=i[8],i[9]&&(r+=":"+i[9]))),r):"Unrecognized time: "+r},e.prototype.parseInteger=function(e,t){for(var n,r=this.get(e),i=r>127,o=i?255:0,a="";r==o&&++e<t;)r=this.get(e);if(0===(n=t-e))return i?-1:0;if(n>4){for(a=r,n<<=3;!(128&(+a^o));)a=+a<<1,--n;a="("+n+" bit)\n"}i&&(r-=256);for(var l=new aL(r),s=e+1;s<t;++s)l.mulAdd(256,this.get(s));return a+l.toString()},e.prototype.parseBitString=function(e,t,n){for(var r=this.get(e),i="("+((t-e-1<<3)-r)+" bit)\n",o="",a=e+1;a<t;++a){for(var l=this.get(a),s=a==t-1?r:0,c=7;c>=s;--c)o+=l>>c&1?"1":"0";if(o.length>n)return i+cL(o,n)}return i+o},e.prototype.parseOctetString=function(e,t,n){if(this.isASCII(e,t))return cL(this.parseStringISO(e,t),n);var r=t-e,i="("+r+" byte)\n";r>(n/=2)&&(t=e+n);for(var o=e;o<t;++o)i+=this.hexByte(this.get(o));return r>n&&(i+="…"),i},e.prototype.parseOID=function(e,t,n){for(var r="",i=new aL,o=0,a=e;a<t;++a){var l=this.get(a);if(i.mulAdd(128,127&l),o+=7,!(128&l)){if(""===r)if((i=i.simplify())instanceof aL)i.sub(80),r="2."+i.toString();else{var s=i<80?i<40?0:1:2;r=s+"."+(i-40*s)}else r+="."+i.toString();if(r.length>n)return cL(r,n);i=new aL,o=0}}return o>0&&(r+=".incomplete"),r},e}(),fL=function(){function e(e,t,n,r,i){if(!(r instanceof hL))throw new Error("Invalid tag value.");this.stream=e,this.header=t,this.length=n,this.tag=r,this.sub=i}return e.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},e.prototype.content=function(e){if(void 0===this.tag)return null;void 0===e&&(e=1/0);var t=this.posContent(),n=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+n,e);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(t)?"false":"true";case 2:return this.stream.parseInteger(t,t+n);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(t,t+n,e);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+n,e);case 6:return this.stream.parseOID(t,t+n,e);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return cL(this.stream.parseStringUTF(t,t+n),e);case 18:case 19:case 20:case 21:case 22:case 26:return cL(this.stream.parseStringISO(t,t+n),e);case 30:return cL(this.stream.parseStringBMP(t,t+n),e);case 23:case 24:return this.stream.parseTime(t,t+n,23==this.tag.tagNumber)}return null},e.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},e.prototype.toPrettyString=function(e){void 0===e&&(e="");var t=e+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(t+="+"),t+=this.length,this.tag.tagConstructed?t+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(t+=" (encapsulates)"),t+="\n",null!==this.sub){e+=" ";for(var n=0,r=this.sub.length;n<r;++n)t+=this.sub[n].toPrettyString(e)}return t},e.prototype.posStart=function(){return this.stream.pos},e.prototype.posContent=function(){return this.stream.pos+this.header},e.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},e.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},e.decodeLength=function(e){var t=e.get(),n=127&t;if(n==t)return n;if(n>6)throw new Error("Length over 48 bits not supported at position "+(e.pos-1));if(0===n)return null;t=0;for(var r=0;r<n;++r)t=256*t+e.get();return t},e.prototype.getHexStringValue=function(){var e=this.toHexString(),t=2*this.header,n=2*this.length;return e.substring(t,t+n)},e.decode=function(t){var n;n=t instanceof uL?t:new uL(t,0);var r=new uL(n),i=new hL(n),o=e.decodeLength(n),a=n.pos,l=a-r.pos,s=null,c=function(){var t=[];if(null!==o){for(var r=a+o;n.pos<r;)t[t.length]=e.decode(n);if(n.pos!=r)throw new Error("Content size is not correct for container starting at offset "+a)}else try{for(;;){var i=e.decode(n);if(i.tag.isEOC())break;t[t.length]=i}o=a-n.pos}catch(e){throw new Error("Exception while decoding undefined length content: "+e)}return t};if(i.tagConstructed)s=c();else if(i.isUniversal()&&(3==i.tagNumber||4==i.tagNumber))try{if(3==i.tagNumber&&0!=n.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");s=c();for(var d=0;d<s.length;++d)if(s[d].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(e){s=null}if(null===s){if(null===o)throw new Error("We can't skip over an invalid tag with undefined length at offset "+a);n.pos=a+Math.abs(o)}return new e(r,l,o,i,s)},e}(),hL=function(){function e(e){var t=e.get();if(this.tagClass=t>>6,this.tagConstructed=!!(32&t),this.tagNumber=31&t,31==this.tagNumber){var n=new aL;do{t=e.get(),n.mulAdd(128,127&t)}while(128&t);this.tagNumber=n.simplify()}}return e.prototype.isUniversal=function(){return 0===this.tagClass},e.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber},e}(),CL=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],pL=(1<<26)/CL[CL.length-1],mL=function(){function e(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}return e.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var n,r=(1<<t)-1,i=!1,o="",a=this.t,l=this.DB-a*this.DB%t;if(a-- >0)for(l<this.DB&&(n=this[a]>>l)>0&&(i=!0,o=Ux(n));a>=0;)l<t?(n=(this[a]&(1<<l)-1)<<t-l,n|=this[--a]>>(l+=this.DB-t)):(n=this[a]>>(l-=t)&r,l<=0&&(l+=this.DB,--a)),n>0&&(i=!0),i&&(o+=Ux(n));return i?o:"0"},e.prototype.negate=function(){var t=wL();return e.ZERO.subTo(this,t),t},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+VL(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var n=wL();return this.abs().divRemTo(t,null,n),this.s<0&&n.compareTo(e.ZERO)>0&&t.subTo(n,n),n},e.prototype.modPowInt=function(e,t){var n;return n=e<256||t.isEven()?new vL(t):new AL(t),this.exp(e,n)},e.prototype.clone=function(){var e=wL();return this.copyTo(e),e},e.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},e.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},e.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},e.prototype.toByteArray=function(){var e=this.t,t=[];t[0]=this.s;var n,r=this.DB-e*this.DB%8,i=0;if(e-- >0)for(r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[i++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),128&n&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(t[i++]=n);return t},e.prototype.equals=function(e){return 0==this.compareTo(e)},e.prototype.min=function(e){return this.compareTo(e)<0?this:e},e.prototype.max=function(e){return this.compareTo(e)>0?this:e},e.prototype.and=function(e){var t=wL();return this.bitwiseTo(e,Wx,t),t},e.prototype.or=function(e){var t=wL();return this.bitwiseTo(e,Xx,t),t},e.prototype.xor=function(e){var t=wL();return this.bitwiseTo(e,Qx,t),t},e.prototype.andNot=function(e){var t=wL();return this.bitwiseTo(e,Gx,t),t},e.prototype.not=function(){for(var e=wL(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},e.prototype.shiftLeft=function(e){var t=wL();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},e.prototype.shiftRight=function(e){var t=wL();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},e.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+Yx(this[e]);return this.s<0?this.t*this.DB:-1},e.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,n=0;n<this.t;++n)e+=Kx(this[n]^t);return e},e.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:!!(this[t]&1<<e%this.DB)},e.prototype.setBit=function(e){return this.changeBit(e,Xx)},e.prototype.clearBit=function(e){return this.changeBit(e,Gx)},e.prototype.flipBit=function(e){return this.changeBit(e,Qx)},e.prototype.add=function(e){var t=wL();return this.addTo(e,t),t},e.prototype.subtract=function(e){var t=wL();return this.subTo(e,t),t},e.prototype.multiply=function(e){var t=wL();return this.multiplyTo(e,t),t},e.prototype.divide=function(e){var t=wL();return this.divRemTo(e,t,null),t},e.prototype.remainder=function(e){var t=wL();return this.divRemTo(e,null,t),t},e.prototype.divideAndRemainder=function(e){var t=wL(),n=wL();return this.divRemTo(e,t,n),[t,n]},e.prototype.modPow=function(e,t){var n,r,i=e.bitLength(),o=kL(1);if(i<=0)return o;n=i<18?1:i<48?3:i<144?4:i<768?5:6,r=i<8?new vL(t):t.isEven()?new yL(t):new AL(t);var a=[],l=3,s=n-1,c=(1<<n)-1;if(a[1]=r.convert(this),n>1){var d=wL();for(r.sqrTo(a[1],d);l<=c;)a[l]=wL(),r.mulTo(d,a[l-2],a[l]),l+=2}var u,f,h=e.t-1,C=!0,p=wL();for(i=VL(e[h])-1;h>=0;){for(i>=s?u=e[h]>>i-s&c:(u=(e[h]&(1<<i+1)-1)<<s-i,h>0&&(u|=e[h-1]>>this.DB+i-s)),l=n;!(1&u);)u>>=1,--l;if((i-=l)<0&&(i+=this.DB,--h),C)a[u].copyTo(o),C=!1;else{for(;l>1;)r.sqrTo(o,p),r.sqrTo(p,o),l-=2;l>0?r.sqrTo(o,p):(f=o,o=p,p=f),r.mulTo(p,a[u],o)}for(;h>=0&&!(e[h]&1<<i);)r.sqrTo(o,p),f=o,o=p,p=f,--i<0&&(i=this.DB-1,--h)}return r.revert(o)},e.prototype.modInverse=function(t){var n=t.isEven();if(this.isEven()&&n||0==t.signum())return e.ZERO;for(var r=t.clone(),i=this.clone(),o=kL(1),a=kL(0),l=kL(0),s=kL(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),n?(o.isEven()&&a.isEven()||(o.addTo(this,o),a.subTo(t,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);for(;i.isEven();)i.rShiftTo(1,i),n?(l.isEven()&&s.isEven()||(l.addTo(this,l),s.subTo(t,s)),l.rShiftTo(1,l)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);r.compareTo(i)>=0?(r.subTo(i,r),n&&o.subTo(l,o),a.subTo(s,a)):(i.subTo(r,i),n&&l.subTo(o,l),s.subTo(a,s))}return 0!=i.compareTo(e.ONE)?e.ZERO:s.compareTo(t)>=0?s.subtract(t):s.signum()<0?(s.addTo(t,s),s.signum()<0?s.add(t):s):s},e.prototype.pow=function(e){return this.exp(e,new gL)},e.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var i=t.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return t;for(i<o&&(o=i),o>0&&(t.rShiftTo(o,t),n.rShiftTo(o,n));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},e.prototype.isProbablePrime=function(e){var t,n=this.abs();if(1==n.t&&n[0]<=CL[CL.length-1]){for(t=0;t<CL.length;++t)if(n[0]==CL[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<CL.length;){for(var r=CL[t],i=t+1;i<CL.length&&r<pL;)r*=CL[i++];for(r=n.modInt(r);t<i;)if(r%CL[t++]==0)return!1}return n.millerRabin(e)},e.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},e.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},e.prototype.fromString=function(t,n){var r;if(16==n)r=4;else if(8==n)r=3;else if(256==n)r=8;else if(2==n)r=1;else if(32==n)r=5;else{if(4!=n)return void this.fromRadix(t,n);r=2}this.t=0,this.s=0;for(var i=t.length,o=!1,a=0;--i>=0;){var l=8==r?255&+t[i]:HL(t,i);l<0?"-"==t.charAt(i)&&(o=!0):(o=!1,0==a?this[this.t++]=l:a+r>this.DB?(this[this.t-1]|=(l&(1<<this.DB-a)-1)<<a,this[this.t++]=l>>this.DB-a):this[this.t-1]|=l<<a,(a+=r)>=this.DB&&(a-=this.DB))}8==r&&128&+t[0]&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),o&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},e.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},e.prototype.drShiftTo=function(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s},e.prototype.lShiftTo=function(e,t){for(var n=e%this.DB,r=this.DB-n,i=(1<<r)-1,o=Math.floor(e/this.DB),a=this.s<<n&this.DM,l=this.t-1;l>=0;--l)t[l+o+1]=this[l]>>r|a,a=(this[l]&i)<<n;for(l=o-1;l>=0;--l)t[l]=0;t[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()},e.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,i=this.DB-r,o=(1<<r)-1;t[0]=this[n]>>r;for(var a=n+1;a<this.t;++a)t[a-n-1]|=(this[a]&o)<<i,t[a-n]=this[a]>>r;r>0&&(t[this.t-n-1]|=(this.s&o)<<i),t.t=this.t-n,t.clamp()}},e.prototype.subTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]-e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e[n],t[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()},e.prototype.multiplyTo=function(t,n){var r=this.abs(),i=t.abs(),o=r.t;for(n.t=o+i.t;--o>=0;)n[o]=0;for(o=0;o<i.t;++o)n[o+r.t]=r.am(0,i[o],n,o,0,r.t);n.s=0,n.clamp(),this.s!=t.s&&e.ZERO.subTo(n,n)},e.prototype.squareTo=function(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},e.prototype.divRemTo=function(t,n,r){var i=t.abs();if(!(i.t<=0)){var o=this.abs();if(o.t<i.t)return null!=n&&n.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=wL());var a=wL(),l=this.s,s=t.s,c=this.DB-VL(i[i.t-1]);c>0?(i.lShiftTo(c,a),o.lShiftTo(c,r)):(i.copyTo(a),o.copyTo(r));var d=a.t,u=a[d-1];if(0!=u){var f=u*(1<<this.F1)+(d>1?a[d-2]>>this.F2:0),h=this.FV/f,C=(1<<this.F1)/f,p=1<<this.F2,m=r.t,g=m-d,v=null==n?wL():n;for(a.dlShiftTo(g,v),r.compareTo(v)>=0&&(r[r.t++]=1,r.subTo(v,r)),e.ONE.dlShiftTo(d,v),v.subTo(a,a);a.t<d;)a[a.t++]=0;for(;--g>=0;){var A=r[--m]==u?this.DM:Math.floor(r[m]*h+(r[m-1]+p)*C);if((r[m]+=a.am(0,A,r,g,0,d))<A)for(a.dlShiftTo(g,v),r.subTo(v,r);r[m]<--A;)r.subTo(v,r)}null!=n&&(r.drShiftTo(d,n),l!=s&&e.ZERO.subTo(n,n)),r.t=d,r.clamp(),c>0&&r.rShiftTo(c,r),l<0&&e.ZERO.subTo(r,r)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},e.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},e.prototype.exp=function(t,n){if(t>4294967295||t<1)return e.ONE;var r=wL(),i=wL(),o=n.convert(this),a=VL(t)-1;for(o.copyTo(r);--a>=0;)if(n.sqrTo(r,i),(t&1<<a)>0)n.mulTo(i,o,r);else{var l=r;r=i,i=l}return n.revert(r)},e.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},e.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),r=kL(n),i=wL(),o=wL(),a="";for(this.divRemTo(r,i,o);i.signum()>0;)a=(n+o.intValue()).toString(e).substring(1)+a,i.divRemTo(r,i,o);return o.intValue().toString(e)+a},e.prototype.fromRadix=function(t,n){this.fromInt(0),null==n&&(n=10);for(var r=this.chunkSize(n),i=Math.pow(n,r),o=!1,a=0,l=0,s=0;s<t.length;++s){var c=HL(t,s);c<0?"-"==t.charAt(s)&&0==this.signum()&&(o=!0):(l=n*l+c,++a>=r&&(this.dMultiply(i),this.dAddOffset(l,0),a=0,l=0))}a>0&&(this.dMultiply(Math.pow(n,a)),this.dAddOffset(l,0)),o&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,n,r){if("number"==typeof n)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),Xx,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(n);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var i=[],o=7&t;i.length=1+(t>>3),n.nextBytes(i),o>0?i[0]&=(1<<o)-1:i[0]=0,this.fromString(i,256)}},e.prototype.bitwiseTo=function(e,t,n){var r,i,o=Math.min(e.t,this.t);for(r=0;r<o;++r)n[r]=t(this[r],e[r]);if(e.t<this.t){for(i=e.s&this.DM,r=o;r<this.t;++r)n[r]=t(this[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=o;r<e.t;++r)n[r]=t(i,e[r]);n.t=e.t}n.s=t(this.s,e.s),n.clamp()},e.prototype.changeBit=function(t,n){var r=e.ONE.shiftLeft(t);return this.bitwiseTo(r,n,r),r},e.prototype.addTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]+e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e[n],t[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()},e.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},e.prototype.multiplyLowerTo=function(e,t,n){var r=Math.min(this.t+e.t,t);for(n.s=0,n.t=r;r>0;)n[--r]=0;for(var i=n.t-this.t;r<i;++r)n[r+this.t]=this.am(0,e[r],n,r,0,this.t);for(i=Math.min(e.t,t);r<i;++r)this.am(0,e[r],n,r,0,t-r);n.clamp()},e.prototype.multiplyUpperTo=function(e,t,n){--t;var r=n.t=this.t+e.t-t;for(n.s=0;--r>=0;)n[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)n[this.t+r-t]=this.am(t-r,e[r],n,0,0,this.t+r-t);n.clamp(),n.drShiftTo(1,n)},e.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(0==t)n=this[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this[r])%e;return n},e.prototype.millerRabin=function(t){var n=this.subtract(e.ONE),r=n.getLowestSetBit();if(r<=0)return!1;var i=n.shiftRight(r);(t=t+1>>1)>CL.length&&(t=CL.length);for(var o=wL(),a=0;a<t;++a){o.fromInt(CL[Math.floor(Math.random()*CL.length)]);var l=o.modPow(i,this);if(0!=l.compareTo(e.ONE)&&0!=l.compareTo(n)){for(var s=1;s++<r&&0!=l.compareTo(n);)if(0==(l=l.modPowInt(2,this)).compareTo(e.ONE))return!1;if(0!=l.compareTo(n))return!1}}return!0},e.prototype.square=function(){var e=wL();return this.squareTo(e),e},e.prototype.gcda=function(e,t){var n=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(n.compareTo(r)<0){var i=n;n=r,r=i}var o=n.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)t(n);else{o<a&&(a=o),a>0&&(n.rShiftTo(a,n),r.rShiftTo(a,r));var l=function(){(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),n.compareTo(r)>=0?(n.subTo(r,n),n.rShiftTo(1,n)):(r.subTo(n,r),r.rShiftTo(1,r)),n.signum()>0?setTimeout(l,0):(a>0&&r.lShiftTo(a,r),setTimeout(function(){t(r)},0))};setTimeout(l,10)}},e.prototype.fromNumberAsync=function(t,n,r,i){if("number"==typeof n)if(t<2)this.fromInt(1);else{this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),Xx,this),this.isEven()&&this.dAddOffset(1,0);var o=this,a=function(){o.dAddOffset(2,0),o.bitLength()>t&&o.subTo(e.ONE.shiftLeft(t-1),o),o.isProbablePrime(n)?setTimeout(function(){i()},0):setTimeout(a,0)};setTimeout(a,0)}else{var l=[],s=7&t;l.length=1+(t>>3),n.nextBytes(l),s>0?l[0]&=(1<<s)-1:l[0]=0,this.fromString(l,256)}},e}(),gL=function(){function e(){}return e.prototype.convert=function(e){return e},e.prototype.revert=function(e){return e},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n)},e.prototype.sqrTo=function(e,t){e.squareTo(t)},e}(),vL=function(){function e(e){this.m=e}return e.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),AL=function(){function e(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}return e.prototype.convert=function(e){var t=wL();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(mL.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=wL();return e.copyTo(t),this.reduce(t),t},e.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=32767&e[t],r=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[n=t+this.m.t]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),yL=function(){function e(e){this.m=e,this.r2=wL(),this.q3=wL(),mL.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e)}return e.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=wL();return e.copyTo(t),this.reduce(t),t},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}();function wL(){return new mL(null)}function bL(e,t){return new mL(e,t)}var EL="undefined"!=typeof navigator;EL&&"Microsoft Internet Explorer"==navigator.appName?(mL.prototype.am=function(e,t,n,r,i,o){for(var a=32767&t,l=t>>15;--o>=0;){var s=32767&this[e],c=this[e++]>>15,d=l*s+c*a;i=((s=a*s+((32767&d)<<15)+n[r]+(1073741823&i))>>>30)+(d>>>15)+l*c+(i>>>30),n[r++]=1073741823&s}return i},dL=30):EL&&"Netscape"!=navigator.appName?(mL.prototype.am=function(e,t,n,r,i,o){for(;--o>=0;){var a=t*this[e++]+n[r]+i;i=Math.floor(a/67108864),n[r++]=67108863&a}return i},dL=26):(mL.prototype.am=function(e,t,n,r,i,o){for(var a=16383&t,l=t>>14;--o>=0;){var s=16383&this[e],c=this[e++]>>14,d=l*s+c*a;i=((s=a*s+((16383&d)<<14)+n[r]+i)>>28)+(d>>14)+l*c,n[r++]=268435455&s}return i},dL=28),mL.prototype.DB=dL,mL.prototype.DM=(1<<dL)-1,mL.prototype.DV=1<<dL;mL.prototype.FV=Math.pow(2,52),mL.prototype.F1=52-dL,mL.prototype.F2=2*dL-52;var ML,xL,LL=[];for(ML="0".charCodeAt(0),xL=0;xL<=9;++xL)LL[ML++]=xL;for(ML="a".charCodeAt(0),xL=10;xL<36;++xL)LL[ML++]=xL;for(ML="A".charCodeAt(0),xL=10;xL<36;++xL)LL[ML++]=xL;function HL(e,t){var n=LL[e.charCodeAt(t)];return null==n?-1:n}function kL(e){var t=wL();return t.fromInt(e),t}function VL(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}mL.ZERO=kL(0),mL.ONE=kL(1);var SL=function(){function e(){this.i=0,this.j=0,this.S=[]}return e.prototype.init=function(e){var t,n,r;for(t=0;t<256;++t)this.S[t]=t;for(n=0,t=0;t<256;++t)n=n+this.S[t]+e[t%e.length]&255,r=this.S[t],this.S[t]=this.S[n],this.S[n]=r;this.i=0,this.j=0},e.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]},e}();var zL,OL,NL=null;if(null==NL){NL=[],OL=0;var DL=void 0;if("undefined"!=typeof window&&self.crypto&&self.crypto.getRandomValues){var TL=new Uint32Array(256);for(self.crypto.getRandomValues(TL),DL=0;DL<TL.length;++DL)NL[OL++]=255&TL[DL]}var IL=0,ZL=function(e){if((IL=IL||0)>=256||OL>=256)self.removeEventListener?self.removeEventListener("mousemove",ZL,!1):self.detachEvent&&self.detachEvent("onmousemove",ZL);else try{var t=e.x+e.y;NL[OL++]=255&t,IL+=1}catch(e){}};"undefined"!=typeof window&&(self.addEventListener?self.addEventListener("mousemove",ZL,!1):self.attachEvent&&self.attachEvent("onmousemove",ZL))}function RL(){if(null==zL){for(zL=new SL;OL<256;){var e=Math.floor(65536*Math.random());NL[OL++]=255&e}for(zL.init(NL),OL=0;OL<NL.length;++OL)NL[OL]=0;OL=0}return zL.next()}var jL=function(){function e(){}return e.prototype.nextBytes=function(e){for(var t=0;t<e.length;++t)e[t]=RL()},e}();function BL(e){return function(e){for(var t="",n=0;n<32*e.length;n+=8)t+=String.fromCharCode(e[n>>5]>>>24-n%32&255);return t}(function(e,t){var n,r,i,o,a,l,s,c,d,u,f,h,C=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),p=new Array(64);for(e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t,d=0;d<e.length;d+=16){for(n=C[0],r=C[1],i=C[2],o=C[3],a=C[4],l=C[5],s=C[6],c=C[7],u=0;u<64;u++)p[u]=u<16?e[u+d]:KL(KL(KL(GL(p[u-2]),p[u-7]),QL(p[u-15])),p[u-16]),f=KL(KL(KL(KL(c,XL(a)),qL(a,l,s)),YL[u]),p[u]),h=KL(WL(n),UL(n,r,i)),c=s,s=l,l=a,a=KL(o,f),o=i,i=r,r=n,n=KL(f,h);C[0]=KL(n,C[0]),C[1]=KL(r,C[1]),C[2]=KL(i,C[2]),C[3]=KL(o,C[3]),C[4]=KL(a,C[4]),C[5]=KL(l,C[5]),C[6]=KL(s,C[6]),C[7]=KL(c,C[7])}return C}(function(e){for(var t=Array(e.length>>2),n=0;n<t.length;n++)t[n]=0;for(n=0;n<8*e.length;n+=8)t[n>>5]|=(255&e.charCodeAt(n/8))<<24-n%32;return t}(e),8*e.length))}function PL(e){for(var t="0123456789abcdef",n="",r=0;r<e.length;r++){var i=e.charCodeAt(r);n+=t.charAt(i>>>4&15)+t.charAt(15&i)}return n}function _L(e,t){return e>>>t|e<<32-t}function FL(e,t){return e>>>t}function qL(e,t,n){return e&t^~e&n}function UL(e,t,n){return e&t^e&n^t&n}function WL(e){return _L(e,2)^_L(e,13)^_L(e,22)}function XL(e){return _L(e,6)^_L(e,11)^_L(e,25)}function QL(e){return _L(e,7)^_L(e,18)^FL(e,3)}function GL(e){return _L(e,17)^_L(e,19)^FL(e,10)}var YL=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function KL(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function JL(e,t){if(t<e.length+11)return console.error("Message too long for RSA"),null;for(var n=[],r=e.length-1;r>=0&&t>0;){var i=e.charCodeAt(r--);i<128?n[--t]=i:i>127&&i<2048?(n[--t]=63&i|128,n[--t]=i>>6|192):(n[--t]=63&i|128,n[--t]=i>>6&63|128,n[--t]=i>>12|224)}n[--t]=0;for(var o=new jL,a=[];t>2;){for(a[0]=0;0==a[0];)o.nextBytes(a);n[--t]=a[0]}return n[--t]=2,n[--t]=0,new mL(n)}function $L(e,t,n){for(var r="",i=0;r.length<t;)r+=n(String.fromCharCode.apply(String,e.concat([(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i]))),i+=1;return r}function eH(e,t){var n=BL;if(e.length+64+2>t)throw"Message too long for RSA";var r,i="";for(r=0;r<t-e.length-64-2;r+=1)i+="\0";var o=n("")+i+""+e,a=new Array(32);(new jL).nextBytes(a);var l=$L(a,o.length,n),s=[];for(r=0;r<o.length;r+=1)s[r]=o.charCodeAt(r)^l.charCodeAt(r);var c=$L(s,a.length,n),d=[0];for(r=0;r<a.length;r+=1)d[r+1]=a[r]^c.charCodeAt(r);return new mL(d.concat(s))}var tH=function(){function e(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return e.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},e.prototype.doPrivate=function(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),n=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(n)<0;)t=t.add(this.p);return t.subtract(n).multiply(this.coeff).mod(this.p).multiply(this.q).add(n)},e.prototype.setPublic=function(e,t){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=bL(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")},e.prototype.encrypt=function(e,t){void 0===t&&(t=JL);var n=this.n.bitLength()+7>>3,r=t(e,n);if(null==r)return null;var i=this.doPublic(r);if(null==i)return null;for(var o=i.toString(16),a=o.length,l=0;l<2*n-a;l++)o="0"+o;return o},e.prototype.setPrivate=function(e,t,n){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=bL(e,16),this.e=parseInt(t,16),this.d=bL(n,16)):console.error("Invalid RSA private key")},e.prototype.setPrivateEx=function(e,t,n,r,i,o,a,l){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=bL(e,16),this.e=parseInt(t,16),this.d=bL(n,16),this.p=bL(r,16),this.q=bL(i,16),this.dmp1=bL(o,16),this.dmq1=bL(a,16),this.coeff=bL(l,16)):console.error("Invalid RSA private key")},e.prototype.generate=function(e,t){var n=new jL,r=e>>1;this.e=parseInt(t,16);for(var i=new mL(t,16);;){for(;this.p=new mL(e-r,1,n),0!=this.p.subtract(mL.ONE).gcd(i).compareTo(mL.ONE)||!this.p.isProbablePrime(10););for(;this.q=new mL(r,1,n),0!=this.q.subtract(mL.ONE).gcd(i).compareTo(mL.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var a=this.p.subtract(mL.ONE),l=this.q.subtract(mL.ONE),s=a.multiply(l);if(0==s.gcd(i).compareTo(mL.ONE)){this.n=this.p.multiply(this.q),this.d=i.modInverse(s),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(l),this.coeff=this.q.modInverse(this.p);break}}},e.prototype.decrypt=function(e){var t=bL(e,16),n=this.doPrivate(t);return null==n?null:function(e,t){var n=e.toByteArray(),r=0;for(;r<n.length&&0==n[r];)++r;if(n.length-r!=t-1||2!=n[r])return null;++r;for(;0!=n[r];)if(++r>=n.length)return null;var i="";for(;++r<n.length;){var o=255&n[r];o<128?i+=String.fromCharCode(o):o>191&&o<224?(i+=String.fromCharCode((31&o)<<6|63&n[r+1]),++r):(i+=String.fromCharCode((15&o)<<12|(63&n[r+1])<<6|63&n[r+2]),r+=2)}return i}(n,this.n.bitLength()+7>>3)},e.prototype.generateAsync=function(e,t,n){var r=new jL,i=e>>1;this.e=parseInt(t,16);var o=new mL(t,16),a=this,l=function(){var t=function(){if(a.p.compareTo(a.q)<=0){var e=a.p;a.p=a.q,a.q=e}var t=a.p.subtract(mL.ONE),r=a.q.subtract(mL.ONE),i=t.multiply(r);0==i.gcd(o).compareTo(mL.ONE)?(a.n=a.p.multiply(a.q),a.d=o.modInverse(i),a.dmp1=a.d.mod(t),a.dmq1=a.d.mod(r),a.coeff=a.q.modInverse(a.p),setTimeout(function(){n()},0)):setTimeout(l,0)},s=function(){a.q=wL(),a.q.fromNumberAsync(i,1,r,function(){a.q.subtract(mL.ONE).gcda(o,function(e){0==e.compareTo(mL.ONE)&&a.q.isProbablePrime(10)?setTimeout(t,0):setTimeout(s,0)})})},c=function(){a.p=wL(),a.p.fromNumberAsync(e-i,1,r,function(){a.p.subtract(mL.ONE).gcda(o,function(e){0==e.compareTo(mL.ONE)&&a.p.isProbablePrime(10)?setTimeout(s,0):setTimeout(c,0)})})};setTimeout(c,0)};setTimeout(l,0)},e.prototype.sign=function(e,t,n){var r=(nH[n]||"")+t(e).toString(),i=this.n.bitLength()/4,o=function(e,t){if(t<e.length+22)return console.error("Message too long for RSA"),null;for(var n=t-e.length-6,r="",i=0;i<n;i+=2)r+="ff";return bL("0001"+r+"00"+e,16)}(r,i);if(null==o)return null;var a=this.doPrivate(o);if(null==a)return null;for(var l=a.toString(16),s=l.length,c=0;c<i-s;c++)l="0"+l;return l},e.prototype.verify=function(e,t,n){var r=bL(t,16),i=this.doPublic(r);return null==i?null:function(e){for(var t in nH)if(nH.hasOwnProperty(t)){var n=nH[t],r=n.length;if(e.substring(0,r)==n)return e.substring(r)}return e}(i.toString(16).replace(/^1f+00/,""))==n(e).toString()},e}();var nH={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function rH(e,t,n){if(!t||!e)throw new Error("extend failed, please check that all dependencies are included.");var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t)}
29
29
  /**
30
30
  * @fileOverview
31
31
  * @name asn1-1.0.js